@frumu/tandem-panel 0.4.7 → 0.4.8

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.
@@ -0,0 +1,180 @@
1
+ var ke=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},mr={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},gr=class{#t=mr;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},ge=new gr;function yr(e){setTimeout(e,0)}var Re=typeof window>"u"||"Deno"in globalThis;function J(){}function br(e,t){return typeof e=="function"?e(t):e}function nn(e){return typeof e=="number"&&e>=0&&e!==1/0}function js(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ae(e,t){return typeof e=="function"?e(t):e}function H(e,t){return typeof e=="function"?e(t):e}function qn(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:r,queryKey:o,stale:a}=e;if(o){if(s){if(t.queryHash!==bn(o,t.options))return!1}else if(!Ye(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||r&&!r(t))}function Vn(e,t){const{exact:n,status:s,predicate:i,mutationKey:r}=e;if(r){if(!t.options.mutationKey)return!1;if(n){if(ve(t.options.mutationKey)!==ve(r))return!1}else if(!Ye(t.options.mutationKey,r))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function bn(e,t){return(t?.queryKeyHashFn||ve)(e)}function ve(e){return JSON.stringify(e,(t,n)=>sn(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Ye(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ye(e[n],t[n])):!1}var wr=Object.prototype.hasOwnProperty;function wn(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=Qn(e)&&Qn(t);if(!s&&!(sn(e)&&sn(t)))return t;const r=(s?e:Object.keys(e)).length,o=s?t:Object.keys(t),a=o.length,c=s?new Array(a):{};let u=0;for(let l=0;l<a;l++){const f=s?l:o[l],h=e[f],p=t[f];if(h===p){c[f]=h,(s?l<r:wr.call(e,f))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){c[f]=p;continue}const y=wn(h,p,n+1);c[f]=y,y===h&&u++}return r===a&&u===r?e:c}function Xe(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Qn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function sn(e){if(!Jn(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Jn(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Jn(e){return Object.prototype.toString.call(e)==="[object Object]"}function vr(e){return new Promise(t=>{ge.setTimeout(t,e)})}function rn(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?wn(e,t):t}function _r(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function kr(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var vn=Symbol();function Rs(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===vn?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ff(e,t){return typeof e=="function"?e(...t):!!e}function Sr(e,t,n){let s=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Or=class extends ke{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Re&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},_n=new Or;function on(){let e,t;const n=new Promise((i,r)=>{e=i,t=r});n.status="pending",n.catch(()=>{});function s(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{s({status:"fulfilled",value:i}),e(i)},n.reject=i=>{s({status:"rejected",reason:i}),t(i)},n}var $r=yr;function Er(){let e=[],t=0,n=a=>{a()},s=a=>{a()},i=$r;const r=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{s(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||o()}return c},batchCalls:a=>(...c)=>{r(()=>{a(...c)})},schedule:r,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{s=a},setScheduler:a=>{i=a}}}var F=Er(),Ar=class extends ke{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Re&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},vt=new Ar;function Nr(e){return Math.min(1e3*2**e,3e4)}function Ds(e){return(e??"online")==="online"?vt.isOnline():!0}var an=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Zs(e){let t=!1,n=0,s;const i=on(),r=()=>i.status!=="pending",o=d=>{if(!r()){const g=new an(d);h(g),e.onCancel?.(g)}},a=()=>{t=!0},c=()=>{t=!1},u=()=>_n.isFocused()&&(e.networkMode==="always"||vt.isOnline())&&e.canRun(),l=()=>Ds(e.networkMode)&&e.canRun(),f=d=>{r()||(s?.(),i.resolve(d))},h=d=>{r()||(s?.(),i.reject(d))},p=()=>new Promise(d=>{s=g=>{(r()||u())&&d(g)},e.onPause?.()}).then(()=>{s=void 0,r()||e.onContinue?.()}),y=()=>{if(r())return;let d;const g=n===0?e.initialPromise:void 0;try{d=g??e.fn()}catch(b){d=Promise.reject(b)}Promise.resolve(d).then(f).catch(b=>{if(r())return;const v=e.retry??(Re?0:3),_=e.retryDelay??Nr,k=typeof _=="function"?_(n,b):_,S=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,b);if(t||!S){h(b);return}n++,e.onFail?.(n,b),vr(k).then(()=>u()?void 0:p()).then(()=>{t?h(b):y()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(s?.(),i),cancelRetry:a,continueRetry:c,canStart:l,start:()=>(l()?y():p().then(y),i)}}var Fs=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nn(this.gcTime)&&(this.#t=ge.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Re?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ge.clearTimeout(this.#t),this.#t=void 0)}},Ir=class extends Fs{#t;#e;#n;#i;#s;#r;#a;constructor(e){super(),this.#a=!1,this.#r=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Gn(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#r,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Gn(this.options);t.data!==void 0&&(this.setState(Hn(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=rn(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(J).catch(J):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>H(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===vn||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ae(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!js(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#a?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,s=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const a=Rs(this.options,t),u=(()=>{const l={client:this.#i,queryKey:this.queryKey,meta:this.meta};return s(l),l})();return this.#a=!1,this.options.persister?this.options.persister(a,u,this):a(u)},o=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return s(a),a})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#o({type:"fetch",meta:o.fetchOptions?.meta}),this.#s=Zs({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:a=>{a instanceof an&&a.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(a,c)=>{this.#o({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const a=await this.#s.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof an){if(a.silent)return this.#s.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#o({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Us(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...Hn(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?s:void 0,s;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),F.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Us(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ds(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Hn(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Gn(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Tr=class extends ke{constructor(e,t){super(),this.options=t,this.#t=e,this.#o=null,this.#a=on(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#s;#r;#a;#o;#p;#f;#h;#u;#l;#c;#d=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Wn(this.#e,this.options)?this.#m():this.updateResult(),this.#w())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cn(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cn(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#_(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof H(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#k(),this.#e.setOptions(this.options),t._defaulted&&!Xe(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const s=this.hasListeners();s&&Yn(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),s&&(this.#e!==n||H(this.options.enabled,this.#e)!==H(t.enabled,this.#e)||ae(this.options.staleTime,this.#e)!==ae(t.staleTime,this.#e))&&this.#g();const i=this.#y();s&&(this.#e!==n||H(this.options.enabled,this.#e)!==H(t.enabled,this.#e)||i!==this.#c)&&this.#b(i)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return Cr(this,n)&&(this.#i=n,this.#r=this.options,this.#s=this.#e.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){this.#d.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#m(e){this.#k();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(J)),t}#g(){this.#v();const e=ae(this.options.staleTime,this.#e);if(Re||this.#i.isStale||!nn(e))return;const n=js(this.#i.dataUpdatedAt,e)+1;this.#u=ge.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#b(e){this.#_(),this.#c=e,!(Re||H(this.options.enabled,this.#e)===!1||!nn(this.#c)||this.#c===0)&&(this.#l=ge.setInterval(()=>{(this.options.refetchIntervalInBackground||_n.isFocused())&&this.#m()},this.#c))}#w(){this.#g(),this.#b(this.#y())}#v(){this.#u&&(ge.clearTimeout(this.#u),this.#u=void 0)}#_(){this.#l&&(ge.clearInterval(this.#l),this.#l=void 0)}createResult(e,t){const n=this.#e,s=this.options,i=this.#i,r=this.#s,o=this.#r,c=e!==n?e.state:this.#n,{state:u}=e;let l={...u},f=!1,h;if(t._optimisticResults){const w=this.hasListeners(),T=!w&&Wn(e,t),V=w&&Yn(e,n,t,s);(T||V)&&(l={...l,...Us(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:p,errorUpdatedAt:y,status:d}=l;h=l.data;let g=!1;if(t.placeholderData!==void 0&&h===void 0&&d==="pending"){let w;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(w=i.data,g=!0):w=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,w!==void 0&&(d="success",h=rn(i?.data,w,t),f=!0)}if(t.select&&h!==void 0&&!g)if(i&&h===r?.data&&t.select===this.#p)h=this.#f;else try{this.#p=t.select,h=t.select(h),h=rn(i?.data,h,t),this.#f=h,this.#o=null}catch(w){this.#o=w}this.#o&&(p=this.#o,h=this.#f,y=Date.now(),d="error");const b=l.fetchStatus==="fetching",v=d==="pending",_=d==="error",k=v&&b,S=h!==void 0,A={status:d,fetchStatus:l.fetchStatus,isPending:v,isSuccess:d==="success",isError:_,isInitialLoading:k,isLoading:k,data:h,dataUpdatedAt:l.dataUpdatedAt,error:p,errorUpdatedAt:y,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>c.dataUpdateCount||l.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!v,isLoadingError:_&&!S,isPaused:l.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:_&&S,isStale:kn(e,t),refetch:this.refetch,promise:this.#a,isEnabled:H(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const w=A.data!==void 0,T=A.status==="error"&&!w,V=me=>{T?me.reject(A.error):w&&me.resolve(A.data)},se=()=>{const me=this.#a=A.promise=on();V(me)},M=this.#a;switch(M.status){case"pending":e.queryHash===n.queryHash&&V(M);break;case"fulfilled":(T||A.data!==M.value)&&se();break;case"rejected":(!T||A.error!==M.reason)&&se();break}}return A}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#r=this.options,this.#s.data!==void 0&&(this.#h=this.#e),Xe(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!this.#d.size)return!0;const r=new Set(i??this.#d);return this.options.throwOnError&&r.add("error"),Object.keys(this.#i).some(o=>{const a=o;return this.#i[a]!==e[a]&&r.has(a)})};this.#S({listeners:n()})}#k(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#w()}#S(e){F.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Mr(e,t){return H(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Wn(e,t){return Mr(e,t)||e.state.data!==void 0&&cn(e,t,t.refetchOnMount)}function cn(e,t,n){if(H(t.enabled,e)!==!1&&ae(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&kn(e,t)}return!1}function Yn(e,t,n,s){return(e!==t||H(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&kn(e,n)}function kn(e,t){return H(t.enabled,e)!==!1&&e.isStaleByTime(ae(t.staleTime,e))}function Cr(e,t){return!Xe(e.getCurrentResult(),t)}function Xn(e){return{onFetch:(t,n)=>{const s=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,r=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let l=!1;const f=y=>{Sr(y,()=>t.signal,()=>l=!0)},h=Rs(t.options,t.fetchOptions),p=async(y,d,g)=>{if(l)return Promise.reject();if(d==null&&y.pages.length)return Promise.resolve(y);const v=(()=>{const $={client:t.client,queryKey:t.queryKey,pageParam:d,direction:g?"backward":"forward",meta:t.options.meta};return f($),$})(),_=await h(v),{maxPages:k}=t.options,S=g?kr:_r;return{pages:S(y.pages,_,k),pageParams:S(y.pageParams,d,k)}};if(i&&r.length){const y=i==="backward",d=y?Pr:es,g={pages:r,pageParams:o},b=d(s,g);a=await p(g,b,y)}else{const y=e??r.length;do{const d=c===0?o[0]??s.initialPageParam:es(s,a);if(c>0&&d==null)break;a=await p(a,d),c++}while(c<y)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function es(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function Pr(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var zr=class extends Fs{#t;#e;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||Ks(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#s({type:"continue"})},n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Zs({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#s({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",i=!this.#i.canStart();try{if(s)t();else{this.#s({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#s({type:"pending",context:o,variables:e,isPaused:i})}const r=await this.#i.start();return await this.#n.config.onSuccess?.(r,e,this.state.context,this,n),await this.options.onSuccess?.(r,e,this.state.context,n),await this.#n.config.onSettled?.(r,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(r,null,e,this.state.context,n),this.#s({type:"success",data:r}),r}catch(r){try{await this.#n.config.onError?.(r,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(r,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,r,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#s({type:"error",error:r}),r}finally{this.#n.runNext(this)}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),F.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Ks(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Lr=class extends ke{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,n){const s=new zr({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#t.add(e);const t=at(e);if(typeof t=="string"){const n=this.#e.get(t);n?n.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=at(e);if(typeof t=="string"){const n=this.#e.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=at(e);if(typeof t=="string"){const s=this.#e.get(t)?.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=at(e);return typeof t=="string"?this.#e.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){F.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Vn(t,n))}findAll(e={}){return this.getAll().filter(t=>Vn(e,t))}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return F.batch(()=>Promise.all(e.map(t=>t.continue().catch(J))))}};function at(e){return e.options.scope?.id}var Uf=class extends ke{#t;#e=void 0;#n;#i;constructor(e,t){super(),this.#t=e,this.setOptions(t),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#t.defaultMutationOptions(e),Xe(this.options,t)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&ve(t.mutationKey)!==ve(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#s(),this.#r(e)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#r()}mutate(e,t){return this.#i=t,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(e)}#s(){const e=this.#n?.state??Ks();this.#e={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#r(e){F.batch(()=>{if(this.#i&&this.hasListeners()){const t=this.#e.variables,n=this.#e.context,s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#i.onSuccess?.(e.data,t,n,s)}catch(i){Promise.reject(i)}try{this.#i.onSettled?.(e.data,null,t,n,s)}catch(i){Promise.reject(i)}}else if(e?.type==="error"){try{this.#i.onError?.(e.error,t,n,s)}catch(i){Promise.reject(i)}try{this.#i.onSettled?.(void 0,e.error,t,n,s)}catch(i){Promise.reject(i)}}}this.listeners.forEach(t=>{t(this.#e)})})}};function ts(e,t){const n=new Set(t);return e.filter(s=>!n.has(s))}function jr(e,t,n){const s=e.slice(0);return s[t]=n,s}var Kf=class extends ke{#t;#e;#n;#i;#s;#r;#a;#o;#p;#f=[];constructor(e,t,n){super(),this.#t=e,this.#i=n,this.#n=[],this.#s=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,F.batch(()=>{const n=this.#s,s=this.#l(this.#n);s.forEach(l=>l.observer.setOptions(l.defaultedQueryOptions));const i=s.map(l=>l.observer),r=i.map(l=>l.getCurrentResult()),o=n.length!==i.length,a=i.some((l,f)=>l!==n[f]),c=o||a,u=c?!0:r.some((l,f)=>{const h=this.#e[f];return!h||!Xe(l,h)});!c&&!u||(c&&(this.#f=s,this.#s=i),this.#e=r,this.hasListeners()&&(c&&(ts(n,i).forEach(l=>{l.destroy()}),ts(i,n).forEach(l=>{l.subscribe(f=>{this.#c(l,f)})})),this.#d()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){const n=this.#l(e),s=n.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions)),i=n.map(r=>r.defaultedQueryOptions.queryHash);return[s,r=>this.#u(r??s,t,i),()=>this.#h(s,n)]}#h(e,t){return t.map((n,s)=>{const i=e[s];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,r=>{t.forEach(o=>{o.observer.trackProp(r)})})})}#u(e,t,n){if(t){const s=this.#p,i=n!==void 0&&s!==void 0&&(s.length!==n.length||n.some((r,o)=>r!==s[o]));return(!this.#r||this.#e!==this.#o||i||t!==this.#a)&&(this.#a=t,this.#o=this.#e,n!==void 0&&(this.#p=n),this.#r=wn(this.#r,t(e))),this.#r}return e}#l(e){const t=new Map;this.#s.forEach(s=>{const i=s.options.queryHash;if(!i)return;const r=t.get(i);r?r.push(s):t.set(i,[s])});const n=[];return e.forEach(s=>{const i=this.#t.defaultQueryOptions(s),o=t.get(i.queryHash)?.shift()??new Tr(this.#t,i);n.push({defaultedQueryOptions:i,observer:o})}),n}#c(e,t){const n=this.#s.indexOf(e);n!==-1&&(this.#e=jr(this.#e,n,t),this.#d())}#d(){if(this.hasListeners()){const e=this.#r,t=this.#h(this.#e,this.#f),n=this.#u(t,this.#i?.combine);e!==n&&F.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}},Rr=class extends ke{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const s=t.queryKey,i=t.queryHash??bn(s,t);let r=this.get(i);return r||(r=new Ir({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(r)),r}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){F.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>qn(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>qn(e,n)):t}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){F.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){F.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Bf=class{#t;#e;#n;#i;#s;#r;#a;#o;constructor(e={}){this.#t=e.queryCache||new Rr,this.#e=e.mutationCache||new Lr,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#a=_n.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#o=vt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#t.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ae(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),r=this.#t.get(s.queryHash)?.state.data,o=br(t,r);if(o!==void 0)return this.#t.build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return F.batch(()=>this.#t.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;F.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return F.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=F.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(s).then(J).catch(J)}invalidateQueries(e,t={}){return F.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=F.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let r=i.fetch(void 0,n);return n.throwOnError||(r=r.catch(J)),i.state.fetchStatus==="paused"?Promise.resolve():r}));return Promise.all(s).then(J)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(ae(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(J).catch(J)}fetchInfiniteQuery(e){return e.behavior=Xn(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(J).catch(J)}ensureInfiniteQueryData(e){return e.behavior=Xn(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return vt.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(ve(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(s=>{Ye(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(ve(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{Ye(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=bn(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===vn&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}};function m(e,t,n){function s(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=o.prototype,l=Object.keys(u);for(let f=0;f<l.length;f++){const h=l[f];h in a||(a[h]=u[h].bind(a))}}const i=n?.Parent??Object;class r extends i{}Object.defineProperty(r,"name",{value:e});function o(a){var c;const u=n?.Parent?new r:this;s(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const l of u._zod.deferred)l();return u}return Object.defineProperty(o,"init",{value:s}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class ze extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Bs extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const xs={};function ue(e){return xs}function qs(e){const t=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,i])=>t.indexOf(+s)===-1).map(([s,i])=>i)}function un(e,t){return typeof t=="bigint"?t.toString():t}function Sn(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function On(e){return e==null}function $n(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Dr(e,t){const n=(e.toString().split(".")[1]||"").length,s=t.toString();let i=(s.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(s)){const c=s.match(/\d?e-(\d?)/);c?.[1]&&(i=Number.parseInt(c[1]))}const r=n>i?n:i,o=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return o%a/10**r}const ns=Symbol("evaluating");function N(e,t,n){let s;Object.defineProperty(e,t,{get(){if(s!==ns)return s===void 0&&(s=ns,s=n()),s},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Se(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function he(...e){const t={};for(const n of e){const s=Object.getOwnPropertyDescriptors(n);Object.assign(t,s)}return Object.defineProperties({},t)}function ss(e){return JSON.stringify(e)}function Zr(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Vs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Fr=Sn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function De(e){if(_t(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(_t(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Qs(e){return De(e)?{...e}:Array.isArray(e)?[...e]:e}const Ur=new Set(["string","number","symbol"]);function It(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function de(e,t,n){const s=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(s._zod.parent=e),s}function O(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new 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 Kr(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Br={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function xr(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const r=he(e._zod.def,{get shape(){const o={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=n.shape[a])}return Se(this,"shape",o),o},checks:[]});return de(e,r)}function qr(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const r=he(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete o[a]}return Se(this,"shape",o),o},checks:[]});return de(e,r)}function Vr(e,t){if(!De(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const r=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=he(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Se(this,"shape",r),r}});return de(e,i)}function Qr(e,t){if(!De(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=he(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Se(this,"shape",s),s}});return de(e,n)}function Jr(e,t){const n=he(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return Se(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return de(e,n)}function Hr(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=he(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return Se(this,"shape",c),c},checks:[]});return de(t,o)}function Gr(e,t,n){const s=he(t._zod.def,{get shape(){const i=t._zod.def.shape,r={...i};if(n)for(const o in n){if(!(o in r))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(r[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)r[o]=new e({type:"nonoptional",innerType:i[o]});return Se(this,"shape",r),r}});return de(t,s)}function Ne(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 Ie(e,t){return t.map(n=>{var s;return(s=n).path??(s.path=[]),n.path.unshift(e),n})}function ct(e){return typeof e=="string"?e:e?.message}function le(e,t,n){const s={...e,path:e.path??[]};if(!e.message){const i=ct(e.inst?._zod.def?.error?.(e))??ct(t?.error?.(e))??ct(n.customError?.(e))??ct(n.localeError?.(e))??"Invalid input";s.message=i}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function En(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function et(...e){const[t,n,s]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:s}:{...t}}const Js=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,un,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Hs=m("$ZodError",Js),Gs=m("$ZodError",Js,{Parent:Error});function Wr(e,t=n=>n.message){const n={},s=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):s.push(t(i));return{formErrors:s,fieldErrors:n}}function Yr(e,t=n=>n.message){const n={_errors:[]},s=i=>{for(const r of i.issues)if(r.code==="invalid_union"&&r.errors.length)r.errors.map(o=>s({issues:o}));else if(r.code==="invalid_key")s({issues:r.issues});else if(r.code==="invalid_element")s({issues:r.issues});else if(r.path.length===0)n._errors.push(t(r));else{let o=n,a=0;for(;a<r.path.length;){const c=r.path[a];a===r.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(r))):o[c]=o[c]||{_errors:[]},o=o[c],a++}}};return s(e),n}const An=e=>(t,n,s,i)=>{const r=s?Object.assign(s,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new ze;if(o.issues.length){const a=new(i?.Err??e)(o.issues.map(c=>le(c,r,ue())));throw Vs(a,i?.callee),a}return o.value},Nn=e=>async(t,n,s,i)=>{const r=s?Object.assign(s,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(i?.Err??e)(o.issues.map(c=>le(c,r,ue())));throw Vs(a,i?.callee),a}return o.value},Tt=e=>(t,n,s)=>{const i=s?{...s,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},i);if(r instanceof Promise)throw new ze;return r.issues.length?{success:!1,error:new(e??Hs)(r.issues.map(o=>le(o,i,ue())))}:{success:!0,data:r.value}},Xr=Tt(Gs),Mt=e=>async(t,n,s)=>{const i=s?Object.assign(s,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(o=>le(o,i,ue())))}:{success:!0,data:r.value}},eo=Mt(Gs),to=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return An(e)(t,n,i)},no=e=>(t,n,s)=>An(e)(t,n,s),so=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Nn(e)(t,n,i)},io=e=>async(t,n,s)=>Nn(e)(t,n,s),ro=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Tt(e)(t,n,i)},oo=e=>(t,n,s)=>Tt(e)(t,n,s),ao=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Mt(e)(t,n,i)},co=e=>async(t,n,s)=>Mt(e)(t,n,s),uo=/^[cC][^\s-]{8,}$/,lo=/^[0-9a-z]+$/,fo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ho=/^[0-9a-vA-V]{20}$/,po=/^[A-Za-z0-9]{27}$/,mo=/^[a-zA-Z0-9_-]{21}$/,go=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yo=/^([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})$/,is=e=>e?new 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)$/,bo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,wo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function vo(){return new RegExp(wo,"u")}const _o=/^(?:(?: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])$/,ko=/^(([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}|:))$/,So=/^((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])$/,Oo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$o=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ws=/^[A-Za-z0-9_-]*$/,Eo=/^\+[1-9]\d{6,14}$/,Ys="(?:(?:\\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])))",Ao=new RegExp(`^${Ys}$`);function Xs(e){const 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}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function No(e){return new RegExp(`^${Xs(e)}$`)}function Io(e){const t=Xs({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${t}(?:${n.join("|")})`;return new RegExp(`^${Ys}T(?:${s})$`)}const To=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Mo=/^-?\d+$/,ei=/^-?\d+(?:\.\d+)?$/,Co=/^(?:true|false)$/i,Po=/^[^A-Z]*$/,zo=/^[^a-z]*$/,q=m("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ti={number:"number",bigint:"bigint",object:"date"},ni=m("$ZodCheckLessThan",(e,t)=>{q.init(e,t);const n=ti[typeof t.value];e._zod.onattach.push(s=>{const i=s._zod.bag,r=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value<=t.value:s.value<t.value)||s.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),si=m("$ZodCheckGreaterThan",(e,t)=>{q.init(e,t);const n=ti[typeof t.value];e._zod.onattach.push(s=>{const i=s._zod.bag,r=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value>=t.value:s.value>t.value)||s.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Lo=m("$ZodCheckMultipleOf",(e,t)=>{q.init(e,t),e._zod.onattach.push(n=>{var s;(s=n._zod.bag).multipleOf??(s.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Dr(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})}}),jo=m("$ZodCheckNumberFormat",(e,t)=>{q.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),s=n?"int":"number",[i,r]=Br[t.format];e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,a.minimum=i,a.maximum=r,n&&(a.pattern=Mo)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:s,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort});return}}a<i&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>r&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Ro=m("$ZodCheckMaxLength",(e,t)=>{var n;q.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!On(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(s._zod.bag.maximum=t.maximum)}),e._zod.check=s=>{const i=s.value;if(i.length<=t.maximum)return;const o=En(i);s.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Do=m("$ZodCheckMinLength",(e,t)=>{var n;q.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!On(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(s._zod.bag.minimum=t.minimum)}),e._zod.check=s=>{const i=s.value;if(i.length>=t.minimum)return;const o=En(i);s.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Zo=m("$ZodCheckLengthEquals",(e,t)=>{var n;q.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!On(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=s=>{const i=s.value,r=i.length;if(r===t.length)return;const o=En(i),a=r>t.length;s.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!t.abort})}}),Ct=m("$ZodCheckStringFormat",(e,t)=>{var n,s;q.init(e,t),e._zod.onattach.push(i=>{const r=i._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(s=e._zod).check??(s.check=()=>{})}),Fo=m("$ZodCheckRegex",(e,t)=>{Ct.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})}}),Uo=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Po),Ct.init(e,t)}),Ko=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=zo),Ct.init(e,t)}),Bo=m("$ZodCheckIncludes",(e,t)=>{q.init(e,t);const n=It(t.includes),s=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=s,e._zod.onattach.push(i=>{const r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(s)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),xo=m("$ZodCheckStartsWith",(e,t)=>{q.init(e,t);const n=new RegExp(`^${It(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=s=>{s.value.startsWith(t.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:s.value,inst:e,continue:!t.abort})}}),qo=m("$ZodCheckEndsWith",(e,t)=>{q.init(e,t);const n=new RegExp(`.*${It(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=s=>{s.value.endsWith(t.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:s.value,inst:e,continue:!t.abort})}}),Vo=m("$ZodCheckOverwrite",(e,t)=>{q.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Qo{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const s=t.split(`
2
+ `).filter(o=>o),i=Math.min(...s.map(o=>o.length-o.trimStart().length)),r=s.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of r)this.content.push(o)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(r=>` ${r}`)];return new t(...n,i.join(`
3
+ `))}}const Jo={major:4,minor:3,patch:6},j=m("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Jo;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const i of s)for(const r of i._zod.onattach)r(e);if(s.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,a,c)=>{let u=Ne(o),l;for(const f of a){if(f._zod.def.when){if(!f._zod.def.when(o))continue}else if(u)continue;const h=o.issues.length,p=f._zod.check(o);if(p instanceof Promise&&c?.async===!1)throw new ze;if(l||p instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await p,o.issues.length!==h&&(u||(u=Ne(o,h)))});else{if(o.issues.length===h)continue;u||(u=Ne(o,h))}}return l?l.then(()=>o):o},r=(o,a,c)=>{if(Ne(o))return o.aborted=!0,o;const u=i(a,s,c);if(u instanceof Promise){if(c.async===!1)throw new ze;return u.then(l=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(o,a)=>{if(a.skipChecks)return e._zod.parse(o,a);if(a.direction==="backward"){const u=e._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>r(l,o,a)):r(u,o,a)}const c=e._zod.parse(o,a);if(c instanceof Promise){if(a.async===!1)throw new ze;return c.then(u=>i(u,s,a))}return i(c,s,a)}}N(e,"~standard",()=>({validate:i=>{try{const r=Xr(e,i);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return eo(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),In=m("$ZodString",(e,t)=>{j.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??To(e._zod.bag),e._zod.parse=(n,s)=>{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}}),P=m("$ZodStringFormat",(e,t)=>{Ct.init(e,t),In.init(e,t)}),Ho=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=yo),P.init(e,t)}),Go=m("$ZodUUID",(e,t)=>{if(t.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(s===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=is(s))}else t.pattern??(t.pattern=is());P.init(e,t)}),Wo=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=bo),P.init(e,t)}),Yo=m("$ZodURL",(e,t)=>{P.init(e,t),e._zod.check=n=>{try{const s=n.value.trim(),i=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Xo=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=vo()),P.init(e,t)}),ea=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=mo),P.init(e,t)}),ta=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=uo),P.init(e,t)}),na=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=lo),P.init(e,t)}),sa=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=fo),P.init(e,t)}),ia=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ho),P.init(e,t)}),ra=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=po),P.init(e,t)}),oa=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Io(t)),P.init(e,t)}),aa=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ao),P.init(e,t)}),ca=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=No(t)),P.init(e,t)}),ua=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=go),P.init(e,t)}),la=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=_o),P.init(e,t),e._zod.bag.format="ipv4"}),fa=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ko),P.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),ha=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=So),P.init(e,t)}),da=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Oo),P.init(e,t),e._zod.check=n=>{const s=n.value.split("/");try{if(s.length!==2)throw new Error;const[i,r]=s;if(!r)throw new Error;const o=Number(r);if(`${o}`!==r)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function ii(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const pa=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=$o),P.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{ii(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function ma(e){if(!Ws.test(e))return!1;const t=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return ii(n)}const ga=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ws),P.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{ma(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),ya=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Eo),P.init(e,t)});function ba(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[s]=n;if(!s)return!1;const i=JSON.parse(atob(s));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const wa=m("$ZodJWT",(e,t)=>{P.init(e,t),e._zod.check=n=>{ba(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),ri=m("$ZodNumber",(e,t)=>{j.init(e,t),e._zod.pattern=e._zod.bag.pattern??ei,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const r=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...r?{received:r}:{}}),n}}),va=m("$ZodNumberFormat",(e,t)=>{jo.init(e,t),ri.init(e,t)}),_a=m("$ZodBoolean",(e,t)=>{j.init(e,t),e._zod.pattern=Co,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),ka=m("$ZodAny",(e,t)=>{j.init(e,t),e._zod.parse=n=>n}),Sa=m("$ZodUnknown",(e,t)=>{j.init(e,t),e._zod.parse=n=>n}),Oa=m("$ZodNever",(e,t)=>{j.init(e,t),e._zod.parse=(n,s)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function rs(e,t,n){e.issues.length&&t.issues.push(...Ie(n,e.issues)),t.value[n]=e.value}const $a=m("$ZodArray",(e,t)=>{j.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const r=[];for(let o=0;o<i.length;o++){const a=i[o],c=t.element._zod.run({value:a,issues:[]},s);c instanceof Promise?r.push(c.then(u=>rs(u,n,o))):rs(c,n,o)}return r.length?Promise.all(r).then(()=>n):n}});function kt(e,t,n,s,i){if(e.issues.length){if(i&&!(n in s))return;t.issues.push(...Ie(n,e.issues))}e.value===void 0?n in s&&(t.value[n]=void 0):t.value[n]=e.value}function oi(e){const t=Object.keys(e.shape);for(const s of t)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const n=Kr(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ai(e,t,n,s,i,r){const o=[],a=i.keySet,c=i.catchall._zod,u=c.def.type,l=c.optout==="optional";for(const f in t){if(a.has(f))continue;if(u==="never"){o.push(f);continue}const h=c.run({value:t[f],issues:[]},s);h instanceof Promise?e.push(h.then(p=>kt(p,n,f,t,l))):kt(h,n,f,t,l)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:r}),e.length?Promise.all(e).then(()=>n):n}const Ea=m("$ZodObject",(e,t)=>{if(j.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const s=Sn(()=>oi(t));N(e._zod,"propValues",()=>{const a=t.shape,c={};for(const u in a){const l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(const f of l.values)c[u].add(f)}}return c});const i=_t,r=t.catchall;let o;e._zod.parse=(a,c)=>{o??(o=s.value);const u=a.value;if(!i(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const l=[],f=o.shape;for(const h of o.keys){const p=f[h],y=p._zod.optout==="optional",d=p._zod.run({value:u[h],issues:[]},c);d instanceof Promise?l.push(d.then(g=>kt(g,a,h,u,y))):kt(d,a,h,u,y)}return r?ai(l,u,a,c,s.value,e):l.length?Promise.all(l).then(()=>a):a}}),Aa=m("$ZodObjectJIT",(e,t)=>{Ea.init(e,t);const n=e._zod.parse,s=Sn(()=>oi(t)),i=h=>{const p=new Qo(["shape","payload","ctx"]),y=s.value,d=_=>{const k=ss(_);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};p.write("const input = payload.value;");const g=Object.create(null);let b=0;for(const _ of y.keys)g[_]=`key_${b++}`;p.write("const newResult = {};");for(const _ of y.keys){const k=g[_],S=ss(_),A=h[_]?._zod?.optout==="optional";p.write(`const ${k} = ${d(_)};`),A?p.write(`
4
+ if (${k}.issues.length) {
5
+ if (${S} in input) {
6
+ payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
7
+ ...iss,
8
+ path: iss.path ? [${S}, ...iss.path] : [${S}]
9
+ })));
10
+ }
11
+ }
12
+
13
+ if (${k}.value === undefined) {
14
+ if (${S} in input) {
15
+ newResult[${S}] = undefined;
16
+ }
17
+ } else {
18
+ newResult[${S}] = ${k}.value;
19
+ }
20
+
21
+ `):p.write(`
22
+ if (${k}.issues.length) {
23
+ payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
24
+ ...iss,
25
+ path: iss.path ? [${S}, ...iss.path] : [${S}]
26
+ })));
27
+ }
28
+
29
+ if (${k}.value === undefined) {
30
+ if (${S} in input) {
31
+ newResult[${S}] = undefined;
32
+ }
33
+ } else {
34
+ newResult[${S}] = ${k}.value;
35
+ }
36
+
37
+ `)}p.write("payload.value = newResult;"),p.write("return payload;");const v=p.compile();return(_,k)=>v(h,_,k)};let r;const o=_t,a=!xs.jitless,u=a&&Fr.value,l=t.catchall;let f;e._zod.parse=(h,p)=>{f??(f=s.value);const y=h.value;return o(y)?a&&u&&p?.async===!1&&p.jitless!==!0?(r||(r=i(t.shape)),h=r(h,p),l?ai([],y,h,p,f,e):h):n(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),h)}});function os(e,t,n,s){for(const r of e)if(r.issues.length===0)return t.value=r.value,t;const i=e.filter(r=>!Ne(r));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(r=>r.issues.map(o=>le(o,s,ue())))}),t)}const Na=m("$ZodUnion",(e,t)=>{j.init(e,t),N(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),N(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),N(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),N(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${i.map(r=>$n(r.source)).join("|")})$`)}});const n=t.options.length===1,s=t.options[0]._zod.run;e._zod.parse=(i,r)=>{if(n)return s(i,r);let o=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:i.value,issues:[]},r);if(u instanceof Promise)a.push(u),o=!0;else{if(u.issues.length===0)return u;a.push(u)}}return o?Promise.all(a).then(c=>os(c,i,e,r)):os(a,i,e,r)}}),Ia=m("$ZodIntersection",(e,t)=>{j.init(e,t),e._zod.parse=(n,s)=>{const i=n.value,r=t.left._zod.run({value:i,issues:[]},s),o=t.right._zod.run({value:i,issues:[]},s);return r instanceof Promise||o instanceof Promise?Promise.all([r,o]).then(([c,u])=>as(n,c,u)):as(n,r,o)}});function ln(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(De(e)&&De(t)){const n=Object.keys(t),s=Object.keys(e).filter(r=>n.indexOf(r)!==-1),i={...e,...t};for(const r of s){const o=ln(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};i[r]=o.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let s=0;s<e.length;s++){const i=e[s],r=t[s],o=ln(i,r);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function as(e,t,n){const s=new Map;let i;for(const a of t.issues)if(a.code==="unrecognized_keys"){i??(i=a);for(const c of a.keys)s.has(c)||s.set(c,{}),s.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)s.has(c)||s.set(c,{}),s.get(c).r=!0;else e.issues.push(a);const r=[...s].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(r.length&&i&&e.issues.push({...i,keys:r}),Ne(e))return e;const o=ln(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Ta=m("$ZodRecord",(e,t)=>{j.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!De(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const r=[],o=t.keyType._zod.values;if(o){n.value={};const a=new Set;for(const u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const l=t.valueType._zod.run({value:i[u],issues:[]},s);l instanceof Promise?r.push(l.then(f=>{f.issues.length&&n.issues.push(...Ie(u,f.issues)),n.value[u]=f.value})):(l.issues.length&&n.issues.push(...Ie(u,l.issues)),n.value[u]=l.value)}let c;for(const u in i)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c})}else{n.value={};for(const a of Reflect.ownKeys(i)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},s);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&ei.test(a)&&c.issues.length){const f=t.keyType._zod.run({value:Number(a),issues:[]},s);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(c=f)}if(c.issues.length){t.mode==="loose"?n.value[a]=i[a]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(f=>le(f,s,ue())),input:a,path:[a],inst:e});continue}const l=t.valueType._zod.run({value:i[a],issues:[]},s);l instanceof Promise?r.push(l.then(f=>{f.issues.length&&n.issues.push(...Ie(a,f.issues)),n.value[c.value]=f.value})):(l.issues.length&&n.issues.push(...Ie(a,l.issues)),n.value[c.value]=l.value)}}return r.length?Promise.all(r).then(()=>n):n}}),Ma=m("$ZodEnum",(e,t)=>{j.init(e,t);const n=qs(t.entries),s=new Set(n);e._zod.values=s,e._zod.pattern=new RegExp(`^(${n.filter(i=>Ur.has(typeof i)).map(i=>typeof i=="string"?It(i):i.toString()).join("|")})$`),e._zod.parse=(i,r)=>{const o=i.value;return s.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:e}),i}}),Ca=m("$ZodTransform",(e,t)=>{j.init(e,t),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new Bs(e.constructor.name);const i=t.transform(n.value,n);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n));if(i instanceof Promise)throw new ze;return n.value=i,n}});function cs(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ci=m("$ZodOptional",(e,t)=>{j.init(e,t),e._zod.optin="optional",e._zod.optout="optional",N(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),N(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${$n(n.source)})?$`):void 0}),e._zod.parse=(n,s)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(r=>cs(r,n.value)):cs(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,s)}}),Pa=m("$ZodExactOptional",(e,t)=>{ci.init(e,t),N(e._zod,"values",()=>t.innerType._zod.values),N(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,s)=>t.innerType._zod.run(n,s)}),za=m("$ZodNullable",(e,t)=>{j.init(e,t),N(e._zod,"optin",()=>t.innerType._zod.optin),N(e._zod,"optout",()=>t.innerType._zod.optout),N(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${$n(n.source)}|null)$`):void 0}),N(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,s)=>n.value===null?n:t.innerType._zod.run(n,s)}),La=m("$ZodDefault",(e,t)=>{j.init(e,t),e._zod.optin="optional",N(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(r=>us(r,t)):us(i,t)}});function us(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ja=m("$ZodPrefault",(e,t)=>{j.init(e,t),e._zod.optin="optional",N(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>(s.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,s))}),Ra=m("$ZodNonOptional",(e,t)=>{j.init(e,t),N(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(s=>s!==void 0)):void 0}),e._zod.parse=(n,s)=>{const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(r=>ls(r,e)):ls(i,e)}});function ls(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Da=m("$ZodCatch",(e,t)=>{j.init(e,t),N(e._zod,"optin",()=>t.innerType._zod.optin),N(e._zod,"optout",()=>t.innerType._zod.optout),N(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(r=>(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(o=>le(o,s,ue()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(r=>le(r,s,ue()))},input:n.value}),n.issues=[]),n)}}),Za=m("$ZodPipe",(e,t)=>{j.init(e,t),N(e._zod,"values",()=>t.in._zod.values),N(e._zod,"optin",()=>t.in._zod.optin),N(e._zod,"optout",()=>t.out._zod.optout),N(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,s)=>{if(s.direction==="backward"){const r=t.out._zod.run(n,s);return r instanceof Promise?r.then(o=>ut(o,t.in,s)):ut(r,t.in,s)}const i=t.in._zod.run(n,s);return i instanceof Promise?i.then(r=>ut(r,t.out,s)):ut(i,t.out,s)}});function ut(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Fa=m("$ZodReadonly",(e,t)=>{j.init(e,t),N(e._zod,"propValues",()=>t.innerType._zod.propValues),N(e._zod,"values",()=>t.innerType._zod.values),N(e._zod,"optin",()=>t.innerType?._zod?.optin),N(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(fs):fs(i)}});function fs(e){return e.value=Object.freeze(e.value),e}const Ua=m("$ZodCustom",(e,t)=>{q.init(e,t),j.init(e,t),e._zod.parse=(n,s)=>n,e._zod.check=n=>{const s=n.value,i=t.fn(s);if(i instanceof Promise)return i.then(r=>hs(r,n,s,e));hs(i,n,s,e)}});function hs(e,t,n,s){if(!e){const i={code:"custom",input:n,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(i.params=s._zod.def.params),t.issues.push(et(i))}}var ds;class Ka{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const s=n[0];return this._map.set(t,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const s={...this.get(n)??{}};delete s.id;const i={...s,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Ba(){return new Ka}(ds=globalThis).__zod_globalRegistry??(ds.__zod_globalRegistry=Ba());const He=globalThis.__zod_globalRegistry;function xa(e,t){return new e({type:"string",...O(t)})}function qa(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...O(t)})}function ps(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...O(t)})}function Va(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...O(t)})}function Qa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...O(t)})}function Ja(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...O(t)})}function Ha(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...O(t)})}function Ga(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...O(t)})}function Wa(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...O(t)})}function Ya(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...O(t)})}function Xa(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...O(t)})}function ec(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...O(t)})}function tc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...O(t)})}function nc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...O(t)})}function sc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...O(t)})}function ic(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...O(t)})}function rc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...O(t)})}function oc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...O(t)})}function ac(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...O(t)})}function cc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...O(t)})}function uc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...O(t)})}function lc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...O(t)})}function fc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...O(t)})}function hc(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...O(t)})}function dc(e,t){return new e({type:"string",format:"date",check:"string_format",...O(t)})}function pc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...O(t)})}function mc(e,t){return new e({type:"string",format:"duration",check:"string_format",...O(t)})}function gc(e,t){return new e({type:"number",checks:[],...O(t)})}function yc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...O(t)})}function bc(e,t){return new e({type:"boolean",...O(t)})}function wc(e){return new e({type:"any"})}function vc(e){return new e({type:"unknown"})}function _c(e,t){return new e({type:"never",...O(t)})}function ms(e,t){return new ni({check:"less_than",...O(t),value:e,inclusive:!1})}function Qt(e,t){return new ni({check:"less_than",...O(t),value:e,inclusive:!0})}function gs(e,t){return new si({check:"greater_than",...O(t),value:e,inclusive:!1})}function Jt(e,t){return new si({check:"greater_than",...O(t),value:e,inclusive:!0})}function ys(e,t){return new Lo({check:"multiple_of",...O(t),value:e})}function ui(e,t){return new Ro({check:"max_length",...O(t),maximum:e})}function St(e,t){return new Do({check:"min_length",...O(t),minimum:e})}function li(e,t){return new Zo({check:"length_equals",...O(t),length:e})}function kc(e,t){return new Fo({check:"string_format",format:"regex",...O(t),pattern:e})}function Sc(e){return new Uo({check:"string_format",format:"lowercase",...O(e)})}function Oc(e){return new Ko({check:"string_format",format:"uppercase",...O(e)})}function $c(e,t){return new Bo({check:"string_format",format:"includes",...O(t),includes:e})}function Ec(e,t){return new xo({check:"string_format",format:"starts_with",...O(t),prefix:e})}function Ac(e,t){return new qo({check:"string_format",format:"ends_with",...O(t),suffix:e})}function Ue(e){return new Vo({check:"overwrite",tx:e})}function Nc(e){return Ue(t=>t.normalize(e))}function Ic(){return Ue(e=>e.trim())}function Tc(){return Ue(e=>e.toLowerCase())}function Mc(){return Ue(e=>e.toUpperCase())}function Cc(){return Ue(e=>Zr(e))}function Pc(e,t,n){return new e({type:"array",element:t,...O(n)})}function zc(e,t,n){return new e({type:"custom",check:"custom",fn:t,...O(n)})}function Lc(e){const t=jc(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(et(s,n.value,t._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(et(i))}},e(n.value,n)));return t}function jc(e,t){const n=new q({check:"custom",...O(t)});return n._zod.check=e,n}function fi(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??He,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Z(e,t,n={path:[],schemaPath:[]}){var s;const i=e._zod.def,r=t.seen.get(e);if(r)return r.count++,n.schemaPath.includes(e)&&(r.cycle=n.path),r.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const l={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,l);else{const h=o.schema,p=t.processors[i.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);p(e,t,h,l)}const f=e._zod.parent;f&&(o.ref||(o.ref=f),Z(f,t,l),t.seen.get(f).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io==="input"&&K(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((s=o.schema).default??(s.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function hi(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=new Map;for(const o of e.seen.entries()){const a=e.metadataRegistry.get(o[0])?.id;if(a){const c=s.get(a);if(c&&c!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(a,o[0])}}const i=o=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const f=e.external.registry.get(o[0])?.id,h=e.external.uri??(y=>y);if(f)return{ref:h(f)};const p=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=p,{defId:p,ref:`${h("__shared")}#/${a}/${p}`}}if(o[1]===n)return{ref:"#"};const u=`#/${a}/`,l=o[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},r=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:c,defId:u}=i(o);a.def={...a.schema},u&&(a.defId=u);const l=a.schema;for(const f in l)delete l[f];l.$ref=c};if(e.cycles==="throw")for(const o of e.seen.entries()){const a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
38
+
39
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const a=o[1];if(t===o[0]){r(o);continue}if(e.external){const u=e.external.registry.get(o[0])?.id;if(t!==o[0]&&u){r(o);continue}}if(e.metadataRegistry.get(o[0])?.id){r(o);continue}if(a.cycle){r(o);continue}if(a.count>1&&e.reused==="ref"){r(o);continue}}}function di(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=o=>{const a=e.seen.get(o);if(a.ref===null)return;const c=a.def??a.schema,u={...c},l=a.ref;if(a.ref=null,l){s(l);const h=e.seen.get(l),p=h.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(p)):Object.assign(c,p),Object.assign(c,u),o._zod.parent===l)for(const d in c)d==="$ref"||d==="allOf"||d in u||delete c[d];if(p.$ref&&h.def)for(const d in c)d==="$ref"||d==="allOf"||d in h.def&&JSON.stringify(c[d])===JSON.stringify(h.def[d])&&delete c[d]}const f=o._zod.parent;if(f&&f!==l){s(f);const h=e.seen.get(f);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(const p in c)p==="$ref"||p==="allOf"||p in h.def&&JSON.stringify(c[p])===JSON.stringify(h.def[p])&&delete c[p]}e.override({zodSchema:o,jsonSchema:c,path:a.path??[]})};for(const o of[...e.seen.entries()].reverse())s(o[0]);const 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){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(o)}Object.assign(i,n.def??n.schema);const r=e.external?.defs??{};for(const o of e.seen.entries()){const a=o[1];a.def&&a.defId&&(r[a.defId]=a.def)}e.external||Object.keys(r).length>0&&(e.target==="draft-2020-12"?i.$defs=r:i.definitions=r);try{const o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ot(t,"input",e.processors),output:Ot(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function K(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const s=e._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return K(s.element,n);if(s.type==="set")return K(s.valueType,n);if(s.type==="lazy")return K(s.getter(),n);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return K(s.innerType,n);if(s.type==="intersection")return K(s.left,n)||K(s.right,n);if(s.type==="record"||s.type==="map")return K(s.keyType,n)||K(s.valueType,n);if(s.type==="pipe")return K(s.in,n)||K(s.out,n);if(s.type==="object"){for(const i in s.shape)if(K(s.shape[i],n))return!0;return!1}if(s.type==="union"){for(const i of s.options)if(K(i,n))return!0;return!1}if(s.type==="tuple"){for(const i of s.items)if(K(i,n))return!0;return!!(s.rest&&K(s.rest,n))}return!1}const Rc=(e,t={})=>n=>{const s=fi({...n,processors:t});return Z(e,s),hi(s,e),di(s,e)},Ot=(e,t,n={})=>s=>{const{libraryOptions:i,target:r}=s??{},o=fi({...i??{},target:r,io:t,processors:n});return Z(e,o),hi(o,e),di(o,e)},Dc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zc=(e,t,n,s)=>{const i=n;i.type="string";const{minimum:r,maximum:o,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof r=="number"&&(i.minLength=r),typeof o=="number"&&(i.maxLength=o),a&&(i.format=Dc[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){const l=[...c];l.length===1?i.pattern=l[0].source:l.length>1&&(i.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},Fc=(e,t,n,s)=>{const i=n,{minimum:r,maximum:o,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number",typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l),typeof r=="number"&&(i.minimum=r,typeof l=="number"&&t.target!=="draft-04"&&(l>=r?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof o=="number"&&(i.maximum=o,typeof u=="number"&&t.target!=="draft-04"&&(u<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},Uc=(e,t,n,s)=>{n.type="boolean"},Kc=(e,t,n,s)=>{n.not={}},Bc=(e,t,n,s)=>{},xc=(e,t,n,s)=>{},qc=(e,t,n,s)=>{const i=e._zod.def,r=qs(i.entries);r.every(o=>typeof o=="number")&&(n.type="number"),r.every(o=>typeof o=="string")&&(n.type="string"),n.enum=r},Vc=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Qc=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Jc=(e,t,n,s)=>{const i=n,r=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;typeof o=="number"&&(i.minItems=o),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=Z(r.element,t,{...s,path:[...s.path,"items"]})},Hc=(e,t,n,s)=>{const i=n,r=e._zod.def;i.type="object",i.properties={};const o=r.shape;for(const u in o)i.properties[u]=Z(o[u],t,{...s,path:[...s.path,"properties",u]});const a=new Set(Object.keys(o)),c=new Set([...a].filter(u=>{const l=r.shape[u]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(i.required=Array.from(c)),r.catchall?._zod.def.type==="never"?i.additionalProperties=!1:r.catchall?r.catchall&&(i.additionalProperties=Z(r.catchall,t,{...s,path:[...s.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},Gc=(e,t,n,s)=>{const i=e._zod.def,r=i.inclusive===!1,o=i.options.map((a,c)=>Z(a,t,{...s,path:[...s.path,r?"oneOf":"anyOf",c]}));r?n.oneOf=o:n.anyOf=o},Wc=(e,t,n,s)=>{const i=e._zod.def,r=Z(i.left,t,{...s,path:[...s.path,"allOf",0]}),o=Z(i.right,t,{...s,path:[...s.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(r)?r.allOf:[r],...a(o)?o.allOf:[o]];n.allOf=c},Yc=(e,t,n,s)=>{const i=n,r=e._zod.def;i.type="object";const o=r.keyType,c=o._zod.bag?.patterns;if(r.mode==="loose"&&c&&c.size>0){const l=Z(r.valueType,t,{...s,path:[...s.path,"patternProperties","*"]});i.patternProperties={};for(const f of c)i.patternProperties[f.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Z(r.keyType,t,{...s,path:[...s.path,"propertyNames"]})),i.additionalProperties=Z(r.valueType,t,{...s,path:[...s.path,"additionalProperties"]});const u=o._zod.values;if(u){const l=[...u].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(i.required=l)}},Xc=(e,t,n,s)=>{const i=e._zod.def,r=Z(i.innerType,t,s),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[r,{type:"null"}]},eu=(e,t,n,s)=>{const i=e._zod.def;Z(i.innerType,t,s);const r=t.seen.get(e);r.ref=i.innerType},tu=(e,t,n,s)=>{const i=e._zod.def;Z(i.innerType,t,s);const r=t.seen.get(e);r.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},nu=(e,t,n,s)=>{const i=e._zod.def;Z(i.innerType,t,s);const r=t.seen.get(e);r.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},su=(e,t,n,s)=>{const i=e._zod.def;Z(i.innerType,t,s);const r=t.seen.get(e);r.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},iu=(e,t,n,s)=>{const i=e._zod.def,r=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Z(r,t,s);const o=t.seen.get(e);o.ref=r},ru=(e,t,n,s)=>{const i=e._zod.def;Z(i.innerType,t,s);const r=t.seen.get(e);r.ref=i.innerType,n.readOnly=!0},pi=(e,t,n,s)=>{const i=e._zod.def;Z(i.innerType,t,s);const r=t.seen.get(e);r.ref=i.innerType},ou=m("ZodISODateTime",(e,t)=>{oa.init(e,t),D.init(e,t)});function au(e){return hc(ou,e)}const cu=m("ZodISODate",(e,t)=>{aa.init(e,t),D.init(e,t)});function uu(e){return dc(cu,e)}const lu=m("ZodISOTime",(e,t)=>{ca.init(e,t),D.init(e,t)});function fu(e){return pc(lu,e)}const hu=m("ZodISODuration",(e,t)=>{ua.init(e,t),D.init(e,t)});function du(e){return mc(hu,e)}const pu=(e,t)=>{Hs.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Yr(e,n)},flatten:{value:n=>Wr(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,un,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,un,2)}},isEmpty:{get(){return e.issues.length===0}}})},Y=m("ZodError",pu,{Parent:Error}),mu=An(Y),gu=Nn(Y),yu=Tt(Y),bu=Mt(Y),wu=to(Y),vu=no(Y),_u=so(Y),ku=io(Y),Su=ro(Y),Ou=oo(Y),$u=ao(Y),Eu=co(Y),R=m("ZodType",(e,t)=>(j.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ot(e,"input"),output:Ot(e,"output")}}),e.toJSONSchema=Rc(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(he(t,{checks:[...t.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0}),e.with=e.check,e.clone=(n,s)=>de(e,n,s),e.brand=()=>e,e.register=((n,s)=>(n.add(e,s),e)),e.parse=(n,s)=>mu(e,n,s,{callee:e.parse}),e.safeParse=(n,s)=>yu(e,n,s),e.parseAsync=async(n,s)=>gu(e,n,s,{callee:e.parseAsync}),e.safeParseAsync=async(n,s)=>bu(e,n,s),e.spa=e.safeParseAsync,e.encode=(n,s)=>wu(e,n,s),e.decode=(n,s)=>vu(e,n,s),e.encodeAsync=async(n,s)=>_u(e,n,s),e.decodeAsync=async(n,s)=>ku(e,n,s),e.safeEncode=(n,s)=>Su(e,n,s),e.safeDecode=(n,s)=>Ou(e,n,s),e.safeEncodeAsync=async(n,s)=>$u(e,n,s),e.safeDecodeAsync=async(n,s)=>Eu(e,n,s),e.refine=(n,s)=>e.check(kl(n,s)),e.superRefine=n=>e.check(Sl(n)),e.overwrite=n=>e.check(Ue(n)),e.optional=()=>_s(e),e.exactOptional=()=>ul(e),e.nullable=()=>ks(e),e.nullish=()=>_s(ks(e)),e.nonoptional=n=>ml(e,n),e.array=()=>Yu(e),e.or=n=>tl([e,n]),e.and=n=>sl(e,n),e.transform=n=>Ss(e,al(n)),e.default=n=>hl(e,n),e.prefault=n=>pl(e,n),e.catch=n=>yl(e,n),e.pipe=n=>Ss(e,n),e.readonly=()=>vl(e),e.describe=n=>{const s=e.clone();return He.add(s,{description:n}),s},Object.defineProperty(e,"description",{get(){return He.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return He.get(e);const s=e.clone();return He.add(s,n[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),mi=m("_ZodString",(e,t)=>{In.init(e,t),R.init(e,t),e._zod.processJSONSchema=(s,i,r)=>Zc(e,s,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...s)=>e.check(kc(...s)),e.includes=(...s)=>e.check($c(...s)),e.startsWith=(...s)=>e.check(Ec(...s)),e.endsWith=(...s)=>e.check(Ac(...s)),e.min=(...s)=>e.check(St(...s)),e.max=(...s)=>e.check(ui(...s)),e.length=(...s)=>e.check(li(...s)),e.nonempty=(...s)=>e.check(St(1,...s)),e.lowercase=s=>e.check(Sc(s)),e.uppercase=s=>e.check(Oc(s)),e.trim=()=>e.check(Ic()),e.normalize=(...s)=>e.check(Nc(...s)),e.toLowerCase=()=>e.check(Tc()),e.toUpperCase=()=>e.check(Mc()),e.slugify=()=>e.check(Cc())}),Au=m("ZodString",(e,t)=>{In.init(e,t),mi.init(e,t),e.email=n=>e.check(qa(Nu,n)),e.url=n=>e.check(Ga(Iu,n)),e.jwt=n=>e.check(fc(xu,n)),e.emoji=n=>e.check(Wa(Tu,n)),e.guid=n=>e.check(ps(bs,n)),e.uuid=n=>e.check(Va(lt,n)),e.uuidv4=n=>e.check(Qa(lt,n)),e.uuidv6=n=>e.check(Ja(lt,n)),e.uuidv7=n=>e.check(Ha(lt,n)),e.nanoid=n=>e.check(Ya(Mu,n)),e.guid=n=>e.check(ps(bs,n)),e.cuid=n=>e.check(Xa(Cu,n)),e.cuid2=n=>e.check(ec(Pu,n)),e.ulid=n=>e.check(tc(zu,n)),e.base64=n=>e.check(cc(Uu,n)),e.base64url=n=>e.check(uc(Ku,n)),e.xid=n=>e.check(nc(Lu,n)),e.ksuid=n=>e.check(sc(ju,n)),e.ipv4=n=>e.check(ic(Ru,n)),e.ipv6=n=>e.check(rc(Du,n)),e.cidrv4=n=>e.check(oc(Zu,n)),e.cidrv6=n=>e.check(ac(Fu,n)),e.e164=n=>e.check(lc(Bu,n)),e.datetime=n=>e.check(au(n)),e.date=n=>e.check(uu(n)),e.time=n=>e.check(fu(n)),e.duration=n=>e.check(du(n))});function xf(e){return xa(Au,e)}const D=m("ZodStringFormat",(e,t)=>{P.init(e,t),mi.init(e,t)}),Nu=m("ZodEmail",(e,t)=>{Wo.init(e,t),D.init(e,t)}),bs=m("ZodGUID",(e,t)=>{Ho.init(e,t),D.init(e,t)}),lt=m("ZodUUID",(e,t)=>{Go.init(e,t),D.init(e,t)}),Iu=m("ZodURL",(e,t)=>{Yo.init(e,t),D.init(e,t)}),Tu=m("ZodEmoji",(e,t)=>{Xo.init(e,t),D.init(e,t)}),Mu=m("ZodNanoID",(e,t)=>{ea.init(e,t),D.init(e,t)}),Cu=m("ZodCUID",(e,t)=>{ta.init(e,t),D.init(e,t)}),Pu=m("ZodCUID2",(e,t)=>{na.init(e,t),D.init(e,t)}),zu=m("ZodULID",(e,t)=>{sa.init(e,t),D.init(e,t)}),Lu=m("ZodXID",(e,t)=>{ia.init(e,t),D.init(e,t)}),ju=m("ZodKSUID",(e,t)=>{ra.init(e,t),D.init(e,t)}),Ru=m("ZodIPv4",(e,t)=>{la.init(e,t),D.init(e,t)}),Du=m("ZodIPv6",(e,t)=>{fa.init(e,t),D.init(e,t)}),Zu=m("ZodCIDRv4",(e,t)=>{ha.init(e,t),D.init(e,t)}),Fu=m("ZodCIDRv6",(e,t)=>{da.init(e,t),D.init(e,t)}),Uu=m("ZodBase64",(e,t)=>{pa.init(e,t),D.init(e,t)}),Ku=m("ZodBase64URL",(e,t)=>{ga.init(e,t),D.init(e,t)}),Bu=m("ZodE164",(e,t)=>{ya.init(e,t),D.init(e,t)}),xu=m("ZodJWT",(e,t)=>{wa.init(e,t),D.init(e,t)}),gi=m("ZodNumber",(e,t)=>{ri.init(e,t),R.init(e,t),e._zod.processJSONSchema=(s,i,r)=>Fc(e,s,i),e.gt=(s,i)=>e.check(gs(s,i)),e.gte=(s,i)=>e.check(Jt(s,i)),e.min=(s,i)=>e.check(Jt(s,i)),e.lt=(s,i)=>e.check(ms(s,i)),e.lte=(s,i)=>e.check(Qt(s,i)),e.max=(s,i)=>e.check(Qt(s,i)),e.int=s=>e.check(ws(s)),e.safe=s=>e.check(ws(s)),e.positive=s=>e.check(gs(0,s)),e.nonnegative=s=>e.check(Jt(0,s)),e.negative=s=>e.check(ms(0,s)),e.nonpositive=s=>e.check(Qt(0,s)),e.multipleOf=(s,i)=>e.check(ys(s,i)),e.step=(s,i)=>e.check(ys(s,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function qf(e){return gc(gi,e)}const qu=m("ZodNumberFormat",(e,t)=>{va.init(e,t),gi.init(e,t)});function ws(e){return yc(qu,e)}const Vu=m("ZodBoolean",(e,t)=>{_a.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Uc(e,n,s)});function Vf(e){return bc(Vu,e)}const Qu=m("ZodAny",(e,t)=>{ka.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Bc()});function Qf(){return wc(Qu)}const Ju=m("ZodUnknown",(e,t)=>{Sa.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>xc()});function vs(){return vc(Ju)}const Hu=m("ZodNever",(e,t)=>{Oa.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Kc(e,n,s)});function Gu(e){return _c(Hu,e)}const Wu=m("ZodArray",(e,t)=>{$a.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Jc(e,n,s,i),e.element=t.element,e.min=(n,s)=>e.check(St(n,s)),e.nonempty=n=>e.check(St(1,n)),e.max=(n,s)=>e.check(ui(n,s)),e.length=(n,s)=>e.check(li(n,s)),e.unwrap=()=>e.element});function Yu(e,t){return Pc(Wu,e,t)}const Xu=m("ZodObject",(e,t)=>{Aa.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Hc(e,n,s,i),N(e,"shape",()=>t.shape),e.keyof=()=>rl(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:vs()}),e.loose=()=>e.clone({...e._zod.def,catchall:vs()}),e.strict=()=>e.clone({...e._zod.def,catchall:Gu()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Vr(e,n),e.safeExtend=n=>Qr(e,n),e.merge=n=>Jr(e,n),e.pick=n=>xr(e,n),e.omit=n=>qr(e,n),e.partial=(...n)=>Hr(yi,e,n[0]),e.required=(...n)=>Gr(bi,e,n[0])});function Jf(e,t){const n={type:"object",shape:e??{},...O(t)};return new Xu(n)}const el=m("ZodUnion",(e,t)=>{Na.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Gc(e,n,s,i),e.options=t.options});function tl(e,t){return new el({type:"union",options:e,...O(t)})}const nl=m("ZodIntersection",(e,t)=>{Ia.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Wc(e,n,s,i)});function sl(e,t){return new nl({type:"intersection",left:e,right:t})}const il=m("ZodRecord",(e,t)=>{Ta.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Yc(e,n,s,i),e.keyType=t.keyType,e.valueType=t.valueType});function Hf(e,t,n){return new il({type:"record",keyType:e,valueType:t,...O(n)})}const fn=m("ZodEnum",(e,t)=>{Ma.init(e,t),R.init(e,t),e._zod.processJSONSchema=(s,i,r)=>qc(e,s,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(s,i)=>{const r={};for(const o of s)if(n.has(o))r[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new fn({...t,checks:[],...O(i),entries:r})},e.exclude=(s,i)=>{const r={...t.entries};for(const o of s)if(n.has(o))delete r[o];else throw new Error(`Key ${o} not found in enum`);return new fn({...t,checks:[],...O(i),entries:r})}});function rl(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new fn({type:"enum",entries:n,...O(t)})}const ol=m("ZodTransform",(e,t)=>{Ca.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Qc(e,n),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new Bs(e.constructor.name);n.addIssue=r=>{if(typeof r=="string")n.issues.push(et(r,n.value,t));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(et(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(r=>(n.value=r,n)):(n.value=i,n)}});function al(e){return new ol({type:"transform",transform:e})}const yi=m("ZodOptional",(e,t)=>{ci.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>pi(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function _s(e){return new yi({type:"optional",innerType:e})}const cl=m("ZodExactOptional",(e,t)=>{Pa.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>pi(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function ul(e){return new cl({type:"optional",innerType:e})}const ll=m("ZodNullable",(e,t)=>{za.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Xc(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function ks(e){return new ll({type:"nullable",innerType:e})}const fl=m("ZodDefault",(e,t)=>{La.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>tu(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hl(e,t){return new fl({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Qs(t)}})}const dl=m("ZodPrefault",(e,t)=>{ja.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>nu(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function pl(e,t){return new dl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Qs(t)}})}const bi=m("ZodNonOptional",(e,t)=>{Ra.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>eu(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function ml(e,t){return new bi({type:"nonoptional",innerType:e,...O(t)})}const gl=m("ZodCatch",(e,t)=>{Da.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>su(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function yl(e,t){return new gl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const bl=m("ZodPipe",(e,t)=>{Za.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>iu(e,n,s,i),e.in=t.in,e.out=t.out});function Ss(e,t){return new bl({type:"pipe",in:e,out:t})}const wl=m("ZodReadonly",(e,t)=>{Fa.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>ru(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function vl(e){return new wl({type:"readonly",innerType:e})}const _l=m("ZodCustom",(e,t)=>{Ua.init(e,t),R.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Vc(e,n)});function kl(e,t={}){return zc(_l,e,t)}function Sl(e){return Lc(e)}const wi={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const vi=([e,t,n])=>{const s=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach(i=>{s.setAttribute(i,String(t[i]))}),n?.length&&n.forEach(i=>{const r=vi(i);s.appendChild(r)}),s},Ol=(e,t={})=>{const s={...wi,...t};return vi(["svg",s,e])};const $l=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const El=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const Al=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const Nl=e=>{const t=Al(e);return t.charAt(0).toUpperCase()+t.slice(1)};const Il=e=>Array.from(e.attributes).reduce((t,n)=>(t[n.name]=n.value,t),{}),Os=e=>typeof e=="string"?e:!e||!e.class?"":e.class&&typeof e.class=="string"?e.class.split(" "):e.class&&Array.isArray(e.class)?e.class:"",$s=(e,{nameAttr:t,icons:n,attrs:s})=>{const i=e.getAttribute(t);if(i==null)return;const r=Nl(i),o=n[r];if(!o)return console.warn(`${e.outerHTML} icon name was not found in the provided icons object.`);const a=Il(e),c=$l(a)?{}:{"aria-hidden":"true"},u={...wi,"data-lucide":i,...c,...s,...a},l=Os(a),f=Os(s),h=El("lucide",`lucide-${i}`,...l,...f);h&&Object.assign(u,{class:h});const p=Ol(o,u);return e.parentNode?.replaceChild(p,e)};const Gf=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"}]];const Wf=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"}],["path",{d:"M10 12h4"}]];const Yf=[["path",{d:"M3 19V5"}],["path",{d:"m13 6-6 6 6 6"}],["path",{d:"M7 12h14"}]];const Xf=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z"}],["path",{d:"m9 12 2 2 4-4"}]];const eh=[["rect",{x:"14",y:"14",width:"4",height:"6",rx:"2"}],["rect",{x:"6",y:"4",width:"4",height:"6",rx:"2"}],["path",{d:"M6 20h4"}],["path",{d:"M14 10h4"}],["path",{d:"M6 14h2v6"}],["path",{d:"M14 4h2v6"}]];const th=[["path",{d:"M12 7v14"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"}]];const nh=[["path",{d:"M12 8V4H8"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}],["path",{d:"M2 14h2"}],["path",{d:"M20 14h2"}],["path",{d:"M15 13v2"}],["path",{d:"M9 13v2"}]];const sh=[["path",{d:"M10 19.655A6 6 0 0 1 6 14v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 3.97"}],["path",{d:"M14 15.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997a1 1 0 0 1-1.517-.86z"}],["path",{d:"M14.12 3.88 16 2"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97"}],["path",{d:"M6 13H2"}],["path",{d:"m8 2 1.88 1.88"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13"}]];const ih=[["path",{d:"M12 20v-9"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z"}],["path",{d:"M14.12 3.88 16 2"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97"}],["path",{d:"M22 13h-4"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97"}],["path",{d:"M6 13H2"}],["path",{d:"m8 2 1.88 1.88"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13"}]];const rh=[["path",{d:"M20 6 9 17l-5-5"}]];const oh=[["path",{d:"m6 9 6 6 6-6"}]];const ah=[["path",{d:"m9 18 6-6-6-6"}]];const ch=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m16 12-4-4-4 4"}],["path",{d:"M12 16V8"}]];const uh=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m15 9-6 6"}],["path",{d:"m9 9 6 6"}]];const lh=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}],["path",{d:"M12 11h4"}],["path",{d:"M12 16h4"}],["path",{d:"M8 11h.01"}],["path",{d:"M8 16h.01"}]];const fh=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 6v6h4"}]];const hh=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 6v6l4 2"}]];const dh=[["line",{x1:"15",x2:"15",y1:"12",y2:"18"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];const ph=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];const mh=[["path",{d:"M12 20v2"}],["path",{d:"M12 2v2"}],["path",{d:"M17 20v2"}],["path",{d:"M17 2v2"}],["path",{d:"M2 12h2"}],["path",{d:"M2 17h2"}],["path",{d:"M2 7h2"}],["path",{d:"M20 12h2"}],["path",{d:"M20 17h2"}],["path",{d:"M20 7h2"}],["path",{d:"M7 20v2"}],["path",{d:"M7 2v2"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1"}]];const gh=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5"}],["path",{d:"M3 12A9 3 0 0 0 21 12"}]];const yh=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];const bh=[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]];const wh=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M12 12v6"}],["path",{d:"m15 15-3-3-3 3"}]];const vh=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2"}],["path",{d:"M6.453 15h11.094"}],["path",{d:"M8.5 2h7"}]];const _h=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"}]];const kh=[["path",{d:"M12.531 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14v6a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341l.427-.473"}],["path",{d:"m16.5 3.5 5 5"}],["path",{d:"m21.5 3.5-5 5"}]];const Sh=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z"}]];const Oh=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M12 7v5l4 2"}]];const $h=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}]];const Eh=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];const Ah=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}]];const Nh=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];const Ih=[["path",{d:"M3 5h.01"}],["path",{d:"M3 12h.01"}],["path",{d:"M3 19h.01"}],["path",{d:"M8 5h13"}],["path",{d:"M8 12h13"}],["path",{d:"M8 19h13"}]];const Th=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];const Mh=[["path",{d:"m16 17 5-5-5-5"}],["path",{d:"M21 12H9"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}]];const Ch=[["path",{d:"M4 5h16"}],["path",{d:"M4 12h16"}],["path",{d:"M4 19h16"}]];const Ph=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"}]];const zh=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]];const Lh=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1"}]];const jh=[["path",{d:"M12 17v4"}],["path",{d:"m14.305 7.53.923-.382"}],["path",{d:"m15.228 4.852-.923-.383"}],["path",{d:"m16.852 3.228-.383-.924"}],["path",{d:"m16.852 8.772-.383.923"}],["path",{d:"m19.148 3.228.383-.924"}],["path",{d:"m19.53 9.696-.382-.924"}],["path",{d:"m20.772 4.852.924-.383"}],["path",{d:"m20.772 7.148.924.383"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7"}],["path",{d:"M8 21h8"}],["circle",{cx:"18",cy:"6",r:"3"}]];const Rh=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"}],["path",{d:"M12 12V8"}]];const Dh=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"}],["path",{d:"M12 22V12"}],["polyline",{points:"3.29 7 12 12 20.71 7"}],["path",{d:"m7.5 4.27 9 5.15"}]];const Zh=[["path",{d:"M11 7 6 2"}],["path",{d:"M18.992 12H2.041"}],["path",{d:"M21.145 18.38A3.34 3.34 0 0 1 20 16.5a3.3 3.3 0 0 1-1.145 1.88c-.575.46-.855 1.02-.855 1.595A2 2 0 0 0 20 22a2 2 0 0 0 2-2.025c0-.58-.285-1.13-.855-1.595"}],["path",{d:"m8.5 4.5 2.148-2.148a1.205 1.205 0 0 1 1.704 0l7.296 7.296a1.205 1.205 0 0 1 0 1.704l-7.592 7.592a3.615 3.615 0 0 1-5.112 0l-3.888-3.888a3.615 3.615 0 0 1 0-5.112L5.67 7.33"}]];const Fh=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"}]];const Uh=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1"}]];const Kh=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];const Bh=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"}]];const xh=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z"}],["path",{d:"m2 22 3-3"}],["path",{d:"M7.5 13.5 10 11"}],["path",{d:"M10.5 16.5 13 14"}],["path",{d:"m18 3-4 4h6l-4 4"}]];const qh=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];const Vh=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478"}],["circle",{cx:"12",cy:"12",r:"2"}]];const Qh=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}],["path",{d:"M8 16H3v5"}]];const Jh=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}]];const Hh=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7"}]];const Gh=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];const Wh=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"}],["path",{d:"m21.854 2.147-10.94 10.939"}]];const Yh=[["path",{d:"M14 17H5"}],["path",{d:"M19 7h-9"}],["circle",{cx:"17",cy:"17",r:"3"}],["circle",{cx:"7",cy:"7",r:"3"}]];const Xh=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]];const ed=[["circle",{cx:"18",cy:"5",r:"3"}],["circle",{cx:"6",cy:"12",r:"3"}],["circle",{cx:"18",cy:"19",r:"3"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49"}]];const td=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"M12 8v4"}],["path",{d:"M12 16h.01"}]];const nd=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"m9 12 2 2 4-4"}]];const sd=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}]];const id=[["path",{d:"M7 18v-6a5 5 0 1 1 10 0v6"}],["path",{d:"M5 21a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2z"}],["path",{d:"M21 12h1"}],["path",{d:"M18.5 4.5 18 5"}],["path",{d:"M2 12h1"}],["path",{d:"M12 2v1"}],["path",{d:"m4.929 4.929.707.707"}],["path",{d:"M12 12v6"}]];const rd=[["path",{d:"M10 5H3"}],["path",{d:"M12 19H3"}],["path",{d:"M14 3v4"}],["path",{d:"M16 17v4"}],["path",{d:"M21 12h-9"}],["path",{d:"M21 19h-5"}],["path",{d:"M21 5h-7"}],["path",{d:"M8 10v4"}],["path",{d:"M8 12H3"}]];const od=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"}],["path",{d:"M20 2v4"}],["path",{d:"M22 4h-4"}],["circle",{cx:"4",cy:"20",r:"2"}]];const ad=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}]];const cd=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];const ud=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];const ld=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}],["circle",{cx:"9",cy:"7",r:"4"}]];const fd=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2"}]];const hd=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];const Tl=({icons:e={},nameAttr:t="data-lucide",attrs:n={},root:s=document,inTemplates:i}={})=>{if(!Object.values(e).length)throw new Error(`Please provide an icons object.
40
+ If you want to use all the icons you can import it like:
41
+ \`import { createIcons, icons } from 'lucide';
42
+ lucide.createIcons({icons});\``);if(typeof s>"u")throw new Error("`createIcons()` only works in a browser environment.");if(Array.from(s.querySelectorAll(`[${t}]`)).forEach(o=>$s(o,{nameAttr:t,icons:e,attrs:n})),i&&Array.from(s.querySelectorAll("template")).forEach(a=>Tl({icons:e,nameAttr:t,attrs:n,root:a.content,inTemplates:i})),t==="data-lucide"){const o=s.querySelectorAll("[icon-name]");o.length>0&&(console.warn("[Lucide] Some icons were found with the now deprecated icon-name attribute. These will still be replaced for backwards compatibility, but will no longer be supported in v1.0 and you should switch to data-lucide"),Array.from(o).forEach(a=>$s(a,{nameAttr:"icon-name",icons:e,attrs:n})))}},Tn=Symbol.for("yaml.alias"),hn=Symbol.for("yaml.document"),ce=Symbol.for("yaml.map"),_i=Symbol.for("yaml.pair"),ne=Symbol.for("yaml.scalar"),Ke=Symbol.for("yaml.seq"),W=Symbol.for("yaml.node.type"),pe=e=>!!e&&typeof e=="object"&&e[W]===Tn,Oe=e=>!!e&&typeof e=="object"&&e[W]===hn,Be=e=>!!e&&typeof e=="object"&&e[W]===ce,C=e=>!!e&&typeof e=="object"&&e[W]===_i,I=e=>!!e&&typeof e=="object"&&e[W]===ne,xe=e=>!!e&&typeof e=="object"&&e[W]===Ke;function z(e){if(e&&typeof e=="object")switch(e[W]){case ce:case Ke:return!0}return!1}function L(e){if(e&&typeof e=="object")switch(e[W]){case Tn:case ce:case ne:case Ke:return!0}return!1}const ki=e=>(I(e)||z(e))&&!!e.anchor,x=Symbol("break visit"),Si=Symbol("skip children"),te=Symbol("remove node");function $e(e,t){const n=Oi(t);Oe(e)?Te(null,e.contents,n,Object.freeze([e]))===te&&(e.contents=null):Te(null,e,n,Object.freeze([]))}$e.BREAK=x;$e.SKIP=Si;$e.REMOVE=te;function Te(e,t,n,s){const i=$i(e,t,n,s);if(L(i)||C(i))return Ei(e,s,i),Te(e,i,n,s);if(typeof i!="symbol"){if(z(t)){s=Object.freeze(s.concat(t));for(let r=0;r<t.items.length;++r){const o=Te(r,t.items[r],n,s);if(typeof o=="number")r=o-1;else{if(o===x)return x;o===te&&(t.items.splice(r,1),r-=1)}}}else if(C(t)){s=Object.freeze(s.concat(t));const r=Te("key",t.key,n,s);if(r===x)return x;r===te&&(t.key=null);const o=Te("value",t.value,n,s);if(o===x)return x;o===te&&(t.value=null)}}return i}async function Pt(e,t){const n=Oi(t);Oe(e)?await Me(null,e.contents,n,Object.freeze([e]))===te&&(e.contents=null):await Me(null,e,n,Object.freeze([]))}Pt.BREAK=x;Pt.SKIP=Si;Pt.REMOVE=te;async function Me(e,t,n,s){const i=await $i(e,t,n,s);if(L(i)||C(i))return Ei(e,s,i),Me(e,i,n,s);if(typeof i!="symbol"){if(z(t)){s=Object.freeze(s.concat(t));for(let r=0;r<t.items.length;++r){const o=await Me(r,t.items[r],n,s);if(typeof o=="number")r=o-1;else{if(o===x)return x;o===te&&(t.items.splice(r,1),r-=1)}}}else if(C(t)){s=Object.freeze(s.concat(t));const r=await Me("key",t.key,n,s);if(r===x)return x;r===te&&(t.key=null);const o=await Me("value",t.value,n,s);if(o===x)return x;o===te&&(t.value=null)}}return i}function Oi(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function $i(e,t,n,s){if(typeof n=="function")return n(e,t,s);if(Be(t))return n.Map?.(e,t,s);if(xe(t))return n.Seq?.(e,t,s);if(C(t))return n.Pair?.(e,t,s);if(I(t))return n.Scalar?.(e,t,s);if(pe(t))return n.Alias?.(e,t,s)}function Ei(e,t,n){const s=t[t.length-1];if(z(s))s.items[e]=n;else if(C(s))e==="key"?s.key=n:s.value=n;else if(Oe(s))s.contents=n;else{const i=pe(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Ml={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Cl=e=>e.replace(/[!,[\]{}]/g,t=>Ml[t]);class B{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},B.defaultYaml,t),this.tags=Object.assign({},B.defaultTags,n)}clone(){const t=new B(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new B(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:B.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},B.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:B.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},B.defaultTags),this.atNextDocument=!1);const s=t.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return n(6,`Unsupported YAML version ${r}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,s,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return n(String(o)),null}return s==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,s]of Object.entries(this.tags))if(t.startsWith(s))return n+Cl(t.substring(s.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(t&&s.length>0&&L(t.contents)){const r={};$e(t.contents,(o,a)=>{L(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${r} ${o}`);return n.join(`
43
+ `)}}B.defaultYaml={explicit:!1,version:"1.2"};B.defaultTags={"!!":"tag:yaml.org,2002:"};function Ai(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Ni(e){const t=new Set;return $e(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function Ii(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function Pl(e,t){const n=[],s=new Map;let i=null;return{onAnchor:r=>{n.push(r),i??(i=Ni(e));const o=Ii(t,i);return i.add(o),o},setAnchors:()=>{for(const r of n){const o=s.get(r);if(typeof o=="object"&&o.anchor&&(I(o.node)||z(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:s}}function Ce(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){const o=s[i],a=Ce(e,s,String(i),o);a===void 0?delete s[i]:a!==o&&(s[i]=a)}else if(s instanceof Map)for(const i of Array.from(s.keys())){const r=s.get(i),o=Ce(e,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(const i of Array.from(s)){const r=Ce(e,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(const[i,r]of Object.entries(s)){const o=Ce(e,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return e.call(t,n,s)}function G(e,t,n){if(Array.isArray(e))return e.map((s,i)=>G(s,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!ki(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=r=>{s.res=r,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}class Mn{constructor(t){Object.defineProperty(this,W,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!Oe(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=G(this,"",o);if(typeof i=="function")for(const{count:c,res:u}of o.anchors.values())i(u,c);return typeof r=="function"?Ce(r,{"":a},"",a):a}}class zt extends Mn{constructor(t){super(Tn),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let s;n?.aliasResolveCache?s=n.aliasResolveCache:(s=[],$e(t,{Node:(r,o)=>{(pe(o)||ki(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let i;for(const r of s){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:s,doc:i,maxAliasCount:r}=n,o=this.resolve(i,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=s.get(o);if(a||(G(o,null,n),a=s.get(o)),a?.res===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=gt(i,o,s)),a.count*a.aliasCount>r)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(t,n,s){const i=`*${this.source}`;if(t){if(Ai(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(t.implicitKey)return`${i} `}return i}}function gt(e,t,n){if(pe(t)){const s=t.resolve(e),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}else if(z(t)){let s=0;for(const i of t.items){const r=gt(e,i,n);r>s&&(s=r)}return s}else if(C(t)){const s=gt(e,t.key,n),i=gt(e,t.value,n);return Math.max(s,i)}return 1}const Ti=e=>!e||typeof e!="function"&&typeof e!="object";class E extends Mn{constructor(t){super(ne),this.value=t}toJSON(t,n){return n?.keep?this.value:G(this.value,t,n)}toString(){return String(this.value)}}E.BLOCK_FOLDED="BLOCK_FOLDED";E.BLOCK_LITERAL="BLOCK_LITERAL";E.PLAIN="PLAIN";E.QUOTE_DOUBLE="QUOTE_DOUBLE";E.QUOTE_SINGLE="QUOTE_SINGLE";const zl="tag:yaml.org,2002:";function Ll(e,t,n){if(t){const s=n.filter(r=>r.tag===t),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(s=>s.identify?.(e)&&!s.format)}function tt(e,t,n){if(Oe(e)&&(e=e.contents),L(e))return e;if(C(e)){const f=n.schema[ce].createNode?.(n.schema,null,n);return f.items.push(e),f}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=n;let c;if(s&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=i(e)),new zt(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=zl+t.slice(2));let u=Ll(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const f=new E(e);return c&&(c.node=f),f}u=e instanceof Map?o[ce]:Symbol.iterator in Object(e)?o[Ke]:o[ce]}r&&(r(u),delete n.onTagObj);const l=u?.createNode?u.createNode(n.schema,e,n):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(n.schema,e,n):new E(e);return t?l.tag=t:u.default||(l.tag=u.tag),c&&(c.node=l),l}function $t(e,t,n){let s=n;for(let i=t.length-1;i>=0;--i){const r=t[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return tt(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Ge=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Mi extends Mn{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(s=>L(s)||C(s)?s.clone(t):s),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Ge(t))this.add(n);else{const[s,...i]=t,r=this.get(s,!0);if(z(r))r.addIn(i,n);else if(r===void 0&&this.schema)this.set(s,$t(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(t){const[n,...s]=t;if(s.length===0)return this.delete(n);const i=this.get(n,!0);if(z(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(t,n){const[s,...i]=t,r=this.get(s,!0);return i.length===0?!n&&I(r)?r.value:r:z(r)?r.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!C(n))return!1;const s=n.value;return s==null||t&&I(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(t){const[n,...s]=t;if(s.length===0)return this.has(n);const i=this.get(n,!0);return z(i)?i.hasIn(s):!1}setIn(t,n){const[s,...i]=t;if(i.length===0)this.set(s,n);else{const r=this.get(s,!0);if(z(r))r.setIn(i,n);else if(r===void 0&&this.schema)this.set(s,$t(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}}const jl=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ie(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ye=(e,t,n)=>e.endsWith(`
44
+ `)?ie(n,t):n.includes(`
45
+ `)?`
46
+ `+ie(n,t):(e.endsWith(" ")?"":" ")+n,Ci="flow",dn="block",yt="quoted";function Lt(e,t,n="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return e;i<r&&(r=0);const c=Math.max(1+r,1+i-t.length);if(e.length<=c)return e;const u=[],l={};let f=i-t.length;typeof s=="number"&&(s>i-Math.max(2,r)?u.push(0):f=i-s);let h,p,y=!1,d=-1,g=-1,b=-1;n===dn&&(d=Es(e,d,t.length),d!==-1&&(f=d+c));for(let _;_=e[d+=1];){if(n===yt&&_==="\\"){switch(g=d,e[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}b=d}if(_===`
47
+ `)n===dn&&(d=Es(e,d,t.length)),f=d+t.length+c,h=void 0;else{if(_===" "&&p&&p!==" "&&p!==`
48
+ `&&p!==" "){const k=e[d+1];k&&k!==" "&&k!==`
49
+ `&&k!==" "&&(h=d)}if(d>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===yt){for(;p===" "||p===" ";)p=_,_=e[d+=1],y=!0;const k=d>b+1?d-2:g-1;if(l[k])return e;u.push(k),l[k]=!0,f=k+c,h=void 0}else y=!0}p=_}if(y&&a&&a(),u.length===0)return e;o&&o();let v=e.slice(0,u[0]);for(let _=0;_<u.length;++_){const k=u[_],S=u[_+1]||e.length;k===0?v=`
50
+ ${t}${e.slice(0,S)}`:(n===yt&&l[k]&&(v+=`${e[k]}\\`),v+=`
51
+ ${t}${e.slice(k+1,S)}`)}return v}function Es(e,t,n){let s=t,i=t+1,r=e[i];for(;r===" "||r===" ";)if(t<i+n)r=e[++t];else{do r=e[++t];while(r&&r!==`
52
+ `);s=t,i=t+1,r=e[i]}return s}const jt=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Rt=e=>/^(%|---|\.\.\.)/m.test(e);function Rl(e,t,n){if(!t||t<0)return!1;const s=t-n,i=e.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(e[r]===`
53
+ `){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}function We(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(Rt(e)?" ":"");let o="",a=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);const l=n.substr(c+2,4);switch(l){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:l.substr(0,2)==="00"?o+="\\x"+l.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(s||n[c+2]==='"'||n.length<i)c+=1;else{for(o+=n.slice(a,c)+`
54
+
55
+ `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
56
+ `,c+=2;o+=r,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,s?o:Lt(o,r,yt,jt(t,!1))}function pn(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
57
+ `)||/[ \t]\n|\n[ \t]/.test(e))return We(e,t);const n=t.indent||(Rt(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
58
+ ${n}`)+"'";return t.implicitKey?s:Lt(s,n,Ci,jt(t,!1))}function Pe(e,t){const{singleQuote:n}=t.options;let s;if(n===!1)s=We;else{const i=e.includes('"'),r=e.includes("'");i&&!r?s=pn:r&&!i?s=We:s=n?pn:We}return s(e,t)}let mn;try{mn=new RegExp(`(^|(?<!
59
+ ))
60
+ +(?!
61
+ |$)`,"g")}catch{mn=/\n+(?!\n|$)/g}function bt({comment:e,type:t,value:n},s,i,r){const{blockQuote:o,commentString:a,lineWidth:c}=s.options;if(!o||/\n[\t ]+$/.test(n))return Pe(n,s);const u=s.indent||(s.forceBlockIndent||Rt(n)?" ":""),l=o==="literal"?!0:o==="folded"||t===E.BLOCK_FOLDED?!1:t===E.BLOCK_LITERAL?!0:!Rl(n,c,u.length);if(!n)return l?`|
62
+ `:`>
63
+ `;let f,h;for(h=n.length;h>0;--h){const S=n[h-1];if(S!==`
64
+ `&&S!==" "&&S!==" ")break}let p=n.substring(h);const y=p.indexOf(`
65
+ `);y===-1?f="-":n===p||y!==p.length-1?(f="+",r&&r()):f="",p&&(n=n.slice(0,-p.length),p[p.length-1]===`
66
+ `&&(p=p.slice(0,-1)),p=p.replace(mn,`$&${u}`));let d=!1,g,b=-1;for(g=0;g<n.length;++g){const S=n[g];if(S===" ")d=!0;else if(S===`
67
+ `)b=g;else break}let v=n.substring(0,b<g?b+1:g);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${u}`));let k=(d?u?"2":"1":"")+f;if(e&&(k+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!l){const S=n.replace(/\n+/g,`
68
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);let $=!1;const A=jt(s,!0);o!=="folded"&&t!==E.BLOCK_FOLDED&&(A.onOverflow=()=>{$=!0});const w=Lt(`${v}${S}${p}`,u,dn,A);if(!$)return`>${k}
69
+ ${u}${w}`}return n=n.replace(/\n+/g,`$&${u}`),`|${k}
70
+ ${u}${v}${n}${p}`}function Dl(e,t,n,s){const{type:i,value:r}=e,{actualString:o,implicitKey:a,indent:c,indentStep:u,inFlow:l}=t;if(a&&r.includes(`
71
+ `)||l&&/[[\]{},]/.test(r))return Pe(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||l||!r.includes(`
72
+ `)?Pe(r,t):bt(e,t,n,s);if(!a&&!l&&i!==E.PLAIN&&r.includes(`
73
+ `))return bt(e,t,n,s);if(Rt(r)){if(c==="")return t.forceBlockIndent=!0,bt(e,t,n,s);if(a&&c===u)return Pe(r,t)}const f=r.replace(/\n+/g,`$&
74
+ ${c}`);if(o){const h=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(f),{compat:p,tags:y}=t.doc.schema;if(y.some(h)||p?.some(h))return Pe(r,t)}return a?f:Lt(f,c,Ci,jt(t,!1))}function it(e,t,n,s){const{implicitKey:i,inFlow:r}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==E.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=E.QUOTE_DOUBLE);const c=l=>{switch(l){case E.BLOCK_FOLDED:case E.BLOCK_LITERAL:return i||r?Pe(o.value,t):bt(o,t,n,s);case E.QUOTE_DOUBLE:return We(o.value,t);case E.QUOTE_SINGLE:return pn(o.value,t);case E.PLAIN:return Dl(o,t,n,s);default:return null}};let u=c(a);if(u===null){const{defaultKeyType:l,defaultStringType:f}=t.options,h=i&&l||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function Pi(e,t){const n=Object.assign({blockQuote:!0,commentString:jl,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function Zl(e,t){if(t.tag){const i=e.filter(r=>r.tag===t.tag);if(i.length>0)return i.find(r=>r.format===t.format)??i[0]}let n,s;if(I(t)){s=t.value;let i=e.filter(r=>r.identify?.(s));if(i.length>1){const r=i.filter(o=>o.test);r.length>0&&(i=r)}n=i.find(r=>r.format===t.format)??i.find(r=>!r.format)}else s=t,n=e.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!n){const i=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return n}function Fl(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const i=[],r=(I(e)||z(e))&&e.anchor;r&&Ai(r)&&(n.add(r),i.push(`&${r}`));const o=e.tag??(t.default?null:t.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}function Ze(e,t,n,s){if(C(e))return e.toString(t,n,s);if(pe(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const r=L(e)?e:t.doc.createNode(e,{onTagObj:c=>i=c});i??(i=Zl(t.doc.schema.tags,r));const o=Fl(r,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(r,t,n,s):I(r)?it(r,t,n,s):r.toString(t,n,s);return o?I(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
75
+ ${t.indent}${a}`:a}function Ul({key:e,value:t},n,s,i){const{allNullValues:r,doc:o,indent:a,indentStep:c,options:{commentString:u,indentSeq:l,simpleKeys:f}}=n;let h=L(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(z(e)||!L(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||z(e)||(I(e)?e.type===E.BLOCK_FOLDED||e.type===E.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!r),indent:a+c});let y=!1,d=!1,g=Ze(e,n,()=>y=!0,()=>d=!0);if(!p&&!n.inFlow&&g.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(r||t==null)return y&&s&&s(),g===""?"?":p?`? ${g}`:g}else if(r&&!f||t==null&&p)return g=`? ${g}`,h&&!y?g+=ye(g,n.indent,u(h)):d&&i&&i(),g;y&&(h=null),p?(h&&(g+=ye(g,n.indent,u(h))),g=`? ${g}
76
+ ${a}:`):(g=`${g}:`,h&&(g+=ye(g,n.indent,u(h))));let b,v,_;L(t)?(b=!!t.spaceBefore,v=t.commentBefore,_=t.comment):(b=!1,v=null,_=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!h&&I(t)&&(n.indentAtStart=g.length+1),d=!1,!l&&c.length>=2&&!n.inFlow&&!p&&xe(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let k=!1;const S=Ze(t,n,()=>k=!0,()=>d=!0);let $=" ";if(h||b||v){if($=b?`
77
+ `:"",v){const A=u(v);$+=`
78
+ ${ie(A,n.indent)}`}S===""&&!n.inFlow?$===`
79
+ `&&_&&($=`
80
+
81
+ `):$+=`
82
+ ${n.indent}`}else if(!p&&z(t)){const A=S[0],w=S.indexOf(`
83
+ `),T=w!==-1,V=n.inFlow??t.flow??t.items.length===0;if(T||!V){let se=!1;if(T&&(A==="&"||A==="!")){let M=S.indexOf(" ");A==="&"&&M!==-1&&M<w&&S[M+1]==="!"&&(M=S.indexOf(" ",M+1)),(M===-1||w<M)&&(se=!0)}se||($=`
84
+ ${n.indent}`)}}else(S===""||S[0]===`
85
+ `)&&($="");return g+=$+S,n.inFlow?k&&s&&s():_&&!k?g+=ye(g,n.indent,u(_)):d&&i&&i(),g}function zi(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const ft="<<",re={identify:e=>e===ft||typeof e=="symbol"&&e.description===ft,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new E(Symbol(ft)),{addToJSMap:Li}),stringify:()=>ft},Kl=(e,t)=>(re.identify(t)||I(t)&&(!t.type||t.type===E.PLAIN)&&re.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===re.tag&&n.default);function Li(e,t,n){if(n=e&&pe(n)?n.resolve(e.doc):n,xe(n))for(const s of n.items)Ht(e,t,s);else if(Array.isArray(n))for(const s of n)Ht(e,t,s);else Ht(e,t,n)}function Ht(e,t,n){const s=e&&pe(n)?n.resolve(e.doc):n;if(!Be(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,e,Map);for(const[r,o]of i)t instanceof Map?t.has(r)||t.set(r,o):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function ji(e,t,{key:n,value:s}){if(L(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(Kl(e,n))Li(e,t,s);else{const i=G(n,"",e);if(t instanceof Map)t.set(i,G(s,i,e));else if(t instanceof Set)t.add(i);else{const r=Bl(n,i,e),o=G(s,r,e);r in t?Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[r]=o}}return t}function Bl(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(L(e)&&n?.doc){const s=Pi(n.doc,{});s.anchors=new Set;for(const r of n.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;const i=e.toString(s);if(!n.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),zi(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function Cn(e,t,n){const s=tt(e,void 0,n),i=tt(t,void 0,n);return new U(s,i)}class U{constructor(t,n=null){Object.defineProperty(this,W,{value:_i}),this.key=t,this.value=n}clone(t){let{key:n,value:s}=this;return L(n)&&(n=n.clone(t)),L(s)&&(s=s.clone(t)),new U(n,s)}toJSON(t,n){const s=n?.mapAsMap?new Map:{};return ji(n,s,this)}toString(t,n,s){return t?.doc?Ul(this,t,n,s):JSON.stringify(this)}}function Ri(e,t,n){return(t.inFlow??e.flow?ql:xl)(e,t,n)}function xl({comment:e,items:t},n,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:c,options:{commentString:u}}=n,l=Object.assign({},n,{indent:r,type:null});let f=!1;const h=[];for(let y=0;y<t.length;++y){const d=t[y];let g=null;if(L(d))!f&&d.spaceBefore&&h.push(""),Et(n,h,d.commentBefore,f),d.comment&&(g=d.comment);else if(C(d)){const v=L(d.key)?d.key:null;v&&(!f&&v.spaceBefore&&h.push(""),Et(n,h,v.commentBefore,f))}f=!1;let b=Ze(d,l,()=>g=null,()=>f=!0);g&&(b+=ye(b,r,u(g))),f&&g&&(f=!1),h.push(s+b)}let p;if(h.length===0)p=i.start+i.end;else{p=h[0];for(let y=1;y<h.length;++y){const d=h[y];p+=d?`
86
+ ${c}${d}`:`
87
+ `}}return e?(p+=`
88
+ `+ie(u(e),c),a&&a()):f&&o&&o(),p}function ql({items:e},t,{flowChars:n,itemIndent:s}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=t;s+=r;const c=Object.assign({},t,{indent:s,inFlow:!0,type:null});let u=!1,l=0;const f=[];for(let y=0;y<e.length;++y){const d=e[y];let g=null;if(L(d))d.spaceBefore&&f.push(""),Et(t,f,d.commentBefore,!1),d.comment&&(g=d.comment);else if(C(d)){const v=L(d.key)?d.key:null;v&&(v.spaceBefore&&f.push(""),Et(t,f,v.commentBefore,!1),v.comment&&(u=!0));const _=L(d.value)?d.value:null;_?(_.comment&&(g=_.comment),_.commentBefore&&(u=!0)):d.value==null&&v?.comment&&(g=v.comment)}g&&(u=!0);let b=Ze(d,c,()=>g=null);y<e.length-1&&(b+=","),g&&(b+=ye(b,s,a(g))),!u&&(f.length>l||b.includes(`
89
+ `))&&(u=!0),f.push(b),l=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!u){const y=f.reduce((d,g)=>d+g.length+2,2);u=t.options.lineWidth>0&&y>t.options.lineWidth}if(u){let y=h;for(const d of f)y+=d?`
90
+ ${r}${i}${d}`:`
91
+ `;return`${y}
92
+ ${i}${p}`}else return`${h}${o}${f.join(" ")}${o}${p}`}function Et({indent:e,options:{commentString:t}},n,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const r=ie(t(s),e);n.push(r.trimStart())}}function be(e,t){const n=I(t)?t.value:t;for(const s of e)if(C(s)&&(s.key===t||s.key===n||I(s.key)&&s.key.value===n))return s}class Q extends Mi{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(ce,t),this.items=[]}static from(t,n,s){const{keepUndefined:i,replacer:r}=s,o=new this(t),a=(c,u)=>{if(typeof r=="function")u=r.call(n,c,u);else if(Array.isArray(r)&&!r.includes(c))return;(u!==void 0||i)&&o.items.push(Cn(c,u,s))};if(n instanceof Map)for(const[c,u]of n)a(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let s;C(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new U(t,t?.value):s=new U(t.key,t.value);const i=be(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${s.key} already set`);I(i.value)&&Ti(s.value)?i.value.value=s.value:i.value=s.value}else if(r){const o=this.items.findIndex(a=>r(s,a)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(t){const n=be(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=be(this.items,t)?.value;return(!n&&I(i)?i.value:i)??void 0}has(t){return!!be(this.items,t)}set(t,n){this.add(new U(t,n),!0)}toJSON(t,n,s){const i=s?new s:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(const r of this.items)ji(n,i,r);return i}toString(t,n,s){if(!t)return JSON.stringify(this);for(const i of this.items)if(!C(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Ri(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}}const qe={collection:"map",default:!0,nodeClass:Q,tag:"tag:yaml.org,2002:map",resolve(e,t){return Be(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Q.from(e,t,n)};class fe extends Mi{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ke,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=ht(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const s=ht(t);if(typeof s!="number")return;const i=this.items[s];return!n&&I(i)?i.value:i}has(t){const n=ht(t);return typeof n=="number"&&n<this.items.length}set(t,n){const s=ht(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[s];I(i)&&Ti(n)?i.value=n:this.items[s]=n}toJSON(t,n){const s=[];n?.onCreate&&n.onCreate(s);let i=0;for(const r of this.items)s.push(G(r,String(i++),n));return s}toString(t,n,s){return t?Ri(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(t,n,s){const{replacer:i}=s,r=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof i=="function"){const c=n instanceof Set?a:String(o++);a=i.call(n,c,a)}r.items.push(tt(a,void 0,s))}}return r}}function ht(e){let t=I(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Ve={collection:"seq",default:!0,nodeClass:fe,tag:"tag:yaml.org,2002:seq",resolve(e,t){return xe(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>fe.from(e,t,n)},Dt={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,s){return t=Object.assign({actualString:!0},t),it(e,t,n,s)}},Zt={identify:e=>e==null,createNode:()=>new E(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new E(null),stringify:({source:e},t)=>typeof e=="string"&&Zt.test.test(e)?e:t.options.nullStr},Pn={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new E(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Pn.test.test(e)){const s=e[0]==="t"||e[0]==="T";if(t===s)return e}return t?n.options.trueStr:n.options.falseStr}};function ee({format:e,minFractionDigits:t,tag:n,value:s}){if(typeof s=="bigint")return String(s);const i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=t-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const Di={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ee},Zi={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ee(e)}},Fi={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new E(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ee},Ft=e=>typeof e=="bigint"||Number.isInteger(e),zn=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function Ui(e,t,n){const{value:s}=e;return Ft(s)&&s>=0?n+s.toString(t):ee(e)}const Ki={identify:e=>Ft(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>zn(e,2,8,n),stringify:e=>Ui(e,8,"0o")},Bi={identify:Ft,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>zn(e,0,10,n),stringify:ee},xi={identify:e=>Ft(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>zn(e,2,16,n),stringify:e=>Ui(e,16,"0x")},Vl=[qe,Ve,Dt,Zt,Pn,Ki,Bi,xi,Di,Zi,Fi];function As(e){return typeof e=="bigint"||Number.isInteger(e)}const dt=({value:e})=>JSON.stringify(e),Ql=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:dt},{identify:e=>e==null,createNode:()=>new E(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:dt},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:dt},{identify:As,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>As(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:dt}],Jl={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Hl=[qe,Ve].concat(Ql,Jl),Ln={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let i=0;i<n.length;++i)s[i]=n.charCodeAt(i);return s}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},s,i,r){if(!n)return"";const o=n;let a;if(typeof btoa=="function"){let c="";for(let u=0;u<o.length;++u)c+=String.fromCharCode(o[u]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=E.BLOCK_LITERAL),t!==E.QUOTE_DOUBLE){const c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),u=Math.ceil(a.length/c),l=new Array(u);for(let f=0,h=0;f<u;++f,h+=c)l[f]=a.substr(h,c);a=l.join(t===E.BLOCK_LITERAL?`
93
+ `:" ")}return it({comment:e,type:t,value:a},s,i,r)}};function qi(e,t){if(xe(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!C(s)){if(Be(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");const i=s.items[0]||new U(new E(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
94
+ ${i.key.commentBefore}`:s.commentBefore),s.comment){const r=i.value??i.key;r.comment=r.comment?`${s.comment}
95
+ ${r.comment}`:s.comment}s=i}e.items[n]=C(s)?s:new U(s)}}else t("Expected a sequence for this tag");return e}function Vi(e,t,n){const{replacer:s}=n,i=new fe(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof s=="function"&&(o=s.call(t,String(r++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)a=u[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else a=o;i.items.push(Cn(a,c,n))}return i}const jn={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:qi,createNode:Vi};class Le extends fe{constructor(){super(),this.add=Q.prototype.add.bind(this),this.delete=Q.prototype.delete.bind(this),this.get=Q.prototype.get.bind(this),this.has=Q.prototype.has.bind(this),this.set=Q.prototype.set.bind(this),this.tag=Le.tag}toJSON(t,n){if(!n)return super.toJSON(t);const s=new Map;n?.onCreate&&n.onCreate(s);for(const i of this.items){let r,o;if(C(i)?(r=G(i.key,"",n),o=G(i.value,r,n)):r=G(i,"",n),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(t,n,s){const i=Vi(t,n,s),r=new this;return r.items=i.items,r}}Le.tag="tag:yaml.org,2002:omap";const Rn={collection:"seq",identify:e=>e instanceof Map,nodeClass:Le,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=qi(e,t),s=[];for(const{key:i}of n.items)I(i)&&(s.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new Le,n)},createNode:(e,t,n)=>Le.from(e,t,n)};function Qi({value:e,source:t},n){return t&&(e?Ji:Hi).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Ji={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new E(!0),stringify:Qi},Hi={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new E(!1),stringify:Qi},Gl={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ee},Wl={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ee(e)}},Yl={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new E(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const s=e.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(t.minFractionDigits=s.length)}return t},stringify:ee},rt=e=>typeof e=="bigint"||Number.isInteger(e);function Ut(e,t,n,{intAsBigInt:s}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return i==="-"?BigInt(-1)*o:o}const r=parseInt(e,n);return i==="-"?-1*r:r}function Dn(e,t,n){const{value:s}=e;if(rt(s)){const i=s.toString(t);return s<0?"-"+n+i.substr(1):n+i}return ee(e)}const Xl={identify:rt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Ut(e,2,2,n),stringify:e=>Dn(e,2,"0b")},ef={identify:rt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Ut(e,1,8,n),stringify:e=>Dn(e,8,"0")},tf={identify:rt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Ut(e,0,10,n),stringify:ee},nf={identify:rt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Ut(e,2,16,n),stringify:e=>Dn(e,16,"0x")};class je extends Q{constructor(t){super(t),this.tag=je.tag}add(t){let n;C(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new U(t.key,null):n=new U(t,null),be(this.items,n.key)||this.items.push(n)}get(t,n){const s=be(this.items,t);return!n&&C(s)?I(s.key)?s.key.value:s.key:s}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=be(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new U(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,s){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(t,n,s){const{replacer:i}=s,r=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),r.items.push(Cn(o,null,s));return r}}je.tag="tag:yaml.org,2002:set";const Zn={collection:"map",identify:e=>e instanceof Set,nodeClass:je,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>je.from(e,t,n),resolve(e,t){if(Be(e)){if(e.hasAllNullValues(!0))return Object.assign(new je,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Fn(e,t){const n=e[0],s=n==="-"||n==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*r:r}function Gi(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return ee(e);let s="";t<0&&(s="-",t*=n(-1));const i=n(60),r=[t%i];return t<60?r.unshift(0):(t=(t-r[0])/i,r.unshift(t%i),t>=60&&(t=(t-r[0])/i,r.unshift(t))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Wi={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Fn(e,n),stringify:Gi},Yi={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Fn(e,!1),stringify:Gi},Kt={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Kt.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,i,r,o,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,s-1,i,r||0,o||0,a||0,c);const l=t[8];if(l&&l!=="Z"){let f=Fn(l,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Ns=[qe,Ve,Dt,Zt,Ji,Hi,Xl,ef,tf,nf,Gl,Wl,Yl,Ln,re,Rn,jn,Zn,Wi,Yi,Kt],Is=new Map([["core",Vl],["failsafe",[qe,Ve,Dt]],["json",Hl],["yaml11",Ns],["yaml-1.1",Ns]]),Ts={binary:Ln,bool:Pn,float:Fi,floatExp:Zi,floatNaN:Di,floatTime:Yi,int:Bi,intHex:xi,intOct:Ki,intTime:Wi,map:qe,merge:re,null:Zt,omap:Rn,pairs:jn,seq:Ve,set:Zn,timestamp:Kt},sf={"tag:yaml.org,2002:binary":Ln,"tag:yaml.org,2002:merge":re,"tag:yaml.org,2002:omap":Rn,"tag:yaml.org,2002:pairs":jn,"tag:yaml.org,2002:set":Zn,"tag:yaml.org,2002:timestamp":Kt};function Gt(e,t,n){const s=Is.get(t);if(s&&!e)return n&&!s.includes(re)?s.concat(re):s.slice();let i=s;if(!i)if(Array.isArray(e))i=[];else{const r=Array.from(Is.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(const r of e)i=i.concat(r);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(re)),i.reduce((r,o)=>{const a=typeof o=="string"?Ts[o]:o;if(!a){const c=JSON.stringify(o),u=Object.keys(Ts).map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return r.includes(a)||r.push(a),r},[])}const rf=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Bt{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?Gt(t,"compat"):t?Gt(null,t):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?sf:{},this.tags=Gt(n,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,ce,{value:qe}),Object.defineProperty(this,ne,{value:Dt}),Object.defineProperty(this,Ke,{value:Ve}),this.sortMapEntries=typeof o=="function"?o:o===!0?rf:null}clone(){const t=Object.create(Bt.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function of(e,t){const n=[];let s=t.directives===!0;if(t.directives!==!1&&e.directives){const c=e.directives.toString(e);c?(n.push(c),s=!0):e.directives.docStart&&(s=!0)}s&&n.push("---");const i=Pi(e,t),{commentString:r}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const c=r(e.commentBefore);n.unshift(ie(c,""))}let o=!1,a=null;if(e.contents){if(L(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){const l=r(e.contents.commentBefore);n.push(ie(l,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}const c=a?void 0:()=>o=!0;let u=Ze(e.contents,i,()=>a=null,c);a&&(u+=ye(u,"",r(a))),(u[0]==="|"||u[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${u}`:n.push(u)}else n.push(Ze(e.contents,i));if(e.directives?.docEnd)if(e.comment){const c=r(e.comment);c.includes(`
96
+ `)?(n.push("..."),n.push(ie(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(ie(r(c),"")))}return n.join(`
97
+ `)+`
98
+ `}class Qe{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,W,{value:hn});let i=null;typeof n=="function"||Array.isArray(n)?i=n:s===void 0&&n&&(s=n,n=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new B({version:o}),this.setSchema(o,s),this.contents=t===void 0?null:this.createNode(t,i,s)}clone(){const t=Object.create(Qe.prototype,{[W]:{value:hn}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=L(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Ee(this.contents)&&this.contents.add(t)}addIn(t,n){Ee(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const s=Ni(this);t.anchor=!n||s.has(n)?Ii(n||"a",s):n}return new zt(t.anchor)}createNode(t,n,s){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const g=v=>typeof v=="number"||v instanceof String||v instanceof Number,b=n.filter(g).map(String);b.length>0&&(n=n.concat(b)),i=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:u,tag:l}=s??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=Pl(this,o||"a"),y={aliasDuplicateObjects:r??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:i,schema:this.schema,sourceObjects:p},d=tt(t,l,y);return a&&z(d)&&(d.flow=!0),h(),d}createPair(t,n,s={}){const i=this.createNode(t,null,s),r=this.createNode(n,null,s);return new U(i,r)}delete(t){return Ee(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ge(t)?this.contents==null?!1:(this.contents=null,!0):Ee(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return z(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Ge(t)?!n&&I(this.contents)?this.contents.value:this.contents:z(this.contents)?this.contents.getIn(t,n):void 0}has(t){return z(this.contents)?this.contents.has(t):!1}hasIn(t){return Ge(t)?this.contents!==void 0:z(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=$t(this.schema,[t],n):Ee(this.contents)&&this.contents.set(t,n)}setIn(t,n){Ge(t)?this.contents=n:this.contents==null?this.contents=$t(this.schema,Array.from(t),n):Ee(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let s;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new B({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new B({version:t}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new Bt(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=G(this.contents,n??"",a);if(typeof r=="function")for(const{count:u,res:l}of a.anchors.values())r(l,u);return typeof o=="function"?Ce(o,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return of(this,t)}}function Ee(e){if(z(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Un extends Error{constructor(t,n,s,i){super(),this.name=t,this.code=s,this.message=i,this.pos=n}}class we extends Un{constructor(t,n,s){super("YAMLParseError",t,n,s)}}class Xi extends Un{constructor(t,n,s){super("YAMLWarning",t,n,s)}}const At=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));const{line:s,col:i}=n.linePos[0];n.message+=` at line ${s}, column ${i}`;let r=i-1,o=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,r))){let a=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`…
99
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1;const c=n.linePos[1];c?.line===s&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-r)));const u=" ".repeat(r)+"^".repeat(a);n.message+=`:
100
+
101
+ ${o}
102
+ ${u}
103
+ `}};function Fe(e,{flow:t,indicator:n,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let c=!1,u=a,l=a,f="",h="",p=!1,y=!1,d=null,g=null,b=null,v=null,_=null,k=null,S=null;for(const w of e)switch(y&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&r(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),d&&(u&&w.type!=="comment"&&w.type!=="newline"&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),w.type){case"space":!t&&(n!=="doc-start"||s?.type!=="flow-collection")&&w.source.includes(" ")&&(d=w),l=!0;break;case"comment":{l||r(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const T=w.source.substring(1)||" ";f?f+=h+T:f=T,h="",u=!1;break}case"newline":u?f?f+=w.source:(!k||n!=="seq-item-ind")&&(c=!0):h+=w.source,u=!0,p=!0,(g||b)&&(v=w),l=!0;break;case"anchor":g&&r(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&r(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=w,S??(S=w.offset),u=!1,l=!1,y=!0;break;case"tag":{b&&r(w,"MULTIPLE_TAGS","A node can have at most one tag"),b=w,S??(S=w.offset),u=!1,l=!1,y=!0;break}case n:(g||b)&&r(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),k&&r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${t??"collection"}`),k=w,u=n==="seq-item-ind"||n==="explicit-key-ind",l=!1;break;case"comma":if(t){_&&r(w,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=w,u=!1,l=!1;break}default:r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),u=!1,l=!1}const $=e[e.length-1],A=$?$.offset+$.source.length:i;return y&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(u&&d.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:k,spaceBefore:c,comment:f,hasNewline:p,anchor:g,tag:b,newlineAfterProp:v,end:A,start:S??A}}function nt(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
104
+ `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(nt(t.key)||nt(t.value))return!0}return!1;default:return!0}}function gn(e,t,n){if(t?.type==="flow-collection"){const s=t.end[0];s.indent===e&&(s.source==="]"||s.source==="}")&&nt(t)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function er(e,t,n){const{uniqueKeys:s}=e.options;if(s===!1)return!1;const i=typeof s=="function"?s:(r,o)=>r===o||I(r)&&I(o)&&r.value===o.value;return t.some(r=>i(r.key,n))}const Ms="All mapping items must start at the same column";function af({composeNode:e,composeEmptyNode:t},n,s,i,r){const o=r?.nodeClass??Q,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=s.offset,u=null;for(const l of s.items){const{start:f,key:h,sep:p,value:y}=l,d=Fe(f,{indicator:"explicit-key-ind",next:h??p?.[0],offset:c,onError:i,parentIndent:s.indent,startOnNewline:!0}),g=!d.found;if(g){if(h&&(h.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==s.indent&&i(c,"BAD_INDENT",Ms)),!d.anchor&&!d.tag&&!p){u=d.end,d.comment&&(a.comment?a.comment+=`
105
+ `+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||nt(h))&&i(h??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==s.indent&&i(c,"BAD_INDENT",Ms);n.atKey=!0;const b=d.end,v=h?e(n,h,d,i):t(n,b,f,null,d,i);n.schema.compat&&gn(s.indent,h,i),n.atKey=!1,er(n,a.items,v)&&i(b,"DUPLICATE_KEY","Map keys must be unique");const _=Fe(p??[],{indicator:"map-value-ind",next:y,offset:v.range[2],onError:i,parentIndent:s.indent,startOnNewline:!h||h.type==="block-scalar"});if(c=_.end,_.found){g&&(y?.type==="block-map"&&!_.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&d.start<_.found.offset-1024&&i(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=y?e(n,y,_,i):t(n,c,p,null,_,i);n.schema.compat&&gn(s.indent,y,i),c=k.range[2];const S=new U(v,k);n.options.keepSourceTokens&&(S.srcToken=l),a.items.push(S)}else{g&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(v.comment?v.comment+=`
106
+ `+_.comment:v.comment=_.comment);const k=new U(v);n.options.keepSourceTokens&&(k.srcToken=l),a.items.push(k)}}return u&&u<c&&i(u,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,c,u??c],a}function cf({composeNode:e,composeEmptyNode:t},n,s,i,r){const o=r?.nodeClass??fe,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=s.offset,u=null;for(const{start:l,value:f}of s.items){const h=Fe(l,{indicator:"seq-item-ind",next:f,offset:c,onError:i,parentIndent:s.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||f)f?.type==="block-seq"?i(h.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{u=h.end,h.comment&&(a.comment=h.comment);continue}const p=f?e(n,f,h,i):t(n,h.end,l,null,h,i);n.schema.compat&&gn(s.indent,f,i),c=p.range[2],a.items.push(p)}return a.range=[s.offset,c,u??c],a}function ot(e,t,n,s){let i="";if(e){let r=!1,o="";for(const a of e){const{source:c,type:u}=a;switch(u){case"space":r=!0;break;case"comment":{n&&!r&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const l=c.substring(1)||" ";i?i+=o+l:i=l,o="";break}case"newline":i&&(o+=c),r=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=c.length}}return{comment:i,offset:t}}const Wt="Block collections are not allowed within flow collections",Yt=e=>e&&(e.type==="block-map"||e.type==="block-seq");function uf({composeNode:e,composeEmptyNode:t},n,s,i,r){const o=s.start.source==="{",a=o?"flow map":"flow sequence",c=r?.nodeClass??(o?Q:fe),u=new c(n.schema);u.flow=!0;const l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=s.offset+s.start.source.length;for(let g=0;g<s.items.length;++g){const b=s.items[g],{start:v,key:_,sep:k,value:S}=b,$=Fe(v,{flow:a,indicator:"explicit-key-ind",next:_??k?.[0],offset:f,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!$.found){if(!$.anchor&&!$.tag&&!k&&!S){g===0&&$.comma?i($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):g<s.items.length-1&&i($.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),$.comment&&(u.comment?u.comment+=`
107
+ `+$.comment:u.comment=$.comment),f=$.end;continue}!o&&n.options.strict&&nt(_)&&i(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)$.comma&&i($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if($.comma||i($.start,"MISSING_CHAR",`Missing , between ${a} items`),$.comment){let A="";e:for(const w of v)switch(w.type){case"comma":case"space":break;case"comment":A=w.source.substring(1);break e;default:break e}if(A){let w=u.items[u.items.length-1];C(w)&&(w=w.value??w.key),w.comment?w.comment+=`
108
+ `+A:w.comment=A,$.comment=$.comment.substring(A.length+1)}}if(!o&&!k&&!$.found){const A=S?e(n,S,$,i):t(n,$.end,k,null,$,i);u.items.push(A),f=A.range[2],Yt(S)&&i(A.range,"BLOCK_IN_FLOW",Wt)}else{n.atKey=!0;const A=$.end,w=_?e(n,_,$,i):t(n,A,v,null,$,i);Yt(_)&&i(w.range,"BLOCK_IN_FLOW",Wt),n.atKey=!1;const T=Fe(k??[],{flow:a,indicator:"map-value-ind",next:S,offset:w.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(T.found){if(!o&&!$.found&&n.options.strict){if(k)for(const M of k){if(M===T.found)break;if(M.type==="newline"){i(M,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}$.start<T.found.offset-1024&&i(T.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&S.source?.[0]===":"?i(S,"MISSING_CHAR",`Missing space after : in ${a}`):i(T.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const V=S?e(n,S,T,i):T.found?t(n,T.end,k,null,T,i):null;V?Yt(S)&&i(V.range,"BLOCK_IN_FLOW",Wt):T.comment&&(w.comment?w.comment+=`
109
+ `+T.comment:w.comment=T.comment);const se=new U(w,V);if(n.options.keepSourceTokens&&(se.srcToken=b),o){const M=u;er(n,M.items,w)&&i(A,"DUPLICATE_KEY","Map keys must be unique"),M.items.push(se)}else{const M=new Q(n.schema);M.flow=!0,M.items.push(se);const me=(V??w).range;M.range=[w.range[0],me[1],me[2]],u.items.push(M)}f=V?V.range[2]:T.end}}const h=o?"}":"]",[p,...y]=s.end;let d=f;if(p?.source===h)d=p.offset+p.source.length;else{const g=a[0].toUpperCase()+a.substring(1),b=l?`${g} must end with a ${h}`:`${g} in block collection must be sufficiently indented and end with a ${h}`;i(f,l?"MISSING_CHAR":"BAD_INDENT",b),p&&p.source.length!==1&&y.unshift(p)}if(y.length>0){const g=ot(y,d,n.options.strict,i);g.comment&&(u.comment?u.comment+=`
110
+ `+g.comment:u.comment=g.comment),u.range=[s.offset,d,g.offset]}else u.range=[s.offset,d,d];return u}function Xt(e,t,n,s,i,r){const o=n.type==="block-map"?af(e,t,n,s,r):n.type==="block-seq"?cf(e,t,n,s,r):uf(e,t,n,s,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function lf(e,t,n,s,i){const r=s.tag,o=r?t.directives.tagName(r.source,h=>i(r,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){const{anchor:h,newlineAfterProp:p}=s,y=h&&r?h.offset>r.offset?h:r:h??r;y&&(!p||p.offset<y.offset)&&i(y,"MISSING_CHAR","Missing newline after block sequence props")}const a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===Q.tagName&&a==="map"||o===fe.tagName&&a==="seq")return Xt(e,t,n,i,o);let c=t.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!c){const h=t.schema.knownTags[o];if(h?.collection===a)t.schema.tags.push(Object.assign({},h,{default:!1})),c=h;else return h?i(r,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Xt(e,t,n,i,o)}const u=Xt(e,t,n,i,o,c),l=c.resolve?.(u,h=>i(r,"TAG_RESOLVE_FAILED",h),t.options)??u,f=L(l)?l:new E(l);return f.range=u.range,f.tag=o,c?.format&&(f.format=c.format),f}function tr(e,t,n){const s=t.offset,i=ff(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const r=i.mode===">"?E.BLOCK_FOLDED:E.BLOCK_LITERAL,o=t.source?hf(t.source):[];let a=o.length;for(let d=o.length-1;d>=0;--d){const g=o[d][1];if(g===""||g==="\r")a=d;else break}if(a===0){const d=i.chomp==="+"&&o.length>0?`
111
+ `.repeat(Math.max(1,o.length-1)):"";let g=s+i.length;return t.source&&(g+=t.source.length),{value:d,type:r,comment:i.comment,range:[s,g,g]}}let c=t.indent+i.indent,u=t.offset+i.length,l=0;for(let d=0;d<a;++d){const[g,b]=o[d];if(b===""||b==="\r")i.indent===0&&g.length>c&&(c=g.length);else{g.length<c&&n(u+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=g.length),l=d,c===0&&!e.atRoot&&n(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=g.length+b.length+1}for(let d=o.length-1;d>=a;--d)o[d][0].length>c&&(a=d+1);let f="",h="",p=!1;for(let d=0;d<l;++d)f+=o[d][0].slice(c)+`
112
+ `;for(let d=l;d<a;++d){let[g,b]=o[d];u+=g.length+b.length+1;const v=b[b.length-1]==="\r";if(v&&(b=b.slice(0,-1)),b&&g.length<c){const k=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(u-b.length-(v?2:1),"BAD_INDENT",k),g=""}r===E.BLOCK_LITERAL?(f+=h+g.slice(c)+b,h=`
113
+ `):g.length>c||b[0]===" "?(h===" "?h=`
114
+ `:!p&&h===`
115
+ `&&(h=`
116
+
117
+ `),f+=h+g.slice(c)+b,h=`
118
+ `,p=!0):b===""?h===`
119
+ `?f+=`
120
+ `:h=`
121
+ `:(f+=h+b,h=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let d=a;d<o.length;++d)f+=`
122
+ `+o[d][0].slice(c);f[f.length-1]!==`
123
+ `&&(f+=`
124
+ `);break;default:f+=`
125
+ `}const y=s+i.length+t.source.length;return{value:f,type:r,comment:i.comment,range:[s,y,y]}}function ff({offset:e,props:t},n,s){if(t[0].type!=="block-scalar-header")return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],r=i[0];let o=0,a="",c=-1;for(let h=1;h<i.length;++h){const p=i[h];if(!a&&(p==="-"||p==="+"))a=p;else{const y=Number(p);!o&&y?o=y:c===-1&&(c=e+h)}}c!==-1&&s(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let u=!1,l="",f=i.length;for(let h=1;h<t.length;++h){const p=t[h];switch(p.type){case"space":u=!0;case"newline":f+=p.source.length;break;case"comment":n&&!u&&s(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,l=p.source.substring(1);break;case"error":s(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{const y=`Unexpected token in block scalar header: ${p.type}`;s(p,"UNEXPECTED_TOKEN",y);const d=p.source;d&&typeof d=="string"&&(f+=d.length)}}}return{mode:r,indent:o,chomp:a,comment:l,length:f}}function hf(e){const t=e.split(/\n( *)/),n=t[0],s=n.match(/^( *)/),r=[s?.[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)r.push([t[o],t[o+1]]);return r}function nr(e,t,n){const{offset:s,type:i,source:r,end:o}=e;let a,c;const u=(h,p,y)=>n(s+h,p,y);switch(i){case"scalar":a=E.PLAIN,c=df(r,u);break;case"single-quoted-scalar":a=E.QUOTE_SINGLE,c=pf(r,u);break;case"double-quoted-scalar":a=E.QUOTE_DOUBLE,c=mf(r,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}const l=s+r.length,f=ot(o,l,t,n);return{value:c,type:a,comment:f.comment,range:[s,l,f.offset]}}function df(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),sr(e)}function pf(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),sr(e.slice(1,-1)).replace(/''/g,"'")}function sr(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
126
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
127
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=t.exec(e);if(!s)return e;let i=s[1],r=" ",o=t.lastIndex;for(n.lastIndex=o;s=n.exec(e);)s[1]===""?r===`
128
+ `?i+=r:r=`
129
+ `:(i+=r+s[1],r=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,s=a.exec(e),i+r+(s?.[1]??"")}function mf(e,t){let n="";for(let s=1;s<e.length-1;++s){const i=e[s];if(!(i==="\r"&&e[s+1]===`
130
+ `))if(i===`
131
+ `){const{fold:r,offset:o}=gf(e,s);n+=r,s=o}else if(i==="\\"){let r=e[++s];const o=yf[r];if(o)n+=o;else if(r===`
132
+ `)for(r=e[s+1];r===" "||r===" ";)r=e[++s+1];else if(r==="\r"&&e[s+1]===`
133
+ `)for(r=e[++s+1];r===" "||r===" ";)r=e[++s+1];else if(r==="x"||r==="u"||r==="U"){const a={x:2,u:4,U:8}[r];n+=bf(e,s+1,a,t),s+=a}else{const a=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(i===" "||i===" "){const r=s;let o=e[s+1];for(;o===" "||o===" ";)o=e[++s+1];o!==`
134
+ `&&!(o==="\r"&&e[s+2]===`
135
+ `)&&(n+=s>r?e.slice(r,s+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function gf(e,t){let n="",s=e[t+1];for(;(s===" "||s===" "||s===`
136
+ `||s==="\r")&&!(s==="\r"&&e[t+2]!==`
137
+ `);)s===`
138
+ `&&(n+=`
139
+ `),t+=1,s=e[t+1];return n||(n=" "),{fold:n,offset:t}}const yf={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
140
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function bf(e,t,n,s){const i=e.substr(t,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const a=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function ir(e,t,n,s){const{value:i,type:r,comment:o,range:a}=t.type==="block-scalar"?tr(e,t,s):nr(t,e.options.strict,s),c=n?e.directives.tagName(n.source,f=>s(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[ne]:c?u=wf(e.schema,i,c,n,s):t.type==="scalar"?u=vf(e,i,t,s):u=e.schema[ne];let l;try{const f=u.resolve(i,h=>s(n??t,"TAG_RESOLVE_FAILED",h),e.options);l=I(f)?f:new E(f)}catch(f){const h=f instanceof Error?f.message:String(f);s(n??t,"TAG_RESOLVE_FAILED",h),l=new E(i)}return l.range=a,l.source=i,r&&(l.type=r),c&&(l.tag=c),u.format&&(l.format=u.format),o&&(l.comment=o),l}function wf(e,t,n,s,i){if(n==="!")return e[ne];const r=[];for(const a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)r.push(a);else return a;for(const a of r)if(a.test?.test(t))return a;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[ne])}function vf({atKey:e,directives:t,schema:n},s,i,r){const o=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(s))||n[ne];if(n.compat){const a=n.compat.find(c=>c.default&&c.test?.test(s))??n[ne];if(o.tag!==a.tag){const c=t.tagString(o.tag),u=t.tagString(a.tag),l=`Value may be parsed as either ${c} or ${u}`;r(i,"TAG_RESOLVE_FAILED",l,!0)}}return o}function _f(e,t,n){if(t){n??(n=t.length);for(let s=n-1;s>=0;--s){let i=t[s];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++s];i?.type==="space";)e+=i.source.length,i=t[++s];break}}return e}const kf={composeNode:rr,composeEmptyNode:Kn};function rr(e,t,n,s){const i=e.atKey,{spaceBefore:r,comment:o,anchor:a,tag:c}=n;let u,l=!0;switch(t.type){case"alias":u=Sf(e,t,s),(a||c)&&s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=ir(e,t,c,s),a&&(u.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":u=lf(kf,e,t,n,s),a&&(u.anchor=a.source.substring(1));break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",f),u=Kn(e,t.offset,void 0,null,n,s),l=!1}}return a&&u.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!I(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&s(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(u.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&l&&(u.srcToken=t),u}function Kn(e,t,n,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:c},u){const l={type:"scalar",offset:_f(t,n,s),indent:-1,source:""},f=ir(e,l,a,u);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=c),f}function Sf({options:e},{offset:t,source:n,end:s},i){const r=new zt(n.substring(1));r.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,a=ot(s,o,e.strict,i);return r.range=[t,o,a.offset],a.comment&&(r.comment=a.comment),r}function Of(e,t,{offset:n,start:s,value:i,end:r},o){const a=Object.assign({_directives:t},e),c=new Qe(void 0,a),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},l=Fe(s,{indicator:"doc-start",next:i??r?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!l.hasNewline&&o(l.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?rr(u,i,l,o):Kn(u,l.end,s,null,l,o);const f=c.contents.range[2],h=ot(r,f,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function Je(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function Cs(e){let t="",n=!1,s=!1;for(let i=0;i<e.length;++i){const r=e[i];switch(r[0]){case"#":t+=(t===""?"":s?`
141
+
142
+ `:`
143
+ `)+(r.substring(1)||" "),n=!0,s=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:t,afterEmptyLine:s}}class Bn{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,i,r)=>{const o=Je(n);r?this.warnings.push(new Xi(o,s,i)):this.errors.push(new we(o,s,i))},this.directives=new B({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:s,afterEmptyLine:i}=Cs(this.prelude);if(s){const r=t.contents;if(n)t.comment=t.comment?`${t.comment}
144
+ ${s}`:s;else if(i||t.directives.docStart||!r)t.commentBefore=s;else if(z(r)&&!r.flow&&r.items.length>0){let o=r.items[0];C(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${s}
145
+ ${a}`:s}else{const o=r.commentBefore;r.commentBefore=o?`${s}
146
+ ${o}`:s}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Cs(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,s=-1){for(const i of t)yield*this.next(i);yield*this.end(n,s)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,s,i)=>{const r=Je(t);r[0]+=n,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Of(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,s=new we(Je(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new we(Je(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const n=ot(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
147
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new we(Je(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const s=Object.assign({_directives:this.directives},this.options),i=new Qe(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}function $f(e,t=!0,n){if(e){const s=(i,r,o)=>{const a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,r,o);else throw new we([a,a+1],r,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return nr(e,t,s);case"block-scalar":return tr({options:{strict:t}},e,s)}}return null}function Ef(e,t){const{implicitKey:n=!1,indent:s,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=t,a=it({type:o,value:e},{implicitKey:n,indent:s>0?" ".repeat(s):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:s,source:`
148
+ `}];switch(a[0]){case"|":case">":{const u=a.indexOf(`
149
+ `),l=a.substring(0,u),f=a.substring(u+1)+`
150
+ `,h=[{type:"block-scalar-header",offset:r,indent:s,source:l}];return or(h,c)||h.push({type:"newline",offset:-1,indent:s,source:`
151
+ `}),{type:"block-scalar",offset:r,indent:s,props:h,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:a,end:c};default:return{type:"scalar",offset:r,indent:s,source:a,end:c}}}function Af(e,t,n={}){let{afterKey:s=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=n,a="indent"in e?e.indent:null;if(s&&typeof a=="number"&&(a+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const u=e.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const c=it({type:o,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Nf(e,c);break;case'"':en(e,c,"double-quoted-scalar");break;case"'":en(e,c,"single-quoted-scalar");break;default:en(e,c,"scalar")}}function Nf(e,t){const n=t.indexOf(`
152
+ `),s=t.substring(0,n),i=t.substring(n+1)+`
153
+ `;if(e.type==="block-scalar"){const r=e.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=s,e.source=i}else{const{offset:r}=e,o="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:s}];or(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
154
+ `});for(const c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:o,props:a,source:i})}}function or(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function en(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const s=e.props.slice(1);let i=t.length;e.props[0].type==="block-scalar-header"&&(i-=e.props[0].source.length);for(const r of s)r.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:s});break}case"block-map":case"block-seq":{const i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
155
+ `};delete e.items,Object.assign(e,{type:n,source:t,end:[i]});break}default:{const s="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(const r of Object.keys(e))r!=="type"&&r!=="offset"&&delete e[r];Object.assign(e,{type:n,indent:s,source:t,end:i})}}}const If=e=>"type"in e?Nt(e):wt(e);function Nt(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=Nt(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=wt(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=wt(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=wt(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function wt({start:e,key:t,sep:n,value:s}){let i="";for(const r of e)i+=r.source;if(t&&(i+=Nt(t)),n)for(const r of n)i+=r.source;return s&&(i+=Nt(s)),i}const yn=Symbol("break visit"),Tf=Symbol("skip children"),ar=Symbol("remove item");function _e(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),cr(Object.freeze([]),e,t)}_e.BREAK=yn;_e.SKIP=Tf;_e.REMOVE=ar;_e.itemAtPath=(e,t)=>{let n=e;for(const[s,i]of t){const r=n?.[s];if(r&&"items"in r)n=r.items[i];else return}return n};_e.parentCollection=(e,t)=>{const n=_e.itemAtPath(e,t.slice(0,-1)),s=t[t.length-1][0],i=n?.[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function cr(e,t,n){let s=n(t,e);if(typeof s=="symbol")return s;for(const i of["key","value"]){const r=t[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){const a=cr(Object.freeze(e.concat([[i,o]])),r.items[o],n);if(typeof a=="number")o=a-1;else{if(a===yn)return yn;a===ar&&(r.items.splice(o,1),o-=1)}}typeof s=="function"&&i==="key"&&(s=s(t,e))}}return typeof s=="function"?s(t,e):s}const xt="\uFEFF",qt="",Vt="",st="",Mf=e=>!!e&&"items"in e,Cf=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Pf(e){switch(e){case xt:return"<BOM>";case qt:return"<DOC>";case Vt:return"<FLOW_END>";case st:return"<SCALAR>";default:return JSON.stringify(e)}}function ur(e){switch(e){case xt:return"byte-order-mark";case qt:return"doc-mode";case Vt:return"flow-error-end";case st:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
156
+ `:case`\r
157
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const zf=Object.freeze(Object.defineProperty({__proto__:null,BOM:xt,DOCUMENT:qt,FLOW_END:Vt,SCALAR:st,createScalarToken:Ef,isCollection:Mf,isScalar:Cf,prettyToken:Pf,resolveAsScalar:$f,setScalarValue:Af,stringify:If,tokenType:ur,visit:_e},Symbol.toStringTag,{value:"Module"}));function X(e){switch(e){case void 0:case" ":case`
158
+ `:case"\r":case" ":return!0;default:return!1}}const Ps=new Set("0123456789ABCDEFabcdef"),Lf=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),pt=new Set(",[]{}"),jf=new Set(` ,[]{}
159
+ \r `),tn=e=>!e||jf.has(e);class lr{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
160
+ `?!0:n==="\r"?this.buffer[t+1]===`
161
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+t];if(n==="\r"){const i=this.buffer[s+t+1];if(i===`
162
+ `||!i&&!this.atEnd)return t+s+1}return n===`
163
+ `||s>=this.indentNext||!n&&!this.atEnd?t+s:-1}if(n==="-"||n==="."){const s=this.buffer.substr(t,3);if((s==="---"||s==="...")&&X(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
164
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===xt&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,s=t.indexOf("#");for(;s!==-1;){const r=t[s-1];if(r===" "||r===" "){n=s-1;break}else s=t.indexOf("#",s+1)}for(;;){const r=t[n-1];if(r===" "||r===" ")n-=1;else break}const i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield qt,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&X(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!X(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&X(n)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(tn),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,s=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&i[0]!=="#"||s===0&&(i.startsWith("---")||i.startsWith("..."))&&X(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Vt,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(tn),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||X(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let r=0;for(;this.buffer[n-1-r]==="\\";)r+=1;if(r%2===0)break;n=this.buffer.indexOf('"',n+1)}const s=this.buffer.substring(0,n);let i=s.indexOf(`
165
+ `,this.pos);if(i!==-1){for(;i!==-1;){const r=this.continueScalar(i+1);if(r===-1)break;i=s.indexOf(`
166
+ `,r)}i!==-1&&(n=i-(s[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>X(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":n+=1;break;case`
167
+ `:t=r,n=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
168
+ `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(t+1);if(r===-1)break;t=this.buffer.indexOf(`
169
+ `,r)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
170
+ `;)s=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let r=t-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
171
+ `&&r>=this.pos&&r+1+n>a)t=r;else break}while(!0);return yield st,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){const r=this.buffer[s+1];if(X(r)||t&&pt.has(r))break;n=s}else if(X(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===`
172
+ `?(s+=1,i=`
173
+ `,r=this.buffer[s+1]):n=s),r==="#"||t&&pt.has(r))break;if(i===`
174
+ `){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(t&&pt.has(i))break;n=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield st,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const s=this.buffer.slice(this.pos,t);return s?(yield s,this.pos+=s.length,s.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(tn))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(X(n)||t&&pt.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!X(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(Lf.has(n))n=this.buffer[++t];else if(n==="%"&&Ps.has(this.buffer[t+1])&&Ps.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
175
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
176
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||t&&s===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,s=this.buffer[n];for(;!t(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class fr{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,s=this.lineStarts.length;for(;n<s;){const r=n+s>>1;this.lineStarts[r]<t?n=r+1:s=r}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}}function oe(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function zs(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function hr(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function mt(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Ae(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function Ls(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!oe(t.start,"explicit-key-ind")&&!oe(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,hr(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class xn{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new lr,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(t,n))yield*this.next(s);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=ur(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const s=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Ls(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{const i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&zs(i.start)===-1&&(n.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<n.indent))&&(s.type==="document"?s.end=i.start:s.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{zs(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=mt(this.peek(2)),s=Ae(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const r={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
177
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
178
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const s="end"in n.value?n.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,i=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let r=[];if(i&&n.sep&&!n.value){const o=[];for(let a=0;a<n.sep.length;++a){const c=n.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(r.push(this.sourceToken),t.items.push({start:r}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(r.push(this.sourceToken),t.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(oe(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(hr(n.key)&&!oe(n.sep,"newline")){const o=Ae(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else r.length>0?n.sep=n.sep.concat(r,this.sourceToken):n.sep.push(this.sourceToken);else if(oe(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=Ae(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:r,key:null,sep:[this.sourceToken]}):oe(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||n.value?(t.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!oe(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const s="end"in n.value?n.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||oe(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const s=this.startBlockValue(t);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===t.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const i=mt(s),r=Ae(i);Ls(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
179
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
180
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=mt(t),s=Ae(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=mt(t),s=Ae(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function dr(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new fr||null,prettyErrors:t}}function Rf(e,t={}){const{lineCounter:n,prettyErrors:s}=dr(t),i=new xn(n?.addNewLine),r=new Bn(t),o=Array.from(r.compose(i.parse(e)));if(s&&n)for(const a of o)a.errors.forEach(At(e,n)),a.warnings.forEach(At(e,n));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function pr(e,t={}){const{lineCounter:n,prettyErrors:s}=dr(t),i=new xn(n?.addNewLine),r=new Bn(t);let o=null;for(const a of r.compose(i.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new we(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(At(e,n)),o.warnings.forEach(At(e,n))),o}function Df(e,t,n){let s;typeof t=="function"?s=t:n===void 0&&t&&typeof t=="object"&&(n=t);const i=pr(e,n);if(!i)return null;if(i.warnings.forEach(r=>zi(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},n))}function Zf(e,t,n){let s=null;if(typeof t=="function"||Array.isArray(t)?s=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){const{keepUndefined:i}=n??t??{};if(!i)return}return Oe(e)&&!s?e.toString(n):new Qe(e,s,n).toString(n)}const dd=Object.freeze(Object.defineProperty({__proto__:null,Alias:zt,CST:zf,Composer:Bn,Document:Qe,Lexer:lr,LineCounter:fr,Pair:U,Parser:xn,Scalar:E,Schema:Bt,YAMLError:Un,YAMLMap:Q,YAMLParseError:we,YAMLSeq:fe,YAMLWarning:Xi,isAlias:pe,isCollection:z,isDocument:Oe,isMap:Be,isNode:L,isPair:C,isScalar:I,isSeq:xe,parse:Df,parseAllDocuments:Rf,parseDocument:pr,stringify:Zf,visit:$e,visitAsync:Pt},Symbol.toStringTag,{value:"Module"}));export{Th as $,Qh as A,Vh as B,uh as C,qh as D,xh as E,Bh as F,Kh as G,Zh as H,Dh as I,Fh as J,jh as K,Ch as L,Uf as M,Rh as N,Lh as O,Uh as P,Tr as Q,Jh as R,ad as S,ud as T,ld as U,zh as V,fd as W,hd as X,Ph as Y,Mh as Z,Ih as _,F as a,Nh as a0,Ah as a1,Eh as a2,$h as a3,Oh as a4,_h as a5,vh as a6,kh as a7,Sh as a8,wh as a9,yh as aa,gh as ab,mh as ac,bh as ad,dh as ae,ph as af,fh as ag,hh as ah,lh as ai,ah as aj,oh as ak,rh as al,th as am,nh as an,sh as ao,ih as ap,eh as aq,Xf as ar,ch as as,Yf as at,Wf as au,Gf as av,dd as aw,Bf as ax,Kf as b,xf as c,Qf as d,Vf as e,qf as f,Yu as g,Tl as h,Re as i,cd as j,sd as k,ed as l,id as m,J as n,Jf as o,od as p,rd as q,Hf as r,Ff as s,nd as t,td as u,Yh as v,Xh as w,Wh as x,Gh as y,Hh as z};