PageSourceSearch

https://www.chebahut.com/_next/static/immutable/chunks/1wi-sylqd1h5t.js

js chebahut.com collected 2026-10-01 11:49:30 UTC 81,349 bytes, 8 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,479278,355751,e=>{"use strict";function t(e){return"https://www.sanity.io/help/"+e}let r=["image","file"],i=["before","after","replace"],n=e=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(e))throw Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},s=(e,t)=>{if("string"!=typeof t||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(t)||t.includes(".."))throw Error(`${e}(): "${t}" is not a valid document ID`)},o=e=>{if("string"!=typeof e||!/^[a-z0-9._-]{1,75}$/i.test(e))throw Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return e},a=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:i}=t;switch(r){case"dataset":if(2!==i.split(".").length)throw Error('Dataset resource ID must be in the format "project.dataset"');return;case"dashboard":case"knowledge-base":case"media-library":case"canvas":return;default:throw Error(`Unsupported resource type: ${r.toString()}`)}},u=e=>{var t;let r,i;return t=function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return console.warn(e.join(" "),...r)},r=!1,function(){for(var e=arguments.length,n=Array(e),s=0;s<e;s++)n[s]=arguments[s];return r||(i=t(...n),r=!0),i}},c=u(["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"]),l=u(["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."]),h=u(["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."]),d=u(["The `previewDrafts` perspective has been renamed to  `drafts` and will be removed in a future API version"]),f=u(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${t("js-client-browser-token")} for more information and how to hide this warning.`]),p=u(["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`."]),g=u(["Using the Sanity client without specifying an API version is deprecated.",`See ${t("js-client-api-version")}`]),m=u(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]),v=u(["You have called `createVersion()` with a defined `document`.","If you are creating a version of a document that already exists, prefer providing `baseId` and `releaseId` instead."]),y=u(["The `uri` request option has been renamed to `url`.","Please update your code to use `url` instead. Support for `uri` will be removed in a future version."]),b=u(["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."]),w={apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}},E=["localhost","127.0.0.1","0.0.0.0"];function I(e){if(Array.isArray(e)&&e.length>1&&e.includes("raw"))throw TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}e.s(["_",0,s,"a",0,v,"b",0,(e,t)=>{if(t._id&&t._id!==e)throw Error(`The provided document ID (\`${t._id}\`) does not match the generated version ID (\`${e}\`)`)},"c",0,d,"d",0,o,"f",0,(e,t)=>{if(!t._id)throw Error(`${e}() requires that the document contains an ID ("_id" property)`);s(e,t._id)},"g",0,e=>{if(-1===r.indexOf(e))throw Error(`Invalid asset type: ${e}. Must be one of ${r.join(", ")}`)},"h",0,(e,t)=>{if(t.resource)throw Error(`\`${e}\` does not support resource-based operations`)},"i",0,h,"l",0,n,"m",0,a,"n",0,(e,r)=>{let i,s={...r,...e,stega:{..."boolean"==typeof r.stega?{enabled:r.stega}:r.stega||w.stega,..."boolean"==typeof e.stega?{enabled:e.stega}:e.stega||{}}};s.apiVersion||g();
1let u={...w,...s,apiHost:s.apiHost??w.apiHost};u["~experimental_resource"]&&!u.resource&&(b(),u.resource=u["~experimental_resource"]);let h=u.resource,d=u.useProjectHostname&&!h;if(typeof Promise>"u"){let e=t("js-client-promise-polyfill");throw Error(`No native Promise-implementation found, polyfill needed - see ${e}`)}if(d&&!u.projectId)throw Error("Configuration must contain `projectId`");if(h&&a(u),void 0!==u.perspective&&I(u.perspective),"encodeSourceMap"in u)throw 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 u)throw 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("boolean"!=typeof u.stega.enabled)throw Error(`stega.enabled must be a boolean, received ${u.stega.enabled}`);if(u.stega.enabled&&void 0===u.stega.studioUrl)throw Error("stega.studioUrl must be defined when stega.enabled is true");if(u.stega.enabled&&"string"!=typeof u.stega.studioUrl&&"function"!=typeof u.stega.studioUrl)throw Error(`stega.studioUrl must be a string or a function, received ${u.stega.studioUrl}`);let m="u">typeof window&&window.location&&window.location.hostname,v=m&&(i=window.location.hostname,-1!==E.indexOf(i)),y=!!u.token;u.withCredentials&&y&&(p(),u.withCredentials=!1),m&&v&&y&&!0!==u.ignoreBrowserTokenWarning?f():void 0===u.useCdn&&l(),d&&(e=>{if(!/^[-a-z0-9]+$/i.test(e))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")})(u.projectId),u.dataset&&n(u.dataset),"requestTagPrefix"in u&&(u.requestTagPrefix=u.requestTagPrefix?o(u.requestTagPrefix).replace(/\.+$/,""):void 0),u.apiVersion=`${u.apiVersion}`.replace(/^v/,""),u.isDefaultApi=u.apiHost===w.apiHost,!0===u.useCdn&&u.withCredentials&&c(),u.useCdn=!1!==u.useCdn&&!u.withCredentials,function(e){if("1"===e||"X"===e)return;let t=new Date(e);if(!(/^\d{4}-\d{2}-\d{2}$/.test(e)&&t instanceof Date&&t.getTime()>0))throw Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}(u.apiVersion);let $=u.apiHost.split("://",2),C=$[0],T=$[1],S=u.isDefaultApi?"apicdn.sanity.io":T;return d?(u.url=`${C}://${u.projectId}.${T}/v${u.apiVersion}`,u.cdnUrl=`${C}://${u.projectId}.${S}/v${u.apiVersion}`):(u.url=`${u.apiHost}/v${u.apiVersion}`,u.cdnUrl=u.url),u},"o",0,y,"p",0,(e,t)=>{if(!t._type)throw Error(`\`${e}()\` requires that the document contains a type (\`_type\` property)`);var r=t._type;if("string"!=typeof r)throw Error(`\`${e}()\`: \`${r}\` is not a valid document type`)},"r",0,I,"s",0,m,"t",0,w,"u",0,e=>{if(e.dataset)return e.dataset;let t=e.resource;if(t&&"dataset"===t.type){let e=t.id.split(".");if(2!==e.length)throw Error('Dataset resource ID must be in the format "project.dataset"');return e[1]}throw Error("`dataset` must be provided to perform queries")},"v",0,(e,t,r)=>{let n="insert(at, selector, items)";if(-1===i.indexOf(e)){let e=i.map(e=>`"${e}"`).join(", ");throw Error(`${n} takes an "at"-argument which is one of: ${e}`)}if("string"!=typeof t)throw Error(`${n} takes a "selector"-argument which must be a string`);if(!Array.isArray(r))throw Error(`${n} takes an "items"-argument which must be an array`)},"y",0,(e,t)=>{if("object"!=typeof t||!t||Array.isArray(t))throw Error(`${e}() takes an object of properties`)}],479278);var $=e.i(20935);e.s(["isTimeoutError",()=>$.n],355751)},935492,e=>{"use strict";e.i(988131);var t,r=e.i(719476),i=e.i(173502),n=e.i(479278),s=e.i(282123);e.i(355751);var o=e.i(137727),a=e.i(516165),u=e.i(986838),c=e.i(381095),l=e.i(159862),h=e.i(819600),d=e.i(987417),f=e.i(689431),p=e.i(913186),g=e.i(178480),m=e.i(806298),v=e.i(897275),y=e.i(134671),b=e.i(812802),w=e.i(969031),E=e.i(946704),I=e.i(567468),$=e.i(134921),C=e.i(694547),T=e.i(717913),S=e.i(706453),A=e.i(474699),x=e.i(80205),O=e.i(544287);class k extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function P(e,t,r){return 100===r&&97===e.charCodeAt(t+1)&&116===e.charCodeAt(t+2)&&97===e.charCodeAt(t+3)&&58===e.charCodeAt(t+4)}function j(e,t,r){return 101===r&&118===e.charCodeAt(t+1)&&101===e.charCodeAt(t+2)&&110===e.charCodeAt(t+3)&&116===e.charCodeAt(t+4)&&58===e.charCodeAt(t+5)}function D(e,t){let r=1;for(;r<e.length&&r<t.length;){if(e.charCodeAt(r)!==t.charCodeAt(r))return!1;r++}return e.length<=t.length||58===e.charCodeAt(t.length)}
1class M extends Event{code;message;constructor(e,t){super(e),this.code=t?.code??void 0,this.message=t?.message??void 0}[Symbol.for("nodejs.util.inspect.custom")](e,t,r){return r(R(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(R(this),t)}}function R(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}class q extends EventTarget{static CONNECTING=0;static OPEN=1;static CLOSED=2;CONNECTING=0;OPEN=1;CLOSED=2;get readyState(){return this.#e}get url(){return this.#t.href}get withCredentials(){return this.#r}get onerror(){return this.#i}set onerror(e){this.#i&&this.removeEventListener("error",this.#i),this.#i=e,e&&this.addEventListener("error",e)}get onmessage(){return this.#n}set onmessage(e){this.#n&&this.removeEventListener("message",this.#n),this.#n=e,e&&this.addEventListener("message",e)}get onopen(){return this.#s}set onopen(e){this.#s&&this.removeEventListener("open",this.#s),this.#s=e,e&&this.addEventListener("open",e)}addEventListener(e,t,r){super.addEventListener(e,t,r)}removeEventListener(e,t,r){super.removeEventListener(e,t,r)}constructor(e,t){super();try{if(e instanceof URL)this.#t=e;else if("string"==typeof e)this.#t=new URL(e,function(){let e="document"in globalThis?globalThis.document:void 0;return e&&"object"==typeof e&&"baseURI"in e&&"string"==typeof e.baseURI?e.baseURI:void 0}());else throw Error("Invalid URL")}catch{throw function(e){let t=globalThis.DOMException;return"function"==typeof t?new t(e,"SyntaxError"):SyntaxError(e)}("An invalid or illegal string was specified")}this.#o=function(e){let t,r;if("function"==typeof e)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{maxBufferSize:i,onComment:n,onError:s,onEvent:o,onId:a,onRetry:u}=e,c=[],l=0,h=!0,d="",f=0,p=!1,g=!1,m=!1;function v(e){if(e){if(13===e.charCodeAt(e.length-1)){E(e,0,e.length-1),m=!0;return}if(y(e)){c.push(e),l=e.length;return}g=!0}}function y(e){let t=e.charCodeAt(0);return 58===t&&!!n||100===t&&D(e,"data")||101===t&&D(e,"event")||105===t&&D(e,"id")||114===t&&D(e,"retry")}function b(){void 0===i||l+d.length<=i||(p=!0,c.length=0,l=0,t=void 0,d="",f=0,r=void 0,g=!1,m=!1,null==s||s(new k(`Buffered data exceeded max buffer size of ${i} characters`,{type:"max-buffer-size-exceeded"})))}function w(e){let i=0;if(-1===e.indexOf("\r")){let n=e.indexOf("\n",i);for(;-1!==n;){if(i===n){void 0!==t&&(null==a||a(t)),f>0&&(null==o||o({id:t,event:r,data:d})),t=void 0,d="",f=0,r=void 0,i=n+1,n=e.indexOf("\n",i);continue}let s=e.charCodeAt(i);if(P(e,i,s)){let s=32===e.charCodeAt(i+5)?i+6:i+5,u=e.slice(s,n);if(0===f&&10===e.charCodeAt(n+1)){void 0!==t&&(null==a||a(t)),null==o||o({id:t,event:r,data:u}),t=void 0,d="",r=void 0,i=n+2,n=e.indexOf("\n",i);continue}d=0===f?u:`${d}
2${u}`,f++}else j(e,i,s)?r=e.slice(32===e.charCodeAt(i+6)?i+7:i+6,n)||void 0:E(e,i,n);i=n+1,n=e.indexOf("\n",i)}return e.slice(i)}for(;i<e.length;){let t=e.indexOf("\r",i),r=e.indexOf("\n",i),n=-1;if(-1!==t&&-1!==r?n=t<r?t:r:-1!==t?n=t===e.length-1?-1:t:-1!==r&&(n=r),-1===n)break;E(e,i,n),i=n+1,13===e.charCodeAt(i-1)&&10===e.charCodeAt(i)&&i++}return e.slice(i)}function E(e,i,s){if(i===s)return void(void 0!==t&&(null==a||a(t)),f>0&&(null==o||o({id:t,event:r,data:d})),t=void 0,d="",f=0,r=void 0);let u=e.charCodeAt(i);if(P(e,i,u)){let t=32===e.charCodeAt(i+5)?i+6:i+5,r=e.slice(t,s);d=0===f?r:`${d}
3${r}`,f++;return}if(j(e,i,u)){r=e.slice(32===e.charCodeAt(i+6)?i+7:i+6,s)||void 0;return}if(105===u&&100===e.charCodeAt(i+1)&&58===e.charCodeAt(i+2)){let r=e.slice(32===e.charCodeAt(i+3)?i+4:i+3,s);r.includes("\0")||(t=r);return}if(58===u){n&&n(e.slice(i,s).slice(32===e.charCodeAt(i+1)?2:1));return}let c=e.slice(i,s),l=c.indexOf(":");if(-1===l)return void I(c,"",c);let h=c.slice(0,l),p=32===c.charCodeAt(l+1)?2:1;I(h,c.slice(l+p),c)}function I(e,i,n){switch(e){case"event":r=i||void 0;break;case"data":d=0===f?i:`${d}
4${i}`,f++;break;case"id":i.includes("\0")||(t=i);break;case"retry":/^\d+$/.test(i)?null==u||u(parseInt(i,10)):null==s||s(new k(`Invalid \`retry\` value: "${i}"`,{type:"invalid-retry",value:i,line:n}));break;default:null==s||s(new k(`Unknown field "${e.length>20?`${e.slice(0,20)}…`:e}"`,{type:"unknown-field",field:e,value:i,line:n}))}}return{feed:function(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(h&&(h=!1,65279===e.charCodeAt(0)?e=e.slice(1):239===e.charCodeAt(0)&&187===e.charCodeAt(1)&&191===e.charCodeAt(2)&&(e=e.slice(3))),(g||m)&&!(e=function(e){if(0===e.length)return e;if(m)return m=!1,10===e.charCodeAt(0)?e.slice(1):e;let t=e.indexOf("\r"),r=e.indexOf("\n"),i=-1===t?r:-1===r||t<r?t:r;return -1===i?"":i===e.length-1&&13===e.charCodeAt(i)?(g=!1,m=!0,""):(g=!1,e.slice(i+(13===e.charCodeAt(i)&&10===e.charCodeAt(i+1)?2:1)))}(e)))return;if(!c.length){let t=w(e);""!==t&&v(t),b();return}if(-1===e.indexOf("\n")&&-1===e.indexOf("\r")){if(l<6&&!y(c.join("")+e.slice(0,6-l))){c.length=0,l=0,g=!0;return}c.push(e),l+=e.length,b();return}c.push(e);let t=c.join("");c.length=0,l=0,v(w(t)),b()},reset:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.consume&&c.length>0){let e=c.join("");E(e,0,e.length)}h=!0,t=void 0,d="",f=0,r=void 0,c.length=0,l=0,p=!1,g=!1,m=!1}}}({maxBufferSize:t?.maxBufferSize??0x6400000,onEvent:this.#a,onError:this.#u,onId:this.#c,onRetry:this.#l}),this.#e=this.CONNECTING,this.#h=3e3,this.#d=t?.fetch??globalThis.fetch,this.#r=t?.withCredentials??!1,this.#f()}close(){this.#p&&clearTimeout(this.#p),this.#e!==this.CLOSED&&(this.#g&&this.#g.abort(),this.#e=this.CLOSED,this.#g=void 0)}#e;#t;#m;#r;#d;#h;#p;#v=null;#g;#o;#i=null;#n=null;#s=null;#f(){this.#e=this.CONNECTING,this.#g=new AbortController,(0,this.#d)(this.#t,this.#y()).then(this.#b).catch(this.#w)}#b=async e=>{this.#o.reset();let{body:t,redirected:r,status:i,headers:n}=e;
4if(204===i){this.#E("Server sent HTTP 204, not reconnecting",204),this.close();return}if(r?this.#m=new URL(e.url):this.#m=void 0,200!==i)return void this.#E(`Non-200 status code (${i})`,i);if(!(n.get("content-type")||"").startsWith("text/event-stream"))return void this.#E('Invalid content type, expected "text/event-stream"',i);if(this.#e===this.CLOSED)return;this.#e=this.OPEN;let s=new Event("open");if(this.dispatchEvent(s),"object"!=typeof t||!t||!("getReader"in t)){this.#E("Invalid response body, expected a web ReadableStream",i),this.close();return}let o=new TextDecoder,a=t.getReader(),u=!0;do{let{done:e,value:t}=await a.read();if(this.#e===this.CLOSED){u=!1;break}if(t&&this.#o.feed(o.decode(t,{stream:!e})),!e)continue;u=!1,this.#o.reset(),this.#I()}while(u)};#w=e=>{this.#g=void 0,"AbortError"!==e.name&&"aborted"!==e.type&&this.#I(function e(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(e).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${e(t.cause)}`:t.message:`${t}`}(e))};#y(){let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...this.#v?{"Last-Event-ID":this.#v}:void 0},cache:"no-store",signal:this.#g?.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e}#c=e=>{this.#v=e};#a=e=>{let t=this.#m?this.#m.origin:this.#t.origin,r=this.#v??"",i=new MessageEvent(e.event||"message",{data:e.data,origin:t,lastEventId:r});i.origin!==t&&U(i,"origin",t),i.lastEventId!==r&&U(i,"lastEventId",r),this.dispatchEvent(i)};#l=e=>{this.#h=e};#u=e=>{"max-buffer-size-exceeded"===e.type&&(this.close(),this.#E(e.message))};#E(e,t){this.#e!==this.CLOSED&&(this.#e=this.CLOSED);let r=new M("error",{code:t,message:e});this.dispatchEvent(r)}#I(e,t){if(this.#e===this.CLOSED)return;this.#e=this.CONNECTING;let r=new M("error",{code:t,message:e});this.dispatchEvent(r);let i=setTimeout(this.#$,this.#h);"object"==typeof i&&null!==i&&"unref"in i&&i.unref(),this.#p=i}#$=()=>{this.#p=void 0,this.#e===this.CONNECTING&&this.#f()}}function U(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0})}Object.defineProperty(q,"name",{value:"EventSource"}),Object.defineProperty(q,Symbol.for("eventsource.supports-fetch-override"),{value:!0,writable:!1,configurable:!1,enumerable:!1});var _=class extends Error{constructor(e,t={}){let{status:i,...n}=t;super(e,n),(0,r.u)(this,"name","ConnectionFailedError"),(0,r.u)(this,"status",void 0),this.status=i}},V=class extends Error{constructor(e,t,i={}){super(e,i),(0,r.u)(this,"name","DisconnectError"),(0,r.u)(this,"reason",void 0),this.reason=t}},L=class extends Error{constructor(e,t){super(e),(0,r.u)(this,"name","ChannelError"),(0,r.u)(this,"data",void 0),this.data=t}},W=class extends Error{constructor(e,t,i={}){super(e,i),(0,r.u)(this,"name","MessageError"),(0,r.u)(this,"data",void 0),this.data=t}},z=class extends Error{constructor(...e){super(...e),(0,r.u)(this,"name","MessageParseError")}};let F=["channelError","disconnect"];function N(e,t){return(0,l.defer)(()=>{let t=e();return(0,d.isObservable)(t)?t:(0,v.of)(t)}).pipe((0,m.mergeMap)(e=>{var n,s;return n=e,s=t,new a.Observable(e=>{let t=new Set(s),o=t.has("open");function a(r){if("data"in r){let[t,n]=H(r);e.error(t||!n?new z("Unable to parse EventSource error message",{cause:t}):new W((0,i.t)(n.data)&&"string"==typeof n.data.message?n.data.message:"",n));return}if(void 0!==r.code)return void e.error(new _("EventSource connection failed",{status:r.code}));if(n.readyState===n.CLOSED)e.error(new _("EventSource connection failed"));else{let r="reconnect";t.has(r)&&e.next({type:r})}}function u(){let r="open";t.has(r)&&e.next({type:r})}function c(s){let o,[a,u]=H(s);if(a||!u)return void e.error(new z("Unable to parse EventSource message",{cause:a}));if("channelError"===s.type){let t=new URL(n.url).searchParams.get("tag");e.error(new L(function(e,t){let n=(0,i.t)(e)?e.error:void 0;if(!n){let t=(0,i.t)(e)?e.message:void 0;return"string"==typeof t&&t||"Unknown listener error"}if((0,i.t)(n)){if((0,r.l)(n))return(0,r.o)(n,t);if("string"==typeof n.description)return n.description}return"string"==typeof n?n:JSON.stringify(n,null,2)}(u?.data,t),u.data));return}"disconnect"===s.type?e.error(new V(`Server disconnected client: ${(0,i.t)(u.data)&&"string"==typeof u.data.reason&&u.data.reason||"unknown error"}`)):(o=s.type,t.has(o)&&e.next({type:s.type,id:s.lastEventId,...u.data?{data:u.data}:{}}))}n.addEventListener("error",a),o&&n.addEventListener("open",u);let l=[...new Set([...F,...s])].filter(e=>"error"!==e&&"open"!==e&&"reconnect"!==e);
4return l.forEach(e=>n.addEventListener(e,c)),()=>{n.removeEventListener("error",a),o&&n.removeEventListener("open",u),l.forEach(e=>n.removeEventListener(e,c)),n.close()}})}))}function H(e){try{let t="string"==typeof e.data&&JSON.parse(e.data);return[null,{type:e.type,id:e.lastEventId,...!function(e){for(let t in e)return!1;return!0}(t)?{data:t}:{}}]}catch(e){return[e,null]}}function B(e){if("string"==typeof e)return{id:e};if(Array.isArray(e))return{query:"*[_id in $ids]",params:{ids:e}};if("object"==typeof e&&e&&"query"in e&&"string"==typeof e.query)return"params"in e&&"object"==typeof e.params&&null!==e.params?{query:e.query,params:e.params}:{query:e.query};throw Error(`Unknown selection - must be one of:
5
6* Document ID (<docId>)
7* Array of document IDs
8* Object containing \`query\``)}function G(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function Q(e,t,r){G(e,t),t.set(e,r)}function X(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}function Y(e,t,r){return e.set(X(e,t),r),r}function J(e,t){return e.get(X(e,t))}var K=class{constructor(e,t={}){(0,r.u)(this,"selection",void 0),(0,r.u)(this,"operations",void 0),this.selection=e,this.operations=t}set(e){return this._assign("set",e)}setIfMissing(e){return this._assign("setIfMissing",e)}diffMatchPatch(e){return(0,n.y)("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw 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,t,r){return(0,n.v)(e,t,r),this._assign("insert",{[e]:t,items:r})}append(e,t){return this.insert("after",`${e}[-1]`,t)}prepend(e,t){return this.insert("before",`${e}[0]`,t)}splice(e,t,r,i){let n=t<0?t-1:t,s=void 0===r||-1===r?-1:Math.max(0,t+r),o=`${e}[${n}:${n<0&&s>=0?"":s}]`;return this.insert("replace",o,i||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...B(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return(0,n.y)(e,t),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},r&&this.operations[e]||{},t)}),this}_set(e,t){return this._assign(e,t,!1)}},Z=new WeakMap,ee=class e extends K{constructor(e,t,r){super(e,t),Q(this,Z,void 0),Y(Z,this,r)}clone(){return new e(this.selection,{...this.operations},J(Z,this))}commit(e){if(!J(Z,this))throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return J(Z,this).mutate({patch:this.serialize()},t)}},et=new WeakMap,er=class e extends K{constructor(e,t,r){super(e,t),Q(this,et,void 0),Y(et,this,r)}clone(){return new e(this.selection,{...this.operations},J(et,this))}commit(e){if(!J(et,this))throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return J(et,this).mutate({patch:this.serialize()},t)}};let ei={returnDocuments:!1};var en=class{constructor(e=[],t){(0,r.u)(this,"operations",void 0),(0,r.u)(this,"trxId",void 0),this.operations=e,this.trxId=t}create(e){return(0,n.y)("create",e),this._add({create:e})}createIfNotExists(e){let t="createIfNotExists";return(0,n.y)(t,e),(0,n.f)(t,e),this._add({[t]:e})}createOrReplace(e){let t="createOrReplace";return(0,n.y)(t,e),(0,n.f)(t,e),this._add({[t]:e})}delete(e){return(0,n._)("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}},es=new WeakMap,eo=class e extends en{constructor(e,t,r){super(e,r),Q(this,es,void 0),Y(es,this,t)}clone(){return new e([...this.operations],J(es,this),this.trxId)}commit(e){if(!J(es,this))throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return J(es,this).mutate(this.serialize(),Object.assign({transactionId:this.trxId},ei,e||{}))}patch(e,t){let r="function"==typeof t,i="string"!=typeof e&&e instanceof er,n="object"==typeof e&&("query"in e||"id"in e);if(i)return this._add({patch:e.serialize()});if(r){let r=t(new er(e,{},J(es,this)));if(!(r instanceof er))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}if(n){let r=new er(e,t||{},J(es,this));return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}},ea=new WeakMap,eu=class e extends en{constructor(e,t,r){super(e,r),Q(this,ea,void 0),Y(ea,this,t)}clone(){return new e([...this.operations],J(ea,this),this.trxId)}commit(e){if(!J(ea,this))throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return J(ea,this).mutate(this.serialize(),Object.assign({transactionId:this.trxId},ei,e||{}))}patch(e,t){let r="function"==typeof t;if("string"!=typeof e&&e instanceof ee)return this._add({patch:e.serialize()});if(r){let r=t(new ee(e,{},J(ea,this)));if(!(r instanceof ee))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}};
8let ec=["headers","signal","tag","timeout","token"],el=e=>{let{query:t,params:r={},options:i={}}=e,n=new URLSearchParams,{tag:s,includeMutations:o,returnQuery:a,...u}=i;for(let[e,i]of(s&&n.append("tag",s),n.append("query",t),Object.entries(r)))void 0!==i&&n.append(`$${e}`,JSON.stringify(i));for(let[e,t]of Object.entries(u))t&&n.append(e,`${t}`);return!1===a&&n.append("returnQuery","false"),!1===o&&n.append("includeMutations","false"),`?${n}`},eh=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{dryRun:t.dryRun,returnIds:!0,returnDocuments:(e=t.returnDocuments,!1===e?void 0:void 0===e||e),visibility:t.visibility||"sync",autoGenerateArrayKeys:t.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:t.skipCrossDatasetReferenceValidation}};function ed(t,r,i,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},{stega:u,params:c,mapResponse:l,reqOpts:h}=function(e,t,r){let i="stega"in r?{...e,..."boolean"==typeof r.stega?{enabled:r.stega}:r.stega||{}}:e,n=i.enabled?(0,s.t)(t):t,o=!1===r.filterResponse?e=>e:e=>e.result,{cache:a,next:u,...c}={useAbortSignal:void 0!==r.signal,resultSourceMap:i.enabled?"withKeyArraySelector":r.resultSourceMap,...r,returnQuery:!1===r.filterResponse&&!1!==r.returnQuery};return{stega:i,params:n,mapResponse:o,reqOpts:void 0!==a||void 0!==u?{...c,fetch:{cache:a,next:u}}:c}}(i,o,a),d=eE(t,r,"query",{query:n,params:c},h);return u.enabled?Promise.all([d,e.A(28931).then(e=>e.n)]).then(e=>{let[t,{stegaEncodeSourceMap:r}]=e,i=r(t.result,t.resultSourceMap,u);return l({...t,result:i})}):d.then(l)}function ef(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return eq(i.signal,n=>eU(e,t,eg(e,r,{...i,signal:n})).then(e=>em(e,i.includeAllVersions)))}function ep(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return eU(e,t,eg(e,r,i)).then(e=>em(e,i.includeAllVersions))}function eg(e,t,r){let i=t;if(r.releaseId){let e=(0,C.getVersionFromId)(t);if(e){if(e!==r.releaseId)throw Error(`The document ID (\`${t}\`) is already a version of \`${e}\` release, but this does not match the provided \`options.releaseId\` (\`${r.releaseId}\`)`)}else{if((0,S.isDraftId)(t))throw Error(`The document ID (\`${t}\`) is a draft, but \`options.releaseId\` is set as \`${r.releaseId}\``);i=(0,T.getVersionId)(t,r.releaseId)}}return{url:eV(e,"doc",i),tag:r.tag,signal:r.signal,query:void 0===r.includeAllVersions?void 0:{includeAllVersions:r.includeAllVersions}}}function em(e,t){let r=e.documents;return r?t?r:r[0]:t?[]:void 0}function ev(e,t,r){var i,n,s;let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return eU(e,t,(i=e,n=r,s=o,{url:eV(i,"doc",n.join(",")),tag:s.tag,signal:s.signal})).then(e=>{var t,i;let n,s,o;return t=e,i=r,o=(n=t.documents||[],s=e=>e._id,n.reduce((e,t)=>(e[s(t)]=t,e),Object.create(null))),i.map(e=>o[e]||null)})}async function ey(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=new Set;if(0===r.length)return n;for(let s=0;s<r.length;s+=100){let o=r.slice(s,s+100),a=await eU(e,t,{url:eV(e,"doc",o.map(encodeURIComponent).join(",")),tag:i.tag,signal:i.signal,query:{excludeContent:!0}}),u=new Set;for(let e of a.omitted||[])"existence"===e.reason&&u.add(e.id);for(let e of o)u.has(e)||n.add(e)}return n}function eb(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return eE(e,t,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:r}},i)}function ew(e,t,r,i){return eq(i?.signal,n=>e$(e,t,r,{...i,signal:n}))}function eE(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},{reqOptions:s,isMutation:o,returnFirst:a}=function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n="mutate"===t,s="actions"===t,o="query"===t,a=n||s?"":el(r),u=!n&&!s&&a.length<11264,c=u?a:"",l=i.returnFirst,{timeout:h,token:d,tag:f,headers:p,returnQuery:g,lastLiveEventId:m,cacheMode:v}=i;return{reqOptions:{method:u?"GET":"POST",url:eV(e,t,c),body:u?void 0:r,query:n&&eh(i),timeout:h,headers:p,token:d,tag:f,returnQuery:g,perspective:i.perspective,variant:i.variant,resultSourceMap:i.resultSourceMap,lastLiveEventId:Array.isArray(m)?m[0]:m,cacheMode:v,canUseCdn:o,signal:i.signal,fetch:i.fetch,useAbortSignal:i.useAbortSignal,useCdn:i.useCdn},isMutation:n,returnFirst:l}}(e,r,i,n);return eU(e,t,s).then(e=>(function(e,t,r,i){if(!t)return e;let n=e.results||[];if(i)return r?n[0]&&n[0].document:n.map(e=>e.document);let s=r?n[0]&&n[0].id:n.map(e=>e.id);return{transactionId:e.transactionId,results:n,[r?"documentId":"documentIds"]:s}})(e,o,a,n.returnDocuments))}function eI(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return eE(e,t,"mutate",{mutations:[{[i]:r}]},Object.assign({returnFirst:!0,returnDocuments:!0},n))}
8function e$(e,t,r,i){return eE(e,t,"actions",{actions:Array.isArray(r)?r:[r],transactionId:i&&i.transactionId||void 0,skipCrossDatasetReferenceValidation:i&&i.skipCrossDatasetReferenceValidation||void 0,dryRun:i&&i.dryRun||void 0},i)}function eC(e,t,r,i){let n;return eE(e,t,"mutate",{mutations:Array.isArray(n=r instanceof er||r instanceof ee?{patch:r.serialize()}:r instanceof eo||r instanceof eu?r.serialize():r)?n:[n],transactionId:i&&i.transactionId||void 0},i)}function eT(e,t,r,i){return eE(e,t,"mutate",{mutations:[{delete:B(r)}]},i)}function eS(e,t,r,i){return(0,n.f)("createIfNotExists",r),eI(e,t,r,"createIfNotExists",i)}function eA(e,t,r,i){return(0,n.f)("createOrReplace",r),eI(e,t,r,"createOrReplace",i)}function ex(e,t,r,i,s){return(0,n.f)("createVersion",r),(0,n.p)("createVersion",r),(0,n.a)(),e$(e,t,{actionType:"sanity.action.document.version.create",publishedId:i,document:r},s)}function eO(e,t,r,i,s,o,a){if(!i)throw Error("`createVersion()` requires `baseId` when no `document` is provided");if(!r)throw Error("`createVersion()` requires `publishedId` when `baseId` is provided");return(0,n._)("createVersion",i),(0,n._)("createVersion",r),e$(e,t,{actionType:"sanity.action.document.version.create",publishedId:r,baseId:i,versionId:s?(0,T.getVersionId)(r,s):(0,I.getDraftId)(r),ifBaseRevisionId:o},a)}function ek(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4?arguments[4]:void 0;return e$(e,t,{actionType:"sanity.action.document.version.discard",versionId:r,purge:i},n)}function eP(e,t,r,i){return(0,n.f)("replaceVersion",r),(0,n.p)("replaceVersion",r),e$(e,t,{actionType:"sanity.action.document.version.replace",document:r},i)}function ej(e,t,r,i,n){return e$(e,t,{actionType:"sanity.action.document.version.unpublish",versionId:r,publishedId:i},n)}let eD=e=>{let t=e.config();return void 0!==t.dataset&&void 0!==t.projectId||void 0!==t.resource},eM=(e,t)=>eD(e)&&t.startsWith(eV(e,"query"));function eR(e,t){void 0!==t.uri&&(0,n.o)();let r=t.uri||t.url;if("string"!=typeof r)throw TypeError("Request options must include a `url`");let i=e.config(),s=void 0===t.canUseCdn?["GET","HEAD"].indexOf(t.method||"GET")>=0&&(r.startsWith("/data/")||eM(e,r)||eD(e)&&r.startsWith(eV(e,"mutate"))||eD(e)&&r.startsWith(eV(e,"doc",""))||eD(e)&&r.startsWith(eV(e,"listen"))||eD(e)&&r.startsWith(eV(e,"history",""))):t.canUseCdn,o=(t.useCdn??i.useCdn)&&s,a=t.tag&&i.requestTagPrefix?[i.requestTagPrefix,t.tag].join("."):t.tag||i.requestTagPrefix;if(a&&null!==t.tag&&(t.query={tag:(0,n.d)(a),...t.query}),["GET","HEAD","POST"].indexOf(t.method||"GET")>=0&&eM(e,r)){let e=t.resultSourceMap??i.resultSourceMap;void 0!==e&&!1!==e&&(t.query={resultSourceMap:e,...t.query});let r=t.perspective||i.perspective;void 0!==r&&("previewDrafts"===r&&(0,n.c)(),(0,n.r)(r),t.query={perspective:Array.isArray(r)?r.join(","):r,...t.query},(Array.isArray(r)&&r.length>0||"previewDrafts"===r||"drafts"===r)&&o&&(o=!1,(0,n.i)()));let s=t.variant||i.variant;"string"==typeof s&&(t.query={variant:s,...t.query}),"object"==typeof s&&(t.query={variantCondition:Object.entries(s).map(e=>{let[t,r]=e;return`${t}:${r}`}).toSorted(),...t.query}),t.lastLiveEventId&&(t.query={...t.query,lastLiveEventId:t.lastLiveEventId}),!1===t.returnQuery&&(t.query={returnQuery:"false",...t.query}),o&&"noStale"==t.cacheMode&&(t.query={cacheMode:"noStale",...t.query})}return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};e.headers&&Object.assign(r,e.headers);let i=t.token||e.token;i&&(r.Authorization=`Bearer ${i}`),t.useGlobalApi||e.useProjectHostname||!e.projectId||(r["X-Sanity-Project-ID"]=e.projectId);let n={url:t.url,headers:Object.assign(r,t.headers||{})};t.method&&(n.method=t.method),void 0!==t.body&&(n.body=t.body),t.query&&(n.query=function(e){if(e instanceof URLSearchParams||!e||"object"!=typeof e||!Object.values(e).some(Array.isArray))return e;let t=new URLSearchParams;for(let[r,i]of Object.entries(e))if(null!=i)if(Array.isArray(i))for(let e of i)null!=e&&t.append(r,`${e}`);else t.append(r,`${i}`);return t}(t.query)),t.signal&&(n.signal=t.signal),(void 0===t.withCredentials?e.withCredentials:t.withCredentials)&&(n.credentials="include"),"number"==typeof t.maxRedirects&&(n.redirect=0===t.maxRedirects?"manual":"follow");let s=void 0===t.timeout?e.timeout:t.timeout;n.timeout=void 0===s?3e5:0!==s&&s,!1!==t.useAbortSignal||n.signal||(n.timeout="number"==typeof n.timeout&&n.timeout>0&&{total:n.timeout,signal:!1});let o="object"==typeof t.fetch&&"object"==typeof e.fetch?{...e.fetch,...t.fetch}:t.fetch||e.fetch;return"function"==typeof o?n.fetch=o:"object"==typeof o&&o&&(n.meta={...n.meta,fetchInit:o}),!n.fetch&&e.resolveFetch&&(n.fetch=e.resolveFetch("string"==typeof e.proxy?e.proxy:void 0)),"number"==typeof t.maxRetries&&(n.maxRetries=t.maxRetries),"string"==typeof e.lineage&&e.lineage&&(n.meta={...n.meta,lineage:e.lineage}),n}(i,Object.assign({},t,{url:eL(e,r,o)}))}function eq(e,t){return new a.Observable(r=>{let i=new AbortController;return t(e?(0,o.anySignal)([e,i.signal]):i.signal).then(e=>{r.next(e),r.complete()},e=>r.error(e)),()=>i.abort()})}function eU(e,t,r){return t(eR(e,r),e.config().requestHandler).then(e=>e)}function e_(e,t,r){return eq(r.signal,i=>eU(e,t,{...r,signal:i}))}function eV(e,t,r){let i=e.config();if(i.resource)return(0,n.m)(i),`${eW(i)}/${void 0===r?t:`${t}/${r}`}`.replace(/\/($|\?)/,"$1");let s=`/${t}/${(0,n.u)(i)}`;return`/data${void 0===r?s:`${s}/${r}`}`.replace(/\/($|\?)/,"$1")}function eL(e,t){let r=arguments.length>
82&&void 0!==arguments[2]&&arguments[2],{url:i,cdnUrl:n}=e.config();return`${r?n:i}/${t.replace(/^\//,"")}`}let eW=e=>{let t=e.resource;if(!t)throw Error("`resource` must be provided to perform resource queries");let{type:r,id:i}=t;switch(r){case"dataset":{let e=i.split(".");if(2!==e.length)throw Error('Dataset ID must be in the format "project.dataset"');return`/projects/${e[0]}/datasets/${e[1]}`}case"canvas":return`/canvases/${i}`;case"knowledge-base":return`/knowledge-bases/${i}`;case"media-library":return`/media-libraries/${i}`;case"dashboard":return`/dashboards/${i}`;default:throw Error(`Unsupported resource type: ${r.toString()}`)}};var ez=new WeakMap,eF=new WeakMap,eN=class{constructor(e,t){Q(this,ez,void 0),Q(this,eF,void 0),Y(ez,this,e),Y(eF,this,t)}generate(e){var t,r;return t=J(ez,this),r=J(eF,this),e_(t,r,{method:"POST",url:`/agent/action/generate/${(0,n.u)(t.config())}`,body:e})}transform(e){var t,r;return t=J(ez,this),r=J(eF,this),e_(t,r,{method:"POST",url:`/agent/action/transform/${(0,n.u)(t.config())}`,body:e})}translate(e){var t,r;return t=J(ez,this),r=J(eF,this),e_(t,r,{method:"POST",url:`/agent/action/translate/${(0,n.u)(t.config())}`,body:e})}},eH=new WeakMap,eB=new WeakMap,eG=class{constructor(e,t){Q(this,eH,void 0),Q(this,eB,void 0),Y(eH,this,e),Y(eB,this,t)}generate(e){var t,r;return t=J(eH,this),r=J(eB,this),eU(t,r,{method:"POST",url:`/agent/action/generate/${(0,n.u)(t.config())}`,body:e})}transform(e){var t,r;return t=J(eH,this),r=J(eB,this),eU(t,r,{method:"POST",url:`/agent/action/transform/${(0,n.u)(t.config())}`,body:e})}translate(e){var t,r;return t=J(eH,this),r=J(eB,this),eU(t,r,{method:"POST",url:`/agent/action/translate/${(0,n.u)(t.config())}`,body:e})}prompt(e){var t,r;return t=J(eH,this),r=J(eB,this),eU(t,r,{method:"POST",url:`/agent/action/prompt/${(0,n.u)(t.config())}`,body:e})}patch(e){var t,r;return t=J(eH,this),r=J(eB,this),eU(t,r,{method:"POST",url:`/agent/action/patch/${(0,n.u)(t.config())}`,body:e})}},eQ=new WeakMap,eX=new WeakMap,eY=class{constructor(e,t){Q(this,eQ,void 0),Q(this,eX,void 0),Y(eQ,this,e),Y(eX,this,t)}upload(e,t,r){return e0(J(eQ,this),J(eX,this),e,t,r)}},eJ=new WeakMap,eK=new WeakMap,eZ=class{constructor(e,t){Q(this,eJ,void 0),Q(this,eK,void 0),Y(eJ,this,e),Y(eK,this,t)}upload(e,t,r){let i=e0(J(eJ,this),J(eK,this),e,t,r);return(0,f.lastValueFrom)(i.pipe((0,x.filter)(e=>"response"===e.type),(0,p.map)(e=>{var t;return"asset"in(t=e.body)?t.asset:t.document})))}};function e0(t,r,i,s){var o,u,c;let h,d,f,g=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(0,n.g)(i);let m=g.extract||void 0;m&&!m.length&&(m=["none"]);let v=t.config(),y=(o=g,u=s,!(typeof File>"u")&&u instanceof File?Object.assign({filename:!1===o.preserveFilename?void 0:u.name,contentType:u.type},o):o),{tag:b,label:w,title:E,description:I,creditLine:$,filename:C,source:T}=y,S=v.resource?.type==="media-library",A=S?{title:E,filename:C}:{label:w,title:E,description:I,filename:C,meta:m,creditLine:$};T&&!S&&(A.sourceId=T.id,A.sourceName=T.name,A.sourceUrl=T.url);let k=y.contentType?{"Content-Type":y.contentType}:{},P={tag:b,method:"POST",timeout:y.timeout||0,url:function(e,t){let r="image"===t?"images":"files",i=e.resource;if(i){let{type:e,id:t}=i;switch(e){case"dataset":throw Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${t}/assets/${r}`;case"knowledge-base":throw Error("Assets are not supported for knowledge-base resources. Use `client.context.imports` to add content instead.");case"media-library":return`/media-libraries/${t}/upload`;case"dashboard":return`/dashboards/${t}/assets/${r}`;default:throw Error(`Unsupported resource type: ${e.toString()}`)}}return`assets/${r}/${(0,n.u)(e)}`}(v,i),headers:k,query:A,body:s};return"u">typeof XMLHttpRequest?(0,l.defer)(async()=>{let{uploadWithProgress:r}=await e.A(547596),i=eR(t,{...P});return r({url:function(e,t){if(!t)return e;let r=(t instanceof URLSearchParams?t:new URLSearchParams(Object.entries(t).flatMap(e=>{let[t,r]=e;return null==r?[]:[[t,`${r}`]]}))).toString();return r?e+(e.includes("?")?"&":"?")+r:e}
8(i.url,i.query),method:i.method??"POST",headers:i.headers,body:s,withCredentials:"include"===i.credentials,timeout:"object"==typeof i.timeout?i.timeout.total:i.timeout,signal:i.signal})}).pipe((0,O.mergeAll)()):(h=eR(t,P),d=t.config().requester,f=new a.Observable(e=>d(h).subscribe(e)).pipe((0,x.filter)(e=>e?.type==="progress"||e?.type==="response"),(0,p.map)(e=>"progress"===e.type?{type:"progress",stage:e.stage,percent:e.percent,total:e.total,loaded:e.loaded,lengthComputable:e.lengthComputable}:{type:"response",body:e.body})),P.signal?f.pipe((c=P.signal,e=>new a.Observable(t=>{let r=()=>{var e;return t.error((e=c,new DOMException(e?.reason??"The operation was aborted.","AbortError")))};if(c&&c.aborted)return void r();let i=e.subscribe(t);return c.addEventListener("abort",r),()=>{c.removeEventListener("abort",r),i.unsubscribe()}}))):f)}var e1=(e,t)=>Object.keys(t).concat(Object.keys(e)).reduce((r,i)=>(r[i]=void 0===e[i]?t[i]:e[i],r),{});let e2=(e,t)=>t.reduce((t,r)=>(void 0===e[r]||(t[r]=e[r]),t),{}),e3=new Set([408,429]);function e8(){return function(e){return e.pipe((0,u.catchError)((e,t)=>e instanceof _&&("number"!=typeof e.status||e.status<400||e.status>=500||e3.has(e.status))?(0,c.concat)((0,v.of)({type:"reconnect"}),(0,E.timer)(1e3).pipe((0,m.mergeMap)(()=>t))):(0,w.throwError)(()=>e)))}}function e4(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.headers,i=t.withCredentials?"include":void 0;return function(t,n){let s=e5(e),o={...n};if(r){let e=new Headers(n?.headers);for(let[t,i]of Object.entries(r))e.set(t,i);o.headers=e}return void 0!==i&&(o.credentials=i),s("string"==typeof t?t:t.href,o)}}function e5(e){return e.resolveFetch?e.resolveFetch("string"==typeof e.proxy?e.proxy:void 0):globalThis.fetch.bind(globalThis)}let e6=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","enableResume","tag"],e9={includeResult:!0};function e7(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{url:i,requestTagPrefix:n}=this.config(),s=r.tag&&n?[n,r.tag].join("."):r.tag,o={...e1(r,e9),tag:s},a=el({query:e,params:t,options:{tag:s,...e2(o,e6)}}),u=`${i}${eV(this,"listen",a)}`;return u.length>14800?(0,w.throwError)(()=>Error("Query too large for listener")):te(this,u,o.events?o.events:["mutation"])}function te(e,t,r){let i=e.config(),{token:n,withCredentials:s,headers:o}=i,a={};return n&&(a.Authorization=`Bearer ${n}`),o&&Object.assign(a,o),N(()=>new q(t,{fetch:e4(i,{headers:Object.keys(a).length?a:void 0,withCredentials:s})}),r).pipe(e8(),(0,x.filter)(e=>r.includes(e.type)),(0,p.map)(e=>({type:e.type,..."data"in e?e.data:{}})))}let tt=["headers","signal","tag","timeout","token"];function tr(e){if(!e)throw Error("Comment ID must be provided");return`/collaboration/comments/${encodeURIComponent(e)}`}function ti(e){let{resource:t,projectId:r,dataset:i}=e.config();if(t)return t;if(r&&i)return{type:"dataset",id:`${r}.${i}`};throw Error("`resource` or `projectId` and `dataset` must be configured to use collaboration comments")}function tn(e){let{collaboration:t}=e.config(),r=t?.organizationId;if(!r)throw Error("`collaboration.organizationId` must be configured to use collaboration comments");let i=ti(e);return{organizationId:r,resourceId:i.id,resourceType:i.type}}function ts(e,t){if(!t)throw Error("Document ID must be provided");let r=ti(e);return`${r.type}:${r.id}:${(0,$.getPublishedId)(t)}`}function to(e,t,r,i,n){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return e_(e,t,{method:r,url:i,body:n,query:{...tn(e),...s.transactionId?{transactionId:s.transactionId}:{}},...e2(s,tt)})}function ta(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return to(...r).pipe((0,p.map)(t=>{let{results:r}=t,i=e?r.find(t=>{let{id:r}=t;return r===e}):r[0];if(!i?.document)throw Error("Comment write did not return a comment document");return i.document}))}
8function tu(e,t,r,i){return ta(r._id,e,t,"POST","/collaboration/comments",r,i)}function tc(e,t,r,i,n){return ta(r,e,t,"PATCH",tr(r),i,n)}function tl(e,t,r,i){return function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return to(...t).pipe((0,p.map)(e=>{let{transactionId:t,results:r}=e;return{transactionId:t,documentIds:r.map(e=>e.id),results:r}}))}(e,t,"DELETE",tr(r),void 0,i)}function th(e,t,r,i,n){return ta(r,e,t,"POST",`${tr(r)}/reactions`,{shortName:i},n)}function td(e,t,r,i,n){return ta(r,e,t,"DELETE",`${tr(r)}/reactions/${encodeURIComponent(i)}`,void 0,n)}function tf(e,t,r,i,n){let s=tn(e);return e_(e,t,{...el({query:r,params:i}).length<11264?{method:"GET",url:`/collaboration/comments/query${el({query:r,params:i,options:s})}`}:{method:"POST",url:"/collaboration/comments/query",query:s,body:{query:r,params:i??{}}},...e2(n||{},tt)}).pipe((0,p.map)(e=>e.result))}function tp(e,t,r,i){let n=i??{},{requestTagPrefix:s}=e.config(),o=n.tag&&s?[s,n.tag].join("."):n.tag,a=el({query:t,params:r,options:{...e2({...e1(n,e9),tag:o},e6),...tn(e)}}),u=`${e.getUrl("/collaboration/comments/listen")}${a}`;return u.length>14800?(0,w.throwError)(()=>Error("Query too large for listener")):te(e,u,n.events?n.events:["mutation"])}var tg=new WeakMap,tm=new WeakMap,tv=class{constructor(e,t){Q(this,tg,void 0),Q(this,tm,void 0),Y(tg,this,e),Y(tm,this,t)}create(e,t){return tu(J(tg,this),J(tm,this),e,t)}update(e,t,r){return tc(J(tg,this),J(tm,this),e,t,r)}delete(e,t){return tl(J(tg,this),J(tm,this),e,t)}addReaction(e,t,r){return th(J(tg,this),J(tm,this),e,t,r)}removeReaction(e,t,r){return td(J(tg,this),J(tm,this),e,t,r)}getTargetDocumentRef(e){return ts(J(tg,this),e)}fetch(e,t,r){return tf(J(tg,this),J(tm,this),e,t,r)}listen(e,t,r){return tp(J(tg,this),e,t,r)}},ty=new WeakMap,tb=new WeakMap,tw=class{constructor(e,t){Q(this,ty,void 0),Q(this,tb,void 0),Y(ty,this,e),Y(tb,this,t)}create(e,t){return(0,f.lastValueFrom)(tu(J(ty,this),J(tb,this),e,t))}update(e,t,r){return(0,f.lastValueFrom)(tc(J(ty,this),J(tb,this),e,t,r))}delete(e,t){return(0,f.lastValueFrom)(tl(J(ty,this),J(tb,this),e,t))}addReaction(e,t,r){return(0,f.lastValueFrom)(th(J(ty,this),J(tb,this),e,t,r))}removeReaction(e,t,r){return(0,f.lastValueFrom)(td(J(ty,this),J(tb,this),e,t,r))}getTargetDocumentRef(e){return ts(J(ty,this),e)}fetch(e,t,r){return(0,f.lastValueFrom)(tf(J(ty,this),J(tb,this),e,t,r))}listen(e,t,r){return tp(J(ty,this),e,t,r)}};function tE(e){let t=e.config().context?.organizationId;if(!t)throw Error("`context.organizationId` must be configured to query Context documents");return t}function tI(e,t){return`/context/organizations/${encodeURIComponent(tE(e))}/${t}`}function t$(e,t,r,i,n){let s=tI(e,"query");return e_(e,t,{...el({query:r,params:i}).length<11264?{method:"GET",url:`${s}${el({query:r,params:i})}`}:{method:"POST",url:s,body:{query:r,params:i??{}}},...e2(n||{},ec)}).pipe((0,p.map)(e=>e.result))}function tC(e,t,r,i){let n=i??{},{requestTagPrefix:s}=e.config(),o=n.tag&&s?[s,n.tag].join("."):n.tag,a=el({query:t,params:r,options:e2({...e1(n,e9),tag:o},e6)}),u=`${e.getUrl(tI(e,"listen"))}${a}`;return u.length>14800?(0,w.throwError)(()=>Error("Query too large for listener")):te(e,u,n.events?n.events:["mutation"])}let tT="sanity.context.entry",tS="sanity.context.issue",tA="sanity.context.mcp";function tx(e,t,r,i,n){return(0,f.lastValueFrom)(t$(e,t,r,i,n))}async function tO(e,t,r,i,n){let s=[],o;for(;;){let a=`*[${o?`${r} && (_createdAt > $c || (_createdAt == $c && _id > $i))`:r}] | order(_createdAt asc, _id asc) [0...200]`,u=await (0,f.lastValueFrom)(t$(e,t,a,o?{...i,...o}:i,n));if(s.push(...u),u.length<200)return s;let c=u[u.length-1];o={c:c._createdAt,i:c._id}}}function tk(e,t,r,i,n){return tx(e,t,`*[_type == "${tT}" && knowledgeBaseId == $kb && path == $path][0]`,{kb:r,path:i},n)}async function tP(e,t,r,i){let n=[],s="";for(;;){let o=await (0,f.lastValueFrom)(t$(e,t,`*[_type == "${tT}" && knowledgeBaseId == $kb && path > $after] | order(path asc) [0...200] {_id, path, title, tldr, status}`,{kb:r,after:s},i));if(n.push(...o),o.length<200)return n;s=o[o.length-1].path}}function tj(e,t,r,i,n){return tO(e,t,`_type == "${tS}" && knowledgeBaseId == $kb${void 0===i?"":" && status == $status"}`,void 0===i?{kb:r}:{kb:r,status:i},n)}function tD(e,t,r,i,n){return tx(e,t,`*[_type == "${tS}" && knowledgeBaseId == $kb && _id == $id][0]`,{kb:r,id:i},n)}
8function tM(e,t,r,i){return tO(e,t,'_type == "sanity.context.instruction" && knowledgeBaseId == $kb && schemaVersion == 1',{kb:r},i)}function tR(e,t,r){return(0,f.lastValueFrom)(t$(e,t,`*[_type == "${tA}" && organizationId == $org] | order(_createdAt asc, _id asc) [0...500]`,{org:tE(e)},r))}function tq(e,t,r,i){return tx(e,t,`*[_type == "${tA}" && organizationId == $org && name == $name][0]`,{org:tE(e),name:r},i)}function tU(e,t,r,i){return tx(e,t,'*[_type == "sanity.context.conversation" && organizationId == $org && threadId == $threadId][0]',{org:tE(e),threadId:r},i)}let t_="/context/knowledge-bases";function tV(e){let t=e.config().resource;if(t?.type!=="knowledge-base")throw Error("`resource` of type `knowledge-base` must be configured to use knowledge-base methods");return t.id}function tL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return`${t_}/${encodeURIComponent(e)}${t}`}function tW(e,t){let r=e.config().context?.organizationId;if(!r)throw Error("`context.organizationId` must be configured to record conversations");if(!t)throw Error("`threadId` must be provided");return`/context/organizations/${encodeURIComponent(r)}/conversations/${encodeURIComponent(t)}`}function tz(e){return Object.fromEntries(Object.entries(e).flatMap(e=>{let[t,r]=e;return void 0===r?[]:[[t,`${r}`]]}))}var tF=new WeakMap,tN=new WeakMap,tH=new WeakSet,tB=class{constructor(e,t){(function(e,t){G(e,t),t.add(e)})(this,tH),Q(this,tF,void 0),Q(this,tN,void 0),(0,r.u)(this,"knowledgeBases",{create:(e,t)=>eU(J(tF,this),J(tN,this),{url:t_,method:"POST",body:e,...t}),list:e=>eU(J(tF,this),J(tN,this),{url:t_,query:tz({organizationId:e.organizationId,cursor:e.cursor,limit:e.limit}),signal:e.signal,tag:e.tag}),get:(e,t)=>eU(J(tF,this),J(tN,this),{url:tL(e),...t}),edit:(e,t,r)=>eU(J(tF,this),J(tN,this),{url:tL(e),method:"PATCH",body:t,...r}),delete:async(e,t)=>{await eU(J(tF,this),J(tN,this),{url:tL(e),method:"DELETE",...t})}}),(0,r.u)(this,"conversations",{save:(e,t)=>{let{threadId:r,...i}=e;return eU(J(tF,this),J(tN,this),{url:tW(J(tF,this),r),method:"PUT",body:i,...t})},classify:(e,t)=>{let{threadId:r,...i}=e;return eU(J(tF,this),J(tN,this),{url:tW(J(tF,this),r),method:"PATCH",body:i,...t})},get:(e,t)=>tU(J(tF,this),J(tN,this),e.threadId,t)}),(0,r.u)(this,"imports",{create:(e,t)=>"file"===e.type?X(tH,this,tX).call(this,e,t):X(tH,this,tG).call(this,"/imports",{method:"POST",body:e,...t}),list:e=>X(tH,this,tQ).call(this,"/imports",e),get:(e,t)=>X(tH,this,tG).call(this,`/imports/${encodeURIComponent(e.importId)}`,t),download:(e,t)=>X(tH,this,tG).call(this,`/imports/${encodeURIComponent(e.importId)}/download`,t),delete:async(e,t)=>{await X(tH,this,tG).call(this,`/imports/${encodeURIComponent(e.importId)}`,{method:"DELETE",...t})}}),(0,r.u)(this,"jobs",{get:(e,t)=>X(tH,this,tG).call(this,`/jobs/${encodeURIComponent(e.jobId)}`,t)}),(0,r.u)(this,"issues",{list:(e,t)=>tj(J(tF,this),J(tN,this),tV(J(tF,this)),e?.status,t),get:(e,t)=>tD(J(tF,this),J(tN,this),tV(J(tF,this)),e.issueId,t),resolve:(e,t)=>{let{issueId:r,...i}=e;return X(tH,this,tG).call(this,`/issues/${encodeURIComponent(r)}/resolve`,{method:"POST",body:i,...t})},dismiss:(e,t)=>X(tH,this,tG).call(this,`/issues/${encodeURIComponent(e.issueId)}/dismiss`,{method:"POST",...t}),reopen:(e,t)=>X(tH,this,tG).call(this,`/issues/${encodeURIComponent(e.issueId)}/reopen`,{method:"POST",...t}),apply:(e,t)=>X(tH,this,tG).call(this,"/issues/apply",{method:"POST",body:e,...t})}),(0,r.u)(this,"instructions",{create:(e,t)=>X(tH,this,tG).call(this,"/instructions",{method:"POST",body:e,...t}),list:e=>tM(J(tF,this),J(tN,this),tV(J(tF,this)),e),edit:(e,t)=>{let{instructionId:r,...i}=e;return X(tH,this,tG).call(this,`/instructions/${encodeURIComponent(r)}`,{method:"PATCH",body:i,...t})},delete:async(e,t)=>{await X(tH,this,tG).call(this,`/instructions/${encodeURIComponent(e.instructionId)}`,{method:"DELETE",...t})}}),(0,r.u)(this,"entries",{list:e=>tP(J(tF,this),J(tN,this),tV(J(tF,this)),e),get:(e,t)=>tk(J(tF,this),J(tN,this),tV(J(tF,this)),e.path,t),rebuild:(e,t)=>X(tH,this,tG).call(this,`/entries/${encodeURIComponent(e.path)}/rebuild`,{method:"POST",...t})}),(0,r.u)(this,"mcpEndpoints",{list:e=>tR(J(tF,this),J(tN,this),e),get:(e,t)=>tq(J(tF,this),J(tN,this),e.name,t)}),(0,r.u)(this,"sources",{list:e=>
8X(tH,this,tQ).call(this,"/sources",e,{status:e?.status,importId:e?.importId,ids:e?.ids?.join(",")}),get:(e,t)=>X(tH,this,tG).call(this,`/sources/${encodeURIComponent(e.sourceId)}`,t),content:(e,t)=>X(tH,this,tG).call(this,`/sources/${encodeURIComponent(e.sourceId)}/content`,{query:tz({startLine:e.startLine,endLine:e.endLine}),...t}),delete:async(e,t)=>{await X(tH,this,tG).call(this,`/sources/${encodeURIComponent(e.sourceId)}`,{method:"DELETE",...t})}}),Y(tF,this,e),Y(tN,this,t)}fetch(e,t,r){return(0,f.lastValueFrom)(t$(J(tF,this),J(tN,this),e,t,r))}listen(e,t,r){return tC(J(tF,this),e,t,r)}build(e){return X(tH,this,tG).call(this,"/build",{method:"POST",...e})}cancelBuild(e){return X(tH,this,tG).call(this,"/build/cancel",{method:"POST",...e})}refresh(e){return X(tH,this,tG).call(this,"/refresh",{method:"POST",...e})}};function tG(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return eU(J(tF,this),J(tN,this),{url:tL(tV(J(tF,this)),e),...t})}function tQ(e,t,r){return X(tH,this,tG).call(this,e,{query:tz({cursor:t?.cursor,limit:t?.limit,...r}),signal:t?.signal,tag:t?.tag})}async function tX(e,t){var r;let i=await X(tH,this,tG).call(this,"/imports/uploads",{method:"POST",body:{filename:e.filename,...e.contentType&&{contentType:e.contentType}},...t}),n=J(tF,this).config(),s=await (n.resolveFetch?.(n.proxy)??globalThis.fetch)(i.uploadUrl,{method:"PUT",body:ArrayBuffer.isView(r=e.file)?r.buffer instanceof ArrayBuffer?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):Uint8Array.from(r):r,...e.contentType&&{headers:{"content-type":e.contentType}},signal:t?.signal});if(!s.ok)throw Error(`File upload failed: ${s.status} ${s.statusText}`);return X(tH,this,tG).call(this,`/imports/uploads/${encodeURIComponent(i.importId)}/complete`,{method:"POST",body:{},...t})}var tY=new WeakMap,tJ=new WeakMap,tK=class{constructor(e,t){Q(this,tY,void 0),Q(this,tJ,void 0),(0,r.u)(this,"knowledgeBases",{create:(e,t)=>eq(t?.signal,r=>eU(J(tY,this),J(tJ,this),{url:t_,method:"POST",body:e,tag:t?.tag,signal:r})),list:e=>eq(e.signal,t=>eU(J(tY,this),J(tJ,this),{url:t_,query:tz({organizationId:e.organizationId,cursor:e.cursor,limit:e.limit}),tag:e.tag,signal:t})),get:(e,t)=>eq(t?.signal,r=>eU(J(tY,this),J(tJ,this),{url:tL(e),tag:t?.tag,signal:r})),edit:(e,t,r)=>eq(r?.signal,i=>eU(J(tY,this),J(tJ,this),{url:tL(e),method:"PATCH",body:t,tag:r?.tag,signal:i})),delete:(e,t)=>eq(t?.signal,r=>eU(J(tY,this),J(tJ,this),{url:tL(e),method:"DELETE",tag:t?.tag,signal:r}))}),(0,r.u)(this,"conversations",{save:(e,t)=>{let{threadId:r,...i}=e;return eq(t?.signal,e=>eU(J(tY,this),J(tJ,this),{url:tW(J(tY,this),r),method:"PUT",body:i,tag:t?.tag,signal:e}))},classify:(e,t)=>{let{threadId:r,...i}=e;return eq(t?.signal,e=>eU(J(tY,this),J(tJ,this),{url:tW(J(tY,this),r),method:"PATCH",body:i,tag:t?.tag,signal:e}))},get:(e,t)=>eq(t?.signal,r=>tU(J(tY,this),J(tJ,this),e.threadId,{...t,signal:r}))}),(0,r.u)(this,"entries",{list:e=>eq(e?.signal,t=>tP(J(tY,this),J(tJ,this),tV(J(tY,this)),{...e,signal:t})),get:(e,t)=>eq(t?.signal,r=>tk(J(tY,this),J(tJ,this),tV(J(tY,this)),e.path,{...t,signal:r})),rebuild:(e,t)=>eq(t?.signal,r=>eU(J(tY,this),J(tJ,this),{url:tL(tV(J(tY,this)),`/entries/${encodeURIComponent(e.path)}/rebuild`),method:"POST",tag:t?.tag,signal:r}))}),(0,r.u)(this,"issues",{list:(e,t)=>eq(t?.signal,r=>tj(J(tY,this),J(tJ,this),tV(J(tY,this)),e?.status,{...t,signal:r})),get:(e,t)=>eq(t?.signal,r=>tD(J(tY,this),J(tJ,this),tV(J(tY,this)),e.issueId,{...t,signal:r}))}),(0,r.u)(this,"instructions",{list:e=>eq(e?.signal,t=>tM(J(tY,this),J(tJ,this),tV(J(tY,this)),{...e,signal:t}))}),(0,r.u)(this,"mcpEndpoints",{list:e=>eq(e?.signal,t=>tR(J(tY,this),J(tJ,this),{...e,signal:t})),get:(e,t)=>eq(t?.signal,r=>tq(J(tY,this),J(tJ,this),e.name,{...t,signal:r}))}),Y(tY,this,e),Y(tJ,this,t)}fetch(e,t,r){return t$(J(tY,this),J(tJ,this),e,t,r)}listen(e,t,r){return tC(J(tY,this),e,t,r)}};let tZ="2021-03-25";var t0=new WeakMap,t1=class{constructor(e){Q(this,t0,void 0),Y(t0,this,e)}events(){var e,t,n,s,o,c;let{includeDrafts:l=!1,tag:d,waitFor:f}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},E=J(t0,this).config(),{projectId:I,apiVersion:$,token:C,withCredentials:T,requestTagPrefix:S,headers:A}=E,x=$.replace(/^v/,"");if("X"!==x&&x<tZ)throw Error(`The live events API requires API version ${tZ} or later. The current API version is ${x}. Please update your API version to use this feature.`);if(l&&!C&&!T)throw 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.");let O=eV(J(t0,this),"live/events"),k=new URL(J(t0,this).getUrl(O,!1)),P=d&&S?[S,d].join("."):d;P&&k.searchParams.set("tag",P),l&&k.searchParams.set("includeDrafts","true"),f&&k.searchParams.set("waitFor",f);let j={};l&&C&&(j.Authorization=`Bearer ${C}`),A&&Object.assign(j,A);let D=!!(l&&T),M=t2.get(E.resolveFetch);M||(M=new Map,t2.set(E.resolveFetch,M));let R=JSON.stringify([k.href,"string"==typeof E.proxy?E.proxy:null,j,D]),U=M.get(R);if(U)return U;let _=N(()=>new q(k.href,{fetch:e4(E,{headers:Object.keys(j).length?j:void 0,withCredentials:D})}),["message","restart","welcome","reconnect","goaway"]),V=(t=new URL(J(t0,this).getUrl("/check/cors",!1)),n=I,s=D,o=e5(E),new a.Observable(e=>{let a=new AbortController,{signal:u}=a;return o(t.href,{method:"GET",credentials:"omit",signal:u}).then(e=>{if(!(u.aborted||!e.ok))return e.text()}).then(t=>{if(u.aborted)return;let o=void 0===t?void 0:JSON.parse(t),a=(0,i.t)(o)?o.result:void 0;s&&(0,i.t)(a)&&!1===a.withCredentials?e.error(new r.i({projectId:n,credentials:!0})):(0,i.t)(a)&&!1===a.allowed?e.error(new r.i({projectId:n,credentials:s})):(e.next(),e.complete())}).catch(()=>{u.aborted||e.closed||(e.next(),e.complete())}),()=>a.abort()})),L=_.pipe(e8(),(0,m.mergeMap)(e=>"reconnect"===e.type?V.pipe((0,m.mergeMap)(()=>(0,v.of)(e))):(0,v.of)(e)),(0,u.catchError)(e=>e instanceof r.i?(0,w.throwError)(()=>e):V.pipe((0,m.mergeMap)(()=>{throw e}))),(0,p.map)(e=>{if("message"===e.type){let{data:t,...r}=e;return{...r,tags:t.tags}}return e})).pipe((0,h.finalize)(()=>{M.delete(R),0===M.size&&t2.delete(E.resolveFetch)}),(c="function"==typeof(e={predicate:e=>"welcome"===e.type})?{predicate:e,...void 0}:e,e=>{let t,r=!1,{predicate:i,...n}=c,s=e.pipe((0,b.tap)(e=>{c.predicate(e)&&(r=!0,t=e)}),(0,h.finalize)(()=>{r=!1,t=void 0}),(0,y.share)(n)),o=new a.Observable(e=>{r&&e.next(t),e.complete()});return(0,g.merge)(s,o)}));return M.set(R,L),L}};let t2=new Map;var t3=new WeakMap,t8=new WeakMap,t4=class{constructor(e,t){Q(this,t3,void 0),Q(this,t8,void 0),Y(t3,this,e),Y(t8,this,t)}create(e,t){return re(J(t3,this),J(t8,this),"PUT",e,t)}edit(e,t){return re(J(t3,this),J(t8,this),"PATCH",e,t)}
8delete(e){return re(J(t3,this),J(t8,this),"DELETE",e)}list(){(0,n.h)("dataset",J(t3,this).config());let e=J(t3,this).config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),e_(J(t3,this),J(t8,this),{url:r,tag:null})}getEmbeddingsSettings(e){return(0,n.h)("dataset",J(t3,this).config()),(0,n.l)(e),e_(J(t3,this),J(t8,this),{url:t7(J(t3,this),e),tag:null})}editEmbeddingsSettings(e,t){return(0,n.h)("dataset",J(t3,this).config()),(0,n.l)(e),e_(J(t3,this),J(t8,this),{method:"PUT",url:t7(J(t3,this),e),body:t,tag:null})}},t5=new WeakMap,t6=new WeakMap,t9=class{constructor(e,t){Q(this,t5,void 0),Q(this,t6,void 0),Y(t5,this,e),Y(t6,this,t)}create(e,t){return(0,n.h)("dataset",J(t5,this).config()),rt(J(t5,this),J(t6,this),"PUT",e,t)}edit(e,t){return(0,n.h)("dataset",J(t5,this).config()),rt(J(t5,this),J(t6,this),"PATCH",e,t)}delete(e){return(0,n.h)("dataset",J(t5,this).config()),rt(J(t5,this),J(t6,this),"DELETE",e)}list(){(0,n.h)("dataset",J(t5,this).config());let e=J(t5,this).config(),t=e.projectId,r="/datasets";return!1===e.useProjectHostname&&(r=`/projects/${t}/datasets`),eU(J(t5,this),J(t6,this),{url:r,tag:null})}getEmbeddingsSettings(e){return(0,n.h)("dataset",J(t5,this).config()),(0,n.l)(e),eU(J(t5,this),J(t6,this),{url:t7(J(t5,this),e),tag:null})}editEmbeddingsSettings(e,t){return(0,n.h)("dataset",J(t5,this).config()),(0,n.l)(e),eU(J(t5,this),J(t6,this),{method:"PUT",url:t7(J(t5,this),e),body:t,tag:null})}};function t7(e,t){let r=e.config();return!1===r.useProjectHostname?`/projects/${r.projectId}/datasets/${t}/settings/embeddings`:`/datasets/${t}/settings/embeddings`}function re(e,t,r,i,s){return(0,n.h)("dataset",e.config()),(0,n.l)(i),e_(e,t,{method:r,url:`/datasets/${i}`,body:s,tag:null})}function rt(e,t,r,i,s){return(0,n.h)("dataset",e.config()),(0,n.l)(i),eU(e,t,{method:r,url:`/datasets/${i}`,body:s,tag:null})}let rr=["sanity.function.pubsub"],ri=["sanity.function.durable","sanity.function.pubsub","sanity.function.queue"],rn=[...new Set([...rr,...ri])];function rs(e,t,r,i,n){return(0,l.defer)(()=>{let s=e.config(),o=((e,t)=>{let r=t?.organizationId||e.organizationId;if(r)return{"X-Sanity-Scope-Type":"organization","X-Sanity-Scope-Id":r};let{projectId:i}=e;if(!i)throw Error("`functions.invoke()` requires a `projectId` to be set in the client config, or an `organizationId` for a stack deployed at organization scope");return{"X-Sanity-Scope-Type":"project","X-Sanity-Scope-Id":i}})(s,i),a=((e,t)=>{let r=t?.stackId||e.stackId;if(!r)throw Error("`functions.invoke()` requires a `stackId`, either in the client config or on the request. Function names are only unique within a stack.");return r})(s,i),u=n?.sync??!1;return e_(e,t,{method:"GET",url:`/blueprints/stacks/${a}`,headers:o,signal:i?.signal}).pipe((0,p.map)(e=>{let t=(e?.resources||[]).find(e=>e.type?.startsWith("sanity.function.")&&e.name===r);if(!t)throw Error(`Function "${r}" not found in stack "${a}"`);if(!t.externalId)throw Error(`Function "${r}" is declared in stack "${a}" but is not deployed`);if(!rn.includes(t.type))throw Error(`Function invocation is not supported for ${t.type}`);if(u&&!rr.includes(t.type))throw Error(`Synchronous function invocation is not supported for ${t.type}`);if(!u&&!ri.includes(t.type))throw Error(`Asynchronous function invocation is not supported for ${t.type}`);return t.externalId})).pipe((0,m.mergeMap)(r=>e_(e,t,{method:"POST",url:`/functions/${r}/invoke${u?"?sync=true":""}`,headers:o,body:{event:{data:i?.event?.data??{}}},timeout:i?.timeout,signal:i?.signal})))})}var ro=new WeakMap,ra=new WeakMap,ru=class{constructor(e,t){Q(this,ro,void 0),Q(this,ra,void 0),Y(ro,this,e),Y(ra,this,t)}invoke(e,t,r){return rs(J(ro,this),J(ra,this),e,t,r)}},rc=new WeakMap,rl=new WeakMap,rh=class{constructor(e,t){Q(this,rc,void 0),Q(this,rl,void 0),Y(rc,this,e),Y(rl,this,t)}invoke(e,t,r){return(0,f.lastValueFrom)(rs(J(rc,this),J(rl,this),e,t,r))}},rd=new WeakMap,rf=new WeakMap,rp=class{constructor(e,t){Q(this,rd,void 0),Q(this,rf,void 0),Y(rd,this,e),Y(rf,this,t)}getPlaybackInfo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=J(rd,this).config(),i=(r.resource||r["~experimental_resource"])?.id,{instanceId:n,library
8Id:s}=rb(e),o=s||i;if(!o)throw 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");let a=rw(n,o),u=rE(t);return e_(J(rd,this),J(rf,this),{method:"GET",url:a,query:u})}},rg=new WeakMap,rm=new WeakMap,rv=class{constructor(e,t){Q(this,rg,void 0),Q(this,rm,void 0),Y(rg,this,e),Y(rm,this,t)}getPlaybackInfo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=J(rg,this).config(),i=(r.resource||r["~experimental_resource"])?.id,{instanceId:n,libraryId:s}=rb(e),o=s||i;if(!o)throw 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");let a=rw(n,o),u=rE(t);return eU(J(rg,this),J(rm,this),{method:"GET",url:a,query:u})}};let ry=/^media-library:(ml[^:]+):([^:]+)$/;function rb(e){let t="object"==typeof e&&"_ref"in e?e._ref:e,r=ry.exec(t);if(r){let[,e,t]=r;return{libraryId:e,instanceId:t}}if("string"==typeof e&&e.startsWith("video-"))return{instanceId:e};throw Error(`Invalid video asset instance identifier "${t}": must be a valid video instance id or a Global Dataset Reference (GDR) to the video asset in the Media Library`)}function rw(e,t){return`/media-libraries/${t}/video/${e}/playback-info`}function rE(e){let t={};if(e.transformations){let{thumbnail:r,animated:i,storyboard:n}=e.transformations;r&&(r.width&&(t.thumbnailWidth=r.width),r.height&&(t.thumbnailHeight=r.height),void 0!==r.time&&(t.thumbnailTime=r.time),r.fit&&(t.thumbnailFit=r.fit),r.format&&(t.thumbnailFormat=r.format)),i&&(i.width&&(t.animatedWidth=i.width),i.height&&(t.animatedHeight=i.height),void 0!==i.start&&(t.animatedStart=i.start),void 0!==i.end&&(t.animatedEnd=i.end),i.fps&&(t.animatedFps=i.fps),i.format&&(t.animatedFormat=i.format)),n&&n.format&&(t.storyboardFormat=n.format)}return e.expiration&&(t.expiration=e.expiration),t}var rI=new WeakMap,r$=new WeakMap,rC=class{constructor(e,t){Q(this,rI,void 0),Q(this,r$,void 0),Y(rI,this,e),Y(r$,this,t)}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.includeFeatures===!1&&(t.includeFeatures="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership&&(t.onlyExplicitMembership="true"),e_(J(rI,this),J(r$,this),{url:"/projects",query:t})}getById(e){return e_(J(rI,this),J(r$,this),{url:`/projects/${e}`})}},rT=new WeakMap,rS=new WeakMap,rA=class{constructor(e,t){Q(this,rT,void 0),Q(this,rS,void 0),Y(rT,this,e),Y(rS,this,t)}list(e){let t={};return e?.includeMembers===!1&&(t.includeMembers="false"),e?.includeFeatures===!1&&(t.includeFeatures="false"),e?.organizationId&&(t.organizationId=e.organizationId),e?.onlyExplicitMembership&&(t.onlyExplicitMembership="true"),eU(J(rT,this),J(rS,this),{url:"/projects",query:t})}getById(e){return eU(J(rT,this),J(rS,this),{url:`/projects/${e}`})}};function rx(){let e="";for(;e.length<8;)for(let t of crypto.getRandomValues(new Uint8Array(8-e.length))){let r=63&t;r<62&&(e+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[r])}return e}let rO=(e,t)=>t?(0,T.getVersionId)(e,t):(0,I.getDraftId)(e);function rk(e,t){let{releaseId:r,publishedId:i,document:s}=t;if(i&&s._id){let e=rO(i,r);return(0,n.b)(e,s),e}if(s._id){let t=(0,S.isDraftId)(s._id),i=(0,A.isVersionId)(s._id);if(!t&&!i)throw Error(`\`${e}()\` requires a document with an \`_id\` that is a version or draft ID`);if(r){if(t)throw Error(`\`${e}()\` was called with a document ID (\`${s._id}\`) that is a draft ID, but a release ID (\`${r}\`) was also provided.`);let i=(0,C.getVersionFromId)(s._id);if(i!==r)throw Error(`\`${e}()\` was called with a document ID (\`${s._id}\`) that is a version ID, but the release ID (\`${r}\`) does not match the document's version ID (\`${i}\`).`)}return s._id}if(i)return rO(i,r);throw Error(`\`${e}()\` requires either a publishedId or a document with an \`_id\``)}let rP=(e,t)=>{let[r,i,n]=((e,t)=>{if("object"==typeof e&&e&&("releaseId"in e||"metadata"in e)){let{releaseId:r=rx(),metadata:i={}}=e;return[r,i,t]}return[rx(),{},e]})(e,t);return{action:{actionType:"sanity.action.release.create",releaseId:r,metadata:{...i,releaseType:i.releaseType||"undecided"}},options:n}};var rj=new WeakMap,rD=new WeakMap,rM=class{constructor(e,t){Q(this,rj,void 0),Q(this,rD,void 0),Y(rj,this,e),Y(rD,this,t)}get(e,t){let{releaseId:r}=e;return ef(J(rj,this),J(rD,this),`_.releases.${r}`,t)}create(e,t){let{action:r,options:i}=rP(e,t),{releaseId:n,metadata:s}=r;return ew(J(rj,this),J(rD,this),r,i).pipe((0,p.map)(e=>({...e,releaseId:n,metadata:s})))}edit(e,t){let{releaseId:r,patch:i}=e;return ew(J(rj,this),J(rD,this),{actionType:"sanity.action.release.edit",releaseId:r,patch:i},t)}publish(e,t){let{releaseId:r}=e;return ew(J(rj,this),J(rD,this),{actionType:"sanity.action.release.publish",releaseId:r},t)}archive(e,t){let{releaseId:r}=e;return ew(J(rj,this),J(rD,this),{actionType:"sanity.action.release.archive",releaseId:r},t)}unarchive(e,t){let{releaseId:r}=e;return ew(J(rj,this),J(rD,this),{actionType:"sanity.action.release.unarchive",releaseId:r},t)}schedule(e,t){let{releaseId:r,publishAt:i}=e;return ew(J(rj,this),J(rD,this),{actionType:"sanity.action.release.schedule",releaseId:r,publishAt:i},t)}unschedule(e,t){let{releaseId:r}=e;return ew(J(rj,this),J(rD,this),{actionType:"sanity.action.release.unschedule",releaseId:r},t)}delete(e,t){let{releaseId:r}=e;return ew(J(rj,this),J(rD,this),{actionType:"sanity.action.release.delete",releaseId:r},t)}fetchDocuments(e,t){let{releaseId:r}=e;return function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return eq(i.signal,n=>eb(e,t,r,{...i,signal:n}))}(J(rj,this),J(rD,this),r,t)}},rR=new WeakMap,rq=new WeakMap,rU=class{constructor(e,t){Q(this,rR,void 0),Q(this,rq,void 0),Y(rR,this,e),Y(rq,this,t)}get(e,t){let{releaseId:r}=e;return ep(J(rR,this),J(rq,this),`_.releases.${r}`,t)}async create(e,t){let{action:r,options:i}=rP(e,t),{releaseId:n,metadata:s}=r;return{...await e$(J(rR,this),J(rq,this),r,i),releaseId:n,metadata:s}}edit(e,t){let{releaseId:r,patch:i}=e;return e$(J(rR,this),J(rq,this),{actionType:"sanity.action.release.edit",releaseId:r,patch:i},t)}publish(e,t){let{releaseId:r}=e;return e$(J(rR,this),J(rq,this),{actionType:"sanity.action.release.publish",releaseId:r},t)}archive(e,t){let{releaseId:r}=e;return e$(J(rR,this),J(rq,this),{actionType:"sanity.action.release.archive",releaseId:r},t)}unarchive(e,t){let{releaseId:r}=e;return e$(J(rR,this),J(rq,this),{actionType:"sanity.action.release.unarchive",releaseId:r},t)}schedule(e,t){let{releaseId:r,publishAt:i}=e;return e$(J(rR,this),J(rq,this),{actionType:"sanity.action.release.schedule",releaseId:r,publishAt:i},t)}unschedule(e,t){let{releaseId:r}=e;return e$(J(rR,this),J(rq,this),{actionType:"sanity.action.release.unschedule",releaseId:r},t)}delete(e,t){let{releaseId:r}=e;return e$(J(rR,this),J(rq,this),{actionType:"sanity.action.release.delete",releaseId:r},t)}fetchDocuments(e,t){let{releaseId:r}=e;return eb(J(rR,this),J(rq,this),r,t)}},r_=new WeakMap,rV=new WeakMap,rL=class{constructor(e,t){Q(this,r_,void 0),Q(this,rV,void 0),Y(r_,this,e),Y(rV,this,t)}getById(e){return e_(J(r_,this),J(rV,this),{url:`/users/${e}`})}},rW=new WeakMap,rz=new WeakMap,rF=class{constructor(e,t){Q(this,rW,void 0),Q(this,rz,void 0),Y(rW,this,e),Y(rz,this,t)}getById(e){return eU(J(rW,this),J(rz,this),{url:`/users/${e}`})}},rN=new WeakMap,rH=new WeakMap,rB=class e{constructor(e,t=n.t){(0,r.u)(this,"assets",void 0),(0,r.u)(this,"datasets",void 0),(0,r.u)(this,"live",void 0),(0,r.u)(this,"mediaLibrary",void 0),(0,r.u)(this,"projects",void 0),(0,r.u)(this,"users",void 0),(0,r.u)(this,"agent",void 0),(0,r.u)(this,"collaboration",void 0),(0,r.u)(this,"functions",void 0),(0,r.u)(this,"releases",void 0),(0,r.u)(this,"context",void 0),Q(this,rN,void 0),Q(this,rH,void 0),(0,r.u)(this,"listen",e7),this.config(t),Y(rH,this,e),this.assets=new eY(this,J(rH,this)),this.datasets=new t4(this,J(rH,this)),this.live=new t1(this),this.mediaLibrary={video:new rp(this,J(rH,this))},this.projects=new rC(this,J(rH,this)),this.users=new rL(this,J(rH,this)),this.agent={action:new eN(this,J(rH,this))},this.collaboration={comments:new tv(this,J(rH,this))},this.functions=new ru(this,J(rH,this)),this.releases=new rM(this,J(rH,this)),this.context=new tK(this,J(rH,this))}clone(){return new e(J(rH,this),this.config())}config(e){if(void 0===e)return{...J(rN,this)};if(J(rN,this)&&!1===J(rN,this).allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return Y(rN,this,(0,n.n)(e,J(rN,this)||{})),this}withConfig(t){let r=this.config();return new e(J(rH,this),{...r,...t,stega:{...r.stega,..."boolean"==typeof t?.stega?{enabled:t.stega}:t?.stega||{}}})}fetch(e,t,r){return function(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return eq(s.signal,o=>ed(e,t,r,i,n,{...s,signal:o}))}(this,J(rH,this),J(rN,this).stega,e,t,r)}getDocument(e,t){if(t?.includeAllVersions===!0)return ef(this,J(rH,this),e,{...t,includeAllVersions:!0});let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return ef(this,J(rH,this),e,r)}getDocuments(e,t){return function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return eq(i.signal,n=>ev(e,t,r,{...i,signal:n}))}(this,J(rH,this),e,t)}documentsExists(e,t){return function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return eq(i.signal,n=>ey(e,t,r,{...i,signal:n}))}(this,J(rH,this),e,t)}create(e,t){return function(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return eq(n.signal,s=>eI(e,t,r,i,{...n,signal:s}))}(this,J(rH,this),e,"create",t)}createIfNotExists(e,t){var r,i;return r=this,i=J(rH,this),eq(t?.signal,n=>eS(r,i,e,{...t,signal:n}))}createOrReplace(e,t){var r,i;return r=this,i=J(rH,this),eq(t?.signal,n=>eA(r,i,e,{...t,signal:n}))}createVersion(e,t){var r,i,n,s;let{document:o,publishedId:a,releaseId:u,baseId:c,ifBaseRevisionId:l}=e;if(!o)return r=this,i=J(rH,this),eq(t?.signal,e=>eO(r,i,a,c,u,l,{...t,signal:e}));let h=rk("createVersion",{document:o,publishedId:a,releaseId:u}),d={...o,_id:h},f=a||(0,$.getPublishedId)(o._id);return n=this,s=J(rH,this),eq(t?.signal,e=>ex(n,s,d,f,{...t,signal:e}))}delete(e,t){var r,i;return r=this,i=J(rH,this),eq(t?.signal,n=>eT(r,i,e,{...t,signal:n}))}discardVersion(e,t,r){let{releaseId:i,publishedId:n}=e,s=rO(n,i);return function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4?arguments[4]:void 0;return eq(n?.signal,s=>ek(e,t,r,i,{...n,signal:s}))}(this,J(rH,this),s,t,r)}replaceVersion(e,t){var r,i;let{document:n,publishedId:s,releaseId:o}=e,a=rk("replaceVersion",{document:n,publishedId:s,releaseId:o}),u={...n,_id:a};return r=this,i=J(rH,this),eq(t?.signal,e=>eP(r,i,u,{...t,signal:e}))}unpublishVersion(e,t){var r,i;let{releaseId:n,publishedId:s}=e,o=(0,T.getVersionId)(s,n);return r=this,i=J(rH,this),eq(t?.signal,e=>ej(r,i,o,s,{...t,signal:e}))}mutate(e,t){var r,i;return r=this,i=J(rH,this),eq(t?.signal,n=>eC(r,i,e,{...t,signal:n}))}patch(e,t){return new ee(e,t,this)}transaction(e){return new eu(e,this)}action(e,t){return ew(this,J(rH,this),e,t)}request(e){return e_(this,J(rH,this),e)}getUrl(e,t){return eL(this,e,t)}getDataUrl(e,t){return eV(this,e,t)}},rG=new WeakMap,rQ=new WeakMap,rX=class e{constructor(e,t=n.t){(0,r.u)(this,"assets",void 0),(0,r.u)(this,"datasets",void 0),(0,r.u)(this,"live",void 0),(0,r.u)(this,"mediaLibrary",void 0),(0,r.u)(this,"projects",void 0),(0,r.u)(this,"users",void 0),(0,r.u)(this,"agent",void 0),(0,r.u)(this,"collaboration",void 0),(0,r.u)(this,"functions",void 0),(0,r.u)(this,"releases",void 0),(0,r.u)(this,"context",void 0),(0,r.u)(this,"observable",void 0),Q(this,rG,void 0),Q(this,rQ,void 0),(0,r.u)(this,"listen",e7),this.config(t),Y(rQ,this,e),this.assets=new eZ(this,J(rQ,this)),this.datasets=new t9(this,J(rQ,this)),this.live=new t1(this),this.mediaLibrary={video:new rv(this,J(rQ,this))},this.projects=new rA(this,J(rQ,this)),this.users=new rF(this,J(rQ,this)),this.agent={action:new eG(this,J(rQ,this))},this.collaboration={comments:new tw(this,J(rQ,this))},this.functions=new rh(this,J(rQ,this)),this.releases=new rU(this,J(rQ,this)),this.context=new tB(this,J(rQ,this)),this.observable=new rB(e,t)}clone(){return new e(J(rQ,this),this.config())}config(e){if(void 0===e)return{...J(rG,this)};if(J(rG,this)&&!1===J(rG,this).allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(e),Y(rG,this,(0,n.n)(e,J(rG,this)||{})),this}withConfig(t){let r=this.config();return new e(J(rQ,this),{...r,...t,stega:{...r.stega,..."boolean"==typeof t?.stega?{enabled:t.stega}:t?.stega||{}}})}fetch(e,t,r){return ed(this,J(rQ,this),J(rG,this).stega,e,t,r)}getDocument(e,t){if(t?.includeAllVersions===!0)return ep(this,J(rQ,this),e,{...t,includeAllVersions:!0});let r={signal:t?.signal,tag:t?.tag,releaseId:t?.releaseId,...t&&"includeAllVersions"in t?{includeAllVersions:!1}:{}};return ep(this,J(rQ,this),e,r)}getDocuments(e,t){return ev(this,J(rQ,this),e,t)}documentsExists(e,t){return ey(this,J(rQ,this),e,t)}create(e,t){return eI(this,J(rQ,this),e,"create",t)}createIfNotExists(e,t){return eS(this,J(rQ,this),e,t)}createOrReplace(e,t){return eA(this,J(rQ,this),e,t)}createVersion(e,t){let{document:r,publishedId:i,releaseId:n,baseId:s,ifBaseRevisionId:o}=e;if(!r)return eO(this,J(rQ,this),i,s,n,o,t);let a=rk("createVersion",{document:r,publishedId:i,releaseId:n}),u={...r,_id:a},c=i||(0,$.getPublishedId)(r._id);return ex(this,J(rQ,this),u,c,t)}delete(e,t){return eT(this,J(rQ,this),e,t)}discardVersion(e,t,r){let{releaseId:i,publishedId:n}=e,s=rO(n,i);return ek(this,J(rQ,this),s,t,r)}replaceVersion(e,t){let{document:r,publishedId:i,releaseId:n}=e,s=rk("replaceVersion",{document:r,publishedId:i,releaseId:n}),o={...r,_id:s};return eP(this,J(rQ,this),o,t)}unpublishVersion(e,t){let{releaseId:r,publishedId:i}=e,n=(0,T.getVersionId)(i,r);return ej(this,J(rQ,this),n,i,t)}mutate(e,t){return eC(this,J(rQ,this),e,t)}patch(e,t){return new er(e,t,this)}transaction(e){return new eo(e,this)}action(e,t){return e$(this,J(rQ,this),e,t)}request(e){return eU(this,J(rQ,this),e)}dataRequest(e,t,r){return eE(this,J(rQ,this),e,t,r)}getUrl(e,t){return eL(this,e,t)}getDataUrl(e,t){return eV(this,e,t)}};let rY=(t={middleware:[]},{requester:(0,r.t)(t).observable,createClient:e=>{let{observable:i,promise:n}=(0,r.t)(t,{ignoreWarnings:e.ignoreWarnings,maxRetries:e.maxRetries,retryDelay:e.retryDelay}),s=async e=>(await n({redirect:"manual",...e})).body;return new rX((e,t)=>t?t(e,s):s(e),{...e,requester:i,resolveFetch:e.resolveFetch??t.resolveFetch})}}),rJ=(rY.requester,rY.createClient);e.s(["ChannelError",0,L,"ConnectionFailedError",0,_,"DisconnectError",0,V,"createClient",0,rJ],935492)},381095,298183,e=>{"use strict";var t=e.i(544287);function r(){return(0,t.mergeAll)(1)}e.s(["concatAll",0,r],298183);var i=e.i(282519),n=e.i(187636);e.s(["concat",0,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r()((0,n.from)(e,(0,i.popScheduler)(e)))}],381095)},897275,812802,e=>{"use strict";var t=e.i(282519),r=e.i(187636);e.s(["of",0,function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=(0,t.popScheduler)(e);return(0,r.from)(e,n)}],897275);var i=e.i(827540),n=e.i(866312),s=e.i(7560),o=e.i(448971);e.s(["tap",0,function(e,t,r){var a=(0,i.isFunction)(e)||t||r?{next:e,error:t,complete:r}:e;return a?(0,n.operate)(function(e,t){null==(r=a.subscribe)||r.call(a);var r,i=!0;e.subscribe((0,s.createOperatorSubscriber)(t,function(e){var r;null==(r=a.next)||r.call(a,e),t.next(e)},function(){var e;i=!1,null==(e=a.complete)||e.call(a),t.complete()},function(e){var r;i=!1,null==(r=a.error)||r.call(a,e),t.error(e)},function(){var e,t;i&&(null==(e=a.unsubscribe)||e.call(a)),null==(t=a.finalize)||t.call(a)}))}):o.identity}],812802)},969031,e=>{"use strict";var t=e.i(516165),r=e.i(827540);e.s(["throwError",0,function(e,i){var n=(0,r.isFunction)(e)?e:function(){return e},s=function(e){return e.error(n())};return new t.Observable(i?function(e){return i.schedule(s,0,e)}:s)}])},946704,880201,e=>{"us
8e strict";var t=e.i(516165),r=e.i(83205),i=e.i(597961);function n(e){return e instanceof Date&&!isNaN(e)}e.s(["isValidDate",0,n],880201),e.s(["timer",0,function(e,s,o){void 0===e&&(e=0),void 0===o&&(o=r.async);var a=-1;return null!=s&&((0,i.isScheduler)(s)?o=s:a=s),new t.Observable(function(t){var r=n(e)?e-o.now():e;r<0&&(r=0);var i=0;return o.schedule(function(){t.closed||(t.next(i++),0<=a?this.schedule(void 0,a):t.complete())},r)})}],946704)},986838,e=>{"use strict";var t=e.i(633482),r=e.i(7560),i=e.i(866312);e.s(["catchError",0,function e(n){return(0,i.operate)(function(i,s){var o,a=null,u=!1;a=i.subscribe((0,r.createOperatorSubscriber)(s,void 0,void 0,function(r){o=(0,t.innerFrom)(n(r,e(n)(i))),a?(a.unsubscribe(),a=null,o.subscribe(s)):u=!0})),u&&(a.unsubscribe(),a=null,o.subscribe(s))})}])},819600,e=>{"use strict";var t=e.i(866312);e.s(["finalize",0,function(e){return(0,t.operate)(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}])},83205,e=>{"use strict";var t=e.i(79357),r=new(e.i(745491)).AsyncScheduler(t.AsyncAction);e.s(["async",0,r,"asyncScheduler",0,r])},987417,689431,e=>{"use strict";var t=e.i(516165),r=e.i(827540);e.s(["isObservable",0,function(e){return!!e&&(e instanceof t.Observable||(0,r.isFunction)(e.lift)&&(0,r.isFunction)(e.subscribe))}],987417);var i=e.i(501267);e.s(["lastValueFrom",0,function(e,t){var r="object"==typeof t;return new Promise(function(n,s){var o,a=!1;e.subscribe({next:function(e){o=e,a=!0},error:s,complete:function(){a?n(o):r?n(t.defaultValue):s(new i.EmptyError)}})})}],689431)}]);

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.