@coasys/ad4m-connect 0.11.2-dev-multi-user-email → 0.11.2-dev-multi-user-email-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/web.js CHANGED
@@ -1,10 +1,10 @@
1
- var fm=Object.defineProperty;var dm=Object.getOwnPropertyDescriptor;var te=(t,e,r,i)=>{for(var n=i>1?void 0:i?dm(e,r):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&fm(e,r,n),n};var re=(t,e,r)=>new Promise((i,n)=>{var a=u=>{try{s(r.next(u))}catch(c){n(c)}},o=u=>{try{s(r.throw(u))}catch(c){n(c)}},s=u=>u.done?i(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});import{ZBarSymbolType as me,ZBarConfigType as Ip,scanRGBABuffer as hm,getDefaultScanner as mm}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function gm(t,e,r,i){return new(r||(r=Promise))(function(n,a){function o(c){try{u(i.next(c))}catch(l){a(l)}}function s(c){try{u(i.throw(c))}catch(l){a(l)}}function u(c){var l;c.done?n(c.value):(l=c.value,l instanceof r?l:new r(function(d){d(l)})).then(o,s)}u((i=i.apply(t,e||[])).next())})}var M=class{constructor(e,r=Ip.ZBAR_CFG_ENABLE,i=1){this.symbolType=e,this.configType=r,this.number=i,this.configSteps=[this]}static register(e,r,i=r.symbolType){return M.formatsToConfigs[e]=r,M.typesToFormats[i]=M.typesToFormats[i]||e,r}static formats(){return Object.keys(M.formatsToConfigs)}static toFormat(e){return M.typesToFormats[e]}static configure(e,r){var i;(i=M.formatsToConfigs[r])===null||i===void 0||i.configSteps.forEach(n=>e.setConfig(n.symbolType,n.configType,n.number))}add(e){return this.configSteps.push(e),this}},Tp;M.formatsToConfigs={},M.typesToFormats={},M.register("codabar",new M(me.ZBAR_CODABAR)),M.register("code_39",new M(me.ZBAR_CODE39)),M.register("code_93",new M(me.ZBAR_CODE93)),M.register("code_128",new M(me.ZBAR_CODE128)),M.register("databar",new M(me.ZBAR_DATABAR)),M.register("databar_exp",new M(me.ZBAR_DATABAR_EXP)),M.register("ean_2",new M(me.ZBAR_EAN2)),M.register("ean_5",new M(me.ZBAR_EAN5)),M.register("ean_8",new M(me.ZBAR_EAN8)),M.register("ean_13",new M(me.ZBAR_EAN13)),M.register("ean_13+2",new M(me.ZBAR_EAN13)).add(new M(me.ZBAR_EAN2)),M.register("ean_13+5",new M(me.ZBAR_EAN13)).add(new M(me.ZBAR_EAN5)),M.register("isbn_10",new M(me.ZBAR_ISBN10)).add(new M(me.ZBAR_EAN13)),M.register("isbn_13",new M(me.ZBAR_ISBN13)).add(new M(me.ZBAR_EAN13)),M.register("isbn_13+2",new M(me.ZBAR_ISBN13)).add(new M(me.ZBAR_EAN13)).add(new M(me.ZBAR_EAN2)),M.register("isbn_13+5",new M(me.ZBAR_ISBN13)).add(new M(me.ZBAR_EAN13)).add(new M(me.ZBAR_EAN5)),M.register("itf",new M(me.ZBAR_I25)),M.register("qr_code",new M(me.ZBAR_QRCODE)),M.register("sq_code",new M(me.ZBAR_SQCODE)),M.register("upc_a",new M(me.ZBAR_UPCA)).add(new M(me.ZBAR_EAN13)),M.register("upc_e",new M(me.ZBAR_UPCE)).add(new M(me.ZBAR_EAN13)),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.UPRIGHT=0]="UPRIGHT",t[t.ROTATED_RIGHT=1]="ROTATED_RIGHT",t[t.UPSIDE_DOWN=2]="UPSIDE_DOWN",t[t.ROTATED_LEFT=3]="ROTATED_LEFT"}(Tp||(Tp={}));var xc=class{},ym=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Nr=class{constructor(e={}){if(e.formats!==void 0){if(!Array.isArray(e.formats)||!e.formats.length)throw new TypeError(`Barcode formats should be a non-empty array of strings but are: ${JSON.stringify(e)}`);let r=e.formats.filter(i=>!M.formats().includes(i));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||M.formats(),this.zbarConfig=e.zbar||new xc}static getSupportedFormats(){return Promise.resolve(M.formats())}detect(e){if(!Nr.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=Nr.intrinsicDimensions(e);if(r.width===0||r.height===0)return Promise.resolve([]);try{return Promise.all([this.toImageData(e),this.getScanner()]).then(i=>{let n=i[0],a=i[1];return this.zbarConfig.enableCache!==void 0&&a.enableCache(this.zbarConfig.enableCache),hm(n.data,n.width,n.height,a)}).then(i=>i.map(n=>this.toBarcodeDetectorResult(n)))}catch(i){return Promise.reject(i)}}getScanner(){return new Promise((e,r)=>gm(this,void 0,void 0,function*(){if(!this.scanner){let i=yield mm();this.formats.length>0&&(i.setConfig(me.ZBAR_NONE,Ip.ZBAR_CFG_ENABLE,0),this.formats.forEach(n=>M.configure(i,n))),this.scanner=i}e(this.scanner)}))}toImageData(e){let r=i=>{let n=Nr.intrinsicDimensions(i);this.canvas&&this.canvas.width===n.width&&this.canvas.height===n.height||(this.canvas=function(s,u){if(ym)return new OffscreenCanvas(s,u);{let c=document.createElement("canvas");return c.width=s,c.height=u,c}}(n.width,n.height));let a=this.canvas,o=a.getContext("2d");return o.drawImage(i,0,0),o.getImageData(0,0,a.width,a.height)};if(e instanceof ImageData)return Promise.resolve(e);if(e instanceof Blob){let i=document.createElement("img");return i.src=URL.createObjectURL(e),i.decode().then(()=>r(i)).finally(()=>URL.revokeObjectURL(i.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(r(e))}toBarcodeDetectorResult(e){let r={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(i=>{r.minX=Math.min(r.minX,i.x),r.maxX=Math.max(r.maxX,i.x),r.minY=Math.min(r.minY,i.y),r.maxY=Math.max(r.maxY,i.y)}),{format:M.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:r.minX,y:r.minY,width:r.maxX-r.minX,height:r.maxY-r.minY}),cornerPoints:[{x:r.minX,y:r.minY},{x:r.maxX,y:r.minY},{x:r.maxX,y:r.maxY},{x:r.minX,y:r.maxY}]}}static isImageBitmapSource(e){return e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof Blob||e instanceof ImageData||e instanceof CanvasRenderingContext2D||e instanceof ImageBitmap||e&&e.width==0||e&&e.height==0}static intrinsicDimensions(e){return{width:Number(e.naturalWidth||e.videoWidth||e.width),height:Number(e.naturalHeight||e.videoHeight||e.height)}}};var ko=window,To=ko.ShadowRoot&&(ko.ShadyCSS===void 0||ko.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ac=Symbol(),Op=new WeakMap,ia=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Ac)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(To&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=Op.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Op.set(r,e))}return e}toString(){return this.cssText}},Dp=t=>new ia(typeof t=="string"?t:t+"",void 0,Ac),kc=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((i,n,a)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[a+1],t[0]);return new ia(r,t,Ac)},Tc=(t,e)=>{To?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let i=document.createElement("style"),n=ko.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)})},Io=To?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return Dp(r)})(t):t;var Ic,Oo=window,Np=Oo.trustedTypes,vm=Np?Np.emptyScript:"",Rp=Oo.reactiveElementPolyfillSupport,Dc={toAttribute(t,e){switch(e){case Boolean:t=t?vm:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Pp=(t,e)=>e!==t&&(e==e||t==t),Oc={attribute:!0,type:String,converter:Dc,reflect:!1,hasChanged:Pp},Nc="finalized",gr=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((r,i)=>{let n=this._$Ep(i,r);n!==void 0&&(this._$Ev.set(n,i),e.push(n))}),e}static createProperty(e,r=Oc){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){let i=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(n){let a=this[e];this[r]=n,this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Oc}static finalize(){if(this.hasOwnProperty(Nc))return!1;this[Nc]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let n of i)this.createProperty(n,r[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)r.unshift(Io(n))}else e!==void 0&&r.push(Io(e));return r}static _$Ep(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;let r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Tc(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=Oc){var n;let a=this.constructor._$Ep(e,i);if(a!==void 0&&i.reflect===!0){let o=(((n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?i.converter:Dc).toAttribute(r,i.type);this._$El=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(e,r){var i;let n=this.constructor,a=n._$Ev.get(e);if(a!==void 0&&this._$El!==a){let o=n.getPropertyOptions(a),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:Dc;this._$El=a,this[a]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,i){let n=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||Pp)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,a)=>this[a]=n),this._$Ei=void 0);let r=!1,i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var a;return(a=n.hostUpdate)===null||a===void 0?void 0:a.call(n)}),this.update(i)):this._$Ek()}catch(n){throw r=!1,this._$Ek(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var n;return(n=i.hostUpdated)===null||n===void 0?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};gr[Nc]=!0,gr.elementProperties=new Map,gr.elementStyles=[],gr.shadowRootOptions={mode:"open"},Rp?.({ReactiveElement:gr}),((Ic=Oo.reactiveElementVersions)!==null&&Ic!==void 0?Ic:Oo.reactiveElementVersions=[]).push("1.6.3");var Rc,Do=window,fn=Do.trustedTypes,$p=fn?fn.createPolicy("lit-html",{createHTML:t=>t}):void 0,$c="$lit$",Rr=`lit$${(Math.random()+"").slice(9)}$`,Bp="?"+Rr,bm=`<${Bp}>`,mi=document,aa=()=>mi.createComment(""),oa=t=>t===null||typeof t!="object"&&typeof t!="function",Vp=Array.isArray,_m=t=>Vp(t)||typeof t?.[Symbol.iterator]=="function",Pc=`[
1
+ var fm=Object.defineProperty;var dm=Object.getOwnPropertyDescriptor;var te=(t,e,r,i)=>{for(var n=i>1?void 0:i?dm(e,r):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&fm(e,r,n),n};var re=(t,e,r)=>new Promise((i,n)=>{var a=u=>{try{s(r.next(u))}catch(c){n(c)}},o=u=>{try{s(r.throw(u))}catch(c){n(c)}},s=u=>u.done?i(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});import{ZBarSymbolType as me,ZBarConfigType as Ip,scanRGBABuffer as hm,getDefaultScanner as mm}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function gm(t,e,r,i){return new(r||(r=Promise))(function(n,a){function o(c){try{u(i.next(c))}catch(l){a(l)}}function s(c){try{u(i.throw(c))}catch(l){a(l)}}function u(c){var l;c.done?n(c.value):(l=c.value,l instanceof r?l:new r(function(d){d(l)})).then(o,s)}u((i=i.apply(t,e||[])).next())})}var M=class{constructor(e,r=Ip.ZBAR_CFG_ENABLE,i=1){this.symbolType=e,this.configType=r,this.number=i,this.configSteps=[this]}static register(e,r,i=r.symbolType){return M.formatsToConfigs[e]=r,M.typesToFormats[i]=M.typesToFormats[i]||e,r}static formats(){return Object.keys(M.formatsToConfigs)}static toFormat(e){return M.typesToFormats[e]}static configure(e,r){var i;(i=M.formatsToConfigs[r])===null||i===void 0||i.configSteps.forEach(n=>e.setConfig(n.symbolType,n.configType,n.number))}add(e){return this.configSteps.push(e),this}},Tp;M.formatsToConfigs={},M.typesToFormats={},M.register("codabar",new M(me.ZBAR_CODABAR)),M.register("code_39",new M(me.ZBAR_CODE39)),M.register("code_93",new M(me.ZBAR_CODE93)),M.register("code_128",new M(me.ZBAR_CODE128)),M.register("databar",new M(me.ZBAR_DATABAR)),M.register("databar_exp",new M(me.ZBAR_DATABAR_EXP)),M.register("ean_2",new M(me.ZBAR_EAN2)),M.register("ean_5",new M(me.ZBAR_EAN5)),M.register("ean_8",new M(me.ZBAR_EAN8)),M.register("ean_13",new M(me.ZBAR_EAN13)),M.register("ean_13+2",new M(me.ZBAR_EAN13)).add(new M(me.ZBAR_EAN2)),M.register("ean_13+5",new M(me.ZBAR_EAN13)).add(new M(me.ZBAR_EAN5)),M.register("isbn_10",new M(me.ZBAR_ISBN10)).add(new M(me.ZBAR_EAN13)),M.register("isbn_13",new M(me.ZBAR_ISBN13)).add(new M(me.ZBAR_EAN13)),M.register("isbn_13+2",new M(me.ZBAR_ISBN13)).add(new M(me.ZBAR_EAN13)).add(new M(me.ZBAR_EAN2)),M.register("isbn_13+5",new M(me.ZBAR_ISBN13)).add(new M(me.ZBAR_EAN13)).add(new M(me.ZBAR_EAN5)),M.register("itf",new M(me.ZBAR_I25)),M.register("qr_code",new M(me.ZBAR_QRCODE)),M.register("sq_code",new M(me.ZBAR_SQCODE)),M.register("upc_a",new M(me.ZBAR_UPCA)).add(new M(me.ZBAR_EAN13)),M.register("upc_e",new M(me.ZBAR_UPCE)).add(new M(me.ZBAR_EAN13)),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.UPRIGHT=0]="UPRIGHT",t[t.ROTATED_RIGHT=1]="ROTATED_RIGHT",t[t.UPSIDE_DOWN=2]="UPSIDE_DOWN",t[t.ROTATED_LEFT=3]="ROTATED_LEFT"}(Tp||(Tp={}));var xc=class{},ym=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Nr=class{constructor(e={}){if(e.formats!==void 0){if(!Array.isArray(e.formats)||!e.formats.length)throw new TypeError(`Barcode formats should be a non-empty array of strings but are: ${JSON.stringify(e)}`);let r=e.formats.filter(i=>!M.formats().includes(i));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||M.formats(),this.zbarConfig=e.zbar||new xc}static getSupportedFormats(){return Promise.resolve(M.formats())}detect(e){if(!Nr.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=Nr.intrinsicDimensions(e);if(r.width===0||r.height===0)return Promise.resolve([]);try{return Promise.all([this.toImageData(e),this.getScanner()]).then(i=>{let n=i[0],a=i[1];return this.zbarConfig.enableCache!==void 0&&a.enableCache(this.zbarConfig.enableCache),hm(n.data,n.width,n.height,a)}).then(i=>i.map(n=>this.toBarcodeDetectorResult(n)))}catch(i){return Promise.reject(i)}}getScanner(){return new Promise((e,r)=>gm(this,void 0,void 0,function*(){if(!this.scanner){let i=yield mm();this.formats.length>0&&(i.setConfig(me.ZBAR_NONE,Ip.ZBAR_CFG_ENABLE,0),this.formats.forEach(n=>M.configure(i,n))),this.scanner=i}e(this.scanner)}))}toImageData(e){let r=i=>{let n=Nr.intrinsicDimensions(i);this.canvas&&this.canvas.width===n.width&&this.canvas.height===n.height||(this.canvas=function(s,u){if(ym)return new OffscreenCanvas(s,u);{let c=document.createElement("canvas");return c.width=s,c.height=u,c}}(n.width,n.height));let a=this.canvas,o=a.getContext("2d");return o.drawImage(i,0,0),o.getImageData(0,0,a.width,a.height)};if(e instanceof ImageData)return Promise.resolve(e);if(e instanceof Blob){let i=document.createElement("img");return i.src=URL.createObjectURL(e),i.decode().then(()=>r(i)).finally(()=>URL.revokeObjectURL(i.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(r(e))}toBarcodeDetectorResult(e){let r={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(i=>{r.minX=Math.min(r.minX,i.x),r.maxX=Math.max(r.maxX,i.x),r.minY=Math.min(r.minY,i.y),r.maxY=Math.max(r.maxY,i.y)}),{format:M.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:r.minX,y:r.minY,width:r.maxX-r.minX,height:r.maxY-r.minY}),cornerPoints:[{x:r.minX,y:r.minY},{x:r.maxX,y:r.minY},{x:r.maxX,y:r.maxY},{x:r.minX,y:r.maxY}]}}static isImageBitmapSource(e){return e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof Blob||e instanceof ImageData||e instanceof CanvasRenderingContext2D||e instanceof ImageBitmap||e&&e.width==0||e&&e.height==0}static intrinsicDimensions(e){return{width:Number(e.naturalWidth||e.videoWidth||e.width),height:Number(e.naturalHeight||e.videoHeight||e.height)}}};var ko=window,To=ko.ShadowRoot&&(ko.ShadyCSS===void 0||ko.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ac=Symbol(),Op=new WeakMap,ia=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Ac)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(To&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=Op.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Op.set(r,e))}return e}toString(){return this.cssText}},Dp=t=>new ia(typeof t=="string"?t:t+"",void 0,Ac),kc=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((i,n,a)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[a+1],t[0]);return new ia(r,t,Ac)},Tc=(t,e)=>{To?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let i=document.createElement("style"),n=ko.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)})},Io=To?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return Dp(r)})(t):t;var Ic,Oo=window,Np=Oo.trustedTypes,vm=Np?Np.emptyScript:"",Rp=Oo.reactiveElementPolyfillSupport,Dc={toAttribute(t,e){switch(e){case Boolean:t=t?vm:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Pp=(t,e)=>e!==t&&(e==e||t==t),Oc={attribute:!0,type:String,converter:Dc,reflect:!1,hasChanged:Pp},Nc="finalized",gr=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((r,i)=>{let n=this._$Ep(i,r);n!==void 0&&(this._$Ev.set(n,i),e.push(n))}),e}static createProperty(e,r=Oc){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){let i=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(n){let a=this[e];this[r]=n,this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Oc}static finalize(){if(this.hasOwnProperty(Nc))return!1;this[Nc]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let n of i)this.createProperty(n,r[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)r.unshift(Io(n))}else e!==void 0&&r.push(Io(e));return r}static _$Ep(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;let r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Tc(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=Oc){var n;let a=this.constructor._$Ep(e,i);if(a!==void 0&&i.reflect===!0){let o=(((n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?i.converter:Dc).toAttribute(r,i.type);this._$El=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(e,r){var i;let n=this.constructor,a=n._$Ev.get(e);if(a!==void 0&&this._$El!==a){let o=n.getPropertyOptions(a),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:Dc;this._$El=a,this[a]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,i){let n=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||Pp)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,a)=>this[a]=n),this._$Ei=void 0);let r=!1,i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var a;return(a=n.hostUpdate)===null||a===void 0?void 0:a.call(n)}),this.update(i)):this._$Ek()}catch(n){throw r=!1,this._$Ek(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var n;return(n=i.hostUpdated)===null||n===void 0?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};gr[Nc]=!0,gr.elementProperties=new Map,gr.elementStyles=[],gr.shadowRootOptions={mode:"open"},Rp?.({ReactiveElement:gr}),((Ic=Oo.reactiveElementVersions)!==null&&Ic!==void 0?Ic:Oo.reactiveElementVersions=[]).push("1.6.3");var Rc,Do=window,dn=Do.trustedTypes,$p=dn?dn.createPolicy("lit-html",{createHTML:t=>t}):void 0,$c="$lit$",Rr=`lit$${(Math.random()+"").slice(9)}$`,Bp="?"+Rr,bm=`<${Bp}>`,mi=document,aa=()=>mi.createComment(""),oa=t=>t===null||typeof t!="object"&&typeof t!="function",Vp=Array.isArray,_m=t=>Vp(t)||typeof t?.[Symbol.iterator]=="function",Pc=`[
2
2
  \f\r]`,na=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Lp=/-->/g,Fp=/>/g,di=RegExp(`>|${Pc}(?:([^\\s"'>=/]+)(${Pc}*=${Pc}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Mp=/'/g,Up=/"/g,Qp=/^(?:script|style|textarea|title)$/i,zp=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),L=zp(1),J3=zp(2),gi=Symbol.for("lit-noChange"),We=Symbol.for("lit-nothing"),jp=new WeakMap,hi=mi.createTreeWalker(mi,129,null,!1);function Wp(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return $p!==void 0?$p.createHTML(e):e}var Sm=(t,e)=>{let r=t.length-1,i=[],n,a=e===2?"<svg>":"",o=na;for(let s=0;s<r;s++){let u=t[s],c,l,d=-1,f=0;for(;f<u.length&&(o.lastIndex=f,l=o.exec(u),l!==null);)f=o.lastIndex,o===na?l[1]==="!--"?o=Lp:l[1]!==void 0?o=Fp:l[2]!==void 0?(Qp.test(l[2])&&(n=RegExp("</"+l[2],"g")),o=di):l[3]!==void 0&&(o=di):o===di?l[0]===">"?(o=n??na,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?di:l[3]==='"'?Up:Mp):o===Up||o===Mp?o=di:o===Lp||o===Fp?o=na:(o=di,n=void 0);let p=o===di&&t[s+1].startsWith("/>")?" ":"";a+=o===na?u+bm:d>=0?(i.push(c),u.slice(0,d)+$c+u.slice(d)+Rr+p):u+Rr+(d===-2?(i.push(void 0),s):p)}return[Wp(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),i]},yi=class{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[c,l]=Sm(e,r);if(this.el=yi.createElement(c,i),hi.currentNode=this.el.content,r===2){let d=this.el.content,f=d.firstChild;f.remove(),d.append(...f.childNodes)}for(;(n=hi.nextNode())!==null&&u.length<s;){if(n.nodeType===1){if(n.hasAttributes()){let d=[];for(let f of n.getAttributeNames())if(f.endsWith($c)||f.startsWith(Rr)){let p=l[o++];if(d.push(f),p!==void 0){let h=n.getAttribute(p.toLowerCase()+$c).split(Rr),m=/([.?@])?(.*)/.exec(p);u.push({type:1,index:a,name:m[2],strings:h,ctor:m[1]==="."?Fc:m[1]==="?"?Mc:m[1]==="@"?Uc:hn})}else u.push({type:6,index:a})}for(let f of d)n.removeAttribute(f)}if(Qp.test(n.tagName)){let d=n.textContent.split(Rr),f=d.length-1;if(f>0){n.textContent=fn?fn.emptyScript:"";for(let p=0;p<f;p++)n.append(d[p],aa()),hi.nextNode(),u.push({type:2,index:++a});n.append(d[f],aa())}}}else if(n.nodeType===8)if(n.data===Bp)u.push({type:2,index:a});else{let d=-1;for(;(d=n.data.indexOf(Rr,d+1))!==-1;)u.push({type:7,index:a}),d+=Rr.length-1}a++}}static createElement(e,r){let i=mi.createElement("template");return i.innerHTML=e,i}};function dn(t,e,r=t,i){var n,a,o,s;if(e===gi)return e;let u=i!==void 0?(n=r._$Co)===null||n===void 0?void 0:n[i]:r._$Cl,c=oa(e)?void 0:e._$litDirective$;return u?.constructor!==c&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),c===void 0?u=void 0:(u=new c(t),u._$AT(t,r,i)),i!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[i]=u:r._$Cl=u),u!==void 0&&(e=dn(t,u._$AS(t,e.values),u,i)),e}var Lc=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;let{el:{content:i},parts:n}=this._$AD,a=((r=e?.creationScope)!==null&&r!==void 0?r:mi).importNode(i,!0);hi.currentNode=a;let o=hi.nextNode(),s=0,u=0,c=n[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new vi(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new jc(o,this,e)),this._$AV.push(l),c=n[++u]}s!==c?.index&&(o=hi.nextNode(),s++)}return hi.currentNode=mi,a}v(e){let r=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}},vi=class{constructor(e,r,i,n){var a;this.type=2,this._$AH=We,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=n,this._$Cp=(a=n?.isConnected)===null||a===void 0||a}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=dn(this,e,r),oa(e)?e===We||e==null||e===""?(this._$AH!==We&&this._$AR(),this._$AH=We):e!==this._$AH&&e!==gi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):_m(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==We&&oa(this._$AH)?this._$AA.nextSibling.data=e:this.$(mi.createTextNode(e)),this._$AH=e}g(e){var r;let{values:i,_$litType$:n}=e,a=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=yi.createElement(Wp(n.h,n.h[0]),this.options)),n);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===a)this._$AH.v(i);else{let o=new Lc(a,this),s=o.u(this.options);o.v(i),this.$(s),this._$AH=o}}_$AC(e){let r=jp.get(e.strings);return r===void 0&&jp.set(e.strings,r=new yi(e)),r}T(e){Vp(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,i,n=0;for(let a of e)n===r.length?r.push(i=new vi(this.k(aa()),this.k(aa()),this,this.options)):i=r[n],i._$AI(a),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,r);e&&e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}},hn=class{constructor(e,r,i,n,a){this.type=1,this._$AH=We,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=We}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,n){let a=this.strings,o=!1;if(a===void 0)e=dn(this,e,r,0),o=!oa(e)||e!==this._$AH&&e!==gi,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=dn(this,s[i+u],r,u),c===gi&&(c=this._$AH[u]),o||(o=!oa(c)||c!==this._$AH[u]),c===We?e=We:e!==We&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!n&&this.j(e)}j(e){e===We?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Fc=class extends hn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===We?void 0:e}},wm=fn?fn.emptyScript:"",Mc=class extends hn{constructor(){super(...arguments),this.type=4}j(e){e&&e!==We?this.element.setAttribute(this.name,wm):this.element.removeAttribute(this.name)}},Uc=class extends hn{constructor(e,r,i,n,a){super(e,r,i,n,a),this.type=5}_$AI(e,r=this){var i;if((e=(i=dn(this,e,r,0))!==null&&i!==void 0?i:We)===gi)return;let n=this._$AH,a=e===We&&n!==We||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,o=e!==We&&(n===We||a);a&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,i;typeof this._$AH=="function"?this._$AH.call((i=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&i!==void 0?i:this.element,e):this._$AH.handleEvent(e)}},jc=class{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){dn(this,e)}};var qp=Do.litHtmlPolyfillSupport;qp?.(yi,vi),((Rc=Do.litHtmlVersions)!==null&&Rc!==void 0?Rc:Do.litHtmlVersions=[]).push("2.8.0");var Hp=(t,e,r)=>{var i,n;let a=(i=r?.renderBefore)!==null&&i!==void 0?i:e,o=a._$litPart$;if(o===void 0){let s=(n=r?.renderBefore)!==null&&n!==void 0?n:null;a._$litPart$=o=new vi(e.insertBefore(aa(),s),s,void 0,r??{})}return o._$AI(t),o};var qc,Bc;var Pr=class extends gr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Hp(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return gi}};Pr.finalized=!0,Pr._$litElement$=!0,(qc=globalThis.litElementHydrateSupport)===null||qc===void 0||qc.call(globalThis,{LitElement:Pr});var Gp=globalThis.litElementPolyfillSupport;Gp?.({LitElement:Pr});((Bc=globalThis.litElementVersions)!==null&&Bc!==void 0?Bc:globalThis.litElementVersions=[]).push("3.3.3");var Kp=t=>e=>typeof e=="function"?((r,i)=>(customElements.define(r,i),i))(t,e):((r,i)=>{let{kind:n,elements:a}=i;return{kind:n,elements:a,finisher(o){customElements.define(r,o)}}})(t,e);var Cm=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},Em=(t,e,r)=>{e.constructor.createProperty(r,t)};function st(t){return(e,r)=>r!==void 0?Em(t,e,r):Cm(t,e)}function Ee(t){return st({...t,state:!0})}var Vc,Eb=((Vc=window.HTMLSlotElement)===null||Vc===void 0?void 0:Vc.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var Qc=function(t,e){return Qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},Qc(t,e)};function Re(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Qc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var C=function(){return C=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},C.apply(this,arguments)};function Yt(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function Bt(t,e,r,i){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{c(i.next(l))}catch(d){o(d)}}function u(l){try{c(i.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):n(l.value).then(s,u)}c((i=i.apply(t,e||[])).next())})}function Vt(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return u([c,l])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(a=c[0]&2?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],n=0}finally{i=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function $r(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,a;i<n;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))}var zc="Invariant Violation",Zp=Object.setPrototypeOf,xm=Zp===void 0?function(t,e){return t.__proto__=e,t}:Zp,Z=function(t){Re(e,t);function e(r){r===void 0&&(r=zc);var i=t.call(this,typeof r=="number"?zc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return i.framesToPop=1,i.name=zc,xm(i,e.prototype),i}return e}(Error);function $(t,e){if(!t)throw new Z(e)}var Ro=["debug","log","warn","error","silent"],Wc=Ro.indexOf("log");function No(t){return function(){if(Ro.indexOf(t)>=Wc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=No("debug"),t.log=No("log"),t.warn=No("warn"),t.error=No("error")})($||($={}));function Jp(t){var e=Ro[Wc];return Wc=Math.max(0,Ro.indexOf(t)),e}function He(t){try{return t()}catch{}}var Po=He(function(){return globalThis})||He(function(){return window})||He(function(){return self})||He(function(){return global})||He(function(){return He.constructor("return this")()});var Yp="__",Xp=[Yp,Yp].join("DEV");function Am(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Po,Xp,{value:He(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Po[Xp]}}var bi=Am();function Lr(t){try{return t()}catch{}}var Hc=Lr(function(){return globalThis})||Lr(function(){return window})||Lr(function(){return self})||Lr(function(){return global})||Lr(function(){return Lr.constructor("return this")()}),Gc=!1;function km(){Hc&&!Lr(function(){return"production"})&&!Lr(function(){return process})&&(Object.defineProperty(Hc,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Gc=!0)}km();function Kc(){Gc&&(delete Hc.process,Gc=!1)}var Zb=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",Jb=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",ef=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Me=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Zc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Tm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,ca=Tm;function $o(t){var e=t.prototype.toJSON;typeof e=="function"||Zc(0),t.prototype.inspect=e,ca&&(t.prototype[ca]=e)}var tf=function(){function t(r,i,n){this.start=r.start,this.end=i.end,this.startToken=r,this.endToken=i,this.source=n}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();$o(tf);var rf=function(){function t(r,i,n,a,o,s,u){this.kind=r,this.start=i,this.end=n,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();$o(rf);function Jc(t){return t!=null&&typeof t.kind=="string"}function Lo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Lo=function(r){return typeof r}:Lo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Lo(t)}var Im=10,nf=2;function ua(t){return Fo(t,[])}function Fo(t,e){switch(Lo(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Om(t,e);default:return String(t)}}function Om(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),i=Rm(t);if(i!==void 0){var n=i.call(t);if(n!==t)return typeof n=="string"?n:Fo(n,r)}else if(Array.isArray(t))return Nm(t,r);return Dm(t,r)}function Dm(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>nf)return"["+Pm(t)+"]";var i=r.map(function(n){var a=Fo(t[n],e);return n+": "+a});return"{ "+i.join(", ")+" }"}function Nm(t,e){if(t.length===0)return"[]";if(e.length>nf)return"[Array]";for(var r=Math.min(Im,t.length),i=t.length-r,n=[],a=0;a<r;++a)n.push(Fo(t[a],e));return i===1?n.push("... 1 more item"):i>1&&n.push("... ".concat(i," more items")),"["+n.join(", ")+"]"}function Rm(t){var e=t[String(ca)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Pm(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function la(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function af(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function $m(t,e,r){return e&&af(t.prototype,e),r&&af(t,r),t}var Mo=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||la(0,"Body must be a string. Received: ".concat(ua(e),".")),this.body=e,this.name=r,this.locationOffset=i,this.locationOffset.line>0||la(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||la(0,"column in locationOffset is 1-indexed and must be positive.")}return $m(t,[{key:ef,get:function(){return"Source"}}]),t}();function of(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=t.indexOf(`
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Mp=/'/g,Up=/"/g,Qp=/^(?:script|style|textarea|title)$/i,zp=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),L=zp(1),J3=zp(2),gi=Symbol.for("lit-noChange"),We=Symbol.for("lit-nothing"),jp=new WeakMap,hi=mi.createTreeWalker(mi,129,null,!1);function Wp(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return $p!==void 0?$p.createHTML(e):e}var Sm=(t,e)=>{let r=t.length-1,i=[],n,a=e===2?"<svg>":"",o=na;for(let s=0;s<r;s++){let u=t[s],c,l,d=-1,f=0;for(;f<u.length&&(o.lastIndex=f,l=o.exec(u),l!==null);)f=o.lastIndex,o===na?l[1]==="!--"?o=Lp:l[1]!==void 0?o=Fp:l[2]!==void 0?(Qp.test(l[2])&&(n=RegExp("</"+l[2],"g")),o=di):l[3]!==void 0&&(o=di):o===di?l[0]===">"?(o=n??na,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?di:l[3]==='"'?Up:Mp):o===Up||o===Mp?o=di:o===Lp||o===Fp?o=na:(o=di,n=void 0);let p=o===di&&t[s+1].startsWith("/>")?" ":"";a+=o===na?u+bm:d>=0?(i.push(c),u.slice(0,d)+$c+u.slice(d)+Rr+p):u+Rr+(d===-2?(i.push(void 0),s):p)}return[Wp(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),i]},yi=class{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[c,l]=Sm(e,r);if(this.el=yi.createElement(c,i),hi.currentNode=this.el.content,r===2){let d=this.el.content,f=d.firstChild;f.remove(),d.append(...f.childNodes)}for(;(n=hi.nextNode())!==null&&u.length<s;){if(n.nodeType===1){if(n.hasAttributes()){let d=[];for(let f of n.getAttributeNames())if(f.endsWith($c)||f.startsWith(Rr)){let p=l[o++];if(d.push(f),p!==void 0){let h=n.getAttribute(p.toLowerCase()+$c).split(Rr),m=/([.?@])?(.*)/.exec(p);u.push({type:1,index:a,name:m[2],strings:h,ctor:m[1]==="."?Fc:m[1]==="?"?Mc:m[1]==="@"?Uc:mn})}else u.push({type:6,index:a})}for(let f of d)n.removeAttribute(f)}if(Qp.test(n.tagName)){let d=n.textContent.split(Rr),f=d.length-1;if(f>0){n.textContent=dn?dn.emptyScript:"";for(let p=0;p<f;p++)n.append(d[p],aa()),hi.nextNode(),u.push({type:2,index:++a});n.append(d[f],aa())}}}else if(n.nodeType===8)if(n.data===Bp)u.push({type:2,index:a});else{let d=-1;for(;(d=n.data.indexOf(Rr,d+1))!==-1;)u.push({type:7,index:a}),d+=Rr.length-1}a++}}static createElement(e,r){let i=mi.createElement("template");return i.innerHTML=e,i}};function hn(t,e,r=t,i){var n,a,o,s;if(e===gi)return e;let u=i!==void 0?(n=r._$Co)===null||n===void 0?void 0:n[i]:r._$Cl,c=oa(e)?void 0:e._$litDirective$;return u?.constructor!==c&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),c===void 0?u=void 0:(u=new c(t),u._$AT(t,r,i)),i!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[i]=u:r._$Cl=u),u!==void 0&&(e=hn(t,u._$AS(t,e.values),u,i)),e}var Lc=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;let{el:{content:i},parts:n}=this._$AD,a=((r=e?.creationScope)!==null&&r!==void 0?r:mi).importNode(i,!0);hi.currentNode=a;let o=hi.nextNode(),s=0,u=0,c=n[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new vi(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new jc(o,this,e)),this._$AV.push(l),c=n[++u]}s!==c?.index&&(o=hi.nextNode(),s++)}return hi.currentNode=mi,a}v(e){let r=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}},vi=class{constructor(e,r,i,n){var a;this.type=2,this._$AH=We,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=n,this._$Cp=(a=n?.isConnected)===null||a===void 0||a}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=hn(this,e,r),oa(e)?e===We||e==null||e===""?(this._$AH!==We&&this._$AR(),this._$AH=We):e!==this._$AH&&e!==gi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):_m(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==We&&oa(this._$AH)?this._$AA.nextSibling.data=e:this.$(mi.createTextNode(e)),this._$AH=e}g(e){var r;let{values:i,_$litType$:n}=e,a=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=yi.createElement(Wp(n.h,n.h[0]),this.options)),n);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===a)this._$AH.v(i);else{let o=new Lc(a,this),s=o.u(this.options);o.v(i),this.$(s),this._$AH=o}}_$AC(e){let r=jp.get(e.strings);return r===void 0&&jp.set(e.strings,r=new yi(e)),r}T(e){Vp(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,i,n=0;for(let a of e)n===r.length?r.push(i=new vi(this.k(aa()),this.k(aa()),this,this.options)):i=r[n],i._$AI(a),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,r);e&&e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}},mn=class{constructor(e,r,i,n,a){this.type=1,this._$AH=We,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=We}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,n){let a=this.strings,o=!1;if(a===void 0)e=hn(this,e,r,0),o=!oa(e)||e!==this._$AH&&e!==gi,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=hn(this,s[i+u],r,u),c===gi&&(c=this._$AH[u]),o||(o=!oa(c)||c!==this._$AH[u]),c===We?e=We:e!==We&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!n&&this.j(e)}j(e){e===We?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Fc=class extends mn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===We?void 0:e}},wm=dn?dn.emptyScript:"",Mc=class extends mn{constructor(){super(...arguments),this.type=4}j(e){e&&e!==We?this.element.setAttribute(this.name,wm):this.element.removeAttribute(this.name)}},Uc=class extends mn{constructor(e,r,i,n,a){super(e,r,i,n,a),this.type=5}_$AI(e,r=this){var i;if((e=(i=hn(this,e,r,0))!==null&&i!==void 0?i:We)===gi)return;let n=this._$AH,a=e===We&&n!==We||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,o=e!==We&&(n===We||a);a&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,i;typeof this._$AH=="function"?this._$AH.call((i=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&i!==void 0?i:this.element,e):this._$AH.handleEvent(e)}},jc=class{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){hn(this,e)}};var qp=Do.litHtmlPolyfillSupport;qp?.(yi,vi),((Rc=Do.litHtmlVersions)!==null&&Rc!==void 0?Rc:Do.litHtmlVersions=[]).push("2.8.0");var Hp=(t,e,r)=>{var i,n;let a=(i=r?.renderBefore)!==null&&i!==void 0?i:e,o=a._$litPart$;if(o===void 0){let s=(n=r?.renderBefore)!==null&&n!==void 0?n:null;a._$litPart$=o=new vi(e.insertBefore(aa(),s),s,void 0,r??{})}return o._$AI(t),o};var qc,Bc;var Pr=class extends gr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Hp(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return gi}};Pr.finalized=!0,Pr._$litElement$=!0,(qc=globalThis.litElementHydrateSupport)===null||qc===void 0||qc.call(globalThis,{LitElement:Pr});var Gp=globalThis.litElementPolyfillSupport;Gp?.({LitElement:Pr});((Bc=globalThis.litElementVersions)!==null&&Bc!==void 0?Bc:globalThis.litElementVersions=[]).push("3.3.3");var Kp=t=>e=>typeof e=="function"?((r,i)=>(customElements.define(r,i),i))(t,e):((r,i)=>{let{kind:n,elements:a}=i;return{kind:n,elements:a,finisher(o){customElements.define(r,o)}}})(t,e);var Cm=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},Em=(t,e,r)=>{e.constructor.createProperty(r,t)};function st(t){return(e,r)=>r!==void 0?Em(t,e,r):Cm(t,e)}function Ee(t){return st({...t,state:!0})}var Vc,Eb=((Vc=window.HTMLSlotElement)===null||Vc===void 0?void 0:Vc.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var Qc=function(t,e){return Qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},Qc(t,e)};function Re(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Qc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var C=function(){return C=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},C.apply(this,arguments)};function Yt(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function Bt(t,e,r,i){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{c(i.next(l))}catch(d){o(d)}}function u(l){try{c(i.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):n(l.value).then(s,u)}c((i=i.apply(t,e||[])).next())})}function Vt(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return u([c,l])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(a=c[0]&2?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],n=0}finally{i=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function $r(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,a;i<n;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))}var zc="Invariant Violation",Zp=Object.setPrototypeOf,xm=Zp===void 0?function(t,e){return t.__proto__=e,t}:Zp,Z=function(t){Re(e,t);function e(r){r===void 0&&(r=zc);var i=t.call(this,typeof r=="number"?zc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return i.framesToPop=1,i.name=zc,xm(i,e.prototype),i}return e}(Error);function $(t,e){if(!t)throw new Z(e)}var Ro=["debug","log","warn","error","silent"],Wc=Ro.indexOf("log");function No(t){return function(){if(Ro.indexOf(t)>=Wc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=No("debug"),t.log=No("log"),t.warn=No("warn"),t.error=No("error")})($||($={}));function Jp(t){var e=Ro[Wc];return Wc=Math.max(0,Ro.indexOf(t)),e}function He(t){try{return t()}catch{}}var Po=He(function(){return globalThis})||He(function(){return window})||He(function(){return self})||He(function(){return global})||He(function(){return He.constructor("return this")()});var Yp="__",Xp=[Yp,Yp].join("DEV");function Am(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Po,Xp,{value:He(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Po[Xp]}}var bi=Am();function Lr(t){try{return t()}catch{}}var Hc=Lr(function(){return globalThis})||Lr(function(){return window})||Lr(function(){return self})||Lr(function(){return global})||Lr(function(){return Lr.constructor("return this")()}),Gc=!1;function km(){Hc&&!Lr(function(){return"production"})&&!Lr(function(){return process})&&(Object.defineProperty(Hc,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Gc=!0)}km();function Kc(){Gc&&(delete Hc.process,Gc=!1)}var Zb=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",Jb=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",ef=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Me=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Zc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Tm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,ca=Tm;function $o(t){var e=t.prototype.toJSON;typeof e=="function"||Zc(0),t.prototype.inspect=e,ca&&(t.prototype[ca]=e)}var tf=function(){function t(r,i,n){this.start=r.start,this.end=i.end,this.startToken=r,this.endToken=i,this.source=n}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();$o(tf);var rf=function(){function t(r,i,n,a,o,s,u){this.kind=r,this.start=i,this.end=n,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();$o(rf);function Jc(t){return t!=null&&typeof t.kind=="string"}function Lo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Lo=function(r){return typeof r}:Lo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Lo(t)}var Im=10,nf=2;function ua(t){return Fo(t,[])}function Fo(t,e){switch(Lo(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Om(t,e);default:return String(t)}}function Om(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),i=Rm(t);if(i!==void 0){var n=i.call(t);if(n!==t)return typeof n=="string"?n:Fo(n,r)}else if(Array.isArray(t))return Nm(t,r);return Dm(t,r)}function Dm(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>nf)return"["+Pm(t)+"]";var i=r.map(function(n){var a=Fo(t[n],e);return n+": "+a});return"{ "+i.join(", ")+" }"}function Nm(t,e){if(t.length===0)return"[]";if(e.length>nf)return"[Array]";for(var r=Math.min(Im,t.length),i=t.length-r,n=[],a=0;a<r;++a)n.push(Fo(t[a],e));return i===1?n.push("... 1 more item"):i>1&&n.push("... ".concat(i," more items")),"["+n.join(", ")+"]"}function Rm(t){var e=t[String(ca)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Pm(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function la(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function af(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function $m(t,e,r){return e&&af(t.prototype,e),r&&af(t,r),t}var Mo=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||la(0,"Body must be a string. Received: ".concat(ua(e),".")),this.body=e,this.name=r,this.locationOffset=i,this.locationOffset.line>0||la(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||la(0,"column in locationOffset is 1-indexed and must be positive.")}return $m(t,[{key:ef,get:function(){return"Source"}}]),t}();function of(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=t.indexOf(`
4
4
  `)===-1,n=t[0]===" "||t[0]===" ",a=t[t.length-1]==='"',o=t[t.length-1]==="\\",s=!i||a||o||r,u="";return s&&!(i&&n)&&(u+=`
5
5
  `+e),u+=e?t.replace(/\n/g,`
6
6
  `+e):t,s&&(u+=`
7
- `),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var Lm={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},_i=Object.freeze({});function nt(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Lm,i=void 0,n=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],f=[],p=t;do{o++;var h=o===a.length,m=h&&s.length!==0;if(h){if(c=f.length===0?void 0:d[d.length-1],u=l,l=f.pop(),m){if(n)u=u.slice();else{for(var b={},_=0,S=Object.keys(u);_<S.length;_++){var w=S[_];b[w]=u[w]}u=b}for(var v=0,D=0;D<s.length;D++){var N=s[D][0],A=s[D][1];n&&(N-=v),n&&A===null?(u.splice(N,1),v++):u[N]=A}}o=i.index,a=i.keys,s=i.edits,n=i.inArray,i=i.prev}else{if(c=l?n?o:a[o]:void 0,u=l?l[c]:p,u==null)continue;l&&d.push(c)}var R=void 0;if(!Array.isArray(u)){if(!Jc(u))throw new Error("Invalid AST Node: ".concat(ua(u),"."));var F=Yc(e,u.kind,h);if(F){if(R=F.call(e,u,c,l,d,f),R===_i)break;if(R===!1){if(!h){d.pop();continue}}else if(R!==void 0&&(s.push([c,R]),!h))if(Jc(R))u=R;else{d.pop();continue}}}if(R===void 0&&m&&s.push([c,u]),h)d.pop();else{var P;i={inArray:n,index:o,keys:a,edits:s,prev:i},n=Array.isArray(u),a=n?u:(P=r[u.kind])!==null&&P!==void 0?P:[],o=-1,s=[],l&&f.push(l),l=u}}while(i!==void 0);return s.length!==0&&(p=s[s.length-1][1]),p}function Yc(t,e,r){var i=t[e];if(i){if(!r&&typeof i=="function")return i;var n=r?i.leave:i.enter;if(typeof n=="function")return n}else{var a=r?t.leave:t.enter;if(a){if(typeof a=="function")return a;var o=a[e];if(typeof o=="function")return o}}}function mn(t){return nt(t,{leave:Mm})}var Fm=80,Mm={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return U(e.definitions,`
7
+ `),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var Lm={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},_i=Object.freeze({});function nt(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Lm,i=void 0,n=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],f=[],p=t;do{o++;var h=o===a.length,m=h&&s.length!==0;if(h){if(c=f.length===0?void 0:d[d.length-1],u=l,l=f.pop(),m){if(n)u=u.slice();else{for(var b={},_=0,S=Object.keys(u);_<S.length;_++){var w=S[_];b[w]=u[w]}u=b}for(var v=0,D=0;D<s.length;D++){var N=s[D][0],A=s[D][1];n&&(N-=v),n&&A===null?(u.splice(N,1),v++):u[N]=A}}o=i.index,a=i.keys,s=i.edits,n=i.inArray,i=i.prev}else{if(c=l?n?o:a[o]:void 0,u=l?l[c]:p,u==null)continue;l&&d.push(c)}var R=void 0;if(!Array.isArray(u)){if(!Jc(u))throw new Error("Invalid AST Node: ".concat(ua(u),"."));var F=Yc(e,u.kind,h);if(F){if(R=F.call(e,u,c,l,d,f),R===_i)break;if(R===!1){if(!h){d.pop();continue}}else if(R!==void 0&&(s.push([c,R]),!h))if(Jc(R))u=R;else{d.pop();continue}}}if(R===void 0&&m&&s.push([c,u]),h)d.pop();else{var P;i={inArray:n,index:o,keys:a,edits:s,prev:i},n=Array.isArray(u),a=n?u:(P=r[u.kind])!==null&&P!==void 0?P:[],o=-1,s=[],l&&f.push(l),l=u}}while(i!==void 0);return s.length!==0&&(p=s[s.length-1][1]),p}function Yc(t,e,r){var i=t[e];if(i){if(!r&&typeof i=="function")return i;var n=r?i.leave:i.enter;if(typeof n=="function")return n}else{var a=r?t.leave:t.enter;if(a){if(typeof a=="function")return a;var o=a[e];if(typeof o=="function")return o}}}function gn(t){return nt(t,{leave:Mm})}var Fm=80,Mm={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return U(e.definitions,`
8
8
 
9
9
  `)+`
10
10
  `},OperationDefinition:function(e){var r=e.operation,i=e.name,n=Oe("(",U(e.variableDefinitions,", "),")"),a=U(e.directives," "),o=e.selectionSet;return!i&&!a&&!n&&r==="query"?o:U([r,U([i,n]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,i=e.type,n=e.defaultValue,a=e.directives;return r+": "+i+Oe(" = ",n)+Oe(" ",U(a," "))},SelectionSet:function(e){var r=e.selections;return zt(r)},Field:function(e){var r=e.alias,i=e.name,n=e.arguments,a=e.directives,o=e.selectionSet,s=Oe("",r,": ")+i,u=s+Oe("(",U(n,", "),")");return u.length>Fm&&(u=s+Oe(`(
@@ -22,12 +22,12 @@ var fm=Object.defineProperty;var dm=Object.getOwnPropertyDescriptor;var te=(t,e,
22
22
  `)),`
23
23
  }`)}function Oe(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function Uo(t){return Oe(" ",t.replace(/\n/g,`
24
24
  `))}function Um(t){return t.indexOf(`
25
- `)!==-1}function sf(t){return t!=null&&t.some(Um)}function pa(t){return t.kind===Me.FIELD||t.kind===Me.FRAGMENT_SPREAD||t.kind===Me.INLINE_FRAGMENT}function cf(){return typeof Mo=="function"?Kc():Kc()}function Km(){__DEV__?$(typeof bi=="boolean",bi):$(typeof bi=="boolean",39)}cf();Km();function yr(t,e){var r=t.directives;return!r||!r.length?!0:uf(r).every(function(i){var n=i.directive,a=i.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?$(o!==void 0,"Invalid variable referenced in @".concat(n.name.value," directive.")):$(o!==void 0,40)):o=a.value.value,n.name.value==="skip"?!o:o})}function gn(t,e,r){var i=new Set(t),n=i.size;return nt(e,{Directive:function(a){if(i.delete(a.name.value)&&(!r||!i.size))return _i}}),r?!i.size:i.size<n}function Xc(t){return t&&gn(["client","export"],t,!0)}function Zm(t){var e=t.name.value;return e==="skip"||e==="include"}function uf(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!Zm(r)){var i=r.arguments,n=r.name.value;__DEV__?$(i&&i.length===1,"Incorrect number of arguments for the @".concat(n," directive.")):$(i&&i.length===1,41);var a=i[0];__DEV__?$(a.name&&a.name.value==="if","Invalid argument for the @".concat(n," directive.")):$(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?$(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(n," directive must be a variable or a boolean value.")):$(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function eu(t,e){var r=e,i=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new Z("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new Z(44);a.kind==="FragmentDefinition"&&i.push(a)}),typeof r>"u"&&(__DEV__?$(i.length===1,"Found ".concat(i.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):$(i.length===1,45),r=i[0].name.value);var n=C(C({},t),{definitions:$r([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return n}function Si(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function wi(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var r=t.name.value;if(typeof e=="function")return e(r);var i=e&&e[r];return __DEV__?$(i,"No fragment named ".concat(r)):$(i,46),i||null}default:return null}}function fe(t){return t!==null&&typeof t=="object"}function Xt(t){return{__ref:String(t)}}function se(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function tu(t){return fe(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Jm(t){return t.kind==="StringValue"}function Ym(t){return t.kind==="BooleanValue"}function Xm(t){return t.kind==="IntValue"}function eg(t){return t.kind==="FloatValue"}function tg(t){return t.kind==="Variable"}function rg(t){return t.kind==="ObjectValue"}function ig(t){return t.kind==="ListValue"}function ng(t){return t.kind==="EnumValue"}function ag(t){return t.kind==="NullValue"}function Fr(t,e,r,i){if(Xm(r)||eg(r))t[e.value]=Number(r.value);else if(Ym(r)||Jm(r))t[e.value]=r.value;else if(rg(r)){var n={};r.fields.map(function(o){return Fr(n,o.name,o.value,i)}),t[e.value]=n}else if(tg(r)){var a=(i||{})[r.name.value];t[e.value]=a}else if(ig(r))t[e.value]=r.values.map(function(o){var s={};return Fr(s,e,o,i),s[e.value]});else if(ng(r))t[e.value]=r.value;else if(ag(r))t[e.value]=null;else throw __DEV__?new Z('The inline argument "'.concat(e.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new Z(55)}function ru(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(n){r[n.name.value]={},n.arguments&&n.arguments.forEach(function(a){var o=a.name,s=a.value;return Fr(r[n.name.value],o,s,e)})}));var i=null;return t.arguments&&t.arguments.length&&(i={},t.arguments.forEach(function(n){var a=n.name,o=n.value;return Fr(i,a,o,e)})),da(t.name.value,i,r)}var og=["connection","include","skip","client","rest","export"],da=Object.assign(function(t,e,r){if(e&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var i=r.connection.filter?r.connection.filter:[];i.sort();var n={};return i.forEach(function(s){n[s]=e[s]}),"".concat(r.connection.key,"(").concat(fa(n),")")}else return r.connection.key;var a=t;if(e){var o=fa(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){og.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(fa(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=fa;return fa=t,e}}),fa=function(e){return JSON.stringify(e,sg)};function sg(t,e){return fe(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,i){return r[i]=e[i],r},{})),e}function vr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(i){var n=i.name,a=i.value;return Fr(r,n,a,e)}),r}return null}function Rt(t){return t.alias?t.alias.value:t.name.value}function ha(t,e,r){if(typeof t.__typename=="string")return t.__typename;for(var i=0,n=e.selections;i<n.length;i++){var a=n[i];if(Et(a)){if(a.name.value==="__typename")return t[Rt(a)]}else{var o=ha(t,wi(a,r).selectionSet,r);if(typeof o=="string")return o}}}function Et(t){return t.kind==="Field"}function iu(t){return t.kind==="InlineFragment"}function yn(t){__DEV__?$(t&&t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):$(t&&t.kind==="Document",47);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new Z('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new Z(48);return r});return __DEV__?$(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):$(e.length<=1,49),t}function er(t){return yn(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function vn(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Ci(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function ma(t){var e=er(t);return __DEV__?$(e&&e.operation==="query","Must contain a query definition."):$(e&&e.operation==="query",50),e}function nu(t){__DEV__?$(t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):$(t.kind==="Document",51),__DEV__?$(t.definitions.length<=1,"Fragment must have exactly one definition."):$(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?$(e.kind==="FragmentDefinition","Must be a fragment definition."):$(e.kind==="FragmentDefinition",53),e}function Ei(t){yn(t);for(var e,r=0,i=t.definitions;r<i.length;r++){var n=i[r];if(n.kind==="OperationDefinition"){var a=n.operation;if(a==="query"||a==="mutation"||a==="subscription")return n}n.kind==="FragmentDefinition"&&!e&&(e=n)}if(e)return e;throw __DEV__?new Z("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new Z(54)}function xi(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(i){i.defaultValue&&Fr(e,i.variable.name,i.defaultValue)}),e}var Se=Array.isArray;function qe(t){return Array.isArray(t)&&t.length>0}var lf={kind:Me.FIELD,name:{kind:Me.NAME,value:"__typename"}};function ff(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Me.FRAGMENT_SPREAD&&ff(e[r.name.value],e)})}function cg(t){return ff(er(t)||nu(t),Si(Ci(t)))?null:t}function ug(t){var e=new Set,r=[];return t.forEach(function(i){i.name?e.add(i.name):i.test&&r.push(i.test)}),function(i){return e.has(i.name.value)||r.some(function(n){return n(i)})}}function pf(t){var e=new Map;return function(i){i===void 0&&(i=t);var n=e.get(i);return n||e.set(i,n={variables:new Set,fragmentSpreads:new Set}),n}}function au(t,e){for(var r=pf(""),i=pf(""),n=function(S){for(var w=0,v=void 0;w<S.length&&(v=S[w]);++w)if(!Se(v)){if(v.kind===Me.OPERATION_DEFINITION)return r(v.name&&v.name.value);if(v.kind===Me.FRAGMENT_DEFINITION)return i(v.name.value)}return __DEV__&&$.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Me.OPERATION_DEFINITION&&++a;var s=ug(t),u=t.some(function(S){return S.remove}),c=function(S){return u&&S&&S.some(s)},l=new Map,d=!1,f={enter:function(S){if(c(S.directives))return d=!0,null}},p=nt(e,{Field:f,InlineFragment:f,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(S,w,v,D,N){var A=n(N);A&&A.variables.add(S.name.value)}},FragmentSpread:{enter:function(S,w,v,D,N){if(c(S.directives))return d=!0,null;var A=n(N);A&&A.fragmentSpreads.add(S.name.value)}},FragmentDefinition:{enter:function(S,w,v,D){l.set(JSON.stringify(D),S)},leave:function(S,w,v,D){var N=l.get(JSON.stringify(D));if(S===N)return S;if(a>0&&S.selectionSet.selections.every(function(A){return A.kind===Me.FIELD&&A.name.value==="__typename"}))return i(S.name.value).removed=!0,d=!0,null}},Directive:{leave:function(S){if(s(S))return d=!0,null}}});if(!d)return e;var h=function(S){return S.transitiveVars||(S.transitiveVars=new Set(S.variables),S.removed||S.fragmentSpreads.forEach(function(w){h(i(w)).transitiveVars.forEach(function(v){S.transitiveVars.add(v)})})),S},m=new Set;p.definitions.forEach(function(S){S.kind===Me.OPERATION_DEFINITION?h(r(S.name&&S.name.value)).fragmentSpreads.forEach(function(w){m.add(w)}):S.kind===Me.FRAGMENT_DEFINITION&&a===0&&!i(S.name.value).removed&&m.add(S.name.value)}),m.forEach(function(S){h(i(S)).fragmentSpreads.forEach(function(w){m.add(w)})});var b=function(S){return!!(!m.has(S)||i(S).removed)},_={enter:function(S){if(b(S.name.value))return null}};return cg(nt(p,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(S){if(S.variableDefinitions){var w=h(r(S.name&&S.name.value)).transitiveVars;if(w.size<S.variableDefinitions.length)return C(C({},S),{variableDefinitions:S.variableDefinitions.filter(function(v){return w.has(v.variable.name.value)})})}}}}))}var Ai=Object.assign(function(t){return nt(t,{SelectionSet:{enter:function(e,r,i){if(!(i&&i.kind===Me.OPERATION_DEFINITION)){var n=e.selections;if(!!n){var a=n.some(function(s){return Et(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=i;if(!(Et(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return C(C({},e),{selections:$r($r([],n,!0),[lf],!1)})}}}}}})},{added:function(t){return t===lf}}),lg={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&$.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),e}};function ou(t){return au([lg],yn(t))}function su(t){var e=Ei(t),r=e.operation;if(r==="query")return t;var i=nt(t,{OperationDefinition:{enter:function(n){return C(C({},n),{operation:"query"})}}});return i}function cu(t){yn(t);var e=au([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var pg=Object.prototype.hasOwnProperty;function uu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ga(t)}function ga(t){var e=t[0]||{},r=t.length;if(r>1)for(var i=new mt,n=1;n<r;++n)e=i.merge(e,t[n]);return e}var fg=function(t,e,r){return this.merge(t[r],e[r])},mt=function(){function t(e){e===void 0&&(e=fg),this.reconciler=e,this.isObject=fe,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var i=this,n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];return fe(r)&&fe(e)?(Object.keys(r).forEach(function(o){if(pg.call(e,o)){var s=e[o];if(r[o]!==s){var u=i.reconciler.apply(i,$r([e,r,o],n,!1));u!==s&&(e=i.shallowCopyForMerge(e),e[o]=u)}}else e=i.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return fe(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=C({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function dg(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=hg(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
26
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hg(t,e){if(!!t){if(typeof t=="string")return df(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return df(t,e)}}function df(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function hf(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function du(t,e,r){return e&&hf(t.prototype,e),r&&hf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var hu=function(){return typeof Symbol=="function"},mu=function(t){return hu()&&Boolean(Symbol[t])},gu=function(t){return mu(t)?Symbol[t]:"@@"+t};hu()&&!mu("observable")&&(Symbol.observable=Symbol("observable"));var mg=gu("iterator"),pu=gu("observable"),mf=gu("species");function qo(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function ya(t){var e=t.constructor;return e!==void 0&&(e=e[mf],e===null&&(e=void 0)),e!==void 0?e:oe}function gg(t){return t instanceof oe}function bn(t){bn.log?bn.log(t):setTimeout(function(){throw t})}function jo(t){Promise.resolve().then(function(){try{t()}catch(e){bn(e)}})}function gf(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=qo(e,"unsubscribe");r&&r.call(e)}}catch(i){bn(i)}}function fu(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function yg(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(yf(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function yf(t,e,r){t._state="running";var i=t._observer;try{var n=qo(i,e);switch(e){case"next":n&&n.call(i,r);break;case"error":if(fu(t),n)n.call(i,r);else throw r;break;case"complete":fu(t),n&&n.call(i);break}}catch(a){bn(a)}t._state==="closed"?gf(t):t._state==="running"&&(t._state="ready")}function lu(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],jo(function(){return yg(t)});return}yf(t,e,r)}}var vg=function(){function t(r,i){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var n=new bg(this);try{this._cleanup=i.call(void 0,n)}catch(a){n.error(a)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(fu(this),gf(this))},du(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),bg=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(i){lu(this._subscription,"next",i)},e.error=function(i){lu(this._subscription,"error",i)},e.complete=function(){lu(this._subscription,"complete")},du(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),oe=function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(i){return(typeof i!="object"||i===null)&&(i={next:i,error:arguments[1],complete:arguments[2]}),new vg(i,this._subscriber)},e.forEach=function(i){var n=this;return new Promise(function(a,o){if(typeof i!="function"){o(new TypeError(i+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=n.subscribe({next:function(c){try{i(c,s)}catch(l){o(l),u.unsubscribe()}},error:o,complete:a})})},e.map=function(i){var n=this;if(typeof i!="function")throw new TypeError(i+" is not a function");var a=ya(this);return new a(function(o){return n.subscribe({next:function(s){try{s=i(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(i){var n=this;if(typeof i!="function")throw new TypeError(i+" is not a function");var a=ya(this);return new a(function(o){return n.subscribe({next:function(s){try{if(!i(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(i){var n=this;if(typeof i!="function")throw new TypeError(i+" is not a function");var a=ya(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return n.subscribe({next:function(d){var f=!s;if(s=!0,!f||o)try{c=i(c,d)}catch(p){return l.error(p)}else c=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(c),l.complete()}})})},e.concat=function(){for(var i=this,n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];var s=ya(this);return new s(function(u){var c,l=0;function d(f){c=f.subscribe({next:function(p){u.next(p)},error:function(p){u.error(p)},complete:function(){l===a.length?(c=void 0,u.complete()):d(s.from(a[l++]))}})}return d(i),function(){c&&(c.unsubscribe(),c=void 0)}})},e.flatMap=function(i){var n=this;if(typeof i!="function")throw new TypeError(i+" is not a function");var a=ya(this);return new a(function(o){var s=[],u=n.subscribe({next:function(l){if(i)try{l=i(l)}catch(f){return o.error(f)}var d=a.from(l).subscribe({next:function(f){o.next(f)},error:function(f){o.error(f)},complete:function(){var f=s.indexOf(d);f>=0&&s.splice(f,1),c()}});s.push(d)},error:function(l){o.error(l)},complete:function(){c()}});function c(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),u.unsubscribe()}})},e[pu]=function(){return this},t.from=function(i){var n=typeof this=="function"?this:t;if(i==null)throw new TypeError(i+" is not an object");var a=qo(i,pu);if(a){var o=a.call(i);if(Object(o)!==o)throw new TypeError(o+" is not an object");return gg(o)&&o.constructor===n?o:new n(function(s){return o.subscribe(s)})}if(mu("iterator")&&(a=qo(i,mg),a))return new n(function(s){jo(function(){if(!s.closed){for(var u=dg(a.call(i)),c;!(c=u()).done;){var l=c.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(i))return new n(function(s){jo(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})});throw new TypeError(i+" is not observable")},t.of=function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){jo(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})})},du(t,null,[{key:mf,get:function(){return this}}]),t}();hu()&&Object.defineProperty(oe,Symbol("extensions"),{value:{symbol:pu,hostReportError:bn},configurable:!0});function yu(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var _n;typeof self<"u"?_n=self:typeof window<"u"?_n=window:typeof global<"u"?_n=global:typeof module<"u"?_n=module:_n=Function("return this")();var E4=yu(_n);var vf=oe.prototype,bf="@@observable";vf[bf]||(vf[bf]=function(){return this});var _g=Object.prototype.toString;function Bo(t){return vu(t)}function vu(t,e){switch(_g.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var r=t.slice(0);return e.set(t,r),r.forEach(function(n,a){r[a]=vu(n,e)}),r}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var i=Object.create(Object.getPrototypeOf(t));return e.set(t,i),Object.keys(t).forEach(function(n){i[n]=vu(t[n],e)}),i}default:return t}}function Sg(t){var e=new Set([t]);return e.forEach(function(r){fe(r)&&wg(r)===r&&Object.getOwnPropertyNames(r).forEach(function(i){fe(r[i])&&e.add(r[i])})}),t}function wg(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function va(t){return __DEV__&&Sg(t),t}function ki(t,e,r){var i=[];t.forEach(function(n){return n[e]&&i.push(n)}),i.forEach(function(n){return n[e](r)})}function Vo(t,e,r){return new oe(function(i){var n=i.next,a=i.error,o=i.complete,s=0,u=!1,c={then:function(p){return new Promise(function(h){return h(p())})}};function l(p,h){return p?function(m){++s;var b=function(){return p(m)};c=c.then(b,b).then(function(_){--s,n&&n.call(i,_),u&&d.complete()},function(_){throw--s,_}).catch(function(_){a&&a.call(i,_)})}:function(m){return h&&h.call(i,m)}}var d={next:l(e,n),error:l(r,a),complete:function(){u=!0,s||o&&o.call(i)}},f=t.subscribe(d);return function(){return f.unsubscribe()}})}var Pt=typeof WeakMap=="function"&&He(function(){return navigator.product})!=="ReactNative",_f=typeof WeakSet=="function",bu=typeof Symbol=="function"&&typeof Symbol.for=="function",Mr=bu&&Symbol.asyncIterator,F4=typeof He(function(){return window.document.createElement})=="function",M4=He(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Qo(t){function e(r){Object.defineProperty(t,r,{value:oe})}return bu&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Sf(t){return t&&typeof t.then=="function"}var Sn=function(t){Re(e,t);function e(r){var i=t.call(this,function(n){return i.addObserver(n),function(){return i.removeObserver(n)}})||this;return i.observers=new Set,i.promise=new Promise(function(n,a){i.resolve=n,i.reject=a}),i.handlers={next:function(n){i.sub!==null&&(i.latest=["next",n],i.notify("next",n),ki(i.observers,"next",n))},error:function(n){var a=i.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),i.sub=null,i.latest=["error",n],i.reject(n),i.notify("error",n),ki(i.observers,"error",n))},complete:function(){var n=i,a=n.sub,o=n.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?Sf(u)?u.then(function(c){return i.sub=c.subscribe(i.handlers)}):i.sub=u.subscribe(i.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),i.sub=null,i.latest&&i.latest[0]==="next"?i.resolve(i.latest[1]):i.resolve(),i.notify("complete"),ki(i.observers,"complete"))}}},i.nextResultListeners=new Set,i.cancel=function(n){i.reject(n),i.sources=[],i.handlers.complete()},i.promise.catch(function(n){}),typeof r=="function"&&(r=[new oe(r)]),Sf(r)?r.then(function(n){return i.start(n)},i.handlers.error):i.start(r),i}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var i=this.latest[0],n=r[i];n&&n.call(r,this.latest[1]),this.sub===null&&i==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,i){var n=this.nextResultListeners;n.size&&(this.nextResultListeners=new Set,n.forEach(function(a){return a(r,i)}))},e.prototype.beforeNext=function(r){var i=!1;this.nextResultListeners.add(function(n,a){i||(i=!0,r(n,a))})},e}(oe);Qo(Sn);function Ur(t){return"incremental"in t}function Cg(t){return"hasNext"in t&&"data"in t}function wf(t){return Ur(t)||Cg(t)}function zo(t,e){var r=t,i=new mt;return Ur(e)&&qe(e.incremental)&&e.incremental.forEach(function(n){for(var a=n.data,o=n.path,s=o.length-1;s>=0;--s){var u=o[s],c=!isNaN(+u),l=c?[]:{};l[u]=a,a=l}r=i.merge(r,a)}),r}function wn(t){var e=Wo(t);return qe(e)}function Wo(t){var e=qe(t.errors)?t.errors.slice(0):[];return Ur(t)&&qe(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function jr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(i){!i||Object.keys(i).forEach(function(n){var a=i[n];a!==void 0&&(r[n]=a)})}),r}var Cf=new Map;function ba(t){var e=Cf.get(t)||1;return Cf.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Ef(t){var e=ba("stringifyForDisplay");return JSON.stringify(t,function(r,i){return i===void 0?e:i}).split(JSON.stringify(e)).join("<undefined>")}function _a(t,e){return jr(t,e,e.variables&&{variables:C(C({},t&&t.variables),e.variables)})}function Ho(t){return new oe(function(e){e.error(t)})}var Sa=function(t,e,r){var i=new Error(r);throw i.name="ServerError",i.response=t,i.statusCode=t.status,i.result=e,i};function _u(t){for(var e=["query","operationName","variables","extensions","context"],r=0,i=Object.keys(t);r<i.length;r++){var n=i[r];if(e.indexOf(n)<0)throw __DEV__?new Z("illegal argument: ".concat(n)):new Z(27)}return t}function Su(t,e){var r=C({},t),i=function(a){typeof a=="function"?r=C(C({},r),a(r)):r=C(C({},r),a)},n=function(){return C({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:i}),Object.defineProperty(e,"getContext",{enumerable:!1,value:n}),e}function wu(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?vn(e.query)||void 0:""),e}function xf(t,e){return e?e(t):oe.of()}function wa(t){return typeof t=="function"?new $t(t):t}function Go(t){return t.request.length<=1}var Eg=function(t){Re(e,t);function e(r,i){var n=t.call(this,r)||this;return n.link=i,n}return e}(Error),$t=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return oe.of()})},t.from=function(e){return e.length===0?t.empty():e.map(wa).reduce(function(r,i){return r.concat(i)})},t.split=function(e,r,i){var n=wa(r),a=wa(i||new t(xf));return Go(n)&&Go(a)?new t(function(o){return e(o)?n.request(o)||oe.of():a.request(o)||oe.of()}):new t(function(o,s){return e(o)?n.request(o,s)||oe.of():a.request(o,s)||oe.of()})},t.execute=function(e,r){return e.request(Su(r.context,wu(_u(r))))||oe.of()},t.concat=function(e,r){var i=wa(e);if(Go(i))return __DEV__&&$.warn(new Eg("You are calling concat on a terminating link, which will have no effect",i)),i;var n=wa(r);return Go(n)?new t(function(a){return i.request(a,function(o){return n.request(o)||oe.of()})||oe.of()}):new t(function(a,o){return i.request(a,function(s){return n.request(s,o)||oe.of()})||oe.of()})},t.prototype.split=function(e,r,i){return this.concat(t.split(e,r,i||new t(xf)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new Z("request is not implemented"):new Z(22)},t.prototype.onError=function(e,r){if(r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}();var Cn=$t.execute;var Af="3.7.10";function kf(t){return!!t.body}function Tf(t){return!!t.getReader}function If(t){return!!(Mr&&t[Symbol.asyncIterator])}function Of(t){return!!t.stream}function Df(t){return!!t.arrayBuffer}function Nf(t){return!!t.pipe}function Cu(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function Eu(t){var e=null,r=null,i=!1,n=[],a=[];function o(d){if(!r){if(a.length){var f=a.shift();if(Array.isArray(f)&&f[0])return f[0]({value:d,done:!1})}n.push(d)}}function s(d){r=d;var f=a.slice();f.forEach(function(p){p[1](d)}),!e||e()}function u(){i=!0;var d=a.slice();d.forEach(function(f){f[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function c(){return new Promise(function(d,f){if(r)return f(r);if(n.length)return d({value:n.shift(),done:!1});if(i)return d({value:void 0,done:!0});a.push([d,f])})}var l={next:function(){return c()}};return Mr&&(l[Symbol.asyncIterator]=function(){return this}),l}function xu(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(i,n){t.then(function(a){i({value:a,done:!1})}).catch(n)}))}};return Mr&&(r[Symbol.asyncIterator]=function(){return this}),r}function Ko(t){var e={next:function(){return t.read()}};return Mr&&(e[Symbol.asyncIterator]=function(){return this}),e}function Rf(t){var e=t;if(kf(t)&&(e=t.body),If(e))return Cu(e);if(Tf(e))return Ko(e.getReader());if(Of(e))return Ko(e.stream().getReader());if(Df(e))return xu(e.arrayBuffer());if(Nf(e))return Eu(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Pf=Object.prototype.hasOwnProperty;function $f(t,e){var r,i,n;return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h,m,b,_,S,w,v,D,N,A,R;return Vt(this,function(F){switch(F.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",c="--".concat(u),l="",d=Rf(t),f=!0,F.label=1;case 1:return f?[4,d.next()]:[3,3];case 2:for(p=F.sent(),h=p.value,m=p.done,b=typeof h=="string"?h:a.decode(h),f=!m,l+=b,_=l.indexOf(c);_>-1;){if(S=void 0,R=[l.slice(0,_),l.slice(_+c.length)],S=R[0],l=R[1],S.trim()){if(w=S.indexOf(`\r
25
+ `)!==-1}function sf(t){return t!=null&&t.some(Um)}function pa(t){return t.kind===Me.FIELD||t.kind===Me.FRAGMENT_SPREAD||t.kind===Me.INLINE_FRAGMENT}function cf(){return typeof Mo=="function"?Kc():Kc()}function Km(){__DEV__?$(typeof bi=="boolean",bi):$(typeof bi=="boolean",39)}cf();Km();function yr(t,e){var r=t.directives;return!r||!r.length?!0:uf(r).every(function(i){var n=i.directive,a=i.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?$(o!==void 0,"Invalid variable referenced in @".concat(n.name.value," directive.")):$(o!==void 0,40)):o=a.value.value,n.name.value==="skip"?!o:o})}function yn(t,e,r){var i=new Set(t),n=i.size;return nt(e,{Directive:function(a){if(i.delete(a.name.value)&&(!r||!i.size))return _i}}),r?!i.size:i.size<n}function Xc(t){return t&&yn(["client","export"],t,!0)}function Zm(t){var e=t.name.value;return e==="skip"||e==="include"}function uf(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!Zm(r)){var i=r.arguments,n=r.name.value;__DEV__?$(i&&i.length===1,"Incorrect number of arguments for the @".concat(n," directive.")):$(i&&i.length===1,41);var a=i[0];__DEV__?$(a.name&&a.name.value==="if","Invalid argument for the @".concat(n," directive.")):$(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?$(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(n," directive must be a variable or a boolean value.")):$(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function eu(t,e){var r=e,i=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new Z("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new Z(44);a.kind==="FragmentDefinition"&&i.push(a)}),typeof r>"u"&&(__DEV__?$(i.length===1,"Found ".concat(i.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):$(i.length===1,45),r=i[0].name.value);var n=C(C({},t),{definitions:$r([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return n}function Si(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function wi(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var r=t.name.value;if(typeof e=="function")return e(r);var i=e&&e[r];return __DEV__?$(i,"No fragment named ".concat(r)):$(i,46),i||null}default:return null}}function fe(t){return t!==null&&typeof t=="object"}function Xt(t){return{__ref:String(t)}}function se(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function tu(t){return fe(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Jm(t){return t.kind==="StringValue"}function Ym(t){return t.kind==="BooleanValue"}function Xm(t){return t.kind==="IntValue"}function eg(t){return t.kind==="FloatValue"}function tg(t){return t.kind==="Variable"}function rg(t){return t.kind==="ObjectValue"}function ig(t){return t.kind==="ListValue"}function ng(t){return t.kind==="EnumValue"}function ag(t){return t.kind==="NullValue"}function Fr(t,e,r,i){if(Xm(r)||eg(r))t[e.value]=Number(r.value);else if(Ym(r)||Jm(r))t[e.value]=r.value;else if(rg(r)){var n={};r.fields.map(function(o){return Fr(n,o.name,o.value,i)}),t[e.value]=n}else if(tg(r)){var a=(i||{})[r.name.value];t[e.value]=a}else if(ig(r))t[e.value]=r.values.map(function(o){var s={};return Fr(s,e,o,i),s[e.value]});else if(ng(r))t[e.value]=r.value;else if(ag(r))t[e.value]=null;else throw __DEV__?new Z('The inline argument "'.concat(e.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new Z(55)}function ru(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(n){r[n.name.value]={},n.arguments&&n.arguments.forEach(function(a){var o=a.name,s=a.value;return Fr(r[n.name.value],o,s,e)})}));var i=null;return t.arguments&&t.arguments.length&&(i={},t.arguments.forEach(function(n){var a=n.name,o=n.value;return Fr(i,a,o,e)})),da(t.name.value,i,r)}var og=["connection","include","skip","client","rest","export"],da=Object.assign(function(t,e,r){if(e&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var i=r.connection.filter?r.connection.filter:[];i.sort();var n={};return i.forEach(function(s){n[s]=e[s]}),"".concat(r.connection.key,"(").concat(fa(n),")")}else return r.connection.key;var a=t;if(e){var o=fa(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){og.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(fa(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=fa;return fa=t,e}}),fa=function(e){return JSON.stringify(e,sg)};function sg(t,e){return fe(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,i){return r[i]=e[i],r},{})),e}function vr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(i){var n=i.name,a=i.value;return Fr(r,n,a,e)}),r}return null}function Rt(t){return t.alias?t.alias.value:t.name.value}function ha(t,e,r){if(typeof t.__typename=="string")return t.__typename;for(var i=0,n=e.selections;i<n.length;i++){var a=n[i];if(Et(a)){if(a.name.value==="__typename")return t[Rt(a)]}else{var o=ha(t,wi(a,r).selectionSet,r);if(typeof o=="string")return o}}}function Et(t){return t.kind==="Field"}function iu(t){return t.kind==="InlineFragment"}function vn(t){__DEV__?$(t&&t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):$(t&&t.kind==="Document",47);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new Z('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new Z(48);return r});return __DEV__?$(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):$(e.length<=1,49),t}function er(t){return vn(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function bn(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Ci(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function ma(t){var e=er(t);return __DEV__?$(e&&e.operation==="query","Must contain a query definition."):$(e&&e.operation==="query",50),e}function nu(t){__DEV__?$(t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):$(t.kind==="Document",51),__DEV__?$(t.definitions.length<=1,"Fragment must have exactly one definition."):$(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?$(e.kind==="FragmentDefinition","Must be a fragment definition."):$(e.kind==="FragmentDefinition",53),e}function Ei(t){vn(t);for(var e,r=0,i=t.definitions;r<i.length;r++){var n=i[r];if(n.kind==="OperationDefinition"){var a=n.operation;if(a==="query"||a==="mutation"||a==="subscription")return n}n.kind==="FragmentDefinition"&&!e&&(e=n)}if(e)return e;throw __DEV__?new Z("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new Z(54)}function xi(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(i){i.defaultValue&&Fr(e,i.variable.name,i.defaultValue)}),e}var Se=Array.isArray;function qe(t){return Array.isArray(t)&&t.length>0}var lf={kind:Me.FIELD,name:{kind:Me.NAME,value:"__typename"}};function ff(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Me.FRAGMENT_SPREAD&&ff(e[r.name.value],e)})}function cg(t){return ff(er(t)||nu(t),Si(Ci(t)))?null:t}function ug(t){var e=new Set,r=[];return t.forEach(function(i){i.name?e.add(i.name):i.test&&r.push(i.test)}),function(i){return e.has(i.name.value)||r.some(function(n){return n(i)})}}function pf(t){var e=new Map;return function(i){i===void 0&&(i=t);var n=e.get(i);return n||e.set(i,n={variables:new Set,fragmentSpreads:new Set}),n}}function au(t,e){for(var r=pf(""),i=pf(""),n=function(S){for(var w=0,v=void 0;w<S.length&&(v=S[w]);++w)if(!Se(v)){if(v.kind===Me.OPERATION_DEFINITION)return r(v.name&&v.name.value);if(v.kind===Me.FRAGMENT_DEFINITION)return i(v.name.value)}return __DEV__&&$.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Me.OPERATION_DEFINITION&&++a;var s=ug(t),u=t.some(function(S){return S.remove}),c=function(S){return u&&S&&S.some(s)},l=new Map,d=!1,f={enter:function(S){if(c(S.directives))return d=!0,null}},p=nt(e,{Field:f,InlineFragment:f,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(S,w,v,D,N){var A=n(N);A&&A.variables.add(S.name.value)}},FragmentSpread:{enter:function(S,w,v,D,N){if(c(S.directives))return d=!0,null;var A=n(N);A&&A.fragmentSpreads.add(S.name.value)}},FragmentDefinition:{enter:function(S,w,v,D){l.set(JSON.stringify(D),S)},leave:function(S,w,v,D){var N=l.get(JSON.stringify(D));if(S===N)return S;if(a>0&&S.selectionSet.selections.every(function(A){return A.kind===Me.FIELD&&A.name.value==="__typename"}))return i(S.name.value).removed=!0,d=!0,null}},Directive:{leave:function(S){if(s(S))return d=!0,null}}});if(!d)return e;var h=function(S){return S.transitiveVars||(S.transitiveVars=new Set(S.variables),S.removed||S.fragmentSpreads.forEach(function(w){h(i(w)).transitiveVars.forEach(function(v){S.transitiveVars.add(v)})})),S},m=new Set;p.definitions.forEach(function(S){S.kind===Me.OPERATION_DEFINITION?h(r(S.name&&S.name.value)).fragmentSpreads.forEach(function(w){m.add(w)}):S.kind===Me.FRAGMENT_DEFINITION&&a===0&&!i(S.name.value).removed&&m.add(S.name.value)}),m.forEach(function(S){h(i(S)).fragmentSpreads.forEach(function(w){m.add(w)})});var b=function(S){return!!(!m.has(S)||i(S).removed)},_={enter:function(S){if(b(S.name.value))return null}};return cg(nt(p,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(S){if(S.variableDefinitions){var w=h(r(S.name&&S.name.value)).transitiveVars;if(w.size<S.variableDefinitions.length)return C(C({},S),{variableDefinitions:S.variableDefinitions.filter(function(v){return w.has(v.variable.name.value)})})}}}}))}var Ai=Object.assign(function(t){return nt(t,{SelectionSet:{enter:function(e,r,i){if(!(i&&i.kind===Me.OPERATION_DEFINITION)){var n=e.selections;if(!!n){var a=n.some(function(s){return Et(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=i;if(!(Et(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return C(C({},e),{selections:$r($r([],n,!0),[lf],!1)})}}}}}})},{added:function(t){return t===lf}}),lg={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&$.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),e}};function ou(t){return au([lg],vn(t))}function su(t){var e=Ei(t),r=e.operation;if(r==="query")return t;var i=nt(t,{OperationDefinition:{enter:function(n){return C(C({},n),{operation:"query"})}}});return i}function cu(t){vn(t);var e=au([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var pg=Object.prototype.hasOwnProperty;function uu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ga(t)}function ga(t){var e=t[0]||{},r=t.length;if(r>1)for(var i=new mt,n=1;n<r;++n)e=i.merge(e,t[n]);return e}var fg=function(t,e,r){return this.merge(t[r],e[r])},mt=function(){function t(e){e===void 0&&(e=fg),this.reconciler=e,this.isObject=fe,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var i=this,n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];return fe(r)&&fe(e)?(Object.keys(r).forEach(function(o){if(pg.call(e,o)){var s=e[o];if(r[o]!==s){var u=i.reconciler.apply(i,$r([e,r,o],n,!1));u!==s&&(e=i.shallowCopyForMerge(e),e[o]=u)}}else e=i.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return fe(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=C({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function dg(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=hg(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hg(t,e){if(!!t){if(typeof t=="string")return df(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return df(t,e)}}function df(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function hf(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function du(t,e,r){return e&&hf(t.prototype,e),r&&hf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var hu=function(){return typeof Symbol=="function"},mu=function(t){return hu()&&Boolean(Symbol[t])},gu=function(t){return mu(t)?Symbol[t]:"@@"+t};hu()&&!mu("observable")&&(Symbol.observable=Symbol("observable"));var mg=gu("iterator"),pu=gu("observable"),mf=gu("species");function qo(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function ya(t){var e=t.constructor;return e!==void 0&&(e=e[mf],e===null&&(e=void 0)),e!==void 0?e:oe}function gg(t){return t instanceof oe}function _n(t){_n.log?_n.log(t):setTimeout(function(){throw t})}function jo(t){Promise.resolve().then(function(){try{t()}catch(e){_n(e)}})}function gf(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=qo(e,"unsubscribe");r&&r.call(e)}}catch(i){_n(i)}}function fu(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function yg(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(yf(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function yf(t,e,r){t._state="running";var i=t._observer;try{var n=qo(i,e);switch(e){case"next":n&&n.call(i,r);break;case"error":if(fu(t),n)n.call(i,r);else throw r;break;case"complete":fu(t),n&&n.call(i);break}}catch(a){_n(a)}t._state==="closed"?gf(t):t._state==="running"&&(t._state="ready")}function lu(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],jo(function(){return yg(t)});return}yf(t,e,r)}}var vg=function(){function t(r,i){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var n=new bg(this);try{this._cleanup=i.call(void 0,n)}catch(a){n.error(a)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(fu(this),gf(this))},du(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),bg=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(i){lu(this._subscription,"next",i)},e.error=function(i){lu(this._subscription,"error",i)},e.complete=function(){lu(this._subscription,"complete")},du(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),oe=function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(i){return(typeof i!="object"||i===null)&&(i={next:i,error:arguments[1],complete:arguments[2]}),new vg(i,this._subscriber)},e.forEach=function(i){var n=this;return new Promise(function(a,o){if(typeof i!="function"){o(new TypeError(i+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=n.subscribe({next:function(c){try{i(c,s)}catch(l){o(l),u.unsubscribe()}},error:o,complete:a})})},e.map=function(i){var n=this;if(typeof i!="function")throw new TypeError(i+" is not a function");var a=ya(this);return new a(function(o){return n.subscribe({next:function(s){try{s=i(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(i){var n=this;if(typeof i!="function")throw new TypeError(i+" is not a function");var a=ya(this);return new a(function(o){return n.subscribe({next:function(s){try{if(!i(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(i){var n=this;if(typeof i!="function")throw new TypeError(i+" is not a function");var a=ya(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return n.subscribe({next:function(d){var f=!s;if(s=!0,!f||o)try{c=i(c,d)}catch(p){return l.error(p)}else c=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(c),l.complete()}})})},e.concat=function(){for(var i=this,n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];var s=ya(this);return new s(function(u){var c,l=0;function d(f){c=f.subscribe({next:function(p){u.next(p)},error:function(p){u.error(p)},complete:function(){l===a.length?(c=void 0,u.complete()):d(s.from(a[l++]))}})}return d(i),function(){c&&(c.unsubscribe(),c=void 0)}})},e.flatMap=function(i){var n=this;if(typeof i!="function")throw new TypeError(i+" is not a function");var a=ya(this);return new a(function(o){var s=[],u=n.subscribe({next:function(l){if(i)try{l=i(l)}catch(f){return o.error(f)}var d=a.from(l).subscribe({next:function(f){o.next(f)},error:function(f){o.error(f)},complete:function(){var f=s.indexOf(d);f>=0&&s.splice(f,1),c()}});s.push(d)},error:function(l){o.error(l)},complete:function(){c()}});function c(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),u.unsubscribe()}})},e[pu]=function(){return this},t.from=function(i){var n=typeof this=="function"?this:t;if(i==null)throw new TypeError(i+" is not an object");var a=qo(i,pu);if(a){var o=a.call(i);if(Object(o)!==o)throw new TypeError(o+" is not an object");return gg(o)&&o.constructor===n?o:new n(function(s){return o.subscribe(s)})}if(mu("iterator")&&(a=qo(i,mg),a))return new n(function(s){jo(function(){if(!s.closed){for(var u=dg(a.call(i)),c;!(c=u()).done;){var l=c.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(i))return new n(function(s){jo(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})});throw new TypeError(i+" is not observable")},t.of=function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){jo(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})})},du(t,null,[{key:mf,get:function(){return this}}]),t}();hu()&&Object.defineProperty(oe,Symbol("extensions"),{value:{symbol:pu,hostReportError:_n},configurable:!0});function yu(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var Sn;typeof self<"u"?Sn=self:typeof window<"u"?Sn=window:typeof global<"u"?Sn=global:typeof module<"u"?Sn=module:Sn=Function("return this")();var E4=yu(Sn);var vf=oe.prototype,bf="@@observable";vf[bf]||(vf[bf]=function(){return this});var _g=Object.prototype.toString;function Bo(t){return vu(t)}function vu(t,e){switch(_g.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var r=t.slice(0);return e.set(t,r),r.forEach(function(n,a){r[a]=vu(n,e)}),r}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var i=Object.create(Object.getPrototypeOf(t));return e.set(t,i),Object.keys(t).forEach(function(n){i[n]=vu(t[n],e)}),i}default:return t}}function Sg(t){var e=new Set([t]);return e.forEach(function(r){fe(r)&&wg(r)===r&&Object.getOwnPropertyNames(r).forEach(function(i){fe(r[i])&&e.add(r[i])})}),t}function wg(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function va(t){return __DEV__&&Sg(t),t}function ki(t,e,r){var i=[];t.forEach(function(n){return n[e]&&i.push(n)}),i.forEach(function(n){return n[e](r)})}function Vo(t,e,r){return new oe(function(i){var n=i.next,a=i.error,o=i.complete,s=0,u=!1,c={then:function(p){return new Promise(function(h){return h(p())})}};function l(p,h){return p?function(m){++s;var b=function(){return p(m)};c=c.then(b,b).then(function(_){--s,n&&n.call(i,_),u&&d.complete()},function(_){throw--s,_}).catch(function(_){a&&a.call(i,_)})}:function(m){return h&&h.call(i,m)}}var d={next:l(e,n),error:l(r,a),complete:function(){u=!0,s||o&&o.call(i)}},f=t.subscribe(d);return function(){return f.unsubscribe()}})}var Pt=typeof WeakMap=="function"&&He(function(){return navigator.product})!=="ReactNative",_f=typeof WeakSet=="function",bu=typeof Symbol=="function"&&typeof Symbol.for=="function",Mr=bu&&Symbol.asyncIterator,F4=typeof He(function(){return window.document.createElement})=="function",M4=He(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Qo(t){function e(r){Object.defineProperty(t,r,{value:oe})}return bu&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Sf(t){return t&&typeof t.then=="function"}var wn=function(t){Re(e,t);function e(r){var i=t.call(this,function(n){return i.addObserver(n),function(){return i.removeObserver(n)}})||this;return i.observers=new Set,i.promise=new Promise(function(n,a){i.resolve=n,i.reject=a}),i.handlers={next:function(n){i.sub!==null&&(i.latest=["next",n],i.notify("next",n),ki(i.observers,"next",n))},error:function(n){var a=i.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),i.sub=null,i.latest=["error",n],i.reject(n),i.notify("error",n),ki(i.observers,"error",n))},complete:function(){var n=i,a=n.sub,o=n.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?Sf(u)?u.then(function(c){return i.sub=c.subscribe(i.handlers)}):i.sub=u.subscribe(i.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),i.sub=null,i.latest&&i.latest[0]==="next"?i.resolve(i.latest[1]):i.resolve(),i.notify("complete"),ki(i.observers,"complete"))}}},i.nextResultListeners=new Set,i.cancel=function(n){i.reject(n),i.sources=[],i.handlers.complete()},i.promise.catch(function(n){}),typeof r=="function"&&(r=[new oe(r)]),Sf(r)?r.then(function(n){return i.start(n)},i.handlers.error):i.start(r),i}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var i=this.latest[0],n=r[i];n&&n.call(r,this.latest[1]),this.sub===null&&i==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,i){var n=this.nextResultListeners;n.size&&(this.nextResultListeners=new Set,n.forEach(function(a){return a(r,i)}))},e.prototype.beforeNext=function(r){var i=!1;this.nextResultListeners.add(function(n,a){i||(i=!0,r(n,a))})},e}(oe);Qo(wn);function Ur(t){return"incremental"in t}function Cg(t){return"hasNext"in t&&"data"in t}function wf(t){return Ur(t)||Cg(t)}function zo(t,e){var r=t,i=new mt;return Ur(e)&&qe(e.incremental)&&e.incremental.forEach(function(n){for(var a=n.data,o=n.path,s=o.length-1;s>=0;--s){var u=o[s],c=!isNaN(+u),l=c?[]:{};l[u]=a,a=l}r=i.merge(r,a)}),r}function Cn(t){var e=Wo(t);return qe(e)}function Wo(t){var e=qe(t.errors)?t.errors.slice(0):[];return Ur(t)&&qe(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function jr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(i){!i||Object.keys(i).forEach(function(n){var a=i[n];a!==void 0&&(r[n]=a)})}),r}var Cf=new Map;function ba(t){var e=Cf.get(t)||1;return Cf.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Ef(t){var e=ba("stringifyForDisplay");return JSON.stringify(t,function(r,i){return i===void 0?e:i}).split(JSON.stringify(e)).join("<undefined>")}function _a(t,e){return jr(t,e,e.variables&&{variables:C(C({},t&&t.variables),e.variables)})}function Ho(t){return new oe(function(e){e.error(t)})}var Sa=function(t,e,r){var i=new Error(r);throw i.name="ServerError",i.response=t,i.statusCode=t.status,i.result=e,i};function _u(t){for(var e=["query","operationName","variables","extensions","context"],r=0,i=Object.keys(t);r<i.length;r++){var n=i[r];if(e.indexOf(n)<0)throw __DEV__?new Z("illegal argument: ".concat(n)):new Z(27)}return t}function Su(t,e){var r=C({},t),i=function(a){typeof a=="function"?r=C(C({},r),a(r)):r=C(C({},r),a)},n=function(){return C({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:i}),Object.defineProperty(e,"getContext",{enumerable:!1,value:n}),e}function wu(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?bn(e.query)||void 0:""),e}function xf(t,e){return e?e(t):oe.of()}function wa(t){return typeof t=="function"?new $t(t):t}function Go(t){return t.request.length<=1}var Eg=function(t){Re(e,t);function e(r,i){var n=t.call(this,r)||this;return n.link=i,n}return e}(Error),$t=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return oe.of()})},t.from=function(e){return e.length===0?t.empty():e.map(wa).reduce(function(r,i){return r.concat(i)})},t.split=function(e,r,i){var n=wa(r),a=wa(i||new t(xf));return Go(n)&&Go(a)?new t(function(o){return e(o)?n.request(o)||oe.of():a.request(o)||oe.of()}):new t(function(o,s){return e(o)?n.request(o,s)||oe.of():a.request(o,s)||oe.of()})},t.execute=function(e,r){return e.request(Su(r.context,wu(_u(r))))||oe.of()},t.concat=function(e,r){var i=wa(e);if(Go(i))return __DEV__&&$.warn(new Eg("You are calling concat on a terminating link, which will have no effect",i)),i;var n=wa(r);return Go(n)?new t(function(a){return i.request(a,function(o){return n.request(o)||oe.of()})||oe.of()}):new t(function(a,o){return i.request(a,function(s){return n.request(s,o)||oe.of()})||oe.of()})},t.prototype.split=function(e,r,i){return this.concat(t.split(e,r,i||new t(xf)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new Z("request is not implemented"):new Z(22)},t.prototype.onError=function(e,r){if(r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}();var En=$t.execute;var Af="3.7.10";function kf(t){return!!t.body}function Tf(t){return!!t.getReader}function If(t){return!!(Mr&&t[Symbol.asyncIterator])}function Of(t){return!!t.stream}function Df(t){return!!t.arrayBuffer}function Nf(t){return!!t.pipe}function Cu(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function Eu(t){var e=null,r=null,i=!1,n=[],a=[];function o(d){if(!r){if(a.length){var f=a.shift();if(Array.isArray(f)&&f[0])return f[0]({value:d,done:!1})}n.push(d)}}function s(d){r=d;var f=a.slice();f.forEach(function(p){p[1](d)}),!e||e()}function u(){i=!0;var d=a.slice();d.forEach(function(f){f[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function c(){return new Promise(function(d,f){if(r)return f(r);if(n.length)return d({value:n.shift(),done:!1});if(i)return d({value:void 0,done:!0});a.push([d,f])})}var l={next:function(){return c()}};return Mr&&(l[Symbol.asyncIterator]=function(){return this}),l}function xu(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(i,n){t.then(function(a){i({value:a,done:!1})}).catch(n)}))}};return Mr&&(r[Symbol.asyncIterator]=function(){return this}),r}function Ko(t){var e={next:function(){return t.read()}};return Mr&&(e[Symbol.asyncIterator]=function(){return this}),e}function Rf(t){var e=t;if(kf(t)&&(e=t.body),If(e))return Cu(e);if(Tf(e))return Ko(e.getReader());if(Of(e))return Ko(e.stream().getReader());if(Df(e))return xu(e.arrayBuffer());if(Nf(e))return Eu(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Pf=Object.prototype.hasOwnProperty;function $f(t,e){var r,i,n;return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h,m,b,_,S,w,v,D,N,A,R;return Vt(this,function(F){switch(F.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",c="--".concat(u),l="",d=Rf(t),f=!0,F.label=1;case 1:return f?[4,d.next()]:[3,3];case 2:for(p=F.sent(),h=p.value,m=p.done,b=typeof h=="string"?h:a.decode(h),f=!m,l+=b,_=l.indexOf(c);_>-1;){if(S=void 0,R=[l.slice(0,_),l.slice(_+c.length)],S=R[0],l=R[1],S.trim()){if(w=S.indexOf(`\r
27
27
  \r
28
28
  `),v=xg(S.slice(0,w)),D=v["content-type"],D&&D.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");N=S.slice(w);try{A=Lf(t,N.replace(`\r
29
29
  `,"")),(Object.keys(A).length>1||"data"in A||"incremental"in A||"errors"in A)&&((i=e.next)===null||i===void 0||i.call(e,A))}catch(P){Zo(P,e)}}_=l.indexOf(c)}return[3,1];case 3:return(n=e.complete)===null||n===void 0||n.call(e),[2]}})})}function xg(t){var e={};return t.split(`
30
- `).forEach(function(r){var i=r.indexOf(":");if(i>-1){var n=r.slice(0,i).trim().toLowerCase(),a=r.slice(i+1).trim();e[n]=a}}),e}function Lf(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};Sa(t,r(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(n){var i=n;throw i.name="ServerParseError",i.response=t,i.statusCode=t.status,i.bodyText=e,i}}function Zo(t,e){var r,i;t.name!=="AbortError"&&(t.result&&t.result.errors&&t.result.data&&((r=e.next)===null||r===void 0||r.call(e,t.result)),(i=e.error)===null||i===void 0||i.call(e,t))}function Ff(t,e,r){Ag(e)(t).then(function(i){var n,a;(n=r.next)===null||n===void 0||n.call(r,i),(a=r.complete)===null||a===void 0||a.call(r)}).catch(function(i){return Zo(i,r)})}function Ag(t){return function(e){return e.text().then(function(r){return Lf(e,r)}).then(function(r){return e.status>=300&&Sa(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!Pf.call(r,"data")&&!Pf.call(r,"errors")&&Sa(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(i){return i.operationName}):t.operationName,"'.")),r})}}var Ca=function(t,e){var r;try{r=JSON.stringify(t)}catch(n){var i=__DEV__?new Z("Network request failed. ".concat(e," is not serializable: ").concat(n.message)):new Z(24);throw i.parseError=n,i}return r};var kg={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Tg={accept:"*/*","content-type":"application/json"},Ig={method:"POST"},Mf={http:kg,headers:Tg,options:Ig},Uf=function(t,e){return e(t)};function jf(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var n={},a={};r.forEach(function(d){n=C(C(C({},n),d.options),{headers:C(C({},n.headers),d.headers)}),d.credentials&&(n.credentials=d.credentials),a=C(C({},a),d.http)}),n.headers&&(n.headers=Og(n.headers,a.preserveHeaderCase));var o=t.operationName,s=t.extensions,u=t.variables,c=t.query,l={operationName:o,variables:u};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=e(c,mn)),{options:n,body:l}}function Og(t,e){if(!e){var r=Object.create(null);return Object.keys(Object(t)).forEach(function(a){r[a.toLowerCase()]=t[a]}),r}var i=Object.create(null);Object.keys(Object(t)).forEach(function(a){i[a.toLowerCase()]={originalName:a,value:t[a]}});var n=Object.create(null);return Object.keys(i).forEach(function(a){n[i[a].originalName]=i[a].value}),n}var qf=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new Z(`
30
+ `).forEach(function(r){var i=r.indexOf(":");if(i>-1){var n=r.slice(0,i).trim().toLowerCase(),a=r.slice(i+1).trim();e[n]=a}}),e}function Lf(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};Sa(t,r(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(n){var i=n;throw i.name="ServerParseError",i.response=t,i.statusCode=t.status,i.bodyText=e,i}}function Zo(t,e){var r,i;t.name!=="AbortError"&&(t.result&&t.result.errors&&t.result.data&&((r=e.next)===null||r===void 0||r.call(e,t.result)),(i=e.error)===null||i===void 0||i.call(e,t))}function Ff(t,e,r){Ag(e)(t).then(function(i){var n,a;(n=r.next)===null||n===void 0||n.call(r,i),(a=r.complete)===null||a===void 0||a.call(r)}).catch(function(i){return Zo(i,r)})}function Ag(t){return function(e){return e.text().then(function(r){return Lf(e,r)}).then(function(r){return e.status>=300&&Sa(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!Pf.call(r,"data")&&!Pf.call(r,"errors")&&Sa(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(i){return i.operationName}):t.operationName,"'.")),r})}}var Ca=function(t,e){var r;try{r=JSON.stringify(t)}catch(n){var i=__DEV__?new Z("Network request failed. ".concat(e," is not serializable: ").concat(n.message)):new Z(24);throw i.parseError=n,i}return r};var kg={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Tg={accept:"*/*","content-type":"application/json"},Ig={method:"POST"},Mf={http:kg,headers:Tg,options:Ig},Uf=function(t,e){return e(t)};function jf(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var n={},a={};r.forEach(function(d){n=C(C(C({},n),d.options),{headers:C(C({},n.headers),d.headers)}),d.credentials&&(n.credentials=d.credentials),a=C(C({},a),d.http)}),n.headers&&(n.headers=Og(n.headers,a.preserveHeaderCase));var o=t.operationName,s=t.extensions,u=t.variables,c=t.query,l={operationName:o,variables:u};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=e(c,gn)),{options:n,body:l}}function Og(t,e){if(!e){var r=Object.create(null);return Object.keys(Object(t)).forEach(function(a){r[a.toLowerCase()]=t[a]}),r}var i=Object.create(null);Object.keys(Object(t)).forEach(function(a){i[a.toLowerCase()]={originalName:a,value:t[a]}});var n=Object.create(null);return Object.keys(i).forEach(function(a){n[i[a].originalName]=i[a].value}),n}var qf=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new Z(`
31
31
  "fetch" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:
32
32
 
33
33
  import fetch from 'cross-fetch';
@@ -35,7 +35,7 @@ import { ApolloClient, HttpLink } from '@apollo/client';
35
35
  const client = new ApolloClient({
36
36
  link: new HttpLink({ uri: '/graphql', fetch })
37
37
  });
38
- `):new Z(23)};var Bf=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Vf=function(t,e){var r=t.getContext(),i=r.uri;return i||(typeof e=="function"?e(t):e||"/graphql")};function Qf(t,e){var r=[],i=function(d,f){r.push("".concat(d,"=").concat(encodeURIComponent(f)))};if("query"in e&&i("query",e.query),e.operationName&&i("operationName",e.operationName),e.variables){var n=void 0;try{n=Ca(e.variables,"Variables map")}catch(d){return{parseError:d}}i("variables",n)}if(e.extensions){var a=void 0;try{a=Ca(e.extensions,"Extensions map")}catch(d){return{parseError:d}}i("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var zf=He(function(){return fetch}),Wf=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,i=t.fetch,n=t.print,a=n===void 0?Uf:n,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Yt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&qf(i||zf);var f={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new $t(function(p){var h=Vf(p,r),m=p.getContext(),b={};if(m.clientAwareness){var _=m.clientAwareness,S=_.name,w=_.version;S&&(b["apollographql-client-name"]=S),w&&(b["apollographql-client-version"]=w)}var v=C(C({},b),m.headers),D={http:m.http,options:m.fetchOptions,credentials:m.credentials,headers:v},N=jf(p,a,Mf,f,D),A=N.options,R=N.body;if(R.variables&&!l){var F=new Set(Object.keys(R.variables));nt(p.query,{Variable:function(pe,Zt,ae){ae&&ae.kind!=="VariableDefinition"&&F.delete(pe.name.value)}}),F.size&&(R.variables=C({},R.variables),F.forEach(function(pe){delete R.variables[pe]}))}var P;if(!A.signal){var j=Bf(),Je=j.controller,je=j.signal;P=Je,P&&(A.signal=je)}var H=function(pe){return pe.kind==="OperationDefinition"&&pe.operation==="mutation"};if(u&&!p.query.definitions.some(H)&&(A.method="GET"),gn(["defer"],p.query)&&(A.headers=A.headers||{},A.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),A.method==="GET"){var we=Qf(h,R),Ce=we.newURI,le=we.parseError;if(le)return Ho(le);h=Ce}else try{A.body=Ca(R,"Payload")}catch(pe){return Ho(pe)}return new oe(function(pe){var Zt=i||He(function(){return fetch})||zf;return Zt(h,A).then(function(ae){var Jt;p.setContext({response:ae});var Dr=(Jt=ae.headers)===null||Jt===void 0?void 0:Jt.get("content-type");return Dr!==null&&/^multipart\/mixed/i.test(Dr)?$f(ae,pe):Ff(ae,p,pe)}).catch(function(ae){return Zo(ae,pe)}),function(){P&&P.abort()}})})};var Au=function(t){Re(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,Wf(r).request)||this;return i.options=r,i}return e}($t);var{toString:Hf,hasOwnProperty:Dg}=Object.prototype,Gf=Function.prototype.toString,ku=new Map;function ke(t,e){try{return Tu(t,e)}finally{ku.clear()}}function Tu(t,e){if(t===e)return!0;let r=Hf.call(t),i=Hf.call(e);if(r!==i)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Zf(t,e))return!0;let n=Kf(t),a=Kf(e),o=n.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Dg.call(e,n[s]))return!1;for(let s=0;s<o;++s){let u=n[s];if(!Tu(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(Zf(t,e))return!0;let n=t.entries(),a=r==="[object Map]";for(;;){let o=n.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!Tu(u,e.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let n=t.byteLength;if(n===e.byteLength)for(;n--&&t[n]===e[n];);return n===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let n=Gf.call(t);return n!==Gf.call(e)?!1:!Pg(n,Rg)}}return!1}function Kf(t){return Object.keys(t).filter(Ng,t)}function Ng(t){return this[t]!==void 0}var Rg="{ [native code] }";function Pg(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function Zf(t,e){let r=ku.get(t);if(r){if(r.has(e))return!0}else ku.set(t,r=new Set);return r.add(e),!1}var $g=function(){return Object.create(null)},Jf=Array.prototype,Lg=Jf.forEach,Fg=Jf.slice,tr=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=$g),this.weakness=e,this.makeData=r}return t.prototype.lookup=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return this.lookupArray(e)},t.prototype.lookupArray=function(e){var r=this;return Lg.call(e,function(i){return r=r.getChildTrie(i)}),r.data||(r.data=this.makeData(Fg.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&Mg(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),i=r.get(e);return i||r.set(e,i=new t(this.weakness,this.makeData)),i},t}();function Mg(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var et=null,Yf={},Ug=1,jg=()=>class{constructor(){this.id=["slot",Ug++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=et;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===Yf)break;return e!==et&&(et.slots[this.id]=r),!0}return et&&(et.slots[this.id]=Yf),!1}getValue(){if(this.hasValue())return et.slots[this.id]}withValue(e,r,i,n){let a={__proto__:null,[this.id]:e},o=et;et={parent:o,slots:a};try{return r.apply(n,i)}finally{et=o}}static bind(e){let r=et;return function(){let i=et;try{return et=r,e.apply(this,arguments)}finally{et=i}}}static noContext(e,r,i){if(et){let n=et;try{return et=null,e.apply(i,r)}finally{et=n}}else return e.apply(i,r)}};function Xf(t){try{return t()}catch{}}var Iu="@wry/context:Slot",qg=Xf(()=>globalThis)||Xf(()=>global)||Object.create(null),ed=qg,En=ed[Iu]||Array[Iu]||function(t){try{Object.defineProperty(ed,Iu,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(jg());var{bind:Bg,noContext:Vg}=En;function Qg(){}var zg=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=Qg),this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.get=function(e){var r=this.getNode(e);return r&&r.value},t.prototype.getNode=function(e){var r=this.map.get(e);if(r&&r!==this.newest){var i=r.older,n=r.newer;n&&(n.older=i),i&&(i.newer=n),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=n)}return r},t.prototype.set=function(e,r){var i=this.getNode(e);return i?i.value=r:(i={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=i),this.newest=i,this.oldest=this.oldest||i,this.map.set(e,i),i.value)},t.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},t.prototype.delete=function(e){var r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1},t}(),Yo=new En,Ou,Wg=Object.prototype.hasOwnProperty,Nu=(Ou=Array.from,Ou===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:Ou);function Jo(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var Ea=[],Hg=100;function xn(t,e){if(!t)throw new Error(e||"assertion failure")}function Gg(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function rd(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Kg(t){return t.slice(0)}var Zg=function(){function t(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++t.count}return t.prototype.peek=function(){if(this.value.length===1&&!qr(this))return td(this),this.value[0]},t.prototype.recompute=function(e){return xn(!this.recomputing,"already recomputing"),td(this),qr(this)?Jg(this,e):rd(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,id(this),Jo(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),cd(this),Ru(this,function(r,i){r.setDirty(),ud(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Ea.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Nu(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),Ea.push(this.deps),this.deps=null)},t.count=0,t}();function td(t){var e=Yo.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),qr(t)?ad(e,t):od(e,t),e}function Jg(t,e){return cd(t),Yo.withValue(t,Yg,[t,e]),ey(t,e)&&Xg(t),rd(t.value)}function Yg(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(r){t.value[1]=r}t.recomputing=!1}function qr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function Xg(t){t.dirty=!1,!qr(t)&&nd(t)}function id(t){Ru(t,ad)}function nd(t){Ru(t,od)}function Ru(t,e){var r=t.parents.size;if(r)for(var i=Nu(t.parents),n=0;n<r;++n)e(i[n],t)}function ad(t,e){xn(t.childValues.has(e)),xn(qr(e));var r=!qr(t);if(!t.dirtyChildren)t.dirtyChildren=Ea.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&id(t)}function od(t,e){xn(t.childValues.has(e)),xn(!qr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,Kg(e.value)):Gg(r,e.value)||t.setDirty(),sd(t,e),!qr(t)&&nd(t)}function sd(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(Ea.length<Hg&&Ea.push(r),t.dirtyChildren=null))}function cd(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){ud(t,r)}),t.forgetDeps(),xn(t.dirtyChildren===null)}function ud(t,e){e.parents.delete(t),t.childValues.delete(e),sd(t,e)}function ey(t,e){if(typeof t.subscribe=="function")try{Jo(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var ty={setDirty:!0,dispose:!0,forget:!0};function Xo(t){var e=new Map,r=t&&t.subscribe;function i(n){var a=Yo.getValue();if(a){var o=e.get(n);o||e.set(n,o=new Set),a.dependOn(o),typeof r=="function"&&(Jo(o),o.unsubscribe=r(n))}}return i.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&Wg.call(ty,o)?o:"setDirty";Nu(s).forEach(function(c){return c[u]()}),e.delete(a),Jo(s)}},i}function ld(){var t=new tr(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var bw=ld(),Du=new Set;function Ti(t,e){e===void 0&&(e=Object.create(null));var r=new zg(e.max||Math.pow(2,16),function(c){return c.dispose()}),i=e.keyArgs,n=e.makeCacheKey||ld(),a=function(){var c=n.apply(null,i?i.apply(null,arguments):arguments);if(c===void 0)return t.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new Zg(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(c)});var d=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),Du.add(r),Yo.hasValue()||(Du.forEach(function(f){return f.clean()}),Du.clear()),d};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(c){var l=r.get(c);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(n.apply(null,arguments))};function s(c){var l=r.get(c);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(n.apply(null,arguments))};function u(c){return r.delete(c)}return a.forgetKey=u,a.forget=function(){return u(n.apply(null,arguments))},a.makeCacheKey=n,a.getKey=i?function(){return n.apply(null,i.apply(null,arguments))}:n,Object.freeze(a)}var Pu=function(){function t(){this.getFragmentDoc=Ti(eu)}return t.prototype.batch=function(e){var r=this,i=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,n;return this.performTransaction(function(){return n=e.update(r)},i),n},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(C(C({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(C(C({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))},t.prototype.writeQuery=function(e){var r=e.id,i=e.data,n=Yt(e,["id","data"]);return this.write(Object.assign(n,{dataId:r||"ROOT_QUERY",result:i}))},t.prototype.writeFragment=function(e){var r=e.id,i=e.data,n=e.fragment,a=e.fragmentName,o=Yt(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(n,a),dataId:r,result:i}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(i){var n=i.readQuery(e),a=r(n);return a==null?n:(i.writeQuery(C(C({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(i){var n=i.readFragment(e),a=r(n);return a==null?n:(i.writeFragment(C(C({},e),{data:a})),a)}})},t}();var xa=function(t){Re(e,t);function e(r,i,n,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=i,s.query=n,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var Pe=Object.prototype.hasOwnProperty;function Aa(t){return t==null}function ts(t,e){var r=t.__typename,i=t.id,n=t._id;if(typeof r=="string"&&(e&&(e.keyObject=Aa(i)?Aa(n)?void 0:{_id:n}:{id:i}),Aa(i)&&!Aa(n)&&(i=n),!Aa(i)))return"".concat(r,":").concat(typeof i=="number"||typeof i=="string"?i:JSON.stringify(i))}var pd={dataIdFromObject:ts,addTypename:!0,resultCaching:!0,canonizeResults:!1};function fd(t){return jr(pd,t)}function rs(t){var e=t.canonizeResults;return e===void 0?pd.canonizeResults:e}function dd(t,e){return se(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var $u=/^[_a-z][_0-9a-z]*/i;function Wt(t){var e=t.match($u);return e?e[0]:t}function es(t,e,r){return fe(e)?Se(e)?e.every(function(i){return es(t,i,r)}):t.selections.every(function(i){if(Et(i)&&yr(i,r)){var n=Rt(i);return Pe.call(e,n)&&(!i.selectionSet||es(i.selectionSet,e[n],r))}return!0}):!1}function Br(t){return fe(t)&&!se(t)&&!Se(t)}function hd(){return new mt}function is(t,e){var r=Si(Ci(t));return{fragmentMap:r,lookupFragment:function(i){var n=r[i];return!n&&e&&(n=e.lookup(i)),n||null}}}var ns=Object.create(null),Lu=function(){return ns},md=Object.create(null),An=function(){function t(e,r){var i=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(n,a){return va(se(n)?i.get(n.__ref,a):n&&n[a])},this.canRead=function(n){return se(n)?i.has(n.__ref):typeof n=="object"},this.toReference=function(n,a){if(typeof n=="string")return Xt(n);if(se(n))return n;var o=i.policies.identify(n)[0];if(o){var s=Xt(o);return a&&i.merge(o,n),s}}}return t.prototype.toObject=function(){return C({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),Pe.call(this.data,e)){var i=this.data[e];if(i&&Pe.call(i,r))return i[r]}if(r==="__typename"&&Pe.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Vr)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),Pe.call(this.data,e))return this.data[e];if(this instanceof Vr)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var i=this,n;se(e)&&(e=e.__ref),se(r)&&(r=r.__ref);var a=typeof e=="string"?this.lookup(n=e):e,o=typeof r=="string"?this.lookup(n=r):r;if(!!o){__DEV__?$(typeof n=="string","store.merge expects a string ID"):$(typeof n=="string",1);var s=new mt(iy).merge(a,o);if(this.data[n]=s,s!==a&&(delete this.refs[n],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(c){if(!a||a[c]!==s[c]){u[c]=1;var l=Wt(c);l!==c&&!i.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(i instanceof Vr)&&delete s[c]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[n]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(c){return i.group.dirty(n,c)})}}},t.prototype.modify=function(e,r){var i=this,n=this.lookup(e);if(n){var a=Object.create(null),o=!1,s=!0,u={DELETE:ns,INVALIDATE:md,isReference:se,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return i.policies.readField(typeof c=="string"?{fieldName:c,from:l||Xt(e)}:c,{store:i})}};if(Object.keys(n).forEach(function(c){var l=Wt(c),d=n[c];if(d!==void 0){var f=typeof r=="function"?r:r[c]||r[l];if(f){var p=f===Lu?ns:f(va(d),C(C({},u),{fieldName:l,storeFieldName:c,storage:i.getStorage(e,c)}));p===md?i.group.dirty(e,c):(p===ns&&(p=void 0),p!==d&&(a[c]=p,o=!0,d=p))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Vr?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,i){var n,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&i?this.policies.getStoreFieldName({typename:o,fieldName:r,args:i}):r;return this.modify(e,s?(n={},n[s]=Lu,n):Lu)}return!1},t.prototype.evict=function(e,r){var i=!1;return e.id&&(Pe.call(this.data,e.id)&&(i=this.delete(e.id,e.fieldName,e.args)),this instanceof Vr&&this!==r&&(i=this.parent.evict(e,r)||i),(e.fieldName||i)&&this.group.dirty(e.id,e.fieldName||"__exists")),i},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),i=[];return this.getRootIdSet().forEach(function(n){Pe.call(e.policies.rootTypenamesById,n)||i.push(n)}),i.length&&(r.__META={extraRootIds:i.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(a){e&&Pe.call(e,a)||r.delete(a)}),e){var i=e.__META,n=Yt(e,["__META"]);Object.keys(n).forEach(function(a){r.merge(a,n[a])}),i&&i.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Vr?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),i=this.toObject();r.forEach(function(o){Pe.call(i,o)&&(Object.keys(e.findChildRefIds(o)).forEach(r.add,r),delete i[o])});var n=Object.keys(i);if(n.length){for(var a=this;a instanceof Vr;)a=a.parent;n.forEach(function(o){return a.delete(o)})}return n},t.prototype.findChildRefIds=function(e){if(!Pe.call(this.refs,e)){var r=this.refs[e]=Object.create(null),i=this.data[e];if(!i)return r;var n=new Set([i]);n.forEach(function(a){se(a)&&(r[a.__ref]=!0),fe(a)&&Object.keys(a).forEach(function(o){var s=a[o];fe(s)&&n.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var gd=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?Xo():null,this.keyMaker=new tr(Pt)},t.prototype.depend=function(e,r){if(this.d){this.d(Fu(e,r));var i=Wt(r);i!==r&&this.d(Fu(e,i)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Fu(e,r),r==="__exists"?"forget":"setDirty")},t}();function Fu(t,e){return e+"#"+t}function Mu(t,e){Ii(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){Re(i,r);function i(n){var a=n.policies,o=n.resultCaching,s=o===void 0?!0:o,u=n.seed,c=r.call(this,a,new gd(s))||this;return c.stump=new ry(c),c.storageTrie=new tr(Pt),u&&c.replace(u),c}return i.prototype.addLayer=function(n,a){return this.stump.addLayer(n,a)},i.prototype.removeLayer=function(){return this},i.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},i}(t);t.Root=e})(An||(An={}));var Vr=function(t){Re(e,t);function e(r,i,n,a){var o=t.call(this,i.policies,a)||this;return o.id=r,o.parent=i,o.replay=n,o.group=a,n(o),o}return e.prototype.addLayer=function(r,i){return new e(r,this,i,this.group)},e.prototype.removeLayer=function(r){var i=this,n=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=i.data[a],s=n.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){ke(o[u],s[u])||i.group.dirty(a,u)}):(i.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){i.group.dirty(a,u)})):i.delete(a)}),n):n===this.parent?this:n.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return C(C({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var i=this.parent.findChildRefIds(r);return Pe.call(this.data,r)?C(C({},i),t.prototype.findChildRefIds.call(this,r)):i},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(An),ry=function(t){Re(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new gd(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(Vr);function iy(t,e,r){var i=t[r],n=e[r];return ke(i,n)?i:n}function Ii(t){return!!(t instanceof An&&t.group.caching)}function ny(t){return fe(t)?Se(t)?t.slice(0):C({__proto__:Object.getPrototypeOf(t)},t):t}var as=function(){function t(){this.known=new(_f?WeakSet:Set),this.pool=new tr(Pt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return fe(e)&&this.known.has(e)},t.prototype.pass=function(e){if(fe(e)){var r=ny(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(fe(e)){var i=this.passes.get(e);if(i)return i;var n=Object.getPrototypeOf(e);switch(n){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],c=this.sortedKeys(e);u.push(c.json);var l=u.length;c.sorted.forEach(function(p){u.push(r.admit(e[p]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(p,h){d[p]=u[l+h]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),i=this.pool.lookupArray(r);if(!i.keys){r.sort();var n=JSON.stringify(r);(i.keys=this.keysByJSON.get(n))||this.keysByJSON.set(n,i.keys={sorted:r,json:n})}return i.keys},t}();var xt=Object.assign(function(t){if(fe(t)){Uu===void 0&&yd();var e=Uu.admit(t),r=ju.get(e);return r===void 0&&ju.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:yd}),Uu,ju;function yd(){Uu=new as,ju=new(Pt?WeakMap:Map)}function vd(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var bd=function(){function t(e){var r=this;this.knownResults=new(Pt?WeakMap:Map),this.config=jr(e,{addTypename:e.addTypename!==!1,canonizeResults:rs(e)}),this.canon=e.canon||new as,this.executeSelectionSet=Ti(function(i){var n,a=i.context.canonizeResults,o=vd(i);o[3]=!a;var s=(n=r.executeSelectionSet).peek.apply(n,o);return s?a?C(C({},s),{result:r.canon.admit(s.result)}):s:(Mu(i.context.store,i.enclosingRef.__ref),r.execSelectionSetImpl(i))},{max:this.config.resultCacheMaxSize,keyArgs:vd,makeCacheKey:function(i,n,a,o){if(Ii(a.store))return a.store.makeCacheKey(i,se(n)?n.__ref:n,a.varString,o)}}),this.executeSubSelectedArray=Ti(function(i){return Mu(i.context.store,i.enclosingRef.__ref),r.execSubSelectedArrayImpl(i)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(i){var n=i.field,a=i.array,o=i.context;if(Ii(o.store))return o.store.makeCacheKey(n,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new as},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,i=e.query,n=e.rootId,a=n===void 0?"ROOT_QUERY":n,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=C(C({},xi(ma(i))),o);var f=Xt(a),p=this.executeSelectionSet({selectionSet:Ei(i).selectionSet,objectOrReference:f,enclosingRef:f,context:C({store:r,query:i,policies:d,variables:o,varString:xt(o),canonizeResults:l},is(i,this.config.fragments))}),h;if(p.missing&&(h=[new xa(ay(p.missing),p.missing,i,o)],!u))throw h[0];return{result:p.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,i,n){if(Ii(n.store)&&this.knownResults.get(e)===i){var a=this.executeSelectionSet.peek(i,r,n,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,i=e.selectionSet,n=e.objectOrReference,a=e.enclosingRef,o=e.context;if(se(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(n.__ref," object")};var s=o.variables,u=o.policies,c=o.store,l=c.getFieldValue(n,"__typename"),d=[],f,p=new mt;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(w,v){var D;return w.missing&&(f=p.merge(f,(D={},D[v]=w.missing,D))),w.result}var m=new Set(i.selections);m.forEach(function(w){var v,D;if(!!yr(w,s))if(Et(w)){var N=u.readField({fieldName:w.name.value,field:w,variables:o.variables,from:n},o),A=Rt(w);N===void 0?Ai.added(w)||(f=p.merge(f,(v={},v[A]="Can't find field '".concat(w.name.value,"' on ").concat(se(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),v))):Se(N)?N=h(r.executeSubSelectedArray({field:w,array:N,enclosingRef:a,context:o}),A):w.selectionSet?N!=null&&(N=h(r.executeSelectionSet({selectionSet:w.selectionSet,objectOrReference:N,enclosingRef:se(N)?N:a,context:o}),A)):o.canonizeResults&&(N=r.canon.pass(N)),N!==void 0&&d.push((D={},D[A]=N,D))}else{var R=wi(w,o.lookupFragment);if(!R&&w.kind===Me.FRAGMENT_SPREAD)throw __DEV__?new Z("No fragment named ".concat(w.name.value)):new Z(5);R&&u.fragmentMatches(R,l)&&R.selectionSet.selections.forEach(m.add,m)}});var b=ga(d),_={result:b,missing:f},S=o.canonizeResults?this.canon.admit(_):va(_);return S.result&&this.knownResults.set(S.result,i),S},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,i=e.field,n=e.array,a=e.enclosingRef,o=e.context,s,u=new mt;function c(l,d){var f;return l.missing&&(s=u.merge(s,(f={},f[d]=l.missing,f))),l.result}return i.selectionSet&&(n=n.filter(o.store.canRead)),n=n.map(function(l,d){return l===null?null:Se(l)?c(r.executeSubSelectedArray({field:i,array:l,enclosingRef:a,context:o}),d):i.selectionSet?c(r.executeSelectionSet({selectionSet:i.selectionSet,objectOrReference:l,enclosingRef:se(l)?l:a,context:o}),d):(__DEV__&&oy(o.store,i,l),l)}),{result:o.canonizeResults?this.canon.admit(n):n,missing:s}},t}();function ay(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function oy(t,e,r){if(!e.selectionSet){var i=new Set([r]);i.forEach(function(n){fe(n)&&(__DEV__?$(!se(n),"Missing selection set for object of type ".concat(dd(t,n)," returned for query field ").concat(e.name.value)):$(!se(n),6),Object.values(n).forEach(i.add,i))})}}var kn=new En,_d=new WeakMap;function ka(t){var e=_d.get(t);return e||_d.set(t,e={vars:new Set,dep:Xo()}),e}function qu(t){ka(t).vars.forEach(function(e){return e.forgetCache(t)})}function Sd(t){ka(t).vars.forEach(function(e){return e.attachCache(t)})}function os(t){var e=new Set,r=new Set,i=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){ka(u).dep.dirty(i),sy(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=kn.getValue();s&&(n(s),ka(s).dep(i))}return t};i.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var n=i.attachCache=function(a){return e.add(a),ka(a).vars.add(i),i};return i.forgetCache=function(a){return e.delete(a)},i}function sy(t){t.broadcastWatches&&t.broadcastWatches()}var wd=Object.create(null);function Bu(t){var e=JSON.stringify(t);return wd[e]||(wd[e]=Object.create(null))}function Vu(t){var e=Bu(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,i){var n=function(o,s){return i.readField(s,o)},a=i.keyObject=zu(t,function(o){var s=Tn(i.storeObject,o,n);return s===void 0&&r!==i.storeObject&&Pe.call(r,o[0])&&(s=Tn(r,o,Ed)),__DEV__?$(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):$(s!==void 0,2),s});return"".concat(i.typename,":").concat(JSON.stringify(a))})}function Qu(t){var e=Bu(t);return e.keyArgsFn||(e.keyArgsFn=function(r,i){var n=i.field,a=i.variables,o=i.fieldName,s=zu(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(n&&qe(n.directives)){var f=l.slice(1),p=n.directives.find(function(_){return _.name.value===f}),h=p&&vr(p,a);return h&&Tn(h,c.slice(1))}return}if(d==="$"){var m=l.slice(1);if(a&&Pe.call(a,m)){var b=c.slice(0);return b[0]=m,Tn(a,b)}return}if(r)return Tn(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function zu(t,e){var r=new mt;return Cd(t).reduce(function(i,n){var a,o=e(n);if(o!==void 0){for(var s=n.length-1;s>=0;--s)o=(a={},a[n[s]]=o,a);i=r.merge(i,o)}return i},Object.create(null))}function Cd(t){var e=Bu(t);if(!e.paths){var r=e.paths=[],i=[];t.forEach(function(n,a){Se(n)?(Cd(n).forEach(function(o){return r.push(i.concat(o))}),i.length=0):(i.push(n),Se(t[a+1])||(r.push(i.slice(0)),i.length=0))})}return e.paths}function Ed(t,e){return t[e]}function Tn(t,e,r){return r=r||Ed,xd(e.reduce(function i(n,a){return Se(n)?n.map(function(o){return i(o,a)}):n&&r(n,a)},t))}function xd(t){return fe(t)?Se(t)?t.map(xd):zu(Object.keys(t).sort(),function(e){return Tn(t,e)}):t}da.setStringify(xt);function Wu(t){return t.args!==void 0?t.args:t.field?vr(t.field,t.variables):null}var cy=function(){},Ad=function(t,e){return e.fieldName},kd=function(t,e,r){var i=r.mergeObjects;return i(t,e)},Td=function(t,e){return e},Od=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=C({dataIdFromObject:ts},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,r){var i,n=this,a=r&&(r.typename||((i=r.storeObject)===null||i===void 0?void 0:i.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=C(C({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var f=ss(arguments,o);return n.readField(f,{store:n.cache.data,variables:f.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(Se(d))l=Vu(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(i){var n=e[i],a=n.queryType,o=n.mutationType,s=n.subscriptionType,u=Yt(n,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",i),o&&r.setRootTypename("Mutation",i),s&&r.setRootTypename("Subscription",i),Pe.call(r.toBeAdded,i)?r.toBeAdded[i].push(u):r.toBeAdded[i]=[u]})},t.prototype.updateTypePolicy=function(e,r){var i=this,n=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?kd:c===!1?Td:u.merge}s(n,r.merge),n.keyFn=a===!1?cy:Se(a)?Vu(a):typeof a=="function"?a:n.keyFn,o&&Object.keys(o).forEach(function(u){var c=i.getFieldPolicy(e,u,!0),l=o[u];if(typeof l=="function")c.read=l;else{var d=l.keyArgs,f=l.read,p=l.merge;c.keyFn=d===!1?Ad:Se(d)?Qu(d):typeof d=="function"?d:c.keyFn,typeof f=="function"&&(c.read=f),s(c,p)}c.read&&c.merge&&(c.keyFn=c.keyFn||Ad)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var i="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[i];r!==n&&(__DEV__?$(!n||n===e,"Cannot change root ".concat(e," __typename more than once")):$(!n||n===e,3),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[r]=i,this.rootTypenamesById[i]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(i){r.getSupertypeSet(i,!0),e[i].forEach(function(n){r.getSupertypeSet(n,!0).add(i);var a=n.match($u);(!a||a[0]!==n)&&r.fuzzySubtypes.set(n,new RegExp(n))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!Pe.call(this.typePolicies,e)){var i=this.typePolicies[e]=Object.create(null);i.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=Yt(s,["fields"]);Object.assign(i,c),Object.assign(i.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,i){if(e){var n=this.getTypePolicy(e).fields;return n[r]||i&&(n[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var i=this.supertypeMap.get(e);return!i&&r&&this.supertypeMap.set(e,i=new Set),i},t.prototype.fragmentMatches=function(e,r,i,n){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],c=function(h){var m=a.getSupertypeSet(h,!1);m&&m.size&&u.indexOf(m)<0&&u.push(m)},l=!!(i&&this.fuzzySubtypes.size),d=!1,f=0;f<u.length;++f){var p=u[f];if(p.has(o))return s.has(o)||(d&&__DEV__&&$.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;p.forEach(c),l&&f===u.length-1&&es(e.selectionSet,i,n)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,m){var b=r.match(h);b&&b[0]===r&&c(m)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var i=this.getFieldPolicy(e,r,!1);return!!(i&&i.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,i=e.fieldName,n=this.getFieldPolicy(r,i,!1),a,o=n&&n.keyFn;if(o&&r)for(var s={typename:r,fieldName:i,field:e.field||null,variables:e.variables},u=Wu(e);o;){var c=o(u,s);if(Se(c))o=Qu(c);else{a=c||i;break}}return a===void 0&&(a=e.field?ru(e.field,e.variables):da(i,Wu(e))),a===!1?i:i===Wt(a)?a:i+":"+a},t.prototype.readField=function(e,r){var i=e.from;if(!!i){var n=e.field||e.fieldName;if(!!n){if(e.typename===void 0){var a=r.store.getFieldValue(i,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=Wt(o),u=r.store.getFieldValue(i,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=Id(this,i,e,r,r.store.getStorage(se(i)?i.__ref:i,o));return kn.withValue(this.cache,l,[u,d])}return u}}},t.prototype.getReadFunction=function(e,r){var i=this.getFieldPolicy(e,r,!1);return i&&i.read},t.prototype.getMergeFunction=function(e,r,i){var n=this.getFieldPolicy(e,r,!1),a=n&&n.merge;return!a&&i&&(n=this.getTypePolicy(i),a=n&&n.merge),a},t.prototype.runMergeFunction=function(e,r,i,n,a){var o=i.field,s=i.typename,u=i.merge;return u===kd?Dd(n.store)(e,r):u===Td?r:(n.overwrite&&(e=void 0),u(e,r,Id(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:n.variables},n,a||Object.create(null))))},t}();function Id(t,e,r,i,n){var a=t.getStoreFieldName(r),o=Wt(a),s=r.variables||i.variables,u=i.store,c=u.toReference,l=u.canRead;return{args:Wu(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:se,toReference:c,storage:n,cache:t.cache,canRead:l,readField:function(){return t.readField(ss(arguments,e,s),i)},mergeObjects:Dd(i.store)}}function ss(t,e,r){var i=t[0],n=t[1],a=t.length,o;return typeof i=="string"?o={fieldName:i,from:a>1?n:e}:(o=C({},i),Pe.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&$.warn("Undefined 'from' passed to readField with arguments ".concat(Ef(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function Dd(t){return function(r,i){if(Se(r)||Se(i))throw __DEV__?new Z("Cannot automatically merge arrays"):new Z(4);if(fe(r)&&fe(i)){var n=t.getFieldValue(r,"__typename"),a=t.getFieldValue(i,"__typename"),o=n&&a&&n!==a;if(o)return i;if(se(r)&&Br(i))return t.merge(r.__ref,i),r;if(Br(r)&&se(i))return t.merge(r,i.__ref),i;if(Br(r)&&Br(i))return C(C({},r),i)}return i}}function Hu(t,e,r){var i="".concat(e).concat(r),n=t.flavors.get(i);return n||t.flavors.set(i,n=t.clientOnly===e&&t.deferred===r?t:C(C({},t),{clientOnly:e,deferred:r})),n}var $d=function(){function t(e,r,i){this.cache=e,this.reader=r,this.fragments=i}return t.prototype.writeToStore=function(e,r){var i=this,n=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=er(n),l=hd();s=C(C({},xi(c)),s);var d=C(C({store:e,written:Object.create(null),merge:function(p,h){return l.merge(p,h)},variables:s,varString:xt(s)},is(n,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!se(f))throw __DEV__?new Z("Could not identify object ".concat(JSON.stringify(a))):new Z(7);return d.incomingById.forEach(function(p,h){var m=p.storeObject,b=p.mergeTree,_=p.fieldNodeSet,S=Xt(h);if(b&&b.map.size){var w=i.applyMerges(b,S,m,d);if(se(w))return;m=w}if(__DEV__&&!d.overwrite){var v=Object.create(null);_.forEach(function(A){A.selectionSet&&(v[A.name.value]=!0)});var D=function(A){return v[Wt(A)]===!0},N=function(A){var R=b&&b.map.get(A);return Boolean(R&&R.info&&R.info.merge)};Object.keys(m).forEach(function(A){D(A)&&!N(A)&&uy(S,m,A,d.store)})}e.merge(h,m)}),e.retain(f.__ref),f},t.prototype.processSelectionSet=function(e){var r=this,i=e.dataId,n=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=i&&u.rootTypenamesById[i]||ha(n,a,o.fragmentMap)||i&&o.store.get(i,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var w=ss(arguments,c,o.variables);if(se(w.from)){var v=o.incomingById.get(w.from.__ref);if(v){var D=u.readField(C(C({},w),{from:v.storeObject}),o);if(D!==void 0)return D}}return u.readField(w,o)},f=new Set;this.flattenFields(a,n,o,l).forEach(function(w,v){var D,N=Rt(v),A=n[N];if(f.add(v),A!==void 0){var R=u.getStoreFieldName({typename:l,fieldName:v.name.value,field:v,variables:w.variables}),F=Nd(s,R),P=r.processFieldValue(A,v,v.selectionSet?Hu(w,!1,!1):w,F),j=void 0;v.selectionSet&&(se(P)||Br(P))&&(j=d("__typename",P));var Je=u.getMergeFunction(l,v.name.value,j);Je?F.info={field:v,typename:l,merge:Je}:Rd(s,R),c=w.merge(c,(D={},D[R]=P,D))}else __DEV__&&!w.clientOnly&&!w.deferred&&!Ai.added(v)&&!u.getReadFunction(l,v.name.value)&&__DEV__&&$.error("Missing field '".concat(Rt(v),"' while writing result ").concat(JSON.stringify(n,null,2)).substring(0,1e3))});try{var p=u.identify(n,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=p[0],m=p[1];i=i||h,m&&(c=o.merge(c,m))}catch(w){if(!i)throw w}if(typeof i=="string"){var b=Xt(i),_=o.written[i]||(o.written[i]=[]);if(_.indexOf(a)>=0||(_.push(a),this.reader&&this.reader.isFresh(n,b,a,o)))return b;var S=o.incomingById.get(i);return S?(S.storeObject=o.merge(S.storeObject,c),S.mergeTree=Gu(S.mergeTree,s),f.forEach(function(w){return S.fieldNodeSet.add(w)})):o.incomingById.set(i,{storeObject:c,mergeTree:cs(s)?void 0:s,fieldNodeSet:f}),b}return c},t.prototype.processFieldValue=function(e,r,i,n){var a=this;return!r.selectionSet||e===null?__DEV__?Bo(e):e:Se(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,i,Nd(n,s));return Rd(n,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:i,mergeTree:n})},t.prototype.flattenFields=function(e,r,i,n){n===void 0&&(n=ha(r,e,i.fragmentMap));var a=new Map,o=this.cache.policies,s=new tr(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(f){if(!!yr(f,i.variables)){var p=l.clientOnly,h=l.deferred;if(!(p&&h)&&qe(f.directives)&&f.directives.forEach(function(_){var S=_.name.value;if(S==="client"&&(p=!0),S==="defer"){var w=vr(_,i.variables);(!w||w.if!==!1)&&(h=!0)}}),Et(f)){var m=a.get(f);m&&(p=p&&m.clientOnly,h=h&&m.deferred),a.set(f,Hu(i,p,h))}else{var b=wi(f,i.lookupFragment);if(!b&&f.kind===Me.FRAGMENT_SPREAD)throw __DEV__?new Z("No fragment named ".concat(f.name.value)):new Z(8);b&&o.fragmentMatches(b,n,r,i.variables)&&u(b.selectionSet,Hu(i,p,h))}}}))}(e,i),a},t.prototype.applyMerges=function(e,r,i,n,a){var o,s=this;if(e.map.size&&!se(i)){var u=!Se(i)&&(se(r)||Br(r))?r:void 0,c=i;u&&!a&&(a=[se(u)?u.__ref:u]);var l,d=function(f,p){return Se(f)?typeof p=="number"?f[p]:void 0:n.store.getFieldValue(f,String(p))};e.map.forEach(function(f,p){var h=d(u,p),m=d(c,p);if(m!==void 0){a&&a.push(p);var b=s.applyMerges(f,h,m,n,a);b!==m&&(l=l||new Map,l.set(p,b)),a&&$(a.pop()===p)}}),l&&(i=Se(c)?c.slice(0):C({},c),l.forEach(function(f,p){i[p]=f}))}return e.info?this.cache.policies.runMergeFunction(r,i,e.info,n,a&&(o=n.store).getStorage.apply(o,a)):i},t}();var Ld=[];function Nd(t,e){var r=t.map;return r.has(e)||r.set(e,Ld.pop()||{map:new Map}),r.get(e)}function Gu(t,e){if(t===e||!e||cs(e))return t;if(!t||cs(t))return e;var r=t.info&&e.info?C(C({},t.info),e.info):t.info||e.info,i=t.map.size&&e.map.size,n=i?new Map:t.map.size?t.map:e.map,a={info:r,map:n};if(i){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,Gu(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,Gu(e.map.get(s),t.map.get(s)))})}return a}function cs(t){return!t||!(t.info||t.map.size)}function Rd(t,e){var r=t.map,i=r.get(e);i&&cs(i)&&(Ld.push(i),r.delete(e))}var Pd=new Set;function uy(t,e,r,i){var n=function(d){var f=i.getFieldValue(d,r);return typeof f=="object"&&f},a=n(t);if(!!a){var o=n(e);if(!!o&&!se(a)&&!ke(a,o)&&!Object.keys(a).every(function(d){return i.getFieldValue(o,d)!==void 0})){var s=i.getFieldValue(t,"__typename")||i.getFieldValue(e,"__typename"),u=Wt(r),c="".concat(s,".").concat(u);if(!Pd.has(c)){Pd.add(c);var l=[];!Se(a)&&!Se(o)&&[a,o].forEach(function(d){var f=i.getFieldValue(d,"__typename");typeof f=="string"&&!l.includes(f)&&l.push(f)}),__DEV__&&$.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
38
+ `):new Z(23)};var Bf=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Vf=function(t,e){var r=t.getContext(),i=r.uri;return i||(typeof e=="function"?e(t):e||"/graphql")};function Qf(t,e){var r=[],i=function(d,f){r.push("".concat(d,"=").concat(encodeURIComponent(f)))};if("query"in e&&i("query",e.query),e.operationName&&i("operationName",e.operationName),e.variables){var n=void 0;try{n=Ca(e.variables,"Variables map")}catch(d){return{parseError:d}}i("variables",n)}if(e.extensions){var a=void 0;try{a=Ca(e.extensions,"Extensions map")}catch(d){return{parseError:d}}i("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var zf=He(function(){return fetch}),Wf=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,i=t.fetch,n=t.print,a=n===void 0?Uf:n,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Yt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&qf(i||zf);var f={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new $t(function(p){var h=Vf(p,r),m=p.getContext(),b={};if(m.clientAwareness){var _=m.clientAwareness,S=_.name,w=_.version;S&&(b["apollographql-client-name"]=S),w&&(b["apollographql-client-version"]=w)}var v=C(C({},b),m.headers),D={http:m.http,options:m.fetchOptions,credentials:m.credentials,headers:v},N=jf(p,a,Mf,f,D),A=N.options,R=N.body;if(R.variables&&!l){var F=new Set(Object.keys(R.variables));nt(p.query,{Variable:function(pe,Zt,ae){ae&&ae.kind!=="VariableDefinition"&&F.delete(pe.name.value)}}),F.size&&(R.variables=C({},R.variables),F.forEach(function(pe){delete R.variables[pe]}))}var P;if(!A.signal){var j=Bf(),Je=j.controller,je=j.signal;P=Je,P&&(A.signal=je)}var H=function(pe){return pe.kind==="OperationDefinition"&&pe.operation==="mutation"};if(u&&!p.query.definitions.some(H)&&(A.method="GET"),yn(["defer"],p.query)&&(A.headers=A.headers||{},A.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),A.method==="GET"){var we=Qf(h,R),Ce=we.newURI,le=we.parseError;if(le)return Ho(le);h=Ce}else try{A.body=Ca(R,"Payload")}catch(pe){return Ho(pe)}return new oe(function(pe){var Zt=i||He(function(){return fetch})||zf;return Zt(h,A).then(function(ae){var Jt;p.setContext({response:ae});var Dr=(Jt=ae.headers)===null||Jt===void 0?void 0:Jt.get("content-type");return Dr!==null&&/^multipart\/mixed/i.test(Dr)?$f(ae,pe):Ff(ae,p,pe)}).catch(function(ae){return Zo(ae,pe)}),function(){P&&P.abort()}})})};var Au=function(t){Re(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,Wf(r).request)||this;return i.options=r,i}return e}($t);var{toString:Hf,hasOwnProperty:Dg}=Object.prototype,Gf=Function.prototype.toString,ku=new Map;function ke(t,e){try{return Tu(t,e)}finally{ku.clear()}}function Tu(t,e){if(t===e)return!0;let r=Hf.call(t),i=Hf.call(e);if(r!==i)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Zf(t,e))return!0;let n=Kf(t),a=Kf(e),o=n.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Dg.call(e,n[s]))return!1;for(let s=0;s<o;++s){let u=n[s];if(!Tu(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(Zf(t,e))return!0;let n=t.entries(),a=r==="[object Map]";for(;;){let o=n.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!Tu(u,e.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let n=t.byteLength;if(n===e.byteLength)for(;n--&&t[n]===e[n];);return n===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let n=Gf.call(t);return n!==Gf.call(e)?!1:!Pg(n,Rg)}}return!1}function Kf(t){return Object.keys(t).filter(Ng,t)}function Ng(t){return this[t]!==void 0}var Rg="{ [native code] }";function Pg(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function Zf(t,e){let r=ku.get(t);if(r){if(r.has(e))return!0}else ku.set(t,r=new Set);return r.add(e),!1}var $g=function(){return Object.create(null)},Jf=Array.prototype,Lg=Jf.forEach,Fg=Jf.slice,tr=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=$g),this.weakness=e,this.makeData=r}return t.prototype.lookup=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return this.lookupArray(e)},t.prototype.lookupArray=function(e){var r=this;return Lg.call(e,function(i){return r=r.getChildTrie(i)}),r.data||(r.data=this.makeData(Fg.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&Mg(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),i=r.get(e);return i||r.set(e,i=new t(this.weakness,this.makeData)),i},t}();function Mg(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var et=null,Yf={},Ug=1,jg=()=>class{constructor(){this.id=["slot",Ug++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=et;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===Yf)break;return e!==et&&(et.slots[this.id]=r),!0}return et&&(et.slots[this.id]=Yf),!1}getValue(){if(this.hasValue())return et.slots[this.id]}withValue(e,r,i,n){let a={__proto__:null,[this.id]:e},o=et;et={parent:o,slots:a};try{return r.apply(n,i)}finally{et=o}}static bind(e){let r=et;return function(){let i=et;try{return et=r,e.apply(this,arguments)}finally{et=i}}}static noContext(e,r,i){if(et){let n=et;try{return et=null,e.apply(i,r)}finally{et=n}}else return e.apply(i,r)}};function Xf(t){try{return t()}catch{}}var Iu="@wry/context:Slot",qg=Xf(()=>globalThis)||Xf(()=>global)||Object.create(null),ed=qg,xn=ed[Iu]||Array[Iu]||function(t){try{Object.defineProperty(ed,Iu,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(jg());var{bind:Bg,noContext:Vg}=xn;function Qg(){}var zg=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=Qg),this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.get=function(e){var r=this.getNode(e);return r&&r.value},t.prototype.getNode=function(e){var r=this.map.get(e);if(r&&r!==this.newest){var i=r.older,n=r.newer;n&&(n.older=i),i&&(i.newer=n),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=n)}return r},t.prototype.set=function(e,r){var i=this.getNode(e);return i?i.value=r:(i={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=i),this.newest=i,this.oldest=this.oldest||i,this.map.set(e,i),i.value)},t.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},t.prototype.delete=function(e){var r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1},t}(),Yo=new xn,Ou,Wg=Object.prototype.hasOwnProperty,Nu=(Ou=Array.from,Ou===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:Ou);function Jo(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var Ea=[],Hg=100;function An(t,e){if(!t)throw new Error(e||"assertion failure")}function Gg(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function rd(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Kg(t){return t.slice(0)}var Zg=function(){function t(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++t.count}return t.prototype.peek=function(){if(this.value.length===1&&!qr(this))return td(this),this.value[0]},t.prototype.recompute=function(e){return An(!this.recomputing,"already recomputing"),td(this),qr(this)?Jg(this,e):rd(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,id(this),Jo(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),cd(this),Ru(this,function(r,i){r.setDirty(),ud(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Ea.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Nu(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),Ea.push(this.deps),this.deps=null)},t.count=0,t}();function td(t){var e=Yo.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),qr(t)?ad(e,t):od(e,t),e}function Jg(t,e){return cd(t),Yo.withValue(t,Yg,[t,e]),ey(t,e)&&Xg(t),rd(t.value)}function Yg(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(r){t.value[1]=r}t.recomputing=!1}function qr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function Xg(t){t.dirty=!1,!qr(t)&&nd(t)}function id(t){Ru(t,ad)}function nd(t){Ru(t,od)}function Ru(t,e){var r=t.parents.size;if(r)for(var i=Nu(t.parents),n=0;n<r;++n)e(i[n],t)}function ad(t,e){An(t.childValues.has(e)),An(qr(e));var r=!qr(t);if(!t.dirtyChildren)t.dirtyChildren=Ea.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&id(t)}function od(t,e){An(t.childValues.has(e)),An(!qr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,Kg(e.value)):Gg(r,e.value)||t.setDirty(),sd(t,e),!qr(t)&&nd(t)}function sd(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(Ea.length<Hg&&Ea.push(r),t.dirtyChildren=null))}function cd(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){ud(t,r)}),t.forgetDeps(),An(t.dirtyChildren===null)}function ud(t,e){e.parents.delete(t),t.childValues.delete(e),sd(t,e)}function ey(t,e){if(typeof t.subscribe=="function")try{Jo(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var ty={setDirty:!0,dispose:!0,forget:!0};function Xo(t){var e=new Map,r=t&&t.subscribe;function i(n){var a=Yo.getValue();if(a){var o=e.get(n);o||e.set(n,o=new Set),a.dependOn(o),typeof r=="function"&&(Jo(o),o.unsubscribe=r(n))}}return i.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&Wg.call(ty,o)?o:"setDirty";Nu(s).forEach(function(c){return c[u]()}),e.delete(a),Jo(s)}},i}function ld(){var t=new tr(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var bw=ld(),Du=new Set;function Ti(t,e){e===void 0&&(e=Object.create(null));var r=new zg(e.max||Math.pow(2,16),function(c){return c.dispose()}),i=e.keyArgs,n=e.makeCacheKey||ld(),a=function(){var c=n.apply(null,i?i.apply(null,arguments):arguments);if(c===void 0)return t.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new Zg(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(c)});var d=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),Du.add(r),Yo.hasValue()||(Du.forEach(function(f){return f.clean()}),Du.clear()),d};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(c){var l=r.get(c);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(n.apply(null,arguments))};function s(c){var l=r.get(c);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(n.apply(null,arguments))};function u(c){return r.delete(c)}return a.forgetKey=u,a.forget=function(){return u(n.apply(null,arguments))},a.makeCacheKey=n,a.getKey=i?function(){return n.apply(null,i.apply(null,arguments))}:n,Object.freeze(a)}var Pu=function(){function t(){this.getFragmentDoc=Ti(eu)}return t.prototype.batch=function(e){var r=this,i=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,n;return this.performTransaction(function(){return n=e.update(r)},i),n},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(C(C({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(C(C({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))},t.prototype.writeQuery=function(e){var r=e.id,i=e.data,n=Yt(e,["id","data"]);return this.write(Object.assign(n,{dataId:r||"ROOT_QUERY",result:i}))},t.prototype.writeFragment=function(e){var r=e.id,i=e.data,n=e.fragment,a=e.fragmentName,o=Yt(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(n,a),dataId:r,result:i}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(i){var n=i.readQuery(e),a=r(n);return a==null?n:(i.writeQuery(C(C({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(i){var n=i.readFragment(e),a=r(n);return a==null?n:(i.writeFragment(C(C({},e),{data:a})),a)}})},t}();var xa=function(t){Re(e,t);function e(r,i,n,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=i,s.query=n,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var Pe=Object.prototype.hasOwnProperty;function Aa(t){return t==null}function ts(t,e){var r=t.__typename,i=t.id,n=t._id;if(typeof r=="string"&&(e&&(e.keyObject=Aa(i)?Aa(n)?void 0:{_id:n}:{id:i}),Aa(i)&&!Aa(n)&&(i=n),!Aa(i)))return"".concat(r,":").concat(typeof i=="number"||typeof i=="string"?i:JSON.stringify(i))}var pd={dataIdFromObject:ts,addTypename:!0,resultCaching:!0,canonizeResults:!1};function fd(t){return jr(pd,t)}function rs(t){var e=t.canonizeResults;return e===void 0?pd.canonizeResults:e}function dd(t,e){return se(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var $u=/^[_a-z][_0-9a-z]*/i;function Wt(t){var e=t.match($u);return e?e[0]:t}function es(t,e,r){return fe(e)?Se(e)?e.every(function(i){return es(t,i,r)}):t.selections.every(function(i){if(Et(i)&&yr(i,r)){var n=Rt(i);return Pe.call(e,n)&&(!i.selectionSet||es(i.selectionSet,e[n],r))}return!0}):!1}function Br(t){return fe(t)&&!se(t)&&!Se(t)}function hd(){return new mt}function is(t,e){var r=Si(Ci(t));return{fragmentMap:r,lookupFragment:function(i){var n=r[i];return!n&&e&&(n=e.lookup(i)),n||null}}}var ns=Object.create(null),Lu=function(){return ns},md=Object.create(null),kn=function(){function t(e,r){var i=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(n,a){return va(se(n)?i.get(n.__ref,a):n&&n[a])},this.canRead=function(n){return se(n)?i.has(n.__ref):typeof n=="object"},this.toReference=function(n,a){if(typeof n=="string")return Xt(n);if(se(n))return n;var o=i.policies.identify(n)[0];if(o){var s=Xt(o);return a&&i.merge(o,n),s}}}return t.prototype.toObject=function(){return C({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),Pe.call(this.data,e)){var i=this.data[e];if(i&&Pe.call(i,r))return i[r]}if(r==="__typename"&&Pe.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Vr)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),Pe.call(this.data,e))return this.data[e];if(this instanceof Vr)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var i=this,n;se(e)&&(e=e.__ref),se(r)&&(r=r.__ref);var a=typeof e=="string"?this.lookup(n=e):e,o=typeof r=="string"?this.lookup(n=r):r;if(!!o){__DEV__?$(typeof n=="string","store.merge expects a string ID"):$(typeof n=="string",1);var s=new mt(iy).merge(a,o);if(this.data[n]=s,s!==a&&(delete this.refs[n],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(c){if(!a||a[c]!==s[c]){u[c]=1;var l=Wt(c);l!==c&&!i.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(i instanceof Vr)&&delete s[c]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[n]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(c){return i.group.dirty(n,c)})}}},t.prototype.modify=function(e,r){var i=this,n=this.lookup(e);if(n){var a=Object.create(null),o=!1,s=!0,u={DELETE:ns,INVALIDATE:md,isReference:se,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return i.policies.readField(typeof c=="string"?{fieldName:c,from:l||Xt(e)}:c,{store:i})}};if(Object.keys(n).forEach(function(c){var l=Wt(c),d=n[c];if(d!==void 0){var f=typeof r=="function"?r:r[c]||r[l];if(f){var p=f===Lu?ns:f(va(d),C(C({},u),{fieldName:l,storeFieldName:c,storage:i.getStorage(e,c)}));p===md?i.group.dirty(e,c):(p===ns&&(p=void 0),p!==d&&(a[c]=p,o=!0,d=p))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Vr?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,i){var n,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&i?this.policies.getStoreFieldName({typename:o,fieldName:r,args:i}):r;return this.modify(e,s?(n={},n[s]=Lu,n):Lu)}return!1},t.prototype.evict=function(e,r){var i=!1;return e.id&&(Pe.call(this.data,e.id)&&(i=this.delete(e.id,e.fieldName,e.args)),this instanceof Vr&&this!==r&&(i=this.parent.evict(e,r)||i),(e.fieldName||i)&&this.group.dirty(e.id,e.fieldName||"__exists")),i},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),i=[];return this.getRootIdSet().forEach(function(n){Pe.call(e.policies.rootTypenamesById,n)||i.push(n)}),i.length&&(r.__META={extraRootIds:i.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(a){e&&Pe.call(e,a)||r.delete(a)}),e){var i=e.__META,n=Yt(e,["__META"]);Object.keys(n).forEach(function(a){r.merge(a,n[a])}),i&&i.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Vr?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),i=this.toObject();r.forEach(function(o){Pe.call(i,o)&&(Object.keys(e.findChildRefIds(o)).forEach(r.add,r),delete i[o])});var n=Object.keys(i);if(n.length){for(var a=this;a instanceof Vr;)a=a.parent;n.forEach(function(o){return a.delete(o)})}return n},t.prototype.findChildRefIds=function(e){if(!Pe.call(this.refs,e)){var r=this.refs[e]=Object.create(null),i=this.data[e];if(!i)return r;var n=new Set([i]);n.forEach(function(a){se(a)&&(r[a.__ref]=!0),fe(a)&&Object.keys(a).forEach(function(o){var s=a[o];fe(s)&&n.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var gd=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?Xo():null,this.keyMaker=new tr(Pt)},t.prototype.depend=function(e,r){if(this.d){this.d(Fu(e,r));var i=Wt(r);i!==r&&this.d(Fu(e,i)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Fu(e,r),r==="__exists"?"forget":"setDirty")},t}();function Fu(t,e){return e+"#"+t}function Mu(t,e){Ii(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){Re(i,r);function i(n){var a=n.policies,o=n.resultCaching,s=o===void 0?!0:o,u=n.seed,c=r.call(this,a,new gd(s))||this;return c.stump=new ry(c),c.storageTrie=new tr(Pt),u&&c.replace(u),c}return i.prototype.addLayer=function(n,a){return this.stump.addLayer(n,a)},i.prototype.removeLayer=function(){return this},i.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},i}(t);t.Root=e})(kn||(kn={}));var Vr=function(t){Re(e,t);function e(r,i,n,a){var o=t.call(this,i.policies,a)||this;return o.id=r,o.parent=i,o.replay=n,o.group=a,n(o),o}return e.prototype.addLayer=function(r,i){return new e(r,this,i,this.group)},e.prototype.removeLayer=function(r){var i=this,n=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=i.data[a],s=n.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){ke(o[u],s[u])||i.group.dirty(a,u)}):(i.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){i.group.dirty(a,u)})):i.delete(a)}),n):n===this.parent?this:n.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return C(C({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var i=this.parent.findChildRefIds(r);return Pe.call(this.data,r)?C(C({},i),t.prototype.findChildRefIds.call(this,r)):i},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(kn),ry=function(t){Re(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new gd(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(Vr);function iy(t,e,r){var i=t[r],n=e[r];return ke(i,n)?i:n}function Ii(t){return!!(t instanceof kn&&t.group.caching)}function ny(t){return fe(t)?Se(t)?t.slice(0):C({__proto__:Object.getPrototypeOf(t)},t):t}var as=function(){function t(){this.known=new(_f?WeakSet:Set),this.pool=new tr(Pt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return fe(e)&&this.known.has(e)},t.prototype.pass=function(e){if(fe(e)){var r=ny(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(fe(e)){var i=this.passes.get(e);if(i)return i;var n=Object.getPrototypeOf(e);switch(n){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],c=this.sortedKeys(e);u.push(c.json);var l=u.length;c.sorted.forEach(function(p){u.push(r.admit(e[p]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(p,h){d[p]=u[l+h]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),i=this.pool.lookupArray(r);if(!i.keys){r.sort();var n=JSON.stringify(r);(i.keys=this.keysByJSON.get(n))||this.keysByJSON.set(n,i.keys={sorted:r,json:n})}return i.keys},t}();var xt=Object.assign(function(t){if(fe(t)){Uu===void 0&&yd();var e=Uu.admit(t),r=ju.get(e);return r===void 0&&ju.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:yd}),Uu,ju;function yd(){Uu=new as,ju=new(Pt?WeakMap:Map)}function vd(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var bd=function(){function t(e){var r=this;this.knownResults=new(Pt?WeakMap:Map),this.config=jr(e,{addTypename:e.addTypename!==!1,canonizeResults:rs(e)}),this.canon=e.canon||new as,this.executeSelectionSet=Ti(function(i){var n,a=i.context.canonizeResults,o=vd(i);o[3]=!a;var s=(n=r.executeSelectionSet).peek.apply(n,o);return s?a?C(C({},s),{result:r.canon.admit(s.result)}):s:(Mu(i.context.store,i.enclosingRef.__ref),r.execSelectionSetImpl(i))},{max:this.config.resultCacheMaxSize,keyArgs:vd,makeCacheKey:function(i,n,a,o){if(Ii(a.store))return a.store.makeCacheKey(i,se(n)?n.__ref:n,a.varString,o)}}),this.executeSubSelectedArray=Ti(function(i){return Mu(i.context.store,i.enclosingRef.__ref),r.execSubSelectedArrayImpl(i)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(i){var n=i.field,a=i.array,o=i.context;if(Ii(o.store))return o.store.makeCacheKey(n,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new as},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,i=e.query,n=e.rootId,a=n===void 0?"ROOT_QUERY":n,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=C(C({},xi(ma(i))),o);var f=Xt(a),p=this.executeSelectionSet({selectionSet:Ei(i).selectionSet,objectOrReference:f,enclosingRef:f,context:C({store:r,query:i,policies:d,variables:o,varString:xt(o),canonizeResults:l},is(i,this.config.fragments))}),h;if(p.missing&&(h=[new xa(ay(p.missing),p.missing,i,o)],!u))throw h[0];return{result:p.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,i,n){if(Ii(n.store)&&this.knownResults.get(e)===i){var a=this.executeSelectionSet.peek(i,r,n,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,i=e.selectionSet,n=e.objectOrReference,a=e.enclosingRef,o=e.context;if(se(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(n.__ref," object")};var s=o.variables,u=o.policies,c=o.store,l=c.getFieldValue(n,"__typename"),d=[],f,p=new mt;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(w,v){var D;return w.missing&&(f=p.merge(f,(D={},D[v]=w.missing,D))),w.result}var m=new Set(i.selections);m.forEach(function(w){var v,D;if(!!yr(w,s))if(Et(w)){var N=u.readField({fieldName:w.name.value,field:w,variables:o.variables,from:n},o),A=Rt(w);N===void 0?Ai.added(w)||(f=p.merge(f,(v={},v[A]="Can't find field '".concat(w.name.value,"' on ").concat(se(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),v))):Se(N)?N=h(r.executeSubSelectedArray({field:w,array:N,enclosingRef:a,context:o}),A):w.selectionSet?N!=null&&(N=h(r.executeSelectionSet({selectionSet:w.selectionSet,objectOrReference:N,enclosingRef:se(N)?N:a,context:o}),A)):o.canonizeResults&&(N=r.canon.pass(N)),N!==void 0&&d.push((D={},D[A]=N,D))}else{var R=wi(w,o.lookupFragment);if(!R&&w.kind===Me.FRAGMENT_SPREAD)throw __DEV__?new Z("No fragment named ".concat(w.name.value)):new Z(5);R&&u.fragmentMatches(R,l)&&R.selectionSet.selections.forEach(m.add,m)}});var b=ga(d),_={result:b,missing:f},S=o.canonizeResults?this.canon.admit(_):va(_);return S.result&&this.knownResults.set(S.result,i),S},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,i=e.field,n=e.array,a=e.enclosingRef,o=e.context,s,u=new mt;function c(l,d){var f;return l.missing&&(s=u.merge(s,(f={},f[d]=l.missing,f))),l.result}return i.selectionSet&&(n=n.filter(o.store.canRead)),n=n.map(function(l,d){return l===null?null:Se(l)?c(r.executeSubSelectedArray({field:i,array:l,enclosingRef:a,context:o}),d):i.selectionSet?c(r.executeSelectionSet({selectionSet:i.selectionSet,objectOrReference:l,enclosingRef:se(l)?l:a,context:o}),d):(__DEV__&&oy(o.store,i,l),l)}),{result:o.canonizeResults?this.canon.admit(n):n,missing:s}},t}();function ay(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function oy(t,e,r){if(!e.selectionSet){var i=new Set([r]);i.forEach(function(n){fe(n)&&(__DEV__?$(!se(n),"Missing selection set for object of type ".concat(dd(t,n)," returned for query field ").concat(e.name.value)):$(!se(n),6),Object.values(n).forEach(i.add,i))})}}var Tn=new xn,_d=new WeakMap;function ka(t){var e=_d.get(t);return e||_d.set(t,e={vars:new Set,dep:Xo()}),e}function qu(t){ka(t).vars.forEach(function(e){return e.forgetCache(t)})}function Sd(t){ka(t).vars.forEach(function(e){return e.attachCache(t)})}function os(t){var e=new Set,r=new Set,i=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){ka(u).dep.dirty(i),sy(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=Tn.getValue();s&&(n(s),ka(s).dep(i))}return t};i.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var n=i.attachCache=function(a){return e.add(a),ka(a).vars.add(i),i};return i.forgetCache=function(a){return e.delete(a)},i}function sy(t){t.broadcastWatches&&t.broadcastWatches()}var wd=Object.create(null);function Bu(t){var e=JSON.stringify(t);return wd[e]||(wd[e]=Object.create(null))}function Vu(t){var e=Bu(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,i){var n=function(o,s){return i.readField(s,o)},a=i.keyObject=zu(t,function(o){var s=In(i.storeObject,o,n);return s===void 0&&r!==i.storeObject&&Pe.call(r,o[0])&&(s=In(r,o,Ed)),__DEV__?$(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):$(s!==void 0,2),s});return"".concat(i.typename,":").concat(JSON.stringify(a))})}function Qu(t){var e=Bu(t);return e.keyArgsFn||(e.keyArgsFn=function(r,i){var n=i.field,a=i.variables,o=i.fieldName,s=zu(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(n&&qe(n.directives)){var f=l.slice(1),p=n.directives.find(function(_){return _.name.value===f}),h=p&&vr(p,a);return h&&In(h,c.slice(1))}return}if(d==="$"){var m=l.slice(1);if(a&&Pe.call(a,m)){var b=c.slice(0);return b[0]=m,In(a,b)}return}if(r)return In(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function zu(t,e){var r=new mt;return Cd(t).reduce(function(i,n){var a,o=e(n);if(o!==void 0){for(var s=n.length-1;s>=0;--s)o=(a={},a[n[s]]=o,a);i=r.merge(i,o)}return i},Object.create(null))}function Cd(t){var e=Bu(t);if(!e.paths){var r=e.paths=[],i=[];t.forEach(function(n,a){Se(n)?(Cd(n).forEach(function(o){return r.push(i.concat(o))}),i.length=0):(i.push(n),Se(t[a+1])||(r.push(i.slice(0)),i.length=0))})}return e.paths}function Ed(t,e){return t[e]}function In(t,e,r){return r=r||Ed,xd(e.reduce(function i(n,a){return Se(n)?n.map(function(o){return i(o,a)}):n&&r(n,a)},t))}function xd(t){return fe(t)?Se(t)?t.map(xd):zu(Object.keys(t).sort(),function(e){return In(t,e)}):t}da.setStringify(xt);function Wu(t){return t.args!==void 0?t.args:t.field?vr(t.field,t.variables):null}var cy=function(){},Ad=function(t,e){return e.fieldName},kd=function(t,e,r){var i=r.mergeObjects;return i(t,e)},Td=function(t,e){return e},Od=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=C({dataIdFromObject:ts},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,r){var i,n=this,a=r&&(r.typename||((i=r.storeObject)===null||i===void 0?void 0:i.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=C(C({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var f=ss(arguments,o);return n.readField(f,{store:n.cache.data,variables:f.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(Se(d))l=Vu(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(i){var n=e[i],a=n.queryType,o=n.mutationType,s=n.subscriptionType,u=Yt(n,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",i),o&&r.setRootTypename("Mutation",i),s&&r.setRootTypename("Subscription",i),Pe.call(r.toBeAdded,i)?r.toBeAdded[i].push(u):r.toBeAdded[i]=[u]})},t.prototype.updateTypePolicy=function(e,r){var i=this,n=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?kd:c===!1?Td:u.merge}s(n,r.merge),n.keyFn=a===!1?cy:Se(a)?Vu(a):typeof a=="function"?a:n.keyFn,o&&Object.keys(o).forEach(function(u){var c=i.getFieldPolicy(e,u,!0),l=o[u];if(typeof l=="function")c.read=l;else{var d=l.keyArgs,f=l.read,p=l.merge;c.keyFn=d===!1?Ad:Se(d)?Qu(d):typeof d=="function"?d:c.keyFn,typeof f=="function"&&(c.read=f),s(c,p)}c.read&&c.merge&&(c.keyFn=c.keyFn||Ad)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var i="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[i];r!==n&&(__DEV__?$(!n||n===e,"Cannot change root ".concat(e," __typename more than once")):$(!n||n===e,3),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[r]=i,this.rootTypenamesById[i]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(i){r.getSupertypeSet(i,!0),e[i].forEach(function(n){r.getSupertypeSet(n,!0).add(i);var a=n.match($u);(!a||a[0]!==n)&&r.fuzzySubtypes.set(n,new RegExp(n))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!Pe.call(this.typePolicies,e)){var i=this.typePolicies[e]=Object.create(null);i.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=Yt(s,["fields"]);Object.assign(i,c),Object.assign(i.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,i){if(e){var n=this.getTypePolicy(e).fields;return n[r]||i&&(n[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var i=this.supertypeMap.get(e);return!i&&r&&this.supertypeMap.set(e,i=new Set),i},t.prototype.fragmentMatches=function(e,r,i,n){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],c=function(h){var m=a.getSupertypeSet(h,!1);m&&m.size&&u.indexOf(m)<0&&u.push(m)},l=!!(i&&this.fuzzySubtypes.size),d=!1,f=0;f<u.length;++f){var p=u[f];if(p.has(o))return s.has(o)||(d&&__DEV__&&$.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;p.forEach(c),l&&f===u.length-1&&es(e.selectionSet,i,n)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,m){var b=r.match(h);b&&b[0]===r&&c(m)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var i=this.getFieldPolicy(e,r,!1);return!!(i&&i.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,i=e.fieldName,n=this.getFieldPolicy(r,i,!1),a,o=n&&n.keyFn;if(o&&r)for(var s={typename:r,fieldName:i,field:e.field||null,variables:e.variables},u=Wu(e);o;){var c=o(u,s);if(Se(c))o=Qu(c);else{a=c||i;break}}return a===void 0&&(a=e.field?ru(e.field,e.variables):da(i,Wu(e))),a===!1?i:i===Wt(a)?a:i+":"+a},t.prototype.readField=function(e,r){var i=e.from;if(!!i){var n=e.field||e.fieldName;if(!!n){if(e.typename===void 0){var a=r.store.getFieldValue(i,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=Wt(o),u=r.store.getFieldValue(i,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=Id(this,i,e,r,r.store.getStorage(se(i)?i.__ref:i,o));return Tn.withValue(this.cache,l,[u,d])}return u}}},t.prototype.getReadFunction=function(e,r){var i=this.getFieldPolicy(e,r,!1);return i&&i.read},t.prototype.getMergeFunction=function(e,r,i){var n=this.getFieldPolicy(e,r,!1),a=n&&n.merge;return!a&&i&&(n=this.getTypePolicy(i),a=n&&n.merge),a},t.prototype.runMergeFunction=function(e,r,i,n,a){var o=i.field,s=i.typename,u=i.merge;return u===kd?Dd(n.store)(e,r):u===Td?r:(n.overwrite&&(e=void 0),u(e,r,Id(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:n.variables},n,a||Object.create(null))))},t}();function Id(t,e,r,i,n){var a=t.getStoreFieldName(r),o=Wt(a),s=r.variables||i.variables,u=i.store,c=u.toReference,l=u.canRead;return{args:Wu(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:se,toReference:c,storage:n,cache:t.cache,canRead:l,readField:function(){return t.readField(ss(arguments,e,s),i)},mergeObjects:Dd(i.store)}}function ss(t,e,r){var i=t[0],n=t[1],a=t.length,o;return typeof i=="string"?o={fieldName:i,from:a>1?n:e}:(o=C({},i),Pe.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&$.warn("Undefined 'from' passed to readField with arguments ".concat(Ef(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function Dd(t){return function(r,i){if(Se(r)||Se(i))throw __DEV__?new Z("Cannot automatically merge arrays"):new Z(4);if(fe(r)&&fe(i)){var n=t.getFieldValue(r,"__typename"),a=t.getFieldValue(i,"__typename"),o=n&&a&&n!==a;if(o)return i;if(se(r)&&Br(i))return t.merge(r.__ref,i),r;if(Br(r)&&se(i))return t.merge(r,i.__ref),i;if(Br(r)&&Br(i))return C(C({},r),i)}return i}}function Hu(t,e,r){var i="".concat(e).concat(r),n=t.flavors.get(i);return n||t.flavors.set(i,n=t.clientOnly===e&&t.deferred===r?t:C(C({},t),{clientOnly:e,deferred:r})),n}var $d=function(){function t(e,r,i){this.cache=e,this.reader=r,this.fragments=i}return t.prototype.writeToStore=function(e,r){var i=this,n=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=er(n),l=hd();s=C(C({},xi(c)),s);var d=C(C({store:e,written:Object.create(null),merge:function(p,h){return l.merge(p,h)},variables:s,varString:xt(s)},is(n,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!se(f))throw __DEV__?new Z("Could not identify object ".concat(JSON.stringify(a))):new Z(7);return d.incomingById.forEach(function(p,h){var m=p.storeObject,b=p.mergeTree,_=p.fieldNodeSet,S=Xt(h);if(b&&b.map.size){var w=i.applyMerges(b,S,m,d);if(se(w))return;m=w}if(__DEV__&&!d.overwrite){var v=Object.create(null);_.forEach(function(A){A.selectionSet&&(v[A.name.value]=!0)});var D=function(A){return v[Wt(A)]===!0},N=function(A){var R=b&&b.map.get(A);return Boolean(R&&R.info&&R.info.merge)};Object.keys(m).forEach(function(A){D(A)&&!N(A)&&uy(S,m,A,d.store)})}e.merge(h,m)}),e.retain(f.__ref),f},t.prototype.processSelectionSet=function(e){var r=this,i=e.dataId,n=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=i&&u.rootTypenamesById[i]||ha(n,a,o.fragmentMap)||i&&o.store.get(i,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var w=ss(arguments,c,o.variables);if(se(w.from)){var v=o.incomingById.get(w.from.__ref);if(v){var D=u.readField(C(C({},w),{from:v.storeObject}),o);if(D!==void 0)return D}}return u.readField(w,o)},f=new Set;this.flattenFields(a,n,o,l).forEach(function(w,v){var D,N=Rt(v),A=n[N];if(f.add(v),A!==void 0){var R=u.getStoreFieldName({typename:l,fieldName:v.name.value,field:v,variables:w.variables}),F=Nd(s,R),P=r.processFieldValue(A,v,v.selectionSet?Hu(w,!1,!1):w,F),j=void 0;v.selectionSet&&(se(P)||Br(P))&&(j=d("__typename",P));var Je=u.getMergeFunction(l,v.name.value,j);Je?F.info={field:v,typename:l,merge:Je}:Rd(s,R),c=w.merge(c,(D={},D[R]=P,D))}else __DEV__&&!w.clientOnly&&!w.deferred&&!Ai.added(v)&&!u.getReadFunction(l,v.name.value)&&__DEV__&&$.error("Missing field '".concat(Rt(v),"' while writing result ").concat(JSON.stringify(n,null,2)).substring(0,1e3))});try{var p=u.identify(n,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=p[0],m=p[1];i=i||h,m&&(c=o.merge(c,m))}catch(w){if(!i)throw w}if(typeof i=="string"){var b=Xt(i),_=o.written[i]||(o.written[i]=[]);if(_.indexOf(a)>=0||(_.push(a),this.reader&&this.reader.isFresh(n,b,a,o)))return b;var S=o.incomingById.get(i);return S?(S.storeObject=o.merge(S.storeObject,c),S.mergeTree=Gu(S.mergeTree,s),f.forEach(function(w){return S.fieldNodeSet.add(w)})):o.incomingById.set(i,{storeObject:c,mergeTree:cs(s)?void 0:s,fieldNodeSet:f}),b}return c},t.prototype.processFieldValue=function(e,r,i,n){var a=this;return!r.selectionSet||e===null?__DEV__?Bo(e):e:Se(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,i,Nd(n,s));return Rd(n,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:i,mergeTree:n})},t.prototype.flattenFields=function(e,r,i,n){n===void 0&&(n=ha(r,e,i.fragmentMap));var a=new Map,o=this.cache.policies,s=new tr(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(f){if(!!yr(f,i.variables)){var p=l.clientOnly,h=l.deferred;if(!(p&&h)&&qe(f.directives)&&f.directives.forEach(function(_){var S=_.name.value;if(S==="client"&&(p=!0),S==="defer"){var w=vr(_,i.variables);(!w||w.if!==!1)&&(h=!0)}}),Et(f)){var m=a.get(f);m&&(p=p&&m.clientOnly,h=h&&m.deferred),a.set(f,Hu(i,p,h))}else{var b=wi(f,i.lookupFragment);if(!b&&f.kind===Me.FRAGMENT_SPREAD)throw __DEV__?new Z("No fragment named ".concat(f.name.value)):new Z(8);b&&o.fragmentMatches(b,n,r,i.variables)&&u(b.selectionSet,Hu(i,p,h))}}}))}(e,i),a},t.prototype.applyMerges=function(e,r,i,n,a){var o,s=this;if(e.map.size&&!se(i)){var u=!Se(i)&&(se(r)||Br(r))?r:void 0,c=i;u&&!a&&(a=[se(u)?u.__ref:u]);var l,d=function(f,p){return Se(f)?typeof p=="number"?f[p]:void 0:n.store.getFieldValue(f,String(p))};e.map.forEach(function(f,p){var h=d(u,p),m=d(c,p);if(m!==void 0){a&&a.push(p);var b=s.applyMerges(f,h,m,n,a);b!==m&&(l=l||new Map,l.set(p,b)),a&&$(a.pop()===p)}}),l&&(i=Se(c)?c.slice(0):C({},c),l.forEach(function(f,p){i[p]=f}))}return e.info?this.cache.policies.runMergeFunction(r,i,e.info,n,a&&(o=n.store).getStorage.apply(o,a)):i},t}();var Ld=[];function Nd(t,e){var r=t.map;return r.has(e)||r.set(e,Ld.pop()||{map:new Map}),r.get(e)}function Gu(t,e){if(t===e||!e||cs(e))return t;if(!t||cs(t))return e;var r=t.info&&e.info?C(C({},t.info),e.info):t.info||e.info,i=t.map.size&&e.map.size,n=i?new Map:t.map.size?t.map:e.map,a={info:r,map:n};if(i){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,Gu(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,Gu(e.map.get(s),t.map.get(s)))})}return a}function cs(t){return!t||!(t.info||t.map.size)}function Rd(t,e){var r=t.map,i=r.get(e);i&&cs(i)&&(Ld.push(i),r.delete(e))}var Pd=new Set;function uy(t,e,r,i){var n=function(d){var f=i.getFieldValue(d,r);return typeof f=="object"&&f},a=n(t);if(!!a){var o=n(e);if(!!o&&!se(a)&&!ke(a,o)&&!Object.keys(a).every(function(d){return i.getFieldValue(o,d)!==void 0})){var s=i.getFieldValue(t,"__typename")||i.getFieldValue(e,"__typename"),u=Wt(r),c="".concat(s,".").concat(u);if(!Pd.has(c)){Pd.add(c);var l=[];!Se(a)&&!Se(o)&&[a,o].forEach(function(d){var f=i.getFieldValue(d,"__typename");typeof f=="string"&&!l.includes(f)&&l.push(f)}),__DEV__&&$.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
39
39
 
40
40
  To address this problem (which is not a bug in Apollo Client), `).concat(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(c,` field, so InMemoryCache can safely merge these objects:
41
41
 
@@ -46,11 +46,11 @@ For more information about these options, please refer to the documentation:
46
46
 
47
47
  * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers
48
48
  * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects
49
- `))}}}}var Ta=function(t){Re(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;return i.watches=new Set,i.typenameDocumentCache=new Map,i.makeVar=os,i.txCount=0,i.config=fd(r),i.addTypename=!!i.config.addTypename,i.policies=new Od({cache:i,dataIdFromObject:i.config.dataIdFromObject,possibleTypes:i.config.possibleTypes,typePolicies:i.config.typePolicies}),i.init(),i}return e.prototype.init=function(){var r=this.data=new An.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},e.prototype.resetResultCache=function(r){var i=this,n=this.storeReader,a=this.config.fragments;this.storeWriter=new $d(this,this.storeReader=new bd({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:rs(this.config),canon:r?void 0:n&&n.canon,fragments:a}),a),this.maybeBroadcastWatch=Ti(function(o,s){return i.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?i.optimisticData:i.data;if(Ii(s)){var u=o.optimistic,c=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,xt({optimistic:u,id:c,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},e.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},e.prototype.read=function(r){var i=r.returnPartialData,n=i===void 0?!1:i;try{return this.storeReader.diffQueryAgainstStore(C(C({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(a){if(a instanceof xa)return null;throw a}},e.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(r){if(Pe.call(r,"id")&&!r.id)return!1;var i=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,i.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(C(C({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(r){var i=this;return this.watches.size||Sd(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){i.watches.delete(r)&&!i.watches.size&&qu(i),i.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){xt.reset();var i=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),i},e.prototype.retain=function(r,i){return(i?this.optimisticData:this.data).retain(r)},e.prototype.release=function(r,i){return(i?this.optimisticData:this.data).release(r)},e.prototype.identify=function(r){if(se(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(i){__DEV__&&$.warn(i)}},e.prototype.evict=function(r){if(!r.id){if(Pe.call(r,"id"))return!1;r=C(C({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(r){var i=this;return this.init(),xt.reset(),r&&r.discardWatches?(this.watches.forEach(function(n){return i.maybeBroadcastWatch.forget(n)}),this.watches.clear(),qu(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var i=this.optimisticData.removeLayer(r);i!==this.optimisticData&&(this.optimisticData=i,this.broadcastWatches())},e.prototype.batch=function(r){var i=this,n=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,u=r.onWatchUpdated,c,l=function(f){var p=i,h=p.data,m=p.optimisticData;++i.txCount,f&&(i.data=i.optimisticData=f);try{return c=n(i)}finally{--i.txCount,i.data=h,i.optimisticData=m}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(C(C({},r),{onWatchUpdated:function(f){return d.add(f),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&d.size?(this.broadcastWatches(C(C({},r),{onWatchUpdated:function(f,p){var h=u.call(this,f,p);return h!==!1&&d.delete(f),h}})),d.size&&d.forEach(function(f){return i.maybeBroadcastWatch.dirty(f)})):this.broadcastWatches(r),c},e.prototype.performTransaction=function(r,i){return this.batch({update:r,optimistic:i||i!==null})},e.prototype.transformDocument=function(r){if(this.addTypename){var i=this.typenameDocumentCache.get(r);return i||(i=Ai(r),this.typenameDocumentCache.set(r,i),this.typenameDocumentCache.set(i,i)),i}return r},e.prototype.transformForLink=function(r){var i=this.config.fragments;return i?i.transform(r):r},e.prototype.broadcastWatches=function(r){var i=this;this.txCount||this.watches.forEach(function(n){return i.maybeBroadcastWatch(n,r)})},e.prototype.broadcastWatch=function(r,i){var n=r.lastDiff,a=this.diff(r);i&&(r.optimistic&&typeof i.optimistic=="string"&&(a.fromOptimisticTransaction=!0),i.onWatchUpdated&&i.onWatchUpdated.call(this,r,a,n)===!1)||(!n||!ke(n.result,a.result))&&r.callback(r.lastDiff=a,n)},e}(Pu);function Fd(t){return t.hasOwnProperty("graphQLErrors")}var ly=function(t){var e="";if(qe(t.graphQLErrors)||qe(t.clientErrors)){var r=(t.graphQLErrors||[]).concat(t.clientErrors||[]);r.forEach(function(i){var n=i?i.message:"Error message not found.";e+="".concat(n,`
49
+ `))}}}}var Ta=function(t){Re(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;return i.watches=new Set,i.typenameDocumentCache=new Map,i.makeVar=os,i.txCount=0,i.config=fd(r),i.addTypename=!!i.config.addTypename,i.policies=new Od({cache:i,dataIdFromObject:i.config.dataIdFromObject,possibleTypes:i.config.possibleTypes,typePolicies:i.config.typePolicies}),i.init(),i}return e.prototype.init=function(){var r=this.data=new kn.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},e.prototype.resetResultCache=function(r){var i=this,n=this.storeReader,a=this.config.fragments;this.storeWriter=new $d(this,this.storeReader=new bd({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:rs(this.config),canon:r?void 0:n&&n.canon,fragments:a}),a),this.maybeBroadcastWatch=Ti(function(o,s){return i.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?i.optimisticData:i.data;if(Ii(s)){var u=o.optimistic,c=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,xt({optimistic:u,id:c,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},e.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},e.prototype.read=function(r){var i=r.returnPartialData,n=i===void 0?!1:i;try{return this.storeReader.diffQueryAgainstStore(C(C({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(a){if(a instanceof xa)return null;throw a}},e.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(r){if(Pe.call(r,"id")&&!r.id)return!1;var i=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,i.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(C(C({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(r){var i=this;return this.watches.size||Sd(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){i.watches.delete(r)&&!i.watches.size&&qu(i),i.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){xt.reset();var i=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),i},e.prototype.retain=function(r,i){return(i?this.optimisticData:this.data).retain(r)},e.prototype.release=function(r,i){return(i?this.optimisticData:this.data).release(r)},e.prototype.identify=function(r){if(se(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(i){__DEV__&&$.warn(i)}},e.prototype.evict=function(r){if(!r.id){if(Pe.call(r,"id"))return!1;r=C(C({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(r){var i=this;return this.init(),xt.reset(),r&&r.discardWatches?(this.watches.forEach(function(n){return i.maybeBroadcastWatch.forget(n)}),this.watches.clear(),qu(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var i=this.optimisticData.removeLayer(r);i!==this.optimisticData&&(this.optimisticData=i,this.broadcastWatches())},e.prototype.batch=function(r){var i=this,n=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,u=r.onWatchUpdated,c,l=function(f){var p=i,h=p.data,m=p.optimisticData;++i.txCount,f&&(i.data=i.optimisticData=f);try{return c=n(i)}finally{--i.txCount,i.data=h,i.optimisticData=m}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(C(C({},r),{onWatchUpdated:function(f){return d.add(f),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&d.size?(this.broadcastWatches(C(C({},r),{onWatchUpdated:function(f,p){var h=u.call(this,f,p);return h!==!1&&d.delete(f),h}})),d.size&&d.forEach(function(f){return i.maybeBroadcastWatch.dirty(f)})):this.broadcastWatches(r),c},e.prototype.performTransaction=function(r,i){return this.batch({update:r,optimistic:i||i!==null})},e.prototype.transformDocument=function(r){if(this.addTypename){var i=this.typenameDocumentCache.get(r);return i||(i=Ai(r),this.typenameDocumentCache.set(r,i),this.typenameDocumentCache.set(i,i)),i}return r},e.prototype.transformForLink=function(r){var i=this.config.fragments;return i?i.transform(r):r},e.prototype.broadcastWatches=function(r){var i=this;this.txCount||this.watches.forEach(function(n){return i.maybeBroadcastWatch(n,r)})},e.prototype.broadcastWatch=function(r,i){var n=r.lastDiff,a=this.diff(r);i&&(r.optimistic&&typeof i.optimistic=="string"&&(a.fromOptimisticTransaction=!0),i.onWatchUpdated&&i.onWatchUpdated.call(this,r,a,n)===!1)||(!n||!ke(n.result,a.result))&&r.callback(r.lastDiff=a,n)},e}(Pu);function Fd(t){return t.hasOwnProperty("graphQLErrors")}var ly=function(t){var e="";if(qe(t.graphQLErrors)||qe(t.clientErrors)){var r=(t.graphQLErrors||[]).concat(t.clientErrors||[]);r.forEach(function(i){var n=i?i.message:"Error message not found.";e+="".concat(n,`
50
50
  `)})}return t.networkError&&(e+="".concat(t.networkError.message,`
51
51
  `)),e=e.replace(/\n$/,""),e},br=function(t){Re(e,t);function e(r){var i=r.graphQLErrors,n=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,u=t.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=i||[],u.clientErrors=n||[],u.networkError=a||null,u.message=o||ly(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var ye;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"})(ye||(ye={}));function Qr(t){return t?t<7:!1}var py=Object.assign,fy=Object.hasOwnProperty,us=function(t){Re(e,t);function e(r){var i=r.queryManager,n=r.queryInfo,a=r.options,o=t.call(this,function(b){try{var _=b._subscription._observer;_&&!_.error&&(_.error=dy)}catch{}var S=!o.observers.size;o.observers.add(b);var w=o.last;return w&&w.error?b.error&&b.error(w.error):w&&w.result&&b.next&&b.next(w.result),S&&o.reobserve().catch(function(){}),function(){o.observers.delete(b)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=n,o.queryManager=i,o.isTornDown=!1;var s=i.defaultOptions.watchQuery,u=s===void 0?{}:s,c=u.fetchPolicy,l=c===void 0?"cache-first":c,d=a.fetchPolicy,f=d===void 0?l:d,p=a.initialFetchPolicy,h=p===void 0?f==="standby"?l:f:p;o.options=C(C({},a),{initialFetchPolicy:h,fetchPolicy:f}),o.queryId=n.queryId||i.generateQueryId();var m=er(o.query);return o.queryName=m&&m.name&&m.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var r=this;return new Promise(function(i,n){var a={next:function(s){i(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:n},o=r.subscribe(a)})},e.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var i=this.getLastResult(!0),n=this.queryInfo.networkStatus||i&&i.networkStatus||ye.ready,a=C(C({},i),{loading:Qr(n),networkStatus:n}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(a.data=u.result),ke(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===ye.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=ye.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&Zu(u.missing)}return r&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(r,i){return!this.last||!ke(this.last.result,r)||i&&!ke(this.last.variables,i)},e.prototype.getLast=function(r,i){var n=this.last;if(n&&n[r]&&(!i||ke(n.variables,this.variables)))return n[r]},e.prototype.getLastResult=function(r){return this.getLast("result",r)},e.prototype.getLastError=function(r){return this.getLast("error",r)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(r){var i,n={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?n.fetchPolicy=a:a==="no-cache"?n.fetchPolicy="no-cache":n.fetchPolicy="network-only",__DEV__&&r&&fy.call(r,"variables")){var o=ma(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&$.warn("Called refetch(".concat(JSON.stringify(r),") for query ").concat(((i=o.name)===null||i===void 0?void 0:i.value)||JSON.stringify(o),`, which does not declare a $variables variable.
52
- Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!ke(this.options.variables,r)&&(n.variables=this.options.variables=C(C({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(n,ye.refetch)},e.prototype.fetchMore=function(r){var i=this,n=C(C({},r.query?r:C(C(C(C({},this.options),{query:this.query}),r),{variables:C(C({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=ye.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,n,ye.fetchMore).then(function(c){return i.queryManager.removeQuery(a),o.networkStatus===ye.fetchMore&&(o.networkStatus=s),i.queryManager.cache.batch({update:function(l){var d=r.updateQuery;d?l.updateQuery({query:i.query,variables:i.variables,returnPartialData:!0,optimistic:!1},function(f){return d(f,{fetchMoreResult:c.data,variables:n.variables})}):l.writeQuery({query:n.query,variables:n.variables,data:c.data})},onWatchUpdated:function(l){u.add(l.query)}}),c}).finally(function(){u.has(i.query)||Ku(i)})},e.prototype.subscribeToMore=function(r){var i=this,n=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&i.updateQuery(function(s,u){var c=u.variables;return o(s,{subscriptionData:a,variables:c})})},error:function(a){if(r.onError){r.onError(a);return}__DEV__&&$.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(n),function(){i.subscriptions.delete(n)&&n.unsubscribe()}},e.prototype.setOptions=function(r){return this.reobserve(r)},e.prototype.setVariables=function(r){return ke(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},ye.setVariables):Promise.resolve())},e.prototype.updateQuery=function(r){var i=this.queryManager,n=i.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(n,{variables:this.variables});a&&(i.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),i.broadcastQueries())},e.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(r,i){if(i.nextFetchPolicy){var n=i.fetchPolicy,a=n===void 0?"cache-first":n,o=i.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof i.nextFetchPolicy=="function"?i.fetchPolicy=i.nextFetchPolicy(a,{reason:r,options:i,observable:this,initialFetchPolicy:s}):r==="variables-changed"?i.fetchPolicy=s:i.fetchPolicy=i.nextFetchPolicy)}return i.fetchPolicy},e.prototype.fetch=function(r,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,r,i)},e.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var i=this,n=i.pollingInfo,a=i.options.pollInterval;if(!a){n&&(clearTimeout(n.timeout),delete this.pollingInfo);return}if(!(n&&n.interval===a)){__DEV__?$(a,"Attempted to start a polling query without a polling interval."):$(a,13);var o=n||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(Qr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},ye.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},e.prototype.updateLastResult=function(r,i){return i===void 0&&(i=this.variables),this.last=C(C({},this.last),{result:this.queryManager.assumeImmutableResults?r:Bo(r),variables:i}),qe(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,i){var n=this;this.isTornDown=!1;var a=i===ye.refetch||i===ye.fetchMore||i===ye.poll,o=this.options.variables,s=this.options.fetchPolicy,u=jr(this.options,r||{}),c=a?u:py(this.options,u);a||(this.updatePolling(),r&&r.variables&&!ke(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),i===void 0&&(i=ye.setVariables)));var l=c.variables&&C({},c.variables),d=this.fetch(c,i),f={next:function(p){n.reportResult(p,l)},error:function(p){n.reportError(p,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=f),d.addObserver(f),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,i){var n=this.getLastError();(n||this.isDifferentFromLastResult(r,i))&&((n||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,i),ki(this.observers,"next",r))},e.prototype.reportError=function(r,i){var n=C(C({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:ye.error,loading:!1});this.updateLastResult(n,i),ki(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(oe);Qo(us);function Ku(t){var e=t.options,r=e.fetchPolicy,i=e.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=i,typeof i=="function"?i.apply(this,arguments):r}}):t.reobserve()}function dy(t){__DEV__&&$.error("Unhandled error",t.message,t.stack)}function Zu(t){__DEV__&&t&&__DEV__&&$.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var ls=function(){function t(e){var r=e.cache,i=e.client,n=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,i&&(this.client=i),n&&this.addResolvers(n),a&&this.setFragmentMatcher(a)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(i){r.resolvers=uu(r.resolvers,i)}):this.resolvers=uu(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){var r=e.document,i=e.remoteResult,n=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return Bt(this,void 0,void 0,function(){return Vt(this,function(u){return r?[2,this.resolveDocument(r,i.data,n,a,this.fragmentMatcher,s).then(function(c){return C(C({},i),{data:c.result})})]:[2,i]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return gn(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return cu(e)},t.prototype.prepareContext=function(e){var r=this.cache;return C(C({},e),{cache:r,getCacheKey:function(i){return r.identify(i)}})},t.prototype.addExportedVariables=function(e,r,i){return r===void 0&&(r={}),i===void 0&&(i={}),Bt(this,void 0,void 0,function(){return Vt(this,function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(i),r).then(function(a){return C(C({},r),a.exportedVariables)})]:[2,C({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return nt(e,{Directive:{enter:function(i){if(i.name.value==="client"&&i.arguments&&(r=i.arguments.some(function(n){return n.name.value==="always"&&n.value.kind==="BooleanValue"&&n.value.value===!0}),r))return _i}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:su(e),variables:r,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,r,i,n,a,o){return i===void 0&&(i={}),n===void 0&&(n={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),Bt(this,void 0,void 0,function(){var s,u,c,l,d,f,p,h,m,b,_;return Vt(this,function(S){return s=Ei(e),u=Ci(e),c=Si(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,f=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",p=this,h=p.cache,m=p.client,b={fragmentMap:c,context:C(C({},i),{cache:h,client:m}),variables:n,fragmentMatcher:a,defaultOperationType:f,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},_=!1,[2,this.resolveSelectionSet(s.selectionSet,_,r,b).then(function(w){return{result:w,exportedVariables:b.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,i,n){return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return Vt(this,function(d){return a=n.fragmentMap,o=n.context,s=n.variables,u=[i],c=function(f){return Bt(l,void 0,void 0,function(){var p,h;return Vt(this,function(m){return!r&&!n.selectionsToResolve.has(f)?[2]:yr(f,s)?Et(f)?[2,this.resolveField(f,r,i,n).then(function(b){var _;typeof b<"u"&&u.push((_={},_[Rt(f)]=b,_))})]:(iu(f)?p=f:(p=a[f.name.value],__DEV__?$(p,"No fragment named ".concat(f.name.value)):$(p,11)),p&&p.typeCondition&&(h=p.typeCondition.name.value,n.fragmentMatcher(i,h,o))?[2,this.resolveSelectionSet(p.selectionSet,r,i,n).then(function(b){u.push(b)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return ga(u)})]})})},t.prototype.resolveField=function(e,r,i,n){return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h=this;return Vt(this,function(m){return i?(a=n.variables,o=e.name.value,s=Rt(e),u=o!==s,c=i[s]||i[o],l=Promise.resolve(c),(!n.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=i.__typename||n.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(p=f[u?o:s],p&&(l=Promise.resolve(kn.withValue(this.cache,p,[i,vr(e,a),n.context,{field:e,fragmentMap:n.fragmentMap}]))))),[2,l.then(function(b){var _,S;if(b===void 0&&(b=c),e.directives&&e.directives.forEach(function(v){v.name.value==="export"&&v.arguments&&v.arguments.forEach(function(D){D.name.value==="as"&&D.value.kind==="StringValue"&&(n.exportedVariables[D.value.value]=b)})}),!e.selectionSet||b==null)return b;var w=(S=(_=e.directives)===null||_===void 0?void 0:_.some(function(v){return v.name.value==="client"}))!==null&&S!==void 0?S:!1;if(Array.isArray(b))return h.resolveSubSelectedArray(e,r||w,b,n);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||w,b,n)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,i,n){var a=this;return Promise.all(i.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,r,o,n);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,r,o,n)}))},t.prototype.collectSelectionsToResolve=function(e,r){var i=function(o){return!Array.isArray(o)},n=this.selectionsToResolveCache;function a(o){if(!n.has(o)){var s=new Set;n.set(o,s),nt(o,{Directive:function(u,c,l,d,f){u.name.value==="client"&&f.forEach(function(p){i(p)&&pa(p)&&s.add(p)})},FragmentSpread:function(u,c,l,d,f){var p=r[u.name.value];__DEV__?$(p,"No fragment named ".concat(u.name.value)):$(p,12);var h=a(p);h.size>0&&(f.forEach(function(m){i(m)&&pa(m)&&s.add(m)}),s.add(u),h.forEach(function(m){s.add(m)}))}})}return n.get(o)}return a(e)},t}();var In=new(Pt?WeakMap:Map);function Ju(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return In.set(t,(In.get(t)+1)%1e15),r.apply(this,arguments)})}function Md(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var ps=function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var i=this.cache=e.cache;In.has(i)||(In.set(i,0),Ju(i,"evict"),Ju(i,"modify"),Ju(i,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||ye.loading;return this.variables&&this.networkStatus!==ye.loading&&!ke(this.variables,e.variables)&&(r=ye.setVariables),ke(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){Md(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&ke(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var i=this.observableQuery;if(i&&i.options.fetchPolicy==="no-cache")return{complete:!1};var n=this.cache.diff(r);return this.updateLastDiff(n,r),n},t.prototype.updateLastDiff=function(e,r){this.lastDiff=e?{diff:e,options:r||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var r;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},t.prototype.setDiff=function(e){var r=this,i=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!ke(i&&i.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},t.prototype.setObservableQuery=function(e){var r=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var i=r.getDiff();i.fromOptimisticTransaction?e.observe():Ku(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Md(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Qr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var i=this.observableQuery;if(!(i&&i.options.fetchPolicy==="no-cache")){var n=C(C({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!ke(n,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=n))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,r){var i=this.lastWrite;return!(i&&i.dmCount===In.get(this.cache)&&ke(r,i.variables)&&ke(e.data,i.result.data))},t.prototype.markResult=function(e,r,i,n){var a=this,o=new mt,s=qe(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&qe(e.incremental)){var u=zo(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,i.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(i.variables)):n!==0&&(fs(e,i.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,i.variables))l.writeQuery({query:r,data:e.data,variables:i.variables,overwrite:n===1}),a.lastWrite={result:e,variables:i.variables,dmCount:In.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(i.variables),f=l.diff(d);a.stopped||a.updateWatch(i.variables),a.updateLastDiff(f,d),f.complete&&(e.data=f.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=ye.ready},t.prototype.markError=function(e){return this.networkStatus=ye.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function fs(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",i=!wn(t);return!i&&r&&t.data&&(i=!0),i}var hy=Object.prototype.hasOwnProperty,Ud=function(){function t(e){var r=e.cache,i=e.link,n=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,c=u===void 0?!1:u,l=e.clientAwareness,d=l===void 0?{}:l,f=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Pt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=r,this.link=i,this.defaultOptions=n||Object.create(null),this.queryDeduplication=o,this.clientAwareness=d,this.localState=f||new ls({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!p,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,i){e.stopQueryNoBroadcast(i)}),this.cancelPendingFetches(__DEV__?new Z("QueryManager stopped while query was in flight"):new Z(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,i,n=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,c=u===void 0?[]:u,l=e.awaitRefetchQueries,d=l===void 0?!1:l,f=e.update,p=e.onQueryUpdated,h=e.fetchPolicy,m=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,b=e.errorPolicy,_=b===void 0?((i=this.defaultOptions.mutate)===null||i===void 0?void 0:i.errorPolicy)||"none":b,S=e.keepRootFields,w=e.context;return Bt(this,void 0,void 0,function(){var v,D,N,A,R,F;return Vt(this,function(P){switch(P.label){case 0:return __DEV__?$(n,"mutation option is required. You must specify your GraphQL document in the mutation option."):$(n,15),__DEV__?$(m==="network-only"||m==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):$(m==="network-only"||m==="no-cache",16),v=this.generateMutationId(),D=this.transform(n),N=D.document,A=D.hasClientExports,n=this.cache.transformForLink(N),a=this.getVariables(n,a),A?[4,this.localState.addExportedVariables(n,a,w)]:[3,2];case 1:a=P.sent(),P.label=2;case 2:return R=this.mutationStore&&(this.mutationStore[v]={mutation:n,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:v,document:n,variables:a,fetchPolicy:m,errorPolicy:_,context:w,updateQueries:s,update:f,keepRootFields:S}),this.broadcastQueries(),F=this,[2,new Promise(function(j,Je){return Vo(F.getObservableFromLink(n,C(C({},w),{optimisticResponse:o}),a,!1),function(je){if(wn(je)&&_==="none")throw new br({graphQLErrors:Wo(je)});R&&(R.loading=!1,R.error=null);var H=C({},je);return typeof c=="function"&&(c=c(H)),_==="ignore"&&wn(H)&&delete H.errors,F.markMutationResult({mutationId:v,result:H,document:n,variables:a,fetchPolicy:m,errorPolicy:_,context:w,update:f,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?v:void 0,onQueryUpdated:p,keepRootFields:S})}).subscribe({next:function(je){F.broadcastQueries(),(!("hasNext"in je)||je.hasNext===!1)&&j(je)},error:function(je){R&&(R.loading=!1,R.error=je),o&&F.cache.removeOptimistic(v),F.broadcastQueries(),Je(je instanceof br?je:new br({networkError:je}))}})})]}})})},t.prototype.markMutationResult=function(e,r){var i=this;r===void 0&&(r=this.cache);var n=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&fs(n,e.errorPolicy)){if(Ur(n)||a.push({result:n.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Ur(n)&&qe(n.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=zo(s.result,n)),typeof u<"u"&&(n.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(d,f){var p=d.observableQuery,h=p&&p.queryName;if(!(!h||!hy.call(c,h))){var m=c[h],b=i.queries.get(f),_=b.document,S=b.variables,w=r.diff({query:_,variables:S,returnPartialData:!0,optimistic:!1}),v=w.result,D=w.complete;if(D&&v){var N=m(v,{mutationResult:n,queryName:_&&vn(_)||void 0,queryVariables:S});N&&a.push({result:N,dataId:"ROOT_QUERY",query:_,variables:S})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(m){return d.write(m)});var f=e.update,p=!wf(n)||Ur(n)&&!n.hasNext;if(f){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:i.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(n=C(C({},n),{data:h.result}),"incremental"in n&&delete n.incremental,"hasNext"in n&&delete n.hasNext)}p&&f(d,n,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&p&&d.modify({id:"ROOT_MUTATION",fields:function(m,b){var _=b.fieldName,S=b.DELETE;return _==="__typename"?m:S}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return n})}return Promise.resolve(n)},t.prototype.markMutationOptimistic=function(e,r){var i=this,n=typeof e=="function"?e(r.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{i.markMutationResult(C(C({},r),{result:{data:n}}),a)}catch(o){__DEV__&&$.error(o)}},r.mutationId)},t.prototype.fetchQuery=function(e,r,i){return this.fetchQueryObservable(e,r,i).promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,i){e[i]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){var r=this.transformCache;if(!r.has(e)){var i=this.cache.transformDocument(e),n=ou(i),a=this.localState.clientQuery(i),o=n&&this.localState.serverQuery(n),s={document:i,hasClientExports:Xc(i),hasForcedResolvers:this.localState.shouldForceResolvers(i),clientQuery:a,serverQuery:o,defaultVars:xi(er(i)),asQuery:C(C({},i),{definitions:i.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?C(C({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(e),u(i),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return C(C({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=C(C({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new ps(this),i=new us({queryManager:this,queryInfo:r,options:e});return this.queries.set(i.queryId,r),r.init({document:i.query,observableQuery:i,variables:i.variables}),i},t.prototype.query=function(e,r){var i=this;return r===void 0&&(r=this.generateQueryId()),__DEV__?$(e.query,"query option is required. You must specify your GraphQL document in the query option."):$(e.query,17),__DEV__?$(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):$(e.query.kind==="Document",18),__DEV__?$(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):$(!e.returnPartialData,19),__DEV__?$(!e.pollInterval,"pollInterval option only supported on watchQuery."):$(!e.pollInterval,20),this.fetchQuery(r,e).finally(function(){return i.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new Z("Store reset while query was in flight (not completed in link chain)"):new Z(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=ye.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var r=this;e===void 0&&(e="active");var i=new Map,n=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?n.set(o,!1):tu(o)?n.set(r.transform(o).document,!1):fe(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){i.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||l&&n.has(l)||c&&n.has(c))&&(i.set(s,u),l&&n.set(l,!0),c&&n.set(c,!0))}}),a.size&&a.forEach(function(o){var s=ba("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new us({queryManager:r,queryInfo:u,options:C(C({},o),{fetchPolicy:"network-only"})});$(c.queryId===s),u.setObservableQuery(c),i.set(s,c)}),__DEV__&&n.size&&n.forEach(function(o,s){o||__DEV__&&$.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),i},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var i=[];return this.getObservableQueries(e?"all":"active").forEach(function(n,a){var o=n.options.fetchPolicy;n.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&i.push(n.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(i)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var r=this,i=e.query,n=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;i=this.transform(i).document,o=this.getVariables(i,o);var c=function(d){return r.getObservableFromLink(i,u,d).map(function(f){if(n!=="no-cache"&&(fs(f,a)&&r.cache.write({query:i,result:f.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),wn(f))throw new br({graphQLErrors:f.errors});return f})};if(this.transform(i).hasClientExports){var l=this.localState.addExportedVariables(i,o,u).then(c);return new oe(function(d){var f=null;return l.then(function(p){return f=p.subscribe(d)},d.error),function(){return f&&f.unsubscribe()}})}return c(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,i,n){var a=this,o;n===void 0&&(n=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,d=c.link,f={query:u,variables:i,operationName:vn(u)||void 0,context:this.prepareContext(C(C({},r),{forceFetch:!n}))};if(r=f.context,n){var p=l.get(u)||new Map;l.set(u,p);var h=xt(i);if(s=p.get(h),!s){var m=new Sn([Cn(d,f)]);p.set(h,s=m),m.beforeNext(function(){p.delete(h)&&p.size<1&&l.delete(u)})}}else s=new Sn([Cn(d,f)])}else s=new Sn([oe.of({data:{}})]),r=this.prepareContext(r);var b=this.transform(e).clientQuery;return b&&(s=Vo(s,function(_){return a.localState.runResolvers({document:b,remoteResult:_,context:r,variables:i})})),s},t.prototype.getResultsFromLink=function(e,r,i){var n=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return Vo(this.getObservableFromLink(a,i.context,i.variables),function(o){var s=Wo(o),u=s.length>0;if(n>=e.lastRequestId){if(u&&i.errorPolicy==="none")throw e.markError(new br({graphQLErrors:s}));e.markResult(o,a,i,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:ye.ready};return u&&i.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=ye.error),c},function(o){var s=Fd(o)?o:new br({networkError:o});throw n>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,i){var n=this;i===void 0&&(i=ye.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,c=r.fetchPolicy,l=c===void 0?u&&u.fetchPolicy||"cache-first":c,d=r.errorPolicy,f=d===void 0?u&&u.errorPolicy||"none":d,p=r.returnPartialData,h=p===void 0?!1:p,m=r.notifyOnNetworkStatusChange,b=m===void 0?!1:m,_=r.context,S=_===void 0?{}:_,w=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:f,returnPartialData:h,notifyOnNetworkStatusChange:b,context:S}),v=function(A){w.variables=A;var R=n.fetchQueryByPolicy(s,w,i);return w.fetchPolicy!=="standby"&&R.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),R},D=function(){return n.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(A){D(),setTimeout(function(){return N.cancel(A)})});var N=new Sn(this.transform(w.query).hasClientExports?this.localState.addExportedVariables(w.query,w.variables,w.context).then(v):v(w.variables));return N.promise.then(D,D),N},t.prototype.refetchQueries=function(e){var r=this,i=e.updateCache,n=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?ba("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;n&&this.getObservableQueries(n).forEach(function(f,p){l.set(p,{oq:f,lastDiff:r.getQuery(p).getDiff()})});var d=new Map;return i&&this.cache.batch({update:i,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(f,p,h){var m=f.watcher instanceof ps&&f.watcher.observableQuery;if(m){if(c){l.delete(m.queryId);var b=c(m,p,h);return b===!0&&(b=m.refetch()),b!==!1&&d.set(m,b),b}c!==null&&l.set(m.queryId,{oq:m,lastDiff:h,diff:p})}}}),l.size&&l.forEach(function(f,p){var h=f.oq,m=f.lastDiff,b=f.diff,_;if(c){if(!b){var S=h.queryInfo;S.reset(),b=S.getDiff()}_=c(h,b,m)}(!c||_===!0)&&(_=h.refetch()),_!==!1&&d.set(h,_),p.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(p)}),u&&this.cache.removeOptimistic(u),d},t.prototype.fetchQueryByPolicy=function(e,r,i){var n=this,a=r.query,o=r.variables,s=r.fetchPolicy,u=r.refetchWritePolicy,c=r.errorPolicy,l=r.returnPartialData,d=r.context,f=r.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:i});var h=function(){return e.getDiff(o)},m=function(v,D){D===void 0&&(D=e.networkStatus||ye.loading);var N=v.result;__DEV__&&!l&&!ke(N,{})&&Zu(v.missing);var A=function(R){return oe.of(C({data:R,loading:Qr(D),networkStatus:D},v.complete?null:{partial:!0}))};return N&&n.transform(a).hasForcedResolvers?n.localState.runResolvers({document:a,remoteResult:{data:N},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(R){return A(R.data||void 0)}):c==="none"&&D===ye.refetch&&Array.isArray(v.missing)?A(void 0):A(N)},b=s==="no-cache"?0:i===ye.refetch&&u!=="merge"?1:2,_=function(){return n.getResultsFromLink(e,b,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},S=f&&typeof p=="number"&&p!==i&&Qr(i);switch(s){default:case"cache-first":{var w=h();return w.complete?[m(w,e.markReady())]:l||S?[m(w),_()]:[_()]}case"cache-and-network":{var w=h();return w.complete||l||S?[m(w),_()]:[_()]}case"cache-only":return[m(h(),e.markReady())];case"network-only":return S?[m(h()),_()]:[_()];case"no-cache":return S?[m(e.getDiff()),_()]:[_()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new ps(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return C(C({},r),{clientAwareness:this.clientAwareness})},t}();var jd=!1;var ds=function(){function t(e){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var i=e.uri,n=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,c=e.ssrForceFetchDelay,l=c===void 0?0:c,d=e.connectToDevTools,f=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,p=e.queryDeduplication,h=p===void 0?!0:p,m=e.defaultOptions,b=e.assumeImmutableResults,_=b===void 0?!1:b,S=e.resolvers,w=e.typeDefs,v=e.fragmentMatcher,D=e.name,N=e.version,A=e.link;if(A||(A=i?new Au({uri:i,credentials:n,headers:a}):$t.empty()),!o)throw __DEV__?new Z(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
53
- For more information, please visit: https://go.apollo.dev/c/docs`):new Z(9);if(this.link=A,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=m||Object.create(null),this.typeDefs=w,l&&setTimeout(function(){return r.disableNetworkFetches=!1},l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!jd&&f&&__DEV__&&(jd=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var R=window.navigator,F=R&&R.userAgent,P=void 0;typeof F=="string"&&(F.indexOf("Chrome/")>-1?P="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":F.indexOf("Firefox/")>-1&&(P="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),P&&__DEV__&&$.log("Download the Apollo DevTools for a better development experience: "+P)}this.version=Af,this.localState=new ls({cache:o,client:this,resolvers:S,fragmentMatcher:v}),this.queryManager=new Ud({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:D,version:N},localState:this.localState,assumeImmutableResults:_,onBroadcast:f?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=_a(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=_a(this.defaultOptions.query,e)),__DEV__?$(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):$(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=_a(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return Cn(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(i){return i!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(i){return i!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),i=[],n=[];r.forEach(function(o,s){i.push(s),n.push(o)});var a=Promise.all(n);return a.queries=i,a.results=n,a.catch(function(o){__DEV__&&$.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}();Jp(bi?"log":"silent");function ct(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function _r(t){return ct(t)==="object"}function qd(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function Yu(t,e){return t.length<124?t:e}var Bd="graphql-transport-ws";var gt;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(gt||(gt={}));var $e;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})($e||($e={}));function Vd(t){if(!_r(t))throw new Error(`Message is expected to be an object, but got ${ct(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${ct(t.type)}`);switch(t.type){case $e.ConnectionInit:case $e.ConnectionAck:case $e.Ping:case $e.Pong:{if(t.payload!=null&&!_r(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case $e.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!_r(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ct(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${ct(t.payload.query)}`);if(t.payload.variables!=null&&!_r(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${ct(t.payload.variables)}`);if(t.payload.operationName!=null&&ct(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${ct(t.payload.operationName)}`);if(t.payload.extensions!=null&&!_r(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${ct(t.payload.extensions)}`);break}case $e.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!_r(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ct(t.payload)}`);break}case $e.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!qd(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case $e.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function Qd(t,e){return Vd(typeof t=="string"?JSON.parse(t,e):t)}function On(t,e){return Vd(t),JSON.stringify(t,e)}function Xu(t){let{url:e,connectionParams:r,lazy:i=!0,onNonLazyError:n=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:c=5,retryWait:l=async function(we){let Ce=1e3;for(let le=0;le<we;le++)Ce*=2;await new Promise(le=>setTimeout(le,Ce+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=hs,isFatalConnectionProblem:f,on:p,webSocketImpl:h,generateID:m=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,we=>{let Ce=Math.random()*16|0;return(we=="x"?Ce:Ce&3|8).toString(16)})},jsonMessageReplacer:b,jsonMessageReviver:_}=t,S;if(h){if(!gy(h))throw new Error("Invalid WebSocket implementation provided");S=h}else typeof WebSocket<"u"?S=WebSocket:typeof global<"u"?S=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(S=window.WebSocket||window.MozWebSocket);if(!S)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let w=S,v=(()=>{let H=(()=>{let Ce={};return{on(le,pe){return Ce[le]=pe,()=>{delete Ce[le]}},emit(le){var pe;"id"in le&&((pe=Ce[le.id])===null||pe===void 0||pe.call(Ce,le))}}})(),we={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[H.emit,p.message]:[H.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:H.on,on(Ce,le){let pe=we[Ce];return pe.push(le),()=>{pe.splice(pe.indexOf(le),1)}},emit(Ce,...le){for(let pe of[...we[Ce]])pe(...le)}}})();function D(H){let we=[v.on("error",Ce=>{we.forEach(le=>le()),H(Ce)}),v.on("closed",Ce=>{we.forEach(le=>le()),H(Ce)})]}let N,A=0,R,F=!1,P=0,j=!1;async function Je(){clearTimeout(R);let[H,we]=await(N??(N=new Promise((pe,Zt)=>(async()=>{if(F){if(await l(P),!A)return N=void 0,Zt({code:1e3,reason:"All Subscriptions Gone"});P++}v.emit("connecting");let ae=new w(typeof e=="function"?await e():e,Bd),Jt,Dr;function Ao(){isFinite(o)&&o>0&&(clearTimeout(Dr),Dr=setTimeout(()=>{ae.readyState===w.OPEN&&(ae.send(On({type:$e.Ping})),v.emit("ping",!1,void 0))},o))}D(Ye=>{N=void 0,clearTimeout(Jt),clearTimeout(Dr),Zt(Ye),hs(Ye)&&Ye.code===4499&&(ae.close(4499,"Terminated"),ae.onerror=null,ae.onclose=null)}),ae.onerror=Ye=>v.emit("error",Ye),ae.onclose=Ye=>v.emit("closed",Ye),ae.onopen=async()=>{try{v.emit("opened",ae);let Ye=typeof r=="function"?await r():r;if(ae.readyState!==w.OPEN)return;ae.send(On(Ye?{type:$e.ConnectionInit,payload:Ye}:{type:$e.ConnectionInit},b)),isFinite(u)&&u>0&&(Jt=setTimeout(()=>{ae.close(gt.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Ao()}catch(Ye){v.emit("error",Ye),ae.close(gt.InternalClientError,Yu(Ye instanceof Error?Ye.message:new Error(Ye).message,"Internal client error"))}};let pn=!1;ae.onmessage=({data:Ye})=>{try{let Xe=Qd(Ye,_);if(v.emit("message",Xe),Xe.type==="ping"||Xe.type==="pong"){v.emit(Xe.type,!0,Xe.payload),Xe.type==="pong"?Ao():s||(ae.send(On(Xe.payload?{type:$e.Pong,payload:Xe.payload}:{type:$e.Pong})),v.emit("pong",!1,Xe.payload));return}if(pn)return;if(Xe.type!==$e.ConnectionAck)throw new Error(`First message cannot be of type ${Xe.type}`);clearTimeout(Jt),pn=!0,v.emit("connected",ae,Xe.payload),F=!1,P=0,pe([ae,new Promise((V3,pm)=>D(pm))])}catch(Xe){ae.onmessage=null,v.emit("error",Xe),ae.close(gt.BadResponse,Yu(Xe instanceof Error?Xe.message:new Error(Xe).message,"Bad response"))}}})())));H.readyState===w.CLOSING&&await we;let Ce=()=>{},le=new Promise(pe=>Ce=pe);return[H,Ce,Promise.race([le.then(()=>{if(!A){let pe=()=>H.close(1e3,"Normal Closure");isFinite(a)&&a>0?R=setTimeout(()=>{H.readyState===w.OPEN&&pe()},a):pe()}}),we])]}function je(H){if(hs(H)&&(my(H.code)||[gt.InternalServerError,gt.InternalClientError,gt.BadRequest,gt.BadResponse,gt.Unauthorized,gt.SubprotocolNotAcceptable,gt.SubscriberAlreadyExists,gt.TooManyInitialisationRequests].includes(H.code)))throw H;if(j)return!1;if(hs(H)&&H.code===1e3)return A>0;if(!c||P>=c||!d(H)||f?.(H))throw H;return F=!0}return i||(async()=>{for(A++;;)try{let[,,H]=await Je();await H}catch(H){try{if(!je(H))return}catch(we){return n?.(we)}}})(),{on:v.on,subscribe(H,we){let Ce=m(H),le=!1,pe=!1,Zt=()=>{A--,le=!0};return(async()=>{for(A++;;)try{let[ae,Jt,Dr]=await Je();if(le)return Jt();let Ao=v.onMessage(Ce,pn=>{switch(pn.type){case $e.Next:{we.next(pn.payload);return}case $e.Error:{pe=!0,le=!0,we.error(pn.payload),Zt();return}case $e.Complete:{le=!0,Zt();return}}});ae.send(On({id:Ce,type:$e.Subscribe,payload:H},b)),Zt=()=>{!le&&ae.readyState===w.OPEN&&ae.send(On({id:Ce,type:$e.Complete},b)),A--,le=!0,Jt()},await Dr.finally(Ao);return}catch(ae){if(!je(ae))return}})().then(()=>{pe||we.complete()}).catch(ae=>{we.error(ae)}),()=>{le||Zt()}},async dispose(){if(j=!0,N){let[H]=await N;H.close(1e3,"Normal Closure")}},terminate(){N&&v.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function hs(t){return _r(t)&&"code"in t&&"reason"in t}function my(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function gy(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function yy(t){return fe(t)&&"code"in t&&"reason"in t}var el=function(t){Re(e,t);function e(r){var i=t.call(this)||this;return i.client=r,i}return e.prototype.request=function(r){var i=this;return new oe(function(n){return i.client.subscribe(C(C({},r),{query:mn(r.query)}),{next:n.next.bind(n),complete:n.complete.bind(n),error:function(a){return a instanceof Error?n.error(a):yy(a)?n.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):n.error(new br({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}($t);var Ws=function(){return Ws=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Ws.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Ts(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ts=function(r){return typeof r}:Ts=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ts(t)}function vy(t){return Ts(t)=="object"&&t!==null}var u1=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Sl(t,e){for(var r=/\r\n|[\n\r]/g,i=1,n=e+1,a;(a=r.exec(t.body))&&a.index<e;)i+=1,n=e+1-(a.index+a[0].length);return{line:i,column:n}}function by(t){return l1(t.source,Sl(t.source,t.start))}function l1(t,e){var r=t.locationOffset.column-1,i=Is(r)+t.body,n=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,c="".concat(t.name,":").concat(o,":").concat(u,`
52
+ Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!ke(this.options.variables,r)&&(n.variables=this.options.variables=C(C({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(n,ye.refetch)},e.prototype.fetchMore=function(r){var i=this,n=C(C({},r.query?r:C(C(C(C({},this.options),{query:this.query}),r),{variables:C(C({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=ye.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,n,ye.fetchMore).then(function(c){return i.queryManager.removeQuery(a),o.networkStatus===ye.fetchMore&&(o.networkStatus=s),i.queryManager.cache.batch({update:function(l){var d=r.updateQuery;d?l.updateQuery({query:i.query,variables:i.variables,returnPartialData:!0,optimistic:!1},function(f){return d(f,{fetchMoreResult:c.data,variables:n.variables})}):l.writeQuery({query:n.query,variables:n.variables,data:c.data})},onWatchUpdated:function(l){u.add(l.query)}}),c}).finally(function(){u.has(i.query)||Ku(i)})},e.prototype.subscribeToMore=function(r){var i=this,n=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&i.updateQuery(function(s,u){var c=u.variables;return o(s,{subscriptionData:a,variables:c})})},error:function(a){if(r.onError){r.onError(a);return}__DEV__&&$.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(n),function(){i.subscriptions.delete(n)&&n.unsubscribe()}},e.prototype.setOptions=function(r){return this.reobserve(r)},e.prototype.setVariables=function(r){return ke(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},ye.setVariables):Promise.resolve())},e.prototype.updateQuery=function(r){var i=this.queryManager,n=i.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(n,{variables:this.variables});a&&(i.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),i.broadcastQueries())},e.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(r,i){if(i.nextFetchPolicy){var n=i.fetchPolicy,a=n===void 0?"cache-first":n,o=i.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof i.nextFetchPolicy=="function"?i.fetchPolicy=i.nextFetchPolicy(a,{reason:r,options:i,observable:this,initialFetchPolicy:s}):r==="variables-changed"?i.fetchPolicy=s:i.fetchPolicy=i.nextFetchPolicy)}return i.fetchPolicy},e.prototype.fetch=function(r,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,r,i)},e.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var i=this,n=i.pollingInfo,a=i.options.pollInterval;if(!a){n&&(clearTimeout(n.timeout),delete this.pollingInfo);return}if(!(n&&n.interval===a)){__DEV__?$(a,"Attempted to start a polling query without a polling interval."):$(a,13);var o=n||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(Qr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},ye.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},e.prototype.updateLastResult=function(r,i){return i===void 0&&(i=this.variables),this.last=C(C({},this.last),{result:this.queryManager.assumeImmutableResults?r:Bo(r),variables:i}),qe(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,i){var n=this;this.isTornDown=!1;var a=i===ye.refetch||i===ye.fetchMore||i===ye.poll,o=this.options.variables,s=this.options.fetchPolicy,u=jr(this.options,r||{}),c=a?u:py(this.options,u);a||(this.updatePolling(),r&&r.variables&&!ke(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),i===void 0&&(i=ye.setVariables)));var l=c.variables&&C({},c.variables),d=this.fetch(c,i),f={next:function(p){n.reportResult(p,l)},error:function(p){n.reportError(p,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=f),d.addObserver(f),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,i){var n=this.getLastError();(n||this.isDifferentFromLastResult(r,i))&&((n||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,i),ki(this.observers,"next",r))},e.prototype.reportError=function(r,i){var n=C(C({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:ye.error,loading:!1});this.updateLastResult(n,i),ki(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(oe);Qo(us);function Ku(t){var e=t.options,r=e.fetchPolicy,i=e.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=i,typeof i=="function"?i.apply(this,arguments):r}}):t.reobserve()}function dy(t){__DEV__&&$.error("Unhandled error",t.message,t.stack)}function Zu(t){__DEV__&&t&&__DEV__&&$.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var ls=function(){function t(e){var r=e.cache,i=e.client,n=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,i&&(this.client=i),n&&this.addResolvers(n),a&&this.setFragmentMatcher(a)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(i){r.resolvers=uu(r.resolvers,i)}):this.resolvers=uu(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){var r=e.document,i=e.remoteResult,n=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return Bt(this,void 0,void 0,function(){return Vt(this,function(u){return r?[2,this.resolveDocument(r,i.data,n,a,this.fragmentMatcher,s).then(function(c){return C(C({},i),{data:c.result})})]:[2,i]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return yn(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return cu(e)},t.prototype.prepareContext=function(e){var r=this.cache;return C(C({},e),{cache:r,getCacheKey:function(i){return r.identify(i)}})},t.prototype.addExportedVariables=function(e,r,i){return r===void 0&&(r={}),i===void 0&&(i={}),Bt(this,void 0,void 0,function(){return Vt(this,function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(i),r).then(function(a){return C(C({},r),a.exportedVariables)})]:[2,C({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return nt(e,{Directive:{enter:function(i){if(i.name.value==="client"&&i.arguments&&(r=i.arguments.some(function(n){return n.name.value==="always"&&n.value.kind==="BooleanValue"&&n.value.value===!0}),r))return _i}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:su(e),variables:r,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,r,i,n,a,o){return i===void 0&&(i={}),n===void 0&&(n={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),Bt(this,void 0,void 0,function(){var s,u,c,l,d,f,p,h,m,b,_;return Vt(this,function(S){return s=Ei(e),u=Ci(e),c=Si(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,f=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",p=this,h=p.cache,m=p.client,b={fragmentMap:c,context:C(C({},i),{cache:h,client:m}),variables:n,fragmentMatcher:a,defaultOperationType:f,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},_=!1,[2,this.resolveSelectionSet(s.selectionSet,_,r,b).then(function(w){return{result:w,exportedVariables:b.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,i,n){return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return Vt(this,function(d){return a=n.fragmentMap,o=n.context,s=n.variables,u=[i],c=function(f){return Bt(l,void 0,void 0,function(){var p,h;return Vt(this,function(m){return!r&&!n.selectionsToResolve.has(f)?[2]:yr(f,s)?Et(f)?[2,this.resolveField(f,r,i,n).then(function(b){var _;typeof b<"u"&&u.push((_={},_[Rt(f)]=b,_))})]:(iu(f)?p=f:(p=a[f.name.value],__DEV__?$(p,"No fragment named ".concat(f.name.value)):$(p,11)),p&&p.typeCondition&&(h=p.typeCondition.name.value,n.fragmentMatcher(i,h,o))?[2,this.resolveSelectionSet(p.selectionSet,r,i,n).then(function(b){u.push(b)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return ga(u)})]})})},t.prototype.resolveField=function(e,r,i,n){return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h=this;return Vt(this,function(m){return i?(a=n.variables,o=e.name.value,s=Rt(e),u=o!==s,c=i[s]||i[o],l=Promise.resolve(c),(!n.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=i.__typename||n.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(p=f[u?o:s],p&&(l=Promise.resolve(Tn.withValue(this.cache,p,[i,vr(e,a),n.context,{field:e,fragmentMap:n.fragmentMap}]))))),[2,l.then(function(b){var _,S;if(b===void 0&&(b=c),e.directives&&e.directives.forEach(function(v){v.name.value==="export"&&v.arguments&&v.arguments.forEach(function(D){D.name.value==="as"&&D.value.kind==="StringValue"&&(n.exportedVariables[D.value.value]=b)})}),!e.selectionSet||b==null)return b;var w=(S=(_=e.directives)===null||_===void 0?void 0:_.some(function(v){return v.name.value==="client"}))!==null&&S!==void 0?S:!1;if(Array.isArray(b))return h.resolveSubSelectedArray(e,r||w,b,n);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||w,b,n)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,i,n){var a=this;return Promise.all(i.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,r,o,n);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,r,o,n)}))},t.prototype.collectSelectionsToResolve=function(e,r){var i=function(o){return!Array.isArray(o)},n=this.selectionsToResolveCache;function a(o){if(!n.has(o)){var s=new Set;n.set(o,s),nt(o,{Directive:function(u,c,l,d,f){u.name.value==="client"&&f.forEach(function(p){i(p)&&pa(p)&&s.add(p)})},FragmentSpread:function(u,c,l,d,f){var p=r[u.name.value];__DEV__?$(p,"No fragment named ".concat(u.name.value)):$(p,12);var h=a(p);h.size>0&&(f.forEach(function(m){i(m)&&pa(m)&&s.add(m)}),s.add(u),h.forEach(function(m){s.add(m)}))}})}return n.get(o)}return a(e)},t}();var On=new(Pt?WeakMap:Map);function Ju(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return On.set(t,(On.get(t)+1)%1e15),r.apply(this,arguments)})}function Md(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var ps=function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var i=this.cache=e.cache;On.has(i)||(On.set(i,0),Ju(i,"evict"),Ju(i,"modify"),Ju(i,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||ye.loading;return this.variables&&this.networkStatus!==ye.loading&&!ke(this.variables,e.variables)&&(r=ye.setVariables),ke(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){Md(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&ke(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var i=this.observableQuery;if(i&&i.options.fetchPolicy==="no-cache")return{complete:!1};var n=this.cache.diff(r);return this.updateLastDiff(n,r),n},t.prototype.updateLastDiff=function(e,r){this.lastDiff=e?{diff:e,options:r||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var r;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},t.prototype.setDiff=function(e){var r=this,i=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!ke(i&&i.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},t.prototype.setObservableQuery=function(e){var r=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var i=r.getDiff();i.fromOptimisticTransaction?e.observe():Ku(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Md(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Qr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var i=this.observableQuery;if(!(i&&i.options.fetchPolicy==="no-cache")){var n=C(C({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!ke(n,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=n))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,r){var i=this.lastWrite;return!(i&&i.dmCount===On.get(this.cache)&&ke(r,i.variables)&&ke(e.data,i.result.data))},t.prototype.markResult=function(e,r,i,n){var a=this,o=new mt,s=qe(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&qe(e.incremental)){var u=zo(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,i.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(i.variables)):n!==0&&(fs(e,i.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,i.variables))l.writeQuery({query:r,data:e.data,variables:i.variables,overwrite:n===1}),a.lastWrite={result:e,variables:i.variables,dmCount:On.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(i.variables),f=l.diff(d);a.stopped||a.updateWatch(i.variables),a.updateLastDiff(f,d),f.complete&&(e.data=f.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=ye.ready},t.prototype.markError=function(e){return this.networkStatus=ye.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function fs(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",i=!Cn(t);return!i&&r&&t.data&&(i=!0),i}var hy=Object.prototype.hasOwnProperty,Ud=function(){function t(e){var r=e.cache,i=e.link,n=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,c=u===void 0?!1:u,l=e.clientAwareness,d=l===void 0?{}:l,f=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Pt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=r,this.link=i,this.defaultOptions=n||Object.create(null),this.queryDeduplication=o,this.clientAwareness=d,this.localState=f||new ls({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!p,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,i){e.stopQueryNoBroadcast(i)}),this.cancelPendingFetches(__DEV__?new Z("QueryManager stopped while query was in flight"):new Z(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,i,n=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,c=u===void 0?[]:u,l=e.awaitRefetchQueries,d=l===void 0?!1:l,f=e.update,p=e.onQueryUpdated,h=e.fetchPolicy,m=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,b=e.errorPolicy,_=b===void 0?((i=this.defaultOptions.mutate)===null||i===void 0?void 0:i.errorPolicy)||"none":b,S=e.keepRootFields,w=e.context;return Bt(this,void 0,void 0,function(){var v,D,N,A,R,F;return Vt(this,function(P){switch(P.label){case 0:return __DEV__?$(n,"mutation option is required. You must specify your GraphQL document in the mutation option."):$(n,15),__DEV__?$(m==="network-only"||m==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):$(m==="network-only"||m==="no-cache",16),v=this.generateMutationId(),D=this.transform(n),N=D.document,A=D.hasClientExports,n=this.cache.transformForLink(N),a=this.getVariables(n,a),A?[4,this.localState.addExportedVariables(n,a,w)]:[3,2];case 1:a=P.sent(),P.label=2;case 2:return R=this.mutationStore&&(this.mutationStore[v]={mutation:n,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:v,document:n,variables:a,fetchPolicy:m,errorPolicy:_,context:w,updateQueries:s,update:f,keepRootFields:S}),this.broadcastQueries(),F=this,[2,new Promise(function(j,Je){return Vo(F.getObservableFromLink(n,C(C({},w),{optimisticResponse:o}),a,!1),function(je){if(Cn(je)&&_==="none")throw new br({graphQLErrors:Wo(je)});R&&(R.loading=!1,R.error=null);var H=C({},je);return typeof c=="function"&&(c=c(H)),_==="ignore"&&Cn(H)&&delete H.errors,F.markMutationResult({mutationId:v,result:H,document:n,variables:a,fetchPolicy:m,errorPolicy:_,context:w,update:f,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?v:void 0,onQueryUpdated:p,keepRootFields:S})}).subscribe({next:function(je){F.broadcastQueries(),(!("hasNext"in je)||je.hasNext===!1)&&j(je)},error:function(je){R&&(R.loading=!1,R.error=je),o&&F.cache.removeOptimistic(v),F.broadcastQueries(),Je(je instanceof br?je:new br({networkError:je}))}})})]}})})},t.prototype.markMutationResult=function(e,r){var i=this;r===void 0&&(r=this.cache);var n=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&fs(n,e.errorPolicy)){if(Ur(n)||a.push({result:n.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Ur(n)&&qe(n.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=zo(s.result,n)),typeof u<"u"&&(n.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(d,f){var p=d.observableQuery,h=p&&p.queryName;if(!(!h||!hy.call(c,h))){var m=c[h],b=i.queries.get(f),_=b.document,S=b.variables,w=r.diff({query:_,variables:S,returnPartialData:!0,optimistic:!1}),v=w.result,D=w.complete;if(D&&v){var N=m(v,{mutationResult:n,queryName:_&&bn(_)||void 0,queryVariables:S});N&&a.push({result:N,dataId:"ROOT_QUERY",query:_,variables:S})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(m){return d.write(m)});var f=e.update,p=!wf(n)||Ur(n)&&!n.hasNext;if(f){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:i.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(n=C(C({},n),{data:h.result}),"incremental"in n&&delete n.incremental,"hasNext"in n&&delete n.hasNext)}p&&f(d,n,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&p&&d.modify({id:"ROOT_MUTATION",fields:function(m,b){var _=b.fieldName,S=b.DELETE;return _==="__typename"?m:S}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return n})}return Promise.resolve(n)},t.prototype.markMutationOptimistic=function(e,r){var i=this,n=typeof e=="function"?e(r.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{i.markMutationResult(C(C({},r),{result:{data:n}}),a)}catch(o){__DEV__&&$.error(o)}},r.mutationId)},t.prototype.fetchQuery=function(e,r,i){return this.fetchQueryObservable(e,r,i).promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,i){e[i]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){var r=this.transformCache;if(!r.has(e)){var i=this.cache.transformDocument(e),n=ou(i),a=this.localState.clientQuery(i),o=n&&this.localState.serverQuery(n),s={document:i,hasClientExports:Xc(i),hasForcedResolvers:this.localState.shouldForceResolvers(i),clientQuery:a,serverQuery:o,defaultVars:xi(er(i)),asQuery:C(C({},i),{definitions:i.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?C(C({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(e),u(i),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return C(C({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=C(C({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new ps(this),i=new us({queryManager:this,queryInfo:r,options:e});return this.queries.set(i.queryId,r),r.init({document:i.query,observableQuery:i,variables:i.variables}),i},t.prototype.query=function(e,r){var i=this;return r===void 0&&(r=this.generateQueryId()),__DEV__?$(e.query,"query option is required. You must specify your GraphQL document in the query option."):$(e.query,17),__DEV__?$(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):$(e.query.kind==="Document",18),__DEV__?$(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):$(!e.returnPartialData,19),__DEV__?$(!e.pollInterval,"pollInterval option only supported on watchQuery."):$(!e.pollInterval,20),this.fetchQuery(r,e).finally(function(){return i.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new Z("Store reset while query was in flight (not completed in link chain)"):new Z(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=ye.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var r=this;e===void 0&&(e="active");var i=new Map,n=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?n.set(o,!1):tu(o)?n.set(r.transform(o).document,!1):fe(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){i.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||l&&n.has(l)||c&&n.has(c))&&(i.set(s,u),l&&n.set(l,!0),c&&n.set(c,!0))}}),a.size&&a.forEach(function(o){var s=ba("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new us({queryManager:r,queryInfo:u,options:C(C({},o),{fetchPolicy:"network-only"})});$(c.queryId===s),u.setObservableQuery(c),i.set(s,c)}),__DEV__&&n.size&&n.forEach(function(o,s){o||__DEV__&&$.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),i},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var i=[];return this.getObservableQueries(e?"all":"active").forEach(function(n,a){var o=n.options.fetchPolicy;n.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&i.push(n.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(i)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var r=this,i=e.query,n=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;i=this.transform(i).document,o=this.getVariables(i,o);var c=function(d){return r.getObservableFromLink(i,u,d).map(function(f){if(n!=="no-cache"&&(fs(f,a)&&r.cache.write({query:i,result:f.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),Cn(f))throw new br({graphQLErrors:f.errors});return f})};if(this.transform(i).hasClientExports){var l=this.localState.addExportedVariables(i,o,u).then(c);return new oe(function(d){var f=null;return l.then(function(p){return f=p.subscribe(d)},d.error),function(){return f&&f.unsubscribe()}})}return c(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,i,n){var a=this,o;n===void 0&&(n=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,d=c.link,f={query:u,variables:i,operationName:bn(u)||void 0,context:this.prepareContext(C(C({},r),{forceFetch:!n}))};if(r=f.context,n){var p=l.get(u)||new Map;l.set(u,p);var h=xt(i);if(s=p.get(h),!s){var m=new wn([En(d,f)]);p.set(h,s=m),m.beforeNext(function(){p.delete(h)&&p.size<1&&l.delete(u)})}}else s=new wn([En(d,f)])}else s=new wn([oe.of({data:{}})]),r=this.prepareContext(r);var b=this.transform(e).clientQuery;return b&&(s=Vo(s,function(_){return a.localState.runResolvers({document:b,remoteResult:_,context:r,variables:i})})),s},t.prototype.getResultsFromLink=function(e,r,i){var n=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return Vo(this.getObservableFromLink(a,i.context,i.variables),function(o){var s=Wo(o),u=s.length>0;if(n>=e.lastRequestId){if(u&&i.errorPolicy==="none")throw e.markError(new br({graphQLErrors:s}));e.markResult(o,a,i,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:ye.ready};return u&&i.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=ye.error),c},function(o){var s=Fd(o)?o:new br({networkError:o});throw n>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,i){var n=this;i===void 0&&(i=ye.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,c=r.fetchPolicy,l=c===void 0?u&&u.fetchPolicy||"cache-first":c,d=r.errorPolicy,f=d===void 0?u&&u.errorPolicy||"none":d,p=r.returnPartialData,h=p===void 0?!1:p,m=r.notifyOnNetworkStatusChange,b=m===void 0?!1:m,_=r.context,S=_===void 0?{}:_,w=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:f,returnPartialData:h,notifyOnNetworkStatusChange:b,context:S}),v=function(A){w.variables=A;var R=n.fetchQueryByPolicy(s,w,i);return w.fetchPolicy!=="standby"&&R.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),R},D=function(){return n.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(A){D(),setTimeout(function(){return N.cancel(A)})});var N=new wn(this.transform(w.query).hasClientExports?this.localState.addExportedVariables(w.query,w.variables,w.context).then(v):v(w.variables));return N.promise.then(D,D),N},t.prototype.refetchQueries=function(e){var r=this,i=e.updateCache,n=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?ba("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;n&&this.getObservableQueries(n).forEach(function(f,p){l.set(p,{oq:f,lastDiff:r.getQuery(p).getDiff()})});var d=new Map;return i&&this.cache.batch({update:i,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(f,p,h){var m=f.watcher instanceof ps&&f.watcher.observableQuery;if(m){if(c){l.delete(m.queryId);var b=c(m,p,h);return b===!0&&(b=m.refetch()),b!==!1&&d.set(m,b),b}c!==null&&l.set(m.queryId,{oq:m,lastDiff:h,diff:p})}}}),l.size&&l.forEach(function(f,p){var h=f.oq,m=f.lastDiff,b=f.diff,_;if(c){if(!b){var S=h.queryInfo;S.reset(),b=S.getDiff()}_=c(h,b,m)}(!c||_===!0)&&(_=h.refetch()),_!==!1&&d.set(h,_),p.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(p)}),u&&this.cache.removeOptimistic(u),d},t.prototype.fetchQueryByPolicy=function(e,r,i){var n=this,a=r.query,o=r.variables,s=r.fetchPolicy,u=r.refetchWritePolicy,c=r.errorPolicy,l=r.returnPartialData,d=r.context,f=r.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:i});var h=function(){return e.getDiff(o)},m=function(v,D){D===void 0&&(D=e.networkStatus||ye.loading);var N=v.result;__DEV__&&!l&&!ke(N,{})&&Zu(v.missing);var A=function(R){return oe.of(C({data:R,loading:Qr(D),networkStatus:D},v.complete?null:{partial:!0}))};return N&&n.transform(a).hasForcedResolvers?n.localState.runResolvers({document:a,remoteResult:{data:N},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(R){return A(R.data||void 0)}):c==="none"&&D===ye.refetch&&Array.isArray(v.missing)?A(void 0):A(N)},b=s==="no-cache"?0:i===ye.refetch&&u!=="merge"?1:2,_=function(){return n.getResultsFromLink(e,b,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},S=f&&typeof p=="number"&&p!==i&&Qr(i);switch(s){default:case"cache-first":{var w=h();return w.complete?[m(w,e.markReady())]:l||S?[m(w),_()]:[_()]}case"cache-and-network":{var w=h();return w.complete||l||S?[m(w),_()]:[_()]}case"cache-only":return[m(h(),e.markReady())];case"network-only":return S?[m(h()),_()]:[_()];case"no-cache":return S?[m(e.getDiff()),_()]:[_()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new ps(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return C(C({},r),{clientAwareness:this.clientAwareness})},t}();var jd=!1;var ds=function(){function t(e){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var i=e.uri,n=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,c=e.ssrForceFetchDelay,l=c===void 0?0:c,d=e.connectToDevTools,f=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,p=e.queryDeduplication,h=p===void 0?!0:p,m=e.defaultOptions,b=e.assumeImmutableResults,_=b===void 0?!1:b,S=e.resolvers,w=e.typeDefs,v=e.fragmentMatcher,D=e.name,N=e.version,A=e.link;if(A||(A=i?new Au({uri:i,credentials:n,headers:a}):$t.empty()),!o)throw __DEV__?new Z(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
53
+ For more information, please visit: https://go.apollo.dev/c/docs`):new Z(9);if(this.link=A,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=m||Object.create(null),this.typeDefs=w,l&&setTimeout(function(){return r.disableNetworkFetches=!1},l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!jd&&f&&__DEV__&&(jd=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var R=window.navigator,F=R&&R.userAgent,P=void 0;typeof F=="string"&&(F.indexOf("Chrome/")>-1?P="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":F.indexOf("Firefox/")>-1&&(P="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),P&&__DEV__&&$.log("Download the Apollo DevTools for a better development experience: "+P)}this.version=Af,this.localState=new ls({cache:o,client:this,resolvers:S,fragmentMatcher:v}),this.queryManager=new Ud({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:D,version:N},localState:this.localState,assumeImmutableResults:_,onBroadcast:f?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=_a(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=_a(this.defaultOptions.query,e)),__DEV__?$(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):$(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=_a(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return En(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(i){return i!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(i){return i!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),i=[],n=[];r.forEach(function(o,s){i.push(s),n.push(o)});var a=Promise.all(n);return a.queries=i,a.results=n,a.catch(function(o){__DEV__&&$.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}();Jp(bi?"log":"silent");function ct(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function _r(t){return ct(t)==="object"}function qd(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function Yu(t,e){return t.length<124?t:e}var Bd="graphql-transport-ws";var gt;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(gt||(gt={}));var $e;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})($e||($e={}));function Vd(t){if(!_r(t))throw new Error(`Message is expected to be an object, but got ${ct(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${ct(t.type)}`);switch(t.type){case $e.ConnectionInit:case $e.ConnectionAck:case $e.Ping:case $e.Pong:{if(t.payload!=null&&!_r(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case $e.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!_r(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ct(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${ct(t.payload.query)}`);if(t.payload.variables!=null&&!_r(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${ct(t.payload.variables)}`);if(t.payload.operationName!=null&&ct(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${ct(t.payload.operationName)}`);if(t.payload.extensions!=null&&!_r(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${ct(t.payload.extensions)}`);break}case $e.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!_r(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ct(t.payload)}`);break}case $e.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!qd(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case $e.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function Qd(t,e){return Vd(typeof t=="string"?JSON.parse(t,e):t)}function Dn(t,e){return Vd(t),JSON.stringify(t,e)}function Xu(t){let{url:e,connectionParams:r,lazy:i=!0,onNonLazyError:n=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:c=5,retryWait:l=async function(we){let Ce=1e3;for(let le=0;le<we;le++)Ce*=2;await new Promise(le=>setTimeout(le,Ce+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=hs,isFatalConnectionProblem:f,on:p,webSocketImpl:h,generateID:m=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,we=>{let Ce=Math.random()*16|0;return(we=="x"?Ce:Ce&3|8).toString(16)})},jsonMessageReplacer:b,jsonMessageReviver:_}=t,S;if(h){if(!gy(h))throw new Error("Invalid WebSocket implementation provided");S=h}else typeof WebSocket<"u"?S=WebSocket:typeof global<"u"?S=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(S=window.WebSocket||window.MozWebSocket);if(!S)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let w=S,v=(()=>{let H=(()=>{let Ce={};return{on(le,pe){return Ce[le]=pe,()=>{delete Ce[le]}},emit(le){var pe;"id"in le&&((pe=Ce[le.id])===null||pe===void 0||pe.call(Ce,le))}}})(),we={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[H.emit,p.message]:[H.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:H.on,on(Ce,le){let pe=we[Ce];return pe.push(le),()=>{pe.splice(pe.indexOf(le),1)}},emit(Ce,...le){for(let pe of[...we[Ce]])pe(...le)}}})();function D(H){let we=[v.on("error",Ce=>{we.forEach(le=>le()),H(Ce)}),v.on("closed",Ce=>{we.forEach(le=>le()),H(Ce)})]}let N,A=0,R,F=!1,P=0,j=!1;async function Je(){clearTimeout(R);let[H,we]=await(N??(N=new Promise((pe,Zt)=>(async()=>{if(F){if(await l(P),!A)return N=void 0,Zt({code:1e3,reason:"All Subscriptions Gone"});P++}v.emit("connecting");let ae=new w(typeof e=="function"?await e():e,Bd),Jt,Dr;function Ao(){isFinite(o)&&o>0&&(clearTimeout(Dr),Dr=setTimeout(()=>{ae.readyState===w.OPEN&&(ae.send(Dn({type:$e.Ping})),v.emit("ping",!1,void 0))},o))}D(Ye=>{N=void 0,clearTimeout(Jt),clearTimeout(Dr),Zt(Ye),hs(Ye)&&Ye.code===4499&&(ae.close(4499,"Terminated"),ae.onerror=null,ae.onclose=null)}),ae.onerror=Ye=>v.emit("error",Ye),ae.onclose=Ye=>v.emit("closed",Ye),ae.onopen=async()=>{try{v.emit("opened",ae);let Ye=typeof r=="function"?await r():r;if(ae.readyState!==w.OPEN)return;ae.send(Dn(Ye?{type:$e.ConnectionInit,payload:Ye}:{type:$e.ConnectionInit},b)),isFinite(u)&&u>0&&(Jt=setTimeout(()=>{ae.close(gt.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Ao()}catch(Ye){v.emit("error",Ye),ae.close(gt.InternalClientError,Yu(Ye instanceof Error?Ye.message:new Error(Ye).message,"Internal client error"))}};let fn=!1;ae.onmessage=({data:Ye})=>{try{let Xe=Qd(Ye,_);if(v.emit("message",Xe),Xe.type==="ping"||Xe.type==="pong"){v.emit(Xe.type,!0,Xe.payload),Xe.type==="pong"?Ao():s||(ae.send(Dn(Xe.payload?{type:$e.Pong,payload:Xe.payload}:{type:$e.Pong})),v.emit("pong",!1,Xe.payload));return}if(fn)return;if(Xe.type!==$e.ConnectionAck)throw new Error(`First message cannot be of type ${Xe.type}`);clearTimeout(Jt),fn=!0,v.emit("connected",ae,Xe.payload),F=!1,P=0,pe([ae,new Promise((V3,pm)=>D(pm))])}catch(Xe){ae.onmessage=null,v.emit("error",Xe),ae.close(gt.BadResponse,Yu(Xe instanceof Error?Xe.message:new Error(Xe).message,"Bad response"))}}})())));H.readyState===w.CLOSING&&await we;let Ce=()=>{},le=new Promise(pe=>Ce=pe);return[H,Ce,Promise.race([le.then(()=>{if(!A){let pe=()=>H.close(1e3,"Normal Closure");isFinite(a)&&a>0?R=setTimeout(()=>{H.readyState===w.OPEN&&pe()},a):pe()}}),we])]}function je(H){if(hs(H)&&(my(H.code)||[gt.InternalServerError,gt.InternalClientError,gt.BadRequest,gt.BadResponse,gt.Unauthorized,gt.SubprotocolNotAcceptable,gt.SubscriberAlreadyExists,gt.TooManyInitialisationRequests].includes(H.code)))throw H;if(j)return!1;if(hs(H)&&H.code===1e3)return A>0;if(!c||P>=c||!d(H)||f?.(H))throw H;return F=!0}return i||(async()=>{for(A++;;)try{let[,,H]=await Je();await H}catch(H){try{if(!je(H))return}catch(we){return n?.(we)}}})(),{on:v.on,subscribe(H,we){let Ce=m(H),le=!1,pe=!1,Zt=()=>{A--,le=!0};return(async()=>{for(A++;;)try{let[ae,Jt,Dr]=await Je();if(le)return Jt();let Ao=v.onMessage(Ce,fn=>{switch(fn.type){case $e.Next:{we.next(fn.payload);return}case $e.Error:{pe=!0,le=!0,we.error(fn.payload),Zt();return}case $e.Complete:{le=!0,Zt();return}}});ae.send(Dn({id:Ce,type:$e.Subscribe,payload:H},b)),Zt=()=>{!le&&ae.readyState===w.OPEN&&ae.send(Dn({id:Ce,type:$e.Complete},b)),A--,le=!0,Jt()},await Dr.finally(Ao);return}catch(ae){if(!je(ae))return}})().then(()=>{pe||we.complete()}).catch(ae=>{we.error(ae)}),()=>{le||Zt()}},async dispose(){if(j=!0,N){let[H]=await N;H.close(1e3,"Normal Closure")}},terminate(){N&&v.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function hs(t){return _r(t)&&"code"in t&&"reason"in t}function my(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function gy(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function yy(t){return fe(t)&&"code"in t&&"reason"in t}var el=function(t){Re(e,t);function e(r){var i=t.call(this)||this;return i.client=r,i}return e.prototype.request=function(r){var i=this;return new oe(function(n){return i.client.subscribe(C(C({},r),{query:gn(r.query)}),{next:n.next.bind(n),complete:n.complete.bind(n),error:function(a){return a instanceof Error?n.error(a):yy(a)?n.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):n.error(new br({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}($t);var Ws=function(){return Ws=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Ws.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Ts(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ts=function(r){return typeof r}:Ts=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ts(t)}function vy(t){return Ts(t)=="object"&&t!==null}var u1=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Sl(t,e){for(var r=/\r\n|[\n\r]/g,i=1,n=e+1,a;(a=r.exec(t.body))&&a.index<e;)i+=1,n=e+1-(a.index+a[0].length);return{line:i,column:n}}function by(t){return l1(t.source,Sl(t.source,t.start))}function l1(t,e){var r=t.locationOffset.column-1,i=Is(r)+t.body,n=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,c="".concat(t.name,":").concat(o,":").concat(u,`
54
54
  `),l=i.split(/\r\n|[\n\r]/g),d=l[n];if(d.length>120){for(var f=Math.floor(u/80),p=u%80,h=[],m=0;m<d.length;m+=80)h.push(d.slice(m,m+80));return c+zd([["".concat(o),h[0]]].concat(h.slice(1,f+1).map(function(b){return["",b]}),[[" ",Is(p-1)+"^"],["",h[f+1]]]))}return c+zd([["".concat(o-1),l[n-1]],["".concat(o),d],["",Is(u-1)+"^"],["".concat(o+1),l[n+1]]])}function zd(t){var e=t.filter(function(i){i[0];var n=i[1];return n!==void 0}),r=Math.max.apply(Math,e.map(function(i){var n=i[0];return n.length}));return e.map(function(i){var n=i[0],a=i[1];return _y(r,n)+(a?" | "+a:" |")}).join(`
55
55
  `)}function Is(t){return Array(t+1).join(" ")}function _y(t,e){return Is(t-e.length)+e}function Os(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Os=function(r){return typeof r}:Os=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Os(t)}function Wd(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function Sy(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Wd(Object(r),!0).forEach(function(i){wy(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wd(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function wy(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Cy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hd(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ey(t,e,r){return e&&Hd(t.prototype,e),r&&Hd(t,r),t}function xy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&to(t,e)}function Ay(t){var e=f1();return function(){var i=ro(t),n;if(e){var a=ro(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return p1(this,n)}}function p1(t,e){return e&&(Os(e)==="object"||typeof e=="function")?e:Ra(t)}function Ra(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wl(t){var e=typeof Map=="function"?new Map:void 0;return wl=function(i){if(i===null||!ky(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(i))return e.get(i);e.set(i,n)}function n(){return Ds(i,arguments,ro(this).constructor)}return n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),to(n,i)},wl(t)}function Ds(t,e,r){return f1()?Ds=Reflect.construct:Ds=function(n,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(n,s),c=new u;return o&&to(c,o.prototype),c},Ds.apply(null,arguments)}function f1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function ky(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function to(t,e){return to=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},to(t,e)}function ro(t){return ro=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ro(t)}var Ty=function(t){xy(r,t);var e=Ay(r);function r(i,n,a,o,s,u,c){var l,d,f,p;Cy(this,r),p=e.call(this,i),p.name="GraphQLError",p.originalError=u??void 0,p.nodes=Gd(Array.isArray(n)?n:n?[n]:void 0);for(var h=[],m=0,b=(_=p.nodes)!==null&&_!==void 0?_:[];m<b.length;m++){var _,S=b[m],w=S.loc;w!=null&&h.push(w)}h=Gd(h),p.source=a??((l=h)===null||l===void 0?void 0:l[0].source),p.positions=o??((d=h)===null||d===void 0?void 0:d.map(function(D){return D.start})),p.locations=o&&a?o.map(function(D){return Sl(a,D)}):(f=h)===null||f===void 0?void 0:f.map(function(D){return Sl(D.source,D.start)}),p.path=s??void 0;var v=u?.extensions;return c==null&&vy(v)?p.extensions=Sy({},v):p.extensions=c??{},Object.defineProperties(Ra(p),{message:{enumerable:!0},locations:{enumerable:p.locations!=null},path:{enumerable:p.path!=null},extensions:{enumerable:p.extensions!=null&&Object.keys(p.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(Ra(p),"stack",{value:u.stack,writable:!0,configurable:!0}),p1(p)):(Error.captureStackTrace?Error.captureStackTrace(Ra(p),r):Object.defineProperty(Ra(p),"stack",{value:Error().stack,writable:!0,configurable:!0}),p)}return Ey(r,[{key:"toString",value:function(){return Iy(this)}},{key:u1,get:function(){return"Object"}}]),r}(wl(Error));function Gd(t){return t===void 0||t.length===0?void 0:t}function Iy(t){var e=t.message;if(t.nodes)for(var r=0,i=t.nodes;r<i.length;r++){var n=i[r];n.loc&&(e+=`
56
56
 
@@ -60,13 +60,13 @@ For more information, please visit: https://go.apollo.dev/c/docs`):new Z(9);if(t
60
60
  `)}function Zd(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function Qy(t){for(var e,r=!0,i=!0,n=0,a=null,o=0;o<t.length;++o)switch(t.charCodeAt(o)){case 13:t.charCodeAt(o+1)===10&&++o;case 10:r=!1,i=!0,n=0;break;case 9:case 32:++n;break;default:i&&!r&&(a===null||n<a)&&(a=n),i=!1}return(e=a)!==null&&e!==void 0?e:0}var zy=function(){function t(r){var i=new Fe(I.SOF,0,0,0,0,null);this.source=r,this.lastToken=i,this.token=i,this.line=1,this.lineStart=0}var e=t.prototype;return e.advance=function(){this.lastToken=this.token;var i=this.token=this.lookahead();return i},e.lookahead=function(){var i=this.token;if(i.kind!==I.EOF)do{var n;i=(n=i.next)!==null&&n!==void 0?n:i.next=Hy(this,i)}while(i.kind===I.COMMENT);return i},t}();function Wy(t){return t===I.BANG||t===I.DOLLAR||t===I.AMP||t===I.PAREN_L||t===I.PAREN_R||t===I.SPREAD||t===I.COLON||t===I.EQUALS||t===I.AT||t===I.BRACKET_L||t===I.BRACKET_R||t===I.BRACE_L||t===I.PIPE||t===I.BRACE_R}function zi(t){return isNaN(t)?I.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function Hy(t,e){for(var r=t.source,i=r.body,n=i.length,a=e.end;a<n;){var o=i.charCodeAt(a),s=t.line,u=1+a-t.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++t.line,t.lineStart=a;continue;case 13:i.charCodeAt(a+1)===10?a+=2:++a,++t.line,t.lineStart=a;continue;case 33:return new Fe(I.BANG,a,a+1,s,u,e);case 35:return Ky(r,a,s,u,e);case 36:return new Fe(I.DOLLAR,a,a+1,s,u,e);case 38:return new Fe(I.AMP,a,a+1,s,u,e);case 40:return new Fe(I.PAREN_L,a,a+1,s,u,e);case 41:return new Fe(I.PAREN_R,a,a+1,s,u,e);case 46:if(i.charCodeAt(a+1)===46&&i.charCodeAt(a+2)===46)return new Fe(I.SPREAD,a,a+3,s,u,e);break;case 58:return new Fe(I.COLON,a,a+1,s,u,e);case 61:return new Fe(I.EQUALS,a,a+1,s,u,e);case 64:return new Fe(I.AT,a,a+1,s,u,e);case 91:return new Fe(I.BRACKET_L,a,a+1,s,u,e);case 93:return new Fe(I.BRACKET_R,a,a+1,s,u,e);case 123:return new Fe(I.BRACE_L,a,a+1,s,u,e);case 124:return new Fe(I.PIPE,a,a+1,s,u,e);case 125:return new Fe(I.BRACE_R,a,a+1,s,u,e);case 34:return i.charCodeAt(a+1)===34&&i.charCodeAt(a+2)===34?Yy(r,a,s,u,e,t):Jy(r,a,s,u,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Zy(r,a,o,s,u,e);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return e0(r,a,s,u,e)}throw kt(r,a,Gy(o))}var c=t.line,l=1+a-t.lineStart;return new Fe(I.EOF,n,n,c,l,e)}function Gy(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(zi(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(zi(t),".")}function Ky(t,e,r,i,n){var a=t.body,o,s=e;do o=a.charCodeAt(++s);while(!isNaN(o)&&(o>31||o===9));return new Fe(I.COMMENT,e,s,r,i,n,a.slice(e+1,s))}function Zy(t,e,r,i,n,a){var o=t.body,s=r,u=e,c=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw kt(t,u,"Invalid number, unexpected digit after 0: ".concat(zi(s),"."))}else u=rl(t,u,s),s=o.charCodeAt(u);if(s===46&&(c=!0,s=o.charCodeAt(++u),u=rl(t,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(c=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=rl(t,u,s),s=o.charCodeAt(u)),s===46||t0(s))throw kt(t,u,"Invalid number, expected digit but got: ".concat(zi(s),"."));return new Fe(c?I.FLOAT:I.INT,e,u,i,n,a,o.slice(e,u))}function rl(t,e,r){var i=t.body,n=e,a=r;if(a>=48&&a<=57){do a=i.charCodeAt(++n);while(a>=48&&a<=57);return n}throw kt(t,n,"Invalid number, expected digit but got: ".concat(zi(a),"."))}function Jy(t,e,r,i,n){for(var a=t.body,o=e+1,s=o,u=0,c="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&u!==10&&u!==13;){if(u===34)return c+=a.slice(s,o),new Fe(I.STRING,e,o+1,r,i,n,c);if(u<32&&u!==9)throw kt(t,o,"Invalid character within String: ".concat(zi(u),"."));if(++o,u===92){switch(c+=a.slice(s,o-1),u=a.charCodeAt(o),u){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
61
61
  `;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=Xy(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var d=a.slice(o+1,o+5);throw kt(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw kt(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw kt(t,o,"Unterminated string.")}function Yy(t,e,r,i,n,a){for(var o=t.body,s=e+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(c===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(u,s),new Fe(I.BLOCK_STRING,e,s+3,r,i,n,Vy(l));if(c<32&&c!==9&&c!==10&&c!==13)throw kt(t,s,"Invalid character within String: ".concat(zi(c),"."));c===10?(++s,++a.line,a.lineStart=s):c===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):c===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw kt(t,s,"Unterminated string.")}function Xy(t,e,r,i){return ms(t)<<12|ms(e)<<8|ms(r)<<4|ms(i)}function ms(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function e0(t,e,r,i,n){for(var a=t.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Fe(I.NAME,e,s,r,i,n,a.slice(e,s))}function t0(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function r0(t,e){var r=new i0(t,e);return r.parseDocument()}var i0=function(){function t(r,i){var n=qy(r)?r:new g1(r);this._lexer=new zy(n),this._options=i}var e=t.prototype;return e.parseName=function(){var i=this.expectToken(I.NAME);return{kind:W.NAME,value:i.value,loc:this.loc(i)}},e.parseDocument=function(){var i=this._lexer.token;return{kind:W.DOCUMENT,definitions:this.many(I.SOF,this.parseDefinition,I.EOF),loc:this.loc(i)}},e.parseDefinition=function(){if(this.peek(I.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(I.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var i=this._lexer.token;if(this.peek(I.BRACE_L))return{kind:W.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(i)};var n=this.parseOperationType(),a;return this.peek(I.NAME)&&(a=this.parseName()),{kind:W.OPERATION_DEFINITION,operation:n,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseOperationType=function(){var i=this.expectToken(I.NAME);switch(i.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(i)},e.parseVariableDefinitions=function(){return this.optionalMany(I.PAREN_L,this.parseVariableDefinition,I.PAREN_R)},e.parseVariableDefinition=function(){var i=this._lexer.token;return{kind:W.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(I.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(I.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(i)}},e.parseVariable=function(){var i=this._lexer.token;return this.expectToken(I.DOLLAR),{kind:W.VARIABLE,name:this.parseName(),loc:this.loc(i)}},e.parseSelectionSet=function(){var i=this._lexer.token;return{kind:W.SELECTION_SET,selections:this.many(I.BRACE_L,this.parseSelection,I.BRACE_R),loc:this.loc(i)}},e.parseSelection=function(){return this.peek(I.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var i=this._lexer.token,n=this.parseName(),a,o;return this.expectOptionalToken(I.COLON)?(a=n,o=this.parseName()):o=n,{kind:W.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(I.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(i)}},e.parseArguments=function(i){var n=i?this.parseConstArgument:this.parseArgument;return this.optionalMany(I.PAREN_L,n,I.PAREN_R)},e.parseArgument=function(){var i=this._lexer.token,n=this.parseName();return this.expectToken(I.COLON),{kind:W.ARGUMENT,name:n,value:this.parseValueLiteral(!1),loc:this.loc(i)}},e.parseConstArgument=function(){var i=this._lexer.token;return{kind:W.ARGUMENT,name:this.parseName(),value:(this.expectToken(I.COLON),this.parseValueLiteral(!0)),loc:this.loc(i)}},e.parseFragment=function(){var i=this._lexer.token;this.expectToken(I.SPREAD);var n=this.expectOptionalKeyword("on");return!n&&this.peek(I.NAME)?{kind:W.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(i)}:{kind:W.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentDefinition=function(){var i,n=this._lexer.token;return this.expectKeyword("fragment"),((i=this._options)===null||i===void 0?void 0:i.experimentalFragmentVariables)===!0?{kind:W.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}:{kind:W.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(i){var n=this._lexer.token;switch(n.kind){case I.BRACKET_L:return this.parseList(i);case I.BRACE_L:return this.parseObject(i);case I.INT:return this._lexer.advance(),{kind:W.INT,value:n.value,loc:this.loc(n)};case I.FLOAT:return this._lexer.advance(),{kind:W.FLOAT,value:n.value,loc:this.loc(n)};case I.STRING:case I.BLOCK_STRING:return this.parseStringLiteral();case I.NAME:switch(this._lexer.advance(),n.value){case"true":return{kind:W.BOOLEAN,value:!0,loc:this.loc(n)};case"false":return{kind:W.BOOLEAN,value:!1,loc:this.loc(n)};case"null":return{kind:W.NULL,loc:this.loc(n)};default:return{kind:W.ENUM,value:n.value,loc:this.loc(n)}}case I.DOLLAR:if(!i)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var i=this._lexer.token;return this._lexer.advance(),{kind:W.STRING,value:i.value,block:i.kind===I.BLOCK_STRING,loc:this.loc(i)}},e.parseList=function(i){var n=this,a=this._lexer.token,o=function(){return n.parseValueLiteral(i)};return{kind:W.LIST,values:this.any(I.BRACKET_L,o,I.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(i){var n=this,a=this._lexer.token,o=function(){return n.parseObjectField(i)};return{kind:W.OBJECT,fields:this.any(I.BRACE_L,o,I.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(i){var n=this._lexer.token,a=this.parseName();return this.expectToken(I.COLON),{kind:W.OBJECT_FIELD,name:a,value:this.parseValueLiteral(i),loc:this.loc(n)}},e.parseDirectives=function(i){for(var n=[];this.peek(I.AT);)n.push(this.parseDirective(i));return n},e.parseDirective=function(i){var n=this._lexer.token;return this.expectToken(I.AT),{kind:W.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(i),loc:this.loc(n)}},e.parseTypeReference=function(){var i=this._lexer.token,n;return this.expectOptionalToken(I.BRACKET_L)?(n=this.parseTypeReference(),this.expectToken(I.BRACKET_R),n={kind:W.LIST_TYPE,type:n,loc:this.loc(i)}):n=this.parseNamedType(),this.expectOptionalToken(I.BANG)?{kind:W.NON_NULL_TYPE,type:n,loc:this.loc(i)}:n},e.parseNamedType=function(){var i=this._lexer.token;return{kind:W.NAMED_TYPE,name:this.parseName(),loc:this.loc(i)}},e.parseTypeSystemDefinition=function(){var i=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(i.kind===I.NAME)switch(i.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(i)},e.peekDescription=function(){return this.peek(I.STRING)||this.peek(I.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);return{kind:W.SCHEMA_DEFINITION,description:n,directives:a,operationTypes:o,loc:this.loc(i)}},e.parseOperationTypeDefinition=function(){var i=this._lexer.token,n=this.parseOperationType();this.expectToken(I.COLON);var a=this.parseNamedType();return{kind:W.OPERATION_TYPE_DEFINITION,operation:n,type:a,loc:this.loc(i)}},e.parseScalarTypeDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:W.SCALAR_TYPE_DEFINITION,description:n,name:a,directives:o,loc:this.loc(i)}},e.parseObjectTypeDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:W.OBJECT_TYPE_DEFINITION,description:n,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(i)}},e.parseImplementsInterfaces=function(){var i;if(!this.expectOptionalKeyword("implements"))return[];if(((i=this._options)===null||i===void 0?void 0:i.allowLegacySDLImplementsInterfaces)===!0){var n=[];this.expectOptionalToken(I.AMP);do n.push(this.parseNamedType());while(this.expectOptionalToken(I.AMP)||this.peek(I.NAME));return n}return this.delimitedMany(I.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var i;return((i=this._options)===null||i===void 0?void 0:i.allowLegacySDLEmptyFields)===!0&&this.peek(I.BRACE_L)&&this._lexer.lookahead().kind===I.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(I.BRACE_L,this.parseFieldDefinition,I.BRACE_R)},e.parseFieldDefinition=function(){var i=this._lexer.token,n=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(I.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:W.FIELD_DEFINITION,description:n,name:a,arguments:o,type:s,directives:u,loc:this.loc(i)}},e.parseArgumentDefs=function(){return this.optionalMany(I.PAREN_L,this.parseInputValueDef,I.PAREN_R)},e.parseInputValueDef=function(){var i=this._lexer.token,n=this.parseDescription(),a=this.parseName();this.expectToken(I.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(I.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:W.INPUT_VALUE_DEFINITION,description:n,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(i)}},e.parseInterfaceTypeDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:W.INTERFACE_TYPE_DEFINITION,description:n,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(i)}},e.parseUnionTypeDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:W.UNION_TYPE_DEFINITION,description:n,name:a,directives:o,types:s,loc:this.loc(i)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(I.EQUALS)?this.delimitedMany(I.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:W.ENUM_TYPE_DEFINITION,description:n,name:a,directives:o,values:s,loc:this.loc(i)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(I.BRACE_L,this.parseEnumValueDefinition,I.BRACE_R)},e.parseEnumValueDefinition=function(){var i=this._lexer.token,n=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:W.ENUM_VALUE_DEFINITION,description:n,name:a,directives:o,loc:this.loc(i)}},e.parseInputObjectTypeDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:W.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:a,directives:o,fields:s,loc:this.loc(i)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(I.BRACE_L,this.parseInputValueDef,I.BRACE_R)},e.parseTypeSystemExtension=function(){var i=this._lexer.lookahead();if(i.kind===I.NAME)switch(i.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(i)},e.parseSchemaExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var n=this.parseDirectives(!0),a=this.optionalMany(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);if(n.length===0&&a.length===0)throw this.unexpected();return{kind:W.SCHEMA_EXTENSION,directives:n,operationTypes:a,loc:this.loc(i)}},e.parseScalarTypeExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var n=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:W.SCALAR_TYPE_EXTENSION,name:n,directives:a,loc:this.loc(i)}},e.parseObjectTypeExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var n=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:W.OBJECT_TYPE_EXTENSION,name:n,interfaces:a,directives:o,fields:s,loc:this.loc(i)}},e.parseInterfaceTypeExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var n=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:W.INTERFACE_TYPE_EXTENSION,name:n,interfaces:a,directives:o,fields:s,loc:this.loc(i)}},e.parseUnionTypeExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var n=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:W.UNION_TYPE_EXTENSION,name:n,directives:a,types:o,loc:this.loc(i)}},e.parseEnumTypeExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var n=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:W.ENUM_TYPE_EXTENSION,name:n,directives:a,values:o,loc:this.loc(i)}},e.parseInputObjectTypeExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var n=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:W.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:a,fields:o,loc:this.loc(i)}},e.parseDirectiveDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(I.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:W.DIRECTIVE_DEFINITION,description:n,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(i)}},e.parseDirectiveLocations=function(){return this.delimitedMany(I.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var i=this._lexer.token,n=this.parseName();if(By[n.value]!==void 0)return n;throw this.unexpected(i)},e.loc=function(i){var n;if(((n=this._options)===null||n===void 0?void 0:n.noLocation)!==!0)return new h1(i,this._lexer.lastToken,this._lexer.source)},e.peek=function(i){return this._lexer.token.kind===i},e.expectToken=function(i){var n=this._lexer.token;if(n.kind===i)return this._lexer.advance(),n;throw kt(this._lexer.source,n.start,"Expected ".concat(y1(i),", found ").concat(il(n),"."))},e.expectOptionalToken=function(i){var n=this._lexer.token;if(n.kind===i)return this._lexer.advance(),n},e.expectKeyword=function(i){var n=this._lexer.token;if(n.kind===I.NAME&&n.value===i)this._lexer.advance();else throw kt(this._lexer.source,n.start,'Expected "'.concat(i,'", found ').concat(il(n),"."))},e.expectOptionalKeyword=function(i){var n=this._lexer.token;return n.kind===I.NAME&&n.value===i?(this._lexer.advance(),!0):!1},e.unexpected=function(i){var n=i??this._lexer.token;return kt(this._lexer.source,n.start,"Unexpected ".concat(il(n),"."))},e.any=function(i,n,a){this.expectToken(i);for(var o=[];!this.expectOptionalToken(a);)o.push(n.call(this));return o},e.optionalMany=function(i,n,a){if(this.expectOptionalToken(i)){var o=[];do o.push(n.call(this));while(!this.expectOptionalToken(a));return o}return[]},e.many=function(i,n,a){this.expectToken(i);var o=[];do o.push(n.call(this));while(!this.expectOptionalToken(a));return o},e.delimitedMany=function(i,n){this.expectOptionalToken(i);var a=[];do a.push(n.call(this));while(this.expectOptionalToken(i));return a},t}();function il(t){var e=t.value;return y1(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function y1(t){return Wy(t)?'"'.concat(t,'"'):t}var Rs=new Map,El=new Map,v1=!0,Hs=!1;function b1(t){return t.replace(/[\s,]+/g," ").trim()}function n0(t){return b1(t.source.body.substring(t.start,t.end))}function a0(t){var e=new Set,r=[];return t.definitions.forEach(function(i){if(i.kind==="FragmentDefinition"){var n=i.name.value,a=n0(i.loc),o=El.get(n);o&&!o.has(a)?v1&&console.warn("Warning: fragment with name "+n+` already exists.
62
62
  graphql-tag enforces all fragment names across your application to be unique; read more about
63
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||El.set(n,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(i))}else r.push(i)}),Ws(Ws({},t),{definitions:r})}function o0(t){var e=new Set(t.definitions);e.forEach(function(i){i.loc&&delete i.loc,Object.keys(i).forEach(function(n){var a=i[n];a&&typeof a=="object"&&e.add(a)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function s0(t){var e=b1(t);if(!Rs.has(e)){var r=r0(t,{experimentalFragmentVariables:Hs,allowLegacyFragmentVariables:Hs});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Rs.set(e,o0(a0(r)))}return Rs.get(e)}function E(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var i=t[0];return e.forEach(function(n,a){n&&n.kind==="Document"?i+=n.loc.source.body:i+=n,i+=t[a+1]}),s0(i)}function c0(){Rs.clear(),El.clear()}function u0(){v1=!1}function l0(){Hs=!0}function p0(){Hs=!1}var Ia={gql:E,resetCaches:c0,disableFragmentWarnings:u0,enableExperimentalFragmentVariables:l0,disableExperimentalFragmentVariables:p0};(function(t){t.gql=Ia.gql,t.resetCaches=Ia.resetCaches,t.disableFragmentWarnings=Ia.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Ia.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Ia.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function k(t){if(!t)throw"Got no result from Apollo";if(t.error)throw t.error;if(t.errors)throw t.errors;return t.data}function f0(){}function li(){return f0}var Y=li,g=li,Ze=li,_e=li,G=li,Dt=li,d0=li,Gl=li,_1=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},S1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Wi=class{constructor(e){this.code=e}};_1([g(),S1("design:type",String)],Wi.prototype,"code",void 0);Wi=_1([G(),S1("design:paramtypes",[String])],Wi);var Kl=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Zl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ur=class{constructor(e,r){this.address=e,this.name=r}};Kl([g(),Zl("design:type",String)],ur.prototype,"address",void 0);Kl([g(),Zl("design:type",String)],ur.prototype,"name",void 0);ur=Kl([G(),Zl("design:paramtypes",[String,String])],ur);var Ie=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Qe=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Tr=class{constructor(e,r){this.key=r,this.signature=e}};Ie([g(),Qe("design:type",String)],Tr.prototype,"signature",void 0);Ie([g(),Qe("design:type",String)],Tr.prototype,"key",void 0);Ie([g(),Qe("design:type",Boolean)],Tr.prototype,"valid",void 0);Ie([g(),Qe("design:type",Boolean)],Tr.prototype,"invalid",void 0);Tr=Ie([G(),Ze(),Qe("design:paramtypes",[String,String])],Tr);var Hi=class{};Ie([g(),Qe("design:type",String)],Hi.prototype,"signature",void 0);Ie([g(),Qe("design:type",String)],Hi.prototype,"key",void 0);Ie([g(),Qe("design:type",Boolean)],Hi.prototype,"valid",void 0);Ie([g(),Qe("design:type",Boolean)],Hi.prototype,"invalid",void 0);Hi=Ie([Ze()],Hi);function pi(t){let e=class{constructor(i,n,a,o){this.author=i,this.timestamp=n,this.data=a,this.proof=o}};return Ie([g(),Qe("design:type",String)],e.prototype,"author",void 0),Ie([g(),Qe("design:type",String)],e.prototype,"timestamp",void 0),Ie([g(),Qe("design:type",Object)],e.prototype,"data",void 0),Ie([g(),Qe("design:type",Tr)],e.prototype,"proof",void 0),e=Ie([G(),Qe("design:paramtypes",[String,String,Object,Tr])],e),e}function h0(t){let e=class{};return Ie([g(),Qe("design:type",String)],e.prototype,"author",void 0),Ie([g(),Qe("design:type",String)],e.prototype,"timestamp",void 0),Ie([g(),Qe("design:type",Object)],e.prototype,"data",void 0),Ie([g(),Qe("design:type",Hi)],e.prototype,"proof",void 0),e=Ie([Ze()],e),e}var Jd=class extends pi(){};Jd=Ie([G()],Jd);var Gs=class extends pi(){};Ie([g(),Qe("design:type",ur)],Gs.prototype,"language",void 0);Ie([g(),Qe("design:type",Wi)],Gs.prototype,"icon",void 0);Gs=Ie([G()],Gs);function v8(t){return t&&t.author&&t.timestamp&&t.data}var Ue=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},it=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Gi=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Ue([g(),it("design:type",String)],Gi.prototype,"source",void 0);Ue([g(),it("design:type",String)],Gi.prototype,"target",void 0);Ue([g(),it("design:type",String)],Gi.prototype,"predicate",void 0);Gi=Ue([G(),it("design:paramtypes",[Object])],Gi);var Ks=class{};Ue([g(),it("design:type",Array)],Ks.prototype,"additions",void 0);Ue([g(),it("design:type",Array)],Ks.prototype,"removals",void 0);Ks=Ue([Ze()],Ks);var Zs=class{constructor(e,r){this.additions=e,this.removals=r}};Ue([g(),it("design:type",Array)],Zs.prototype,"additions",void 0);Ue([g(),it("design:type",Array)],Zs.prototype,"removals",void 0);Zs=Ue([G(),it("design:paramtypes",[Array,Array])],Zs);var io=class{};Ue([g(),it("design:type",String)],io.prototype,"source",void 0);Ue([g(),it("design:type",String)],io.prototype,"target",void 0);Ue([g(),it("design:type",String)],io.prototype,"predicate",void 0);io=Ue([Ze()],io);var ni=class extends pi(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,i,n;for(i=0;i<e.length;i++)n=e.charCodeAt(i),r=(r<<5)-r+n,r|=0;return r}};Ue([g(),it("design:type",String)],ni.prototype,"status",void 0);ni=Ue([G()],ni);var xl=class extends h0(){};Ue([g(),it("design:type",String)],xl.prototype,"status",void 0);xl=Ue([Ze()],xl);function x8(t,e){return t.author==e.author&&t.timestamp==e.timestamp&&t.data.source==e.data.source&&t.data.predicate==e.data.predicate&&t.data.target==e.data.target}function A8(t){return t&&t.source&&t.target}var Js=class{constructor(e,r){this.oldLink=e,this.newLink=r}};Ue([g(),it("design:type",ni)],Js.prototype,"oldLink",void 0);Ue([g(),it("design:type",ni)],Js.prototype,"newLink",void 0);Js=Ue([G(),it("design:paramtypes",[ni,ni])],Js);var rn=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},yo=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Al,fr=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let i=JSON.parse(JSON.stringify(this.links));return e.target&&(i=i.filter(n=>n.data.target===e.target)),e.predicate&&(i=i.filter(n=>n.data.predicate===e.predicate)),e.fromDate&&(i=i.filter(n=>new Date(n.timestamp)>=e.fromDate)),e.untilDate&&(i=i.filter(n=>new Date(n.timestamp)<=e.untilDate)),e.limit&&(i=i.slice(0,e.limit)),i}if(e.target){let i=JSON.parse(JSON.stringify(this.links));return e.predicate&&(i=i.filter(n=>n.data.predicate===e.predicate)),e.fromDate&&(i=i.filter(n=>new Date(n.timestamp)>=e.fromDate)),e.untilDate&&(i=i.filter(n=>new Date(n.timestamp)<=e.untilDate)),e.limit&&(i=i.slice(0,e.limit)),i}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(i=>i.data.predicate===e.predicate),e.limit&&(r=r.slice(0,e.limit)),r}getSingleTarget(e){delete e.target;let r=this.get(e);return r.length?r[0].data.target:null}};rn([g(),yo("design:type",Array)],fr.prototype,"links",void 0);fr=rn([G(),yo("design:paramtypes",[Array])],fr);var Ys=class{};rn([g(),yo("design:type",Array)],Ys.prototype,"links",void 0);Ys=rn([Ze()],Ys);var kl=Al=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new Al;return r.links.push(e),r}};rn([g(),yo("design:type",Array)],kl.prototype,"links",void 0);kl=Al=rn([Ze(),yo("design:paramtypes",[Array])],kl);var Ki=class extends pi(){};Ki=rn([G()],Ki);var q=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},B=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Xr=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new fr}};q([g(),B("design:type",String)],Xr.prototype,"did",void 0);q([g(),B("design:type",fr)],Xr.prototype,"perspective",void 0);q([g(),B("design:type",String)],Xr.prototype,"directMessageLanguage",void 0);Xr=q([G(),B("design:paramtypes",[String,fr])],Xr);var Yd=class extends pi(){};Yd=q([G()],Yd);var ai=class{constructor(e,r,i,n,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=i,this.deviceKey=n,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};q([g(),B("design:type",String)],ai.prototype,"did",void 0);q([g(),B("design:type",String)],ai.prototype,"didSigningKeyId",void 0);q([g(),B("design:type",String)],ai.prototype,"deviceKeyType",void 0);q([g(),B("design:type",String)],ai.prototype,"deviceKey",void 0);q([g(),B("design:type",String)],ai.prototype,"deviceKeySignedByDid",void 0);q([g(),B("design:type",String)],ai.prototype,"didSignedByDeviceKey",void 0);ai=q([G(),B("design:paramtypes",[String,String,String,String,String,String])],ai);var oi=class{constructor(e,r,i,n,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=i,this.deviceKey=n,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};q([g(),B("design:type",String)],oi.prototype,"did",void 0);q([g(),B("design:type",String)],oi.prototype,"didSigningKeyId",void 0);q([g(),B("design:type",String)],oi.prototype,"deviceKeyType",void 0);q([g(),B("design:type",String)],oi.prototype,"deviceKey",void 0);q([g(),B("design:type",String)],oi.prototype,"deviceKeySignedByDid",void 0);q([g(),B("design:type",String)],oi.prototype,"didSignedByDeviceKey",void 0);oi=q([Ze(),B("design:paramtypes",[String,String,String,String,String,String])],oi);var Xs=class{constructor(e,r){this.signature=e,this.publicKey=r}};q([g(),B("design:type",String)],Xs.prototype,"signature",void 0);q([g(),B("design:type",String)],Xs.prototype,"publicKey",void 0);Xs=q([G(),B("design:paramtypes",[String,String])],Xs);var qn=class{constructor(e,r){this.domain=e,this.pointers=r}};q([g(),B("design:type",String)],qn.prototype,"domain",void 0);q([g(),B("design:type",Array)],qn.prototype,"pointers",void 0);qn=q([G(),B("design:paramtypes",[String,Array])],qn);var ec=class{constructor(e,r){this.with=e,this.can=r}};q([g(),B("design:type",qn)],ec.prototype,"with",void 0);q([g(),B("design:type",Array)],ec.prototype,"can",void 0);ec=q([G(),B("design:paramtypes",[qn,Array])],ec);var Ir=class{constructor(e,r,i,n,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=i,this.capabilities=n}};q([g(),B("design:type",String)],Ir.prototype,"appName",void 0);q([g(),B("design:type",String)],Ir.prototype,"appDesc",void 0);q([g(),B("design:type",String)],Ir.prototype,"appUrl",void 0);q([g(),B("design:type",String)],Ir.prototype,"appIconPath",void 0);q([g(),B("design:type",Array)],Ir.prototype,"capabilities",void 0);Ir=q([G(),B("design:paramtypes",[String,String,String,Array,String])],Ir);var Bn=class{constructor(e,r,i,n){this.requestId=e,this.auth=r,this.token=i,this.revoked=n}};q([g(),B("design:type",String)],Bn.prototype,"requestId",void 0);q([g(),B("design:type",String)],Bn.prototype,"token",void 0);q([g(),B("design:type",Boolean)],Bn.prototype,"revoked",void 0);q([g(),B("design:type",Ir)],Bn.prototype,"auth",void 0);Bn=q([G(),B("design:paramtypes",[String,Ir,String,Boolean])],Bn);var Vn=class{constructor(e,r){this.domain=e,this.pointers=r}};q([g(),B("design:type",String)],Vn.prototype,"domain",void 0);q([g(),B("design:type",Array)],Vn.prototype,"pointers",void 0);Vn=q([Ze(),B("design:paramtypes",[String,Array])],Vn);var tc=class{constructor(e,r){this.with=e,this.can=r}};q([g(),B("design:type",Vn)],tc.prototype,"with",void 0);q([g(),B("design:type",Array)],tc.prototype,"can",void 0);tc=q([Ze(),B("design:paramtypes",[Vn,Array])],tc);var dr=class{constructor(e,r,i,n,a,o){this.appName=e,this.appDesc=r,this.appUrl=n,this.appDomain=i,this.capabilities=o,this.appIconPath=a}};q([g(),B("design:type",String)],dr.prototype,"appName",void 0);q([g(),B("design:type",String)],dr.prototype,"appDesc",void 0);q([g(),B("design:type",String)],dr.prototype,"appDomain",void 0);q([g(),B("design:type",String)],dr.prototype,"appUrl",void 0);q([g(),B("design:type",String)],dr.prototype,"appIconPath",void 0);q([g(),B("design:type",Array)],dr.prototype,"capabilities",void 0);dr=q([Ze(),B("design:paramtypes",[String,String,String,String,String,Array])],dr);var Zi=class{constructor(e,r,i){this.did=e,this.success=r,this.error=i}};q([g(),B("design:type",String)],Zi.prototype,"did",void 0);q([g(),B("design:type",Boolean)],Zi.prototype,"success",void 0);q([g(),B("design:type",String)],Zi.prototype,"error",void 0);Zi=q([G(),B("design:paramtypes",[String,Boolean,String])],Zi);var Jn=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Yn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Mt=class{constructor(e){e?(this.isInitialized=e.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=e.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=e.did,this.didDocument=e.didDocument,this.error=e.error):(this.isInitialized=!1,this.isUnlocked=!1)}};Jn([g(),Yn("design:type",Boolean)],Mt.prototype,"isInitialized",void 0);Jn([g(),Yn("design:type",Boolean)],Mt.prototype,"isUnlocked",void 0);Jn([g(),Yn("design:type",String)],Mt.prototype,"did",void 0);Jn([g(),Yn("design:type",String)],Mt.prototype,"didDocument",void 0);Jn([g(),Yn("design:type",String)],Mt.prototype,"error",void 0);Mt=Jn([G(),Yn("design:paramtypes",[Object])],Mt);var Xd=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Le=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},yt,vt,Tl=class{constructor(e,r){yt.set(this,void 0),vt.set(this,void 0),Xd(this,yt,e,"f"),Xd(this,vt,r,"f")}async otherAgents(){return await Le(this,yt,"f").otherAgents(Le(this,vt,"f"))}async hasTelepresenceAdapter(){return await Le(this,yt,"f").hasTelepresenceAdapter(Le(this,vt,"f"))}async onlineAgents(){return await Le(this,yt,"f").onlineAgents(Le(this,vt,"f"))}async setOnlineStatus(e){return await Le(this,yt,"f").setOnlineStatus(Le(this,vt,"f"),e)}async setOnlineStatusU(e){return await Le(this,yt,"f").setOnlineStatusU(Le(this,vt,"f"),e)}async sendSignal(e,r){return await Le(this,yt,"f").sendSignal(Le(this,vt,"f"),e,r)}async sendSignalU(e,r){return await Le(this,yt,"f").sendSignalU(Le(this,vt,"f"),e,r)}async sendBroadcast(e,r=!1){return await Le(this,yt,"f").sendBroadcast(Le(this,vt,"f"),e,r)}async sendBroadcastU(e,r=!1){return await Le(this,yt,"f").sendBroadcastU(Le(this,vt,"f"),e,r)}async addSignalHandler(e){await Le(this,yt,"f").addSignalHandler(Le(this,vt,"f"),e)}removeSignalHandler(e){Le(this,yt,"f").removeSignalHandler(Le(this,vt,"f"),e)}};yt=new WeakMap,vt=new WeakMap;var nn=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},an=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ot=class{constructor(e){e&&(this.source=e.source,this.predicate=e.predicate,this.target=e.target,e.fromDate&&(this.fromDate=e.fromDate),e.untilDate&&(this.untilDate=e.untilDate),e.limit&&(this.limit=e.limit))}isMatch(e){return!(this.source&&this.source!==e.source||this.predicate&&this.predicate!==e.predicate||this.target&&this.target!==e.target)}};nn([g(),an("design:type",String)],ot.prototype,"source",void 0);nn([g(),an("design:type",String)],ot.prototype,"target",void 0);nn([g(),an("design:type",String)],ot.prototype,"predicate",void 0);nn([g(),an("design:type",Date)],ot.prototype,"fromDate",void 0);nn([g(),an("design:type",Date)],ot.prototype,"untilDate",void 0);nn([g(),an("design:type",Number)],ot.prototype,"limit",void 0);ot=nn([G(),Ze(),an("design:paramtypes",[Object])],ot);var eh=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},tt=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},bt,wr;function gs(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var wt=class{constructor(){bt.set(this,void 0),wr.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new wt;return eh(r,wr,e,"f"),r}static from(e){let r=new wt;return eh(r,bt,e,"f"),r}toUrl(){if(tt(this,wr,"f")&&!tt(this,bt,"f"))return tt(this,wr,"f");if(!tt(this,wr,"f")&&(tt(this,bt,"f")===void 0||tt(this,bt,"f")===""||tt(this,bt,"f")===null))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof tt(this,bt,"f")){case"string":e=`string:${gs(tt(this,bt,"f"))}`;break;case"number":e=`number:${gs(tt(this,bt,"f"))}`;break;case"boolean":e=`boolean:${gs(tt(this,bt,"f"))}`;break;case"object":e=`json:${gs(JSON.stringify(tt(this,bt,"f")))}`;break}return`literal://${e}`}get(){if(tt(this,bt,"f"))return tt(this,bt,"f");if(!tt(this,wr,"f"))throw new Error("Can't render empty Literal");if(!tt(this,wr,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=tt(this,wr,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let r=e.substring(7);return parseFloat(r)}if(e.startsWith("json:")){let r=e.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${e}`)}};bt=new WeakMap,wr=new WeakMap;function ei(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Jl(t){return`set${ei(t)}`}function kr(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function Yl(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function m0(t){return`add${ei(Yl(t))}`}function g0(t){let e=t.substring(3),r=kr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function y0(t){return`remove${ei(Yl(t))}`}function v0(t){let e=t.substring(6),r=kr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function b0(t){let e=t.substring(13),r=kr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function _0(t){return`setCollection${ei(Yl(t))}`}function Di(t){if(Array.isArray(t))return`[${t.map(Di).join(", ")}]`;let e=Object.keys(t),r=[];for(let i of e){let n=JSON.stringify(t[i]),a=`${i}: ${n}`;r.push(a)}return`{${r.join(", ")}}`}var nl=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},J=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},lt,pt,De,rc=class{constructor(t,e,r){lt.set(this,void 0),pt.set(this,void 0),De.set(this,void 0),nl(this,lt,e,"f"),nl(this,pt,r,"f"),nl(this,De,t,"f")}get baseExpression(){return J(this,lt,"f")}async init(){let isInstance=await J(this,De,"f").isSubjectInstance(J(this,lt,"f"),J(this,pt,"f"));if(!isInstance)throw`Not a valid subject instance of ${J(this,pt,"f")} for ${J(this,lt,"f")}`;let results=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property_getter(C, "${J(this,lt,"f")}", "${t}", Value)`);if(r&&r.length>0){let i=r[0].Value;if(e)try{if(i){let n=await J(this,De,"f").getExpression(i);try{return JSON.parse(n.data)}catch{return n.data}}else return i}catch{return i}else return i}else return r||void 0}})}let setters=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[Jl(property)]=async t=>{resolveLanguage&&(t=await J(this,De,"f").createExpression(t,resolveLanguage)),await J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:t}])}}let results2=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let t of collections)Object.defineProperty(this,t,{configurable:!0,get:async()=>{let e=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection_getter(C, "${J(this,lt,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(i=>i!==""&&i!==""):[]}});let adders=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection_adder(C, Collection, Adder)`);adders||(adders=[]);for(let adder of adders)if(adder){let collection=adder.Collection,actions=eval(adder.Adder);this[m0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:e}]))):await J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:t}])}}let removers=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection_remover(C, Collection, Remover)`);removers||(removers=[]);for(let remover of removers)if(remover){let collection=remover.Collection,actions=eval(remover.Remover);this[y0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:e}]))):await J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:t}])}}let collectionSetters=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection_setter(C, Collection, Setter)`);collectionSetters||(collectionSetters=[]);for(let collectionSetter of collectionSetters)if(collectionSetter){let collection=collectionSetter.Collection,actions=eval(collectionSetter.Setter);this[_0(collection)]=async t=>{Array.isArray(t)?await J(this,De,"f").executeAction(actions,J(this,lt,"f"),t.map(e=>({name:"value",value:e}))):await J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:t}])}}}};lt=new WeakMap,pt=new WeakMap,De=new WeakMap;var be=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},T=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},Ps,Cr,ir,nr,ji,Gr,Kr,Ni,Pa,$s,Ri,Pi,Lt,Fn,Il,de,ge,$i,Li,Fi,$a,ic=class{constructor(e,r,i){Ps.add(this),Cr.set(this,void 0),ir.set(this,void 0),nr.set(this,void 0),ji.set(this,void 0),Gr.set(this,void 0),Kr.set(this,void 0),Ni.set(this,void 0),Pa.set(this,!1),$s.set(this,void 0),Ri.set(this,void 0),Pi.set(this,void 0),Lt.set(this,void 0),Fn.set(this,void 0),this.isSurrealDB=!1,be(this,Cr,e,"f"),be(this,Fn,r,"f"),be(this,nr,i,"f"),be(this,ji,new Set,"f"),be(this,Ni,null,"f"),be(this,$s,new Promise((n,a)=>{be(this,Ri,n,"f"),be(this,Pi,a,"f")}),"f")}async subscribe(){T(this,Kr,"f")&&(T(this,Kr,"f").call(this),be(this,Kr,void 0,"f")),T(this,Lt,"f")&&(clearTimeout(T(this,Lt,"f")),be(this,Lt,void 0,"f")),T(this,Gr,"f")&&(clearTimeout(T(this,Gr,"f")),be(this,Gr,void 0,"f"));try{let r;this.isSurrealDB?r=await T(this,nr,"f").perspectiveSubscribeSurrealQuery(T(this,Cr,"f"),T(this,Fn,"f")):r=await T(this,nr,"f").subscribeQuery(T(this,Cr,"f"),T(this,Fn,"f")),be(this,ir,r.subscriptionId,"f"),r.result?(be(this,Ni,r.result,"f"),T(this,Ps,"m",Il).call(this,r.result)):console.warn("\u26A0\uFE0F No initial result returned from subscribeQuery!"),be(this,Lt,setTimeout(()=>{console.error("Subscription initialization timed out after 30 seconds. Resubscribing..."),this.subscribe().catch(i=>{console.error("Error during subscription retry after timeout:",i)})},3e4),"f"),be(this,Kr,T(this,nr,"f").subscribeToQueryUpdates(T(this,ir,"f"),i=>{T(this,Lt,"f")&&(clearTimeout(T(this,Lt,"f")),be(this,Lt,void 0,"f")),T(this,Ri,"f")&&(T(this,Ri,"f").call(this,!0),be(this,Ri,void 0,"f"),be(this,Pi,void 0,"f")),!(i.isInit&&T(this,Ni,"f"))&&(be(this,Ni,i,"f"),T(this,Ps,"m",Il).call(this,i))}),"f")}catch(r){throw console.error("Error setting up subscription:",r),T(this,Pi,"f")&&(T(this,Pi,"f").call(this,r),be(this,Ri,void 0,"f"),be(this,Pi,void 0,"f")),r}let e=async()=>{if(!T(this,Pa,"f")){try{this.isSurrealDB?await T(this,nr,"f").perspectiveKeepAliveSurrealQuery(T(this,Cr,"f"),T(this,ir,"f")):await T(this,nr,"f").keepAliveQuery(T(this,Cr,"f"),T(this,ir,"f"))}catch(r){console.error("Error in keepalive:",r),console.log("Reinitializing subscription for query:",T(this,Fn,"f"));try{await this.subscribe(),console.log("Subscription reinitialized")}catch(i){console.error("Error during resubscription from keepalive:",i);return}}T(this,Pa,"f")||be(this,Gr,setTimeout(e,3e4),"f")}};be(this,Gr,setTimeout(e,3e4),"f")}get id(){return T(this,ir,"f")}get initialized(){return T(this,$s,"f")}get result(){return T(this,Ni,"f")}onResult(e){return T(this,ji,"f").add(e),()=>T(this,ji,"f").delete(e)}dispose(){be(this,Pa,!0,"f"),clearTimeout(T(this,Gr,"f")),T(this,Kr,"f")&&T(this,Kr,"f").call(this),T(this,ji,"f").clear(),T(this,Lt,"f")&&(clearTimeout(T(this,Lt,"f")),be(this,Lt,void 0,"f")),T(this,ir,"f")&&(this.isSurrealDB?T(this,nr,"f").perspectiveDisposeSurrealQuerySubscription(T(this,Cr,"f"),T(this,ir,"f")).catch(e=>console.error("Error disposing surreal query subscription:",e)):T(this,nr,"f").disposeQuerySubscription(T(this,Cr,"f"),T(this,ir,"f")).catch(e=>console.error("Error disposing query subscription:",e)))}};Cr=new WeakMap,ir=new WeakMap,nr=new WeakMap,ji=new WeakMap,Gr=new WeakMap,Kr=new WeakMap,Ni=new WeakMap,Pa=new WeakMap,$s=new WeakMap,Ri=new WeakMap,Pi=new WeakMap,Lt=new WeakMap,Fn=new WeakMap,Ps=new WeakSet,Il=function t(e){for(let r of T(this,ji,"f"))try{r(e)}catch(i){console.error("Error in query subscription callback:",i)}};var Un=class{constructor(t,e){de.set(this,void 0),ge.set(this,void 0),$i.set(this,void 0),Li.set(this,void 0),Fi.set(this,void 0),$a.set(this,void 0),be(this,$i,[],"f"),be(this,Li,[],"f"),be(this,Fi,[],"f"),be(this,$a,[],"f"),be(this,de,t,"f"),be(this,ge,e,"f"),this.uuid=T(this,de,"f").uuid,this.name=T(this,de,"f").name,this.owners=T(this,de,"f").owners,this.sharedUrl=T(this,de,"f").sharedUrl,this.neighbourhood=T(this,de,"f").neighbourhood,this.state=T(this,de,"f").state,T(this,ge,"f").addPerspectiveLinkAddedListener(T(this,de,"f").uuid,T(this,$i,"f")),T(this,ge,"f").addPerspectiveLinkRemovedListener(T(this,de,"f").uuid,T(this,Li,"f")),T(this,ge,"f").addPerspectiveLinkUpdatedListener(T(this,de,"f").uuid,T(this,Fi,"f")),T(this,ge,"f").addPerspectiveSyncStateChangeListener(T(this,de,"f").uuid,T(this,$a,"f"))}async executeAction(t,e,r,i){return await T(this,ge,"f").executeCommands(T(this,de,"f").uuid,JSON.stringify(t),e,JSON.stringify(r),i)}async get(t){return await T(this,ge,"f").queryLinks(T(this,de,"f").uuid,t)}async infer(t){return await T(this,ge,"f").queryProlog(T(this,de,"f").uuid,t)}async querySurrealDB(t){return await T(this,ge,"f").querySurrealDB(T(this,de,"f").uuid,t)}async add(t,e="shared",r){return await T(this,ge,"f").addLink(T(this,de,"f").uuid,t,e,r)}async addLinks(t,e="shared",r){return await T(this,ge,"f").addLinks(T(this,de,"f").uuid,t,e,r)}async removeLinks(t,e){return await T(this,ge,"f").removeLinks(T(this,de,"f").uuid,t,e)}async linkMutations(t,e="shared"){return await T(this,ge,"f").linkMutations(T(this,de,"f").uuid,t,e)}async addLinkExpression(t,e="shared",r){return await T(this,ge,"f").addLinkExpression(T(this,de,"f").uuid,t,e,r)}async update(t,e,r){return await T(this,ge,"f").updateLink(T(this,de,"f").uuid,t,e,r)}async remove(t,e){return await T(this,ge,"f").removeLink(T(this,de,"f").uuid,t,e)}async createBatch(){return await T(this,ge,"f").createBatch(T(this,de,"f").uuid)}async commitBatch(t){return await T(this,ge,"f").commitBatch(T(this,de,"f").uuid,t)}async getExpression(t){return await T(this,ge,"f").getExpression(t)}async createExpression(t,e){return await T(this,ge,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?T(this,$i,"f").push(e):t==="link-removed"?T(this,Li,"f").push(e):t==="link-updated"&&T(this,Fi,"f").push(e)}async addSyncStateChangeListener(t){T(this,$a,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=T(this,$i,"f").indexOf(e);T(this,$i,"f").splice(r,1)}else if(t==="link-removed"){let r=T(this,Li,"f").indexOf(e);T(this,Li,"f").splice(r,1)}else if(t==="link-updated"){let r=T(this,Fi,"f").indexOf(e);T(this,Fi,"f").splice(r,1)}}async snapshot(){return T(this,ge,"f").snapshotByUUID(T(this,de,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new ot({source:t.source,predicate:t.predicate}),i=await this.get(r),n=[];for(let o of i)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,n.push(o);let a=[t];await this.linkMutations({additions:a,removals:n},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(t){return(await this.infer(`flowable("${t}", F), register_sdna_flow(X, F)`)).map(r=>r.X)}async startFlow(flowName,exprAddr){let startAction=await this.infer(`start_action(Action, F), register_sdna_flow("${flowName}", F)`);startAction=eval(startAction[0].Action),await this.executeAction(startAction,exprAddr,void 0)}async expressionsInFlowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state(X, ${e}, F)`)).map(i=>i.X)}async flowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(t,e){return(await this.infer(`register_sdna_flow("${t}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(i=>i.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){let t=["ad4m://has_subject_class","ad4m://has_flow","ad4m://has_custom_sdna"],e=[];for(let r of t){let i=await this.get(new ot({source:"ad4m://self",predicate:r}));for(let n of i){let a=n.data.target,o=await this.get(new ot({source:a,predicate:"ad4m://sdna"}));for(let s of o){let u=wt.fromUrl(s.data.target).get();typeof u=="string"&&e.push(u)}}}return e}async getSdnaForClass(t){let e=wt.from(t);if((await this.get(new ot({source:"ad4m://self",target:e.toUrl(),predicate:"ad4m://has_subject_class"}))).length===0)return null;let i=await this.get(new ot({source:e.toUrl(),predicate:"ad4m://sdna"}));if(i.length===0)return null;let n=wt.fromUrl(i[0].data.target).get();return typeof n=="string"?n:null}async addSdna(t,e,r){return T(this,ge,"f").addSdna(T(this,de,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClassName(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(t,e,r,i){let n;if(typeof t=="string")n=t,await T(this,ge,"f").createSubject(T(this,de,"f").uuid,JSON.stringify({className:n,initialValues:r}),e,r?JSON.stringify(r):void 0,i);else{let a=this.buildQueryFromTemplate(t);await T(this,ge,"f").createSubject(T(this,de,"f").uuid,JSON.stringify({query:a,initialValues:r}),e,r?JSON.stringify(r):void 0,i)}return i?e:this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await T(this,ge,"f").getSubjectData(T(this,de,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await T(this,ge,"f").getSubjectData(T(this,de,"f").uuid,JSON.stringify({query:r}),e))}async removeSubject(subjectClass,exprAddr,batchId){let className=await this.stringOrTemplateObjectToSubjectClassName(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No destructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0,batchId)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClassName(e),i=!1,n=5,a=0;for(;a<n&&!i;)i=await this.infer(`subject_class("${r}", C), instance(C, "${t}")`),a++;return i}async getSubjectProxy(t,e){if(!await this.isSubjectInstance(t,e))throw`Expression ${t} is not a subject instance of given class: ${JSON.stringify(e)}`;let r=await this.stringOrTemplateObjectToSubjectClassName(e),i=new rc(this,t,r);return await i.init(),i}async getAllSubjectInstances(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let i of e){let n=await this.infer(`subject_class("${i}", C), instance(C, X)`),a=await Promise.all(n.map(async o=>await this.getSubjectProxy(o.X,i)));r=r.concat(a)}return r}async getAllSubjectProxies(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let i of e)r=await this.infer(`subject_class("${i}", C), instance(C, X)`);return r}buildQueryFromTemplate(t){let e;return function(r){let i=[],n=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>i.push(l)):i.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>{n.includes(l)||n.push(l)}):n.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")}));let o=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("add"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("add")}));let s=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("remove"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("remove")}));let u=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("setCollection"));u=u.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("setCollection")}));let c="subject_class(Class, C)";for(let l of i)c+=`, property(C, "${l}")`;for(let l of n)c+=`, collection(C, "${l}")`;for(let l of a){let d=l.substring(3);d=d.charAt(0).toLowerCase()+d.slice(1),c+=`, property_setter(C, "${d}", _)`}for(let l of o)c+=`, collection_adder(C, "${g0(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${v0(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${b0(l)}", _)`;c+=".",e=c}(t),e}async subjectClassesByTemplate(t){let e=this.buildQueryFromTemplate(t),r=await this.infer(e);return r?r.map(i=>i.Class):[]}async ensureSDNASubjectClass(t){if((await this.subjectClassesByTemplate(new t)).length>0)return;let{name:r,sdna:i}=t.generateSDNA();await this.addSdna(r,i,"subject_class")}getNeighbourhoodProxy(){return T(this,ge,"f").getNeighbourhoodProxy(T(this,de,"f").uuid)}get ai(){return T(this,ge,"f").aiClient}async subscribeInfer(t){let e=new ic(this.uuid,t,T(this,ge,"f"));return await e.subscribe(),await e.initialized,e}async subscribeSurrealDB(t){let e=new ic(this.uuid,t,T(this,ge,"f"));return e.isSurrealDB=!0,await e.subscribe(),await e.initialized,e}};de=new WeakMap,ge=new WeakMap,$i=new WeakMap,Li=new WeakMap,Fi=new WeakMap,$a=new WeakMap;var zr=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Q=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},ie,La,Fa,Ma,Ls,Ua,Fs,Ms,ut=`
63
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||El.set(n,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(i))}else r.push(i)}),Ws(Ws({},t),{definitions:r})}function o0(t){var e=new Set(t.definitions);e.forEach(function(i){i.loc&&delete i.loc,Object.keys(i).forEach(function(n){var a=i[n];a&&typeof a=="object"&&e.add(a)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function s0(t){var e=b1(t);if(!Rs.has(e)){var r=r0(t,{experimentalFragmentVariables:Hs,allowLegacyFragmentVariables:Hs});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Rs.set(e,o0(a0(r)))}return Rs.get(e)}function E(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var i=t[0];return e.forEach(function(n,a){n&&n.kind==="Document"?i+=n.loc.source.body:i+=n,i+=t[a+1]}),s0(i)}function c0(){Rs.clear(),El.clear()}function u0(){v1=!1}function l0(){Hs=!0}function p0(){Hs=!1}var Ia={gql:E,resetCaches:c0,disableFragmentWarnings:u0,enableExperimentalFragmentVariables:l0,disableExperimentalFragmentVariables:p0};(function(t){t.gql=Ia.gql,t.resetCaches=Ia.resetCaches,t.disableFragmentWarnings=Ia.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Ia.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Ia.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function k(t){if(!t)throw"Got no result from Apollo";if(t.error)throw t.error;if(t.errors)throw t.errors;return t.data}function f0(){}function li(){return f0}var Y=li,g=li,Ze=li,_e=li,G=li,Dt=li,d0=li,Gl=li,_1=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},S1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Wi=class{constructor(e){this.code=e}};_1([g(),S1("design:type",String)],Wi.prototype,"code",void 0);Wi=_1([G(),S1("design:paramtypes",[String])],Wi);var Kl=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Zl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ur=class{constructor(e,r){this.address=e,this.name=r}};Kl([g(),Zl("design:type",String)],ur.prototype,"address",void 0);Kl([g(),Zl("design:type",String)],ur.prototype,"name",void 0);ur=Kl([G(),Zl("design:paramtypes",[String,String])],ur);var Ie=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Qe=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Tr=class{constructor(e,r){this.key=r,this.signature=e}};Ie([g(),Qe("design:type",String)],Tr.prototype,"signature",void 0);Ie([g(),Qe("design:type",String)],Tr.prototype,"key",void 0);Ie([g(),Qe("design:type",Boolean)],Tr.prototype,"valid",void 0);Ie([g(),Qe("design:type",Boolean)],Tr.prototype,"invalid",void 0);Tr=Ie([G(),Ze(),Qe("design:paramtypes",[String,String])],Tr);var Hi=class{};Ie([g(),Qe("design:type",String)],Hi.prototype,"signature",void 0);Ie([g(),Qe("design:type",String)],Hi.prototype,"key",void 0);Ie([g(),Qe("design:type",Boolean)],Hi.prototype,"valid",void 0);Ie([g(),Qe("design:type",Boolean)],Hi.prototype,"invalid",void 0);Hi=Ie([Ze()],Hi);function pi(t){let e=class{constructor(i,n,a,o){this.author=i,this.timestamp=n,this.data=a,this.proof=o}};return Ie([g(),Qe("design:type",String)],e.prototype,"author",void 0),Ie([g(),Qe("design:type",String)],e.prototype,"timestamp",void 0),Ie([g(),Qe("design:type",Object)],e.prototype,"data",void 0),Ie([g(),Qe("design:type",Tr)],e.prototype,"proof",void 0),e=Ie([G(),Qe("design:paramtypes",[String,String,Object,Tr])],e),e}function h0(t){let e=class{};return Ie([g(),Qe("design:type",String)],e.prototype,"author",void 0),Ie([g(),Qe("design:type",String)],e.prototype,"timestamp",void 0),Ie([g(),Qe("design:type",Object)],e.prototype,"data",void 0),Ie([g(),Qe("design:type",Hi)],e.prototype,"proof",void 0),e=Ie([Ze()],e),e}var Jd=class extends pi(){};Jd=Ie([G()],Jd);var Gs=class extends pi(){};Ie([g(),Qe("design:type",ur)],Gs.prototype,"language",void 0);Ie([g(),Qe("design:type",Wi)],Gs.prototype,"icon",void 0);Gs=Ie([G()],Gs);function v8(t){return t&&t.author&&t.timestamp&&t.data}var Ue=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},it=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Gi=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Ue([g(),it("design:type",String)],Gi.prototype,"source",void 0);Ue([g(),it("design:type",String)],Gi.prototype,"target",void 0);Ue([g(),it("design:type",String)],Gi.prototype,"predicate",void 0);Gi=Ue([G(),it("design:paramtypes",[Object])],Gi);var Ks=class{};Ue([g(),it("design:type",Array)],Ks.prototype,"additions",void 0);Ue([g(),it("design:type",Array)],Ks.prototype,"removals",void 0);Ks=Ue([Ze()],Ks);var Zs=class{constructor(e,r){this.additions=e,this.removals=r}};Ue([g(),it("design:type",Array)],Zs.prototype,"additions",void 0);Ue([g(),it("design:type",Array)],Zs.prototype,"removals",void 0);Zs=Ue([G(),it("design:paramtypes",[Array,Array])],Zs);var io=class{};Ue([g(),it("design:type",String)],io.prototype,"source",void 0);Ue([g(),it("design:type",String)],io.prototype,"target",void 0);Ue([g(),it("design:type",String)],io.prototype,"predicate",void 0);io=Ue([Ze()],io);var ni=class extends pi(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,i,n;for(i=0;i<e.length;i++)n=e.charCodeAt(i),r=(r<<5)-r+n,r|=0;return r}};Ue([g(),it("design:type",String)],ni.prototype,"status",void 0);ni=Ue([G()],ni);var xl=class extends h0(){};Ue([g(),it("design:type",String)],xl.prototype,"status",void 0);xl=Ue([Ze()],xl);function x8(t,e){return t.author==e.author&&t.timestamp==e.timestamp&&t.data.source==e.data.source&&t.data.predicate==e.data.predicate&&t.data.target==e.data.target}function A8(t){return t&&t.source&&t.target}var Js=class{constructor(e,r){this.oldLink=e,this.newLink=r}};Ue([g(),it("design:type",ni)],Js.prototype,"oldLink",void 0);Ue([g(),it("design:type",ni)],Js.prototype,"newLink",void 0);Js=Ue([G(),it("design:paramtypes",[ni,ni])],Js);var nn=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},yo=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Al,fr=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let i=JSON.parse(JSON.stringify(this.links));return e.target&&(i=i.filter(n=>n.data.target===e.target)),e.predicate&&(i=i.filter(n=>n.data.predicate===e.predicate)),e.fromDate&&(i=i.filter(n=>new Date(n.timestamp)>=e.fromDate)),e.untilDate&&(i=i.filter(n=>new Date(n.timestamp)<=e.untilDate)),e.limit&&(i=i.slice(0,e.limit)),i}if(e.target){let i=JSON.parse(JSON.stringify(this.links));return e.predicate&&(i=i.filter(n=>n.data.predicate===e.predicate)),e.fromDate&&(i=i.filter(n=>new Date(n.timestamp)>=e.fromDate)),e.untilDate&&(i=i.filter(n=>new Date(n.timestamp)<=e.untilDate)),e.limit&&(i=i.slice(0,e.limit)),i}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(i=>i.data.predicate===e.predicate),e.limit&&(r=r.slice(0,e.limit)),r}getSingleTarget(e){delete e.target;let r=this.get(e);return r.length?r[0].data.target:null}};nn([g(),yo("design:type",Array)],fr.prototype,"links",void 0);fr=nn([G(),yo("design:paramtypes",[Array])],fr);var Ys=class{};nn([g(),yo("design:type",Array)],Ys.prototype,"links",void 0);Ys=nn([Ze()],Ys);var kl=Al=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new Al;return r.links.push(e),r}};nn([g(),yo("design:type",Array)],kl.prototype,"links",void 0);kl=Al=nn([Ze(),yo("design:paramtypes",[Array])],kl);var Ki=class extends pi(){};Ki=nn([G()],Ki);var q=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},B=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Xr=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new fr}};q([g(),B("design:type",String)],Xr.prototype,"did",void 0);q([g(),B("design:type",fr)],Xr.prototype,"perspective",void 0);q([g(),B("design:type",String)],Xr.prototype,"directMessageLanguage",void 0);Xr=q([G(),B("design:paramtypes",[String,fr])],Xr);var Yd=class extends pi(){};Yd=q([G()],Yd);var ai=class{constructor(e,r,i,n,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=i,this.deviceKey=n,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};q([g(),B("design:type",String)],ai.prototype,"did",void 0);q([g(),B("design:type",String)],ai.prototype,"didSigningKeyId",void 0);q([g(),B("design:type",String)],ai.prototype,"deviceKeyType",void 0);q([g(),B("design:type",String)],ai.prototype,"deviceKey",void 0);q([g(),B("design:type",String)],ai.prototype,"deviceKeySignedByDid",void 0);q([g(),B("design:type",String)],ai.prototype,"didSignedByDeviceKey",void 0);ai=q([G(),B("design:paramtypes",[String,String,String,String,String,String])],ai);var oi=class{constructor(e,r,i,n,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=i,this.deviceKey=n,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};q([g(),B("design:type",String)],oi.prototype,"did",void 0);q([g(),B("design:type",String)],oi.prototype,"didSigningKeyId",void 0);q([g(),B("design:type",String)],oi.prototype,"deviceKeyType",void 0);q([g(),B("design:type",String)],oi.prototype,"deviceKey",void 0);q([g(),B("design:type",String)],oi.prototype,"deviceKeySignedByDid",void 0);q([g(),B("design:type",String)],oi.prototype,"didSignedByDeviceKey",void 0);oi=q([Ze(),B("design:paramtypes",[String,String,String,String,String,String])],oi);var Xs=class{constructor(e,r){this.signature=e,this.publicKey=r}};q([g(),B("design:type",String)],Xs.prototype,"signature",void 0);q([g(),B("design:type",String)],Xs.prototype,"publicKey",void 0);Xs=q([G(),B("design:paramtypes",[String,String])],Xs);var Bn=class{constructor(e,r){this.domain=e,this.pointers=r}};q([g(),B("design:type",String)],Bn.prototype,"domain",void 0);q([g(),B("design:type",Array)],Bn.prototype,"pointers",void 0);Bn=q([G(),B("design:paramtypes",[String,Array])],Bn);var ec=class{constructor(e,r){this.with=e,this.can=r}};q([g(),B("design:type",Bn)],ec.prototype,"with",void 0);q([g(),B("design:type",Array)],ec.prototype,"can",void 0);ec=q([G(),B("design:paramtypes",[Bn,Array])],ec);var Ir=class{constructor(e,r,i,n,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=i,this.capabilities=n}};q([g(),B("design:type",String)],Ir.prototype,"appName",void 0);q([g(),B("design:type",String)],Ir.prototype,"appDesc",void 0);q([g(),B("design:type",String)],Ir.prototype,"appUrl",void 0);q([g(),B("design:type",String)],Ir.prototype,"appIconPath",void 0);q([g(),B("design:type",Array)],Ir.prototype,"capabilities",void 0);Ir=q([G(),B("design:paramtypes",[String,String,String,Array,String])],Ir);var Vn=class{constructor(e,r,i,n){this.requestId=e,this.auth=r,this.token=i,this.revoked=n}};q([g(),B("design:type",String)],Vn.prototype,"requestId",void 0);q([g(),B("design:type",String)],Vn.prototype,"token",void 0);q([g(),B("design:type",Boolean)],Vn.prototype,"revoked",void 0);q([g(),B("design:type",Ir)],Vn.prototype,"auth",void 0);Vn=q([G(),B("design:paramtypes",[String,Ir,String,Boolean])],Vn);var Qn=class{constructor(e,r){this.domain=e,this.pointers=r}};q([g(),B("design:type",String)],Qn.prototype,"domain",void 0);q([g(),B("design:type",Array)],Qn.prototype,"pointers",void 0);Qn=q([Ze(),B("design:paramtypes",[String,Array])],Qn);var tc=class{constructor(e,r){this.with=e,this.can=r}};q([g(),B("design:type",Qn)],tc.prototype,"with",void 0);q([g(),B("design:type",Array)],tc.prototype,"can",void 0);tc=q([Ze(),B("design:paramtypes",[Qn,Array])],tc);var dr=class{constructor(e,r,i,n,a,o){this.appName=e,this.appDesc=r,this.appUrl=n,this.appDomain=i,this.capabilities=o,this.appIconPath=a}};q([g(),B("design:type",String)],dr.prototype,"appName",void 0);q([g(),B("design:type",String)],dr.prototype,"appDesc",void 0);q([g(),B("design:type",String)],dr.prototype,"appDomain",void 0);q([g(),B("design:type",String)],dr.prototype,"appUrl",void 0);q([g(),B("design:type",String)],dr.prototype,"appIconPath",void 0);q([g(),B("design:type",Array)],dr.prototype,"capabilities",void 0);dr=q([Ze(),B("design:paramtypes",[String,String,String,String,String,Array])],dr);var Zi=class{constructor(e,r,i){this.did=e,this.success=r,this.error=i}};q([g(),B("design:type",String)],Zi.prototype,"did",void 0);q([g(),B("design:type",Boolean)],Zi.prototype,"success",void 0);q([g(),B("design:type",String)],Zi.prototype,"error",void 0);Zi=q([G(),B("design:paramtypes",[String,Boolean,String])],Zi);var Jn=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Yn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Mt=class{constructor(e){e?(this.isInitialized=e.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=e.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=e.did,this.didDocument=e.didDocument,this.error=e.error):(this.isInitialized=!1,this.isUnlocked=!1)}};Jn([g(),Yn("design:type",Boolean)],Mt.prototype,"isInitialized",void 0);Jn([g(),Yn("design:type",Boolean)],Mt.prototype,"isUnlocked",void 0);Jn([g(),Yn("design:type",String)],Mt.prototype,"did",void 0);Jn([g(),Yn("design:type",String)],Mt.prototype,"didDocument",void 0);Jn([g(),Yn("design:type",String)],Mt.prototype,"error",void 0);Mt=Jn([G(),Yn("design:paramtypes",[Object])],Mt);var Xd=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Le=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},yt,vt,Tl=class{constructor(e,r){yt.set(this,void 0),vt.set(this,void 0),Xd(this,yt,e,"f"),Xd(this,vt,r,"f")}async otherAgents(){return await Le(this,yt,"f").otherAgents(Le(this,vt,"f"))}async hasTelepresenceAdapter(){return await Le(this,yt,"f").hasTelepresenceAdapter(Le(this,vt,"f"))}async onlineAgents(){return await Le(this,yt,"f").onlineAgents(Le(this,vt,"f"))}async setOnlineStatus(e){return await Le(this,yt,"f").setOnlineStatus(Le(this,vt,"f"),e)}async setOnlineStatusU(e){return await Le(this,yt,"f").setOnlineStatusU(Le(this,vt,"f"),e)}async sendSignal(e,r){return await Le(this,yt,"f").sendSignal(Le(this,vt,"f"),e,r)}async sendSignalU(e,r){return await Le(this,yt,"f").sendSignalU(Le(this,vt,"f"),e,r)}async sendBroadcast(e,r=!1){return await Le(this,yt,"f").sendBroadcast(Le(this,vt,"f"),e,r)}async sendBroadcastU(e,r=!1){return await Le(this,yt,"f").sendBroadcastU(Le(this,vt,"f"),e,r)}async addSignalHandler(e){await Le(this,yt,"f").addSignalHandler(Le(this,vt,"f"),e)}removeSignalHandler(e){Le(this,yt,"f").removeSignalHandler(Le(this,vt,"f"),e)}};yt=new WeakMap,vt=new WeakMap;var an=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},on=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ot=class{constructor(e){e&&(this.source=e.source,this.predicate=e.predicate,this.target=e.target,e.fromDate&&(this.fromDate=e.fromDate),e.untilDate&&(this.untilDate=e.untilDate),e.limit&&(this.limit=e.limit))}isMatch(e){return!(this.source&&this.source!==e.source||this.predicate&&this.predicate!==e.predicate||this.target&&this.target!==e.target)}};an([g(),on("design:type",String)],ot.prototype,"source",void 0);an([g(),on("design:type",String)],ot.prototype,"target",void 0);an([g(),on("design:type",String)],ot.prototype,"predicate",void 0);an([g(),on("design:type",Date)],ot.prototype,"fromDate",void 0);an([g(),on("design:type",Date)],ot.prototype,"untilDate",void 0);an([g(),on("design:type",Number)],ot.prototype,"limit",void 0);ot=an([G(),Ze(),on("design:paramtypes",[Object])],ot);var eh=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},tt=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},bt,wr;function gs(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var wt=class{constructor(){bt.set(this,void 0),wr.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new wt;return eh(r,wr,e,"f"),r}static from(e){let r=new wt;return eh(r,bt,e,"f"),r}toUrl(){if(tt(this,wr,"f")&&!tt(this,bt,"f"))return tt(this,wr,"f");if(!tt(this,wr,"f")&&(tt(this,bt,"f")===void 0||tt(this,bt,"f")===""||tt(this,bt,"f")===null))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof tt(this,bt,"f")){case"string":e=`string:${gs(tt(this,bt,"f"))}`;break;case"number":e=`number:${gs(tt(this,bt,"f"))}`;break;case"boolean":e=`boolean:${gs(tt(this,bt,"f"))}`;break;case"object":e=`json:${gs(JSON.stringify(tt(this,bt,"f")))}`;break}return`literal://${e}`}get(){if(tt(this,bt,"f"))return tt(this,bt,"f");if(!tt(this,wr,"f"))throw new Error("Can't render empty Literal");if(!tt(this,wr,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=tt(this,wr,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let r=e.substring(7);return parseFloat(r)}if(e.startsWith("json:")){let r=e.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${e}`)}};bt=new WeakMap,wr=new WeakMap;function ei(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Jl(t){return`set${ei(t)}`}function kr(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function Yl(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function m0(t){return`add${ei(Yl(t))}`}function g0(t){let e=t.substring(3),r=kr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function y0(t){return`remove${ei(Yl(t))}`}function v0(t){let e=t.substring(6),r=kr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function b0(t){let e=t.substring(13),r=kr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function _0(t){return`setCollection${ei(Yl(t))}`}function Di(t){if(Array.isArray(t))return`[${t.map(Di).join(", ")}]`;let e=Object.keys(t),r=[];for(let i of e){let n=JSON.stringify(t[i]),a=`${i}: ${n}`;r.push(a)}return`{${r.join(", ")}}`}var nl=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},J=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},lt,pt,De,rc=class{constructor(t,e,r){lt.set(this,void 0),pt.set(this,void 0),De.set(this,void 0),nl(this,lt,e,"f"),nl(this,pt,r,"f"),nl(this,De,t,"f")}get baseExpression(){return J(this,lt,"f")}async init(){let isInstance=await J(this,De,"f").isSubjectInstance(J(this,lt,"f"),J(this,pt,"f"));if(!isInstance)throw`Not a valid subject instance of ${J(this,pt,"f")} for ${J(this,lt,"f")}`;let results=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property_getter(C, "${J(this,lt,"f")}", "${t}", Value)`);if(r&&r.length>0){let i=r[0].Value;if(e)try{if(i){let n=await J(this,De,"f").getExpression(i);try{return JSON.parse(n.data)}catch{return n.data}}else return i}catch{return i}else return i}else return r||void 0}})}let setters=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[Jl(property)]=async t=>{resolveLanguage&&(t=await J(this,De,"f").createExpression(t,resolveLanguage)),await J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:t}])}}let results2=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let t of collections)Object.defineProperty(this,t,{configurable:!0,get:async()=>{let e=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection_getter(C, "${J(this,lt,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(i=>i!==""&&i!==""):[]}});let adders=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection_adder(C, Collection, Adder)`);adders||(adders=[]);for(let adder of adders)if(adder){let collection=adder.Collection,actions=eval(adder.Adder);this[m0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:e}]))):await J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:t}])}}let removers=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection_remover(C, Collection, Remover)`);removers||(removers=[]);for(let remover of removers)if(remover){let collection=remover.Collection,actions=eval(remover.Remover);this[y0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:e}]))):await J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:t}])}}let collectionSetters=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection_setter(C, Collection, Setter)`);collectionSetters||(collectionSetters=[]);for(let collectionSetter of collectionSetters)if(collectionSetter){let collection=collectionSetter.Collection,actions=eval(collectionSetter.Setter);this[_0(collection)]=async t=>{Array.isArray(t)?await J(this,De,"f").executeAction(actions,J(this,lt,"f"),t.map(e=>({name:"value",value:e}))):await J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:t}])}}}};lt=new WeakMap,pt=new WeakMap,De=new WeakMap;var be=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},T=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},Ps,Cr,ir,nr,ji,Gr,Kr,Ni,Pa,$s,Ri,Pi,Lt,Mn,Il,de,ge,$i,Li,Fi,$a,ic=class{constructor(e,r,i){Ps.add(this),Cr.set(this,void 0),ir.set(this,void 0),nr.set(this,void 0),ji.set(this,void 0),Gr.set(this,void 0),Kr.set(this,void 0),Ni.set(this,void 0),Pa.set(this,!1),$s.set(this,void 0),Ri.set(this,void 0),Pi.set(this,void 0),Lt.set(this,void 0),Mn.set(this,void 0),this.isSurrealDB=!1,be(this,Cr,e,"f"),be(this,Mn,r,"f"),be(this,nr,i,"f"),be(this,ji,new Set,"f"),be(this,Ni,null,"f"),be(this,$s,new Promise((n,a)=>{be(this,Ri,n,"f"),be(this,Pi,a,"f")}),"f")}async subscribe(){T(this,Kr,"f")&&(T(this,Kr,"f").call(this),be(this,Kr,void 0,"f")),T(this,Lt,"f")&&(clearTimeout(T(this,Lt,"f")),be(this,Lt,void 0,"f")),T(this,Gr,"f")&&(clearTimeout(T(this,Gr,"f")),be(this,Gr,void 0,"f"));try{let r;this.isSurrealDB?r=await T(this,nr,"f").perspectiveSubscribeSurrealQuery(T(this,Cr,"f"),T(this,Mn,"f")):r=await T(this,nr,"f").subscribeQuery(T(this,Cr,"f"),T(this,Mn,"f")),be(this,ir,r.subscriptionId,"f"),r.result?(be(this,Ni,r.result,"f"),T(this,Ps,"m",Il).call(this,r.result)):console.warn("\u26A0\uFE0F No initial result returned from subscribeQuery!"),be(this,Lt,setTimeout(()=>{console.error("Subscription initialization timed out after 30 seconds. Resubscribing..."),this.subscribe().catch(i=>{console.error("Error during subscription retry after timeout:",i)})},3e4),"f"),be(this,Kr,T(this,nr,"f").subscribeToQueryUpdates(T(this,ir,"f"),i=>{T(this,Lt,"f")&&(clearTimeout(T(this,Lt,"f")),be(this,Lt,void 0,"f")),T(this,Ri,"f")&&(T(this,Ri,"f").call(this,!0),be(this,Ri,void 0,"f"),be(this,Pi,void 0,"f")),!(i.isInit&&T(this,Ni,"f"))&&(be(this,Ni,i,"f"),T(this,Ps,"m",Il).call(this,i))}),"f")}catch(r){throw console.error("Error setting up subscription:",r),T(this,Pi,"f")&&(T(this,Pi,"f").call(this,r),be(this,Ri,void 0,"f"),be(this,Pi,void 0,"f")),r}let e=async()=>{if(!T(this,Pa,"f")){try{this.isSurrealDB?await T(this,nr,"f").perspectiveKeepAliveSurrealQuery(T(this,Cr,"f"),T(this,ir,"f")):await T(this,nr,"f").keepAliveQuery(T(this,Cr,"f"),T(this,ir,"f"))}catch(r){console.error("Error in keepalive:",r),console.log("Reinitializing subscription for query:",T(this,Mn,"f"));try{await this.subscribe(),console.log("Subscription reinitialized")}catch(i){console.error("Error during resubscription from keepalive:",i);return}}T(this,Pa,"f")||be(this,Gr,setTimeout(e,3e4),"f")}};be(this,Gr,setTimeout(e,3e4),"f")}get id(){return T(this,ir,"f")}get initialized(){return T(this,$s,"f")}get result(){return T(this,Ni,"f")}onResult(e){return T(this,ji,"f").add(e),()=>T(this,ji,"f").delete(e)}dispose(){be(this,Pa,!0,"f"),clearTimeout(T(this,Gr,"f")),T(this,Kr,"f")&&T(this,Kr,"f").call(this),T(this,ji,"f").clear(),T(this,Lt,"f")&&(clearTimeout(T(this,Lt,"f")),be(this,Lt,void 0,"f")),T(this,ir,"f")&&(this.isSurrealDB?T(this,nr,"f").perspectiveDisposeSurrealQuerySubscription(T(this,Cr,"f"),T(this,ir,"f")).catch(e=>console.error("Error disposing surreal query subscription:",e)):T(this,nr,"f").disposeQuerySubscription(T(this,Cr,"f"),T(this,ir,"f")).catch(e=>console.error("Error disposing query subscription:",e)))}};Cr=new WeakMap,ir=new WeakMap,nr=new WeakMap,ji=new WeakMap,Gr=new WeakMap,Kr=new WeakMap,Ni=new WeakMap,Pa=new WeakMap,$s=new WeakMap,Ri=new WeakMap,Pi=new WeakMap,Lt=new WeakMap,Mn=new WeakMap,Ps=new WeakSet,Il=function t(e){for(let r of T(this,ji,"f"))try{r(e)}catch(i){console.error("Error in query subscription callback:",i)}};var jn=class{constructor(t,e){de.set(this,void 0),ge.set(this,void 0),$i.set(this,void 0),Li.set(this,void 0),Fi.set(this,void 0),$a.set(this,void 0),be(this,$i,[],"f"),be(this,Li,[],"f"),be(this,Fi,[],"f"),be(this,$a,[],"f"),be(this,de,t,"f"),be(this,ge,e,"f"),this.uuid=T(this,de,"f").uuid,this.name=T(this,de,"f").name,this.owners=T(this,de,"f").owners,this.sharedUrl=T(this,de,"f").sharedUrl,this.neighbourhood=T(this,de,"f").neighbourhood,this.state=T(this,de,"f").state,T(this,ge,"f").addPerspectiveLinkAddedListener(T(this,de,"f").uuid,T(this,$i,"f")),T(this,ge,"f").addPerspectiveLinkRemovedListener(T(this,de,"f").uuid,T(this,Li,"f")),T(this,ge,"f").addPerspectiveLinkUpdatedListener(T(this,de,"f").uuid,T(this,Fi,"f")),T(this,ge,"f").addPerspectiveSyncStateChangeListener(T(this,de,"f").uuid,T(this,$a,"f"))}async executeAction(t,e,r,i){return await T(this,ge,"f").executeCommands(T(this,de,"f").uuid,JSON.stringify(t),e,JSON.stringify(r),i)}async get(t){return await T(this,ge,"f").queryLinks(T(this,de,"f").uuid,t)}async infer(t){return await T(this,ge,"f").queryProlog(T(this,de,"f").uuid,t)}async querySurrealDB(t){return await T(this,ge,"f").querySurrealDB(T(this,de,"f").uuid,t)}async add(t,e="shared",r){return await T(this,ge,"f").addLink(T(this,de,"f").uuid,t,e,r)}async addLinks(t,e="shared",r){return await T(this,ge,"f").addLinks(T(this,de,"f").uuid,t,e,r)}async removeLinks(t,e){return await T(this,ge,"f").removeLinks(T(this,de,"f").uuid,t,e)}async linkMutations(t,e="shared"){return await T(this,ge,"f").linkMutations(T(this,de,"f").uuid,t,e)}async addLinkExpression(t,e="shared",r){return await T(this,ge,"f").addLinkExpression(T(this,de,"f").uuid,t,e,r)}async update(t,e,r){return await T(this,ge,"f").updateLink(T(this,de,"f").uuid,t,e,r)}async remove(t,e){return await T(this,ge,"f").removeLink(T(this,de,"f").uuid,t,e)}async createBatch(){return await T(this,ge,"f").createBatch(T(this,de,"f").uuid)}async commitBatch(t){return await T(this,ge,"f").commitBatch(T(this,de,"f").uuid,t)}async getExpression(t){return await T(this,ge,"f").getExpression(t)}async createExpression(t,e){return await T(this,ge,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?T(this,$i,"f").push(e):t==="link-removed"?T(this,Li,"f").push(e):t==="link-updated"&&T(this,Fi,"f").push(e)}async addSyncStateChangeListener(t){T(this,$a,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=T(this,$i,"f").indexOf(e);T(this,$i,"f").splice(r,1)}else if(t==="link-removed"){let r=T(this,Li,"f").indexOf(e);T(this,Li,"f").splice(r,1)}else if(t==="link-updated"){let r=T(this,Fi,"f").indexOf(e);T(this,Fi,"f").splice(r,1)}}async snapshot(){return T(this,ge,"f").snapshotByUUID(T(this,de,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new ot({source:t.source,predicate:t.predicate}),i=await this.get(r),n=[];for(let o of i)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,n.push(o);let a=[t];await this.linkMutations({additions:a,removals:n},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(t){return(await this.infer(`flowable("${t}", F), register_sdna_flow(X, F)`)).map(r=>r.X)}async startFlow(flowName,exprAddr){let startAction=await this.infer(`start_action(Action, F), register_sdna_flow("${flowName}", F)`);startAction=eval(startAction[0].Action),await this.executeAction(startAction,exprAddr,void 0)}async expressionsInFlowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state(X, ${e}, F)`)).map(i=>i.X)}async flowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(t,e){return(await this.infer(`register_sdna_flow("${t}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(i=>i.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){let t=["ad4m://has_subject_class","ad4m://has_flow","ad4m://has_custom_sdna"],e=[];for(let r of t){let i=await this.get(new ot({source:"ad4m://self",predicate:r}));for(let n of i){let a=n.data.target,o=await this.get(new ot({source:a,predicate:"ad4m://sdna"}));for(let s of o){let u=wt.fromUrl(s.data.target).get();typeof u=="string"&&e.push(u)}}}return e}async getSdnaForClass(t){let e=wt.from(t);if((await this.get(new ot({source:"ad4m://self",target:e.toUrl(),predicate:"ad4m://has_subject_class"}))).length===0)return null;let i=await this.get(new ot({source:e.toUrl(),predicate:"ad4m://sdna"}));if(i.length===0)return null;let n=wt.fromUrl(i[0].data.target).get();return typeof n=="string"?n:null}async addSdna(t,e,r){return T(this,ge,"f").addSdna(T(this,de,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClassName(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(t,e,r,i){let n;if(typeof t=="string")n=t,await T(this,ge,"f").createSubject(T(this,de,"f").uuid,JSON.stringify({className:n,initialValues:r}),e,r?JSON.stringify(r):void 0,i);else{let a=this.buildQueryFromTemplate(t);await T(this,ge,"f").createSubject(T(this,de,"f").uuid,JSON.stringify({query:a,initialValues:r}),e,r?JSON.stringify(r):void 0,i)}return i?e:this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await T(this,ge,"f").getSubjectData(T(this,de,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await T(this,ge,"f").getSubjectData(T(this,de,"f").uuid,JSON.stringify({query:r}),e))}async removeSubject(subjectClass,exprAddr,batchId){let className=await this.stringOrTemplateObjectToSubjectClassName(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No destructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0,batchId)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClassName(e),i=!1,n=5,a=0;for(;a<n&&!i;)i=await this.infer(`subject_class("${r}", C), instance(C, "${t}")`),a++;return i}async getSubjectProxy(t,e){if(!await this.isSubjectInstance(t,e))throw`Expression ${t} is not a subject instance of given class: ${JSON.stringify(e)}`;let r=await this.stringOrTemplateObjectToSubjectClassName(e),i=new rc(this,t,r);return await i.init(),i}async getAllSubjectInstances(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let i of e){let n=await this.infer(`subject_class("${i}", C), instance(C, X)`),a=await Promise.all(n.map(async o=>await this.getSubjectProxy(o.X,i)));r=r.concat(a)}return r}async getAllSubjectProxies(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let i of e)r=await this.infer(`subject_class("${i}", C), instance(C, X)`);return r}buildQueryFromTemplate(t){let e;return function(r){let i=[],n=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>i.push(l)):i.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>{n.includes(l)||n.push(l)}):n.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")}));let o=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("add"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("add")}));let s=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("remove"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("remove")}));let u=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("setCollection"));u=u.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("setCollection")}));let c="subject_class(Class, C)";for(let l of i)c+=`, property(C, "${l}")`;for(let l of n)c+=`, collection(C, "${l}")`;for(let l of a){let d=l.substring(3);d=d.charAt(0).toLowerCase()+d.slice(1),c+=`, property_setter(C, "${d}", _)`}for(let l of o)c+=`, collection_adder(C, "${g0(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${v0(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${b0(l)}", _)`;c+=".",e=c}(t),e}async subjectClassesByTemplate(t){let e=this.buildQueryFromTemplate(t),r=await this.infer(e);return r?r.map(i=>i.Class):[]}async ensureSDNASubjectClass(t){if((await this.subjectClassesByTemplate(new t)).length>0)return;let{name:r,sdna:i}=t.generateSDNA();await this.addSdna(r,i,"subject_class")}getNeighbourhoodProxy(){return T(this,ge,"f").getNeighbourhoodProxy(T(this,de,"f").uuid)}get ai(){return T(this,ge,"f").aiClient}async subscribeInfer(t){let e=new ic(this.uuid,t,T(this,ge,"f"));return await e.subscribe(),await e.initialized,e}async subscribeSurrealDB(t){let e=new ic(this.uuid,t,T(this,ge,"f"));return e.isSurrealDB=!0,await e.subscribe(),await e.initialized,e}};de=new WeakMap,ge=new WeakMap,$i=new WeakMap,Li=new WeakMap,Fi=new WeakMap,$a=new WeakMap;var zr=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Q=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},ie,La,Fa,Ma,Ls,Ua,Fs,Ms,ut=`
64
64
  author
65
65
  timestamp
66
66
  status
67
67
  data { source, predicate, target }
68
68
  proof { valid, invalid, signature, key }
69
- `,Dn=`
69
+ `,Nn=`
70
70
  uuid
71
71
  name
72
72
  sharedUrl
@@ -89,13 +89,13 @@ neighbourhood {
89
89
  }
90
90
  `,nc=class{constructor(e,r=!0){ie.set(this,void 0),La.set(this,void 0),Fa.set(this,void 0),Ma.set(this,void 0),Ls.set(this,void 0),Ua.set(this,void 0),Fs.set(this,void 0),Ms.set(this,void 0),zr(this,ie,e,"f"),zr(this,La,[],"f"),zr(this,Fa,[],"f"),zr(this,Ma,[],"f"),zr(this,Ls,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){zr(this,Ua,e,"f")}setNeighbourhoodClient(e){zr(this,Fs,e,"f")}setAIClient(e){zr(this,Ms,e,"f")}get aiClient(){return Q(this,Ms,"f")}async all(){let{perspectives:e}=k(await Q(this,ie,"f").query({query:E`query perspectives {
91
91
  perspectives {
92
- ${Dn}
92
+ ${Nn}
93
93
  }
94
- }`}));return e.map(r=>new Un(r,this))}async byUUID(e){let{perspective:r}=k(await Q(this,ie,"f").query({query:E`query perspective($uuid: String!) {
94
+ }`}));return e.map(r=>new jn(r,this))}async byUUID(e){let{perspective:r}=k(await Q(this,ie,"f").query({query:E`query perspective($uuid: String!) {
95
95
  perspective(uuid: $uuid) {
96
- ${Dn}
96
+ ${Nn}
97
97
  }
98
- }`,variables:{uuid:e}}));return r?new Un(r,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:r}=k(await Q(this,ie,"f").query({query:E`query perspectiveSnapshot($uuid: String!) {
98
+ }`,variables:{uuid:e}}));return r?new jn(r,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:r}=k(await Q(this,ie,"f").query({query:E`query perspectiveSnapshot($uuid: String!) {
99
99
  perspectiveSnapshot(uuid: $uuid) {
100
100
  links { ${ut} }
101
101
  }
@@ -133,13 +133,13 @@ neighbourhood {
133
133
  perspectiveDisposeQuerySubscription(uuid: $uuid, subscriptionId: $subscriptionId)
134
134
  }`,variables:{uuid:e,subscriptionId:r}}));return i}async add(e){let{perspectiveAdd:r}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveAdd($name: String!) {
135
135
  perspectiveAdd(name: $name) {
136
- ${Dn}
136
+ ${Nn}
137
137
  }
138
- }`,variables:{name:e}}));return new Un(r,this)}async update(e,r){let{perspectiveUpdate:i}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveUpdate($uuid: String!, $name: String!) {
138
+ }`,variables:{name:e}}));return new jn(r,this)}async update(e,r){let{perspectiveUpdate:i}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveUpdate($uuid: String!, $name: String!) {
139
139
  perspectiveUpdate(uuid: $uuid, name: $name) {
140
- ${Dn}
140
+ ${Nn}
141
141
  }
142
- }`,variables:{uuid:e,name:r}}));return new Un(i,this)}async remove(e){return k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveRemove($uuid: String!) {
142
+ }`,variables:{uuid:e,name:r}}));return new jn(i,this)}async remove(e){return k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveRemove($uuid: String!) {
143
143
  perspectiveRemove(uuid: $uuid)
144
144
  }`,variables:{uuid:e}}))}async addLink(e,r,i="shared",n){let{perspectiveAddLink:a}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String!, $batchId: String) {
145
145
  perspectiveAddLink(uuid: $uuid, link: $link, status: $status, batchId: $batchId) {
@@ -181,10 +181,10 @@ neighbourhood {
181
181
  }`,variables:{uuid:e,subjectClass:r,expressionAddress:i,initialValues:n,batchId:a}})).perspectiveCreateSubject}async getSubjectData(e,r,i){return k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveGetSubjectData($uuid: String!, $subjectClass: String!, $expressionAddress: String!) {
182
182
  perspectiveGetSubjectData(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
183
183
  }`,variables:{uuid:e,subjectClass:r,expressionAddress:i}})).perspectiveGetSubjectData}async getExpression(e){return await Q(this,Ua,"f").get(e)}async createExpression(e,r){return await Q(this,Ua,"f").create(e,r)}addPerspectiveAddedListener(e){Q(this,La,"f").push(e)}subscribePerspectiveAdded(){Q(this,ie,"f").subscribe({query:E` subscription {
184
- perspectiveAdded { ${Dn} }
184
+ perspectiveAdded { ${Nn} }
185
185
  }
186
186
  `}).subscribe({next:e=>{Q(this,La,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){Q(this,Fa,"f").push(e)}subscribePerspectiveUpdated(){Q(this,ie,"f").subscribe({query:E` subscription {
187
- perspectiveUpdated { ${Dn} }
187
+ perspectiveUpdated { ${Nn} }
188
188
  }
189
189
  `}).subscribe({next:e=>{Q(this,Fa,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){Q(this,Ls,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){Q(this,ie,"f").subscribe({query:E` subscription {
190
190
  perspectiveSyncStateChange(uuid: "${e}")
@@ -249,7 +249,7 @@ neighbourhood {
249
249
  can
250
250
  }
251
251
  }
252
- `,Nn=`
252
+ `,Rn=`
253
253
  isInitialized
254
254
  isUnlocked
255
255
  did
@@ -267,13 +267,13 @@ neighbourhood {
267
267
  publicKey
268
268
  `,no=class{constructor(e,r=!0){he.set(this,void 0),ja.set(this,void 0),qa.set(this,void 0),Ba.set(this,void 0),ys(this,he,e,"f"),ys(this,qa,[],"f"),ys(this,Ba,[],"f"),ys(this,ja,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=k(await ce(this,he,"f").query({query:E`query agent { agent { ${Oa} } }`})),r=new Xr(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=k(await ce(this,he,"f").query({query:E`query agentStatus {
269
269
  agentStatus {
270
- ${Nn}
270
+ ${Rn}
271
271
  }
272
272
  }`}));return new Mt(e)}async generate(e){let{agentGenerate:r}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentGenerate(
273
273
  $passphrase: String!
274
274
  ) {
275
275
  agentGenerate(passphrase: $passphrase) {
276
- ${Nn}
276
+ ${Rn}
277
277
  }
278
278
  }`,variables:{passphrase:e}}));return new Mt(r)}async import(e){let{did:r,didDocument:i,keystore:n,passphrase:a}=e,{agentImport:o}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentImport(
279
279
  $did: String!,
@@ -282,15 +282,15 @@ neighbourhood {
282
282
  $passphrase: String!
283
283
  ) {
284
284
  agentImport(did: $did, didDocument: $didDocument, keystore: $keystore, passphrase: $passphrase) {
285
- ${Nn}
285
+ ${Rn}
286
286
  }
287
287
  }`,variables:{did:r,didDocument:i,keystore:n,passphrase:a}}));return new Mt(o)}async lock(e){let{agentLock:r}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentLock($passphrase: String!) {
288
288
  agentLock(passphrase: $passphrase) {
289
- ${Nn}
289
+ ${Rn}
290
290
  }
291
291
  }`,variables:{passphrase:e}}));return new Mt(r)}async unlock(e,r=!0){let{agentUnlock:i}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
292
292
  agentUnlock(passphrase: $passphrase, holochain: $holochain) {
293
- ${Nn}
293
+ ${Rn}
294
294
  }
295
295
  }`,variables:{passphrase:e,holochain:r}}));return new Mt(i)}async byDID(e){let{agentByDID:r}=k(await ce(this,he,"f").query({query:E`query agentByDID($did: String!) {
296
296
  agentByDID(did: $did) {
@@ -329,7 +329,7 @@ neighbourhood {
329
329
  }
330
330
  }
331
331
  `}).subscribe({next:e=>{ce(this,ja,"f").forEach(r=>{r()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){ce(this,Ba,"f").push(e)}subscribeAgentStatusChanged(){ce(this,he,"f").subscribe({query:E` subscription {
332
- agentStatusChanged { ${Nn} }
332
+ agentStatusChanged { ${Rn} }
333
333
  }
334
334
  `}).subscribe({next:e=>{let r=e.data.agentStatusChanged;ce(this,Ba,"f").forEach(i=>{i(r)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:r}=k(await ce(this,he,"f").mutate({mutation:E`
335
335
  mutation agentRequestCapability($authInfo: AuthInfoInput!) {
@@ -376,6 +376,7 @@ neighbourhood {
376
376
  success
377
377
  message
378
378
  requiresPassword
379
+ isExistingUser
379
380
  }
380
381
  }`,variables:{email:e,appInfo:r}}));return i}async verifyEmailCode(e,r,i){let{runtimeVerifyEmailCode:n}=k(await ce(this,he,"f").mutate({mutation:E`mutation runtimeVerifyEmailCode($email: String!, $code: String!, $verificationType: String!) {
381
382
  runtimeVerifyEmailCode(email: $email, code: $code, verificationType: $verificationType)
@@ -434,7 +435,7 @@ neighbourhood {
434
435
  $address: String!,
435
436
  ) {
436
437
  languageRemove(address: $address)
437
- }`,variables:{address:e}}));return r}};Ht=new WeakMap;var C0=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},at=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},ft,Mn,Dl=class{constructor(e){ft.set(this,void 0),Mn.set(this,new Map),C0(this,ft,e,"f")}async publishFromPerspective(e,r,i){let{neighbourhoodPublishFromPerspective:n}=k(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodPublishFromPerspective(
438
+ }`,variables:{address:e}}));return r}};Ht=new WeakMap;var C0=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},at=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},ft,Un,Dl=class{constructor(e){ft.set(this,void 0),Un.set(this,new Map),C0(this,ft,e,"f")}async publishFromPerspective(e,r,i){let{neighbourhoodPublishFromPerspective:n}=k(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodPublishFromPerspective(
438
439
  $linkLanguage: String!,
439
440
  $meta: PerspectiveInput!,
440
441
  $perspectiveUUID: String!
@@ -543,7 +544,7 @@ neighbourhood {
543
544
  payload: $payload,
544
545
  loopback: $loopback
545
546
  )
546
- }`,variables:{perspectiveUUID:e,payload:r,loopback:i}}));return n}dispatchSignal(e,r){let i=at(this,Mn,"f").get(e);i&&i.forEach(n=>n(r))}async subscribeToSignals(e){let r=this;await at(this,ft,"f").subscribe({query:E`subscription neighbourhoodSignal($perspectiveUUID: String!) {
547
+ }`,variables:{perspectiveUUID:e,payload:r,loopback:i}}));return n}dispatchSignal(e,r){let i=at(this,Un,"f").get(e);i&&i.forEach(n=>n(r))}async subscribeToSignals(e){let r=this;await at(this,ft,"f").subscribe({query:E`subscription neighbourhoodSignal($perspectiveUUID: String!) {
547
548
  neighbourhoodSignal(perspectiveUUID: $perspectiveUUID) {
548
549
  author
549
550
  timestamp
@@ -558,7 +559,7 @@ neighbourhood {
558
559
  }
559
560
  proof { valid, invalid, signature, key }
560
561
  }
561
- }`,variables:{perspectiveUUID:e}}).subscribe({next:i=>{let{neighbourhoodSignal:n}=k(i);r.dispatchSignal(e,n)}})}async addSignalHandler(e,r){let i=at(this,Mn,"f").get(e);i||(i=[],at(this,Mn,"f").set(e,i),await this.subscribeToSignals(e)),i.push(r)}removeSignalHandler(e,r){let i=at(this,Mn,"f").get(e);if(i){let n=i.indexOf(r);n>-1&&i.splice(n,1)}}};ft=new WeakMap,Mn=new WeakMap;var _s=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},z=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},K,Va,Qa,za,w1,Ss=`
562
+ }`,variables:{perspectiveUUID:e}}).subscribe({next:i=>{let{neighbourhoodSignal:n}=k(i);r.dispatchSignal(e,n)}})}async addSignalHandler(e,r){let i=at(this,Un,"f").get(e);i||(i=[],at(this,Un,"f").set(e,i),await this.subscribeToSignals(e)),i.push(r)}removeSignalHandler(e,r){let i=at(this,Un,"f").get(e);if(i){let n=i.indexOf(r);n>-1&&i.splice(n,1)}}};ft=new WeakMap,Un=new WeakMap;var _s=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},z=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},K,Va,Qa,za,w1,Ss=`
562
563
  author
563
564
  timestamp
564
565
  data {
@@ -702,7 +703,7 @@ triggerMatch
702
703
  type
703
704
  addon
704
705
  }
705
- }`}).subscribe({next:e=>{z(this,Qa,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};K=new WeakMap,Va=new WeakMap,Qa=new WeakMap,za=new WeakMap,w1=new WeakMap;var A0=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Rn=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},Er,Rl=class{constructor(e){Er.set(this,void 0),A0(this,Er,e,"f")}async get(e,r=!1){if(!r)try{let n=wt.fromUrl(e).get();if(typeof n=="object"&&n!==null&&"author"in n&&"timestamp"in n&&"data"in n&&"proof"in n)return n}catch{}let{expression:i}=k(await Rn(this,Er,"f").query({query:E`query expression($url: String!) {
706
+ }`}).subscribe({next:e=>{z(this,Qa,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};K=new WeakMap,Va=new WeakMap,Qa=new WeakMap,za=new WeakMap,w1=new WeakMap;var A0=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Pn=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},Er,Rl=class{constructor(e){Er.set(this,void 0),A0(this,Er,e,"f")}async get(e,r=!1){if(!r)try{let n=wt.fromUrl(e).get();if(typeof n=="object"&&n!==null&&"author"in n&&"timestamp"in n&&"data"in n&&"proof"in n)return n}catch{}let{expression:i}=k(await Pn(this,Er,"f").query({query:E`query expression($url: String!) {
706
707
  expression(url: $url) {
707
708
  author
708
709
  timestamp
@@ -715,7 +716,7 @@ triggerMatch
715
716
  invalid
716
717
  }
717
718
  }
718
- }`,variables:{url:e}}));return i}async getMany(e){let{expressionMany:r}=k(await Rn(this,Er,"f").query({query:E`query expressionMany($urls: [String!]!) {
719
+ }`,variables:{url:e}}));return i}async getMany(e){let{expressionMany:r}=k(await Pn(this,Er,"f").query({query:E`query expressionMany($urls: [String!]!) {
719
720
  expressionMany(urls: $urls) {
720
721
  author
721
722
  timestamp
@@ -728,19 +729,19 @@ triggerMatch
728
729
  invalid
729
730
  }
730
731
  }
731
- }`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=k(await Rn(this,Er,"f").query({query:E`query expressionRaw($url: String!) {
732
+ }`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=k(await Pn(this,Er,"f").query({query:E`query expressionRaw($url: String!) {
732
733
  expressionRaw(url: $url)
733
- }`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:i}=k(await Rn(this,Er,"f").mutate({mutation:E`mutation expressionCreate($content: String!, $languageAddress: String!){
734
+ }`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:i}=k(await Pn(this,Er,"f").mutate({mutation:E`mutation expressionCreate($content: String!, $languageAddress: String!){
734
735
  expressionCreate(content: $content, languageAddress: $languageAddress)
735
- }`,variables:{content:e,languageAddress:r}}));return i}async interactions(e){let{expressionInteractions:r}=k(await Rn(this,Er,"f").query({query:E`query expressionInteractions($url: String!) {
736
+ }`,variables:{content:e,languageAddress:r}}));return i}async interactions(e){let{expressionInteractions:r}=k(await Pn(this,Er,"f").query({query:E`query expressionInteractions($url: String!) {
736
737
  expressionInteractions(url: $url) {
737
738
  label
738
739
  name
739
740
  parameters { name, type }
740
741
  }
741
- }`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:i}=k(await Rn(this,Er,"f").mutate({mutation:E`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
742
+ }`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:i}=k(await Pn(this,Er,"f").mutate({mutation:E`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
742
743
  expressionInteract(url: $url, interactionCall: $interactionCall)
743
- }`,variables:{url:e,interactionCall:r}}));return i}};Er=new WeakMap;var yc={};yc.byteLength=T0;yc.toByteArray=O0;yc.fromByteArray=R0;var sr=[],Ft=[],k0=typeof Uint8Array<"u"?Uint8Array:Array,al="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Oi=0,ih=al.length;Oi<ih;++Oi)sr[Oi]=al[Oi],Ft[al.charCodeAt(Oi)]=Oi;var Oi,ih;Ft["-".charCodeAt(0)]=62;Ft["_".charCodeAt(0)]=63;function E1(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function T0(t){var e=E1(t),r=e[0],i=e[1];return(r+i)*3/4-i}function I0(t,e,r){return(e+r)*3/4-r}function O0(t){var e,r=E1(t),i=r[0],n=r[1],a=new k0(I0(t,i,n)),o=0,s=n>0?i-4:i,u;for(u=0;u<s;u+=4)e=Ft[t.charCodeAt(u)]<<18|Ft[t.charCodeAt(u+1)]<<12|Ft[t.charCodeAt(u+2)]<<6|Ft[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return n===2&&(e=Ft[t.charCodeAt(u)]<<2|Ft[t.charCodeAt(u+1)]>>4,a[o++]=e&255),n===1&&(e=Ft[t.charCodeAt(u)]<<10|Ft[t.charCodeAt(u+1)]<<4|Ft[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function D0(t){return sr[t>>18&63]+sr[t>>12&63]+sr[t>>6&63]+sr[t&63]}function N0(t,e,r){for(var i,n=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),n.push(D0(i));return n.join("")}function R0(t){for(var e,r=t.length,i=r%3,n=[],a=16383,o=0,s=r-i;o<s;o+=a)n.push(N0(t,o,o+a>s?s:o+a));return i===1?(e=t[r-1],n.push(sr[e>>2]+sr[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(sr[e>>10]+sr[e>>4&63]+sr[e<<2&63]+"=")),n.join("")}var P0=4,nh=0,ah=1,$0=2;function Xn(t){let e=t.length;for(;--e>=0;)t[e]=0}var L0=0,x1=1,F0=2,M0=3,U0=258,Xl=29,vo=256,ao=vo+1+Xl,jn=30,ep=19,A1=2*ao+1,qi=15,ol=16,j0=7,tp=256,k1=16,T1=17,I1=18,Pl=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Us=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),q0=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),O1=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),B0=512,xr=new Array((ao+2)*2);Xn(xr);var Ya=new Array(jn*2);Xn(Ya);var oo=new Array(B0);Xn(oo);var so=new Array(U0-M0+1);Xn(so);var rp=new Array(Xl);Xn(rp);var ac=new Array(jn);Xn(ac);function sl(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}var D1,N1,R1;function cl(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var P1=t=>t<256?oo[t]:oo[256+(t>>>7)],co=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},St=(t,e,r)=>{t.bi_valid>ol-r?(t.bi_buf|=e<<t.bi_valid&65535,co(t,t.bi_buf),t.bi_buf=e>>ol-t.bi_valid,t.bi_valid+=r-ol):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},cr=(t,e,r)=>{St(t,r[e*2],r[e*2+1])},$1=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},V0=t=>{t.bi_valid===16?(co(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},Q0=(t,e)=>{let r=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,d,f,p,h,m=0;for(f=0;f<=qi;f++)t.bl_count[f]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<A1;c++)l=t.heap[c],f=r[r[l*2+1]*2+1]+1,f>u&&(f=u,m++),r[l*2+1]=f,!(l>i)&&(t.bl_count[f]++,p=0,l>=s&&(p=o[l-s]),h=r[l*2],t.opt_len+=h*(f+p),a&&(t.static_len+=h*(n[l*2+1]+p)));if(m!==0){do{for(f=u-1;t.bl_count[f]===0;)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[u]--,m-=2}while(m>0);for(f=u;f!==0;f--)for(l=t.bl_count[f];l!==0;)d=t.heap[--c],!(d>i)&&(r[d*2+1]!==f&&(t.opt_len+=(f-r[d*2+1])*r[d*2],r[d*2+1]=f),l--)}},L1=(t,e,r)=>{let i=new Array(qi+1),n=0,a,o;for(a=1;a<=qi;a++)n=n+r[a-1]<<1,i[a]=n;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=$1(i[s]++,s))}},z0=()=>{let t,e,r,i,n,a=new Array(qi+1);for(r=0,i=0;i<Xl-1;i++)for(rp[i]=r,t=0;t<1<<Pl[i];t++)so[r++]=i;for(so[r-1]=i,n=0,i=0;i<16;i++)for(ac[i]=n,t=0;t<1<<Us[i];t++)oo[n++]=i;for(n>>=7;i<jn;i++)for(ac[i]=n<<7,t=0;t<1<<Us[i]-7;t++)oo[256+n++]=i;for(e=0;e<=qi;e++)a[e]=0;for(t=0;t<=143;)xr[t*2+1]=8,t++,a[8]++;for(;t<=255;)xr[t*2+1]=9,t++,a[9]++;for(;t<=279;)xr[t*2+1]=7,t++,a[7]++;for(;t<=287;)xr[t*2+1]=8,t++,a[8]++;for(L1(xr,ao+1,a),t=0;t<jn;t++)Ya[t*2+1]=5,Ya[t*2]=$1(t,5);D1=new sl(xr,Pl,vo+1,ao,qi),N1=new sl(Ya,Us,0,jn,qi),R1=new sl(new Array(0),q0,0,ep,j0)},F1=t=>{let e;for(e=0;e<ao;e++)t.dyn_ltree[e*2]=0;for(e=0;e<jn;e++)t.dyn_dtree[e*2]=0;for(e=0;e<ep;e++)t.bl_tree[e*2]=0;t.dyn_ltree[tp*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},M1=t=>{t.bi_valid>8?co(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},oh=(t,e,r,i)=>{let n=e*2,a=r*2;return t[n]<t[a]||t[n]===t[a]&&i[e]<=i[r]},ul=(t,e,r)=>{let i=t.heap[r],n=r<<1;for(;n<=t.heap_len&&(n<t.heap_len&&oh(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!oh(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i},sh=(t,e,r)=>{let i,n,a=0,o,s;if(t.sym_next!==0)do i=t.pending_buf[t.sym_buf+a++]&255,i+=(t.pending_buf[t.sym_buf+a++]&255)<<8,n=t.pending_buf[t.sym_buf+a++],i===0?cr(t,n,e):(o=so[n],cr(t,o+vo+1,e),s=Pl[o],s!==0&&(n-=rp[o],St(t,n,s)),i--,o=P1(i),cr(t,o,r),s=Us[o],s!==0&&(i-=ac[o],St(t,i,s)));while(a<t.sym_next);cr(t,tp,e)},$l=(t,e)=>{let r=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,a=e.stat_desc.elems,o,s,u=-1,c;for(t.heap_len=0,t.heap_max=A1,o=0;o<a;o++)r[o*2]!==0?(t.heap[++t.heap_len]=u=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=u<2?++u:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,n&&(t.static_len-=i[c*2+1]);for(e.max_code=u,o=t.heap_len>>1;o>=1;o--)ul(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],ul(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,r[c*2]=r[o*2]+r[s*2],t.depth[c]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,r[o*2+1]=r[s*2+1]=c,t.heap[1]=c++,ul(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Q0(t,e),L1(r,u,t.bl_count)},ch=(t,e,r)=>{let i,n=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)a=o,o=e[(i+1)*2+1],!(++s<u&&a===o)&&(s<c?t.bl_tree[a*2]+=s:a!==0?(a!==n&&t.bl_tree[a*2]++,t.bl_tree[k1*2]++):s<=10?t.bl_tree[T1*2]++:t.bl_tree[I1*2]++,s=0,n=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},uh=(t,e,r)=>{let i,n=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),i=0;i<=r;i++)if(a=o,o=e[(i+1)*2+1],!(++s<u&&a===o)){if(s<c)do cr(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==n&&(cr(t,a,t.bl_tree),s--),cr(t,k1,t.bl_tree),St(t,s-3,2)):s<=10?(cr(t,T1,t.bl_tree),St(t,s-3,3)):(cr(t,I1,t.bl_tree),St(t,s-11,7));s=0,n=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},W0=t=>{let e;for(ch(t,t.dyn_ltree,t.l_desc.max_code),ch(t,t.dyn_dtree,t.d_desc.max_code),$l(t,t.bl_desc),e=ep-1;e>=3&&t.bl_tree[O1[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},H0=(t,e,r,i)=>{let n;for(St(t,e-257,5),St(t,r-1,5),St(t,i-4,4),n=0;n<i;n++)St(t,t.bl_tree[O1[n]*2+1],3);uh(t,t.dyn_ltree,e-1),uh(t,t.dyn_dtree,r-1)},G0=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return nh;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return ah;for(r=32;r<vo;r++)if(t.dyn_ltree[r*2]!==0)return ah;return nh},lh=!1,K0=t=>{lh||(z0(),lh=!0),t.l_desc=new cl(t.dyn_ltree,D1),t.d_desc=new cl(t.dyn_dtree,N1),t.bl_desc=new cl(t.bl_tree,R1),t.bi_buf=0,t.bi_valid=0,F1(t)},U1=(t,e,r,i)=>{St(t,(L0<<1)+(i?1:0),3),M1(t),co(t,r),co(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},Z0=t=>{St(t,x1<<1,3),cr(t,tp,xr),V0(t)},J0=(t,e,r,i)=>{let n,a,o=0;t.level>0?(t.strm.data_type===$0&&(t.strm.data_type=G0(t)),$l(t,t.l_desc),$l(t,t.d_desc),o=W0(t),n=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=n&&(n=a)):n=a=r+5,r+4<=n&&e!==-1?U1(t,e,r,i):t.strategy===P0||a===n?(St(t,(x1<<1)+(i?1:0),3),sh(t,xr,Ya)):(St(t,(F0<<1)+(i?1:0),3),H0(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),sh(t,t.dyn_ltree,t.dyn_dtree)),F1(t),i&&M1(t)},Y0=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(so[r]+vo+1)*2]++,t.dyn_dtree[P1(e)*2]++),t.sym_next===t.sym_end),X0=K0,ev=U1,tv=J0,rv=Y0,iv=Z0,nv={_tr_init:X0,_tr_stored_block:ev,_tr_flush_block:tv,_tr_tally:rv,_tr_align:iv},av=(t,e,r,i)=>{let n=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do n=n+e[i++]|0,a=a+n|0;while(--o);n%=65521,a%=65521}return n|a<<16|0},uo=av,ov=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},sv=new Uint32Array(ov()),cv=(t,e,r,i)=>{let n=sv,a=i+r;t^=-1;for(let o=i;o<a;o++)t=t>>>8^n[(t^e[o])&255];return t^-1},Ge=cv,Ji={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},on={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:uv,_tr_stored_block:Ll,_tr_flush_block:lv,_tr_tally:ti,_tr_align:pv}=nv,{Z_NO_FLUSH:ri,Z_PARTIAL_FLUSH:fv,Z_FULL_FLUSH:dv,Z_FINISH:Ut,Z_BLOCK:ph,Z_OK:rt,Z_STREAM_END:fh,Z_STREAM_ERROR:lr,Z_DATA_ERROR:hv,Z_BUF_ERROR:ll,Z_DEFAULT_COMPRESSION:mv,Z_FILTERED:gv,Z_HUFFMAN_ONLY:ws,Z_RLE:yv,Z_FIXED:vv,Z_DEFAULT_STRATEGY:bv,Z_UNKNOWN:_v,Z_DEFLATED:vc}=on,Sv=9,wv=15,Cv=8,Ev=29,xv=256,Fl=xv+1+Ev,Av=30,kv=19,Tv=2*Fl+1,Iv=15,ue=3,Jr=258,pr=Jr+ue+1,Ov=32,Qn=42,ip=57,Ml=69,Ul=73,jl=91,ql=103,Bi=113,Wa=666,dt=1,ea=2,Yi=3,ta=4,Dv=3,Vi=(t,e)=>(t.msg=Ji[e],e),dh=t=>t*2-(t>4?9:0),Zr=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Nv=t=>{let e,r,i,n=t.w_size;e=t.hash_size,i=e;do r=t.head[--i],t.head[i]=r>=n?r-n:0;while(--e);e=n,i=e;do r=t.prev[--i],t.prev[i]=r>=n?r-n:0;while(--e)},Rv=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,ii=Rv,At=t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},Tt=(t,e)=>{lv(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,At(t.strm)},ve=(t,e)=>{t.pending_buf[t.pending++]=e},Da=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Bl=(t,e,r,i)=>{let n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),r),t.state.wrap===1?t.adler=uo(t.adler,e,n,r):t.state.wrap===2&&(t.adler=Ge(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)},j1=(t,e)=>{let r=t.max_chain_length,i=t.strstart,n,a,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-pr?t.strstart-(t.w_size-pr):0,c=t.window,l=t.w_mask,d=t.prev,f=t.strstart+Jr,p=c[i+o-1],h=c[i+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do if(n=e,!(c[n+o]!==h||c[n+o-1]!==p||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<f);if(a=Jr-(f-i),i=f-Jr,a>o){if(t.match_start=e,o=a,a>=s)break;p=c[i+o-1],h=c[i+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},zn=t=>{let e=t.w_size,r,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-pr)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Nv(t),i+=e),t.strm.avail_in===0)break;if(r=Bl(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=r,t.lookahead+t.insert>=ue)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=ii(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=ii(t,t.ins_h,t.window[n+ue-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<ue)););}while(t.lookahead<pr&&t.strm.avail_in!==0)},q1=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,i,n,a,o=0,s=t.strm.avail_in;do{if(i=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,n=t.strstart-t.block_start,i>n+t.strm.avail_in&&(i=n+t.strm.avail_in),i>a&&(i=a),i<r&&(i===0&&e!==Ut||e===ri||i!==n+t.strm.avail_in)))break;o=e===Ut&&i===n+t.strm.avail_in?1:0,Ll(t,0,0,o),t.pending_buf[t.pending-4]=i,t.pending_buf[t.pending-3]=i>>8,t.pending_buf[t.pending-2]=~i,t.pending_buf[t.pending-1]=~i>>8,At(t.strm),n&&(n>i&&(n=i),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,i-=n),i&&(Bl(t.strm,t.strm.output,t.strm.next_out,i),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?ta:e!==ri&&e!==Ut&&t.strm.avail_in===0&&t.strstart===t.block_start?ea:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Bl(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,r=a>t.w_size?t.w_size:a,n=t.strstart-t.block_start,(n>=r||(n||e===Ut)&&e!==ri&&t.strm.avail_in===0&&n<=a)&&(i=n>a?a:n,o=e===Ut&&t.strm.avail_in===0&&i===n?1:0,Ll(t,t.block_start,i,o),t.block_start+=i,At(t.strm)),o?Yi:dt)},pl=(t,e)=>{let r,i;for(;;){if(t.lookahead<pr){if(zn(t),t.lookahead<pr&&e===ri)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=ue&&(t.ins_h=ii(t,t.ins_h,t.window[t.strstart+ue-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-pr&&(t.match_length=j1(t,r)),t.match_length>=ue)if(i=ti(t,t.strstart-t.match_start,t.match_length-ue),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ue){t.match_length--;do t.strstart++,t.ins_h=ii(t,t.ins_h,t.window[t.strstart+ue-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ii(t,t.ins_h,t.window[t.strstart+1]);else i=ti(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(Tt(t,!1),t.strm.avail_out===0))return dt}return t.insert=t.strstart<ue-1?t.strstart:ue-1,e===Ut?(Tt(t,!0),t.strm.avail_out===0?Yi:ta):t.sym_next&&(Tt(t,!1),t.strm.avail_out===0)?dt:ea},Pn=(t,e)=>{let r,i,n;for(;;){if(t.lookahead<pr){if(zn(t),t.lookahead<pr&&e===ri)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=ue&&(t.ins_h=ii(t,t.ins_h,t.window[t.strstart+ue-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=ue-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-pr&&(t.match_length=j1(t,r),t.match_length<=5&&(t.strategy===gv||t.match_length===ue&&t.strstart-t.match_start>4096)&&(t.match_length=ue-1)),t.prev_length>=ue&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-ue,i=ti(t,t.strstart-1-t.prev_match,t.prev_length-ue),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=ii(t,t.ins_h,t.window[t.strstart+ue-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=ue-1,t.strstart++,i&&(Tt(t,!1),t.strm.avail_out===0))return dt}else if(t.match_available){if(i=ti(t,0,t.window[t.strstart-1]),i&&Tt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return dt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=ti(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<ue-1?t.strstart:ue-1,e===Ut?(Tt(t,!0),t.strm.avail_out===0?Yi:ta):t.sym_next&&(Tt(t,!1),t.strm.avail_out===0)?dt:ea},Pv=(t,e)=>{let r,i,n,a,o=t.window;for(;;){if(t.lookahead<=Jr){if(zn(t),t.lookahead<=Jr&&e===ri)return dt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=ue&&t.strstart>0&&(n=t.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){a=t.strstart+Jr;do;while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&n<a);t.match_length=Jr-(a-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ue?(r=ti(t,1,t.match_length-ue),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=ti(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Tt(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Ut?(Tt(t,!0),t.strm.avail_out===0?Yi:ta):t.sym_next&&(Tt(t,!1),t.strm.avail_out===0)?dt:ea},$v=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(zn(t),t.lookahead===0)){if(e===ri)return dt;break}if(t.match_length=0,r=ti(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Tt(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Ut?(Tt(t,!0),t.strm.avail_out===0?Yi:ta):t.sym_next&&(Tt(t,!1),t.strm.avail_out===0)?dt:ea};function rr(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}var Ha=[new rr(0,0,0,0,q1),new rr(4,4,8,4,pl),new rr(4,5,16,8,pl),new rr(4,6,32,32,pl),new rr(4,4,16,16,Pn),new rr(8,16,32,32,Pn),new rr(8,16,128,128,Pn),new rr(8,32,128,256,Pn),new rr(32,128,258,1024,Pn),new rr(32,258,258,4096,Pn)],Lv=t=>{t.window_size=2*t.w_size,Zr(t.head),t.max_lazy_match=Ha[t.level].max_lazy,t.good_match=Ha[t.level].good_length,t.nice_match=Ha[t.level].nice_length,t.max_chain_length=Ha[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ue-1,t.match_available=0,t.ins_h=0};function Fv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=vc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Tv*2),this.dyn_dtree=new Uint16Array((2*Av+1)*2),this.bl_tree=new Uint16Array((2*kv+1)*2),Zr(this.dyn_ltree),Zr(this.dyn_dtree),Zr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Iv+1),this.heap=new Uint16Array(2*Fl+1),Zr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Fl+1),Zr(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var bo=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==Qn&&e.status!==ip&&e.status!==Ml&&e.status!==Ul&&e.status!==jl&&e.status!==ql&&e.status!==Bi&&e.status!==Wa?1:0},B1=t=>{if(bo(t))return Vi(t,lr);t.total_in=t.total_out=0,t.data_type=_v;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?ip:e.wrap?Qn:Bi,t.adler=e.wrap===2?0:1,e.last_flush=-2,uv(e),rt},V1=t=>{let e=B1(t);return e===rt&&Lv(t.state),e},Mv=(t,e)=>bo(t)||t.state.wrap!==2?lr:(t.state.gzhead=e,rt),Q1=(t,e,r,i,n,a)=>{if(!t)return lr;let o=1;if(e===mv&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),n<1||n>Sv||r!==vc||i<8||i>15||e<0||e>9||a<0||a>vv||i===8&&o!==1)return Vi(t,lr);i===8&&(i=9);let s=new Fv;return t.state=s,s.strm=t,s.status=Qn,s.wrap=o,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=n+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+ue-1)/ue),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<n+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,V1(t)},Uv=(t,e)=>Q1(t,e,vc,wv,Cv,bv),jv=(t,e)=>{if(bo(t)||e>ph||e<0)return t?Vi(t,lr):lr;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===Wa&&e!==Ut)return Vi(t,t.avail_out===0?ll:lr);let i=r.last_flush;if(r.last_flush=e,r.pending!==0){if(At(t),t.avail_out===0)return r.last_flush=-1,rt}else if(t.avail_in===0&&dh(e)<=dh(i)&&e!==Ut)return Vi(t,ll);if(r.status===Wa&&t.avail_in!==0)return Vi(t,ll);if(r.status===Qn&&r.wrap===0&&(r.status=Bi),r.status===Qn){let n=vc+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=ws||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,n|=a<<6,r.strstart!==0&&(n|=Ov),n+=31-n%31,Da(r,n),r.strstart!==0&&(Da(r,t.adler>>>16),Da(r,t.adler&65535)),t.adler=1,r.status=Bi,At(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===ip){if(t.adler=0,ve(r,31),ve(r,139),ve(r,8),r.gzhead)ve(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ve(r,r.gzhead.time&255),ve(r,r.gzhead.time>>8&255),ve(r,r.gzhead.time>>16&255),ve(r,r.gzhead.time>>24&255),ve(r,r.level===9?2:r.strategy>=ws||r.level<2?4:0),ve(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ve(r,r.gzhead.extra.length&255),ve(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Ge(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Ml;else if(ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,r.level===9?2:r.strategy>=ws||r.level<2?4:0),ve(r,Dv),r.status=Bi,At(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===Ml){if(r.gzhead.extra){let n=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex+=s,At(t),r.pending!==0)return r.last_flush=-1,rt;n=0,a-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=Ul}if(r.status===Ul){if(r.gzhead.name){let n=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),At(t),r.pending!==0)return r.last_flush=-1,rt;n=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,ve(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=jl}if(r.status===jl){if(r.gzhead.comment){let n=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),At(t),r.pending!==0)return r.last_flush=-1,rt;n=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,ve(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n))}r.status=ql}if(r.status===ql){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(At(t),r.pending!==0))return r.last_flush=-1,rt;ve(r,t.adler&255),ve(r,t.adler>>8&255),t.adler=0}if(r.status=Bi,At(t),r.pending!==0)return r.last_flush=-1,rt}if(t.avail_in!==0||r.lookahead!==0||e!==ri&&r.status!==Wa){let n=r.level===0?q1(r,e):r.strategy===ws?$v(r,e):r.strategy===yv?Pv(r,e):Ha[r.level].func(r,e);if((n===Yi||n===ta)&&(r.status=Wa),n===dt||n===Yi)return t.avail_out===0&&(r.last_flush=-1),rt;if(n===ea&&(e===fv?pv(r):e!==ph&&(Ll(r,0,0,!1),e===dv&&(Zr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),At(t),t.avail_out===0))return r.last_flush=-1,rt}return e!==Ut?rt:r.wrap<=0?fh:(r.wrap===2?(ve(r,t.adler&255),ve(r,t.adler>>8&255),ve(r,t.adler>>16&255),ve(r,t.adler>>24&255),ve(r,t.total_in&255),ve(r,t.total_in>>8&255),ve(r,t.total_in>>16&255),ve(r,t.total_in>>24&255)):(Da(r,t.adler>>>16),Da(r,t.adler&65535)),At(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?rt:fh)},qv=t=>{if(bo(t))return lr;let e=t.state.status;return t.state=null,e===Bi?Vi(t,hv):rt},Bv=(t,e)=>{let r=e.length;if(bo(t))return lr;let i=t.state,n=i.wrap;if(n===2||n===1&&i.status!==Qn||i.lookahead)return lr;if(n===1&&(t.adler=uo(t.adler,e,r,0)),i.wrap=0,r>=i.w_size){n===0&&(Zr(i.head),i.strstart=0,i.block_start=0,i.insert=0);let u=new Uint8Array(i.w_size);u.set(e.subarray(r-i.w_size,r),0),e=u,r=i.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,zn(i);i.lookahead>=ue;){let u=i.strstart,c=i.lookahead-(ue-1);do i.ins_h=ii(i,i.ins_h,i.window[u+ue-1]),i.prev[u&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=u,u++;while(--c);i.strstart=u,i.lookahead=ue-1,zn(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=ue-1,i.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,i.wrap=n,rt},Vv=Uv,Qv=Q1,zv=V1,Wv=B1,Hv=Mv,Gv=jv,Kv=qv,Zv=Bv,Jv="pako deflate (from Nodeca project)",Xa={deflateInit:Vv,deflateInit2:Qv,deflateReset:zv,deflateResetKeep:Wv,deflateSetHeader:Hv,deflate:Gv,deflateEnd:Kv,deflateSetDictionary:Zv,deflateInfo:Jv},Yv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Xv=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let i in r)Yv(r,i)&&(t[i]=r[i])}}return t},e2=t=>{let e=0;for(let i=0,n=t.length;i<n;i++)e+=t[i].length;let r=new Uint8Array(e);for(let i=0,n=0,a=t.length;i<a;i++){let o=t[i];r.set(o,n),n+=o.length}return r},bc={assign:Xv,flattenChunks:e2},z1=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){z1=!1}var lo=new Uint8Array(256);for(let t=0;t<256;t++)lo[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;lo[254]=lo[254]=1;var t2=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,i,n,a,o=t.length,s=0;for(n=0;n<o;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<o&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,n=0;a<s;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<o&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e},r2=(t,e)=>{if(e<65534&&t.subarray&&z1)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let i=0;i<e;i++)r+=String.fromCharCode(t[i]);return r},i2=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let i,n,a=new Array(r*2);for(n=0,i=0;i<r;){let o=t[i++];if(o<128){a[n++]=o;continue}let s=lo[o];if(s>4){a[n++]=65533,i+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&i<r;)o=o<<6|t[i++]&63,s--;if(s>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return r2(a,n)},n2=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+lo[t[r]]>e?r:e},po={string2buf:t2,buf2string:i2,utf8border:n2};function a2(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var W1=a2,H1=Object.prototype.toString,{Z_NO_FLUSH:o2,Z_SYNC_FLUSH:s2,Z_FULL_FLUSH:c2,Z_FINISH:u2,Z_OK:oc,Z_STREAM_END:l2,Z_DEFAULT_COMPRESSION:p2,Z_DEFAULT_STRATEGY:f2,Z_DEFLATED:d2}=on;function _o(t){this.options=bc.assign({level:p2,method:d2,chunkSize:16384,windowBits:15,memLevel:8,strategy:f2},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W1,this.strm.avail_out=0;let r=Xa.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==oc)throw new Error(Ji[r]);if(e.header&&Xa.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=po.string2buf(e.dictionary):H1.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=Xa.deflateSetDictionary(this.strm,i),r!==oc)throw new Error(Ji[r]);this._dict_set=!0}}_o.prototype.push=function(t,e){let r=this.strm,i=this.options.chunkSize,n,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?u2:o2,typeof t=="string"?r.input=po.string2buf(t):H1.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(a===s2||a===c2)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(n=Xa.deflate(r,a),n===l2)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),n=Xa.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===oc;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};_o.prototype.onData=function(t){this.chunks.push(t)};_o.prototype.onEnd=function(t){t===oc&&(this.result=bc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function np(t,e){let r=new _o(e);if(r.push(t,!0),r.err)throw r.msg||Ji[r.err];return r.result}function h2(t,e){return e=e||{},e.raw=!0,np(t,e)}function m2(t,e){return e=e||{},e.gzip=!0,np(t,e)}var g2=_o,y2=np,v2=h2,b2=m2,_2=on,S2={Deflate:g2,deflate:y2,deflateRaw:v2,gzip:b2,constants:_2},Cs=16209,w2=16191,C2=function t(e,r){let i,n,a,o,s,u,c,l,d,f,p,h,m,b,_,S,w,v,D,N,A,R,F,P,j=e.state;i=e.next_in,F=e.input,n=i+(e.avail_in-5),a=e.next_out,P=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=j.dmax,c=j.wsize,l=j.whave,d=j.wnext,f=j.window,p=j.hold,h=j.bits,m=j.lencode,b=j.distcode,_=(1<<j.lenbits)-1,S=(1<<j.distbits)-1;e:do{h<15&&(p+=F[i++]<<h,h+=8,p+=F[i++]<<h,h+=8),w=m[p&_];t:for(;;){if(v=w>>>24,p>>>=v,h-=v,v=w>>>16&255,v===0)P[a++]=w&65535;else if(v&16){D=w&65535,v&=15,v&&(h<v&&(p+=F[i++]<<h,h+=8),D+=p&(1<<v)-1,p>>>=v,h-=v),h<15&&(p+=F[i++]<<h,h+=8,p+=F[i++]<<h,h+=8),w=b[p&S];r:for(;;){if(v=w>>>24,p>>>=v,h-=v,v=w>>>16&255,v&16){if(N=w&65535,v&=15,h<v&&(p+=F[i++]<<h,h+=8,h<v&&(p+=F[i++]<<h,h+=8)),N+=p&(1<<v)-1,N>u){e.msg="invalid distance too far back",j.mode=Cs;break e}if(p>>>=v,h-=v,v=a-o,N>v){if(v=N-v,v>l&&j.sane){e.msg="invalid distance too far back",j.mode=Cs;break e}if(A=0,R=f,d===0){if(A+=c-v,v<D){D-=v;do P[a++]=f[A++];while(--v);A=a-N,R=P}}else if(d<v){if(A+=c+d-v,v-=d,v<D){D-=v;do P[a++]=f[A++];while(--v);if(A=0,d<D){v=d,D-=v;do P[a++]=f[A++];while(--v);A=a-N,R=P}}}else if(A+=d-v,v<D){D-=v;do P[a++]=f[A++];while(--v);A=a-N,R=P}for(;D>2;)P[a++]=R[A++],P[a++]=R[A++],P[a++]=R[A++],D-=3;D&&(P[a++]=R[A++],D>1&&(P[a++]=R[A++]))}else{A=a-N;do P[a++]=P[A++],P[a++]=P[A++],P[a++]=P[A++],D-=3;while(D>2);D&&(P[a++]=P[A++],D>1&&(P[a++]=P[A++]))}}else if((v&64)===0){w=b[(w&65535)+(p&(1<<v)-1)];continue r}else{e.msg="invalid distance code",j.mode=Cs;break e}break}}else if((v&64)===0){w=m[(w&65535)+(p&(1<<v)-1)];continue t}else if(v&32){j.mode=w2;break e}else{e.msg="invalid literal/length code",j.mode=Cs;break e}break}}while(i<n&&a<s);D=h>>3,i-=D,h-=D<<3,p&=(1<<h)-1,e.next_in=i,e.next_out=a,e.avail_in=i<n?5+(n-i):5-(i-n),e.avail_out=a<s?257+(s-a):257-(a-s),j.hold=p,j.bits=h},$n=15,hh=852,mh=592,gh=0,fl=1,yh=2,E2=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),x2=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),A2=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),k2=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),T2=(t,e,r,i,n,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,f=0,p=0,h=0,m=0,b=0,_=0,S=0,w,v,D,N,A,R=null,F,P=new Uint16Array($n+1),j=new Uint16Array($n+1),Je=null,je,H,we;for(c=0;c<=$n;c++)P[c]=0;for(l=0;l<i;l++)P[e[r+l]]++;for(p=u,f=$n;f>=1&&P[f]===0;f--);if(p>f&&(p=f),f===0)return n[a++]=1<<24|64<<16|0,n[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<f&&P[d]===0;d++);for(p<d&&(p=d),b=1,c=1;c<=$n;c++)if(b<<=1,b-=P[c],b<0)return-1;if(b>0&&(t===gh||f!==1))return-1;for(j[1]=0,c=1;c<$n;c++)j[c+1]=j[c]+P[c];for(l=0;l<i;l++)e[r+l]!==0&&(o[j[e[r+l]]++]=l);if(t===gh?(R=Je=o,F=20):t===fl?(R=E2,Je=x2,F=257):(R=A2,Je=k2,F=0),S=0,l=0,c=d,A=a,h=p,m=0,D=-1,_=1<<p,N=_-1,t===fl&&_>hh||t===yh&&_>mh)return 1;for(;;){je=c-m,o[l]+1<F?(H=0,we=o[l]):o[l]>=F?(H=Je[o[l]-F],we=R[o[l]-F]):(H=32+64,we=0),w=1<<c-m,v=1<<h,d=v;do v-=w,n[A+(S>>m)+v]=je<<24|H<<16|we|0;while(v!==0);for(w=1<<c-1;S&w;)w>>=1;if(w!==0?(S&=w-1,S+=w):S=0,l++,--P[c]===0){if(c===f)break;c=e[r+o[l]]}if(c>p&&(S&N)!==D){for(m===0&&(m=p),A+=d,h=c-m,b=1<<h;h+m<f&&(b-=P[h+m],!(b<=0));)h++,b<<=1;if(_+=1<<h,t===fl&&_>hh||t===yh&&_>mh)return 1;D=S&N,n[D]=p<<24|h<<16|A-a|0}}return S!==0&&(n[A+S]=c-m<<24|64<<16|0),s.bits=p,0},eo=T2,I2=0,G1=1,K1=2,{Z_FINISH:vh,Z_BLOCK:O2,Z_TREES:Es,Z_OK:Xi,Z_STREAM_END:D2,Z_NEED_DICT:N2,Z_STREAM_ERROR:jt,Z_DATA_ERROR:Z1,Z_MEM_ERROR:J1,Z_BUF_ERROR:R2,Z_DEFLATED:bh}=on,_c=16180,_h=16181,Sh=16182,wh=16183,Ch=16184,Eh=16185,xh=16186,Ah=16187,kh=16188,Th=16189,sc=16190,Sr=16191,dl=16192,Ih=16193,hl=16194,Oh=16195,Dh=16196,Nh=16197,Rh=16198,xs=16199,As=16200,Ph=16201,$h=16202,Lh=16203,Fh=16204,Mh=16205,ml=16206,Uh=16207,jh=16208,Te=16209,Y1=16210,X1=16211,P2=852,$2=592,L2=15,F2=L2,qh=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function M2(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var sn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<_c||e.mode>X1?1:0},em=t=>{if(sn(t))return jt;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=_c,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(P2),e.distcode=e.distdyn=new Int32Array($2),e.sane=1,e.back=-1,Xi},tm=t=>{if(sn(t))return jt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,em(t)},rm=(t,e)=>{let r;if(sn(t))return jt;let i=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?jt:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,tm(t))},im=(t,e)=>{if(!t)return jt;let r=new M2;t.state=r,r.strm=t,r.window=null,r.mode=_c;let i=rm(t,e);return i!==Xi&&(t.state=null),i},U2=t=>im(t,F2),Bh=!0,gl,yl,j2=t=>{if(Bh){gl=new Int32Array(512),yl=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(eo(G1,t.lens,0,288,gl,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;eo(K1,t.lens,0,32,yl,0,t.work,{bits:5}),Bh=!1}t.lencode=gl,t.lenbits=9,t.distcode=yl,t.distbits=5},nm=(t,e,r,i)=>{let n,a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>i&&(n=i),a.window.set(e.subarray(r-i,r-i+n),a.wnext),i-=n,i?(a.window.set(e.subarray(r-i,r),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0},q2=(t,e)=>{let r,i,n,a,o,s,u,c,l,d,f,p,h,m,b=0,_,S,w,v,D,N,A,R,F=new Uint8Array(4),P,j,Je=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(sn(t)||!t.output||!t.input&&t.avail_in!==0)return jt;r=t.state,r.mode===Sr&&(r.mode=dl),o=t.next_out,n=t.output,u=t.avail_out,a=t.next_in,i=t.input,s=t.avail_in,c=r.hold,l=r.bits,d=s,f=u,R=Xi;e:for(;;)switch(r.mode){case _c:if(r.wrap===0){r.mode=dl;break}for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0),c=0,l=0,r.mode=_h;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=Te;break}if((c&15)!==bh){t.msg="unknown compression method",r.mode=Te;break}if(c>>>=4,l-=4,A=(c&15)+8,r.wbits===0&&(r.wbits=A),A>15||A>r.wbits){t.msg="invalid window size",r.mode=Te;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?Th:Sr,c=0,l=0;break;case _h:for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==bh){t.msg="unknown compression method",r.mode=Te;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=Te;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0)),c=0,l=0,r.mode=Sh;case Sh:for(;l<32;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,F[2]=c>>>16&255,F[3]=c>>>24&255,r.check=Ge(r.check,F,4,0)),c=0,l=0,r.mode=wh;case wh:for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0)),c=0,l=0,r.mode=Ch;case Ch:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Eh;case Eh:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(r.head&&(A=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(i.subarray(a,a+p),A)),r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,i,p,a)),s-=p,a+=p,r.length-=p),r.length))break e;r.length=0,r.mode=xh;case xh:if(r.flags&2048){if(s===0)break e;p=0;do A=i[a+p++],r.head&&A&&r.length<65536&&(r.head.name+=String.fromCharCode(A));while(A&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,i,p,a)),s-=p,a+=p,A)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Ah;case Ah:if(r.flags&4096){if(s===0)break e;p=0;do A=i[a+p++],r.head&&A&&r.length<65536&&(r.head.comment+=String.fromCharCode(A));while(A&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,i,p,a)),s-=p,a+=p,A)break e}else r.head&&(r.head.comment=null);r.mode=kh;case kh:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=Te;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Sr;break;case Th:for(;l<32;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}t.adler=r.check=qh(c),c=0,l=0,r.mode=sc;case sc:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,N2;t.adler=r.check=1,r.mode=Sr;case Sr:if(e===O2||e===Es)break e;case dl:if(r.last){c>>>=l&7,l-=l&7,r.mode=ml;break}for(;l<3;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=Ih;break;case 1:if(j2(r),r.mode=xs,e===Es){c>>>=2,l-=2;break e}break;case 2:r.mode=Dh;break;case 3:t.msg="invalid block type",r.mode=Te}c>>>=2,l-=2;break;case Ih:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=Te;break}if(r.length=c&65535,c=0,l=0,r.mode=hl,e===Es)break e;case hl:r.mode=Oh;case Oh:if(p=r.length,p){if(p>s&&(p=s),p>u&&(p=u),p===0)break e;n.set(i.subarray(a,a+p),o),s-=p,a+=p,u-=p,o+=p,r.length-=p;break}r.mode=Sr;break;case Dh:for(;l<14;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Te;break}r.have=0,r.mode=Nh;case Nh:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.lens[Je[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[Je[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},R=eo(I2,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,R){t.msg="invalid code lengths set",r.mode=Te;break}r.have=0,r.mode=Rh;case Rh:for(;r.have<r.nlen+r.ndist;){for(;b=r.lencode[c&(1<<r.lenbits)-1],_=b>>>24,S=b>>>16&255,w=b&65535,!(_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(w<16)c>>>=_,l-=_,r.lens[r.have++]=w;else{if(w===16){for(j=_+2;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(c>>>=_,l-=_,r.have===0){t.msg="invalid bit length repeat",r.mode=Te;break}A=r.lens[r.have-1],p=3+(c&3),c>>>=2,l-=2}else if(w===17){for(j=_+3;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}c>>>=_,l-=_,A=0,p=3+(c&7),c>>>=3,l-=3}else{for(j=_+7;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}c>>>=_,l-=_,A=0,p=11+(c&127),c>>>=7,l-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Te;break}for(;p--;)r.lens[r.have++]=A}}if(r.mode===Te)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=Te;break}if(r.lenbits=9,P={bits:r.lenbits},R=eo(G1,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,R){t.msg="invalid literal/lengths set",r.mode=Te;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},R=eo(K1,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,R){t.msg="invalid distances set",r.mode=Te;break}if(r.mode=xs,e===Es)break e;case xs:r.mode=As;case As:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,C2(t,f),o=t.next_out,n=t.output,u=t.avail_out,a=t.next_in,i=t.input,s=t.avail_in,c=r.hold,l=r.bits,r.mode===Sr&&(r.back=-1);break}for(r.back=0;b=r.lencode[c&(1<<r.lenbits)-1],_=b>>>24,S=b>>>16&255,w=b&65535,!(_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(S&&(S&240)===0){for(v=_,D=S,N=w;b=r.lencode[N+((c&(1<<v+D)-1)>>v)],_=b>>>24,S=b>>>16&255,w=b&65535,!(v+_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}c>>>=v,l-=v,r.back+=v}if(c>>>=_,l-=_,r.back+=_,r.length=w,S===0){r.mode=Mh;break}if(S&32){r.back=-1,r.mode=Sr;break}if(S&64){t.msg="invalid literal/length code",r.mode=Te;break}r.extra=S&15,r.mode=Ph;case Ph:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=$h;case $h:for(;b=r.distcode[c&(1<<r.distbits)-1],_=b>>>24,S=b>>>16&255,w=b&65535,!(_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if((S&240)===0){for(v=_,D=S,N=w;b=r.distcode[N+((c&(1<<v+D)-1)>>v)],_=b>>>24,S=b>>>16&255,w=b&65535,!(v+_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}c>>>=v,l-=v,r.back+=v}if(c>>>=_,l-=_,r.back+=_,S&64){t.msg="invalid distance code",r.mode=Te;break}r.offset=w,r.extra=S&15,r.mode=Lh;case Lh:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Te;break}r.mode=Fh;case Fh:if(u===0)break e;if(p=f-u,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Te;break}p>r.wnext?(p-=r.wnext,h=r.wsize-p):h=r.wnext-p,p>r.length&&(p=r.length),m=r.window}else m=n,h=o-r.offset,p=r.length;p>u&&(p=u),u-=p,r.length-=p;do n[o++]=m[h++];while(--p);r.length===0&&(r.mode=As);break;case Mh:if(u===0)break e;n[o++]=r.length,u--,r.mode=As;break;case ml:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=i[a++]<<l,l+=8}if(f-=u,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?Ge(r.check,n,f,o-f):uo(r.check,n,f,o-f)),f=u,r.wrap&4&&(r.flags?c:qh(c))!==r.check){t.msg="incorrect data check",r.mode=Te;break}c=0,l=0}r.mode=Uh;case Uh:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=Te;break}c=0,l=0}r.mode=jh;case jh:R=D2;break e;case Te:R=Z1;break e;case Y1:return J1;case X1:default:return jt}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,(r.wsize||f!==t.avail_out&&r.mode<Te&&(r.mode<ml||e!==vh))&&nm(t,t.output,t.next_out,f-t.avail_out),d-=t.avail_in,f-=t.avail_out,t.total_in+=d,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?Ge(r.check,n,f,t.next_out-f):uo(r.check,n,f,t.next_out-f)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Sr?128:0)+(r.mode===xs||r.mode===hl?256:0),(d===0&&f===0||e===vh)&&R===Xi&&(R=R2),R},B2=t=>{if(sn(t))return jt;let e=t.state;return e.window&&(e.window=null),t.state=null,Xi},V2=(t,e)=>{if(sn(t))return jt;let r=t.state;return(r.wrap&2)===0?jt:(r.head=e,e.done=!1,Xi)},Q2=(t,e)=>{let r=e.length,i,n,a;return sn(t)||(i=t.state,i.wrap!==0&&i.mode!==sc)?jt:i.mode===sc&&(n=1,n=uo(n,e,r,0),n!==i.check)?Z1:(a=nm(t,e,r,r),a?(i.mode=Y1,J1):(i.havedict=1,Xi))},z2=tm,W2=rm,H2=em,G2=U2,K2=im,Z2=q2,J2=B2,Y2=V2,X2=Q2,e3="pako inflate (from Nodeca project)",Ar={inflateReset:z2,inflateReset2:W2,inflateResetKeep:H2,inflateInit:G2,inflateInit2:K2,inflate:Z2,inflateEnd:J2,inflateGetHeader:Y2,inflateSetDictionary:X2,inflateInfo:e3};function t3(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var r3=t3,am=Object.prototype.toString,{Z_NO_FLUSH:i3,Z_FINISH:n3,Z_OK:fo,Z_STREAM_END:vl,Z_NEED_DICT:bl,Z_STREAM_ERROR:a3,Z_DATA_ERROR:Vh,Z_MEM_ERROR:o3}=on;function So(t){this.options=bc.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W1,this.strm.avail_out=0;let r=Ar.inflateInit2(this.strm,e.windowBits);if(r!==fo)throw new Error(Ji[r]);if(this.header=new r3,Ar.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=po.string2buf(e.dictionary):am.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Ar.inflateSetDictionary(this.strm,e.dictionary),r!==fo)))throw new Error(Ji[r])}So.prototype.push=function(t,e){let r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?n3:i3,am.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),a=Ar.inflate(r,o),a===bl&&n&&(a=Ar.inflateSetDictionary(r,n),a===fo?a=Ar.inflate(r,o):a===Vh&&(a=bl));r.avail_in>0&&a===vl&&r.state.wrap>0&&t[r.next_in]!==0;)Ar.inflateReset(r),a=Ar.inflate(r,o);switch(a){case a3:case Vh:case bl:case o3:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===vl))if(this.options.to==="string"){let u=po.utf8border(r.output,r.next_out),c=r.next_out-u,l=po.buf2string(r.output,u);r.next_out=c,r.avail_out=i-c,c&&r.output.set(r.output.subarray(u,u+c),0),this.onData(l)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===fo&&s===0)){if(a===vl)return a=Ar.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};So.prototype.onData=function(t){this.chunks.push(t)};So.prototype.onEnd=function(t){t===fo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=bc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function ap(t,e){let r=new So(e);if(r.push(t),r.err)throw r.msg||Ji[r.err];return r.result}function s3(t,e){return e=e||{},e.raw=!0,ap(t,e)}var c3=So,u3=ap,l3=s3,p3=ap,f3=on,d3={Inflate:c3,inflate:u3,inflateRaw:l3,ungzip:p3,constants:f3},{Deflate:h3,deflate:m3,deflateRaw:g3,gzip:y3}=S2,{Inflate:v3,inflate:b3,inflateRaw:_3,ungzip:S3}=d3,w3=h3,C3=m3,E3=g3,x3=y3,A3=v3,k3=b3,T3=_3,I3=S3,O3=on,D3={Deflate:w3,deflate:C3,deflateRaw:E3,gzip:x3,Inflate:A3,inflate:k3,inflateRaw:T3,ungzip:I3,constants:O3},xe=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Ae=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},cc=class{constructor(e,r){this.input=e,this.output=r}};xe([g(),Ae("design:type",String)],cc.prototype,"input",void 0);xe([g(),Ae("design:type",String)],cc.prototype,"output",void 0);cc=xe([Ze(),Ae("design:paramtypes",[String,String])],cc);var uc=class{constructor(e,r){this.input=e,this.output=r}};xe([g(),Ae("design:type",String)],uc.prototype,"input",void 0);xe([g(),Ae("design:type",String)],uc.prototype,"output",void 0);uc=xe([G(),Ae("design:paramtypes",[String,String])],uc);var si=class{constructor(e,r,i,n,a){this.name=e,this.modelId=r,this.systemPrompt=i,this.promptExamples=n,this.metaData=a}};xe([g(),Ae("design:type",String)],si.prototype,"name",void 0);xe([g(),Ae("design:type",String)],si.prototype,"modelId",void 0);xe([g(),Ae("design:type",String)],si.prototype,"systemPrompt",void 0);xe([g(),Ae("design:type",Array)],si.prototype,"promptExamples",void 0);xe([g(),Ae("design:type",String)],si.prototype,"metaData",void 0);si=xe([Ze(),Ae("design:paramtypes",[String,String,String,Array,String])],si);var hr=class{constructor(e,r,i,n,a,o,s,u){this.name=e,this.modelId=r,this.taskId=i,this.systemPrompt=n,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};xe([g(),Ae("design:type",String)],hr.prototype,"name",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"modelId",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"taskId",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"systemPrompt",void 0);xe([g(),Ae("design:type",Array)],hr.prototype,"promptExamples",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"metaData",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"createdAt",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"updatedAt",void 0);hr=xe([G(),Ae("design:paramtypes",[String,String,String,String,Array,String,String,String])],hr);var en=class{constructor(e,r,i,n,a){this.model=e,this.status=r,this.progress=i,this.downloaded=n,this.loaded=a}};xe([g(),Ae("design:type",String)],en.prototype,"model",void 0);xe([g(),Ae("design:type",String)],en.prototype,"status",void 0);xe([g(),Ae("design:type",Number)],en.prototype,"progress",void 0);xe([g(),Ae("design:type",Boolean)],en.prototype,"downloaded",void 0);xe([g(),Ae("design:type",Boolean)],en.prototype,"loaded",void 0);en=xe([G(),Ae("design:paramtypes",[String,String,Number,Boolean,Boolean])],en);var N3=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},ze=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},Ve,js,Vl=class{constructor(e,r=!0){Ve.set(this,void 0),js.set(this,new Map),N3(this,Ve,e,"f")}async getModels(){let e=await ze(this,Ve,"f").query({query:E`
744
+ }`,variables:{url:e,interactionCall:r}}));return i}};Er=new WeakMap;var yc={};yc.byteLength=T0;yc.toByteArray=O0;yc.fromByteArray=R0;var sr=[],Ft=[],k0=typeof Uint8Array<"u"?Uint8Array:Array,al="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Oi=0,ih=al.length;Oi<ih;++Oi)sr[Oi]=al[Oi],Ft[al.charCodeAt(Oi)]=Oi;var Oi,ih;Ft["-".charCodeAt(0)]=62;Ft["_".charCodeAt(0)]=63;function E1(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function T0(t){var e=E1(t),r=e[0],i=e[1];return(r+i)*3/4-i}function I0(t,e,r){return(e+r)*3/4-r}function O0(t){var e,r=E1(t),i=r[0],n=r[1],a=new k0(I0(t,i,n)),o=0,s=n>0?i-4:i,u;for(u=0;u<s;u+=4)e=Ft[t.charCodeAt(u)]<<18|Ft[t.charCodeAt(u+1)]<<12|Ft[t.charCodeAt(u+2)]<<6|Ft[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return n===2&&(e=Ft[t.charCodeAt(u)]<<2|Ft[t.charCodeAt(u+1)]>>4,a[o++]=e&255),n===1&&(e=Ft[t.charCodeAt(u)]<<10|Ft[t.charCodeAt(u+1)]<<4|Ft[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function D0(t){return sr[t>>18&63]+sr[t>>12&63]+sr[t>>6&63]+sr[t&63]}function N0(t,e,r){for(var i,n=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),n.push(D0(i));return n.join("")}function R0(t){for(var e,r=t.length,i=r%3,n=[],a=16383,o=0,s=r-i;o<s;o+=a)n.push(N0(t,o,o+a>s?s:o+a));return i===1?(e=t[r-1],n.push(sr[e>>2]+sr[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(sr[e>>10]+sr[e>>4&63]+sr[e<<2&63]+"=")),n.join("")}var P0=4,nh=0,ah=1,$0=2;function Xn(t){let e=t.length;for(;--e>=0;)t[e]=0}var L0=0,x1=1,F0=2,M0=3,U0=258,Xl=29,vo=256,ao=vo+1+Xl,qn=30,ep=19,A1=2*ao+1,qi=15,ol=16,j0=7,tp=256,k1=16,T1=17,I1=18,Pl=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Us=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),q0=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),O1=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),B0=512,xr=new Array((ao+2)*2);Xn(xr);var Ya=new Array(qn*2);Xn(Ya);var oo=new Array(B0);Xn(oo);var so=new Array(U0-M0+1);Xn(so);var rp=new Array(Xl);Xn(rp);var ac=new Array(qn);Xn(ac);function sl(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}var D1,N1,R1;function cl(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var P1=t=>t<256?oo[t]:oo[256+(t>>>7)],co=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},St=(t,e,r)=>{t.bi_valid>ol-r?(t.bi_buf|=e<<t.bi_valid&65535,co(t,t.bi_buf),t.bi_buf=e>>ol-t.bi_valid,t.bi_valid+=r-ol):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},cr=(t,e,r)=>{St(t,r[e*2],r[e*2+1])},$1=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},V0=t=>{t.bi_valid===16?(co(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},Q0=(t,e)=>{let r=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,d,f,p,h,m=0;for(f=0;f<=qi;f++)t.bl_count[f]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<A1;c++)l=t.heap[c],f=r[r[l*2+1]*2+1]+1,f>u&&(f=u,m++),r[l*2+1]=f,!(l>i)&&(t.bl_count[f]++,p=0,l>=s&&(p=o[l-s]),h=r[l*2],t.opt_len+=h*(f+p),a&&(t.static_len+=h*(n[l*2+1]+p)));if(m!==0){do{for(f=u-1;t.bl_count[f]===0;)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[u]--,m-=2}while(m>0);for(f=u;f!==0;f--)for(l=t.bl_count[f];l!==0;)d=t.heap[--c],!(d>i)&&(r[d*2+1]!==f&&(t.opt_len+=(f-r[d*2+1])*r[d*2],r[d*2+1]=f),l--)}},L1=(t,e,r)=>{let i=new Array(qi+1),n=0,a,o;for(a=1;a<=qi;a++)n=n+r[a-1]<<1,i[a]=n;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=$1(i[s]++,s))}},z0=()=>{let t,e,r,i,n,a=new Array(qi+1);for(r=0,i=0;i<Xl-1;i++)for(rp[i]=r,t=0;t<1<<Pl[i];t++)so[r++]=i;for(so[r-1]=i,n=0,i=0;i<16;i++)for(ac[i]=n,t=0;t<1<<Us[i];t++)oo[n++]=i;for(n>>=7;i<qn;i++)for(ac[i]=n<<7,t=0;t<1<<Us[i]-7;t++)oo[256+n++]=i;for(e=0;e<=qi;e++)a[e]=0;for(t=0;t<=143;)xr[t*2+1]=8,t++,a[8]++;for(;t<=255;)xr[t*2+1]=9,t++,a[9]++;for(;t<=279;)xr[t*2+1]=7,t++,a[7]++;for(;t<=287;)xr[t*2+1]=8,t++,a[8]++;for(L1(xr,ao+1,a),t=0;t<qn;t++)Ya[t*2+1]=5,Ya[t*2]=$1(t,5);D1=new sl(xr,Pl,vo+1,ao,qi),N1=new sl(Ya,Us,0,qn,qi),R1=new sl(new Array(0),q0,0,ep,j0)},F1=t=>{let e;for(e=0;e<ao;e++)t.dyn_ltree[e*2]=0;for(e=0;e<qn;e++)t.dyn_dtree[e*2]=0;for(e=0;e<ep;e++)t.bl_tree[e*2]=0;t.dyn_ltree[tp*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},M1=t=>{t.bi_valid>8?co(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},oh=(t,e,r,i)=>{let n=e*2,a=r*2;return t[n]<t[a]||t[n]===t[a]&&i[e]<=i[r]},ul=(t,e,r)=>{let i=t.heap[r],n=r<<1;for(;n<=t.heap_len&&(n<t.heap_len&&oh(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!oh(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i},sh=(t,e,r)=>{let i,n,a=0,o,s;if(t.sym_next!==0)do i=t.pending_buf[t.sym_buf+a++]&255,i+=(t.pending_buf[t.sym_buf+a++]&255)<<8,n=t.pending_buf[t.sym_buf+a++],i===0?cr(t,n,e):(o=so[n],cr(t,o+vo+1,e),s=Pl[o],s!==0&&(n-=rp[o],St(t,n,s)),i--,o=P1(i),cr(t,o,r),s=Us[o],s!==0&&(i-=ac[o],St(t,i,s)));while(a<t.sym_next);cr(t,tp,e)},$l=(t,e)=>{let r=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,a=e.stat_desc.elems,o,s,u=-1,c;for(t.heap_len=0,t.heap_max=A1,o=0;o<a;o++)r[o*2]!==0?(t.heap[++t.heap_len]=u=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=u<2?++u:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,n&&(t.static_len-=i[c*2+1]);for(e.max_code=u,o=t.heap_len>>1;o>=1;o--)ul(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],ul(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,r[c*2]=r[o*2]+r[s*2],t.depth[c]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,r[o*2+1]=r[s*2+1]=c,t.heap[1]=c++,ul(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Q0(t,e),L1(r,u,t.bl_count)},ch=(t,e,r)=>{let i,n=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)a=o,o=e[(i+1)*2+1],!(++s<u&&a===o)&&(s<c?t.bl_tree[a*2]+=s:a!==0?(a!==n&&t.bl_tree[a*2]++,t.bl_tree[k1*2]++):s<=10?t.bl_tree[T1*2]++:t.bl_tree[I1*2]++,s=0,n=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},uh=(t,e,r)=>{let i,n=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),i=0;i<=r;i++)if(a=o,o=e[(i+1)*2+1],!(++s<u&&a===o)){if(s<c)do cr(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==n&&(cr(t,a,t.bl_tree),s--),cr(t,k1,t.bl_tree),St(t,s-3,2)):s<=10?(cr(t,T1,t.bl_tree),St(t,s-3,3)):(cr(t,I1,t.bl_tree),St(t,s-11,7));s=0,n=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},W0=t=>{let e;for(ch(t,t.dyn_ltree,t.l_desc.max_code),ch(t,t.dyn_dtree,t.d_desc.max_code),$l(t,t.bl_desc),e=ep-1;e>=3&&t.bl_tree[O1[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},H0=(t,e,r,i)=>{let n;for(St(t,e-257,5),St(t,r-1,5),St(t,i-4,4),n=0;n<i;n++)St(t,t.bl_tree[O1[n]*2+1],3);uh(t,t.dyn_ltree,e-1),uh(t,t.dyn_dtree,r-1)},G0=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return nh;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return ah;for(r=32;r<vo;r++)if(t.dyn_ltree[r*2]!==0)return ah;return nh},lh=!1,K0=t=>{lh||(z0(),lh=!0),t.l_desc=new cl(t.dyn_ltree,D1),t.d_desc=new cl(t.dyn_dtree,N1),t.bl_desc=new cl(t.bl_tree,R1),t.bi_buf=0,t.bi_valid=0,F1(t)},U1=(t,e,r,i)=>{St(t,(L0<<1)+(i?1:0),3),M1(t),co(t,r),co(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},Z0=t=>{St(t,x1<<1,3),cr(t,tp,xr),V0(t)},J0=(t,e,r,i)=>{let n,a,o=0;t.level>0?(t.strm.data_type===$0&&(t.strm.data_type=G0(t)),$l(t,t.l_desc),$l(t,t.d_desc),o=W0(t),n=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=n&&(n=a)):n=a=r+5,r+4<=n&&e!==-1?U1(t,e,r,i):t.strategy===P0||a===n?(St(t,(x1<<1)+(i?1:0),3),sh(t,xr,Ya)):(St(t,(F0<<1)+(i?1:0),3),H0(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),sh(t,t.dyn_ltree,t.dyn_dtree)),F1(t),i&&M1(t)},Y0=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(so[r]+vo+1)*2]++,t.dyn_dtree[P1(e)*2]++),t.sym_next===t.sym_end),X0=K0,ev=U1,tv=J0,rv=Y0,iv=Z0,nv={_tr_init:X0,_tr_stored_block:ev,_tr_flush_block:tv,_tr_tally:rv,_tr_align:iv},av=(t,e,r,i)=>{let n=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do n=n+e[i++]|0,a=a+n|0;while(--o);n%=65521,a%=65521}return n|a<<16|0},uo=av,ov=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},sv=new Uint32Array(ov()),cv=(t,e,r,i)=>{let n=sv,a=i+r;t^=-1;for(let o=i;o<a;o++)t=t>>>8^n[(t^e[o])&255];return t^-1},Ge=cv,Ji={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},sn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:uv,_tr_stored_block:Ll,_tr_flush_block:lv,_tr_tally:ti,_tr_align:pv}=nv,{Z_NO_FLUSH:ri,Z_PARTIAL_FLUSH:fv,Z_FULL_FLUSH:dv,Z_FINISH:Ut,Z_BLOCK:ph,Z_OK:rt,Z_STREAM_END:fh,Z_STREAM_ERROR:lr,Z_DATA_ERROR:hv,Z_BUF_ERROR:ll,Z_DEFAULT_COMPRESSION:mv,Z_FILTERED:gv,Z_HUFFMAN_ONLY:ws,Z_RLE:yv,Z_FIXED:vv,Z_DEFAULT_STRATEGY:bv,Z_UNKNOWN:_v,Z_DEFLATED:vc}=sn,Sv=9,wv=15,Cv=8,Ev=29,xv=256,Fl=xv+1+Ev,Av=30,kv=19,Tv=2*Fl+1,Iv=15,ue=3,Jr=258,pr=Jr+ue+1,Ov=32,zn=42,ip=57,Ml=69,Ul=73,jl=91,ql=103,Bi=113,Wa=666,dt=1,ea=2,Yi=3,ta=4,Dv=3,Vi=(t,e)=>(t.msg=Ji[e],e),dh=t=>t*2-(t>4?9:0),Zr=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Nv=t=>{let e,r,i,n=t.w_size;e=t.hash_size,i=e;do r=t.head[--i],t.head[i]=r>=n?r-n:0;while(--e);e=n,i=e;do r=t.prev[--i],t.prev[i]=r>=n?r-n:0;while(--e)},Rv=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,ii=Rv,At=t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},Tt=(t,e)=>{lv(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,At(t.strm)},ve=(t,e)=>{t.pending_buf[t.pending++]=e},Da=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Bl=(t,e,r,i)=>{let n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),r),t.state.wrap===1?t.adler=uo(t.adler,e,n,r):t.state.wrap===2&&(t.adler=Ge(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)},j1=(t,e)=>{let r=t.max_chain_length,i=t.strstart,n,a,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-pr?t.strstart-(t.w_size-pr):0,c=t.window,l=t.w_mask,d=t.prev,f=t.strstart+Jr,p=c[i+o-1],h=c[i+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do if(n=e,!(c[n+o]!==h||c[n+o-1]!==p||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<f);if(a=Jr-(f-i),i=f-Jr,a>o){if(t.match_start=e,o=a,a>=s)break;p=c[i+o-1],h=c[i+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},Wn=t=>{let e=t.w_size,r,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-pr)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Nv(t),i+=e),t.strm.avail_in===0)break;if(r=Bl(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=r,t.lookahead+t.insert>=ue)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=ii(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=ii(t,t.ins_h,t.window[n+ue-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<ue)););}while(t.lookahead<pr&&t.strm.avail_in!==0)},q1=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,i,n,a,o=0,s=t.strm.avail_in;do{if(i=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,n=t.strstart-t.block_start,i>n+t.strm.avail_in&&(i=n+t.strm.avail_in),i>a&&(i=a),i<r&&(i===0&&e!==Ut||e===ri||i!==n+t.strm.avail_in)))break;o=e===Ut&&i===n+t.strm.avail_in?1:0,Ll(t,0,0,o),t.pending_buf[t.pending-4]=i,t.pending_buf[t.pending-3]=i>>8,t.pending_buf[t.pending-2]=~i,t.pending_buf[t.pending-1]=~i>>8,At(t.strm),n&&(n>i&&(n=i),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,i-=n),i&&(Bl(t.strm,t.strm.output,t.strm.next_out,i),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?ta:e!==ri&&e!==Ut&&t.strm.avail_in===0&&t.strstart===t.block_start?ea:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Bl(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,r=a>t.w_size?t.w_size:a,n=t.strstart-t.block_start,(n>=r||(n||e===Ut)&&e!==ri&&t.strm.avail_in===0&&n<=a)&&(i=n>a?a:n,o=e===Ut&&t.strm.avail_in===0&&i===n?1:0,Ll(t,t.block_start,i,o),t.block_start+=i,At(t.strm)),o?Yi:dt)},pl=(t,e)=>{let r,i;for(;;){if(t.lookahead<pr){if(Wn(t),t.lookahead<pr&&e===ri)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=ue&&(t.ins_h=ii(t,t.ins_h,t.window[t.strstart+ue-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-pr&&(t.match_length=j1(t,r)),t.match_length>=ue)if(i=ti(t,t.strstart-t.match_start,t.match_length-ue),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ue){t.match_length--;do t.strstart++,t.ins_h=ii(t,t.ins_h,t.window[t.strstart+ue-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ii(t,t.ins_h,t.window[t.strstart+1]);else i=ti(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(Tt(t,!1),t.strm.avail_out===0))return dt}return t.insert=t.strstart<ue-1?t.strstart:ue-1,e===Ut?(Tt(t,!0),t.strm.avail_out===0?Yi:ta):t.sym_next&&(Tt(t,!1),t.strm.avail_out===0)?dt:ea},$n=(t,e)=>{let r,i,n;for(;;){if(t.lookahead<pr){if(Wn(t),t.lookahead<pr&&e===ri)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=ue&&(t.ins_h=ii(t,t.ins_h,t.window[t.strstart+ue-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=ue-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-pr&&(t.match_length=j1(t,r),t.match_length<=5&&(t.strategy===gv||t.match_length===ue&&t.strstart-t.match_start>4096)&&(t.match_length=ue-1)),t.prev_length>=ue&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-ue,i=ti(t,t.strstart-1-t.prev_match,t.prev_length-ue),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=ii(t,t.ins_h,t.window[t.strstart+ue-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=ue-1,t.strstart++,i&&(Tt(t,!1),t.strm.avail_out===0))return dt}else if(t.match_available){if(i=ti(t,0,t.window[t.strstart-1]),i&&Tt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return dt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=ti(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<ue-1?t.strstart:ue-1,e===Ut?(Tt(t,!0),t.strm.avail_out===0?Yi:ta):t.sym_next&&(Tt(t,!1),t.strm.avail_out===0)?dt:ea},Pv=(t,e)=>{let r,i,n,a,o=t.window;for(;;){if(t.lookahead<=Jr){if(Wn(t),t.lookahead<=Jr&&e===ri)return dt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=ue&&t.strstart>0&&(n=t.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){a=t.strstart+Jr;do;while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&n<a);t.match_length=Jr-(a-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ue?(r=ti(t,1,t.match_length-ue),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=ti(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Tt(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Ut?(Tt(t,!0),t.strm.avail_out===0?Yi:ta):t.sym_next&&(Tt(t,!1),t.strm.avail_out===0)?dt:ea},$v=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(Wn(t),t.lookahead===0)){if(e===ri)return dt;break}if(t.match_length=0,r=ti(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Tt(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Ut?(Tt(t,!0),t.strm.avail_out===0?Yi:ta):t.sym_next&&(Tt(t,!1),t.strm.avail_out===0)?dt:ea};function rr(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}var Ha=[new rr(0,0,0,0,q1),new rr(4,4,8,4,pl),new rr(4,5,16,8,pl),new rr(4,6,32,32,pl),new rr(4,4,16,16,$n),new rr(8,16,32,32,$n),new rr(8,16,128,128,$n),new rr(8,32,128,256,$n),new rr(32,128,258,1024,$n),new rr(32,258,258,4096,$n)],Lv=t=>{t.window_size=2*t.w_size,Zr(t.head),t.max_lazy_match=Ha[t.level].max_lazy,t.good_match=Ha[t.level].good_length,t.nice_match=Ha[t.level].nice_length,t.max_chain_length=Ha[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ue-1,t.match_available=0,t.ins_h=0};function Fv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=vc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Tv*2),this.dyn_dtree=new Uint16Array((2*Av+1)*2),this.bl_tree=new Uint16Array((2*kv+1)*2),Zr(this.dyn_ltree),Zr(this.dyn_dtree),Zr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Iv+1),this.heap=new Uint16Array(2*Fl+1),Zr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Fl+1),Zr(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var bo=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==zn&&e.status!==ip&&e.status!==Ml&&e.status!==Ul&&e.status!==jl&&e.status!==ql&&e.status!==Bi&&e.status!==Wa?1:0},B1=t=>{if(bo(t))return Vi(t,lr);t.total_in=t.total_out=0,t.data_type=_v;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?ip:e.wrap?zn:Bi,t.adler=e.wrap===2?0:1,e.last_flush=-2,uv(e),rt},V1=t=>{let e=B1(t);return e===rt&&Lv(t.state),e},Mv=(t,e)=>bo(t)||t.state.wrap!==2?lr:(t.state.gzhead=e,rt),Q1=(t,e,r,i,n,a)=>{if(!t)return lr;let o=1;if(e===mv&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),n<1||n>Sv||r!==vc||i<8||i>15||e<0||e>9||a<0||a>vv||i===8&&o!==1)return Vi(t,lr);i===8&&(i=9);let s=new Fv;return t.state=s,s.strm=t,s.status=zn,s.wrap=o,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=n+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+ue-1)/ue),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<n+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,V1(t)},Uv=(t,e)=>Q1(t,e,vc,wv,Cv,bv),jv=(t,e)=>{if(bo(t)||e>ph||e<0)return t?Vi(t,lr):lr;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===Wa&&e!==Ut)return Vi(t,t.avail_out===0?ll:lr);let i=r.last_flush;if(r.last_flush=e,r.pending!==0){if(At(t),t.avail_out===0)return r.last_flush=-1,rt}else if(t.avail_in===0&&dh(e)<=dh(i)&&e!==Ut)return Vi(t,ll);if(r.status===Wa&&t.avail_in!==0)return Vi(t,ll);if(r.status===zn&&r.wrap===0&&(r.status=Bi),r.status===zn){let n=vc+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=ws||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,n|=a<<6,r.strstart!==0&&(n|=Ov),n+=31-n%31,Da(r,n),r.strstart!==0&&(Da(r,t.adler>>>16),Da(r,t.adler&65535)),t.adler=1,r.status=Bi,At(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===ip){if(t.adler=0,ve(r,31),ve(r,139),ve(r,8),r.gzhead)ve(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ve(r,r.gzhead.time&255),ve(r,r.gzhead.time>>8&255),ve(r,r.gzhead.time>>16&255),ve(r,r.gzhead.time>>24&255),ve(r,r.level===9?2:r.strategy>=ws||r.level<2?4:0),ve(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ve(r,r.gzhead.extra.length&255),ve(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Ge(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Ml;else if(ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,r.level===9?2:r.strategy>=ws||r.level<2?4:0),ve(r,Dv),r.status=Bi,At(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===Ml){if(r.gzhead.extra){let n=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex+=s,At(t),r.pending!==0)return r.last_flush=-1,rt;n=0,a-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=Ul}if(r.status===Ul){if(r.gzhead.name){let n=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),At(t),r.pending!==0)return r.last_flush=-1,rt;n=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,ve(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=jl}if(r.status===jl){if(r.gzhead.comment){let n=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),At(t),r.pending!==0)return r.last_flush=-1,rt;n=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,ve(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n))}r.status=ql}if(r.status===ql){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(At(t),r.pending!==0))return r.last_flush=-1,rt;ve(r,t.adler&255),ve(r,t.adler>>8&255),t.adler=0}if(r.status=Bi,At(t),r.pending!==0)return r.last_flush=-1,rt}if(t.avail_in!==0||r.lookahead!==0||e!==ri&&r.status!==Wa){let n=r.level===0?q1(r,e):r.strategy===ws?$v(r,e):r.strategy===yv?Pv(r,e):Ha[r.level].func(r,e);if((n===Yi||n===ta)&&(r.status=Wa),n===dt||n===Yi)return t.avail_out===0&&(r.last_flush=-1),rt;if(n===ea&&(e===fv?pv(r):e!==ph&&(Ll(r,0,0,!1),e===dv&&(Zr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),At(t),t.avail_out===0))return r.last_flush=-1,rt}return e!==Ut?rt:r.wrap<=0?fh:(r.wrap===2?(ve(r,t.adler&255),ve(r,t.adler>>8&255),ve(r,t.adler>>16&255),ve(r,t.adler>>24&255),ve(r,t.total_in&255),ve(r,t.total_in>>8&255),ve(r,t.total_in>>16&255),ve(r,t.total_in>>24&255)):(Da(r,t.adler>>>16),Da(r,t.adler&65535)),At(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?rt:fh)},qv=t=>{if(bo(t))return lr;let e=t.state.status;return t.state=null,e===Bi?Vi(t,hv):rt},Bv=(t,e)=>{let r=e.length;if(bo(t))return lr;let i=t.state,n=i.wrap;if(n===2||n===1&&i.status!==zn||i.lookahead)return lr;if(n===1&&(t.adler=uo(t.adler,e,r,0)),i.wrap=0,r>=i.w_size){n===0&&(Zr(i.head),i.strstart=0,i.block_start=0,i.insert=0);let u=new Uint8Array(i.w_size);u.set(e.subarray(r-i.w_size,r),0),e=u,r=i.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Wn(i);i.lookahead>=ue;){let u=i.strstart,c=i.lookahead-(ue-1);do i.ins_h=ii(i,i.ins_h,i.window[u+ue-1]),i.prev[u&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=u,u++;while(--c);i.strstart=u,i.lookahead=ue-1,Wn(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=ue-1,i.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,i.wrap=n,rt},Vv=Uv,Qv=Q1,zv=V1,Wv=B1,Hv=Mv,Gv=jv,Kv=qv,Zv=Bv,Jv="pako deflate (from Nodeca project)",Xa={deflateInit:Vv,deflateInit2:Qv,deflateReset:zv,deflateResetKeep:Wv,deflateSetHeader:Hv,deflate:Gv,deflateEnd:Kv,deflateSetDictionary:Zv,deflateInfo:Jv},Yv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Xv=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let i in r)Yv(r,i)&&(t[i]=r[i])}}return t},e2=t=>{let e=0;for(let i=0,n=t.length;i<n;i++)e+=t[i].length;let r=new Uint8Array(e);for(let i=0,n=0,a=t.length;i<a;i++){let o=t[i];r.set(o,n),n+=o.length}return r},bc={assign:Xv,flattenChunks:e2},z1=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){z1=!1}var lo=new Uint8Array(256);for(let t=0;t<256;t++)lo[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;lo[254]=lo[254]=1;var t2=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,i,n,a,o=t.length,s=0;for(n=0;n<o;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<o&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,n=0;a<s;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<o&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e},r2=(t,e)=>{if(e<65534&&t.subarray&&z1)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let i=0;i<e;i++)r+=String.fromCharCode(t[i]);return r},i2=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let i,n,a=new Array(r*2);for(n=0,i=0;i<r;){let o=t[i++];if(o<128){a[n++]=o;continue}let s=lo[o];if(s>4){a[n++]=65533,i+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&i<r;)o=o<<6|t[i++]&63,s--;if(s>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return r2(a,n)},n2=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+lo[t[r]]>e?r:e},po={string2buf:t2,buf2string:i2,utf8border:n2};function a2(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var W1=a2,H1=Object.prototype.toString,{Z_NO_FLUSH:o2,Z_SYNC_FLUSH:s2,Z_FULL_FLUSH:c2,Z_FINISH:u2,Z_OK:oc,Z_STREAM_END:l2,Z_DEFAULT_COMPRESSION:p2,Z_DEFAULT_STRATEGY:f2,Z_DEFLATED:d2}=sn;function _o(t){this.options=bc.assign({level:p2,method:d2,chunkSize:16384,windowBits:15,memLevel:8,strategy:f2},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W1,this.strm.avail_out=0;let r=Xa.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==oc)throw new Error(Ji[r]);if(e.header&&Xa.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=po.string2buf(e.dictionary):H1.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=Xa.deflateSetDictionary(this.strm,i),r!==oc)throw new Error(Ji[r]);this._dict_set=!0}}_o.prototype.push=function(t,e){let r=this.strm,i=this.options.chunkSize,n,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?u2:o2,typeof t=="string"?r.input=po.string2buf(t):H1.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(a===s2||a===c2)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(n=Xa.deflate(r,a),n===l2)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),n=Xa.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===oc;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};_o.prototype.onData=function(t){this.chunks.push(t)};_o.prototype.onEnd=function(t){t===oc&&(this.result=bc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function np(t,e){let r=new _o(e);if(r.push(t,!0),r.err)throw r.msg||Ji[r.err];return r.result}function h2(t,e){return e=e||{},e.raw=!0,np(t,e)}function m2(t,e){return e=e||{},e.gzip=!0,np(t,e)}var g2=_o,y2=np,v2=h2,b2=m2,_2=sn,S2={Deflate:g2,deflate:y2,deflateRaw:v2,gzip:b2,constants:_2},Cs=16209,w2=16191,C2=function t(e,r){let i,n,a,o,s,u,c,l,d,f,p,h,m,b,_,S,w,v,D,N,A,R,F,P,j=e.state;i=e.next_in,F=e.input,n=i+(e.avail_in-5),a=e.next_out,P=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=j.dmax,c=j.wsize,l=j.whave,d=j.wnext,f=j.window,p=j.hold,h=j.bits,m=j.lencode,b=j.distcode,_=(1<<j.lenbits)-1,S=(1<<j.distbits)-1;e:do{h<15&&(p+=F[i++]<<h,h+=8,p+=F[i++]<<h,h+=8),w=m[p&_];t:for(;;){if(v=w>>>24,p>>>=v,h-=v,v=w>>>16&255,v===0)P[a++]=w&65535;else if(v&16){D=w&65535,v&=15,v&&(h<v&&(p+=F[i++]<<h,h+=8),D+=p&(1<<v)-1,p>>>=v,h-=v),h<15&&(p+=F[i++]<<h,h+=8,p+=F[i++]<<h,h+=8),w=b[p&S];r:for(;;){if(v=w>>>24,p>>>=v,h-=v,v=w>>>16&255,v&16){if(N=w&65535,v&=15,h<v&&(p+=F[i++]<<h,h+=8,h<v&&(p+=F[i++]<<h,h+=8)),N+=p&(1<<v)-1,N>u){e.msg="invalid distance too far back",j.mode=Cs;break e}if(p>>>=v,h-=v,v=a-o,N>v){if(v=N-v,v>l&&j.sane){e.msg="invalid distance too far back",j.mode=Cs;break e}if(A=0,R=f,d===0){if(A+=c-v,v<D){D-=v;do P[a++]=f[A++];while(--v);A=a-N,R=P}}else if(d<v){if(A+=c+d-v,v-=d,v<D){D-=v;do P[a++]=f[A++];while(--v);if(A=0,d<D){v=d,D-=v;do P[a++]=f[A++];while(--v);A=a-N,R=P}}}else if(A+=d-v,v<D){D-=v;do P[a++]=f[A++];while(--v);A=a-N,R=P}for(;D>2;)P[a++]=R[A++],P[a++]=R[A++],P[a++]=R[A++],D-=3;D&&(P[a++]=R[A++],D>1&&(P[a++]=R[A++]))}else{A=a-N;do P[a++]=P[A++],P[a++]=P[A++],P[a++]=P[A++],D-=3;while(D>2);D&&(P[a++]=P[A++],D>1&&(P[a++]=P[A++]))}}else if((v&64)===0){w=b[(w&65535)+(p&(1<<v)-1)];continue r}else{e.msg="invalid distance code",j.mode=Cs;break e}break}}else if((v&64)===0){w=m[(w&65535)+(p&(1<<v)-1)];continue t}else if(v&32){j.mode=w2;break e}else{e.msg="invalid literal/length code",j.mode=Cs;break e}break}}while(i<n&&a<s);D=h>>3,i-=D,h-=D<<3,p&=(1<<h)-1,e.next_in=i,e.next_out=a,e.avail_in=i<n?5+(n-i):5-(i-n),e.avail_out=a<s?257+(s-a):257-(a-s),j.hold=p,j.bits=h},Ln=15,hh=852,mh=592,gh=0,fl=1,yh=2,E2=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),x2=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),A2=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),k2=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),T2=(t,e,r,i,n,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,f=0,p=0,h=0,m=0,b=0,_=0,S=0,w,v,D,N,A,R=null,F,P=new Uint16Array(Ln+1),j=new Uint16Array(Ln+1),Je=null,je,H,we;for(c=0;c<=Ln;c++)P[c]=0;for(l=0;l<i;l++)P[e[r+l]]++;for(p=u,f=Ln;f>=1&&P[f]===0;f--);if(p>f&&(p=f),f===0)return n[a++]=1<<24|64<<16|0,n[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<f&&P[d]===0;d++);for(p<d&&(p=d),b=1,c=1;c<=Ln;c++)if(b<<=1,b-=P[c],b<0)return-1;if(b>0&&(t===gh||f!==1))return-1;for(j[1]=0,c=1;c<Ln;c++)j[c+1]=j[c]+P[c];for(l=0;l<i;l++)e[r+l]!==0&&(o[j[e[r+l]]++]=l);if(t===gh?(R=Je=o,F=20):t===fl?(R=E2,Je=x2,F=257):(R=A2,Je=k2,F=0),S=0,l=0,c=d,A=a,h=p,m=0,D=-1,_=1<<p,N=_-1,t===fl&&_>hh||t===yh&&_>mh)return 1;for(;;){je=c-m,o[l]+1<F?(H=0,we=o[l]):o[l]>=F?(H=Je[o[l]-F],we=R[o[l]-F]):(H=32+64,we=0),w=1<<c-m,v=1<<h,d=v;do v-=w,n[A+(S>>m)+v]=je<<24|H<<16|we|0;while(v!==0);for(w=1<<c-1;S&w;)w>>=1;if(w!==0?(S&=w-1,S+=w):S=0,l++,--P[c]===0){if(c===f)break;c=e[r+o[l]]}if(c>p&&(S&N)!==D){for(m===0&&(m=p),A+=d,h=c-m,b=1<<h;h+m<f&&(b-=P[h+m],!(b<=0));)h++,b<<=1;if(_+=1<<h,t===fl&&_>hh||t===yh&&_>mh)return 1;D=S&N,n[D]=p<<24|h<<16|A-a|0}}return S!==0&&(n[A+S]=c-m<<24|64<<16|0),s.bits=p,0},eo=T2,I2=0,G1=1,K1=2,{Z_FINISH:vh,Z_BLOCK:O2,Z_TREES:Es,Z_OK:Xi,Z_STREAM_END:D2,Z_NEED_DICT:N2,Z_STREAM_ERROR:jt,Z_DATA_ERROR:Z1,Z_MEM_ERROR:J1,Z_BUF_ERROR:R2,Z_DEFLATED:bh}=sn,_c=16180,_h=16181,Sh=16182,wh=16183,Ch=16184,Eh=16185,xh=16186,Ah=16187,kh=16188,Th=16189,sc=16190,Sr=16191,dl=16192,Ih=16193,hl=16194,Oh=16195,Dh=16196,Nh=16197,Rh=16198,xs=16199,As=16200,Ph=16201,$h=16202,Lh=16203,Fh=16204,Mh=16205,ml=16206,Uh=16207,jh=16208,Te=16209,Y1=16210,X1=16211,P2=852,$2=592,L2=15,F2=L2,qh=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function M2(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var cn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<_c||e.mode>X1?1:0},em=t=>{if(cn(t))return jt;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=_c,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(P2),e.distcode=e.distdyn=new Int32Array($2),e.sane=1,e.back=-1,Xi},tm=t=>{if(cn(t))return jt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,em(t)},rm=(t,e)=>{let r;if(cn(t))return jt;let i=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?jt:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,tm(t))},im=(t,e)=>{if(!t)return jt;let r=new M2;t.state=r,r.strm=t,r.window=null,r.mode=_c;let i=rm(t,e);return i!==Xi&&(t.state=null),i},U2=t=>im(t,F2),Bh=!0,gl,yl,j2=t=>{if(Bh){gl=new Int32Array(512),yl=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(eo(G1,t.lens,0,288,gl,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;eo(K1,t.lens,0,32,yl,0,t.work,{bits:5}),Bh=!1}t.lencode=gl,t.lenbits=9,t.distcode=yl,t.distbits=5},nm=(t,e,r,i)=>{let n,a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>i&&(n=i),a.window.set(e.subarray(r-i,r-i+n),a.wnext),i-=n,i?(a.window.set(e.subarray(r-i,r),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0},q2=(t,e)=>{let r,i,n,a,o,s,u,c,l,d,f,p,h,m,b=0,_,S,w,v,D,N,A,R,F=new Uint8Array(4),P,j,Je=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(cn(t)||!t.output||!t.input&&t.avail_in!==0)return jt;r=t.state,r.mode===Sr&&(r.mode=dl),o=t.next_out,n=t.output,u=t.avail_out,a=t.next_in,i=t.input,s=t.avail_in,c=r.hold,l=r.bits,d=s,f=u,R=Xi;e:for(;;)switch(r.mode){case _c:if(r.wrap===0){r.mode=dl;break}for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0),c=0,l=0,r.mode=_h;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=Te;break}if((c&15)!==bh){t.msg="unknown compression method",r.mode=Te;break}if(c>>>=4,l-=4,A=(c&15)+8,r.wbits===0&&(r.wbits=A),A>15||A>r.wbits){t.msg="invalid window size",r.mode=Te;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?Th:Sr,c=0,l=0;break;case _h:for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==bh){t.msg="unknown compression method",r.mode=Te;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=Te;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0)),c=0,l=0,r.mode=Sh;case Sh:for(;l<32;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,F[2]=c>>>16&255,F[3]=c>>>24&255,r.check=Ge(r.check,F,4,0)),c=0,l=0,r.mode=wh;case wh:for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0)),c=0,l=0,r.mode=Ch;case Ch:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Eh;case Eh:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(r.head&&(A=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(i.subarray(a,a+p),A)),r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,i,p,a)),s-=p,a+=p,r.length-=p),r.length))break e;r.length=0,r.mode=xh;case xh:if(r.flags&2048){if(s===0)break e;p=0;do A=i[a+p++],r.head&&A&&r.length<65536&&(r.head.name+=String.fromCharCode(A));while(A&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,i,p,a)),s-=p,a+=p,A)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Ah;case Ah:if(r.flags&4096){if(s===0)break e;p=0;do A=i[a+p++],r.head&&A&&r.length<65536&&(r.head.comment+=String.fromCharCode(A));while(A&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,i,p,a)),s-=p,a+=p,A)break e}else r.head&&(r.head.comment=null);r.mode=kh;case kh:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=Te;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Sr;break;case Th:for(;l<32;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}t.adler=r.check=qh(c),c=0,l=0,r.mode=sc;case sc:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,N2;t.adler=r.check=1,r.mode=Sr;case Sr:if(e===O2||e===Es)break e;case dl:if(r.last){c>>>=l&7,l-=l&7,r.mode=ml;break}for(;l<3;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=Ih;break;case 1:if(j2(r),r.mode=xs,e===Es){c>>>=2,l-=2;break e}break;case 2:r.mode=Dh;break;case 3:t.msg="invalid block type",r.mode=Te}c>>>=2,l-=2;break;case Ih:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=Te;break}if(r.length=c&65535,c=0,l=0,r.mode=hl,e===Es)break e;case hl:r.mode=Oh;case Oh:if(p=r.length,p){if(p>s&&(p=s),p>u&&(p=u),p===0)break e;n.set(i.subarray(a,a+p),o),s-=p,a+=p,u-=p,o+=p,r.length-=p;break}r.mode=Sr;break;case Dh:for(;l<14;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Te;break}r.have=0,r.mode=Nh;case Nh:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.lens[Je[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[Je[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},R=eo(I2,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,R){t.msg="invalid code lengths set",r.mode=Te;break}r.have=0,r.mode=Rh;case Rh:for(;r.have<r.nlen+r.ndist;){for(;b=r.lencode[c&(1<<r.lenbits)-1],_=b>>>24,S=b>>>16&255,w=b&65535,!(_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(w<16)c>>>=_,l-=_,r.lens[r.have++]=w;else{if(w===16){for(j=_+2;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(c>>>=_,l-=_,r.have===0){t.msg="invalid bit length repeat",r.mode=Te;break}A=r.lens[r.have-1],p=3+(c&3),c>>>=2,l-=2}else if(w===17){for(j=_+3;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}c>>>=_,l-=_,A=0,p=3+(c&7),c>>>=3,l-=3}else{for(j=_+7;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}c>>>=_,l-=_,A=0,p=11+(c&127),c>>>=7,l-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Te;break}for(;p--;)r.lens[r.have++]=A}}if(r.mode===Te)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=Te;break}if(r.lenbits=9,P={bits:r.lenbits},R=eo(G1,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,R){t.msg="invalid literal/lengths set",r.mode=Te;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},R=eo(K1,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,R){t.msg="invalid distances set",r.mode=Te;break}if(r.mode=xs,e===Es)break e;case xs:r.mode=As;case As:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,C2(t,f),o=t.next_out,n=t.output,u=t.avail_out,a=t.next_in,i=t.input,s=t.avail_in,c=r.hold,l=r.bits,r.mode===Sr&&(r.back=-1);break}for(r.back=0;b=r.lencode[c&(1<<r.lenbits)-1],_=b>>>24,S=b>>>16&255,w=b&65535,!(_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(S&&(S&240)===0){for(v=_,D=S,N=w;b=r.lencode[N+((c&(1<<v+D)-1)>>v)],_=b>>>24,S=b>>>16&255,w=b&65535,!(v+_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}c>>>=v,l-=v,r.back+=v}if(c>>>=_,l-=_,r.back+=_,r.length=w,S===0){r.mode=Mh;break}if(S&32){r.back=-1,r.mode=Sr;break}if(S&64){t.msg="invalid literal/length code",r.mode=Te;break}r.extra=S&15,r.mode=Ph;case Ph:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=$h;case $h:for(;b=r.distcode[c&(1<<r.distbits)-1],_=b>>>24,S=b>>>16&255,w=b&65535,!(_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if((S&240)===0){for(v=_,D=S,N=w;b=r.distcode[N+((c&(1<<v+D)-1)>>v)],_=b>>>24,S=b>>>16&255,w=b&65535,!(v+_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}c>>>=v,l-=v,r.back+=v}if(c>>>=_,l-=_,r.back+=_,S&64){t.msg="invalid distance code",r.mode=Te;break}r.offset=w,r.extra=S&15,r.mode=Lh;case Lh:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Te;break}r.mode=Fh;case Fh:if(u===0)break e;if(p=f-u,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Te;break}p>r.wnext?(p-=r.wnext,h=r.wsize-p):h=r.wnext-p,p>r.length&&(p=r.length),m=r.window}else m=n,h=o-r.offset,p=r.length;p>u&&(p=u),u-=p,r.length-=p;do n[o++]=m[h++];while(--p);r.length===0&&(r.mode=As);break;case Mh:if(u===0)break e;n[o++]=r.length,u--,r.mode=As;break;case ml:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=i[a++]<<l,l+=8}if(f-=u,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?Ge(r.check,n,f,o-f):uo(r.check,n,f,o-f)),f=u,r.wrap&4&&(r.flags?c:qh(c))!==r.check){t.msg="incorrect data check",r.mode=Te;break}c=0,l=0}r.mode=Uh;case Uh:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=Te;break}c=0,l=0}r.mode=jh;case jh:R=D2;break e;case Te:R=Z1;break e;case Y1:return J1;case X1:default:return jt}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,(r.wsize||f!==t.avail_out&&r.mode<Te&&(r.mode<ml||e!==vh))&&nm(t,t.output,t.next_out,f-t.avail_out),d-=t.avail_in,f-=t.avail_out,t.total_in+=d,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?Ge(r.check,n,f,t.next_out-f):uo(r.check,n,f,t.next_out-f)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Sr?128:0)+(r.mode===xs||r.mode===hl?256:0),(d===0&&f===0||e===vh)&&R===Xi&&(R=R2),R},B2=t=>{if(cn(t))return jt;let e=t.state;return e.window&&(e.window=null),t.state=null,Xi},V2=(t,e)=>{if(cn(t))return jt;let r=t.state;return(r.wrap&2)===0?jt:(r.head=e,e.done=!1,Xi)},Q2=(t,e)=>{let r=e.length,i,n,a;return cn(t)||(i=t.state,i.wrap!==0&&i.mode!==sc)?jt:i.mode===sc&&(n=1,n=uo(n,e,r,0),n!==i.check)?Z1:(a=nm(t,e,r,r),a?(i.mode=Y1,J1):(i.havedict=1,Xi))},z2=tm,W2=rm,H2=em,G2=U2,K2=im,Z2=q2,J2=B2,Y2=V2,X2=Q2,e3="pako inflate (from Nodeca project)",Ar={inflateReset:z2,inflateReset2:W2,inflateResetKeep:H2,inflateInit:G2,inflateInit2:K2,inflate:Z2,inflateEnd:J2,inflateGetHeader:Y2,inflateSetDictionary:X2,inflateInfo:e3};function t3(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var r3=t3,am=Object.prototype.toString,{Z_NO_FLUSH:i3,Z_FINISH:n3,Z_OK:fo,Z_STREAM_END:vl,Z_NEED_DICT:bl,Z_STREAM_ERROR:a3,Z_DATA_ERROR:Vh,Z_MEM_ERROR:o3}=sn;function So(t){this.options=bc.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W1,this.strm.avail_out=0;let r=Ar.inflateInit2(this.strm,e.windowBits);if(r!==fo)throw new Error(Ji[r]);if(this.header=new r3,Ar.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=po.string2buf(e.dictionary):am.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Ar.inflateSetDictionary(this.strm,e.dictionary),r!==fo)))throw new Error(Ji[r])}So.prototype.push=function(t,e){let r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?n3:i3,am.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),a=Ar.inflate(r,o),a===bl&&n&&(a=Ar.inflateSetDictionary(r,n),a===fo?a=Ar.inflate(r,o):a===Vh&&(a=bl));r.avail_in>0&&a===vl&&r.state.wrap>0&&t[r.next_in]!==0;)Ar.inflateReset(r),a=Ar.inflate(r,o);switch(a){case a3:case Vh:case bl:case o3:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===vl))if(this.options.to==="string"){let u=po.utf8border(r.output,r.next_out),c=r.next_out-u,l=po.buf2string(r.output,u);r.next_out=c,r.avail_out=i-c,c&&r.output.set(r.output.subarray(u,u+c),0),this.onData(l)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===fo&&s===0)){if(a===vl)return a=Ar.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};So.prototype.onData=function(t){this.chunks.push(t)};So.prototype.onEnd=function(t){t===fo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=bc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function ap(t,e){let r=new So(e);if(r.push(t),r.err)throw r.msg||Ji[r.err];return r.result}function s3(t,e){return e=e||{},e.raw=!0,ap(t,e)}var c3=So,u3=ap,l3=s3,p3=ap,f3=sn,d3={Inflate:c3,inflate:u3,inflateRaw:l3,ungzip:p3,constants:f3},{Deflate:h3,deflate:m3,deflateRaw:g3,gzip:y3}=S2,{Inflate:v3,inflate:b3,inflateRaw:_3,ungzip:S3}=d3,w3=h3,C3=m3,E3=g3,x3=y3,A3=v3,k3=b3,T3=_3,I3=S3,O3=sn,D3={Deflate:w3,deflate:C3,deflateRaw:E3,gzip:x3,Inflate:A3,inflate:k3,inflateRaw:T3,ungzip:I3,constants:O3},xe=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Ae=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},cc=class{constructor(e,r){this.input=e,this.output=r}};xe([g(),Ae("design:type",String)],cc.prototype,"input",void 0);xe([g(),Ae("design:type",String)],cc.prototype,"output",void 0);cc=xe([Ze(),Ae("design:paramtypes",[String,String])],cc);var uc=class{constructor(e,r){this.input=e,this.output=r}};xe([g(),Ae("design:type",String)],uc.prototype,"input",void 0);xe([g(),Ae("design:type",String)],uc.prototype,"output",void 0);uc=xe([G(),Ae("design:paramtypes",[String,String])],uc);var si=class{constructor(e,r,i,n,a){this.name=e,this.modelId=r,this.systemPrompt=i,this.promptExamples=n,this.metaData=a}};xe([g(),Ae("design:type",String)],si.prototype,"name",void 0);xe([g(),Ae("design:type",String)],si.prototype,"modelId",void 0);xe([g(),Ae("design:type",String)],si.prototype,"systemPrompt",void 0);xe([g(),Ae("design:type",Array)],si.prototype,"promptExamples",void 0);xe([g(),Ae("design:type",String)],si.prototype,"metaData",void 0);si=xe([Ze(),Ae("design:paramtypes",[String,String,String,Array,String])],si);var hr=class{constructor(e,r,i,n,a,o,s,u){this.name=e,this.modelId=r,this.taskId=i,this.systemPrompt=n,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};xe([g(),Ae("design:type",String)],hr.prototype,"name",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"modelId",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"taskId",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"systemPrompt",void 0);xe([g(),Ae("design:type",Array)],hr.prototype,"promptExamples",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"metaData",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"createdAt",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"updatedAt",void 0);hr=xe([G(),Ae("design:paramtypes",[String,String,String,String,Array,String,String,String])],hr);var en=class{constructor(e,r,i,n,a){this.model=e,this.status=r,this.progress=i,this.downloaded=n,this.loaded=a}};xe([g(),Ae("design:type",String)],en.prototype,"model",void 0);xe([g(),Ae("design:type",String)],en.prototype,"status",void 0);xe([g(),Ae("design:type",Number)],en.prototype,"progress",void 0);xe([g(),Ae("design:type",Boolean)],en.prototype,"downloaded",void 0);xe([g(),Ae("design:type",Boolean)],en.prototype,"loaded",void 0);en=xe([G(),Ae("design:paramtypes",[String,String,Number,Boolean,Boolean])],en);var N3=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},ze=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},Ve,js,Vl=class{constructor(e,r=!0){Ve.set(this,void 0),js.set(this,new Map),N3(this,Ve,e,"f")}async getModels(){let e=await ze(this,Ve,"f").query({query:E`
744
745
  query {
745
746
  aiGetModels {
746
747
  id
@@ -900,7 +901,7 @@ triggerMatch
900
901
  mutation AiFeedTranscriptionStream($streamIds: [String!]!, $audio: [Float!]!) {
901
902
  aiFeedTranscriptionStream(streamIds: $streamIds, audio: $audio)
902
903
  }
903
- `,variables:{streamIds:Array.isArray(e)?e:[e],audio:r}}));return i}};Ve=new WeakMap,js=new WeakMap;var Hr=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Be=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},ar,qs,Ga,Bs,Ka,Mi,Vs,Za,ho=class{constructor(e,r=!0){ar.set(this,void 0),qs.set(this,void 0),Ga.set(this,void 0),Bs.set(this,void 0),Ka.set(this,void 0),Mi.set(this,void 0),Vs.set(this,void 0),Za.set(this,void 0),Hr(this,ar,e,"f"),Hr(this,qs,new no(Be(this,ar,"f"),r),"f"),Hr(this,Ga,new Rl(Be(this,ar,"f")),"f"),Hr(this,Bs,new Ol(Be(this,ar,"f")),"f"),Hr(this,Ka,new Dl(Be(this,ar,"f")),"f"),Hr(this,Za,new Vl(Be(this,ar,"f"),r),"f"),Hr(this,Mi,new nc(Be(this,ar,"f"),r),"f"),Be(this,Mi,"f").setExpressionClient(Be(this,Ga,"f")),Be(this,Mi,"f").setNeighbourhoodClient(Be(this,Ka,"f")),Be(this,Mi,"f").setAIClient(Be(this,Za,"f")),Hr(this,Vs,new Nl(Be(this,ar,"f"),r),"f")}get agent(){return Be(this,qs,"f")}get expression(){return Be(this,Ga,"f")}get languages(){return Be(this,Bs,"f")}get neighbourhood(){return Be(this,Ka,"f")}get perspective(){return Be(this,Mi,"f")}get runtime(){return Be(this,Vs,"f")}get ai(){return Be(this,Za,"f")}};ar=new WeakMap,qs=new WeakMap,Ga=new WeakMap,Bs=new WeakMap,Ka=new WeakMap,Mi=new WeakMap,Vs=new WeakMap,Za=new WeakMap;var Ql;(function(t){t.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",t.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",t.AgentIsUntrusted="AGENT_IS_UNTRUSTED",t.CapabilityRequested="CAPABILITY_REQUESTED",t.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(Ql||(Ql={}));var op=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},sp=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Qi=class{constructor(e,r){this.language=e,this.expression=r}};op([g(),sp("design:type",ur)],Qi.prototype,"language",void 0);op([g(),sp("design:type",String)],Qi.prototype,"expression",void 0);Qi=op([G(),sp("design:paramtypes",[ur,String])],Qi);function X8(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function e7(t){if(t.startsWith("literal://")){let a=new ur;a.address="literal",a.name="literal";let o=t.substring(10);return new Qi(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new ur;return s.address=a,new Qi(s,o)}let n=/^did:([^\s]+)$/.exec(t);if(n&&n.length==2){let a=new ur;return a.address="did",new Qi(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var Nt=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},mr=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},lc=class{};Nt([g(),mr("design:type",String)],lc.prototype,"name",void 0);Nt([g(),mr("design:type",String)],lc.prototype,"type",void 0);lc=Nt([G()],lc);var mo=class{};Nt([g(),mr("design:type",String)],mo.prototype,"label",void 0);Nt([g(),mr("design:type",String)],mo.prototype,"name",void 0);Nt([g(),mr("design:type",Array)],mo.prototype,"parameters",void 0);mo=Nt([G()],mo);var pc=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};Nt([g(),mr("design:type",String)],pc.prototype,"name",void 0);Nt([g(),mr("design:type",String)],pc.prototype,"parametersStringified",void 0);pc=Nt([Ze(),mr("design:paramtypes",[String,Object])],pc);var fc=class{};Nt([g(),mr("design:type",String)],fc.prototype,"did",void 0);Nt([g(),mr("design:type",Ki)],fc.prototype,"status",void 0);fc=Nt([G()],fc);var Qh=class{},cn=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},ra=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ci=class{};cn([g(),ra("design:type",String)],ci.prototype,"name",void 0);cn([g(),ra("design:type",String)],ci.prototype,"address",void 0);cn([g(),ra("design:type",String)],ci.prototype,"settings",void 0);cn([g(),ra("design:type",Wi)],ci.prototype,"icon",void 0);cn([g(),ra("design:type",Wi)],ci.prototype,"constructorIcon",void 0);cn([g(),ra("design:type",Wi)],ci.prototype,"settingsIcon",void 0);ci=cn([G()],ci);var ht=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Ct=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Gt=class{};ht([g(),Ct("design:type",String)],Gt.prototype,"name",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"address",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"description",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"author",void 0);ht([g(),Ct("design:type",Boolean)],Gt.prototype,"templated",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"templateSourceLanguageAddress",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"templateAppliedParams",void 0);ht([g(),Ct("design:type",Array)],Gt.prototype,"possibleTemplateParams",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"sourceCodeLink",void 0);Gt=ht([G()],Gt);var Wn=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};ht([g(),Ct("design:type",String)],Wn.prototype,"name",void 0);ht([g(),Ct("design:type",String)],Wn.prototype,"description",void 0);ht([g(),Ct("design:type",Array)],Wn.prototype,"possibleTemplateParams",void 0);ht([g(),Ct("design:type",String)],Wn.prototype,"sourceCodeLink",void 0);Wn=ht([Ze(),Ct("design:paramtypes",[String,String])],Wn);var zh=class{},Wh=class extends pi(){},Hh=class{},Sc=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},cp=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},dc=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};Sc([g(),cp("design:type",String)],dc.prototype,"linkLanguage",void 0);Sc([g(),cp("design:type",fr)],dc.prototype,"meta",void 0);dc=Sc([G(),cp("design:paramtypes",[String,fr])],dc);var zl=class extends pi(){};zl=Sc([G()],zl);var un=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},ln=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Wl;(function(t){t.Private="PRIVATE",t.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",t.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",t.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",t.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",t.Synced="SYNCED"})(Wl||(Wl={}));var ui=class{constructor(e,r,i){this.uuid=e,this.name=r,i?this.state=i:this.state=Wl.Private}};un([g(),ln("design:type",String)],ui.prototype,"uuid",void 0);un([g(),ln("design:type",String)],ui.prototype,"name",void 0);un([g(),ln("design:type",String)],ui.prototype,"state",void 0);un([g(),ln("design:type",String)],ui.prototype,"sharedUrl",void 0);un([g(),ln("design:type",zl)],ui.prototype,"neighbourhood",void 0);un([g(),ln("design:type",Array)],ui.prototype,"owners",void 0);ui=un([G(),ln("design:paramtypes",[String,String,String])],ui);var wc=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},om=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},hc=class{};wc([g(),om("design:type",Array)],hc.prototype,"additions",void 0);wc([g(),om("design:type",Array)],hc.prototype,"removals",void 0);hc=wc([G()],hc);var Gh=class extends pi(){};Gh=wc([G()],Gh);var Kh=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Ln=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},Ja,Ui,ks="smart_literal://content";function R3(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=r.length;for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*i));return e}var go=class{constructor(e,r){Ja.set(this,void 0),Ui.set(this,void 0),Kh(this,Ja,e,"f"),Kh(this,Ui,r,"f")}get base(){return Ln(this,Ui,"f")}static async create(e,r){let i=wt.from(R3(10)).toUrl(),n=new go(e,i);return await n.set(r),n}static async isSmartLiteralBase(e,r){return(await e.get(new ot({source:r,predicate:ks}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new ot({predicate:ks}))).map(i=>new go(e,i.data.source))}async get(){let e=await Ln(this,Ja,"f").getSingleTarget(new ot({source:Ln(this,Ui,"f"),predicate:ks}));if(!e)throw`No content for smart literal ${Ln(this,Ui,"f")}`;return wt.fromUrl(e).get()}async set(e){let r=wt.from(e);await Ln(this,Ja,"f").setSingleTarget(new Gi({source:Ln(this,Ui,"f"),predicate:ks,target:r.toUrl()}))}};Ja=new WeakMap,Ui=new WeakMap;var Zh=class{};function d7(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function h7(t){return`triple(this, "${t}", _)`}function m7(t){return function(e,r,i){if(typeof i.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");i.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let d=t.where[l];u+=`, property_getter(C, Instance, "${l}", "${d}")`}t&&t.condition&&(u+=", "+t.condition);let c=await a.infer(u);if(c==!1)return o;if(typeof c=="string")throw c;for(let l of c){let d=l.Instance,f=new rc(a,d,s);await f.init(),o.push(f)}return o}}}function sm(t){return function(e,r){if(typeof t.writable>"u"&&t.through&&(t.writable=!0),t.required&&!t.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!t.through&&!t.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],...t},t.writable){let i=r;e[`set${ei(i)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function g7(t){return function(e,r){if(!t.through&&!t.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!t.through)throw new Error("SubjectFlag requires a 'through' option");if(!t.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],through:t.through,required:!0,initial:t.value,flag:!0},e[r]=t.value,Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function y7(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let i=r;e[`add${ei(i)}`]=()=>{},e[`remove${ei(i)}`]=()=>{},e[`setCollection${ei(i)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function cm(t){let e="",r="abcdefghijklmnopqrstuvwxyz",i=r.length;for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*i));return e}function P3(t){return function(e){e.prototype.className=t.name,e.className=t.name,e.generateSDNA=function(){let r="",i=t.name,n=e.prototype,a=cm(8);r+=`subject_class("${i}", ${a}).
904
+ `,variables:{streamIds:Array.isArray(e)?e:[e],audio:r}}));return i}};Ve=new WeakMap,js=new WeakMap;var Hr=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Be=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},ar,qs,Ga,Bs,Ka,Mi,Vs,Za,ho=class{constructor(e,r=!0){ar.set(this,void 0),qs.set(this,void 0),Ga.set(this,void 0),Bs.set(this,void 0),Ka.set(this,void 0),Mi.set(this,void 0),Vs.set(this,void 0),Za.set(this,void 0),Hr(this,ar,e,"f"),Hr(this,qs,new no(Be(this,ar,"f"),r),"f"),Hr(this,Ga,new Rl(Be(this,ar,"f")),"f"),Hr(this,Bs,new Ol(Be(this,ar,"f")),"f"),Hr(this,Ka,new Dl(Be(this,ar,"f")),"f"),Hr(this,Za,new Vl(Be(this,ar,"f"),r),"f"),Hr(this,Mi,new nc(Be(this,ar,"f"),r),"f"),Be(this,Mi,"f").setExpressionClient(Be(this,Ga,"f")),Be(this,Mi,"f").setNeighbourhoodClient(Be(this,Ka,"f")),Be(this,Mi,"f").setAIClient(Be(this,Za,"f")),Hr(this,Vs,new Nl(Be(this,ar,"f"),r),"f")}get agent(){return Be(this,qs,"f")}get expression(){return Be(this,Ga,"f")}get languages(){return Be(this,Bs,"f")}get neighbourhood(){return Be(this,Ka,"f")}get perspective(){return Be(this,Mi,"f")}get runtime(){return Be(this,Vs,"f")}get ai(){return Be(this,Za,"f")}};ar=new WeakMap,qs=new WeakMap,Ga=new WeakMap,Bs=new WeakMap,Ka=new WeakMap,Mi=new WeakMap,Vs=new WeakMap,Za=new WeakMap;var Ql;(function(t){t.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",t.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",t.AgentIsUntrusted="AGENT_IS_UNTRUSTED",t.CapabilityRequested="CAPABILITY_REQUESTED",t.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(Ql||(Ql={}));var op=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},sp=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Qi=class{constructor(e,r){this.language=e,this.expression=r}};op([g(),sp("design:type",ur)],Qi.prototype,"language",void 0);op([g(),sp("design:type",String)],Qi.prototype,"expression",void 0);Qi=op([G(),sp("design:paramtypes",[ur,String])],Qi);function X8(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function e7(t){if(t.startsWith("literal://")){let a=new ur;a.address="literal",a.name="literal";let o=t.substring(10);return new Qi(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new ur;return s.address=a,new Qi(s,o)}let n=/^did:([^\s]+)$/.exec(t);if(n&&n.length==2){let a=new ur;return a.address="did",new Qi(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var Nt=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},mr=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},lc=class{};Nt([g(),mr("design:type",String)],lc.prototype,"name",void 0);Nt([g(),mr("design:type",String)],lc.prototype,"type",void 0);lc=Nt([G()],lc);var mo=class{};Nt([g(),mr("design:type",String)],mo.prototype,"label",void 0);Nt([g(),mr("design:type",String)],mo.prototype,"name",void 0);Nt([g(),mr("design:type",Array)],mo.prototype,"parameters",void 0);mo=Nt([G()],mo);var pc=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};Nt([g(),mr("design:type",String)],pc.prototype,"name",void 0);Nt([g(),mr("design:type",String)],pc.prototype,"parametersStringified",void 0);pc=Nt([Ze(),mr("design:paramtypes",[String,Object])],pc);var fc=class{};Nt([g(),mr("design:type",String)],fc.prototype,"did",void 0);Nt([g(),mr("design:type",Ki)],fc.prototype,"status",void 0);fc=Nt([G()],fc);var Qh=class{},un=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},ra=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ci=class{};un([g(),ra("design:type",String)],ci.prototype,"name",void 0);un([g(),ra("design:type",String)],ci.prototype,"address",void 0);un([g(),ra("design:type",String)],ci.prototype,"settings",void 0);un([g(),ra("design:type",Wi)],ci.prototype,"icon",void 0);un([g(),ra("design:type",Wi)],ci.prototype,"constructorIcon",void 0);un([g(),ra("design:type",Wi)],ci.prototype,"settingsIcon",void 0);ci=un([G()],ci);var ht=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Ct=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Gt=class{};ht([g(),Ct("design:type",String)],Gt.prototype,"name",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"address",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"description",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"author",void 0);ht([g(),Ct("design:type",Boolean)],Gt.prototype,"templated",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"templateSourceLanguageAddress",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"templateAppliedParams",void 0);ht([g(),Ct("design:type",Array)],Gt.prototype,"possibleTemplateParams",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"sourceCodeLink",void 0);Gt=ht([G()],Gt);var Hn=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};ht([g(),Ct("design:type",String)],Hn.prototype,"name",void 0);ht([g(),Ct("design:type",String)],Hn.prototype,"description",void 0);ht([g(),Ct("design:type",Array)],Hn.prototype,"possibleTemplateParams",void 0);ht([g(),Ct("design:type",String)],Hn.prototype,"sourceCodeLink",void 0);Hn=ht([Ze(),Ct("design:paramtypes",[String,String])],Hn);var zh=class{},Wh=class extends pi(){},Hh=class{},Sc=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},cp=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},dc=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};Sc([g(),cp("design:type",String)],dc.prototype,"linkLanguage",void 0);Sc([g(),cp("design:type",fr)],dc.prototype,"meta",void 0);dc=Sc([G(),cp("design:paramtypes",[String,fr])],dc);var zl=class extends pi(){};zl=Sc([G()],zl);var ln=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},pn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Wl;(function(t){t.Private="PRIVATE",t.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",t.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",t.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",t.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",t.Synced="SYNCED"})(Wl||(Wl={}));var ui=class{constructor(e,r,i){this.uuid=e,this.name=r,i?this.state=i:this.state=Wl.Private}};ln([g(),pn("design:type",String)],ui.prototype,"uuid",void 0);ln([g(),pn("design:type",String)],ui.prototype,"name",void 0);ln([g(),pn("design:type",String)],ui.prototype,"state",void 0);ln([g(),pn("design:type",String)],ui.prototype,"sharedUrl",void 0);ln([g(),pn("design:type",zl)],ui.prototype,"neighbourhood",void 0);ln([g(),pn("design:type",Array)],ui.prototype,"owners",void 0);ui=ln([G(),pn("design:paramtypes",[String,String,String])],ui);var wc=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},om=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},hc=class{};wc([g(),om("design:type",Array)],hc.prototype,"additions",void 0);wc([g(),om("design:type",Array)],hc.prototype,"removals",void 0);hc=wc([G()],hc);var Gh=class extends pi(){};Gh=wc([G()],Gh);var Kh=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Fn=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},Ja,Ui,ks="smart_literal://content";function R3(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=r.length;for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*i));return e}var go=class{constructor(e,r){Ja.set(this,void 0),Ui.set(this,void 0),Kh(this,Ja,e,"f"),Kh(this,Ui,r,"f")}get base(){return Fn(this,Ui,"f")}static async create(e,r){let i=wt.from(R3(10)).toUrl(),n=new go(e,i);return await n.set(r),n}static async isSmartLiteralBase(e,r){return(await e.get(new ot({source:r,predicate:ks}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new ot({predicate:ks}))).map(i=>new go(e,i.data.source))}async get(){let e=await Fn(this,Ja,"f").getSingleTarget(new ot({source:Fn(this,Ui,"f"),predicate:ks}));if(!e)throw`No content for smart literal ${Fn(this,Ui,"f")}`;return wt.fromUrl(e).get()}async set(e){let r=wt.from(e);await Fn(this,Ja,"f").setSingleTarget(new Gi({source:Fn(this,Ui,"f"),predicate:ks,target:r.toUrl()}))}};Ja=new WeakMap,Ui=new WeakMap;var Zh=class{};function d7(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function h7(t){return`triple(this, "${t}", _)`}function m7(t){return function(e,r,i){if(typeof i.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");i.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let d=t.where[l];u+=`, property_getter(C, Instance, "${l}", "${d}")`}t&&t.condition&&(u+=", "+t.condition);let c=await a.infer(u);if(c==!1)return o;if(typeof c=="string")throw c;for(let l of c){let d=l.Instance,f=new rc(a,d,s);await f.init(),o.push(f)}return o}}}function sm(t){return function(e,r){if(typeof t.writable>"u"&&t.through&&(t.writable=!0),t.required&&!t.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!t.through&&!t.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],...t},t.writable){let i=r;e[`set${ei(i)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function g7(t){return function(e,r){if(!t.through&&!t.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!t.through)throw new Error("SubjectFlag requires a 'through' option");if(!t.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],through:t.through,required:!0,initial:t.value,flag:!0},e[r]=t.value,Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function y7(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let i=r;e[`add${ei(i)}`]=()=>{},e[`remove${ei(i)}`]=()=>{},e[`setCollection${ei(i)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function cm(t){let e="",r="abcdefghijklmnopqrstuvwxyz",i=r.length;for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*i));return e}function P3(t){return function(e){e.prototype.className=t.name,e.className=t.name,e.generateSDNA=function(){let r="",i=t.name,n=e.prototype,a=cm(8);r+=`subject_class("${i}", ${a}).
904
905
  `;let o=[],s=[];n.subjectConstructor&&n.subjectConstructor.length&&(s=s.concat(n.subjectConstructor));let u=[];n.isSubjectInstance&&n.isSubjectInstance.length&&(u=u.concat(n.isSubjectInstance));let c=[],l=n.__properties||{};for(let h in l){let m=`property(${a}, "${h}").
905
906
  `,{through:b,initial:_,required:S,resolveLanguage:w,writable:v,flag:D,getter:N,setter:A,local:R}=l[h];if(w&&(m+=`property_resolve(${a}, "${h}").
906
907
  `,m+=`property_resolve_language(${a}, "${h}", "${w}").
@@ -1495,6 +1496,7 @@ type UserStatistics {
1495
1496
  }
1496
1497
 
1497
1498
  type VerificationRequestResult {
1499
+ isExistingUser: Boolean!
1498
1500
  message: String!
1499
1501
  requiresPassword: Boolean!
1500
1502
  success: Boolean!
@@ -1507,7 +1509,7 @@ input VoiceActivityParamsInput {
1507
1509
  startWindow: Float
1508
1510
  timeBeforeSpeech: Float
1509
1511
  }
1510
- `;function Jh(t){return t?.length?t.length===1?t.toString():t.length===2?t.join(" and "):t.slice(0,-1).join(", ")+", and "+t.slice(-1):""}function um(t){let e=t.can.includes("*")?["READ","WRITE","UPDATE"]:t.can,r=t.with.domain==="*"?"":t.with.domain,i=t.with.pointers.includes("*")?["all AD4M data"]:t.with.pointers;return`${Jh(e)} your ${r} actions, with access to ${Jh(i)}`}var O=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},y=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},X=function(t,e){return function(r,i){e(r,i,t)}},wo=new ni;wo.author="did:ad4m:test";wo.timestamp=Date.now();wo.data={source:"root",target:"neighbourhood://Qm12345"};wo.proof={signature:"",key:"",valid:!0};var Yr=new Ki;Yr.author="did:ad4m:test";Yr.timestamp=Date.now().toString();Yr.proof=new Tr("","");Yr.data=new fr([wo]);var mc=class{};O([g(),y("design:type",String)],mc.prototype,"recipient",void 0);O([g(),y("design:type",Ki)],mc.prototype,"message",void 0);mc=O([G()],mc);var Hn=class{};O([g(),y("design:type",String)],Hn.prototype,"ad4mExecutorVersion",void 0);O([g(),y("design:type",Boolean)],Hn.prototype,"isInitialized",void 0);O([g(),y("design:type",Boolean)],Hn.prototype,"isUnlocked",void 0);Hn=O([G()],Hn);var tn=class{};O([g(),y("design:type",String)],tn.prototype,"title",void 0);O([g(),y("design:type",String)],tn.prototype,"message",void 0);O([g(),y("design:type",String)],tn.prototype,"type",void 0);O([g(),y("design:type",String)],tn.prototype,"addon",void 0);tn=O([G()],tn);var qt=class{};O([g(),y("design:type",String)],qt.prototype,"description",void 0);O([g(),y("design:type",String)],qt.prototype,"appName",void 0);O([g(),y("design:type",String)],qt.prototype,"appUrl",void 0);O([g(),y("design:type",String)],qt.prototype,"appIconPath",void 0);O([g(),y("design:type",String)],qt.prototype,"trigger",void 0);O([g(),y("design:type",Array)],qt.prototype,"perspectiveIds",void 0);O([g(),y("design:type",String)],qt.prototype,"webhookUrl",void 0);O([g(),y("design:type",String)],qt.prototype,"webhookAuth",void 0);qt=O([Ze()],qt);var It=class{};O([g(),y("design:type",String)],It.prototype,"id",void 0);O([g(),y("design:type",Boolean)],It.prototype,"granted",void 0);O([g(),y("design:type",String)],It.prototype,"description",void 0);O([g(),y("design:type",String)],It.prototype,"appName",void 0);O([g(),y("design:type",String)],It.prototype,"appUrl",void 0);O([g(),y("design:type",String)],It.prototype,"appIconPath",void 0);O([g(),y("design:type",String)],It.prototype,"trigger",void 0);O([g(),y("design:type",Array)],It.prototype,"perspectiveIds",void 0);O([g(),y("design:type",String)],It.prototype,"webhookUrl",void 0);O([g(),y("design:type",String)],It.prototype,"webhookAuth",void 0);It=O([G()],It);var Gn=class{};O([g(),y("design:type",It)],Gn.prototype,"notification",void 0);O([g(),y("design:type",String)],Gn.prototype,"perspectiveId",void 0);O([g(),y("design:type",String)],Gn.prototype,"triggerMatch",void 0);Gn=O([G()],Gn);var Ke=class{};O([g(),y("design:type",Number)],Ke.prototype,"total",void 0);O([g(),y("design:type",Number)],Ke.prototype,"imported",void 0);O([g(),y("design:type",Number)],Ke.prototype,"failed",void 0);O([g(),y("design:type",Number)],Ke.prototype,"omitted",void 0);O([g(),y("design:type",Array)],Ke.prototype,"errors",void 0);Ke=O([G()],Ke);var Ot=class{};O([g(),y("design:type",Ke)],Ot.prototype,"perspectives",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"links",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"expressions",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"perspectiveDiffs",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"notifications",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"models",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"defaultModels",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"tasks",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"friends",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"trustedAgents",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"knownLinkLanguages",void 0);Ot=O([G()],Ot);var Kn=class{};O([g(),y("design:type",String)],Kn.prototype,"email",void 0);O([g(),y("design:type",String)],Kn.prototype,"did",void 0);O([g(),y("design:type",String)],Kn.prototype,"lastSeen",void 0);O([g(),y("design:type",Number)],Kn.prototype,"perspectiveCount",void 0);Kn=O([G()],Kn);var Zn=class{};O([g(),y("design:type",Boolean)],Zn.prototype,"success",void 0);O([g(),y("design:type",String)],Zn.prototype,"message",void 0);O([g(),y("design:type",Boolean)],Zn.prototype,"requiresPassword",void 0);Zn=O([G()],Zn);var V=class{runtimeQuit(){return!0}runtimeOpenLink(e){return!0}runtimeInfo(){return{ad4mExecutorVersion:"x.x.x",isInitialized:!0,isUnlocked:!0}}addTrustedAgents(e){return e}deleteTrustedAgents(e){return[]}getTrustedAgents(){return["agentPubKey"]}runtimeKnownLinkLanguageTemplates(){return["Qm12345abcdef"]}runtimeAddKnownLinkLanguageTemplates(e){return e}runtimeRemoveKnownLinkLanguageTemplates(e){return[]}runtimeFriends(){return["did:test:friend"]}runtimeAddFriends(e){return e}runtimeRemoveFriends(e){return[]}runtimeHcAgentInfos(){return JSON.stringify([{agent:{type:"Buffer",data:[9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186]},signature:{type:"Buffer",data:[195,143,170,36,234,123,255,85,188,138,124,2,91,18,53,231,44,41,240,8,80,131,100,150,165,125,146,90,17,200,190,129,114,211,11,146,150,128,198,199,79,118,157,101,194,68,58,245,98,182,79,139,140,41,143,129,8,136,87,77,180,231,218,11]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,101,83,52,86,112,54,109,118,80,48,122,116,85,101,104,114,117,113,89,52,102,66,53,101,69,98,121,48,69,66,100,89,84,50,95,67,48,69,112,77,111,76,111,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,104,189,50,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38]},signature:{type:"Buffer",data:[233,192,38,3,59,248,124,231,57,255,40,154,50,60,119,252,68,198,154,109,175,155,106,217,211,155,109,223,249,91,221,210,17,132,72,230,11,230,247,119,72,244,145,91,75,7,67,5,130,151,44,231,52,220,28,154,212,82,58,90,203,211,236,4]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,55,101,77,106,48,73,83,72,56,56,81,56,45,89,51,74,89,70,53,76,72,57,83,54,68,119,71,73,49,88,45,115,87,53,68,104,66,87,121,71,119,78,115,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,103,45,197,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109]},signature:{type:"Buffer",data:[88,189,229,122,44,171,194,156,90,79,148,49,207,224,34,199,219,88,24,243,103,127,123,41,87,171,127,92,6,216,198,171,26,226,237,217,122,78,98,146,55,255,68,240,202,83,58,140,147,185,3,66,15,216,210,22,99,197,73,234,120,17,74,1]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,114,70,71,83,100,113,104,101,68,107,70,70,56,69,102,109,45,69,116,55,119,81,101,120,83,88,55,65,112,69,51,89,86,99,45,120,102,52,104,106,77,115,77,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,23,220,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56]},signature:{type:"Buffer",data:[129,12,55,104,239,121,138,2,86,106,136,51,219,79,170,8,195,69,81,188,225,192,247,196,54,39,164,110,75,39,240,56,245,189,154,77,72,11,97,250,202,149,242,97,128,28,47,164,236,104,136,82,212,246,44,143,132,119,255,135,112,11,20,13]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56,164,117,114,108,115,145,217,97,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,104,121,112,115,86,121,103,117,80,84,115,53,118,73,80,65,102,97,112,90,88,113,117,84,115,79,80,100,67,81,79,79,117,103,57,51,82,103,106,95,114,85,73,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,54,53,46,50,50,46,51,50,46,49,49,47,112,47,53,55,55,57,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,188,123,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}}])}runtimeGetNetworkMetrics(){return JSON.stringify({metrics:{},stats:{}})}runtimeRestartHolochain(){return!0}runtimeHcAddAgentInfos(e){return!0}runtimeVerifyStringSignedByDid(e,r,i,n){return!0}runtimeSetStatus(e){return!0}runtimeFriendStatus(e){return Yr}runtimeFriendSendMessage(e,r){return!0}runtimeMessageInbox(e){return[Yr]}runtimeMessageOutbox(e){return[{recipient:"did:test:recipient",message:Yr}]}runtimeMessageReceived(){return Yr}exceptionOccurred(){return{title:"Test title",message:"Test message",type:Ql.LanguageIsNotLoaded}}runtimeRequestInstallNotification(e){return"new-notification-id"}runtimeNotifications(){return[{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}]}runtimeUpdateNotification(e,r){return!0}runtimeRemoveNotification(e){return!0}runtimeGrantNotification(e){return!0}runtimeNotificationTriggered(){return{perspectiveId:"test-perspective-id",triggerMatch:"test-trigger-match",notification:{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}}}runtimeExportDb(e){return!0}runtimeImportDb(e){return!0}runtimeExportPerspective(e,r){return!0}runtimeImportPerspective(e){return!0}runtimeMultiUserEnabled(){return!1}runtimeSetMultiUserEnabled(e){return e}runtimeListUsers(){return[{email:"test@example.com",did:"did:key:test123",lastSeen:new Date().toISOString(),perspectiveCount:5}]}runtimeRequestLoginVerification(e,r){return{success:!0,message:"Verification email sent",requiresPassword:!1}}runtimeVerifyEmailCode(e,r,i){return"test-jwt-token-from-email-verification"}runtimeTestEmail(e){return!0}runtimeCreateUser(e,r,i){return new Zi("did:key:test123",!0)}runtimeLoginUser(e,r){return"test-jwt-token-from-password-login"}runtimeEmailTestModeEnable(){return!0}runtimeEmailTestModeDisable(){return!0}runtimeEmailTestGetCode(e){return"123456"}runtimeEmailTestClearCodes(){return!0}runtimeEmailTestSetExpiry(e,r,i){return!0}};O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeQuit",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeOpenLink",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Hn)],V.prototype,"runtimeInfo",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"addTrustedAgents",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"deleteTrustedAgents",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"getTrustedAgents",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"runtimeKnownLinkLanguageTemplates",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"runtimeAddKnownLinkLanguageTemplates",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"runtimeRemoveKnownLinkLanguageTemplates",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"runtimeFriends",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"runtimeAddFriends",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"runtimeRemoveFriends",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",String)],V.prototype,"runtimeHcAgentInfos",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",String)],V.prototype,"runtimeGetNetworkMetrics",null);O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeRestartHolochain",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Object]),y("design:returntype",Boolean)],V.prototype,"runtimeHcAddAgentInfos",null);O([Dt(),X(0,Y()),X(1,Y()),X(2,Y()),X(3,Y()),y("design:type",Function),y("design:paramtypes",[String,String,String,String]),y("design:returntype",void 0)],V.prototype,"runtimeVerifyStringSignedByDid",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[fr]),y("design:returntype",Boolean)],V.prototype,"runtimeSetStatus",null);O([Dt(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Ki)],V.prototype,"runtimeFriendStatus",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,Ys]),y("design:returntype",Boolean)],V.prototype,"runtimeFriendSendMessage",null);O([Dt(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Array)],V.prototype,"runtimeMessageInbox",null);O([Dt(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Array)],V.prototype,"runtimeMessageOutbox",null);O([Gl(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Ki)],V.prototype,"runtimeMessageReceived",null);O([Gl(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",tn)],V.prototype,"exceptionOccurred",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[qt]),y("design:returntype",String)],V.prototype,"runtimeRequestInstallNotification",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"runtimeNotifications",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,qt]),y("design:returntype",Boolean)],V.prototype,"runtimeUpdateNotification",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeRemoveNotification",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeGrantNotification",null);O([Gl(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Gn)],V.prototype,"runtimeNotificationTriggered",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeExportDb",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeImportDb",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,String]),y("design:returntype",Boolean)],V.prototype,"runtimeExportPerspective",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeImportPerspective",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeMultiUserEnabled",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Boolean]),y("design:returntype",Boolean)],V.prototype,"runtimeSetMultiUserEnabled",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"runtimeListUsers",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,dr]),y("design:returntype",Zn)],V.prototype,"runtimeRequestLoginVerification",null);O([_e(),X(0,Y()),X(1,Y()),X(2,Y()),y("design:type",Function),y("design:paramtypes",[String,String,String]),y("design:returntype",String)],V.prototype,"runtimeVerifyEmailCode",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeTestEmail",null);O([_e(),X(0,Y()),X(1,Y()),X(2,Y()),y("design:type",Function),y("design:paramtypes",[String,String,dr]),y("design:returntype",Zi)],V.prototype,"runtimeCreateUser",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,String]),y("design:returntype",String)],V.prototype,"runtimeLoginUser",null);O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeEmailTestModeEnable",null);O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeEmailTestModeDisable",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",String)],V.prototype,"runtimeEmailTestGetCode",null);O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeEmailTestClearCodes",null);O([_e(),X(0,Y()),X(1,Y()),X(2,Y()),y("design:type",Function),y("design:paramtypes",[String,String,Number]),y("design:returntype",Boolean)],V.prototype,"runtimeEmailTestSetExpiry",null);V=O([d0()],V);var Na=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},ne=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},_t,or,Qs,Ne;function zs(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Yh(t){return t?`triple("${t}", "ad4m://has_child", Base)`:""}function _l(){return`
1512
+ `;function Jh(t){return t?.length?t.length===1?t.toString():t.length===2?t.join(" and "):t.slice(0,-1).join(", ")+", and "+t.slice(-1):""}function um(t){let e=t.can.includes("*")?["READ","WRITE","UPDATE"]:t.can,r=t.with.domain==="*"?"":t.with.domain,i=t.with.pointers.includes("*")?["all AD4M data"]:t.with.pointers;return`${Jh(e)} your ${r} actions, with access to ${Jh(i)}`}var O=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},y=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},X=function(t,e){return function(r,i){e(r,i,t)}},wo=new ni;wo.author="did:ad4m:test";wo.timestamp=Date.now();wo.data={source:"root",target:"neighbourhood://Qm12345"};wo.proof={signature:"",key:"",valid:!0};var Yr=new Ki;Yr.author="did:ad4m:test";Yr.timestamp=Date.now().toString();Yr.proof=new Tr("","");Yr.data=new fr([wo]);var mc=class{};O([g(),y("design:type",String)],mc.prototype,"recipient",void 0);O([g(),y("design:type",Ki)],mc.prototype,"message",void 0);mc=O([G()],mc);var Gn=class{};O([g(),y("design:type",String)],Gn.prototype,"ad4mExecutorVersion",void 0);O([g(),y("design:type",Boolean)],Gn.prototype,"isInitialized",void 0);O([g(),y("design:type",Boolean)],Gn.prototype,"isUnlocked",void 0);Gn=O([G()],Gn);var tn=class{};O([g(),y("design:type",String)],tn.prototype,"title",void 0);O([g(),y("design:type",String)],tn.prototype,"message",void 0);O([g(),y("design:type",String)],tn.prototype,"type",void 0);O([g(),y("design:type",String)],tn.prototype,"addon",void 0);tn=O([G()],tn);var qt=class{};O([g(),y("design:type",String)],qt.prototype,"description",void 0);O([g(),y("design:type",String)],qt.prototype,"appName",void 0);O([g(),y("design:type",String)],qt.prototype,"appUrl",void 0);O([g(),y("design:type",String)],qt.prototype,"appIconPath",void 0);O([g(),y("design:type",String)],qt.prototype,"trigger",void 0);O([g(),y("design:type",Array)],qt.prototype,"perspectiveIds",void 0);O([g(),y("design:type",String)],qt.prototype,"webhookUrl",void 0);O([g(),y("design:type",String)],qt.prototype,"webhookAuth",void 0);qt=O([Ze()],qt);var It=class{};O([g(),y("design:type",String)],It.prototype,"id",void 0);O([g(),y("design:type",Boolean)],It.prototype,"granted",void 0);O([g(),y("design:type",String)],It.prototype,"description",void 0);O([g(),y("design:type",String)],It.prototype,"appName",void 0);O([g(),y("design:type",String)],It.prototype,"appUrl",void 0);O([g(),y("design:type",String)],It.prototype,"appIconPath",void 0);O([g(),y("design:type",String)],It.prototype,"trigger",void 0);O([g(),y("design:type",Array)],It.prototype,"perspectiveIds",void 0);O([g(),y("design:type",String)],It.prototype,"webhookUrl",void 0);O([g(),y("design:type",String)],It.prototype,"webhookAuth",void 0);It=O([G()],It);var Kn=class{};O([g(),y("design:type",It)],Kn.prototype,"notification",void 0);O([g(),y("design:type",String)],Kn.prototype,"perspectiveId",void 0);O([g(),y("design:type",String)],Kn.prototype,"triggerMatch",void 0);Kn=O([G()],Kn);var Ke=class{};O([g(),y("design:type",Number)],Ke.prototype,"total",void 0);O([g(),y("design:type",Number)],Ke.prototype,"imported",void 0);O([g(),y("design:type",Number)],Ke.prototype,"failed",void 0);O([g(),y("design:type",Number)],Ke.prototype,"omitted",void 0);O([g(),y("design:type",Array)],Ke.prototype,"errors",void 0);Ke=O([G()],Ke);var Ot=class{};O([g(),y("design:type",Ke)],Ot.prototype,"perspectives",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"links",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"expressions",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"perspectiveDiffs",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"notifications",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"models",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"defaultModels",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"tasks",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"friends",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"trustedAgents",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"knownLinkLanguages",void 0);Ot=O([G()],Ot);var Zn=class{};O([g(),y("design:type",String)],Zn.prototype,"email",void 0);O([g(),y("design:type",String)],Zn.prototype,"did",void 0);O([g(),y("design:type",String)],Zn.prototype,"lastSeen",void 0);O([g(),y("design:type",Number)],Zn.prototype,"perspectiveCount",void 0);Zn=O([G()],Zn);var rn=class{};O([g(),y("design:type",Boolean)],rn.prototype,"success",void 0);O([g(),y("design:type",String)],rn.prototype,"message",void 0);O([g(),y("design:type",Boolean)],rn.prototype,"requiresPassword",void 0);O([g(),y("design:type",Boolean)],rn.prototype,"isExistingUser",void 0);rn=O([G()],rn);var V=class{runtimeQuit(){return!0}runtimeOpenLink(e){return!0}runtimeInfo(){return{ad4mExecutorVersion:"x.x.x",isInitialized:!0,isUnlocked:!0}}addTrustedAgents(e){return e}deleteTrustedAgents(e){return[]}getTrustedAgents(){return["agentPubKey"]}runtimeKnownLinkLanguageTemplates(){return["Qm12345abcdef"]}runtimeAddKnownLinkLanguageTemplates(e){return e}runtimeRemoveKnownLinkLanguageTemplates(e){return[]}runtimeFriends(){return["did:test:friend"]}runtimeAddFriends(e){return e}runtimeRemoveFriends(e){return[]}runtimeHcAgentInfos(){return JSON.stringify([{agent:{type:"Buffer",data:[9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186]},signature:{type:"Buffer",data:[195,143,170,36,234,123,255,85,188,138,124,2,91,18,53,231,44,41,240,8,80,131,100,150,165,125,146,90,17,200,190,129,114,211,11,146,150,128,198,199,79,118,157,101,194,68,58,245,98,182,79,139,140,41,143,129,8,136,87,77,180,231,218,11]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,101,83,52,86,112,54,109,118,80,48,122,116,85,101,104,114,117,113,89,52,102,66,53,101,69,98,121,48,69,66,100,89,84,50,95,67,48,69,112,77,111,76,111,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,104,189,50,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38]},signature:{type:"Buffer",data:[233,192,38,3,59,248,124,231,57,255,40,154,50,60,119,252,68,198,154,109,175,155,106,217,211,155,109,223,249,91,221,210,17,132,72,230,11,230,247,119,72,244,145,91,75,7,67,5,130,151,44,231,52,220,28,154,212,82,58,90,203,211,236,4]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,55,101,77,106,48,73,83,72,56,56,81,56,45,89,51,74,89,70,53,76,72,57,83,54,68,119,71,73,49,88,45,115,87,53,68,104,66,87,121,71,119,78,115,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,103,45,197,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109]},signature:{type:"Buffer",data:[88,189,229,122,44,171,194,156,90,79,148,49,207,224,34,199,219,88,24,243,103,127,123,41,87,171,127,92,6,216,198,171,26,226,237,217,122,78,98,146,55,255,68,240,202,83,58,140,147,185,3,66,15,216,210,22,99,197,73,234,120,17,74,1]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,114,70,71,83,100,113,104,101,68,107,70,70,56,69,102,109,45,69,116,55,119,81,101,120,83,88,55,65,112,69,51,89,86,99,45,120,102,52,104,106,77,115,77,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,23,220,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56]},signature:{type:"Buffer",data:[129,12,55,104,239,121,138,2,86,106,136,51,219,79,170,8,195,69,81,188,225,192,247,196,54,39,164,110,75,39,240,56,245,189,154,77,72,11,97,250,202,149,242,97,128,28,47,164,236,104,136,82,212,246,44,143,132,119,255,135,112,11,20,13]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56,164,117,114,108,115,145,217,97,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,104,121,112,115,86,121,103,117,80,84,115,53,118,73,80,65,102,97,112,90,88,113,117,84,115,79,80,100,67,81,79,79,117,103,57,51,82,103,106,95,114,85,73,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,54,53,46,50,50,46,51,50,46,49,49,47,112,47,53,55,55,57,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,188,123,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}}])}runtimeGetNetworkMetrics(){return JSON.stringify({metrics:{},stats:{}})}runtimeRestartHolochain(){return!0}runtimeHcAddAgentInfos(e){return!0}runtimeVerifyStringSignedByDid(e,r,i,n){return!0}runtimeSetStatus(e){return!0}runtimeFriendStatus(e){return Yr}runtimeFriendSendMessage(e,r){return!0}runtimeMessageInbox(e){return[Yr]}runtimeMessageOutbox(e){return[{recipient:"did:test:recipient",message:Yr}]}runtimeMessageReceived(){return Yr}exceptionOccurred(){return{title:"Test title",message:"Test message",type:Ql.LanguageIsNotLoaded}}runtimeRequestInstallNotification(e){return"new-notification-id"}runtimeNotifications(){return[{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}]}runtimeUpdateNotification(e,r){return!0}runtimeRemoveNotification(e){return!0}runtimeGrantNotification(e){return!0}runtimeNotificationTriggered(){return{perspectiveId:"test-perspective-id",triggerMatch:"test-trigger-match",notification:{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}}}runtimeExportDb(e){return!0}runtimeImportDb(e){return!0}runtimeExportPerspective(e,r){return!0}runtimeImportPerspective(e){return!0}runtimeMultiUserEnabled(){return!1}runtimeSetMultiUserEnabled(e){return e}runtimeListUsers(){return[{email:"test@example.com",did:"did:key:test123",lastSeen:new Date().toISOString(),perspectiveCount:5}]}runtimeRequestLoginVerification(e,r){return{success:!0,message:"Verification email sent",requiresPassword:!1,isExistingUser:!0}}runtimeVerifyEmailCode(e,r,i){return"test-jwt-token-from-email-verification"}runtimeTestEmail(e){return!0}runtimeCreateUser(e,r,i){return new Zi("did:key:test123",!0)}runtimeLoginUser(e,r){return"test-jwt-token-from-password-login"}runtimeEmailTestModeEnable(){return!0}runtimeEmailTestModeDisable(){return!0}runtimeEmailTestGetCode(e){return"123456"}runtimeEmailTestClearCodes(){return!0}runtimeEmailTestSetExpiry(e,r,i){return!0}};O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeQuit",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeOpenLink",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Gn)],V.prototype,"runtimeInfo",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"addTrustedAgents",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"deleteTrustedAgents",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"getTrustedAgents",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"runtimeKnownLinkLanguageTemplates",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"runtimeAddKnownLinkLanguageTemplates",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"runtimeRemoveKnownLinkLanguageTemplates",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"runtimeFriends",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"runtimeAddFriends",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"runtimeRemoveFriends",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",String)],V.prototype,"runtimeHcAgentInfos",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",String)],V.prototype,"runtimeGetNetworkMetrics",null);O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeRestartHolochain",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Object]),y("design:returntype",Boolean)],V.prototype,"runtimeHcAddAgentInfos",null);O([Dt(),X(0,Y()),X(1,Y()),X(2,Y()),X(3,Y()),y("design:type",Function),y("design:paramtypes",[String,String,String,String]),y("design:returntype",void 0)],V.prototype,"runtimeVerifyStringSignedByDid",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[fr]),y("design:returntype",Boolean)],V.prototype,"runtimeSetStatus",null);O([Dt(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Ki)],V.prototype,"runtimeFriendStatus",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,Ys]),y("design:returntype",Boolean)],V.prototype,"runtimeFriendSendMessage",null);O([Dt(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Array)],V.prototype,"runtimeMessageInbox",null);O([Dt(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Array)],V.prototype,"runtimeMessageOutbox",null);O([Gl(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Ki)],V.prototype,"runtimeMessageReceived",null);O([Gl(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",tn)],V.prototype,"exceptionOccurred",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[qt]),y("design:returntype",String)],V.prototype,"runtimeRequestInstallNotification",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"runtimeNotifications",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,qt]),y("design:returntype",Boolean)],V.prototype,"runtimeUpdateNotification",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeRemoveNotification",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeGrantNotification",null);O([Gl(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Kn)],V.prototype,"runtimeNotificationTriggered",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeExportDb",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeImportDb",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,String]),y("design:returntype",Boolean)],V.prototype,"runtimeExportPerspective",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeImportPerspective",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeMultiUserEnabled",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Boolean]),y("design:returntype",Boolean)],V.prototype,"runtimeSetMultiUserEnabled",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"runtimeListUsers",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,dr]),y("design:returntype",rn)],V.prototype,"runtimeRequestLoginVerification",null);O([_e(),X(0,Y()),X(1,Y()),X(2,Y()),y("design:type",Function),y("design:paramtypes",[String,String,String]),y("design:returntype",String)],V.prototype,"runtimeVerifyEmailCode",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeTestEmail",null);O([_e(),X(0,Y()),X(1,Y()),X(2,Y()),y("design:type",Function),y("design:paramtypes",[String,String,dr]),y("design:returntype",Zi)],V.prototype,"runtimeCreateUser",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,String]),y("design:returntype",String)],V.prototype,"runtimeLoginUser",null);O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeEmailTestModeEnable",null);O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeEmailTestModeDisable",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",String)],V.prototype,"runtimeEmailTestGetCode",null);O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeEmailTestClearCodes",null);O([_e(),X(0,Y()),X(1,Y()),X(2,Y()),y("design:type",Function),y("design:paramtypes",[String,String,Number]),y("design:returntype",Boolean)],V.prototype,"runtimeEmailTestSetExpiry",null);V=O([d0()],V);var Na=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},ne=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},_t,or,Qs,Ne;function zs(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Yh(t){return t?`triple("${t}", "ad4m://has_child", Base)`:""}function _l(){return`
1511
1513
  findall(
1512
1514
  [T, A],
1513
1515
  link(Base, _, _, T, A),
@@ -1560,7 +1562,7 @@ WHERE ${l.join(" AND ")}
1560
1562
  - options.namespace
1561
1563
  - schema["x-ad4m"].namespace
1562
1564
  - schema.title
1563
- - valid schema.$id`)}static determinePredicate(t,e,r,i,n){if(n.propertyMapping?.[e])return n.propertyMapping[e];if(r["x-ad4m"]?.through)return r["x-ad4m"].through;if(n.predicateTemplate){let o=o1(i),[s,u]=o.includes("://")?o.split("://"):["",o],c=u||"";return n.predicateTemplate.replace("${namespace}",c).replace("${scheme}",s).replace("${ns}",c).replace("${title}",t.title||"").replace("${property}",e)}if(n.predicateGenerator)return n.predicateGenerator(t.title||"",e);let a=o1(i);return a.includes("://")?`${a}${e}`:`${a}://${e}`}static getPropertyOption(t,e,r,i,n){return r.propertyOptions?.[t]?.[i]!==void 0?r.propertyOptions[t][i]:e["x-ad4m"]?.[i]!==void 0?e["x-ad4m"][i]:r[i]!==void 0?r[i]:n}static getDefaultValueForType(t){switch(t){case"string":return"";case"number":return 0;case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return""}}};_t=new WeakMap,or=new WeakMap,Qs=new WeakMap,Ne=new WeakMap;_Ad4mModel.classNamesByClass=new WeakMap;var Hl=class{constructor(e,r,i){this.queryParams={},this.modelClassName=null,this.useSurrealDBFlag=!0,this.perspective=e,this.ctor=r,i&&(this.queryParams=i)}dispose(){this.currentSubscription&&(this.currentSubscription.dispose(),this.currentSubscription=void 0)}where(e){return this.queryParams.where=e,this}order(e){return this.queryParams.order=e,this}limit(e){return this.queryParams.limit=e,this}offset(e){return this.queryParams.offset=e,this}source(e){return this.queryParams.source=e,this}properties(e){return this.queryParams.properties=e,this}collections(e){return this.queryParams.collections=e,this}overrideModelClassName(e){return this.modelClassName=e,this}useSurrealDB(e=!0){return this.useSurrealDBFlag=e,this}async get(){if(this.useSurrealDBFlag){let e=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams),r=await this.perspective.querySurrealDB(e),{results:i}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,r);return i}else{let e=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName),r=await this.perspective.infer(e),{results:i}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,r);return i}}async subscribe(e){if(this.dispose(),this.useSurrealDBFlag){let r=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams);this.currentSubscription=await this.perspective.subscribeSurrealDB(r);let i=async a=>{let{results:o}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(i);let{results:n}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}else{let r=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let i=async a=>{let{results:o}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(i);let{results:n}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}}async count(){if(this.useSurrealDBFlag){let e=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams),r=await this.perspective.querySurrealDB(e),{totalCount:i}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,r);return i}else{let e=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);return(await this.perspective.infer(e))?.[0]?.TotalCount||0}}async countSubscribe(e){if(this.dispose(),this.useSurrealDBFlag){let r=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams);this.currentSubscription=await this.perspective.subscribeSurrealDB(r);let i=async a=>{let{totalCount:o}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(i);let{totalCount:n}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}else{let r=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let i=async n=>{let a=n?.[0]?.TotalCount||0;e(a)};return this.currentSubscription.onResult(i),this.currentSubscription.result?.[0]?.TotalCount||0}}async paginate(e,r){let i={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0};if(this.useSurrealDBFlag){let n=await this.ctor.queryToSurrealQL(this.perspective,i),a=await this.perspective.querySurrealDB(n),{results:o,totalCount:s}=await this.ctor.instancesFromSurrealResult(this.perspective,i,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}else{let n=await this.ctor.queryToProlog(this.perspective,i,this.modelClassName),a=await this.perspective.infer(n),{results:o,totalCount:s}=await this.ctor.instancesFromPrologResult(this.perspective,i,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}}async paginateSubscribe(e,r,i){this.dispose();let n={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0};if(this.useSurrealDBFlag){let a=await this.ctor.queryToSurrealQL(this.perspective,n);this.currentSubscription=await this.perspective.subscribeSurrealDB(a);let o=async c=>{let{results:l,totalCount:d}=await this.ctor.instancesFromSurrealResult(this.perspective,n,c);i({results:l,totalCount:d,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromSurrealResult(this.perspective,n,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}else{let a=await this.ctor.queryToProlog(this.perspective,n,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(a);let o=async c=>{let{results:l,totalCount:d}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,c);i({results:l,totalCount:d,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromPrologResult(this.perspective,n,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}}};var Cc="0.11.2-dev-multi-user-email";var Or=12e3;function F3(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function fi(t,e=1e4){return re(this,null,function*(){return Promise.race([new Promise((r,i)=>{let n;try{n=new WebSocket(t,"graphql-transport-ws"),n.onopen=()=>{n.close(),r(n)},n.onerror=a=>{i(a)},n.onclose=a=>{a.code!==1e3&&i(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){n&&n.close(),i(a)}}),new Promise((r,i)=>{setTimeout(()=>{i(new Error("WebSocket connection timed out"))},e)})])})}function lp(t){return re(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:F3().signal,mode:"cors"});if(e.status===400||e.status===0||e.status===200)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}function M3(){return new Promise((t,e)=>{let r=document.querySelector("ad4m-connect"),i=r==null?void 0:r.getAd4mClient();i?t(i):e("No Ad4mClient found")})}function pp(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function Ec(t,e){pp()&&localStorage.setItem(`${Cc}/${t}`,e)}function Kt(t){return pp()?localStorage.getItem(`${Cc}/${t}`):null}function fp(t){pp()&&localStorage.removeItem(`${Cc}/${t}`)}var U3=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};function Co(t,{include:e,exclude:r}={}){let i=n=>{let a=o=>typeof o=="string"?n===o:o.test(n);return e?e.some(a):r?!r.some(a):!0};for(let[n,a]of U3(t.constructor.prototype)){if(a==="constructor"||!i(a))continue;let o=Reflect.getOwnPropertyDescriptor(n,a);o&&typeof o.value=="function"&&(t[a]=t[a].bind(t))}return t}var Eo=class{constructor(e){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=Or;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};Co(this);this.options=e,this.appName=e.appName,this.appDesc=e.appDesc,this.appDomain=e.appDomain,this.appUrl=e.appUrl,this.appIconPath=e.appIconPath,this.capabilities=e.capabilities,this.port=e.port||this.port,this.url=e.url||`ws://localhost:${this.port}/graphql`,this.token=e.token||this.token,this.isHosting=e.hosting||!1}notifyConfigChange(e,r){this.listeners.configstatechange.forEach(i=>{i(e,r)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(r=>{r(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(r=>{r(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,r){this.listeners[e].push(r)}buildTempClient(e){let r=Xu({url:e,connectionParams:()=>re(this,null,function*(){return{headers:{authorization:""}}})}),i=new ds({link:new el(r),cache:new Ta({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"}}});return new ho(i)}connect(e){return re(this,null,function*(){try{if(e){yield fi(e),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=`ws://localhost:${this.port}/graphql`;yield fi(r),this.setUrl(r);let i=this.buildClient();return yield this.checkAuth(),i}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}connectMultiUser(){return re(this,null,function*(){console.warn("[Ad4m Connect] connectMultiUser() is deprecated. The new email verification flow is handled automatically by the UI.");try{let e=this.options.backendUrl;console.debug("[Ad4m Connect] Connecting to backend:",e),yield fi(e),this.setUrl(e);let r=this.buildClient();console.debug("[Ad4m Connect] Built client:",r);let i;try{console.debug("[Ad4m Connect] Logging in user:",this.options.userEmail),i=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.debug("[Ad4m Connect] Login successful")}catch(a){console.debug("[Ad4m Connect] Login error:",a),console.debug("[Ad4m Connect] User does not exist, trying to create user:",this.options.userEmail);try{console.debug("[Ad4m Connect] Creating user:",this.options.userEmail);let o=yield r.agent.createUser(this.options.userEmail,this.options.userPassword);if(console.debug("[Ad4m Connect] Create result:",o),!o.success)throw new Error(o.error||"Failed to create user. Server may require email verification.");console.debug("[Ad4m Connect] Logging in user after creation:",this.options.userEmail),i=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.log("[Ad4m Connect] Successfully created and logged in user")}catch(o){throw new Error(`Failed to create/login user: ${o.message}. If email verification is enabled, please use the UI-driven flow instead.`)}}this.setToken(i);let n=this.buildClient();return yield n.agent.status(),this.ad4mClient=n,this.notifyAuthChange("authenticated"),this.notifyConnectionChange("connected"),n}catch(e){throw this.notifyConnectionChange("error"),this.notifyAuthChange("unauthenticated"),e}})}loginToHosting(e,r){return re(this,null,function*(){try{let i=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(i.status===200){let n=yield i.json();localStorage.setItem("hosting_token",n.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,Ec("ad4mhosting","true"),!s.paused)this.connect();else throw new Error("Hosting is not running")}}else if((yield i.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(i){throw console.log(i),new Error(`Error logging in ${i}`)}})}checkEmail(e){return re(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(e){return re(this,null,function*(){try{if(e){let r=yield lp(e);return this.setPort(r),this.buildClient()}else if(this.url.includes("localhost")){let r=yield this.findPort();return this.setPort(r),this.buildClient()}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return re(this,null,function*(){var r,i;if(((r=this.activeSocket)==null?void 0:r.readyState)===WebSocket.OPEN&&((i=this.activeSocket)==null?void 0:i.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return this.notifyConnectionChange("connecting"),yield fi(this.url),this.buildClient()}catch(n){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return re(this,null,function*(){let e=[...Array(10).keys()].map((n,a)=>lp(Or+a)),i=(yield Promise.allSettled(e)).find(n=>n.status==="fulfilled");if(i)return i.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{let e=new WebSocket(this.url,"graphql-transport-ws")}catch(e){this.notifyConnectionChange("not_connected");return}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop(),this.wsClient=null,this.apolloClient=null),this.wsClient=Xu({url:this.url,connectionParams:()=>re(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:e=>re(this,null,function*(){if(!e.wasClean&&!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let r=yield this.connect();r?this.ad4mClient=r:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new ds({link:new el(this.wsClient),cache:new Ta({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new ho(this.apolloClient),this.ad4mClient}checkAuth(){return re(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return re(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let i=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+i}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return re(this,null,function*(){var r;try{let i=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(i),yield this.buildClient(),yield this.checkAuth(),this.token}catch(i){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(Or),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function dp({unlockAgent:t,reconnect:e}){return L`
1565
+ - valid schema.$id`)}static determinePredicate(t,e,r,i,n){if(n.propertyMapping?.[e])return n.propertyMapping[e];if(r["x-ad4m"]?.through)return r["x-ad4m"].through;if(n.predicateTemplate){let o=o1(i),[s,u]=o.includes("://")?o.split("://"):["",o],c=u||"";return n.predicateTemplate.replace("${namespace}",c).replace("${scheme}",s).replace("${ns}",c).replace("${title}",t.title||"").replace("${property}",e)}if(n.predicateGenerator)return n.predicateGenerator(t.title||"",e);let a=o1(i);return a.includes("://")?`${a}${e}`:`${a}://${e}`}static getPropertyOption(t,e,r,i,n){return r.propertyOptions?.[t]?.[i]!==void 0?r.propertyOptions[t][i]:e["x-ad4m"]?.[i]!==void 0?e["x-ad4m"][i]:r[i]!==void 0?r[i]:n}static getDefaultValueForType(t){switch(t){case"string":return"";case"number":return 0;case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return""}}};_t=new WeakMap,or=new WeakMap,Qs=new WeakMap,Ne=new WeakMap;_Ad4mModel.classNamesByClass=new WeakMap;var Hl=class{constructor(e,r,i){this.queryParams={},this.modelClassName=null,this.useSurrealDBFlag=!0,this.perspective=e,this.ctor=r,i&&(this.queryParams=i)}dispose(){this.currentSubscription&&(this.currentSubscription.dispose(),this.currentSubscription=void 0)}where(e){return this.queryParams.where=e,this}order(e){return this.queryParams.order=e,this}limit(e){return this.queryParams.limit=e,this}offset(e){return this.queryParams.offset=e,this}source(e){return this.queryParams.source=e,this}properties(e){return this.queryParams.properties=e,this}collections(e){return this.queryParams.collections=e,this}overrideModelClassName(e){return this.modelClassName=e,this}useSurrealDB(e=!0){return this.useSurrealDBFlag=e,this}async get(){if(this.useSurrealDBFlag){let e=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams),r=await this.perspective.querySurrealDB(e),{results:i}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,r);return i}else{let e=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName),r=await this.perspective.infer(e),{results:i}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,r);return i}}async subscribe(e){if(this.dispose(),this.useSurrealDBFlag){let r=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams);this.currentSubscription=await this.perspective.subscribeSurrealDB(r);let i=async a=>{let{results:o}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(i);let{results:n}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}else{let r=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let i=async a=>{let{results:o}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(i);let{results:n}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}}async count(){if(this.useSurrealDBFlag){let e=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams),r=await this.perspective.querySurrealDB(e),{totalCount:i}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,r);return i}else{let e=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);return(await this.perspective.infer(e))?.[0]?.TotalCount||0}}async countSubscribe(e){if(this.dispose(),this.useSurrealDBFlag){let r=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams);this.currentSubscription=await this.perspective.subscribeSurrealDB(r);let i=async a=>{let{totalCount:o}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(i);let{totalCount:n}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}else{let r=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let i=async n=>{let a=n?.[0]?.TotalCount||0;e(a)};return this.currentSubscription.onResult(i),this.currentSubscription.result?.[0]?.TotalCount||0}}async paginate(e,r){let i={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0};if(this.useSurrealDBFlag){let n=await this.ctor.queryToSurrealQL(this.perspective,i),a=await this.perspective.querySurrealDB(n),{results:o,totalCount:s}=await this.ctor.instancesFromSurrealResult(this.perspective,i,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}else{let n=await this.ctor.queryToProlog(this.perspective,i,this.modelClassName),a=await this.perspective.infer(n),{results:o,totalCount:s}=await this.ctor.instancesFromPrologResult(this.perspective,i,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}}async paginateSubscribe(e,r,i){this.dispose();let n={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0};if(this.useSurrealDBFlag){let a=await this.ctor.queryToSurrealQL(this.perspective,n);this.currentSubscription=await this.perspective.subscribeSurrealDB(a);let o=async c=>{let{results:l,totalCount:d}=await this.ctor.instancesFromSurrealResult(this.perspective,n,c);i({results:l,totalCount:d,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromSurrealResult(this.perspective,n,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}else{let a=await this.ctor.queryToProlog(this.perspective,n,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(a);let o=async c=>{let{results:l,totalCount:d}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,c);i({results:l,totalCount:d,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromPrologResult(this.perspective,n,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}}};var Cc="0.11.2-dev-multi-user-email-2";var Or=12e3;function F3(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function fi(t,e=1e4){return re(this,null,function*(){return Promise.race([new Promise((r,i)=>{let n;try{n=new WebSocket(t,"graphql-transport-ws"),n.onopen=()=>{n.close(),r(n)},n.onerror=a=>{i(a)},n.onclose=a=>{a.code!==1e3&&i(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){n&&n.close(),i(a)}}),new Promise((r,i)=>{setTimeout(()=>{i(new Error("WebSocket connection timed out"))},e)})])})}function lp(t){return re(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:F3().signal,mode:"cors"});if(e.status===400||e.status===0||e.status===200)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}function M3(){return new Promise((t,e)=>{let r=document.querySelector("ad4m-connect"),i=r==null?void 0:r.getAd4mClient();i?t(i):e("No Ad4mClient found")})}function pp(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function Ec(t,e){pp()&&localStorage.setItem(`${Cc}/${t}`,e)}function Kt(t){return pp()?localStorage.getItem(`${Cc}/${t}`):null}function fp(t){pp()&&localStorage.removeItem(`${Cc}/${t}`)}var U3=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};function Co(t,{include:e,exclude:r}={}){let i=n=>{let a=o=>typeof o=="string"?n===o:o.test(n);return e?e.some(a):r?!r.some(a):!0};for(let[n,a]of U3(t.constructor.prototype)){if(a==="constructor"||!i(a))continue;let o=Reflect.getOwnPropertyDescriptor(n,a);o&&typeof o.value=="function"&&(t[a]=t[a].bind(t))}return t}var Eo=class{constructor(e){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=Or;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};Co(this);this.options=e,this.appName=e.appName,this.appDesc=e.appDesc,this.appDomain=e.appDomain,this.appUrl=e.appUrl,this.appIconPath=e.appIconPath,this.capabilities=e.capabilities,this.port=e.port||this.port,this.url=e.url||`ws://localhost:${this.port}/graphql`,this.token=e.token||this.token,this.isHosting=e.hosting||!1}notifyConfigChange(e,r){this.listeners.configstatechange.forEach(i=>{i(e,r)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(r=>{r(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(r=>{r(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,r){this.listeners[e].push(r)}buildTempClient(e){let r=Xu({url:e,connectionParams:()=>re(this,null,function*(){return{headers:{authorization:""}}})}),i=new ds({link:new el(r),cache:new Ta({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"}}});return new ho(i)}connect(e){return re(this,null,function*(){try{if(e){yield fi(e),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=`ws://localhost:${this.port}/graphql`;yield fi(r),this.setUrl(r);let i=this.buildClient();return yield this.checkAuth(),i}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}connectMultiUser(){return re(this,null,function*(){console.warn("[Ad4m Connect] connectMultiUser() is deprecated. The new email verification flow is handled automatically by the UI.");try{let e=this.options.backendUrl;console.debug("[Ad4m Connect] Connecting to backend:",e),yield fi(e),this.setUrl(e);let r=this.buildClient();console.debug("[Ad4m Connect] Built client:",r);let i;try{console.debug("[Ad4m Connect] Logging in user:",this.options.userEmail),i=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.debug("[Ad4m Connect] Login successful")}catch(a){console.debug("[Ad4m Connect] Login error:",a),console.debug("[Ad4m Connect] User does not exist, trying to create user:",this.options.userEmail);try{console.debug("[Ad4m Connect] Creating user:",this.options.userEmail);let o=yield r.agent.createUser(this.options.userEmail,this.options.userPassword);if(console.debug("[Ad4m Connect] Create result:",o),!o.success)throw new Error(o.error||"Failed to create user. Server may require email verification.");console.debug("[Ad4m Connect] Logging in user after creation:",this.options.userEmail),i=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.log("[Ad4m Connect] Successfully created and logged in user")}catch(o){throw new Error(`Failed to create/login user: ${o.message}. If email verification is enabled, please use the UI-driven flow instead.`)}}this.setToken(i);let n=this.buildClient();return yield n.agent.status(),this.ad4mClient=n,this.notifyAuthChange("authenticated"),this.notifyConnectionChange("connected"),n}catch(e){throw this.notifyConnectionChange("error"),this.notifyAuthChange("unauthenticated"),e}})}loginToHosting(e,r){return re(this,null,function*(){try{let i=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(i.status===200){let n=yield i.json();localStorage.setItem("hosting_token",n.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,Ec("ad4mhosting","true"),!s.paused)this.connect();else throw new Error("Hosting is not running")}}else if((yield i.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(i){throw console.log(i),new Error(`Error logging in ${i}`)}})}checkEmail(e){return re(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(e){return re(this,null,function*(){try{if(e){let r=yield lp(e);return this.setPort(r),this.buildClient()}else if(this.url.includes("localhost")){let r=yield this.findPort();return this.setPort(r),this.buildClient()}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return re(this,null,function*(){var r,i;if(((r=this.activeSocket)==null?void 0:r.readyState)===WebSocket.OPEN&&((i=this.activeSocket)==null?void 0:i.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return this.notifyConnectionChange("connecting"),yield fi(this.url),this.buildClient()}catch(n){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return re(this,null,function*(){let e=[...Array(10).keys()].map((n,a)=>lp(Or+a)),i=(yield Promise.allSettled(e)).find(n=>n.status==="fulfilled");if(i)return i.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{let e=new WebSocket(this.url,"graphql-transport-ws")}catch(e){this.notifyConnectionChange("not_connected");return}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop(),this.wsClient=null,this.apolloClient=null),this.wsClient=Xu({url:this.url,connectionParams:()=>re(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:e=>re(this,null,function*(){if(!e.wasClean&&!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let r=yield this.connect();r?this.ad4mClient=r:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new ds({link:new el(this.wsClient),cache:new Ta({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new ho(this.apolloClient),this.ad4mClient}checkAuth(){return re(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return re(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let i=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+i}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return re(this,null,function*(){var r;try{let i=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(i),yield this.buildClient(),yield this.checkAuth(),this.token}catch(i){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(Or),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function dp({unlockAgent:t,reconnect:e}){return L`
1564
1566
  <div class="text-center">
1565
1567
  <div class="items">
1566
1568
  <div>
@@ -1967,10 +1969,10 @@ WHERE ${l.join(" AND ")}
1967
1969
  `:o==="password"?L`
1968
1970
  <div class="items">
1969
1971
  <div class="text-center">
1970
- <h3 class="heading">Create your account</h3>
1972
+ <h3 class="heading">${s==="signup"?"Create your account":"Sign in to your account"}</h3>
1971
1973
  <p class="body">Email: <strong>${t}</strong></p>
1972
1974
  <p class="body" style="margin-top: 10px;">
1973
- Choose a password to create your account
1975
+ ${s==="signup"?"Choose a password to create your account":"Enter your password to sign in"}
1974
1976
  </p>
1975
1977
  </div>
1976
1978
 
@@ -1987,7 +1989,7 @@ WHERE ${l.join(" AND ")}
1987
1989
  id="password"
1988
1990
  type="password"
1989
1991
  class="input__field"
1990
- placeholder="Enter a strong password"
1992
+ placeholder="${s==="signup"?"Enter a strong password":"Enter your password"}"
1991
1993
  .value=${e}
1992
1994
  @input=${m=>c(m.target.value)}
1993
1995
  @keypress=${m=>{m.key==="Enter"&&e&&!n&&f()}}
@@ -2003,7 +2005,8 @@ WHERE ${l.join(" AND ")}
2003
2005
  @click=${f}
2004
2006
  ?disabled=${n||!e}
2005
2007
  >
2006
- ${n?"Creating account...":"Create Account"}
2008
+ ${s==="signup"?n?"Creating account...":"Create Account":n?"Signing in...":"Sign In"}
2009
+
2007
2010
  </button>
2008
2011
  </div>
2009
2012
 
@@ -2063,7 +2066,7 @@ WHERE ${l.join(" AND ")}
2063
2066
  class="input__field code-input"
2064
2067
  placeholder="000000"
2065
2068
  .value=${r}
2066
- @input=${m=>{let _=m.target.value.replace(/\D/g,"");l(_),_.length===6&&setTimeout(()=>p(),100)}}
2069
+ @input=${m=>{let _=m.target.value.replace(/\D/g,"");l(_)}}
2067
2070
  ?disabled=${n}
2068
2071
  autofocus
2069
2072
  />
@@ -3003,7 +3006,7 @@ WHERE ${l.join(" AND ")}
3003
3006
  width: 100vw;
3004
3007
  object-fit: cover;
3005
3008
  }
3006
- `,ee=class extends Pr{constructor(){super(...arguments);this._code=null;this._isMobile=null;this._hasClickedDownload=null;this._isRemote=!1;this._isOpen=!1;this._hostingStep=0;this._email="";this._passowrd="";this._passwordError=null;this._hostingNotRunningError=null;this._verifyCodeError=null;this._isHostingLoading=!1;this._multiUserEmail="";this._multiUserPassword="";this._multiUserVerificationCode="";this._multiUserError=null;this._multiUserLoading=!1;this._multiUserStep="email";this._multiUserVerificationType="login";this._localDetected=!1;this._remoteUrl="";this._remoteMultiUserDetected=null;this._remoteDetecting=!1;this._remoteError=null;this.uiState="connection_overview";this.appName=null;this.appDesc=null;this.appDomain=null;this.appIconPath=null;this.mobile=null;this.capabilities=[];this.hosting=Kt("ad4mhosting")==="true"||!1;this.token=Kt("ad4mToken")||"";this.port=parseInt(Kt("ad4mport"))||Or;this.url=Kt("ad4murl")||"";this.multiUser=!1;this.backendUrl=""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}injectFont(){let r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href","https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap"),document.head.appendChild(r)}connectedCallback(){super.connectedCallback(),Co(this),this.injectFont(),this._isMobile=j3(),this._client=new Eo({appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath,capabilities:Array.isArray(this.capabilities)?this.capabilities:JSON.parse(this.capabilities),port:this.port||parseInt(Kt("ad4mport"))||Or,token:this.token||Kt("ad4mtoken"),url:this.url||Kt("ad4murl"),hosting:this.hosting}),this._client.on("configstatechange",this.handleConfigChange),this._client.on("authstatechange",this.handleAuthChange),this._client.on("connectionstatechange",this.handleConnectionChange),this.loadFont(),this.token||Kt("ad4mtoken")?this.multiUser&&this.backendUrl?this._client.connect(this.backendUrl):this._client.connect():(this.detectLocal(),this.changeUIState("connection_overview"),this._isOpen=!0)}checkEmail(){return re(this,null,function*(){try{(yield this._client.checkEmail(this._email))?this._hostingStep=1:this._hostingStep=2}catch(r){console.log(r)}})}handleMultiUserEmailSubmit(){return re(this,null,function*(){try{this._multiUserLoading=!0,this._multiUserError=null;let r=this._client.buildTempClient(this.backendUrl),i={appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath},n=yield r.agent.requestLoginVerification(this._multiUserEmail,i);if(n.success&&!n.requiresPassword)this._multiUserStep="code",this._multiUserVerificationType="login";else if(n.requiresPassword){let a=n.message&&n.message.includes("Email verification is not available");this._multiUserStep="password",this._multiUserVerificationType=a?"login":"signup"}else this._multiUserError=n.message||"Failed to send verification email"}catch(r){this._multiUserError=r.message||"Failed to process email. Please try again."}finally{this._multiUserLoading=!1}})}handleMultiUserPasswordSubmit(){return re(this,null,function*(){try{this._multiUserLoading=!0,this._multiUserError=null;let r=this._client.buildTempClient(this.backendUrl);if(this._multiUserVerificationType==="login")try{let i=yield r.agent.loginUser(this._multiUserEmail,this._multiUserPassword);this._client.setToken(i),this._client.setUrl(this.backendUrl),yield this._client.buildClient(),yield this._client.checkAuth(),this._multiUserEmail="",this._multiUserPassword="",this._multiUserVerificationCode="",this._multiUserStep="email",this._isOpen=!1,this.changeUIState("connected"),this.handleAuthChange("authenticated")}catch(i){this._multiUserError=i.message||"Invalid email or password. Please try again."}else{let i={appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath},n=yield r.agent.createUser(this._multiUserEmail,this._multiUserPassword,i);if(n.success)if(n.error&&n.error.includes("SMTP is not configured"))try{let a=yield r.agent.loginUser(this._multiUserEmail,this._multiUserPassword);this._client.setToken(a),this._client.setUrl(this.backendUrl),yield this._client.buildClient(),yield this._client.checkAuth(),this._multiUserEmail="",this._multiUserPassword="",this._multiUserVerificationCode="",this._multiUserStep="email",this._isOpen=!1,this.changeUIState("connected"),this.handleAuthChange("authenticated")}catch(a){this._multiUserError=a.message||"Account created but login failed. Please try logging in."}else n.error?this._multiUserError=n.error+" You can try logging in with your password.":(this._multiUserStep="code",this._multiUserVerificationType="signup");else this._multiUserError=n.error||"Failed to create account. Please try again."}}catch(r){this._multiUserError=r.message||"Failed to process request. Please try again."}finally{this._multiUserLoading=!1}})}handleMultiUserCodeSubmit(){return re(this,null,function*(){try{this._multiUserLoading=!0,this._multiUserError=null;let i=yield this._client.buildTempClient(this.backendUrl).agent.verifyEmailCode(this._multiUserEmail,this._multiUserVerificationCode,this._multiUserVerificationType);this._client.setToken(i),this._client.setUrl(this.backendUrl),yield this._client.buildClient(),yield this._client.checkAuth(),this._multiUserEmail="",this._multiUserPassword="",this._multiUserVerificationCode="",this._multiUserStep="email",this._isOpen=!1,this.changeUIState("connected"),this.handleAuthChange("authenticated")}catch(r){this._multiUserError="Invalid or expired code. Please try again.",this._multiUserVerificationCode=""}finally{this._multiUserLoading=!1}})}handleMultiUserBackToEmail(){this._multiUserStep="email",this._multiUserPassword="",this._multiUserVerificationCode="",this._multiUserError=null}changeMultiUserEmail(r){this._multiUserEmail=r,this._multiUserError=null}changeMultiUserPassword(r){this._multiUserPassword=r,this._multiUserError=null}changeMultiUserVerificationCode(r){this._multiUserVerificationCode=r,this._multiUserError=null}detectLocal(){return re(this,null,function*(){try{yield fi(`ws://localhost:${this.port}/graphql`,3e3),this._localDetected=!0}catch(r){console.log("[Ad4m Connect] Local detection failed:",r),this._localDetected=!1}})}verifyAd4mApi(r){return re(this,null,function*(){console.log("[Ad4m Connect] Verifying AD4M API at URL:",r);let i=this._client.buildTempClient(r);try{yield i.runtime.info(),console.log("[Ad4m Connect] AD4M API verified")}catch(n){throw console.error("[Ad4m Connect] Failed to verify AD4M API:",n),new Error("Server is reachable but doesn't appear to be an AD4M executor. Make sure the URL includes '/graphql'.")}})}detectRemoteMultiUser(r){return re(this,null,function*(){console.log("[Ad4m Connect] Detecting multi-user mode for URL:",r);let i=this._client.buildTempClient(r);try{let n=yield i.runtime.multiUserEnabled();return console.log("[Ad4m Connect] Multi-user detection result:",n),n}catch(n){return console.error("[Ad4m Connect] Failed to detect multi-user mode:",n),console.error("[Ad4m Connect] Error details:",n.message,n.stack),!1}})}handleConnectLocal(){return re(this,null,function*(){try{this.changeUIState("requestcap"),yield this._client.connect()}catch(r){console.error("Failed to connect to local AD4M:",r),this.changeUIState("connection_overview")}})}handleShowRemoteConnection(){this._remoteUrl=this.backendUrl||this.url||"",this._remoteMultiUserDetected=null,this._remoteError=null,this.changeUIState("remote_connection")}handleRemoteUrlChange(r){this._remoteUrl=r,this._remoteError=null}handleRemoteConnect(){return re(this,null,function*(){if(!this._remoteUrl){this._remoteError="Please enter a URL";return}this._remoteDetecting=!0,this._remoteError=null,this._remoteMultiUserDetected=null;try{console.log("[Ad4m Connect] Checking if server is reachable:",this._remoteUrl),yield fi(this._remoteUrl,5e3),console.log("[Ad4m Connect] Server is reachable"),yield this.verifyAd4mApi(this._remoteUrl);let r=yield this.detectRemoteMultiUser(this._remoteUrl);this._remoteMultiUserDetected=r,this._remoteDetecting=!1}catch(r){console.error("[Ad4m Connect] Connection/detection failed:",r),this._remoteError=r.message||"Cannot reach server at this URL. Please check the URL and try again.",this._remoteMultiUserDetected=null,this._remoteDetecting=!1}})}handleRemoteMultiUserAuth(){return re(this,null,function*(){this.backendUrl=this._remoteUrl,this.changeUIState("multiuser_auth")})}handleRemoteRequestCapability(){return re(this,null,function*(){try{this.changeUIState("requestcap"),yield this._client.connect(this._remoteUrl)}catch(r){this._remoteError=r.message||"Failed to connect",this.changeUIState("remote_connection")}})}loginToHosting(){return re(this,null,function*(){try{yield this._client.loginToHosting(this._email,this._passowrd),this.changeUIState("connected")}catch(r){r.message.includes("Passwords did not match")?this._passwordError="Passwords did not match":this._hostingNotRunningError="Hosting is not running"}})}changeEmail(r){this._email=r}changePassword(r){this._passowrd=r}unlockAgent(r,i=!0){return re(this,null,function*(){yield this._client.ad4mClient.agent.unlock(r,i)})}verifyCode(r){return re(this,null,function*(){try{yield this._client.verifyCode(r)}catch(i){this._verifyCodeError="Invalid code"}})}changeUrl(r){r!==this._client.url&&(fp("ad4mtoken"),this._client.setToken(null)),this._client.setUrl(r)}changePort(r){this._client.setPort(r)}changeUIState(r){this.uiState=r}setIsHostingRunning(r){this._hostingNotRunningError=r}changeIsRemote(r){this._isRemote=r}changeCode(r){this._code=r}onDownloaded(){this._hasClickedDownload=!0}handleAuthChange(r){let i=new CustomEvent("authstatechange",{detail:r});r==="locked"&&(this._isOpen=!0),r==="authenticated"&&(this._isOpen=!1),this.dispatchEvent(i),this.requestUpdate()}handleConfigChange(r,i){this[r]=i,i?Ec("ad4m"+r,i):fp("ad4m"+r),this.requestUpdate()}handleConnectionChange(r){if(r==="checking_local"){this._isOpen=!1;return}r==="connected"&&(this.authState!=="authenticated"?(this.changeUIState("requestcap"),this._isOpen=!0):(this.changeUIState("connected"),this._isOpen=!1)),r==="disconnected"&&(this._isOpen=!0),r==="not_connected"&&(this._isOpen=!0,this.multiUser&&this.backendUrl?this.changeUIState("multiuser_auth"):this.changeUIState("start"));let i=new CustomEvent("connectionstatechange",{detail:r});this.dispatchEvent(i),this.requestUpdate()}loadFont(){let r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.crossOrigin="anonymous",r.href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap",document.head.appendChild(r)}startCamera(r){return re(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(i){window.BarcodeDetector=Nr}yield this.changeUIState("qr"),setTimeout(()=>re(this,null,function*(){let i=this.shadowRoot.querySelector("video");if(!i)return;let n=yield navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:"environment"}});i.srcObject=n,i.autoplay=!0}),100)})}connect(){return re(this,null,function*(){this._isOpen=!0,this.requestUpdate();let r=yield this._client.connect();try{let i=yield r.agent.status();i.isUnlocked&&i.isInitialized&&window.location.reload()}catch(i){console.warn(i)}return r})}getAd4mClient(){return this._client.ad4mClient}connectRemote(r){return re(this,null,function*(){try{this.changeUrl(r);let i=yield this._client.connect(r),n=yield i.agent.status();return n.isUnlocked&&n.isInitialized||this.changeUIState("requestcap"),i}catch(i){this.changeUIState("requestcap"),this._isOpen=!0}})}requestCapability(r){return re(this,null,function*(){try{yield this._client.requestCapability(r),this.changeUIState("verifycode")}catch(i){console.warn(i)}})}isAuthenticated(){return re(this,null,function*(){return this._client.checkAuth()})}setOpen(r){this._isOpen=r}setHostingStep(r){this._hostingStep=r}clearState(){this.handleConfigChange("port",null),this.handleConfigChange("url",null),this.handleConfigChange("token",null),this.handleConnectionChange("not_connected"),this.handleAuthChange("unauthenticated"),this.changeUIState("start"),this._client.clearState()}renderViews(){if(this.connectionState==="connecting")return bp();if(this.uiState==="connection_overview")return hp({localDetected:this._localDetected,multiUserConfigured:this.multiUser&&!!this.backendUrl,backendUrl:this.backendUrl,configuredUrl:this.url,isMobile:this._isMobile,onConnectLocal:this.handleConnectLocal,onConnectRemote:this.handleShowRemoteConnection,onScanQR:()=>{this.startCamera(null)},onDownloadAd4m:()=>{window.open("https://github.com/coasys/ad4m/releases")}});if(this.uiState==="remote_connection")return wp({initialUrl:this._remoteUrl,detecting:this._remoteDetecting,multiUserDetected:this._remoteMultiUserDetected,error:this._remoteError,onBack:()=>this.changeUIState("connection_overview"),onUrlChange:this.handleRemoteUrlChange,onConnect:this.handleRemoteConnect,onMultiUserAuth:this.handleRemoteMultiUserAuth,onRequestCapability:this.handleRemoteRequestCapability});if(this.uiState==="multiuser_auth")return Sp({email:this._multiUserEmail,password:this._multiUserPassword,verificationCode:this._multiUserVerificationCode,error:this._multiUserError,isLoading:this._multiUserLoading,backendUrl:this.backendUrl,step:this._multiUserStep,verificationType:this._multiUserVerificationType,changeEmail:this.changeMultiUserEmail,changePassword:this.changeMultiUserPassword,changeVerificationCode:this.changeMultiUserVerificationCode,onEmailSubmit:this.handleMultiUserEmailSubmit,onPasswordSubmit:this.handleMultiUserPasswordSubmit,onCodeSubmit:this.handleMultiUserCodeSubmit,onBackToEmail:this.handleMultiUserBackToEmail});if(this.uiState==="hosting")return vp({email:this._email,password:this._passowrd,changeEmail:this.changeEmail,changePassword:this.changePassword,changeState:this.changeUIState,step:this._hostingStep,setHostingStep:this.setHostingStep,login:this.loginToHosting,checkEmail:this.checkEmail,passwordError:this._passwordError,isHostingRunning:this._hostingNotRunningError,setIsHostingRunning:this.setIsHostingRunning});if(this.uiState==="qr")return Ep({changeState:this.changeUIState,onSuccess:r=>{this.changeUrl(r),this._client.connect(r)},uiState:this.uiState});if(this.authState==="locked")return dp({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return xp({port:this.port,changePort:this.changePort,isRemote:this._isRemote,changeIsRemote:this.changeIsRemote,url:this.url,changeState:this.changeUIState,changeUrl:this.changeUrl,connectToPort:this._client.connectToPort,connectRemote:this.connectRemote,clearState:this.clearState});if(this.connectionState==="not_connected")return Ap({scanQrcode:this.startCamera,connect:this.connect,isMobile:this._isMobile,hasClickedDownload:this._hasClickedDownload,onDownloaded:this.onDownloaded,changeState:this.changeUIState,hosting:this.hosting});if(this.connectionState==="connected")return this.uiState==="verifycode"?kp({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode,isHosting:this._client.isHosting,verifyCodeError:this._verifyCodeError}):Cp({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return gp({reconnect:this.connect});if(this.connectionState==="port_not_found")return mp()}mobileView(){return this.mobile?_p({openModal:()=>{this.changeUIState("settings"),this._isOpen=!this._isOpen}}):null}render(){return console.log(this.authState,this.connectionState,this.uiState,this._isOpen),this._isOpen===!1?this.authState==="authenticated"?this.mobileView():null:L`
3009
+ `,ee=class extends Pr{constructor(){super(...arguments);this._code=null;this._isMobile=null;this._hasClickedDownload=null;this._isRemote=!1;this._isOpen=!1;this._hostingStep=0;this._email="";this._passowrd="";this._passwordError=null;this._hostingNotRunningError=null;this._verifyCodeError=null;this._isHostingLoading=!1;this._multiUserEmail="";this._multiUserPassword="";this._multiUserVerificationCode="";this._multiUserError=null;this._multiUserLoading=!1;this._codeSubmitTimeout=null;this._multiUserStep="email";this._multiUserVerificationType="login";this._localDetected=!1;this._remoteUrl="";this._remoteMultiUserDetected=null;this._remoteDetecting=!1;this._remoteError=null;this.uiState="connection_overview";this.appName=null;this.appDesc=null;this.appDomain=null;this.appIconPath=null;this.mobile=null;this.capabilities=[];this.hosting=Kt("ad4mhosting")==="true"||!1;this.token=Kt("ad4mToken")||"";this.port=parseInt(Kt("ad4mport"))||Or;this.url=Kt("ad4murl")||"";this.multiUser=!1;this.backendUrl=""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}injectFont(){let r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href","https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap"),document.head.appendChild(r)}connectedCallback(){super.connectedCallback(),Co(this),this.injectFont(),this._isMobile=j3(),this._client=new Eo({appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath,capabilities:Array.isArray(this.capabilities)?this.capabilities:JSON.parse(this.capabilities),port:this.port||parseInt(Kt("ad4mport"))||Or,token:this.token||Kt("ad4mtoken"),url:this.url||Kt("ad4murl"),hosting:this.hosting}),this._client.on("configstatechange",this.handleConfigChange),this._client.on("authstatechange",this.handleAuthChange),this._client.on("connectionstatechange",this.handleConnectionChange),this.loadFont(),this.token||Kt("ad4mtoken")?this.multiUser&&this.backendUrl?this._client.connect(this.backendUrl):this._client.connect():(this.detectLocal(),this.changeUIState("connection_overview"),this._isOpen=!0)}checkEmail(){return re(this,null,function*(){try{(yield this._client.checkEmail(this._email))?this._hostingStep=1:this._hostingStep=2}catch(r){console.log(r)}})}handleMultiUserEmailSubmit(){return re(this,null,function*(){try{this._multiUserLoading=!0,this._multiUserError=null;let r=this._client.buildTempClient(this.backendUrl),i={appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath},n=yield r.agent.requestLoginVerification(this._multiUserEmail,i);n.success&&!n.requiresPassword?(this._multiUserStep="code",this._multiUserVerificationType="login"):n.requiresPassword?(this._multiUserStep="password",this._multiUserVerificationType=n.isExistingUser?"login":"signup"):this._multiUserError=n.message||"Failed to send verification email"}catch(r){this._multiUserError=r.message||"Failed to process email. Please try again."}finally{this._multiUserLoading=!1}})}handleMultiUserPasswordSubmit(){return re(this,null,function*(){try{this._multiUserLoading=!0,this._multiUserError=null;let r=this._client.buildTempClient(this.backendUrl);if(this._multiUserVerificationType==="login")try{let i=yield r.agent.loginUser(this._multiUserEmail,this._multiUserPassword);this._client.setToken(i),this._client.setUrl(this.backendUrl),yield this._client.buildClient(),yield this._client.checkAuth(),this._multiUserEmail="",this._multiUserPassword="",this._multiUserVerificationCode="",this._multiUserStep="email",this._isOpen=!1,this.changeUIState("connected"),this.handleAuthChange("authenticated")}catch(i){this._multiUserError=i.message||"Invalid email or password. Please try again."}else{let i={appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath},n=yield r.agent.createUser(this._multiUserEmail,this._multiUserPassword,i);if(n.success)if(n.error&&n.error.includes("SMTP is not configured"))try{let a=yield r.agent.loginUser(this._multiUserEmail,this._multiUserPassword);this._client.setToken(a),this._client.setUrl(this.backendUrl),yield this._client.buildClient(),yield this._client.checkAuth(),this._multiUserEmail="",this._multiUserPassword="",this._multiUserVerificationCode="",this._multiUserStep="email",this._isOpen=!1,this.changeUIState("connected"),this.handleAuthChange("authenticated")}catch(a){this._multiUserError=a.message||"Account created but login failed. Please try logging in."}else n.error?this._multiUserError=n.error+" You can try logging in with your password.":(this._multiUserStep="code",this._multiUserVerificationType="signup");else this._multiUserError=n.error||"Failed to create account. Please try again."}}catch(r){this._multiUserError=r.message||"Failed to process request. Please try again."}finally{this._multiUserLoading=!1}})}handleMultiUserCodeSubmit(){return re(this,null,function*(){if(!this._multiUserLoading){this._codeSubmitTimeout!==null&&(clearTimeout(this._codeSubmitTimeout),this._codeSubmitTimeout=null);try{this._multiUserLoading=!0,this._multiUserError=null;let i=yield this._client.buildTempClient(this.backendUrl).agent.verifyEmailCode(this._multiUserEmail,this._multiUserVerificationCode,this._multiUserVerificationType);this._client.setToken(i),this._client.setUrl(this.backendUrl),yield this._client.buildClient(),yield this._client.checkAuth(),this._multiUserEmail="",this._multiUserPassword="",this._multiUserVerificationCode="",this._multiUserStep="email",this._isOpen=!1,this.changeUIState("connected"),this.handleAuthChange("authenticated")}catch(r){this._multiUserError="Invalid or expired code. Please try again.",this._multiUserVerificationCode=""}finally{this._multiUserLoading=!1}}})}handleMultiUserBackToEmail(){this._codeSubmitTimeout!==null&&(clearTimeout(this._codeSubmitTimeout),this._codeSubmitTimeout=null),this._multiUserStep="email",this._multiUserPassword="",this._multiUserVerificationCode="",this._multiUserError=null}changeMultiUserEmail(r){this._multiUserEmail=r,this._multiUserError=null}changeMultiUserPassword(r){this._multiUserPassword=r,this._multiUserError=null}changeMultiUserVerificationCode(r){this._codeSubmitTimeout!==null&&(clearTimeout(this._codeSubmitTimeout),this._codeSubmitTimeout=null),this._multiUserVerificationCode=r,this._multiUserError=null,r.length===6&&!this._multiUserLoading&&(this._codeSubmitTimeout=setTimeout(()=>{this._codeSubmitTimeout=null,this._multiUserVerificationCode.length===6&&!this._multiUserLoading&&this.handleMultiUserCodeSubmit()},100))}detectLocal(){return re(this,null,function*(){try{yield fi(`ws://localhost:${this.port}/graphql`,3e3),this._localDetected=!0}catch(r){console.log("[Ad4m Connect] Local detection failed:",r),this._localDetected=!1}})}verifyAd4mApi(r){return re(this,null,function*(){console.log("[Ad4m Connect] Verifying AD4M API at URL:",r);let i=this._client.buildTempClient(r);try{yield i.runtime.info(),console.log("[Ad4m Connect] AD4M API verified")}catch(n){throw console.error("[Ad4m Connect] Failed to verify AD4M API:",n),new Error("Server is reachable but doesn't appear to be an AD4M executor. Make sure the URL includes '/graphql'.")}})}detectRemoteMultiUser(r){return re(this,null,function*(){console.log("[Ad4m Connect] Detecting multi-user mode for URL:",r);let i=this._client.buildTempClient(r);try{let n=yield i.runtime.multiUserEnabled();return console.log("[Ad4m Connect] Multi-user detection result:",n),n}catch(n){return console.error("[Ad4m Connect] Failed to detect multi-user mode:",n),console.error("[Ad4m Connect] Error details:",n.message,n.stack),!1}})}handleConnectLocal(){return re(this,null,function*(){try{this.changeUIState("requestcap"),yield this._client.connect()}catch(r){console.error("Failed to connect to local AD4M:",r),this.changeUIState("connection_overview")}})}handleShowRemoteConnection(){this._remoteUrl=this.backendUrl||this.url||"",this._remoteMultiUserDetected=null,this._remoteError=null,this.changeUIState("remote_connection")}handleRemoteUrlChange(r){this._remoteUrl=r,this._remoteError=null}handleRemoteConnect(){return re(this,null,function*(){if(!this._remoteUrl){this._remoteError="Please enter a URL";return}this._remoteDetecting=!0,this._remoteError=null,this._remoteMultiUserDetected=null;try{console.log("[Ad4m Connect] Checking if server is reachable:",this._remoteUrl),yield fi(this._remoteUrl,5e3),console.log("[Ad4m Connect] Server is reachable"),yield this.verifyAd4mApi(this._remoteUrl);let r=yield this.detectRemoteMultiUser(this._remoteUrl);this._remoteMultiUserDetected=r,this._remoteDetecting=!1}catch(r){console.error("[Ad4m Connect] Connection/detection failed:",r),this._remoteError=r.message||"Cannot reach server at this URL. Please check the URL and try again.",this._remoteMultiUserDetected=null,this._remoteDetecting=!1}})}handleRemoteMultiUserAuth(){return re(this,null,function*(){this.backendUrl=this._remoteUrl,this.changeUIState("multiuser_auth")})}handleRemoteRequestCapability(){return re(this,null,function*(){try{this.changeUIState("requestcap"),yield this._client.connect(this._remoteUrl)}catch(r){this._remoteError=r.message||"Failed to connect",this.changeUIState("remote_connection")}})}loginToHosting(){return re(this,null,function*(){try{yield this._client.loginToHosting(this._email,this._passowrd),this.changeUIState("connected")}catch(r){r.message.includes("Passwords did not match")?this._passwordError="Passwords did not match":this._hostingNotRunningError="Hosting is not running"}})}changeEmail(r){this._email=r}changePassword(r){this._passowrd=r}unlockAgent(r,i=!0){return re(this,null,function*(){yield this._client.ad4mClient.agent.unlock(r,i)})}verifyCode(r){return re(this,null,function*(){try{yield this._client.verifyCode(r)}catch(i){this._verifyCodeError="Invalid code"}})}changeUrl(r){r!==this._client.url&&(fp("ad4mtoken"),this._client.setToken(null)),this._client.setUrl(r)}changePort(r){this._client.setPort(r)}changeUIState(r){this.uiState=r}setIsHostingRunning(r){this._hostingNotRunningError=r}changeIsRemote(r){this._isRemote=r}changeCode(r){this._code=r}onDownloaded(){this._hasClickedDownload=!0}handleAuthChange(r){let i=new CustomEvent("authstatechange",{detail:r});r==="locked"&&(this._isOpen=!0),r==="authenticated"&&(this._isOpen=!1),this.dispatchEvent(i),this.requestUpdate()}handleConfigChange(r,i){this[r]=i,i?Ec("ad4m"+r,i):fp("ad4m"+r),this.requestUpdate()}handleConnectionChange(r){if(r==="checking_local"){this._isOpen=!1;return}r==="connected"&&(this.authState!=="authenticated"?(this.changeUIState("requestcap"),this._isOpen=!0):(this.changeUIState("connected"),this._isOpen=!1)),r==="disconnected"&&(this._isOpen=!0),r==="not_connected"&&(this._isOpen=!0,this.multiUser&&this.backendUrl?this.changeUIState("multiuser_auth"):this.changeUIState("start"));let i=new CustomEvent("connectionstatechange",{detail:r});this.dispatchEvent(i),this.requestUpdate()}loadFont(){let r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.crossOrigin="anonymous",r.href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap",document.head.appendChild(r)}startCamera(r){return re(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(i){window.BarcodeDetector=Nr}yield this.changeUIState("qr"),setTimeout(()=>re(this,null,function*(){let i=this.shadowRoot.querySelector("video");if(!i)return;let n=yield navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:"environment"}});i.srcObject=n,i.autoplay=!0}),100)})}connect(){return re(this,null,function*(){this._isOpen=!0,this.requestUpdate();let r=yield this._client.connect();try{let i=yield r.agent.status();i.isUnlocked&&i.isInitialized&&window.location.reload()}catch(i){console.warn(i)}return r})}getAd4mClient(){return this._client.ad4mClient}connectRemote(r){return re(this,null,function*(){try{this.changeUrl(r);let i=yield this._client.connect(r),n=yield i.agent.status();return n.isUnlocked&&n.isInitialized||this.changeUIState("requestcap"),i}catch(i){this.changeUIState("requestcap"),this._isOpen=!0}})}requestCapability(r){return re(this,null,function*(){try{yield this._client.requestCapability(r),this.changeUIState("verifycode")}catch(i){console.warn(i)}})}isAuthenticated(){return re(this,null,function*(){return this._client.checkAuth()})}setOpen(r){this._isOpen=r}setHostingStep(r){this._hostingStep=r}clearState(){this.handleConfigChange("port",null),this.handleConfigChange("url",null),this.handleConfigChange("token",null),this.handleConnectionChange("not_connected"),this.handleAuthChange("unauthenticated"),this.changeUIState("start"),this._client.clearState()}renderViews(){if(this.connectionState==="connecting")return bp();if(this.uiState==="connection_overview")return hp({localDetected:this._localDetected,multiUserConfigured:this.multiUser&&!!this.backendUrl,backendUrl:this.backendUrl,configuredUrl:this.url,isMobile:this._isMobile,onConnectLocal:this.handleConnectLocal,onConnectRemote:this.handleShowRemoteConnection,onScanQR:()=>{this.startCamera(null)},onDownloadAd4m:()=>{window.open("https://github.com/coasys/ad4m/releases")}});if(this.uiState==="remote_connection")return wp({initialUrl:this._remoteUrl,detecting:this._remoteDetecting,multiUserDetected:this._remoteMultiUserDetected,error:this._remoteError,onBack:()=>this.changeUIState("connection_overview"),onUrlChange:this.handleRemoteUrlChange,onConnect:this.handleRemoteConnect,onMultiUserAuth:this.handleRemoteMultiUserAuth,onRequestCapability:this.handleRemoteRequestCapability});if(this.uiState==="multiuser_auth")return Sp({email:this._multiUserEmail,password:this._multiUserPassword,verificationCode:this._multiUserVerificationCode,error:this._multiUserError,isLoading:this._multiUserLoading,backendUrl:this.backendUrl,step:this._multiUserStep,verificationType:this._multiUserVerificationType,changeEmail:this.changeMultiUserEmail,changePassword:this.changeMultiUserPassword,changeVerificationCode:this.changeMultiUserVerificationCode,onEmailSubmit:this.handleMultiUserEmailSubmit,onPasswordSubmit:this.handleMultiUserPasswordSubmit,onCodeSubmit:this.handleMultiUserCodeSubmit,onBackToEmail:this.handleMultiUserBackToEmail});if(this.uiState==="hosting")return vp({email:this._email,password:this._passowrd,changeEmail:this.changeEmail,changePassword:this.changePassword,changeState:this.changeUIState,step:this._hostingStep,setHostingStep:this.setHostingStep,login:this.loginToHosting,checkEmail:this.checkEmail,passwordError:this._passwordError,isHostingRunning:this._hostingNotRunningError,setIsHostingRunning:this.setIsHostingRunning});if(this.uiState==="qr")return Ep({changeState:this.changeUIState,onSuccess:r=>{this.changeUrl(r),this._client.connect(r)},uiState:this.uiState});if(this.authState==="locked")return dp({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return xp({port:this.port,changePort:this.changePort,isRemote:this._isRemote,changeIsRemote:this.changeIsRemote,url:this.url,changeState:this.changeUIState,changeUrl:this.changeUrl,connectToPort:this._client.connectToPort,connectRemote:this.connectRemote,clearState:this.clearState});if(this.connectionState==="not_connected")return Ap({scanQrcode:this.startCamera,connect:this.connect,isMobile:this._isMobile,hasClickedDownload:this._hasClickedDownload,onDownloaded:this.onDownloaded,changeState:this.changeUIState,hosting:this.hosting});if(this.connectionState==="connected")return this.uiState==="verifycode"?kp({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode,isHosting:this._client.isHosting,verifyCodeError:this._verifyCodeError}):Cp({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return gp({reconnect:this.connect});if(this.connectionState==="port_not_found")return mp()}mobileView(){return this.mobile?_p({openModal:()=>{this.changeUIState("settings"),this._isOpen=!this._isOpen}}):null}render(){return console.log(this.authState,this.connectionState,this.uiState,this._isOpen),this._isOpen===!1?this.authState==="authenticated"?this.mobileView():null:L`
3007
3010
  <div class="wrapper">
3008
3011
  <div class="dialog">
3009
3012
  ${yp()}