PageSourceSearch

https://www.endevo.life/assets/sanity-client-DFVlsPP2.js

js endevo.life collected 2026-10-02 00:38:00 UTC 192,469 bytes, 38 lines download raw bytes

1var rc=Object.defineProperty;var Ni=t=>{throw TypeError(t)};var nc=(t,e,r)=>e in t?rc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var S=(t,e,r)=>nc(t,typeof e!="symbol"?e+"":e,r),Hi=(t,e,r)=>e.has(t)||Ni("Cannot "+r);var c=(t,e,r)=>(Hi(t,e,"read from private field"),r?r.call(t):e.get(t)),O=(t,e,r)=>e.has(t)?Ni("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),j=(t,e,r,n)=>(Hi(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);import{aG as Wi,ay as z,$ as pt,Z as _e,Y as $e,W as Pe,_ as ic,X as so,Q as ni,U as sc,M as oc,aq as oo,a9 as ao}from"./react-vendor-RSk6clzO.js";function ac(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const uc="modulepreload",cc=function(t){return"/"+t},Bi={},Hn=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(r.map(u=>{if(u=cc(u),u in Bi)return;Bi[u]=!0;const l=u.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=l?"stylesheet":uc,l||(f.as="script"),f.crossOrigin="",f.href=u,a&&f.setAttribute("nonce",a),document.head.appendChild(f),l)return new Promise((v,y)=>{f.addEventListener("load",v),f.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};function zi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Gi(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zi(Object(r),!0).forEach(function(n){lc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zi(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function lc(t,e,r){return(e=fc(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fc(t){var e=dc(t,"string");return typeof e=="symbol"?e:e+""}function dc(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lr(t){return t._type==="span"&&"text"in t&&typeof t.text=="string"&&(typeof t.marks>"u"||Array.isArray(t.marks)&&t.marks.every(e=>typeof e=="string"))}function $i(t){return typeof t._type=="string"&&t._type[0]!=="@"&&(!("markDefs"in t)||!t.markDefs||Array.isArray(t.markDefs)&&t.markDefs.every(e=>typeof e._key=="string"))&&"children"in t&&Array.isArray(t.children)&&t.children.every(e=>typeof e=="object"&&"_type"in e)}function uo(t){return $i(t)&&"listItem"in t&&typeof t.listItem=="string"&&(typeof t.level>"u"||typeof t.level=="number")}function co(t){return t._type==="@list"}function lo(t){return t._type==="@span"}function fo(t){return t._type==="@text"}const Qi=["strong","em","code","underline","strike-through"];function hc(t,e,r){if(!Lr(t)||!t.marks)return[];if(!t.marks.length)return[];const n=t.marks.slice(),i={};return n.forEach(s=>{i[s]=1;for(let o=e+1;o<r.length;o++){const a=r[o];if(a&&Lr(a)&&Array.isArray(a.marks)&&a.marks.indexOf(s)!==-1)i[s]++;else break}}),n.sort((s,o)=>pc(i,s,o))}function pc(t,e,r){const n=t[e],i=t[r];if(n!==i)return i-n;const s=Qi.indexOf(e),o=Qi.indexOf(r);return s!==o?s-o:e.localeCompare(r)}function yc(t){var e,r;const{children:n}=t,i=(e=t.markDefs)!=null?e:[];
1if(!n||!n.length)return[];const s=n.map(hc),o={_type:"@span",children:[],markType:"<unknown>"};let a=[o];for(let u=0;u<n.length;u++){const l=n[u];if(!l)continue;const d=s[u]||[];let f=1;if(a.length>1)for(f;f<a.length;f++){const y=((r=a[f])==null?void 0:r.markKey)||"",h=d.indexOf(y);if(h===-1)break;d.splice(h,1)}a=a.slice(0,f);let v=a[a.length-1];if(v){for(const y of d){const h=i==null?void 0:i.find(m=>m._key===y),p=h?h._type:y,g={_type:"@span",_key:l._key,children:[],markDef:h,markType:p,markKey:y};v.children.push(g),a.push(g),v=g}if(Lr(l)){const y=l.text.split(`
2`);for(let h=y.length;h-- >1;)y.splice(h,0,`
3`);v.children=v.children.concat(y.map(h=>({_type:"@text",text:h})))}else v.children=v.children.concat(l)}}return o.children}function vc(t,e){const r=[];let n;for(let i=0;i<t.length;i++){const s=t[i];if(s){if(!uo(s)){r.push(s),n=void 0;continue}if(!n){n=Sn(s,i,e),r.push(n);continue}if(mc(s,n)){n.children.push(s);continue}if((s.level||1)>n.level){const o=Sn(s,i,e);if(e==="html"){const a=n.children[n.children.length-1],u=Gi(Gi({},a),{},{children:[...a.children,o]});n.children[n.children.length-1]=u}else n.children.push(o);n=o;continue}if((s.level||1)<n.level){const o=r[r.length-1],a=o&&hi(o,s);if(a){n=a,n.children.push(s);continue}n=Sn(s,i,e),r.push(n);continue}if(s.listItem!==n.listItem){const o=r[r.length-1],a=o&&hi(o,{level:s.level||1});if(a&&a.listItem===s.listItem){n=a,n.children.push(s);continue}else{n=Sn(s,i,e),r.push(n);continue}}console.warn("Unknown state encountered for block",s),r.push(s)}}return r}function mc(t,e){return(t.level||1)===e.level&&t.listItem===e.listItem}function Sn(t,e,r){return{_type:"@list",_key:`${t._key||`${e}`}-parent`,mode:r,level:t.level||1,listItem:t.listItem,children:[t]}}function hi(t,e){const r=e.level||1,n=e.listItem||"normal",i=typeof e.listItem=="string";if(co(t)&&(t.level||1)===r&&i&&(t.listItem||"normal")===n)return t;if(!("children"in t))return;const s=t.children[t.children.length-1];return s&&!Lr(s)?hi(s,e):void 0}function ho(t){let e="";return t.children.forEach(r=>{fo(r)?e+=r.text:lo(r)&&(e+=ho(r))}),e}const gc=/^\s/,wc=/\s$/;function Ay(t){const e=Array.isArray(t)?t:[t];let r="";return e.forEach((n,i)=>{if(!$i(n))return;let s=!1;n.children.forEach(o=>{Lr(o)?(r+=s&&r&&!wc.test(r)&&!gc.test(o.text)?" ":"",r+=o.text,s=!1):s=!0}),i!==e.length-1&&(r+=`
4
5`)}),r}const bc="html",Ec=["block","list","listItem","marks","types"],$c=["listItem"],Ic=["_key"];function Ji(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Je(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ji(Object(r),!0).forEach(function(n){xc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ji(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xc(t,e,r){return(e=Sc(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sc(t){var e=Cc(t,"string");return typeof e=="symbol"?e:e+""}function Cc(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pi(t,e){if(t==null)return{};var r,n,i=Ac(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)r=s[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function Ac(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}const _c={number:({children:t})=>z.jsx("ol",{children:t}),bullet:({children:t})=>z.jsx("ul",{children:t})},jc=({children:t})=>z.jsx("li",{children:t}),Tc=({children:t,value:e})=>z.jsx("a",{href:e==null?void 0:e.href,children:t}),Oc={textDecoration:"underline"},Pc={em:({children:t})=>z.jsx("em",{children:t}),strong:({children:t})=>z.jsx("strong",{children:t}),code:({children:t})=>z.jsx("code",{children:t}),underline:({children:t})=>z.jsx("span",{style:Oc,children:t}),"strike-through":({children:t})=>z.jsx("del",{children:t}),link:Tc},dn=(t,e)=>`[@portabletext/react] Unknown ${t}, specify a component for it in the \`components.${e}\` prop`,po=t=>dn(`block type "${t}"`,"types"),kc=t=>dn(`mark type "${t}"`,"marks"),Rc=t=>dn(`block style "${t}"`,"block"),Dc=t=>dn(`list style "${t}"`,"list"),Mc=t=>dn(`list item style "${t}"`,"listItem");function Lc(t){console.warn(t)}const Xi={display:"none"},qc=({value:t,isInline:e})=>{const r=po(t._type);return e?z.jsx("span",{style:Xi,children:r}):z.jsx("div",{style:Xi,children:r})},Uc=({markType:t,children:e})=>z.jsx("span",{className:`unknown__pt__mark__${t}`,children:e}),Fc=({children:t})=>z.jsx("p",{children:t}),Vc=({children:t})=>z.jsx("ul",{children:t}),Nc=({children:t})=>z.jsx("li",{children:t}),Hc=()=>z.jsx("br",{}),Wc={normal:({children:t})=>z.jsx("p",{children:t}),blockquote:({children:t})=>z.jsx("blockquote",{children:t}),h1:({children:t})=>z.jsx("h1",{children:t}),h2:({children:t})=>z.jsx("h2",{children:t}),h3:({children:t})=>z.jsx("h3",{children:t}),h4:({children:t})=>z.jsx("h4",{children:t}),h5:({children:t})=>z.jsx("h5",{children:t}),h6:({children:t})=>z.jsx("h6",{children:t})},Yi={types:{},block:Wc,marks:Pc,list:_c,listItem:jc,hardBreak:Hc,unknownType:qc,unknownMark:Uc,unknownList:Vc,unknownListItem:Nc,unknownBlockStyle:Fc};function Bc(t,e){const{block:r,list:n,listItem:i,marks:s,types:o}=e,a=pi(e,Ec);return Je(Je({},t),{},{block:Ar(t,e,"block"),list:Ar(t,e,"list"),listItem:Ar(t,e,"listItem"),marks:Ar(t,e,"marks"),types:Ar(t,e,"types")},a)}function Ar(t,e,r){const n=e[r],i=t[r];return typeof n=="function"||n&&typeof i=="function"?n:n?Je(Je({},i),n):i}function _y({value:t,components:e,listNestingMode:r,onMissingComponent:n=Lc}){const i=n||Gc,s=Array.isArray(t)?t:[t],o=vc(s,r||bc),a=Wi.useMemo(()=>e?Bc(Yi,e):Yi,[e]),u=Wi.useMemo(()=>zc(a,i),[a,i]),l=o.map((d,f)=>u({node:d,index:f,isInline:!1,renderNode:u}));return z.jsx(z.Fragment,{children:l})}const zc=(t,e)=>{function r(f){const{node:v,index:y,isInline:h}=f,p=v._key||`node-${y}`;return co(v)?s(v,y,p):uo(v)?i(v,y,p):lo(v)?o(v,y,p):n(v)?d(v,y,p,h):$i(v)?a(v,y,p,h):fo(v)?u(v,p):l(v,y,p,h)}
5function n(f){return f._type in t.types}function i(f,v,y){const h=Ki({node:f,index:v,isInline:!1,renderNode:r}),p=t.listItem,g=(typeof p=="function"?p:p[f.listItem])||t.unknownListItem;if(g===t.unknownListItem){const x=f.listItem||"bullet";e(Mc(x),{type:x,nodeType:"listItemStyle"})}let m=h.children;if(f.style&&f.style!=="normal"){const{listItem:x}=f,A=pi(f,$c);m=r({node:A,index:v,isInline:!1})}return z.jsx(g,{value:f,index:v,isInline:!1,renderNode:r,children:m},y)}function s(f,v,y){const h=f.children.map((m,x)=>r({node:m._key?m:Je(Je({},m),{},{_key:`li-${v}-${x}`}),index:x,isInline:!1})),p=t.list,g=(typeof p=="function"?p:p[f.listItem])||t.unknownList;if(g===t.unknownList){const m=f.listItem||"bullet";e(Dc(m),{nodeType:"listStyle",type:m})}return z.jsx(g,{value:f,index:v,isInline:!1,renderNode:r,children:h},y)}function o(f,v,y){const{markDef:h,markType:p,markKey:g}=f,m=t.marks[p]||t.unknownMark,x=f.children.map((A,C)=>r({node:A,index:C,isInline:!0}));return m===t.unknownMark&&e(kc(p),{nodeType:"mark",type:p}),z.jsx(m,{text:ho(f),value:h,markType:p,markKey:g,renderNode:r,children:x},y)}function a(f,v,y,h){const p=Ki({node:f,index:v,isInline:h,renderNode:r}),{_key:g}=p,m=pi(p,Ic),x=m.node.style||"normal",A=(typeof t.block=="function"?t.block:t.block[x])||t.unknownBlockStyle;return A===t.unknownBlockStyle&&e(Rc(x),{nodeType:"blockStyle",type:x}),z.jsx(A,Je(Je({},m),{},{value:m.node,renderNode:r}),y)}function u(f,v){if(f.text===`
6`){const y=t.hardBreak;return y?z.jsx(y,{},v):`
7`}return f.text}function l(f,v,y,h){const p={value:f,isInline:h,index:v,renderNode:r};e(po(f._type),{nodeType:"block",type:f._type});const g=t.unknownType;return z.jsx(g,Je({},p),y)}function d(f,v,y,h){const p={value:f,isInline:h,index:v,renderNode:r},g=t.types[f._type];return g?z.jsx(g,Je({},p),y):null}return r};function Ki(t){const{node:e,index:r,isInline:n,renderNode:i}=t,s=yc(e).map((o,a)=>i({node:o,isInline:!0,index:a,renderNode:i}));return{_key:e._key||`block-${r}`,children:s,index:r,isInline:n,node:e}}function Gc(){}const yo=!(typeof navigator>"u")&&navigator.product==="ReactNative",vo={timeout:yo?6e4:12e4},Qc=function(t){const e={...vo,...typeof t=="string"?{url:t}:t};if(e.timeout=mo(e.timeout),e.query){const{url:r,searchParams:n}=function(i){const s=i.indexOf("?");if(s===-1)return{url:i,searchParams:new URLSearchParams};const o=i.slice(0,s),a=i.slice(s+1);if(!yo)return{url:o,searchParams:new URLSearchParams(a)};if(typeof decodeURIComponent!="function")throw new Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");const u=new URLSearchParams;for(const l of a.split("&")){const[d,f]=l.split("=");d&&u.append(Zi(d),Zi(f||""))}return{url:o,searchParams:u}}(e.url);for(const[i,s]of Object.entries(e.query)){if(s!==void 0)if(Array.isArray(s))for(const a of s)n.append(i,a);else n.append(i,s);const o=n.toString();o&&(e.url=`${r}?${o}`)}}return e.method=e.body&&!e.method?"POST":(e.method||"GET").toUpperCase(),e};function Zi(t){return decodeURIComponent(t.replace(/\+/g," "))}function mo(t){if(t===!1||t===0)return!1;if(t.connect||t.socket)return t;const e=Number(t);return isNaN(e)?mo(vo.timeout):{connect:e,socket:e}}const Jc=/^https?:\/\//i,Xc=function(t){if(!Jc.test(t.url))throw new Error(`"${t.url}" is not a valid URL`)};function go(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}const Yc=["request","response","progress","error","abort"],es=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];function wo(t,e){const r=[],n=es.reduce((s,o)=>(s[o]=s[o]||[],s),{processOptions:[Qc],validateOptions:[Xc]});function i(s){const o=Yc.reduce((y,h)=>(y[h]=function(){const p=Object.create(null);let g=0;return{publish:function(m){for(const x in p)p[x](m)},subscribe:function(m){const x=g++;return p[x]=m,function(){delete p[x]}}}}(),y),{}),a=(y=>function(h,p,...g){const m=h==="onError";let x=p;for(let A=0;A<y[h].length&&(x=(0,y[h][A])(x,...g),!m||x);A++);return x})(n),u=a("processOptions",s);a("validateOptions",u);const l={options:u,channels:o,applyMiddleware:a};let d;const f=o.request.subscribe(y=>{d=e(y,(h,p)=>((g,m,x)=>{let A=g,C=m;if(!A)try{C=a("onResponse",m,x)}catch(G){C=null,A=G}A=A&&a("onError",A,x),A?o.error.publish(A):C&&o.response.publish(C)})(h,p,y))});o.abort.subscribe(()=>{f(),d&&d.abort()});const v=a("onReturn",o,l);return v===o&&o.request.publish(l),v}return i.use=function(s){if(!s)throw new Error("Tried to add middleware that resolved to fal
7sey value");if(typeof s=="function")throw new Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(s.onReturn&&n.onReturn.length>0)throw new Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return es.forEach(o=>{s[o]&&n[o].push(s[o])}),r.push(s),i},i.clone=()=>wo(r,e),t.forEach(i.use),i}var ts,rs,Kc=go(function(){if(rs)return ts;rs=1;var t=function(r){return r.replace(/^\s+|\s+$/g,"")},e=function(r){return Object.prototype.toString.call(r)==="[object Array]"};return ts=function(r){if(!r)return{};for(var n=Object.create(null),i=t(r).split(`
8`),s=0;s<i.length;s++){var o=i[s],a=o.indexOf(":"),u=t(o.slice(0,a)).toLowerCase(),l=t(o.slice(a+1));typeof n[u]>"u"?n[u]=l:e(n[u])?n[u].push(l):n[u]=[n[u],l]}return n}}()),Vr,Nr,er,Hr,st,Wr,Br,Js;let yi=(Js=class{constructor(){S(this,"onabort");S(this,"onerror");S(this,"onreadystatechange");S(this,"ontimeout");S(this,"readyState",0);S(this,"response");S(this,"responseText","");S(this,"responseType","");S(this,"status");S(this,"statusText");S(this,"withCredentials");O(this,Vr);O(this,Nr);O(this,er);O(this,Hr,{});O(this,st);O(this,Wr,{});O(this,Br)}open(e,r,n){var i;j(this,Vr,e),j(this,Nr,r),j(this,er,""),this.readyState=1,(i=this.onreadystatechange)==null||i.call(this),j(this,st,void 0)}abort(){c(this,st)&&c(this,st).abort()}getAllResponseHeaders(){return c(this,er)}setRequestHeader(e,r){c(this,Hr)[e]=r}setInit(e,r=!0){j(this,Wr,e),j(this,Br,r)}send(e){const r=this.responseType!=="arraybuffer",n={...c(this,Wr),method:c(this,Vr),headers:c(this,Hr),body:e};typeof AbortController=="function"&&c(this,Br)&&(j(this,st,new AbortController),typeof EventTarget<"u"&&c(this,st).signal instanceof EventTarget&&(n.signal=c(this,st).signal)),typeof document<"u"&&(n.credentials=this.withCredentials?"include":"omit"),fetch(c(this,Nr),n).then(i=>{var s;return i.headers.forEach((o,a)=>{j(this,er,c(this,er)+`${a}: ${o}\r
9`)}),this.status=i.status,this.statusText=i.statusText,this.readyState=3,(s=this.onreadystatechange)==null||s.call(this),r?i.text():i.arrayBuffer()}).then(i=>{var s;typeof i=="string"?this.responseText=i:this.response=i,this.readyState=4,(s=this.onreadystatechange)==null||s.call(this)}).catch(i=>{var s,o;i.name!=="AbortError"?(s=this.onerror)==null||s.call(this,i):(o=this.onabort)==null||o.call(this)})}},Vr=new WeakMap,Nr=new WeakMap,er=new WeakMap,Hr=new WeakMap,st=new WeakMap,Wr=new WeakMap,Br=new WeakMap,Js);const vi=typeof XMLHttpRequest=="function"?"xhr":"fetch",Zc=vi==="xhr"?XMLHttpRequest:yi,el=(t,e)=>{const r=t.options,n=t.applyMiddleware("finalizeOptions",r),i={},s=t.applyMiddleware("interceptRequest",void 0,{adapter:vi,context:t});if(s){const p=setTimeout(e,0,null,s);return{abort:()=>clearTimeout(p)}}let o=new Zc;o instanceof yi&&typeof n.fetch=="object"&&o.setInit(n.fetch,n.useAbortSignal??!0);const a=n.headers,u=n.timeout;let l=!1,d=!1,f=!1;if(o.onerror=p=>{h(o instanceof yi?p instanceof Error?p:new Error(`Request error while attempting to reach is ${n.url}`,{cause:p}):new Error(`Request error while attempting to reach is ${n.url}${p.lengthComputable?`(${p.loaded} of ${p.total} bytes transferred)`:""}`))},o.ontimeout=p=>{h(new Error(`Request timeout while attempting to reach ${n.url}${p.lengthComputable?`(${p.loaded} of ${p.total} bytes transferred)`:""}`))},o.onabort=()=>{y(!0),l=!0},o.onreadystatechange=function(){u&&(y(),i.socket=setTimeout(()=>v("ESOCKETTIMEDOUT"),u.socket)),!l&&o&&o.readyState===4&&o.status!==0&&function(){if(!(l||d||f)){if(o.status===0)return void h(new Error("Unknown XHR error"));y(),d=!0,e(null,{body:o.response||(o.responseType===""||o.responseType==="text"?o.responseText:""),url:n.url,method:n.method,headers:Kc(o.getAllResponseHeaders()),statusCode:o.status,statusMessage:o.statusText})}}()},o.open(n.method,n.url,!0),o.withCredentials=!!n.withCredentials,a&&o.setRequestHeader)for(const p in a)a.hasOwnProperty(p)&&o.setRequestHeader(p,a[p]);return n.rawBody&&(o.responseType="arraybuffer"),t.applyMiddleware("onRequest",{options:n,adapter:vi,request:o,context:t}),o.send(n.body||null),u&&(i.connect=setTimeout(()=>v("ETIMEDOUT"),u.connect)),{abort:function(){l=!0,o&&o.abort()}};function v(p){f=!0,o.abort();const g=new Error(p==="ESOCKETTIMEDOUT"?`Socket timed out on request to ${n.url}`:`Connection timed out on request to ${n.url}`);g.code=p,t.channels.error.publish(g)}function y(p){(p||l||o&&o.readyState>=2&&i.connect)&&clearTimeout(i.connect),i.socket&&clearTimeout(i.socket)}function h(p){if(d)return;y(!0),d=!0,o=null;const g=p||new Error(`Network error while attempting to reach ${n.url}`);g.isNetworkError=!0,g.request=n,e(g)}},bo=(t=[],e=el)=>wo(t,e);var tl={},ns,is,ss,os,as,ii={exports:{}};as||(as=1,function(t,e){e.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;n.splice(1,0,i,"color: inherit");let s=0,o=0;n[0].replace(/%[a-zA-Z%]/g,a=>{a!=="%%"&&(s++,a==="%c"&&(o=s))}),n.splice(o,0,i)},e.save=function(n){try{n?e.storage.setItem("debug",n):e.storage.removeItem("debug")}catch{}},e.load=function(){let n;try{n=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!n&&typeof process<"u"&&"env"in process&&(n=tl.DEBUG),n},e.useColors=function(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;
9if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch{}}(),e.destroy=(()=>{let n=!1;return()=>{n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=(os?ss:(os=1,ss=function(n){function i(a){let u,l,d,f=null;function v(...y){if(!v.enabled)return;const h=v,p=Number(new Date),g=p-(u||p);h.diff=g,h.prev=u,h.curr=p,u=p,y[0]=i.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let m=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(x,A)=>{if(x==="%%")return"%";m++;const C=i.formatters[A];if(typeof C=="function"){const G=y[m];x=C.call(h,G),y.splice(m,1),m--}return x}),i.formatArgs.call(h,y),(h.log||i.log).apply(h,y)}return v.namespace=a,v.useColors=i.useColors(),v.color=i.selectColor(a),v.extend=s,v.destroy=i.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(l!==i.namespaces&&(l=i.namespaces,d=i.enabled(a)),d),set:y=>{f=y}}),typeof i.init=="function"&&i.init(v),v}function s(a,u){const l=i(this.namespace+(typeof u>"u"?":":u)+a);return l.log=this.log,l}function o(a,u){let l=0,d=0,f=-1,v=0;for(;l<a.length;)if(d<u.length&&(u[d]===a[l]||u[d]==="*"))u[d]==="*"?(f=d,v=l,d++):(l++,d++);else{if(f===-1)return!1;d=f+1,v++,l=v}for(;d<u.length&&u[d]==="*";)d++;return d===u.length}return i.debug=i,i.default=i,i.coerce=function(a){return a instanceof Error?a.stack||a.message:a},i.disable=function(){const a=[...i.names,...i.skips.map(u=>"-"+u)].join(",");return i.enable(""),a},i.enable=function(a){i.save(a),i.namespaces=a,i.names=[],i.skips=[];const u=(typeof a=="string"?a:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const l of u)l[0]==="-"?i.skips.push(l.slice(1)):i.names.push(l)},i.enabled=function(a){for(const u of i.skips)if(o(a,u))return!1;for(const u of i.names)if(o(a,u))return!0;return!1},i.humanize=function(){if(is)return ns;is=1;var a=1e3,u=60*a,l=60*u,d=24*l,f=7*d;function v(y,h,p,g){var m=h>=1.5*p;return Math.round(y/p)+" "+g+(m?"s":"")}return ns=function(y,h){h=h||{};var p,g,m=typeof y;if(m==="string"&&y.length>0)return function(x){if(!((x=String(x)).length>100)){var A=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(x);if(A){var C=parseFloat(A[1]);switch((A[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*C;case"weeks":case"week":case"w":return C*f;case"days":case"day":case"d":return C*d;case"hours":case"hour":case"hrs":case"hr":case"h":return C*l;case"minutes":case"minute":case"mins":case"min":case"m":return C*u;case"seconds":case"second":case"secs":case"sec":case"s":return C*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return C;default:return}}}}(y);if(m==="number"&&isFinite(y))return h.long?(p=y,(g=Math.abs(p))>=d?v(p,g,d,"day"):g>=l?v(p,g,l,"hour"):g>=u?v(p,g,u,"minute"):g>=a?v(p,g,a,"second"):p+" ms"):function(x){var A=Math.abs(x);return A>=d?Math.round(x/d)+"d":A>=l?Math.round(x/l)+"h":A>=u?Math.round(x/u)+"m":A>=a?Math.round(x/a)+"s":x+"ms"}(y);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(y))}}(),i.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}
9,Object.keys(n).forEach(a=>{i[a]=n[a]}),i.names=[],i.skips=[],i.formatters={},i.selectColor=function(a){let u=0;for(let l=0;l<a.length;l++)u=(u<<5)-u+a.charCodeAt(l),u|=0;return i.colors[Math.abs(u)%i.colors.length]},i.enable(i.load()),i}))(e);const{formatters:r}=t.exports;r.j=function(n){try{return JSON.stringify(n)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}}(ii,ii.exports)),ii.exports;const rl=typeof Buffer>"u"?()=>!1:t=>Buffer.isBuffer(t);function us(t){return Object.prototype.toString.call(t)==="[object Object]"}function nl(t){if(us(t)===!1)return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(us(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)}const il=["boolean","string","number"];function Eo(){return{processOptions:t=>{const e=t.body;return!e||typeof e.pipe=="function"||rl(e)||il.indexOf(typeof e)===-1&&!Array.isArray(e)&&!nl(e)?t:Object.assign({},t,{body:JSON.stringify(t.body),headers:Object.assign({},t.headers,{"Content-Type":"application/json"})})}}}function $o(t){return{onResponse:r=>{const n=r.headers["content-type"]||"",i=t&&t.force||n.indexOf("application/json")!==-1;return r.body&&n&&i?Object.assign({},r,{body:e(r.body)}):r},processOptions:r=>Object.assign({},r,{headers:Object.assign({Accept:"application/json"},r.headers)})};function e(r){try{return JSON.parse(r)}catch(n){throw n.message=`Failed to parsed response body as JSON: ${n.message}`,n}}}let _r={};typeof globalThis<"u"?_r=globalThis:typeof window<"u"?_r=window:typeof global<"u"?_r=global:typeof self<"u"&&(_r=self);var sl=_r;function Io(t={}){const e=t.implementation||sl.Observable;if(!e)throw new Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:(r,n)=>new e(i=>(r.error.subscribe(s=>i.error(s)),r.progress.subscribe(s=>i.next(Object.assign({type:"progress"},s))),r.response.subscribe(s=>{i.next(Object.assign({type:"response"},s)),i.complete()}),r.request.publish(n),()=>r.abort.publish()))}}function xo(){return{onRequest:t=>{if(t.adapter!=="xhr")return;const e=t.request,r=t.context;function n(i){return s=>{const o=s.lengthComputable?s.loaded/s.total*100:-1;r.channels.progress.publish({stage:i,percent:o,total:s.total,loaded:s.loaded,lengthComputable:s.lengthComputable})}}"upload"in e&&"onprogress"in e.upload&&(e.upload.onprogress=n("upload")),"onprogress"in e&&(e.onprogress=n("download"))}}}var So=(t,e,r)=>(r.method==="GET"||r.method==="HEAD")&&(t.isNetworkError||!1);function ol(t){return 100*Math.pow(2,t)+100*Math.random()}const hn=(t={})=>(e=>{const r=e.maxRetries||5,n=e.retryDelay||ol,i=e.shouldRetry;return{onError:(s,o)=>{const a=o.options,u=a.maxRetries||r,l=a.retryDelay||n,d=a.shouldRetry||i,f=a.attemptNumber||0;if((v=a.body)!==null&&typeof v=="object"&&typeof v.pipe=="function"||!d(s,f,a)||f>=u)return s;var v;const y=Object.assign({},o,{options:Object.assign({},a,{attemptNumber:f+1})});return setTimeout(()=>o.channels.request.publish(y),l(f)),null}}})({shouldRetry:So,...t});hn.shouldRetry=So;function V(t){return typeof t=="function"}function Wn(t){var e=function(n){Error.call(n),n.stack=new Error().stack},r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var si=Wn(function(t){return function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
10`+r.map(function(n,i){return i+1+") "+n.toString()}).join(`
11  `):"",this.name="UnsubscriptionError",this.errors=r}});function pr(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var At=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,n,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=pt(o),u=a.next();!u.done;u=a.next()){var l=u.value;l.remove(this)}}catch(p){e={error:p}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}else o.remove(this);var d=this.initialTeardown;if(V(d))try{d()}catch(p){s=p instanceof si?p.errors:[p]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var v=pt(f),y=v.next();!y.done;y=v.next()){var h=y.value;try{cs(h)}
vendor: 5,763 bytes, line 11
11catch(p){s=s??[],p instanceof si?s=_e(_e([],$e(s)),$e(p.errors)):s.push(p)}}}catch(p){n={error:p}}finally{try{y&&!y.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}}if(s)throw new si(s)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)cs(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&pr(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&pr(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Co=At.EMPTY;function Ao(t){return t instanceof At||t&&"closed"in t&&V(t.remove)&&V(t.add)&&V(t.unsubscribe)}function cs(t){V(t)?t():t.unsubscribe()}var al={Promise:void 0},ul={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,_e([t,e],$e(r)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function _o(t){ul.setTimeout(function(){throw t})}function Nt(){}function jn(t){t()}var Ii=function(t){Pe(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Ao(r)&&r.add(n)):n.destination=fl,n}return e.create=function(r,n,i){return new yr(r,n,i)},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(At),cl=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){Cn(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){Cn(n)}else Cn(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){Cn(r)}},t}(),yr=function(t){Pe(e,t);function e(r,n,i){var s=t.call(this)||this,o;return V(r)||!r?o={next:r??void 0,error:n??void 0,complete:i??void 0}:o=r,s.destination=new cl(o),s}return e}(Ii);function Cn(t){_o(t)}function ll(t){throw t}var fl={closed:!0,next:Nt,error:ll,complete:Nt},xi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Be(t){return t}function dl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return jo(t)}function jo(t){return t.length===0?Be:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}var N=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this,s=pl(e)?e:new yr(e,r,n);return jn(function(){var o=i,a=o.operator,u=o.source;s.add(a?a.call(s,u):u?i._subscribe(s):i._trySubscribe(s))}),s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=ls(r),new r(function(i,s){var o=new yr({next:function(a){try{e(a)}catch(u){s(u),o.unsubscribe()}},error:s,complete:i});n.subscribe(o)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[xi]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return jo(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=ls(e),new e(function(n,i){var s;r.subscribe(function(o){return s=o},function(o){return i(o)},function(){return n(s)})})},t.create=function(e){return new t(e)},t}();function ls(t){var e;return(e=t??al.Promise)!==null&&e!==void 0?e:Promise}function hl(t){return t&&V(t.next)&&V(t.error)&&V(t.complete)}function pl(t){return t&&t instanceof Ii||hl(t)&&Ao(t)}function To(t){return V(t==null?void 0:t.lift)}function U(t){return function(e){if(To(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function M(t,e,r,n,i){return new Oo(t,e,r,n,i)}var Oo=function(t){Pe(e,t);function e(r,n,i,s,o,a){var u=t.call(this,r)||this;return u.onFinalize=o,u.shouldUnsubscribe=a,u._next=n?function(l){try{n(l)}catch(d){r.error(d)}}:t.prototype._next,u._error=s?function(l){try{s(l)}catch(d){r.error(d)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=i?function(){try{i()}catch(l){r.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,u}return e.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},e}(Ii);function yl(){return U(function(t,e){var r=null;t._refCount++;var n=M(e,void 0,void 0,void 0,function(){if(!t||t._refCount<=0||0<--t._refCount){r=null;return}var i=t._connection,s=r;r=null,i&&(!s||i===s)&&i.unsubscribe(),e.unsubscribe()});t.subscribe(n),n.closed||(r=t.connect())})}var vl=function(t){Pe(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subjectFactory=n,i._subject=null,i._refCount=0,i._connection=null,To(r)&&(i.lift=r.lift),i}
11return e.prototype._subscribe=function(r){return this.getSubject().subscribe(r)},e.prototype.getSubject=function(){var r=this._subject;return(!r||r.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var r=this._connection;this._subject=this._connection=null,r==null||r.unsubscribe()},e.prototype.connect=function(){var r=this,n=this._connection;if(!n){n=this._connection=new At;var i=this.getSubject();n.add(this.source.subscribe(M(i,void 0,function(){r._teardown(),i.complete()},function(s){r._teardown(),i.error(s)},function(){return r._teardown()}))),n.closed&&(this._connection=null,n=At.EMPTY)}return n},e.prototype.refCount=function(){return yl()(this)},e}(N),ml=Wn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),br=function(t){Pe(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var n=new fs(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new ml},e.prototype.next=function(r){var n=this;jn(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=pt(n.currentObservers),a=o.next();!a.done;a=o.next()){var u=a.value;u.next(r)}}catch(l){i={error:l}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;jn(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},e.prototype.complete=function(){var r=this;jn(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,s=i.hasError,o=i.isStopped,a=i.observers;return s||o?Co:(this.currentObservers=null,a.push(r),new At(function(){n.currentObservers=null,pr(a,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,s=n.thrownError,o=n.isStopped;i?r.error(s):o&&r.complete()},e.prototype.asObservable=function(){var r=new N;return r.source=this,r},e.create=function(r,n){return new fs(r,n)},e}(N),fs=function(t){Pe(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:Co},e}(br),Ty=function(t){Pe(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,i=r.thrownError,s=r._value;if(n)throw i;return this._throwIfClosed(),s},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(br),Si={now:function(){return(Si.delegate||Date).now()},delegate:void 0},Po=function(t){Pe(e,t);function e(r,n,i){r===void 0&&(r=1/0),n===void 0&&(n=1/0),i===void 0&&(i=Si);var s=t.call(this)||this;return s._bufferSize=r,s._windowTime=n,s._timestampProvider=i,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=n===1/0,s._bufferSize=Math.max(1,r),s._windowTime=Math.max(1,n),s}return e.prototype.next=function(r){var n=this,i=n.isStopped,s=n._buffer,o=n._infiniteTimeWindow,a=n._timestampProvider,u=n._windowTime;i||(s.push(r),!o&&s.push(a.now()+u)),this._trimBuffer(),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),i=this,s=i._infiniteTimeWindow,o=i._buffer,a=o.slice(),u=0;u<a.length&&!r.closed;u+=s?1:2)r.next(a[u]);return this._checkFinalizedStatuses(r),n},e.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,i=r._timestampProvider,s=r._buffer,o=r._infiniteTimeWindow,a=(o?1:2)*n;if(n<1/0&&a<s.length&&s.splice(0,s.length-a),!o){for(var u=i.now(),l=0,d=1;d<s.length&&s[d]<=u;d+=2)l=d;l&&s.splice(0,l+1)}},e}(br),gl=function(t){Pe(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return this},e}(At),ds={setInterval:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,_e([t,e],$e(r)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},ko=function(t){Pe(e,t);function e(r,n){var i=t.call(this,r,n)||this;
11return i.scheduler=r,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var s=this.id,o=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(o,s,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),ds.setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&ds.clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,s;try{this.work(r)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,pr(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(gl),wl=1,oi,mi={};function hs(t){return t in mi?(delete mi[t],!0):!1}var Ro={setImmediate:function(t){var e=wl++;return mi[e]=!0,oi||(oi=Promise.resolve()),oi.then(function(){return hs(e)&&t()}),e},clearImmediate:function(t){hs(t)}},bl=Ro.setImmediate,El=Ro.clearImmediate,ps={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return bl.apply(void 0,_e([],$e(t)))},clearImmediate:function(t){return El(t)},delegate:void 0},$l=function(t){Pe(e,t);function e(r,n){var i=t.call(this,r,n)||this;
11return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r._scheduled||(r._scheduled=ps.setImmediate(r.flush.bind(r,void 0))))},e.prototype.recycleAsyncId=function(r,n,i){var s;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);var o=r.actions;n!=null&&((s=o[o.length-1])===null||s===void 0?void 0:s.id)!==n&&(ps.clearImmediate(n),r._scheduled===n&&(r._scheduled=void 0))},e}(ko),ys=function(){function t(e,r){r===void 0&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,e).schedule(n,r)},t.now=Si.now,t}(),Do=function(t){Pe(e,t);function e(r,n){n===void 0&&(n=ys.now);var i=t.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(ys),Il=function(t){Pe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,s;r=r||i.shift();do if(s=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,s){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw s}},e}(Do),Oy=new Il($l),_t=new Do(ko),xl=_t,Er=new N(function(t){return t.complete()});function Mo(t){return t&&V(t.schedule)}function Ci(t){return t[t.length-1]}function Bn(t){return V(Ci(t))?t.pop():void 0}function Ht(t){return Mo(Ci(t))?t.pop():void 0}function Sl(t,e){return typeof Ci(t)=="number"?t.pop():e}var Ai=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Lo(t){return V(t==null?void 0:t.then)}function qo(t){return V(t[xi])}function Uo(t){return Symbol.asyncIterator&&V(t==null?void 0:t[Symbol.asyncIterator])}function Fo(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Cl(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Vo=Cl();function No(t){return V(t==null?void 0:t[Vo])}function Ho(t){return ic(this,arguments,function(){var r,n,i,s;return so(this,function(o){switch(o.label){case 0:r=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,ni(r.read())];case 3:return n=o.sent(),i=n.value,s=n.done,s?[4,ni(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,ni(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Wo(t){return V(t==null?void 0:t.getReader)}function Q(t){if(t instanceof N)return t;if(t!=null){if(qo(t))return Al(t);if(Ai(t))return _l(t);if(Lo(t))return jl(t);if(Uo(t))return Bo(t);if(No(t))return Tl(t);if(Wo(t))return Ol(t)}throw Fo(t)}function Al(t){return new N(function(e){var r=t[xi]();if(V(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function _l(t){return new N(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}function jl(t){return new N(function(e){t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,_o)})}function Tl(t){return new N(function(e){var r,n;try{for(var i=pt(t),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(a){r={error:a}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()})}function Bo(t){return new N(function(e){Pl(t,e).catch(function(r){return e.error(r)})})}function Ol(t){return Bo(Ho(t))}function Pl(t,e){var r,n,i,s;return sc(this,void 0,void 0,function(){var o,a;return so(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),r=oc(t),u.label=1;case 1:return[4,r.next()];case 2:if(n=u.sent(),!!n.done)return[3,4];if(o=n.value,e.next(o),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=u.sent(),i={error:a},[3,11];case 6:return u.trys.push([6,,9,10]),n&&!n.done&&(s=r.return)?[4,s.call(r)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];
11case 10:return[7];case 11:return e.complete(),[2]}})})}function He(t,e,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var s=e.schedule(function(){r(),i?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(s),!i)return s}function zo(t,e){return e===void 0&&(e=0),U(function(r,n){r.subscribe(M(n,function(i){return He(n,t,function(){return n.next(i)},e)},function(){return He(n,t,function(){return n.complete()},e)},function(i){return He(n,t,function(){return n.error(i)},e)}))})}function Go(t,e){return e===void 0&&(e=0),U(function(r,n){n.add(t.schedule(function(){return r.subscribe(n)},e))})}function kl(t,e){return Q(t).pipe(Go(e),zo(e))}function Rl(t,e){return Q(t).pipe(Go(e),zo(e))}function Dl(t,e){return new N(function(r){var n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}function Ml(t,e){return new N(function(r){var n;return He(r,e,function(){n=t[Vo](),He(r,e,function(){var i,s,o;try{i=n.next(),s=i.value,o=i.done}catch(a){r.error(a);return}o?r.complete():r.next(s)},0,!0)}),function(){return V(n==null?void 0:n.return)&&n.return()}})}function Qo(t,e){if(!t)throw new Error("Iterable cannot be null");return new N(function(r){He(r,e,function(){var n=t[Symbol.asyncIterator]();He(r,e,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}function Ll(t,e){return Qo(Ho(t),e)}function ql(t,e){if(t!=null){if(qo(t))return kl(t,e);if(Ai(t))return Dl(t,e);if(Lo(t))return Rl(t,e);if(Uo(t))return Qo(t,e);if(No(t))return Ml(t,e);if(Wo(t))return Ll(t,e)}throw Fo(t)}function jt(t,e){return e?ql(t,e):Q(t)}function Ke(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Ht(t);return jt(t,r)}function pn(t,e){var r=V(t)?t:function(){return t},n=function(i){return i.error(r())};return new N(n)}function Jo(t){return!!t&&(t instanceof N||V(t.lift)&&V(t.subscribe))}var yn=Wn(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function R(t,e){var r=typeof e=="object";return new Promise(function(n,i){var s=!1,o;t.subscribe({next:function(a){o=a,s=!0},error:i,complete:function(){s?n(o):r?n(e.defaultValue):i(new yn)}})})}function ai(t,e){return new Promise(function(r,n){var i=new yr({next:function(s){r(s),i.unsubscribe()},error:n,complete:function(){n(new yn)}});t.subscribe(i)})}function Xo(t){return t instanceof Date&&!isNaN(t)}var Ul=Wn(function(t){return function(r){r===void 0&&(r=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r}});function Py(t,e){var r=Xo(t)?{first:t}:typeof t=="number"?{each:t}:t,n=r.first,i=r.each,s=r.with,o=s===void 0?Fl:s,a=r.scheduler,u=a===void 0?_t:a,l=r.meta,d=l===void 0?null:l;if(n==null&&i==null)throw new TypeError("No timeout provided.");return U(function(f,v){var y,h,p=null,g=0,m=function(x){h=He(v,u,function(){try{y.unsubscribe(),Q(o({meta:d,lastValue:p,seen:g})).subscribe(v)}catch(A){v.error(A)}},x)};y=f.subscribe(M(v,function(x){h==null||h.unsubscribe(),g++,v.next(p=x),i>0&&m(i)},void 0,void 0,function(){h!=null&&h.closed||h==null||h.unsubscribe(),p=null})),!g&&m(n!=null?typeof n=="number"?n:+n-u.now():i)})}function Fl(t){throw new Ul(t)}function X(t,e){return U(function(r,n){var i=0;r.subscribe(M(n,function(s){n.next(t.call(e,s,i++))}))})}var Vl=Array.isArray;function Nl(t,e){return Vl(e)?t.apply(void 0,_e([],$e(e))):t(e)}function zn(t){return X(function(e){return Nl(t,e)})}var Hl=Array.isArray,Wl=Object.getPrototypeOf,Bl=Object.prototype,zl=Object.keys;function Yo(t){if(t.length===1){var e=t[0];if(Hl(e))return{args:e,keys:null};if(Gl(e)){var r=zl(e);return{args:r.map(function(n){return e[n]}),keys:r}}}return{args:t,keys:null}}function Gl(t){return t&&typeof t=="object"&&Wl(t)===Bl}function Ko(t,e){return t.reduce(function(r,n,i){return r[n]=e[i],r},{})}function ky(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Ht(t),n=Bn(t),i=Yo(t),s=i.args,o=i.keys;if(s.length===0)return jt([],r);var a=new N(Zo(s,r,o?function(u){return Ko(o,u)}:Be));return n?a.pipe(zn(n)):a}function Zo(t,e,r){return r===void 0&&(r=Be),function(n){vs(e,function(){for(var i=t.length,s=new Array(i),o=i,a=i,u=function(d){vs(e,function(){var f=jt(t[d],e),v=!1;f.subscribe(M(n,function(y){s[d]=y,v||(v=!0,a--),a||n.next(r(s.slice()))},function(){--o||n.complete()}
11))},n)},l=0;l<i;l++)u(l)},n)}}function vs(t,e,r){t?He(r,t,e):e()}function ea(t,e,r,n,i,s,o,a){var u=[],l=0,d=0,f=!1,v=function(){f&&!u.length&&!l&&e.complete()},y=function(p){return l<n?h(p):u.push(p)},h=function(p){s&&e.next(p),l++;var g=!1;Q(r(p,d++)).subscribe(M(e,function(m){s?y(m):e.next(m)},function(){g=!0},void 0,function(){if(g)try{l--;for(var m=function(){var x=u.shift();o||h(x)};u.length&&l<n;)m();v()}catch(x){e.error(x)}}))};return t.subscribe(M(e,y,function(){f=!0,v()})),function(){}}function ve(t,e,r){return r===void 0&&(r=1/0),V(e)?ve(function(n,i){return X(function(s,o){return e(n,s,i,o)})(Q(t(n,i)))},r):(typeof e=="number"&&(r=e),U(function(n,i){return ea(n,i,t,r)}))}function ta(t){return t===void 0&&(t=1/0),ve(Be,t)}function ra(){return ta(1)}function qr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ra()(jt(t,Ht(t)))}function vn(t){return new N(function(e){Q(t()).subscribe(e)})}function Ry(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Bn(t),n=Yo(t),i=n.args,s=n.keys,o=new N(function(a){var u=i.length;if(!u){a.complete();return}for(var l=new Array(u),d=u,f=u,v=function(h){var p=!1;Q(i[h]).subscribe(M(a,function(g){p||(p=!0,f--),l[h]=g},function(){return d--},void 0,function(){(!d||!p)&&(f||a.next(s?Ko(s,l):l),a.complete())}))},y=0;y<u;y++)v(y)});return r?o.pipe(zn(r)):o}var Ql=["addListener","removeListener"],Jl=["addEventListener","removeEventListener"],Xl=["on","off"];function ms(t,e,r,n){if(V(r)&&(n=r,r=void 0),n)return ms(t,e,r).pipe(zn(n));var i=$e(Zl(t)?Jl.map(function(a){return function(u){return t[a](e,u,r)}}):Yl(t)?Ql.map(gs(t,e)):Kl(t)?Xl.map(gs(t,e)):[],2),s=i[0],o=i[1];if(!s&&Ai(t))return ve(function(a){return ms(a,e,r)})(Q(t));if(!s)throw new TypeError("Invalid event target");return new N(function(a){var u=function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];return a.next(1<l.length?l:l[0])};return s(u),function(){return o(u)}})}function gs(t,e){return function(r){return function(n){return t[r](e,n)}}}function Yl(t){return V(t.addListener)&&V(t.removeListener)}function Kl(t){return V(t.on)&&V(t.off)}function Zl(t){return V(t.addEventListener)&&V(t.removeEventListener)}function Dy(t,e,r){return vn(function(){return t()?e:r})}function Tt(t,e,r){t===void 0&&(t=0),r===void 0&&(r=xl);var n=-1;return e!=null&&(Mo(e)?r=e:n=e),new N(function(i){var s=Xo(t)?+t-r.now():t;s<0&&(s=0);var o=0;return r.schedule(function(){i.closed||(i.next(o++),0<=n?this.schedule(void 0,n):i.complete())},s)})}function My(t,e){return e===void 0&&(e=_t),Tt(t,t,e)}function na(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Ht(t),n=Sl(t,1/0),i=t;return i.length?i.length===1?Q(i[0]):ta(n)(jt(i,r)):Er}var Ly=new N(Nt),ef=Array.isArray;function ia(t){return t.length===1&&ef(t[0])?t[0]:t}function tf(t,e){return function(r,n){return!t.call(e,r,n)}}function me(t,e){return U(function(r,n){var i=0;r.subscribe(M(n,function(s){return t.call(e,s,i++)&&n.next(s)}))})}function qy(t,e,r){return[me(e,r)(Q(t)),me(tf(e,r))(Q(t))]}function Uy(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t=ia(t),t.length===1?Q(t[0]):new N(rf(t))}function rf(t){return function(e){for(var r=[],n=function(s){r.push(Q(t[s]).subscribe(M(e,function(o){if(r){for(var a=0;a<r.length;a++)a!==s&&r[a].unsubscribe();r=null}e.next(o)})))},i=0;r&&!e.closed&&i<t.length;i++)n(i)}}function Fy(t,e){return new N(function(r){var n=t(),i=e(n),s=i?Q(i):Er;return s.subscribe(r),function(){n&&n.unsubscribe()}})}function nf(t){return U(function(e,r){var n=!1,i=null,s=null,o=!1,a=function(){if(s==null||s.unsubscribe(),s=null,n){n=!1;var l=i;
11i=null,r.next(l)}o&&r.complete()},u=function(){s=null,o&&r.complete()};e.subscribe(M(r,function(l){n=!0,i=l,s||Q(t(l)).subscribe(s=M(r,a,u))},function(){o=!0,(!n||!s||s.closed)&&r.complete()}))})}function Vy(t,e){return e===void 0&&(e=_t),nf(function(){return Tt(t,e)})}function Ny(t,e){return e===void 0&&(e=null),e=e??t,U(function(r,n){var i=[],s=0;r.subscribe(M(n,function(o){var a,u,l,d,f=null;s++%e===0&&i.push([]);try{for(var v=pt(i),y=v.next();!y.done;y=v.next()){var h=y.value;h.push(o),t<=h.length&&(f=f??[],f.push(h))}}catch(m){a={error:m}}finally{try{y&&!y.done&&(u=v.return)&&u.call(v)}finally{if(a)throw a.error}}if(f)try{for(var p=pt(f),g=p.next();!g.done;g=p.next()){var h=g.value;pr(i,h),n.next(h)}}catch(m){l={error:m}}finally{try{g&&!g.done&&(d=p.return)&&d.call(p)}finally{if(l)throw l.error}}},function(){var o,a;try{for(var u=pt(i),l=u.next();!l.done;l=u.next()){var d=l.value;n.next(d)}}catch(f){o={error:f}}finally{try{l&&!l.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}n.complete()},void 0,function(){i=null}))})}function Hy(t){for(var e,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var s=(e=Ht(n))!==null&&e!==void 0?e:_t,o=(r=n[0])!==null&&r!==void 0?r:null,a=n[1]||1/0;return U(function(u,l){var d=[],f=!1,v=function(p){var g=p.buffer,m=p.subs;m.unsubscribe(),pr(d,p),l.next(g),f&&y()},y=function(){if(d){var p=new At;l.add(p);var g=[],m={buffer:g,subs:p};d.push(m),He(p,s,function(){return v(m)},t)}};o!==null&&o>=0?He(l,s,y,o,!0):f=!0,y();var h=M(l,function(p){var g,m,x=d.slice();try{for(var A=pt(x),C=A.next();!C.done;C=A.next()){var G=C.value,W=G.buffer;W.push(p),a<=W.length&&v(G)}}catch(Ie){g={error:Ie}}finally{try{C&&!C.done&&(m=A.return)&&m.call(A)}finally{if(g)throw g.error}}},function(){for(;d!=null&&d.length;)l.next(d.shift().buffer);h==null||h.unsubscribe(),l.complete(),l.unsubscribe()},void 0,function(){return d=null});u.subscribe(h)})}function mn(t){return U(function(e,r){var n=null,i=!1,s;n=e.subscribe(M(r,void 0,void 0,function(o){s=Q(t(o,mn(t)(e))),n?(n.unsubscribe(),n=null,s.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,s.subscribe(r))})}function sa(t,e,r,n,i){return function(s,o){var a=r,u=e,l=0;s.subscribe(M(o,function(d){var f=l++;u=a?t(u,d,f):(a=!0,d),n&&o.next(u)},i&&function(){a&&o.next(u),o.complete()}))}}function oa(t,e){return U(sa(t,e,arguments.length>=2,!1,!0))}var sf=function(t,e){return t.push(e),t};function Wy(){return U(function(t,e){oa(sf,[])(t).subscribe(e)})}function aa(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Bn(t);return r?dl(aa.apply(void 0,_e([],$e(t))),zn(r)):U(function(n,i){Zo(_e([n],$e(ia(t))))(i)})}function ua(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return aa.apply(void 0,_e([],$e(t)))}function By(t,e){return V(e)?ve(t,e,1):ve(t,1)}function of(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Ht(t);return U(function(n,i){ra()(jt(_e([n],$e(t)),r)).subscribe(i)})}function zy(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return of.apply(void 0,_e([],$e(t)))}function af(t){return new N(function(e){return t.subscribe(e)})}var uf={connector:function(){return new br}};function cf(t,e){e===void 0&&(e=uf);var r=e.connector;return U(function(n,i){var s=r();Q(t(af(s))).subscribe(i),i.add(n.subscribe(s))})}function Gy(t){return oa(function(e,r,n){return e+1},0)}function Qy(t){return U(function(e,r){var n=!1,i=null,s=null,o=function(){if(s==null||s.unsubscribe(),s=null,n){n=!1;var a=i;i=null,r.next(a)}};e.subscribe(M(r,function(a){s==null||s.unsubscribe(),n=!0,i=a,s=M(r,o,Nt),Q(t(a)).subscribe(s)},function(){o(),r.complete()},void 0,function(){i=s=null}))})}function Jy(t,e){return e===void 0&&(e=_t),U(function(r,n){var i=null,s=null,o=null,a=function(){if(i){i.unsubscribe(),i=null;var l=s;s=null,n.next(l)}};function u(){var l=o+t,d=e.now();if(d<l){i=this.schedule(void 0,l-d),n.add(i);return}a()}r.subscribe(M(n,function(l){s=l,o=e.now(),i||(i=e.schedule(u,t),n.add(i))},function(){a(),n.complete()},void 0,function(){s=i=null}))})}function ca(t){return U(function(e,r){var n=!1;e.subscribe(M(r,function(i){n=!0,r.next(i)},function(){n||r.next(t),r.complete()}
11))})}function la(t){return t<=0?function(){return Er}:U(function(e,r){var n=0;e.subscribe(M(r,function(i){++n<=t&&(r.next(i),t<=n&&r.complete())}))})}function lf(t){return X(function(){return t})}function ff(t,e){return ve(function(r,n){return Q(t(r,n)).pipe(la(1),lf(r))})}function Xy(t,e){e===void 0&&(e=_t);var r=Tt(t,e);return ff(function(){return r})}function Yy(t,e){return U(function(r,n){var i=new Set;r.subscribe(M(n,function(s){var o=t?t(s):s;i.has(o)||(i.add(o),n.next(s))})),e&&Q(e).subscribe(M(n,function(){return i.clear()},Nt))})}function Ky(t,e){return e===void 0&&(e=Be),t=t??df,U(function(r,n){var i,s=!0;r.subscribe(M(n,function(o){var a=e(o);(s||!t(i,a))&&(s=!1,i=a,n.next(o))}))})}function df(t,e){return t===e}function fa(t){return t===void 0&&(t=hf),U(function(e,r){var n=!1;e.subscribe(M(r,function(i){n=!0,r.next(i)},function(){return n?r.complete():r.error(t())}))})}function hf(){return new yn}function Zy(t,e){return U(function(r,n){var i=0,s=null,o=!1;r.subscribe(M(n,function(a){s||(s=M(n,void 0,function(){s=null,o&&n.complete()}),Q(t(a,i++)).subscribe(s))},function(){o=!0,!s&&n.complete()}))})}function ev(t,e,r){return e===void 0&&(e=1/0),e=(e||0)<1?1/0:e,U(function(n,i){return ea(n,i,t,e,void 0,!0,r)})}function Gn(t){return U(function(e,r){try{e.subscribe(r)}finally{r.add(t)}})}function tv(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?me(function(i,s){return t(i,s,n)}):Be,la(1),r?ca(e):fa(function(){return new yn}))}}function rv(t,e,r,n){return U(function(i,s){var o;!e||typeof e=="function"?o=e:(r=e.duration,o=e.element,n=e.connector);var a=new Map,u=function(h){a.forEach(h),h(s)},l=function(h){return u(function(p){return p.error(h)})},d=0,f=!1,v=new Oo(s,function(h){try{var p=t(h),g=a.get(p);if(!g){a.set(p,g=n?n():new br);var m=y(p,g);if(s.next(m),r){var x=M(g,function(){g.complete(),x==null||x.unsubscribe()},void 0,void 0,function(){return a.delete(p)});v.add(Q(r(m)).subscribe(x))}}g.next(o?o(h):h)}catch(A){l(A)}},function(){return u(function(h){return h.complete()})},l,function(){return a.clear()},function(){return f=!0,d===0});i.subscribe(v);function y(h,p){var g=new N(function(m){d++;var x=p.subscribe(m);return function(){x.unsubscribe(),--d===0&&f&&v.unsubscribe()}});return g.key=h,g}})}function pf(t){return t<=0?function(){return Er}:U(function(e,r){var n=[];e.subscribe(M(r,function(i){n.push(i),t<n.length&&n.shift()},function(){var i,s;try{for(var o=pt(n),a=o.next();!a.done;a=o.next()){var u=a.value;r.next(u)}}catch(l){i={error:l}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}r.complete()},void 0,function(){n=null}))})}function nv(t,e){var r=arguments.length>=2;return function(n){return n.pipe(Be,pf(1),r?ca(e):fa(function(){return new yn}))}}function iv(t,e,r){return r===void 0&&(r=1/0),V(e)?ve(function(){return t},e,r):ve(function(){return t},r)}function yf(t,e){var r=V(t)?t:function(){return t};return V(e)?cf(e,{connector:r}):function(n){return new vl(n,r)}}function sv(){return U(function(t,e){var r,n=!1;t.subscribe(M(e,function(i){var s=r;r=i,n&&e.next([s,i]),n=!0}))})}function ov(t,e,r,n){var i=V(r)?r:void 0;return function(s){return yf(new Po(t,e,n),i)(s)}}function av(t){var e,r=1/0,n;return t!=null&&(typeof t=="object"?(e=t.count,r=e===void 0?1/0:e,n=t.delay):r=t),r<=0?function(){return Er}:U(function(i,s){var o=0,a,u=function(){if(a==null||a.unsubscribe(),a=null,n!=null){var d=typeof n=="number"?Tt(n):Q(n(o)),f=M(s,function(){f.unsubscribe(),l()});d.subscribe(f)}else l()},l=function(){var d=!1;a=i.subscribe(M(s,void 0,function(){++o<r?a?u():d=!0:s.complete()})),d&&u()};l()})}function uv(t){t===void 0&&(t=1/0);var e;t&&typeof t=="object"?e=t:e={count:t};var r=e.count,n=r===void 0?1/0:r,i=e.delay,s=e.resetOnSuccess,o=s===void 0?!1:s;return n<=0?Be:U(function(a,u){var l=0,d,f=function(){var v=!1;d=a.subscribe(M(u,function(y){o&&(l=0),u.next(y)},void 0,function(y){if(l++<n){var h=function(){d?(d.unsubscribe(),d=null,f()):v=!0};if(i!=null){var p=typeof i=="number"?Tt(i):Q(i(y,l)),g=M(u,function(){g.unsubscribe(),h()},function(){u.complete()});p.subscribe(g)}else h()}else u.error(y)})),v&&(d.unsubscribe(),d=null,f())};f()})}function cv(t,e){return U(sa(t,e,arguments.length>=2,!0))}function _i(t){t===void 0&&(t={});var e=t.connector,r=e===void 0?function(){return new br}:e,n=t.resetOnError,i=n===void 0?!0:n,s=t.resetOnComplete,o=s===void 0?!0:s,a=t.resetOnRefCountZero,u=a===void 0?!0:a;return function(l){var d,f,v,y=0,h=!1,p=!1,g=function(){f==null||f.unsubscribe(),f=void 0},m=function(){g(),d=v=void 0,h=p=!1},x=function(){var A=d;m(),A==null||A.unsubscribe()};return U(function(A,C){y++,!p&&!h&&g();var G=v=v??r();C.add(function(){y--,y===0&&!p&&!h&&(f=ui(x,u))}),G.subscribe(C),!d&&y>0&&(d=new yr({next:function(W){return G.next(W)},error:function(W){p=!0,g(),f=ui(m,i,W),G.error(W)},complete:function(){h=!0,g(),f=ui(m,o),G.complete()}}),Q(A).subscribe(d))})(l)}}function ui(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(e===!0){t();return}if(e!==!1){var i=new yr({next:function(){i.unsubscribe(),t()}});return Q(e.apply(void 0,_e([],$e(r)))).subscribe(i)}}function da(t,e,r){var n,i,s,o,a=!1;return t&&typeof t=="object"?(n=t.bufferSize,o=n===void 0?1/0:n,i=t.windowTime,e=i===void 0?1/0:i,s=t.refCount,a=s===void 0?!1:s,r=t.scheduler):o=t??1/0,_i({connector:function(){return new Po(o,e,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}function lv(t){return me(function(e,r){return t<=r})}function fv(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Ht(t);return U(function(n,i){(r?qr(t,n,r):qr(t,n)).subscribe(i)})}function gi(t,e){return U(function(r,n){var i=null,s=0,o=!1,a=function(){return o&&!i&&n.c
11omplete()};r.subscribe(M(n,function(u){i==null||i.unsubscribe();var l=0,d=s++;Q(t(u,d)).subscribe(i=M(n,function(f){return n.next(e?e(u,f,d,l++):f)},function(){i=null,a()}))},function(){o=!0,a()}))})}function dv(){return gi(Be)}function hv(t,e){return V(e)?gi(function(){return t},e):gi(function(){return t})}function pv(t){return U(function(e,r){Q(t).subscribe(M(r,function(){return r.complete()},Nt)),!r.closed&&e.subscribe(r)})}function yv(t,e){return U(function(r,n){var i=0;r.subscribe(M(n,function(s){var o=t(s,i++);(o||e)&&n.next(s),!o&&n.complete()}))})}function ha(t,e,r){var n=V(t)||e||r?{next:t,error:e,complete:r}:t;return n?U(function(i,s){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;i.subscribe(M(s,function(u){var l;(l=n.next)===null||l===void 0||l.call(n,u),s.next(u)},function(){var u;a=!1,(u=n.complete)===null||u===void 0||u.call(n),s.complete()},function(u){var l;a=!1,(l=n.error)===null||l===void 0||l.call(n,u),s.error(u)},function(){var u,l;a&&((u=n.unsubscribe)===null||u===void 0||u.call(n)),(l=n.finalize)===null||l===void 0||l.call(n)}))}):Be}function vf(t,e){return U(function(r,n){var i=e??{},s=i.leading,o=s===void 0?!0:s,a=i.trailing,u=a===void 0?!1:a,l=!1,d=null,f=null,v=!1,y=function(){f==null||f.unsubscribe(),f=null,u&&(g(),v&&n.complete())},h=function(){f=null,v&&n.complete()},p=function(m){return f=Q(t(m)).subscribe(M(n,y,h))},g=function(){if(l){l=!1;var m=d;d=null,n.next(m),!v&&p(m)}};r.subscribe(M(n,function(m){l=!0,d=m,!(f&&!f.closed)&&(o?g():p(m))},function(){v=!0,!(u&&l&&f&&!f.closed)&&n.complete()}))})}function vv(t,e,r){e===void 0&&(e=_t);var n=Tt(t,e);return vf(function(){return n},r)}function mv(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Bn(t);return U(function(n,i){for(var s=t.length,o=new Array(s),a=t.map(function(){return!1}),u=!1,l=function(f){Q(t[f]).subscribe(M(i,function(v){o[f]=v,!u&&!a[f]&&(a[f]=!0,(u=a.every(Be))&&(a=null))},Nt))},d=0;d<s;d++)l(d);n.subscribe(M(i,function(f){if(u){var v=_e([f],$e(o));i.next(r?r.apply(void 0,_e([],$e(v))):v)}}))})}var pa={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},ji={0:8203,1:8204,2:8205,3:65279},mf=new Array(4).fill(String.fromCodePoint(ji[0])).join("");function gf(t){let e=JSON.stringify(t);return`${mf}${Array.from(e).map(r=>{let n=r.charCodeAt(0);if(n>255)throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${e} on character ${r} (${n})`);return Array.from(n.toString(4).padStart(4,"0")).map(i=>String.fromCodePoint(ji[i])).join("")}).join("")}`}function wf(t){return!Number.isNaN(Number(t))||/[a-z]/i.test(t)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(t)?!1:!!Date.parse(t)}function bf(t){try{new URL(t,t.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}function Ef(t,e,r="auto"){return r===!0||r==="auto"&&(wf(t)||bf(t))?t:`${t}${gf(e)}`}Object.fromEntries(Object.entries(ji).map(t=>t.reverse()));Object.fromEntries(Object.entries(pa).map(t=>t.reverse()));var $f=`${Object.values(pa).map(t=>`\\u{${t.toString(16)}}`).join("")}`,ws=new RegExp(`[${$f}]{4,}`,"gu");function If(t){var e;return{cleaned:t.replace(ws,""),encoded:((e=t.match(ws))==null?void 0:e[0])||""}}function xf(t){return t&&JSON.parse(If(JSON.stringify(t)).cleaned)}function Sf(t){return xf(t)}let Cf=class extends Error{constructor(r){const n=ya(r);super(n.message);S(this,"response");S(this,"statusCode",400);S(this,"responseBody");S(this,"details");Object.assign(this,n)}},Af=class extends Error{constructor(r){const n=ya(r);super(n.message);S(this,"response");S(this,"statusCode",500);S(this,"responseBody");S(this,"details");Object.assign(this,n)}};function ya(t){const e=t.body,r={response:t,statusCode:t.statusCode,responseBody:Of(e,t),message:"",details:void 0};if(e.error&&e.message)return r.message=`${e.error} - ${e.message}`,r;if(_f(e)||jf(e)){const n=e.error.items||[],i=n.slice(0,5).map(o=>{var a;return(a=o.error)==null?void 0:a.description}).filter(Boolean);let s=i.length?`:
12- ${i.join(`
13- `)}`:"";return n.length>5&&(s+=`
14...and ${n.length-5} more`),r.message=`${e.error.description}${s}`,r.details=e.error,r}return e.error&&e.error.description?(r.message=e.error.description,r.details=e.error,r):(r.message=e.error||e.message||Tf(t),r)}function _f(t){return Tn(t)&&Tn(t.error)&&t.error.type==="mutationError"&&typeof t.error.description=="str
14ing"}function jf(t){return Tn(t)&&Tn(t.error)&&t.error.type==="actionError"&&typeof t.error.description=="string"}function Tn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Tf(t){const e=t.statusMessage?` ${t.statusMessage}`:"";return`${t.method}-request to ${t.url} resulted in HTTP ${t.statusCode}${e}`}function Of(t,e){return(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")!==-1?JSON.stringify(t,null,2):t}let Pf=class extends Error{constructor({projectId:r}){super("CorsOriginError");S(this,"projectId");S(this,"addOriginUrl");this.name="CorsOriginError",this.projectId=r;const n=new URL(`https://sanity.io/manage/project/${r}/api`);if(typeof location<"u"){const{origin:i}=location;n.searchParams.set("cors","add"),n.searchParams.set("origin",i),this.addOriginUrl=n,this.message=`The current origin is not allowed to connect to the Live Content API. Add it here: ${n}`}else this.message=`The current origin is not allowed to connect to the Live Content API. Change your configuration here: ${n}`}};const kf={onResponse:t=>{if(t.statusCode>=500)throw new Af(t);if(t.statusCode>=400)throw new Cf(t);return t}};function Rf(){const t={};return{onResponse:e=>{const r=e.headers["x-sanity-warning"],n=Array.isArray(r)?r:[r];for(const i of n)!i||t[i]||(t[i]=!0,console.warn(i));return e}}}function bs(t){return bo([hn({shouldRetry:Df}),...t,Rf(),Eo(),$o(),xo(),kf,Io({implementation:N})])}function Df(t,e,r){if(r.maxRetries===0)return!1;const n=r.method==="GET"||r.method==="HEAD",i=(r.uri||r.url).startsWith("/data/query"),s=t.response&&(t.response.statusCode===429||t.response.statusCode===502||t.response.statusCode===503);return(n||i)&&s?!0:hn.shouldRetry(t,e,r)}const Mf="https://www.sanity.io/help/";function Ti(t){return Mf+t}const Es=["image","file"],$s=["before","after","replace"],va=t=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(t))throw new Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},Lf=t=>{if(!/^[-a-z0-9]+$/i.test(t))throw new Error("`projectId` can only contain only a-z, 0-9 and dashes")},qf=t=>
14{if(Es.indexOf(t)===-1)throw new Error(`Invalid asset type: ${t}. Must be one of ${Es.join(", ")}`)},Or=(t,e)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new Error(`${t}() takes an object of properties`)},ma=(t,e)=>{if(typeof e!="string"||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(e)||e.includes(".."))throw new Error(`${t}(): "${e}" is not a valid document ID`)},On=(t,e)=>{if(!e._id)throw new Error(`${t}() requires that the document contains an ID ("_id" property)`);ma(t,e._id)},Uf=(t,e,r)=>{const n="insert(at, selector, items)";if($s.indexOf(t)===-1){const i=$s.map(s=>`"${s}"`).join(", ");throw new Error(`${n} takes an "at"-argument which is one of: ${i}`)}if(typeof e!="string")throw new Error(`${n} takes a "selector"-argument which must be a string`);if(!Array.isArray(r))throw new Error(`${n} takes an "items"-argument which must be an array`)},ga=t=>{if(!t.dataset)throw new Error("`dataset` must be provided to perform queries");return t.dataset||""},wa=t=>{if(typeof t!="string"||!/^[a-z0-9._-]{1,75}$/i.test(t))throw new Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return t},ba=t=>{if(!t["~experimental_resource"])throw new Error("`resource` must be provided to perform resource queries");const{type:e,id:r}=t["~experimental_resource"];switch(e){case"dataset":{if(r.split(".").length!==2)throw new Error('Dataset resource ID must be in the format "project.dataset"');return}case"dashboard":case"media-library":case"canvas":return;default:throw new Error(`Unsupported resource type: ${e.toString()}`)}},Ye=(t,e)=>{if(e["~experimental_resource"])throw new Error(`\`${t}\` does not support resource-based operations`)};function Ff(t){let e=!1,r;return(...n)=>(e||(r=t(...n),e=!0),r)}const Wt=t=>Ff((...e)=>console.warn(t.join(" "),...e)),Vf=Wt(["Because you set `withCredentials` to true, we will override your `useCdn`","setting to be false since (cookie-based) credentials are never set on the CDN"]),Nf=Wt(["Since you haven't set a value for `useCdn`, we will deliver content using our","global, edge-cached API-CDN. If you wish to have content delivered faster, set","`useCdn: false` to use the Live API. Note: You may incur higher costs using the live API."]),Hf=Wt(["The Sanity client is configured with the `perspective` set to `drafts` or `previewDrafts`, which doesn't support the API-CDN.","The Live API will be used instead. Set `useCdn: false` in your configuration to hide this warning."]),Wf=Wt(["The `previewDrafts` perspective has been renamed to  `drafts` and will be removed in a future API version"]),Bf=Wt(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${Ti("js-client-browser-token")} for more information and how to hide this warning.`]),zf=Wt(["You have configured Sanity client to use a token, but also provided `withCredentials: true`.","This is no longer supported - only token will be used - remove `withCredentials: true`."]),Gf=Wt(["Using the Sanity client without specifying an API version is deprecated.",`See ${Ti("js-client-api-version")}`]),Qf="apicdn.sanity.io",Pr={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},Jf=["localhost","127.0.0.1","0.0.0.0"],Xf=t=>Jf.indexOf(t)!==-1;function Yf(t){if(t==="1"||t==="X")return;const e=new Date(t);if(!(/^\d{4}-\d{2}-\d{2}$/.test(t)&&e instanceof Date&&e.getTime()>0))throw new Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}function Ea(t){if(Array.isArray(t)&&t.length>1&&t.includes("raw"))throw new TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}const $a=(t,e)=>{const r={...e,...t,stega:{...typeof e.stega=="boolean"?{enabled:e.stega}:e.stega||Pr.stega,...typeof t.stega=="boolean"?{enabled:t.stega}:t.stega||{}}};r.apiVersion||Gf();const n={...Pr,...r},i=n.useProjectHostname&&!n["~experimental_resource"];if(typeof Promise>"u"){const v=Ti("js-client-promise-polyfill");throw new Error(`No native Promise-implementation found, polyfill needed - see ${v}`)}if(i&&!n.projectId)throw new Error("Configuration must contain `projectId`");if(n["~experimental_resource"]&&ba(n),typeof n.perspective<"u"&&Ea(n.perspective),"encodeSourceMap"in n)throw new Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMap' is not supported in '@sanity/client'. Did you mean 'stega.enabled'?");if("encodeSourceMapAtPath"in n)throw new Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMapAtPath' is not supported in '@sanity/client'. Did you mean 'stega.filter'?");
14if(typeof n.stega.enabled!="boolean")throw new Error(`stega.enabled must be a boolean, received ${n.stega.enabled}`);if(n.stega.enabled&&n.stega.studioUrl===void 0)throw new Error("stega.studioUrl must be defined when stega.enabled is true");if(n.stega.enabled&&typeof n.stega.studioUrl!="string"&&typeof n.stega.studioUrl!="function")throw new Error(`stega.studioUrl must be a string or a function, received ${n.stega.studioUrl}`);const s=typeof window<"u"&&window.location&&window.location.hostname,o=s&&Xf(window.location.hostname),a=!!n.token;n.withCredentials&&a&&(zf(),n.withCredentials=!1),s&&o&&a&&n.ignoreBrowserTokenWarning!==!0?Bf():typeof n.useCdn>"u"&&Nf(),i&&Lf(n.projectId),n.dataset&&va(n.dataset),"requestTagPrefix"in n&&(n.requestTagPrefix=n.requestTagPrefix?wa(n.requestTagPrefix).replace(/\.+$/,""):void 0),n.apiVersion=`${n.apiVersion}`.replace(/^v/,""),n.isDefaultApi=n.apiHost===Pr.apiHost,n.useCdn===!0&&n.withCredentials&&Vf(),n.useCdn=n.useCdn!==!1&&!n.withCredentials,Yf(n.apiVersion);const u=n.apiHost.split("://",2),l=u[0],d=u[1],f=n.isDefaultApi?Qf:d;return i?(n.url=`${l}://${n.projectId}.${d}/v${n.apiVersion}`,n.cdnUrl=`${l}://${n.projectId}.${f}/v${n.apiVersion}`):(n.url=`${n.apiHost}/v${n.apiVersion}`,n.cdnUrl=n.url),n};let Ia=class extends Error{constructor(){super(...arguments);S(this,"name","ConnectionFailedError")}},Kf=class extends Error{constructor(r,n,i={}){super(r,i);S(this,"name","DisconnectError");S(this,"reason");this.reason=n}},Zf=class extends Error{constructor(r,n){super(r);S(this,"name","ChannelError");S(this,"data");this.data=n}},ed=class extends Error{constructor(r,n,i={}){super(r,i);S(this,"name","MessageError");S(this,"data");this.data=n}},Is=class extends Error{constructor(){super(...arguments);S(this,"name","MessageParseError")}};const td=["channelError","disconnect"];function xa(t,e){return vn(()=>{const r=t();return Jo(r)?r:Ke(r)}).pipe(ve(r=>rd(r,e)))}function rd(t,e){return new N(r=>{const n=e.includes("open"),i=e.includes("reconnect");function s(l){if("data"in l){const[d,f]=xs(l);r.error(d?new Is("Unable to parse EventSource error message",{cause:f}):new ed((f==null?void 0:f.data).message,f));return}t.readyState===t.CLOSED?r.error(new Ia("EventSource connection failed")):i&&r.next({type:"reconnect"})}function o(){r.next({type:"open"})}function a(l){var v;const[d,f]=xs(l);if(d){r.error(new Is("Unable to parse EventSource message",{cause:d}));return}if(l.type==="channelError"){r.error(new Zf(nd(f==null?void 0:f.data),f.data));return}if(l.type==="disconnect"){r.error(new Kf(`Server disconnected client: ${((v=f.data)==null?void 0:v.reason)||"unknown error"}`));return}r.next({type:l.type,id:l.lastEventId,...f.data?{data:f.data}:{}})}t.addEventListener("error",s),n&&t.addEventListener("open",o);const u=[...new Set([...td,...e])].filter(l=>l!=="error"&&l!=="open"&&l!=="reconnect");return u.forEach(l=>t.addEventListener(l,a)),()=>{t.removeEventListener("error",s),n&&t.removeEventListener("open",o),u.forEach(l=>t.removeEventListener(l,a)),t.close()}})}function xs(t){try{const e=typeof t.data=="string"&&JSON.parse(t.data);return[null,{type:t.type,id:t.lastEventId,...id(e)?{}:{data:e}}]}catch(e){return[e,null]}}function nd(t){return t.error?t.error.description?t.error.description:typeof t.error=="string"?t.error:JSON.stringify(t.error,null,2):t.message||"Unknown listener error"}function id(t){for(const e in t)return!1;return!0}function Sa(t){if(typeof t=="string")return{id:t};if(Array.isArray(t))return{query:"*[_id in $ids]",params:{ids:t}};if(typeof t=="object"&&t!==null&&"query"in t&&typeof t.query=="string")return"params"in t&&typeof t.params=="object"&&t.params!==null?{query:t.query,params:t.params}:{query:t.query};const e=["* Document ID (<docId>)","* Array of document IDs","* Object containing `query`"].join(`
15`);throw new Error(`Unknown selection - must be one of:
16
17${e}`)}let Ca=class{constructor(e,r={}){S(this,"selection");S(this,"operations");this.selection=e,this.operations=r}set(e){return this._assign("set",e)}setIfMissing(e){return this._assign("setIfMissing",e)}diffMatchPatch(e){return Or("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw new Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:e}),this}inc(e){return this._assign("inc",e)}dec(e){return this._assign("dec",e)}insert(e,r,n){return Uf(e,r,n),this._assign("insert",{[e]:r,items:n})}append(e,r){return this.insert("after",`${e}[-1]`,r)}prepend(e,r){return this.insert("before",`${e}[0]`,r)}splice(e,r,n,i){const s=typeof n>"u"||n===-1,o=r<0?r-1:r,a=s?-1:Math.max(0,r+n),u=o<0&&a>=0?"":a,l=`${e}[${o}:${u}]`;return this.insert("replace",l,i||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...Sa(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,r,n=!0){return Or(e,r),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},n&&this.operations[e]||{},r)}),this}_set(e,r){return this._assign(e,r,!1)}};var kt,tr;let kr=(tr=class extends Ca{constructor(r,n,i){super(r,n);O(this,kt);j(this,kt,i)}clone(){return new tr(this.selection,{...this.operations},c(this,kt))}commit(r){if(!c(this,kt))throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");
17const n=typeof this.selection=="string",i=Object.assign({returnFirst:n,returnDocuments:!0},r);return c(this,kt).mutate({patch:this.serialize()},i)}},kt=new WeakMap,tr);var Rt,rr;let Yt=(rr=class extends Ca{constructor(r,n,i){super(r,n);O(this,Rt);j(this,Rt,i)}clone(){return new rr(this.selection,{...this.operations},c(this,Rt))}commit(r){if(!c(this,Rt))throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");const n=typeof this.selection=="string",i=Object.assign({returnFirst:n,returnDocuments:!0},r);return c(this,Rt).mutate({patch:this.serialize()},i)}},Rt=new WeakMap,rr);const Aa={returnDocuments:!1};let _a=class{constructor(e=[],r){S(this,"operations");S(this,"trxId");this.operations=e,this.trxId=r}create(e){return Or("create",e),this._add({create:e})}createIfNotExists(e){const r="createIfNotExists";return Or(r,e),On(r,e),this._add({[r]:e})}createOrReplace(e){const r="createOrReplace";return Or(r,e),On(r,e),this._add({[r]:e})}delete(e){return ma("delete",e),this._add({delete:{id:e}})}transactionId(e){return e?(this.trxId=e,this):this.trxId}serialize(){return[...this.operations]}toJSON(){return this.serialize()}reset(){return this.operations=[],this}_add(e){return this.operations.push(e),this}};var ot,nr;let ja=(nr=class extends _a{constructor(r,n,i){super(r,i);O(this,ot);j(this,ot,n)}clone(){return new nr([...this.operations],c(this,ot),this.trxId)}commit(r){if(!c(this,ot))throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return c(this,ot).mutate(this.serialize(),Object.assign({transactionId:this.trxId},Aa,r||{}))}patch(r,n){const i=typeof n=="function",s=typeof r!="string"&&r instanceof Yt,o=typeof r=="object"&&("query"in r||"id"in r);if(s)return this._add({patch:r.serialize()});if(i){const a=n(new Yt(r,{},c(this,ot)));if(!(a instanceof Yt))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:a.serialize()})}if(o){const a=new Yt(r,n||{},c(this,ot));return this._add({patch:a.serialize()})}return this._add({patch:{id:r,...n}})}},ot=new WeakMap,nr);var mt,ir;let Ta=(ir=class extends _a{constructor(r,n,i){super(r,i);O(this,mt);j(this,mt,n)}clone(){return new ir([...this.operations],c(this,mt),this.trxId)}commit(r){if(!c(this,mt))throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return c(this,mt).mutate(this.serialize(),Object.assign({transactionId:this.trxId},Aa,r||{}))}patch(r,n){const i=typeof n=="function";if(typeof r!="string"&&r instanceof kr)return this._add({patch:r.serialize()});if(i){const s=n(new kr(r,{},c(this,mt)));if(!(s instanceof kr))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:s.serialize()})}return this._add({patch:{id:r,...n}})}},mt=new WeakMap,ir);const sd="X-Sanity-Project-ID";function od(t,e={}){const r={},n=e.token||t.token;n&&(r.Authorization=`Bearer ${n}`),!e.useGlobalApi&&!t.useProjectHostname&&t.projectId&&(r[sd]=t.projectId);const i=!!(typeof e.withCredentials>"u"?t.withCredentials:e.withCredentials),s=typeof e.timeout>"u"?t.timeout:e.timeout;return Object.assign({},e,{headers:Object.assign({},r,e.headers||{}),timeout:typeof s>"u"?5*60*1e3:s,proxy:e.proxy||t.proxy,json:!0,withCredentials:i,fetch:typeof e.fetch=="object"&&typeof t.fetch=="object"?{...t.fetch,...e.fetch}:e.fetch||t.fetch})}const Oa=({query:t,params:e={},options:r={}})=>{const n=new URLSearchParams,{tag:i,includeMutations:s,returnQuery:o,...a}=r;i&&n.append("tag",i),n.append("query",t);for(const[u,l]of Object.entries(e))n.append(`$${u}`,JSON.stringify(l));for(const[u,l]of Object.entries(a))l&&n.append(u,`${l}`);return o===!1&&n.append("returnQuery","false"),s===!1&&n.append("includeMutations","false"),`?${n}`},ad=(t,e)=>t===!1?void 0:typeof t>"u"?e:t,ud=(t={})=>({dryRun:t.dryRun,returnIds:!0,returnDocuments:ad(t.returnDocuments,!0),visibility:t.visibility||"sync",autoGenerateArrayKeys:t.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:t.skipCrossDatasetReferenceValidation}),Oi=t=>t.type==="response",cd=t=>t.body,ld=(t,e)=>t.reduce((r,n)=>(r[e(n)]=n,r),Object.create(null)),fd=11264;function Pa(t,e,r,n,i={},s={}){const o="stega"in s?{...r||{},...typeof s.stega=="boolean"?{enabled:s.stega}:s.stega||{}}:r,a=o.enabled?Sf(i):i,u=s.filterResponse===!1?h=>h:h=>h.result,{cache:l,next:d,...f}={useAbortSignal:typeof s.signal<"u",resultSourceMap:o.enabled?"withKeyArraySelector":s.resultSourceMap,...s,returnQuery:s.filterResponse===!1&&s.returnQuery!==!1}
17,v=typeof l<"u"||typeof d<"u"?{...f,fetch:{cache:l,next:d}}:f,y=$r(t,e,"query",{query:n,params:a},v);return o.enabled?y.pipe(ua(jt(Hn(()=>Promise.resolve().then(()=>ny),void 0).then(function(h){return h.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:h})=>h))),X(([h,p])=>{const g=p(h.result,h.resultSourceMap,o);return u({...h,result:g})})):y.pipe(X(u))}function ka(t,e,r,n={}){const i={uri:Le(t,"doc",r),json:!0,tag:n.tag,signal:n.signal};return wn(t,e,i).pipe(me(Oi),X(s=>s.body.documents&&s.body.documents[0]))}function Ra(t,e,r,n={}){const i={uri:Le(t,"doc",r.join(",")),json:!0,tag:n.tag,signal:n.signal};return wn(t,e,i).pipe(me(Oi),X(s=>{const o=ld(s.body.documents||[],a=>a._id);return r.map(a=>o[a]||null)}))}function Da(t,e,r,n){return On("createIfNotExists",r),Qn(t,e,r,"createIfNotExists",n)}function Ma(t,e,r,n){return On("createOrReplace",r),Qn(t,e,r,"createOrReplace",n)}function La(t,e,r,n){return $r(t,e,"mutate",{mutations:[{delete:Sa(r)}]},n)}function qa(t,e,r,n){let i;r instanceof Yt||r instanceof kr?i={patch:r.serialize()}:r instanceof ja||r instanceof Ta?i=r.serialize():i=r;const s=Array.isArray(i)?i:[i],o=n&&n.transactionId||void 0;return $r(t,e,"mutate",{mutations:s,transactionId:o},n)}function Ua(t,e,r,n){const i=Array.isArray(r)?r:[r],s=n&&n.transactionId||void 0,o=n&&n.skipCrossDatasetReferenceValidation||void 0,a=n&&n.dryRun||void 0;return $r(t,e,"actions",{actions:i,transactionId:s,skipCrossDatasetReferenceValidation:o,dryRun:a},n)}function $r(t,e,r,n,i={}){const s=r==="mutate",o=r==="actions",a=r==="query",u=s||o?"":Oa(n),l=!s&&!o&&u.length<fd,d=l?u:"",f=i.returnFirst,{timeout:v,token:y,tag:h,headers:p,returnQuery:g,lastLiveEventId:m,cacheMode:x}=i,A=Le(t,r,d),C={method:l?"GET":"POST",uri:A,json:!0,body:l?void 0:n,query:s&&ud(i),timeout:v,headers:p,token:y,tag:h,returnQuery:g,perspective:i.perspective,resultSourceMap:i.resultSourceMap,lastLiveEventId:Array.isArray(m)?m[0]:m,cacheMode:x,canUseCdn:a,signal:i.signal,fetch:i.fetch,useAbortSignal:i.useAbortSignal,useCdn:i.useCdn};return wn(t,e,C).pipe(me(Oi),X(cd),X(G=>{if(!s)return G;const W=G.results||[];if(i.returnDocuments)return f?W[0]&&W[0].document:W.map(pe=>pe.document);const Ie=f?"documentId":"documentIds",ke=f?W[0]&&W[0].id:W.map(pe=>pe.id);return{transactionId:G.transactionId,results:W,[Ie]:ke}}))}function Qn(t,e,r,n,i={}){const s={[n]:r},o=Object.assign({returnFirst:!0,returnDocuments:!0},i);return $r(t,e,"mutate",{mutations:[s]},o)}const gn=t=>t.config().dataset!==void 0&&t.config().projectId!==void 0||t.config()["~experimental_resource"]!==void 0,Fa=(t,e)=>gn(t)&&e.startsWith(Le(t,"query")),dd=(t,e)=>gn(t)&&e.startsWith(Le(t,"mutate")),hd=(t,e)=>gn(t)&&e.startsWith(Le(t,"doc","")),pd=(t,e)=>gn(t)&&e.startsWith(Le(t,"listen")),yd=(t,e)=>gn(t)&&e.startsWith(Le(t,"history","")),vd=(t,e)=>e.startsWith("/data/")||Fa(t,e)||dd(t,e)||hd(t,e)||pd(t,e)||yd(t,e);function wn(t,e,r){const n=r.url||r.uri,i=t.config(),s=typeof r.canUseCdn>"u"?["GET","HEAD"].indexOf(r.method||"GET")>=0&&vd(t,n):r.canUseCdn;let o=(r.useCdn??i.useCdn)&&s;const a=r.tag&&i.requestTagPrefix?[i.requestTagPrefix,r.tag].join("."):r.tag||i.requestTagPrefix;if(a&&r.tag!==null&&(r.query={tag:wa(a),...r.query}),["GET","HEAD","POST"].indexOf(r.method||"GET")>=0&&Fa(t,n)){const d=r.resultSourceMap??i.resultSourceMap;d!==void 0&&d!==!1&&(r.query={resultSourceMap:d,...r.query});const f=r.perspective||i.perspective;typeof f<"u"&&(f==="previewDrafts"&&Wf(),Ea(f),r.query={perspective:Array.isArray(f)?f.join(","):f,...r.query},(Array.isArray(f)&&f.length>0||f==="previewDrafts"||f==="drafts")&&o&&(o=!1,Hf())),r.lastLiveEventId&&(r.query={...r.query,lastLiveEventId:r.lastLiveEventId}),r.returnQuery===!1&&(r.query={returnQuery:"false",...r.query}),o&&r.cacheMode=="noStale"&&(r.query={cacheMode:"noStale",...r.query})}const u=od(i,Object.assign({},r,{url:Pi(t,n,o)})),l=new N(d=>e(u,i.requester).subscribe(d));return r.signal?l.pipe(md(r.signal)):l}function We(t,e,r){return wn(t,e,r).pipe(me(n=>n.type==="response"),X(n=>n.body))}function Le(t,e,r){const n=t.config();if(n["~experimental_resource"]){ba(n);const o=bd(n),a=r!==void 0?`${e}/${r}`:e;return`${o}/${a}`.replace(/\/($|\?)/,"$1")}const i=ga(n),s=`/${e}/${i}`;return`/data${r!==void 0?`${s}/${r}`:s}`.replace(/\/($|\?)/,"$1")}function Pi(t,e,r=!1){const{url:n,cdnUrl:i}=t.config();return`${r?i:n}/${e.replace(/^\//,"")}`}function md(t){return e=>new N(r=>{const n=()=>r.error(wd(t));if(t&&t.aborted){n();return}const i=e.subscribe(r);return t.addEventListener("abort",n),()=>{t.removeEventListener("abort",n),i.unsubscribe()}})}const gd=!!globalThis.DOMException;function wd(t){if(gd)return new DOMException((t==null?void 0:t.reason)??"The operation was aborted.","AbortError");const e=new Error((t==null?void 0:t.reason)??"The operation was aborted.");return e.name="AbortError",e}const bd=t=>{if(!t["~experimental_resource"])throw new Error("`resource` must be provided to perform resource queries");const{type:e,id:r}=t["~experimental_resource"];switch(e){case"dataset":{const n=r.split(".");if(n.length!==2)throw new Error('Dataset ID must be in the format "project.dataset"');return`/projects/${n[0]}/datasets/${n[1]}`}case"canvas":return`/canvases/${r}`;case"media-library":return`/media-libraries/${r}`;case"dashboard":return`/dashboards/${r}`;default:throw new Error(`Unsupported resource type: ${e.toString()}`)}};var zr,Gr,Xs;let Ed=(Xs=class{constructor(e,r){O(this,zr);O(this,Gr);j(this,zr,e),j(this,Gr,r)}upload(e,r,n){return Va(c(this,zr),c(this,Gr),e,r,n)}},zr=new WeakMap,Gr=new WeakMap,Xs);var Qr,Jr,Ys;let $d=(Ys=class{constructor(e,r){O(this,Qr);O(this,Jr);j(this,Qr,e),j(this,Jr,r)}upload(e,r,n){const i=Va(c(this,Qr),c(this,Jr),e,r,n);return R(i.pipe(me(s=>s.type==="response"),X(s=>s.body.document)))}},Qr=new WeakMap,Jr=new WeakMap,Ys);function Va(t,e,r,n,i={}){qf(r);let s=i.extract||void 0;s&&!s.length&&(s=["none"]);const o=t.config(),a=xd(i,n),{tag:u,label:l,title:d,description:f,creditLine:v,filename:y,source:h}=a,p={label:l,title:d,description:f,filename:y,meta:s,creditLine:v};return h&&(p.sourceId=h.id,p.sourceName=h.name,p.sourceUrl=h.url),wn(t,e,{tag:u,method:"POST",timeout:a.timeout||0,uri:Id(o,r),headers:a.contentType?{"Content-Type":a.contentType}:{},query:p,body:n})}function Id(t,e){const r=e==="image"?"images":"files";if(t["~experimental_resource"]){const{type:i,id:s}=t["~experimental_resource"];switch(i){case"dataset":throw new Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${s}/assets/${r}`;case"media-library":return`/media-libraries/${s}/upload`;case"dashboard":return`/dashboards/${s}/assets/${r}`;default:throw new Error(`Unsupported resource type: ${i.toString()}`)}}const n=ga(t);return`assets/${r}/${n}`}function xd(t,e){return typeof File>"u"||!(e instanceof File)?t:Object.assign({filename:t.preserveFilename===!1?void 0:e.name,contentType:e.type},t)}var Sd=(t,e)=>Object.keys(e).concat(Object.keys(t)).reduce((r,n)=>(r[n]=typeof t[n]>"u"?e[n]:t[n],r),{});const Cd=(t,e)=>e.reduce((r,n)=>(typeof t[n]>"u"||(r[n]=t[n]),r),{}),Na=vn(()=>Hn(()=>Promise.resolve().then(()=>Hu),void 0)).pipe(X(({default:t})=>t),da(1));function Ha(){return function(t){return t.pipe(mn((e,r)=>e instanceof Ia?qr(Ke({type:"reconnect"}),Tt(1e3).pipe(ve(()=>r))):pn(()=>e)))}}const Ad=14800,_d=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","tag"],jd={includeResult:!0};function Wa(t,e,r={}){const{url:n,token:i,withCredentials:s,requestTagPrefix:o}=this.config(),a=r.tag&&o?[o,r.tag].join("."):r.tag,u={...Sd(r,jd),tag:a},l=Cd(u,_d),d=Oa({query:t,params:e,options:{tag:a,...l}}),f=`${n}${Le(this,"listen",d)}`;if(f.length>Ad)return pn(()=>new Error("Query too large for listener"));const v=u.events?u.events:["mutation"],y={};return s&&(y.withCredentials=!0),i&&(y.headers={Authorization:`Bearer ${i}`}),xa(()=>(typeof EventSource>"u"||y.headers?Na:Ke(EventSource)).pipe(X(h=>new h(f,y))),v).pipe(Ha(),me(h=>v.includes(h.type)),X(h=>({type:h.type,..."data"in h?h.data:{}})))}function Td(t,e){return Od(typeof t=="function"?{predicate:t,...e}:t)}function Od(t){return e=>{let r,n=!1;const{predicate:i,...s}=t,o=e.pipe(ha(u=>{t.predicate(u)&&(n=!0,r=u)}),Gn(()=>{n=!1,r=void 0}),_i(s)),a=new N(u=>{n&&u.next(r),u.complete()});return na(o,a)}}const Ss="2021-03-25";var gt,Ks;let Ba=(Ks=class{constructor(e){O(this,gt);j(this,gt,e)}events({includeDrafts:e=!1,tag:r}={}){Ye("live",c(this,gt).config());const{projectId:n,apiVersion:i,token:s,withCredentials:o,requestTagPrefix:a}=c(this,gt).config(),u=i.replace(/^v/,"");if(u!=="X"&&u<Ss)throw new Error(`The live events API requires API version ${Ss} or later. The current API version is ${u}. Please update your API version to use this feature.`);if(e&&!s&&!o)throw new Error("The live events API requires a token or withCredentials when 'includeDrafts: true'. Please update your client configuration. The token should have the lowest possible access role.");const l=Le(c(this,gt),"live/events"),d=new URL(c(this,gt).getUrl(l,!1)),f=r&&a?[a,r].join("."):r;f&&d.searchParams.set("tag",f),e&&d.searchParams.set("includeDrafts","true");const v={};e&&s&&(v.headers={Authorization:`Bearer ${s}`}),e&&o&&(v.withCredentials=!0);const y=`${d.href}::${JSON.stringify(v)}`,h=ci.get(y);if(h)return h;const p=xa(()=>(typeof EventSource>"u"||v.headers?Na:Ke(EventSource)).pipe(X(x=>new x(d.href,v))),["message","restart","welcome","reconnect","goaway"]).pipe(Ha(),X(x=>
17{if(x.type==="message"){const{data:A,...C}=x;return{...C,tags:A.tags}}return x})),g=Pd(d,{method:"OPTIONS",mode:"cors",credentials:v.withCredentials?"include":"omit",headers:v.headers}).pipe(ve(()=>Er),mn(()=>{throw new Pf({projectId:n})})),m=qr(g,p).pipe(Gn(()=>ci.delete(y)),Td({predicate:x=>x.type==="welcome"}));return ci.set(y,m),m}},gt=new WeakMap,Ks);function Pd(t,e){return new N(r=>{const n=new AbortController,i=n.signal;return fetch(t,{...e,signal:n.signal}).then(s=>{r.next(s),r.complete()},s=>{i.aborted||r.error(s)}),()=>n.abort()})}const ci=new Map;var wt,bt,Zs;let kd=(Zs=class{constructor(e,r){O(this,wt);O(this,bt);j(this,wt,e),j(this,bt,r)}create(e,r){return Kt(c(this,wt),c(this,bt),"PUT",e,r)}edit(e,r){return Kt(c(this,wt),c(this,bt),"PATCH",e,r)}delete(e){return Kt(c(this,wt),c(this,bt),"DELETE",e)}list(){return We(c(this,wt),c(this,bt),{uri:"/datasets",tag:null})}},wt=new WeakMap,bt=new WeakMap,Zs);var Me,Et,eo;let Rd=(eo=class{constructor(e,r){O(this,Me);O(this,Et);j(this,Me,e),j(this,Et,r)}create(e,r){return Ye("dataset",c(this,Me).config()),R(Kt(c(this,Me),c(this,Et),"PUT",e,r))}edit(e,r){return Ye("dataset",c(this,Me).config()),R(Kt(c(this,Me),c(this,Et),"PATCH",e,r))}delete(e){return Ye("dataset",c(this,Me).config()),R(Kt(c(this,Me),c(this,Et),"DELETE",e))}list(){return Ye("dataset",c(this,Me).config()),R(We(c(this,Me),c(this,Et),{uri:"/datasets",tag:null}))}},Me=new WeakMap,Et=new WeakMap,eo);function Kt(t,e,r,n,i){return Ye("dataset",t.config()),va(n),We(t,e,{method:r,uri:`/datasets/${n}`,body:i,tag:null})}var $t,sr,to;let Dd=(to=class{constructor(e,r){O(this,$t);O(this,sr);j(this,$t,e),j(this,sr,r)}list(e){Ye("projects",c(this,$t).config());const r=(e==null?void 0:e.includeMembers)===!1?"/projects?includeMembers=false":"/projects";return We(c(this,$t),c(this,sr),{uri:r})}getById(e){return Ye("projects",c(this,$t).config()),We(c(this,$t),c(this,sr),{uri:`/projects/${e}`})}},$t=new WeakMap,sr=new WeakMap,to);var It,or,ro;let Md=(ro=class{constructor(e,r){O(this,It);O(this,or);j(this,It,e),j(this,or,r)}list(e){Ye("projects",c(this,It).config());const r=(e==null?void 0:e.includeMembers)===!1?"/projects?includeMembers=false":"/projects";return R(We(c(this,It),c(this,or),{uri:r}))}getById(e){return Ye("projects",c(this,It).config()),R(We(c(this,It),c(this,or),{uri:`/projects/${e}`}))}},It=new WeakMap,or=new WeakMap,ro);var Xr,Yr,no;let Ld=(no=class{constructor(e,r){O(this,Xr);O(this,Yr);j(this,Xr,e),j(this,Yr,r)}getById(e){return We(c(this,Xr),c(this,Yr),{uri:`/users/${e}`})}},Xr=new WeakMap,Yr=new WeakMap,no);var Kr,Zr,io;let qd=(io=class{constructor(e,r){O(this,Kr);O(this,Zr);j(this,Kr,e),j(this,Zr,r)}getById(e){return R(We(c(this,Kr),c(this,Zr),{uri:`/users/${e}`}))}},Kr=new WeakMap,Zr=new WeakMap,io);var at,ue,Ft;let Ud=(Ft=class{constructor(e,r=Pr){S(this,"assets");S(this,"datasets");S(this,"live");S(this,"projects");S(this,"users");O(this,at);O(this,ue);S(this,"listen",Wa);this.config(r),j(this,ue,e),this.assets=new Ed(this,c(this,ue)),this.datasets=new kd(this,c(this,ue)),this.live=new Ba(this),this.projects=new Dd(this,c(this,ue)),this.users=new Ld(this,c(this,ue))}clone(){return new Ft(c(this,ue),this.config())}config(e){if(e===void 0)return{...c(this,at)};
17if(c(this,at)&&c(this,at).allowReconfigure===!1)throw new Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return j(this,at,$a(e,c(this,at)||{})),this}withConfig(e){const r=this.config();return new Ft(c(this,ue),{...r,...e,stega:{...r.stega||{},...typeof(e==null?void 0:e.stega)=="boolean"?{enabled:e.stega}:(e==null?void 0:e.stega)||{}}})}fetch(e,r,n){return Pa(this,c(this,ue),c(this,at).stega,e,r,n)}getDocument(e,r){return ka(this,c(this,ue),e,r)}getDocuments(e,r){return Ra(this,c(this,ue),e,r)}create(e,r){return Qn(this,c(this,ue),e,"create",r)}createIfNotExists(e,r){return Da(this,c(this,ue),e,r)}createOrReplace(e,r){return Ma(this,c(this,ue),e,r)}delete(e,r){return La(this,c(this,ue),e,r)}mutate(e,r){return qa(this,c(this,ue),e,r)}patch(e,r){return new kr(e,r,this)}transaction(e){return new Ta(e,this)}action(e,r){return Ua(this,c(this,ue),e,r)}request(e){return We(this,c(this,ue),e)}getUrl(e,r){return Pi(this,e,r)}getDataUrl(e,r){return Le(this,e,r)}},at=new WeakMap,ue=new WeakMap,Ft);var ut,oe,Vt;let Fd=(Vt=class{constructor(e,r=Pr){S(this,"assets");S(this,"datasets");S(this,"live");S(this,"projects");S(this,"users");S(this,"observable");O(this,ut);O(this,oe);S(this,"listen",Wa);this.config(r),j(this,oe,e),this.assets=new $d(this,c(this,oe)),this.datasets=new Rd(this,c(this,oe)),this.live=new Ba(this),this.projects=new Md(this,c(this,oe)),this.users=new qd(this,c(this,oe)),this.observable=new Ud(e,r)}clone(){return new Vt(c(this,oe),this.config())}config(e){if(e===void 0)return{...c(this,ut)};if(c(this,ut)&&c(this,ut).allowReconfigure===!1)throw new Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),j(this,ut,$a(e,c(this,ut)||{})),this}withConfig(e){const r=this.config();return new Vt(c(this,oe),{...r,...e,stega:{...r.stega||{},...typeof(e==null?void 0:e.stega)=="boolean"?{enabled:e.stega}:(e==null?void 0:e.stega)||{}}})}fetch(e,r,n){return R(Pa(this,c(this,oe),c(this,ut).stega,e,r,n))}getDocument(e,r){return R(ka(this,c(this,oe),e,r))}getDocuments(e,r){return R(Ra(this,c(this,oe),e,r))}create(e,r){return R(Qn(this,c(this,oe),e,"create",r))}createIfNotExists(e,r){return R(Da(this,c(this,oe),e,r))}createOrReplace(e,r){return R(Ma(this,c(this,oe),e,r))}delete(e,r){return R(La(this,c(this,oe),e,r))}mutate(e,r){return R(qa(this,c(this,oe),e,r))}patch(e,r){return new Yt(e,r,this)}transaction(e){return new ja(e,this)}action(e,r){return R(Ua(this,c(this,oe),e,r))}request(e){return R(We(this,c(this,oe),e))}dataRequest(e,r,n){return R($r(this,c(this,oe),e,r,n))}getUrl(e,r){return Pi(this,e,r)}getDataUrl(e,r){return Le(this,e,r)}},ut=new WeakMap,oe=new WeakMap,Vt);function Vd(t,e){return{requester:bs(t),createClient:r=>{const n=bs(t);return new e((i,s)=>(s||n)({maxRedirects:0,maxRetries:r.maxRetries,retryDelay:r.retryDelay,...i}),r)}}}var Nd=[];const Hd=Vd(Nd,Fd),Lv=Hd.createClient;var za={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(ao,function(){function r(w,$){($==null||$>w.length)&&($=w.length);for(var I=0,E=Array($);I<$;I++)E[I]=w[I];return E}function n(w,$){var I=typeof Symbol<"u"&&w[Symbol.iterator]||w["@@iterator"];if(I)return(I=I.call(w)).next.bind(I);if(Array.isArray(w)||(I=s(w))||$){I&&(w=I);var E=0;return function(){return E>=w.length?{done:!0}:{done:!1,value:w[E++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
18In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(){return i=Object.assign?Object.assign.bind():function(w){for(var $=1;$<arguments.length;$++){var I=arguments[$];for(var E in I)({}).hasOwnProperty.call(I,E)&&(w[E]=I[E])}return w},i.apply(null,arguments)}function s(w,$){if(w){if(typeof w=="string")return r(w,$);var I={}.toString.call(w).slice(8,-1);return I==="Object"&&w.constructor&&(I=w.constructor.name),I==="Map"||I==="Set"?Array.from(w):I==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I)?r(w,$):void 0}}var o="image-Tb9Ew8CXIwaY6R1kjMvI0uRR-2000x3000-jpg";function a(w){var $=w.split("-"),I=$[1],E=$[2],J=$[3];if(!I||!E||!J)throw new Error("Malformed asset _ref '"+w+`'. Expected an id like "`+
18o+'".');var P=E.split("x"),H=P[0],se=P[1],ge=+H,ie=+se,fe=isFinite(ge)&&isFinite(ie);if(!fe)throw new Error("Malformed asset _ref '"+w+`'. Expected an id like "`+o+'".');return{id:I,width:ge,height:ie,format:J}}var u=function($){var I=$;return I?typeof I._ref=="string":!1},l=function($){var I=$;return I?typeof I._id=="string":!1},d=function($){var I=$;return I&&I.asset?typeof I.asset.url=="string":!1},f=function($){if(typeof $=="object"&&$!==null){var I=$;return I._upload&&(!I.asset||!I.asset._ref)}return!1};function v(w){if(!w)return null;var $;if(typeof w=="string"&&y(w))$={asset:{_ref:h(w)}};else if(typeof w=="string")$={asset:{_ref:w}};else if(u(w))$={asset:w};else if(l(w))$={asset:{_ref:w._id||""}};else if(d(w))$={asset:{_ref:h(w.asset.url)}};else if(typeof w.asset=="object")$=i({},w);else return null;var I=w;return I.crop&&($.crop=I.crop),I.hotspot&&($.hotspot=I.hotspot),p($)}function y(w){return/^https?:\/\//.test(""+w)}function h(w){var $=w.split("/").slice(-1);return("image-"+$[0]).replace(/\.([a-z]+)$/,"-$1")}function p(w){if(w.crop&&w.hotspot)return w;var $=i({},w);return $.crop||($.crop={left:0,top:0,bottom:0,right:0}),$.hotspot||($.hotspot={x:.5,y:.5,height:1,width:1}),$}var g=[["width","w"],["height","h"],["format","fm"],["download","dl"],["blur","blur"],["sharpen","sharp"],["invert","invert"],["orientation","or"],["minHeight","min-h"],["maxHeight","max-h"],["minWidth","min-w"],["maxWidth","max-w"],["quality","q"],["fit","fit"],["crop","crop"],["saturation","sat"],["auto","auto"],["dpr","dpr"],["pad","pad"],["frame","frame"]];function m(w){var $=i({},w||{}),I=$.source;delete $.source;var E=v(I);if(!E){if(I&&f(I))return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8HwQACfsD/QNViZkAAAAASUVORK5CYII=";throw new Error("Unable to resolve image URL from source ("+JSON.stringify(I)+")")}var J=E.asset._ref||E.asset._id||"",P=a(J),H=Math.round(E.crop.left*P.width),se=Math.round(E.crop.top*P.height),ge={left:H,top:se,width:Math.round(P.width-E.crop.right*P.width-H),height:Math.round(P.height-E.crop.bottom*P.height-se)},ie=E.hotspot.height*P.height/2,fe=E.hotspot.width*P.width/2,Ze=E.hotspot.x*P.width,et=E.hotspot.y*P.height,Re={left:Ze-fe,top:et-ie,right:Ze+fe,bottom:et+ie};return $.rect||$.focalPoint||$.ignoreImageParams||$.crop||($=i({},$,A({crop:ge,hotspot:Re},$))),x(i({},$,{asset:P}))}function x(w){var $=(w.baseUrl||"https://cdn.sanity.io").replace(/\/+$/,""),I=w.vanityName?"/"+w.vanityName:"",E=w.asset.id+"-"+w.asset.width+"x"+w.asset.height+"."+w.asset.format+I,J=$+"/images/"+w.projectId+"/"+w.dataset+"/"+E,P=[];if(w.rect){var H=w.rect,se=H.left,ge=H.top,ie=H.width,fe=H.height,Ze=se!==0||ge!==0||fe!==w.asset.height||ie!==w.asset.width;Ze&&P.push("rect="+se+","+ge+","+ie+","+fe)}w.bg&&P.push("bg="+w.bg),w.focalPoint&&(P.push("fp-x="+w.focalPoint.x),P.push("fp-y="+w.focalPoint.y));var et=[w.flipHorizontal&&"h",w.flipVertical&&"v"].filter(Boolean).join("");return et&&P.push("flip="+et),g.forEach(function(Re){var Ot=Re[0],Fe=Re[1];typeof w[Ot]<"u"?P.push(Fe+"="+encodeURIComponent(w[Ot])):typeof w[Fe]<"u"&&P.push(Fe+"="+encodeURIComponent(w[Fe]))}),P.length===0?J:J+"?"+P.join("&")}function A(w,$){var I,E=$.width,J=$.height;if(!(E&&J))return{width:E,height:J,rect:w.crop};var P=w.crop,H=w.hotspot,se=E/J,ge=P.width/P.height;if(ge>se){var ie=Math.round(P.height),fe=Math.round(ie*se),Ze=Math.max(0,Math.round(P.top)),et=Math.round((H.right-H.left)/2+H.left),Re=Math.max(0,Math.round(et-fe/2));Re<P.left?Re=P.left:Re+fe>P.left+P.width&&(Re=P.left+P.width-fe),I={left:Re,top:Ze,width:fe,height:ie}}else{var Ot=P.width,Fe=Math.round(Ot/se),Ir=Math.max(0,Math.round(P.left)),xr=Math.round((H.bottom-H.top)/2+H.top),De=Math.max(0,Math.round(xr-Fe/2));De<P.top?De=P.top:De+Fe>P.top+P.height&&(De=P.top+P.height-Fe),I={left:Ir,top:De,width:Ot,height:Fe}}return{width:E,height:J,rect:I}}var C=["clip","crop","fill","fillmax","max","scale","min"],G=["top","bottom","left","right","center","focalpoint","entropy"],W=["format"];function Ie(w){return w&&"config"in w?typeof w.config=="function":!1}function ke(w){return w&&"clientConfig"in w?typeof w.clientConfig=="object":!1}function pe(w){for(var $=g,I=n($),E;!(E=I()).done;){var J=E.value,P=J[0],H=J[1];if(w===P||w===H)return P}return w}function Ue(w){if(Ie(w)){var $=w.config(),I=$.apiHost,E=$.projectId,J=$.dataset,P=I||"https://api.sanity.io";return new ze(null,{baseUrl:P.replace(/^https:\/\/api\./,"https://cdn."),projectId:E,dataset:J})}if(ke(w)){var H=w.clientConfig,se=H.apiHost,ge=H.projectId,ie=H.dataset,fe=se||"https://api.sanity.io";return new ze(null,{baseUrl:fe.replace(/^https:\/\/api\./,"https://cdn."),projectId:ge,dataset:ie})}return new ze(null,w||{})}var ze=function(){function w(I,E){this.options=void 0,this.options=I?i({},I.options||{},E||{}):i({},E||{})}var $=w.prototype;return $.withOptions=function(E){var J=E.baseUrl||this.options.baseUrl,P={baseUrl:J};for(var H in E)if(E.hasOwnProperty(H)){var se=pe(H);P[se]=E[H]}return new w(this,i({baseUrl:J},P))},$.image=function(E){return this.withOptions({source:E})},$.dataset=function(E){return this.withOptions({dataset:E})},$.projectId=function(E){return this.withOptions({projectId:E})},$.bg=function(E){return this.withOptions({bg:E})},$.dpr=function(E){return this.withOptions(E&&E!==1?{dpr:E}:{})},$.width=function(E){return this.withOptions({width:E})},$.height=function(E){return this.withOptions({height:E})},$.focalPoint=function(E,J){return this.withOptions({focalPoint:{x:E,y:J}})},$.maxWidth=function(E){return this.withOptions({maxWidth:E})},$.minWidth=function(E){return this.withOptions({minWidth:E})},$.maxHeight=function(E){return this.withOptions({maxHeight:E})},$.minHeight=function(E){return this.withOptions({minHeight:E})},$.size=function(E,J){return this.withOptions({width:E,height:J})},$.blur=function(E){return this.withOptions({blur:E})},$.sharpen=function(E){return this.withOptions({sharpen:E})},$.rect=function(E,J,P,H){return this.withOptions({rect:{left:E,top:J,width:P,height:H}})},$.format=function(E){return this.withOptions({format:E})},$.invert=function(E){return this.withOptions({invert:E})},$.orientation=function(E){return this.withOptions({orientation:E})},$.quality=function(E){return this.withOptions({quality:E})},$.forceDownload=function(E){return this.withOptions({download:E})},$.flipHorizontal=function(){return this.withOptions({flipHorizontal:!0})},$.flipVertical=function(){return this.withOptions({flipVertical:!0})},$.ignoreImageParams=function(){return this.withOptions({ignoreImageParams:!0})},$.fit=function(E){if(C.indexOf(E)===-1)throw new Error('Invalid fit mode "'+E+'"');return this.withOptions({fit:E})},$.crop=function(E){if(G.indexOf(E)===-1)throw new Error('Invalid crop mode "'+E+'"');return this.withOptions({crop:E})},$.saturation=function(E){return this.withOptions({saturation:E})},$.auto=function(E){if(W.indexOf(E)===-1)throw new Error('Invalid auto mode "'+E+'"');return this.withOptions({auto:E})},$.pad=function(E){return this.withOptions({pad:E}
18)},$.vanityName=function(E){return this.withOptions({vanityName:E})},$.frame=function(E){if(E!==1)throw new Error('Invalid frame value "'+E+'"');return this.withOptions({frame:E})},$.url=function(){return m(this.options)},$.toString=function(){return this.url()},w}();return Ue})})(za);var Wd=za.exports;const qv=oo(Wd);function Pn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Ga={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},jr={0:8203,1:8204,2:8205,3:65279},Tr={0:String.fromCodePoint(jr[0]),1:String.fromCodePoint(jr[1]),2:String.fromCodePoint(jr[2]),3:String.fromCodePoint(jr[3])},Bd=new Array(4).fill(String.fromCodePoint(jr[0])).join("");function zd(t){let e=JSON.stringify(t),r=new TextEncoder().encode(e),n="";for(let i=0;i<r.length;i++){let s=r[i];n+=Tr[s>>6&3]+Tr[s>>4&3]+Tr[s>>2&3]+Tr[s&3]}return Bd+n}function Gd(t){return!Number.isNaN(Number(t))||/[a-z]/i.test(t)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(t)?!1:!!Date.parse(t)}function Qd(t){try{new URL(t,t.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}function Jd(t,e,r="auto"){return r===!0||r==="auto"&&(Gd(t)||Qd(t))?t:`${t}${zd(e)}`}Object.fromEntries(Object.entries(Tr).map(t=>[t[1],+t[0]]));Object.fromEntries(Object.entries(Ga).map(t=>t.reverse()));var Xd=`${Object.values(Ga).map(t=>`\\u{${t.toString(16)}}`).join("")}`,Cs=new RegExp(`[${Xd}]{4,}`,"gu");function Yd(t){var e;return{cleaned:t.replace(Cs,""),encoded:((e=t.match(Cs))==null?void 0:e[0])||""}}function Kd(t){return t&&JSON.parse(Yd(JSON.stringify(t)).cleaned)}function Zd(t){return Kd(t)}const eh="drafts",th="versions",vr=".",kn=`${eh}${vr}`,Qa=`${th}${vr}`;function Jn(t){return t.startsWith(kn)}function Xn(t){return t.startsWith(Qa)}function Ja(t){if(Xn(t)){const e=Yn(t);return kn+e}return Jn(t)?t:kn+t}function bn(t,e){if(e==="drafts"||e==="published")throw new Error('Version can not be "published" or "drafts"');return`${Qa}${e}${vr}${Yn(t)}`}function Xa(t){if(!Xn(t))return;const[e,r]=t.split(vr);return r}function Yn(t){return Xn(t)?t.split(vr).slice(2).join(vr):Jn(t)?t.slice(kn.length):t}let rh=t=>crypto.getRandomValues(new Uint8Array(t)),nh=(t,e,r)=>{let n=(2<<Math.log(t.length-1)/Math.LN2)-1,i=-~(1.6*n*e/t.length);return(s=e)=>{let o="";for(;;){let a=r(i),u=i|0;for(;u--;)if(o+=t[a[u]&n]||"",o.length===s)return o}}},ih=(t,e=21)=>nh(t,e,rh),Uv=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),"");const As=/\r\n|[\n\r\u2028\u2029]/;function sh(t,e,r){const n=t.split(As),i={start:_s(e.start,n),end:e.end?_s(e.end,n):void 0},{start:s,end:o,markerLines:a}=oh(i,n),u=`${o}`.length;return t.split(As,o).slice(s,o).map((l,d)=>{const f=s+1+d,v=` ${` ${f}`.slice(-u)} |`,y=a[f],h=!a[f+1];if(!y)return` ${v}${l.length>0?` ${l}`:""}`;let p="";if(Array.isArray(y)){const g=l.slice(0,Math.max(y[0]-1,0)).replace(/[^\t]/g," "),m=y[1]||1;p=[`
19 `,v.replace(/\d/g," ")," ",g,"^".repeat(m)].join(""),h&&r&&(p+=" "+r)}return[">",v,l.length>0?` ${l}`:"",p].join("")}).join(`
20`)}function oh(t,e){const r={...t.start},n={...r,...t.end},i=2,s=3,o=r.line??-1,a=r.column??0,u=n.line,l=n.column;let d=Math.max(o-(i+1),0),f=Math.min(e.length,u+s);o===-1&&(d=0),u===-1&&(f=e.length);const v=u-o,y={};if(v)for(let h=0;h<=v;h++){const p=h+o;if(!a)y[p]=!0;else if(h===0){const g=e[p-1].length;y[p]=[a,g-a+1]}else if(h===v)y[p]=[0,l];else{const g=e[p-h].length;y[p]=[0,g]}}else a===l?a?y[o]=[a,0]:y[o]=!0:y[o]=[a,l-a];return{start:d,end:f,markerLines:y}}function _s(t,e){var n;let r=0;for(let i=0;i<e.length;i++){const s=e[i].length+1;if(r+s>t)return{line:i+1,column:t-r};r+=s}return{line:e.length,column:((n=e[e.length-1])==null?void 0:n.length)??0}}const li=5;class ah extends Error{constructor(r,n){const i=Ya(r,n);super(i.message);S(this,"response");S(this,"statusCode",400);S(this,"responseBody");S(this,"traceId");S(this,"details");Object.assign(this,i)}}class uh extends Error{constructor(r){const n=Ya(r);super(n.message);S(this,"response");S(this,"statusCode",500);S(this,"responseBody");S(this,"traceId");S(this,"details");Object.assign(this,n)}}function Ya(t,e){var s,o;const r=t.body,n={response:t,statusCode:t.statusCode,responseBody:dh(r,t),traceId:fh(t),message:"",details:void 0};if(!Pn(r))return n.message=`${fi(t,r)}${vt(n.traceId)}`,n;const i=r.error;if(typeof i=="string"&&typeof r.message=="string")return n.message=`${i} - ${r.message}${vt(n.traceId)}`,n;if(typeof i!="object"||i===null)return typeof i=="string"?n.message=`${i}${vt(n.traceId)}`:typeof r.message=="string"?n.message=`${r.message}${vt(n.traceId)}`:n.message=`${fi(t,r)}${vt(n.traceId)}`,n;if(ch(i)||lh(i)){const a=i.items||[],u=a.slice(0,li).map(d=>{var f;return(f=d.error)==null?void 0:f.description}
20).filter(Boolean);let l=u.length?`:
21- ${u.join(`
22- `)}`:"";return a.length>li&&(l+=`
23...and ${a.length-li} more`),n.message=`${i.description}${vt(n.traceId)}${l}`,n.details=r.error,n}if(Ka(i)){const a=(o=(s=e==null?void 0:e.options)==null?void 0:s.query)==null?void 0:o.tag;return n.message=Za(i,a,n.traceId),n.details=r.error,n}return"description"in i&&typeof i.description=="string"?(n.message=`${i.description}${vt(n.traceId)}`,n.details=i,n):(n.message=`${fi(t,r)}${vt(n.traceId)}`,n)}function ch(t){return"type"in t&&t.type==="mutationError"&&"description"in t&&typeof t.description=="string"}function lh(t){return"type"in t&&t.type==="actionError"&&"description"in t&&typeof t.description=="string"}function Ka(t){return Pn(t)&&t.type==="queryParseError"&&typeof t.query=="string"&&typeof t.start=="number"&&typeof t.end=="number"}function Za(t,e,r){const{query:n,start:i,end:s,description:o}=t,a=r?`
24(traceId: ${r})`:"";if(!n||typeof i>"u")return`GROQ query parse error: ${o}${a}`;const u=e?`
25
26Tag: ${e}`:"";return`GROQ query parse error:
27${sh(n,{start:i,end:s},o)}${u}${a}`}function fi(t,e){const r=typeof e=="string"?` (${hh(e,100)})`:"",n=t.statusMessage?` ${t.statusMessage}`:"";return`${t.method}-request to ${t.url} resulted in HTTP ${t.statusCode}${n}${r}`}function fh(t){var r;const e=(r=t==null?void 0:t.headers)==null?void 0:r.traceparent;if(e)return e.split("-")[1]}function dh(t,e){return(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")!==-1?JSON.stringify(t,null,2):t}function vt(t){return t?` (traceId: ${t})`:""}function hh(t,e){return t.length>e?`${t.slice(0,e)}…`:t}
27class wi extends Error{constructor({projectId:r,credentials:n}={}){super("CorsOriginError");S(this,"projectId");S(this,"addOriginUrl");if(this.name="CorsOriginError",this.projectId=r,r&&typeof location<"u"){const i=new URL(`https://sanity.io/manage/project/${r}/api`),{origin:s}=location;i.searchParams.set("cors","add"),i.searchParams.set("origin",s),n&&i.searchParams.set("credentials",""),this.addOriginUrl=i,this.message=`The current origin is not allowed to connect to the Live Content API. Add it here: ${i}`}else r?this.message=`The current origin is not allowed to connect to the Live Content API. Change your configuration here: https://sanity.io/manage/project/${r}/api`:this.message="The current origin is not allowed to connect to the Live Content API."}}const ph={onResponse:(t,e)=>{if(t.statusCode>=500)throw new uh(t);if(t.statusCode>=400)throw new ah(t,e);return t}};function yh(t={}){const e={},r=n=>t.ignoreWarnings===void 0?!1:(Array.isArray(t.ignoreWarnings)?t.ignoreWarnings:[t.ignoreWarnings]).some(i=>typeof i=="string"?n.includes(i):i instanceof RegExp?i.test(n):!1);return{onResponse:n=>{const i=n.headers["x-sanity-warning"],s=Array.isArray(i)?i:[i];for(const o of s)!o||e[o]||r(o)||(e[o]=!0,console.warn(o));return n}}}function js(t,e={}){return bo([hn({shouldRetry:vh}),...t,yh(e),Eo(),$o(),xo(),ph,Io({implementation:N})])}function vh(t,e,r){if(r.maxRetries===0)return!1;const n=r.method==="GET"||r.method==="HEAD",i=(r.uri||r.url).startsWith("/data/query"),s=t.response&&(t.response.statusCode===429||t.response.statusCode===502||t.response.statusCode===503);return(n||i)&&s?!0:hn.shouldRetry(t,e,r)}const mh="https://www.sanity.io/help/";function ki(t){return mh+t}const Ts=["image","file"],Os=["before","after","replace"],mr=t=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(t))throw new Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},gh=t=>{if(!/^[-a-z0-9]+$/i.test(t))throw new Error("`projectId` can only contain only a-z, 0-9 and dashes")},wh=t=>{if(Ts.indexOf(t)===-1)throw new Error(`Invalid asset type: ${t}. Must be one of ${Ts.join(", ")}`)},Rr=(t,e)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new Error(`${t}() takes an object of properties`)},Rn=(t,e)=>{if(typeof e!="string"||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(e)||e.includes(".."))throw new Error(`${t}(): "${e}" is not a valid document ID`)},gr=(t,e)=>{if(!e._id)throw new Error(`${t}() requires that the document contains an ID ("_id" property)`);Rn(t,e._id)},bh=(t,e)=>{if(typeof e!="string")throw new Error(`\`${t}()\`: \`${e}\` is not a valid document type`)},eu=(t,e)=>{if(!e._type)throw new Error(`\`${t}()\` requires that the document contains a type (\`_type\` property)`);bh(t,e._type)},Eh=(t,e)=>{if(e._id&&e._id!==t)throw new Error(`The provided document ID (\`${e._id}\`) does not match the generated version ID (\`${t}\`)`)},$h=(t,e,r)=>{const n="insert(at, selector, items)";if(Os.indexOf(t)===-1){const i=Os.map(s=>`"${s}"`).join(", ");throw new Error(`${n} takes an "at"-argument which is one of: ${i}`)}if(typeof e!="string")throw new Error(`${n} takes a "selector"-argument which must be a string`);if(!Array.isArray(r))throw new Error(`${n} takes an "items"-argument which must be an array`)},Bt=t=>{if(t.dataset)return t.dataset;const e=t.resource;if(e&&e.type==="dataset"){const r=e.id.split(".");if(r.length!==2)throw new Error('Dataset resource ID must be in the format "project.dataset"');return r[1]}throw new Error("`dataset` must be provided to perform queries")},tu=t=>{if(typeof t!="string"||!/^[a-z0-9._-]{1,75}$/i.test(t))throw new Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return t},ru=t=>{const e=t.resource;if(!e)throw new Error("`resource` must be provided to perform resource queries");const{type:r,id:n}=e;switch(r){case"dataset":{if(n.split(".").length!==2)throw new Error('Dataset resource ID must be in the format "project.dataset"');return}case"dashboard":case"media-library":case"canvas":return;default:throw new Error(`Unsupported resource type: ${r.toString()}`)}},Xe=(t,e)=>{if(e.resource)throw new Error(`\`${t}\` does not support resource-based operations`)};function Ih(t){let e=!1,r;return(...n)=>(e||(r=t(...n),e=!0),r)}const yt=t=>Ih((...e)=>console.warn(t.join(" "),...e)),xh=yt(["Because you set `withCredentials` to true, we will override your `useCdn`","setting to be false since (cookie-based) credentials are never set on the CDN"]),Sh=yt(["Since you haven't set a value for `useCdn`, we will deliver content using our","global, edge-cached API-CDN. If you wish to have content delivered faster, set","`useCdn: false` to use the Live API. Note: You may incur higher costs using the live API."]),Ch=yt(["The Sanity client is configured with the `perspective` set to `drafts` or `previewDrafts`, which doesn't support the API-CDN.","The Live API will be used instead. Set `useCdn: false` in your configuration to hide this warning."]),Ah=yt(["The `previewDrafts` perspective has been renamed to  `drafts` and will be removed in a future API version"]),_h=yt(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${ki("js-cl
27ient-browser-token")} for more information and how to hide this warning.`]),jh=yt(["You have configured Sanity client to use a token, but also provided `withCredentials: true`.","This is no longer supported - only token will be used - remove `withCredentials: true`."]),Th=yt(["Using the Sanity client without specifying an API version is deprecated.",`See ${ki("js-client-api-version")}`]),Oh=yt(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."]),Ph=yt(["The `~experimental_resource` configuration property has been renamed to `resource`.","Please update your client configuration to use `resource` instead. Support for `~experimental_resource` will be removed in a future version."]),kh="apicdn.sanity.io",Dr={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},Rh=["localhost","127.0.0.1","0.0.0.0"],Dh=t=>Rh.indexOf(t)!==-1;function Mh(t){if(t==="1"||t==="X")return;const e=new Date(t);if(!(/^\d{4}-\d{2}-\d{2}$/.test(t)&&e instanceof Date&&e.getTime()>0))throw new Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}function nu(t){if(Array.isArray(t)&&t.length>1&&t.includes("raw"))throw new TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}const iu=(t,e)=>{const r={...e,...t,stega:{...typeof e.stega=="boolean"?{enabled:e.stega}:e.stega||Dr.stega,...typeof t.stega=="boolean"?{enabled:t.stega}:t.stega||{}}};r.apiVersion||Th();const n={...Dr,...r};n["~experimental_resource"]&&!n.resource&&(Ph(),n.resource=n["~experimental_resource"]);const i=n.resource,s=n.useProjectHostname&&!i;if(typeof Promise>"u"){const y=ki("js-client-promise-polyfill");throw new Error(`No native Promise-implementation found, polyfill needed - see ${y}`)}if(s&&!n.projectId)throw new Error("Configuration must contain `projectId`");if(i&&ru(n),typeof n.perspective<"u"&&nu(n.perspective),"encodeSourceMap"in n)throw new Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMap' is not supported in '@sanity/client'. Did you mean 'stega.enabled'?");if("encodeSourceMapAtPath"in n)throw new Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMapAtPath' is not supported in '@sanity/client'. Did you mean 'stega.filter'?");if(typeof n.stega.enabled!="boolean")throw new Error(`stega.enabled must be a boolean, received ${n.stega.enabled}`);if(n.stega.enabled&&n.stega.studioUrl===void 0)throw new Error("stega.studioUrl must be defined when stega.enabled is true");if(n.stega.enabled&&typeof n.stega.studioUrl!="string"&&typeof n.stega.studioUrl!="function")throw new Error(`stega.studioUrl must be a string or a function, received ${n.stega.studioUrl}`);const o=typeof window<"u"&&window.location&&window.location.hostname,a=o&&Dh(window.location.hostname),u=!!n.token;n.withCredentials&&u&&(jh(),n.withCredentials=!1),o&&a&&u&&n.ignoreBrowserTokenWarning!==!0?_h():typeof n.useCdn>"u"&&Sh(),s&&gh(n.projectId),n.dataset&&mr(n.dataset),"requestTagPrefix"in n&&(n.requestTagPrefix=n.requestTagPrefix?tu(n.requestTagPrefix).replace(/\.+$/,""):void 0),n.apiVersion=`${n.apiVersion}`.replace(/^v/,""),n.isDefaultApi=n.apiHost===Dr.apiHost,n.useCdn===!0&&n.withCredentials&&xh(),n.useCdn=n.useCdn!==!1&&!n.withCredentials,Mh(n.apiVersion);const l=n.apiHost.split("://",2),d=l[0],f=l[1],v=n.isDefaultApi?kh:f;return s?(n.url=`${d}://${n.projectId}.${f}/v${n.apiVersion}`,n.cdnUrl=`${d}://${n.projectId}.${v}/v${n.apiVersion}`):(n.url=`${n.apiHost}/v${n.apiVersion}`,n.cdnUrl=n.url),n};class su extends Error{constructor(){super(...arguments);S(this,"name","ConnectionFailedError")}}class Lh extends Error{constructor(r,n,i={}){super(r,i);S(this,"name","DisconnectError");S(this,"reason");this.reason=n}}class qh extends Error{constructor(r,n){super(r);S(this,"name","ChannelError");S(this,"data");this.data=n}}class Uh extends Error{constructor(r,n,i={}){super(r,i);S(this,"name","MessageError");S(this,"data");this.data=n}}
27class Ps extends Error{constructor(){super(...arguments);S(this,"name","MessageParseError")}}const Fh=["channelError","disconnect"];function ou(t,e){return vn(()=>{const r=t();return Jo(r)?r:Ke(r)}).pipe(ve(r=>Vh(r,e)))}function Vh(t,e){return new N(r=>{const n=e.includes("open"),i=e.includes("reconnect");function s(l){if("data"in l){const[d,f]=ks(l);r.error(d?new Ps("Unable to parse EventSource error message",{cause:f}):new Uh((f==null?void 0:f.data).message,f));return}t.readyState===t.CLOSED?r.error(new su("EventSource connection failed")):i&&r.next({type:"reconnect"})}function o(){r.next({type:"open"})}function a(l){var v;const[d,f]=ks(l);if(d){r.error(new Ps("Unable to parse EventSource message",{cause:d}));return}if(l.type==="channelError"){const y=new URL(t.url).searchParams.get("tag");r.error(new qh(Nh(f==null?void 0:f.data,y),f.data));return}if(l.type==="disconnect"){r.error(new Lh(`Server disconnected client: ${((v=f.data)==null?void 0:v.reason)||"unknown error"}`));return}r.next({type:l.type,id:l.lastEventId,...f.data?{data:f.data}:{}})}t.addEventListener("error",s),n&&t.addEventListener("open",o);const u=[...new Set([...Fh,...e])].filter(l=>l!=="error"&&l!=="open"&&l!=="reconnect");return u.forEach(l=>t.addEventListener(l,a)),()=>{t.removeEventListener("error",s),n&&t.removeEventListener("open",o),u.forEach(l=>t.removeEventListener(l,a)),t.close()}})}function ks(t){try{const e=typeof t.data=="string"&&JSON.parse(t.data);return[null,{type:t.type,id:t.lastEventId,...Hh(e)?{}:{data:e}}]}catch(e){return[e,null]}}function Nh(t,e){const r=t.error;return r?Ka(r)?Za(r,e):r.description?r.description:typeof r=="string"?r:JSON.stringify(r,null,2):t.message||"Unknown listener error"}function Hh(t){for(const e in t)return!1;return!0}function au(t){if(typeof t=="string")return{id:t};if(Array.isArray(t))return{query:"*[_id in $ids]",params:{ids:t}};if(typeof t=="object"&&t!==null&&"query"in t&&typeof t.query=="string")return"params"in t&&typeof t.params=="object"&&t.params!==null?{query:t.query,params:t.params}:{query:t.query};const e=["* Document ID (<docId>)","* Array of document IDs","* Object containing `query`"].join(`
28`);throw new Error(`Unknown selection - must be one of:
29
30${e}`)}class uu{constructor(e,r={}){S(this,"selection");S(this,"operations");this.selection=e,this.operations=r}set(e){return this._assign("set",e)}setIfMissing(e){return this._assign("setIfMissing",e)}diffMatchPatch(e){return Rr("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw new Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:e}),this}inc(e){return this._assign("inc",e)}dec(e){return this._assign("dec",e)}insert(e,r,n){return $h(e,r,n),this._assign("insert",{[e]:r,items:n})}append(e,r){return this.insert("after",`${e}[-1]`,r)}prepend(e,r){return this.insert("before",`${e}[0]`,r)}splice(e,r,n,i){const s=typeof n>"u"||n===-1,o=r<0?r-1:r,a=s?-1:Math.max(0,r+n),u=o<0&&a>=0?"":a,l=`${e}[${o}:${u}]`;return this.insert("replace",l,i||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...au(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,r,n=!0){return Rr(e,r),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},n&&this.operations[e]||{},r)}),this}_set(e,r){return this._assign(e,r,!1)}}var Dt;const Mi=class Mi extends uu{constructor(r,n,i){super(r,n);O(this,Dt);j(this,Dt,i)}clone(){return new Mi(this.selection,{...this.operations},c(this,Dt))}commit(r){if(!c(this,Dt))throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");const n=typeof this.selection=="string",i=Object.assign({returnFirst:n,returnDocuments:!0},r);return c(this,Dt).mutate({patch:this.serialize()},i)}};Dt=new WeakMap;let Ut=Mi;var Mt;const Li=class Li extends uu{constructor(r,n,i){super(r,n);O(this,Mt);j(this,Mt,i)}clone(){return new Li(this.selection,{...this.operations},c(this,Mt))}commit(r){if(!c(this,Mt))throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");
30const n=typeof this.selection=="string",i=Object.assign({returnFirst:n,returnDocuments:!0},r);return c(this,Mt).mutate({patch:this.serialize()},i)}};Mt=new WeakMap;let Ct=Li;const cu={returnDocuments:!1};class lu{constructor(e=[],r){S(this,"operations");S(this,"trxId");this.operations=e,this.trxId=r}create(e){return Rr("create",e),this._add({create:e})}createIfNotExists(e){const r="createIfNotExists";return Rr(r,e),gr(r,e),this._add({[r]:e})}createOrReplace(e){const r="createOrReplace";return Rr(r,e),gr(r,e),this._add({[r]:e})}delete(e){return Rn("delete",e),this._add({delete:{id:e}})}transactionId(e){return e?(this.trxId=e,this):this.trxId}serialize(){return[...this.operations]}toJSON(){return this.serialize()}reset(){return this.operations=[],this}_add(e){return this.operations.push(e),this}}var ct;const qi=class qi extends lu{constructor(r,n,i){super(r,i);O(this,ct);j(this,ct,n)}clone(){return new qi([...this.operations],c(this,ct),this.trxId)}commit(r){if(!c(this,ct))throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return c(this,ct).mutate(this.serialize(),Object.assign({transactionId:this.trxId},cu,r||{}))}patch(r,n){const i=typeof n=="function",s=typeof r!="string"&&r instanceof Ct,o=typeof r=="object"&&("query"in r||"id"in r);if(s)return this._add({patch:r.serialize()});if(i){const a=n(new Ct(r,{},c(this,ct)));if(!(a instanceof Ct))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:a.serialize()})}if(o){const a=new Ct(r,n||{},c(this,ct));return this._add({patch:a.serialize()})}return this._add({patch:{id:r,...n}})}};ct=new WeakMap;let Dn=qi;var xt;const Ui=class Ui extends lu{constructor(r,n,i){super(r,i);O(this,xt);j(this,xt,n)}clone(){return new Ui([...this.operations],c(this,xt),this.trxId)}commit(r){if(!c(this,xt))throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return c(this,xt).mutate(this.serialize(),Object.assign({transactionId:this.trxId},cu,r||{}))}patch(r,n){const i=typeof n=="function";if(typeof r!="string"&&r instanceof Ut)return this._add({patch:r.serialize()});if(i){const s=n(new Ut(r,{},c(this,xt)));if(!(s instanceof Ut))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:s.serialize()})}return this._add({patch:{id:r,...n}})}};xt=new WeakMap;let Mn=Ui;const Wh="X-Sanity-Project-ID";function Bh(t,e={}){const r={};t.headers&&Object.assign(r,t.headers);const n=e.token||t.token;n&&(r.Authorization=`Bearer ${n}`),!e.useGlobalApi&&!t.useProjectHostname&&t.projectId&&(r[Wh]=t.projectId);const i=!!(typeof e.withCredentials>"u"?t.withCredentials:e.withCredentials),s=typeof e.timeout>"u"?t.timeout:e.timeout;return Object.assign({},e,{headers:Object.assign({},r,e.headers||{}),timeout:typeof s>"u"?5*60*1e3:s,proxy:e.proxy||t.proxy,json:!0,withCredentials:i,fetch:typeof e.fetch=="object"&&typeof t.fetch=="object"?{...t.fetch,...e.fetch}:e.fetch||t.fetch})}const fu=({query:t,params:e={},options:r={}})=>{const n=new URLSearchParams,{tag:i,includeMutations:s,returnQuery:o,...a}=r;i&&n.append("tag",i),n.append("query",t);for(const[u,l]of Object.entries(e))l!==void 0&&n.append(`$${u}`,JSON.stringify(l));for(const[u,l]of Object.entries(a))l&&n.append(u,`${l}`);return o===!1&&n.append("returnQuery","false"),s===!1&&n.append("includeMutations","false"),`?${n}`},zh=(t,e)=>t===!1?void 0:typeof t>"u"?e:t,Gh=(t={})=>({dryRun:t.dryRun,returnIds:!0,returnDocuments:zh(t.returnDocuments,!0),visibility:t.visibility||"sync",autoGenerateArrayKeys:t.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:t.skipCrossDatasetReferenceValidation}),Ri=t=>t.type==="response",Qh=t=>t.body,Jh=(t,e)=>t.reduce((r,n)=>(r[e(n)]=n,r),Object.create(null)),Xh=11264;function du(t,e,r,n,i={},s={}){const o="stega"in s?{...r||{},...typeof s.stega=="boolean"?{enabled:s.stega}:s.stega||{}}:r,a=o.enabled?Zd(i):i,u=s.filterResponse===!1?h=>h:h=>h.result,{cache:l,next:d,...f}={useAbortSignal:typeof s.signal<"u",resultSourceMap:o.enabled?"withKeyArraySelector":s.resultSourceMap,...s,returnQuery:s.filterResponse===!1&&s.returnQuery!==!1}
30,v=typeof l<"u"||typeof d<"u"?{...f,fetch:{cache:l,next:d}}:f,y=zt(t,e,"query",{query:n,params:a},v);return o.enabled?y.pipe(ua(jt(Hn(()=>Promise.resolve().then(()=>xy),void 0).then(function(h){return h.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:h})=>h))),X(([h,p])=>{const g=p(h.result,h.resultSourceMap,o);return u({...h,result:g})})):y.pipe(X(u))}function wr(t,e,r,n={}){const i=(()=>{if(!n.releaseId)return r;const o=Xa(r);if(!o){if(Jn(r))throw new Error(`The document ID (\`${r}\`) is a draft, but \`options.releaseId\` is set as \`${n.releaseId}\``);return bn(r,n.releaseId)}if(o!==n.releaseId)throw new Error(`The document ID (\`${r}\`) is already a version of \`${o}\` release, but this does not match the provided \`options.releaseId\` (\`${n.releaseId}\`)`);return r})(),s={uri:qe(t,"doc",i),json:!0,tag:n.tag,signal:n.signal,query:n.includeAllVersions!==void 0?{includeAllVersions:n.includeAllVersions}:void 0};return $n(t,e,s).pipe(me(Ri),X(o=>{const a=o.body.documents;return a?n.includeAllVersions?a:a[0]:n.includeAllVersions?[]:void 0}))}function hu(t,e,r,n={}){const i={uri:qe(t,"doc",r.join(",")),json:!0,tag:n.tag,signal:n.signal};return $n(t,e,i).pipe(me(Ri),X(s=>{const o=Jh(s.body.documents||[],a=>a._id);return r.map(a=>o[a]||null)}))}function pu(t,e,r,n={}){return zt(t,e,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:r}},n)}function yu(t,e,r,n){return gr("createIfNotExists",r),Kn(t,e,r,"createIfNotExists",n)}function vu(t,e,r,n){return gr("createOrReplace",r),Kn(t,e,r,"createOrReplace",n)}function mu(t,e,r,n,i){return gr("createVersion",r),eu("createVersion",r),Oh(),ne(t,e,{actionType:"sanity.action.document.version.create",publishedId:n,document:r},i)}function gu(t,e,r,n,i,s,o){if(!n)throw new Error("`createVersion()` requires `baseId` when no `document` is provided");if(!r)throw new Error("`createVersion()` requires `publishedId` when `baseId` is provided");Rn("createVersion",n),Rn("createVersion",r);const a={actionType:"sanity.action.document.version.create",publishedId:r,baseId:n,versionId:i?bn(r,i):Ja(r),ifBaseRevisionId:s};return ne(t,e,a,o)}function wu(t,e,r,n){return zt(t,e,"mutate",{mutations:[{delete:au(r)}]},n)}function bu(t,e,r,n=!1,i){return ne(t,e,{actionType:"sanity.action.document.version.discard",versionId:r,purge:n},i)}function Eu(t,e,r,n){return gr("replaceVersion",r),eu("replaceVersion",r),ne(t,e,{actionType:"sanity.action.document.version.replace",document:r},n)}function $u(t,e,r,n,i){return ne(t,e,{actionType:"sanity.action.document.version.unpublish",versionId:r,publishedId:n},i)}function Iu(t,e,r,n){let i;r instanceof Ct||r instanceof Ut?i={patch:r.serialize()}:r instanceof Dn||r instanceof Mn?i=r.serialize():i=r;const s=Array.isArray(i)?i:[i],o=n&&n.transactionId||void 0;return zt(t,e,"mutate",{mutations:s,transactionId:o},n)}function ne(t,e,r,n){const i=Array.isArray(r)?r:[r],s=n&&n.transactionId||void 0,o=n&&n.skipCrossDatasetReferenceValidation||void 0,a=n&&n.dryRun||void 0;return zt(t,e,"actions",{actions:i,transactionId:s,skipCrossDatasetReferenceValidation:o,dryRun:a},n)}function zt(t,e,r,n,i={}){const s=r==="mutate",o=r==="actions",a=r==="query",u=s||o?"":fu(n),l=!s&&!o&&u.length<Xh,d=l?u:"",f=i.returnFirst,{timeout:v,token:y,tag:h,headers:p,returnQuery:g,lastLiveEventId:m,cacheMode:x}=i,A=qe(t,r,d),C={method:l?"GET":"POST",uri:A,json:!0,body:l?void 0:n,query:s&&Gh(i),timeout:v,headers:p,token:y,tag:h,returnQuery:g,perspective:i.perspective,resultSourceMap:i.resultSourceMap,lastLiveEventId:Array.isArray(m)?m[0]:m,cacheMode:x,canUseCdn:a,signal:i.signal,fetch:i.fetch,useAbortSignal:i.useAbortSignal,useCdn:i.useCdn};return $n(t,e,C).pipe(me(Ri),X(Qh),X(G=>{if(!s)return G;const W=G.results||[];if(i.returnDocuments)return f?W[0]&&W[0].document:W.map(pe=>pe.document);const Ie=f?"documentId":"documentIds",ke=f?W[0]&&W[0].id:W.map(pe=>pe.id);return{transactionId:G.transactionId,results:W,[Ie]:ke}}))}function Kn(t,e,r,n,i={}){const s={[n]:r},o=Object.assign({returnFirst:!0,returnDocuments:!0},i);return zt(t,e,"mutate",{mutations:[s]},o)}const En=t=>{const e=t.config();return e.dataset!==void 0&&e.projectId!==void 0||e.resource!==void 0},xu=(t,e)=>En(t)&&e.startsWith(qe(t,"query")),Yh=(t,e)=>En(t)&&e.startsWith(qe(t,"mutate")),Kh=(t,e)=>En(t)&&e.startsWith(qe(t,"doc","")),Zh=(t,e)=>En(t)&&e.startsWith(qe(t,"listen")),ep=(t,e)=>En(t)&&e.startsWith(qe(t,"history","")),tp=(t,e)=>e.startsWith("/data/")||xu(t,e)||Yh(t,e)||Kh(t,e)||Zh(t,e)||ep(t,e);function $n(t,e,r){const n=r.url||r.uri,i=t.config(),s=typeof r.canUseCdn>"u"?["GET","HEAD"].indexOf(r.method||"GET")>=0&&tp(t,n):r.canUseCdn;let o=(r.useCdn??i.useCdn)&&s;const a=r.tag&&i.requestTagPrefix?[i.requestTagPrefix,r.tag].join("."):r.tag||i.requestTagPrefix;if(a&&r.tag!==null&&(r.query={tag:tu(a),...r.query}),["GET","HEAD","POST"].indexOf(r.method||"GET")>=0&&xu(t,n)){const d=r.resultSourceMap??i.resultSourceMap;d!==void 0&&d!==!1&&(r.query={resultSourceMap:d,...r.query});const f=r.perspective||i.perspective;typeof f<"u"&&(f==="previewDrafts"&&Ah(),nu(f),r.query={perspective:Array.isArray(f)?f.join(","):f,...r.query},(Array.isArray(f)&&f.length>0||f==="previewDrafts"||f==="drafts")&&o&&(o=!1,Ch())),r.lastLiveEventId&&(r.query={...r.query,lastLiveEventId:r.lastLiveEventId}),r.returnQuery===!1&&(r.query={returnQuery:"false",...r.query}),o&&r.cacheMode=="noStale"&&(r.query={cacheMode:"noStale",...r.query})}const u=Bh(i,Object.assign({},r,{url:Di(t,n,o)})),l=new N(d=>e(u,i.requester).subscribe(d));return r.signal?l.pipe(rp(r.signal)):l}function ae(t,e,r){return $n(t,e,r).pipe(me(n=>n.type==="response"),X(n=>n.body))}function qe(t,e,r){const n=t.config();
30if(n.resource){ru(n);const o=sp(n),a=r!==void 0?`${e}/${r}`:e;return`${o}/${a}`.replace(/\/($|\?)/,"$1")}const i=Bt(n),s=`/${e}/${i}`;return`/data${r!==void 0?`${s}/${r}`:s}`.replace(/\/($|\?)/,"$1")}function Di(t,e,r=!1){const{url:n,cdnUrl:i}=t.config();return`${r?i:n}/${e.replace(/^\//,"")}`}function rp(t){return e=>new N(r=>{const n=()=>r.error(ip(t));if(t&&t.aborted){n();return}const i=e.subscribe(r);return t.addEventListener("abort",n),()=>{t.removeEventListener("abort",n),i.unsubscribe()}})}const np=!!globalThis.DOMException;function ip(t){if(np)return new DOMException((t==null?void 0:t.reason)??"The operation was aborted.","AbortError");const e=new Error((t==null?void 0:t.reason)??"The operation was aborted.");return e.name="AbortError",e}const sp=t=>{const e=t.resource;if(!e)throw new Error("`resource` must be provided to perform resource queries");const{type:r,id:n}=e;switch(r){case"dataset":{const i=n.split(".");if(i.length!==2)throw new Error('Dataset ID must be in the format "project.dataset"');return`/projects/${i[0]}/datasets/${i[1]}`}case"canvas":return`/canvases/${n}`;case"media-library":return`/media-libraries/${n}`;case"dashboard":return`/dashboards/${n}`;default:throw new Error(`Unsupported resource type: ${r.toString()}`)}};
30function Su(t,e,r){const n=Bt(t.config());return ae(t,e,{method:"POST",uri:`/agent/action/generate/${n}`,body:r})}function op(t,e,r){const n=Bt(t.config());return ae(t,e,{method:"POST",uri:`/agent/action/patch/${n}`,body:r})}function ap(t,e,r){const n=Bt(t.config());return ae(t,e,{method:"POST",uri:`/agent/action/prompt/${n}`,body:r})}function Cu(t,e,r){const n=Bt(t.config());return ae(t,e,{method:"POST",uri:`/agent/action/transform/${n}`,body:r})}function Au(t,e,r){const n=Bt(t.config());return ae(t,e,{method:"POST",uri:`/agent/action/translate/${n}`,body:r})}var Lt,qt;class up{constructor(e,r){O(this,Lt);O(this,qt);j(this,Lt,e),j(this,qt,r)}generate(e){return Su(c(this,Lt),c(this,qt),e)}transform(e){return Cu(c(this,Lt),c(this,qt),e)}translate(e){return Au(c(this,Lt),c(this,qt),e)}}Lt=new WeakMap,qt=new WeakMap;var lt,ft;class cp{constructor(e,r){O(this,lt);O(this,ft);j(this,lt,e),j(this,ft,r)}generate(e){return R(Su(c(this,lt),c(this,ft),e))}transform(e){return R(Cu(c(this,lt),c(this,ft),e))}translate(e){return R(Au(c(this,lt),c(this,ft),e))}prompt(e){return R(ap(c(this,lt),c(this,ft),e))}patch(e){return R(op(c(this,lt),c(this,ft),e))}}lt=new WeakMap,ft=new WeakMap;var en,tn;class lp{constructor(e,r){O(this,en);O(this,tn);j(this,en,e),j(this,tn,r)}upload(e,r,n){return _u(c(this,en),c(this,tn),e,r,n)}}en=new WeakMap,tn=new WeakMap;var rn,nn;class fp{constructor(e,r){O(this,rn);O(this,nn);j(this,rn,e),j(this,nn,r)}upload(e,r,n){const i=_u(c(this,rn),c(this,nn),e,r,n);return R(i.pipe(me(s=>s.type==="response"),X(s=>s.body.document)))}}rn=new WeakMap,nn=new WeakMap;function _u(t,e,r,n,i={}){var m;wh(r);let s=i.extract||void 0;s&&!s.length&&(s=["none"]);const o=t.config(),a=hp(i,n),{tag:u,label:l,title:d,description:f,creditLine:v,filename:y,source:h}=a,p=((m=o.resource)==null?void 0:m.type)==="media-library",g=p?{title:d,filename:y}:{label:l,title:d,description:f,filename:y,meta:s,creditLine:v};return h&&!p&&(g.sourceId=h.id,g.sourceName=h.name,g.sourceUrl=h.url),$n(t,e,{tag:u,method:"POST",timeout:a.timeout||0,uri:dp(o,r),headers:a.contentType?{"Content-Type":a.contentType}:{},query:g,body:n})}function dp(t,e){const r=e==="image"?"images":"files",n=t.resource;if(n){const{type:s,id:o}=n;switch(s){case"dataset":throw new Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${o}/assets/${r}`;case"media-library":return`/media-libraries/${o}/upload`;case"dashboard":return`/dashboards/${o}/assets/${r}`;default:throw new Error(`Unsupported resource type: ${s.toString()}`)}}const i=Bt(t);return`assets/${r}/${i}`}function hp(t,e){return typeof File>"u"||!(e instanceof File)?t:Object.assign({filename:t.preserveFilename===!1?void 0:e.name,contentType:e.type},t)}var pp=(t,e)=>Object.keys(e).concat(Object.keys(t)).reduce((r,n)=>(r[n]=typeof t[n]>"u"?e[n]:t[n],r),{});const yp=(t,e)=>e.reduce((r,n)=>(typeof t[n]>"u"||(r[n]=t[n]),r),{}),ju=vn(()=>Hn(()=>Promise.resolve().then(()=>Hu),void 0)).pipe(X(({default:t})=>t),da(1));function Tu(){return function(t){return t.pipe(mn((e,r)=>e instanceof su?qr(Ke({type:"reconnect"}),Tt(1e3).pipe(ve(()=>r))):pn(()=>e)))}}const vp=14800,mp=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","enableResume","tag"],gp={includeResult:!0};function Ou(t,e,r={}){const{url:n,token:i,withCredentials:s,requestTagPrefix:o,headers:a}=this.config(),u=r.tag&&o?[o,r.tag].join("."):r.tag,l={...pp(r,gp),tag:u},d=yp(l,mp),f=fu({query:t,params:e,options:{tag:u,...d}}),v=`${n}${qe(this,"listen",f)}`;if(v.length>vp)return pn(()=>new Error("Query too large for listener"));const y=l.events?l.events:["mutation"],h={};return s&&(h.withCredentials=!0),(i||a)&&(h.headers={},i&&(h.headers.Authorization=`Bearer ${i}`),a&&Object.assign(h.headers,a)),ou(()=>(typeof EventSource>"u"||h.headers?ju:Ke(EventSource)).pipe(X(p=>new p(v,h))),y).pipe(Tu(),me(p=>y.includes(p.type)),X(p=>({type:p.type,..."data"in p?p.data:{}})))}function wp(t,e){return bp(typeof t=="function"?{predicate:t,...e}:t)}function bp(t){return e=>{let r,n=!1;const{predicate:i,...s}=t,o=e.pipe(ha(u=>{t.predicate(u)&&(n=!0,r=u)}),Gn(()=>{n=!1,r=void 0}),_i(s)),a=new N(u=>{n&&u.next(r),u.complete()});return na(o,a)}}const Rs="2021-03-25";var St;class Pu{constructor(e){O(this,St);j(this,St,e)}events({includeDrafts:e=!1,tag:r,waitFor:n}={}){const{projectId:i,apiVersion:s,token:o,withCredentials:a,requestTagPrefix:u,headers:l}=c(this,St).config(),d=s.replace(/^v/,"");if(d!=="X"&&d<Rs)throw new Error(`The live events API requires API version ${Rs} or later. The current API version is ${d}. Please update your API version to use this feature.`);if(e&&!o&&!a)throw new Error("The live events API requires a token or withCredentials when 'includeDrafts: true'. Please update your client configuration. The token should have the lowest possible access role.");const f=qe(c(this,St),"live/events"),v=new URL(c(this,St).getUrl(f,!1)),y=r&&u?[u,r].join("."):r;y&&v.searchParams.set("tag",y),e&&v.searchParams.set("includeDrafts","true"),n&&v.searchParams.set("waitFor",n);const h={};e&&a&&(h.withCredentials=!0),(e&&o||l)&&(h.headers={},e&&o&&(h.headers.Authorization=`Bearer ${o}`),l&&Object.assign(h.headers,l));const p=`${v.href}::${JSON.stringify(h)}`,g=di.get(p);if(g)return g;const m=ou(()=>(typeof EventSource>"u"||h.headers?ju:Ke(EventSource)).pipe(X(C=>new C(v.href,h))),["message","restart","welcome","reconnect","goaway"]),x=Ep(new URL(c(this,St).getUrl("/check/cors",!1)),i,h.withCredentials===!0),A=m.pipe(Tu(),ve(C=>C.type==="reconnect"?x.pipe(ve(()=>Ke(C))):Ke(C)),mn(C=>C instanceof wi?pn(()=>C):x.pipe(ve(()=>{throw C}))),X(C=>{if(C.type==="message"){const{data:G,...W}=C;return{...W,tags:G.tags}}return C})).pipe(Gn(()=>di.delete(p)),wp({predicate:C=>C.type==="welcome"}));return di.set(p,A),A}}St=new WeakMap;function Ep(t,e,r){return new N(n=>{const i=new AbortController,{signal:s}=i;return fetch(t,{method:"GET",mode:"cors",credentials:"omit",signal:s}).then(o=>{if(!(s.aborted||!o.ok))return o.json()}).then(o=>{var a,u;if(!s.aborted){if(r&&((a=o==null?void 0:o.result)==null?void 0:a.withCredentials)===!1){n.error(new wi({projectId:e,credentials:!0}));return}if(((u=o==null?void 0:o.result)==null?void 0:u.allowed)===!1){n.error(new wi({projectId:e,credentials:r}));return}n.next(),n.complete()}}).catch(()=>{s.aborted||n.closed||(n.next(),n.complete())}),()=>i.abort()})}const di=new Map;var ye,Ge;class $p{constructor(e,r){O(this,ye);O(this,Ge);j(this,ye,e),j(this,Ge,r)}create(e,r){return Zt(c(this,ye),c(this,Ge),"PUT",e,r)}edit(e,r){return Zt(c(this,ye),c(this,Ge),"PATCH",e,r)}delete(e){return Zt(c(this,ye),c(this,Ge),"DELETE",e)}list(){Xe("dataset",c(this,ye).config());const e=c(this,ye).config(),r=e.projectId;let n="/datasets";return e.useProjectHostname===!1&&(n=`/projects/${r}/datasets`),ae(c(this,ye),c(this,Ge),{uri:n,tag:null})}getEmbeddingsSettings(e){return Xe("dataset",c(this,ye).config()),mr(e),ae(c(this,ye),c(this,Ge),{uri:Ln(c(this,ye),e),tag:null})}editEmbeddingsSettings(e,r){return Xe("dataset",c(this,ye).config()),mr(e),ae(c(this,ye),c(this,Ge),{method:"PUT",uri:Ln(c(this,ye),e),body:r,tag:null})}}ye=new WeakMap,Ge=new WeakMap;var le,Qe;class Ip{constructor(e,r){O(this,le);O(this,Qe);j(this,le,e),j(this,Qe,r)}create(e,r){return Xe("dataset",c(this,le).config()),R(Zt(c(this,le),c(this,Qe),"PUT",e,r))}edit(e,r){return Xe("dataset",c(this,le).config()),R(Zt(c(this,le),c(this,Qe),"PATCH",e,r))}delete(e){return Xe("dataset",c(this,le).config()),R(Zt(c(this,le),c(this,Qe),"DELETE",e))}list(){Xe("dataset",c(this,le).config());const e=c(this,le).config(),r=e.projectId;let n="/datasets";return e.useProjectHostname===!1&&(n=`/projects/${r}/datasets`),R(ae(c(this,le),c(this,Qe),{uri:n,tag:null}))}getEmbeddingsSettings(e){return Xe("dataset",c(this,le).config()),mr(e),R(ae(c(this,le),c(this,Qe),{uri:Ln(c(this,le),e),tag:null}))}editEmbeddingsSettings(e,r){return Xe("dataset",c(this,le).config()),mr(e),R(ae(c(this,le),c(this,Qe),{method:"PUT",uri:Ln(c(this,le),e),body:r,tag:null}))}}le=new WeakMap,Qe=new WeakMap;function Ln(t,e){const r=t.config();return r.useProjectHostname===!1?`/projects/${r.projectId}/datasets/${e}/settings/embeddings`:`/datasets/${e}/settings/embeddings`}function Zt(t,e,r,n,i){return Xe("dataset",t.config()),mr(n),ae(t,e,{method:r,uri:`/datasets/${n}`,body:i,tag:null})}var ar,sn;
30class ku{constructor(e,r){O(this,ar);O(this,sn);j(this,ar,e),j(this,sn,r)}getPlaybackInfo(e,r={}){var d;const n=c(this,ar).config(),i=(d=n.resource||n["~experimental_resource"])==null?void 0:d.id,{instanceId:s,libraryId:o}=Ap(e),a=o||i;if(!a)throw new Error("Could not determine Media Library ID - you need to provide a valid Media Library ID in the client config or a Media Library GDR");const u=_p(s,a),l=jp(r);return ae(c(this,ar),c(this,sn),{method:"GET",uri:u,query:l})}}ar=new WeakMap,sn=new WeakMap;var on,an;class xp{constructor(e,r){O(this,on);O(this,an);j(this,on,e),j(this,an,r)}getPlaybackInfo(e,r={}){return R(new ku(c(this,on).observable,c(this,an)).getPlaybackInfo(e,r))}}on=new WeakMap,an=new WeakMap;const Sp=/^media-library:(ml[^:]+):([^:]+)$/;function Cp(t){return typeof t=="object"&&"_ref"in t}function Ap(t){const e=Cp(t)?t._ref:t,r=Sp.exec(e);if(r){const[,n,i]=r;return{libraryId:n,instanceId:i}}if(typeof t=="string"&&t.startsWith("video-"))return{instanceId:t};throw new Error(`Invalid video asset instance identifier "${e}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}function _p(t,e){return`/media-libraries/${e}/video/${t}/playback-info`}function jp(t){const e={};if(t.transformations){const{thumbnail:r,animated:n,storyboard:i}=t.transformations;r&&(r.width&&(e.thumbnailWidth=r.width),r.height&&(e.thumbnailHeight=r.height),r.time!==void 0&&(e.thumbnailTime=r.time),r.fit&&(e.thumbnailFit=r.fit),r.format&&(e.thumbnailFormat=r.format)),n&&(n.width&&(e.animatedWidth=n.width),n.height&&(e.animatedHeight=n.height),n.start!==void 0&&(e.animatedStart=n.start),n.end!==void 0&&(e.animatedEnd=n.end),n.fps&&(e.animatedFps=n.fps),n.format&&(e.animatedFormat=n.format)),i&&i.format&&(e.storyboardFormat=i.format)}return t.expiration&&(e.expiration=t.expiration),e}var ur,cr;class Tp{constructor(e,r){O(this,ur);O(this,cr);j(this,ur,e),j(this,cr,r)}list(e){const r={},n="/projects";return(e==null?void 0:e.includeMembers)===!1&&(r.includeMembers="false"),(e==null?void 0:e.includeFeatures)===!1&&(r.includeFeatures="false"),e!=null&&e.organizationId&&(r.organizationId=e.organizationId),e!=null&&e.onlyExplicitMembership&&(r.onlyExplicitMembership="true"),ae(c(this,ur),c(this,cr),{uri:n,query:r})}getById(e){return ae(c(this,ur),c(this,cr),{uri:`/projects/${e}`})}}ur=new WeakMap,cr=new WeakMap;var lr,fr;class Op{constructor(e,r){O(this,lr);O(this,fr);j(this,lr,e),j(this,fr,r)}list(e){const r={},n="/projects";return(e==null?void 0:e.includeMembers)===!1&&(r.includeMembers="false"),(e==null?void 0:e.includeFeatures)===!1&&(r.includeFeatures="false"),e!=null&&e.organizationId&&(r.organizationId=e.organizationId),e!=null&&e.onlyExplicitMembership&&(r.onlyExplicitMembership="true"),R(ae(c(this,lr),c(this,fr),{uri:n,query:r}))}getById(e){return R(ae(c(this,lr),c(this,fr),{uri:`/projects/${e}`}))}}lr=new WeakMap,fr=new WeakMap;const Ds=ih("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),qn=(t,e)=>e?bn(t,e):Ja(t);function Un(t,{releaseId:e,publishedId:r,document:n}){if(r&&n._id){const i=qn(r,e);return Eh(i,n),i}if(n._id){const i=Jn(n._id),s=Xn(n._id);if(!i&&!s)throw new Error(`\`${t}()\` requires a document with an \`_id\` that is a version or draft ID`);if(e){if(i)throw new Error(`\`${t}()\` was called with a document ID (\`${n._id}\`) that is a draft ID, but a release ID (\`${e}\`) was also provided.`);const o=Xa(n._id);if(o!==e)throw new Error(`\`${t}()\` was called with a document ID (\`${n._id}\`) that is a version ID, but the release ID (\`${e}\`) does not match the document's version ID (\`${o}\`).`)}return n._id}if(r)return qn(r,e);throw new Error(`\`${t}()\` requires either a publishedId or a document with an \`_id\``)}const Pp=(t,e)=>{if(typeof t=="object"&&t!==null&&("releaseId"in t||"metadata"in t)){const{releaseId:r=Ds(),metadata:n={}}=t;return[r,n,e]}return[Ds(),{},t]},Ru=(t,e)=>{const[r,n,i]=Pp(t,e),s={...n,releaseType:n.releaseType||"undecided"};return{action:{actionType:"sanity.action.release.create",releaseId:r,metadata:s},options:i}};var xe,Se;class kp{constructor(e,r){O(this,xe);O(this,Se);j(this,xe,e),j(this,Se,r)}get({releaseId:e},r){return wr(c(this,xe),c(this,Se),`_.releases.${e}`,r)}create(e,r){const{action:n,options:i}=Ru(e,r),{releaseId:s,metadata:o}=n;return ne(c(this,xe),c(this,Se),n,i).pipe(X(a=>({...a,releaseId:s,metadata:o})))}edit({releaseId:e,patch:r},n){const i={actionType:"sanity.action.release.edit",releaseId:e,patch:r};return ne(c(this,xe),c(this,Se),i,n)}publish({releaseId:e},r){const n={actionType:"sanity.action.release.publish",releaseId:e};return ne(c(this,xe),c(this,Se),n,r)}archive({releaseId:e},r){const n={actionType:"sanity.action.release.archive",releaseId:e};return ne(c(this,xe),c(this,Se),n,r)}unarchive({releaseId:e},r){const n={actionType:"sanity.action.release.unarchive",releaseId:e};return ne(c(this,xe),c(this,Se),n,r)}schedule({releaseId:e,publishAt:r},n){const i={actionType:"sanity.action.release.schedule",releaseId:e,publishAt:r};return ne(c(this,xe),c(this,Se),i,n)}unschedule({releaseId:e},r){const n={actionType:"sanity.action.release.unschedule",releaseId:e};return ne(c(this,xe),c(this,Se),n,r)}delete({releaseId:e},r){const n={actionType:"sanity.action.release.delete",releaseId:e};return ne(c(this,xe),c(this,Se),n,r)}fetchDocuments({releaseId:e},r){return pu(c(this,xe),c(this,Se),e,r)}}xe=new WeakMap,Se=new WeakMap;var Ce,Ae;class Rp{constructor(e,r){O(this,Ce);O(this,Ae);j(this,Ce,e),j(this,Ae,r)}get({releaseId:e},r){return R(wr(c(this,Ce),c(this,Ae),`_.releases.${e}`,r))}async create(e,r){const{action:n,options:i}=Ru(e,r),{releaseId:s,metadata:o}=n;return{...await R(ne(c(this,Ce),c(this,Ae),n,i)),releaseId:s,metadata:o}}edit({releaseId:e,patch:r},n){const i={actionType:"sanity.action.release.edit",releaseId:e,patch:r};return R(ne(c(this,Ce),c(this,Ae),i,n))}publish({releaseId:e},r){const n={actionType:"sanity.action.release.publish",releaseId:e};return R(ne(c(this,Ce),c(this,Ae),n,r))}archive({releaseId:e},r){const n={actionType:"sanity.action.release.archive",releaseId:e};return R(ne(c(this,Ce),c(this,Ae),n,r))}unarchive({releaseId:e},r){const n={actionType:"sanity.action.release.unarchive",releaseId:e};return R(ne(c(this,Ce),c(this,Ae),n,r))}schedule({releaseId:e,publishAt:r},n){const i={actionType:"sanity.action.release.schedule",releaseId:e,publishAt:r};return R(ne(c(this,Ce),c(this,Ae),i,n))}unschedule({releaseId:e},r){const n={actionType:"sanity.action.release.unschedule",releaseId:e};return R(ne(c(this,Ce),c(this,Ae),n,r))}delete({releaseId:e},r){const n={actionType:"sanity.action.release.delete",releaseId:e};return R(ne(c(this,Ce),c(this,Ae),n,r))}fetchDocuments({releaseId:e},r){return R(pu(c(this,Ce),c(this,Ae),e,r))}}Ce=new WeakMap,Ae=new WeakMap;var un,cn;class Dp{constructor(e,r){O(this,un);O(this,cn);j(this,un,e),j(this,cn,r)}getById(e){return ae(c(this,un),c(this,cn),{uri:`/users/${e}`})}}un=new WeakMap,cn=new WeakMap;var ln,fn;class Mp{constructor(e,r){O(this,ln);O(this,fn);j(this,ln,e),j(this,fn,r)}getById(e){return R(ae(c(this,ln),c(this,fn),{uri:`/users/${e}`}))}}ln=new WeakMap,fn=new WeakMap;var dt,dr,Z;const Nn=class Nn{constructor(e,r=Dr){S(this,"assets");S(this,"datasets");S(this,"live");S(this,"mediaLibrary");S(this,"projects");S(this,"users");S(this,"agent");S(this,"releases");O(this,dt);O(this,dr);O(this,Z);S(this,"listen",Ou);this.config(r),j(this,dr,e);const n=r._requestHandler;j(this,Z,n?(()=>{let i;return(s,o)=>{const a=s;
30return i||(i=new Fn(e,{...r,_requestHandler:void 0})),n(a,u=>e(u,o),i)}})():e),this.assets=new lp(this,c(this,Z)),this.datasets=new $p(this,c(this,Z)),this.live=new Pu(this),this.mediaLibrary={video:new ku(this,c(this,Z))},this.projects=new Tp(this,c(this,Z)),this.users=new Dp(this,c(this,Z)),this.agent={action:new up(this,c(this,Z))},this.releases=new kp(this,c(this,Z))}clone(){return new Nn(c(this,dr),this.config())}config(e){if(e===void 0)return{...c(this,dt)};if(c(this,dt)&&c(this,dt).allowReconfigure===!1)throw new Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return j(this,dt,iu(e,c(this,dt)||{})),this}withConfig(e){const r=this.config();return new Nn(c(this,dr),{...r,...e,stega:{...r.stega||{},...typeof(e==null?void 0:e.stega)=="boolean"?{enabled:e.stega}:(e==null?void 0:e.stega)||{}}})}fetch(e,r,n){return du(this,c(this,Z),c(this,dt).stega,e,r,n)}getDocument(e,r){if((r==null?void 0:r.includeAllVersions)===!0)return wr(this,c(this,Z),e,{...r,includeAllVersions:!0});const n={signal:r==null?void 0:r.signal,tag:r==null?void 0:r.tag,releaseId:r==null?void 0:r.releaseId,...r&&"includeAllVersions"in r?{includeAllVersions:!1}:{}};return wr(this,c(this,Z),e,n)}getDocuments(e,r){return hu(this,c(this,Z),e,r)}create(e,r){return Kn(this,c(this,Z),e,"create",r)}createIfNotExists(e,r){return yu(this,c(this,Z),e,r)}createOrReplace(e,r){return vu(this,c(this,Z),e,r)}createVersion({document:e,publishedId:r,releaseId:n,baseId:i,ifBaseRevisionId:s},o){if(!e)return gu(this,c(this,Z),r,i,n,s,o);const a=Un("createVersion",{document:e,publishedId:r,releaseId:n}),u={...e,_id:a},l=r||Yn(e._id);return mu(this,c(this,Z),u,l,o)}delete(e,r){return wu(this,c(this,Z),e,r)}discardVersion({releaseId:e,publishedId:r},n,i){const s=qn(r,e);return bu(this,c(this,Z),s,n,i)}replaceVersion({document:e,publishedId:r,releaseId:n},i){const s=Un("replaceVersion",{document:e,publishedId:r,releaseId:n}),o={...e,_id:s};return Eu(this,c(this,Z),o,i)}unpublishVersion({releaseId:e,publishedId:r},n){const i=bn(r,e);return $u(this,c(this,Z),i,r,n)}mutate(e,r){return Iu(this,c(this,Z),e,r)}patch(e,r){return new Ut(e,r,this)}transaction(e){return new Mn(e,this)}action(e,r){return ne(this,c(this,Z),e,r)}request(e){return ae(this,c(this,Z),e)}getUrl(e,r){return Di(this,e,r)}getDataUrl(e,r){return qe(this,e,r)}};dt=new WeakMap,dr=new WeakMap,Z=new WeakMap;let bi=Nn;var ht,hr,K;const Mr=class Mr{constructor(e,r=Dr){S(this,"assets");S(this,"datasets");S(this,"live");S(this,"mediaLibrary");S(this,"projects");S(this,"users");S(this,"agent");S(this,"releases");S(this,"observable");O(this,ht);O(this,hr);O(this,K);S(this,"listen",Ou);this.config(r),j(this,hr,e);const n=r._requestHandler;j(this,K,n?(()=>{let i;return(s,o)=>{const a=s;return i||(i=new Mr(e,{...r,_requestHandler:void 0})),n(a,u=>e(u,o),i)}})():e),this.assets=new fp(this,c(this,K)),this.datasets=new Ip(this,c(this,K)),this.live=new Pu(this),this.mediaLibrary={video:new xp(this,c(this,K))},this.projects=new Op(this,c(this,K)),this.users=new Mp(this,c(this,K)),this.agent={action:new cp(this,c(this,K))},this.releases=new Rp(this,c(this,K)),this.observable=new bi(e,r)}clone(){return new Mr(c(this,hr),this.config())}config(e){if(e===void 0)return{...c(this,ht)};if(c(this,ht)&&c(this,ht).allowReconfigure===!1)throw new Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),j(this,ht,iu(e,c(this,ht)||{})),this}withConfig(e){const r=this.config();return new Mr(c(this,hr),{...r,...e,stega:{...r.stega||{},...typeof(e==null?void 0:e.stega)=="boolean"?{enabled:e.stega}:(e==null?void 0:e.stega)||{}}})}fetch(e,r,n){return R(du(this,c(this,K),c(this,ht).stega,e,r,n))}getDocument(e,r){if((r==null?void 0:r.includeAllVersions)===!0)return R(wr(this,c(this,K),e,{...r,includeAllVersions:!0}));const n={signal:r==null?void 0:r.signal,tag:r==null?void 0:r.tag,releaseId:r==null?void 0:r.releaseId,...r&&"includeAllVersions"in r?{includeAllVersions:!1}:{}};return R(wr(this,c(this,K),e,n))}getDocuments(e,r){return R(hu(this,c(this,K),e,r))}create(e,r){return R(Kn(this,c(this,K),e,"create",r))}createIfNotExists(e,r){return R(yu(this,c(this,K),e,r))}createOrReplace(e,r){return R(vu(this,c(this,K),e,r))}createVersion({document:e,publishedId:r,releaseId:n,baseId:i,ifBaseRevisionId:s},o){if(!e)return ai(gu(this,c(this,K),r,i,n,s,o));const a=Un("createVersion",{document:e,publishedId:r,releaseId:n}),u={...e,_id:a},l=r||Yn(e._id);return ai(mu(this,c(this,K),u,l,o))}delete(e,r){return R(wu(this,c(this,K),e,r))}discardVersion({releaseId:e,publishedId:r},n,i){const s=qn(r,e);return R(bu(this,c(this,K),s,n,i))}replaceVersion({document:e,publishedId:r,releaseId:n},i){const s=Un("replaceVersion",{document:e,publishedId:r,releaseId:n}),o={...e,_id:s};return ai(Eu(this,c(this,K),o,i))}unpublishVersion({releaseId:e,publishedId:r},n){const i=bn(r,e);return R($u(this,c(this,K),i,r,n))}mutate(e,r){return R(Iu(this,c(this,K),e,r))}patch(e,r){return new Ct(e,r,this)}transaction(e){return new Dn(e,this)}action(e,r){return R(ne(this,c(this,K),e,r))}request(e){return R(ae(this,c(this,K),e))}dataRequest(e,r,n){return R(zt(this,c(this,K),e,r,n))}getUrl(e,r){return Di(this,e,r)}getDataUrl(e,r){return qe(this,e,r)}};
30ht=new WeakMap,hr=new WeakMap,K=new WeakMap;let Fn=Mr;function Lp(t,e){return{requester:js(t),createClient:r=>{const n=js(t,{ignoreWarnings:r.ignoreWarnings});return new e((i,s)=>(s||n)({maxRedirects:0,maxRetries:r.maxRetries,retryDelay:r.retryDelay,lineage:r.lineage,...i}),r)}}}var qp=[];const Up=Lp(qp,Fn),Fv=Up.createClient,Du=/_key\s*==\s*['"](.*)['"]/;function Fp(t){return typeof t=="string"?Du.test(t.trim()):typeof t=="object"&&"_key"in t}function Mu(t){if(!Array.isArray(t))throw new Error("Path is not an array");return t.reduce((e,r,n)=>{const i=typeof r;if(i==="number")return`${e}[${r}]`;if(i==="string")return`${e}${n===0?"":"."}${r}`;if(Fp(r)&&r._key)return`${e}[_key=="${r._key}"]`;if(Array.isArray(r)){const[s,o]=r;return`${e}[${s}:${o}]`}throw new Error(`Unsupported path segment \`${JSON.stringify(r)}\``)},"")}const Ms={"\f":"\\f","\n":"\\n","\r":"\\r","	":"\\t","'":"\\'","\\":"\\\\"},Ls={"\\f":"\f","\\n":`
31`,"\\r":"\r","\\t":"	","\\'":"'","\\\\":"\\"};function Vp(t){return`$${t.map(e=>typeof e=="string"?`['${e.replace(/[\f\n\r\t'\\]/g,r=>Ms[r])}']`:typeof e=="number"?`[${e}]`:e._key!==""?`[?(@._key=='${e._key.replace(/['\\]/g,r=>Ms[r])}')]`:`[${e._index}]`).join("")}`}function qs(t){const e=[],r=/\['(.*?)'\]|\[(\d+)\]|\[\?\(@\._key=='(.*?)'\)\]/g;let n;for(;(n=r.exec(t))!==null;){if(n[1]!==void 0){const i=n[1].replace(/\\(\\|f|n|r|t|')/g,s=>Ls[s]);e.push(i);continue}if(n[2]!==void 0){e.push(parseInt(n[2],10));continue}if(n[3]!==void 0){const i=n[3].replace(/\\(\\')/g,s=>Ls[s]);e.push({_key:i,_index:-1});continue}}return e}function Lu(t){return t.map(e=>{if(typeof e=="string"||typeof e=="number")return e;if(e._key!=="")return{_key:e._key};if(e._index!==-1)return e._index;throw new Error(`invalid segment:${JSON.stringify(e)}`)})}function Np(t){return t.map(e=>{if(typeof e=="string"||typeof e=="number")return e;if(e._index!==-1)return e._index;throw new Error(`invalid segment:${JSON.stringify(e)}`)})}function Hp(t,e){if(!(e!=null&&e.mappings))return;const r=Vp(Np(t));if(e.mappings[r]!==void 0)return{mapping:e.mappings[r],matchedPath:r,pathSuffix:""};const n=Object.entries(e.mappings).filter(([a])=>r.startsWith(a)).sort(([a],[u])=>u.length-a.length);if(n.length==0)return;const[i,s]=n[0],o=r.substring(i.length);return{mapping:s,matchedPath:i,pathSuffix:o}}function Wp(t){return t!==null&&Array.isArray(t)}function Us(t){return typeof t=="object"&&t!==null}function Jt(t,e,r=[]){if(Wp(t))return t.map((n,i)=>{if(Us(n)){const s=n._key;if(typeof s=="string")return Jt(n,e,r.concat({_key:s,_index:i}))}return Jt(n,e,r.concat(i))});if(Us(t)){if(t._type==="block"||t._type==="span"){const n={...t};return t._type==="block"?n.children=Jt(t.children,e,r.concat("children")):t._type==="span"&&(n.text=Jt(t.text,e,r.concat("text"))),n}return Object.fromEntries(Object.entries(t).map(([n,i])=>[n,Jt(i,e,r.concat(n))]))}return e(t,r)}function qu(t,e,r){return Jt(t,(n,i)=>{if(typeof n!="string")return n;const s=Hp(i,e);if(!s)return n;const{mapping:o,matchedPath:a}=s;if(o.type!=="value"||o.source.type!=="documentValue")return n;const u=e.documents[o.source.document],l=e.paths[o.source.path],d=qs(a),f=qs(l).concat(i.slice(d.length));return r({sourcePath:f,sourceDocument:u,resultPath:i,value:n})})}const Bp="drafts",zp="versions",Ur=".",Uu=`${Bp}${Ur}`,Gp=`${zp}${Ur}`;function Fu(t){return t.startsWith(Uu)}function Zn(t){return t.startsWith(Gp)}function Qp(t){return!Fu(t)&&!Zn(t)}function Jp(t){if(!Zn(t))return;const[e,r,...n]=t.split(Ur);return r}function Xp(t){return Zn(t)?t.split(Ur).slice(2).join(Ur):Fu(t)?t.slice(Uu.length):t}function Yp(t){const{baseUrl:e,workspace:r="default",tool:n="default",id:i,type:s,path:o,projectId:a,dataset:u}=t;if(!e)throw new Error("baseUrl is required");if(!o)throw new Error("path is required");if(!i)throw new Error("id is required");if(e!=="/"&&e.endsWith("/"))throw new Error("baseUrl must not end with a slash");const l=r==="default"?void 0:r,d=n==="default"?void 0:n,f=Xp(i),v=Array.isArray(o)?Mu(Lu(o)):o,y=new URLSearchParams({baseUrl:e,id:f,type:s,path:v});if(l&&y.set("workspace",l),d&&y.set("tool",d),a&&y.set("projectId",a),u&&y.set("dataset",u),Qp(i))y.set("perspective","published");else if(Zn(i)){const g=Jp(i);y.set("perspective",g)}const h=[e==="/"?"":e];l&&h.push(l);const p=["mode=presentation",`id=${f}`,`type=${s}`,`path=${encodeURIComponent(v)}`];return d&&p.push(`tool=${d}`),h.push("intent","edit",`${p.join(";")}?${y}`),h.join("/")}function Kp(t){let e=typeof t=="string"?t:t.baseUrl;return e!=="/"&&(e=e.replace(/\/$/,"")),typeof t=="string"?{baseUrl:e}:{...t,baseUrl:e}}const Fs=({sourcePath:t,resultPath:e,value:r})=>{if(ey(r)||ty(r))return!1;const n=t.at(-1);return!(t.at(-2)==="slug"&&n==="current"||typeof n=="string"&&(n.startsWith("_")||n.endsWith("Id"))||t.some(i=>i==="meta"||i==="metadata"||i==="openGraph"||i==="seo")||Vs(t)||Vs(e)||typeof n=="string"&&Zp.has(n))},Zp=new Set(["color","colour","currency","email","format","gid","hex","href","hsl","hsla","icon","id","index","key","language","layout","link","linkAction","locale","lqip","page","path","ref","rgb","rgba","route","secret","slug","status","tag","template","theme","type","textTheme","unit","url","username","variant","website"]);function ey(t){return/^\d{4}-\d{2}-\d{2}/.test(t)?!!Date.parse(t):!1}function ty(t){try{new URL(t,t.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}function Vs(t){return t.some(e=>typeof e=="string"&&e.match(/type/i)!==null)}const An=20;function Vu(t,e,r){var u,l,d,f,v,y,h,p,g;
31const{filter:n,logger:i,enabled:s}=r;if(!s){const m="config.enabled must be true, don't call this function otherwise";throw(u=i==null?void 0:i.error)==null||u.call(i,`[@sanity/client]: ${m}`,{result:t,resultSourceMap:e,config:r}),new TypeError(m)}if(!e)return(l=i==null?void 0:i.error)==null||l.call(i,"[@sanity/client]: Missing Content Source Map from response body",{result:t,resultSourceMap:e,config:r}),t;if(!r.studioUrl){const m="config.studioUrl must be defined";throw(d=i==null?void 0:i.error)==null||d.call(i,`[@sanity/client]: ${m}`,{result:t,resultSourceMap:e,config:r}),new TypeError(m)}const o={encoded:[],skipped:[]},a=qu(t,e,({sourcePath:m,sourceDocument:x,resultPath:A,value:C})=>{if((typeof n=="function"?n({sourcePath:m,resultPath:A,filterDefault:Fs,sourceDocument:x,value:C}):Fs({sourcePath:m,resultPath:A,value:C}))===!1)return i&&o.skipped.push({path:Ns(m),value:`${C.slice(0,An)}${C.length>An?"...":""}`,length:C.length}),C;i&&o.encoded.push({path:Ns(m),value:`${C.slice(0,An)}${C.length>An?"...":""}`,length:C.length});const{baseUrl:G,workspace:W,tool:Ie}=Kp(typeof r.studioUrl=="function"?r.studioUrl(x):r.studioUrl);if(!G)return C;const{_id:ke,_type:pe,_projectId:Ue,_dataset:ze}=x;return Ef(C,{origin:"sanity.io",href:Yp({baseUrl:G,workspace:W,tool:Ie,id:ke,type:pe,path:m,...!r.omitCrossDatasetReferenceData&&{dataset:ze,projectId:Ue}})},!1)});if(i){const m=o.skipped.length,x=o.encoded.length;if((m||x)&&((f=(i==null?void 0:i.groupCollapsed)||i.log)==null||f("[@sanity/client]: Encoding source map into result"),(v=i.log)==null||v.call(i,`[@sanity/client]: Paths encoded: ${o.encoded.length}, skipped: ${o.skipped.length}`)),o.encoded.length>0&&((y=i==null?void 0:i.log)==null||y.call(i,"[@sanity/client]: Table of encoded paths"),(h=(i==null?void 0:i.table)||i.log)==null||h(o.encoded)),o.skipped.length>0){const A=new Set;for(const{path:C}of o.skipped)A.add(C.replace(Du,"0").replace(/\[\d+\]/g,"[]"));(p=i==null?void 0:i.log)==null||p.call(i,"[@sanity/client]: List of skipped paths",[...A.values()])}(m||x)&&((g=i==null?void 0:i.groupEnd)==null||g.call(i))}return a}function Ns(t){return Mu(Lu(t))}var ry=Object.freeze({__proto__:null,stegaEncodeSourceMap:Vu});const ny=Object.freeze(Object.defineProperty({__proto__:null,encodeIntoResult:qu,stegaEncodeSourceMap:Vu,stegaEncodeSourceMap$1:ry},Symbol.toStringTag,{value:"Module"}));var Ei={exports:{}};/** @license
32 * eventsource.js
33 * Available under MIT License (MIT)
34 * https://github.com/Yaffle/EventSource/
35 */(function(t,e){(function(r){var n=r.setTimeout,i=r.clearTimeout,s=r.XMLHttpRequest,o=r.XDomainRequest,a=r.ActiveXObject,u=r.EventSource,l=r.document,d=r.Promise,f=r.fetch,v=r.Response,y=r.TextDecoder,h=r.TextEncoder,p=r.AbortController;if(typeof window<"u"&&typeof l<"u"&&!("readyState"in l)&&l.body==null&&(l.readyState="loading",window.addEventListener("load",function(b){l.readyState="complete"},!1)),s==null&&a!=null&&(s=function(){return new a("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(b){function T(){}return T.prototype=b,new T}),Date.now||(Date.now=function(){return new Date().getTime()}),p==null){var g=f;f=function(b,T){var k=T.signal;return g(b,{headers:T.headers,credentials:T.credentials,cache:T.cache}).then(function(_){var L=_.body.getReader();return k._reader=L,k._aborted&&k._reader.cancel(),{status:_.status,statusText:_.statusText,headers:_.headers,body:{getReader:function(){return L}}}})},p=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function m(){this.bitsNeeded=0,this.codePoint=0}m.prototype.decode=function(b){function T(Y,ee,q){if(q===1)return Y>=128>>ee&&Y<<ee<=2047;if(q===2)return Y>=2048>>ee&&Y<<ee<=55295||Y>=57344>>ee&&Y<<ee<=65535;if(q===3)return Y>=65536>>ee&&Y<<ee<=1114111;throw new Error}function k(Y,ee){if(Y===6*1)return ee>>6>15?3:ee>31?2:1;if(Y===6*2)return ee>15?3:2;if(Y===6*3)return 3;throw new Error}for(var _=65533,L="",D=this.bitsNeeded,F=this.codePoint,te=0;te<b.length;te+=1){var B=b[te];D!==0&&(B<128||B>191||!T(F<<6|B&63,D-6,k(D,F)))&&(D=0,F=_,L+=String.fromCharCode(F)),D===0?(B>=0&&B<=127?(D=0,F=B):B>=192&&B<=223?(D=6*1,F=B&31):B>=224&&B<=239?(D=6*2,F=B&15):B>=240&&B<=247?(D=6*3,F=B&7):(D=0,F=_),D!==0&&!T(F,D,k(D,F))&&(D=0,F=_)):(D-=6,F=F<<6|B&63),D===0&&(F<=6
355535?L+=String.fromCharCode(F):(L+=String.fromCharCode(55296+(F-65535-1>>10)),L+=String.fromCharCode(56320+(F-65535-1&1023))))}return this.bitsNeeded=D,this.codePoint=F,L};var x=function(){try{return new y().decode(new h().encode("test"),{stream:!0})==="test"}catch(b){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+b)}return!1};(y==null||h==null||!x())&&(y=m);var A=function(){};function C(b){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=A,this.onload=A,this.onerror=A,this.onreadystatechange=A,this._contentType="",this._xhr=b,this._sendTimeout=0,this._abort=A}C.prototype.open=function(b,T){this._abort(!0);var k=this,_=this._xhr,L=1,D=0;this._abort=function(q){k._sendTimeout!==0&&(i(k._sendTimeout),k._sendTimeout=0),(L===1||L===2||L===3)&&(L=4,_.onload=A,_.onerror=A,_.onabort=A,_.onprogress=A,_.onreadystatechange=A,_.abort(),D!==0&&(i(D),D=0),q||(k.readyState=4,k.onabort(null),k.onreadystatechange())),L=0};var F=function(){if(L===1){var q=0,re="",tt=void 0;if("contentType"in _)q=200,re="OK",tt=_.contentType;else try{q=_.status,re=_.statusText,tt=_.getResponseHeader("Content-Type")}catch{q=0,re="",tt=void 0}q!==0&&(L=2,k.readyState=2,k.status=q,k.statusText=re,k._contentType=tt,k.onreadystatechange())}},te=function(){if(F(),L===2||L===3){L=3;var q="";try{q=_.responseText}catch{}k.readyState=3,k.responseText=q,k.onprogress()}},B=function(q,re){if((re==null||re.preventDefault==null)&&(re={preventDefault:A}),te(),L===1||L===2||L===3){if(L=4,D!==0&&(i(D),D=0),k.readyState=4,q==="load")k.onload(re);else if(q==="error")k.onerror(re);else if(q==="abort")k.onabort(re);else throw new TypeError;k.onreadystatechange()}},Y=function(q){_!=null&&(_.readyState===4?(!("onload"in _)||!("onerror"in _)||!("onabort"in _))&&B(_.responseText===""?"error":"load",q):_.readyState===3?"onprogress"in _||te():_.readyState===2&&F())},ee=function(){D=n(function(){ee()},500),_.readyState===3&&te()};"onload"in _&&(_.onload=function(q){B("load",q)}),"onerror"in _&&(_.onerror=function(q){B("error",q)}),"onabort"in _&&(_.onabort=function(q){B("abort",q)}),"onprogress"in _&&(_.onprogress=te),"onreadystatechange"in _&&(_.onreadystatechange=function(q){Y(q)}),("contentType"in _||!("ontimeout"in s.prototype))&&(T+=(T.indexOf("?")===-1?"?":"&")+"padding=true"),_.open(b,T,!0),"readyState"in _&&(D=n(function(){ee()},0))},C.prototype.abort=function(){this._abort(!1)},C.prototype.getResponseHeader=function(b){return this._contentType},C.prototype.setRequestHeader=function(b,T){var k=this._xhr;"setRequestHeader"in k&&k.setRequestHeader(b,T)},C.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},C.prototype.send=function(){if((!("ontimeout"in s.prototype)||!("sendAsBinary"in s.prototype)&&!("mozAnon"in s.prototype))&&l!=null&&l.readyState!=null&&l.readyState!=="complete"){var b=this;b._sendTimeout=n(function(){b._sendTimeout=0,b.send()},4);return}var T=this._xhr;"withCredentials"in T&&(T.withCredentials=this.withCredentials);try{T.send(void 0)}catch(k){throw k}};function G(b){return b.replace(/[A-Z]/g,function(T){return String.fromCharCode(T.charCodeAt(0)+32)})}function W(b){for(var T=Object.create(null),k=b.split(`\r
36`),_=0;_<k.length;_+=1){var L=k[_],D=L.split(": "),F=D.shift(),te=D.join(": ");T[G(F)]=te}this._map=T}W.prototype.get=function(b){return this._map[G(b)]},s!=null&&s.HEADERS_RECEIVED==null&&(s.HEADERS_RECEIVED=2);function Ie(){}Ie.prototype.open=function(b,T,k,_,L,D,F){b.open("GET",L);var te=0;b.onprogress=function(){var Y=b.responseText,ee=Y.slice(te);te+=ee.length,k(ee)},b.onerror=function(Y){Y.preventDefault(),_(new Error("NetworkError"))},b.onload=function(){_(null)},b.onabort=function(){_(null)},b.onreadystatechange=function(){if(b.readyState===s.HEADERS_RECEIVED){var Y=b.status,ee=b.statusText,q=b.getResponseHeader("Content-Type"),re=b.getAllResponseHeaders();T(Y,ee,q,new W(re))}},b.withCredentials=D;for(var B in F)Object.prototype.hasOwnProperty.call(F,B)&&b.setRequestHeader(B,F[B]);return b.send(),b};function ke(b){this._headers=b}ke.prototype.get=function(b){return this._headers.get(b)};function pe(){}pe.prototype.open=function(b,T,k,_,L,D,F){var te=null,B=new p,Y=B.signal,ee=new y;return f(L,{headers:F,credentials:D?"include":"same-origin",signal:Y,cache:"no-store"}).then(function(q){return te=q.body.getReader(),T(q.status,q.statusText,q.headers.get("Content-Type"),new ke(q.headers)),new d(function(re,tt){var Sr=function(){te.read().then(function(je){if(je.done)re(void 0);else{var we=ee.decode(je.value,{stream:!0});k(we),Sr()}}).catch(function(je){tt(je)})};Sr()})}).catch(function(q){if(q.name!=="AbortError")return q}).then(function(q){_(q)}),{abort:function(){te!=null&&te.cancel(),B.abort()}}};function Ue(){this._listeners=Object.create(null)}function ze(b){n(function(){throw b},0)}Ue.prototype.dispatchEvent=function(b){b.target=this;var T=this._listeners[b.type];if(T!=null)for(var k=T.length,_=0;_<k;_+=1){var L=T[_];try{typeof L.handleEvent=="function"?L.handleEvent(b):L.call(this,b)}catch(D){ze(D)}}},Ue.prototype.addEventListener=function(b,T){b=String(b);var k=this._listeners,_=k[b];_==null&&(_=[],k[b]=_);for(var L=!1,D=0;D<_.length;D+=1)_[D]===T&&(L=!0);L||_.push(T)},Ue.prototype.removeEventListener=function(b,T){b=String(b);var k=this._listeners,_=k[b];if(_!=null){for(var L=[],D=0;D<_.length;D+=1)_[D]!==T&&L.push(_[D]);L.length===0?delete k[b]:k[b]=L}};function w(b){this.type=b,this.target=void 0}function $(b,T){w.call(this,b),this.data=T.data,this.lastEventId=T.lastEventId}$.prototype=Object.create(w.prototype);function I(b,T){w.call(this,b),this.status=T.status,this.statusText=T.statusText,this.headers=T.headers}I.prototype=Object.create(w.prototype);function E(b,T){w.call(this,b),this.error=T.error}E.prototype=Object.create(w.prototype);var J=-1,P=0,H=1,se=2,ge=-1,ie=0,fe=1,Ze=2,et=3,Re=/^text\/event\-stream(;.*)?$/i,Ot=1e3,Fe=18e6,Ir=function(b,T){var k=b==null?T:parseInt(b,10);return k!==k&&(k=T),xr(k)},xr=function(b){return Math.min(Math.max(b,Ot),Fe)},De=function(b,T,k){try{typeof T=="function"&&T.call(b,k)}catch(_){ze(_)}};function Ve(b,T){Ue.call(this),T=T||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,Zu(this,b,T)}function Yu(){return s!=null&&"withCredentials"in s.prototype||o==null?new s:new o}var Ku=f!=null&&v!=null&&"body"in v.prototype;function Zu(b,T,k){T=String(T);var _=!!k.withCredentials,L=k.lastEventIdQueryParameterName||"lastEventId",D=xr(1e3),F=Ir(k.heartbeatTimeout,45e3),te="",B=D,Y=!1,ee=0,q=k.headers||{}
36,re=k.Transport,tt=Ku&&re==null?void 0:new C(re!=null?new re:Yu()),Sr=re!=null&&typeof re!="string"?new re:tt==null?new pe:new Ie,je=void 0,we=0,Ne=J,Gt="",In="",rt="",xn="",be=ie,ti=0,Pt=0,ec=function(de,ce,Te,Oe){if(Ne===P)if(de===200&&Te!=null&&Re.test(Te)){Ne=H,Y=Date.now(),B=D,b.readyState=H;var Ee=new I("open",{status:de,statusText:ce,headers:Oe});b.dispatchEvent(Ee),De(b,b.onopen,Ee)}else{var he="";de!==200?(ce&&(ce=ce.replace(/\s+/g," ")),he="EventSource's response has a status "+de+" "+ce+" that is not 200. Aborting the connection."):he="EventSource's response has a Content-Type specifying an unsupported type: "+(Te==null?"-":Te.replace(/\s+/g," "))+". Aborting the connection.",ri();var Ee=new I("error",{status:de,statusText:ce,headers:Oe});b.dispatchEvent(Ee),De(b,b.onerror,Ee),console.error(he)}},tc=function(de){if(Ne===H){for(var ce=-1,Te=0;Te<de.length;Te+=1){var Oe=de.charCodeAt(Te);(Oe===10||Oe===13)&&(ce=Te)}var Ee=(ce!==-1?xn:"")+de.slice(0,ce+1);xn=(ce===-1?xn:"")+de.slice(ce+1),de!==""&&(Y=Date.now(),ee+=de.length);for(var he=0;he<Ee.length;he+=1){var Oe=Ee.charCodeAt(he);if(be===ge&&Oe===10)be=ie;else if(be===ge&&(be=ie),Oe===13||Oe===10){if(be!==ie){be===fe&&(Pt=he+1);var nt=Ee.slice(ti,Pt-1),it=Ee.slice(Pt+(Pt<he&&Ee.charCodeAt(Pt)===32?1:0),he);nt==="data"?(Gt+=`
37`,Gt+=it):nt==="id"?In=it:nt==="event"?rt=it:nt==="retry"?(D=Ir(it,D),B=D):nt==="heartbeatTimeout"&&(F=Ir(it,F),we!==0&&(i(we),we=n(function(){Cr()},F)))}if(be===ie){if(Gt!==""){te=In,rt===""&&(rt="message");var Qt=new $(rt,{data:Gt.slice(1),lastEventId:In});if(b.dispatchEvent(Qt),rt==="open"?De(b,b.onopen,Qt):rt==="message"?De(b,b.onmessage,Qt):rt==="error"&&De(b,b.onerror,Qt),Ne===se)return}Gt="",rt=""}be=Oe===13?ge:ie}else be===ie&&(ti=he,be=fe),be===fe?Oe===58&&(Pt=he+1,be=Ze):be===Ze&&(be=et)}}},Vi=function(de){if(Ne===H||Ne===P){Ne=J,we!==0&&(i(we),we=0),we=n(function(){Cr()},B),B=xr(Math.min(D*16,B*2)),b.readyState=P;var ce=new E("error",{error:de});b.dispatchEvent(ce),De(b,b.onerror,ce),de!=null&&console.error(de)}},ri=function(){Ne=se,je!=null&&(je.abort(),je=void 0),we!==0&&(i(we),we=0),b.readyState=se},Cr=function(){if(we=0,Ne!==J){if(!Y&&je!=null)Vi(new Error("No activity within "+F+" milliseconds. "+(Ne===P?"No response received.":ee+" chars received.")+" Reconnecting.")),je!=null&&(je.abort(),je=void 0);else{var de=Math.max((Y||Date.now())+F-Date.now(),1);Y=!1,we=n(function(){Cr()},de)}return}Y=!1,ee=0,we=n(function(){Cr()},F),Ne=P,Gt="",rt="",In=te,xn="",ti=0,Pt=0,be=ie;var ce=T;if(T.slice(0,5)!=="data:"&&T.slice(0,5)!=="blob:"&&te!==""){var Te=T.indexOf("?");ce=Te===-1?T:T.slice(0,Te+1)+T.slice(Te+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(it,Qt){return Qt===L?"":it}),ce+=(T.indexOf("?")===-1?"?":"&")+L+"="+encodeURIComponent(te)}var Oe=b.withCredentials,Ee={};Ee.Accept="text/event-stream";var he=b.headers;if(he!=null)for(var nt in he)Object.prototype.hasOwnProperty.call(he,nt)&&(Ee[nt]=he[nt]);try{je=Sr.open(tt,ec,tc,Vi,ce,Oe,Ee)}catch(it){throw ri(),it}};b.url=T,b.readyState=P,b.withCredentials=_,b.headers=q,b._close=ri,Cr()}Ve.prototype=Object.create(Ue.prototype),Ve.prototype.CONNECTING=P,Ve.prototype.OPEN=H,Ve.prototype.CLOSED=se,Ve.prototype.close=function(){this._close()},Ve.CONNECTING=P,Ve.OPEN=H,Ve.CLOSED=se,Ve.prototype.withCredentials=void 0;var Fi=u;s!=null&&(u==null||!("withCredentials"in u.prototype))&&(Fi=Ve),function(b){{var T=b(e);T!==void 0&&(t.exports=T)}}(function(b){b.EventSourcePolyfill=Ve,b.NativeEventSource=u,b.EventSource=Fi})})(typeof globalThis>"u"?typeof window<"u"?window:typeof self<"u"?self:ao:globalThis)})(Ei,Ei.exports);var iy=Ei.exports,Nu=iy.EventSourcePolyfill;const sy=oo(Nu),Hu=ac({__proto__:null,default:sy},[Nu]),Wu=/_key\s*==\s*['"](.*)['"]/;function oy(t){return typeof t=="string"?Wu.test(t.trim()):typeof t=="object"&&"_key"in t}function Bu(t){if(!Array.isArray(t))throw new Error("Path is not an array");return t.reduce((e,r,n)=>{const i=typeof r;if(i==="number")return`${e}[${r}]`;if(i==="string")return`${e}${n===0?"":"."}${r}`;if(oy(r)&&r._key)return`${e}[_key=="${r._key}"]`;if(Array.isArray(r)){const[s,o]=r;return`${e}[${s}:${o}]`}throw new Error(`Unsupported path segment \`${JSON.stringify(r)}\``)},"")}const Vn={"\f":"\\f","\n":"\\n","\r":"\\r","	":"\\t","'":"\\'","\\":"\\\\"},Hs={"\\f":"\f","\\n":`
38`,"\\r":"\r","\\t":"	","\\'":"'","\\\\":"\\"};function ay(t){return`$${t.map(e=>typeof e=="string"?`['${e.replace(/[\f\n\r\t'\\]/g,r=>Vn[r])}']`:typeof e=="number"?`[${e}]`:e._key!==""?`[?(@._key=='${e._key.replace(/['\\]/g,r=>Vn[r])}')]`:`[${e._index}]`).join("")}`}function uy(t){return t.map(e=>typeof e=="string"?`['${e.replace(/[\f\n\r\t'\\]/g,r=>Vn[r])}']`:typeof e=="number"?`[${e}]`:e._key!==""?`[?(@._key=='${e._key.replace(/['\\]/g,r=>Vn[r])}')]`:`[${e._index}]`)}function Ws(t){const e=[],r=/\['(.*?)'\]|\[(\d+)\]|\[\?\(@\._key=='(.*?)'\)\]/g;let n;for(;(n=r.exec(t))!==null;){if(n[1]!==void 0){const i=n[1].replace(/\\(\\|f|n|r|t|')/g,s=>Hs[s]);e.push(i);continue}if(n[2]!==void 0){e.push(parseInt(n[2],10));continue}if(n[3]!==void 0){const i=n[3].replace(/\\(\\')/g,s=>Hs[s]);e.push({_key:i,_index:-1});continue}}return e}function zu(t){return t.map(e=>{if(typeof e=="string"||typeof e=="number")return e;if(e._key!=="")return{_key:e._key};if(e._index!==-1)return e._index;throw new Error(`invalid segment:${JSON.stringify(e)}`)})}function Bs(t){return t.map(e=>{if(typeof e=="string"||typeof e=="number")return e;if(e._index!==-1)return e._index;throw new Error(`invalid segment:${JSON.stringify(e)}`)})}function cy(t,e){if(!(e!=null&&e.mappings))return;const r=ay(Bs(t));if(e.mappings[r]!==void 0)return{mapping:e.mappings[r],matchedPath:r,pathSuffix:""};const n=uy(Bs(t));for(let i=n.length-1;i>=0;i--){const s=`$${n.slice(0,i).join("")}`,o=e.mappings[s];if(o){const a=r.substring(s.length);return{mapping:o,matchedPath:s,pathSuffix:a}}}}function ly(t){return t!==null&&Array.isArray(t)}function Xt(t,e,r=[]){if(ly(t))return t.map((n,i)=>{if(Pn(n)){const s=n._key;if(typeof s=="string")return Xt(n,e,r.concat({_key:s,_index:i}))}return Xt(n,e,r.concat(i))});if(Pn(t)){if(t._type==="block"||t._type==="span"){const n={...t};return t._type==="block"?n.children=Xt(t.children,e,r.concat("children")):t._type==="span"&&(n.text=Xt(t.text,e,r.concat("text"))),n}return Object.fromEntries(Object.entries(t).map(([n,i])=>[n,Xt(i,e,r.concat(n))]))}return e(t,r)}function Gu(t,e,r){return Xt(t,(n,i)=>
38{if(typeof n!="string")return n;const s=cy(i,e);if(!s)return n;const{mapping:o,matchedPath:a}=s;if(o.type!=="value"||o.source.type!=="documentValue")return n;const u=e.documents[o.source.document],l=e.paths[o.source.path],d=Ws(a),f=Ws(l).concat(i.slice(d.length));return r({sourcePath:f,sourceDocument:u,resultPath:i,value:n})})}const fy="drafts",dy="versions",Fr=".",Qu=`${fy}${Fr}`,hy=`${dy}${Fr}`;function Ju(t){return t.startsWith(Qu)}function ei(t){return t.startsWith(hy)}function py(t){return!Ju(t)&&!ei(t)}function yy(t){if(!ei(t))return;const[e,r]=t.split(Fr);return r}function vy(t){return ei(t)?t.split(Fr).slice(2).join(Fr):Ju(t)?t.slice(Qu.length):t}function my(t){const{baseUrl:e,workspace:r="default",tool:n="default",id:i,type:s,path:o,projectId:a,dataset:u}=t;if(!e)throw new Error("baseUrl is required");if(!o)throw new Error("path is required");if(!i)throw new Error("id is required");if(e!=="/"&&e.endsWith("/"))throw new Error("baseUrl must not end with a slash");const l=r==="default"?void 0:r,d=n==="default"?void 0:n,f=vy(i),v=Array.isArray(o)?Bu(zu(o)):o,y=new URLSearchParams({baseUrl:e,id:f,type:s,path:v});if(l&&y.set("workspace",l),d&&y.set("tool",d),a&&y.set("projectId",a),u&&y.set("dataset",u),py(i))y.set("perspective","published");else if(ei(i)){const g=yy(i);y.set("perspective",g)}const h=[e==="/"?"":e];l&&h.push(l);const p=["mode=presentation",`id=${f}`,`type=${s}`,`path=${encodeURIComponent(v)}`];return d&&p.push(`tool=${d}`),h.push("intent","edit",`${p.join(";")}?${y}`),h.join("/")}function gy(t){let e=typeof t=="string"?t:t.baseUrl;return e!=="/"&&(e=e.replace(/\/$/,"")),typeof t=="string"?{baseUrl:e}:{...t,baseUrl:e}}const zs=({sourcePath:t,resultPath:e,value:r})=>{if(by(r)||$y(r))return!1;const n=t.at(-1);return!(t.at(-2)==="slug"&&n==="current"||typeof n=="string"&&(n.startsWith("_")||n.endsWith("Id"))||t.some(i=>i==="meta"||i==="metadata"||i==="openGraph"||i==="seo")||Gs(t)||Gs(e)||typeof n=="string"&&wy.has(n))},wy=new Set(["color","colour","currency","email","format","gid","hex","href","hsl","hsla","icon","id","index","key","language","layout","link","linkAction","locale","lqip","page","path","ref","rgb","rgba","route","secret","slug","status","tag","template","theme","type","textTheme","unit","url","username","variant","website"]);function by(t){return/^\d{4}-\d{2}-\d{2}/.test(t)?!!Date.parse(t):!1}const Ey=new Set(["app:","data:","discord:","file:","ftp:","ftps:","geo:","http:","https:","imap:","javascript:","magnet:","mailto:","maps:","ms-excel:","ms-powerpoint:","ms-word:","slack:","sms:","spotify:","steam:","teams:","tel:","vscode:","zoom:"]);function $y(t){try{const{protocol:e}=new URL(t,t.startsWith("/")?"https://acme.com":void 0);return Ey.has(e)||e.startsWith("web+")}catch{return!1}}function Gs(t){return t.some(e=>typeof e=="string"&&e.match(/type/i)!==null)}const _n=20;function Xu(t,e,r){var u,l,d,f,v,y,h,p,g;const{filter:n,logger:i,enabled:s}=r;if(!s){const m="config.enabled must be true, don't call this function otherwise";throw(u=i==null?void 0:i.error)==null||u.call(i,`[@sanity/client]: ${m}`,{result:t,resultSourceMap:e,config:r}),new TypeError(m)}if(!e)return(l=i==null?void 0:i.error)==null||l.call(i,"[@sanity/client]: Missing Content Source Map from response body",{result:t,resultSourceMap:e,config:r}),t;if(!r.studioUrl){const m="config.studioUrl must be defined";throw(d=i==null?void 0:i.error)==null||d.call(i,`[@sanity/client]: ${m}`,{result:t,resultSourceMap:e,config:r}),new TypeError(m)}const o={encoded:[],skipped:[]},a=Gu(t,e,({sourcePath:m,sourceDocument:x,resultPath:A,value:C})=>{if((typeof n=="function"?n({sourcePath:m,resultPath:A,filterDefault:zs,sourceDocument:x,value:C}):zs({sourcePath:m,resultPath:A,value:C}))===!1)return i&&o.skipped.push({path:Qs(m),value:`${C.slice(0,_n)}${C.length>_n?"...":""}`,length:C.length}),C;i&&o.encoded.push({path:Qs(m),value:`${C.slice(0,_n)}${C.length>_n?"...":""}`,length:C.length});const{baseUrl:G,workspace:W,tool:Ie}=gy(typeof r.studioUrl=="function"?r.studioUrl(x):r.studioUrl);if(!G)return C;const{_id:ke,_type:pe,_projectId:Ue,_dataset:ze}=x;return Jd(C,{origin:"sanity.io",href:my({baseUrl:G,workspace:W,tool:Ie,id:ke,type:pe,path:m,...!r.omitCrossDatasetReferenceData&&{dataset:ze,projectId:Ue}})},!1)});if(i){const m=o.skipped.length,x=o.encoded.length;if((m||x)&&((f=(i==null?void 0:i.groupCollapsed)||i.log)==null||f("[@sanity/client]: Encoding source map into result"),(v=i.log)==null||v.call(i,`[@sanity/client]: Paths encoded: ${o.encoded.length}, skipped: ${o.skipped.length}`)),o.encoded.length>0&&((y=i==null?void 0:i.log)==null||y.call(i,"[@sanity/client]: Table of encoded paths"),(h=(i==null?void 0:i.table)||i.log)==null||h(o.encoded)),o.skipped.length>0){const A=new Set;for(const{path:C}of o.skipped)A.add(C.replace(Wu,"0").replace(/\[\d+\]/g,"[]"));(p=i==null?void 0:i.log)==null||p.call(i,"[@sanity/client]: List of skipped paths",[...A.values()])}(m||x)&&((g=i==null?void 0:i.groupEnd)==null||g.call(i))}return a}function Qs(t){return Bu(zu(t))}var Iy=Object.freeze({__proto__:null,stegaEncodeSourceMap:Xu});const xy=Object.freeze(Object.defineProperty({__proto__:null,encodeIntoResult:Gu,stegaEncodeSourceMap:Xu,stegaEncodeSourceMap$1:Iy},Symbol.toStringTag,{value:"Module"}));
38export{nv as $,me as A,Ty as B,qh as C,Gn as D,Er as E,tv as F,ai as G,Ry as H,jt as I,ms as J,Yn as K,rv as L,Dy as M,Ly as N,N as O,_y as P,qv as Q,Po as R,uh as S,My as T,Jo as U,$i as V,uo as W,co as X,lo as Y,fo as Z,Hn as _,ah as a,R as a0,X as a1,lf as a2,na as a3,ta as a4,ve as a5,iv as a6,Uv as a7,vc as a8,Ke as a9,Py as aA,Tt as aB,Wy as aC,Ay as aD,Fy as aE,mv as aF,sv as aa,qy as ab,dl as ac,ov as ad,Uy as ae,oa as af,yl as ag,av as ah,uv as ai,cv as aj,ql as ak,_i as al,da as am,lv as an,ho as ao,fv as ap,dv as aq,gi as ar,hv as as,la as at,pv as au,yv as av,ha as aw,vf as ax,vv as ay,pn as az,br as b,Oy as c,_t as d,Vy as e,Ny as f,Hy as g,yc as h,mn as i,ky as j,qr as k,By as l,zy as m,cf as n,Gy as o,Fv as p,Lv as q,ih as r,Qy as s,Jy as t,vn as u,Xy as v,Yy as w,Ky as x,Zy as y,ev as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.