@well-played.gg/react-sdk 1.15.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wp-react-sdk.cjs.js +19 -19
- package/dist/wp-react-sdk.es.js +2096 -2096
- package/dist/wp-react-sdk.umd.js +14 -14
- package/package.json +1 -1
package/dist/wp-react-sdk.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Gt,
|
|
1
|
+
(function(Gt,ie){typeof exports=="object"&&typeof module<"u"?ie(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],ie):(Gt=typeof globalThis<"u"?globalThis:Gt||self,ie(Gt.WellPlayedReactSDK={},Gt.React,Gt.ReactDOM))})(this,function(Gt,ie,oC){"use strict";function aC(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Ph=function(t,e){return Ph=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Ph(t,e)};function pr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ph(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var C=function(){return C=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},C.apply(this,arguments)};function Tn(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Ki(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})}function Ji(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function wt(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var Fh="Invariant Violation",g0=Object.setPrototypeOf,lC=g0===void 0?function(t,e){return t.__proto__=e,t}:g0,y0=function(t){pr(e,t);function e(n){n===void 0&&(n=Fh);var r=t.call(this,typeof n=="number"?Fh+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=Fh,lC(r,e.prototype),r}return e}(Error);function Hs(t,e){if(!t)throw new y0(e)}var nu=["debug","log","warn","error","silent"],Lh=nu.indexOf("log");function ru(t){return function(){if(nu.indexOf(t)>=Lh){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=ru("debug"),t.log=ru("log"),t.warn=ru("warn"),t.error=ru("error")})(Hs||(Hs={}));function $h(t){var e=nu[Lh];return Lh=Math.max(0,nu.indexOf(t)),e}var Vh="3.11.10";function mr(t){try{return t()}catch{}}const jh=mr(function(){return globalThis})||mr(function(){return window})||mr(function(){return self})||mr(function(){return global})||mr(function(){return mr.constructor("return this")()});var v0=new Map;function iu(t){var e=v0.get(t)||1;return v0.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Bh(t,e){e===void 0&&(e=0);var n=iu("stringifyForDisplay");return JSON.stringify(t,function(r,i){return i===void 0?n:i},e).split(JSON.stringify(n)).join("<undefined>")}function su(t){return function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(typeof e=="number"){var i=e;e=Uh(i),e||(e=qh(i,n),n=[])}t.apply(void 0,[e].concat(n))}}var se=Object.assign(function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];e||Hs(e,Uh(n,r)||qh(n,r))},{debug:su(Hs.debug),log:su(Hs.log),warn:su(Hs.warn),error:su(Hs.error)});function Sn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new y0(Uh(t,e)||qh(t,e))}var b0=Symbol.for("ApolloErrorMessageHandler_"+Vh);function _0(t){if(typeof t=="string")return t;try{return Bh(t,2).slice(0,1e3)}catch{return"<non-serializable>"}}function Uh(t,e){if(e===void 0&&(e=[]),!!t)return jh[b0]&&jh[b0](t,e.map(_0))}function qh(t,e){if(e===void 0&&(e=[]),!!t)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:Vh,message:t,args:e.map(_0)})))}var cC=globalThis.__DEV__!==!1;const uC="16.9.0",fC=Object.freeze({major:16,minor:9,patch:0,preReleaseTag:null});function $e(t,e){if(!!!t)throw new Error(e)}function Zn(t){return typeof(t==null?void 0:t.then)=="function"}function er(t){return typeof t=="object"&&t!==null}function xt(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}const dC=/\r\n|[\n\r]/g;function ou(t,e){let n=0,r=1;for(const i of t.body.matchAll(dC)){if(typeof i.index=="number"||xt(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function E0(t){return Wh(t.source,ou(t.source,t.start))}function Wh(t,e){const n=t.locationOffset.column-1,r="".padStart(n)+t.body,i=e.line-1,s=t.locationOffset.line-1,o=e.line+s,a=e.line===1?n:0,l=e.column+a,u=`${t.name}:${o}:${l}
|
|
2
2
|
`,d=r.split(/\r\n|[\n\r]/g),h=d[i];if(h.length>120){const p=Math.floor(l/80),g=l%80,y=[];for(let b=0;b<h.length;b+=80)y.push(h.slice(b,b+80));return u+w0([[`${o} |`,y[0]],...y.slice(1,p+1).map(b=>["|",b]),["|","^".padStart(g)],["|",y[p+1]]])}return u+w0([[`${o-1} |`,d[i-1]],[`${o} |`,h],["|","^".padStart(l)],[`${o+1} |`,d[i+1]]])}function w0(t){const e=t.filter(([r,i])=>i!==void 0),n=Math.max(...e.map(([r])=>r.length));return e.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(`
|
|
3
3
|
`)}function hC(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}let j=class tC extends Error{constructor(e,...n){var r,i,s;const{nodes:o,source:a,positions:l,path:u,originalError:d,extensions:h}=hC(n);super(e),this.name="GraphQLError",this.path=u??void 0,this.originalError=d??void 0,this.nodes=T0(Array.isArray(o)?o:o?[o]:void 0);const p=T0((r=this.nodes)===null||r===void 0?void 0:r.map(y=>y.loc).filter(y=>y!=null));this.source=a??(p==null||(i=p[0])===null||i===void 0?void 0:i.source),this.positions=l??(p==null?void 0:p.map(y=>y.start)),this.locations=l&&a?l.map(y=>ou(a,y)):p==null?void 0:p.map(y=>ou(y.source,y.start));const g=er(d==null?void 0:d.extensions)?d==null?void 0:d.extensions:void 0;this.extensions=(s=h??g)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),d!=null&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,tC):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+=`
|
|
4
4
|
|
|
@@ -174,15 +174,15 @@ ${e.join(`
|
|
|
174
174
|
`+e+")"}function Wp(t){const e=is(t.defaultValue,t.type);let n=t.name+": "+String(t.type);return e&&(n+=` = ${dt(e)}`),n+zp(t.deprecationReason)}function LM(t){return br(t)+"directive @"+t.name+wE(t.args)+(t.isRepeatable?" repeatable":"")+" on "+t.locations.join(" | ")}function zp(t){return t==null?"":t!==ap?` @deprecated(reason: ${dt({kind:k.STRING,value:t})})`:" @deprecated"}function $M(t){return t.specifiedByURL==null?"":` @specifiedBy(url: ${dt({kind:k.STRING,value:t.specifiedByURL})})`}function br(t,e="",n=!0){const{description:r}=t;if(r==null)return"";const i=dt({kind:k.STRING,value:r,block:bC(r)});return(e&&!n?`
|
|
175
175
|
`+e:e)+i.replace(/\n/g,`
|
|
176
176
|
`+e)+`
|
|
177
|
-
`}function VM(t){const e=[];for(const n of t)e.push(...n.definitions);return{kind:k.DOCUMENT,definitions:e}}function jM(t){const e=[],n=Object.create(null);for(const i of t.definitions)switch(i.kind){case k.OPERATION_DEFINITION:e.push(i);break;case k.FRAGMENT_DEFINITION:n[i.name.value]=SE(i.selectionSet);break}const r=Object.create(null);for(const i of e){const s=new Set;for(const a of SE(i.selectionSet))TE(s,n,a);const o=i.name?i.name.value:"";r[o]={kind:k.DOCUMENT,definitions:t.definitions.filter(a=>a===i||a.kind===k.FRAGMENT_DEFINITION&&s.has(a.name.value))}}return r}function TE(t,e,n){if(!t.has(n)){t.add(n);const r=e[n];if(r!==void 0)for(const i of r)TE(t,e,i)}}function SE(t){const e=[];return en(t,{FragmentSpread(n){e.push(n.name.value)}}),e}function BM(t){const e=R0(t)?t:new cu(t),n=e.body,r=new Kh(e);let i="",s=!1;for(;r.advance().kind!==W.EOF;){const o=r.token,a=o.kind,l=!I0(o.kind);s&&(l||o.kind===W.SPREAD)&&(i+=" ");const u=n.slice(o.start,o.end);a===W.BLOCK_STRING?i+=A0(o.value,{minimize:!0}):i+=u,s=l}return i}function UM(t){const e=OE(t);if(e)throw e;return t}function OE(t){if(typeof t=="string"||$e(!1,"Expected name to be a string."),t.startsWith("__"))return new j(`Name "${t}" must not begin with "__", which is reserved by GraphQL introspection.`);try{tr(t)}catch(e){return e}}var kt;(function(t){t.TYPE_REMOVED="TYPE_REMOVED",t.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",t.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",t.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",t.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",t.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",t.FIELD_REMOVED="FIELD_REMOVED",t.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",t.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",t.ARG_REMOVED="ARG_REMOVED",t.ARG_CHANGED_KIND="ARG_CHANGED_KIND",t.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",t.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",t.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",t.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",t.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"})(kt||(kt={}));var Wr;(function(t){t.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",t.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",t.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",t.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",t.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",t.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"})(Wr||(Wr={}));function qM(t,e){return kE(t,e).filter(n=>n.type in kt)}function WM(t,e){return kE(t,e).filter(n=>n.type in Wr)}function kE(t,e){return[...QM(t,e),...zM(t,e)]}function zM(t,e){const n=[],r=Ti(t.getDirectives(),e.getDirectives());for(const i of r.removed)n.push({type:kt.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(const[i,s]of r.persisted){const o=Ti(i.args,s.args);for(const a of o.added)ts(a)&&n.push({type:kt.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${a.name} on directive ${i.name} was added.`});for(const a of o.removed)n.push({type:kt.DIRECTIVE_ARG_REMOVED,description:`${a.name} was removed from ${i.name}.`});i.isRepeatable&&!s.isRepeatable&&n.push({type:kt.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(const a of i.locations)s.locations.includes(a)||n.push({type:kt.DIRECTIVE_LOCATION_REMOVED,description:`${a} was removed from ${i.name}.`})}return n}function QM(t,e){const n=[],r=Ti(Object.values(t.getTypeMap()),Object.values(e.getTypeMap()));for(const i of r.removed)n.push({type:kt.TYPE_REMOVED,description:_u(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(const[i,s]of r.persisted)Ft(i)&&Ft(s)?n.push(...KM(i,s)):Bt(i)&&Bt(s)?n.push(...HM(i,s)):ht(i)&&ht(s)?n.push(...GM(i,s)):Ye(i)&&Ye(s)?n.push(...AE(i,s),...NE(i,s)):st(i)&&st(s)?n.push(...AE(i,s),...NE(i,s)):i.constructor!==s.constructor&&n.push({type:kt.TYPE_CHANGED_KIND,description:`${i.name} changed from ${IE(i)} to ${IE(s)}.`});return n}function GM(t,e){const n=[],r=Ti(Object.values(t.getFields()),Object.values(e.getFields()));for(const i of r.added)gu(i)?n.push({type:kt.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${t.name} was added.`}):n.push({type:Wr.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i.name} on input type ${t.name} was added.`});for(const i of r.removed)n.push({type:kt.FIELD_REMOVED,description:`${t.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)Sl(i.type,s.type)||n.push({type:kt.FIELD_CHANGED_KIND,description:`${t.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function HM(t,e){const n=[],r=Ti(t.getTypes(),e.getTypes());for(const i of r.added)n.push({type:Wr.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${t.name}.`});for(const i of r.removed)n.push({type:kt.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${t.name}.`});return n}function KM(t,e){const n=[],r=Ti(t.getValues(),e.getValues());for(const i of r.added)n.push({type:Wr.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${t.name}.`});for(const i of r.removed)n.push({type:kt.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${t.name}.`});return n}function NE(t,e){const n=[],r=Ti(t.getInterfaces(),e.getInterfaces());for(const i of r.added)n.push({type:Wr.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${t.name}.`});for(const i of r.removed)n.push({type:kt.IMPLEMENTED_INTERFACE_REMOVED,description:`${t.name} no longer implements interface ${i.name}.`});return n}function AE(t,e){const n=[],r=Ti(Object.values(t.getFields()),Object.values(e.getFields()));for(const i of r.removed)n.push({type:kt.FIELD_REMOVED,description:`${t.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)n.push(...JM(t,i,s)),Tl(i.type,s.type)||n.push({type:kt.FIELD_CHANGED_KIND,description:`${t.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function JM(t,e,n){const r=[],i=Ti(e.args,n.args);for(const s of i.removed)r.push({type:kt.ARG_REMOVED,description:`${t.name}.${e.name} arg ${s.name} was removed.`});for(const[s,o]of i.persisted)if(!Sl(s.type,o.type))r.push({type:kt.ARG_CHANGED_KIND,description:`${t.name}.${e.name} arg ${s.name} has changed type from ${String(s.type)} to ${String(o.type)}.`});else if(s.defaultValue!==void 0)if(o.defaultValue===void 0)r.push({type:Wr.ARG_DEFAULT_VALUE_CHANGE,description:`${t.name}.${e.name} arg ${s.name} defaultValue was removed.`});else{const l=xE(s.defaultValue,s.type),u=xE(o.defaultValue,o.type);l!==u&&r.push({type:Wr.ARG_DEFAULT_VALUE_CHANGE,description:`${t.name}.${e.name} arg ${s.name} has changed defaultValue from ${l} to ${u}.`})}for(const s of i.added)ts(s)?r.push({type:kt.REQUIRED_ARG_ADDED,description:`A required arg ${s.name} on ${t.name}.${e.name} was added.`}):r.push({type:Wr.OPTIONAL_ARG_ADDED,description:`An optional arg ${s.name} on ${t.name}.${e.name} was added.`});return r}function Tl(t,e){return gt(t)?gt(e)&&Tl(t.ofType,e.ofType)||Ae(e)&&Tl(t,e.ofType):Ae(t)?Ae(e)&&Tl(t.ofType,e.ofType):dl(e)&&t.name===e.name||Ae(e)&&Tl(t,e.ofType)}function Sl(t,e){return gt(t)?gt(e)&&Sl(t.ofType,e.ofType):Ae(t)?Ae(e)&&Sl(t.ofType,e.ofType)||!Ae(e)&&Sl(t.ofType,e):dl(e)&&t.name===e.name}function IE(t){if(nr(t))return"a Scalar type";if(Ye(t))return"an Object type";if(st(t))return"an Interface type";if(Bt(t))return"a Union type";if(Ft(t))return"an Enum type";if(ht(t))return"an Input type";xt(!1,"Unexpected type: "+z(t))}function xE(t,e){const n=is(t,e);return n!=null||xt(!1),dt(Ou(n))}function Ti(t,e){const n=[],r=[],i=[],s=Ei(t,({name:a})=>a),o=Ei(e,({name:a})=>a);for(const a of t){const l=o[a.name];l===void 0?r.push(a):i.push([a,l])}for(const a of e)s[a.name]===void 0&&n.push(a);return{added:n,persisted:i,removed:r}}const YM=Object.freeze(Object.defineProperty({__proto__:null,BREAK:Zi,get BreakingChangeType(){return kt},DEFAULT_DEPRECATION_REASON:ap,get DangerousChangeType(){return Wr},get DirectiveLocation(){return pe},ExecutableDefinitionsRule:i_,FieldsOnCorrectTypeRule:s_,FragmentsOnCompositeTypesRule:o_,GRAPHQL_MAX_INT:vu,GRAPHQL_MIN_INT:bu,GraphQLBoolean:jn,GraphQLDeprecatedDirective:wu,GraphQLDirective:Ur,GraphQLEnumType:ns,GraphQLError:j,GraphQLFloat:Y0,GraphQLID:ip,GraphQLIncludeDirective:sp,GraphQLInputObjectType:Yo,GraphQLInt:J0,GraphQLInterfaceType:Ko,GraphQLList:tn,GraphQLNonNull:Ve,GraphQLObjectType:yr,GraphQLOneOfDirective:cp,GraphQLScalarType:ii,GraphQLSchema:Xo,GraphQLSkipDirective:op,GraphQLSpecifiedByDirective:lp,GraphQLString:Ot,GraphQLUnionType:Jo,get Kind(){return k},KnownArgumentNamesRule:a_,KnownDirectivesRule:Ip,KnownFragmentNamesRule:c_,KnownTypeNamesRule:xp,Lexer:Kh,Location:S0,LoneAnonymousOperationRule:f_,LoneSchemaDefinitionRule:d_,MaxIntrospectionDepthRule:h_,NoDeprecatedCustomRule:gM,NoFragmentCyclesRule:p_,NoSchemaIntrospectionCustomRule:yM,NoUndefinedVariablesRule:m_,NoUnusedFragmentsRule:g_,NoUnusedVariablesRule:y_,get OperationTypeNode(){return jt},OverlappingFieldsCanBeMergedRule:b_,PossibleFragmentSpreadsRule:T_,PossibleTypeExtensionsRule:S_,ProvidedRequiredArgumentsRule:O_,ScalarLeafsRule:N_,SchemaMetaFieldDef:gl,SingleFieldSubscriptionsRule:R_,Source:cu,Token:zh,get TokenKind(){return W},TypeInfo:wp,get TypeKind(){return lt},TypeMetaFieldDef:yl,TypeNameMetaFieldDef:vl,UniqueArgumentDefinitionNamesRule:P_,UniqueArgumentNamesRule:Lp,UniqueDirectiveNamesRule:F_,UniqueDirectivesPerLocationRule:$p,UniqueEnumValueNamesRule:L_,UniqueFieldDefinitionNamesRule:$_,UniqueFragmentNamesRule:V_,UniqueInputFieldNamesRule:Vp,UniqueOperationNamesRule:j_,UniqueOperationTypesRule:B_,UniqueTypeNamesRule:U_,UniqueVariableNamesRule:q_,ValidationContext:J_,ValuesOfCorrectTypeRule:W_,VariablesAreInputTypesRule:z_,VariablesInAllowedPositionRule:Q_,__Directive:dp,__DirectiveLocation:hp,__EnumValue:mp,__Field:pp,__InputValue:ml,__Schema:Tu,__Type:vr,__TypeKind:gp,assertAbstractType:iD,assertCompositeType:rD,assertDirective:cD,assertEnumType:JC,assertEnumValueName:j0,assertInputObjectType:YC,assertInputType:eD,assertInterfaceType:U0,assertLeafType:nD,assertListType:XC,assertName:tr,assertNamedType:oD,assertNonNullType:ZC,assertNullableType:q0,assertObjectType:B0,assertOutputType:tD,assertScalarType:HC,assertSchema:yp,assertType:GC,assertUnionType:KC,assertValidName:UM,assertValidSchema:bp,assertWrappingType:sD,astFromValue:is,buildASTSchema:gE,buildClientSchema:EM,buildSchema:SM,coerceInputValue:I_,concatAST:VM,createSourceEventStream:fE,defaultFieldResolver:Bp,defaultTypeResolver:aE,doTypesOverlap:rp,execute:Cu,executeSync:eE,extendSchema:wM,findBreakingChanges:qM,findDangerousChanges:WM,formatError:mC,getArgumentValues:Iu,getDirectiveValues:ta,getEnterLeaveForKind:Go,getIntrospectionQuery:dE,getLocation:ou,getNamedType:On,getNullableType:ep,getOperationAST:vM,getOperationRootType:bM,getVariableValues:C_,getVisitFn:WC,graphql:uM,graphqlSync:fM,introspectionFromSchema:_M,introspectionTypes:bl,isAbstractType:ri,isCompositeType:ni,isConstValueNode:kp,isDefinitionNode:wD,isDirective:Eu,isEnumType:Ft,isEqualType:yu,isExecutableDefinitionNode:Sp,isInputObjectType:ht,isInputType:Vn,isInterfaceType:st,isIntrospectionType:Ys,isLeafType:ti,isListType:gt,isNamedType:dl,isNonNullType:Ae,isNullableType:Zh,isObjectType:Ye,isOutputType:es,isRequiredArgument:ts,isRequiredInputField:gu,isScalarType:nr,isSchema:Z0,isSelectionNode:Op,isSpecifiedDirective:up,isSpecifiedScalarType:_u,isType:ul,isTypeDefinitionNode:Zo,isTypeExtensionNode:Su,isTypeNode:TD,isTypeSubTypeOf:Js,isTypeSystemDefinitionNode:Np,isTypeSystemExtensionNode:Ap,isUnionType:Bt,isValidNameError:OE,isValueNode:r_,isWrappingType:fl,lexicographicSortSchema:OM,locatedError:na,parse:ll,parseConstValue:PC,parseType:FC,parseValue:P0,print:dt,printError:pC,printIntrospectionSchema:NM,printLocation:E0,printSchema:kM,printSourceLocation:Wh,printType:bE,recommendedRules:G_,resolveObjMapThunk:np,resolveReadonlyArrayThunk:tp,responsePathAsArray:kn,separateOperations:jM,specifiedDirectives:rs,specifiedRules:H_,specifiedScalarTypes:hl,stripIgnoredCharacters:BM,subscribe:hM,syntaxError:Vt,typeFromAST:Bn,validate:Y_,validateSchema:vp,valueFromAST:si,valueFromASTUntyped:pu,version:uC,versionInfo:fC,visit:en,visitInParallel:Xh,visitWithTypeInfo:Tp},Symbol.toStringTag,{value:"Module"}));function ra(t,e){var n=t.directives;return!n||!n.length?!0:DE(n).every(function(r){var i=r.directive,s=r.ifArgument,o=!1;return s.value.kind==="Variable"?(o=e&&e[s.value.name.value],ie(o!==void 0,70,i.name.value)):o=s.value.value,i.name.value==="skip"?!o:o})}function XM(t){var e=[];return en(t,{Directive:function(n){e.push(n.name.value)}}),e}var ZM=function(t,e){return ss(t,e,!1)},eR=function(t,e){return ss(t,e,!0)};function ss(t,e,n){var r=new Set(t),i=r.size;return en(e,{Directive:function(s){if(r.delete(s.name.value)&&(!n||!r.size))return Zi}}),n?!r.size:r.size<i}function CE(t){return t&&ss(["client","export"],t,!0)}function tR(t){var e=t.name.value;return e==="skip"||e==="include"}function DE(t){var e=[];return t&&t.length&&t.forEach(function(n){if(tR(n)){var r=n.arguments,i=n.name.value;ie(r&&r.length===1,71,i);var s=r[0];ie(s.name&&s.name.value==="if",72,i);var o=s.value;ie(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),73,i),e.push({directive:n,ifArgument:s})}}),e}const nR=()=>Object.create(null),{forEach:rR,slice:ME}=Array.prototype,{hasOwnProperty:iR}=Object.prototype;let eo=class nC{constructor(e=!0,n=nR){this.weakness=e,this.makeData=n}lookup(){return this.lookupArray(arguments)}lookupArray(e){let n=this;return rR.call(e,r=>n=n.getChildTrie(r)),iR.call(n,"data")?n.data:n.data=this.makeData(ME.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let n=this;for(let r=0,i=e.length;n&&r<i;++r){const s=n.mapFor(e[r],!1);n=s&&s.get(e[r])}return n&&n.data}remove(){return this.removeArray(arguments)}removeArray(e){let n;if(e.length){const r=e[0],i=this.mapFor(r,!1),s=i&&i.get(r);s&&(n=s.removeArray(ME.call(e,1)),!s.data&&!s.weak&&!(s.strong&&s.strong.size)&&i.delete(r))}else n=this.data,delete this.data;return n}getChildTrie(e){const n=this.mapFor(e,!0);let r=n.get(e);return r||n.set(e,r=new nC(this.weakness,this.makeData)),r}mapFor(e,n){return this.weakness&&sR(e)?this.weak||(n?this.weak=new WeakMap:void 0):this.strong||(n?this.strong=new Map:void 0)}};function sR(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var RE=mr(function(){return navigator.product})=="ReactNative",as=typeof WeakMap=="function"&&!(RE&&!global.HermesInternal),Qp=typeof WeakSet=="function",Lu=typeof Symbol=="function"&&typeof Symbol.for=="function",Ol=Lu&&Symbol.asyncIterator,Gp=typeof mr(function(){return window.document.createElement})=="function",oR=mr(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,PE=(Gp||RE)&&!oR;function yt(t){return t!==null&&typeof t=="object"}function FE(t){return t!==null&&typeof t=="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function LE(t,e){var n=e,r=[];t.definitions.forEach(function(s){if(s.kind==="OperationDefinition")throw Sn(74,s.operation,s.name?" named '".concat(s.name.value,"'"):"");s.kind==="FragmentDefinition"&&r.push(s)}),typeof n>"u"&&(ie(r.length===1,75,r.length),n=r[0].name.value);var i=C(C({},t),{definitions:wt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],t.definitions,!0)});return i}function kl(t){t===void 0&&(t=[]);var e={};return t.forEach(function(n){e[n.name.value]=n}),e}function Nl(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var n=t.name.value;if(typeof e=="function")return e(n);var r=e&&e[n];return ie(r,76,n),r||null}default:return null}}function aR(){}class Hp{constructor(e=1/0,n=aR){this.max=e,this.dispose=n,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const n=this.getNode(e);return n&&n.value}get size(){return this.map.size}getNode(e){const n=this.map.get(e);if(n&&n!==this.newest){const{older:r,newer:i}=n;i&&(i.older=r),r&&(r.newer=i),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=i)}return n}set(e,n){let r=this.getNode(e);return r?r.value=n:(r={key:e,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const n=this.map.get(e);return n?(n===this.newest&&(this.newest=n.older),n===this.oldest&&(this.oldest=n.newer),n.newer&&(n.newer.older=n.older),n.older&&(n.older.newer=n.newer),this.map.delete(e),this.dispose(n.value,e),!0):!1}}function Kp(){}const lR=Kp,cR=typeof WeakRef<"u"?WeakRef:function(t){return{deref:()=>t}},uR=typeof WeakMap<"u"?WeakMap:Map,fR=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:Kp,unregister:Kp}},dR=10024;class $u{constructor(e=1/0,n=lR){this.max=e,this.dispose=n,this.map=new uR,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const r=this.unfinalizedNodes.values();for(let i=0;i<dR;i++){const s=r.next().value;if(!s)break;this.unfinalizedNodes.delete(s);const o=s.key;delete s.key,s.keyRef=new cR(o),this.registry.register(o,s,s)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new fR(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const n=this.getNode(e);return n&&n.value}getNode(e){const n=this.map.get(e);if(n&&n!==this.newest){const{older:r,newer:i}=n;i&&(i.older=r),r&&(r.newer=i),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=i)}return n}set(e,n){let r=this.getNode(e);return r?r.value=n:(r={key:e,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.scheduleFinalization(r),this.map.set(e,r),this.size++,r.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const n=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,n),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),n&&this.map.delete(n)}delete(e){const n=this.map.get(e);return n?(this.deleteNode(n),!0):!1}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var Jp=new WeakSet;function $E(t){t.size<=(t.max||-1)||Jp.has(t)||(Jp.add(t),setTimeout(function(){t.clean(),Jp.delete(t)},100))}var Vu=function(t,e){var n=new $u(t,e);return n.set=function(r,i){var s=$u.prototype.set.call(this,r,i);return $E(this),s},n},VE=function(t,e){var n=new Hp(t,e);return n.set=function(r,i){var s=Hp.prototype.set.call(this,r,i);return $E(this),s},n},hR=Symbol.for("apollo.cacheSize"),zr=C({},jh[hR]),to={};function Yp(t,e){to[t]=e}var pR=globalThis.__DEV__!==!1?vR:void 0,mR=globalThis.__DEV__!==!1?bR:void 0,gR=globalThis.__DEV__!==!1?jE:void 0;function yR(){var t={parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4};return Object.fromEntries(Object.entries(t).map(function(e){var n=e[0],r=e[1];return[n,zr[n]||r]}))}function vR(){var t,e,n,r,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:yR(),sizes:C({print:(t=to.print)===null||t===void 0?void 0:t.call(to),parser:(e=to.parser)===null||e===void 0?void 0:e.call(to),canonicalStringify:(n=to.canonicalStringify)===null||n===void 0?void 0:n.call(to),links:Zp(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:UE(this.queryManager.documentTransform)}},(i=(r=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(r))}}function jE(){return{cache:{fragmentQueryDocuments:ls(this.getFragmentDoc)}}}function bR(){var t=this.config.fragments;return C(C({},jE.apply(this)),{addTypenameDocumentTransform:UE(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:ls(this.storeReader.executeSelectionSet),executeSubSelectedArray:ls(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:ls(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:ls(t==null?void 0:t.findFragmentSpreads),lookup:ls(t==null?void 0:t.lookup),transform:ls(t==null?void 0:t.transform)}})}function _R(t){return!!t&&"dirtyKey"in t}function ls(t){return _R(t)?t.size:void 0}function BE(t){return t!=null}function UE(t){return Xp(t).map(function(e){return{cache:e}})}function Xp(t){return t?wt(wt([ls(t==null?void 0:t.performWork)],Xp(t==null?void 0:t.left),!0),Xp(t==null?void 0:t.right),!0).filter(BE):[]}function Zp(t){var e;return t?wt(wt([(e=t==null?void 0:t.getMemoryInternals)===null||e===void 0?void 0:e.call(t)],Zp(t==null?void 0:t.left),!0),Zp(t==null?void 0:t.right),!0).filter(BE):[]}var _r=Object.assign(function(e){return JSON.stringify(e,ER)},{reset:function(){ia=new VE(zr.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&Yp("canonicalStringify",function(){return ia.size});var ia;_r.reset();function ER(t,e){if(e&&typeof e=="object"){var n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){var r=Object.keys(e);if(r.every(wR))return e;var i=JSON.stringify(r),s=ia.get(i);if(!s){r.sort();var o=JSON.stringify(r);s=ia.get(o)||r,ia.set(i,s),ia.set(o,s)}var a=Object.create(n);return s.forEach(function(l){a[l]=e[l]}),a}}return e}function wR(t,e,n){return e===0||n[e-1]<=t}function Si(t){return{__ref:String(t)}}function et(t){return!!(t&&typeof t=="object"&&typeof t.__ref=="string")}function qE(t){return yt(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function TR(t){return t.kind==="StringValue"}function SR(t){return t.kind==="BooleanValue"}function OR(t){return t.kind==="IntValue"}function kR(t){return t.kind==="FloatValue"}function NR(t){return t.kind==="Variable"}function AR(t){return t.kind==="ObjectValue"}function IR(t){return t.kind==="ListValue"}function xR(t){return t.kind==="EnumValue"}function CR(t){return t.kind==="NullValue"}function no(t,e,n,r){if(OR(n)||kR(n))t[e.value]=Number(n.value);else if(SR(n)||TR(n))t[e.value]=n.value;else if(AR(n)){var i={};n.fields.map(function(o){return no(i,o.name,o.value,r)}),t[e.value]=i}else if(NR(n)){var s=(r||{})[n.name.value];t[e.value]=s}else if(IR(n))t[e.value]=n.values.map(function(o){var a={};return no(a,e,o,r),a[e.value]});else if(xR(n))t[e.value]=n.value;else if(CR(n))t[e.value]=null;else throw Sn(85,e.value,n.kind)}function WE(t,e){var n=null;t.directives&&(n={},t.directives.forEach(function(i){n[i.name.value]={},i.arguments&&i.arguments.forEach(function(s){var o=s.name,a=s.value;return no(n[i.name.value],o,a,e)})}));var r=null;return t.arguments&&t.arguments.length&&(r={},t.arguments.forEach(function(i){var s=i.name,o=i.value;return no(r,s,o,e)})),em(t.name.value,r,n)}var DR=["connection","include","skip","client","rest","export","nonreactive"],Al=_r,em=Object.assign(function(t,e,n){if(e&&n&&n.connection&&n.connection.key)if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach(function(a){i[a]=e[a]}),"".concat(n.connection.key,"(").concat(Al(i),")")}else return n.connection.key;var s=t;if(e){var o=Al(e);s+="(".concat(o,")")}return n&&Object.keys(n).forEach(function(a){DR.indexOf(a)===-1&&(n[a]&&Object.keys(n[a]).length?s+="@".concat(a,"(").concat(Al(n[a]),")"):s+="@".concat(a))}),s},{setStringify:function(t){var e=Al;return Al=t,e}});function Il(t,e){if(t.arguments&&t.arguments.length){var n={};return t.arguments.forEach(function(r){var i=r.name,s=r.value;return no(n,i,s,e)}),n}return null}function Oi(t){return t.alias?t.alias.value:t.name.value}function ju(t,e,n){for(var r,i=0,s=e.selections;i<s.length;i++){var o=s[i];if(ki(o)){if(o.name.value==="__typename")return t[Oi(o)]}else r?r.push(o):r=[o]}if(typeof t.__typename=="string")return t.__typename;if(r)for(var a=0,l=r;a<l.length;a++){var o=l[a],u=ju(t,Nl(o,n).selectionSet,n);if(typeof u=="string")return u}}function ki(t){return t.kind==="Field"}function zE(t){return t.kind==="InlineFragment"}function ro(t){ie(t&&t.kind==="Document",77);var e=t.definitions.filter(function(n){return n.kind!=="FragmentDefinition"}).map(function(n){if(n.kind!=="OperationDefinition")throw Sn(78,n.kind);return n});return ie(e.length<=1,79,e.length),t}function io(t){return ro(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Bu(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function xl(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function tm(t){var e=io(t);return ie(e&&e.operation==="query",80),e}function QE(t){ie(t.kind==="Document",81),ie(t.definitions.length<=1,82);var e=t.definitions[0];return ie(e.kind==="FragmentDefinition",83),e}function so(t){ro(t);for(var e,n=0,r=t.definitions;n<r.length;n++){var i=r[n];if(i.kind==="OperationDefinition"){var s=i.operation;if(s==="query"||s==="mutation"||s==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw Sn(84)}function Uu(t){var e=Object.create(null),n=t&&t.variableDefinitions;return n&&n.length&&n.forEach(function(r){r.defaultValue&&no(e,r.variable.name,r.defaultValue)}),e}const MR=()=>Object.create(null),{forEach:RR,slice:PR}=Array.prototype,{hasOwnProperty:FR}=Object.prototype;class nm{constructor(e=!0,n=MR){this.weakness=e,this.makeData=n}lookup(...e){return this.lookupArray(e)}lookupArray(e){let n=this;return RR.call(e,r=>n=n.getChildTrie(r)),FR.call(n,"data")?n.data:n.data=this.makeData(PR.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let n=this;for(let r=0,i=e.length;n&&r<i;++r){const s=this.weakness&&GE(e[r])?n.weak:n.strong;n=s&&s.get(e[r])}return n&&n.data}getChildTrie(e){const n=this.weakness&&GE(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let r=n.get(e);return r||n.set(e,r=new nm(this.weakness,this.makeData)),r}}function GE(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}let nn=null;const HE={};let LR=1;const $R=()=>class{constructor(){this.id=["slot",LR++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=nn;e;e=e.parent)if(this.id in e.slots){const n=e.slots[this.id];if(n===HE)break;return e!==nn&&(nn.slots[this.id]=n),!0}return nn&&(nn.slots[this.id]=HE),!1}getValue(){if(this.hasValue())return nn.slots[this.id]}withValue(e,n,r,i){const s={__proto__:null,[this.id]:e},o=nn;nn={parent:o,slots:s};try{return n.apply(i,r)}finally{nn=o}}static bind(e){const n=nn;return function(){const r=nn;try{return nn=n,e.apply(this,arguments)}finally{nn=r}}}static noContext(e,n,r){if(nn){const i=nn;try{return nn=null,e.apply(r,n)}finally{nn=i}}else return e.apply(r,n)}};function KE(t){try{return t()}catch{}}const rm="@wry/context:Slot",JE=KE(()=>globalThis)||KE(()=>global)||Object.create(null),im=JE[rm]||Array[rm]||function(t){try{Object.defineProperty(JE,rm,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}($R()),{bind:fae,noContext:dae}=im,qu=new im,{hasOwnProperty:VR}=Object.prototype,sm=Array.from||function(t){const e=[];return t.forEach(n=>e.push(n)),e};function om(t){const{unsubscribe:e}=t;typeof e=="function"&&(t.unsubscribe=void 0,e())}const Cl=[],jR=100;function sa(t,e){if(!t)throw new Error(e||"assertion failure")}function YE(t,e){const n=t.length;return n>0&&n===e.length&&t[n-1]===e[n-1]}function XE(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function ZE(t){return t.slice(0)}class Wu{constructor(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,++Wu.count}peek(){if(this.value.length===1&&!cs(this))return ew(this),this.value[0]}recompute(e){return sa(!this.recomputing,"already recomputing"),ew(this),cs(this)?BR(this,e):XE(this.value)}setDirty(){this.dirty||(this.dirty=!0,tw(this),om(this))}dispose(){this.setDirty(),ow(this),am(this,(e,n)=>{e.setDirty(),aw(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=Cl.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(sm(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),Cl.push(this.deps),this.deps=null)}}Wu.count=0;function ew(t){const e=qu.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),cs(t)?rw(e,t):iw(e,t),e}function BR(t,e){return ow(t),qu.withValue(t,UR,[t,e]),WR(t,e)&&qR(t),XE(t.value)}function UR(t,e){t.recomputing=!0;const{normalizeResult:n}=t;let r;n&&t.value.length===1&&(r=ZE(t.value)),t.value.length=0;try{if(t.value[0]=t.fn.apply(null,e),n&&r&&!YE(r,t.value))try{t.value[0]=n(t.value[0],r[0])}catch{}}catch(i){t.value[1]=i}t.recomputing=!1}function cs(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function qR(t){t.dirty=!1,!cs(t)&&nw(t)}function tw(t){am(t,rw)}function nw(t){am(t,iw)}function am(t,e){const n=t.parents.size;if(n){const r=sm(t.parents);for(let i=0;i<n;++i)e(r[i],t)}}function rw(t,e){sa(t.childValues.has(e)),sa(cs(e));const n=!cs(t);if(!t.dirtyChildren)t.dirtyChildren=Cl.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),n&&tw(t)}function iw(t,e){sa(t.childValues.has(e)),sa(!cs(e));const n=t.childValues.get(e);n.length===0?t.childValues.set(e,ZE(e.value)):YE(n,e.value)||t.setDirty(),sw(t,e),!cs(t)&&nw(t)}function sw(t,e){const n=t.dirtyChildren;n&&(n.delete(e),n.size===0&&(Cl.length<jR&&Cl.push(n),t.dirtyChildren=null))}function ow(t){t.childValues.size>0&&t.childValues.forEach((e,n)=>{aw(t,n)}),t.forgetDeps(),sa(t.dirtyChildren===null)}function aw(t,e){e.parents.delete(t),t.childValues.delete(e),sw(t,e)}function WR(t,e){if(typeof t.subscribe=="function")try{om(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}const zR={setDirty:!0,dispose:!0,forget:!0};function lw(t){const e=new Map;function n(r){const i=qu.getValue();if(i){let s=e.get(r);s||e.set(r,s=new Set),i.dependOn(s)}}return n.dirty=function(i,s){const o=e.get(i);if(o){const a=s&&VR.call(zR,s)?s:"setDirty";sm(o).forEach(l=>l[a]()),e.delete(i),om(o)}},n}let cw;function QR(...t){return(cw||(cw=new nm(typeof WeakMap=="function"))).lookupArray(t)}const lm=new Set;function Dl(t,{max:e=Math.pow(2,16),keyArgs:n,makeCacheKey:r=QR,normalizeResult:i,subscribe:s,cache:o=Hp}=Object.create(null)){const a=typeof o=="function"?new o(e,p=>p.dispose()):o,l=function(){const p=r.apply(null,n?n.apply(null,arguments):arguments);if(p===void 0)return t.apply(null,arguments);let g=a.get(p);g||(a.set(p,g=new Wu(t)),g.normalizeResult=i,g.subscribe=s,g.forget=()=>a.delete(p));const y=g.recompute(Array.prototype.slice.call(arguments));return a.set(p,g),lm.add(a),qu.hasValue()||(lm.forEach(b=>b.clean()),lm.clear()),y};Object.defineProperty(l,"size",{get:()=>a.size,configurable:!1,enumerable:!1}),Object.freeze(l.options={max:e,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:s,cache:a});function u(p){const g=p&&a.get(p);g&&g.setDirty()}l.dirtyKey=u,l.dirty=function(){u(r.apply(null,arguments))};function d(p){const g=p&&a.get(p);if(g)return g.peek()}l.peekKey=d,l.peek=function(){return d(r.apply(null,arguments))};function h(p){return p?a.delete(p):!1}return l.forgetKey=h,l.forget=function(){return h(r.apply(null,arguments))},l.makeCacheKey=r,l.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(l)}function GR(t){return t}var Ml=function(){function t(e,n){n===void 0&&(n=Object.create(null)),this.resultCache=Qp?new WeakSet:new Set,this.transform=e,n.getCacheKey&&(this.getCacheKey=n.getCacheKey),this.cached=n.cache!==!1,this.resetCache()}return t.prototype.getCacheKey=function(e){return[e]},t.identity=function(){return new t(GR,{cache:!1})},t.split=function(e,n,r){return r===void 0&&(r=t.identity()),Object.assign(new t(function(i){var s=e(i)?n:r;return s.transformDocument(i)},{cache:!1}),{left:n,right:r})},t.prototype.resetCache=function(){var e=this;if(this.cached){var n=new eo(as);this.performWork=Dl(t.prototype.performWork.bind(this),{makeCacheKey:function(r){var i=e.getCacheKey(r);if(i)return ie(Array.isArray(i),69),n.lookupArray(i)},max:zr["documentTransform.cache"],cache:$u})}},t.prototype.performWork=function(e){return ro(e),this.transform(e)},t.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var n=this.performWork(e);return this.resultCache.add(n),n},t.prototype.concat=function(e){var n=this;return Object.assign(new t(function(r){return e.transformDocument(n.transformDocument(r))},{cache:!1}),{left:this,right:e})},t}(),Rl,oa=Object.assign(function(t){var e=Rl.get(t);return e||(e=dt(t),Rl.set(t,e)),e},{reset:function(){Rl=new Vu(zr.print||2e3)}});oa.reset(),globalThis.__DEV__!==!1&&Yp("print",function(){return Rl?Rl.size:0});var Tt=Array.isArray;function Un(t){return Array.isArray(t)&&t.length>0}var uw={kind:k.FIELD,name:{kind:k.NAME,value:"__typename"}};function fw(t,e){return!t||t.selectionSet.selections.every(function(n){return n.kind===k.FRAGMENT_SPREAD&&fw(e[n.name.value],e)})}function cm(t){return fw(io(t)||QE(t),kl(xl(t)))?null:t}function HR(t){var e=new Map,n=new Map;return t.forEach(function(r){r&&(r.name?e.set(r.name,r):r.test&&n.set(r.test,r))}),function(r){var i=e.get(r.name.value);return!i&&n.size&&n.forEach(function(s,o){o(r)&&(i=s)}),i}}function dw(t){var e=new Map;return function(r){r===void 0&&(r=t);var i=e.get(r);return i||e.set(r,i={variables:new Set,fragmentSpreads:new Set}),i}}function zu(t,e){ro(e);for(var n=dw(""),r=dw(""),i=function(w){for(var O=0,N=void 0;O<w.length&&(N=w[O]);++O)if(!Tt(N)){if(N.kind===k.OPERATION_DEFINITION)return n(N.name&&N.name.value);if(N.kind===k.FRAGMENT_DEFINITION)return r(N.name.value)}return globalThis.__DEV__!==!1&&ie.error(86),null},s=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===k.OPERATION_DEFINITION&&++s;var a=HR(t),l=function(w){return Un(w)&&w.map(a).some(function(O){return O&&O.remove})},u=new Map,d=!1,h={enter:function(w){if(l(w.directives))return d=!0,null}},p=en(e,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(w,O,N,I,P){var R=i(P);R&&R.variables.add(w.name.value)}},FragmentSpread:{enter:function(w,O,N,I,P){if(l(w.directives))return d=!0,null;var R=i(P);R&&R.fragmentSpreads.add(w.name.value)}},FragmentDefinition:{enter:function(w,O,N,I){u.set(JSON.stringify(I),w)},leave:function(w,O,N,I){var P=u.get(JSON.stringify(I));if(w===P)return w;if(s>0&&w.selectionSet.selections.every(function(R){return R.kind===k.FIELD&&R.name.value==="__typename"}))return r(w.name.value).removed=!0,d=!0,null}},Directive:{leave:function(w){if(a(w))return d=!0,null}}});if(!d)return e;var g=function(w){return w.transitiveVars||(w.transitiveVars=new Set(w.variables),w.removed||w.fragmentSpreads.forEach(function(O){g(r(O)).transitiveVars.forEach(function(N){w.transitiveVars.add(N)})})),w},y=new Set;p.definitions.forEach(function(w){w.kind===k.OPERATION_DEFINITION?g(n(w.name&&w.name.value)).fragmentSpreads.forEach(function(O){y.add(O)}):w.kind===k.FRAGMENT_DEFINITION&&s===0&&!r(w.name.value).removed&&y.add(w.name.value)}),y.forEach(function(w){g(r(w)).fragmentSpreads.forEach(function(O){y.add(O)})});var b=function(w){return!!(!y.has(w)||r(w).removed)},_={enter:function(w){if(b(w.name.value))return null}};return cm(en(p,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(w){if(w.variableDefinitions){var O=g(n(w.name&&w.name.value)).transitiveVars;if(O.size<w.variableDefinitions.length)return C(C({},w),{variableDefinitions:w.variableDefinitions.filter(function(N){return O.has(N.variable.name.value)})})}}}}))}var Qu=Object.assign(function(t){return en(t,{SelectionSet:{enter:function(e,n,r){if(!(r&&r.kind===k.OPERATION_DEFINITION)){var i=e.selections;if(i){var s=i.some(function(a){return ki(a)&&(a.name.value==="__typename"||a.name.value.lastIndexOf("__",0)===0)});if(!s){var o=r;if(!(ki(o)&&o.directives&&o.directives.some(function(a){return a.name.value==="export"})))return C(C({},e),{selections:wt(wt([],i,!0),[uw],!1)})}}}}}})},{added:function(t){return t===uw}}),KR={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(n){return n.name.value==="key"}))&&globalThis.__DEV__!==!1&&ie.warn(87),e}};function JR(t){return zu([KR],ro(t))}function YR(t){return function(n){return t.some(function(r){return n.value&&n.value.kind===k.VARIABLE&&n.value.name&&(r.name===n.value.name.value||r.test&&r.test(n))})}}function XR(t,e){var n=YR(t);return cm(en(e,{OperationDefinition:{enter:function(r){return C(C({},r),{variableDefinitions:r.variableDefinitions?r.variableDefinitions.filter(function(i){return!t.some(function(s){return s.name===i.variable.name.value})}):[]})}},Field:{enter:function(r){var i=t.some(function(o){return o.remove});if(i){var s=0;if(r.arguments&&r.arguments.forEach(function(o){n(o)&&(s+=1)}),s===1)return null}}},Argument:{enter:function(r){if(n(r))return null}}}))}function ZR(t,e){function n(r){if(t.some(function(i){return i.name===r.name.value}))return null}return cm(en(e,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}function hw(t){var e=so(t),n=e.operation;if(n==="query")return t;var r=en(t,{OperationDefinition:{enter:function(i){return C(C({},i),{operation:"query"})}}});return r}function um(t){ro(t);var e=zu([{test:function(n){return n.name.value==="client"},remove:!0}],t);return e}function fm(t,e){var n;return((n=io(t))===null||n===void 0?void 0:n.operation)===e}function eP(t){return fm(t,"mutation")}function tP(t){return fm(t,"query")}function nP(t){return fm(t,"subscription")}var rP=Object.prototype.hasOwnProperty;function Pl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return aa(t)}function aa(t){var e=t[0]||{},n=t.length;if(n>1)for(var r=new Ni,i=1;i<n;++i)e=r.merge(e,t[i]);return e}var iP=function(t,e,n){return this.merge(t[n],e[n])},Ni=function(){function t(e){e===void 0&&(e=iP),this.reconciler=e,this.isObject=yt,this.pastCopies=new Set}return t.prototype.merge=function(e,n){for(var r=this,i=[],s=2;s<arguments.length;s++)i[s-2]=arguments[s];return yt(n)&&yt(e)?(Object.keys(n).forEach(function(o){if(rP.call(e,o)){var a=e[o];if(n[o]!==a){var l=r.reconciler.apply(r,wt([e,n,o],i,!1));l!==a&&(e=r.shallowCopyForMerge(e),e[o]=l)}}else e=r.shallowCopyForMerge(e),e[o]=n[o]}),e):n},t.prototype.shallowCopyForMerge=function(e){return yt(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 sP(t){return t===void 0&&(t=!1),{keyArgs:t,merge:function(e,n){return e?wt(wt([],e,!0),n,!0):n}}}function oP(t){return t===void 0&&(t=!1),{keyArgs:t,merge:function(e,n,r){var i=r.args,s=e?e.slice(0):[];if(n)if(i)for(var o=i.offset,a=o===void 0?0:o,l=0;l<n.length;++l)s[a+l]=n[l];else s.push.apply(s,n);return s}}}function aP(t){return t===void 0&&(t=!1),{keyArgs:t,read:function(e,n){var r=n.canRead,i=n.readField;if(!e)return e;var s=[],o="",a="";e.edges.forEach(function(h){r(i("node",h))&&(s.push(h),h.cursor&&(o=o||h.cursor||"",a=h.cursor||a))}),s.length>1&&o===a&&(o="");var l=e.pageInfo||{},u=l.startCursor,d=l.endCursor;return C(C({},dm(e)),{edges:s,pageInfo:C(C({},e.pageInfo),{startCursor:u||o,endCursor:d||a})})},merge:function(e,n,r){var i=r.args,s=r.isReference,o=r.readField;if(e||(e=cP()),!n)return e;var a=n.edges?n.edges.map(function(Q){return s(Q=C({},Q))&&(Q.cursor=o("cursor",Q)),Q}):[];if(n.pageInfo){var l=n.pageInfo,u=l.startCursor,d=l.endCursor,h=a[0],p=a[a.length-1];h&&u&&(h.cursor=u),p&&d&&(p.cursor=d);var g=h&&h.cursor;g&&!u&&(n=Pl(n,{pageInfo:{startCursor:g}}));var y=p&&p.cursor;y&&!d&&(n=Pl(n,{pageInfo:{endCursor:y}}))}var b=e.edges,_=[];if(i&&i.after){var w=b.findIndex(function(Q){return Q.cursor===i.after});w>=0&&(b=b.slice(0,w+1))}else if(i&&i.before){var w=b.findIndex(function(x){return x.cursor===i.before});_=w<0?b:b.slice(w),b=[]}else n.edges&&(b=[]);var O=wt(wt(wt([],b,!0),a,!0),_,!0),N=C(C({},n.pageInfo),e.pageInfo);if(n.pageInfo){var I=n.pageInfo,P=I.hasPreviousPage,R=I.hasNextPage,u=I.startCursor,d=I.endCursor,B=Tn(I,["hasPreviousPage","hasNextPage","startCursor","endCursor"]);Object.assign(N,B),b.length||(P!==void 0&&(N.hasPreviousPage=P),u!==void 0&&(N.startCursor=u)),_.length||(R!==void 0&&(N.hasNextPage=R),d!==void 0&&(N.endCursor=d))}return C(C(C({},dm(e)),dm(n)),{edges:O,pageInfo:N})}}}var dm=function(t){return Tn(t,lP)},lP=["edges","pageInfo"];function cP(){return{edges:[],pageInfo:{hasPreviousPage:!1,hasNextPage:!0,startCursor:"",endCursor:""}}}function uP(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=fP(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
178
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fP(t,e){if(t){if(typeof t=="string")return pw(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pw(t,e)}}function pw(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function mw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function hm(t,e,n){return e&&mw(t.prototype,e),n&&mw(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var pm=function(){return typeof Symbol=="function"},mm=function(t){return pm()&&!!Symbol[t]},gm=function(t){return mm(t)?Symbol[t]:"@@"+t};pm()&&!mm("observable")&&(Symbol.observable=Symbol("observable"));var dP=gm("iterator"),ym=gm("observable"),gw=gm("species");function Gu(t,e){var n=t[e];if(n!=null){if(typeof n!="function")throw new TypeError(n+" is not a function");return n}}function Fl(t){var e=t.constructor;return e!==void 0&&(e=e[gw],e===null&&(e=void 0)),e!==void 0?e:Xe}function hP(t){return t instanceof Xe}function la(t){la.log?la.log(t):setTimeout(function(){throw t})}function Hu(t){Promise.resolve().then(function(){try{t()}catch(e){la(e)}})}function yw(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var n=Gu(e,"unsubscribe");n&&n.call(e)}}catch(r){la(r)}}function vm(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function pP(t){var e=t._queue;if(e){t._queue=void 0,t._state="ready";for(var n=0;n<e.length&&(vw(t,e[n].type,e[n].value),t._state!=="closed");++n);}}function vw(t,e,n){t._state="running";var r=t._observer;try{var i=Gu(r,e);switch(e){case"next":i&&i.call(r,n);break;case"error":if(vm(t),i)i.call(r,n);else throw n;break;case"complete":vm(t),i&&i.call(r);break}}catch(s){la(s)}t._state==="closed"?yw(t):t._state==="running"&&(t._state="ready")}function bm(t,e,n){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:n});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:n}],Hu(function(){return pP(t)});return}vw(t,e,n)}}var mP=function(){function t(n,r){this._cleanup=void 0,this._observer=n,this._queue=void 0,this._state="initializing";var i=new gP(this);try{this._cleanup=r.call(void 0,i)}catch(s){i.error(s)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(vm(this),yw(this))},hm(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),gP=function(){function t(n){this._subscription=n}var e=t.prototype;return e.next=function(r){bm(this._subscription,"next",r)},e.error=function(r){bm(this._subscription,"error",r)},e.complete=function(){bm(this._subscription,"complete")},hm(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),Xe=function(){function t(n){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof n!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=n}var e=t.prototype;return e.subscribe=function(r){return(typeof r!="object"||r===null)&&(r={next:r,error:arguments[1],complete:arguments[2]}),new mP(r,this._subscriber)},e.forEach=function(r){var i=this;return new Promise(function(s,o){if(typeof r!="function"){o(new TypeError(r+" is not a function"));return}function a(){l.unsubscribe(),s()}var l=i.subscribe({next:function(u){try{r(u,a)}catch(d){o(d),l.unsubscribe()}},error:o,complete:s})})},e.map=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=Fl(this);return new s(function(o){return i.subscribe({next:function(a){try{a=r(a)}catch(l){return o.error(l)}o.next(a)},error:function(a){o.error(a)},complete:function(){o.complete()}})})},e.filter=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=Fl(this);return new s(function(o){return i.subscribe({next:function(a){try{if(!r(a))return}catch(l){return o.error(l)}o.next(a)},error:function(a){o.error(a)},complete:function(){o.complete()}})})},e.reduce=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=Fl(this),o=arguments.length>1,a=!1,l=arguments[1],u=l;return new s(function(d){return i.subscribe({next:function(h){var p=!a;if(a=!0,!p||o)try{u=r(u,h)}catch(g){return d.error(g)}else u=h},error:function(h){d.error(h)},complete:function(){if(!a&&!o)return d.error(new TypeError("Cannot reduce an empty sequence"));d.next(u),d.complete()}})})},e.concat=function(){for(var r=this,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];var a=Fl(this);return new a(function(l){var u,d=0;function h(p){u=p.subscribe({next:function(g){l.next(g)},error:function(g){l.error(g)},complete:function(){d===s.length?(u=void 0,l.complete()):h(a.from(s[d++]))}})}return h(r),function(){u&&(u.unsubscribe(),u=void 0)}})},e.flatMap=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=Fl(this);return new s(function(o){var a=[],l=i.subscribe({next:function(d){if(r)try{d=r(d)}catch(p){return o.error(p)}var h=s.from(d).subscribe({next:function(p){o.next(p)},error:function(p){o.error(p)},complete:function(){var p=a.indexOf(h);p>=0&&a.splice(p,1),u()}});a.push(h)},error:function(d){o.error(d)},complete:function(){u()}});function u(){l.closed&&a.length===0&&o.complete()}return function(){a.forEach(function(d){return d.unsubscribe()}),l.unsubscribe()}})},e[ym]=function(){return this},t.from=function(r){var i=typeof this=="function"?this:t;if(r==null)throw new TypeError(r+" is not an object");var s=Gu(r,ym);if(s){var o=s.call(r);if(Object(o)!==o)throw new TypeError(o+" is not an object");return hP(o)&&o.constructor===i?o:new i(function(a){return o.subscribe(a)})}if(mm("iterator")&&(s=Gu(r,dP),s))return new i(function(a){Hu(function(){if(!a.closed){for(var l=uP(s.call(r)),u;!(u=l()).done;){var d=u.value;if(a.next(d),a.closed)return}a.complete()}})});if(Array.isArray(r))return new i(function(a){Hu(function(){if(!a.closed){for(var l=0;l<r.length;++l)if(a.next(r[l]),a.closed)return;a.complete()}})});throw new TypeError(r+" is not observable")},t.of=function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];var o=typeof this=="function"?this:t;return new o(function(a){Hu(function(){if(!a.closed){for(var l=0;l<i.length;++l)if(a.next(i[l]),a.closed)return;a.complete()}})})},hm(t,null,[{key:gw,get:function(){return this}}]),t}();pm()&&Object.defineProperty(Xe,Symbol("extensions"),{value:{symbol:ym,hostReportError:la},configurable:!0});function yP(t){var e,n=t.Symbol;if(typeof n=="function")if(n.observable)e=n.observable;else{typeof n.for=="function"?e=n.for("https://github.com/benlesh/symbol-observable"):e=n("https://github.com/benlesh/symbol-observable");try{n.observable=e}catch{}}else e="@@observable";return e}var ca;typeof self<"u"?ca=self:typeof window<"u"?ca=window:typeof global<"u"?ca=global:typeof module<"u"?ca=module:ca=Function("return this")(),yP(ca);var bw=Xe.prototype,_w="@@observable";bw[_w]||(bw[_w]=function(){return this});function Ku(t){var e=Promise.resolve(t);return e.status="fulfilled",e.value=t,e}function Ew(t){var e=Promise.reject(t);return e.catch(function(){}),e.status="rejected",e.reason=t,e}function ww(t){return"status"in t}function _m(t){if(ww(t))return t;var e=t;return e.status="pending",e.then(function(n){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=n}},function(n){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=n}}),t}var vP=Object.prototype.toString;function Em(t){return wm(t)}function wm(t,e){switch(vP.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var n=t.slice(0);return e.set(t,n),n.forEach(function(i,s){n[s]=wm(i,e)}),n}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var r=Object.create(Object.getPrototypeOf(t));return e.set(t,r),Object.keys(t).forEach(function(i){r[i]=wm(t[i],e)}),r}default:return t}}function bP(t){var e=new Set([t]);return e.forEach(function(n){yt(n)&&_P(n)===n&&Object.getOwnPropertyNames(n).forEach(function(r){yt(n[r])&&e.add(n[r])})}),t}function _P(t){if(globalThis.__DEV__!==!1&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function ua(t){return globalThis.__DEV__!==!1&&bP(t),t}function fa(t,e,n){var r=[];t.forEach(function(i){return i[e]&&r.push(i)}),r.forEach(function(i){return i[e](n)})}function Ju(t,e,n){return new Xe(function(r){var i={then:function(l){return new Promise(function(u){return u(l())})}};function s(l,u){return function(d){if(l){var h=function(){return r.closed?0:l(d)};i=i.then(h,h).then(function(p){return r.next(p)},function(p){return r.error(p)})}else r[u](d)}}var o={next:s(e,"next"),error:s(n,"error"),complete:function(){i.then(function(){return r.complete()})}},a=t.subscribe(o);return function(){return a.unsubscribe()}})}function Tm(t){function e(n){Object.defineProperty(t,n,{value:Xe})}return Lu&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Tw(t){return t&&typeof t.then=="function"}var oo=function(t){pr(e,t);function e(n){var r=t.call(this,function(i){return r.addObserver(i),function(){return r.removeObserver(i)}})||this;return r.observers=new Set,r.promise=new Promise(function(i,s){r.resolve=i,r.reject=s}),r.handlers={next:function(i){r.sub!==null&&(r.latest=["next",i],r.notify("next",i),fa(r.observers,"next",i))},error:function(i){var s=r.sub;s!==null&&(s&&setTimeout(function(){return s.unsubscribe()}),r.sub=null,r.latest=["error",i],r.reject(i),r.notify("error",i),fa(r.observers,"error",i))},complete:function(){var i=r,s=i.sub,o=i.sources,a=o===void 0?[]:o;if(s!==null){var l=a.shift();l?Tw(l)?l.then(function(u){return r.sub=u.subscribe(r.handlers)},r.handlers.error):r.sub=l.subscribe(r.handlers):(s&&setTimeout(function(){return s.unsubscribe()}),r.sub=null,r.latest&&r.latest[0]==="next"?r.resolve(r.latest[1]):r.resolve(),r.notify("complete"),fa(r.observers,"complete"))}}},r.nextResultListeners=new Set,r.cancel=function(i){r.reject(i),r.sources=[],r.handlers.error(i)},r.promise.catch(function(i){}),typeof n=="function"&&(n=[new Xe(n)]),Tw(n)?n.then(function(i){return r.start(i)},r.handlers.error):r.start(n),r}return e.prototype.start=function(n){this.sub===void 0&&(this.sources=Array.from(n),this.handlers.complete())},e.prototype.deliverLastMessage=function(n){if(this.latest){var r=this.latest[0],i=n[r];i&&i.call(n,this.latest[1]),this.sub===null&&r==="next"&&n.complete&&n.complete()}},e.prototype.addObserver=function(n){this.observers.has(n)||(this.deliverLastMessage(n),this.observers.add(n))},e.prototype.removeObserver=function(n){this.observers.delete(n)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(n,r){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(s){return s(n,r)}))},e.prototype.beforeNext=function(n){var r=!1;this.nextResultListeners.add(function(i,s){r||(r=!0,n(i,s))})},e}(Xe);Tm(oo);function ao(t){return"incremental"in t}function Sw(t){return"hasNext"in t&&"data"in t}function Ow(t){return ao(t)||Sw(t)}function kw(t){return yt(t)&&"payload"in t}function Sm(t,e){var n=t,r=new Ni;return ao(e)&&Un(e.incremental)&&e.incremental.forEach(function(i){for(var s=i.data,o=i.path,a=o.length-1;a>=0;--a){var l=o[a],u=!isNaN(+l),d=u?[]:{};d[l]=s,s=d}n=r.merge(n,s)}),n}function Ll(t){var e=Yu(t);return Un(e)}function Yu(t){var e=Un(t.errors)?t.errors.slice(0):[];return ao(t)&&Un(t.incremental)&&t.incremental.forEach(function(n){n.errors&&e.push.apply(e,n.errors)}),e}function us(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Object.create(null);return t.forEach(function(r){r&&Object.keys(r).forEach(function(i){var s=r[i];s!==void 0&&(n[i]=s)})}),n}function oi(t,e){return us(t,e,e.variables&&{variables:us(C(C({},t&&t.variables),e.variables))})}function Nw(t,e){return Om(t,e)}function Om(t,e,n){if(n===void 0&&(n=new Map),n.has(t))return n.get(t);var r=!1;if(Array.isArray(t)){var i=[];if(n.set(t,i),t.forEach(function(o,a){var l=Om(o,e,n);r||(r=l!==o),i[a]=l}),r)return i}else if(FE(t)){var s=Object.create(Object.getPrototypeOf(t));if(n.set(t,s),Object.keys(t).forEach(function(o){if(o===e){r=!0;return}var a=Om(t[o],e,n);r||(r=a!==t[o]),s[o]=a}),r)return s}return t}function EP(t){return Nw(t,"__typename")}const wP=Object.freeze(Object.defineProperty({__proto__:null,AutoCleanedStrongCache:VE,AutoCleanedWeakCache:Vu,Concast:oo,DEV:cC,DeepMerger:Ni,DocumentTransform:Ml,Observable:Xe,addTypenameToDocument:Qu,argumentsObjectFromField:Il,asyncMap:Ju,buildQueryFromSelectionSet:hw,cacheSizes:zr,canUseAsyncIteratorSymbol:Ol,canUseDOM:Gp,canUseLayoutEffect:PE,canUseSymbol:Lu,canUseWeakMap:as,canUseWeakSet:Qp,canonicalStringify:_r,checkDocument:ro,cloneDeep:Em,compact:us,concatPagination:sP,createFragmentMap:kl,createFulfilledPromise:Ku,createRejectedPromise:Ew,fixObservableSubclass:Tm,getDefaultValues:Uu,getDirectiveNames:XM,getFragmentDefinition:QE,getFragmentDefinitions:xl,getFragmentFromSelection:Nl,getFragmentQueryDocument:LE,getGraphQLErrorsFromResult:Yu,getInclusionDirectives:DE,getMainDefinition:so,getOperationDefinition:io,getOperationName:Bu,getQueryDefinition:tm,getStoreKeyName:em,getTypenameFromResult:ju,graphQLResultHasError:Ll,hasAllDirectives:eR,hasAnyDirectives:ZM,hasClientExports:CE,hasDirectives:ss,isApolloPayloadResult:kw,isArray:Tt,isDocumentNode:qE,isExecutionPatchIncrementalResult:ao,isExecutionPatchInitialResult:Sw,isExecutionPatchResult:Ow,isField:ki,isInlineFragment:zE,isMutationOperation:eP,isNonEmptyArray:Un,isNonNullObject:yt,isPlainObject:FE,isQueryOperation:tP,isReference:et,isStatefulPromise:ww,isSubscriptionOperation:nP,iterateObserversSafely:fa,makeReference:Si,makeUniqueId:iu,maybe:mr,maybeDeepFreeze:ua,mergeDeep:Pl,mergeDeepArray:aa,mergeIncrementalData:Sm,mergeOptions:oi,offsetLimitPagination:oP,omitDeep:Nw,print:oa,relayStylePagination:aP,removeArgumentsFromDocument:XR,removeClientSetsFromDocument:um,removeConnectionDirectiveFromDocument:JR,removeDirectivesFromDocument:zu,removeFragmentSpreadFromDocument:ZR,resultKeyNameFromField:Oi,shouldInclude:ra,storeKeyNameFromField:WE,stringifyForDisplay:Bh,stripTypename:EP,valueToObjectRepresentation:no,wrapPromiseWithState:_m},Symbol.toStringTag,{value:"Module"}));function $l(t){return new Xe(function(e){e.error(t)})}function Aw(t){var e=!1;return new Promise(function(n,r){t.subscribe({next:function(i){e?globalThis.__DEV__!==!1&&ie.warn(43):(e=!0,n(i))},error:r})})}function Iw(t){return new Xe(function(e){t.then(function(n){e.next(n),e.complete()}).catch(e.error.bind(e))})}var Xu=function(t,e,n){var r=new Error(n);throw r.name="ServerError",r.response=t,r.statusCode=t.status,r.result=e,r};function TP(t){for(var e=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if(e.indexOf(i)<0)throw Sn(44,i)}return t}function SP(t,e){var n=C({},t),r=function(s){typeof s=="function"?n=C(C({},n),s(n)):n=C(C({},n),s)},i=function(){return C({},n)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:r}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function OP(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Bu(e.query)||void 0:""),e}function kP(t,e){var n=C({},t),r=new Set(Object.keys(t));return en(e,{Variable:function(i,s,o){o&&o.kind!=="VariableDefinition"&&r.delete(i.name.value)}}),r.forEach(function(i){delete n[i]}),n}function xw(t,e){return e?e(t):Xe.of()}function Vl(t){return typeof t=="function"?new Nn(t):t}function Zu(t){return t.request.length<=1}var Nn=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return Xe.of()})},t.from=function(e){return e.length===0?t.empty():e.map(Vl).reduce(function(n,r){return n.concat(r)})},t.split=function(e,n,r){var i=Vl(n),s=Vl(r||new t(xw)),o;return Zu(i)&&Zu(s)?o=new t(function(a){return e(a)?i.request(a)||Xe.of():s.request(a)||Xe.of()}):o=new t(function(a,l){return e(a)?i.request(a,l)||Xe.of():s.request(a,l)||Xe.of()}),Object.assign(o,{left:i,right:s})},t.execute=function(e,n){return e.request(SP(n.context,OP(TP(n))))||Xe.of()},t.concat=function(e,n){var r=Vl(e);if(Zu(r))return globalThis.__DEV__!==!1&&ie.warn(36,r),r;var i=Vl(n),s;return Zu(i)?s=new t(function(o){return r.request(o,function(a){return i.request(a)||Xe.of()})||Xe.of()}):s=new t(function(o,a){return r.request(o,function(l){return i.request(l,a)||Xe.of()})||Xe.of()}),Object.assign(s,{left:r,right:i})},t.prototype.split=function(e,n,r){return this.concat(t.split(e,n,r||new t(xw)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,n){throw Sn(37)},t.prototype.onError=function(e,n){if(n&&n.error)return n.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}(),Cw=Nn.empty,km=Nn.from,Nm=Nn.split,Dw=Nn.concat,jl=Nn.execute;function NP(t){var e,n=t[Symbol.asyncIterator]();return e={next:function(){return n.next()}},e[Symbol.asyncIterator]=function(){return this},e}function AP(t){var e=null,n=null,r=!1,i=[],s=[];function o(h){if(!n){if(s.length){var p=s.shift();if(Array.isArray(p)&&p[0])return p[0]({value:h,done:!1})}i.push(h)}}function a(h){n=h;var p=s.slice();p.forEach(function(g){g[1](h)}),!e||e()}function l(){r=!0;var h=s.slice();h.forEach(function(p){p[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",a),t.removeListener("end",l),t.removeListener("finish",l),t.removeListener("close",l)},t.on("data",o),t.on("error",a),t.on("end",l),t.on("finish",l),t.on("close",l);function u(){return new Promise(function(h,p){if(n)return p(n);if(i.length)return h({value:i.shift(),done:!1});if(r)return h({value:void 0,done:!0});s.push([h,p])})}var d={next:function(){return u()}};return Ol&&(d[Symbol.asyncIterator]=function(){return this}),d}function IP(t){var e=!1,n={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(r,i){t.then(function(s){r({value:s,done:!1})}).catch(i)}))}};return Ol&&(n[Symbol.asyncIterator]=function(){return this}),n}function Mw(t){var e={next:function(){return t.read()}};return Ol&&(e[Symbol.asyncIterator]=function(){return this}),e}function xP(t){return!!t.body}function CP(t){return!!t.getReader}function DP(t){return!!(Ol&&t[Symbol.asyncIterator])}function MP(t){return!!t.stream}function RP(t){return!!t.arrayBuffer}function PP(t){return!!t.pipe}function FP(t){var e=t;if(xP(t)&&(e=t.body),DP(e))return NP(e);if(CP(e))return Mw(e.getReader());if(MP(e))return Mw(e.stream().getReader());if(RP(e))return IP(e.arrayBuffer());if(PP(e))return AP(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Am=Symbol();function LP(t){return t.extensions?Array.isArray(t.extensions[Am]):!1}function ef(t){return t.hasOwnProperty("graphQLErrors")}var $P=function(t){var e=wt(wt(wt([],t.graphQLErrors,!0),t.clientErrors,!0),t.protocolErrors,!0);return t.networkError&&e.push(t.networkError),e.map(function(n){return yt(n)&&n.message||"Error message not found."}).join(`
|
|
177
|
+
`}function VM(t){const e=[];for(const n of t)e.push(...n.definitions);return{kind:k.DOCUMENT,definitions:e}}function jM(t){const e=[],n=Object.create(null);for(const i of t.definitions)switch(i.kind){case k.OPERATION_DEFINITION:e.push(i);break;case k.FRAGMENT_DEFINITION:n[i.name.value]=SE(i.selectionSet);break}const r=Object.create(null);for(const i of e){const s=new Set;for(const a of SE(i.selectionSet))TE(s,n,a);const o=i.name?i.name.value:"";r[o]={kind:k.DOCUMENT,definitions:t.definitions.filter(a=>a===i||a.kind===k.FRAGMENT_DEFINITION&&s.has(a.name.value))}}return r}function TE(t,e,n){if(!t.has(n)){t.add(n);const r=e[n];if(r!==void 0)for(const i of r)TE(t,e,i)}}function SE(t){const e=[];return en(t,{FragmentSpread(n){e.push(n.name.value)}}),e}function BM(t){const e=R0(t)?t:new cu(t),n=e.body,r=new Kh(e);let i="",s=!1;for(;r.advance().kind!==W.EOF;){const o=r.token,a=o.kind,l=!I0(o.kind);s&&(l||o.kind===W.SPREAD)&&(i+=" ");const u=n.slice(o.start,o.end);a===W.BLOCK_STRING?i+=A0(o.value,{minimize:!0}):i+=u,s=l}return i}function UM(t){const e=OE(t);if(e)throw e;return t}function OE(t){if(typeof t=="string"||$e(!1,"Expected name to be a string."),t.startsWith("__"))return new j(`Name "${t}" must not begin with "__", which is reserved by GraphQL introspection.`);try{tr(t)}catch(e){return e}}var kt;(function(t){t.TYPE_REMOVED="TYPE_REMOVED",t.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",t.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",t.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",t.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",t.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",t.FIELD_REMOVED="FIELD_REMOVED",t.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",t.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",t.ARG_REMOVED="ARG_REMOVED",t.ARG_CHANGED_KIND="ARG_CHANGED_KIND",t.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",t.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",t.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",t.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",t.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"})(kt||(kt={}));var Wr;(function(t){t.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",t.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",t.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",t.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",t.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",t.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"})(Wr||(Wr={}));function qM(t,e){return kE(t,e).filter(n=>n.type in kt)}function WM(t,e){return kE(t,e).filter(n=>n.type in Wr)}function kE(t,e){return[...QM(t,e),...zM(t,e)]}function zM(t,e){const n=[],r=Ti(t.getDirectives(),e.getDirectives());for(const i of r.removed)n.push({type:kt.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(const[i,s]of r.persisted){const o=Ti(i.args,s.args);for(const a of o.added)ts(a)&&n.push({type:kt.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${a.name} on directive ${i.name} was added.`});for(const a of o.removed)n.push({type:kt.DIRECTIVE_ARG_REMOVED,description:`${a.name} was removed from ${i.name}.`});i.isRepeatable&&!s.isRepeatable&&n.push({type:kt.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(const a of i.locations)s.locations.includes(a)||n.push({type:kt.DIRECTIVE_LOCATION_REMOVED,description:`${a} was removed from ${i.name}.`})}return n}function QM(t,e){const n=[],r=Ti(Object.values(t.getTypeMap()),Object.values(e.getTypeMap()));for(const i of r.removed)n.push({type:kt.TYPE_REMOVED,description:_u(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(const[i,s]of r.persisted)Ft(i)&&Ft(s)?n.push(...KM(i,s)):Bt(i)&&Bt(s)?n.push(...HM(i,s)):ht(i)&&ht(s)?n.push(...GM(i,s)):Ye(i)&&Ye(s)?n.push(...AE(i,s),...NE(i,s)):st(i)&&st(s)?n.push(...AE(i,s),...NE(i,s)):i.constructor!==s.constructor&&n.push({type:kt.TYPE_CHANGED_KIND,description:`${i.name} changed from ${IE(i)} to ${IE(s)}.`});return n}function GM(t,e){const n=[],r=Ti(Object.values(t.getFields()),Object.values(e.getFields()));for(const i of r.added)gu(i)?n.push({type:kt.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${t.name} was added.`}):n.push({type:Wr.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i.name} on input type ${t.name} was added.`});for(const i of r.removed)n.push({type:kt.FIELD_REMOVED,description:`${t.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)Sl(i.type,s.type)||n.push({type:kt.FIELD_CHANGED_KIND,description:`${t.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function HM(t,e){const n=[],r=Ti(t.getTypes(),e.getTypes());for(const i of r.added)n.push({type:Wr.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${t.name}.`});for(const i of r.removed)n.push({type:kt.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${t.name}.`});return n}function KM(t,e){const n=[],r=Ti(t.getValues(),e.getValues());for(const i of r.added)n.push({type:Wr.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${t.name}.`});for(const i of r.removed)n.push({type:kt.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${t.name}.`});return n}function NE(t,e){const n=[],r=Ti(t.getInterfaces(),e.getInterfaces());for(const i of r.added)n.push({type:Wr.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${t.name}.`});for(const i of r.removed)n.push({type:kt.IMPLEMENTED_INTERFACE_REMOVED,description:`${t.name} no longer implements interface ${i.name}.`});return n}function AE(t,e){const n=[],r=Ti(Object.values(t.getFields()),Object.values(e.getFields()));for(const i of r.removed)n.push({type:kt.FIELD_REMOVED,description:`${t.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)n.push(...JM(t,i,s)),Tl(i.type,s.type)||n.push({type:kt.FIELD_CHANGED_KIND,description:`${t.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function JM(t,e,n){const r=[],i=Ti(e.args,n.args);for(const s of i.removed)r.push({type:kt.ARG_REMOVED,description:`${t.name}.${e.name} arg ${s.name} was removed.`});for(const[s,o]of i.persisted)if(!Sl(s.type,o.type))r.push({type:kt.ARG_CHANGED_KIND,description:`${t.name}.${e.name} arg ${s.name} has changed type from ${String(s.type)} to ${String(o.type)}.`});else if(s.defaultValue!==void 0)if(o.defaultValue===void 0)r.push({type:Wr.ARG_DEFAULT_VALUE_CHANGE,description:`${t.name}.${e.name} arg ${s.name} defaultValue was removed.`});else{const l=xE(s.defaultValue,s.type),u=xE(o.defaultValue,o.type);l!==u&&r.push({type:Wr.ARG_DEFAULT_VALUE_CHANGE,description:`${t.name}.${e.name} arg ${s.name} has changed defaultValue from ${l} to ${u}.`})}for(const s of i.added)ts(s)?r.push({type:kt.REQUIRED_ARG_ADDED,description:`A required arg ${s.name} on ${t.name}.${e.name} was added.`}):r.push({type:Wr.OPTIONAL_ARG_ADDED,description:`An optional arg ${s.name} on ${t.name}.${e.name} was added.`});return r}function Tl(t,e){return gt(t)?gt(e)&&Tl(t.ofType,e.ofType)||Ae(e)&&Tl(t,e.ofType):Ae(t)?Ae(e)&&Tl(t.ofType,e.ofType):dl(e)&&t.name===e.name||Ae(e)&&Tl(t,e.ofType)}function Sl(t,e){return gt(t)?gt(e)&&Sl(t.ofType,e.ofType):Ae(t)?Ae(e)&&Sl(t.ofType,e.ofType)||!Ae(e)&&Sl(t.ofType,e):dl(e)&&t.name===e.name}function IE(t){if(nr(t))return"a Scalar type";if(Ye(t))return"an Object type";if(st(t))return"an Interface type";if(Bt(t))return"a Union type";if(Ft(t))return"an Enum type";if(ht(t))return"an Input type";xt(!1,"Unexpected type: "+z(t))}function xE(t,e){const n=is(t,e);return n!=null||xt(!1),dt(Ou(n))}function Ti(t,e){const n=[],r=[],i=[],s=Ei(t,({name:a})=>a),o=Ei(e,({name:a})=>a);for(const a of t){const l=o[a.name];l===void 0?r.push(a):i.push([a,l])}for(const a of e)s[a.name]===void 0&&n.push(a);return{added:n,persisted:i,removed:r}}const YM=Object.freeze(Object.defineProperty({__proto__:null,BREAK:Zi,get BreakingChangeType(){return kt},DEFAULT_DEPRECATION_REASON:ap,get DangerousChangeType(){return Wr},get DirectiveLocation(){return pe},ExecutableDefinitionsRule:i_,FieldsOnCorrectTypeRule:s_,FragmentsOnCompositeTypesRule:o_,GRAPHQL_MAX_INT:vu,GRAPHQL_MIN_INT:bu,GraphQLBoolean:jn,GraphQLDeprecatedDirective:wu,GraphQLDirective:Ur,GraphQLEnumType:ns,GraphQLError:j,GraphQLFloat:Y0,GraphQLID:ip,GraphQLIncludeDirective:sp,GraphQLInputObjectType:Yo,GraphQLInt:J0,GraphQLInterfaceType:Ko,GraphQLList:tn,GraphQLNonNull:Ve,GraphQLObjectType:yr,GraphQLOneOfDirective:cp,GraphQLScalarType:ii,GraphQLSchema:Xo,GraphQLSkipDirective:op,GraphQLSpecifiedByDirective:lp,GraphQLString:Ot,GraphQLUnionType:Jo,get Kind(){return k},KnownArgumentNamesRule:a_,KnownDirectivesRule:Ip,KnownFragmentNamesRule:c_,KnownTypeNamesRule:xp,Lexer:Kh,Location:S0,LoneAnonymousOperationRule:f_,LoneSchemaDefinitionRule:d_,MaxIntrospectionDepthRule:h_,NoDeprecatedCustomRule:gM,NoFragmentCyclesRule:p_,NoSchemaIntrospectionCustomRule:yM,NoUndefinedVariablesRule:m_,NoUnusedFragmentsRule:g_,NoUnusedVariablesRule:y_,get OperationTypeNode(){return jt},OverlappingFieldsCanBeMergedRule:b_,PossibleFragmentSpreadsRule:T_,PossibleTypeExtensionsRule:S_,ProvidedRequiredArgumentsRule:O_,ScalarLeafsRule:N_,SchemaMetaFieldDef:gl,SingleFieldSubscriptionsRule:R_,Source:cu,Token:zh,get TokenKind(){return W},TypeInfo:wp,get TypeKind(){return lt},TypeMetaFieldDef:yl,TypeNameMetaFieldDef:vl,UniqueArgumentDefinitionNamesRule:P_,UniqueArgumentNamesRule:Lp,UniqueDirectiveNamesRule:F_,UniqueDirectivesPerLocationRule:$p,UniqueEnumValueNamesRule:L_,UniqueFieldDefinitionNamesRule:$_,UniqueFragmentNamesRule:V_,UniqueInputFieldNamesRule:Vp,UniqueOperationNamesRule:j_,UniqueOperationTypesRule:B_,UniqueTypeNamesRule:U_,UniqueVariableNamesRule:q_,ValidationContext:J_,ValuesOfCorrectTypeRule:W_,VariablesAreInputTypesRule:z_,VariablesInAllowedPositionRule:Q_,__Directive:dp,__DirectiveLocation:hp,__EnumValue:mp,__Field:pp,__InputValue:ml,__Schema:Tu,__Type:vr,__TypeKind:gp,assertAbstractType:iD,assertCompositeType:rD,assertDirective:cD,assertEnumType:JC,assertEnumValueName:j0,assertInputObjectType:YC,assertInputType:eD,assertInterfaceType:U0,assertLeafType:nD,assertListType:XC,assertName:tr,assertNamedType:oD,assertNonNullType:ZC,assertNullableType:q0,assertObjectType:B0,assertOutputType:tD,assertScalarType:HC,assertSchema:yp,assertType:GC,assertUnionType:KC,assertValidName:UM,assertValidSchema:bp,assertWrappingType:sD,astFromValue:is,buildASTSchema:gE,buildClientSchema:EM,buildSchema:SM,coerceInputValue:I_,concatAST:VM,createSourceEventStream:fE,defaultFieldResolver:Bp,defaultTypeResolver:aE,doTypesOverlap:rp,execute:Cu,executeSync:eE,extendSchema:wM,findBreakingChanges:qM,findDangerousChanges:WM,formatError:mC,getArgumentValues:Iu,getDirectiveValues:ta,getEnterLeaveForKind:Go,getIntrospectionQuery:dE,getLocation:ou,getNamedType:On,getNullableType:ep,getOperationAST:vM,getOperationRootType:bM,getVariableValues:C_,getVisitFn:WC,graphql:uM,graphqlSync:fM,introspectionFromSchema:_M,introspectionTypes:bl,isAbstractType:ri,isCompositeType:ni,isConstValueNode:kp,isDefinitionNode:wD,isDirective:Eu,isEnumType:Ft,isEqualType:yu,isExecutableDefinitionNode:Sp,isInputObjectType:ht,isInputType:Vn,isInterfaceType:st,isIntrospectionType:Ys,isLeafType:ti,isListType:gt,isNamedType:dl,isNonNullType:Ae,isNullableType:Zh,isObjectType:Ye,isOutputType:es,isRequiredArgument:ts,isRequiredInputField:gu,isScalarType:nr,isSchema:Z0,isSelectionNode:Op,isSpecifiedDirective:up,isSpecifiedScalarType:_u,isType:ul,isTypeDefinitionNode:Zo,isTypeExtensionNode:Su,isTypeNode:TD,isTypeSubTypeOf:Js,isTypeSystemDefinitionNode:Np,isTypeSystemExtensionNode:Ap,isUnionType:Bt,isValidNameError:OE,isValueNode:r_,isWrappingType:fl,lexicographicSortSchema:OM,locatedError:na,parse:ll,parseConstValue:PC,parseType:FC,parseValue:P0,print:dt,printError:pC,printIntrospectionSchema:NM,printLocation:E0,printSchema:kM,printSourceLocation:Wh,printType:bE,recommendedRules:G_,resolveObjMapThunk:np,resolveReadonlyArrayThunk:tp,responsePathAsArray:kn,separateOperations:jM,specifiedDirectives:rs,specifiedRules:H_,specifiedScalarTypes:hl,stripIgnoredCharacters:BM,subscribe:hM,syntaxError:Vt,typeFromAST:Bn,validate:Y_,validateSchema:vp,valueFromAST:si,valueFromASTUntyped:pu,version:uC,versionInfo:fC,visit:en,visitInParallel:Xh,visitWithTypeInfo:Tp},Symbol.toStringTag,{value:"Module"}));function ra(t,e){var n=t.directives;return!n||!n.length?!0:DE(n).every(function(r){var i=r.directive,s=r.ifArgument,o=!1;return s.value.kind==="Variable"?(o=e&&e[s.value.name.value],se(o!==void 0,70,i.name.value)):o=s.value.value,i.name.value==="skip"?!o:o})}function XM(t){var e=[];return en(t,{Directive:function(n){e.push(n.name.value)}}),e}var ZM=function(t,e){return ss(t,e,!1)},eR=function(t,e){return ss(t,e,!0)};function ss(t,e,n){var r=new Set(t),i=r.size;return en(e,{Directive:function(s){if(r.delete(s.name.value)&&(!n||!r.size))return Zi}}),n?!r.size:r.size<i}function CE(t){return t&&ss(["client","export"],t,!0)}function tR(t){var e=t.name.value;return e==="skip"||e==="include"}function DE(t){var e=[];return t&&t.length&&t.forEach(function(n){if(tR(n)){var r=n.arguments,i=n.name.value;se(r&&r.length===1,71,i);var s=r[0];se(s.name&&s.name.value==="if",72,i);var o=s.value;se(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),73,i),e.push({directive:n,ifArgument:s})}}),e}const nR=()=>Object.create(null),{forEach:rR,slice:ME}=Array.prototype,{hasOwnProperty:iR}=Object.prototype;let eo=class nC{constructor(e=!0,n=nR){this.weakness=e,this.makeData=n}lookup(){return this.lookupArray(arguments)}lookupArray(e){let n=this;return rR.call(e,r=>n=n.getChildTrie(r)),iR.call(n,"data")?n.data:n.data=this.makeData(ME.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let n=this;for(let r=0,i=e.length;n&&r<i;++r){const s=n.mapFor(e[r],!1);n=s&&s.get(e[r])}return n&&n.data}remove(){return this.removeArray(arguments)}removeArray(e){let n;if(e.length){const r=e[0],i=this.mapFor(r,!1),s=i&&i.get(r);s&&(n=s.removeArray(ME.call(e,1)),!s.data&&!s.weak&&!(s.strong&&s.strong.size)&&i.delete(r))}else n=this.data,delete this.data;return n}getChildTrie(e){const n=this.mapFor(e,!0);let r=n.get(e);return r||n.set(e,r=new nC(this.weakness,this.makeData)),r}mapFor(e,n){return this.weakness&&sR(e)?this.weak||(n?this.weak=new WeakMap:void 0):this.strong||(n?this.strong=new Map:void 0)}};function sR(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var RE=mr(function(){return navigator.product})=="ReactNative",as=typeof WeakMap=="function"&&!(RE&&!global.HermesInternal),Qp=typeof WeakSet=="function",Lu=typeof Symbol=="function"&&typeof Symbol.for=="function",Ol=Lu&&Symbol.asyncIterator,Gp=typeof mr(function(){return window.document.createElement})=="function",oR=mr(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,PE=(Gp||RE)&&!oR;function yt(t){return t!==null&&typeof t=="object"}function FE(t){return t!==null&&typeof t=="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function LE(t,e){var n=e,r=[];t.definitions.forEach(function(s){if(s.kind==="OperationDefinition")throw Sn(74,s.operation,s.name?" named '".concat(s.name.value,"'"):"");s.kind==="FragmentDefinition"&&r.push(s)}),typeof n>"u"&&(se(r.length===1,75,r.length),n=r[0].name.value);var i=C(C({},t),{definitions:wt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],t.definitions,!0)});return i}function kl(t){t===void 0&&(t=[]);var e={};return t.forEach(function(n){e[n.name.value]=n}),e}function Nl(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var n=t.name.value;if(typeof e=="function")return e(n);var r=e&&e[n];return se(r,76,n),r||null}default:return null}}function aR(){}class Hp{constructor(e=1/0,n=aR){this.max=e,this.dispose=n,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const n=this.getNode(e);return n&&n.value}get size(){return this.map.size}getNode(e){const n=this.map.get(e);if(n&&n!==this.newest){const{older:r,newer:i}=n;i&&(i.older=r),r&&(r.newer=i),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=i)}return n}set(e,n){let r=this.getNode(e);return r?r.value=n:(r={key:e,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const n=this.map.get(e);return n?(n===this.newest&&(this.newest=n.older),n===this.oldest&&(this.oldest=n.newer),n.newer&&(n.newer.older=n.older),n.older&&(n.older.newer=n.newer),this.map.delete(e),this.dispose(n.value,e),!0):!1}}function Kp(){}const lR=Kp,cR=typeof WeakRef<"u"?WeakRef:function(t){return{deref:()=>t}},uR=typeof WeakMap<"u"?WeakMap:Map,fR=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:Kp,unregister:Kp}},dR=10024;class $u{constructor(e=1/0,n=lR){this.max=e,this.dispose=n,this.map=new uR,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const r=this.unfinalizedNodes.values();for(let i=0;i<dR;i++){const s=r.next().value;if(!s)break;this.unfinalizedNodes.delete(s);const o=s.key;delete s.key,s.keyRef=new cR(o),this.registry.register(o,s,s)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new fR(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const n=this.getNode(e);return n&&n.value}getNode(e){const n=this.map.get(e);if(n&&n!==this.newest){const{older:r,newer:i}=n;i&&(i.older=r),r&&(r.newer=i),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=i)}return n}set(e,n){let r=this.getNode(e);return r?r.value=n:(r={key:e,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.scheduleFinalization(r),this.map.set(e,r),this.size++,r.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const n=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,n),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),n&&this.map.delete(n)}delete(e){const n=this.map.get(e);return n?(this.deleteNode(n),!0):!1}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var Jp=new WeakSet;function $E(t){t.size<=(t.max||-1)||Jp.has(t)||(Jp.add(t),setTimeout(function(){t.clean(),Jp.delete(t)},100))}var Vu=function(t,e){var n=new $u(t,e);return n.set=function(r,i){var s=$u.prototype.set.call(this,r,i);return $E(this),s},n},VE=function(t,e){var n=new Hp(t,e);return n.set=function(r,i){var s=Hp.prototype.set.call(this,r,i);return $E(this),s},n},hR=Symbol.for("apollo.cacheSize"),zr=C({},jh[hR]),to={};function Yp(t,e){to[t]=e}var pR=globalThis.__DEV__!==!1?vR:void 0,mR=globalThis.__DEV__!==!1?bR:void 0,gR=globalThis.__DEV__!==!1?jE:void 0;function yR(){var t={parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4};return Object.fromEntries(Object.entries(t).map(function(e){var n=e[0],r=e[1];return[n,zr[n]||r]}))}function vR(){var t,e,n,r,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:yR(),sizes:C({print:(t=to.print)===null||t===void 0?void 0:t.call(to),parser:(e=to.parser)===null||e===void 0?void 0:e.call(to),canonicalStringify:(n=to.canonicalStringify)===null||n===void 0?void 0:n.call(to),links:Zp(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:UE(this.queryManager.documentTransform)}},(i=(r=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(r))}}function jE(){return{cache:{fragmentQueryDocuments:ls(this.getFragmentDoc)}}}function bR(){var t=this.config.fragments;return C(C({},jE.apply(this)),{addTypenameDocumentTransform:UE(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:ls(this.storeReader.executeSelectionSet),executeSubSelectedArray:ls(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:ls(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:ls(t==null?void 0:t.findFragmentSpreads),lookup:ls(t==null?void 0:t.lookup),transform:ls(t==null?void 0:t.transform)}})}function _R(t){return!!t&&"dirtyKey"in t}function ls(t){return _R(t)?t.size:void 0}function BE(t){return t!=null}function UE(t){return Xp(t).map(function(e){return{cache:e}})}function Xp(t){return t?wt(wt([ls(t==null?void 0:t.performWork)],Xp(t==null?void 0:t.left),!0),Xp(t==null?void 0:t.right),!0).filter(BE):[]}function Zp(t){var e;return t?wt(wt([(e=t==null?void 0:t.getMemoryInternals)===null||e===void 0?void 0:e.call(t)],Zp(t==null?void 0:t.left),!0),Zp(t==null?void 0:t.right),!0).filter(BE):[]}var _r=Object.assign(function(e){return JSON.stringify(e,ER)},{reset:function(){ia=new VE(zr.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&Yp("canonicalStringify",function(){return ia.size});var ia;_r.reset();function ER(t,e){if(e&&typeof e=="object"){var n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){var r=Object.keys(e);if(r.every(wR))return e;var i=JSON.stringify(r),s=ia.get(i);if(!s){r.sort();var o=JSON.stringify(r);s=ia.get(o)||r,ia.set(i,s),ia.set(o,s)}var a=Object.create(n);return s.forEach(function(l){a[l]=e[l]}),a}}return e}function wR(t,e,n){return e===0||n[e-1]<=t}function Si(t){return{__ref:String(t)}}function et(t){return!!(t&&typeof t=="object"&&typeof t.__ref=="string")}function qE(t){return yt(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function TR(t){return t.kind==="StringValue"}function SR(t){return t.kind==="BooleanValue"}function OR(t){return t.kind==="IntValue"}function kR(t){return t.kind==="FloatValue"}function NR(t){return t.kind==="Variable"}function AR(t){return t.kind==="ObjectValue"}function IR(t){return t.kind==="ListValue"}function xR(t){return t.kind==="EnumValue"}function CR(t){return t.kind==="NullValue"}function no(t,e,n,r){if(OR(n)||kR(n))t[e.value]=Number(n.value);else if(SR(n)||TR(n))t[e.value]=n.value;else if(AR(n)){var i={};n.fields.map(function(o){return no(i,o.name,o.value,r)}),t[e.value]=i}else if(NR(n)){var s=(r||{})[n.name.value];t[e.value]=s}else if(IR(n))t[e.value]=n.values.map(function(o){var a={};return no(a,e,o,r),a[e.value]});else if(xR(n))t[e.value]=n.value;else if(CR(n))t[e.value]=null;else throw Sn(85,e.value,n.kind)}function WE(t,e){var n=null;t.directives&&(n={},t.directives.forEach(function(i){n[i.name.value]={},i.arguments&&i.arguments.forEach(function(s){var o=s.name,a=s.value;return no(n[i.name.value],o,a,e)})}));var r=null;return t.arguments&&t.arguments.length&&(r={},t.arguments.forEach(function(i){var s=i.name,o=i.value;return no(r,s,o,e)})),em(t.name.value,r,n)}var DR=["connection","include","skip","client","rest","export","nonreactive"],Al=_r,em=Object.assign(function(t,e,n){if(e&&n&&n.connection&&n.connection.key)if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach(function(a){i[a]=e[a]}),"".concat(n.connection.key,"(").concat(Al(i),")")}else return n.connection.key;var s=t;if(e){var o=Al(e);s+="(".concat(o,")")}return n&&Object.keys(n).forEach(function(a){DR.indexOf(a)===-1&&(n[a]&&Object.keys(n[a]).length?s+="@".concat(a,"(").concat(Al(n[a]),")"):s+="@".concat(a))}),s},{setStringify:function(t){var e=Al;return Al=t,e}});function Il(t,e){if(t.arguments&&t.arguments.length){var n={};return t.arguments.forEach(function(r){var i=r.name,s=r.value;return no(n,i,s,e)}),n}return null}function Oi(t){return t.alias?t.alias.value:t.name.value}function ju(t,e,n){for(var r,i=0,s=e.selections;i<s.length;i++){var o=s[i];if(ki(o)){if(o.name.value==="__typename")return t[Oi(o)]}else r?r.push(o):r=[o]}if(typeof t.__typename=="string")return t.__typename;if(r)for(var a=0,l=r;a<l.length;a++){var o=l[a],u=ju(t,Nl(o,n).selectionSet,n);if(typeof u=="string")return u}}function ki(t){return t.kind==="Field"}function zE(t){return t.kind==="InlineFragment"}function ro(t){se(t&&t.kind==="Document",77);var e=t.definitions.filter(function(n){return n.kind!=="FragmentDefinition"}).map(function(n){if(n.kind!=="OperationDefinition")throw Sn(78,n.kind);return n});return se(e.length<=1,79,e.length),t}function io(t){return ro(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Bu(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function xl(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function tm(t){var e=io(t);return se(e&&e.operation==="query",80),e}function QE(t){se(t.kind==="Document",81),se(t.definitions.length<=1,82);var e=t.definitions[0];return se(e.kind==="FragmentDefinition",83),e}function so(t){ro(t);for(var e,n=0,r=t.definitions;n<r.length;n++){var i=r[n];if(i.kind==="OperationDefinition"){var s=i.operation;if(s==="query"||s==="mutation"||s==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw Sn(84)}function Uu(t){var e=Object.create(null),n=t&&t.variableDefinitions;return n&&n.length&&n.forEach(function(r){r.defaultValue&&no(e,r.variable.name,r.defaultValue)}),e}const MR=()=>Object.create(null),{forEach:RR,slice:PR}=Array.prototype,{hasOwnProperty:FR}=Object.prototype;class nm{constructor(e=!0,n=MR){this.weakness=e,this.makeData=n}lookup(...e){return this.lookupArray(e)}lookupArray(e){let n=this;return RR.call(e,r=>n=n.getChildTrie(r)),FR.call(n,"data")?n.data:n.data=this.makeData(PR.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let n=this;for(let r=0,i=e.length;n&&r<i;++r){const s=this.weakness&&GE(e[r])?n.weak:n.strong;n=s&&s.get(e[r])}return n&&n.data}getChildTrie(e){const n=this.weakness&&GE(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let r=n.get(e);return r||n.set(e,r=new nm(this.weakness,this.makeData)),r}}function GE(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}let nn=null;const HE={};let LR=1;const $R=()=>class{constructor(){this.id=["slot",LR++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=nn;e;e=e.parent)if(this.id in e.slots){const n=e.slots[this.id];if(n===HE)break;return e!==nn&&(nn.slots[this.id]=n),!0}return nn&&(nn.slots[this.id]=HE),!1}getValue(){if(this.hasValue())return nn.slots[this.id]}withValue(e,n,r,i){const s={__proto__:null,[this.id]:e},o=nn;nn={parent:o,slots:s};try{return n.apply(i,r)}finally{nn=o}}static bind(e){const n=nn;return function(){const r=nn;try{return nn=n,e.apply(this,arguments)}finally{nn=r}}}static noContext(e,n,r){if(nn){const i=nn;try{return nn=null,e.apply(r,n)}finally{nn=i}}else return e.apply(r,n)}};function KE(t){try{return t()}catch{}}const rm="@wry/context:Slot",JE=KE(()=>globalThis)||KE(()=>global)||Object.create(null),im=JE[rm]||Array[rm]||function(t){try{Object.defineProperty(JE,rm,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}($R()),{bind:fae,noContext:dae}=im,qu=new im,{hasOwnProperty:VR}=Object.prototype,sm=Array.from||function(t){const e=[];return t.forEach(n=>e.push(n)),e};function om(t){const{unsubscribe:e}=t;typeof e=="function"&&(t.unsubscribe=void 0,e())}const Cl=[],jR=100;function sa(t,e){if(!t)throw new Error(e||"assertion failure")}function YE(t,e){const n=t.length;return n>0&&n===e.length&&t[n-1]===e[n-1]}function XE(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function ZE(t){return t.slice(0)}class Wu{constructor(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,++Wu.count}peek(){if(this.value.length===1&&!cs(this))return ew(this),this.value[0]}recompute(e){return sa(!this.recomputing,"already recomputing"),ew(this),cs(this)?BR(this,e):XE(this.value)}setDirty(){this.dirty||(this.dirty=!0,tw(this),om(this))}dispose(){this.setDirty(),ow(this),am(this,(e,n)=>{e.setDirty(),aw(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=Cl.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(sm(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),Cl.push(this.deps),this.deps=null)}}Wu.count=0;function ew(t){const e=qu.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),cs(t)?rw(e,t):iw(e,t),e}function BR(t,e){return ow(t),qu.withValue(t,UR,[t,e]),WR(t,e)&&qR(t),XE(t.value)}function UR(t,e){t.recomputing=!0;const{normalizeResult:n}=t;let r;n&&t.value.length===1&&(r=ZE(t.value)),t.value.length=0;try{if(t.value[0]=t.fn.apply(null,e),n&&r&&!YE(r,t.value))try{t.value[0]=n(t.value[0],r[0])}catch{}}catch(i){t.value[1]=i}t.recomputing=!1}function cs(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function qR(t){t.dirty=!1,!cs(t)&&nw(t)}function tw(t){am(t,rw)}function nw(t){am(t,iw)}function am(t,e){const n=t.parents.size;if(n){const r=sm(t.parents);for(let i=0;i<n;++i)e(r[i],t)}}function rw(t,e){sa(t.childValues.has(e)),sa(cs(e));const n=!cs(t);if(!t.dirtyChildren)t.dirtyChildren=Cl.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),n&&tw(t)}function iw(t,e){sa(t.childValues.has(e)),sa(!cs(e));const n=t.childValues.get(e);n.length===0?t.childValues.set(e,ZE(e.value)):YE(n,e.value)||t.setDirty(),sw(t,e),!cs(t)&&nw(t)}function sw(t,e){const n=t.dirtyChildren;n&&(n.delete(e),n.size===0&&(Cl.length<jR&&Cl.push(n),t.dirtyChildren=null))}function ow(t){t.childValues.size>0&&t.childValues.forEach((e,n)=>{aw(t,n)}),t.forgetDeps(),sa(t.dirtyChildren===null)}function aw(t,e){e.parents.delete(t),t.childValues.delete(e),sw(t,e)}function WR(t,e){if(typeof t.subscribe=="function")try{om(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}const zR={setDirty:!0,dispose:!0,forget:!0};function lw(t){const e=new Map;function n(r){const i=qu.getValue();if(i){let s=e.get(r);s||e.set(r,s=new Set),i.dependOn(s)}}return n.dirty=function(i,s){const o=e.get(i);if(o){const a=s&&VR.call(zR,s)?s:"setDirty";sm(o).forEach(l=>l[a]()),e.delete(i),om(o)}},n}let cw;function QR(...t){return(cw||(cw=new nm(typeof WeakMap=="function"))).lookupArray(t)}const lm=new Set;function Dl(t,{max:e=Math.pow(2,16),keyArgs:n,makeCacheKey:r=QR,normalizeResult:i,subscribe:s,cache:o=Hp}=Object.create(null)){const a=typeof o=="function"?new o(e,p=>p.dispose()):o,l=function(){const p=r.apply(null,n?n.apply(null,arguments):arguments);if(p===void 0)return t.apply(null,arguments);let g=a.get(p);g||(a.set(p,g=new Wu(t)),g.normalizeResult=i,g.subscribe=s,g.forget=()=>a.delete(p));const y=g.recompute(Array.prototype.slice.call(arguments));return a.set(p,g),lm.add(a),qu.hasValue()||(lm.forEach(b=>b.clean()),lm.clear()),y};Object.defineProperty(l,"size",{get:()=>a.size,configurable:!1,enumerable:!1}),Object.freeze(l.options={max:e,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:s,cache:a});function u(p){const g=p&&a.get(p);g&&g.setDirty()}l.dirtyKey=u,l.dirty=function(){u(r.apply(null,arguments))};function d(p){const g=p&&a.get(p);if(g)return g.peek()}l.peekKey=d,l.peek=function(){return d(r.apply(null,arguments))};function h(p){return p?a.delete(p):!1}return l.forgetKey=h,l.forget=function(){return h(r.apply(null,arguments))},l.makeCacheKey=r,l.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(l)}function GR(t){return t}var Ml=function(){function t(e,n){n===void 0&&(n=Object.create(null)),this.resultCache=Qp?new WeakSet:new Set,this.transform=e,n.getCacheKey&&(this.getCacheKey=n.getCacheKey),this.cached=n.cache!==!1,this.resetCache()}return t.prototype.getCacheKey=function(e){return[e]},t.identity=function(){return new t(GR,{cache:!1})},t.split=function(e,n,r){return r===void 0&&(r=t.identity()),Object.assign(new t(function(i){var s=e(i)?n:r;return s.transformDocument(i)},{cache:!1}),{left:n,right:r})},t.prototype.resetCache=function(){var e=this;if(this.cached){var n=new eo(as);this.performWork=Dl(t.prototype.performWork.bind(this),{makeCacheKey:function(r){var i=e.getCacheKey(r);if(i)return se(Array.isArray(i),69),n.lookupArray(i)},max:zr["documentTransform.cache"],cache:$u})}},t.prototype.performWork=function(e){return ro(e),this.transform(e)},t.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var n=this.performWork(e);return this.resultCache.add(n),n},t.prototype.concat=function(e){var n=this;return Object.assign(new t(function(r){return e.transformDocument(n.transformDocument(r))},{cache:!1}),{left:this,right:e})},t}(),Rl,oa=Object.assign(function(t){var e=Rl.get(t);return e||(e=dt(t),Rl.set(t,e)),e},{reset:function(){Rl=new Vu(zr.print||2e3)}});oa.reset(),globalThis.__DEV__!==!1&&Yp("print",function(){return Rl?Rl.size:0});var Tt=Array.isArray;function Un(t){return Array.isArray(t)&&t.length>0}var uw={kind:k.FIELD,name:{kind:k.NAME,value:"__typename"}};function fw(t,e){return!t||t.selectionSet.selections.every(function(n){return n.kind===k.FRAGMENT_SPREAD&&fw(e[n.name.value],e)})}function cm(t){return fw(io(t)||QE(t),kl(xl(t)))?null:t}function HR(t){var e=new Map,n=new Map;return t.forEach(function(r){r&&(r.name?e.set(r.name,r):r.test&&n.set(r.test,r))}),function(r){var i=e.get(r.name.value);return!i&&n.size&&n.forEach(function(s,o){o(r)&&(i=s)}),i}}function dw(t){var e=new Map;return function(r){r===void 0&&(r=t);var i=e.get(r);return i||e.set(r,i={variables:new Set,fragmentSpreads:new Set}),i}}function zu(t,e){ro(e);for(var n=dw(""),r=dw(""),i=function(w){for(var O=0,N=void 0;O<w.length&&(N=w[O]);++O)if(!Tt(N)){if(N.kind===k.OPERATION_DEFINITION)return n(N.name&&N.name.value);if(N.kind===k.FRAGMENT_DEFINITION)return r(N.name.value)}return globalThis.__DEV__!==!1&&se.error(86),null},s=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===k.OPERATION_DEFINITION&&++s;var a=HR(t),l=function(w){return Un(w)&&w.map(a).some(function(O){return O&&O.remove})},u=new Map,d=!1,h={enter:function(w){if(l(w.directives))return d=!0,null}},p=en(e,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(w,O,N,I,P){var R=i(P);R&&R.variables.add(w.name.value)}},FragmentSpread:{enter:function(w,O,N,I,P){if(l(w.directives))return d=!0,null;var R=i(P);R&&R.fragmentSpreads.add(w.name.value)}},FragmentDefinition:{enter:function(w,O,N,I){u.set(JSON.stringify(I),w)},leave:function(w,O,N,I){var P=u.get(JSON.stringify(I));if(w===P)return w;if(s>0&&w.selectionSet.selections.every(function(R){return R.kind===k.FIELD&&R.name.value==="__typename"}))return r(w.name.value).removed=!0,d=!0,null}},Directive:{leave:function(w){if(a(w))return d=!0,null}}});if(!d)return e;var g=function(w){return w.transitiveVars||(w.transitiveVars=new Set(w.variables),w.removed||w.fragmentSpreads.forEach(function(O){g(r(O)).transitiveVars.forEach(function(N){w.transitiveVars.add(N)})})),w},y=new Set;p.definitions.forEach(function(w){w.kind===k.OPERATION_DEFINITION?g(n(w.name&&w.name.value)).fragmentSpreads.forEach(function(O){y.add(O)}):w.kind===k.FRAGMENT_DEFINITION&&s===0&&!r(w.name.value).removed&&y.add(w.name.value)}),y.forEach(function(w){g(r(w)).fragmentSpreads.forEach(function(O){y.add(O)})});var b=function(w){return!!(!y.has(w)||r(w).removed)},_={enter:function(w){if(b(w.name.value))return null}};return cm(en(p,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(w){if(w.variableDefinitions){var O=g(n(w.name&&w.name.value)).transitiveVars;if(O.size<w.variableDefinitions.length)return C(C({},w),{variableDefinitions:w.variableDefinitions.filter(function(N){return O.has(N.variable.name.value)})})}}}}))}var Qu=Object.assign(function(t){return en(t,{SelectionSet:{enter:function(e,n,r){if(!(r&&r.kind===k.OPERATION_DEFINITION)){var i=e.selections;if(i){var s=i.some(function(a){return ki(a)&&(a.name.value==="__typename"||a.name.value.lastIndexOf("__",0)===0)});if(!s){var o=r;if(!(ki(o)&&o.directives&&o.directives.some(function(a){return a.name.value==="export"})))return C(C({},e),{selections:wt(wt([],i,!0),[uw],!1)})}}}}}})},{added:function(t){return t===uw}}),KR={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(n){return n.name.value==="key"}))&&globalThis.__DEV__!==!1&&se.warn(87),e}};function JR(t){return zu([KR],ro(t))}function YR(t){return function(n){return t.some(function(r){return n.value&&n.value.kind===k.VARIABLE&&n.value.name&&(r.name===n.value.name.value||r.test&&r.test(n))})}}function XR(t,e){var n=YR(t);return cm(en(e,{OperationDefinition:{enter:function(r){return C(C({},r),{variableDefinitions:r.variableDefinitions?r.variableDefinitions.filter(function(i){return!t.some(function(s){return s.name===i.variable.name.value})}):[]})}},Field:{enter:function(r){var i=t.some(function(o){return o.remove});if(i){var s=0;if(r.arguments&&r.arguments.forEach(function(o){n(o)&&(s+=1)}),s===1)return null}}},Argument:{enter:function(r){if(n(r))return null}}}))}function ZR(t,e){function n(r){if(t.some(function(i){return i.name===r.name.value}))return null}return cm(en(e,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}function hw(t){var e=so(t),n=e.operation;if(n==="query")return t;var r=en(t,{OperationDefinition:{enter:function(i){return C(C({},i),{operation:"query"})}}});return r}function um(t){ro(t);var e=zu([{test:function(n){return n.name.value==="client"},remove:!0}],t);return e}function fm(t,e){var n;return((n=io(t))===null||n===void 0?void 0:n.operation)===e}function eP(t){return fm(t,"mutation")}function tP(t){return fm(t,"query")}function nP(t){return fm(t,"subscription")}var rP=Object.prototype.hasOwnProperty;function Pl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return aa(t)}function aa(t){var e=t[0]||{},n=t.length;if(n>1)for(var r=new Ni,i=1;i<n;++i)e=r.merge(e,t[i]);return e}var iP=function(t,e,n){return this.merge(t[n],e[n])},Ni=function(){function t(e){e===void 0&&(e=iP),this.reconciler=e,this.isObject=yt,this.pastCopies=new Set}return t.prototype.merge=function(e,n){for(var r=this,i=[],s=2;s<arguments.length;s++)i[s-2]=arguments[s];return yt(n)&&yt(e)?(Object.keys(n).forEach(function(o){if(rP.call(e,o)){var a=e[o];if(n[o]!==a){var l=r.reconciler.apply(r,wt([e,n,o],i,!1));l!==a&&(e=r.shallowCopyForMerge(e),e[o]=l)}}else e=r.shallowCopyForMerge(e),e[o]=n[o]}),e):n},t.prototype.shallowCopyForMerge=function(e){return yt(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 sP(t){return t===void 0&&(t=!1),{keyArgs:t,merge:function(e,n){return e?wt(wt([],e,!0),n,!0):n}}}function oP(t){return t===void 0&&(t=!1),{keyArgs:t,merge:function(e,n,r){var i=r.args,s=e?e.slice(0):[];if(n)if(i)for(var o=i.offset,a=o===void 0?0:o,l=0;l<n.length;++l)s[a+l]=n[l];else s.push.apply(s,n);return s}}}function aP(t){return t===void 0&&(t=!1),{keyArgs:t,read:function(e,n){var r=n.canRead,i=n.readField;if(!e)return e;var s=[],o="",a="";e.edges.forEach(function(h){r(i("node",h))&&(s.push(h),h.cursor&&(o=o||h.cursor||"",a=h.cursor||a))}),s.length>1&&o===a&&(o="");var l=e.pageInfo||{},u=l.startCursor,d=l.endCursor;return C(C({},dm(e)),{edges:s,pageInfo:C(C({},e.pageInfo),{startCursor:u||o,endCursor:d||a})})},merge:function(e,n,r){var i=r.args,s=r.isReference,o=r.readField;if(e||(e=cP()),!n)return e;var a=n.edges?n.edges.map(function(Q){return s(Q=C({},Q))&&(Q.cursor=o("cursor",Q)),Q}):[];if(n.pageInfo){var l=n.pageInfo,u=l.startCursor,d=l.endCursor,h=a[0],p=a[a.length-1];h&&u&&(h.cursor=u),p&&d&&(p.cursor=d);var g=h&&h.cursor;g&&!u&&(n=Pl(n,{pageInfo:{startCursor:g}}));var y=p&&p.cursor;y&&!d&&(n=Pl(n,{pageInfo:{endCursor:y}}))}var b=e.edges,_=[];if(i&&i.after){var w=b.findIndex(function(Q){return Q.cursor===i.after});w>=0&&(b=b.slice(0,w+1))}else if(i&&i.before){var w=b.findIndex(function(x){return x.cursor===i.before});_=w<0?b:b.slice(w),b=[]}else n.edges&&(b=[]);var O=wt(wt(wt([],b,!0),a,!0),_,!0),N=C(C({},n.pageInfo),e.pageInfo);if(n.pageInfo){var I=n.pageInfo,P=I.hasPreviousPage,R=I.hasNextPage,u=I.startCursor,d=I.endCursor,B=Tn(I,["hasPreviousPage","hasNextPage","startCursor","endCursor"]);Object.assign(N,B),b.length||(P!==void 0&&(N.hasPreviousPage=P),u!==void 0&&(N.startCursor=u)),_.length||(R!==void 0&&(N.hasNextPage=R),d!==void 0&&(N.endCursor=d))}return C(C(C({},dm(e)),dm(n)),{edges:O,pageInfo:N})}}}var dm=function(t){return Tn(t,lP)},lP=["edges","pageInfo"];function cP(){return{edges:[],pageInfo:{hasPreviousPage:!1,hasNextPage:!0,startCursor:"",endCursor:""}}}function uP(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=fP(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
178
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fP(t,e){if(t){if(typeof t=="string")return pw(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pw(t,e)}}function pw(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function mw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function hm(t,e,n){return e&&mw(t.prototype,e),n&&mw(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var pm=function(){return typeof Symbol=="function"},mm=function(t){return pm()&&!!Symbol[t]},gm=function(t){return mm(t)?Symbol[t]:"@@"+t};pm()&&!mm("observable")&&(Symbol.observable=Symbol("observable"));var dP=gm("iterator"),ym=gm("observable"),gw=gm("species");function Gu(t,e){var n=t[e];if(n!=null){if(typeof n!="function")throw new TypeError(n+" is not a function");return n}}function Fl(t){var e=t.constructor;return e!==void 0&&(e=e[gw],e===null&&(e=void 0)),e!==void 0?e:Xe}function hP(t){return t instanceof Xe}function la(t){la.log?la.log(t):setTimeout(function(){throw t})}function Hu(t){Promise.resolve().then(function(){try{t()}catch(e){la(e)}})}function yw(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var n=Gu(e,"unsubscribe");n&&n.call(e)}}catch(r){la(r)}}function vm(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function pP(t){var e=t._queue;if(e){t._queue=void 0,t._state="ready";for(var n=0;n<e.length&&(vw(t,e[n].type,e[n].value),t._state!=="closed");++n);}}function vw(t,e,n){t._state="running";var r=t._observer;try{var i=Gu(r,e);switch(e){case"next":i&&i.call(r,n);break;case"error":if(vm(t),i)i.call(r,n);else throw n;break;case"complete":vm(t),i&&i.call(r);break}}catch(s){la(s)}t._state==="closed"?yw(t):t._state==="running"&&(t._state="ready")}function bm(t,e,n){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:n});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:n}],Hu(function(){return pP(t)});return}vw(t,e,n)}}var mP=function(){function t(n,r){this._cleanup=void 0,this._observer=n,this._queue=void 0,this._state="initializing";var i=new gP(this);try{this._cleanup=r.call(void 0,i)}catch(s){i.error(s)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(vm(this),yw(this))},hm(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),gP=function(){function t(n){this._subscription=n}var e=t.prototype;return e.next=function(r){bm(this._subscription,"next",r)},e.error=function(r){bm(this._subscription,"error",r)},e.complete=function(){bm(this._subscription,"complete")},hm(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),Xe=function(){function t(n){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof n!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=n}var e=t.prototype;return e.subscribe=function(r){return(typeof r!="object"||r===null)&&(r={next:r,error:arguments[1],complete:arguments[2]}),new mP(r,this._subscriber)},e.forEach=function(r){var i=this;return new Promise(function(s,o){if(typeof r!="function"){o(new TypeError(r+" is not a function"));return}function a(){l.unsubscribe(),s()}var l=i.subscribe({next:function(u){try{r(u,a)}catch(d){o(d),l.unsubscribe()}},error:o,complete:s})})},e.map=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=Fl(this);return new s(function(o){return i.subscribe({next:function(a){try{a=r(a)}catch(l){return o.error(l)}o.next(a)},error:function(a){o.error(a)},complete:function(){o.complete()}})})},e.filter=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=Fl(this);return new s(function(o){return i.subscribe({next:function(a){try{if(!r(a))return}catch(l){return o.error(l)}o.next(a)},error:function(a){o.error(a)},complete:function(){o.complete()}})})},e.reduce=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=Fl(this),o=arguments.length>1,a=!1,l=arguments[1],u=l;return new s(function(d){return i.subscribe({next:function(h){var p=!a;if(a=!0,!p||o)try{u=r(u,h)}catch(g){return d.error(g)}else u=h},error:function(h){d.error(h)},complete:function(){if(!a&&!o)return d.error(new TypeError("Cannot reduce an empty sequence"));d.next(u),d.complete()}})})},e.concat=function(){for(var r=this,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];var a=Fl(this);return new a(function(l){var u,d=0;function h(p){u=p.subscribe({next:function(g){l.next(g)},error:function(g){l.error(g)},complete:function(){d===s.length?(u=void 0,l.complete()):h(a.from(s[d++]))}})}return h(r),function(){u&&(u.unsubscribe(),u=void 0)}})},e.flatMap=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=Fl(this);return new s(function(o){var a=[],l=i.subscribe({next:function(d){if(r)try{d=r(d)}catch(p){return o.error(p)}var h=s.from(d).subscribe({next:function(p){o.next(p)},error:function(p){o.error(p)},complete:function(){var p=a.indexOf(h);p>=0&&a.splice(p,1),u()}});a.push(h)},error:function(d){o.error(d)},complete:function(){u()}});function u(){l.closed&&a.length===0&&o.complete()}return function(){a.forEach(function(d){return d.unsubscribe()}),l.unsubscribe()}})},e[ym]=function(){return this},t.from=function(r){var i=typeof this=="function"?this:t;if(r==null)throw new TypeError(r+" is not an object");var s=Gu(r,ym);if(s){var o=s.call(r);if(Object(o)!==o)throw new TypeError(o+" is not an object");return hP(o)&&o.constructor===i?o:new i(function(a){return o.subscribe(a)})}if(mm("iterator")&&(s=Gu(r,dP),s))return new i(function(a){Hu(function(){if(!a.closed){for(var l=uP(s.call(r)),u;!(u=l()).done;){var d=u.value;if(a.next(d),a.closed)return}a.complete()}})});if(Array.isArray(r))return new i(function(a){Hu(function(){if(!a.closed){for(var l=0;l<r.length;++l)if(a.next(r[l]),a.closed)return;a.complete()}})});throw new TypeError(r+" is not observable")},t.of=function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];var o=typeof this=="function"?this:t;return new o(function(a){Hu(function(){if(!a.closed){for(var l=0;l<i.length;++l)if(a.next(i[l]),a.closed)return;a.complete()}})})},hm(t,null,[{key:gw,get:function(){return this}}]),t}();pm()&&Object.defineProperty(Xe,Symbol("extensions"),{value:{symbol:ym,hostReportError:la},configurable:!0});function yP(t){var e,n=t.Symbol;if(typeof n=="function")if(n.observable)e=n.observable;else{typeof n.for=="function"?e=n.for("https://github.com/benlesh/symbol-observable"):e=n("https://github.com/benlesh/symbol-observable");try{n.observable=e}catch{}}else e="@@observable";return e}var ca;typeof self<"u"?ca=self:typeof window<"u"?ca=window:typeof global<"u"?ca=global:typeof module<"u"?ca=module:ca=Function("return this")(),yP(ca);var bw=Xe.prototype,_w="@@observable";bw[_w]||(bw[_w]=function(){return this});function Ku(t){var e=Promise.resolve(t);return e.status="fulfilled",e.value=t,e}function Ew(t){var e=Promise.reject(t);return e.catch(function(){}),e.status="rejected",e.reason=t,e}function ww(t){return"status"in t}function _m(t){if(ww(t))return t;var e=t;return e.status="pending",e.then(function(n){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=n}},function(n){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=n}}),t}var vP=Object.prototype.toString;function Em(t){return wm(t)}function wm(t,e){switch(vP.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var n=t.slice(0);return e.set(t,n),n.forEach(function(i,s){n[s]=wm(i,e)}),n}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var r=Object.create(Object.getPrototypeOf(t));return e.set(t,r),Object.keys(t).forEach(function(i){r[i]=wm(t[i],e)}),r}default:return t}}function bP(t){var e=new Set([t]);return e.forEach(function(n){yt(n)&&_P(n)===n&&Object.getOwnPropertyNames(n).forEach(function(r){yt(n[r])&&e.add(n[r])})}),t}function _P(t){if(globalThis.__DEV__!==!1&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function ua(t){return globalThis.__DEV__!==!1&&bP(t),t}function fa(t,e,n){var r=[];t.forEach(function(i){return i[e]&&r.push(i)}),r.forEach(function(i){return i[e](n)})}function Ju(t,e,n){return new Xe(function(r){var i={then:function(l){return new Promise(function(u){return u(l())})}};function s(l,u){return function(d){if(l){var h=function(){return r.closed?0:l(d)};i=i.then(h,h).then(function(p){return r.next(p)},function(p){return r.error(p)})}else r[u](d)}}var o={next:s(e,"next"),error:s(n,"error"),complete:function(){i.then(function(){return r.complete()})}},a=t.subscribe(o);return function(){return a.unsubscribe()}})}function Tm(t){function e(n){Object.defineProperty(t,n,{value:Xe})}return Lu&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Tw(t){return t&&typeof t.then=="function"}var oo=function(t){pr(e,t);function e(n){var r=t.call(this,function(i){return r.addObserver(i),function(){return r.removeObserver(i)}})||this;return r.observers=new Set,r.promise=new Promise(function(i,s){r.resolve=i,r.reject=s}),r.handlers={next:function(i){r.sub!==null&&(r.latest=["next",i],r.notify("next",i),fa(r.observers,"next",i))},error:function(i){var s=r.sub;s!==null&&(s&&setTimeout(function(){return s.unsubscribe()}),r.sub=null,r.latest=["error",i],r.reject(i),r.notify("error",i),fa(r.observers,"error",i))},complete:function(){var i=r,s=i.sub,o=i.sources,a=o===void 0?[]:o;if(s!==null){var l=a.shift();l?Tw(l)?l.then(function(u){return r.sub=u.subscribe(r.handlers)},r.handlers.error):r.sub=l.subscribe(r.handlers):(s&&setTimeout(function(){return s.unsubscribe()}),r.sub=null,r.latest&&r.latest[0]==="next"?r.resolve(r.latest[1]):r.resolve(),r.notify("complete"),fa(r.observers,"complete"))}}},r.nextResultListeners=new Set,r.cancel=function(i){r.reject(i),r.sources=[],r.handlers.error(i)},r.promise.catch(function(i){}),typeof n=="function"&&(n=[new Xe(n)]),Tw(n)?n.then(function(i){return r.start(i)},r.handlers.error):r.start(n),r}return e.prototype.start=function(n){this.sub===void 0&&(this.sources=Array.from(n),this.handlers.complete())},e.prototype.deliverLastMessage=function(n){if(this.latest){var r=this.latest[0],i=n[r];i&&i.call(n,this.latest[1]),this.sub===null&&r==="next"&&n.complete&&n.complete()}},e.prototype.addObserver=function(n){this.observers.has(n)||(this.deliverLastMessage(n),this.observers.add(n))},e.prototype.removeObserver=function(n){this.observers.delete(n)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(n,r){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(s){return s(n,r)}))},e.prototype.beforeNext=function(n){var r=!1;this.nextResultListeners.add(function(i,s){r||(r=!0,n(i,s))})},e}(Xe);Tm(oo);function ao(t){return"incremental"in t}function Sw(t){return"hasNext"in t&&"data"in t}function Ow(t){return ao(t)||Sw(t)}function kw(t){return yt(t)&&"payload"in t}function Sm(t,e){var n=t,r=new Ni;return ao(e)&&Un(e.incremental)&&e.incremental.forEach(function(i){for(var s=i.data,o=i.path,a=o.length-1;a>=0;--a){var l=o[a],u=!isNaN(+l),d=u?[]:{};d[l]=s,s=d}n=r.merge(n,s)}),n}function Ll(t){var e=Yu(t);return Un(e)}function Yu(t){var e=Un(t.errors)?t.errors.slice(0):[];return ao(t)&&Un(t.incremental)&&t.incremental.forEach(function(n){n.errors&&e.push.apply(e,n.errors)}),e}function us(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Object.create(null);return t.forEach(function(r){r&&Object.keys(r).forEach(function(i){var s=r[i];s!==void 0&&(n[i]=s)})}),n}function oi(t,e){return us(t,e,e.variables&&{variables:us(C(C({},t&&t.variables),e.variables))})}function Nw(t,e){return Om(t,e)}function Om(t,e,n){if(n===void 0&&(n=new Map),n.has(t))return n.get(t);var r=!1;if(Array.isArray(t)){var i=[];if(n.set(t,i),t.forEach(function(o,a){var l=Om(o,e,n);r||(r=l!==o),i[a]=l}),r)return i}else if(FE(t)){var s=Object.create(Object.getPrototypeOf(t));if(n.set(t,s),Object.keys(t).forEach(function(o){if(o===e){r=!0;return}var a=Om(t[o],e,n);r||(r=a!==t[o]),s[o]=a}),r)return s}return t}function EP(t){return Nw(t,"__typename")}const wP=Object.freeze(Object.defineProperty({__proto__:null,AutoCleanedStrongCache:VE,AutoCleanedWeakCache:Vu,Concast:oo,DEV:cC,DeepMerger:Ni,DocumentTransform:Ml,Observable:Xe,addTypenameToDocument:Qu,argumentsObjectFromField:Il,asyncMap:Ju,buildQueryFromSelectionSet:hw,cacheSizes:zr,canUseAsyncIteratorSymbol:Ol,canUseDOM:Gp,canUseLayoutEffect:PE,canUseSymbol:Lu,canUseWeakMap:as,canUseWeakSet:Qp,canonicalStringify:_r,checkDocument:ro,cloneDeep:Em,compact:us,concatPagination:sP,createFragmentMap:kl,createFulfilledPromise:Ku,createRejectedPromise:Ew,fixObservableSubclass:Tm,getDefaultValues:Uu,getDirectiveNames:XM,getFragmentDefinition:QE,getFragmentDefinitions:xl,getFragmentFromSelection:Nl,getFragmentQueryDocument:LE,getGraphQLErrorsFromResult:Yu,getInclusionDirectives:DE,getMainDefinition:so,getOperationDefinition:io,getOperationName:Bu,getQueryDefinition:tm,getStoreKeyName:em,getTypenameFromResult:ju,graphQLResultHasError:Ll,hasAllDirectives:eR,hasAnyDirectives:ZM,hasClientExports:CE,hasDirectives:ss,isApolloPayloadResult:kw,isArray:Tt,isDocumentNode:qE,isExecutionPatchIncrementalResult:ao,isExecutionPatchInitialResult:Sw,isExecutionPatchResult:Ow,isField:ki,isInlineFragment:zE,isMutationOperation:eP,isNonEmptyArray:Un,isNonNullObject:yt,isPlainObject:FE,isQueryOperation:tP,isReference:et,isStatefulPromise:ww,isSubscriptionOperation:nP,iterateObserversSafely:fa,makeReference:Si,makeUniqueId:iu,maybe:mr,maybeDeepFreeze:ua,mergeDeep:Pl,mergeDeepArray:aa,mergeIncrementalData:Sm,mergeOptions:oi,offsetLimitPagination:oP,omitDeep:Nw,print:oa,relayStylePagination:aP,removeArgumentsFromDocument:XR,removeClientSetsFromDocument:um,removeConnectionDirectiveFromDocument:JR,removeDirectivesFromDocument:zu,removeFragmentSpreadFromDocument:ZR,resultKeyNameFromField:Oi,shouldInclude:ra,storeKeyNameFromField:WE,stringifyForDisplay:Bh,stripTypename:EP,valueToObjectRepresentation:no,wrapPromiseWithState:_m},Symbol.toStringTag,{value:"Module"}));function $l(t){return new Xe(function(e){e.error(t)})}function Aw(t){var e=!1;return new Promise(function(n,r){t.subscribe({next:function(i){e?globalThis.__DEV__!==!1&&se.warn(43):(e=!0,n(i))},error:r})})}function Iw(t){return new Xe(function(e){t.then(function(n){e.next(n),e.complete()}).catch(e.error.bind(e))})}var Xu=function(t,e,n){var r=new Error(n);throw r.name="ServerError",r.response=t,r.statusCode=t.status,r.result=e,r};function TP(t){for(var e=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if(e.indexOf(i)<0)throw Sn(44,i)}return t}function SP(t,e){var n=C({},t),r=function(s){typeof s=="function"?n=C(C({},n),s(n)):n=C(C({},n),s)},i=function(){return C({},n)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:r}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function OP(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Bu(e.query)||void 0:""),e}function kP(t,e){var n=C({},t),r=new Set(Object.keys(t));return en(e,{Variable:function(i,s,o){o&&o.kind!=="VariableDefinition"&&r.delete(i.name.value)}}),r.forEach(function(i){delete n[i]}),n}function xw(t,e){return e?e(t):Xe.of()}function Vl(t){return typeof t=="function"?new Nn(t):t}function Zu(t){return t.request.length<=1}var Nn=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return Xe.of()})},t.from=function(e){return e.length===0?t.empty():e.map(Vl).reduce(function(n,r){return n.concat(r)})},t.split=function(e,n,r){var i=Vl(n),s=Vl(r||new t(xw)),o;return Zu(i)&&Zu(s)?o=new t(function(a){return e(a)?i.request(a)||Xe.of():s.request(a)||Xe.of()}):o=new t(function(a,l){return e(a)?i.request(a,l)||Xe.of():s.request(a,l)||Xe.of()}),Object.assign(o,{left:i,right:s})},t.execute=function(e,n){return e.request(SP(n.context,OP(TP(n))))||Xe.of()},t.concat=function(e,n){var r=Vl(e);if(Zu(r))return globalThis.__DEV__!==!1&&se.warn(36,r),r;var i=Vl(n),s;return Zu(i)?s=new t(function(o){return r.request(o,function(a){return i.request(a)||Xe.of()})||Xe.of()}):s=new t(function(o,a){return r.request(o,function(l){return i.request(l,a)||Xe.of()})||Xe.of()}),Object.assign(s,{left:r,right:i})},t.prototype.split=function(e,n,r){return this.concat(t.split(e,n,r||new t(xw)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,n){throw Sn(37)},t.prototype.onError=function(e,n){if(n&&n.error)return n.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}(),Cw=Nn.empty,km=Nn.from,Nm=Nn.split,Dw=Nn.concat,jl=Nn.execute;function NP(t){var e,n=t[Symbol.asyncIterator]();return e={next:function(){return n.next()}},e[Symbol.asyncIterator]=function(){return this},e}function AP(t){var e=null,n=null,r=!1,i=[],s=[];function o(h){if(!n){if(s.length){var p=s.shift();if(Array.isArray(p)&&p[0])return p[0]({value:h,done:!1})}i.push(h)}}function a(h){n=h;var p=s.slice();p.forEach(function(g){g[1](h)}),!e||e()}function l(){r=!0;var h=s.slice();h.forEach(function(p){p[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",a),t.removeListener("end",l),t.removeListener("finish",l),t.removeListener("close",l)},t.on("data",o),t.on("error",a),t.on("end",l),t.on("finish",l),t.on("close",l);function u(){return new Promise(function(h,p){if(n)return p(n);if(i.length)return h({value:i.shift(),done:!1});if(r)return h({value:void 0,done:!0});s.push([h,p])})}var d={next:function(){return u()}};return Ol&&(d[Symbol.asyncIterator]=function(){return this}),d}function IP(t){var e=!1,n={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(r,i){t.then(function(s){r({value:s,done:!1})}).catch(i)}))}};return Ol&&(n[Symbol.asyncIterator]=function(){return this}),n}function Mw(t){var e={next:function(){return t.read()}};return Ol&&(e[Symbol.asyncIterator]=function(){return this}),e}function xP(t){return!!t.body}function CP(t){return!!t.getReader}function DP(t){return!!(Ol&&t[Symbol.asyncIterator])}function MP(t){return!!t.stream}function RP(t){return!!t.arrayBuffer}function PP(t){return!!t.pipe}function FP(t){var e=t;if(xP(t)&&(e=t.body),DP(e))return NP(e);if(CP(e))return Mw(e.getReader());if(MP(e))return Mw(e.stream().getReader());if(RP(e))return IP(e.arrayBuffer());if(PP(e))return AP(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Am=Symbol();function LP(t){return t.extensions?Array.isArray(t.extensions[Am]):!1}function ef(t){return t.hasOwnProperty("graphQLErrors")}var $P=function(t){var e=wt(wt(wt([],t.graphQLErrors,!0),t.clientErrors,!0),t.protocolErrors,!0);return t.networkError&&e.push(t.networkError),e.map(function(n){return yt(n)&&n.message||"Error message not found."}).join(`
|
|
179
179
|
`)},fn=function(t){pr(e,t);function e(n){var r=n.graphQLErrors,i=n.protocolErrors,s=n.clientErrors,o=n.networkError,a=n.errorMessage,l=n.extraInfo,u=t.call(this,a)||this;return u.name="ApolloError",u.graphQLErrors=r||[],u.protocolErrors=i||[],u.clientErrors=s||[],u.networkError=o||null,u.message=a||$P(u),u.extraInfo=l,u.cause=wt(wt(wt([o],r||[],!0),i||[],!0),s||[],!0).find(function(d){return!!d})||null,u.__proto__=e.prototype,u}return e}(Error),Rw=Object.prototype.hasOwnProperty;function VP(t,e){return Ki(this,void 0,void 0,function(){var n,r,i,s,o,a,l,u,d,h,p,g,y,b,_,w,O,N,I,P,R,B,Q,x;return Ji(this,function(U){switch(U.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");n=new TextDecoder("utf-8"),r=(x=t.headers)===null||x===void 0?void 0:x.get("content-type"),i="boundary=",s=r!=null&&r.includes(i)?r==null?void 0:r.substring((r==null?void 0:r.indexOf(i))+i.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",o=`\r
|
|
180
180
|
--`.concat(s),a="",l=FP(t),u=!0,U.label=1;case 1:return u?[4,l.next()]:[3,3];case 2:for(d=U.sent(),h=d.value,p=d.done,g=typeof h=="string"?h:n.decode(h),y=a.length-o.length+1,u=!p,a+=g,b=a.indexOf(o,y);b>-1;){if(_=void 0,B=[a.slice(0,b),a.slice(b+o.length)],_=B[0],a=B[1],w=_.indexOf(`\r
|
|
181
181
|
\r
|
|
182
182
|
`),O=jP(_.slice(0,w)),N=O["content-type"],N&&N.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");if(I=_.slice(w),I){if(P=Pw(t,I),Object.keys(P).length>1||"data"in P||"incremental"in P||"errors"in P||"payload"in P)if(kw(P)){if(R={},"payload"in P){if(Object.keys(P).length===1&&P.payload===null)return[2];R=C({},P.payload)}"errors"in P&&(R=C(C({},R),{extensions:C(C({},"extensions"in R?R.extensions:null),(Q={},Q[Am]=P.errors,Q))})),e(R)}else e(P);else if(Object.keys(P).length===1&&"hasNext"in P&&!P.hasNext)return[2]}b=a.indexOf(o)}return[3,1];case 3:return[2]}})})}function jP(t){var e={};return t.split(`
|
|
183
|
-
`).forEach(function(n){var r=n.indexOf(":");if(r>-1){var i=n.slice(0,r).trim().toLowerCase(),s=n.slice(r+1).trim();e[i]=s}}),e}function Pw(t,e){if(t.status>=300){var n=function(){try{return JSON.parse(e)}catch{return e}};Xu(t,n(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var r=i;throw r.name="ServerParseError",r.response=t,r.statusCode=t.status,r.bodyText=e,r}}function BP(t,e){t.result&&t.result.errors&&t.result.data&&e.next(t.result),e.error(t)}function Im(t){return function(e){return e.text().then(function(n){return Pw(e,n)}).then(function(n){return!Array.isArray(n)&&!Rw.call(n,"data")&&!Rw.call(n,"errors")&&Xu(e,n,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(r){return r.operationName}):t.operationName,"'.")),n})}}var Bl=function(t,e){var n;try{n=JSON.stringify(t)}catch(i){var r=Sn(40,e,i.message);throw r.parseError=i,r}return n},UP={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},qP={accept:"*/*","content-type":"application/json"},WP={method:"POST"},xm={http:UP,headers:qP,options:WP},tf=function(t,e){return e(t)};function Fw(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return n.unshift(e),nf.apply(void 0,wt([t,tf],n,!1))}function nf(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={},s={};n.forEach(function(h){i=C(C(C({},i),h.options),{headers:C(C({},i.headers),h.headers)}),h.credentials&&(i.credentials=h.credentials),s=C(C({},s),h.http)}),i.headers&&(i.headers=zP(i.headers,s.preserveHeaderCase));var o=t.operationName,a=t.extensions,l=t.variables,u=t.query,d={operationName:o,variables:l};return s.includeExtensions&&(d.extensions=a),s.includeQuery&&(d.query=e(u,oa)),{options:i,body:d}}function zP(t,e){if(!e){var n={};return Object.keys(Object(t)).forEach(function(s){n[s.toLowerCase()]=t[s]}),n}var r={};Object.keys(Object(t)).forEach(function(s){r[s.toLowerCase()]={originalName:s,value:t[s]}});var i={};return Object.keys(r).forEach(function(s){i[r[s].originalName]=r[s].value}),i}var Cm=function(t){if(!t&&typeof fetch>"u")throw Sn(38)},Lw=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}},Dm=function(t,e){var n=t.getContext(),r=n.uri;return r||(typeof e=="function"?e(t):e||"/graphql")};function Mm(t,e){var n=[],r=function(h,p){n.push("".concat(h,"=").concat(encodeURIComponent(p)))};if("query"in e&&r("query",e.query),e.operationName&&r("operationName",e.operationName),e.variables){var i=void 0;try{i=Bl(e.variables,"Variables map")}catch(h){return{parseError:h}}r("variables",i)}if(e.extensions){var s=void 0;try{s=Bl(e.extensions,"Extensions map")}catch(h){return{parseError:h}}r("extensions",s)}var o="",a=t,l=t.indexOf("#");l!==-1&&(o=t.substr(l),a=t.substr(0,l));var u=a.indexOf("?")===-1?"?":"&",d=a+u+n.join("&")+o;return{newURI:d}}var $w=mr(function(){return fetch}),Rm=function(t){t===void 0&&(t={});var e=t.uri,n=e===void 0?"/graphql":e,r=t.fetch,i=t.print,s=i===void 0?tf:i,o=t.includeExtensions,a=t.preserveHeaderCase,l=t.useGETForQueries,u=t.includeUnusedVariables,d=u===void 0?!1:u,h=Tn(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&Cm(r||$w);var p={http:{includeExtensions:o,preserveHeaderCase:a},options:h.fetchOptions,credentials:h.credentials,headers:h.headers};return new Nn(function(g){var y=Dm(g,n),b=g.getContext(),_={};if(b.clientAwareness){var w=b.clientAwareness,O=w.name,N=w.version;O&&(_["apollographql-client-name"]=O),N&&(_["apollographql-client-version"]=N)}var I=C(C({},_),b.headers),P={http:b.http,options:b.fetchOptions,credentials:b.credentials,headers:I};if(ss(["client"],g.query)){var R=um(g.query);if(!R)return $l(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));g.query=R}var B=nf(g,s,xm,p,P),Q=B.options,x=B.body;x.variables&&!d&&(x.variables=kP(x.variables,g.query));var U;!Q.signal&&typeof AbortController<"u"&&(U=new AbortController,Q.signal=U.signal);var be=function(ye){return ye.kind==="OperationDefinition"&&ye.operation==="mutation"},Oe=function(ye){return ye.kind==="OperationDefinition"&&ye.operation==="subscription"},ke=Oe(so(g.query)),je=ss(["defer"],g.query);if(l&&!g.query.definitions.some(be)&&(Q.method="GET"),je||ke){Q.headers=Q.headers||{};var te="multipart/mixed;";ke&&je&&globalThis.__DEV__!==!1&&ie.warn(39),ke?te+="boundary=graphql;subscriptionSpec=1.0,application/json":je&&(te+="deferSpec=20220824,application/json"),Q.headers.accept=te}if(Q.method==="GET"){var xe=Mm(y,x),fe=xe.newURI,Ee=xe.parseError;if(Ee)return $l(Ee);y=fe}else try{Q.body=Bl(x,"Payload")}catch(ye){return $l(ye)}return new Xe(function(ye){var ut=r||mr(function(){return fetch})||$w,ve=ye.next.bind(ye);return ut(y,Q).then(function($){var Z;g.setContext({response:$});var Y=(Z=$.headers)===null||Z===void 0?void 0:Z.get("content-type");return Y!==null&&/^multipart\/mixed/i.test(Y)?VP($,ve):Im(g)($).then(ve)}).then(function(){U=void 0,ye.complete()}).catch(function($){U=void 0,BP($,ye)}),function(){U&&U.abort()}})})},rf=function(t){pr(e,t);function e(n){n===void 0&&(n={});var r=t.call(this,Rm(n).request)||this;return r.options=n,r}return e}(Nn);const{toString:Vw,hasOwnProperty:QP}=Object.prototype,jw=Function.prototype.toString,Pm=new Map;function Ue(t,e){try{return Fm(t,e)}finally{Pm.clear()}}function Fm(t,e){if(t===e)return!0;const n=Vw.call(t),r=Vw.call(e);if(n!==r)return!1;switch(n){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Uw(t,e))return!0;const i=Bw(t),s=Bw(e),o=i.length;if(o!==s.length)return!1;for(let a=0;a<o;++a)if(!QP.call(e,i[a]))return!1;for(let a=0;a<o;++a){const l=i[a];if(!Fm(t[l],e[l]))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(Uw(t,e))return!0;const i=t.entries(),s=n==="[object Map]";for(;;){const o=i.next();if(o.done)break;const[a,l]=o.value;if(!e.has(a)||s&&!Fm(l,e.get(a)))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 i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=jw.call(t);return i!==jw.call(e)?!1:!KP(i,HP)}}return!1}function Bw(t){return Object.keys(t).filter(GP,t)}function GP(t){return this[t]!==void 0}const HP="{ [native code] }";function KP(t,e){const n=t.length-e.length;return n>=0&&t.indexOf(e,n)===n}function Uw(t,e){let n=Pm.get(t);if(n){if(n.has(e))return!0}else Pm.set(t,n=new Set);return n.add(e),!1}const JP=Object.freeze(Object.defineProperty({__proto__:null,default:Ue,equal:Ue},Symbol.toStringTag,{value:"Module"}));function qw(t,e,n,r){var i=e.data,s=Tn(e,["data"]),o=n.data,a=Tn(n,["data"]);return Ue(s,a)&&sf(so(t).selectionSet,i,o,{fragmentMap:kl(xl(t)),variables:r})}function sf(t,e,n,r){if(e===n)return!0;var i=new Set;return t.selections.every(function(s){if(i.has(s)||(i.add(s),!ra(s,r.variables))||Ww(s))return!0;if(ki(s)){var o=Oi(s),a=e&&e[o],l=n&&n[o],u=s.selectionSet;if(!u)return Ue(a,l);var d=Array.isArray(a),h=Array.isArray(l);if(d!==h)return!1;if(d&&h){var p=a.length;if(l.length!==p)return!1;for(var g=0;g<p;++g)if(!sf(u,a[g],l[g],r))return!1;return!0}return sf(u,a,l,r)}else{var y=Nl(s,r.fragmentMap);if(y)return Ww(y)?!0:sf(y.selectionSet,e,n,r)}})}function Ww(t){return!!t.directives&&t.directives.some(YP)}function YP(t){return t.name.value==="nonreactive"}var of=function(){function t(){this.assumeImmutableResults=!1,this.getFragmentDoc=Dl(LE,{max:zr["cache.fragmentQueryDocuments"]||1e3,cache:$u})}return t.prototype.batch=function(e){var n=this,r=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(n)},r),i},t.prototype.recordOptimisticTransaction=function(e,n){this.performTransaction(e,n)},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,n){return n===void 0&&(n=!!e.optimistic),this.read(C(C({},e),{rootId:e.id||"ROOT_QUERY",optimistic:n}))},t.prototype.watchFragment=function(e){var n=this,r=e.fragment,i=e.fragmentName,s=e.from,o=e.optimistic,a=o===void 0?!0:o,l=Tn(e,["fragment","fragmentName","from","optimistic"]),u=this.getFragmentDoc(r,i),d=C(C({},l),{returnPartialData:!0,id:typeof s>"u"||typeof s=="string"?s:this.identify(s),query:u,optimistic:a}),h;return new Xe(function(p){return n.watch(C(C({},d),{immediate:!0,callback:function(g){if(!(h&&qw(u,{data:h==null?void 0:h.result},{data:g.result}))){var y={data:g.result,complete:!!g.complete};g.missing&&(y.missing=aa(g.missing.map(function(b){return b.missing}))),h=g,p.next(y)}}}))})},t.prototype.readFragment=function(e,n){return n===void 0&&(n=!!e.optimistic),this.read(C(C({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:n}))},t.prototype.writeQuery=function(e){var n=e.id,r=e.data,i=Tn(e,["id","data"]);return this.write(Object.assign(i,{dataId:n||"ROOT_QUERY",result:r}))},t.prototype.writeFragment=function(e){var n=e.id,r=e.data,i=e.fragment,s=e.fragmentName,o=Tn(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,s),dataId:n,result:r}))},t.prototype.updateQuery=function(e,n){return this.batch({update:function(r){var i=r.readQuery(e),s=n(i);return s==null?i:(r.writeQuery(C(C({},e),{data:s})),s)}})},t.prototype.updateFragment=function(e,n){return this.batch({update:function(r){var i=r.readFragment(e),s=n(i);return s==null?i:(r.writeFragment(C(C({},e),{data:s})),s)}})},t}();globalThis.__DEV__!==!1&&(of.prototype.getMemoryInternals=gR);var af;af||(af={});var lf=function(t){pr(e,t);function e(n,r,i,s){var o,a=t.call(this,n)||this;if(a.message=n,a.path=r,a.query=i,a.variables=s,Array.isArray(a.path)){a.missing=a.message;for(var l=a.path.length-1;l>=0;--l)a.missing=(o={},o[a.path[l]]=a.missing,o)}else a.missing=a.path;return a.__proto__=e.prototype,a}return e}(Error),Ht=Object.prototype.hasOwnProperty;function Ul(t){return t==null}function cf(t,e){var n=t.__typename,r=t.id,i=t._id;if(typeof n=="string"&&(e&&(e.keyObject=Ul(r)?Ul(i)?void 0:{_id:i}:{id:r}),Ul(r)&&!Ul(i)&&(r=i),!Ul(r)))return"".concat(n,":").concat(typeof r=="number"||typeof r=="string"?r:JSON.stringify(r))}var zw={dataIdFromObject:cf,addTypename:!0,resultCaching:!0,canonizeResults:!1};function XP(t){return us(zw,t)}function Qw(t){var e=t.canonizeResults;return e===void 0?zw.canonizeResults:e}function ZP(t,e){return et(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Gw=/^[_a-z][_0-9a-z]*/i;function fs(t){var e=t.match(Gw);return e?e[0]:t}function Lm(t,e,n){return yt(e)?Tt(e)?e.every(function(r){return Lm(t,r,n)}):t.selections.every(function(r){if(ki(r)&&ra(r,n)){var i=Oi(r);return Ht.call(e,i)&&(!r.selectionSet||Lm(r.selectionSet,e[i],n))}return!0}):!1}function da(t){return yt(t)&&!et(t)&&!Tt(t)}function eF(){return new Ni}function Hw(t,e){var n=kl(xl(t));return{fragmentMap:n,lookupFragment:function(r){var i=n[r];return!i&&e&&(i=e.lookup(r)),i||null}}}var uf=Object.create(null),$m=function(){return uf},Kw=Object.create(null),ql=function(){function t(e,n){var r=this;this.policies=e,this.group=n,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,s){return ua(et(i)?r.get(i.__ref,s):i&&i[s])},this.canRead=function(i){return et(i)?r.has(i.__ref):typeof i=="object"},this.toReference=function(i,s){if(typeof i=="string")return Si(i);if(et(i))return i;var o=r.policies.identify(i)[0];if(o){var a=Si(o);return s&&r.merge(o,i),a}}}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,n){if(this.group.depend(e,n),Ht.call(this.data,e)){var r=this.data[e];if(r&&Ht.call(r,n))return r[n]}if(n==="__typename"&&Ht.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof ds)return this.parent.get(e,n)},t.prototype.lookup=function(e,n){if(n&&this.group.depend(e,"__exists"),Ht.call(this.data,e))return this.data[e];if(this instanceof ds)return this.parent.lookup(e,n);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,n){var r=this,i;et(e)&&(e=e.__ref),et(n)&&(n=n.__ref);var s=typeof e=="string"?this.lookup(i=e):e,o=typeof n=="string"?this.lookup(i=n):n;if(o){ie(typeof i=="string",1);var a=new Ni(nF).merge(s,o);if(this.data[i]=a,a!==s&&(delete this.refs[i],this.group.caching)){var l=Object.create(null);s||(l.__exists=1),Object.keys(o).forEach(function(u){if(!s||s[u]!==a[u]){l[u]=1;var d=fs(u);d!==u&&!r.policies.hasKeyArgs(a.__typename,d)&&(l[d]=1),a[u]===void 0&&!(r instanceof ds)&&delete a[u]}}),l.__typename&&!(s&&s.__typename)&&this.policies.rootTypenamesById[i]===a.__typename&&delete l.__typename,Object.keys(l).forEach(function(u){return r.group.dirty(i,u)})}}},t.prototype.modify=function(e,n){var r=this,i=this.lookup(e);if(i){var s=Object.create(null),o=!1,a=!0,l={DELETE:uf,INVALIDATE:Kw,isReference:et,toReference:this.toReference,canRead:this.canRead,readField:function(u,d){return r.policies.readField(typeof u=="string"?{fieldName:u,from:d||Si(e)}:u,{store:r})}};if(Object.keys(i).forEach(function(u){var d=fs(u),h=i[u];if(h!==void 0){var p=typeof n=="function"?n:n[u]||n[d];if(p){var g=p===$m?uf:p(ua(h),C(C({},l),{fieldName:d,storeFieldName:u,storage:r.getStorage(e,u)}));if(g===Kw)r.group.dirty(e,u);else if(g===uf&&(g=void 0),g!==h&&(s[u]=g,o=!0,h=g,globalThis.__DEV__!==!1)){var y=function(P){if(r.lookup(P.__ref)===void 0)return globalThis.__DEV__!==!1&&ie.warn(2,P),!0};if(et(g))y(g);else if(Array.isArray(g))for(var b=!1,_=void 0,w=0,O=g;w<O.length;w++){var N=O[w];if(et(N)){if(b=!0,y(N))break}else if(typeof N=="object"&&N){var I=r.policies.identify(N)[0];I&&(_=N)}if(b&&_!==void 0){globalThis.__DEV__!==!1&&ie.warn(3,_);break}}}}h!==void 0&&(a=!1)}}),o)return this.merge(e,s),a&&(this instanceof ds?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,n,r){var i,s=this.lookup(e);if(s){var o=this.getFieldValue(s,"__typename"),a=n&&r?this.policies.getStoreFieldName({typename:o,fieldName:n,args:r}):n;return this.modify(e,a?(i={},i[a]=$m,i):$m)}return!1},t.prototype.evict=function(e,n){var r=!1;return e.id&&(Ht.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof ds&&this!==n&&(r=this.parent.evict(e,n)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,n=this.toObject(),r=[];return this.getRootIdSet().forEach(function(i){Ht.call(e.policies.rootTypenamesById,i)||r.push(i)}),r.length&&(n.__META={extraRootIds:r.sort()}),n},t.prototype.replace=function(e){var n=this;if(Object.keys(this.data).forEach(function(s){e&&Ht.call(e,s)||n.delete(s)}),e){var r=e.__META,i=Tn(e,["__META"]);Object.keys(i).forEach(function(s){n.merge(s,i[s])}),r&&r.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 n=--this.rootIds[e];return n||delete this.rootIds[e],n}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof ds?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,n=this.getRootIdSet(),r=this.toObject();n.forEach(function(o){Ht.call(r,o)&&(Object.keys(e.findChildRefIds(o)).forEach(n.add,n),delete r[o])});var i=Object.keys(r);if(i.length){for(var s=this;s instanceof ds;)s=s.parent;i.forEach(function(o){return s.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!Ht.call(this.refs,e)){var n=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return n;var i=new Set([r]);i.forEach(function(s){et(s)&&(n[s.__ref]=!0),yt(s)&&Object.keys(s).forEach(function(o){var a=s[o];yt(a)&&i.add(a)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}(),Jw=function(){function t(e,n){n===void 0&&(n=null),this.caching=e,this.parent=n,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?lw():null,this.keyMaker=new eo(as)},t.prototype.depend=function(e,n){if(this.d){this.d(Vm(e,n));var r=fs(n);r!==n&&this.d(Vm(e,r)),this.parent&&this.parent.depend(e,n)}},t.prototype.dirty=function(e,n){this.d&&this.d.dirty(Vm(e,n),n==="__exists"?"forget":"setDirty")},t}();function Vm(t,e){return e+"#"+t}function Yw(t,e){Wl(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(n){pr(r,n);function r(i){var s=i.policies,o=i.resultCaching,a=o===void 0?!0:o,l=i.seed,u=n.call(this,s,new Jw(a))||this;return u.stump=new tF(u),u.storageTrie=new eo(as),l&&u.replace(l),u}return r.prototype.addLayer=function(i,s){return this.stump.addLayer(i,s)},r.prototype.removeLayer=function(){return this},r.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},r}(t);t.Root=e})(ql||(ql={}));var ds=function(t){pr(e,t);function e(n,r,i,s){var o=t.call(this,r.policies,s)||this;return o.id=n,o.parent=r,o.replay=i,o.group=s,i(o),o}return e.prototype.addLayer=function(n,r){return new e(n,this,r,this.group)},e.prototype.removeLayer=function(n){var r=this,i=this.parent.removeLayer(n);return n===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(s){var o=r.data[s],a=i.lookup(s);a?o?o!==a&&Object.keys(o).forEach(function(l){Ue(o[l],a[l])||r.group.dirty(s,l)}):(r.group.dirty(s,"__exists"),Object.keys(a).forEach(function(l){r.group.dirty(s,l)})):r.delete(s)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return C(C({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(n){var r=this.parent.findChildRefIds(n);return Ht.call(this.data,n)?C(C({},r),t.prototype.findChildRefIds.call(this,n)):r},e.prototype.getStorage=function(){for(var n=this.parent;n.parent;)n=n.parent;return n.getStorage.apply(n,arguments)},e}(ql),tF=function(t){pr(e,t);function e(n){return t.call(this,"EntityStore.Stump",n,function(){},new Jw(n.group.caching,n.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(n,r){return this.parent.merge(n,r)},e}(ds);function nF(t,e,n){var r=t[n],i=e[n];return Ue(r,i)?r:i}function Wl(t){return!!(t instanceof ql&&t.group.caching)}function rF(t){return yt(t)?Tt(t)?t.slice(0):C({__proto__:Object.getPrototypeOf(t)},t):t}var Xw=function(){function t(){this.known=new(Qp?WeakSet:Set),this.pool=new eo(as),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return yt(e)&&this.known.has(e)},t.prototype.pass=function(e){if(yt(e)){var n=rF(e);return this.passes.set(n,e),n}return e},t.prototype.admit=function(e){var n=this;if(yt(e)){var r=this.passes.get(e);if(r)return r;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var s=e.map(this.admit,this),o=this.pool.lookupArray(s);return o.array||(this.known.add(o.array=s),globalThis.__DEV__!==!1&&Object.freeze(s)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var a=Object.getPrototypeOf(e),l=[a],u=this.sortedKeys(e);l.push(u.json);var d=l.length;u.sorted.forEach(function(g){l.push(n.admit(e[g]))});var o=this.pool.lookupArray(l);if(!o.object){var h=o.object=Object.create(a);this.known.add(h),u.sorted.forEach(function(g,y){h[g]=l[d+y]}),globalThis.__DEV__!==!1&&Object.freeze(h)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var n=Object.keys(e),r=this.pool.lookupArray(n);if(!r.keys){n.sort();var i=JSON.stringify(n);(r.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,r.keys={sorted:n,json:i})}return r.keys},t}();function Zw(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var iF=function(){function t(e){var n=this;this.knownResults=new(as?WeakMap:Map),this.config=us(e,{addTypename:e.addTypename!==!1,canonizeResults:Qw(e)}),this.canon=e.canon||new Xw,this.executeSelectionSet=Dl(function(r){var i,s=r.context.canonizeResults,o=Zw(r);o[3]=!s;var a=(i=n.executeSelectionSet).peek.apply(i,o);return a?s?C(C({},a),{result:n.canon.admit(a.result)}):a:(Yw(r.context.store,r.enclosingRef.__ref),n.execSelectionSetImpl(r))},{max:this.config.resultCacheMaxSize||zr["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Zw,makeCacheKey:function(r,i,s,o){if(Wl(s.store))return s.store.makeCacheKey(r,et(i)?i.__ref:i,s.varString,o)}}),this.executeSubSelectedArray=Dl(function(r){return Yw(r.context.store,r.enclosingRef.__ref),n.execSubSelectedArrayImpl(r)},{max:this.config.resultCacheMaxSize||zr["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(r){var i=r.field,s=r.array,o=r.context;if(Wl(o.store))return o.store.makeCacheKey(i,s,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new Xw},t.prototype.diffQueryAgainstStore=function(e){var n=e.store,r=e.query,i=e.rootId,s=i===void 0?"ROOT_QUERY":i,o=e.variables,a=e.returnPartialData,l=a===void 0?!0:a,u=e.canonizeResults,d=u===void 0?this.config.canonizeResults:u,h=this.config.cache.policies;o=C(C({},Uu(tm(r))),o);var p=Si(s),g=this.executeSelectionSet({selectionSet:so(r).selectionSet,objectOrReference:p,enclosingRef:p,context:C({store:n,query:r,policies:h,variables:o,varString:_r(o),canonizeResults:d},Hw(r,this.config.fragments))}),y;if(g.missing&&(y=[new lf(sF(g.missing),g.missing,r,o)],!l))throw y[0];return{result:g.result,complete:!y,missing:y}},t.prototype.isFresh=function(e,n,r,i){if(Wl(i.store)&&this.knownResults.get(e)===r){var s=this.executeSelectionSet.peek(r,n,i,this.canon.isKnown(e));if(s&&e===s.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var n=this,r=e.selectionSet,i=e.objectOrReference,s=e.enclosingRef,o=e.context;if(et(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var a=o.variables,l=o.policies,u=o.store,d=u.getFieldValue(i,"__typename"),h=[],p,g=new Ni;this.config.addTypename&&typeof d=="string"&&!l.rootIdsByTypename[d]&&h.push({__typename:d});function y(N,I){var P;return N.missing&&(p=g.merge(p,(P={},P[I]=N.missing,P))),N.result}var b=new Set(r.selections);b.forEach(function(N){var I,P;if(ra(N,a))if(ki(N)){var R=l.readField({fieldName:N.name.value,field:N,variables:o.variables,from:i},o),B=Oi(N);R===void 0?Qu.added(N)||(p=g.merge(p,(I={},I[B]="Can't find field '".concat(N.name.value,"' on ").concat(et(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),I))):Tt(R)?R.length>0&&(R=y(n.executeSubSelectedArray({field:N,array:R,enclosingRef:s,context:o}),B)):N.selectionSet?R!=null&&(R=y(n.executeSelectionSet({selectionSet:N.selectionSet,objectOrReference:R,enclosingRef:et(R)?R:s,context:o}),B)):o.canonizeResults&&(R=n.canon.pass(R)),R!==void 0&&h.push((P={},P[B]=R,P))}else{var Q=Nl(N,o.lookupFragment);if(!Q&&N.kind===k.FRAGMENT_SPREAD)throw Sn(9,N.name.value);Q&&l.fragmentMatches(Q,d)&&Q.selectionSet.selections.forEach(b.add,b)}});var _=aa(h),w={result:_,missing:p},O=o.canonizeResults?this.canon.admit(w):ua(w);return O.result&&this.knownResults.set(O.result,r),O},t.prototype.execSubSelectedArrayImpl=function(e){var n=this,r=e.field,i=e.array,s=e.enclosingRef,o=e.context,a,l=new Ni;function u(d,h){var p;return d.missing&&(a=l.merge(a,(p={},p[h]=d.missing,p))),d.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(d,h){return d===null?null:Tt(d)?u(n.executeSubSelectedArray({field:r,array:d,enclosingRef:s,context:o}),h):r.selectionSet?u(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:d,enclosingRef:et(d)?d:s,context:o}),h):(globalThis.__DEV__!==!1&&oF(o.store,r,d),d)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:a}},t}();function sF(t){try{JSON.stringify(t,function(e,n){if(typeof n=="string")throw n;return n})}catch(e){return e}}function oF(t,e,n){if(!e.selectionSet){var r=new Set([n]);r.forEach(function(i){yt(i)&&(ie(!et(i),10,ZP(t,i),e.name.value),Object.values(i).forEach(r.add,r))})}}var jm=new im,eT=new WeakMap;function zl(t){var e=eT.get(t);return e||eT.set(t,e={vars:new Set,dep:lw()}),e}function tT(t){zl(t).vars.forEach(function(e){return e.forgetCache(t)})}function aF(t){zl(t).vars.forEach(function(e){return e.attachCache(t)})}function Bm(t){var e=new Set,n=new Set,r=function(s){if(arguments.length>0){if(t!==s){t=s,e.forEach(function(l){zl(l).dep.dirty(r),lF(l)});var o=Array.from(n);n.clear(),o.forEach(function(l){return l(t)})}}else{var a=jm.getValue();a&&(i(a),zl(a).dep(r))}return t};r.onNextChange=function(s){return n.add(s),function(){n.delete(s)}};var i=r.attachCache=function(s){return e.add(s),zl(s).vars.add(r),r};return r.forgetCache=function(s){return e.delete(s)},r}function lF(t){t.broadcastWatches&&t.broadcastWatches()}var nT=Object.create(null);function Um(t){var e=JSON.stringify(t);return nT[e]||(nT[e]=Object.create(null))}function rT(t){var e=Um(t);return e.keyFieldsFn||(e.keyFieldsFn=function(n,r){var i=function(o,a){return r.readField(a,o)},s=r.keyObject=qm(t,function(o){var a=ha(r.storeObject,o,i);return a===void 0&&n!==r.storeObject&&Ht.call(n,o[0])&&(a=ha(n,o,oT)),ie(a!==void 0,4,o.join("."),n),a});return"".concat(r.typename,":").concat(JSON.stringify(s))})}function iT(t){var e=Um(t);return e.keyArgsFn||(e.keyArgsFn=function(n,r){var i=r.field,s=r.variables,o=r.fieldName,a=qm(t,function(u){var d=u[0],h=d.charAt(0);if(h==="@"){if(i&&Un(i.directives)){var p=d.slice(1),g=i.directives.find(function(w){return w.name.value===p}),y=g&&Il(g,s);return y&&ha(y,u.slice(1))}return}if(h==="$"){var b=d.slice(1);if(s&&Ht.call(s,b)){var _=u.slice(0);return _[0]=b,ha(s,_)}return}if(n)return ha(n,u)}),l=JSON.stringify(a);return(n||l!=="{}")&&(o+=":"+l),o})}function qm(t,e){var n=new Ni;return sT(t).reduce(function(r,i){var s,o=e(i);if(o!==void 0){for(var a=i.length-1;a>=0;--a)o=(s={},s[i[a]]=o,s);r=n.merge(r,o)}return r},Object.create(null))}function sT(t){var e=Um(t);if(!e.paths){var n=e.paths=[],r=[];t.forEach(function(i,s){Tt(i)?(sT(i).forEach(function(o){return n.push(r.concat(o))}),r.length=0):(r.push(i),Tt(t[s+1])||(n.push(r.slice(0)),r.length=0))})}return e.paths}function oT(t,e){return t[e]}function ha(t,e,n){return n=n||oT,aT(e.reduce(function r(i,s){return Tt(i)?i.map(function(o){return r(o,s)}):i&&n(i,s)},t))}function aT(t){return yt(t)?Tt(t)?t.map(aT):qm(Object.keys(t).sort(),function(e){return ha(t,e)}):t}function Wm(t){return t.args!==void 0?t.args:t.field?Il(t.field,t.variables):null}var cF=function(){},lT=function(t,e){return e.fieldName},cT=function(t,e,n){var r=n.mergeObjects;return r(t,e)},uT=function(t,e){return e},uF=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:cf},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,n){var r,i=this,s=n&&(n.typename||((r=n.storeObject)===null||r===void 0?void 0:r.__typename))||e.__typename;if(s===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=n&&n.storeObject||e,a=C(C({},n),{typename:s,storeObject:o,readField:n&&n.readField||function(){var p=zm(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),l,u=s&&this.getTypePolicy(s),d=u&&u.keyFn||this.config.dataIdFromObject;d;){var h=d(C(C({},e),o),a);if(Tt(h))d=rT(h);else{l=h;break}}return l=l?String(l):void 0,a.keyObject?[l,a.keyObject]:[l]},t.prototype.addTypePolicies=function(e){var n=this;Object.keys(e).forEach(function(r){var i=e[r],s=i.queryType,o=i.mutationType,a=i.subscriptionType,l=Tn(i,["queryType","mutationType","subscriptionType"]);s&&n.setRootTypename("Query",r),o&&n.setRootTypename("Mutation",r),a&&n.setRootTypename("Subscription",r),Ht.call(n.toBeAdded,r)?n.toBeAdded[r].push(l):n.toBeAdded[r]=[l]})},t.prototype.updateTypePolicy=function(e,n){var r=this,i=this.getTypePolicy(e),s=n.keyFields,o=n.fields;function a(l,u){l.merge=typeof u=="function"?u:u===!0?cT:u===!1?uT:l.merge}a(i,n.merge),i.keyFn=s===!1?cF:Tt(s)?rT(s):typeof s=="function"?s:i.keyFn,o&&Object.keys(o).forEach(function(l){var u=r.getFieldPolicy(e,l,!0),d=o[l];if(typeof d=="function")u.read=d;else{var h=d.keyArgs,p=d.read,g=d.merge;u.keyFn=h===!1?lT:Tt(h)?iT(h):typeof h=="function"?h:u.keyFn,typeof p=="function"&&(u.read=p),a(u,g)}u.read&&u.merge&&(u.keyFn=u.keyFn||lT)})},t.prototype.setRootTypename=function(e,n){n===void 0&&(n=e);var r="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[r];n!==i&&(ie(!i||i===e,5,e),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[n]=r,this.rootTypenamesById[r]=n)},t.prototype.addPossibleTypes=function(e){var n=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(r){n.getSupertypeSet(r,!0),e[r].forEach(function(i){n.getSupertypeSet(i,!0).add(r);var s=i.match(Gw);(!s||s[0]!==i)&&n.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var n=this;if(!Ht.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(o,a){if(o.test(e)){var l=n.supertypeMap.get(a);l&&l.forEach(function(u){return i.add(u)})}})),i&&i.size&&i.forEach(function(o){var a=n.getTypePolicy(o),l=a.fields,u=Tn(a,["fields"]);Object.assign(r,u),Object.assign(r.fields,l)})}var s=this.toBeAdded[e];return s&&s.length&&s.splice(0).forEach(function(o){n.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,n,r){if(e){var i=this.getTypePolicy(e).fields;return i[n]||r&&(i[n]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,n){var r=this.supertypeMap.get(e);return!r&&n&&this.supertypeMap.set(e,r=new Set),r},t.prototype.fragmentMatches=function(e,n,r,i){var s=this;if(!e.typeCondition)return!0;if(!n)return!1;var o=e.typeCondition.name.value;if(n===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(n,!0),l=[a],u=function(y){var b=s.getSupertypeSet(y,!1);b&&b.size&&l.indexOf(b)<0&&l.push(b)},d=!!(r&&this.fuzzySubtypes.size),h=!1,p=0;p<l.length;++p){var g=l[p];if(g.has(o))return a.has(o)||(h&&globalThis.__DEV__!==!1&&ie.warn(6,n,o),a.add(o)),!0;g.forEach(u),d&&p===l.length-1&&Lm(e.selectionSet,r,i)&&(d=!1,h=!0,this.fuzzySubtypes.forEach(function(y,b){var _=n.match(y);_&&_[0]===n&&u(b)}))}return!1},t.prototype.hasKeyArgs=function(e,n){var r=this.getFieldPolicy(e,n,!1);return!!(r&&r.keyFn)},t.prototype.getStoreFieldName=function(e){var n=e.typename,r=e.fieldName,i=this.getFieldPolicy(n,r,!1),s,o=i&&i.keyFn;if(o&&n)for(var a={typename:n,fieldName:r,field:e.field||null,variables:e.variables},l=Wm(e);o;){var u=o(l,a);if(Tt(u))o=iT(u);else{s=u||r;break}}return s===void 0&&(s=e.field?WE(e.field,e.variables):em(r,Wm(e))),s===!1?r:r===fs(s)?s:r+":"+s},t.prototype.readField=function(e,n){var r=e.from;if(r){var i=e.field||e.fieldName;if(i){if(e.typename===void 0){var s=n.store.getFieldValue(r,"__typename");s&&(e.typename=s)}var o=this.getStoreFieldName(e),a=fs(o),l=n.store.getFieldValue(r,o),u=this.getFieldPolicy(e.typename,a,!1),d=u&&u.read;if(d){var h=fT(this,r,e,n,n.store.getStorage(et(r)?r.__ref:r,o));return jm.withValue(this.cache,d,[l,h])}return l}}},t.prototype.getReadFunction=function(e,n){var r=this.getFieldPolicy(e,n,!1);return r&&r.read},t.prototype.getMergeFunction=function(e,n,r){var i=this.getFieldPolicy(e,n,!1),s=i&&i.merge;return!s&&r&&(i=this.getTypePolicy(r),s=i&&i.merge),s},t.prototype.runMergeFunction=function(e,n,r,i,s){var o=r.field,a=r.typename,l=r.merge;return l===cT?dT(i.store)(e,n):l===uT?n:(i.overwrite&&(e=void 0),l(e,n,fT(this,void 0,{typename:a,fieldName:o.name.value,field:o,variables:i.variables},i,s||Object.create(null))))},t}();function fT(t,e,n,r,i){var s=t.getStoreFieldName(n),o=fs(s),a=n.variables||r.variables,l=r.store,u=l.toReference,d=l.canRead;return{args:Wm(n),field:n.field||null,fieldName:o,storeFieldName:s,variables:a,isReference:et,toReference:u,storage:i,cache:t.cache,canRead:d,readField:function(){return t.readField(zm(arguments,e,a),r)},mergeObjects:dT(r.store)}}function zm(t,e,n){var r=t[0],i=t[1],s=t.length,o;return typeof r=="string"?o={fieldName:r,from:s>1?i:e}:(o=C({},r),Ht.call(o,"from")||(o.from=e)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&ie.warn(7,Bh(Array.from(t))),o.variables===void 0&&(o.variables=n),o}function dT(t){return function(n,r){if(Tt(n)||Tt(r))throw Sn(8);if(yt(n)&&yt(r)){var i=t.getFieldValue(n,"__typename"),s=t.getFieldValue(r,"__typename"),o=i&&s&&i!==s;if(o)return r;if(et(n)&&da(r))return t.merge(n.__ref,r),n;if(da(n)&&et(r))return t.merge(n,r.__ref),r;if(da(n)&&da(r))return C(C({},n),r)}return r}}function Qm(t,e,n){var r="".concat(e).concat(n),i=t.flavors.get(r);return i||t.flavors.set(r,i=t.clientOnly===e&&t.deferred===n?t:C(C({},t),{clientOnly:e,deferred:n})),i}var fF=function(){function t(e,n,r){this.cache=e,this.reader=n,this.fragments=r}return t.prototype.writeToStore=function(e,n){var r=this,i=n.query,s=n.result,o=n.dataId,a=n.variables,l=n.overwrite,u=io(i),d=eF();a=C(C({},Uu(u)),a);var h=C(C({store:e,written:Object.create(null),merge:function(g,y){return d.merge(g,y)},variables:a,varString:_r(a)},Hw(i,this.fragments)),{overwrite:!!l,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:s||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:h});if(!et(p))throw Sn(11,s);return h.incomingById.forEach(function(g,y){var b=g.storeObject,_=g.mergeTree,w=g.fieldNodeSet,O=Si(y);if(_&&_.map.size){var N=r.applyMerges(_,O,b,h);if(et(N))return;b=N}if(globalThis.__DEV__!==!1&&!h.overwrite){var I=Object.create(null);w.forEach(function(B){B.selectionSet&&(I[B.name.value]=!0)});var P=function(B){return I[fs(B)]===!0},R=function(B){var Q=_&&_.map.get(B);return!!(Q&&Q.info&&Q.info.merge)};Object.keys(b).forEach(function(B){P(B)&&!R(B)&&dF(O,b,B,h.store)})}e.merge(y,b)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var n=this,r=e.dataId,i=e.result,s=e.selectionSet,o=e.context,a=e.mergeTree,l=this.cache.policies,u=Object.create(null),d=r&&l.rootTypenamesById[r]||ju(i,s,o.fragmentMap)||r&&o.store.get(r,"__typename");typeof d=="string"&&(u.__typename=d);var h=function(){var N=zm(arguments,u,o.variables);if(et(N.from)){var I=o.incomingById.get(N.from.__ref);if(I){var P=l.readField(C(C({},N),{from:I.storeObject}),o);if(P!==void 0)return P}}return l.readField(N,o)},p=new Set;this.flattenFields(s,i,o,d).forEach(function(N,I){var P,R=Oi(I),B=i[R];if(p.add(I),B!==void 0){var Q=l.getStoreFieldName({typename:d,fieldName:I.name.value,field:I,variables:N.variables}),x=pT(a,Q),U=n.processFieldValue(B,I,I.selectionSet?Qm(N,!1,!1):N,x),be=void 0;I.selectionSet&&(et(U)||da(U))&&(be=h("__typename",U));var Oe=l.getMergeFunction(d,I.name.value,be);Oe?x.info={field:I,typename:d,merge:Oe}:mT(a,Q),u=N.merge(u,(P={},P[Q]=U,P))}else globalThis.__DEV__!==!1&&!N.clientOnly&&!N.deferred&&!Qu.added(I)&&!l.getReadFunction(d,I.name.value)&&globalThis.__DEV__!==!1&&ie.error(12,Oi(I),i)});try{var g=l.identify(i,{typename:d,selectionSet:s,fragmentMap:o.fragmentMap,storeObject:u,readField:h}),y=g[0],b=g[1];r=r||y,b&&(u=o.merge(u,b))}catch(N){if(!r)throw N}if(typeof r=="string"){var _=Si(r),w=o.written[r]||(o.written[r]=[]);if(w.indexOf(s)>=0||(w.push(s),this.reader&&this.reader.isFresh(i,_,s,o)))return _;var O=o.incomingById.get(r);return O?(O.storeObject=o.merge(O.storeObject,u),O.mergeTree=Gm(O.mergeTree,a),p.forEach(function(N){return O.fieldNodeSet.add(N)})):o.incomingById.set(r,{storeObject:u,mergeTree:ff(a)?void 0:a,fieldNodeSet:p}),_}return u},t.prototype.processFieldValue=function(e,n,r,i){var s=this;return!n.selectionSet||e===null?globalThis.__DEV__!==!1?Em(e):e:Tt(e)?e.map(function(o,a){var l=s.processFieldValue(o,n,r,pT(i,a));return mT(i,a),l}):this.processSelectionSet({result:e,selectionSet:n.selectionSet,context:r,mergeTree:i})},t.prototype.flattenFields=function(e,n,r,i){i===void 0&&(i=ju(n,e,r.fragmentMap));var s=new Map,o=this.cache.policies,a=new eo(!1);return function l(u,d){var h=a.lookup(u,d.clientOnly,d.deferred);h.visited||(h.visited=!0,u.selections.forEach(function(p){if(ra(p,r.variables)){var g=d.clientOnly,y=d.deferred;if(!(g&&y)&&Un(p.directives)&&p.directives.forEach(function(w){var O=w.name.value;if(O==="client"&&(g=!0),O==="defer"){var N=Il(w,r.variables);(!N||N.if!==!1)&&(y=!0)}}),ki(p)){var b=s.get(p);b&&(g=g&&b.clientOnly,y=y&&b.deferred),s.set(p,Qm(r,g,y))}else{var _=Nl(p,r.lookupFragment);if(!_&&p.kind===k.FRAGMENT_SPREAD)throw Sn(13,p.name.value);_&&o.fragmentMatches(_,i,n,r.variables)&&l(_.selectionSet,Qm(r,g,y))}}}))}(e,r),s},t.prototype.applyMerges=function(e,n,r,i,s){var o,a=this;if(e.map.size&&!et(r)){var l=!Tt(r)&&(et(n)||da(n))?n:void 0,u=r;l&&!s&&(s=[et(l)?l.__ref:l]);var d,h=function(p,g){return Tt(p)?typeof g=="number"?p[g]:void 0:i.store.getFieldValue(p,String(g))};e.map.forEach(function(p,g){var y=h(l,g),b=h(u,g);if(b!==void 0){s&&s.push(g);var _=a.applyMerges(p,y,b,i,s);_!==b&&(d=d||new Map,d.set(g,_)),s&&ie(s.pop()===g)}}),d&&(r=Tt(u)?u.slice(0):C({},u),d.forEach(function(p,g){r[g]=p}))}return e.info?this.cache.policies.runMergeFunction(n,r,e.info,i,s&&(o=i.store).getStorage.apply(o,s)):r},t}(),hT=[];function pT(t,e){var n=t.map;return n.has(e)||n.set(e,hT.pop()||{map:new Map}),n.get(e)}function Gm(t,e){if(t===e||!e||ff(e))return t;if(!t||ff(t))return e;var n=t.info&&e.info?C(C({},t.info),e.info):t.info||e.info,r=t.map.size&&e.map.size,i=r?new Map:t.map.size?t.map:e.map,s={info:n,map:i};if(r){var o=new Set(e.map.keys());t.map.forEach(function(a,l){s.map.set(l,Gm(a,e.map.get(l))),o.delete(l)}),o.forEach(function(a){s.map.set(a,Gm(e.map.get(a),t.map.get(a)))})}return s}function ff(t){return!t||!(t.info||t.map.size)}function mT(t,e){var n=t.map,r=n.get(e);r&&ff(r)&&(hT.push(r),n.delete(e))}var gT=new Set;function dF(t,e,n,r){var i=function(h){var p=r.getFieldValue(h,n);return typeof p=="object"&&p},s=i(t);if(s){var o=i(e);if(o&&!et(s)&&!Ue(s,o)&&!Object.keys(s).every(function(h){return r.getFieldValue(o,h)!==void 0})){var a=r.getFieldValue(t,"__typename")||r.getFieldValue(e,"__typename"),l=fs(n),u="".concat(a,".").concat(l);if(!gT.has(u)){gT.add(u);var d=[];!Tt(s)&&!Tt(o)&&[s,o].forEach(function(h){var p=r.getFieldValue(h,"__typename");typeof p=="string"&&!d.includes(p)&&d.push(p)}),globalThis.__DEV__!==!1&&ie.warn(14,l,a,d.length?"either ensure all objects of type "+d.join(" and ")+" have an ID or a custom merge function, or ":"",u,C({},s),C({},o))}}}}var Hm=function(t){pr(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.watches=new Set,r.addTypenameTransform=new Ml(Qu),r.assumeImmutableResults=!0,r.makeVar=Bm,r.txCount=0,r.config=XP(n),r.addTypename=!!r.config.addTypename,r.policies=new uF({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return e.prototype.init=function(){var n=this.data=new ql.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=n.stump,this.resetResultCache()},e.prototype.resetResultCache=function(n){var r=this,i=this.storeReader,s=this.config.fragments;this.storeWriter=new fF(this,this.storeReader=new iF({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Qw(this.config),canon:n?void 0:i&&i.canon,fragments:s}),s),this.maybeBroadcastWatch=Dl(function(o,a){return r.broadcastWatch(o,a)},{max:this.config.resultCacheMaxSize||zr["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(o){var a=o.optimistic?r.optimisticData:r.data;if(Wl(a)){var l=o.optimistic,u=o.id,d=o.variables;return a.makeCacheKey(o.query,o.callback,_r({optimistic:l,id:u,variables:d}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(n){return this.init(),n&&this.data.replace(n),this},e.prototype.extract=function(n){return n===void 0&&(n=!1),(n?this.optimisticData:this.data).extract()},e.prototype.read=function(n){var r=n.returnPartialData,i=r===void 0?!1:r;try{return this.storeReader.diffQueryAgainstStore(C(C({},n),{store:n.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(s){if(s instanceof lf)return null;throw s}},e.prototype.write=function(n){try{return++this.txCount,this.storeWriter.writeToStore(this.data,n)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(n){if(Ht.call(n,"id")&&!n.id)return!1;var r=n.optimistic?this.optimisticData:this.data;try{return++this.txCount,r.modify(n.id||"ROOT_QUERY",n.fields)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(n){return this.storeReader.diffQueryAgainstStore(C(C({},n),{store:n.optimistic?this.optimisticData:this.data,rootId:n.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(n){var r=this;return this.watches.size||aF(this),this.watches.add(n),n.immediate&&this.maybeBroadcastWatch(n),function(){r.watches.delete(n)&&!r.watches.size&&tT(r),r.maybeBroadcastWatch.forget(n)}},e.prototype.gc=function(n){var r;_r.reset(),oa.reset(),this.addTypenameTransform.resetCache(),(r=this.config.fragments)===null||r===void 0||r.resetCaches();var i=this.optimisticData.gc();return n&&!this.txCount&&(n.resetResultCache?this.resetResultCache(n.resetResultIdentities):n.resetResultIdentities&&this.storeReader.resetCanon()),i},e.prototype.retain=function(n,r){return(r?this.optimisticData:this.data).retain(n)},e.prototype.release=function(n,r){return(r?this.optimisticData:this.data).release(n)},e.prototype.identify=function(n){if(et(n))return n.__ref;try{return this.policies.identify(n)[0]}catch(r){globalThis.__DEV__!==!1&&ie.warn(r)}},e.prototype.evict=function(n){if(!n.id){if(Ht.call(n,"id"))return!1;n=C(C({},n),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(n,this.data)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(n){var r=this;return this.init(),_r.reset(),n&&n.discardWatches?(this.watches.forEach(function(i){return r.maybeBroadcastWatch.forget(i)}),this.watches.clear(),tT(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(n){var r=this.optimisticData.removeLayer(n);r!==this.optimisticData&&(this.optimisticData=r,this.broadcastWatches())},e.prototype.batch=function(n){var r=this,i=n.update,s=n.optimistic,o=s===void 0?!0:s,a=n.removeOptimistic,l=n.onWatchUpdated,u,d=function(p){var g=r,y=g.data,b=g.optimisticData;++r.txCount,p&&(r.data=r.optimisticData=p);try{return u=i(r)}finally{--r.txCount,r.data=y,r.optimisticData=b}},h=new Set;return l&&!this.txCount&&this.broadcastWatches(C(C({},n),{onWatchUpdated:function(p){return h.add(p),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,d):o===!1?d(this.data):d(),typeof a=="string"&&(this.optimisticData=this.optimisticData.removeLayer(a)),l&&h.size?(this.broadcastWatches(C(C({},n),{onWatchUpdated:function(p,g){var y=l.call(this,p,g);return y!==!1&&h.delete(p),y}})),h.size&&h.forEach(function(p){return r.maybeBroadcastWatch.dirty(p)})):this.broadcastWatches(n),u},e.prototype.performTransaction=function(n,r){return this.batch({update:n,optimistic:r||r!==null})},e.prototype.transformDocument=function(n){return this.addTypenameToDocument(this.addFragmentsToDocument(n))},e.prototype.broadcastWatches=function(n){var r=this;this.txCount||this.watches.forEach(function(i){return r.maybeBroadcastWatch(i,n)})},e.prototype.addFragmentsToDocument=function(n){var r=this.config.fragments;return r?r.transform(n):n},e.prototype.addTypenameToDocument=function(n){return this.addTypename?this.addTypenameTransform.transformDocument(n):n},e.prototype.broadcastWatch=function(n,r){var i=n.lastDiff,s=this.diff(n);r&&(n.optimistic&&typeof r.optimistic=="string"&&(s.fromOptimisticTransaction=!0),r.onWatchUpdated&&r.onWatchUpdated.call(this,n,s,i)===!1)||(!i||!Ue(i.result,s.result))&&n.callback(n.lastDiff=s,i)},e}(of);globalThis.__DEV__!==!1&&(Hm.prototype.getMemoryInternals=mR);var Qe;(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"})(Qe||(Qe={}));function Ql(t){return t?t<7:!1}function yT(t){return t===7||t===8}var vT=Object.assign,hF=Object.hasOwnProperty,Gl=function(t){pr(e,t);function e(n){var r=n.queryManager,i=n.queryInfo,s=n.options,o=t.call(this,function(_){try{var w=_._subscription._observer;w&&!w.error&&(w.error=pF)}catch{}var O=!o.observers.size;o.observers.add(_);var N=o.last;return N&&N.error?_.error&&_.error(N.error):N&&N.result&&_.next&&_.next(N.result),O&&o.reobserve().catch(function(){}),function(){o.observers.delete(_)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=r,o.waitForOwnResult=Km(s.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var a=r.defaultOptions.watchQuery,l=a===void 0?{}:a,u=l.fetchPolicy,d=u===void 0?"cache-first":u,h=s.fetchPolicy,p=h===void 0?d:h,g=s.initialFetchPolicy,y=g===void 0?p==="standby"?d:p:g;o.options=C(C({},s),{initialFetchPolicy:y,fetchPolicy:p}),o.queryId=i.queryId||r.generateQueryId();var b=io(o.query);return o.queryName=b&&b.name&&b.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var n=this;return new Promise(function(r,i){var s={next:function(a){r(a),n.observers.delete(s),n.observers.size||n.queryManager.removeQuery(n.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=n.subscribe(s)})},e.prototype.resetDiff=function(){this.queryInfo.resetDiff()},e.prototype.getCurrentResult=function(n){n===void 0&&(n=!0);var r=this.getLastResult(!0),i=this.queryInfo.networkStatus||r&&r.networkStatus||Qe.ready,s=C(C({},r),{loading:Ql(i),networkStatus:i}),o=this.options.fetchPolicy,a=o===void 0?"cache-first":o;if(!(Km(a)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var l=this.queryInfo.getDiff();(l.complete||this.options.returnPartialData)&&(s.data=l.result),Ue(s.data,{})&&(s.data=void 0),l.complete?(delete s.partial,l.complete&&s.networkStatus===Qe.loading&&(a==="cache-first"||a==="cache-only")&&(s.networkStatus=Qe.ready,s.loading=!1)):s.partial=!0,globalThis.__DEV__!==!1&&!l.complete&&!this.options.partialRefetch&&!s.loading&&!s.data&&!s.error&&_T(l.missing)}return n&&this.updateLastResult(s),s},e.prototype.isDifferentFromLastResult=function(n,r){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!qw(this.query,this.last.result,n,this.variables):!Ue(this.last.result,n);return i||r&&!Ue(this.last.variables,r)},e.prototype.getLast=function(n,r){var i=this.last;if(i&&i[n]&&(!r||Ue(i.variables,this.variables)))return i[n]},e.prototype.getLastResult=function(n){return this.getLast("result",n)},e.prototype.getLastError=function(n){return this.getLast("error",n)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(n){var r,i={pollInterval:0},s=this.options.fetchPolicy;if(s==="cache-and-network"?i.fetchPolicy=s:s==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&n&&hF.call(n,"variables")){var o=tm(this.query),a=o.variableDefinitions;(!a||!a.some(function(l){return l.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&ie.warn(20,n,((r=o.name)===null||r===void 0?void 0:r.value)||o)}return n&&!Ue(this.options.variables,n)&&(i.variables=this.options.variables=C(C({},this.options.variables),n)),this.queryInfo.resetLastWrite(),this.reobserve(i,Qe.refetch)},e.prototype.fetchMore=function(n){var r=this,i=C(C({},n.query?n:C(C(C(C({},this.options),{query:this.options.query}),n),{variables:C(C({},this.options.variables),n.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var s=this.queryManager.generateQueryId();this.lastQuery=n.query?this.transformDocument(this.options.query):i.query;var o=this.queryInfo,a=o.networkStatus;o.networkStatus=Qe.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var l=new Set,u=n==null?void 0:n.updateQuery,d=this.options.fetchPolicy!=="no-cache";return d||ie(u,21),this.queryManager.fetchQuery(s,i,Qe.fetchMore).then(function(h){if(r.queryManager.removeQuery(s),o.networkStatus===Qe.fetchMore&&(o.networkStatus=a),d)r.queryManager.cache.batch({update:function(y){var b=n.updateQuery;b?y.updateQuery({query:r.query,variables:r.variables,returnPartialData:!0,optimistic:!1},function(_){return b(_,{fetchMoreResult:h.data,variables:i.variables})}):y.writeQuery({query:i.query,variables:i.variables,data:h.data})},onWatchUpdated:function(y){l.add(y.query)}});else{var p=r.getLast("result"),g=u(p.data,{fetchMoreResult:h.data,variables:i.variables});r.reportResult(C(C({},p),{data:g}),r.variables)}return h}).finally(function(){d&&!l.has(r.query)&&bT(r)})},e.prototype.subscribeToMore=function(n){var r=this,i=this.queryManager.startGraphQLSubscription({query:n.document,variables:n.variables,context:n.context}).subscribe({next:function(s){var o=n.updateQuery;o&&r.updateQuery(function(a,l){var u=l.variables;return o(a,{subscriptionData:s,variables:u})})},error:function(s){if(n.onError){n.onError(s);return}globalThis.__DEV__!==!1&&ie.error(22,s)}});return this.subscriptions.add(i),function(){r.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(n){return this.reobserve(n)},e.prototype.silentSetOptions=function(n){var r=us(this.options,n||{});vT(this.options,r)},e.prototype.setVariables=function(n){return Ue(this.variables,n)?this.observers.size?this.result():Promise.resolve():(this.options.variables=n,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:n},Qe.setVariables):Promise.resolve())},e.prototype.updateQuery=function(n){var r=this.queryManager,i=r.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,s=n(i,{variables:this.variables});s&&(r.cache.writeQuery({query:this.options.query,data:s,variables:this.variables}),r.broadcastQueries())},e.prototype.startPolling=function(n){this.options.pollInterval=n,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(n,r){if(r.nextFetchPolicy){var i=r.fetchPolicy,s=i===void 0?"cache-first":i,o=r.initialFetchPolicy,a=o===void 0?s:o;s==="standby"||(typeof r.nextFetchPolicy=="function"?r.fetchPolicy=r.nextFetchPolicy(s,{reason:n,options:r,observable:this,initialFetchPolicy:a}):n==="variables-changed"?r.fetchPolicy=a:r.fetchPolicy=r.nextFetchPolicy)}return r.fetchPolicy},e.prototype.fetch=function(n,r,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,n,r,i)},e.prototype.updatePolling=function(){var n=this;if(!this.queryManager.ssrMode){var r=this,i=r.pollingInfo,s=r.options.pollInterval;if(!s||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===s)){ie(s,23);var o=i||(this.pollingInfo={});o.interval=s;var a=function(){var u,d;n.pollingInfo&&(!Ql(n.queryInfo.networkStatus)&&!(!((d=(u=n.options).skipPollAttempt)===null||d===void 0)&&d.call(u))?n.reobserve({fetchPolicy:n.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},Qe.poll).then(l,l):l())},l=function(){var u=n.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(a,u.interval))};l()}}},e.prototype.updateLastResult=function(n,r){r===void 0&&(r=this.variables);var i=this.getLastError();return i&&this.last&&!Ue(r,this.last.variables)&&(i=void 0),this.last=C({result:this.queryManager.assumeImmutableResults?n:Em(n),variables:r},i?{error:i}:null)},e.prototype.reobserveAsConcast=function(n,r){var i=this;this.isTornDown=!1;var s=r===Qe.refetch||r===Qe.fetchMore||r===Qe.poll,o=this.options.variables,a=this.options.fetchPolicy,l=us(this.options,n||{}),u=s?l:vT(this.options,l),d=this.transformDocument(u.query);this.lastQuery=d,s||(this.updatePolling(),n&&n.variables&&!Ue(n.variables,o)&&u.fetchPolicy!=="standby"&&(u.fetchPolicy===a||typeof u.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",u),r===void 0&&(r=Qe.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Km(u.fetchPolicy));var h=function(){i.concast===y&&(i.waitForOwnResult=!1)},p=u.variables&&C({},u.variables),g=this.fetch(u,r,d),y=g.concast,b=g.fromLink,_={next:function(w){Ue(i.variables,p)&&(h(),i.reportResult(w,p))},error:function(w){Ue(i.variables,p)&&(ef(w)||(w=new fn({networkError:w})),h(),i.reportError(w,p))}};return!s&&(b||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=y,this.observer=_),y.addObserver(_),y},e.prototype.reobserve=function(n,r){return this.reobserveAsConcast(n,r).promise},e.prototype.resubscribeAfterError=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=this.last;this.resetLastResults();var s=this.subscribe.apply(this,n);return this.last=i,s},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(n,r){var i=this.getLastError(),s=this.isDifferentFromLastResult(n,r);(i||!n.partial||this.options.returnPartialData)&&this.updateLastResult(n,r),(i||s)&&fa(this.observers,"next",n)},e.prototype.reportError=function(n,r){var i=C(C({},this.getLastResult()),{error:n,errors:n.graphQLErrors,networkStatus:Qe.error,loading:!1});this.updateLastResult(i,r),fa(this.observers,"error",this.last.error=n)},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(n){return n.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e.prototype.transformDocument=function(n){return this.queryManager.transform(n)},e}(Xe);Tm(Gl);function bT(t){var e=t.options,n=e.fetchPolicy,r=e.nextFetchPolicy;return n==="cache-and-network"||n==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(i,s){return this.nextFetchPolicy=r,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(i,s):n}}):t.reobserve()}function pF(t){globalThis.__DEV__!==!1&&ie.error(24,t.message,t.stack)}function _T(t){globalThis.__DEV__!==!1&&t&&globalThis.__DEV__!==!1&&ie.debug(25,t)}function Km(t){return t==="network-only"||t==="no-cache"||t==="standby"}var pa=new(as?WeakMap:Map);function Jm(t,e){var n=t[e];typeof n=="function"&&(t[e]=function(){return pa.set(t,(pa.get(t)+1)%1e15),n.apply(this,arguments)})}function ET(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Ym=function(){function t(e,n){n===void 0&&(n=e.generateQueryId()),this.queryId=n,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;pa.has(r)||(pa.set(r,0),Jm(r,"evict"),Jm(r,"modify"),Jm(r,"reset"))}return t.prototype.init=function(e){var n=e.networkStatus||Qe.loading;return this.variables&&this.networkStatus!==Qe.loading&&!Ue(this.variables,e.variables)&&(n=Qe.setVariables),Ue(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:n}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){ET(this),this.dirty=!1},t.prototype.resetDiff=function(){this.lastDiff=void 0},t.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&Ue(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var r=this.cache.diff(e);return this.updateLastDiff(r,e),r},t.prototype.updateLastDiff=function(e,n){this.lastDiff=e?{diff:e,options:n||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var n;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(n=this.observableQuery)===null||n===void 0?void 0:n.options.canonizeResults}},t.prototype.setDiff=function(e){var n=this,r,i=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(!((r=this.observableQuery)===null||r===void 0)&&r.getLastError())||(this.updateLastDiff(e),!this.dirty&&!Ue(i&&i.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return n.notify()},0))))},t.prototype.setObservableQuery=function(e){var n=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 r=n.getDiff();r.fromOptimisticTransaction?e.observe():bT(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;ET(this),this.shouldNotify()&&this.listeners.forEach(function(n){return n(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Ql(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;var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var n=this;e===void 0&&(e=this.variables);var r=this.observableQuery;if(!(r&&r.options.fetchPolicy==="no-cache")){var i=C(C({},this.getDiffOptions(e)),{watcher:this,callback:function(s){return n.setDiff(s)}});(!this.lastWatch||!Ue(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,n){var r=this.lastWrite;return!(r&&r.dmCount===pa.get(this.cache)&&Ue(n,r.variables)&&Ue(e.data,r.result.data))},t.prototype.markResult=function(e,n,r,i){var s=this,o=new Ni,a=Un(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Un(e.incremental)){var l=Sm(this.getDiff().result,e);e.data=l}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=a,r.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(r.variables)):i!==0&&(Xm(e,r.errorPolicy)?this.cache.performTransaction(function(d){if(s.shouldWrite(e,r.variables))d.writeQuery({query:n,data:e.data,variables:r.variables,overwrite:i===1}),s.lastWrite={result:e,variables:r.variables,dmCount:pa.get(s.cache)};else if(s.lastDiff&&s.lastDiff.diff.complete){e.data=s.lastDiff.diff.result;return}var h=s.getDiffOptions(r.variables),p=d.diff(h);!s.stopped&&Ue(s.variables,r.variables)&&s.updateWatch(r.variables),s.updateLastDiff(p,h),p.complete&&(e.data=p.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Qe.ready},t.prototype.markError=function(e){return this.networkStatus=Qe.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Xm(t,e){e===void 0&&(e="none");var n=e==="ignore"||e==="all",r=!Ll(t);return!r&&n&&t.data&&(r=!0),r}var mF=Object.prototype.hasOwnProperty,wT=Object.create(null),gF=function(){function t(e){var n=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new Vu(zr["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new eo(!1);var r=new Ml(function(s){return n.cache.transformDocument(s)},{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults;var i=e.documentTransform;this.documentTransform=i?r.concat(i).concat(r):r,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(n,r){e.stopQueryNoBroadcast(r)}),this.cancelPendingFetches(Sn(26))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(n){return n(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){return Ki(this,arguments,void 0,function(n){var r,i,s,o,a,l,u,d=n.mutation,h=n.variables,p=n.optimisticResponse,g=n.updateQueries,y=n.refetchQueries,b=y===void 0?[]:y,_=n.awaitRefetchQueries,w=_===void 0?!1:_,O=n.update,N=n.onQueryUpdated,I=n.fetchPolicy,P=I===void 0?((l=this.defaultOptions.mutate)===null||l===void 0?void 0:l.fetchPolicy)||"network-only":I,R=n.errorPolicy,B=R===void 0?((u=this.defaultOptions.mutate)===null||u===void 0?void 0:u.errorPolicy)||"none":R,Q=n.keepRootFields,x=n.context;return Ji(this,function(U){switch(U.label){case 0:return ie(d,27),ie(P==="network-only"||P==="no-cache",28),r=this.generateMutationId(),d=this.cache.transformForLink(this.transform(d)),i=this.getDocumentInfo(d).hasClientExports,h=this.getVariables(d,h),i?[4,this.localState.addExportedVariables(d,h,x)]:[3,2];case 1:h=U.sent(),U.label=2;case 2:return s=this.mutationStore&&(this.mutationStore[r]={mutation:d,variables:h,loading:!0,error:null}),o=p&&this.markMutationOptimistic(p,{mutationId:r,document:d,variables:h,fetchPolicy:P,errorPolicy:B,context:x,updateQueries:g,update:O,keepRootFields:Q}),this.broadcastQueries(),a=this,[2,new Promise(function(be,Oe){return Ju(a.getObservableFromLink(d,C(C({},x),{optimisticResponse:o?p:void 0}),h,{},!1),function(ke){if(Ll(ke)&&B==="none")throw new fn({graphQLErrors:Yu(ke)});s&&(s.loading=!1,s.error=null);var je=C({},ke);return typeof b=="function"&&(b=b(je)),B==="ignore"&&Ll(je)&&delete je.errors,a.markMutationResult({mutationId:r,result:je,document:d,variables:h,fetchPolicy:P,errorPolicy:B,context:x,update:O,updateQueries:g,awaitRefetchQueries:w,refetchQueries:b,removeOptimistic:o?r:void 0,onQueryUpdated:N,keepRootFields:Q})}).subscribe({next:function(ke){a.broadcastQueries(),(!("hasNext"in ke)||ke.hasNext===!1)&&be(ke)},error:function(ke){s&&(s.loading=!1,s.error=ke),o&&a.cache.removeOptimistic(r),a.broadcastQueries(),Oe(ke instanceof fn?ke:new fn({networkError:ke}))}})})]}})})},t.prototype.markMutationResult=function(e,n){var r=this;n===void 0&&(n=this.cache);var i=e.result,s=[],o=e.fetchPolicy==="no-cache";if(!o&&Xm(i,e.errorPolicy)){if(ao(i)||s.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),ao(i)&&Un(i.incremental)){var a=n.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),l=void 0;a.result&&(l=Sm(a.result,i)),typeof l<"u"&&(i.data=l,s.push({result:l,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(h,p){var g=h.observableQuery,y=g&&g.queryName;if(!(!y||!mF.call(u,y))){var b=u[y],_=r.queries.get(p),w=_.document,O=_.variables,N=n.diff({query:w,variables:O,returnPartialData:!0,optimistic:!1}),I=N.result,P=N.complete;if(P&&I){var R=b(I,{mutationResult:i,queryName:w&&Bu(w)||void 0,queryVariables:O});R&&s.push({result:R,dataId:"ROOT_QUERY",query:w,variables:O})}}})}if(s.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var d=[];if(this.refetchQueries({updateCache:function(h){o||s.forEach(function(b){return h.write(b)});var p=e.update,g=!Ow(i)||ao(i)&&!i.hasNext;if(p){if(!o){var y=h.diff({id:"ROOT_MUTATION",query:r.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});y.complete&&(i=C(C({},i),{data:y.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}g&&p(h,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&g&&h.modify({id:"ROOT_MUTATION",fields:function(b,_){var w=_.fieldName,O=_.DELETE;return w==="__typename"?b:O}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(h){return d.push(h)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(d).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,n){var r=this,i=typeof e=="function"?e(n.variables,{IGNORE:wT}):e;return i===wT?!1:(this.cache.recordOptimisticTransaction(function(s){try{r.markMutationResult(C(C({},n),{result:{data:i}}),s)}catch(o){globalThis.__DEV__!==!1&&ie.error(o)}},n.mutationId),!0)},t.prototype.fetchQuery=function(e,n,r){return this.fetchConcastWithInfo(e,n,r).concast.promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(n,r){e[r]={variables:n.variables,networkStatus:n.networkStatus,networkError:n.networkError,graphQLErrors:n.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var n=this.queries.get(e);n&&(n.networkError=void 0,n.graphQLErrors=[])},t.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},t.prototype.getDocumentInfo=function(e){var n=this.transformCache;if(!n.has(e)){var r={hasClientExports:CE(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:ss(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:zu([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:Uu(io(e)),asQuery:C(C({},e),{definitions:e.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?C(C({},i),{operation:"query"}):i})})};n.set(e,r)}return n.get(e)},t.prototype.getVariables=function(e,n){return C(C({},this.getDocumentInfo(e).defaultVars),n)},t.prototype.watchQuery=function(e){var n=this.transform(e.query);e=C(C({},e),{variables:this.getVariables(n,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Ym(this),i=new Gl({queryManager:this,queryInfo:r,options:e});return i.lastQuery=n,this.queries.set(i.queryId,r),r.init({document:n,observableQuery:i,variables:i.variables}),i},t.prototype.query=function(e,n){var r=this;return n===void 0&&(n=this.generateQueryId()),ie(e.query,29),ie(e.query.kind==="Document",30),ie(!e.returnPartialData,31),ie(!e.pollInterval,32),this.fetchQuery(n,C(C({},e),{query:this.transform(e.query)})).finally(function(){return r.stopQuery(n)})},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 n=this.queries.get(e);n&&n.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(Sn(33)),this.queries.forEach(function(n){n.observableQuery?n.networkStatus=Qe.loading:n.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var n=this;e===void 0&&(e="active");var r=new Map,i=new Map,s=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):qE(o)?i.set(n.transform(o),!1):yt(o)&&o.query&&s.add(o)}),this.queries.forEach(function(o,a){var l=o.observableQuery,u=o.document;if(l){if(e==="all"){r.set(a,l);return}var d=l.queryName,h=l.options.fetchPolicy;if(h==="standby"||e==="active"&&!l.hasObservers())return;(e==="active"||d&&i.has(d)||u&&i.has(u))&&(r.set(a,l),d&&i.set(d,!0),u&&i.set(u,!0))}}),s.size&&s.forEach(function(o){var a=iu("legacyOneTimeQuery"),l=n.getQuery(a).init({document:o.query,variables:o.variables}),u=new Gl({queryManager:n,queryInfo:l,options:C(C({},o),{fetchPolicy:"network-only"})});ie(u.queryId===a),l.setObservableQuery(u),r.set(a,u)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(o,a){o||globalThis.__DEV__!==!1&&ie.warn(typeof a=="string"?34:35,a)}),r},t.prototype.reFetchObservableQueries=function(e){var n=this;e===void 0&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,s){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&r.push(i.refetch()),n.getQuery(s).setDiff(null)}),this.broadcastQueries(),Promise.all(r)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var n=this,r=e.query,i=e.fetchPolicy,s=e.errorPolicy,o=s===void 0?"none":s,a=e.variables,l=e.context,u=l===void 0?{}:l,d=e.extensions,h=d===void 0?{}:d;r=this.transform(r),a=this.getVariables(r,a);var p=function(y){return n.getObservableFromLink(r,u,y,h).map(function(b){i!=="no-cache"&&(Xm(b,o)&&n.cache.write({query:r,result:b.data,dataId:"ROOT_SUBSCRIPTION",variables:y}),n.broadcastQueries());var _=Ll(b),w=LP(b);if(_||w){var O={};if(_&&(O.graphQLErrors=b.errors),w&&(O.protocolErrors=b.extensions[Am]),o==="none"||w)throw new fn(O)}return o==="ignore"&&delete b.errors,b})};if(this.getDocumentInfo(r).hasClientExports){var g=this.localState.addExportedVariables(r,a,u).then(p);return new Xe(function(y){var b=null;return g.then(function(_){return b=_.subscribe(y)},y.error),function(){return b&&b.unsubscribe()}})}return p(a)},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,n,r,i,s){var o=this,a;s===void 0&&(s=(a=n==null?void 0:n.queryDeduplication)!==null&&a!==void 0?a:this.queryDeduplication);var l,u=this.getDocumentInfo(e),d=u.serverQuery,h=u.clientQuery;if(d){var p=this,g=p.inFlightLinkObservables,y=p.link,b={query:d,variables:r,operationName:Bu(d)||void 0,context:this.prepareContext(C(C({},n),{forceFetch:!s})),extensions:i};if(n=b.context,s){var _=oa(d),w=_r(r),O=g.lookup(_,w);if(l=O.observable,!l){var N=new oo([jl(y,b)]);l=O.observable=N,N.beforeNext(function(){g.remove(_,w)})}}else l=new oo([jl(y,b)])}else l=new oo([Xe.of({data:{}})]),n=this.prepareContext(n);return h&&(l=Ju(l,function(I){return o.localState.runResolvers({document:h,remoteResult:I,context:n,variables:r})})),l},t.prototype.getResultsFromLink=function(e,n,r){var i=e.lastRequestId=this.generateRequestId(),s=this.cache.transformForLink(r.query);return Ju(this.getObservableFromLink(s,r.context,r.variables),function(o){var a=Yu(o),l=a.length>0,u=r.errorPolicy;if(i>=e.lastRequestId){if(l&&u==="none")throw e.markError(new fn({graphQLErrors:a}));e.markResult(o,s,r,n),e.markReady()}var d={data:o.data,loading:!1,networkStatus:Qe.ready};return l&&u==="none"&&(d.data=void 0),l&&u!=="ignore"&&(d.errors=a,d.networkStatus=Qe.error),d},function(o){var a=ef(o)?o:new fn({networkError:o});throw i>=e.lastRequestId&&e.markError(a),a})},t.prototype.fetchConcastWithInfo=function(e,n,r,i){var s=this;r===void 0&&(r=Qe.loading),i===void 0&&(i=n.query);var o=this.getVariables(i,n.variables),a=this.getQuery(e),l=this.defaultOptions.watchQuery,u=n.fetchPolicy,d=u===void 0?l&&l.fetchPolicy||"cache-first":u,h=n.errorPolicy,p=h===void 0?l&&l.errorPolicy||"none":h,g=n.returnPartialData,y=g===void 0?!1:g,b=n.notifyOnNetworkStatusChange,_=b===void 0?!1:b,w=n.context,O=w===void 0?{}:w,N=Object.assign({},n,{query:i,variables:o,fetchPolicy:d,errorPolicy:p,returnPartialData:y,notifyOnNetworkStatusChange:_,context:O}),I=function(x){N.variables=x;var U=s.fetchQueryByPolicy(a,N,r);return N.fetchPolicy!=="standby"&&U.sources.length>0&&a.observableQuery&&a.observableQuery.applyNextFetchPolicy("after-fetch",n),U},P=function(){return s.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(x){P(),setTimeout(function(){return R.cancel(x)})});var R,B;if(this.getDocumentInfo(N.query).hasClientExports)R=new oo(this.localState.addExportedVariables(N.query,N.variables,N.context).then(I).then(function(x){return x.sources})),B=!0;else{var Q=I(N.variables);B=Q.fromLink,R=new oo(Q.sources)}return R.promise.then(P,P),{concast:R,fromLink:B}},t.prototype.refetchQueries=function(e){var n=this,r=e.updateCache,i=e.include,s=e.optimistic,o=s===void 0?!1:s,a=e.removeOptimistic,l=a===void 0?o?iu("refetchQueries"):void 0:a,u=e.onQueryUpdated,d=new Map;i&&this.getObservableQueries(i).forEach(function(p,g){d.set(g,{oq:p,lastDiff:n.getQuery(g).getDiff()})});var h=new Map;return r&&this.cache.batch({update:r,optimistic:o&&l||!1,removeOptimistic:l,onWatchUpdated:function(p,g,y){var b=p.watcher instanceof Ym&&p.watcher.observableQuery;if(b){if(u){d.delete(b.queryId);var _=u(b,g,y);return _===!0&&(_=b.refetch()),_!==!1&&h.set(b,_),_}u!==null&&d.set(b.queryId,{oq:b,lastDiff:y,diff:g})}}}),d.size&&d.forEach(function(p,g){var y=p.oq,b=p.lastDiff,_=p.diff,w;if(u){if(!_){var O=y.queryInfo;O.reset(),_=O.getDiff()}w=u(y,_,b)}(!u||w===!0)&&(w=y.refetch()),w!==!1&&h.set(y,w),g.indexOf("legacyOneTimeQuery")>=0&&n.stopQueryNoBroadcast(g)}),l&&this.cache.removeOptimistic(l),h},t.prototype.fetchQueryByPolicy=function(e,n,r){var i=this,s=n.query,o=n.variables,a=n.fetchPolicy,l=n.refetchWritePolicy,u=n.errorPolicy,d=n.returnPartialData,h=n.context,p=n.notifyOnNetworkStatusChange,g=e.networkStatus;e.init({document:s,variables:o,networkStatus:r});var y=function(){return e.getDiff()},b=function(I,P){P===void 0&&(P=e.networkStatus||Qe.loading);var R=I.result;globalThis.__DEV__!==!1&&!d&&!Ue(R,{})&&_T(I.missing);var B=function(Q){return Xe.of(C({data:Q,loading:Ql(P),networkStatus:P},I.complete?null:{partial:!0}))};return R&&i.getDocumentInfo(s).hasForcedResolvers?i.localState.runResolvers({document:s,remoteResult:{data:R},context:h,variables:o,onlyRunForcedResolvers:!0}).then(function(Q){return B(Q.data||void 0)}):u==="none"&&P===Qe.refetch&&Array.isArray(I.missing)?B(void 0):B(R)},_=a==="no-cache"?0:r===Qe.refetch&&l!=="merge"?1:2,w=function(){return i.getResultsFromLink(e,_,{query:s,variables:o,context:h,fetchPolicy:a,errorPolicy:u})},O=p&&typeof g=="number"&&g!==r&&Ql(r);switch(a){default:case"cache-first":{var N=y();return N.complete?{fromLink:!1,sources:[b(N,e.markReady())]}:d||O?{fromLink:!0,sources:[b(N),w()]}:{fromLink:!0,sources:[w()]}}case"cache-and-network":{var N=y();return N.complete||d||O?{fromLink:!0,sources:[b(N),w()]}:{fromLink:!0,sources:[w()]}}case"cache-only":return{fromLink:!1,sources:[b(y(),e.markReady())]};case"network-only":return O?{fromLink:!0,sources:[b(y()),w()]}:{fromLink:!0,sources:[w()]};case"no-cache":return O?{fromLink:!0,sources:[b(e.getDiff()),w()]}:{fromLink:!0,sources:[w()]};case"standby":return{fromLink:!1,sources:[]}}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Ym(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var n=this.localState.prepareContext(e);return C(C(C({},this.defaultContext),n),{clientAwareness:this.clientAwareness})},t}(),yF=function(){function t(e){var n=e.cache,r=e.client,i=e.resolvers,s=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=n,r&&(this.client=r),i&&this.addResolvers(i),s&&this.setFragmentMatcher(s)}return t.prototype.addResolvers=function(e){var n=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(r){n.resolvers=Pl(n.resolvers,r)}):this.resolvers=Pl(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){return Ki(this,arguments,void 0,function(n){var r=n.document,i=n.remoteResult,s=n.context,o=n.variables,a=n.onlyRunForcedResolvers,l=a===void 0?!1:a;return Ji(this,function(u){return r?[2,this.resolveDocument(r,i.data,s,o,this.fragmentMatcher,l).then(function(d){return C(C({},i),{data:d.result})})]:[2,i]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return ss(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return um(e)},t.prototype.prepareContext=function(e){var n=this.cache;return C(C({},e),{cache:n,getCacheKey:function(r){return n.identify(r)}})},t.prototype.addExportedVariables=function(e){return Ki(this,arguments,void 0,function(n,r,i){return r===void 0&&(r={}),i===void 0&&(i={}),Ji(this,function(s){return n?[2,this.resolveDocument(n,this.buildRootValueFromCache(n,r)||{},this.prepareContext(i),r).then(function(o){return C(C({},r),o.exportedVariables)})]:[2,C({},r)]})})},t.prototype.shouldForceResolvers=function(e){var n=!1;return en(e,{Directive:{enter:function(r){if(r.name.value==="client"&&r.arguments&&(n=r.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),n))return Zi}}}),n},t.prototype.buildRootValueFromCache=function(e,n){return this.cache.diff({query:hw(e),variables:n,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,n){return Ki(this,arguments,void 0,function(r,i,s,o,a,l){var u,d,h,p,g,y,b,_,w,O,N;return s===void 0&&(s={}),o===void 0&&(o={}),a===void 0&&(a=function(){return!0}),l===void 0&&(l=!1),Ji(this,function(I){return u=so(r),d=xl(r),h=kl(d),p=this.collectSelectionsToResolve(u,h),g=u.operation,y=g?g.charAt(0).toUpperCase()+g.slice(1):"Query",b=this,_=b.cache,w=b.client,O={fragmentMap:h,context:C(C({},s),{cache:_,client:w}),variables:o,fragmentMatcher:a,defaultOperationType:y,exportedVariables:{},selectionsToResolve:p,onlyRunForcedResolvers:l},N=!1,[2,this.resolveSelectionSet(u.selectionSet,N,i,O).then(function(P){return{result:P,exportedVariables:O.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,n,r,i){return Ki(this,void 0,void 0,function(){var s,o,a,l,u,d=this;return Ji(this,function(h){return s=i.fragmentMap,o=i.context,a=i.variables,l=[r],u=function(p){return Ki(d,void 0,void 0,function(){var g,y;return Ji(this,function(b){return!n&&!i.selectionsToResolve.has(p)?[2]:ra(p,a)?ki(p)?[2,this.resolveField(p,n,r,i).then(function(_){var w;typeof _<"u"&&l.push((w={},w[Oi(p)]=_,w))})]:(zE(p)?g=p:(g=s[p.name.value],ie(g,18,p.name.value)),g&&g.typeCondition&&(y=g.typeCondition.name.value,i.fragmentMatcher(r,y,o))?[2,this.resolveSelectionSet(g.selectionSet,n,r,i).then(function(_){l.push(_)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return aa(l)})]})})},t.prototype.resolveField=function(e,n,r,i){return Ki(this,void 0,void 0,function(){var s,o,a,l,u,d,h,p,g,y=this;return Ji(this,function(b){return r?(s=i.variables,o=e.name.value,a=Oi(e),l=o!==a,u=r[a]||r[o],d=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(h=r.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[h],p&&(g=p[l?o:a],g&&(d=Promise.resolve(jm.withValue(this.cache,g,[r,Il(e,s),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,d.then(function(_){var w,O;if(_===void 0&&(_=u),e.directives&&e.directives.forEach(function(I){I.name.value==="export"&&I.arguments&&I.arguments.forEach(function(P){P.name.value==="as"&&P.value.kind==="StringValue"&&(i.exportedVariables[P.value.value]=_)})}),!e.selectionSet||_==null)return _;var N=(O=(w=e.directives)===null||w===void 0?void 0:w.some(function(I){return I.name.value==="client"}))!==null&&O!==void 0?O:!1;if(Array.isArray(_))return y.resolveSubSelectedArray(e,n||N,_,i);if(e.selectionSet)return y.resolveSelectionSet(e.selectionSet,n||N,_,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,n,r,i){var s=this;return Promise.all(r.map(function(o){if(o===null)return null;if(Array.isArray(o))return s.resolveSubSelectedArray(e,n,o,i);if(e.selectionSet)return s.resolveSelectionSet(e.selectionSet,n,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,n){var r=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function s(o){if(!i.has(o)){var a=new Set;i.set(o,a),en(o,{Directive:function(l,u,d,h,p){l.name.value==="client"&&p.forEach(function(g){r(g)&&Op(g)&&a.add(g)})},FragmentSpread:function(l,u,d,h,p){var g=n[l.name.value];ie(g,19,l.name.value);var y=s(g);y.size>0&&(p.forEach(function(b){r(b)&&Op(b)&&a.add(b)}),a.add(l),y.forEach(function(b){a.add(b)}))}})}return i.get(o)}return s(e)},t}(),TT=!1,df=function(){function t(e){var n=this,r;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw Sn(15);var i=e.uri,s=e.credentials,o=e.headers,a=e.cache,l=e.documentTransform,u=e.ssrMode,d=u===void 0?!1:u,h=e.ssrForceFetchDelay,p=h===void 0?0:h,g=e.connectToDevTools,y=e.queryDeduplication,b=y===void 0?!0:y,_=e.defaultOptions,w=e.defaultContext,O=e.assumeImmutableResults,N=O===void 0?a.assumeImmutableResults:O,I=e.resolvers,P=e.typeDefs,R=e.fragmentMatcher,B=e.name,Q=e.version,x=e.devtools,U=e.link;U||(U=i?new rf({uri:i,credentials:s,headers:o}):Nn.empty()),this.link=U,this.cache=a,this.disableNetworkFetches=d||p>0,this.queryDeduplication=b,this.defaultOptions=_||Object.create(null),this.typeDefs=P,this.devtoolsConfig=C(C({},x),{enabled:(r=x==null?void 0:x.enabled)!==null&&r!==void 0?r:g}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=globalThis.__DEV__!==!1),p&&setTimeout(function(){return n.disableNetworkFetches=!1},p),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=Vh,this.localState=new yF({cache:a,client:this,resolvers:I,fragmentMatcher:R}),this.queryManager=new gF({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:w,documentTransform:l,queryDeduplication:b,ssrMode:d,clientAwareness:{name:B,version:Q},localState:this.localState,assumeImmutableResults:N,onBroadcast:this.devtoolsConfig.enabled?function(){n.devToolsHookCb&&n.devToolsHookCb({action:{},state:{queries:n.queryManager.getQueryStore(),mutations:n.queryManager.mutationStore||{}},dataWithOptimisticResults:n.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return t.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var e=window,n=Symbol.for("apollo.devtools");(e[n]=e[n]||[]).push(this),e.__APOLLO_CLIENT__=this,!TT&&globalThis.__DEV__!==!1&&(TT=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var r=window.navigator,i=r&&r.userAgent,s=void 0;typeof i=="string"&&(i.indexOf("Chrome/")>-1?s="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":i.indexOf("Firefox/")>-1&&(s="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),s&&globalThis.__DEV__!==!1&&ie.log("Download the Apollo DevTools for a better development experience: %s",s)}},1e4))}},Object.defineProperty(t.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=oi(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=oi(this.defaultOptions.query,e)),ie(e.fetchPolicy!=="cache-and-network",16),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=oi(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,n){return n===void 0&&(n=!1),this.cache.readQuery(e,n)},t.prototype.watchFragment=function(e){return this.cache.watchFragment(e)},t.prototype.readFragment=function(e,n){return n===void 0&&(n=!1),this.cache.readFragment(e,n)},t.prototype.writeQuery=function(e){var n=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),n},t.prototype.writeFragment=function(e){var n=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),n},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return jl(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(n){return n()}))}).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(n){return n()}))})},t.prototype.onResetStore=function(e){var n=this;return this.resetStoreCallbacks.push(e),function(){n.resetStoreCallbacks=n.resetStoreCallbacks.filter(function(r){return r!==e})}},t.prototype.onClearStore=function(e){var n=this;return this.clearStoreCallbacks.push(e),function(){n.clearStoreCallbacks=n.clearStoreCallbacks.filter(function(r){return r!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var n=this.queryManager.refetchQueries(e),r=[],i=[];n.forEach(function(o,a){r.push(a),i.push(o)});var s=Promise.all(i);return s.queries=r,s.results=i,s.catch(function(o){globalThis.__DEV__!==!1&&ie.debug(17,o)}),s},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},Object.defineProperty(t.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),t}();globalThis.__DEV__!==!1&&(df.prototype.getMemoryInternals=pR);var hf=new Map,Zm=new Map,ST=!0,pf=!1;function OT(t){return t.replace(/[\s,]+/g," ").trim()}function vF(t){return OT(t.source.body.substring(t.start,t.end))}function bF(t){var e=new Set,n=[];return t.definitions.forEach(function(r){if(r.kind==="FragmentDefinition"){var i=r.name.value,s=vF(r.loc),o=Zm.get(i);o&&!o.has(s)?ST&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
183
|
+
`).forEach(function(n){var r=n.indexOf(":");if(r>-1){var i=n.slice(0,r).trim().toLowerCase(),s=n.slice(r+1).trim();e[i]=s}}),e}function Pw(t,e){if(t.status>=300){var n=function(){try{return JSON.parse(e)}catch{return e}};Xu(t,n(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var r=i;throw r.name="ServerParseError",r.response=t,r.statusCode=t.status,r.bodyText=e,r}}function BP(t,e){t.result&&t.result.errors&&t.result.data&&e.next(t.result),e.error(t)}function Im(t){return function(e){return e.text().then(function(n){return Pw(e,n)}).then(function(n){return!Array.isArray(n)&&!Rw.call(n,"data")&&!Rw.call(n,"errors")&&Xu(e,n,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(r){return r.operationName}):t.operationName,"'.")),n})}}var Bl=function(t,e){var n;try{n=JSON.stringify(t)}catch(i){var r=Sn(40,e,i.message);throw r.parseError=i,r}return n},UP={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},qP={accept:"*/*","content-type":"application/json"},WP={method:"POST"},xm={http:UP,headers:qP,options:WP},tf=function(t,e){return e(t)};function Fw(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return n.unshift(e),nf.apply(void 0,wt([t,tf],n,!1))}function nf(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={},s={};n.forEach(function(h){i=C(C(C({},i),h.options),{headers:C(C({},i.headers),h.headers)}),h.credentials&&(i.credentials=h.credentials),s=C(C({},s),h.http)}),i.headers&&(i.headers=zP(i.headers,s.preserveHeaderCase));var o=t.operationName,a=t.extensions,l=t.variables,u=t.query,d={operationName:o,variables:l};return s.includeExtensions&&(d.extensions=a),s.includeQuery&&(d.query=e(u,oa)),{options:i,body:d}}function zP(t,e){if(!e){var n={};return Object.keys(Object(t)).forEach(function(s){n[s.toLowerCase()]=t[s]}),n}var r={};Object.keys(Object(t)).forEach(function(s){r[s.toLowerCase()]={originalName:s,value:t[s]}});var i={};return Object.keys(r).forEach(function(s){i[r[s].originalName]=r[s].value}),i}var Cm=function(t){if(!t&&typeof fetch>"u")throw Sn(38)},Lw=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}},Dm=function(t,e){var n=t.getContext(),r=n.uri;return r||(typeof e=="function"?e(t):e||"/graphql")};function Mm(t,e){var n=[],r=function(h,p){n.push("".concat(h,"=").concat(encodeURIComponent(p)))};if("query"in e&&r("query",e.query),e.operationName&&r("operationName",e.operationName),e.variables){var i=void 0;try{i=Bl(e.variables,"Variables map")}catch(h){return{parseError:h}}r("variables",i)}if(e.extensions){var s=void 0;try{s=Bl(e.extensions,"Extensions map")}catch(h){return{parseError:h}}r("extensions",s)}var o="",a=t,l=t.indexOf("#");l!==-1&&(o=t.substr(l),a=t.substr(0,l));var u=a.indexOf("?")===-1?"?":"&",d=a+u+n.join("&")+o;return{newURI:d}}var $w=mr(function(){return fetch}),Rm=function(t){t===void 0&&(t={});var e=t.uri,n=e===void 0?"/graphql":e,r=t.fetch,i=t.print,s=i===void 0?tf:i,o=t.includeExtensions,a=t.preserveHeaderCase,l=t.useGETForQueries,u=t.includeUnusedVariables,d=u===void 0?!1:u,h=Tn(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&Cm(r||$w);var p={http:{includeExtensions:o,preserveHeaderCase:a},options:h.fetchOptions,credentials:h.credentials,headers:h.headers};return new Nn(function(g){var y=Dm(g,n),b=g.getContext(),_={};if(b.clientAwareness){var w=b.clientAwareness,O=w.name,N=w.version;O&&(_["apollographql-client-name"]=O),N&&(_["apollographql-client-version"]=N)}var I=C(C({},_),b.headers),P={http:b.http,options:b.fetchOptions,credentials:b.credentials,headers:I};if(ss(["client"],g.query)){var R=um(g.query);if(!R)return $l(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));g.query=R}var B=nf(g,s,xm,p,P),Q=B.options,x=B.body;x.variables&&!d&&(x.variables=kP(x.variables,g.query));var U;!Q.signal&&typeof AbortController<"u"&&(U=new AbortController,Q.signal=U.signal);var be=function(ye){return ye.kind==="OperationDefinition"&&ye.operation==="mutation"},Oe=function(ye){return ye.kind==="OperationDefinition"&&ye.operation==="subscription"},ke=Oe(so(g.query)),je=ss(["defer"],g.query);if(l&&!g.query.definitions.some(be)&&(Q.method="GET"),je||ke){Q.headers=Q.headers||{};var te="multipart/mixed;";ke&&je&&globalThis.__DEV__!==!1&&se.warn(39),ke?te+="boundary=graphql;subscriptionSpec=1.0,application/json":je&&(te+="deferSpec=20220824,application/json"),Q.headers.accept=te}if(Q.method==="GET"){var xe=Mm(y,x),fe=xe.newURI,Ee=xe.parseError;if(Ee)return $l(Ee);y=fe}else try{Q.body=Bl(x,"Payload")}catch(ye){return $l(ye)}return new Xe(function(ye){var ut=r||mr(function(){return fetch})||$w,ve=ye.next.bind(ye);return ut(y,Q).then(function($){var Z;g.setContext({response:$});var Y=(Z=$.headers)===null||Z===void 0?void 0:Z.get("content-type");return Y!==null&&/^multipart\/mixed/i.test(Y)?VP($,ve):Im(g)($).then(ve)}).then(function(){U=void 0,ye.complete()}).catch(function($){U=void 0,BP($,ye)}),function(){U&&U.abort()}})})},rf=function(t){pr(e,t);function e(n){n===void 0&&(n={});var r=t.call(this,Rm(n).request)||this;return r.options=n,r}return e}(Nn);const{toString:Vw,hasOwnProperty:QP}=Object.prototype,jw=Function.prototype.toString,Pm=new Map;function Ue(t,e){try{return Fm(t,e)}finally{Pm.clear()}}function Fm(t,e){if(t===e)return!0;const n=Vw.call(t),r=Vw.call(e);if(n!==r)return!1;switch(n){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Uw(t,e))return!0;const i=Bw(t),s=Bw(e),o=i.length;if(o!==s.length)return!1;for(let a=0;a<o;++a)if(!QP.call(e,i[a]))return!1;for(let a=0;a<o;++a){const l=i[a];if(!Fm(t[l],e[l]))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(Uw(t,e))return!0;const i=t.entries(),s=n==="[object Map]";for(;;){const o=i.next();if(o.done)break;const[a,l]=o.value;if(!e.has(a)||s&&!Fm(l,e.get(a)))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 i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=jw.call(t);return i!==jw.call(e)?!1:!KP(i,HP)}}return!1}function Bw(t){return Object.keys(t).filter(GP,t)}function GP(t){return this[t]!==void 0}const HP="{ [native code] }";function KP(t,e){const n=t.length-e.length;return n>=0&&t.indexOf(e,n)===n}function Uw(t,e){let n=Pm.get(t);if(n){if(n.has(e))return!0}else Pm.set(t,n=new Set);return n.add(e),!1}const JP=Object.freeze(Object.defineProperty({__proto__:null,default:Ue,equal:Ue},Symbol.toStringTag,{value:"Module"}));function qw(t,e,n,r){var i=e.data,s=Tn(e,["data"]),o=n.data,a=Tn(n,["data"]);return Ue(s,a)&&sf(so(t).selectionSet,i,o,{fragmentMap:kl(xl(t)),variables:r})}function sf(t,e,n,r){if(e===n)return!0;var i=new Set;return t.selections.every(function(s){if(i.has(s)||(i.add(s),!ra(s,r.variables))||Ww(s))return!0;if(ki(s)){var o=Oi(s),a=e&&e[o],l=n&&n[o],u=s.selectionSet;if(!u)return Ue(a,l);var d=Array.isArray(a),h=Array.isArray(l);if(d!==h)return!1;if(d&&h){var p=a.length;if(l.length!==p)return!1;for(var g=0;g<p;++g)if(!sf(u,a[g],l[g],r))return!1;return!0}return sf(u,a,l,r)}else{var y=Nl(s,r.fragmentMap);if(y)return Ww(y)?!0:sf(y.selectionSet,e,n,r)}})}function Ww(t){return!!t.directives&&t.directives.some(YP)}function YP(t){return t.name.value==="nonreactive"}var of=function(){function t(){this.assumeImmutableResults=!1,this.getFragmentDoc=Dl(LE,{max:zr["cache.fragmentQueryDocuments"]||1e3,cache:$u})}return t.prototype.batch=function(e){var n=this,r=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(n)},r),i},t.prototype.recordOptimisticTransaction=function(e,n){this.performTransaction(e,n)},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,n){return n===void 0&&(n=!!e.optimistic),this.read(C(C({},e),{rootId:e.id||"ROOT_QUERY",optimistic:n}))},t.prototype.watchFragment=function(e){var n=this,r=e.fragment,i=e.fragmentName,s=e.from,o=e.optimistic,a=o===void 0?!0:o,l=Tn(e,["fragment","fragmentName","from","optimistic"]),u=this.getFragmentDoc(r,i),d=C(C({},l),{returnPartialData:!0,id:typeof s>"u"||typeof s=="string"?s:this.identify(s),query:u,optimistic:a}),h;return new Xe(function(p){return n.watch(C(C({},d),{immediate:!0,callback:function(g){if(!(h&&qw(u,{data:h==null?void 0:h.result},{data:g.result}))){var y={data:g.result,complete:!!g.complete};g.missing&&(y.missing=aa(g.missing.map(function(b){return b.missing}))),h=g,p.next(y)}}}))})},t.prototype.readFragment=function(e,n){return n===void 0&&(n=!!e.optimistic),this.read(C(C({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:n}))},t.prototype.writeQuery=function(e){var n=e.id,r=e.data,i=Tn(e,["id","data"]);return this.write(Object.assign(i,{dataId:n||"ROOT_QUERY",result:r}))},t.prototype.writeFragment=function(e){var n=e.id,r=e.data,i=e.fragment,s=e.fragmentName,o=Tn(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,s),dataId:n,result:r}))},t.prototype.updateQuery=function(e,n){return this.batch({update:function(r){var i=r.readQuery(e),s=n(i);return s==null?i:(r.writeQuery(C(C({},e),{data:s})),s)}})},t.prototype.updateFragment=function(e,n){return this.batch({update:function(r){var i=r.readFragment(e),s=n(i);return s==null?i:(r.writeFragment(C(C({},e),{data:s})),s)}})},t}();globalThis.__DEV__!==!1&&(of.prototype.getMemoryInternals=gR);var af;af||(af={});var lf=function(t){pr(e,t);function e(n,r,i,s){var o,a=t.call(this,n)||this;if(a.message=n,a.path=r,a.query=i,a.variables=s,Array.isArray(a.path)){a.missing=a.message;for(var l=a.path.length-1;l>=0;--l)a.missing=(o={},o[a.path[l]]=a.missing,o)}else a.missing=a.path;return a.__proto__=e.prototype,a}return e}(Error),Ht=Object.prototype.hasOwnProperty;function Ul(t){return t==null}function cf(t,e){var n=t.__typename,r=t.id,i=t._id;if(typeof n=="string"&&(e&&(e.keyObject=Ul(r)?Ul(i)?void 0:{_id:i}:{id:r}),Ul(r)&&!Ul(i)&&(r=i),!Ul(r)))return"".concat(n,":").concat(typeof r=="number"||typeof r=="string"?r:JSON.stringify(r))}var zw={dataIdFromObject:cf,addTypename:!0,resultCaching:!0,canonizeResults:!1};function XP(t){return us(zw,t)}function Qw(t){var e=t.canonizeResults;return e===void 0?zw.canonizeResults:e}function ZP(t,e){return et(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Gw=/^[_a-z][_0-9a-z]*/i;function fs(t){var e=t.match(Gw);return e?e[0]:t}function Lm(t,e,n){return yt(e)?Tt(e)?e.every(function(r){return Lm(t,r,n)}):t.selections.every(function(r){if(ki(r)&&ra(r,n)){var i=Oi(r);return Ht.call(e,i)&&(!r.selectionSet||Lm(r.selectionSet,e[i],n))}return!0}):!1}function da(t){return yt(t)&&!et(t)&&!Tt(t)}function eF(){return new Ni}function Hw(t,e){var n=kl(xl(t));return{fragmentMap:n,lookupFragment:function(r){var i=n[r];return!i&&e&&(i=e.lookup(r)),i||null}}}var uf=Object.create(null),$m=function(){return uf},Kw=Object.create(null),ql=function(){function t(e,n){var r=this;this.policies=e,this.group=n,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,s){return ua(et(i)?r.get(i.__ref,s):i&&i[s])},this.canRead=function(i){return et(i)?r.has(i.__ref):typeof i=="object"},this.toReference=function(i,s){if(typeof i=="string")return Si(i);if(et(i))return i;var o=r.policies.identify(i)[0];if(o){var a=Si(o);return s&&r.merge(o,i),a}}}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,n){if(this.group.depend(e,n),Ht.call(this.data,e)){var r=this.data[e];if(r&&Ht.call(r,n))return r[n]}if(n==="__typename"&&Ht.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof ds)return this.parent.get(e,n)},t.prototype.lookup=function(e,n){if(n&&this.group.depend(e,"__exists"),Ht.call(this.data,e))return this.data[e];if(this instanceof ds)return this.parent.lookup(e,n);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,n){var r=this,i;et(e)&&(e=e.__ref),et(n)&&(n=n.__ref);var s=typeof e=="string"?this.lookup(i=e):e,o=typeof n=="string"?this.lookup(i=n):n;if(o){se(typeof i=="string",1);var a=new Ni(nF).merge(s,o);if(this.data[i]=a,a!==s&&(delete this.refs[i],this.group.caching)){var l=Object.create(null);s||(l.__exists=1),Object.keys(o).forEach(function(u){if(!s||s[u]!==a[u]){l[u]=1;var d=fs(u);d!==u&&!r.policies.hasKeyArgs(a.__typename,d)&&(l[d]=1),a[u]===void 0&&!(r instanceof ds)&&delete a[u]}}),l.__typename&&!(s&&s.__typename)&&this.policies.rootTypenamesById[i]===a.__typename&&delete l.__typename,Object.keys(l).forEach(function(u){return r.group.dirty(i,u)})}}},t.prototype.modify=function(e,n){var r=this,i=this.lookup(e);if(i){var s=Object.create(null),o=!1,a=!0,l={DELETE:uf,INVALIDATE:Kw,isReference:et,toReference:this.toReference,canRead:this.canRead,readField:function(u,d){return r.policies.readField(typeof u=="string"?{fieldName:u,from:d||Si(e)}:u,{store:r})}};if(Object.keys(i).forEach(function(u){var d=fs(u),h=i[u];if(h!==void 0){var p=typeof n=="function"?n:n[u]||n[d];if(p){var g=p===$m?uf:p(ua(h),C(C({},l),{fieldName:d,storeFieldName:u,storage:r.getStorage(e,u)}));if(g===Kw)r.group.dirty(e,u);else if(g===uf&&(g=void 0),g!==h&&(s[u]=g,o=!0,h=g,globalThis.__DEV__!==!1)){var y=function(P){if(r.lookup(P.__ref)===void 0)return globalThis.__DEV__!==!1&&se.warn(2,P),!0};if(et(g))y(g);else if(Array.isArray(g))for(var b=!1,_=void 0,w=0,O=g;w<O.length;w++){var N=O[w];if(et(N)){if(b=!0,y(N))break}else if(typeof N=="object"&&N){var I=r.policies.identify(N)[0];I&&(_=N)}if(b&&_!==void 0){globalThis.__DEV__!==!1&&se.warn(3,_);break}}}}h!==void 0&&(a=!1)}}),o)return this.merge(e,s),a&&(this instanceof ds?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,n,r){var i,s=this.lookup(e);if(s){var o=this.getFieldValue(s,"__typename"),a=n&&r?this.policies.getStoreFieldName({typename:o,fieldName:n,args:r}):n;return this.modify(e,a?(i={},i[a]=$m,i):$m)}return!1},t.prototype.evict=function(e,n){var r=!1;return e.id&&(Ht.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof ds&&this!==n&&(r=this.parent.evict(e,n)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,n=this.toObject(),r=[];return this.getRootIdSet().forEach(function(i){Ht.call(e.policies.rootTypenamesById,i)||r.push(i)}),r.length&&(n.__META={extraRootIds:r.sort()}),n},t.prototype.replace=function(e){var n=this;if(Object.keys(this.data).forEach(function(s){e&&Ht.call(e,s)||n.delete(s)}),e){var r=e.__META,i=Tn(e,["__META"]);Object.keys(i).forEach(function(s){n.merge(s,i[s])}),r&&r.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 n=--this.rootIds[e];return n||delete this.rootIds[e],n}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof ds?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,n=this.getRootIdSet(),r=this.toObject();n.forEach(function(o){Ht.call(r,o)&&(Object.keys(e.findChildRefIds(o)).forEach(n.add,n),delete r[o])});var i=Object.keys(r);if(i.length){for(var s=this;s instanceof ds;)s=s.parent;i.forEach(function(o){return s.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!Ht.call(this.refs,e)){var n=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return n;var i=new Set([r]);i.forEach(function(s){et(s)&&(n[s.__ref]=!0),yt(s)&&Object.keys(s).forEach(function(o){var a=s[o];yt(a)&&i.add(a)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}(),Jw=function(){function t(e,n){n===void 0&&(n=null),this.caching=e,this.parent=n,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?lw():null,this.keyMaker=new eo(as)},t.prototype.depend=function(e,n){if(this.d){this.d(Vm(e,n));var r=fs(n);r!==n&&this.d(Vm(e,r)),this.parent&&this.parent.depend(e,n)}},t.prototype.dirty=function(e,n){this.d&&this.d.dirty(Vm(e,n),n==="__exists"?"forget":"setDirty")},t}();function Vm(t,e){return e+"#"+t}function Yw(t,e){Wl(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(n){pr(r,n);function r(i){var s=i.policies,o=i.resultCaching,a=o===void 0?!0:o,l=i.seed,u=n.call(this,s,new Jw(a))||this;return u.stump=new tF(u),u.storageTrie=new eo(as),l&&u.replace(l),u}return r.prototype.addLayer=function(i,s){return this.stump.addLayer(i,s)},r.prototype.removeLayer=function(){return this},r.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},r}(t);t.Root=e})(ql||(ql={}));var ds=function(t){pr(e,t);function e(n,r,i,s){var o=t.call(this,r.policies,s)||this;return o.id=n,o.parent=r,o.replay=i,o.group=s,i(o),o}return e.prototype.addLayer=function(n,r){return new e(n,this,r,this.group)},e.prototype.removeLayer=function(n){var r=this,i=this.parent.removeLayer(n);return n===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(s){var o=r.data[s],a=i.lookup(s);a?o?o!==a&&Object.keys(o).forEach(function(l){Ue(o[l],a[l])||r.group.dirty(s,l)}):(r.group.dirty(s,"__exists"),Object.keys(a).forEach(function(l){r.group.dirty(s,l)})):r.delete(s)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return C(C({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(n){var r=this.parent.findChildRefIds(n);return Ht.call(this.data,n)?C(C({},r),t.prototype.findChildRefIds.call(this,n)):r},e.prototype.getStorage=function(){for(var n=this.parent;n.parent;)n=n.parent;return n.getStorage.apply(n,arguments)},e}(ql),tF=function(t){pr(e,t);function e(n){return t.call(this,"EntityStore.Stump",n,function(){},new Jw(n.group.caching,n.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(n,r){return this.parent.merge(n,r)},e}(ds);function nF(t,e,n){var r=t[n],i=e[n];return Ue(r,i)?r:i}function Wl(t){return!!(t instanceof ql&&t.group.caching)}function rF(t){return yt(t)?Tt(t)?t.slice(0):C({__proto__:Object.getPrototypeOf(t)},t):t}var Xw=function(){function t(){this.known=new(Qp?WeakSet:Set),this.pool=new eo(as),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return yt(e)&&this.known.has(e)},t.prototype.pass=function(e){if(yt(e)){var n=rF(e);return this.passes.set(n,e),n}return e},t.prototype.admit=function(e){var n=this;if(yt(e)){var r=this.passes.get(e);if(r)return r;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var s=e.map(this.admit,this),o=this.pool.lookupArray(s);return o.array||(this.known.add(o.array=s),globalThis.__DEV__!==!1&&Object.freeze(s)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var a=Object.getPrototypeOf(e),l=[a],u=this.sortedKeys(e);l.push(u.json);var d=l.length;u.sorted.forEach(function(g){l.push(n.admit(e[g]))});var o=this.pool.lookupArray(l);if(!o.object){var h=o.object=Object.create(a);this.known.add(h),u.sorted.forEach(function(g,y){h[g]=l[d+y]}),globalThis.__DEV__!==!1&&Object.freeze(h)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var n=Object.keys(e),r=this.pool.lookupArray(n);if(!r.keys){n.sort();var i=JSON.stringify(n);(r.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,r.keys={sorted:n,json:i})}return r.keys},t}();function Zw(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var iF=function(){function t(e){var n=this;this.knownResults=new(as?WeakMap:Map),this.config=us(e,{addTypename:e.addTypename!==!1,canonizeResults:Qw(e)}),this.canon=e.canon||new Xw,this.executeSelectionSet=Dl(function(r){var i,s=r.context.canonizeResults,o=Zw(r);o[3]=!s;var a=(i=n.executeSelectionSet).peek.apply(i,o);return a?s?C(C({},a),{result:n.canon.admit(a.result)}):a:(Yw(r.context.store,r.enclosingRef.__ref),n.execSelectionSetImpl(r))},{max:this.config.resultCacheMaxSize||zr["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Zw,makeCacheKey:function(r,i,s,o){if(Wl(s.store))return s.store.makeCacheKey(r,et(i)?i.__ref:i,s.varString,o)}}),this.executeSubSelectedArray=Dl(function(r){return Yw(r.context.store,r.enclosingRef.__ref),n.execSubSelectedArrayImpl(r)},{max:this.config.resultCacheMaxSize||zr["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(r){var i=r.field,s=r.array,o=r.context;if(Wl(o.store))return o.store.makeCacheKey(i,s,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new Xw},t.prototype.diffQueryAgainstStore=function(e){var n=e.store,r=e.query,i=e.rootId,s=i===void 0?"ROOT_QUERY":i,o=e.variables,a=e.returnPartialData,l=a===void 0?!0:a,u=e.canonizeResults,d=u===void 0?this.config.canonizeResults:u,h=this.config.cache.policies;o=C(C({},Uu(tm(r))),o);var p=Si(s),g=this.executeSelectionSet({selectionSet:so(r).selectionSet,objectOrReference:p,enclosingRef:p,context:C({store:n,query:r,policies:h,variables:o,varString:_r(o),canonizeResults:d},Hw(r,this.config.fragments))}),y;if(g.missing&&(y=[new lf(sF(g.missing),g.missing,r,o)],!l))throw y[0];return{result:g.result,complete:!y,missing:y}},t.prototype.isFresh=function(e,n,r,i){if(Wl(i.store)&&this.knownResults.get(e)===r){var s=this.executeSelectionSet.peek(r,n,i,this.canon.isKnown(e));if(s&&e===s.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var n=this,r=e.selectionSet,i=e.objectOrReference,s=e.enclosingRef,o=e.context;if(et(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var a=o.variables,l=o.policies,u=o.store,d=u.getFieldValue(i,"__typename"),h=[],p,g=new Ni;this.config.addTypename&&typeof d=="string"&&!l.rootIdsByTypename[d]&&h.push({__typename:d});function y(N,I){var P;return N.missing&&(p=g.merge(p,(P={},P[I]=N.missing,P))),N.result}var b=new Set(r.selections);b.forEach(function(N){var I,P;if(ra(N,a))if(ki(N)){var R=l.readField({fieldName:N.name.value,field:N,variables:o.variables,from:i},o),B=Oi(N);R===void 0?Qu.added(N)||(p=g.merge(p,(I={},I[B]="Can't find field '".concat(N.name.value,"' on ").concat(et(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),I))):Tt(R)?R.length>0&&(R=y(n.executeSubSelectedArray({field:N,array:R,enclosingRef:s,context:o}),B)):N.selectionSet?R!=null&&(R=y(n.executeSelectionSet({selectionSet:N.selectionSet,objectOrReference:R,enclosingRef:et(R)?R:s,context:o}),B)):o.canonizeResults&&(R=n.canon.pass(R)),R!==void 0&&h.push((P={},P[B]=R,P))}else{var Q=Nl(N,o.lookupFragment);if(!Q&&N.kind===k.FRAGMENT_SPREAD)throw Sn(9,N.name.value);Q&&l.fragmentMatches(Q,d)&&Q.selectionSet.selections.forEach(b.add,b)}});var _=aa(h),w={result:_,missing:p},O=o.canonizeResults?this.canon.admit(w):ua(w);return O.result&&this.knownResults.set(O.result,r),O},t.prototype.execSubSelectedArrayImpl=function(e){var n=this,r=e.field,i=e.array,s=e.enclosingRef,o=e.context,a,l=new Ni;function u(d,h){var p;return d.missing&&(a=l.merge(a,(p={},p[h]=d.missing,p))),d.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(d,h){return d===null?null:Tt(d)?u(n.executeSubSelectedArray({field:r,array:d,enclosingRef:s,context:o}),h):r.selectionSet?u(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:d,enclosingRef:et(d)?d:s,context:o}),h):(globalThis.__DEV__!==!1&&oF(o.store,r,d),d)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:a}},t}();function sF(t){try{JSON.stringify(t,function(e,n){if(typeof n=="string")throw n;return n})}catch(e){return e}}function oF(t,e,n){if(!e.selectionSet){var r=new Set([n]);r.forEach(function(i){yt(i)&&(se(!et(i),10,ZP(t,i),e.name.value),Object.values(i).forEach(r.add,r))})}}var jm=new im,eT=new WeakMap;function zl(t){var e=eT.get(t);return e||eT.set(t,e={vars:new Set,dep:lw()}),e}function tT(t){zl(t).vars.forEach(function(e){return e.forgetCache(t)})}function aF(t){zl(t).vars.forEach(function(e){return e.attachCache(t)})}function Bm(t){var e=new Set,n=new Set,r=function(s){if(arguments.length>0){if(t!==s){t=s,e.forEach(function(l){zl(l).dep.dirty(r),lF(l)});var o=Array.from(n);n.clear(),o.forEach(function(l){return l(t)})}}else{var a=jm.getValue();a&&(i(a),zl(a).dep(r))}return t};r.onNextChange=function(s){return n.add(s),function(){n.delete(s)}};var i=r.attachCache=function(s){return e.add(s),zl(s).vars.add(r),r};return r.forgetCache=function(s){return e.delete(s)},r}function lF(t){t.broadcastWatches&&t.broadcastWatches()}var nT=Object.create(null);function Um(t){var e=JSON.stringify(t);return nT[e]||(nT[e]=Object.create(null))}function rT(t){var e=Um(t);return e.keyFieldsFn||(e.keyFieldsFn=function(n,r){var i=function(o,a){return r.readField(a,o)},s=r.keyObject=qm(t,function(o){var a=ha(r.storeObject,o,i);return a===void 0&&n!==r.storeObject&&Ht.call(n,o[0])&&(a=ha(n,o,oT)),se(a!==void 0,4,o.join("."),n),a});return"".concat(r.typename,":").concat(JSON.stringify(s))})}function iT(t){var e=Um(t);return e.keyArgsFn||(e.keyArgsFn=function(n,r){var i=r.field,s=r.variables,o=r.fieldName,a=qm(t,function(u){var d=u[0],h=d.charAt(0);if(h==="@"){if(i&&Un(i.directives)){var p=d.slice(1),g=i.directives.find(function(w){return w.name.value===p}),y=g&&Il(g,s);return y&&ha(y,u.slice(1))}return}if(h==="$"){var b=d.slice(1);if(s&&Ht.call(s,b)){var _=u.slice(0);return _[0]=b,ha(s,_)}return}if(n)return ha(n,u)}),l=JSON.stringify(a);return(n||l!=="{}")&&(o+=":"+l),o})}function qm(t,e){var n=new Ni;return sT(t).reduce(function(r,i){var s,o=e(i);if(o!==void 0){for(var a=i.length-1;a>=0;--a)o=(s={},s[i[a]]=o,s);r=n.merge(r,o)}return r},Object.create(null))}function sT(t){var e=Um(t);if(!e.paths){var n=e.paths=[],r=[];t.forEach(function(i,s){Tt(i)?(sT(i).forEach(function(o){return n.push(r.concat(o))}),r.length=0):(r.push(i),Tt(t[s+1])||(n.push(r.slice(0)),r.length=0))})}return e.paths}function oT(t,e){return t[e]}function ha(t,e,n){return n=n||oT,aT(e.reduce(function r(i,s){return Tt(i)?i.map(function(o){return r(o,s)}):i&&n(i,s)},t))}function aT(t){return yt(t)?Tt(t)?t.map(aT):qm(Object.keys(t).sort(),function(e){return ha(t,e)}):t}function Wm(t){return t.args!==void 0?t.args:t.field?Il(t.field,t.variables):null}var cF=function(){},lT=function(t,e){return e.fieldName},cT=function(t,e,n){var r=n.mergeObjects;return r(t,e)},uT=function(t,e){return e},uF=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:cf},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,n){var r,i=this,s=n&&(n.typename||((r=n.storeObject)===null||r===void 0?void 0:r.__typename))||e.__typename;if(s===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=n&&n.storeObject||e,a=C(C({},n),{typename:s,storeObject:o,readField:n&&n.readField||function(){var p=zm(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),l,u=s&&this.getTypePolicy(s),d=u&&u.keyFn||this.config.dataIdFromObject;d;){var h=d(C(C({},e),o),a);if(Tt(h))d=rT(h);else{l=h;break}}return l=l?String(l):void 0,a.keyObject?[l,a.keyObject]:[l]},t.prototype.addTypePolicies=function(e){var n=this;Object.keys(e).forEach(function(r){var i=e[r],s=i.queryType,o=i.mutationType,a=i.subscriptionType,l=Tn(i,["queryType","mutationType","subscriptionType"]);s&&n.setRootTypename("Query",r),o&&n.setRootTypename("Mutation",r),a&&n.setRootTypename("Subscription",r),Ht.call(n.toBeAdded,r)?n.toBeAdded[r].push(l):n.toBeAdded[r]=[l]})},t.prototype.updateTypePolicy=function(e,n){var r=this,i=this.getTypePolicy(e),s=n.keyFields,o=n.fields;function a(l,u){l.merge=typeof u=="function"?u:u===!0?cT:u===!1?uT:l.merge}a(i,n.merge),i.keyFn=s===!1?cF:Tt(s)?rT(s):typeof s=="function"?s:i.keyFn,o&&Object.keys(o).forEach(function(l){var u=r.getFieldPolicy(e,l,!0),d=o[l];if(typeof d=="function")u.read=d;else{var h=d.keyArgs,p=d.read,g=d.merge;u.keyFn=h===!1?lT:Tt(h)?iT(h):typeof h=="function"?h:u.keyFn,typeof p=="function"&&(u.read=p),a(u,g)}u.read&&u.merge&&(u.keyFn=u.keyFn||lT)})},t.prototype.setRootTypename=function(e,n){n===void 0&&(n=e);var r="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[r];n!==i&&(se(!i||i===e,5,e),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[n]=r,this.rootTypenamesById[r]=n)},t.prototype.addPossibleTypes=function(e){var n=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(r){n.getSupertypeSet(r,!0),e[r].forEach(function(i){n.getSupertypeSet(i,!0).add(r);var s=i.match(Gw);(!s||s[0]!==i)&&n.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var n=this;if(!Ht.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(o,a){if(o.test(e)){var l=n.supertypeMap.get(a);l&&l.forEach(function(u){return i.add(u)})}})),i&&i.size&&i.forEach(function(o){var a=n.getTypePolicy(o),l=a.fields,u=Tn(a,["fields"]);Object.assign(r,u),Object.assign(r.fields,l)})}var s=this.toBeAdded[e];return s&&s.length&&s.splice(0).forEach(function(o){n.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,n,r){if(e){var i=this.getTypePolicy(e).fields;return i[n]||r&&(i[n]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,n){var r=this.supertypeMap.get(e);return!r&&n&&this.supertypeMap.set(e,r=new Set),r},t.prototype.fragmentMatches=function(e,n,r,i){var s=this;if(!e.typeCondition)return!0;if(!n)return!1;var o=e.typeCondition.name.value;if(n===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(n,!0),l=[a],u=function(y){var b=s.getSupertypeSet(y,!1);b&&b.size&&l.indexOf(b)<0&&l.push(b)},d=!!(r&&this.fuzzySubtypes.size),h=!1,p=0;p<l.length;++p){var g=l[p];if(g.has(o))return a.has(o)||(h&&globalThis.__DEV__!==!1&&se.warn(6,n,o),a.add(o)),!0;g.forEach(u),d&&p===l.length-1&&Lm(e.selectionSet,r,i)&&(d=!1,h=!0,this.fuzzySubtypes.forEach(function(y,b){var _=n.match(y);_&&_[0]===n&&u(b)}))}return!1},t.prototype.hasKeyArgs=function(e,n){var r=this.getFieldPolicy(e,n,!1);return!!(r&&r.keyFn)},t.prototype.getStoreFieldName=function(e){var n=e.typename,r=e.fieldName,i=this.getFieldPolicy(n,r,!1),s,o=i&&i.keyFn;if(o&&n)for(var a={typename:n,fieldName:r,field:e.field||null,variables:e.variables},l=Wm(e);o;){var u=o(l,a);if(Tt(u))o=iT(u);else{s=u||r;break}}return s===void 0&&(s=e.field?WE(e.field,e.variables):em(r,Wm(e))),s===!1?r:r===fs(s)?s:r+":"+s},t.prototype.readField=function(e,n){var r=e.from;if(r){var i=e.field||e.fieldName;if(i){if(e.typename===void 0){var s=n.store.getFieldValue(r,"__typename");s&&(e.typename=s)}var o=this.getStoreFieldName(e),a=fs(o),l=n.store.getFieldValue(r,o),u=this.getFieldPolicy(e.typename,a,!1),d=u&&u.read;if(d){var h=fT(this,r,e,n,n.store.getStorage(et(r)?r.__ref:r,o));return jm.withValue(this.cache,d,[l,h])}return l}}},t.prototype.getReadFunction=function(e,n){var r=this.getFieldPolicy(e,n,!1);return r&&r.read},t.prototype.getMergeFunction=function(e,n,r){var i=this.getFieldPolicy(e,n,!1),s=i&&i.merge;return!s&&r&&(i=this.getTypePolicy(r),s=i&&i.merge),s},t.prototype.runMergeFunction=function(e,n,r,i,s){var o=r.field,a=r.typename,l=r.merge;return l===cT?dT(i.store)(e,n):l===uT?n:(i.overwrite&&(e=void 0),l(e,n,fT(this,void 0,{typename:a,fieldName:o.name.value,field:o,variables:i.variables},i,s||Object.create(null))))},t}();function fT(t,e,n,r,i){var s=t.getStoreFieldName(n),o=fs(s),a=n.variables||r.variables,l=r.store,u=l.toReference,d=l.canRead;return{args:Wm(n),field:n.field||null,fieldName:o,storeFieldName:s,variables:a,isReference:et,toReference:u,storage:i,cache:t.cache,canRead:d,readField:function(){return t.readField(zm(arguments,e,a),r)},mergeObjects:dT(r.store)}}function zm(t,e,n){var r=t[0],i=t[1],s=t.length,o;return typeof r=="string"?o={fieldName:r,from:s>1?i:e}:(o=C({},r),Ht.call(o,"from")||(o.from=e)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&se.warn(7,Bh(Array.from(t))),o.variables===void 0&&(o.variables=n),o}function dT(t){return function(n,r){if(Tt(n)||Tt(r))throw Sn(8);if(yt(n)&&yt(r)){var i=t.getFieldValue(n,"__typename"),s=t.getFieldValue(r,"__typename"),o=i&&s&&i!==s;if(o)return r;if(et(n)&&da(r))return t.merge(n.__ref,r),n;if(da(n)&&et(r))return t.merge(n,r.__ref),r;if(da(n)&&da(r))return C(C({},n),r)}return r}}function Qm(t,e,n){var r="".concat(e).concat(n),i=t.flavors.get(r);return i||t.flavors.set(r,i=t.clientOnly===e&&t.deferred===n?t:C(C({},t),{clientOnly:e,deferred:n})),i}var fF=function(){function t(e,n,r){this.cache=e,this.reader=n,this.fragments=r}return t.prototype.writeToStore=function(e,n){var r=this,i=n.query,s=n.result,o=n.dataId,a=n.variables,l=n.overwrite,u=io(i),d=eF();a=C(C({},Uu(u)),a);var h=C(C({store:e,written:Object.create(null),merge:function(g,y){return d.merge(g,y)},variables:a,varString:_r(a)},Hw(i,this.fragments)),{overwrite:!!l,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:s||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:h});if(!et(p))throw Sn(11,s);return h.incomingById.forEach(function(g,y){var b=g.storeObject,_=g.mergeTree,w=g.fieldNodeSet,O=Si(y);if(_&&_.map.size){var N=r.applyMerges(_,O,b,h);if(et(N))return;b=N}if(globalThis.__DEV__!==!1&&!h.overwrite){var I=Object.create(null);w.forEach(function(B){B.selectionSet&&(I[B.name.value]=!0)});var P=function(B){return I[fs(B)]===!0},R=function(B){var Q=_&&_.map.get(B);return!!(Q&&Q.info&&Q.info.merge)};Object.keys(b).forEach(function(B){P(B)&&!R(B)&&dF(O,b,B,h.store)})}e.merge(y,b)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var n=this,r=e.dataId,i=e.result,s=e.selectionSet,o=e.context,a=e.mergeTree,l=this.cache.policies,u=Object.create(null),d=r&&l.rootTypenamesById[r]||ju(i,s,o.fragmentMap)||r&&o.store.get(r,"__typename");typeof d=="string"&&(u.__typename=d);var h=function(){var N=zm(arguments,u,o.variables);if(et(N.from)){var I=o.incomingById.get(N.from.__ref);if(I){var P=l.readField(C(C({},N),{from:I.storeObject}),o);if(P!==void 0)return P}}return l.readField(N,o)},p=new Set;this.flattenFields(s,i,o,d).forEach(function(N,I){var P,R=Oi(I),B=i[R];if(p.add(I),B!==void 0){var Q=l.getStoreFieldName({typename:d,fieldName:I.name.value,field:I,variables:N.variables}),x=pT(a,Q),U=n.processFieldValue(B,I,I.selectionSet?Qm(N,!1,!1):N,x),be=void 0;I.selectionSet&&(et(U)||da(U))&&(be=h("__typename",U));var Oe=l.getMergeFunction(d,I.name.value,be);Oe?x.info={field:I,typename:d,merge:Oe}:mT(a,Q),u=N.merge(u,(P={},P[Q]=U,P))}else globalThis.__DEV__!==!1&&!N.clientOnly&&!N.deferred&&!Qu.added(I)&&!l.getReadFunction(d,I.name.value)&&globalThis.__DEV__!==!1&&se.error(12,Oi(I),i)});try{var g=l.identify(i,{typename:d,selectionSet:s,fragmentMap:o.fragmentMap,storeObject:u,readField:h}),y=g[0],b=g[1];r=r||y,b&&(u=o.merge(u,b))}catch(N){if(!r)throw N}if(typeof r=="string"){var _=Si(r),w=o.written[r]||(o.written[r]=[]);if(w.indexOf(s)>=0||(w.push(s),this.reader&&this.reader.isFresh(i,_,s,o)))return _;var O=o.incomingById.get(r);return O?(O.storeObject=o.merge(O.storeObject,u),O.mergeTree=Gm(O.mergeTree,a),p.forEach(function(N){return O.fieldNodeSet.add(N)})):o.incomingById.set(r,{storeObject:u,mergeTree:ff(a)?void 0:a,fieldNodeSet:p}),_}return u},t.prototype.processFieldValue=function(e,n,r,i){var s=this;return!n.selectionSet||e===null?globalThis.__DEV__!==!1?Em(e):e:Tt(e)?e.map(function(o,a){var l=s.processFieldValue(o,n,r,pT(i,a));return mT(i,a),l}):this.processSelectionSet({result:e,selectionSet:n.selectionSet,context:r,mergeTree:i})},t.prototype.flattenFields=function(e,n,r,i){i===void 0&&(i=ju(n,e,r.fragmentMap));var s=new Map,o=this.cache.policies,a=new eo(!1);return function l(u,d){var h=a.lookup(u,d.clientOnly,d.deferred);h.visited||(h.visited=!0,u.selections.forEach(function(p){if(ra(p,r.variables)){var g=d.clientOnly,y=d.deferred;if(!(g&&y)&&Un(p.directives)&&p.directives.forEach(function(w){var O=w.name.value;if(O==="client"&&(g=!0),O==="defer"){var N=Il(w,r.variables);(!N||N.if!==!1)&&(y=!0)}}),ki(p)){var b=s.get(p);b&&(g=g&&b.clientOnly,y=y&&b.deferred),s.set(p,Qm(r,g,y))}else{var _=Nl(p,r.lookupFragment);if(!_&&p.kind===k.FRAGMENT_SPREAD)throw Sn(13,p.name.value);_&&o.fragmentMatches(_,i,n,r.variables)&&l(_.selectionSet,Qm(r,g,y))}}}))}(e,r),s},t.prototype.applyMerges=function(e,n,r,i,s){var o,a=this;if(e.map.size&&!et(r)){var l=!Tt(r)&&(et(n)||da(n))?n:void 0,u=r;l&&!s&&(s=[et(l)?l.__ref:l]);var d,h=function(p,g){return Tt(p)?typeof g=="number"?p[g]:void 0:i.store.getFieldValue(p,String(g))};e.map.forEach(function(p,g){var y=h(l,g),b=h(u,g);if(b!==void 0){s&&s.push(g);var _=a.applyMerges(p,y,b,i,s);_!==b&&(d=d||new Map,d.set(g,_)),s&&se(s.pop()===g)}}),d&&(r=Tt(u)?u.slice(0):C({},u),d.forEach(function(p,g){r[g]=p}))}return e.info?this.cache.policies.runMergeFunction(n,r,e.info,i,s&&(o=i.store).getStorage.apply(o,s)):r},t}(),hT=[];function pT(t,e){var n=t.map;return n.has(e)||n.set(e,hT.pop()||{map:new Map}),n.get(e)}function Gm(t,e){if(t===e||!e||ff(e))return t;if(!t||ff(t))return e;var n=t.info&&e.info?C(C({},t.info),e.info):t.info||e.info,r=t.map.size&&e.map.size,i=r?new Map:t.map.size?t.map:e.map,s={info:n,map:i};if(r){var o=new Set(e.map.keys());t.map.forEach(function(a,l){s.map.set(l,Gm(a,e.map.get(l))),o.delete(l)}),o.forEach(function(a){s.map.set(a,Gm(e.map.get(a),t.map.get(a)))})}return s}function ff(t){return!t||!(t.info||t.map.size)}function mT(t,e){var n=t.map,r=n.get(e);r&&ff(r)&&(hT.push(r),n.delete(e))}var gT=new Set;function dF(t,e,n,r){var i=function(h){var p=r.getFieldValue(h,n);return typeof p=="object"&&p},s=i(t);if(s){var o=i(e);if(o&&!et(s)&&!Ue(s,o)&&!Object.keys(s).every(function(h){return r.getFieldValue(o,h)!==void 0})){var a=r.getFieldValue(t,"__typename")||r.getFieldValue(e,"__typename"),l=fs(n),u="".concat(a,".").concat(l);if(!gT.has(u)){gT.add(u);var d=[];!Tt(s)&&!Tt(o)&&[s,o].forEach(function(h){var p=r.getFieldValue(h,"__typename");typeof p=="string"&&!d.includes(p)&&d.push(p)}),globalThis.__DEV__!==!1&&se.warn(14,l,a,d.length?"either ensure all objects of type "+d.join(" and ")+" have an ID or a custom merge function, or ":"",u,C({},s),C({},o))}}}}var Hm=function(t){pr(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.watches=new Set,r.addTypenameTransform=new Ml(Qu),r.assumeImmutableResults=!0,r.makeVar=Bm,r.txCount=0,r.config=XP(n),r.addTypename=!!r.config.addTypename,r.policies=new uF({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return e.prototype.init=function(){var n=this.data=new ql.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=n.stump,this.resetResultCache()},e.prototype.resetResultCache=function(n){var r=this,i=this.storeReader,s=this.config.fragments;this.storeWriter=new fF(this,this.storeReader=new iF({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Qw(this.config),canon:n?void 0:i&&i.canon,fragments:s}),s),this.maybeBroadcastWatch=Dl(function(o,a){return r.broadcastWatch(o,a)},{max:this.config.resultCacheMaxSize||zr["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(o){var a=o.optimistic?r.optimisticData:r.data;if(Wl(a)){var l=o.optimistic,u=o.id,d=o.variables;return a.makeCacheKey(o.query,o.callback,_r({optimistic:l,id:u,variables:d}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(n){return this.init(),n&&this.data.replace(n),this},e.prototype.extract=function(n){return n===void 0&&(n=!1),(n?this.optimisticData:this.data).extract()},e.prototype.read=function(n){var r=n.returnPartialData,i=r===void 0?!1:r;try{return this.storeReader.diffQueryAgainstStore(C(C({},n),{store:n.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(s){if(s instanceof lf)return null;throw s}},e.prototype.write=function(n){try{return++this.txCount,this.storeWriter.writeToStore(this.data,n)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(n){if(Ht.call(n,"id")&&!n.id)return!1;var r=n.optimistic?this.optimisticData:this.data;try{return++this.txCount,r.modify(n.id||"ROOT_QUERY",n.fields)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(n){return this.storeReader.diffQueryAgainstStore(C(C({},n),{store:n.optimistic?this.optimisticData:this.data,rootId:n.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(n){var r=this;return this.watches.size||aF(this),this.watches.add(n),n.immediate&&this.maybeBroadcastWatch(n),function(){r.watches.delete(n)&&!r.watches.size&&tT(r),r.maybeBroadcastWatch.forget(n)}},e.prototype.gc=function(n){var r;_r.reset(),oa.reset(),this.addTypenameTransform.resetCache(),(r=this.config.fragments)===null||r===void 0||r.resetCaches();var i=this.optimisticData.gc();return n&&!this.txCount&&(n.resetResultCache?this.resetResultCache(n.resetResultIdentities):n.resetResultIdentities&&this.storeReader.resetCanon()),i},e.prototype.retain=function(n,r){return(r?this.optimisticData:this.data).retain(n)},e.prototype.release=function(n,r){return(r?this.optimisticData:this.data).release(n)},e.prototype.identify=function(n){if(et(n))return n.__ref;try{return this.policies.identify(n)[0]}catch(r){globalThis.__DEV__!==!1&&se.warn(r)}},e.prototype.evict=function(n){if(!n.id){if(Ht.call(n,"id"))return!1;n=C(C({},n),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(n,this.data)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(n){var r=this;return this.init(),_r.reset(),n&&n.discardWatches?(this.watches.forEach(function(i){return r.maybeBroadcastWatch.forget(i)}),this.watches.clear(),tT(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(n){var r=this.optimisticData.removeLayer(n);r!==this.optimisticData&&(this.optimisticData=r,this.broadcastWatches())},e.prototype.batch=function(n){var r=this,i=n.update,s=n.optimistic,o=s===void 0?!0:s,a=n.removeOptimistic,l=n.onWatchUpdated,u,d=function(p){var g=r,y=g.data,b=g.optimisticData;++r.txCount,p&&(r.data=r.optimisticData=p);try{return u=i(r)}finally{--r.txCount,r.data=y,r.optimisticData=b}},h=new Set;return l&&!this.txCount&&this.broadcastWatches(C(C({},n),{onWatchUpdated:function(p){return h.add(p),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,d):o===!1?d(this.data):d(),typeof a=="string"&&(this.optimisticData=this.optimisticData.removeLayer(a)),l&&h.size?(this.broadcastWatches(C(C({},n),{onWatchUpdated:function(p,g){var y=l.call(this,p,g);return y!==!1&&h.delete(p),y}})),h.size&&h.forEach(function(p){return r.maybeBroadcastWatch.dirty(p)})):this.broadcastWatches(n),u},e.prototype.performTransaction=function(n,r){return this.batch({update:n,optimistic:r||r!==null})},e.prototype.transformDocument=function(n){return this.addTypenameToDocument(this.addFragmentsToDocument(n))},e.prototype.broadcastWatches=function(n){var r=this;this.txCount||this.watches.forEach(function(i){return r.maybeBroadcastWatch(i,n)})},e.prototype.addFragmentsToDocument=function(n){var r=this.config.fragments;return r?r.transform(n):n},e.prototype.addTypenameToDocument=function(n){return this.addTypename?this.addTypenameTransform.transformDocument(n):n},e.prototype.broadcastWatch=function(n,r){var i=n.lastDiff,s=this.diff(n);r&&(n.optimistic&&typeof r.optimistic=="string"&&(s.fromOptimisticTransaction=!0),r.onWatchUpdated&&r.onWatchUpdated.call(this,n,s,i)===!1)||(!i||!Ue(i.result,s.result))&&n.callback(n.lastDiff=s,i)},e}(of);globalThis.__DEV__!==!1&&(Hm.prototype.getMemoryInternals=mR);var Qe;(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"})(Qe||(Qe={}));function Ql(t){return t?t<7:!1}function yT(t){return t===7||t===8}var vT=Object.assign,hF=Object.hasOwnProperty,Gl=function(t){pr(e,t);function e(n){var r=n.queryManager,i=n.queryInfo,s=n.options,o=t.call(this,function(_){try{var w=_._subscription._observer;w&&!w.error&&(w.error=pF)}catch{}var O=!o.observers.size;o.observers.add(_);var N=o.last;return N&&N.error?_.error&&_.error(N.error):N&&N.result&&_.next&&_.next(N.result),O&&o.reobserve().catch(function(){}),function(){o.observers.delete(_)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=r,o.waitForOwnResult=Km(s.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var a=r.defaultOptions.watchQuery,l=a===void 0?{}:a,u=l.fetchPolicy,d=u===void 0?"cache-first":u,h=s.fetchPolicy,p=h===void 0?d:h,g=s.initialFetchPolicy,y=g===void 0?p==="standby"?d:p:g;o.options=C(C({},s),{initialFetchPolicy:y,fetchPolicy:p}),o.queryId=i.queryId||r.generateQueryId();var b=io(o.query);return o.queryName=b&&b.name&&b.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var n=this;return new Promise(function(r,i){var s={next:function(a){r(a),n.observers.delete(s),n.observers.size||n.queryManager.removeQuery(n.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=n.subscribe(s)})},e.prototype.resetDiff=function(){this.queryInfo.resetDiff()},e.prototype.getCurrentResult=function(n){n===void 0&&(n=!0);var r=this.getLastResult(!0),i=this.queryInfo.networkStatus||r&&r.networkStatus||Qe.ready,s=C(C({},r),{loading:Ql(i),networkStatus:i}),o=this.options.fetchPolicy,a=o===void 0?"cache-first":o;if(!(Km(a)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var l=this.queryInfo.getDiff();(l.complete||this.options.returnPartialData)&&(s.data=l.result),Ue(s.data,{})&&(s.data=void 0),l.complete?(delete s.partial,l.complete&&s.networkStatus===Qe.loading&&(a==="cache-first"||a==="cache-only")&&(s.networkStatus=Qe.ready,s.loading=!1)):s.partial=!0,globalThis.__DEV__!==!1&&!l.complete&&!this.options.partialRefetch&&!s.loading&&!s.data&&!s.error&&_T(l.missing)}return n&&this.updateLastResult(s),s},e.prototype.isDifferentFromLastResult=function(n,r){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!qw(this.query,this.last.result,n,this.variables):!Ue(this.last.result,n);return i||r&&!Ue(this.last.variables,r)},e.prototype.getLast=function(n,r){var i=this.last;if(i&&i[n]&&(!r||Ue(i.variables,this.variables)))return i[n]},e.prototype.getLastResult=function(n){return this.getLast("result",n)},e.prototype.getLastError=function(n){return this.getLast("error",n)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(n){var r,i={pollInterval:0},s=this.options.fetchPolicy;if(s==="cache-and-network"?i.fetchPolicy=s:s==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&n&&hF.call(n,"variables")){var o=tm(this.query),a=o.variableDefinitions;(!a||!a.some(function(l){return l.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&se.warn(20,n,((r=o.name)===null||r===void 0?void 0:r.value)||o)}return n&&!Ue(this.options.variables,n)&&(i.variables=this.options.variables=C(C({},this.options.variables),n)),this.queryInfo.resetLastWrite(),this.reobserve(i,Qe.refetch)},e.prototype.fetchMore=function(n){var r=this,i=C(C({},n.query?n:C(C(C(C({},this.options),{query:this.options.query}),n),{variables:C(C({},this.options.variables),n.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var s=this.queryManager.generateQueryId();this.lastQuery=n.query?this.transformDocument(this.options.query):i.query;var o=this.queryInfo,a=o.networkStatus;o.networkStatus=Qe.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var l=new Set,u=n==null?void 0:n.updateQuery,d=this.options.fetchPolicy!=="no-cache";return d||se(u,21),this.queryManager.fetchQuery(s,i,Qe.fetchMore).then(function(h){if(r.queryManager.removeQuery(s),o.networkStatus===Qe.fetchMore&&(o.networkStatus=a),d)r.queryManager.cache.batch({update:function(y){var b=n.updateQuery;b?y.updateQuery({query:r.query,variables:r.variables,returnPartialData:!0,optimistic:!1},function(_){return b(_,{fetchMoreResult:h.data,variables:i.variables})}):y.writeQuery({query:i.query,variables:i.variables,data:h.data})},onWatchUpdated:function(y){l.add(y.query)}});else{var p=r.getLast("result"),g=u(p.data,{fetchMoreResult:h.data,variables:i.variables});r.reportResult(C(C({},p),{data:g}),r.variables)}return h}).finally(function(){d&&!l.has(r.query)&&bT(r)})},e.prototype.subscribeToMore=function(n){var r=this,i=this.queryManager.startGraphQLSubscription({query:n.document,variables:n.variables,context:n.context}).subscribe({next:function(s){var o=n.updateQuery;o&&r.updateQuery(function(a,l){var u=l.variables;return o(a,{subscriptionData:s,variables:u})})},error:function(s){if(n.onError){n.onError(s);return}globalThis.__DEV__!==!1&&se.error(22,s)}});return this.subscriptions.add(i),function(){r.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(n){return this.reobserve(n)},e.prototype.silentSetOptions=function(n){var r=us(this.options,n||{});vT(this.options,r)},e.prototype.setVariables=function(n){return Ue(this.variables,n)?this.observers.size?this.result():Promise.resolve():(this.options.variables=n,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:n},Qe.setVariables):Promise.resolve())},e.prototype.updateQuery=function(n){var r=this.queryManager,i=r.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,s=n(i,{variables:this.variables});s&&(r.cache.writeQuery({query:this.options.query,data:s,variables:this.variables}),r.broadcastQueries())},e.prototype.startPolling=function(n){this.options.pollInterval=n,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(n,r){if(r.nextFetchPolicy){var i=r.fetchPolicy,s=i===void 0?"cache-first":i,o=r.initialFetchPolicy,a=o===void 0?s:o;s==="standby"||(typeof r.nextFetchPolicy=="function"?r.fetchPolicy=r.nextFetchPolicy(s,{reason:n,options:r,observable:this,initialFetchPolicy:a}):n==="variables-changed"?r.fetchPolicy=a:r.fetchPolicy=r.nextFetchPolicy)}return r.fetchPolicy},e.prototype.fetch=function(n,r,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,n,r,i)},e.prototype.updatePolling=function(){var n=this;if(!this.queryManager.ssrMode){var r=this,i=r.pollingInfo,s=r.options.pollInterval;if(!s||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===s)){se(s,23);var o=i||(this.pollingInfo={});o.interval=s;var a=function(){var u,d;n.pollingInfo&&(!Ql(n.queryInfo.networkStatus)&&!(!((d=(u=n.options).skipPollAttempt)===null||d===void 0)&&d.call(u))?n.reobserve({fetchPolicy:n.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},Qe.poll).then(l,l):l())},l=function(){var u=n.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(a,u.interval))};l()}}},e.prototype.updateLastResult=function(n,r){r===void 0&&(r=this.variables);var i=this.getLastError();return i&&this.last&&!Ue(r,this.last.variables)&&(i=void 0),this.last=C({result:this.queryManager.assumeImmutableResults?n:Em(n),variables:r},i?{error:i}:null)},e.prototype.reobserveAsConcast=function(n,r){var i=this;this.isTornDown=!1;var s=r===Qe.refetch||r===Qe.fetchMore||r===Qe.poll,o=this.options.variables,a=this.options.fetchPolicy,l=us(this.options,n||{}),u=s?l:vT(this.options,l),d=this.transformDocument(u.query);this.lastQuery=d,s||(this.updatePolling(),n&&n.variables&&!Ue(n.variables,o)&&u.fetchPolicy!=="standby"&&(u.fetchPolicy===a||typeof u.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",u),r===void 0&&(r=Qe.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Km(u.fetchPolicy));var h=function(){i.concast===y&&(i.waitForOwnResult=!1)},p=u.variables&&C({},u.variables),g=this.fetch(u,r,d),y=g.concast,b=g.fromLink,_={next:function(w){Ue(i.variables,p)&&(h(),i.reportResult(w,p))},error:function(w){Ue(i.variables,p)&&(ef(w)||(w=new fn({networkError:w})),h(),i.reportError(w,p))}};return!s&&(b||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=y,this.observer=_),y.addObserver(_),y},e.prototype.reobserve=function(n,r){return this.reobserveAsConcast(n,r).promise},e.prototype.resubscribeAfterError=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=this.last;this.resetLastResults();var s=this.subscribe.apply(this,n);return this.last=i,s},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(n,r){var i=this.getLastError(),s=this.isDifferentFromLastResult(n,r);(i||!n.partial||this.options.returnPartialData)&&this.updateLastResult(n,r),(i||s)&&fa(this.observers,"next",n)},e.prototype.reportError=function(n,r){var i=C(C({},this.getLastResult()),{error:n,errors:n.graphQLErrors,networkStatus:Qe.error,loading:!1});this.updateLastResult(i,r),fa(this.observers,"error",this.last.error=n)},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(n){return n.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e.prototype.transformDocument=function(n){return this.queryManager.transform(n)},e}(Xe);Tm(Gl);function bT(t){var e=t.options,n=e.fetchPolicy,r=e.nextFetchPolicy;return n==="cache-and-network"||n==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(i,s){return this.nextFetchPolicy=r,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(i,s):n}}):t.reobserve()}function pF(t){globalThis.__DEV__!==!1&&se.error(24,t.message,t.stack)}function _T(t){globalThis.__DEV__!==!1&&t&&globalThis.__DEV__!==!1&&se.debug(25,t)}function Km(t){return t==="network-only"||t==="no-cache"||t==="standby"}var pa=new(as?WeakMap:Map);function Jm(t,e){var n=t[e];typeof n=="function"&&(t[e]=function(){return pa.set(t,(pa.get(t)+1)%1e15),n.apply(this,arguments)})}function ET(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Ym=function(){function t(e,n){n===void 0&&(n=e.generateQueryId()),this.queryId=n,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;pa.has(r)||(pa.set(r,0),Jm(r,"evict"),Jm(r,"modify"),Jm(r,"reset"))}return t.prototype.init=function(e){var n=e.networkStatus||Qe.loading;return this.variables&&this.networkStatus!==Qe.loading&&!Ue(this.variables,e.variables)&&(n=Qe.setVariables),Ue(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:n}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){ET(this),this.dirty=!1},t.prototype.resetDiff=function(){this.lastDiff=void 0},t.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&Ue(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var r=this.cache.diff(e);return this.updateLastDiff(r,e),r},t.prototype.updateLastDiff=function(e,n){this.lastDiff=e?{diff:e,options:n||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var n;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(n=this.observableQuery)===null||n===void 0?void 0:n.options.canonizeResults}},t.prototype.setDiff=function(e){var n=this,r,i=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(!((r=this.observableQuery)===null||r===void 0)&&r.getLastError())||(this.updateLastDiff(e),!this.dirty&&!Ue(i&&i.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return n.notify()},0))))},t.prototype.setObservableQuery=function(e){var n=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 r=n.getDiff();r.fromOptimisticTransaction?e.observe():bT(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;ET(this),this.shouldNotify()&&this.listeners.forEach(function(n){return n(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Ql(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;var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var n=this;e===void 0&&(e=this.variables);var r=this.observableQuery;if(!(r&&r.options.fetchPolicy==="no-cache")){var i=C(C({},this.getDiffOptions(e)),{watcher:this,callback:function(s){return n.setDiff(s)}});(!this.lastWatch||!Ue(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,n){var r=this.lastWrite;return!(r&&r.dmCount===pa.get(this.cache)&&Ue(n,r.variables)&&Ue(e.data,r.result.data))},t.prototype.markResult=function(e,n,r,i){var s=this,o=new Ni,a=Un(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Un(e.incremental)){var l=Sm(this.getDiff().result,e);e.data=l}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=a,r.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(r.variables)):i!==0&&(Xm(e,r.errorPolicy)?this.cache.performTransaction(function(d){if(s.shouldWrite(e,r.variables))d.writeQuery({query:n,data:e.data,variables:r.variables,overwrite:i===1}),s.lastWrite={result:e,variables:r.variables,dmCount:pa.get(s.cache)};else if(s.lastDiff&&s.lastDiff.diff.complete){e.data=s.lastDiff.diff.result;return}var h=s.getDiffOptions(r.variables),p=d.diff(h);!s.stopped&&Ue(s.variables,r.variables)&&s.updateWatch(r.variables),s.updateLastDiff(p,h),p.complete&&(e.data=p.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Qe.ready},t.prototype.markError=function(e){return this.networkStatus=Qe.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Xm(t,e){e===void 0&&(e="none");var n=e==="ignore"||e==="all",r=!Ll(t);return!r&&n&&t.data&&(r=!0),r}var mF=Object.prototype.hasOwnProperty,wT=Object.create(null),gF=function(){function t(e){var n=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new Vu(zr["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new eo(!1);var r=new Ml(function(s){return n.cache.transformDocument(s)},{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults;var i=e.documentTransform;this.documentTransform=i?r.concat(i).concat(r):r,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(n,r){e.stopQueryNoBroadcast(r)}),this.cancelPendingFetches(Sn(26))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(n){return n(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){return Ki(this,arguments,void 0,function(n){var r,i,s,o,a,l,u,d=n.mutation,h=n.variables,p=n.optimisticResponse,g=n.updateQueries,y=n.refetchQueries,b=y===void 0?[]:y,_=n.awaitRefetchQueries,w=_===void 0?!1:_,O=n.update,N=n.onQueryUpdated,I=n.fetchPolicy,P=I===void 0?((l=this.defaultOptions.mutate)===null||l===void 0?void 0:l.fetchPolicy)||"network-only":I,R=n.errorPolicy,B=R===void 0?((u=this.defaultOptions.mutate)===null||u===void 0?void 0:u.errorPolicy)||"none":R,Q=n.keepRootFields,x=n.context;return Ji(this,function(U){switch(U.label){case 0:return se(d,27),se(P==="network-only"||P==="no-cache",28),r=this.generateMutationId(),d=this.cache.transformForLink(this.transform(d)),i=this.getDocumentInfo(d).hasClientExports,h=this.getVariables(d,h),i?[4,this.localState.addExportedVariables(d,h,x)]:[3,2];case 1:h=U.sent(),U.label=2;case 2:return s=this.mutationStore&&(this.mutationStore[r]={mutation:d,variables:h,loading:!0,error:null}),o=p&&this.markMutationOptimistic(p,{mutationId:r,document:d,variables:h,fetchPolicy:P,errorPolicy:B,context:x,updateQueries:g,update:O,keepRootFields:Q}),this.broadcastQueries(),a=this,[2,new Promise(function(be,Oe){return Ju(a.getObservableFromLink(d,C(C({},x),{optimisticResponse:o?p:void 0}),h,{},!1),function(ke){if(Ll(ke)&&B==="none")throw new fn({graphQLErrors:Yu(ke)});s&&(s.loading=!1,s.error=null);var je=C({},ke);return typeof b=="function"&&(b=b(je)),B==="ignore"&&Ll(je)&&delete je.errors,a.markMutationResult({mutationId:r,result:je,document:d,variables:h,fetchPolicy:P,errorPolicy:B,context:x,update:O,updateQueries:g,awaitRefetchQueries:w,refetchQueries:b,removeOptimistic:o?r:void 0,onQueryUpdated:N,keepRootFields:Q})}).subscribe({next:function(ke){a.broadcastQueries(),(!("hasNext"in ke)||ke.hasNext===!1)&&be(ke)},error:function(ke){s&&(s.loading=!1,s.error=ke),o&&a.cache.removeOptimistic(r),a.broadcastQueries(),Oe(ke instanceof fn?ke:new fn({networkError:ke}))}})})]}})})},t.prototype.markMutationResult=function(e,n){var r=this;n===void 0&&(n=this.cache);var i=e.result,s=[],o=e.fetchPolicy==="no-cache";if(!o&&Xm(i,e.errorPolicy)){if(ao(i)||s.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),ao(i)&&Un(i.incremental)){var a=n.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),l=void 0;a.result&&(l=Sm(a.result,i)),typeof l<"u"&&(i.data=l,s.push({result:l,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(h,p){var g=h.observableQuery,y=g&&g.queryName;if(!(!y||!mF.call(u,y))){var b=u[y],_=r.queries.get(p),w=_.document,O=_.variables,N=n.diff({query:w,variables:O,returnPartialData:!0,optimistic:!1}),I=N.result,P=N.complete;if(P&&I){var R=b(I,{mutationResult:i,queryName:w&&Bu(w)||void 0,queryVariables:O});R&&s.push({result:R,dataId:"ROOT_QUERY",query:w,variables:O})}}})}if(s.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var d=[];if(this.refetchQueries({updateCache:function(h){o||s.forEach(function(b){return h.write(b)});var p=e.update,g=!Ow(i)||ao(i)&&!i.hasNext;if(p){if(!o){var y=h.diff({id:"ROOT_MUTATION",query:r.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});y.complete&&(i=C(C({},i),{data:y.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}g&&p(h,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&g&&h.modify({id:"ROOT_MUTATION",fields:function(b,_){var w=_.fieldName,O=_.DELETE;return w==="__typename"?b:O}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(h){return d.push(h)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(d).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,n){var r=this,i=typeof e=="function"?e(n.variables,{IGNORE:wT}):e;return i===wT?!1:(this.cache.recordOptimisticTransaction(function(s){try{r.markMutationResult(C(C({},n),{result:{data:i}}),s)}catch(o){globalThis.__DEV__!==!1&&se.error(o)}},n.mutationId),!0)},t.prototype.fetchQuery=function(e,n,r){return this.fetchConcastWithInfo(e,n,r).concast.promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(n,r){e[r]={variables:n.variables,networkStatus:n.networkStatus,networkError:n.networkError,graphQLErrors:n.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var n=this.queries.get(e);n&&(n.networkError=void 0,n.graphQLErrors=[])},t.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},t.prototype.getDocumentInfo=function(e){var n=this.transformCache;if(!n.has(e)){var r={hasClientExports:CE(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:ss(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:zu([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:Uu(io(e)),asQuery:C(C({},e),{definitions:e.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?C(C({},i),{operation:"query"}):i})})};n.set(e,r)}return n.get(e)},t.prototype.getVariables=function(e,n){return C(C({},this.getDocumentInfo(e).defaultVars),n)},t.prototype.watchQuery=function(e){var n=this.transform(e.query);e=C(C({},e),{variables:this.getVariables(n,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Ym(this),i=new Gl({queryManager:this,queryInfo:r,options:e});return i.lastQuery=n,this.queries.set(i.queryId,r),r.init({document:n,observableQuery:i,variables:i.variables}),i},t.prototype.query=function(e,n){var r=this;return n===void 0&&(n=this.generateQueryId()),se(e.query,29),se(e.query.kind==="Document",30),se(!e.returnPartialData,31),se(!e.pollInterval,32),this.fetchQuery(n,C(C({},e),{query:this.transform(e.query)})).finally(function(){return r.stopQuery(n)})},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 n=this.queries.get(e);n&&n.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(Sn(33)),this.queries.forEach(function(n){n.observableQuery?n.networkStatus=Qe.loading:n.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var n=this;e===void 0&&(e="active");var r=new Map,i=new Map,s=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):qE(o)?i.set(n.transform(o),!1):yt(o)&&o.query&&s.add(o)}),this.queries.forEach(function(o,a){var l=o.observableQuery,u=o.document;if(l){if(e==="all"){r.set(a,l);return}var d=l.queryName,h=l.options.fetchPolicy;if(h==="standby"||e==="active"&&!l.hasObservers())return;(e==="active"||d&&i.has(d)||u&&i.has(u))&&(r.set(a,l),d&&i.set(d,!0),u&&i.set(u,!0))}}),s.size&&s.forEach(function(o){var a=iu("legacyOneTimeQuery"),l=n.getQuery(a).init({document:o.query,variables:o.variables}),u=new Gl({queryManager:n,queryInfo:l,options:C(C({},o),{fetchPolicy:"network-only"})});se(u.queryId===a),l.setObservableQuery(u),r.set(a,u)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(o,a){o||globalThis.__DEV__!==!1&&se.warn(typeof a=="string"?34:35,a)}),r},t.prototype.reFetchObservableQueries=function(e){var n=this;e===void 0&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,s){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&r.push(i.refetch()),n.getQuery(s).setDiff(null)}),this.broadcastQueries(),Promise.all(r)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var n=this,r=e.query,i=e.fetchPolicy,s=e.errorPolicy,o=s===void 0?"none":s,a=e.variables,l=e.context,u=l===void 0?{}:l,d=e.extensions,h=d===void 0?{}:d;r=this.transform(r),a=this.getVariables(r,a);var p=function(y){return n.getObservableFromLink(r,u,y,h).map(function(b){i!=="no-cache"&&(Xm(b,o)&&n.cache.write({query:r,result:b.data,dataId:"ROOT_SUBSCRIPTION",variables:y}),n.broadcastQueries());var _=Ll(b),w=LP(b);if(_||w){var O={};if(_&&(O.graphQLErrors=b.errors),w&&(O.protocolErrors=b.extensions[Am]),o==="none"||w)throw new fn(O)}return o==="ignore"&&delete b.errors,b})};if(this.getDocumentInfo(r).hasClientExports){var g=this.localState.addExportedVariables(r,a,u).then(p);return new Xe(function(y){var b=null;return g.then(function(_){return b=_.subscribe(y)},y.error),function(){return b&&b.unsubscribe()}})}return p(a)},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,n,r,i,s){var o=this,a;s===void 0&&(s=(a=n==null?void 0:n.queryDeduplication)!==null&&a!==void 0?a:this.queryDeduplication);var l,u=this.getDocumentInfo(e),d=u.serverQuery,h=u.clientQuery;if(d){var p=this,g=p.inFlightLinkObservables,y=p.link,b={query:d,variables:r,operationName:Bu(d)||void 0,context:this.prepareContext(C(C({},n),{forceFetch:!s})),extensions:i};if(n=b.context,s){var _=oa(d),w=_r(r),O=g.lookup(_,w);if(l=O.observable,!l){var N=new oo([jl(y,b)]);l=O.observable=N,N.beforeNext(function(){g.remove(_,w)})}}else l=new oo([jl(y,b)])}else l=new oo([Xe.of({data:{}})]),n=this.prepareContext(n);return h&&(l=Ju(l,function(I){return o.localState.runResolvers({document:h,remoteResult:I,context:n,variables:r})})),l},t.prototype.getResultsFromLink=function(e,n,r){var i=e.lastRequestId=this.generateRequestId(),s=this.cache.transformForLink(r.query);return Ju(this.getObservableFromLink(s,r.context,r.variables),function(o){var a=Yu(o),l=a.length>0,u=r.errorPolicy;if(i>=e.lastRequestId){if(l&&u==="none")throw e.markError(new fn({graphQLErrors:a}));e.markResult(o,s,r,n),e.markReady()}var d={data:o.data,loading:!1,networkStatus:Qe.ready};return l&&u==="none"&&(d.data=void 0),l&&u!=="ignore"&&(d.errors=a,d.networkStatus=Qe.error),d},function(o){var a=ef(o)?o:new fn({networkError:o});throw i>=e.lastRequestId&&e.markError(a),a})},t.prototype.fetchConcastWithInfo=function(e,n,r,i){var s=this;r===void 0&&(r=Qe.loading),i===void 0&&(i=n.query);var o=this.getVariables(i,n.variables),a=this.getQuery(e),l=this.defaultOptions.watchQuery,u=n.fetchPolicy,d=u===void 0?l&&l.fetchPolicy||"cache-first":u,h=n.errorPolicy,p=h===void 0?l&&l.errorPolicy||"none":h,g=n.returnPartialData,y=g===void 0?!1:g,b=n.notifyOnNetworkStatusChange,_=b===void 0?!1:b,w=n.context,O=w===void 0?{}:w,N=Object.assign({},n,{query:i,variables:o,fetchPolicy:d,errorPolicy:p,returnPartialData:y,notifyOnNetworkStatusChange:_,context:O}),I=function(x){N.variables=x;var U=s.fetchQueryByPolicy(a,N,r);return N.fetchPolicy!=="standby"&&U.sources.length>0&&a.observableQuery&&a.observableQuery.applyNextFetchPolicy("after-fetch",n),U},P=function(){return s.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(x){P(),setTimeout(function(){return R.cancel(x)})});var R,B;if(this.getDocumentInfo(N.query).hasClientExports)R=new oo(this.localState.addExportedVariables(N.query,N.variables,N.context).then(I).then(function(x){return x.sources})),B=!0;else{var Q=I(N.variables);B=Q.fromLink,R=new oo(Q.sources)}return R.promise.then(P,P),{concast:R,fromLink:B}},t.prototype.refetchQueries=function(e){var n=this,r=e.updateCache,i=e.include,s=e.optimistic,o=s===void 0?!1:s,a=e.removeOptimistic,l=a===void 0?o?iu("refetchQueries"):void 0:a,u=e.onQueryUpdated,d=new Map;i&&this.getObservableQueries(i).forEach(function(p,g){d.set(g,{oq:p,lastDiff:n.getQuery(g).getDiff()})});var h=new Map;return r&&this.cache.batch({update:r,optimistic:o&&l||!1,removeOptimistic:l,onWatchUpdated:function(p,g,y){var b=p.watcher instanceof Ym&&p.watcher.observableQuery;if(b){if(u){d.delete(b.queryId);var _=u(b,g,y);return _===!0&&(_=b.refetch()),_!==!1&&h.set(b,_),_}u!==null&&d.set(b.queryId,{oq:b,lastDiff:y,diff:g})}}}),d.size&&d.forEach(function(p,g){var y=p.oq,b=p.lastDiff,_=p.diff,w;if(u){if(!_){var O=y.queryInfo;O.reset(),_=O.getDiff()}w=u(y,_,b)}(!u||w===!0)&&(w=y.refetch()),w!==!1&&h.set(y,w),g.indexOf("legacyOneTimeQuery")>=0&&n.stopQueryNoBroadcast(g)}),l&&this.cache.removeOptimistic(l),h},t.prototype.fetchQueryByPolicy=function(e,n,r){var i=this,s=n.query,o=n.variables,a=n.fetchPolicy,l=n.refetchWritePolicy,u=n.errorPolicy,d=n.returnPartialData,h=n.context,p=n.notifyOnNetworkStatusChange,g=e.networkStatus;e.init({document:s,variables:o,networkStatus:r});var y=function(){return e.getDiff()},b=function(I,P){P===void 0&&(P=e.networkStatus||Qe.loading);var R=I.result;globalThis.__DEV__!==!1&&!d&&!Ue(R,{})&&_T(I.missing);var B=function(Q){return Xe.of(C({data:Q,loading:Ql(P),networkStatus:P},I.complete?null:{partial:!0}))};return R&&i.getDocumentInfo(s).hasForcedResolvers?i.localState.runResolvers({document:s,remoteResult:{data:R},context:h,variables:o,onlyRunForcedResolvers:!0}).then(function(Q){return B(Q.data||void 0)}):u==="none"&&P===Qe.refetch&&Array.isArray(I.missing)?B(void 0):B(R)},_=a==="no-cache"?0:r===Qe.refetch&&l!=="merge"?1:2,w=function(){return i.getResultsFromLink(e,_,{query:s,variables:o,context:h,fetchPolicy:a,errorPolicy:u})},O=p&&typeof g=="number"&&g!==r&&Ql(r);switch(a){default:case"cache-first":{var N=y();return N.complete?{fromLink:!1,sources:[b(N,e.markReady())]}:d||O?{fromLink:!0,sources:[b(N),w()]}:{fromLink:!0,sources:[w()]}}case"cache-and-network":{var N=y();return N.complete||d||O?{fromLink:!0,sources:[b(N),w()]}:{fromLink:!0,sources:[w()]}}case"cache-only":return{fromLink:!1,sources:[b(y(),e.markReady())]};case"network-only":return O?{fromLink:!0,sources:[b(y()),w()]}:{fromLink:!0,sources:[w()]};case"no-cache":return O?{fromLink:!0,sources:[b(e.getDiff()),w()]}:{fromLink:!0,sources:[w()]};case"standby":return{fromLink:!1,sources:[]}}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Ym(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var n=this.localState.prepareContext(e);return C(C(C({},this.defaultContext),n),{clientAwareness:this.clientAwareness})},t}(),yF=function(){function t(e){var n=e.cache,r=e.client,i=e.resolvers,s=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=n,r&&(this.client=r),i&&this.addResolvers(i),s&&this.setFragmentMatcher(s)}return t.prototype.addResolvers=function(e){var n=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(r){n.resolvers=Pl(n.resolvers,r)}):this.resolvers=Pl(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){return Ki(this,arguments,void 0,function(n){var r=n.document,i=n.remoteResult,s=n.context,o=n.variables,a=n.onlyRunForcedResolvers,l=a===void 0?!1:a;return Ji(this,function(u){return r?[2,this.resolveDocument(r,i.data,s,o,this.fragmentMatcher,l).then(function(d){return C(C({},i),{data:d.result})})]:[2,i]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return ss(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return um(e)},t.prototype.prepareContext=function(e){var n=this.cache;return C(C({},e),{cache:n,getCacheKey:function(r){return n.identify(r)}})},t.prototype.addExportedVariables=function(e){return Ki(this,arguments,void 0,function(n,r,i){return r===void 0&&(r={}),i===void 0&&(i={}),Ji(this,function(s){return n?[2,this.resolveDocument(n,this.buildRootValueFromCache(n,r)||{},this.prepareContext(i),r).then(function(o){return C(C({},r),o.exportedVariables)})]:[2,C({},r)]})})},t.prototype.shouldForceResolvers=function(e){var n=!1;return en(e,{Directive:{enter:function(r){if(r.name.value==="client"&&r.arguments&&(n=r.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),n))return Zi}}}),n},t.prototype.buildRootValueFromCache=function(e,n){return this.cache.diff({query:hw(e),variables:n,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,n){return Ki(this,arguments,void 0,function(r,i,s,o,a,l){var u,d,h,p,g,y,b,_,w,O,N;return s===void 0&&(s={}),o===void 0&&(o={}),a===void 0&&(a=function(){return!0}),l===void 0&&(l=!1),Ji(this,function(I){return u=so(r),d=xl(r),h=kl(d),p=this.collectSelectionsToResolve(u,h),g=u.operation,y=g?g.charAt(0).toUpperCase()+g.slice(1):"Query",b=this,_=b.cache,w=b.client,O={fragmentMap:h,context:C(C({},s),{cache:_,client:w}),variables:o,fragmentMatcher:a,defaultOperationType:y,exportedVariables:{},selectionsToResolve:p,onlyRunForcedResolvers:l},N=!1,[2,this.resolveSelectionSet(u.selectionSet,N,i,O).then(function(P){return{result:P,exportedVariables:O.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,n,r,i){return Ki(this,void 0,void 0,function(){var s,o,a,l,u,d=this;return Ji(this,function(h){return s=i.fragmentMap,o=i.context,a=i.variables,l=[r],u=function(p){return Ki(d,void 0,void 0,function(){var g,y;return Ji(this,function(b){return!n&&!i.selectionsToResolve.has(p)?[2]:ra(p,a)?ki(p)?[2,this.resolveField(p,n,r,i).then(function(_){var w;typeof _<"u"&&l.push((w={},w[Oi(p)]=_,w))})]:(zE(p)?g=p:(g=s[p.name.value],se(g,18,p.name.value)),g&&g.typeCondition&&(y=g.typeCondition.name.value,i.fragmentMatcher(r,y,o))?[2,this.resolveSelectionSet(g.selectionSet,n,r,i).then(function(_){l.push(_)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return aa(l)})]})})},t.prototype.resolveField=function(e,n,r,i){return Ki(this,void 0,void 0,function(){var s,o,a,l,u,d,h,p,g,y=this;return Ji(this,function(b){return r?(s=i.variables,o=e.name.value,a=Oi(e),l=o!==a,u=r[a]||r[o],d=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(h=r.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[h],p&&(g=p[l?o:a],g&&(d=Promise.resolve(jm.withValue(this.cache,g,[r,Il(e,s),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,d.then(function(_){var w,O;if(_===void 0&&(_=u),e.directives&&e.directives.forEach(function(I){I.name.value==="export"&&I.arguments&&I.arguments.forEach(function(P){P.name.value==="as"&&P.value.kind==="StringValue"&&(i.exportedVariables[P.value.value]=_)})}),!e.selectionSet||_==null)return _;var N=(O=(w=e.directives)===null||w===void 0?void 0:w.some(function(I){return I.name.value==="client"}))!==null&&O!==void 0?O:!1;if(Array.isArray(_))return y.resolveSubSelectedArray(e,n||N,_,i);if(e.selectionSet)return y.resolveSelectionSet(e.selectionSet,n||N,_,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,n,r,i){var s=this;return Promise.all(r.map(function(o){if(o===null)return null;if(Array.isArray(o))return s.resolveSubSelectedArray(e,n,o,i);if(e.selectionSet)return s.resolveSelectionSet(e.selectionSet,n,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,n){var r=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function s(o){if(!i.has(o)){var a=new Set;i.set(o,a),en(o,{Directive:function(l,u,d,h,p){l.name.value==="client"&&p.forEach(function(g){r(g)&&Op(g)&&a.add(g)})},FragmentSpread:function(l,u,d,h,p){var g=n[l.name.value];se(g,19,l.name.value);var y=s(g);y.size>0&&(p.forEach(function(b){r(b)&&Op(b)&&a.add(b)}),a.add(l),y.forEach(function(b){a.add(b)}))}})}return i.get(o)}return s(e)},t}(),TT=!1,df=function(){function t(e){var n=this,r;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw Sn(15);var i=e.uri,s=e.credentials,o=e.headers,a=e.cache,l=e.documentTransform,u=e.ssrMode,d=u===void 0?!1:u,h=e.ssrForceFetchDelay,p=h===void 0?0:h,g=e.connectToDevTools,y=e.queryDeduplication,b=y===void 0?!0:y,_=e.defaultOptions,w=e.defaultContext,O=e.assumeImmutableResults,N=O===void 0?a.assumeImmutableResults:O,I=e.resolvers,P=e.typeDefs,R=e.fragmentMatcher,B=e.name,Q=e.version,x=e.devtools,U=e.link;U||(U=i?new rf({uri:i,credentials:s,headers:o}):Nn.empty()),this.link=U,this.cache=a,this.disableNetworkFetches=d||p>0,this.queryDeduplication=b,this.defaultOptions=_||Object.create(null),this.typeDefs=P,this.devtoolsConfig=C(C({},x),{enabled:(r=x==null?void 0:x.enabled)!==null&&r!==void 0?r:g}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=globalThis.__DEV__!==!1),p&&setTimeout(function(){return n.disableNetworkFetches=!1},p),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=Vh,this.localState=new yF({cache:a,client:this,resolvers:I,fragmentMatcher:R}),this.queryManager=new gF({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:w,documentTransform:l,queryDeduplication:b,ssrMode:d,clientAwareness:{name:B,version:Q},localState:this.localState,assumeImmutableResults:N,onBroadcast:this.devtoolsConfig.enabled?function(){n.devToolsHookCb&&n.devToolsHookCb({action:{},state:{queries:n.queryManager.getQueryStore(),mutations:n.queryManager.mutationStore||{}},dataWithOptimisticResults:n.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return t.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var e=window,n=Symbol.for("apollo.devtools");(e[n]=e[n]||[]).push(this),e.__APOLLO_CLIENT__=this,!TT&&globalThis.__DEV__!==!1&&(TT=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var r=window.navigator,i=r&&r.userAgent,s=void 0;typeof i=="string"&&(i.indexOf("Chrome/")>-1?s="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":i.indexOf("Firefox/")>-1&&(s="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),s&&globalThis.__DEV__!==!1&&se.log("Download the Apollo DevTools for a better development experience: %s",s)}},1e4))}},Object.defineProperty(t.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=oi(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=oi(this.defaultOptions.query,e)),se(e.fetchPolicy!=="cache-and-network",16),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=oi(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,n){return n===void 0&&(n=!1),this.cache.readQuery(e,n)},t.prototype.watchFragment=function(e){return this.cache.watchFragment(e)},t.prototype.readFragment=function(e,n){return n===void 0&&(n=!1),this.cache.readFragment(e,n)},t.prototype.writeQuery=function(e){var n=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),n},t.prototype.writeFragment=function(e){var n=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),n},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return jl(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(n){return n()}))}).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(n){return n()}))})},t.prototype.onResetStore=function(e){var n=this;return this.resetStoreCallbacks.push(e),function(){n.resetStoreCallbacks=n.resetStoreCallbacks.filter(function(r){return r!==e})}},t.prototype.onClearStore=function(e){var n=this;return this.clearStoreCallbacks.push(e),function(){n.clearStoreCallbacks=n.clearStoreCallbacks.filter(function(r){return r!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var n=this.queryManager.refetchQueries(e),r=[],i=[];n.forEach(function(o,a){r.push(a),i.push(o)});var s=Promise.all(i);return s.queries=r,s.results=i,s.catch(function(o){globalThis.__DEV__!==!1&&se.debug(17,o)}),s},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},Object.defineProperty(t.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),t}();globalThis.__DEV__!==!1&&(df.prototype.getMemoryInternals=pR);var hf=new Map,Zm=new Map,ST=!0,pf=!1;function OT(t){return t.replace(/[\s,]+/g," ").trim()}function vF(t){return OT(t.source.body.substring(t.start,t.end))}function bF(t){var e=new Set,n=[];return t.definitions.forEach(function(r){if(r.kind==="FragmentDefinition"){var i=r.name.value,s=vF(r.loc),o=Zm.get(i);o&&!o.has(s)?ST&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
184
184
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
185
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Zm.set(i,o=new Set),o.add(s),e.has(s)||(e.add(s),n.push(r))}else n.push(r)}),C(C({},t),{definitions:n})}function _F(t){var e=new Set(t.definitions);e.forEach(function(r){r.loc&&delete r.loc,Object.keys(r).forEach(function(i){var s=r[i];s&&typeof s=="object"&&e.add(s)})});var n=t.loc;return n&&(delete n.startToken,delete n.endToken),t}function EF(t){var e=OT(t);if(!hf.has(e)){var n=ll(t,{experimentalFragmentVariables:pf,allowLegacyFragmentVariables:pf});if(!n||n.kind!=="Document")throw new Error("Not a valid GraphQL document.");hf.set(e,_F(bF(n)))}return hf.get(e)}function lo(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];typeof t=="string"&&(t=[t]);var r=t[0];return e.forEach(function(i,s){i&&i.kind==="Document"?r+=i.loc.source.body:r+=i,r+=t[s+1]}),EF(r)}function eg(){hf.clear(),Zm.clear()}function tg(){ST=!1}function ng(){pf=!0}function rg(){pf=!1}var Hl={gql:lo,resetCaches:eg,disableFragmentWarnings:tg,enableExperimentalFragmentVariables:ng,disableExperimentalFragmentVariables:rg};(function(t){t.gql=Hl.gql,t.resetCaches=Hl.resetCaches,t.disableFragmentWarnings=Hl.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Hl.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Hl.disableExperimentalFragmentVariables})(lo||(lo={})),lo.default=lo,$h(globalThis.__DEV__!==!1?"log":"silent");const wF=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:of,ApolloClient:df,ApolloError:fn,ApolloLink:Nn,get Cache(){return af},DocumentTransform:Ml,HttpLink:rf,InMemoryCache:Hm,MissingFieldError:lf,get NetworkStatus(){return Qe},Observable:Xe,ObservableQuery:Gl,checkFetcher:Cm,concat:Dw,createHttpLink:Rm,createSignalIfSupported:Lw,defaultDataIdFromObject:cf,defaultPrinter:tf,disableExperimentalFragmentVariables:rg,disableFragmentWarnings:tg,empty:Cw,enableExperimentalFragmentVariables:ng,execute:jl,fallbackHttpConfig:xm,from:km,fromError:$l,fromPromise:Iw,get gql(){return lo},isApolloError:ef,isNetworkRequestSettled:yT,isReference:et,makeReference:Si,makeVar:Bm,mergeOptions:oi,parseAndCheckHttpResponse:Im,resetCaches:eg,rewriteURIForGET:Mm,selectHttpOptionsAndBody:Fw,selectHttpOptionsAndBodyInternal:nf,selectURI:Dm,serializeFetchParameter:Bl,setLogVerbosity:$h,split:Nm,throwServerError:Xu,toPromise:Aw},Symbol.toStringTag,{value:"Module"}));var De=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function TF(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ma(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var kT={exports:{}};(function(t){t.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,t.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,t.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(t.exports,se)})(kT);var X=kT.exports;const ig=aC({__proto__:null,default:TF(X)},[X]);var NT=Lu?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function ga(){ie("createContext"in ig,46);var t=X.createContext[NT];return t||(Object.defineProperty(X.createContext,NT,{value:t=X.createContext({}),enumerable:!1,writable:!1,configurable:!0}),t.displayName="ApolloContext"),t}var SF=ga,OF=function(t){var e=ga();return X.createElement(e.Consumer,null,function(n){return ie(n&&n.client,45),t.children(n.client)})},AT=function(t){var e=t.client,n=t.children,r=ga(),i=X.useContext(r),s=X.useMemo(function(){return C(C({},i),{client:e||i.client})},[i,e]);return ie(s.client,47),X.createElement(r.Provider,{value:s},n)};function qn(t){var e=X.useContext(ga()),n=t||e.client;return ie(!!n,50),n}var IT=!1,kF="useSyncExternalStore",NF=ig[kF],Kl=NF||function(t,e,n){var r=e();globalThis.__DEV__!==!1&&!IT&&r!==e()&&(IT=!0,globalThis.__DEV__!==!1&&ie.error(60));var i=X.useState({inst:{value:r,getSnapshot:e}}),s=i[0].inst,o=i[1];return PE?X.useLayoutEffect(function(){Object.assign(s,{value:r,getSnapshot:e}),sg(s)&&o({inst:s})},[t,r,e]):Object.assign(s,{value:r,getSnapshot:e}),X.useEffect(function(){return sg(s)&&o({inst:s}),t(function(){sg(s)&&o({inst:s})})},[t]),r};function sg(t){var e=t.value,n=t.getSnapshot;try{return e!==n()}catch{return!0}}var rr;(function(t){t[t.Query=0]="Query",t[t.Mutation=1]="Mutation",t[t.Subscription=2]="Subscription"})(rr||(rr={}));var co;function og(t){var e;switch(t){case rr.Query:e="Query";break;case rr.Mutation:e="Mutation";break;case rr.Subscription:e="Subscription";break}return e}function ag(t){co||(co=new Vu(zr.parser||1e3));var e=co.get(t);if(e)return e;var n,r,i;ie(!!t&&!!t.kind,62,t);for(var s=[],o=[],a=[],l=[],u=0,d=t.definitions;u<d.length;u++){var h=d[u];if(h.kind==="FragmentDefinition"){s.push(h);continue}if(h.kind==="OperationDefinition")switch(h.operation){case"query":o.push(h);break;case"mutation":a.push(h);break;case"subscription":l.push(h);break}}ie(!s.length||o.length||a.length||l.length,63),ie(o.length+a.length+l.length<=1,64,t,o.length,l.length,a.length),r=o.length?rr.Query:rr.Mutation,!o.length&&!a.length&&(r=rr.Subscription);var p=o.length?o:a.length?a:l;ie(p.length===1,65,t,p.length);var g=p[0];n=g.variableDefinitions||[],g.name&&g.name.kind==="Name"?i=g.name.value:i="data";var y={name:i,type:r,variables:n};return co.set(t,y),y}ag.resetCache=function(){co=void 0},globalThis.__DEV__!==!1&&Yp("parser",function(){return co?co.size:0});function mf(t,e){var n=ag(t),r=og(e),i=og(n.type);ie(n.type===e,66,r,r,i)}function lg(t,e){var n=X.useRef();return(!n.current||!Ue(n.current.deps,e))&&(n.current={value:t(),deps:e}),n.current.value}var gf=Gp?X.useLayoutEffect:X.useEffect,cg;function AF(){}function IF(){return cg||(cg=X.createContext(null)),X.useCallback(function(){var t=console.error;try{return console.error=AF,X.useContext(cg),!0}catch{return!1}finally{console.error=t}},[])}var xF="use",CF=ig[xF],xT=CF||function(e){var n=_m(e);switch(n.status){case"pending":throw n;case"rejected":throw n.reason;case"fulfilled":return n.value}},DF=Symbol.for("apollo.hook.wrappers");function uo(t,e,n){var r=n.queryManager,i=r&&r[DF],s=i&&i[t];return s?s(e):e}var MF=Object.prototype.hasOwnProperty;function CT(){}var yf=Symbol();function vf(t,e){return e===void 0&&(e=Object.create(null)),uo("useQuery",RF,qn(e&&e.client))(t,e)}function RF(t,e){var n=DT(t,e),r=n.result,i=n.obsQueryFields;return X.useMemo(function(){return C(C({},r),i)},[r,i])}function PF(t,e,n,r,i){function s(h){var p;mf(e,rr.Query);var g={client:t,query:e,observable:r&&r.getSSRObservable(i())||t.watchQuery(ug(void 0,t,n,i())),resultData:{previousData:(p=h==null?void 0:h.resultData.current)===null||p===void 0?void 0:p.data}};return g}var o=X.useState(s),a=o[0],l=o[1];function u(h){var p,g;Object.assign(a.observable,(p={},p[yf]=h,p));var y=a.resultData;l(C(C({},a),{query:h.query,resultData:Object.assign(y,{previousData:((g=y.current)===null||g===void 0?void 0:g.data)||y.previousData,current:void 0})}))}if(t!==a.client||e!==a.query){var d=s(a);return l(d),[d,u]}return[a,u]}function DT(t,e){var n=qn(e.client),r=X.useContext(ga()).renderPromises,i=!!r,s=n.disableNetworkFetches,o=e.ssr!==!1&&!e.skip,a=e.partialRefetch,l=MT(n,t,e,i),u=PF(n,t,e,r,l),d=u[0],h=d.observable,p=d.resultData,g=u[1],y=l(h);$F(p,h,n,e,y);var b=X.useMemo(function(){return BF(h)},[h]);LF(h,r,o);var _=FF(p,h,n,e,y,s,a,i,{onCompleted:e.onCompleted||CT,onError:e.onError||CT});return{result:_,obsQueryFields:b,observable:h,resultData:p,client:n,onQueryExecuted:g}}function FF(t,e,n,r,i,s,o,a,l){var u=X.useRef(l);X.useEffect(function(){u.current=l});var d=(a||s)&&r.ssr===!1&&!r.skip?FT:r.skip||i.fetchPolicy==="standby"?LT:void 0,h=t.previousData,p=X.useMemo(function(){return d&&bf(d,h,e,n)},[n,e,d,h]);return Kl(X.useCallback(function(g){if(a)return function(){};var y=function(){var w=t.current,O=e.getCurrentResult();w&&w.loading===O.loading&&w.networkStatus===O.networkStatus&&Ue(w.data,O.data)||fg(O,t,e,n,o,g,u.current)},b=function(w){if(_.current.unsubscribe(),_.current=e.resubscribeAfterError(y,b),!MF.call(w,"graphQLErrors"))throw w;var O=t.current;(!O||O&&O.loading||!Ue(w,O.error))&&fg({data:O&&O.data,error:w,loading:!1,networkStatus:Qe.error},t,e,n,o,g,u.current)},_={current:e.subscribe(y,b)};return function(){setTimeout(function(){return _.current.unsubscribe()})}},[s,a,e,t,o,n]),function(){return p||RT(t,e,u.current,o,n)},function(){return p||RT(t,e,u.current,o,n)})}function LF(t,e,n){e&&n&&(e.registerSSRObservable(t),t.getCurrentResult().loading&&e.addObservableQueryPromise(t))}function $F(t,e,n,r,i){var s;e[yf]&&!Ue(e[yf],i)&&(e.reobserve(ug(e,n,r,i)),t.previousData=((s=t.current)===null||s===void 0?void 0:s.data)||t.previousData,t.current=void 0),e[yf]=i}function MT(t,e,n,r){n===void 0&&(n={});var i=n.skip;n.ssr,n.onCompleted,n.onError;var s=n.defaultOptions,o=Tn(n,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(a){var l=Object.assign(o,{query:e});return r&&(l.fetchPolicy==="network-only"||l.fetchPolicy==="cache-and-network")&&(l.fetchPolicy="cache-first"),l.variables||(l.variables={}),i?(l.initialFetchPolicy=l.initialFetchPolicy||l.fetchPolicy||dg(s,t.defaultOptions),l.fetchPolicy="standby"):l.fetchPolicy||(l.fetchPolicy=(a==null?void 0:a.options.initialFetchPolicy)||dg(s,t.defaultOptions)),l}}function ug(t,e,n,r){var i=[],s=e.defaultOptions.watchQuery;return s&&i.push(s),n.defaultOptions&&i.push(n.defaultOptions),i.push(us(t&&t.options,r)),i.reduce(oi)}function fg(t,e,n,r,i,s,o){var a=e.current;a&&a.data&&(e.previousData=a.data),!t.error&&Un(t.errors)&&(t.error=new fn({graphQLErrors:t.errors})),e.current=bf(jF(t,n,i),e.previousData,n,r),s(),VF(t,a==null?void 0:a.networkStatus,o)}function VF(t,e,n){if(!t.loading){var r=PT(t);Promise.resolve().then(function(){r?n.onError(r):t.data&&e!==t.networkStatus&&t.networkStatus===Qe.ready&&n.onCompleted(t.data)}).catch(function(i){globalThis.__DEV__!==!1&&ie.warn(i)})}}function RT(t,e,n,r,i){return t.current||fg(e.getCurrentResult(),t,e,i,r,function(){},n),t.current}function dg(t,e){var n;return(t==null?void 0:t.fetchPolicy)||((n=e==null?void 0:e.watchQuery)===null||n===void 0?void 0:n.fetchPolicy)||"cache-first"}function PT(t){return Un(t.errors)?new fn({graphQLErrors:t.errors}):t.error}function bf(t,e,n,r){var i=t.data;t.partial;var s=Tn(t,["data","partial"]),o=C(C({data:i},s),{client:r,observable:n,variables:n.variables,called:t!==FT&&t!==LT,previousData:e});return o}function jF(t,e,n){return t.partial&&n&&!t.loading&&(!t.data||Object.keys(t.data).length===0)&&e.options.fetchPolicy!=="cache-only"?(e.refetch(),C(C({},t),{loading:!0,networkStatus:Qe.refetch})):t}var FT=ua({loading:!0,data:void 0,error:void 0,networkStatus:Qe.loading}),LT=ua({loading:!1,data:void 0,error:void 0,networkStatus:Qe.ready});function BF(t){return{refetch:t.refetch.bind(t),reobserve:t.reobserve.bind(t),fetchMore:t.fetchMore.bind(t),updateQuery:t.updateQuery.bind(t),startPolling:t.startPolling.bind(t),stopPolling:t.stopPolling.bind(t),subscribeToMore:t.subscribeToMore.bind(t)}}var UF=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function hg(t,e){var n,r=X.useRef(),i=X.useRef(),s=X.useRef(),o=oi(e,r.current||{}),a=(n=o==null?void 0:o.query)!==null&&n!==void 0?n:t;i.current=e,s.current=a;var l=C(C({},o),{skip:!r.current}),u=DT(a,l),d=u.obsQueryFields,h=u.result,p=u.client,g=u.resultData,y=u.observable,b=u.onQueryExecuted,_=y.options.initialFetchPolicy||dg(l.defaultOptions,p.defaultOptions),w=X.useReducer(function(Q){return Q+1},0)[1],O=X.useMemo(function(){for(var Q={},x=function(ke){var je=d[ke];Q[ke]=function(){return r.current||(r.current=Object.create(null),w()),je.apply(this,arguments)}},U=0,be=UF;U<be.length;U++){var Oe=be[U];x(Oe)}return Q},[w,d]),N=!!r.current,I=X.useMemo(function(){return C(C(C({},h),O),{called:N})},[h,O,N]),P=X.useCallback(function(Q){r.current=Q?C(C({},Q),{fetchPolicy:Q.fetchPolicy||_}):{fetchPolicy:_};var x=oi(i.current,C({query:s.current},r.current)),U=qF(g,y,p,a,C(C({},x),{skip:!1}),b).then(function(be){return Object.assign(be,O)});return U.catch(function(){}),U},[p,a,O,_,y,g,b]),R=X.useRef(P);gf(function(){R.current=P});var B=X.useCallback(function(){for(var Q=[],x=0;x<arguments.length;x++)Q[x]=arguments[x];return R.current.apply(R,Q)},[]);return[B,I]}function qF(t,e,n,r,i,s){var o=i.query||r,a=MT(n,o,i,!1)(e),l=e.reobserveAsConcast(ug(e,n,i,a));return s(a),new Promise(function(u){var d;l.subscribe({next:function(h){d=h},error:function(){u(bf(e.getCurrentResult(),t.previousData,e,n))},complete:function(){u(bf(d,t.previousData,e,n))}})})}function WF(t,e){var n=qn(e==null?void 0:e.client);mf(t,rr.Mutation);var r=X.useState({called:!1,loading:!1,client:n}),i=r[0],s=r[1],o=X.useRef({result:i,mutationId:0,isMounted:!0,client:n,mutation:t,options:e});gf(function(){Object.assign(o.current,{client:n,options:e,mutation:t})});var a=X.useCallback(function(u){u===void 0&&(u={});var d=o.current,h=d.options,p=d.mutation,g=C(C({},h),{mutation:p}),y=u.client||o.current.client;!o.current.result.loading&&!g.ignoreResults&&o.current.isMounted&&s(o.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:y});var b=++o.current.mutationId,_=oi(g,u);return y.mutate(_).then(function(w){var O,N,I=w.data,P=w.errors,R=P&&P.length>0?new fn({graphQLErrors:P}):void 0,B=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(R&&B&&B(R,_),b===o.current.mutationId&&!_.ignoreResults){var Q={called:!0,loading:!1,data:I,error:R,client:y};o.current.isMounted&&!Ue(o.current.result,Q)&&s(o.current.result=Q)}var x=u.onCompleted||((N=o.current.options)===null||N===void 0?void 0:N.onCompleted);return R||x==null||x(w.data,_),w}).catch(function(w){var O;if(b===o.current.mutationId&&o.current.isMounted){var N={loading:!1,error:w,data:void 0,called:!0,client:y};Ue(o.current.result,N)||s(o.current.result=N)}var I=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(I)return I(w,_),{data:void 0,errors:w};throw w})},[]),l=X.useCallback(function(){if(o.current.isMounted){var u={called:!1,loading:!1,client:o.current.client};Object.assign(o.current,{mutationId:0,result:u}),s(u)}},[]);return X.useEffect(function(){var u=o.current;return u.isMounted=!0,function(){u.isMounted=!1}},[]),[a,C({reset:l},i)]}function zF(t,e){e===void 0&&(e=Object.create(null));var n=X.useRef(!1),r=qn(e.client);mf(t,rr.Subscription),n.current||(n.current=!0,e.onSubscriptionData&&globalThis.__DEV__!==!1&&ie.warn(e.onData?53:54),e.onSubscriptionComplete&&globalThis.__DEV__!==!1&&ie.warn(e.onComplete?55:56));var i=e.skip,s=e.fetchPolicy,o=e.errorPolicy,a=e.shouldResubscribe,l=e.context,u=e.extensions,d=e.ignoreResults,h=lg(function(){return e.variables},[e.variables]),p=function(){return QF(r,t,h,s,o,l,u)},g=X.useState(e.skip?null:p),y=g[0],b=g[1],_=X.useRef(p);gf(function(){_.current=p}),i?y&&b(y=null):(!y||(r!==y.__.client||t!==y.__.query||s!==y.__.fetchPolicy||o!==y.__.errorPolicy||!Ue(h,y.__.variables))&&(typeof a=="function"?!!a(e):a)!==!1)&&b(y=p());var w=X.useRef(e);X.useEffect(function(){w.current=e});var O=!i&&!d,N=X.useMemo(function(){return{loading:O,error:void 0,data:void 0,variables:h}},[O,h]),I=X.useRef(d);gf(function(){I.current=d});var P=Kl(X.useCallback(function(B){if(!y)return function(){};var Q=!1,x=y.__.variables,U=y.__.client,be=y.subscribe({next:function(Oe){var ke,je;if(!Q){var te={loading:!1,data:Oe.data,error:PT(Oe),variables:x};y.__.setResult(te),I.current||B(),te.error?(je=(ke=w.current).onError)===null||je===void 0||je.call(ke,te.error):w.current.onData?w.current.onData({client:U,data:te}):w.current.onSubscriptionData&&w.current.onSubscriptionData({client:U,subscriptionData:te})}},error:function(Oe){var ke,je;Oe=Oe instanceof fn?Oe:new fn({protocolErrors:[Oe]}),Q||(y.__.setResult({loading:!1,data:void 0,error:Oe,variables:x}),I.current||B(),(je=(ke=w.current).onError)===null||je===void 0||je.call(ke,Oe))},complete:function(){Q||(w.current.onComplete?w.current.onComplete():w.current.onSubscriptionComplete&&w.current.onSubscriptionComplete())}});return function(){Q=!0,setTimeout(function(){be.unsubscribe()})}},[y]),function(){return y&&!i&&!d?y.__.result:N},function(){return N}),R=X.useCallback(function(){ie(!w.current.skip,57),b(_.current())},[w,_]);return X.useMemo(function(){return C(C({},P),{restart:R})},[P,R])}function QF(t,e,n,r,i,s,o){var a={query:e,variables:n,fetchPolicy:r,errorPolicy:i,context:s,extensions:o},l=C(C({},a),{client:t,result:{loading:!0,data:void 0,error:void 0,variables:n},setResult:function(d){l.result=d}}),u=null;return Object.assign(new Xe(function(d){u||(u=t.subscribe(a));var h=u.subscribe(d);return function(){return h.unsubscribe()}}),{__:l})}function GF(t){return Kl(X.useCallback(function(e){return t.onNextChange(function n(){e(),t.onNextChange(n)})},[t]),t,t)}function HF(t){return uo("useFragment",KF,qn(t.client))(t)}function KF(t){var e=qn(t.client).cache,n=t.from,r=Tn(t,["from"]),i=X.useMemo(function(){return typeof n=="string"?n:e.identify(n)},[e,n]),s=lg(function(){return C(C({},r),{from:i})},[r,i]),o=X.useMemo(function(){var l=s.fragment,u=s.fragmentName,d=s.from,h=s.optimistic,p=h===void 0?!0:h;return{result:JF(e.diff(C(C({},s),{returnPartialData:!0,id:d,query:e.getFragmentDoc(l,u),optimistic:p})))}},[s,e]),a=X.useCallback(function(){return o.result},[o]);return Kl(X.useCallback(function(l){var u=0,d=e.watchFragment(s).subscribe({next:function(h){Ue(h,o.result)||(o.result=h,clearTimeout(u),u=setTimeout(l))}});return function(){d.unsubscribe(),clearTimeout(u)}},[e,s,o]),a,a)}function JF(t){var e={data:t.result,complete:!!t.complete};return t.missing&&(e.missing=aa(t.missing.map(function(n){return n.missing}))),e}var pg=Symbol(),mg=Symbol();function ai(t){var e,n=(e={toPromise:function(){return yg(n).then(function(){return n})}},e[pg]=t,e[mg]=t.promise,e);return n}function gg(t){ie(!t||pg in t,61)}function yg(t){var e=fo(t);return e.promise.status==="fulfilled"?e.promise:t[mg]}function fo(t){return t[pg]}function Jl(t,e){t[mg]=e}var YF=["canonizeResults","context","errorPolicy","fetchPolicy","refetchWritePolicy","returnPartialData"],$T=function(){function t(e,n){var r=this;this.key={},this.listeners=new Set,this.references=0,this.softReferences=0,this.handleNext=this.handleNext.bind(this),this.handleError=this.handleError.bind(this),this.dispose=this.dispose.bind(this),this.observable=e,n.onDispose&&(this.onDispose=n.onDispose),this.setResult(),this.subscribeToQuery();var i=function(){var s;r.references||(r.autoDisposeTimeoutId=setTimeout(r.dispose,(s=n.autoDisposeTimeoutMs)!==null&&s!==void 0?s:3e4))};this.promise.then(i,i)}return Object.defineProperty(t.prototype,"disposed",{get:function(){return this.subscription.closed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"watchQueryOptions",{get:function(){return this.observable.options},enumerable:!1,configurable:!0}),t.prototype.reinitialize=function(){var e=this.observable,n=this.watchQueryOptions.fetchPolicy,r=n==="no-cache"||n==="standby";try{if(r?e.silentSetOptions({fetchPolicy:"standby"}):(e.resetLastResults(),e.silentSetOptions({fetchPolicy:"cache-first"})),this.subscribeToQuery(),r)return;e.resetDiff(),this.setResult()}finally{e.silentSetOptions({fetchPolicy:n})}},t.prototype.retain=function(){var e=this;this.references++,clearTimeout(this.autoDisposeTimeoutId);var n=!1;return function(){n||(n=!0,e.references--,setTimeout(function(){e.references||e.dispose()}))}},t.prototype.softRetain=function(){var e=this;this.softReferences++;var n=!1;return function(){n||(n=!0,e.softReferences--,setTimeout(function(){!e.softReferences&&!e.references&&e.dispose()}))}},t.prototype.didChangeOptions=function(e){var n=this;return YF.some(function(r){return r in e&&!Ue(n.watchQueryOptions[r],e[r])})},t.prototype.applyOptions=function(e){var n=this.watchQueryOptions,r=n.fetchPolicy,i=n.canonizeResults;return r==="standby"&&r!==e.fetchPolicy?this.initiateFetch(this.observable.reobserve(e)):(this.observable.silentSetOptions(e),i!==e.canonizeResults&&(this.result=C(C({},this.result),this.observable.getCurrentResult()),this.promise=Ku(this.result))),this.promise},t.prototype.listen=function(e){var n=this;return this.listeners.add(e),function(){n.listeners.delete(e)}},t.prototype.refetch=function(e){return this.initiateFetch(this.observable.refetch(e))},t.prototype.fetchMore=function(e){return this.initiateFetch(this.observable.fetchMore(e))},t.prototype.dispose=function(){this.subscription.unsubscribe(),this.onDispose()},t.prototype.onDispose=function(){},t.prototype.handleNext=function(e){var n;switch(this.promise.status){case"pending":{e.data===void 0&&(e.data=this.result.data),this.result=e,(n=this.resolve)===null||n===void 0||n.call(this,e);break}default:{if(e.data===this.result.data&&e.networkStatus===this.result.networkStatus)return;e.data===void 0&&(e.data=this.result.data),this.result=e,this.promise=Ku(e),this.deliver(this.promise);break}}},t.prototype.handleError=function(e){var n;switch(this.subscription.unsubscribe(),this.subscription=this.observable.resubscribeAfterError(this.handleNext,this.handleError),this.promise.status){case"pending":{(n=this.reject)===null||n===void 0||n.call(this,e);break}default:this.promise=Ew(e),this.deliver(this.promise)}},t.prototype.deliver=function(e){this.listeners.forEach(function(n){return n(e)})},t.prototype.initiateFetch=function(e){var n=this;return this.promise=this.createPendingPromise(),this.promise.catch(function(){}),e.then(function(){setTimeout(function(){var r;n.promise.status==="pending"&&(n.result=n.observable.getCurrentResult(),(r=n.resolve)===null||r===void 0||r.call(n,n.result))})}).catch(function(r){var i;return(i=n.reject)===null||i===void 0?void 0:i.call(n,r)}),e},t.prototype.subscribeToQuery=function(){var e=this;this.subscription=this.observable.filter(function(n){return!Ue(n.data,{})&&!Ue(n,e.result)}).subscribe(this.handleNext,this.handleError)},t.prototype.setResult=function(){var e=this.observable.getCurrentResult(!1);Ue(e,this.result)||(this.result=e,this.promise=e.data&&(!e.partial||this.watchQueryOptions.returnPartialData)?Ku(e):this.createPendingPromise())},t.prototype.createPendingPromise=function(){var e=this;return _m(new Promise(function(n,r){e.resolve=n,e.reject=r}))},t}(),XF=function(){function t(e){e===void 0&&(e=Object.create(null)),this.queryRefs=new eo(as),this.options=e}return t.prototype.getQueryRef=function(e,n){var r=this.queryRefs.lookupArray(e);return r.current||(r.current=new $T(n(),{autoDisposeTimeoutMs:this.options.autoDisposeTimeoutMs,onDispose:function(){delete r.current}})),r.current},t.prototype.add=function(e,n){var r=this.queryRefs.lookupArray(e);r.current=n},t}(),vg=Symbol.for("apollo.suspenseCache");function bg(t){var e;return t[vg]||(t[vg]=new XF((e=t.defaultOptions.react)===null||e===void 0?void 0:e.suspense)),t[vg]}var VT=Symbol.for("apollo.skipToken");function ZF(t,e){return e===void 0&&(e=Object.create(null)),uo("useSuspenseQuery",eL,qn(typeof e=="object"?e.client:void 0))(t,e)}function eL(t,e){var n=qn(e.client),r=bg(n),i=Eg({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=wt([t,_r(o)],[].concat(l),!0),d=r.getQueryRef(u,function(){return n.watchQuery(i)}),h=X.useState([d.key,d.promise]),p=h[0],g=h[1];p[0]!==d.key&&(p[0]=d.key,p[1]=d.promise);var y=p[1];d.didChangeOptions(i)&&(p[1]=y=d.applyOptions(i)),X.useEffect(function(){var I=d.retain(),P=d.listen(function(R){g([d.key,R])});return function(){P(),I()}},[d]);var b=X.useMemo(function(){var I=_g(d.result);return{loading:!1,data:d.result.data,networkStatus:I?Qe.error:Qe.ready,error:I}},[d.result]),_=s==="standby"?b:xT(y),w=X.useCallback(function(I){var P=d.fetchMore(I);return g([d.key,d.promise]),P},[d]),O=X.useCallback(function(I){var P=d.refetch(I);return g([d.key,d.promise]),P},[d]),N=d.observable.subscribeToMore;return X.useMemo(function(){return{client:n,data:_.data,error:_g(_),networkStatus:_.networkStatus,fetchMore:w,refetch:O,subscribeToMore:N}},[n,w,O,_,N])}function tL(t){var e=t.query,n=t.fetchPolicy,r=t.returnPartialData;mf(e,rr.Query),nL(n),rL(n,r)}function nL(t){t===void 0&&(t="cache-first");var e=["cache-first","network-only","no-cache","cache-and-network"];ie(e.includes(t),58,t)}function rL(t,e){t==="no-cache"&&e&&globalThis.__DEV__!==!1&&ie.warn(59)}function _g(t){return Un(t.errors)?new fn({graphQLErrors:t.errors}):t.error}function Eg(t){var e=t.client,n=t.query,r=t.options;return lg(function(){var i;if(r===VT)return{query:n,fetchPolicy:"standby"};var s=r.fetchPolicy||((i=e.defaultOptions.watchQuery)===null||i===void 0?void 0:i.fetchPolicy)||"cache-first",o=C(C({},r),{fetchPolicy:s,query:n,notifyOnNetworkStatusChange:!1,nextFetchPolicy:void 0});return globalThis.__DEV__!==!1&&tL(o),r.skip&&(o.fetchPolicy="standby"),o},[e,r,n])}function iL(t,e){return e===void 0&&(e=Object.create(null)),uo("useBackgroundQuery",sL,qn(typeof e=="object"?e.client:void 0))(t,e)}function sL(t,e){var n=qn(e.client),r=bg(n),i=Eg({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=X.useRef(s!=="standby");u.current||(u.current=s!=="standby");var d=wt([t,_r(o)],[].concat(l),!0),h=r.getQueryRef(d,function(){return n.watchQuery(i)}),p=X.useState(ai(h)),g=p[0],y=p[1];if(fo(g)!==h&&y(ai(h)),h.didChangeOptions(i)){var b=h.applyOptions(i);Jl(g,b)}X.useEffect(function(){var O=setTimeout(function(){h.disposed&&r.add(d,h)});return function(){return clearTimeout(O)}});var _=X.useCallback(function(O){var N=h.fetchMore(O);return y(ai(h)),N},[h]),w=X.useCallback(function(O){var N=h.refetch(O);return y(ai(h)),N},[h]);return X.useEffect(function(){return h.softRetain()},[h]),[u.current?g:void 0,{fetchMore:_,refetch:w,subscribeToMore:h.observable.subscribeToMore}]}function oL(t,e){e===void 0&&(e=Object.create(null));var n=qn(e.client),r=bg(n),i=Eg({client:n,query:t,options:e}),s=e.queryKey,o=s===void 0?[]:s,a=X.useState(null),l=a[0],u=a[1];gg(l);var d=l&&fo(l);if(l&&(d!=null&&d.didChangeOptions(i))){var h=d.applyOptions(i);Jl(l,h)}var p=IF(),g=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.fetchMore(O);return u(ai(d)),N},[d]),y=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.refetch(O);return u(ai(d)),N},[d]),b=X.useCallback(function(){for(var O=[],N=0;N<arguments.length;N++)O[N]=arguments[N];ie(!p(),51);var I=O[0],P=wt([t,_r(I)],[].concat(o),!0),R=r.getQueryRef(P,function(){return n.watchQuery(C(C({},i),{variables:I}))});u(ai(R))},[t,o,r,i,p,n]),_=X.useCallback(function(O){return ie(d,52),d.observable.subscribeToMore(O)},[d]),w=X.useCallback(function(){u(null)},[]);return[b,l,{fetchMore:g,refetch:y,reset:w,subscribeToMore:_}]}function aL(t){var e=fo(t);return uo("useQueryRefHandlers",lL,e?e.observable:qn())(t)}function lL(t){gg(t);var e=X.useState(t),n=e[0],r=e[1],i=X.useState(t),s=i[0],o=i[1],a=fo(t);n!==t?(r(t),o(t)):Jl(t,yg(s));var l=X.useCallback(function(d){var h=a.refetch(d);return o(ai(a)),h},[a]),u=X.useCallback(function(d){var h=a.fetchMore(d);return o(ai(a)),h},[a]);return{refetch:l,fetchMore:u,subscribeToMore:a.observable.subscribeToMore}}function cL(t){var e=fo(t);return uo("useReadQuery",uL,e?e.observable:qn())(t)}function uL(t){gg(t);var e=X.useMemo(function(){return fo(t)},[t]),n=X.useCallback(function(){return yg(t)},[t]);e.disposed&&(e.reinitialize(),Jl(t,e.promise)),X.useEffect(function(){return e.retain()},[e]);var r=Kl(X.useCallback(function(s){return e.listen(function(o){Jl(t,o),s()})},[e,t]),n,n),i=xT(r);return X.useMemo(function(){return{data:i.data,networkStatus:i.networkStatus,error:_g(i)}},[i])}function fL(t){return uo("createQueryPreloader",dL,t)(t)}var dL=function(t){return function(n,r){var i,s;r===void 0&&(r=Object.create(null));var o=new $T(t.watchQuery(C(C({},r),{query:n})),{autoDisposeTimeoutMs:(s=(i=t.defaultOptions.react)===null||i===void 0?void 0:i.suspense)===null||s===void 0?void 0:s.autoDisposeTimeoutMs});return ai(o)}};const hL=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:of,ApolloClient:df,ApolloConsumer:OF,ApolloError:fn,ApolloLink:Nn,ApolloProvider:AT,get Cache(){return af},DocumentTransform:Ml,get DocumentType(){return rr},HttpLink:rf,InMemoryCache:Hm,MissingFieldError:lf,get NetworkStatus(){return Qe},Observable:Xe,ObservableQuery:Gl,checkFetcher:Cm,concat:Dw,createHttpLink:Rm,createQueryPreloader:fL,createSignalIfSupported:Lw,defaultDataIdFromObject:cf,defaultPrinter:tf,disableExperimentalFragmentVariables:rg,disableFragmentWarnings:tg,empty:Cw,enableExperimentalFragmentVariables:ng,execute:jl,fallbackHttpConfig:xm,from:km,fromError:$l,fromPromise:Iw,getApolloContext:ga,get gql(){return lo},isApolloError:ef,isNetworkRequestSettled:yT,isReference:et,makeReference:Si,makeVar:Bm,mergeOptions:oi,operationName:og,parseAndCheckHttpResponse:Im,parser:ag,resetApolloContext:SF,resetCaches:eg,rewriteURIForGET:Mm,selectHttpOptionsAndBody:Fw,selectHttpOptionsAndBodyInternal:nf,selectURI:Dm,serializeFetchParameter:Bl,setLogVerbosity:$h,skipToken:VT,split:Nm,throwServerError:Xu,toPromise:Aw,useApolloClient:qn,useBackgroundQuery:iL,useFragment:HF,useLazyQuery:hg,useLoadableQuery:oL,useMutation:WF,useQuery:vf,useQueryRefHandlers:aL,useReactiveVar:GF,useReadQuery:cL,useSubscription:zF,useSuspenseQuery:ZF},Symbol.toStringTag,{value:"Module"})),pL=(t,e)=>{const{data:n,loading:r,refetch:i,fetchMore:s}=vf(t,{...e,notifyOnNetworkStatusChange:!0,variables:{...e==null?void 0:e.variables,page:{first:(e==null?void 0:e.pageSize)??100}}}),o=t.definitions[0].selectionSet.selections[0].name.value;return{data:n,loading:r,loadNextPage:a=>{const l=n==null?void 0:n[o];if(l!=null&&l.pageInfo.hasNextPage)return i({...e==null?void 0:e.variables,...a,page:{first:(e==null?void 0:e.pageSize)??100,after:l.pageInfo.endCursor}})},loadNextPageWithoutAppendingOldData:a=>{const l=n==null?void 0:n[o];return s({variables:{...e==null?void 0:e.variables,...a,page:{first:(e==null?void 0:e.pageSize)??100,after:l==null?void 0:l.pageInfo.endCursor}}})}}},wg=(t,e)=>{const[n,r]=se.useState(!(e!=null&&e.skip)),[i,s]=se.useState([]),[o]=hg(t,e),a=async l=>{var g;const u=t.definitions[0].selectionSet.selections[0].name.value;r(!0);let d=!0,h=null;const p=[];for(;d;){const{data:y,error:b}=await o({variables:{...e==null?void 0:e.variables,...l,page:{first:100,after:h}}});if(b)throw b;const _=y==null?void 0:y[u];_&&(p.push(..._.nodes??[]),d=_.pageInfo.hasNextPage,h=_.pageInfo.endCursor)}return s(p),(g=e==null?void 0:e.onResults)==null||g.call(e,p),r(!1),p};return se.useEffect(()=>{e!=null&&e.skip||a()},[e==null?void 0:e.skip]),{loading:n,results:i,refetch:a}};var Tg={exports:{}},Yl={};/**
|
|
185
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Zm.set(i,o=new Set),o.add(s),e.has(s)||(e.add(s),n.push(r))}else n.push(r)}),C(C({},t),{definitions:n})}function _F(t){var e=new Set(t.definitions);e.forEach(function(r){r.loc&&delete r.loc,Object.keys(r).forEach(function(i){var s=r[i];s&&typeof s=="object"&&e.add(s)})});var n=t.loc;return n&&(delete n.startToken,delete n.endToken),t}function EF(t){var e=OT(t);if(!hf.has(e)){var n=ll(t,{experimentalFragmentVariables:pf,allowLegacyFragmentVariables:pf});if(!n||n.kind!=="Document")throw new Error("Not a valid GraphQL document.");hf.set(e,_F(bF(n)))}return hf.get(e)}function lo(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];typeof t=="string"&&(t=[t]);var r=t[0];return e.forEach(function(i,s){i&&i.kind==="Document"?r+=i.loc.source.body:r+=i,r+=t[s+1]}),EF(r)}function eg(){hf.clear(),Zm.clear()}function tg(){ST=!1}function ng(){pf=!0}function rg(){pf=!1}var Hl={gql:lo,resetCaches:eg,disableFragmentWarnings:tg,enableExperimentalFragmentVariables:ng,disableExperimentalFragmentVariables:rg};(function(t){t.gql=Hl.gql,t.resetCaches=Hl.resetCaches,t.disableFragmentWarnings=Hl.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Hl.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Hl.disableExperimentalFragmentVariables})(lo||(lo={})),lo.default=lo,$h(globalThis.__DEV__!==!1?"log":"silent");const wF=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:of,ApolloClient:df,ApolloError:fn,ApolloLink:Nn,get Cache(){return af},DocumentTransform:Ml,HttpLink:rf,InMemoryCache:Hm,MissingFieldError:lf,get NetworkStatus(){return Qe},Observable:Xe,ObservableQuery:Gl,checkFetcher:Cm,concat:Dw,createHttpLink:Rm,createSignalIfSupported:Lw,defaultDataIdFromObject:cf,defaultPrinter:tf,disableExperimentalFragmentVariables:rg,disableFragmentWarnings:tg,empty:Cw,enableExperimentalFragmentVariables:ng,execute:jl,fallbackHttpConfig:xm,from:km,fromError:$l,fromPromise:Iw,get gql(){return lo},isApolloError:ef,isNetworkRequestSettled:yT,isReference:et,makeReference:Si,makeVar:Bm,mergeOptions:oi,parseAndCheckHttpResponse:Im,resetCaches:eg,rewriteURIForGET:Mm,selectHttpOptionsAndBody:Fw,selectHttpOptionsAndBodyInternal:nf,selectURI:Dm,serializeFetchParameter:Bl,setLogVerbosity:$h,split:Nm,throwServerError:Xu,toPromise:Aw},Symbol.toStringTag,{value:"Module"}));var De=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function TF(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ma(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var kT={exports:{}};(function(t){t.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,t.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,t.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(t.exports,ie)})(kT);var X=kT.exports;const ig=aC({__proto__:null,default:TF(X)},[X]);var NT=Lu?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function ga(){se("createContext"in ig,46);var t=X.createContext[NT];return t||(Object.defineProperty(X.createContext,NT,{value:t=X.createContext({}),enumerable:!1,writable:!1,configurable:!0}),t.displayName="ApolloContext"),t}var SF=ga,OF=function(t){var e=ga();return X.createElement(e.Consumer,null,function(n){return se(n&&n.client,45),t.children(n.client)})},AT=function(t){var e=t.client,n=t.children,r=ga(),i=X.useContext(r),s=X.useMemo(function(){return C(C({},i),{client:e||i.client})},[i,e]);return se(s.client,47),X.createElement(r.Provider,{value:s},n)};function qn(t){var e=X.useContext(ga()),n=t||e.client;return se(!!n,50),n}var IT=!1,kF="useSyncExternalStore",NF=ig[kF],Kl=NF||function(t,e,n){var r=e();globalThis.__DEV__!==!1&&!IT&&r!==e()&&(IT=!0,globalThis.__DEV__!==!1&&se.error(60));var i=X.useState({inst:{value:r,getSnapshot:e}}),s=i[0].inst,o=i[1];return PE?X.useLayoutEffect(function(){Object.assign(s,{value:r,getSnapshot:e}),sg(s)&&o({inst:s})},[t,r,e]):Object.assign(s,{value:r,getSnapshot:e}),X.useEffect(function(){return sg(s)&&o({inst:s}),t(function(){sg(s)&&o({inst:s})})},[t]),r};function sg(t){var e=t.value,n=t.getSnapshot;try{return e!==n()}catch{return!0}}var rr;(function(t){t[t.Query=0]="Query",t[t.Mutation=1]="Mutation",t[t.Subscription=2]="Subscription"})(rr||(rr={}));var co;function og(t){var e;switch(t){case rr.Query:e="Query";break;case rr.Mutation:e="Mutation";break;case rr.Subscription:e="Subscription";break}return e}function ag(t){co||(co=new Vu(zr.parser||1e3));var e=co.get(t);if(e)return e;var n,r,i;se(!!t&&!!t.kind,62,t);for(var s=[],o=[],a=[],l=[],u=0,d=t.definitions;u<d.length;u++){var h=d[u];if(h.kind==="FragmentDefinition"){s.push(h);continue}if(h.kind==="OperationDefinition")switch(h.operation){case"query":o.push(h);break;case"mutation":a.push(h);break;case"subscription":l.push(h);break}}se(!s.length||o.length||a.length||l.length,63),se(o.length+a.length+l.length<=1,64,t,o.length,l.length,a.length),r=o.length?rr.Query:rr.Mutation,!o.length&&!a.length&&(r=rr.Subscription);var p=o.length?o:a.length?a:l;se(p.length===1,65,t,p.length);var g=p[0];n=g.variableDefinitions||[],g.name&&g.name.kind==="Name"?i=g.name.value:i="data";var y={name:i,type:r,variables:n};return co.set(t,y),y}ag.resetCache=function(){co=void 0},globalThis.__DEV__!==!1&&Yp("parser",function(){return co?co.size:0});function mf(t,e){var n=ag(t),r=og(e),i=og(n.type);se(n.type===e,66,r,r,i)}function lg(t,e){var n=X.useRef();return(!n.current||!Ue(n.current.deps,e))&&(n.current={value:t(),deps:e}),n.current.value}var gf=Gp?X.useLayoutEffect:X.useEffect,cg;function AF(){}function IF(){return cg||(cg=X.createContext(null)),X.useCallback(function(){var t=console.error;try{return console.error=AF,X.useContext(cg),!0}catch{return!1}finally{console.error=t}},[])}var xF="use",CF=ig[xF],xT=CF||function(e){var n=_m(e);switch(n.status){case"pending":throw n;case"rejected":throw n.reason;case"fulfilled":return n.value}},DF=Symbol.for("apollo.hook.wrappers");function uo(t,e,n){var r=n.queryManager,i=r&&r[DF],s=i&&i[t];return s?s(e):e}var MF=Object.prototype.hasOwnProperty;function CT(){}var yf=Symbol();function vf(t,e){return e===void 0&&(e=Object.create(null)),uo("useQuery",RF,qn(e&&e.client))(t,e)}function RF(t,e){var n=DT(t,e),r=n.result,i=n.obsQueryFields;return X.useMemo(function(){return C(C({},r),i)},[r,i])}function PF(t,e,n,r,i){function s(h){var p;mf(e,rr.Query);var g={client:t,query:e,observable:r&&r.getSSRObservable(i())||t.watchQuery(ug(void 0,t,n,i())),resultData:{previousData:(p=h==null?void 0:h.resultData.current)===null||p===void 0?void 0:p.data}};return g}var o=X.useState(s),a=o[0],l=o[1];function u(h){var p,g;Object.assign(a.observable,(p={},p[yf]=h,p));var y=a.resultData;l(C(C({},a),{query:h.query,resultData:Object.assign(y,{previousData:((g=y.current)===null||g===void 0?void 0:g.data)||y.previousData,current:void 0})}))}if(t!==a.client||e!==a.query){var d=s(a);return l(d),[d,u]}return[a,u]}function DT(t,e){var n=qn(e.client),r=X.useContext(ga()).renderPromises,i=!!r,s=n.disableNetworkFetches,o=e.ssr!==!1&&!e.skip,a=e.partialRefetch,l=MT(n,t,e,i),u=PF(n,t,e,r,l),d=u[0],h=d.observable,p=d.resultData,g=u[1],y=l(h);$F(p,h,n,e,y);var b=X.useMemo(function(){return BF(h)},[h]);LF(h,r,o);var _=FF(p,h,n,e,y,s,a,i,{onCompleted:e.onCompleted||CT,onError:e.onError||CT});return{result:_,obsQueryFields:b,observable:h,resultData:p,client:n,onQueryExecuted:g}}function FF(t,e,n,r,i,s,o,a,l){var u=X.useRef(l);X.useEffect(function(){u.current=l});var d=(a||s)&&r.ssr===!1&&!r.skip?FT:r.skip||i.fetchPolicy==="standby"?LT:void 0,h=t.previousData,p=X.useMemo(function(){return d&&bf(d,h,e,n)},[n,e,d,h]);return Kl(X.useCallback(function(g){if(a)return function(){};var y=function(){var w=t.current,O=e.getCurrentResult();w&&w.loading===O.loading&&w.networkStatus===O.networkStatus&&Ue(w.data,O.data)||fg(O,t,e,n,o,g,u.current)},b=function(w){if(_.current.unsubscribe(),_.current=e.resubscribeAfterError(y,b),!MF.call(w,"graphQLErrors"))throw w;var O=t.current;(!O||O&&O.loading||!Ue(w,O.error))&&fg({data:O&&O.data,error:w,loading:!1,networkStatus:Qe.error},t,e,n,o,g,u.current)},_={current:e.subscribe(y,b)};return function(){setTimeout(function(){return _.current.unsubscribe()})}},[s,a,e,t,o,n]),function(){return p||RT(t,e,u.current,o,n)},function(){return p||RT(t,e,u.current,o,n)})}function LF(t,e,n){e&&n&&(e.registerSSRObservable(t),t.getCurrentResult().loading&&e.addObservableQueryPromise(t))}function $F(t,e,n,r,i){var s;e[yf]&&!Ue(e[yf],i)&&(e.reobserve(ug(e,n,r,i)),t.previousData=((s=t.current)===null||s===void 0?void 0:s.data)||t.previousData,t.current=void 0),e[yf]=i}function MT(t,e,n,r){n===void 0&&(n={});var i=n.skip;n.ssr,n.onCompleted,n.onError;var s=n.defaultOptions,o=Tn(n,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(a){var l=Object.assign(o,{query:e});return r&&(l.fetchPolicy==="network-only"||l.fetchPolicy==="cache-and-network")&&(l.fetchPolicy="cache-first"),l.variables||(l.variables={}),i?(l.initialFetchPolicy=l.initialFetchPolicy||l.fetchPolicy||dg(s,t.defaultOptions),l.fetchPolicy="standby"):l.fetchPolicy||(l.fetchPolicy=(a==null?void 0:a.options.initialFetchPolicy)||dg(s,t.defaultOptions)),l}}function ug(t,e,n,r){var i=[],s=e.defaultOptions.watchQuery;return s&&i.push(s),n.defaultOptions&&i.push(n.defaultOptions),i.push(us(t&&t.options,r)),i.reduce(oi)}function fg(t,e,n,r,i,s,o){var a=e.current;a&&a.data&&(e.previousData=a.data),!t.error&&Un(t.errors)&&(t.error=new fn({graphQLErrors:t.errors})),e.current=bf(jF(t,n,i),e.previousData,n,r),s(),VF(t,a==null?void 0:a.networkStatus,o)}function VF(t,e,n){if(!t.loading){var r=PT(t);Promise.resolve().then(function(){r?n.onError(r):t.data&&e!==t.networkStatus&&t.networkStatus===Qe.ready&&n.onCompleted(t.data)}).catch(function(i){globalThis.__DEV__!==!1&&se.warn(i)})}}function RT(t,e,n,r,i){return t.current||fg(e.getCurrentResult(),t,e,i,r,function(){},n),t.current}function dg(t,e){var n;return(t==null?void 0:t.fetchPolicy)||((n=e==null?void 0:e.watchQuery)===null||n===void 0?void 0:n.fetchPolicy)||"cache-first"}function PT(t){return Un(t.errors)?new fn({graphQLErrors:t.errors}):t.error}function bf(t,e,n,r){var i=t.data;t.partial;var s=Tn(t,["data","partial"]),o=C(C({data:i},s),{client:r,observable:n,variables:n.variables,called:t!==FT&&t!==LT,previousData:e});return o}function jF(t,e,n){return t.partial&&n&&!t.loading&&(!t.data||Object.keys(t.data).length===0)&&e.options.fetchPolicy!=="cache-only"?(e.refetch(),C(C({},t),{loading:!0,networkStatus:Qe.refetch})):t}var FT=ua({loading:!0,data:void 0,error:void 0,networkStatus:Qe.loading}),LT=ua({loading:!1,data:void 0,error:void 0,networkStatus:Qe.ready});function BF(t){return{refetch:t.refetch.bind(t),reobserve:t.reobserve.bind(t),fetchMore:t.fetchMore.bind(t),updateQuery:t.updateQuery.bind(t),startPolling:t.startPolling.bind(t),stopPolling:t.stopPolling.bind(t),subscribeToMore:t.subscribeToMore.bind(t)}}var UF=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function hg(t,e){var n,r=X.useRef(),i=X.useRef(),s=X.useRef(),o=oi(e,r.current||{}),a=(n=o==null?void 0:o.query)!==null&&n!==void 0?n:t;i.current=e,s.current=a;var l=C(C({},o),{skip:!r.current}),u=DT(a,l),d=u.obsQueryFields,h=u.result,p=u.client,g=u.resultData,y=u.observable,b=u.onQueryExecuted,_=y.options.initialFetchPolicy||dg(l.defaultOptions,p.defaultOptions),w=X.useReducer(function(Q){return Q+1},0)[1],O=X.useMemo(function(){for(var Q={},x=function(ke){var je=d[ke];Q[ke]=function(){return r.current||(r.current=Object.create(null),w()),je.apply(this,arguments)}},U=0,be=UF;U<be.length;U++){var Oe=be[U];x(Oe)}return Q},[w,d]),N=!!r.current,I=X.useMemo(function(){return C(C(C({},h),O),{called:N})},[h,O,N]),P=X.useCallback(function(Q){r.current=Q?C(C({},Q),{fetchPolicy:Q.fetchPolicy||_}):{fetchPolicy:_};var x=oi(i.current,C({query:s.current},r.current)),U=qF(g,y,p,a,C(C({},x),{skip:!1}),b).then(function(be){return Object.assign(be,O)});return U.catch(function(){}),U},[p,a,O,_,y,g,b]),R=X.useRef(P);gf(function(){R.current=P});var B=X.useCallback(function(){for(var Q=[],x=0;x<arguments.length;x++)Q[x]=arguments[x];return R.current.apply(R,Q)},[]);return[B,I]}function qF(t,e,n,r,i,s){var o=i.query||r,a=MT(n,o,i,!1)(e),l=e.reobserveAsConcast(ug(e,n,i,a));return s(a),new Promise(function(u){var d;l.subscribe({next:function(h){d=h},error:function(){u(bf(e.getCurrentResult(),t.previousData,e,n))},complete:function(){u(bf(d,t.previousData,e,n))}})})}function WF(t,e){var n=qn(e==null?void 0:e.client);mf(t,rr.Mutation);var r=X.useState({called:!1,loading:!1,client:n}),i=r[0],s=r[1],o=X.useRef({result:i,mutationId:0,isMounted:!0,client:n,mutation:t,options:e});gf(function(){Object.assign(o.current,{client:n,options:e,mutation:t})});var a=X.useCallback(function(u){u===void 0&&(u={});var d=o.current,h=d.options,p=d.mutation,g=C(C({},h),{mutation:p}),y=u.client||o.current.client;!o.current.result.loading&&!g.ignoreResults&&o.current.isMounted&&s(o.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:y});var b=++o.current.mutationId,_=oi(g,u);return y.mutate(_).then(function(w){var O,N,I=w.data,P=w.errors,R=P&&P.length>0?new fn({graphQLErrors:P}):void 0,B=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(R&&B&&B(R,_),b===o.current.mutationId&&!_.ignoreResults){var Q={called:!0,loading:!1,data:I,error:R,client:y};o.current.isMounted&&!Ue(o.current.result,Q)&&s(o.current.result=Q)}var x=u.onCompleted||((N=o.current.options)===null||N===void 0?void 0:N.onCompleted);return R||x==null||x(w.data,_),w}).catch(function(w){var O;if(b===o.current.mutationId&&o.current.isMounted){var N={loading:!1,error:w,data:void 0,called:!0,client:y};Ue(o.current.result,N)||s(o.current.result=N)}var I=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(I)return I(w,_),{data:void 0,errors:w};throw w})},[]),l=X.useCallback(function(){if(o.current.isMounted){var u={called:!1,loading:!1,client:o.current.client};Object.assign(o.current,{mutationId:0,result:u}),s(u)}},[]);return X.useEffect(function(){var u=o.current;return u.isMounted=!0,function(){u.isMounted=!1}},[]),[a,C({reset:l},i)]}function zF(t,e){e===void 0&&(e=Object.create(null));var n=X.useRef(!1),r=qn(e.client);mf(t,rr.Subscription),n.current||(n.current=!0,e.onSubscriptionData&&globalThis.__DEV__!==!1&&se.warn(e.onData?53:54),e.onSubscriptionComplete&&globalThis.__DEV__!==!1&&se.warn(e.onComplete?55:56));var i=e.skip,s=e.fetchPolicy,o=e.errorPolicy,a=e.shouldResubscribe,l=e.context,u=e.extensions,d=e.ignoreResults,h=lg(function(){return e.variables},[e.variables]),p=function(){return QF(r,t,h,s,o,l,u)},g=X.useState(e.skip?null:p),y=g[0],b=g[1],_=X.useRef(p);gf(function(){_.current=p}),i?y&&b(y=null):(!y||(r!==y.__.client||t!==y.__.query||s!==y.__.fetchPolicy||o!==y.__.errorPolicy||!Ue(h,y.__.variables))&&(typeof a=="function"?!!a(e):a)!==!1)&&b(y=p());var w=X.useRef(e);X.useEffect(function(){w.current=e});var O=!i&&!d,N=X.useMemo(function(){return{loading:O,error:void 0,data:void 0,variables:h}},[O,h]),I=X.useRef(d);gf(function(){I.current=d});var P=Kl(X.useCallback(function(B){if(!y)return function(){};var Q=!1,x=y.__.variables,U=y.__.client,be=y.subscribe({next:function(Oe){var ke,je;if(!Q){var te={loading:!1,data:Oe.data,error:PT(Oe),variables:x};y.__.setResult(te),I.current||B(),te.error?(je=(ke=w.current).onError)===null||je===void 0||je.call(ke,te.error):w.current.onData?w.current.onData({client:U,data:te}):w.current.onSubscriptionData&&w.current.onSubscriptionData({client:U,subscriptionData:te})}},error:function(Oe){var ke,je;Oe=Oe instanceof fn?Oe:new fn({protocolErrors:[Oe]}),Q||(y.__.setResult({loading:!1,data:void 0,error:Oe,variables:x}),I.current||B(),(je=(ke=w.current).onError)===null||je===void 0||je.call(ke,Oe))},complete:function(){Q||(w.current.onComplete?w.current.onComplete():w.current.onSubscriptionComplete&&w.current.onSubscriptionComplete())}});return function(){Q=!0,setTimeout(function(){be.unsubscribe()})}},[y]),function(){return y&&!i&&!d?y.__.result:N},function(){return N}),R=X.useCallback(function(){se(!w.current.skip,57),b(_.current())},[w,_]);return X.useMemo(function(){return C(C({},P),{restart:R})},[P,R])}function QF(t,e,n,r,i,s,o){var a={query:e,variables:n,fetchPolicy:r,errorPolicy:i,context:s,extensions:o},l=C(C({},a),{client:t,result:{loading:!0,data:void 0,error:void 0,variables:n},setResult:function(d){l.result=d}}),u=null;return Object.assign(new Xe(function(d){u||(u=t.subscribe(a));var h=u.subscribe(d);return function(){return h.unsubscribe()}}),{__:l})}function GF(t){return Kl(X.useCallback(function(e){return t.onNextChange(function n(){e(),t.onNextChange(n)})},[t]),t,t)}function HF(t){return uo("useFragment",KF,qn(t.client))(t)}function KF(t){var e=qn(t.client).cache,n=t.from,r=Tn(t,["from"]),i=X.useMemo(function(){return typeof n=="string"?n:e.identify(n)},[e,n]),s=lg(function(){return C(C({},r),{from:i})},[r,i]),o=X.useMemo(function(){var l=s.fragment,u=s.fragmentName,d=s.from,h=s.optimistic,p=h===void 0?!0:h;return{result:JF(e.diff(C(C({},s),{returnPartialData:!0,id:d,query:e.getFragmentDoc(l,u),optimistic:p})))}},[s,e]),a=X.useCallback(function(){return o.result},[o]);return Kl(X.useCallback(function(l){var u=0,d=e.watchFragment(s).subscribe({next:function(h){Ue(h,o.result)||(o.result=h,clearTimeout(u),u=setTimeout(l))}});return function(){d.unsubscribe(),clearTimeout(u)}},[e,s,o]),a,a)}function JF(t){var e={data:t.result,complete:!!t.complete};return t.missing&&(e.missing=aa(t.missing.map(function(n){return n.missing}))),e}var pg=Symbol(),mg=Symbol();function ai(t){var e,n=(e={toPromise:function(){return yg(n).then(function(){return n})}},e[pg]=t,e[mg]=t.promise,e);return n}function gg(t){se(!t||pg in t,61)}function yg(t){var e=fo(t);return e.promise.status==="fulfilled"?e.promise:t[mg]}function fo(t){return t[pg]}function Jl(t,e){t[mg]=e}var YF=["canonizeResults","context","errorPolicy","fetchPolicy","refetchWritePolicy","returnPartialData"],$T=function(){function t(e,n){var r=this;this.key={},this.listeners=new Set,this.references=0,this.softReferences=0,this.handleNext=this.handleNext.bind(this),this.handleError=this.handleError.bind(this),this.dispose=this.dispose.bind(this),this.observable=e,n.onDispose&&(this.onDispose=n.onDispose),this.setResult(),this.subscribeToQuery();var i=function(){var s;r.references||(r.autoDisposeTimeoutId=setTimeout(r.dispose,(s=n.autoDisposeTimeoutMs)!==null&&s!==void 0?s:3e4))};this.promise.then(i,i)}return Object.defineProperty(t.prototype,"disposed",{get:function(){return this.subscription.closed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"watchQueryOptions",{get:function(){return this.observable.options},enumerable:!1,configurable:!0}),t.prototype.reinitialize=function(){var e=this.observable,n=this.watchQueryOptions.fetchPolicy,r=n==="no-cache"||n==="standby";try{if(r?e.silentSetOptions({fetchPolicy:"standby"}):(e.resetLastResults(),e.silentSetOptions({fetchPolicy:"cache-first"})),this.subscribeToQuery(),r)return;e.resetDiff(),this.setResult()}finally{e.silentSetOptions({fetchPolicy:n})}},t.prototype.retain=function(){var e=this;this.references++,clearTimeout(this.autoDisposeTimeoutId);var n=!1;return function(){n||(n=!0,e.references--,setTimeout(function(){e.references||e.dispose()}))}},t.prototype.softRetain=function(){var e=this;this.softReferences++;var n=!1;return function(){n||(n=!0,e.softReferences--,setTimeout(function(){!e.softReferences&&!e.references&&e.dispose()}))}},t.prototype.didChangeOptions=function(e){var n=this;return YF.some(function(r){return r in e&&!Ue(n.watchQueryOptions[r],e[r])})},t.prototype.applyOptions=function(e){var n=this.watchQueryOptions,r=n.fetchPolicy,i=n.canonizeResults;return r==="standby"&&r!==e.fetchPolicy?this.initiateFetch(this.observable.reobserve(e)):(this.observable.silentSetOptions(e),i!==e.canonizeResults&&(this.result=C(C({},this.result),this.observable.getCurrentResult()),this.promise=Ku(this.result))),this.promise},t.prototype.listen=function(e){var n=this;return this.listeners.add(e),function(){n.listeners.delete(e)}},t.prototype.refetch=function(e){return this.initiateFetch(this.observable.refetch(e))},t.prototype.fetchMore=function(e){return this.initiateFetch(this.observable.fetchMore(e))},t.prototype.dispose=function(){this.subscription.unsubscribe(),this.onDispose()},t.prototype.onDispose=function(){},t.prototype.handleNext=function(e){var n;switch(this.promise.status){case"pending":{e.data===void 0&&(e.data=this.result.data),this.result=e,(n=this.resolve)===null||n===void 0||n.call(this,e);break}default:{if(e.data===this.result.data&&e.networkStatus===this.result.networkStatus)return;e.data===void 0&&(e.data=this.result.data),this.result=e,this.promise=Ku(e),this.deliver(this.promise);break}}},t.prototype.handleError=function(e){var n;switch(this.subscription.unsubscribe(),this.subscription=this.observable.resubscribeAfterError(this.handleNext,this.handleError),this.promise.status){case"pending":{(n=this.reject)===null||n===void 0||n.call(this,e);break}default:this.promise=Ew(e),this.deliver(this.promise)}},t.prototype.deliver=function(e){this.listeners.forEach(function(n){return n(e)})},t.prototype.initiateFetch=function(e){var n=this;return this.promise=this.createPendingPromise(),this.promise.catch(function(){}),e.then(function(){setTimeout(function(){var r;n.promise.status==="pending"&&(n.result=n.observable.getCurrentResult(),(r=n.resolve)===null||r===void 0||r.call(n,n.result))})}).catch(function(r){var i;return(i=n.reject)===null||i===void 0?void 0:i.call(n,r)}),e},t.prototype.subscribeToQuery=function(){var e=this;this.subscription=this.observable.filter(function(n){return!Ue(n.data,{})&&!Ue(n,e.result)}).subscribe(this.handleNext,this.handleError)},t.prototype.setResult=function(){var e=this.observable.getCurrentResult(!1);Ue(e,this.result)||(this.result=e,this.promise=e.data&&(!e.partial||this.watchQueryOptions.returnPartialData)?Ku(e):this.createPendingPromise())},t.prototype.createPendingPromise=function(){var e=this;return _m(new Promise(function(n,r){e.resolve=n,e.reject=r}))},t}(),XF=function(){function t(e){e===void 0&&(e=Object.create(null)),this.queryRefs=new eo(as),this.options=e}return t.prototype.getQueryRef=function(e,n){var r=this.queryRefs.lookupArray(e);return r.current||(r.current=new $T(n(),{autoDisposeTimeoutMs:this.options.autoDisposeTimeoutMs,onDispose:function(){delete r.current}})),r.current},t.prototype.add=function(e,n){var r=this.queryRefs.lookupArray(e);r.current=n},t}(),vg=Symbol.for("apollo.suspenseCache");function bg(t){var e;return t[vg]||(t[vg]=new XF((e=t.defaultOptions.react)===null||e===void 0?void 0:e.suspense)),t[vg]}var VT=Symbol.for("apollo.skipToken");function ZF(t,e){return e===void 0&&(e=Object.create(null)),uo("useSuspenseQuery",eL,qn(typeof e=="object"?e.client:void 0))(t,e)}function eL(t,e){var n=qn(e.client),r=bg(n),i=Eg({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=wt([t,_r(o)],[].concat(l),!0),d=r.getQueryRef(u,function(){return n.watchQuery(i)}),h=X.useState([d.key,d.promise]),p=h[0],g=h[1];p[0]!==d.key&&(p[0]=d.key,p[1]=d.promise);var y=p[1];d.didChangeOptions(i)&&(p[1]=y=d.applyOptions(i)),X.useEffect(function(){var I=d.retain(),P=d.listen(function(R){g([d.key,R])});return function(){P(),I()}},[d]);var b=X.useMemo(function(){var I=_g(d.result);return{loading:!1,data:d.result.data,networkStatus:I?Qe.error:Qe.ready,error:I}},[d.result]),_=s==="standby"?b:xT(y),w=X.useCallback(function(I){var P=d.fetchMore(I);return g([d.key,d.promise]),P},[d]),O=X.useCallback(function(I){var P=d.refetch(I);return g([d.key,d.promise]),P},[d]),N=d.observable.subscribeToMore;return X.useMemo(function(){return{client:n,data:_.data,error:_g(_),networkStatus:_.networkStatus,fetchMore:w,refetch:O,subscribeToMore:N}},[n,w,O,_,N])}function tL(t){var e=t.query,n=t.fetchPolicy,r=t.returnPartialData;mf(e,rr.Query),nL(n),rL(n,r)}function nL(t){t===void 0&&(t="cache-first");var e=["cache-first","network-only","no-cache","cache-and-network"];se(e.includes(t),58,t)}function rL(t,e){t==="no-cache"&&e&&globalThis.__DEV__!==!1&&se.warn(59)}function _g(t){return Un(t.errors)?new fn({graphQLErrors:t.errors}):t.error}function Eg(t){var e=t.client,n=t.query,r=t.options;return lg(function(){var i;if(r===VT)return{query:n,fetchPolicy:"standby"};var s=r.fetchPolicy||((i=e.defaultOptions.watchQuery)===null||i===void 0?void 0:i.fetchPolicy)||"cache-first",o=C(C({},r),{fetchPolicy:s,query:n,notifyOnNetworkStatusChange:!1,nextFetchPolicy:void 0});return globalThis.__DEV__!==!1&&tL(o),r.skip&&(o.fetchPolicy="standby"),o},[e,r,n])}function iL(t,e){return e===void 0&&(e=Object.create(null)),uo("useBackgroundQuery",sL,qn(typeof e=="object"?e.client:void 0))(t,e)}function sL(t,e){var n=qn(e.client),r=bg(n),i=Eg({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=X.useRef(s!=="standby");u.current||(u.current=s!=="standby");var d=wt([t,_r(o)],[].concat(l),!0),h=r.getQueryRef(d,function(){return n.watchQuery(i)}),p=X.useState(ai(h)),g=p[0],y=p[1];if(fo(g)!==h&&y(ai(h)),h.didChangeOptions(i)){var b=h.applyOptions(i);Jl(g,b)}X.useEffect(function(){var O=setTimeout(function(){h.disposed&&r.add(d,h)});return function(){return clearTimeout(O)}});var _=X.useCallback(function(O){var N=h.fetchMore(O);return y(ai(h)),N},[h]),w=X.useCallback(function(O){var N=h.refetch(O);return y(ai(h)),N},[h]);return X.useEffect(function(){return h.softRetain()},[h]),[u.current?g:void 0,{fetchMore:_,refetch:w,subscribeToMore:h.observable.subscribeToMore}]}function oL(t,e){e===void 0&&(e=Object.create(null));var n=qn(e.client),r=bg(n),i=Eg({client:n,query:t,options:e}),s=e.queryKey,o=s===void 0?[]:s,a=X.useState(null),l=a[0],u=a[1];gg(l);var d=l&&fo(l);if(l&&(d!=null&&d.didChangeOptions(i))){var h=d.applyOptions(i);Jl(l,h)}var p=IF(),g=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.fetchMore(O);return u(ai(d)),N},[d]),y=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.refetch(O);return u(ai(d)),N},[d]),b=X.useCallback(function(){for(var O=[],N=0;N<arguments.length;N++)O[N]=arguments[N];se(!p(),51);var I=O[0],P=wt([t,_r(I)],[].concat(o),!0),R=r.getQueryRef(P,function(){return n.watchQuery(C(C({},i),{variables:I}))});u(ai(R))},[t,o,r,i,p,n]),_=X.useCallback(function(O){return se(d,52),d.observable.subscribeToMore(O)},[d]),w=X.useCallback(function(){u(null)},[]);return[b,l,{fetchMore:g,refetch:y,reset:w,subscribeToMore:_}]}function aL(t){var e=fo(t);return uo("useQueryRefHandlers",lL,e?e.observable:qn())(t)}function lL(t){gg(t);var e=X.useState(t),n=e[0],r=e[1],i=X.useState(t),s=i[0],o=i[1],a=fo(t);n!==t?(r(t),o(t)):Jl(t,yg(s));var l=X.useCallback(function(d){var h=a.refetch(d);return o(ai(a)),h},[a]),u=X.useCallback(function(d){var h=a.fetchMore(d);return o(ai(a)),h},[a]);return{refetch:l,fetchMore:u,subscribeToMore:a.observable.subscribeToMore}}function cL(t){var e=fo(t);return uo("useReadQuery",uL,e?e.observable:qn())(t)}function uL(t){gg(t);var e=X.useMemo(function(){return fo(t)},[t]),n=X.useCallback(function(){return yg(t)},[t]);e.disposed&&(e.reinitialize(),Jl(t,e.promise)),X.useEffect(function(){return e.retain()},[e]);var r=Kl(X.useCallback(function(s){return e.listen(function(o){Jl(t,o),s()})},[e,t]),n,n),i=xT(r);return X.useMemo(function(){return{data:i.data,networkStatus:i.networkStatus,error:_g(i)}},[i])}function fL(t){return uo("createQueryPreloader",dL,t)(t)}var dL=function(t){return function(n,r){var i,s;r===void 0&&(r=Object.create(null));var o=new $T(t.watchQuery(C(C({},r),{query:n})),{autoDisposeTimeoutMs:(s=(i=t.defaultOptions.react)===null||i===void 0?void 0:i.suspense)===null||s===void 0?void 0:s.autoDisposeTimeoutMs});return ai(o)}};const hL=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:of,ApolloClient:df,ApolloConsumer:OF,ApolloError:fn,ApolloLink:Nn,ApolloProvider:AT,get Cache(){return af},DocumentTransform:Ml,get DocumentType(){return rr},HttpLink:rf,InMemoryCache:Hm,MissingFieldError:lf,get NetworkStatus(){return Qe},Observable:Xe,ObservableQuery:Gl,checkFetcher:Cm,concat:Dw,createHttpLink:Rm,createQueryPreloader:fL,createSignalIfSupported:Lw,defaultDataIdFromObject:cf,defaultPrinter:tf,disableExperimentalFragmentVariables:rg,disableFragmentWarnings:tg,empty:Cw,enableExperimentalFragmentVariables:ng,execute:jl,fallbackHttpConfig:xm,from:km,fromError:$l,fromPromise:Iw,getApolloContext:ga,get gql(){return lo},isApolloError:ef,isNetworkRequestSettled:yT,isReference:et,makeReference:Si,makeVar:Bm,mergeOptions:oi,operationName:og,parseAndCheckHttpResponse:Im,parser:ag,resetApolloContext:SF,resetCaches:eg,rewriteURIForGET:Mm,selectHttpOptionsAndBody:Fw,selectHttpOptionsAndBodyInternal:nf,selectURI:Dm,serializeFetchParameter:Bl,setLogVerbosity:$h,skipToken:VT,split:Nm,throwServerError:Xu,toPromise:Aw,useApolloClient:qn,useBackgroundQuery:iL,useFragment:HF,useLazyQuery:hg,useLoadableQuery:oL,useMutation:WF,useQuery:vf,useQueryRefHandlers:aL,useReactiveVar:GF,useReadQuery:cL,useSubscription:zF,useSuspenseQuery:ZF},Symbol.toStringTag,{value:"Module"})),pL=(t,e)=>{const{data:n,loading:r,refetch:i,fetchMore:s}=vf(t,{...e,notifyOnNetworkStatusChange:!0,variables:{...e==null?void 0:e.variables,page:{first:(e==null?void 0:e.pageSize)??100}}}),o=t.definitions[0].selectionSet.selections[0].name.value;return{data:n,loading:r,loadNextPage:a=>{const l=n==null?void 0:n[o];if(l!=null&&l.pageInfo.hasNextPage)return i({...e==null?void 0:e.variables,...a,page:{first:(e==null?void 0:e.pageSize)??100,after:l.pageInfo.endCursor}})},loadNextPageWithoutAppendingOldData:a=>{const l=n==null?void 0:n[o];return s({variables:{...e==null?void 0:e.variables,...a,page:{first:(e==null?void 0:e.pageSize)??100,after:l==null?void 0:l.pageInfo.endCursor}}})}}},wg=(t,e)=>{const[n,r]=ie.useState(!(e!=null&&e.skip)),[i,s]=ie.useState([]),[o]=hg(t,e),a=async l=>{var g;const u=t.definitions[0].selectionSet.selections[0].name.value;r(!0);let d=!0,h=null;const p=[];for(;d;){const{data:y,error:b}=await o({variables:{...e==null?void 0:e.variables,...l,page:{first:100,after:h}}});if(b)throw b;const _=y==null?void 0:y[u];_&&(p.push(..._.nodes??[]),d=_.pageInfo.hasNextPage,h=_.pageInfo.endCursor)}return s(p),(g=e==null?void 0:e.onResults)==null||g.call(e,p),r(!1),p};return ie.useEffect(()=>{e!=null&&e.skip||a()},[e==null?void 0:e.skip]),{loading:n,results:i,refetch:a}};var Tg={exports:{}},Yl={};/**
|
|
186
186
|
* @license React
|
|
187
187
|
* react-jsx-runtime.production.js
|
|
188
188
|
*
|
|
@@ -212,8 +212,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
212
212
|
|
|
213
213
|
Check the render method of \``+le+"`."),ae||(M=t(M))&&(ae=`
|
|
214
214
|
|
|
215
|
-
Check the top-level render call using <`+M+">."),ae}var N=se,I=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),U=Symbol.for("react.context"),be=Symbol.for("react.forward_ref"),Oe=Symbol.for("react.suspense"),ke=Symbol.for("react.suspense_list"),je=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),xe=Symbol.for("react.offscreen"),fe=Symbol.iterator,Ee=Symbol.for("react.client.reference"),ye=N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ut=Object.prototype.hasOwnProperty,ve=Object.assign,$=Symbol.for("react.client.reference"),Z=Array.isArray,Y=0,ee,we,Pe,Ze,ln,Fs,Kr;r.__reactDisabledLog=!0;var $t,Vc,Pn=!1,$i=new(typeof WeakMap=="function"?WeakMap:Map),Zv=Symbol.for("react.client.reference"),xr,jc={},Qd={},Ls={};Xl.Fragment=R,Xl.jsx=function(M,ae,le,nt,At){return y(M,ae,le,!1,nt,At)},Xl.jsxs=function(M,ae,le,nt,At){return y(M,ae,le,!0,nt,At)}}()),Xl}process.env.NODE_ENV==="production"?Tg.exports=mL():Tg.exports=gL();var he=Tg.exports;let ya=class{open(e){window.location.href=e}reload(){window.location.reload()}getCurrentHref(){return window.location.href}getPath(){const e=window.location;return e.pathname+(e.search||"")+(e.hash||"")}getOrigin(){return window.origin}};const UT=2e3,va=console;class yL{constructor(e,n,r,i=UT,s=!0){this._callback=e,this._client_id=n,this._url=r,this._interval=i||UT,this._stopOnError=s;const o=r.indexOf("/",r.indexOf("//")+2);this._frame_origin=r.substring(0,o),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.width=0,this._frame.height=0,this._frame.src=r}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1)})}_message(e){e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&(e.data==="error"?(va.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):e.data==="changed"?(va.debug(e),va.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):va.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))}start(e){va.debug("CheckSessionIFrame.start :"+e),this.stop();const n=()=>{this._frame.contentWindow.postMessage(this._client_id+" "+e,this._frame_origin)};n(),this._timer=window.setInterval(n,this._interval)}stop(){this._timer&&(va.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)}}const qe={service_worker_not_supported_by_browser:"service_worker_not_supported_by_browser",token_acquired:"token_acquired",logout_from_another_tab:"logout_from_another_tab",logout_from_same_tab:"logout_from_same_tab",token_renewed:"token_renewed",token_timer:"token_timer",loginAsync_begin:"loginAsync_begin",loginAsync_error:"loginAsync_error",loginCallbackAsync_begin:"loginCallbackAsync_begin",loginCallbackAsync_end:"loginCallbackAsync_end",loginCallbackAsync_error:"loginCallbackAsync_error",refreshTokensAsync_begin:"refreshTokensAsync_begin",refreshTokensAsync:"refreshTokensAsync",refreshTokensAsync_end:"refreshTokensAsync_end",refreshTokensAsync_error:"refreshTokensAsync_error",refreshTokensAsync_silent_error:"refreshTokensAsync_silent_error",tryKeepExistingSessionAsync_begin:"tryKeepExistingSessionAsync_begin",tryKeepExistingSessionAsync_end:"tryKeepExistingSessionAsync_end",tryKeepExistingSessionAsync_error:"tryKeepExistingSessionAsync_error",silentLoginAsync_begin:"silentLoginAsync_begin",silentLoginAsync:"silentLoginAsync",silentLoginAsync_end:"silentLoginAsync_end",silentLoginAsync_error:"silentLoginAsync_error",syncTokensAsync_begin:"syncTokensAsync_begin",syncTokensAsync_lock_not_available:"syncTokensAsync_lock_not_available",syncTokensAsync_end:"syncTokensAsync_end",syncTokensAsync_error:"syncTokensAsync_error",tokensInvalidAndWaitingActionsToRefresh:"tokensInvalidAndWaitingActionsToRefresh"},Er=(t,e=sessionStorage)=>{const n=b=>(e[`oidc.${t}`]=JSON.stringify({tokens:null,status:b}),Promise.resolve()),r=async()=>{if(!e[`oidc.${t}`])return e[`oidc.${t}`]=JSON.stringify({tokens:null,status:null}),{tokens:null,status:null};const b=JSON.parse(e[`oidc.${t}`]);return Promise.resolve({tokens:b.tokens,status:b.status})},i=b=>{e[`oidc.${t}`]=JSON.stringify({tokens:b})},s=async b=>{e[`oidc.session_state.${t}`]=b},o=async()=>e[`oidc.session_state.${t}`],a=b=>{e[`oidc.nonce.${t}`]=b.nonce},l=b=>{e[`oidc.jwk.${t}`]=JSON.stringify(b)},u=()=>JSON.parse(e[`oidc.jwk.${t}`]),d=async()=>({nonce:e[`oidc.nonce.${t}`]}),h=async b=>{e[`oidc.dpop_nonce.${t}`]=b},p=()=>e[`oidc.dpop_nonce.${t}`],g=()=>e[`oidc.${t}`]?JSON.stringify({tokens:JSON.parse(e[`oidc.${t}`]).tokens}):null,y={};return{clearAsync:n,initAsync:r,setTokens:i,getTokens:g,setSessionStateAsync:s,getSessionStateAsync:o,setNonceAsync:a,getNonceAsync:d,setLoginParams:b=>{y[t]=b,e[`oidc.login.${t}`]=JSON.stringify(b)},getLoginParams:()=>{const b=e[`oidc.login.${t}`];return b?(y[t]||(y[t]=JSON.parse(b)),y[t]):(console.warn(`storage[oidc.login.${t}] is empty, you should have an bad OIDC or code configuration somewhere.`),null)},getStateAsync:async()=>e[`oidc.state.${t}`],setStateAsync:async b=>{e[`oidc.state.${t}`]=b},getCodeVerifierAsync:async()=>e[`oidc.code_verifier.${t}`],setCodeVerifierAsync:async b=>{e[`oidc.code_verifier.${t}`]=b},setDemonstratingProofOfPossessionNonce:h,getDemonstratingProofOfPossessionNonce:p,setDemonstratingProofOfPossessionJwkAsync:l,getDemonstratingProofOfPossessionJwkAsync:u}};var Zl=(t=>(t.AutomaticBeforeTokenExpiration="AutomaticBeforeTokensExpiration",t.AutomaticOnlyWhenFetchExecuted="AutomaticOnlyWhenFetchExecuted",t))(Zl||{});const vL=t=>decodeURIComponent(Array.prototype.map.call(atob(t),e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")),bL=t=>JSON.parse(vL(t.replaceAll(/-/g,"+").replaceAll(/_/g,"/"))),qT=t=>{try{return t&&_L(t,".")===2?bL(t.split(".")[1]):null}catch(e){console.warn(e)}return null},_L=(t,e)=>t.split(e).length-1,Sg={access_token_or_id_token_invalid:"access_token_or_id_token_invalid",access_token_invalid:"access_token_invalid",id_token_invalid:"id_token_invalid"};function EL(t,e,n){if(t.issuedAt){if(typeof t.issuedAt=="string")return parseInt(t.issuedAt,10)}else return e&&e.iat?e.iat:n&&n.iat?n.iat:new Date().getTime()/1e3;return t.issuedAt}const Og=(t,e=null,n)=>{if(!t)return null;let r;const i=typeof t.expiresIn=="string"?parseInt(t.expiresIn,10):t.expiresIn;t.accessTokenPayload!==void 0?r=t.accessTokenPayload:r=qT(t.accessToken);let s;e!=null&&"idToken"in e&&!("idToken"in t)?s=e.idToken:s=t.idToken;const o=t.idTokenPayload?t.idTokenPayload:qT(s),a=o&&o.exp?o.exp:Number.MAX_VALUE,l=r&&r.exp?r.exp:t.issuedAt+i;t.issuedAt=EL(t,r,o);let u;t.expiresAt?u=t.expiresAt:n===Sg.access_token_invalid?u=l:n===Sg.id_token_invalid?u=a:u=a<l?a:l;const d={...t,idTokenPayload:o,accessTokenPayload:r,expiresAt:u,idToken:s};if(e!=null&&"refreshToken"in e&&!("refreshToken"in t)){const h=e.refreshToken;return{...d,refreshToken:h}}return d},kg=(t,e,n)=>{if(!t)return null;if(!t.issued_at){const i=new Date().getTime()/1e3;t.issued_at=i}const r={accessToken:t.access_token,expiresIn:t.expires_in,idToken:t.id_token,scope:t.scope,tokenType:t.token_type,issuedAt:t.issued_at};return"refresh_token"in t&&(r.refreshToken=t.refresh_token),t.accessTokenPayload!==void 0&&(r.accessTokenPayload=t.accessTokenPayload),t.idTokenPayload!==void 0&&(r.idTokenPayload=t.idTokenPayload),Og(r,e,n)},ec=(t,e)=>{const n=new Date().getTime()/1e3,r=e-n;return Math.round(r-t)},WT=(t,e=0)=>t?ec(e,t.expiresAt)>0:!1,zT=async(t,e=200,n=50)=>{let r=n;if(!t.getTokens())return null;for(;!WT(t.getTokens(),t.configuration.refresh_time_before_tokens_expiration_in_second)&&r>0;){if(t.configuration.token_automatic_renew_mode==Zl.AutomaticOnlyWhenFetchExecuted){await t.renewTokensAsync({});break}else await Ef({milliseconds:e});r=r-1}return{isTokensValid:WT(t.getTokens()),tokens:t.getTokens(),numberWaited:r-n}},QT=(t,e,n)=>{if(t.idTokenPayload){const r=t.idTokenPayload;if(n.issuer!==r.iss)return{isValid:!1,reason:`Issuer does not match (oidcServerConfiguration issuer) ${n.issuer} !== (idTokenPayload issuer) ${r.iss}`};const i=new Date().getTime()/1e3;if(r.exp&&r.exp<i)return{isValid:!1,reason:`Token expired (idTokenPayload exp) ${r.exp} < (currentTimeUnixSecond) ${i}`};const s=60*60*24*7;if(r.iat&&r.iat+s<i)return{isValid:!1,reason:`Token is used from too long time (idTokenPayload iat + timeInSevenDays) ${r.iat+s} < (currentTimeUnixSecond) ${i}`};if(r.nonce&&r.nonce!==e)return{isValid:!1,reason:`Nonce does not match (idTokenPayload nonce) ${r.nonce} !== (nonce) ${e}`}}return{isValid:!0,reason:""}},ba=function(){const t=typeof window>"u"?global:window;return{setTimeout:setTimeout.bind(t),clearTimeout:clearTimeout.bind(t),setInterval:setInterval.bind(t),clearInterval:clearInterval.bind(t)}}(),GT="7.22.32";let HT=null,_f;const Ef=({milliseconds:t})=>new Promise(e=>ba.setTimeout(e,t)),KT=(t="/")=>{try{_f=new AbortController,fetch(`${t}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`,{signal:_f.signal}).catch(e=>{console.log(e)}),Ef({milliseconds:150*1e3}).then(KT)}catch(e){console.log(e)}},JT=()=>{_f&&_f.abort()},wL=(t="/")=>fetch(`${t}OidcKeepAliveServiceWorker.json`,{headers:{"oidc-vanilla":"true"}}).then(e=>e.statusText==="oidc-service-worker").catch(e=>{console.log(e)}),TL=t=>async(e,n)=>{n(),await e.update();const r=await e.unregister();console.log(`Service worker unregistration ${r?"successful":"failed"}`),await Ef({milliseconds:2e3}),t.reload()},SL=t=>{const e=sessionStorage.getItem(`oidc.tabId.${t}`);if(e)return e;const n=globalThis.crypto.randomUUID();return sessionStorage.setItem(`oidc.tabId.${t}`,n),n},An=t=>e=>new Promise(function(n,r){const i=new MessageChannel;i.port1.onmessage=function(s){s!=null&&s.data.error?r(s.data.error):n(s.data),i.port1.close(),i.port2.close()},t.active.postMessage({...e,tabId:SL(e.configurationName)},[i.port2])}),wr=async(t,e)=>{var n;const r=t.service_worker_relative_url;if(typeof window>"u"||typeof navigator>"u"||!navigator.serviceWorker||!r||t.service_worker_activate()===!1)return null;let i=null;t.service_worker_register?i=await t.service_worker_register(r):(i=await navigator.serviceWorker.register(r),i.active&&i.waiting&&(console.log("Detected new service worker waiting, unregistering and reloading"),await((n=t.service_worker_update_require_callback)==null?void 0:n.call(t,i,JT))));try{await navigator.serviceWorker.ready,navigator.serviceWorker.controller||await An(i)({type:"claim"})}catch{return null}const s=async g=>An(i)({type:"clear",data:{status:g},configurationName:e}),o=async(g,y,b)=>{var _;const w=await An(i)({type:"init",data:{oidcServerConfiguration:g,where:y,oidcConfiguration:{token_renew_mode:b.token_renew_mode,service_worker_convert_all_requests_to_cors:b.service_worker_convert_all_requests_to_cors}},configurationName:e}),O=w.version;return O!==GT&&(console.warn(`Service worker ${O} version mismatch with js client version ${GT}, unregistering and reloading`),await((_=b.service_worker_update_require_callback)==null?void 0:_.call(b,i,JT))),{tokens:kg(w.tokens,null,b.token_renew_mode),status:w.status}},a=(g="/")=>{HT==null&&(HT="not_null",KT(g))},l=g=>An(i)({type:"setSessionState",data:{sessionState:g},configurationName:e}),u=async()=>(await An(i)({type:"getSessionState",data:null,configurationName:e})).sessionState,d=g=>(sessionStorage[`oidc.nonce.${e}`]=g.nonce,An(i)({type:"setNonce",data:{nonce:g},configurationName:e})),h=async()=>{let g=(await An(i)({type:"getNonce",data:null,configurationName:e})).nonce;return g||(g=sessionStorage[`oidc.nonce.${e}`],console.warn("nonce not found in service worker, using sessionStorage")),{nonce:g}},p={};return{clearAsync:s,initAsync:o,startKeepAliveServiceWorker:()=>a(t.service_worker_keep_alive_path),isServiceWorkerProxyActiveAsync:()=>wL(t.service_worker_keep_alive_path),setSessionStateAsync:l,getSessionStateAsync:u,setNonceAsync:d,getNonceAsync:h,setLoginParams:g=>{p[e]=g,localStorage[`oidc.login.${e}`]=JSON.stringify(g)},getLoginParams:()=>{const g=localStorage[`oidc.login.${e}`];return p[e]||(p[e]=JSON.parse(g)),p[e]},getStateAsync:async()=>{let g=(await An(i)({type:"getState",data:null,configurationName:e})).state;return g||(g=sessionStorage[`oidc.state.${e}`],console.warn("state not found in service worker, using sessionStorage")),g},setStateAsync:async g=>(sessionStorage[`oidc.state.${e}`]=g,An(i)({type:"setState",data:{state:g},configurationName:e})),getCodeVerifierAsync:async()=>{let g=(await An(i)({type:"getCodeVerifier",data:null,configurationName:e})).codeVerifier;return g||(g=sessionStorage[`oidc.code_verifier.${e}`],console.warn("codeVerifier not found in service worker, using sessionStorage")),g},setCodeVerifierAsync:async g=>(sessionStorage[`oidc.code_verifier.${e}`]=g,An(i)({type:"setCodeVerifier",data:{codeVerifier:g},configurationName:e})),setDemonstratingProofOfPossessionNonce:async g=>{await An(i)({type:"setDemonstratingProofOfPossessionNonce",data:{demonstratingProofOfPossessionNonce:g},configurationName:e})},getDemonstratingProofOfPossessionNonce:async()=>(await An(i)({type:"getDemonstratingProofOfPossessionNonce",data:null,configurationName:e})).demonstratingProofOfPossessionNonce,setDemonstratingProofOfPossessionJwkAsync:async g=>{const y=JSON.stringify(g);await An(i)({type:"setDemonstratingProofOfPossessionJwk",data:{demonstratingProofOfPossessionJwkJson:y},configurationName:e})},getDemonstratingProofOfPossessionJwkAsync:async()=>{const g=await An(i)({type:"getDemonstratingProofOfPossessionJwk",data:null,configurationName:e});return g.demonstratingProofOfPossessionJwkJson?JSON.parse(g.demonstratingProofOfPossessionJwkJson):null}}},_a={},OL=(t,e=window.sessionStorage,n)=>{if(!_a[t]&&e){const i=e.getItem(t);i&&(_a[t]=JSON.parse(i))}const r=1e3*n;return _a[t]&&_a[t].timestamp+r>Date.now()?_a[t].result:null},kL=(t,e,n=window.sessionStorage)=>{const r=Date.now();_a[t]={result:e,timestamp:r},n&&n.setItem(t,JSON.stringify({result:e,timestamp:r}))};function YT(t){return new TextEncoder().encode(t)}function XT(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function NL(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,n){return String.fromCharCode(parseInt(n,16))})}const Ng=t=>{let e="";return t.forEach(function(n){e+=String.fromCharCode(n)}),XT(e)};function ZT(t){return XT(NL(t))}const AL={importKeyAlgorithm:{name:"ECDSA",namedCurve:"P-256",hash:{name:"ES256"}},signAlgorithm:{name:"ECDSA",hash:{name:"SHA-256"}},generateKeyAlgorithm:{name:"ECDSA",namedCurve:"P-256"},digestAlgorithm:{name:"SHA-256"},jwtHeaderAlgorithm:"ES256"},IL=t=>async(e,n,r,i,s="dpop+jwt")=>{switch(e=Object.assign({},e),n.typ=s,n.alg=i.jwtHeaderAlgorithm,n.alg){case"ES256":n.jwk={kty:e.kty,crv:e.crv,x:e.x,y:e.y};break;case"RS256":n.jwk={kty:e.kty,n:e.n,e:e.e,kid:n.kid};break;default:throw new Error("Unknown or not implemented JWS algorithm")}const o={protected:ZT(JSON.stringify(n)),payload:ZT(JSON.stringify(r))},a=i.importKeyAlgorithm,l=!0,u=["sign"],d=await t.crypto.subtle.importKey("jwk",e,a,l,u),h=YT(`${o.protected}.${o.payload}`),p=i.signAlgorithm,g=await t.crypto.subtle.sign(p,d,h);return o.signature=Ng(new Uint8Array(g)),`${o.protected}.${o.payload}.${o.signature}`},xL={sign:IL},CL=t=>async e=>{const n=e,r=!0,i=["sign","verify"],s=await t.crypto.subtle.generateKey(n,r,i);return await t.crypto.subtle.exportKey("jwk",s.privateKey)},DL=t=>{const e=Object.assign({},t);return delete e.d,e.key_ops=["verify"],e},ML={generate:CL,neuter:DL},RL=t=>async(e,n)=>{let r;switch(e.kty){case"EC":r='{"crv":"CRV","kty":"EC","x":"X","y":"Y"}'.replace("CRV",e.crv).replace("X",e.x).replace("Y",e.y);break;case"RSA":r='{"e":"E","kty":"RSA","n":"N"}'.replace("E",e.e).replace("N",e.n);break;default:throw new Error("Unknown or not implemented JWK type")}const i=await t.crypto.subtle.digest(n,YT(r));return Ng(new Uint8Array(i))},PL={thumbprint:RL},FL=t=>async e=>await ML.generate(t)(e),eS=t=>e=>async(n,r="POST",i,s={})=>{const o={jti:btoa(LL()),htm:r,htu:i,iat:Math.round(Date.now()/1e3),...s},a=await PL.thumbprint(t)(n,e.digestAlgorithm);return await xL.sign(t)(n,{kid:a},o,e)},LL=()=>{const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",e="0123456789abcdef";let n=0,r="";for(let i=0;i<36;i++)t[i]!=="-"&&t[i]!=="4"&&(n=Math.random()*16|0),t[i]==="x"?r+=e[n]:t[i]==="y"?(n&=3,n|=8,r+=e[n]):r+=t[i];return r},tS=()=>{const t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return{hasCrypto:t,hasSubtleCrypto:e}},Ag="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",$L=t=>{const e=[];for(let n=0;n<t.byteLength;n+=1){const r=t[n]%Ag.length;e.push(Ag[r])}return e.join("")},Ig=t=>{const e=new Uint8Array(t),{hasCrypto:n}=tS();if(n)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.random()*Ag.length|0;return $L(e)};function VL(t){const e=new ArrayBuffer(t.length),n=new Uint8Array(e);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function nS(t){return new Promise((e,n)=>{crypto.subtle.digest("SHA-256",VL(t)).then(r=>e(Ng(new Uint8Array(r))),r=>n(r))})}const jL=t=>{if(t.length<43||t.length>128)return Promise.reject(new Error("Invalid code length."));const{hasSubtleCrypto:e}=tS();return e?nS(t):Promise.reject(new Error("window.crypto.subtle is unavailable."))},BL=60*60,UL=t=>async(e,n=BL,r=window.sessionStorage,i=1e4)=>{const s=`${e}/.well-known/openid-configuration`,o=`oidc.server:${e}`,a=OL(o,r,n);if(a)return new Mg(a);const l=await tc(t)(s,{},i);if(l.status!==200)return null;const u=await l.json();return kL(o,u,r),new Mg(u)},tc=t=>async(e,n={},r=1e4,i=0)=>{let s;try{const o=new AbortController;setTimeout(()=>o.abort(),r),s=await t(e,{...n,signal:o.signal})}catch(o){if(o.name==="AbortError"||o.message==="Network request failed"){if(i<=1)return await tc(t)(e,n,r,i+1);throw o}else throw console.error(o.message),o}return s},xg={refresh_token:"refresh_token",access_token:"access_token"},rS=t=>async(e,n,r=xg.refresh_token,i,s={},o=1e4)=>{const a={token:n,token_type_hint:r,client_id:i};for(const[d,h]of Object.entries(s))a[d]===void 0&&(a[d]=h);const l=[];for(const d in a){const h=encodeURIComponent(d),p=encodeURIComponent(a[d]);l.push(`${h}=${p}`)}const u=l.join("&");return(await tc(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:u},o)).status!==200?{success:!1}:{success:!0}},qL=t=>async(e,n,r,i,s={},o,a=1e4)=>{for(const[g,y]of Object.entries(r))n[g]===void 0&&(n[g]=y);const l=[];for(const g in n){const y=encodeURIComponent(g),b=encodeURIComponent(n[g]);l.push(`${y}=${b}`)}const u=l.join("&"),d=await tc(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",...s},body:u},a);if(d.status!==200)return{success:!1,status:d.status,demonstratingProofOfPossessionNonce:null};const h=await d.json();let p=null;return d.headers.has(wf)&&(p=d.headers.get(wf)),{success:!0,status:d.status,data:kg(h,i,o),demonstratingProofOfPossessionNonce:p}},WL=(t,e)=>async(n,r)=>{r=r?{...r}:{};const i=Ig(128),s=await jL(i);await t.setCodeVerifierAsync(i),await t.setStateAsync(r.state),r.code_challenge=s,r.code_challenge_method="S256";let o="";if(r)for(const[a,l]of Object.entries(r))o===""?o+="?":o+="&",o+=`${a}=${encodeURIComponent(l)}`;e.open(`${n}${o}`)},wf="DPoP-Nonce",zL=t=>async(e,n,r,i,s=1e4)=>{n=n?{...n}:{},n.code_verifier=await t.getCodeVerifierAsync();const o=[];for(const h in n){const p=encodeURIComponent(h),g=encodeURIComponent(n[h]);o.push(`${p}=${g}`)}const a=o.join("&"),l=await tc(fetch)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",...r},body:a},s);if(await Promise.all([t.setCodeVerifierAsync(null),t.setStateAsync(null)]),l.status!==200)return{success:!1,status:l.status};let u=null;l.headers.has(wf)&&(u=l.headers.get(wf));const d=await l.json();return{success:!0,data:{state:n.state,tokens:kg(d,null,i),demonstratingProofOfPossessionNonce:u}}};async function iS(t,e,n){const r=o=>{t.tokens=o},{tokens:i,status:s}=await Tf(t)(r,0,e,n);return await wr(t.configuration,t.configurationName)||await Er(t.configurationName,t.configuration.storage).setTokens(t.tokens),t.tokens?i:(await t.destroyAsync(s),null)}async function sS(t,e=!1,n=null){const r=t.configuration,i=`${r.client_id}_${t.configurationName}_${r.authority}`;let s;const o=await wr(t.configuration,t.configurationName);if((r==null?void 0:r.storage)===(window==null?void 0:window.sessionStorage)&&!o||!navigator.locks)s=await iS(t,e,n);else{let a="retry";for(;a==="retry";)a=await navigator.locks.request(i,{ifAvailable:!0},async l=>l?await iS(t,e,n):(t.publishEvent(Ai.eventNames.syncTokensAsync_lock_not_available,{lock:"lock not available"}),"retry"));s=a}return s?(t.timeoutId&&(t.timeoutId=nc(t,t.tokens.expiresAt,n)),t.tokens):null}const nc=(t,e,n=null)=>{const r=t.configuration.refresh_time_before_tokens_expiration_in_second;return t.timeoutId&&ba.clearTimeout(t.timeoutId),ba.setTimeout(async()=>{const i={timeLeft:ec(r,e)};t.publishEvent(Ai.eventNames.token_timer,i),await sS(t,!1,n)},1e3)},hs={FORCE_REFRESH:"FORCE_REFRESH",SESSION_LOST:"SESSION_LOST",NOT_CONNECTED:"NOT_CONNECTED",TOKENS_VALID:"TOKENS_VALID",TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID",LOGOUT_FROM_ANOTHER_TAB:"LOGOUT_FROM_ANOTHER_TAB",REQUIRE_SYNC_TOKENS:"REQUIRE_SYNC_TOKENS"},QL=t=>async(e,n,r,i=!1)=>{const s={nonce:null};if(!r)return{tokens:null,status:"NOT_CONNECTED",nonce:s};let o=s;const a=await t.initAsync(e.authority,e.authority_configuration),l=await wr(e,n);if(l){const{status:d,tokens:h}=await l.initAsync(a,"syncTokensAsync",e);if(d==="LOGGED_OUT")return{tokens:null,status:"LOGOUT_FROM_ANOTHER_TAB",nonce:s};if(d==="SESSIONS_LOST")return{tokens:null,status:"SESSIONS_LOST",nonce:s};if(!d||!h)return{tokens:null,status:"REQUIRE_SYNC_TOKENS",nonce:s};if(h.issuedAt!==r.issuedAt){const p=ec(e.refresh_time_before_tokens_expiration_in_second,h.expiresAt)>0?"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID":"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID",g=await l.getNonceAsync();return{tokens:h,status:p,nonce:g}}o=await l.getNonceAsync()}else{const d=Er(n,e.storage??sessionStorage),h=await d.initAsync();let{tokens:p}=h;const{status:g}=h;if(p&&(p=Og(p,t.tokens,e.token_renew_mode)),p){if(g==="SESSIONS_LOST")return{tokens:null,status:"SESSIONS_LOST",nonce:s};if(p.issuedAt!==r.issuedAt){const y=ec(e.refresh_time_before_tokens_expiration_in_second,p.expiresAt)>0?"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID":"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID",b=await d.getNonceAsync();return{tokens:p,status:y,nonce:b}}}else return{tokens:null,status:"LOGOUT_FROM_ANOTHER_TAB",nonce:s};o=await d.getNonceAsync()}const u=ec(e.refresh_time_before_tokens_expiration_in_second,r.expiresAt)>0?"TOKENS_VALID":"TOKENS_INVALID";return i?{tokens:r,status:"FORCE_REFRESH",nonce:o}:{tokens:r,status:u,nonce:o}},Tf=t=>async(e,n=0,r=!1,i=null)=>{if(!navigator.onLine&&document.hidden)return{tokens:t.tokens,status:"GIVE_UP"};let s=6;for(;!navigator.onLine&&s>0;)await Ef({milliseconds:1e3}),s--,t.publishEvent(qe.refreshTokensAsync,{message:`wait because navigator is offline try ${s}`});const o=n+1;i||(i={});const a=t.configuration,l=(d,h=null,p=null)=>Cg(t.configurationName,t.configuration,t.publishEvent.bind(t))(d,h,p),u=async()=>{try{let d;const h=await wr(a,t.configurationName);h?d=h.getLoginParams():d=Er(t.configurationName,a.storage).getLoginParams();const p=await l({...d.extras,...i,prompt:"none"});return p?p.error?(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token silent"}),{tokens:null,status:"SESSION_LOST"}):(e(p.tokens),t.publishEvent(Ai.eventNames.token_renewed,{}),{tokens:p.tokens,status:"LOGGED"}):(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token silent not active"}),{tokens:null,status:"SESSION_LOST"})}catch(d){return console.error(d),t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"exceptionSilent",exception:d.message}),await Tf(t)(e,o,r,i)}};try{const{status:d,tokens:h,nonce:p}=await QL(t)(a,t.configurationName,t.tokens,r);switch(d){case hs.SESSION_LOST:return e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token session lost"}),{tokens:null,status:"SESSION_LOST"};case hs.NOT_CONNECTED:return e(null),{tokens:null,status:null};case hs.TOKENS_VALID:return e(h),{tokens:h,status:"LOGGED_IN"};case hs.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:return e(h),t.publishEvent(Ai.eventNames.token_renewed,{reason:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID"}),{tokens:h,status:"LOGGED_IN"};case hs.LOGOUT_FROM_ANOTHER_TAB:return e(null),t.publishEvent(qe.logout_from_another_tab,{status:"session syncTokensAsync"}),{tokens:null,status:"LOGGED_OUT"};case hs.REQUIRE_SYNC_TOKENS:return a.token_automatic_renew_mode==Zl.AutomaticOnlyWhenFetchExecuted&&hs.FORCE_REFRESH!==d?(t.publishEvent(qe.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"}):(t.publishEvent(qe.refreshTokensAsync_begin,{tryNumber:n}),await u());default:{if(a.token_automatic_renew_mode==Zl.AutomaticOnlyWhenFetchExecuted&&hs.FORCE_REFRESH!==d)return t.publishEvent(qe.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"};if(t.publishEvent(qe.refreshTokensAsync_begin,{refreshToken:h.refreshToken,status:d,tryNumber:n}),!h.refreshToken)return await u();const g=a.client_id,y=a.redirect_uri,b=a.authority,_={...a.token_request_extras?a.token_request_extras:{}};for(const[w,O]of Object.entries(i))w.endsWith(":token_request")&&(_[w.replace(":token_request","")]=O);return await(async()=>{const w={client_id:g,redirect_uri:y,grant_type:"refresh_token",refresh_token:h.refreshToken},O=await t.initAsync(b,a.authority_configuration),N=document.hidden?1e4:3e4*10,I=O.tokenEndpoint,P={};a.demonstrating_proof_of_possession&&(P.DPoP=await t.generateDemonstrationOfProofOfPossessionAsync(h.accessToken,I,"POST"));const R=await qL(t.getFetch())(I,w,_,h,P,a.token_renew_mode,N);if(R.success){const{isValid:B,reason:Q}=QT(R.data,p.nonce,O);if(!B)return e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:`refresh token return not valid tokens, reason: ${Q}`}),{tokens:null,status:"SESSION_LOST"};if(e(R.data),R.demonstratingProofOfPossessionNonce){const x=await wr(a,t.configurationName);x?await x.setDemonstratingProofOfPossessionNonce(R.demonstratingProofOfPossessionNonce):await Er(t.configurationName,a.storage).setDemonstratingProofOfPossessionNonce(R.demonstratingProofOfPossessionNonce)}return t.publishEvent(qe.refreshTokensAsync_end,{success:R.success}),t.publishEvent(Ai.eventNames.token_renewed,{reason:"REFRESH_TOKEN"}),{tokens:R.data,status:"LOGGED_IN"}}else return t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"bad request",tokenResponse:R}),R.status>=400&&R.status<500?(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:`session lost: ${R.status}`}),{tokens:null,status:"SESSION_LOST"}):await Tf(t)(e,o,r,i)})()}}}catch(d){return console.error(d),t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"exception",exception:d.message}),new Promise((h,p)=>{setTimeout(()=>{Tf(t)(e,o,r,i).then(h).catch(p)},1e3)})}},Cg=(t,e,n)=>(r=null,i=null,s=null)=>{if(!e.silent_redirect_uri||!e.silent_login_uri)return Promise.resolve(null);try{n(qe.silentLoginAsync_begin,{});let o="";if(i&&(r==null&&(r={}),r.state=i),s&&(r==null&&(r={}),r.scope=s),r!=null)for(const[h,p]of Object.entries(r))o===""?o=`?${encodeURIComponent(h)}=${encodeURIComponent(p)}`:o+=`&${encodeURIComponent(h)}=${encodeURIComponent(p)}`;const a=e.silent_login_uri+o,l=a.indexOf("/",a.indexOf("//")+2),u=a.substring(0,l),d=document.createElement("iframe");return d.width="0px",d.height="0px",d.id=`${t}_oidc_iframe`,d.setAttribute("src",a),document.body.appendChild(d),new Promise((h,p)=>{let g=!1;const y=()=>{window.removeEventListener("message",b),d.remove(),g=!0},b=_=>{if(_.origin===u&&_.source===d.contentWindow){const w=`${t}_oidc_tokens:`,O=`${t}_oidc_error:`,N=`${t}_oidc_exception:`,I=_.data;if(I&&typeof I=="string"&&!g){if(I.startsWith(w)){const P=JSON.parse(_.data.replace(w,""));n(qe.silentLoginAsync_end,{}),h(P),y()}else if(I.startsWith(O)){const P=JSON.parse(_.data.replace(O,""));n(qe.silentLoginAsync_error,P),h({error:"oidc_"+P.error,tokens:null,sessionState:null}),y()}else if(I.startsWith(N)){const P=JSON.parse(_.data.replace(N,""));n(qe.silentLoginAsync_error,P),p(new Error(P.error)),y()}}}};try{window.addEventListener("message",b);const _=e.silent_login_timeout;setTimeout(()=>{g||(y(),n(qe.silentLoginAsync_error,{reason:"timeout"}),p(new Error("timeout")))},_)}catch(_){y(),n(qe.silentLoginAsync_error,_),p(_)}})}catch(o){throw n(qe.silentLoginAsync_error,o),o}},GL=(t,e,n,r,i)=>(s=null,o=void 0)=>{s={...s};const a=(l,u,d)=>Cg(e,n,r.bind(i))(l,u,d);return(async()=>{i.timeoutId&&ba.clearTimeout(i.timeoutId);let l;s&&"state"in s&&(l=s.state,delete s.state);try{const u=n.extras?{...n.extras,...s}:s,d=await a({...u,prompt:"none"},l,o);if(d)return i.tokens=d.tokens,r(qe.token_acquired,{}),i.timeoutId=nc(i,i.tokens.expiresAt,s),{}}catch(u){return u}})()},HL=(t,e,n)=>(r,i,s,o=!1)=>{const a=(l,u=void 0,d=void 0)=>Cg(t.configurationName,n,t.publishEvent.bind(t))(l,u,d);return new Promise((l,u)=>{if(n.silent_login_uri&&n.silent_redirect_uri&&n.monitor_session&&r&&s&&!o){const d=()=>{t.checkSessionIFrame.stop();const h=t.tokens;if(h===null)return;const p=h.idToken,g=h.idTokenPayload;return a({prompt:"none",id_token_hint:p,scope:n.scope||"openid"}).then(y=>{if(y.error)throw new Error(y.error);const b=y.tokens.idTokenPayload;if(g.sub===b.sub){const _=y.sessionState;t.checkSessionIFrame.start(y.sessionState),g.sid===b.sid?console.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",_):console.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",_)}else console.debug("SessionMonitor._callback: Different subject signed into OP:",b.sub)}).catch(async y=>{console.warn("SessionMonitor._callback: Silent login failed, logging out other tabs:",y);for(const[,b]of Object.entries(e))await b.logoutOtherTabAsync(n.client_id,g.sub)})};t.checkSessionIFrame=new yL(d,i,r),t.checkSessionIFrame.load().then(()=>{t.checkSessionIFrame.start(s),l(t.checkSessionIFrame)}).catch(h=>{u(h)})}else l(null)})},KL=t=>!!(t.os==="iOS"&&t.osVersion.startsWith("12")||t.os==="Mac OS X"&&t.osVersion.startsWith("10_15_6")),JL=t=>{const e=t.appVersion,n=t.userAgent,r="-";let i=r;const s=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Chrome OS",r:/CrOS/},{s:"Linux",r:/(Linux|X11(?!.*CrOS))/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(const a in s){const l=s[a];if(l.r.test(n)){i=l.s;break}}let o=r;switch(/Windows/.test(i)&&(o=/Windows (.*)/.exec(i)[1],i="Windows"),i){case"Mac OS":case"Mac OS X":case"Android":o=/(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([._\d]+)/.exec(n)[1];break;case"iOS":{const a=/OS (\d+)_(\d+)_?(\d+)?/.exec(e);a!=null&&a.length>2&&(o=a[1]+"."+a[2]+"."+(parseInt(a[3])|0));break}}return{os:i,osVersion:o}};function YL(){const t=navigator.userAgent;let e,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(n[1]))return e=/\brv[ :]+(\d+)/g.exec(t)||[],{name:"ie",version:e[1]||""};if(n[1]==="Chrome"&&(e=t.match(/\bOPR|Edge\/(\d+)/),e!=null)){let r=e[1];if(!r){const i=t.split(e[0]+"/");i.length>1&&(r=i[1])}return{name:"opera",version:r}}return n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],(e=t.match(/version\/(\d+)/i))!=null&&n.splice(1,1,e[1]),{name:n[0].toLowerCase(),version:n[1]}}const XL=()=>{const{name:t,version:e}=YL();if(t==="chrome"&&parseInt(e)<=70||t==="opera"&&(!e||parseInt(e.split(".")[0])<80)||t==="ie")return!1;const n=JL(navigator);return!KL(n)},ZL=async t=>{let e;if(t.tokens!=null)return!1;t.publishEvent(qe.tryKeepExistingSessionAsync_begin,{});try{const n=t.configuration,r=await t.initAsync(n.authority,n.authority_configuration);if(e=await wr(n,t.configurationName),e){const{tokens:i}=await e.initAsync(r,"tryKeepExistingSessionAsync",n);if(i){e.startKeepAliveServiceWorker(),t.tokens=i;const s=e.getLoginParams(t.configurationName);t.timeoutId=nc(t,t.tokens.expiresAt,s.extras);const o=await e.getSessionStateAsync();return await t.startCheckSessionAsync(r.check_session_iframe,n.client_id,o),n.preload_user_info&&await t.userInfoAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside ServiceWorker are valid"}),!0}t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!1,message:"no exiting session found"})}else{n.service_worker_relative_url&&t.publishEvent(qe.service_worker_not_supported_by_browser,{message:"service worker is not supported by this browser"});const i=Er(t.configurationName,n.storage??sessionStorage),{tokens:s}=await i.initAsync();if(s){t.tokens=Og(s,null,n.token_renew_mode);const o=i.getLoginParams();t.timeoutId=nc(t,t.tokens.expiresAt,o.extras);const a=await i.getSessionStateAsync();return await t.startCheckSessionAsync(r.check_session_iframe,n.client_id,a),n.preload_user_info&&await t.userInfoAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside storage are valid"}),!0}}return t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!1,message:e?"service worker sessions not retrieved":"session storage sessions not retrieved"}),!1}catch(n){return console.error(n),e&&await e.clearAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_error,"tokens inside ServiceWorker are invalid"),!1}},oS=t=>{const e=t.match(/^([a-z][\w-]+\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);if(!e)throw new Error("Invalid URL");let n=e[6],r=e[7];if(r){const i=r.split("?");i.length===2&&(r=i[0],n=i[1])}return n.startsWith("?")&&(n=n.slice(1)),e&&{href:t,protocol:e[1],host:e[2],hostname:e[3],port:e[4],path:e[5],search:n,hash:r}},rc=t=>{const e=oS(t);let{path:n}=e;n.endsWith("/")&&(n=n.slice(0,-1));let{hash:r}=e;return r==="#_=_"&&(r=""),r&&(n+=r),n},ic=t=>{const e=oS(t),{search:n}=e;return e$(n)},e$=t=>{const e={};let n,r,i;const s=t.split("&");for(r=0,i=s.length;r<i;r++)n=s[r].split("="),e[decodeURIComponent(n[0])]=decodeURIComponent(n[1]);return e},t$=(t,e,n,r,i)=>(s=void 0,o=null,a=!1,l=void 0)=>{const u=o;return o={...o},(async()=>{const d=s||i.getPath();if("state"in o||(o.state=Ig(16)),n(qe.loginAsync_begin,{}),o)for(const h of Object.keys(o))h.endsWith(":token_request")&&delete o[h];try{const h=a?e.silent_redirect_uri:e.redirect_uri;l||(l=e.scope);const p=e.extras?{...e.extras,...o}:o;p.nonce||(p.nonce=Ig(12));const g={nonce:p.nonce},y=await wr(e,t),b=await r(e.authority,e.authority_configuration);let _;if(y)y.setLoginParams({callbackPath:d,extras:u}),await y.initAsync(b,"loginAsync",e),await y.setNonceAsync(g),y.startKeepAliveServiceWorker(),_=y;else{const O=Er(t,e.storage??sessionStorage);O.setLoginParams({callbackPath:d,extras:u}),await O.setNonceAsync(g),_=O}const w={client_id:e.client_id,redirect_uri:h,scope:l,response_type:"code",...p};await WL(_,i)(b.authorizationEndpoint,w)}catch(h){throw n(qe.loginAsync_error,h),h}})()},n$=t=>async(e=!1)=>{try{t.publishEvent(qe.loginCallbackAsync_begin,{});const n=t.configuration,r=n.client_id,i=e?n.silent_redirect_uri:n.redirect_uri,s=n.authority,o=n.token_request_timeout,a=await t.initAsync(s,n.authority_configuration),l=t.location.getCurrentHref(),u=ic(l).session_state,d=await wr(n,t.configurationName);let h,p,g,y;if(d)await d.initAsync(a,"loginCallbackAsync",n),await d.setSessionStateAsync(u),p=await d.getNonceAsync(),g=d.getLoginParams(),y=await d.getStateAsync(),d.startKeepAliveServiceWorker(),h=d;else{const U=Er(t.configurationName,n.storage??sessionStorage);await U.setSessionStateAsync(u),p=await U.getNonceAsync(),g=U.getLoginParams(),y=await U.getStateAsync(),h=U}const b=ic(l);if(b.error||b.error_description)throw new Error(`Error from OIDC server: ${b.error} - ${b.error_description}`);if(b.iss&&b.iss!==a.issuer)throw console.error(),new Error(`Issuer not valid (expected: ${a.issuer}, received: ${b.iss})`);if(b.state&&b.state!==y)throw new Error(`State not valid (expected: ${y}, received: ${b.state})`);const _={code:b.code,grant_type:"authorization_code",client_id:n.client_id,redirect_uri:i},w={};if(n.token_request_extras)for(const[U,be]of Object.entries(n.token_request_extras))w[U]=be;if(g!=null&&g.extras)for(const[U,be]of Object.entries(g.extras))U.endsWith(":token_request")&&(w[U.replace(":token_request","")]=be);const O=a.tokenEndpoint,N={};if(n.demonstrating_proof_of_possession)if(d)N.DPoP=`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${t.configurationName}`;else{const U=await FL(window)(n.demonstrating_proof_of_possession_configuration.generateKeyAlgorithm);await Er(t.configurationName,n.storage).setDemonstratingProofOfPossessionJwkAsync(U),N.DPoP=await eS(window)(n.demonstrating_proof_of_possession_configuration)(U,"POST",O)}const I=await zL(h)(O,{..._,...w},N,t.configuration.token_renew_mode,o);if(!I.success)throw new Error("Token request failed");let P;const R=I.data.tokens,B=I.data.demonstratingProofOfPossessionNonce;if(I.data.state!==w.state)throw new Error("state is not valid");const{isValid:Q,reason:x}=QT(R,p.nonce,a);if(!Q)throw new Error(`Tokens are not OpenID valid, reason: ${x}`);if(d){if(R.refreshToken&&!R.refreshToken.includes("SECURED_BY_OIDC_SERVICE_WORKER"))throw new Error("Refresh token should be hidden by service worker");if(B&&R!=null&&R.accessToken.includes("SECURED_BY_OIDC_SERVICE_WORKER"))throw new Error("Demonstration of proof of possession require Access token not hidden by service worker")}if(d)await d.initAsync(a,"syncTokensAsync",n),P=d.getLoginParams(),B&&await d.setDemonstratingProofOfPossessionNonce(B);else{const U=Er(t.configurationName,n.storage);P=U.getLoginParams(),B&&await U.setDemonstratingProofOfPossessionNonce(B)}return await t.startCheckSessionAsync(a.checkSessionIframe,r,u,e),t.publishEvent(qe.loginCallbackAsync_end,{}),{tokens:R,state:"request.state",callbackPath:P.callbackPath}}catch(n){throw console.error(n),t.publishEvent(qe.loginCallbackAsync_error,n),n}},aS={access_token:"access_token",refresh_token:"refresh_token"},Dg=(t,e)=>{const n={};if(t){for(const[r,i]of Object.entries(t))if(r.endsWith(e)){const s=r.replace(e,"");n[s]=i}return n}return n},r$=t=>{const e={};if(t){for(const[n,r]of Object.entries(t))n.includes(":")||(e[n]=r);return e}return e},i$=t=>async e=>{ba.clearTimeout(t.timeoutId),t.timeoutId=null,t.checkSessionIFrame&&t.checkSessionIFrame.stop();const n=await wr(t.configuration,t.configurationName);n?await n.clearAsync(e):await Er(t.configurationName,t.configuration.storage).clearAsync(e),t.tokens=null,t.userInfo=null},s$=(t,e,n,r,i)=>async(s=void 0,o=null)=>{var a,l;const u=t.configuration,d=await t.initAsync(u.authority,u.authority_configuration);s&&typeof s!="string"&&(s=void 0,r.warn("callbackPathOrUrl path is not a string"));const h=s??i.getPath();let p=!1;s&&(p=s.includes("https://")||s.includes("http://"));const g=p?s:i.getOrigin()+h,y=t.tokens?t.tokens.idToken:"";try{const O=d.revocationEndpoint;if(O){const N=[],I=t.tokens?t.tokens.accessToken:null;if(I&&u.logout_tokens_to_invalidate.includes(aS.access_token)){const R=Dg(o,":revoke_access_token"),B=rS(n)(O,I,xg.access_token,u.client_id,R);N.push(B)}const P=t.tokens?t.tokens.refreshToken:null;if(P&&u.logout_tokens_to_invalidate.includes(aS.refresh_token)){const R=Dg(o,":revoke_refresh_token"),B=rS(n)(O,P,xg.refresh_token,u.client_id,R);N.push(B)}N.length>0&&await Promise.all(N)}}catch(O){r.warn("logoutAsync: error when revoking tokens, if the error persist, you ay configure property logout_tokens_to_invalidate from configuration to avoid this error"),r.warn(O)}const b=((l=(a=t.tokens)==null?void 0:a.idTokenPayload)==null?void 0:l.sub)??null;await t.destroyAsync("LOGGED_OUT");for(const[,O]of Object.entries(e))O!==t?await t.logoutSameTabAsync(t.configuration.client_id,b):t.publishEvent(qe.logout_from_same_tab,{});const _=Dg(o,":oidc");if(_&&_.no_reload==="true")return;const w=r$(o);if(d.endSessionEndpoint){"id_token_hint"in w||(w.id_token_hint=y),!("post_logout_redirect_uri"in w)&&s!==null&&(w.post_logout_redirect_uri=g);let O="";for(const[N,I]of Object.entries(w))I!=null&&(O===""?O+="?":O+="&",O+=`${N}=${encodeURIComponent(I)}`);i.open(`${d.endSessionEndpoint}${O}`)}else i.reload()},lS=(t,e,n=!1)=>async(...r)=>{var i;const[s,o,...a]=r,l=o?{...o}:{method:"GET"};let u=new Headers;l.headers&&(u=l.headers instanceof Headers?l.headers:new Headers(l.headers));const d={getTokens:()=>e.tokens,configuration:{token_automatic_renew_mode:e.configuration.token_automatic_renew_mode,refresh_time_before_tokens_expiration_in_second:e.configuration.refresh_time_before_tokens_expiration_in_second},renewTokensAsync:e.renewTokensAsync.bind(e)},h=await zT(d),p=(i=h==null?void 0:h.tokens)==null?void 0:i.accessToken;if(u.has("Accept")||u.set("Accept","application/json"),p){if(e.configuration.demonstrating_proof_of_possession&&n){const y=await e.generateDemonstrationOfProofOfPossessionAsync(p,s.toString(),l.method);u.set("Authorization",`PoP ${p}`),u.set("DPoP",y)}else u.set("Authorization",`Bearer ${p}`);l.credentials||(l.credentials="same-origin")}const g={...l,headers:u};return await t(s,g,...a)},o$=t=>async(e=!1,n=!1)=>{if(t.userInfo!=null&&!e)return t.userInfo;const r=t.configuration,i=(await t.initAsync(r.authority,r.authority_configuration)).userInfoEndpoint,s=await(async()=>{const o=await lS(fetch,t,n)(i);return o.status!==200?null:o.json()})();return t.userInfo=s,s},cS=()=>fetch;let Mg=class{constructor(e){this.authorizationEndpoint=e.authorization_endpoint,this.tokenEndpoint=e.token_endpoint,this.revocationEndpoint=e.revocation_endpoint,this.userInfoEndpoint=e.userinfo_endpoint,this.checkSessionIframe=e.check_session_iframe,this.issuer=e.issuer,this.endSessionEndpoint=e.end_session_endpoint}};const ho={},a$=(t,e=new ya)=>(n,r="default")=>(ho[r]||(ho[r]=new Ai(n,r,t,e)),ho[r]),l$=async t=>{const{parsedTokens:e,callbackPath:n}=await t.loginCallbackAsync();return t.timeoutId=nc(t,e.expiresAt),{callbackPath:n}},c$=t=>Math.floor(Math.random()*t),Rg=class rC{constructor(e,n="default",r,i=new ya){this.initPromise=null,this.tryKeepExistingSessionPromise=null,this.loginPromise=null,this.loginCallbackPromise=null,this.loginCallbackWithAutoTokensRenewPromise=null,this.userInfoPromise=null,this.renewTokensPromise=null,this.logoutPromise=null;let s=e.silent_login_uri;e.silent_redirect_uri&&!e.silent_login_uri&&(s=`${e.silent_redirect_uri.replace("-callback","").replace("callback","")}-login`);let o=e.refresh_time_before_tokens_expiration_in_second??120;o>60&&(o=o-Math.floor(Math.random()*40)),this.location=i??new ya;const a=e.service_worker_update_require_callback??TL(this.location);this.configuration={...e,silent_login_uri:s,token_automatic_renew_mode:e.token_automatic_renew_mode??Zl.AutomaticBeforeTokenExpiration,monitor_session:e.monitor_session??!1,refresh_time_before_tokens_expiration_in_second:o,silent_login_timeout:e.silent_login_timeout??12e3,token_renew_mode:e.token_renew_mode??Sg.access_token_or_id_token_invalid,demonstrating_proof_of_possession:e.demonstrating_proof_of_possession??!1,authority_timeout_wellknowurl_in_millisecond:e.authority_timeout_wellknowurl_in_millisecond??1e4,logout_tokens_to_invalidate:e.logout_tokens_to_invalidate??["access_token","refresh_token"],service_worker_update_require_callback:a,service_worker_activate:e.service_worker_activate??XL,demonstrating_proof_of_possession_configuration:e.demonstrating_proof_of_possession_configuration??AL,preload_user_info:e.preload_user_info??!1},this.getFetch=r??cS,this.configurationName=n,this.tokens=null,this.userInfo=null,this.events=[],this.timeoutId=null,this.loginCallbackWithAutoTokensRenewAsync.bind(this),this.initAsync.bind(this),this.loginCallbackAsync.bind(this),this.subscribeEvents.bind(this),this.removeEventSubscription.bind(this),this.publishEvent.bind(this),this.destroyAsync.bind(this),this.logoutAsync.bind(this),this.renewTokensAsync.bind(this),this.initAsync(this.configuration.authority,this.configuration.authority_configuration)}subscribeEvents(e){const n=c$(9999999999999).toString();return this.events.push({id:n,func:e}),n}removeEventSubscription(e){const n=this.events.filter(r=>r.id!==e);this.events=n}publishEvent(e,n){this.events.forEach(r=>{r.func(e,n)})}static get(e="default"){const n=typeof process>"u";if(!Object.prototype.hasOwnProperty.call(ho,e)&&n)throw Error(`OIDC library does seem initialized.
|
|
216
|
-
Please checkout that you are using OIDC hook inside a <OidcProvider configurationName="${e}"></OidcProvider> component.`);return ho[e]}_silentLoginCallbackFromIFrame(){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const e=this.location,n=ic(e.getCurrentHref());window.parent.postMessage(`${this.configurationName}_oidc_tokens:${JSON.stringify({tokens:this.tokens,sessionState:n.session_state})}`,e.getOrigin())}}_silentLoginErrorCallbackFromIFrame(e=null){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const n=this.location,r=ic(n.getCurrentHref());r.error?window.parent.postMessage(`${this.configurationName}_oidc_error:${JSON.stringify({error:r.error})}`,n.getOrigin()):window.parent.postMessage(`${this.configurationName}_oidc_exception:${JSON.stringify({error:e==null?"":e.toString()})}`,n.getOrigin())}}async silentLoginCallbackAsync(){try{await this.loginCallbackAsync(!0),this._silentLoginCallbackFromIFrame()}catch(e){console.error(e),this._silentLoginErrorCallbackFromIFrame(e)}}async initAsync(e,n){if(this.initPromise!==null)return this.initPromise;const r=async()=>{if(n!=null)return new Mg({authorization_endpoint:n.authorization_endpoint,end_session_endpoint:n.end_session_endpoint,revocation_endpoint:n.revocation_endpoint,token_endpoint:n.token_endpoint,userinfo_endpoint:n.userinfo_endpoint,check_session_iframe:n.check_session_iframe,issuer:n.issuer});const i=await wr(this.configuration,this.configurationName)?window.localStorage:null;return await UL(this.getFetch())(e,this.configuration.authority_time_cache_wellknowurl_in_second??60*60,i,this.configuration.authority_timeout_wellknowurl_in_millisecond)};return this.initPromise=r(),this.initPromise.finally(()=>{this.initPromise=null})}async tryKeepExistingSessionAsync(){return this.tryKeepExistingSessionPromise!==null?this.tryKeepExistingSessionPromise:(this.tryKeepExistingSessionPromise=ZL(this),this.tryKeepExistingSessionPromise.finally(()=>{this.tryKeepExistingSessionPromise=null}))}async startCheckSessionAsync(e,n,r,i=!1){await HL(this,ho,this.configuration)(e,n,r,i)}async loginAsync(e=void 0,n=null,r=!1,i=void 0,s=!1){return this.logoutPromise&&await this.logoutPromise,this.loginPromise!==null?this.loginPromise:s?GL(window,this.configurationName,this.configuration,this.publishEvent.bind(this),this)(n,i):(this.loginPromise=t$(this.configurationName,this.configuration,this.publishEvent.bind(this),this.initAsync.bind(this),this.location)(e,n,r,i),this.loginPromise.finally(()=>{this.loginPromise=null}))}async loginCallbackAsync(e=!1){if(this.loginCallbackPromise!==null)return this.loginCallbackPromise;const n=async()=>{const r=await n$(this)(e),i=r.tokens;return this.tokens=i,await wr(this.configuration,this.configurationName)||Er(this.configurationName,this.configuration.storage).setTokens(i),this.publishEvent(rC.eventNames.token_acquired,i),this.configuration.preload_user_info&&await this.userInfoAsync(),{parsedTokens:i,state:r.state,callbackPath:r.callbackPath}};return this.loginCallbackPromise=n(),this.loginCallbackPromise.finally(()=>{this.loginCallbackPromise=null})}async generateDemonstrationOfProofOfPossessionAsync(e,n,r,i={}){const s=this.configuration,o={ath:await nS(e),...i};if(await wr(s,this.configurationName))return`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${this.configurationName}`;const a=Er(this.configurationName,s.storage),l=await a.getDemonstratingProofOfPossessionJwkAsync(),u=a.getDemonstratingProofOfPossessionNonce();return u&&(o.nonce=u),await eS(window)(s.demonstrating_proof_of_possession_configuration)(l,r,n,o)}loginCallbackWithAutoTokensRenewAsync(){return this.loginCallbackWithAutoTokensRenewPromise!==null?this.loginCallbackWithAutoTokensRenewPromise:(this.loginCallbackWithAutoTokensRenewPromise=l$(this),this.loginCallbackWithAutoTokensRenewPromise.finally(()=>{this.loginCallbackWithAutoTokensRenewPromise=null}))}userInfoAsync(e=!1,n=!1){return this.userInfoPromise!==null?this.userInfoPromise:(this.userInfoPromise=o$(this)(e,n),this.userInfoPromise.finally(()=>{this.userInfoPromise=null}))}async renewTokensAsync(e=null){if(this.renewTokensPromise!==null)return this.renewTokensPromise;if(this.timeoutId)return ba.clearTimeout(this.timeoutId),this.renewTokensPromise=sS(this,!0,e),this.renewTokensPromise.finally(()=>{this.renewTokensPromise=null})}async destroyAsync(e){return await i$(this)(e)}async logoutSameTabAsync(e,n){this.configuration.monitor_session&&this.configuration.client_id===e&&n&&this.tokens&&this.tokens.idTokenPayload&&this.tokens.idTokenPayload.sub===n&&(await this.destroyAsync("LOGGED_OUT"),this.publishEvent(qe.logout_from_same_tab,{mmessage:"SessionMonitor",sub:n}))}async logoutOtherTabAsync(e,n){this.configuration.monitor_session&&this.configuration.client_id===e&&n&&this.tokens&&this.tokens.idTokenPayload&&this.tokens.idTokenPayload.sub===n&&(await this.destroyAsync("LOGGED_OUT"),this.publishEvent(qe.logout_from_another_tab,{message:"SessionMonitor",sub:n}))}async logoutAsync(e=void 0,n=null){return this.logoutPromise?this.logoutPromise:(this.logoutPromise=s$(this,ho,this.getFetch(),console,this.location)(e,n),this.logoutPromise.finally(()=>{this.logoutPromise=null}))}};Rg.getOrCreate=(t,e)=>(n,r="default")=>a$(t,e)(n,r),Rg.eventNames=qe;let Ai=Rg;const Sf=class iC{constructor(e){this._oidc=e}subscribeEvents(e){return this._oidc.subscribeEvents(e)}removeEventSubscription(e){this._oidc.removeEventSubscription(e)}publishEvent(e,n){this._oidc.publishEvent(e,n)}static get(e="default"){return new iC(Ai.get(e))}tryKeepExistingSessionAsync(){return this._oidc.tryKeepExistingSessionAsync()}loginAsync(e=void 0,n=null,r=!1,i=void 0,s=!1){return this._oidc.loginAsync(e,n,r,i,s)}logoutAsync(e=void 0,n=null){return this._oidc.logoutAsync(e,n)}silentLoginCallbackAsync(){return this._oidc.silentLoginCallbackAsync()}renewTokensAsync(e=null){return this._oidc.renewTokensAsync(e)}loginCallbackAsync(){return this._oidc.loginCallbackWithAutoTokensRenewAsync()}get tokens(){return this._oidc.tokens}get configuration(){return this._oidc.configuration}async generateDemonstrationOfProofOfPossessionAsync(e,n,r,i={}){return this._oidc.generateDemonstrationOfProofOfPossessionAsync(e,n,r,i)}async getValidTokenAsync(e=200,n=50){const r=this._oidc,i={getTokens:()=>r.tokens,configuration:{token_automatic_renew_mode:r.configuration.token_automatic_renew_mode,refresh_time_before_tokens_expiration_in_second:r.configuration.refresh_time_before_tokens_expiration_in_second},renewTokensAsync:r.renewTokensAsync.bind(r)};return zT(i,e,n)}fetchWithTokens(e,n=!1){return lS(e,this._oidc,n)}async userInfoAsync(e=!1,n=!1){return this._oidc.userInfoAsync(e,n)}userInfo(){return this._oidc.userInfo}};Sf.getOrCreate=(t,e=new ya)=>(n,r="default")=>new Sf(Ai.getOrCreate(t,e)(n,r)),Sf.eventNames=Ai.eventNames;let tt=Sf;const uS=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Error authentication"}),he.jsx("p",{className:"oidc-authenticating__content",children:"An error occurred during authentication."})]})}),u$=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Authentication in progress"}),he.jsx("p",{className:"oidc-authenticating__content",children:"You will be redirected to the login page."})]})}),f$=()=>Math.random().toString(36).slice(2,8),d$=(t,e)=>(n,r)=>{if(typeof t.CustomEvent=="function")return new t.CustomEvent(n,r);const i=r||{bubbles:!1,cancelable:!1,detail:void 0},s=e.createEvent("CustomEvent");return s.initCustomEvent(n,i.bubbles,i.cancelable,i.detail),s.prototype=t.Event.prototype,s},h$=(t,e,n)=>({replaceState:(r,i)=>{const s=n(),o=i||t.history.state;t.history.replaceState({key:s,state:o},null,r),t.dispatchEvent(e("popstate"))}}),p$=()=>h$(window,d$(window,document),f$),fS=()=>he.jsx("div",{className:"oidc-callback",children:he.jsxs("div",{className:"oidc-callback__container",children:[he.jsx("h1",{className:"oidc-callback__title",children:"Authentication complete"}),he.jsx("p",{className:"oidc-callback__content",children:"You will be redirected to your application."})]})}),m$=({callBackError:t,callBackSuccess:e,configurationName:n,withCustomHistory:r})=>{const[i,s]=se.useState(!1);se.useEffect(()=>{let l=!0;return(async()=>{const u=tt.get;try{const{callbackPath:d}=await u(n).loginCallbackAsync();(r?r():p$()).replaceState(d||"/")}catch(d){l&&(console.warn(d),s(!0))}})(),()=>{l=!1}},[]);const o=t||uS,a=e||fS;return i?he.jsx(o,{configurationName:n}):he.jsx(a,{configurationName:n})},g$=()=>he.jsx("span",{className:"oidc-loading",children:"Loading"}),y$=()=>he.jsx("div",{className:"oidc-serviceworker",children:he.jsxs("div",{className:"oidc-serviceworker__container",children:[he.jsx("h1",{className:"oidc-serviceworker__title",children:"Unable to authenticate on this browser"}),he.jsx("p",{className:"oidc-serviceworker__content",children:"Your browser is not secure enough to make authentication work. Try updating your browser or use a newer browser."})]})}),v$=()=>he.jsx("div",{className:"oidc-session-lost",children:he.jsxs("div",{className:"oidc-session-lost__container",children:[he.jsx("h1",{className:"oidc-session-lost__title",children:"Session timed out"}),he.jsx("p",{className:"oidc-session-lost__content",children:"Your session has expired. Please re-authenticate."})]})}),b$=({configurationName:t})=>(se.useEffect(()=>{(async()=>{tt.get(t).silentLoginCallbackAsync()})().catch(e=>{console.error("Error during silent login callback:",e)})},[t]),null),_$=({configurationName:t})=>{const e=ic(window.location.href),n=tt.get,r=n(t);let i=null;for(const[s,o]of Object.entries(e))s==="state"||s==="scope"||(i===null&&(i={}),i[s]=o);return se.useEffect(()=>{r.tokens||r.loginAsync(null,i,!0,e.scope)},[]),he.jsx(he.Fragment,{})},E$=({callbackErrorComponent:t,callbackSuccessComponent:e,redirect_uri:n,silent_redirect_uri:r,silent_login_uri:i,children:s,configurationName:o,withCustomHistory:a=null})=>{const l=window?rc(window.location.href):"",[u,d]=se.useState(l);se.useEffect(()=>{const p=()=>d(rc(window.location.href));return p(),window.addEventListener("popstate",p,!1),()=>window.removeEventListener("popstate",p,!1)},[]);const h=rc(n);if(r&&u===rc(r))return he.jsx(b$,{configurationName:o});if(i&&u===rc(i))return he.jsx(_$,{configurationName:o});switch(u){case h:return he.jsx(m$,{callBackError:t,callBackSuccess:e,configurationName:o,withCustomHistory:a});default:return he.jsx(he.Fragment,{children:s})}},w$=se.memo(E$),dS={name:"",data:null},T$=({loadingComponent:t,children:e,configurationName:n})=>{const[r,i]=se.useState(!0),s=tt.get,o=s(n);return se.useEffect(()=>{let a=!0;return o&&o.tryKeepExistingSessionAsync().then(()=>{a&&i(!1)}),()=>{a=!1}},[n]),he.jsx(he.Fragment,{children:r?he.jsx(t,{configurationName:n}):he.jsx(he.Fragment,{children:e})})},sc=({isLoading:t,loadingComponent:e,children:n,configurationName:r})=>{const i=e;return t?he.jsx(i,{configurationName:r,children:n}):he.jsx(he.Fragment,{children:n})},S$=({children:t,configuration:e,configurationName:n="default",callbackSuccessComponent:r=fS,authenticatingComponent:i=u$,loadingComponent:s=g$,serviceWorkerNotSupportedComponent:o=y$,authenticatingErrorComponent:a=uS,sessionLostComponent:l=v$,onSessionLost:u=null,onLogoutFromAnotherTab:d=null,onLogoutFromSameTab:h=null,withCustomHistory:p=null,onEvent:g=null,getFetch:y=null,location:b=null})=>{const _=(je="default")=>tt.getOrCreate(y??cS,b??new ya)(e,je),[w,O]=se.useState(!0),[N,I]=se.useState(dS),[P,R]=se.useState("default");se.useEffect(()=>{const je=_(n).subscribeEvents((te,xe)=>{g&&g(n,te,xe)});return()=>{_(n).removeEventSubscription(je)}},[n,g]),se.useEffect(()=>{const je=_(n).subscribeEvents((te,xe)=>{if(te===tt.eventNames.refreshTokensAsync_error||te===tt.eventNames.syncTokensAsync_error){if(u!=null){u();return}I({name:te,data:xe})}else if(te===tt.eventNames.logout_from_another_tab){if(d!=null){d();return}I({name:te,data:xe})}else te===tt.eventNames.logout_from_same_tab?h!=null&&h():te===tt.eventNames.loginAsync_begin||te===tt.eventNames.loginCallbackAsync_end||te===tt.eventNames.loginAsync_error||te===tt.eventNames.loginCallbackAsync_error?I({name:te,data:xe}):te===tt.eventNames.service_worker_not_supported_by_browser&&e.service_worker_only===!0&&I({name:te,data:xe})});return R(n),O(!1),()=>{_(n).removeEventSubscription(je),I(dS)}},[e,n]);const B=l,Q=i,x=s,U=o,be=a,Oe=w||P!==n,ke=_(n);switch(N.name){case tt.eventNames.service_worker_not_supported_by_browser:return he.jsx(sc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(U,{configurationName:n})});case tt.eventNames.loginAsync_begin:return he.jsx(sc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(Q,{configurationName:n})});case tt.eventNames.loginAsync_error:case tt.eventNames.loginCallbackAsync_error:return he.jsx(sc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(be,{configurationName:n})});case tt.eventNames.refreshTokensAsync_error:case tt.eventNames.syncTokensAsync_error:case tt.eventNames.logout_from_another_tab:return he.jsx(sc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(B,{configurationName:n})});default:return he.jsx(sc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(w$,{redirect_uri:ke.configuration.redirect_uri,silent_redirect_uri:ke.configuration.silent_redirect_uri,silent_login_uri:ke.configuration.silent_login_uri,callbackSuccessComponent:r,callbackErrorComponent:a,authenticatingComponent:i,configurationName:n,withCustomHistory:p,location:b??new ya,children:he.jsx(T$,{loadingComponent:x,configurationName:n,children:t})})})}},hS="default",Pg=(t,e)=>{let n=!1;return t(e)&&(n=t(e).tokens!=null),n},O$=(t=hS)=>{const e=tt.get,[n,r]=se.useState(Pg(e,t));return se.useEffect(()=>{let i=!0;const s=e(t);r(Pg(e,t));const o=s.subscribeEvents((a,l)=>{(a===tt.eventNames.logout_from_another_tab||a===tt.eventNames.logout_from_same_tab||a===tt.eventNames.token_acquired)&&i&&r(Pg(e,t))});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),{login:(i=void 0,s=void 0,o=!1)=>e(t).loginAsync(i,s,!1,void 0,o),logout:(i=void 0,s=void 0)=>e(t).logoutAsync(i,s),renewTokens:async(i=void 0)=>{const s=await e(t).renewTokensAsync(i);return{accessToken:s.accessToken,accessTokenPayload:s.accessTokenPayload,idToken:s.idToken,idTokenPayload:s.idTokenPayload}},isAuthenticated:n}},pS={accessToken:null,accessTokenPayload:null},k$=t=>{const e=tt.get,n=e(t);if(n.tokens){const r=n.tokens;return{accessToken:r.accessToken,accessTokenPayload:r.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:n.configuration.demonstrating_proof_of_possession?(i,s)=>n.generateDemonstrationOfProofOfPossessionAsync(r.accessToken,i,s):null}}return pS};function N$(t,e){return t.configuration.demonstrating_proof_of_possession?(n,r,i={})=>t.generateDemonstrationOfProofOfPossessionAsync(e.accessToken,n,r,i):null}const A$=(t=hS)=>{const e=tt.get,[n,r]=se.useState(k$(t));return se.useEffect(()=>{let i=!0;const s=e(t);if(s.tokens){const a=s.tokens;r({accessToken:a.accessToken,accessTokenPayload:a.accessTokenPayload})}const o=s.subscribeEvents((a,l)=>{if((a===tt.eventNames.token_renewed||a===tt.eventNames.token_acquired||a===tt.eventNames.logout_from_another_tab||a===tt.eventNames.logout_from_same_tab||a===tt.eventNames.refreshTokensAsync_error||a===tt.eventNames.syncTokensAsync_error)&&i){const u=s.tokens;r(u!=null?{accessToken:u.accessToken,accessTokenPayload:u.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:N$(s,u)}:pS)}});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),n};var Of={DOCUMENT:"Document",FRAGMENT_DEFINITION:"FragmentDefinition"};class I$ extends Error{constructor(e,n,r,i,s,o,a){super(e),this.name="GraphQLError",this.message=e,s&&(this.path=s),n&&(this.nodes=Array.isArray(n)?n:[n]),r&&(this.source=r),i&&(this.positions=i),o&&(this.originalError=o);var l=a;if(!l&&o){var u=o.extensions;u&&typeof u=="object"&&(l=u)}this.extensions=l||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return"GraphQLError"}}var rt,me;function Ct(t){return new I$(`Syntax Error: Unexpected token at ${me} in ${t}`)}function ir(t){if(t.lastIndex=me,t.test(rt))return rt.slice(me,me=t.lastIndex)}var kf=/ +(?=[^\s])/y;function x$(t){for(var e=t.split(`
|
|
215
|
+
Check the top-level render call using <`+M+">."),ae}var N=ie,I=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),U=Symbol.for("react.context"),be=Symbol.for("react.forward_ref"),Oe=Symbol.for("react.suspense"),ke=Symbol.for("react.suspense_list"),je=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),xe=Symbol.for("react.offscreen"),fe=Symbol.iterator,Ee=Symbol.for("react.client.reference"),ye=N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ut=Object.prototype.hasOwnProperty,ve=Object.assign,$=Symbol.for("react.client.reference"),Z=Array.isArray,Y=0,ee,we,Pe,Ze,ln,Fs,Kr;r.__reactDisabledLog=!0;var $t,Vc,Pn=!1,$i=new(typeof WeakMap=="function"?WeakMap:Map),Zv=Symbol.for("react.client.reference"),xr,jc={},Qd={},Ls={};Xl.Fragment=R,Xl.jsx=function(M,ae,le,nt,At){return y(M,ae,le,!1,nt,At)},Xl.jsxs=function(M,ae,le,nt,At){return y(M,ae,le,!0,nt,At)}}()),Xl}process.env.NODE_ENV==="production"?Tg.exports=mL():Tg.exports=gL();var he=Tg.exports;let ya=class{open(e){window.location.href=e}reload(){window.location.reload()}getCurrentHref(){return window.location.href}getPath(){const e=window.location;return e.pathname+(e.search||"")+(e.hash||"")}getOrigin(){return window.origin}};const UT=2e3,va=console;class yL{constructor(e,n,r,i=UT,s=!0){this._callback=e,this._client_id=n,this._url=r,this._interval=i||UT,this._stopOnError=s;const o=r.indexOf("/",r.indexOf("//")+2);this._frame_origin=r.substring(0,o),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.width=0,this._frame.height=0,this._frame.src=r}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1)})}_message(e){e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&(e.data==="error"?(va.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):e.data==="changed"?(va.debug(e),va.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):va.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))}start(e){va.debug("CheckSessionIFrame.start :"+e),this.stop();const n=()=>{this._frame.contentWindow.postMessage(this._client_id+" "+e,this._frame_origin)};n(),this._timer=window.setInterval(n,this._interval)}stop(){this._timer&&(va.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)}}const qe={service_worker_not_supported_by_browser:"service_worker_not_supported_by_browser",token_acquired:"token_acquired",logout_from_another_tab:"logout_from_another_tab",logout_from_same_tab:"logout_from_same_tab",token_renewed:"token_renewed",token_timer:"token_timer",loginAsync_begin:"loginAsync_begin",loginAsync_error:"loginAsync_error",loginCallbackAsync_begin:"loginCallbackAsync_begin",loginCallbackAsync_end:"loginCallbackAsync_end",loginCallbackAsync_error:"loginCallbackAsync_error",refreshTokensAsync_begin:"refreshTokensAsync_begin",refreshTokensAsync:"refreshTokensAsync",refreshTokensAsync_end:"refreshTokensAsync_end",refreshTokensAsync_error:"refreshTokensAsync_error",refreshTokensAsync_silent_error:"refreshTokensAsync_silent_error",tryKeepExistingSessionAsync_begin:"tryKeepExistingSessionAsync_begin",tryKeepExistingSessionAsync_end:"tryKeepExistingSessionAsync_end",tryKeepExistingSessionAsync_error:"tryKeepExistingSessionAsync_error",silentLoginAsync_begin:"silentLoginAsync_begin",silentLoginAsync:"silentLoginAsync",silentLoginAsync_end:"silentLoginAsync_end",silentLoginAsync_error:"silentLoginAsync_error",syncTokensAsync_begin:"syncTokensAsync_begin",syncTokensAsync_lock_not_available:"syncTokensAsync_lock_not_available",syncTokensAsync_end:"syncTokensAsync_end",syncTokensAsync_error:"syncTokensAsync_error",tokensInvalidAndWaitingActionsToRefresh:"tokensInvalidAndWaitingActionsToRefresh"},Er=(t,e=sessionStorage)=>{const n=b=>(e[`oidc.${t}`]=JSON.stringify({tokens:null,status:b}),Promise.resolve()),r=async()=>{if(!e[`oidc.${t}`])return e[`oidc.${t}`]=JSON.stringify({tokens:null,status:null}),{tokens:null,status:null};const b=JSON.parse(e[`oidc.${t}`]);return Promise.resolve({tokens:b.tokens,status:b.status})},i=b=>{e[`oidc.${t}`]=JSON.stringify({tokens:b})},s=async b=>{e[`oidc.session_state.${t}`]=b},o=async()=>e[`oidc.session_state.${t}`],a=b=>{e[`oidc.nonce.${t}`]=b.nonce},l=b=>{e[`oidc.jwk.${t}`]=JSON.stringify(b)},u=()=>JSON.parse(e[`oidc.jwk.${t}`]),d=async()=>({nonce:e[`oidc.nonce.${t}`]}),h=async b=>{e[`oidc.dpop_nonce.${t}`]=b},p=()=>e[`oidc.dpop_nonce.${t}`],g=()=>e[`oidc.${t}`]?JSON.stringify({tokens:JSON.parse(e[`oidc.${t}`]).tokens}):null,y={};return{clearAsync:n,initAsync:r,setTokens:i,getTokens:g,setSessionStateAsync:s,getSessionStateAsync:o,setNonceAsync:a,getNonceAsync:d,setLoginParams:b=>{y[t]=b,e[`oidc.login.${t}`]=JSON.stringify(b)},getLoginParams:()=>{const b=e[`oidc.login.${t}`];return b?(y[t]||(y[t]=JSON.parse(b)),y[t]):(console.warn(`storage[oidc.login.${t}] is empty, you should have an bad OIDC or code configuration somewhere.`),null)},getStateAsync:async()=>e[`oidc.state.${t}`],setStateAsync:async b=>{e[`oidc.state.${t}`]=b},getCodeVerifierAsync:async()=>e[`oidc.code_verifier.${t}`],setCodeVerifierAsync:async b=>{e[`oidc.code_verifier.${t}`]=b},setDemonstratingProofOfPossessionNonce:h,getDemonstratingProofOfPossessionNonce:p,setDemonstratingProofOfPossessionJwkAsync:l,getDemonstratingProofOfPossessionJwkAsync:u}};var Zl=(t=>(t.AutomaticBeforeTokenExpiration="AutomaticBeforeTokensExpiration",t.AutomaticOnlyWhenFetchExecuted="AutomaticOnlyWhenFetchExecuted",t))(Zl||{});const vL=t=>decodeURIComponent(Array.prototype.map.call(atob(t),e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")),bL=t=>JSON.parse(vL(t.replaceAll(/-/g,"+").replaceAll(/_/g,"/"))),qT=t=>{try{return t&&_L(t,".")===2?bL(t.split(".")[1]):null}catch(e){console.warn(e)}return null},_L=(t,e)=>t.split(e).length-1,Sg={access_token_or_id_token_invalid:"access_token_or_id_token_invalid",access_token_invalid:"access_token_invalid",id_token_invalid:"id_token_invalid"};function EL(t,e,n){if(t.issuedAt){if(typeof t.issuedAt=="string")return parseInt(t.issuedAt,10)}else return e&&e.iat?e.iat:n&&n.iat?n.iat:new Date().getTime()/1e3;return t.issuedAt}const Og=(t,e=null,n)=>{if(!t)return null;let r;const i=typeof t.expiresIn=="string"?parseInt(t.expiresIn,10):t.expiresIn;t.accessTokenPayload!==void 0?r=t.accessTokenPayload:r=qT(t.accessToken);let s;e!=null&&"idToken"in e&&!("idToken"in t)?s=e.idToken:s=t.idToken;const o=t.idTokenPayload?t.idTokenPayload:qT(s),a=o&&o.exp?o.exp:Number.MAX_VALUE,l=r&&r.exp?r.exp:t.issuedAt+i;t.issuedAt=EL(t,r,o);let u;t.expiresAt?u=t.expiresAt:n===Sg.access_token_invalid?u=l:n===Sg.id_token_invalid?u=a:u=a<l?a:l;const d={...t,idTokenPayload:o,accessTokenPayload:r,expiresAt:u,idToken:s};if(e!=null&&"refreshToken"in e&&!("refreshToken"in t)){const h=e.refreshToken;return{...d,refreshToken:h}}return d},kg=(t,e,n)=>{if(!t)return null;if(!t.issued_at){const i=new Date().getTime()/1e3;t.issued_at=i}const r={accessToken:t.access_token,expiresIn:t.expires_in,idToken:t.id_token,scope:t.scope,tokenType:t.token_type,issuedAt:t.issued_at};return"refresh_token"in t&&(r.refreshToken=t.refresh_token),t.accessTokenPayload!==void 0&&(r.accessTokenPayload=t.accessTokenPayload),t.idTokenPayload!==void 0&&(r.idTokenPayload=t.idTokenPayload),Og(r,e,n)},ec=(t,e)=>{const n=new Date().getTime()/1e3,r=e-n;return Math.round(r-t)},WT=(t,e=0)=>t?ec(e,t.expiresAt)>0:!1,zT=async(t,e=200,n=50)=>{let r=n;if(!t.getTokens())return null;for(;!WT(t.getTokens(),t.configuration.refresh_time_before_tokens_expiration_in_second)&&r>0;){if(t.configuration.token_automatic_renew_mode==Zl.AutomaticOnlyWhenFetchExecuted){await t.renewTokensAsync({});break}else await Ef({milliseconds:e});r=r-1}return{isTokensValid:WT(t.getTokens()),tokens:t.getTokens(),numberWaited:r-n}},QT=(t,e,n)=>{if(t.idTokenPayload){const r=t.idTokenPayload;if(n.issuer!==r.iss)return{isValid:!1,reason:`Issuer does not match (oidcServerConfiguration issuer) ${n.issuer} !== (idTokenPayload issuer) ${r.iss}`};const i=new Date().getTime()/1e3;if(r.exp&&r.exp<i)return{isValid:!1,reason:`Token expired (idTokenPayload exp) ${r.exp} < (currentTimeUnixSecond) ${i}`};const s=60*60*24*7;if(r.iat&&r.iat+s<i)return{isValid:!1,reason:`Token is used from too long time (idTokenPayload iat + timeInSevenDays) ${r.iat+s} < (currentTimeUnixSecond) ${i}`};if(r.nonce&&r.nonce!==e)return{isValid:!1,reason:`Nonce does not match (idTokenPayload nonce) ${r.nonce} !== (nonce) ${e}`}}return{isValid:!0,reason:""}},ba=function(){const t=typeof window>"u"?global:window;return{setTimeout:setTimeout.bind(t),clearTimeout:clearTimeout.bind(t),setInterval:setInterval.bind(t),clearInterval:clearInterval.bind(t)}}(),GT="7.22.32";let HT=null,_f;const Ef=({milliseconds:t})=>new Promise(e=>ba.setTimeout(e,t)),KT=(t="/")=>{try{_f=new AbortController,fetch(`${t}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`,{signal:_f.signal}).catch(e=>{console.log(e)}),Ef({milliseconds:150*1e3}).then(KT)}catch(e){console.log(e)}},JT=()=>{_f&&_f.abort()},wL=(t="/")=>fetch(`${t}OidcKeepAliveServiceWorker.json`,{headers:{"oidc-vanilla":"true"}}).then(e=>e.statusText==="oidc-service-worker").catch(e=>{console.log(e)}),TL=t=>async(e,n)=>{n(),await e.update();const r=await e.unregister();console.log(`Service worker unregistration ${r?"successful":"failed"}`),await Ef({milliseconds:2e3}),t.reload()},SL=t=>{const e=sessionStorage.getItem(`oidc.tabId.${t}`);if(e)return e;const n=globalThis.crypto.randomUUID();return sessionStorage.setItem(`oidc.tabId.${t}`,n),n},An=t=>e=>new Promise(function(n,r){const i=new MessageChannel;i.port1.onmessage=function(s){s!=null&&s.data.error?r(s.data.error):n(s.data),i.port1.close(),i.port2.close()},t.active.postMessage({...e,tabId:SL(e.configurationName)},[i.port2])}),wr=async(t,e)=>{var n;const r=t.service_worker_relative_url;if(typeof window>"u"||typeof navigator>"u"||!navigator.serviceWorker||!r||t.service_worker_activate()===!1)return null;let i=null;t.service_worker_register?i=await t.service_worker_register(r):(i=await navigator.serviceWorker.register(r),i.active&&i.waiting&&(console.log("Detected new service worker waiting, unregistering and reloading"),await((n=t.service_worker_update_require_callback)==null?void 0:n.call(t,i,JT))));try{await navigator.serviceWorker.ready,navigator.serviceWorker.controller||await An(i)({type:"claim"})}catch{return null}const s=async g=>An(i)({type:"clear",data:{status:g},configurationName:e}),o=async(g,y,b)=>{var _;const w=await An(i)({type:"init",data:{oidcServerConfiguration:g,where:y,oidcConfiguration:{token_renew_mode:b.token_renew_mode,service_worker_convert_all_requests_to_cors:b.service_worker_convert_all_requests_to_cors}},configurationName:e}),O=w.version;return O!==GT&&(console.warn(`Service worker ${O} version mismatch with js client version ${GT}, unregistering and reloading`),await((_=b.service_worker_update_require_callback)==null?void 0:_.call(b,i,JT))),{tokens:kg(w.tokens,null,b.token_renew_mode),status:w.status}},a=(g="/")=>{HT==null&&(HT="not_null",KT(g))},l=g=>An(i)({type:"setSessionState",data:{sessionState:g},configurationName:e}),u=async()=>(await An(i)({type:"getSessionState",data:null,configurationName:e})).sessionState,d=g=>(sessionStorage[`oidc.nonce.${e}`]=g.nonce,An(i)({type:"setNonce",data:{nonce:g},configurationName:e})),h=async()=>{let g=(await An(i)({type:"getNonce",data:null,configurationName:e})).nonce;return g||(g=sessionStorage[`oidc.nonce.${e}`],console.warn("nonce not found in service worker, using sessionStorage")),{nonce:g}},p={};return{clearAsync:s,initAsync:o,startKeepAliveServiceWorker:()=>a(t.service_worker_keep_alive_path),isServiceWorkerProxyActiveAsync:()=>wL(t.service_worker_keep_alive_path),setSessionStateAsync:l,getSessionStateAsync:u,setNonceAsync:d,getNonceAsync:h,setLoginParams:g=>{p[e]=g,localStorage[`oidc.login.${e}`]=JSON.stringify(g)},getLoginParams:()=>{const g=localStorage[`oidc.login.${e}`];return p[e]||(p[e]=JSON.parse(g)),p[e]},getStateAsync:async()=>{let g=(await An(i)({type:"getState",data:null,configurationName:e})).state;return g||(g=sessionStorage[`oidc.state.${e}`],console.warn("state not found in service worker, using sessionStorage")),g},setStateAsync:async g=>(sessionStorage[`oidc.state.${e}`]=g,An(i)({type:"setState",data:{state:g},configurationName:e})),getCodeVerifierAsync:async()=>{let g=(await An(i)({type:"getCodeVerifier",data:null,configurationName:e})).codeVerifier;return g||(g=sessionStorage[`oidc.code_verifier.${e}`],console.warn("codeVerifier not found in service worker, using sessionStorage")),g},setCodeVerifierAsync:async g=>(sessionStorage[`oidc.code_verifier.${e}`]=g,An(i)({type:"setCodeVerifier",data:{codeVerifier:g},configurationName:e})),setDemonstratingProofOfPossessionNonce:async g=>{await An(i)({type:"setDemonstratingProofOfPossessionNonce",data:{demonstratingProofOfPossessionNonce:g},configurationName:e})},getDemonstratingProofOfPossessionNonce:async()=>(await An(i)({type:"getDemonstratingProofOfPossessionNonce",data:null,configurationName:e})).demonstratingProofOfPossessionNonce,setDemonstratingProofOfPossessionJwkAsync:async g=>{const y=JSON.stringify(g);await An(i)({type:"setDemonstratingProofOfPossessionJwk",data:{demonstratingProofOfPossessionJwkJson:y},configurationName:e})},getDemonstratingProofOfPossessionJwkAsync:async()=>{const g=await An(i)({type:"getDemonstratingProofOfPossessionJwk",data:null,configurationName:e});return g.demonstratingProofOfPossessionJwkJson?JSON.parse(g.demonstratingProofOfPossessionJwkJson):null}}},_a={},OL=(t,e=window.sessionStorage,n)=>{if(!_a[t]&&e){const i=e.getItem(t);i&&(_a[t]=JSON.parse(i))}const r=1e3*n;return _a[t]&&_a[t].timestamp+r>Date.now()?_a[t].result:null},kL=(t,e,n=window.sessionStorage)=>{const r=Date.now();_a[t]={result:e,timestamp:r},n&&n.setItem(t,JSON.stringify({result:e,timestamp:r}))};function YT(t){return new TextEncoder().encode(t)}function XT(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function NL(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,n){return String.fromCharCode(parseInt(n,16))})}const Ng=t=>{let e="";return t.forEach(function(n){e+=String.fromCharCode(n)}),XT(e)};function ZT(t){return XT(NL(t))}const AL={importKeyAlgorithm:{name:"ECDSA",namedCurve:"P-256",hash:{name:"ES256"}},signAlgorithm:{name:"ECDSA",hash:{name:"SHA-256"}},generateKeyAlgorithm:{name:"ECDSA",namedCurve:"P-256"},digestAlgorithm:{name:"SHA-256"},jwtHeaderAlgorithm:"ES256"},IL=t=>async(e,n,r,i,s="dpop+jwt")=>{switch(e=Object.assign({},e),n.typ=s,n.alg=i.jwtHeaderAlgorithm,n.alg){case"ES256":n.jwk={kty:e.kty,crv:e.crv,x:e.x,y:e.y};break;case"RS256":n.jwk={kty:e.kty,n:e.n,e:e.e,kid:n.kid};break;default:throw new Error("Unknown or not implemented JWS algorithm")}const o={protected:ZT(JSON.stringify(n)),payload:ZT(JSON.stringify(r))},a=i.importKeyAlgorithm,l=!0,u=["sign"],d=await t.crypto.subtle.importKey("jwk",e,a,l,u),h=YT(`${o.protected}.${o.payload}`),p=i.signAlgorithm,g=await t.crypto.subtle.sign(p,d,h);return o.signature=Ng(new Uint8Array(g)),`${o.protected}.${o.payload}.${o.signature}`},xL={sign:IL},CL=t=>async e=>{const n=e,r=!0,i=["sign","verify"],s=await t.crypto.subtle.generateKey(n,r,i);return await t.crypto.subtle.exportKey("jwk",s.privateKey)},DL=t=>{const e=Object.assign({},t);return delete e.d,e.key_ops=["verify"],e},ML={generate:CL,neuter:DL},RL=t=>async(e,n)=>{let r;switch(e.kty){case"EC":r='{"crv":"CRV","kty":"EC","x":"X","y":"Y"}'.replace("CRV",e.crv).replace("X",e.x).replace("Y",e.y);break;case"RSA":r='{"e":"E","kty":"RSA","n":"N"}'.replace("E",e.e).replace("N",e.n);break;default:throw new Error("Unknown or not implemented JWK type")}const i=await t.crypto.subtle.digest(n,YT(r));return Ng(new Uint8Array(i))},PL={thumbprint:RL},FL=t=>async e=>await ML.generate(t)(e),eS=t=>e=>async(n,r="POST",i,s={})=>{const o={jti:btoa(LL()),htm:r,htu:i,iat:Math.round(Date.now()/1e3),...s},a=await PL.thumbprint(t)(n,e.digestAlgorithm);return await xL.sign(t)(n,{kid:a},o,e)},LL=()=>{const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",e="0123456789abcdef";let n=0,r="";for(let i=0;i<36;i++)t[i]!=="-"&&t[i]!=="4"&&(n=Math.random()*16|0),t[i]==="x"?r+=e[n]:t[i]==="y"?(n&=3,n|=8,r+=e[n]):r+=t[i];return r},tS=()=>{const t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return{hasCrypto:t,hasSubtleCrypto:e}},Ag="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",$L=t=>{const e=[];for(let n=0;n<t.byteLength;n+=1){const r=t[n]%Ag.length;e.push(Ag[r])}return e.join("")},Ig=t=>{const e=new Uint8Array(t),{hasCrypto:n}=tS();if(n)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.random()*Ag.length|0;return $L(e)};function VL(t){const e=new ArrayBuffer(t.length),n=new Uint8Array(e);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function nS(t){return new Promise((e,n)=>{crypto.subtle.digest("SHA-256",VL(t)).then(r=>e(Ng(new Uint8Array(r))),r=>n(r))})}const jL=t=>{if(t.length<43||t.length>128)return Promise.reject(new Error("Invalid code length."));const{hasSubtleCrypto:e}=tS();return e?nS(t):Promise.reject(new Error("window.crypto.subtle is unavailable."))},BL=60*60,UL=t=>async(e,n=BL,r=window.sessionStorage,i=1e4)=>{const s=`${e}/.well-known/openid-configuration`,o=`oidc.server:${e}`,a=OL(o,r,n);if(a)return new Mg(a);const l=await tc(t)(s,{},i);if(l.status!==200)return null;const u=await l.json();return kL(o,u,r),new Mg(u)},tc=t=>async(e,n={},r=1e4,i=0)=>{let s;try{const o=new AbortController;setTimeout(()=>o.abort(),r),s=await t(e,{...n,signal:o.signal})}catch(o){if(o.name==="AbortError"||o.message==="Network request failed"){if(i<=1)return await tc(t)(e,n,r,i+1);throw o}else throw console.error(o.message),o}return s},xg={refresh_token:"refresh_token",access_token:"access_token"},rS=t=>async(e,n,r=xg.refresh_token,i,s={},o=1e4)=>{const a={token:n,token_type_hint:r,client_id:i};for(const[d,h]of Object.entries(s))a[d]===void 0&&(a[d]=h);const l=[];for(const d in a){const h=encodeURIComponent(d),p=encodeURIComponent(a[d]);l.push(`${h}=${p}`)}const u=l.join("&");return(await tc(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:u},o)).status!==200?{success:!1}:{success:!0}},qL=t=>async(e,n,r,i,s={},o,a=1e4)=>{for(const[g,y]of Object.entries(r))n[g]===void 0&&(n[g]=y);const l=[];for(const g in n){const y=encodeURIComponent(g),b=encodeURIComponent(n[g]);l.push(`${y}=${b}`)}const u=l.join("&"),d=await tc(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",...s},body:u},a);if(d.status!==200)return{success:!1,status:d.status,demonstratingProofOfPossessionNonce:null};const h=await d.json();let p=null;return d.headers.has(wf)&&(p=d.headers.get(wf)),{success:!0,status:d.status,data:kg(h,i,o),demonstratingProofOfPossessionNonce:p}},WL=(t,e)=>async(n,r)=>{r=r?{...r}:{};const i=Ig(128),s=await jL(i);await t.setCodeVerifierAsync(i),await t.setStateAsync(r.state),r.code_challenge=s,r.code_challenge_method="S256";let o="";if(r)for(const[a,l]of Object.entries(r))o===""?o+="?":o+="&",o+=`${a}=${encodeURIComponent(l)}`;e.open(`${n}${o}`)},wf="DPoP-Nonce",zL=t=>async(e,n,r,i,s=1e4)=>{n=n?{...n}:{},n.code_verifier=await t.getCodeVerifierAsync();const o=[];for(const h in n){const p=encodeURIComponent(h),g=encodeURIComponent(n[h]);o.push(`${p}=${g}`)}const a=o.join("&"),l=await tc(fetch)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",...r},body:a},s);if(await Promise.all([t.setCodeVerifierAsync(null),t.setStateAsync(null)]),l.status!==200)return{success:!1,status:l.status};let u=null;l.headers.has(wf)&&(u=l.headers.get(wf));const d=await l.json();return{success:!0,data:{state:n.state,tokens:kg(d,null,i),demonstratingProofOfPossessionNonce:u}}};async function iS(t,e,n){const r=o=>{t.tokens=o},{tokens:i,status:s}=await Tf(t)(r,0,e,n);return await wr(t.configuration,t.configurationName)||await Er(t.configurationName,t.configuration.storage).setTokens(t.tokens),t.tokens?i:(await t.destroyAsync(s),null)}async function sS(t,e=!1,n=null){const r=t.configuration,i=`${r.client_id}_${t.configurationName}_${r.authority}`;let s;const o=await wr(t.configuration,t.configurationName);if((r==null?void 0:r.storage)===(window==null?void 0:window.sessionStorage)&&!o||!navigator.locks)s=await iS(t,e,n);else{let a="retry";for(;a==="retry";)a=await navigator.locks.request(i,{ifAvailable:!0},async l=>l?await iS(t,e,n):(t.publishEvent(Ai.eventNames.syncTokensAsync_lock_not_available,{lock:"lock not available"}),"retry"));s=a}return s?(t.timeoutId&&(t.timeoutId=nc(t,t.tokens.expiresAt,n)),t.tokens):null}const nc=(t,e,n=null)=>{const r=t.configuration.refresh_time_before_tokens_expiration_in_second;return t.timeoutId&&ba.clearTimeout(t.timeoutId),ba.setTimeout(async()=>{const i={timeLeft:ec(r,e)};t.publishEvent(Ai.eventNames.token_timer,i),await sS(t,!1,n)},1e3)},hs={FORCE_REFRESH:"FORCE_REFRESH",SESSION_LOST:"SESSION_LOST",NOT_CONNECTED:"NOT_CONNECTED",TOKENS_VALID:"TOKENS_VALID",TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID",LOGOUT_FROM_ANOTHER_TAB:"LOGOUT_FROM_ANOTHER_TAB",REQUIRE_SYNC_TOKENS:"REQUIRE_SYNC_TOKENS"},QL=t=>async(e,n,r,i=!1)=>{const s={nonce:null};if(!r)return{tokens:null,status:"NOT_CONNECTED",nonce:s};let o=s;const a=await t.initAsync(e.authority,e.authority_configuration),l=await wr(e,n);if(l){const{status:d,tokens:h}=await l.initAsync(a,"syncTokensAsync",e);if(d==="LOGGED_OUT")return{tokens:null,status:"LOGOUT_FROM_ANOTHER_TAB",nonce:s};if(d==="SESSIONS_LOST")return{tokens:null,status:"SESSIONS_LOST",nonce:s};if(!d||!h)return{tokens:null,status:"REQUIRE_SYNC_TOKENS",nonce:s};if(h.issuedAt!==r.issuedAt){const p=ec(e.refresh_time_before_tokens_expiration_in_second,h.expiresAt)>0?"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID":"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID",g=await l.getNonceAsync();return{tokens:h,status:p,nonce:g}}o=await l.getNonceAsync()}else{const d=Er(n,e.storage??sessionStorage),h=await d.initAsync();let{tokens:p}=h;const{status:g}=h;if(p&&(p=Og(p,t.tokens,e.token_renew_mode)),p){if(g==="SESSIONS_LOST")return{tokens:null,status:"SESSIONS_LOST",nonce:s};if(p.issuedAt!==r.issuedAt){const y=ec(e.refresh_time_before_tokens_expiration_in_second,p.expiresAt)>0?"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID":"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID",b=await d.getNonceAsync();return{tokens:p,status:y,nonce:b}}}else return{tokens:null,status:"LOGOUT_FROM_ANOTHER_TAB",nonce:s};o=await d.getNonceAsync()}const u=ec(e.refresh_time_before_tokens_expiration_in_second,r.expiresAt)>0?"TOKENS_VALID":"TOKENS_INVALID";return i?{tokens:r,status:"FORCE_REFRESH",nonce:o}:{tokens:r,status:u,nonce:o}},Tf=t=>async(e,n=0,r=!1,i=null)=>{if(!navigator.onLine&&document.hidden)return{tokens:t.tokens,status:"GIVE_UP"};let s=6;for(;!navigator.onLine&&s>0;)await Ef({milliseconds:1e3}),s--,t.publishEvent(qe.refreshTokensAsync,{message:`wait because navigator is offline try ${s}`});const o=n+1;i||(i={});const a=t.configuration,l=(d,h=null,p=null)=>Cg(t.configurationName,t.configuration,t.publishEvent.bind(t))(d,h,p),u=async()=>{try{let d;const h=await wr(a,t.configurationName);h?d=h.getLoginParams():d=Er(t.configurationName,a.storage).getLoginParams();const p=await l({...d.extras,...i,prompt:"none"});return p?p.error?(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token silent"}),{tokens:null,status:"SESSION_LOST"}):(e(p.tokens),t.publishEvent(Ai.eventNames.token_renewed,{}),{tokens:p.tokens,status:"LOGGED"}):(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token silent not active"}),{tokens:null,status:"SESSION_LOST"})}catch(d){return console.error(d),t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"exceptionSilent",exception:d.message}),await Tf(t)(e,o,r,i)}};try{const{status:d,tokens:h,nonce:p}=await QL(t)(a,t.configurationName,t.tokens,r);switch(d){case hs.SESSION_LOST:return e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token session lost"}),{tokens:null,status:"SESSION_LOST"};case hs.NOT_CONNECTED:return e(null),{tokens:null,status:null};case hs.TOKENS_VALID:return e(h),{tokens:h,status:"LOGGED_IN"};case hs.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:return e(h),t.publishEvent(Ai.eventNames.token_renewed,{reason:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID"}),{tokens:h,status:"LOGGED_IN"};case hs.LOGOUT_FROM_ANOTHER_TAB:return e(null),t.publishEvent(qe.logout_from_another_tab,{status:"session syncTokensAsync"}),{tokens:null,status:"LOGGED_OUT"};case hs.REQUIRE_SYNC_TOKENS:return a.token_automatic_renew_mode==Zl.AutomaticOnlyWhenFetchExecuted&&hs.FORCE_REFRESH!==d?(t.publishEvent(qe.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"}):(t.publishEvent(qe.refreshTokensAsync_begin,{tryNumber:n}),await u());default:{if(a.token_automatic_renew_mode==Zl.AutomaticOnlyWhenFetchExecuted&&hs.FORCE_REFRESH!==d)return t.publishEvent(qe.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"};if(t.publishEvent(qe.refreshTokensAsync_begin,{refreshToken:h.refreshToken,status:d,tryNumber:n}),!h.refreshToken)return await u();const g=a.client_id,y=a.redirect_uri,b=a.authority,_={...a.token_request_extras?a.token_request_extras:{}};for(const[w,O]of Object.entries(i))w.endsWith(":token_request")&&(_[w.replace(":token_request","")]=O);return await(async()=>{const w={client_id:g,redirect_uri:y,grant_type:"refresh_token",refresh_token:h.refreshToken},O=await t.initAsync(b,a.authority_configuration),N=document.hidden?1e4:3e4*10,I=O.tokenEndpoint,P={};a.demonstrating_proof_of_possession&&(P.DPoP=await t.generateDemonstrationOfProofOfPossessionAsync(h.accessToken,I,"POST"));const R=await qL(t.getFetch())(I,w,_,h,P,a.token_renew_mode,N);if(R.success){const{isValid:B,reason:Q}=QT(R.data,p.nonce,O);if(!B)return e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:`refresh token return not valid tokens, reason: ${Q}`}),{tokens:null,status:"SESSION_LOST"};if(e(R.data),R.demonstratingProofOfPossessionNonce){const x=await wr(a,t.configurationName);x?await x.setDemonstratingProofOfPossessionNonce(R.demonstratingProofOfPossessionNonce):await Er(t.configurationName,a.storage).setDemonstratingProofOfPossessionNonce(R.demonstratingProofOfPossessionNonce)}return t.publishEvent(qe.refreshTokensAsync_end,{success:R.success}),t.publishEvent(Ai.eventNames.token_renewed,{reason:"REFRESH_TOKEN"}),{tokens:R.data,status:"LOGGED_IN"}}else return t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"bad request",tokenResponse:R}),R.status>=400&&R.status<500?(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:`session lost: ${R.status}`}),{tokens:null,status:"SESSION_LOST"}):await Tf(t)(e,o,r,i)})()}}}catch(d){return console.error(d),t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"exception",exception:d.message}),new Promise((h,p)=>{setTimeout(()=>{Tf(t)(e,o,r,i).then(h).catch(p)},1e3)})}},Cg=(t,e,n)=>(r=null,i=null,s=null)=>{if(!e.silent_redirect_uri||!e.silent_login_uri)return Promise.resolve(null);try{n(qe.silentLoginAsync_begin,{});let o="";if(i&&(r==null&&(r={}),r.state=i),s&&(r==null&&(r={}),r.scope=s),r!=null)for(const[h,p]of Object.entries(r))o===""?o=`?${encodeURIComponent(h)}=${encodeURIComponent(p)}`:o+=`&${encodeURIComponent(h)}=${encodeURIComponent(p)}`;const a=e.silent_login_uri+o,l=a.indexOf("/",a.indexOf("//")+2),u=a.substring(0,l),d=document.createElement("iframe");return d.width="0px",d.height="0px",d.id=`${t}_oidc_iframe`,d.setAttribute("src",a),document.body.appendChild(d),new Promise((h,p)=>{let g=!1;const y=()=>{window.removeEventListener("message",b),d.remove(),g=!0},b=_=>{if(_.origin===u&&_.source===d.contentWindow){const w=`${t}_oidc_tokens:`,O=`${t}_oidc_error:`,N=`${t}_oidc_exception:`,I=_.data;if(I&&typeof I=="string"&&!g){if(I.startsWith(w)){const P=JSON.parse(_.data.replace(w,""));n(qe.silentLoginAsync_end,{}),h(P),y()}else if(I.startsWith(O)){const P=JSON.parse(_.data.replace(O,""));n(qe.silentLoginAsync_error,P),h({error:"oidc_"+P.error,tokens:null,sessionState:null}),y()}else if(I.startsWith(N)){const P=JSON.parse(_.data.replace(N,""));n(qe.silentLoginAsync_error,P),p(new Error(P.error)),y()}}}};try{window.addEventListener("message",b);const _=e.silent_login_timeout;setTimeout(()=>{g||(y(),n(qe.silentLoginAsync_error,{reason:"timeout"}),p(new Error("timeout")))},_)}catch(_){y(),n(qe.silentLoginAsync_error,_),p(_)}})}catch(o){throw n(qe.silentLoginAsync_error,o),o}},GL=(t,e,n,r,i)=>(s=null,o=void 0)=>{s={...s};const a=(l,u,d)=>Cg(e,n,r.bind(i))(l,u,d);return(async()=>{i.timeoutId&&ba.clearTimeout(i.timeoutId);let l;s&&"state"in s&&(l=s.state,delete s.state);try{const u=n.extras?{...n.extras,...s}:s,d=await a({...u,prompt:"none"},l,o);if(d)return i.tokens=d.tokens,r(qe.token_acquired,{}),i.timeoutId=nc(i,i.tokens.expiresAt,s),{}}catch(u){return u}})()},HL=(t,e,n)=>(r,i,s,o=!1)=>{const a=(l,u=void 0,d=void 0)=>Cg(t.configurationName,n,t.publishEvent.bind(t))(l,u,d);return new Promise((l,u)=>{if(n.silent_login_uri&&n.silent_redirect_uri&&n.monitor_session&&r&&s&&!o){const d=()=>{t.checkSessionIFrame.stop();const h=t.tokens;if(h===null)return;const p=h.idToken,g=h.idTokenPayload;return a({prompt:"none",id_token_hint:p,scope:n.scope||"openid"}).then(y=>{if(y.error)throw new Error(y.error);const b=y.tokens.idTokenPayload;if(g.sub===b.sub){const _=y.sessionState;t.checkSessionIFrame.start(y.sessionState),g.sid===b.sid?console.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",_):console.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",_)}else console.debug("SessionMonitor._callback: Different subject signed into OP:",b.sub)}).catch(async y=>{console.warn("SessionMonitor._callback: Silent login failed, logging out other tabs:",y);for(const[,b]of Object.entries(e))await b.logoutOtherTabAsync(n.client_id,g.sub)})};t.checkSessionIFrame=new yL(d,i,r),t.checkSessionIFrame.load().then(()=>{t.checkSessionIFrame.start(s),l(t.checkSessionIFrame)}).catch(h=>{u(h)})}else l(null)})},KL=t=>!!(t.os==="iOS"&&t.osVersion.startsWith("12")||t.os==="Mac OS X"&&t.osVersion.startsWith("10_15_6")),JL=t=>{const e=t.appVersion,n=t.userAgent,r="-";let i=r;const s=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Chrome OS",r:/CrOS/},{s:"Linux",r:/(Linux|X11(?!.*CrOS))/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(const a in s){const l=s[a];if(l.r.test(n)){i=l.s;break}}let o=r;switch(/Windows/.test(i)&&(o=/Windows (.*)/.exec(i)[1],i="Windows"),i){case"Mac OS":case"Mac OS X":case"Android":o=/(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([._\d]+)/.exec(n)[1];break;case"iOS":{const a=/OS (\d+)_(\d+)_?(\d+)?/.exec(e);a!=null&&a.length>2&&(o=a[1]+"."+a[2]+"."+(parseInt(a[3])|0));break}}return{os:i,osVersion:o}};function YL(){const t=navigator.userAgent;let e,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(n[1]))return e=/\brv[ :]+(\d+)/g.exec(t)||[],{name:"ie",version:e[1]||""};if(n[1]==="Chrome"&&(e=t.match(/\bOPR|Edge\/(\d+)/),e!=null)){let r=e[1];if(!r){const i=t.split(e[0]+"/");i.length>1&&(r=i[1])}return{name:"opera",version:r}}return n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],(e=t.match(/version\/(\d+)/i))!=null&&n.splice(1,1,e[1]),{name:n[0].toLowerCase(),version:n[1]}}const XL=()=>{const{name:t,version:e}=YL();if(t==="chrome"&&parseInt(e)<=70||t==="opera"&&(!e||parseInt(e.split(".")[0])<80)||t==="ie")return!1;const n=JL(navigator);return!KL(n)},ZL=async t=>{let e;if(t.tokens!=null)return!1;t.publishEvent(qe.tryKeepExistingSessionAsync_begin,{});try{const n=t.configuration,r=await t.initAsync(n.authority,n.authority_configuration);if(e=await wr(n,t.configurationName),e){const{tokens:i}=await e.initAsync(r,"tryKeepExistingSessionAsync",n);if(i){e.startKeepAliveServiceWorker(),t.tokens=i;const s=e.getLoginParams(t.configurationName);t.timeoutId=nc(t,t.tokens.expiresAt,s.extras);const o=await e.getSessionStateAsync();return await t.startCheckSessionAsync(r.check_session_iframe,n.client_id,o),n.preload_user_info&&await t.userInfoAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside ServiceWorker are valid"}),!0}t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!1,message:"no exiting session found"})}else{n.service_worker_relative_url&&t.publishEvent(qe.service_worker_not_supported_by_browser,{message:"service worker is not supported by this browser"});const i=Er(t.configurationName,n.storage??sessionStorage),{tokens:s}=await i.initAsync();if(s){t.tokens=Og(s,null,n.token_renew_mode);const o=i.getLoginParams();t.timeoutId=nc(t,t.tokens.expiresAt,o.extras);const a=await i.getSessionStateAsync();return await t.startCheckSessionAsync(r.check_session_iframe,n.client_id,a),n.preload_user_info&&await t.userInfoAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside storage are valid"}),!0}}return t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!1,message:e?"service worker sessions not retrieved":"session storage sessions not retrieved"}),!1}catch(n){return console.error(n),e&&await e.clearAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_error,"tokens inside ServiceWorker are invalid"),!1}},oS=t=>{const e=t.match(/^([a-z][\w-]+\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);if(!e)throw new Error("Invalid URL");let n=e[6],r=e[7];if(r){const i=r.split("?");i.length===2&&(r=i[0],n=i[1])}return n.startsWith("?")&&(n=n.slice(1)),e&&{href:t,protocol:e[1],host:e[2],hostname:e[3],port:e[4],path:e[5],search:n,hash:r}},rc=t=>{const e=oS(t);let{path:n}=e;n.endsWith("/")&&(n=n.slice(0,-1));let{hash:r}=e;return r==="#_=_"&&(r=""),r&&(n+=r),n},ic=t=>{const e=oS(t),{search:n}=e;return e$(n)},e$=t=>{const e={};let n,r,i;const s=t.split("&");for(r=0,i=s.length;r<i;r++)n=s[r].split("="),e[decodeURIComponent(n[0])]=decodeURIComponent(n[1]);return e},t$=(t,e,n,r,i)=>(s=void 0,o=null,a=!1,l=void 0)=>{const u=o;return o={...o},(async()=>{const d=s||i.getPath();if("state"in o||(o.state=Ig(16)),n(qe.loginAsync_begin,{}),o)for(const h of Object.keys(o))h.endsWith(":token_request")&&delete o[h];try{const h=a?e.silent_redirect_uri:e.redirect_uri;l||(l=e.scope);const p=e.extras?{...e.extras,...o}:o;p.nonce||(p.nonce=Ig(12));const g={nonce:p.nonce},y=await wr(e,t),b=await r(e.authority,e.authority_configuration);let _;if(y)y.setLoginParams({callbackPath:d,extras:u}),await y.initAsync(b,"loginAsync",e),await y.setNonceAsync(g),y.startKeepAliveServiceWorker(),_=y;else{const O=Er(t,e.storage??sessionStorage);O.setLoginParams({callbackPath:d,extras:u}),await O.setNonceAsync(g),_=O}const w={client_id:e.client_id,redirect_uri:h,scope:l,response_type:"code",...p};await WL(_,i)(b.authorizationEndpoint,w)}catch(h){throw n(qe.loginAsync_error,h),h}})()},n$=t=>async(e=!1)=>{try{t.publishEvent(qe.loginCallbackAsync_begin,{});const n=t.configuration,r=n.client_id,i=e?n.silent_redirect_uri:n.redirect_uri,s=n.authority,o=n.token_request_timeout,a=await t.initAsync(s,n.authority_configuration),l=t.location.getCurrentHref(),u=ic(l).session_state,d=await wr(n,t.configurationName);let h,p,g,y;if(d)await d.initAsync(a,"loginCallbackAsync",n),await d.setSessionStateAsync(u),p=await d.getNonceAsync(),g=d.getLoginParams(),y=await d.getStateAsync(),d.startKeepAliveServiceWorker(),h=d;else{const U=Er(t.configurationName,n.storage??sessionStorage);await U.setSessionStateAsync(u),p=await U.getNonceAsync(),g=U.getLoginParams(),y=await U.getStateAsync(),h=U}const b=ic(l);if(b.error||b.error_description)throw new Error(`Error from OIDC server: ${b.error} - ${b.error_description}`);if(b.iss&&b.iss!==a.issuer)throw console.error(),new Error(`Issuer not valid (expected: ${a.issuer}, received: ${b.iss})`);if(b.state&&b.state!==y)throw new Error(`State not valid (expected: ${y}, received: ${b.state})`);const _={code:b.code,grant_type:"authorization_code",client_id:n.client_id,redirect_uri:i},w={};if(n.token_request_extras)for(const[U,be]of Object.entries(n.token_request_extras))w[U]=be;if(g!=null&&g.extras)for(const[U,be]of Object.entries(g.extras))U.endsWith(":token_request")&&(w[U.replace(":token_request","")]=be);const O=a.tokenEndpoint,N={};if(n.demonstrating_proof_of_possession)if(d)N.DPoP=`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${t.configurationName}`;else{const U=await FL(window)(n.demonstrating_proof_of_possession_configuration.generateKeyAlgorithm);await Er(t.configurationName,n.storage).setDemonstratingProofOfPossessionJwkAsync(U),N.DPoP=await eS(window)(n.demonstrating_proof_of_possession_configuration)(U,"POST",O)}const I=await zL(h)(O,{..._,...w},N,t.configuration.token_renew_mode,o);if(!I.success)throw new Error("Token request failed");let P;const R=I.data.tokens,B=I.data.demonstratingProofOfPossessionNonce;if(I.data.state!==w.state)throw new Error("state is not valid");const{isValid:Q,reason:x}=QT(R,p.nonce,a);if(!Q)throw new Error(`Tokens are not OpenID valid, reason: ${x}`);if(d){if(R.refreshToken&&!R.refreshToken.includes("SECURED_BY_OIDC_SERVICE_WORKER"))throw new Error("Refresh token should be hidden by service worker");if(B&&R!=null&&R.accessToken.includes("SECURED_BY_OIDC_SERVICE_WORKER"))throw new Error("Demonstration of proof of possession require Access token not hidden by service worker")}if(d)await d.initAsync(a,"syncTokensAsync",n),P=d.getLoginParams(),B&&await d.setDemonstratingProofOfPossessionNonce(B);else{const U=Er(t.configurationName,n.storage);P=U.getLoginParams(),B&&await U.setDemonstratingProofOfPossessionNonce(B)}return await t.startCheckSessionAsync(a.checkSessionIframe,r,u,e),t.publishEvent(qe.loginCallbackAsync_end,{}),{tokens:R,state:"request.state",callbackPath:P.callbackPath}}catch(n){throw console.error(n),t.publishEvent(qe.loginCallbackAsync_error,n),n}},aS={access_token:"access_token",refresh_token:"refresh_token"},Dg=(t,e)=>{const n={};if(t){for(const[r,i]of Object.entries(t))if(r.endsWith(e)){const s=r.replace(e,"");n[s]=i}return n}return n},r$=t=>{const e={};if(t){for(const[n,r]of Object.entries(t))n.includes(":")||(e[n]=r);return e}return e},i$=t=>async e=>{ba.clearTimeout(t.timeoutId),t.timeoutId=null,t.checkSessionIFrame&&t.checkSessionIFrame.stop();const n=await wr(t.configuration,t.configurationName);n?await n.clearAsync(e):await Er(t.configurationName,t.configuration.storage).clearAsync(e),t.tokens=null,t.userInfo=null},s$=(t,e,n,r,i)=>async(s=void 0,o=null)=>{var a,l;const u=t.configuration,d=await t.initAsync(u.authority,u.authority_configuration);s&&typeof s!="string"&&(s=void 0,r.warn("callbackPathOrUrl path is not a string"));const h=s??i.getPath();let p=!1;s&&(p=s.includes("https://")||s.includes("http://"));const g=p?s:i.getOrigin()+h,y=t.tokens?t.tokens.idToken:"";try{const O=d.revocationEndpoint;if(O){const N=[],I=t.tokens?t.tokens.accessToken:null;if(I&&u.logout_tokens_to_invalidate.includes(aS.access_token)){const R=Dg(o,":revoke_access_token"),B=rS(n)(O,I,xg.access_token,u.client_id,R);N.push(B)}const P=t.tokens?t.tokens.refreshToken:null;if(P&&u.logout_tokens_to_invalidate.includes(aS.refresh_token)){const R=Dg(o,":revoke_refresh_token"),B=rS(n)(O,P,xg.refresh_token,u.client_id,R);N.push(B)}N.length>0&&await Promise.all(N)}}catch(O){r.warn("logoutAsync: error when revoking tokens, if the error persist, you ay configure property logout_tokens_to_invalidate from configuration to avoid this error"),r.warn(O)}const b=((l=(a=t.tokens)==null?void 0:a.idTokenPayload)==null?void 0:l.sub)??null;await t.destroyAsync("LOGGED_OUT");for(const[,O]of Object.entries(e))O!==t?await t.logoutSameTabAsync(t.configuration.client_id,b):t.publishEvent(qe.logout_from_same_tab,{});const _=Dg(o,":oidc");if(_&&_.no_reload==="true")return;const w=r$(o);if(d.endSessionEndpoint){"id_token_hint"in w||(w.id_token_hint=y),!("post_logout_redirect_uri"in w)&&s!==null&&(w.post_logout_redirect_uri=g);let O="";for(const[N,I]of Object.entries(w))I!=null&&(O===""?O+="?":O+="&",O+=`${N}=${encodeURIComponent(I)}`);i.open(`${d.endSessionEndpoint}${O}`)}else i.reload()},lS=(t,e,n=!1)=>async(...r)=>{var i;const[s,o,...a]=r,l=o?{...o}:{method:"GET"};let u=new Headers;l.headers&&(u=l.headers instanceof Headers?l.headers:new Headers(l.headers));const d={getTokens:()=>e.tokens,configuration:{token_automatic_renew_mode:e.configuration.token_automatic_renew_mode,refresh_time_before_tokens_expiration_in_second:e.configuration.refresh_time_before_tokens_expiration_in_second},renewTokensAsync:e.renewTokensAsync.bind(e)},h=await zT(d),p=(i=h==null?void 0:h.tokens)==null?void 0:i.accessToken;if(u.has("Accept")||u.set("Accept","application/json"),p){if(e.configuration.demonstrating_proof_of_possession&&n){const y=await e.generateDemonstrationOfProofOfPossessionAsync(p,s.toString(),l.method);u.set("Authorization",`PoP ${p}`),u.set("DPoP",y)}else u.set("Authorization",`Bearer ${p}`);l.credentials||(l.credentials="same-origin")}const g={...l,headers:u};return await t(s,g,...a)},o$=t=>async(e=!1,n=!1)=>{if(t.userInfo!=null&&!e)return t.userInfo;const r=t.configuration,i=(await t.initAsync(r.authority,r.authority_configuration)).userInfoEndpoint,s=await(async()=>{const o=await lS(fetch,t,n)(i);return o.status!==200?null:o.json()})();return t.userInfo=s,s},cS=()=>fetch;let Mg=class{constructor(e){this.authorizationEndpoint=e.authorization_endpoint,this.tokenEndpoint=e.token_endpoint,this.revocationEndpoint=e.revocation_endpoint,this.userInfoEndpoint=e.userinfo_endpoint,this.checkSessionIframe=e.check_session_iframe,this.issuer=e.issuer,this.endSessionEndpoint=e.end_session_endpoint}};const ho={},a$=(t,e=new ya)=>(n,r="default")=>(ho[r]||(ho[r]=new Ai(n,r,t,e)),ho[r]),l$=async t=>{const{parsedTokens:e,callbackPath:n}=await t.loginCallbackAsync();return t.timeoutId=nc(t,e.expiresAt),{callbackPath:n}},c$=t=>Math.floor(Math.random()*t),Rg=class rC{constructor(e,n="default",r,i=new ya){this.initPromise=null,this.tryKeepExistingSessionPromise=null,this.loginPromise=null,this.loginCallbackPromise=null,this.loginCallbackWithAutoTokensRenewPromise=null,this.userInfoPromise=null,this.renewTokensPromise=null,this.logoutPromise=null;let s=e.silent_login_uri;e.silent_redirect_uri&&!e.silent_login_uri&&(s=`${e.silent_redirect_uri.replace("-callback","").replace("callback","")}-login`);let o=e.refresh_time_before_tokens_expiration_in_second??120;o>60&&(o=o-Math.floor(Math.random()*40)),this.location=i??new ya;const a=e.service_worker_update_require_callback??TL(this.location);this.configuration={...e,silent_login_uri:s,token_automatic_renew_mode:e.token_automatic_renew_mode??Zl.AutomaticBeforeTokenExpiration,monitor_session:e.monitor_session??!1,refresh_time_before_tokens_expiration_in_second:o,silent_login_timeout:e.silent_login_timeout??12e3,token_renew_mode:e.token_renew_mode??Sg.access_token_or_id_token_invalid,demonstrating_proof_of_possession:e.demonstrating_proof_of_possession??!1,authority_timeout_wellknowurl_in_millisecond:e.authority_timeout_wellknowurl_in_millisecond??1e4,logout_tokens_to_invalidate:e.logout_tokens_to_invalidate??["access_token","refresh_token"],service_worker_update_require_callback:a,service_worker_activate:e.service_worker_activate??XL,demonstrating_proof_of_possession_configuration:e.demonstrating_proof_of_possession_configuration??AL,preload_user_info:e.preload_user_info??!1},this.getFetch=r??cS,this.configurationName=n,this.tokens=null,this.userInfo=null,this.events=[],this.timeoutId=null,this.loginCallbackWithAutoTokensRenewAsync.bind(this),this.initAsync.bind(this),this.loginCallbackAsync.bind(this),this.subscribeEvents.bind(this),this.removeEventSubscription.bind(this),this.publishEvent.bind(this),this.destroyAsync.bind(this),this.logoutAsync.bind(this),this.renewTokensAsync.bind(this),this.initAsync(this.configuration.authority,this.configuration.authority_configuration)}subscribeEvents(e){const n=c$(9999999999999).toString();return this.events.push({id:n,func:e}),n}removeEventSubscription(e){const n=this.events.filter(r=>r.id!==e);this.events=n}publishEvent(e,n){this.events.forEach(r=>{r.func(e,n)})}static get(e="default"){const n=typeof process>"u";if(!Object.prototype.hasOwnProperty.call(ho,e)&&n)throw Error(`OIDC library does seem initialized.
|
|
216
|
+
Please checkout that you are using OIDC hook inside a <OidcProvider configurationName="${e}"></OidcProvider> component.`);return ho[e]}_silentLoginCallbackFromIFrame(){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const e=this.location,n=ic(e.getCurrentHref());window.parent.postMessage(`${this.configurationName}_oidc_tokens:${JSON.stringify({tokens:this.tokens,sessionState:n.session_state})}`,e.getOrigin())}}_silentLoginErrorCallbackFromIFrame(e=null){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const n=this.location,r=ic(n.getCurrentHref());r.error?window.parent.postMessage(`${this.configurationName}_oidc_error:${JSON.stringify({error:r.error})}`,n.getOrigin()):window.parent.postMessage(`${this.configurationName}_oidc_exception:${JSON.stringify({error:e==null?"":e.toString()})}`,n.getOrigin())}}async silentLoginCallbackAsync(){try{await this.loginCallbackAsync(!0),this._silentLoginCallbackFromIFrame()}catch(e){console.error(e),this._silentLoginErrorCallbackFromIFrame(e)}}async initAsync(e,n){if(this.initPromise!==null)return this.initPromise;const r=async()=>{if(n!=null)return new Mg({authorization_endpoint:n.authorization_endpoint,end_session_endpoint:n.end_session_endpoint,revocation_endpoint:n.revocation_endpoint,token_endpoint:n.token_endpoint,userinfo_endpoint:n.userinfo_endpoint,check_session_iframe:n.check_session_iframe,issuer:n.issuer});const i=await wr(this.configuration,this.configurationName)?window.localStorage:null;return await UL(this.getFetch())(e,this.configuration.authority_time_cache_wellknowurl_in_second??60*60,i,this.configuration.authority_timeout_wellknowurl_in_millisecond)};return this.initPromise=r(),this.initPromise.finally(()=>{this.initPromise=null})}async tryKeepExistingSessionAsync(){return this.tryKeepExistingSessionPromise!==null?this.tryKeepExistingSessionPromise:(this.tryKeepExistingSessionPromise=ZL(this),this.tryKeepExistingSessionPromise.finally(()=>{this.tryKeepExistingSessionPromise=null}))}async startCheckSessionAsync(e,n,r,i=!1){await HL(this,ho,this.configuration)(e,n,r,i)}async loginAsync(e=void 0,n=null,r=!1,i=void 0,s=!1){return this.logoutPromise&&await this.logoutPromise,this.loginPromise!==null?this.loginPromise:s?GL(window,this.configurationName,this.configuration,this.publishEvent.bind(this),this)(n,i):(this.loginPromise=t$(this.configurationName,this.configuration,this.publishEvent.bind(this),this.initAsync.bind(this),this.location)(e,n,r,i),this.loginPromise.finally(()=>{this.loginPromise=null}))}async loginCallbackAsync(e=!1){if(this.loginCallbackPromise!==null)return this.loginCallbackPromise;const n=async()=>{const r=await n$(this)(e),i=r.tokens;return this.tokens=i,await wr(this.configuration,this.configurationName)||Er(this.configurationName,this.configuration.storage).setTokens(i),this.publishEvent(rC.eventNames.token_acquired,i),this.configuration.preload_user_info&&await this.userInfoAsync(),{parsedTokens:i,state:r.state,callbackPath:r.callbackPath}};return this.loginCallbackPromise=n(),this.loginCallbackPromise.finally(()=>{this.loginCallbackPromise=null})}async generateDemonstrationOfProofOfPossessionAsync(e,n,r,i={}){const s=this.configuration,o={ath:await nS(e),...i};if(await wr(s,this.configurationName))return`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${this.configurationName}`;const a=Er(this.configurationName,s.storage),l=await a.getDemonstratingProofOfPossessionJwkAsync(),u=a.getDemonstratingProofOfPossessionNonce();return u&&(o.nonce=u),await eS(window)(s.demonstrating_proof_of_possession_configuration)(l,r,n,o)}loginCallbackWithAutoTokensRenewAsync(){return this.loginCallbackWithAutoTokensRenewPromise!==null?this.loginCallbackWithAutoTokensRenewPromise:(this.loginCallbackWithAutoTokensRenewPromise=l$(this),this.loginCallbackWithAutoTokensRenewPromise.finally(()=>{this.loginCallbackWithAutoTokensRenewPromise=null}))}userInfoAsync(e=!1,n=!1){return this.userInfoPromise!==null?this.userInfoPromise:(this.userInfoPromise=o$(this)(e,n),this.userInfoPromise.finally(()=>{this.userInfoPromise=null}))}async renewTokensAsync(e=null){if(this.renewTokensPromise!==null)return this.renewTokensPromise;if(this.timeoutId)return ba.clearTimeout(this.timeoutId),this.renewTokensPromise=sS(this,!0,e),this.renewTokensPromise.finally(()=>{this.renewTokensPromise=null})}async destroyAsync(e){return await i$(this)(e)}async logoutSameTabAsync(e,n){this.configuration.monitor_session&&this.configuration.client_id===e&&n&&this.tokens&&this.tokens.idTokenPayload&&this.tokens.idTokenPayload.sub===n&&(await this.destroyAsync("LOGGED_OUT"),this.publishEvent(qe.logout_from_same_tab,{mmessage:"SessionMonitor",sub:n}))}async logoutOtherTabAsync(e,n){this.configuration.monitor_session&&this.configuration.client_id===e&&n&&this.tokens&&this.tokens.idTokenPayload&&this.tokens.idTokenPayload.sub===n&&(await this.destroyAsync("LOGGED_OUT"),this.publishEvent(qe.logout_from_another_tab,{message:"SessionMonitor",sub:n}))}async logoutAsync(e=void 0,n=null){return this.logoutPromise?this.logoutPromise:(this.logoutPromise=s$(this,ho,this.getFetch(),console,this.location)(e,n),this.logoutPromise.finally(()=>{this.logoutPromise=null}))}};Rg.getOrCreate=(t,e)=>(n,r="default")=>a$(t,e)(n,r),Rg.eventNames=qe;let Ai=Rg;const Sf=class iC{constructor(e){this._oidc=e}subscribeEvents(e){return this._oidc.subscribeEvents(e)}removeEventSubscription(e){this._oidc.removeEventSubscription(e)}publishEvent(e,n){this._oidc.publishEvent(e,n)}static get(e="default"){return new iC(Ai.get(e))}tryKeepExistingSessionAsync(){return this._oidc.tryKeepExistingSessionAsync()}loginAsync(e=void 0,n=null,r=!1,i=void 0,s=!1){return this._oidc.loginAsync(e,n,r,i,s)}logoutAsync(e=void 0,n=null){return this._oidc.logoutAsync(e,n)}silentLoginCallbackAsync(){return this._oidc.silentLoginCallbackAsync()}renewTokensAsync(e=null){return this._oidc.renewTokensAsync(e)}loginCallbackAsync(){return this._oidc.loginCallbackWithAutoTokensRenewAsync()}get tokens(){return this._oidc.tokens}get configuration(){return this._oidc.configuration}async generateDemonstrationOfProofOfPossessionAsync(e,n,r,i={}){return this._oidc.generateDemonstrationOfProofOfPossessionAsync(e,n,r,i)}async getValidTokenAsync(e=200,n=50){const r=this._oidc,i={getTokens:()=>r.tokens,configuration:{token_automatic_renew_mode:r.configuration.token_automatic_renew_mode,refresh_time_before_tokens_expiration_in_second:r.configuration.refresh_time_before_tokens_expiration_in_second},renewTokensAsync:r.renewTokensAsync.bind(r)};return zT(i,e,n)}fetchWithTokens(e,n=!1){return lS(e,this._oidc,n)}async userInfoAsync(e=!1,n=!1){return this._oidc.userInfoAsync(e,n)}userInfo(){return this._oidc.userInfo}};Sf.getOrCreate=(t,e=new ya)=>(n,r="default")=>new Sf(Ai.getOrCreate(t,e)(n,r)),Sf.eventNames=Ai.eventNames;let tt=Sf;const uS=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Error authentication"}),he.jsx("p",{className:"oidc-authenticating__content",children:"An error occurred during authentication."})]})}),u$=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Authentication in progress"}),he.jsx("p",{className:"oidc-authenticating__content",children:"You will be redirected to the login page."})]})}),f$=()=>Math.random().toString(36).slice(2,8),d$=(t,e)=>(n,r)=>{if(typeof t.CustomEvent=="function")return new t.CustomEvent(n,r);const i=r||{bubbles:!1,cancelable:!1,detail:void 0},s=e.createEvent("CustomEvent");return s.initCustomEvent(n,i.bubbles,i.cancelable,i.detail),s.prototype=t.Event.prototype,s},h$=(t,e,n)=>({replaceState:(r,i)=>{const s=n(),o=i||t.history.state;t.history.replaceState({key:s,state:o},null,r),t.dispatchEvent(e("popstate"))}}),p$=()=>h$(window,d$(window,document),f$),fS=()=>he.jsx("div",{className:"oidc-callback",children:he.jsxs("div",{className:"oidc-callback__container",children:[he.jsx("h1",{className:"oidc-callback__title",children:"Authentication complete"}),he.jsx("p",{className:"oidc-callback__content",children:"You will be redirected to your application."})]})}),m$=({callBackError:t,callBackSuccess:e,configurationName:n,withCustomHistory:r})=>{const[i,s]=ie.useState(!1);ie.useEffect(()=>{let l=!0;return(async()=>{const u=tt.get;try{const{callbackPath:d}=await u(n).loginCallbackAsync();(r?r():p$()).replaceState(d||"/")}catch(d){l&&(console.warn(d),s(!0))}})(),()=>{l=!1}},[]);const o=t||uS,a=e||fS;return i?he.jsx(o,{configurationName:n}):he.jsx(a,{configurationName:n})},g$=()=>he.jsx("span",{className:"oidc-loading",children:"Loading"}),y$=()=>he.jsx("div",{className:"oidc-serviceworker",children:he.jsxs("div",{className:"oidc-serviceworker__container",children:[he.jsx("h1",{className:"oidc-serviceworker__title",children:"Unable to authenticate on this browser"}),he.jsx("p",{className:"oidc-serviceworker__content",children:"Your browser is not secure enough to make authentication work. Try updating your browser or use a newer browser."})]})}),v$=()=>he.jsx("div",{className:"oidc-session-lost",children:he.jsxs("div",{className:"oidc-session-lost__container",children:[he.jsx("h1",{className:"oidc-session-lost__title",children:"Session timed out"}),he.jsx("p",{className:"oidc-session-lost__content",children:"Your session has expired. Please re-authenticate."})]})}),b$=({configurationName:t})=>(ie.useEffect(()=>{(async()=>{tt.get(t).silentLoginCallbackAsync()})().catch(e=>{console.error("Error during silent login callback:",e)})},[t]),null),_$=({configurationName:t})=>{const e=ic(window.location.href),n=tt.get,r=n(t);let i=null;for(const[s,o]of Object.entries(e))s==="state"||s==="scope"||(i===null&&(i={}),i[s]=o);return ie.useEffect(()=>{r.tokens||r.loginAsync(null,i,!0,e.scope)},[]),he.jsx(he.Fragment,{})},E$=({callbackErrorComponent:t,callbackSuccessComponent:e,redirect_uri:n,silent_redirect_uri:r,silent_login_uri:i,children:s,configurationName:o,withCustomHistory:a=null})=>{const l=window?rc(window.location.href):"",[u,d]=ie.useState(l);ie.useEffect(()=>{const p=()=>d(rc(window.location.href));return p(),window.addEventListener("popstate",p,!1),()=>window.removeEventListener("popstate",p,!1)},[]);const h=rc(n);if(r&&u===rc(r))return he.jsx(b$,{configurationName:o});if(i&&u===rc(i))return he.jsx(_$,{configurationName:o});switch(u){case h:return he.jsx(m$,{callBackError:t,callBackSuccess:e,configurationName:o,withCustomHistory:a});default:return he.jsx(he.Fragment,{children:s})}},w$=ie.memo(E$),dS={name:"",data:null},T$=({loadingComponent:t,children:e,configurationName:n})=>{const[r,i]=ie.useState(!0),s=tt.get,o=s(n);return ie.useEffect(()=>{let a=!0;return o&&o.tryKeepExistingSessionAsync().then(()=>{a&&i(!1)}),()=>{a=!1}},[n]),he.jsx(he.Fragment,{children:r?he.jsx(t,{configurationName:n}):he.jsx(he.Fragment,{children:e})})},sc=({isLoading:t,loadingComponent:e,children:n,configurationName:r})=>{const i=e;return t?he.jsx(i,{configurationName:r,children:n}):he.jsx(he.Fragment,{children:n})},S$=({children:t,configuration:e,configurationName:n="default",callbackSuccessComponent:r=fS,authenticatingComponent:i=u$,loadingComponent:s=g$,serviceWorkerNotSupportedComponent:o=y$,authenticatingErrorComponent:a=uS,sessionLostComponent:l=v$,onSessionLost:u=null,onLogoutFromAnotherTab:d=null,onLogoutFromSameTab:h=null,withCustomHistory:p=null,onEvent:g=null,getFetch:y=null,location:b=null})=>{const _=(je="default")=>tt.getOrCreate(y??cS,b??new ya)(e,je),[w,O]=ie.useState(!0),[N,I]=ie.useState(dS),[P,R]=ie.useState("default");ie.useEffect(()=>{const je=_(n).subscribeEvents((te,xe)=>{g&&g(n,te,xe)});return()=>{_(n).removeEventSubscription(je)}},[n,g]),ie.useEffect(()=>{const je=_(n).subscribeEvents((te,xe)=>{if(te===tt.eventNames.refreshTokensAsync_error||te===tt.eventNames.syncTokensAsync_error){if(u!=null){u();return}I({name:te,data:xe})}else if(te===tt.eventNames.logout_from_another_tab){if(d!=null){d();return}I({name:te,data:xe})}else te===tt.eventNames.logout_from_same_tab?h!=null&&h():te===tt.eventNames.loginAsync_begin||te===tt.eventNames.loginCallbackAsync_end||te===tt.eventNames.loginAsync_error||te===tt.eventNames.loginCallbackAsync_error?I({name:te,data:xe}):te===tt.eventNames.service_worker_not_supported_by_browser&&e.service_worker_only===!0&&I({name:te,data:xe})});return R(n),O(!1),()=>{_(n).removeEventSubscription(je),I(dS)}},[e,n]);const B=l,Q=i,x=s,U=o,be=a,Oe=w||P!==n,ke=_(n);switch(N.name){case tt.eventNames.service_worker_not_supported_by_browser:return he.jsx(sc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(U,{configurationName:n})});case tt.eventNames.loginAsync_begin:return he.jsx(sc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(Q,{configurationName:n})});case tt.eventNames.loginAsync_error:case tt.eventNames.loginCallbackAsync_error:return he.jsx(sc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(be,{configurationName:n})});case tt.eventNames.refreshTokensAsync_error:case tt.eventNames.syncTokensAsync_error:case tt.eventNames.logout_from_another_tab:return he.jsx(sc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(B,{configurationName:n})});default:return he.jsx(sc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(w$,{redirect_uri:ke.configuration.redirect_uri,silent_redirect_uri:ke.configuration.silent_redirect_uri,silent_login_uri:ke.configuration.silent_login_uri,callbackSuccessComponent:r,callbackErrorComponent:a,authenticatingComponent:i,configurationName:n,withCustomHistory:p,location:b??new ya,children:he.jsx(T$,{loadingComponent:x,configurationName:n,children:t})})})}},hS="default",Pg=(t,e)=>{let n=!1;return t(e)&&(n=t(e).tokens!=null),n},O$=(t=hS)=>{const e=tt.get,[n,r]=ie.useState(Pg(e,t));return ie.useEffect(()=>{let i=!0;const s=e(t);r(Pg(e,t));const o=s.subscribeEvents((a,l)=>{(a===tt.eventNames.logout_from_another_tab||a===tt.eventNames.logout_from_same_tab||a===tt.eventNames.token_acquired)&&i&&r(Pg(e,t))});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),{login:(i=void 0,s=void 0,o=!1)=>e(t).loginAsync(i,s,!1,void 0,o),logout:(i=void 0,s=void 0)=>e(t).logoutAsync(i,s),renewTokens:async(i=void 0)=>{const s=await e(t).renewTokensAsync(i);return{accessToken:s.accessToken,accessTokenPayload:s.accessTokenPayload,idToken:s.idToken,idTokenPayload:s.idTokenPayload}},isAuthenticated:n}},pS={accessToken:null,accessTokenPayload:null},k$=t=>{const e=tt.get,n=e(t);if(n.tokens){const r=n.tokens;return{accessToken:r.accessToken,accessTokenPayload:r.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:n.configuration.demonstrating_proof_of_possession?(i,s)=>n.generateDemonstrationOfProofOfPossessionAsync(r.accessToken,i,s):null}}return pS};function N$(t,e){return t.configuration.demonstrating_proof_of_possession?(n,r,i={})=>t.generateDemonstrationOfProofOfPossessionAsync(e.accessToken,n,r,i):null}const A$=(t=hS)=>{const e=tt.get,[n,r]=ie.useState(k$(t));return ie.useEffect(()=>{let i=!0;const s=e(t);if(s.tokens){const a=s.tokens;r({accessToken:a.accessToken,accessTokenPayload:a.accessTokenPayload})}const o=s.subscribeEvents((a,l)=>{if((a===tt.eventNames.token_renewed||a===tt.eventNames.token_acquired||a===tt.eventNames.logout_from_another_tab||a===tt.eventNames.logout_from_same_tab||a===tt.eventNames.refreshTokensAsync_error||a===tt.eventNames.syncTokensAsync_error)&&i){const u=s.tokens;r(u!=null?{accessToken:u.accessToken,accessTokenPayload:u.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:N$(s,u)}:pS)}});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),n};var Of={DOCUMENT:"Document",FRAGMENT_DEFINITION:"FragmentDefinition"};class I$ extends Error{constructor(e,n,r,i,s,o,a){super(e),this.name="GraphQLError",this.message=e,s&&(this.path=s),n&&(this.nodes=Array.isArray(n)?n:[n]),r&&(this.source=r),i&&(this.positions=i),o&&(this.originalError=o);var l=a;if(!l&&o){var u=o.extensions;u&&typeof u=="object"&&(l=u)}this.extensions=l||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return"GraphQLError"}}var rt,me;function Ct(t){return new I$(`Syntax Error: Unexpected token at ${me} in ${t}`)}function ir(t){if(t.lastIndex=me,t.test(rt))return rt.slice(me,me=t.lastIndex)}var kf=/ +(?=[^\s])/y;function x$(t){for(var e=t.split(`
|
|
217
217
|
`),n="",r=0,i=0,s=e.length-1,o=0;o<e.length;o++)kf.lastIndex=0,kf.test(e[o])&&(o&&(!r||kf.lastIndex<r)&&(r=kf.lastIndex),i=i||o,s=o);for(var a=i;a<=s;a++)a!==i&&(n+=`
|
|
218
218
|
`),n+=e[a].slice(r).replace(/\\"""/g,'"""');return n}function Re(){for(var t=0|rt.charCodeAt(me++);t===9||t===10||t===13||t===32||t===35||t===44||t===65279;t=0|rt.charCodeAt(me++))if(t===35)for(;(t=rt.charCodeAt(me++))!==10&&t!==13;);me--}var In=/[_A-Za-z]\w*/y,Fg=new RegExp("(?:(null|true|false)|\\$("+In.source+')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|('+In.source+"))","y"),ps=function(t){return t[t.Const=1]="Const",t[t.Var=2]="Var",t[t.Int=3]="Int",t[t.Float=4]="Float",t[t.BlockString=5]="BlockString",t[t.String=6]="String",t[t.Enum=7]="Enum",t}(ps||{}),C$=/\\/;function Nf(t){var e,n;if(Fg.lastIndex=me,rt.charCodeAt(me)===91){me++,Re();for(var r=[];rt.charCodeAt(me)!==93;)r.push(Nf(t));return me++,Re(),{kind:"ListValue",values:r}}else if(rt.charCodeAt(me)===123){me++,Re();for(var i=[];rt.charCodeAt(me)!==125;){if((e=ir(In))==null||(Re(),rt.charCodeAt(me++)!==58))throw Ct("ObjectField");Re(),i.push({kind:"ObjectField",name:{kind:"Name",value:e},value:Nf(t)})}return me++,Re(),{kind:"ObjectValue",fields:i}}else if((n=Fg.exec(rt))!=null){if(me=Fg.lastIndex,Re(),(e=n[ps.Const])!=null)return e==="null"?{kind:"NullValue"}:{kind:"BooleanValue",value:e==="true"};if((e=n[ps.Var])!=null){if(t)throw Ct("Variable");return{kind:"Variable",name:{kind:"Name",value:e}}}else if((e=n[ps.Int])!=null){var s;return(s=n[ps.Float])!=null?{kind:"FloatValue",value:e+s}:{kind:"IntValue",value:e}}else{if((e=n[ps.BlockString])!=null)return{kind:"StringValue",value:x$(e.slice(3,-3)),block:!0};if((e=n[ps.String])!=null)return{kind:"StringValue",value:C$.test(e)?JSON.parse(e):e.slice(1,-1),block:!1};if((e=n[ps.Enum])!=null)return{kind:"EnumValue",value:e}}}throw Ct("Value")}function mS(t){if(rt.charCodeAt(me)===40){var e=[];me++,Re();var n;do{if((n=ir(In))==null||(Re(),rt.charCodeAt(me++)!==58))throw Ct("Argument");Re(),e.push({kind:"Argument",name:{kind:"Name",value:n},value:Nf(t)})}while(rt.charCodeAt(me)!==41);return me++,Re(),e}}function Ea(t){if(rt.charCodeAt(me)===64){var e=[],n;do{if(me++,(n=ir(In))==null)throw Ct("Directive");Re(),e.push({kind:"Directive",name:{kind:"Name",value:n},arguments:mS(t)})}while(rt.charCodeAt(me)===64);return e}}function D$(){for(var t,e=0;rt.charCodeAt(me)===91;)e++,me++,Re();if((t=ir(In))==null)throw Ct("NamedType");Re();var n={kind:"NamedType",name:{kind:"Name",value:t}};do if(rt.charCodeAt(me)===33&&(me++,Re(),n={kind:"NonNullType",type:n}),e){if(rt.charCodeAt(me++)!==93)throw Ct("NamedType");Re(),n={kind:"ListType",type:n}}while(e--);return n}var Lg=new RegExp("(?:(\\.{3})|("+In.source+"))","y"),$g=function(t){return t[t.Spread=1]="Spread",t[t.Name=2]="Name",t}($g||{});function Af(){var t=[],e,n;do if(Lg.lastIndex=me,(n=Lg.exec(rt))!=null){if(me=Lg.lastIndex,n[$g.Spread]!=null){Re();var r=ir(In);if(r!=null&&r!=="on")Re(),t.push({kind:"FragmentSpread",name:{kind:"Name",value:r},directives:Ea(!1)});else{if(Re(),r==="on"){if((r=ir(In))==null)throw Ct("NamedType");Re()}var i=Ea(!1);if(rt.charCodeAt(me++)!==123)throw Ct("InlineFragment");Re(),t.push({kind:"InlineFragment",typeCondition:r?{kind:"NamedType",name:{kind:"Name",value:r}}:void 0,directives:i,selectionSet:Af()})}}else if((e=n[$g.Name])!=null){var s=void 0;if(Re(),rt.charCodeAt(me)===58){if(me++,Re(),s=e,(e=ir(In))==null)throw Ct("Field");Re()}var o=mS(!1);Re();var a=Ea(!1),l=void 0;rt.charCodeAt(me)===123&&(me++,Re(),l=Af()),t.push({kind:"Field",alias:s?{kind:"Name",value:s}:void 0,name:{kind:"Name",value:e},arguments:o,directives:a,selectionSet:l})}}else throw Ct("SelectionSet");while(rt.charCodeAt(me)!==125);return me++,Re(),{kind:"SelectionSet",selections:t}}function M$(){var t,e;if((t=ir(In))==null||(Re(),ir(In)!=="on")||(Re(),(e=ir(In))==null))throw Ct("FragmentDefinition");Re();var n=Ea(!1);if(rt.charCodeAt(me++)!==123)throw Ct("FragmentDefinition");return Re(),{kind:"FragmentDefinition",name:{kind:"Name",value:t},typeCondition:{kind:"NamedType",name:{kind:"Name",value:e}},directives:n,selectionSet:Af()}}var R$=/(?:query|mutation|subscription|fragment)/y;function P$(t){var e,n,r;if(t&&(Re(),e=ir(In),n=function(){if(Re(),rt.charCodeAt(me)===40){var s=[];me++,Re();var o;do{if(rt.charCodeAt(me++)!==36||(o=ir(In))==null)throw Ct("Variable");if(Re(),rt.charCodeAt(me++)!==58)throw Ct("VariableDefinition");Re();var a=D$(),l=void 0;rt.charCodeAt(me)===61&&(me++,Re(),l=Nf(!0)),Re(),s.push({kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:o}},type:a,defaultValue:l,directives:Ea(!0)})}while(rt.charCodeAt(me)!==41);return me++,Re(),s}}(),r=Ea(!1)),rt.charCodeAt(me)===123)return me++,Re(),{kind:"OperationDefinition",operation:t||"query",name:e?{kind:"Name",value:e}:void 0,variableDefinitions:n,directives:r,selectionSet:Af()}}function F$(t,e){return me=0,function(r,i){var s,o;Re();var a=[];do if((s=ir(R$))==="fragment")Re(),a.push(M$());else if((o=P$(s))!=null)a.push(o);else throw Ct("Document");while(me<r.length);{var l;return{kind:"Document",definitions:a,set loc(u){l=u},get loc(){return l||(l={start:0,end:r.length,startToken:void 0,endToken:void 0,source:{body:r,name:"graphql.web",locationOffset:{line:1,column:1}}}),l}}}}(rt=typeof t.body=="string"?t.body:t)}var gS=0,Vg=new Set;function yS(){function t(e,n){var r=F$(e).definitions,i=new Set;for(var s of n||[])for(var o of s.definitions)o.kind===Of.FRAGMENT_DEFINITION&&!i.has(o)&&(r.push(o),i.add(o));var a;(a=r[0].kind===Of.FRAGMENT_DEFINITION)&&r[0].directives&&(r[0].directives=r[0].directives.filter(u=>u.name.value!=="_unmask"));var l;return{kind:Of.DOCUMENT,definitions:r,get loc(){if(!l&&a){var u=e+function(h){try{gS++;var p="";for(var g of h)if(!Vg.has(g)){Vg.add(g);var{loc:y}=g;y&&(p+=y.source.body)}return p}finally{--gS==0&&Vg.clear()}}(n||[]);return{start:0,end:u.length,source:{body:u,name:"GraphQLTada",locationOffset:{line:1,column:1}}}}return l},set loc(u){l=u}}}return t.scalar=function(n,r){return r},t.persisted=function(n,r){return{kind:Of.DOCUMENT,definitions:r?r.definitions:[],documentId:n}},t}function L$(...t){return t.length===2?t[1]:t[0]}yS();const wa=yS(),$$=wa(`
|
|
219
219
|
query players(
|
|
@@ -241,7 +241,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
`),vS=({playerIds:t,skip:e})=>{const[n,r]=
|
|
244
|
+
`),vS=({playerIds:t,skip:e})=>{const[n,r]=ie.useState([]),[i,s]=ie.useState(!e),[o]=hg($$),a=async l=>{var d,h;const u=[];for(;l.length>0;)u.push(...((h=(d=(await o({variables:{page:{first:100},ids:l.splice(0,100)}})).data)==null?void 0:d.players)==null?void 0:h.nodes)??[]);r(u)};return ie.useEffect(()=>{!e&&t&&(s(!0),a(t).finally(()=>s(!1)))},[e,t]),{results:n,refetch:a,loading:i}},V$=wa(`
|
|
245
245
|
query getMyAccount {
|
|
246
246
|
getMyAccount {
|
|
247
247
|
id
|
|
@@ -292,7 +292,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
`),bS=({tournamentId:t,skip:e,status:n})=>{const[r,i]=
|
|
295
|
+
`),bS=({tournamentId:t,skip:e,status:n})=>{const[r,i]=ie.useState([]),{loading:s,results:o}=wg(B$,{variables:{tournamentId:t,status:n},onResults:async u=>{i(u.flatMap(d=>d.members).map(d=>d.playerProfileId))},skip:e}),{loading:a,results:l}=vS({playerIds:r,skip:s});return{loading:s||a,results:l.length>0&&o.map(u=>({...u,members:u.members.map(d=>({...d,player:l.find(h=>h.id===d.playerProfileId)}))}))||[]}};var If={exports:{}};/**
|
|
296
296
|
* @license
|
|
297
297
|
* Lodash <https://lodash.com/>
|
|
298
298
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -453,7 +453,7 @@ img.ProseMirror-separator {
|
|
|
453
453
|
*
|
|
454
454
|
* This source code is licensed under the MIT license found in the
|
|
455
455
|
* LICENSE file in the root directory of this source tree.
|
|
456
|
-
*/var o1;function FU(){if(o1)return zy;o1=1;var t=
|
|
456
|
+
*/var o1;function FU(){if(o1)return zy;o1=1;var t=ie;function e(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue;function a(h,p){var g=p(),y=r({inst:{value:g,getSnapshot:p}}),b=y[0].inst,_=y[1];return s(function(){b.value=g,b.getSnapshot=p,l(b)&&_({inst:b})},[h,g,p]),i(function(){return l(b)&&_({inst:b}),h(function(){l(b)&&_({inst:b})})},[h]),o(g),g}function l(h){var p=h.getSnapshot;h=h.value;try{var g=p();return!n(h,g)}catch{return!0}}function u(h,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return zy.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,zy}var Qy={};/**
|
|
457
457
|
* @license React
|
|
458
458
|
* use-sync-external-store-shim.development.js
|
|
459
459
|
*
|
|
@@ -461,7 +461,7 @@ img.ProseMirror-separator {
|
|
|
461
461
|
*
|
|
462
462
|
* This source code is licensed under the MIT license found in the
|
|
463
463
|
* LICENSE file in the root directory of this source tree.
|
|
464
|
-
*/var a1;function LU(){return a1||(a1=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=
|
|
464
|
+
*/var a1;function LU(){return a1||(a1=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=ie,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(N){{for(var I=arguments.length,P=new Array(I>1?I-1:0),R=1;R<I;R++)P[R-1]=arguments[R];r("error",N,P)}}function r(N,I,P){{var R=e.ReactDebugCurrentFrame,B=R.getStackAddendum();B!==""&&(I+="%s",P=P.concat([B]));var Q=P.map(function(x){return String(x)});Q.unshift("Warning: "+I),Function.prototype.apply.call(console[N],console,Q)}}function i(N,I){return N===I&&(N!==0||1/N===1/I)||N!==N&&I!==I}var s=typeof Object.is=="function"?Object.is:i,o=t.useState,a=t.useEffect,l=t.useLayoutEffect,u=t.useDebugValue,d=!1,h=!1;function p(N,I,P){d||t.startTransition!==void 0&&(d=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var R=I();if(!h){var B=I();s(R,B)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}var Q=o({inst:{value:R,getSnapshot:I}}),x=Q[0].inst,U=Q[1];return l(function(){x.value=R,x.getSnapshot=I,g(x)&&U({inst:x})},[N,R,I]),a(function(){g(x)&&U({inst:x});var be=function(){g(x)&&U({inst:x})};return N(be)},[N]),u(R),R}function g(N){var I=N.getSnapshot,P=N.value;try{var R=I();return!s(P,R)}catch{return!0}}function y(N,I,P){return I()}var b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_=!b,w=_?y:p,O=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:w;Qy.useSyncExternalStore=O,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Qy}process.env.NODE_ENV==="production"?Wy.exports=FU():Wy.exports=LU();var hd=Wy.exports;const $U=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},VU=({contentComponent:t})=>{const e=hd.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return ie.createElement(ie.Fragment,null,Object.values(e))};function jU(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:oC.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}class BU extends ie.Component{constructor(e){var n;super(e),this.editorContentRef=ie.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=jU(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return ie.createElement(ie.Fragment,null,ie.createElement("div",{ref:$U(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&ie.createElement(VU,{contentComponent:e.contentComponent}))}}const UU=ie.forwardRef((t,e)=>{const n=ie.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return ie.createElement(BU,{key:n,innerRef:e,...t})}),qU=ie.memo(UU);var WU=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],n.get(i[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(e[i]!==n[i])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!(o==="_owner"&&e.$$typeof)&&!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n},zU=PU(WU),Gy={exports:{}},Hy={};/**
|
|
465
465
|
* @license React
|
|
466
466
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
467
467
|
*
|
|
@@ -469,7 +469,7 @@ img.ProseMirror-separator {
|
|
|
469
469
|
*
|
|
470
470
|
* This source code is licensed under the MIT license found in the
|
|
471
471
|
* LICENSE file in the root directory of this source tree.
|
|
472
|
-
*/var l1;function QU(){if(l1)return Hy;l1=1;var t=
|
|
472
|
+
*/var l1;function QU(){if(l1)return Hy;l1=1;var t=ie,e=hd;function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;return Hy.useSyncExternalStoreWithSelector=function(u,d,h,p,g){var y=s(null);if(y.current===null){var b={hasValue:!1,value:null};y.current=b}else b=y.current;y=a(function(){function w(R){if(!O){if(O=!0,N=R,R=p(R),g!==void 0&&b.hasValue){var B=b.value;if(g(B,R))return I=B}return I=R}if(B=I,r(N,R))return B;var Q=p(R);return g!==void 0&&g(B,Q)?B:(N=R,I=Q)}var O=!1,N,I,P=h===void 0?null:h;return[function(){return w(d())},P===null?void 0:function(){return w(P())}]},[d,h,p,g]);var _=i(u,y[0],y[1]);return o(function(){b.hasValue=!0,b.value=_},[_]),l(_),_},Hy}var Ky={};/**
|
|
473
473
|
* @license React
|
|
474
474
|
* use-sync-external-store-shim/with-selector.development.js
|
|
475
475
|
*
|
|
@@ -477,7 +477,7 @@ img.ProseMirror-separator {
|
|
|
477
477
|
*
|
|
478
478
|
* This source code is licensed under the MIT license found in the
|
|
479
479
|
* LICENSE file in the root directory of this source tree.
|
|
480
|
-
*/var c1;function GU(){return c1||(c1=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=se,e=hd;function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;function u(d,h,p,g,y){var b=s(null),_;b.current===null?(_={hasValue:!1,value:null},b.current=_):_=b.current;var w=a(function(){var P=!1,R,B,Q=function(Oe){if(!P){P=!0,R=Oe;var ke=g(Oe);if(y!==void 0&&_.hasValue){var je=_.value;if(y(je,ke))return B=je,je}return B=ke,ke}var te=R,xe=B;if(r(te,Oe))return xe;var fe=g(Oe);return y!==void 0&&y(xe,fe)?xe:(R=Oe,B=fe,fe)},x=p===void 0?null:p,U=function(){return Q(h())},be=x===null?void 0:function(){return Q(x())};return[U,be]},[h,p,g,y]),O=w[0],N=w[1],I=i(d,O,N);return o(function(){_.hasValue=!0,_.value=I},[I]),l(I),I}Ky.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ky}process.env.NODE_ENV==="production"?Gy.exports=QU():Gy.exports=GU();var HU=Gy.exports;class KU{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function JU(t){var e;const[n]=se.useState(()=>new KU(t.editor)),r=HU.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:zU);return se.useEffect(()=>n.watch(t.editor),[t.editor,n]),se.useDebugValue(r),r}const u1=process.env.NODE_ENV!=="production",Jy=typeof window>"u",YU=Jy||!!(typeof window<"u"&&window.next);class XU{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return Jy||YU?(u1&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&Jy&&u1)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)===null||s===void 0?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)===null||s===void 0?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)===null||s===void 0?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)===null||s===void 0?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)===null||s===void 0?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)===null||s===void 0?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)===null||s===void 0?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)===null||s===void 0?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)===null||s===void 0?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)===null||s===void 0?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)===null||s===void 0?void 0:s.call(i,...r)}};return new kU(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function ZU(t={},e=[]){const n=se.useRef(t);n.current=t;const[r]=se.useState(()=>new XU(n)),i=hd.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return se.useDebugValue(i),se.useEffect(r.onRender(e)),JU({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&s===0?0:s+1}),i}const f1=se.createContext({editor:null}),eq=f1.Consumer;function tq({children:t,slotAfter:e,slotBefore:n,editorContainerProps:r={},...i}){const s=ZU(i);return s?se.createElement(f1.Provider,{value:{editor:s}},n,se.createElement(eq,null,({editor:o})=>se.createElement(qU,{editor:o,...r})),t,e):null}const nq=se.createContext({onDragStart:void 0}),rq=()=>se.useContext(nq);se.forwardRef((t,e)=>{const{onDragStart:n}=rq(),r=t.as||"div";return se.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});const iq=/^\s*>\s$/,sq=Qn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Oc({find:iq,type:this.type})]}}),oq=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,aq=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,lq=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,cq=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,uq=Ar.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Ao({find:oq,type:this.type}),Ao({find:lq,type:this.type})]},addPasteRules(){return[Io({find:aq,type:this.type}),Io({find:cq,type:this.type})]}}),fq="listItem",d1="textStyle",h1=/^\s*([-+*])\s$/,dq=Qn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",qt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(fq,this.editor.getAttributes(d1)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Oc({find:h1,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Oc({find:h1,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(d1),editor:this.editor})),[t]}}),hq=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,pq=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,mq=Ar.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Ao({find:hq,type:this.type})]},addPasteRules(){return[Io({find:pq,type:this.type})]}}),gq=/^```([a-z]+)?[\s\n]$/,yq=/^~~~([a-z]+)?[\s\n]$/,vq=Qn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,s=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",qt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
480
|
+
*/var c1;function GU(){return c1||(c1=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=ie,e=hd;function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;function u(d,h,p,g,y){var b=s(null),_;b.current===null?(_={hasValue:!1,value:null},b.current=_):_=b.current;var w=a(function(){var P=!1,R,B,Q=function(Oe){if(!P){P=!0,R=Oe;var ke=g(Oe);if(y!==void 0&&_.hasValue){var je=_.value;if(y(je,ke))return B=je,je}return B=ke,ke}var te=R,xe=B;if(r(te,Oe))return xe;var fe=g(Oe);return y!==void 0&&y(xe,fe)?xe:(R=Oe,B=fe,fe)},x=p===void 0?null:p,U=function(){return Q(h())},be=x===null?void 0:function(){return Q(x())};return[U,be]},[h,p,g,y]),O=w[0],N=w[1],I=i(d,O,N);return o(function(){_.hasValue=!0,_.value=I},[I]),l(I),I}Ky.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ky}process.env.NODE_ENV==="production"?Gy.exports=QU():Gy.exports=GU();var HU=Gy.exports;class KU{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function JU(t){var e;const[n]=ie.useState(()=>new KU(t.editor)),r=HU.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:zU);return ie.useEffect(()=>n.watch(t.editor),[t.editor,n]),ie.useDebugValue(r),r}const u1=process.env.NODE_ENV!=="production",Jy=typeof window>"u",YU=Jy||!!(typeof window<"u"&&window.next);class XU{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return Jy||YU?(u1&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&Jy&&u1)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)===null||s===void 0?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)===null||s===void 0?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)===null||s===void 0?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)===null||s===void 0?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)===null||s===void 0?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)===null||s===void 0?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)===null||s===void 0?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)===null||s===void 0?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)===null||s===void 0?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)===null||s===void 0?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)===null||s===void 0?void 0:s.call(i,...r)}};return new kU(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function ZU(t={},e=[]){const n=ie.useRef(t);n.current=t;const[r]=ie.useState(()=>new XU(n)),i=hd.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return ie.useDebugValue(i),ie.useEffect(r.onRender(e)),JU({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&s===0?0:s+1}),i}const f1=ie.createContext({editor:null}),eq=f1.Consumer;function tq({children:t,slotAfter:e,slotBefore:n,editorContainerProps:r={},...i}){const s=ZU(i);return s?ie.createElement(f1.Provider,{value:{editor:s}},n,ie.createElement(eq,null,({editor:o})=>ie.createElement(qU,{editor:o,...r})),t,e):null}const nq=ie.createContext({onDragStart:void 0}),rq=()=>ie.useContext(nq);ie.forwardRef((t,e)=>{const{onDragStart:n}=rq(),r=t.as||"div";return ie.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});const iq=/^\s*>\s$/,sq=Qn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Oc({find:iq,type:this.type})]}}),oq=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,aq=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,lq=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,cq=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,uq=Ar.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Ao({find:oq,type:this.type}),Ao({find:lq,type:this.type})]},addPasteRules(){return[Io({find:aq,type:this.type}),Io({find:cq,type:this.type})]}}),fq="listItem",d1="textStyle",h1=/^\s*([-+*])\s$/,dq=Qn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",qt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(fq,this.editor.getAttributes(d1)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Oc({find:h1,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Oc({find:h1,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(d1),editor:this.editor})),[t]}}),hq=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,pq=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,mq=Ar.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Ao({find:hq,type:this.type})]},addPasteRules(){return[Io({find:pq,type:this.type})]}}),gq=/^```([a-z]+)?[\s\n]$/,yq=/^~~~([a-z]+)?[\s\n]$/,vq=Qn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,s=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",qt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
481
481
|
|
|
482
482
|
`);return!s||!o?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:u})=>(u.setSelection(Fe.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[qy({find:gq,type:this.type,getAttributes:t=>({language:t[1]})}),qy({find:yq,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Wn({key:new ci("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
|
|
483
483
|
`));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(Ie.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),bq=Qn.create({name:"doc",topNode:!0,content:"block+"});function _q(t={}){return new Wn({view(e){return new Eq(e,t)}})}class Eq{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let u=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(u){let d=u.getBoundingClientRect(),h=a?d.bottom:d.top;a&&l&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:d.left,right:d.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let s,o;if(!i||i==document.body&&getComputedStyle(i).position=="static")s=-pageXOffset,o=-pageYOffset;else{let a=i.getBoundingClientRect();s=a.left-i.scrollLeft,o=a.top-i.scrollTop}this.element.style.left=r.left-s+"px",this.element.style.top=r.top-o+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=iO(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const wq=mn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[_q(this.options)]}});class Nt extends Fe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Nt.valid(r)?new Nt(r):Fe.near(r)}content(){return re.empty}eq(e){return e instanceof Nt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Nt(e.resolve(n.pos))}getBookmark(){return new Yy(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!Tq(e)||!Sq(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Nt.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=n;let l=e.doc.resolve(i);if(Nt.valid(l))return l}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!ge.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let a=e.doc.resolve(i);if(Nt.valid(a))return a}return null}}}Nt.prototype.visible=!1,Nt.findFrom=Nt.findGapCursorFrom,Fe.jsonID("gapcursor",Nt);class Yy{constructor(e){this.pos=e}map(e){return new Yy(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Nt.valid(n)?new Nt(n):Fe.near(n)}}function Tq(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Sq(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Oq(){return new Wn({props:{decorations:Iq,createSelectionBetween(t,e,n){return e.pos==n.pos&&Nt.valid(n)?new Nt(n):null},handleClick:Nq,handleKeyDown:kq,handleDOMEvents:{beforeinput:Aq}}})}const kq=xk({ArrowLeft:pd("horiz",-1),ArrowRight:pd("horiz",1),ArrowUp:pd("vert",-1),ArrowDown:pd("vert",1)});function pd(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof Ie){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=Nt.findGapCursorFrom(a,e,l);return u?(i&&i(r.tr.setSelection(new Nt(u))),!0):!1}}function Nq(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Nt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ge.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Nt(r))),!0)}function Aq(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Nt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=J.empty;for(let o=r.length-1;o>=0;o--)i=J.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new re(i,0,0));return s.setSelection(Ie.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function Iq(t){if(!(t.selection instanceof Nt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ut.create(t.doc,[Nr.widget(t.selection.head,e,{key:"gapcursor"})])}const xq=mn.create({name:"gapCursor",addProseMirrorPlugins(){return[Oq()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ze(ue(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),Cq=Qn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",qt(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
@@ -491,4 +491,4 @@ img.ProseMirror-separator {
|
|
|
491
491
|
data
|
|
492
492
|
id
|
|
493
493
|
}
|
|
494
|
-
`,data:{__typename:jv.cacheExtensionsCollectionTypename,id:e,data:[]}}),this.entityTypeMap.readEntityById(n)||(this._hasPendingCollectionUpdates||setTimeout(()=>this._updatePendingCollections(),0),this.pendingCollectionUpdates[r]||(this.pendingCollectionUpdates[r]={}),this.pendingCollectionUpdates[r][n]||(this.pendingCollectionUpdates[r][n]=(0,Ms.makeReference)(n)))}_expire(e=!1){const{entitiesById:n}=this.entityTypeMap.extract(),r=[];return Object.keys(n).forEach(i=>{const s=n[i],{storeFieldNames:o,dataId:a,fieldName:l,typename:u}=s;(0,mi.isQuery)(a)&&o?Object.keys(o.entries).forEach(d=>{this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,storeFieldName:d,reportOnly:e})&&r.push((0,mi.makeEntityId)(a,d))}):this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,reportOnly:e})&&r.push((0,mi.makeEntityId)(a))}),r.length>0&&this.broadcastWatches(),r}expire(){return this._expire(!1)}expiredEntities(){return this._expire(!0)}activatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.activatePolicies(...e):this.invalidationPolicyManager.activatePolicies(Rn.InvalidationPolicyEvent.Read,Rn.InvalidationPolicyEvent.Write,Rn.InvalidationPolicyEvent.Evict)}deactivatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.deactivatePolicies(...e):this.invalidationPolicyManager.deactivatePolicies(Rn.InvalidationPolicyEvent.Read,Rn.InvalidationPolicyEvent.Write,Rn.InvalidationPolicyEvent.Evict)}activePolicyEvents(){return[Rn.InvalidationPolicyEvent.Read,Rn.InvalidationPolicyEvent.Write,Rn.InvalidationPolicyEvent.Evict].filter(e=>this.invalidationPolicyManager.isPolicyEventActive(e))}read(e){const n=super.read(e);if(!this.invalidationPolicyManager.isPolicyEventActive(Rn.InvalidationPolicyEvent.Read))return n;const r=(0,mi.maybeDeepClone)(n),i=this.cacheResultProcessor.processReadResult(r,e);return i===Mc.ReadResultStatus.Complete?n:(this.broadcastWatches(),i===Mc.ReadResultStatus.Evicted?null:r)}diff(e){const n=super.diff(e);if(!this.invalidationPolicyManager.isPolicyEventActive(Rn.InvalidationPolicyEvent.Read)||this.isBroadcasting)return n;const{result:r}=n,i=(0,mi.maybeDeepClone)(r),s=this.cacheResultProcessor.processReadResult(i,e);return s===Mc.ReadResultStatus.Complete||(this.broadcastWatches(),n.complete=!1,n.result=s===Mc.ReadResultStatus.Evicted?void 0:i),n}extract(e=!1,n=!0){this._hasPendingCollectionUpdates&&this._updatePendingCollections();const r=super.extract(e);return n&&(r.invalidation=(0,tX.default)(this.entityTypeMap.extract(),"entitiesById")),r}readFragmentWhere(e){const{fragment:n,filter:r,limit:i,orderBy:s}=e,o=Vv(e,["fragment","filter","limit","orderBy"]),l=n.definitions[0].typeCondition.name.value,d=this.readReferenceWhere({__typename:l,filter:r,limit:i,orderBy:s}).map(h=>this.readFragment(Object.assign(Object.assign({},o),{fragment:n,id:h.__ref})));return(0,Z7.default)(d)}readReferenceWhere(e){const{__typename:n,filter:r,limit:i,orderBy:s}=e,o=(0,jv.collectionEntityIdForType)(n);this.pendingCollectionUpdates[o]&&this._updatePendingCollection(o);let a=this.readField("data",(0,Ms.makeReference)(o));if(!a)return[];const l=this.readField.bind(this);if(r&&(a=a.filter(u=>{if((0,iX.default)(r))return r(u,l);const d=Object.keys(r).map(h=>{const p=r[h],g=this.readField(h,u);return p===g});return(0,eX.default)(d,Boolean)})),s){const{field:u,descending:d}=s;a=(0,sX.default)(a,h=>l(u,h),[d?"desc":"asc"])}return(0,rX.default)(i)?a:(0,nX.default)(a,i)}writeFragmentWhere(e){const{update:n}=e,r=Vv(e,["update"]);this.readFragmentWhere(r).forEach(i=>{this.writeFragment({id:this.identify(i),fragment:e.fragment,data:n(i),broadcast:!1})}),this.broadcastWatches()}}yd.default=lX,function(t){var e=De&&De.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCache=t.makeCachedVar=void 0;var n=tv;Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return n.makeCachedVar}});var r=yd;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e(r).default}})}(T1);var fA={},Bv={},Rs={};const cX=ma(YM);Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.buildWatchFragmentWhereQuery=Rs.buildWatchFragmentQuery=void 0;const Ps=cX,uX=kc;function dA({fieldName:t,fragmentDefinition:e}){return{kind:Ps.Kind.DOCUMENT,definitions:[{directives:[],variableDefinitions:[],kind:Ps.Kind.OPERATION_DEFINITION,operation:Ps.OperationTypeNode.QUERY,selectionSet:{kind:Ps.Kind.SELECTION_SET,selections:[{arguments:[],kind:Ps.Kind.FIELD,name:{kind:Ps.Kind.NAME,value:t},directives:[{arguments:[],kind:Ps.Kind.DIRECTIVE,name:{kind:Ps.Kind.NAME,value:"client"}}],selectionSet:e.selectionSet}]}}]}}function fX(t){const{fragment:e,id:n,policies:r,fieldName:i}=t,s=e.definitions[0],o=dA({fragmentDefinition:s,fieldName:i});return r.getFieldPolicy("Query",i)||r.addTypePolicies({Query:{fields:{[i]:{read(a){return(0,uX.makeReference)(n)}}}}}),o}Rs.buildWatchFragmentQuery=fX;function dX(t){const{fragment:e,filterVar:n,limitVar:r,orderByVar:i,policies:s,cache:o,fieldName:a}=t,l=e.definitions[0],u=l.typeCondition.name.value,d=dA({fragmentDefinition:l,fieldName:a});return s.getFieldPolicy("Query",a)||s.addTypePolicies({Query:{fields:{[a]:{read(h){return o.readReferenceWhere({__typename:u,filter:n(),limit:r(),orderBy:i()})}}}}}),d}Rs.buildWatchFragmentWhereQuery=dX,Object.defineProperty(Bv,"__esModule",{value:!0});const jd=kc,hA=Rs,pA=xs;class hX extends jd.ApolloClient{constructor(e){super(e),this.policies=this.cache.policies}watchQueryForField(e,n){const r=this.watchQuery({fetchPolicy:"cache-only",query:e}),i=r.subscribe.bind(r);return r.subscribe=(s,...o)=>{typeof s!="object"&&(s={next:s,error:o[0],complete:o[1]});const a=s.next;s.next=d=>{var h;a&&a((h=d==null?void 0:d.data)===null||h===void 0?void 0:h[n])};const l=i(s),u=l.unsubscribe.bind(l);return l.unsubscribe=()=>{delete this.cache.policies.typePolicies.Query.fields[n],u()},l},r}watchFragment(e){const n=(0,pA.generateFragmentFieldName)(),r=(0,hA.buildWatchFragmentQuery)(Object.assign(Object.assign({},e),{fieldName:n,policies:this.policies}));return this.watchQueryForField(r,n)}watchFragmentWhere(e){const n=(0,pA.generateFragmentFieldName)(),r=(0,jd.makeVar)(e.filter),i=(0,jd.makeVar)(e.limit),s=(0,jd.makeVar)(e.orderBy),o=(0,hA.buildWatchFragmentWhereQuery)(Object.assign(Object.assign({},e),{fieldName:n,filterVar:r,limitVar:i,orderByVar:s,cache:this.cache,policies:this.policies}));return this.watchQueryForField(o,n)}}Bv.default=hX,function(t){var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.ApolloExtensionsClient=void 0;var n=Bv;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return e(n).default}})}(fA);var mA={},Uv={},Po={},pX=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Po,"__esModule",{value:!0}),Po.usePrevious=Po.useOnce=void 0;const Bd=se,mX=pX(wd);function gX(t){const e=(0,Bd.useRef)(),n=(0,Bd.useRef)(!1);return n.current||((0,mX.default)(t)?e.current=t():e.current=t,n.current=!0),e.current}Po.useOnce=gX;const yX=t=>{const e=(0,Bd.useRef)(null);return(0,Bd.useEffect)(()=>{e.current=t}),e.current};Po.usePrevious=yX;var Rc={};Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.useFragmentTypePolicyFieldName=void 0;const vX=La,gA=se,bX=xs,_X=Po,EX=({fragmentName:t}={})=>{const e=(0,gA.useMemo)(()=>(0,bX.generateFragmentFieldName)({fragmentName:t}),[t]),n=(0,_X.usePrevious)(e),r=(0,vX.useApolloClient)();return(0,gA.useEffect)(()=>()=>{delete r.cache.policies.typePolicies.Query.fields[n]},[e,n]),e};Rc.useFragmentTypePolicyFieldName=EX;var Pc={};Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.useGetQueryDataByFieldName=void 0;const wX=La,TX=(t,e,n)=>{var r,i;const s=(0,wX.useQuery)(t,{fetchPolicy:"cache-only",returnPartialData:n==null?void 0:n.returnPartialData});return{data:(i=(r=s==null?void 0:s.data)===null||r===void 0?void 0:r[e])!==null&&i!==void 0?i:null}};Pc.useGetQueryDataByFieldName=TX,Object.defineProperty(Uv,"__esModule",{value:!0});const SX=La,OX=se,kX=Po,NX=Rs,AX=Rc,IX=Pc;function xX(t,e){const r=(0,OX.useContext)((0,SX.getApolloContext)()).client,i=r==null?void 0:r.cache,s=(0,AX.useFragmentTypePolicyFieldName)(),o=(0,kX.useOnce)(()=>(0,NX.buildWatchFragmentQuery)({fragment:t,fieldName:s,id:e.id,policies:i.policies}));return(0,IX.useGetQueryDataByFieldName)(o,s,e)}Uv.default=xX;var qv={};const CX=ma(JP);Object.defineProperty(qv,"__esModule",{value:!0});const DX=La,Li=se,MX=Rs,RX=Rc,PX=Pc,Wv=La,yA=CX;function FX(t,e){var n;const r=e==null?void 0:e.filter,s=(0,Li.useRef)((0,Wv.makeVar)(r)).current,o=e==null?void 0:e.limit,l=(0,Li.useRef)((0,Wv.makeVar)(o)).current,u=e==null?void 0:e.orderBy,h=(0,Li.useRef)((0,Wv.makeVar)(u)).current,g=(0,Li.useContext)((0,DX.getApolloContext)()).client,y=g==null?void 0:g.cache,b=(0,RX.useFragmentTypePolicyFieldName)({fragmentName:e==null?void 0:e.fragmentName}),_=(0,Li.useRef)([]);(0,Li.useEffect)(()=>{(typeof r=="function"&&r!==s()||!(0,yA.equal)(r,s()))&&s(r)},[r]),(0,Li.useEffect)(()=>{o!==l()&&l(o)},[o]),(0,Li.useEffect)(()=>{(typeof u=="function"&&u!==h()||!(0,yA.equal)(u,h()))&&h(u)},[u]);const w=(0,Li.useMemo)(()=>(0,MX.buildWatchFragmentWhereQuery)({filter:r,filterVar:s,limitVar:l,orderByVar:h,fragment:t,fieldName:b,cache:y,policies:y.policies}),[b]),O=(0,PX.useGetQueryDataByFieldName)(w,b,e);return Object.assign(Object.assign({},O),{data:(n=O.data)!==null&&n!==void 0?n:_.current})}qv.default=FX,function(t){var e=De&&De.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFragmentWhere=t.useFragment=void 0;var n=Uv;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return e(n).default}});var r=qv;Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return e(r).default}})}(mA);var vA={},zv={},Fc={},LX=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.AuditType=void 0;const $X=LX(Md);var Lc;(function(t){t.Read="Read",t.Write="Write",t.Evict="Evict"})(Lc||(Fc.AuditType=Lc={}));class VX extends $X.default{constructor(e){super(e),this.auditLog=e.auditLog}runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s=!1}){return this.auditLog.log("Running read policy",Lc.Read,"InvalidationPolicyManager",{storeFieldName:i,typename:e,dataId:n,fieldName:r}),super.runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s})}runWritePolicy(e,n){return this.auditLog.log("Running write policy",Lc.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runWritePolicy(e,n)}runEvictPolicy(e,n){return this.auditLog.log("Running evict policy",Lc.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runEvictPolicy(e,n)}}Fc.default=VX;var Qv={},jX=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qv,"__esModule",{value:!0});const BX=jX(Vd);var Ud;(function(t){t.Write="Write",t.Evict="Evict"})(Ud||(Ud={}));class UX extends BX.default{constructor(e){super(),this.auditLog=e.auditLog}write(e,n,r,i){return this.auditLog.log("Writing to type map",Ud.Write,"EntityTypeMap",{typename:e,dataId:n,storeFieldName:r,variables:i}),super.write(e,n,r,i)}evict(e,n){return this.auditLog.log("Evicting from type map",Ud.Evict,"EntityTypeMap",{dataId:e,storeFieldName:n}),super.evict(e,n)}}Qv.default=UX;var Gv={},qX=av;function WX(t,e){var n=[];return qX(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}var zX=WX,QX=G1,GX=zX,HX=Sv,KX=Mn;function JX(t,e){var n=KX(t)?QX:GX;return n(t,HX(e))}var YX=JX,XX=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gv,"__esModule",{value:!0});const ZX=XX(YX);class eZ{constructor(){this._log=[]}log(e,n,r,i){const s={time:Date.now(),type:n,event:e,meta:i,group:r};this._log.push(s)}getLog(e){return(0,ZX.default)(this._log,e)}printLog(e){this.getLog(e).forEach(this.printLogEntry)}printLogEntry(e){var n;console.log(`%c event: ${e.event}`,"color: green"),console.group(),console.log(`type: ${e.type}`),console.log(`time: ${e.time}`),console.log(`meta: ${JSON.stringify((n=e.meta)!==null&&n!==void 0?n:{})}`),console.groupEnd()}}Gv.default=eZ;var qd=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zv,"__esModule",{value:!0});const tZ=qd(yd),nZ=Ro,rZ=qd(Fc),iZ=qd(Qv),sZ=qd(Gv),oZ=Pv;class aZ extends tZ.default{constructor(e){super(e),this.auditLog=new sZ.default;const{invalidationPolicies:n={}}=e;this.entityTypeMap=new iZ.default({auditLog:this.auditLog}),new oZ.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new rZ.default({auditLog:this.auditLog,policies:n,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:this.evict.bind(this),modify:this.modify.bind(this),readField:this.readField.bind(this)}}),this.cacheResultProcessor=new nZ.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this})}}zv.default=aZ,function(t){var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCacheAuditor=void 0;var n=zv;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return e(n).default}})}(vA),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RenewalPolicy=t.InvalidationPolicyEvent=t.InvalidationPolicyCacheAuditor=t.useFragmentWhere=t.useFragment=t.ApolloExtensionsClient=t.makeCachedVar=t.InvalidationPolicyCache=void 0;var e=T1;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e.InvalidationPolicyCache}}),Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return e.makeCachedVar}});var n=fA;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return n.ApolloExtensionsClient}});var r=mA;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return r.useFragment}}),Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return r.useFragmentWhere}});var i=vA;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return i.InvalidationPolicyCacheAuditor}});var s=Ir;Object.defineProperty(t,"InvalidationPolicyEvent",{enumerable:!0,get:function(){return s.InvalidationPolicyEvent}}),Object.defineProperty(t,"RenewalPolicy",{enumerable:!0,get:function(){return s.RenewalPolicy}})}(ev);var Hv=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},lZ=function(){function t(e){var n=e.debug,r=n===void 0?!1:n;this.debug=r,this.lines=[]}return t.prototype.emit=function(e,n){if(e in console){var r=t.prefix;console[e].apply(console,Hv([r],n,!1))}},t.prototype.tailLogs=function(){var e=this;this.lines.forEach(function(n){var r=n[0],i=n[1];return e.emit(r,i)})},t.prototype.getLogs=function(){return this.lines},t.prototype.write=function(e,n){var r=t.buffer;this.lines=Hv(Hv([],this.lines.slice(1-r),!0),[[e,n]],!1),(this.debug||e!=="log")&&this.emit(e,n)},t.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("log",e)},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("warn",e)},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("error",e)},t.buffer=30,t.prefix="[apollo-cache-persist]",t}(),cZ=function(){function t(e){var n=e.cache,r=e.serialize,i=r===void 0?!0:r;this.cache=n,this.serialize=i}return t.prototype.extract=function(){var e=this.cache.extract();return this.serialize&&(e=JSON.stringify(e)),e},t.prototype.restore=function(e){this.serialize&&typeof e=="string"&&(e=JSON.parse(e)),e!=null&&this.cache.restore(e)},t}(),Wd=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})},zd=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},bA=function(){function t(e){var n=e.storage,r=e.key,i=r===void 0?"apollo-cache-persist":r;this.storage=n,this.key=i}return t.prototype.read=function(){return Wd(this,void 0,void 0,function(){return zd(this,function(e){return[2,this.storage.getItem(this.key)]})})},t.prototype.write=function(e){return Wd(this,void 0,void 0,function(){return zd(this,function(n){switch(n.label){case 0:return[4,this.storage.setItem(this.key,e)];case 1:return n.sent(),[2]}})})},t.prototype.purge=function(){return Wd(this,void 0,void 0,function(){return zd(this,function(e){switch(e.label){case 0:return[4,this.storage.removeItem(this.key)];case 1:return e.sent(),[2]}})})},t.prototype.getSize=function(){return Wd(this,void 0,void 0,function(){var e;return zd(this,function(n){switch(n.label){case 0:return[4,this.storage.getItem(this.key)];case 1:return e=n.sent(),e==null?[2,0]:[2,typeof e=="string"?e.length:null]}})})},t}(),Kv=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})},Jv=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},_A=function(){function t(e,n){var r=e.log,i=e.cache,s=e.storage,o=n.maxSize,a=o===void 0?1024*1024:o,l=n.persistenceMapper;this.log=r,this.cache=i,this.storage=s,this.paused=!1,l&&(this.persistenceMapper=l),a&&(this.maxSize=a)}return t.prototype.persist=function(){return Kv(this,void 0,void 0,function(){var e,n;return Jv(this,function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),e=this.cache.extract(),!this.paused&&this.persistenceMapper?[4,this.persistenceMapper(e)]:[3,2];case 1:e=r.sent(),r.label=2;case 2:return this.maxSize!=null&&typeof e=="string"&&e.length>this.maxSize&&!this.paused?[4,this.purge()]:[3,4];case 3:return r.sent(),this.paused=!0,[2];case 4:return this.paused?[2]:[4,this.storage.write(e)];case 5:return r.sent(),this.log.info(typeof e=="string"?"Persisted cache of size ".concat(e.length," characters"):"Persisted cache"),[3,7];case 6:throw n=r.sent(),this.log.error("Error persisting cache",n),n;case 7:return[2]}})})},t.prototype.restore=function(){return Kv(this,void 0,void 0,function(){var e,n;return Jv(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),[4,this.storage.read()];case 1:return e=r.sent(),e==null?[3,3]:[4,this.cache.restore(e)];case 2:return r.sent(),this.log.info(typeof e=="string"?"Restored cache of size ".concat(e.length," characters"):"Restored cache"),[3,4];case 3:this.log.info("No stored cache to restore"),r.label=4;case 4:return[3,6];case 5:throw n=r.sent(),this.log.error("Error restoring cache",n),n;case 6:return[2]}})})},t.prototype.purge=function(){return Kv(this,void 0,void 0,function(){var e;return Jv(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.storage.purge()];case 1:return n.sent(),this.log.info("Purged cache storage"),[3,3];case 2:throw e=n.sent(),this.log.error("Error purging cache storage",e),e;case 3:return[2]}})})},t}();const EA=function(t){var e=t.cache;return function(n){var r=e.write,i=e.evict,s=e.modify,o=e.gc;return e.write=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=r.apply(e,a);return n(),u},e.evict=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=i.apply(e,a);return n(),u},e.modify=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=s.apply(e,a);return n(),u},e.gc=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=o.apply(e,a);return n(),u},function(){e.write=r,e.evict=i,e.modify=s,e.gc=o}}},uZ=function(t){var e=t.log,n=t.cache;return function(r){return e.warn("Trigger option `background` not available on web; using `write` trigger"),EA({cache:n})(r)}};var fZ=function(){function t(e,n){var r=e.log,i=e.persistor,s=this;this.fire=function(){if(!s.debounce){s.persist();return}s.timeout!=null&&clearTimeout(s.timeout),s.timeout=setTimeout(s.persist,s.debounce)},this.persist=function(){s.paused||s.persistor.persist()};var o=t.defaultDebounce,a=n.cache,l=n.debounce,u=n.trigger,d=u===void 0?"write":u;if(d)switch(this.debounce=l??o,this.persistor=i,this.paused=!1,d){case"write":this.uninstall=EA({cache:a})(this.fire);break;case"background":l&&r.warn("Debounce is not recommended with `background` trigger"),this.debounce=l,this.uninstall=uZ({cache:a,log:r})(this.fire);break;default:if(typeof d=="function")this.uninstall=d(this.fire);else throw Error("Unrecognized trigger option: ".concat(d))}}return t.prototype.pause=function(){this.paused=!0},t.prototype.resume=function(){this.paused=!1},t.prototype.remove=function(){this.uninstall&&(this.uninstall(),this.uninstall=null,this.paused=!0)},t.defaultDebounce=1e3,t}(),dZ=function(){function t(e){if(!e.cache)throw new Error("In order to persist your Apollo Cache, you need to pass in a cache. Please see https://www.apollographql.com/docs/react/basics/caching.html for our default InMemoryCache.");if(!e.storage)throw new Error("In order to persist your Apollo Cache, you need to pass in an underlying storage provider. Please see https://github.com/apollographql/apollo-cache-persist#storage-providers");var n=new lZ(e),r=new cZ(e),i=new bA(e),s=new _A({log:n,cache:r,storage:i},e),o=new fZ({log:n,persistor:s},e);this.log=n,this.cache=r,this.storage=i,this.persistor=s,this.trigger=o}return t.prototype.persist=function(){return this.persistor.persist()},t.prototype.restore=function(){return this.persistor.restore()},t.prototype.purge=function(){return this.persistor.purge()},t.prototype.pause=function(){this.trigger.pause()},t.prototype.resume=function(){this.trigger.resume()},t.prototype.remove=function(){this.trigger.remove()},t.prototype.getLogs=function(e){if(e===void 0&&(e=!1),e)this.log.tailLogs();else return this.log.getLogs()},t.prototype.getSize=function(){return this.storage.getSize()},t}(),Yv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hZ=function(t){var e=new pZ(t);e.restoreSync()},pZ=function(t){Yv(e,t);function e(n){var r=t.call(this,n)||this;return r.storage=new gZ(n),r.persistor=new mZ({log:r.log,cache:r.cache,storage:r.storage},n),r}return e.prototype.restoreSync=function(){this.persistor.restoreSync()},e}(dZ),mZ=function(t){Yv(e,t);function e(n,r){var i=n.log,s=n.cache,o=n.storage;return t.call(this,{log:i,cache:s,storage:o},r)||this}return e.prototype.restoreSync=function(){this.cache.restore(this.storage.readSync())},e}(_A),gZ=function(t){Yv(e,t);function e(n){return t.call(this,n)||this}return e.prototype.readSync=function(){return this.storage.getItem(this.key)},e}(bA),yZ=function(){function t(e){this.storage=e}return t.prototype.getItem=function(e){return this.storage.getItem(e)},t.prototype.removeItem=function(e){return this.storage.removeItem(e)},t.prototype.setItem=function(e,n){return n!==null?this.storage.setItem(e,n):this.removeItem(e)},t}();function Hn(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function Fo(t){return Hn(t)==="object"}function vZ(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function wA(t,e){return t.length<124?t:e}const bZ="graphql-transport-ws";var or;(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"})(or||(or={}));var Dt;(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"})(Dt||(Dt={}));function TA(t){if(!Fo(t))throw new Error(`Message is expected to be an object, but got ${Hn(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 ${Hn(t.type)}`);switch(t.type){case Dt.ConnectionInit:case Dt.ConnectionAck:case Dt.Ping:case Dt.Pong:{if(t.payload!=null&&!Fo(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 Dt.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Hn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Fo(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Hn(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 ${Hn(t.payload.query)}`);if(t.payload.variables!=null&&!Fo(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 ${Hn(t.payload.variables)}`);if(t.payload.operationName!=null&&Hn(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 ${Hn(t.payload.operationName)}`);if(t.payload.extensions!=null&&!Fo(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 ${Hn(t.payload.extensions)}`);break}case Dt.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Hn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Fo(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Hn(t.payload)}`);break}case Dt.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Hn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!vZ(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 Dt.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Hn(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 _Z(t,e){return TA(typeof t=="string"?JSON.parse(t,e):t)}function $c(t,e){return TA(t),JSON.stringify(t,e)}var za=function(t){return this instanceof za?(this.v=t,this):new za(t)},EZ=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(p){r[p]&&(i[p]=function(g){return new Promise(function(y,b){s.push([p,g,y,b])>1||a(p,g)})})}function a(p,g){try{l(r[p](g))}catch(y){h(s[0][3],y)}}function l(p){p.value instanceof za?Promise.resolve(p.value.v).then(u,d):h(s[0][2],p)}function u(p){a("next",p)}function d(p){a("throw",p)}function h(p,g){p(g),s.shift(),s.length&&a(s[0][0],s[0][1])}};function wZ(t){const{url:e,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:s=0,keepAlive:o=0,disablePong:a,connectionAckWaitTimeout:l=0,retryAttempts:u=5,retryWait:d=async function(xe){let fe=1e3;for(let Ee=0;Ee<xe;Ee++)fe*=2;await new Promise(Ee=>setTimeout(Ee,fe+Math.floor(Math.random()*2700+300)))},shouldRetry:h=Xv,isFatalConnectionProblem:p,on:g,webSocketImpl:y,generateID:b=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,xe=>{const fe=Math.random()*16|0;return(xe=="x"?fe:fe&3|8).toString(16)})},jsonMessageReplacer:_,jsonMessageReviver:w}=t;let O;if(y){if(!SZ(y))throw new Error("Invalid WebSocket implementation provided");O=y}else typeof WebSocket<"u"?O=WebSocket:typeof global<"u"?O=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(O=window.WebSocket||window.MozWebSocket);if(!O)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const N=O,I=(()=>{const te=(()=>{const fe={};return{on(Ee,ye){return fe[Ee]=ye,()=>{delete fe[Ee]}},emit(Ee){var ye;"id"in Ee&&((ye=fe[Ee.id])===null||ye===void 0||ye.call(fe,Ee))}}})(),xe={connecting:g!=null&&g.connecting?[g.connecting]:[],opened:g!=null&&g.opened?[g.opened]:[],connected:g!=null&&g.connected?[g.connected]:[],ping:g!=null&&g.ping?[g.ping]:[],pong:g!=null&&g.pong?[g.pong]:[],message:g!=null&&g.message?[te.emit,g.message]:[te.emit],closed:g!=null&&g.closed?[g.closed]:[],error:g!=null&&g.error?[g.error]:[]};return{onMessage:te.on,on(fe,Ee){const ye=xe[fe];return ye.push(Ee),()=>{ye.splice(ye.indexOf(Ee),1)}},emit(fe,...Ee){for(const ye of[...xe[fe]])ye(...Ee)}}})();function P(te){const xe=[I.on("error",fe=>{xe.forEach(Ee=>Ee()),te(fe)}),I.on("closed",fe=>{xe.forEach(Ee=>Ee()),te(fe)})]}let R,B=0,Q,x=!1,U=0,be=!1;async function Oe(){clearTimeout(Q);const[te,xe]=await(R??(R=new Promise((ye,ut)=>(async()=>{if(x){if(await d(U),!B)return R=void 0,ut({code:1e3,reason:"All Subscriptions Gone"});U++}I.emit("connecting",x);const ve=new N(typeof e=="function"?await e():e,bZ);let $,Z;function Y(){isFinite(o)&&o>0&&(clearTimeout(Z),Z=setTimeout(()=>{ve.readyState===N.OPEN&&(ve.send($c({type:Dt.Ping})),I.emit("ping",!1,void 0))},o))}P(we=>{R=void 0,clearTimeout($),clearTimeout(Z),ut(we),we instanceof SA&&(ve.close(4499,"Terminated"),ve.onerror=null,ve.onclose=null)}),ve.onerror=we=>I.emit("error",we),ve.onclose=we=>I.emit("closed",we),ve.onopen=async()=>{try{I.emit("opened",ve);const we=typeof n=="function"?await n():n;if(ve.readyState!==N.OPEN)return;ve.send($c(we?{type:Dt.ConnectionInit,payload:we}:{type:Dt.ConnectionInit},_)),isFinite(l)&&l>0&&($=setTimeout(()=>{ve.close(or.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),Y()}catch(we){I.emit("error",we),ve.close(or.InternalClientError,wA(we instanceof Error?we.message:new Error(we).message,"Internal client error"))}};let ee=!1;ve.onmessage=({data:we})=>{try{const Pe=_Z(we,w);if(I.emit("message",Pe),Pe.type==="ping"||Pe.type==="pong"){I.emit(Pe.type,!0,Pe.payload),Pe.type==="pong"?Y():a||(ve.send($c(Pe.payload?{type:Dt.Pong,payload:Pe.payload}:{type:Dt.Pong})),I.emit("pong",!1,Pe.payload));return}if(ee)return;if(Pe.type!==Dt.ConnectionAck)throw new Error(`First message cannot be of type ${Pe.type}`);clearTimeout($),ee=!0,I.emit("connected",ve,Pe.payload,x),x=!1,U=0,ye([ve,new Promise((Ze,ln)=>P(ln))])}catch(Pe){ve.onmessage=null,I.emit("error",Pe),ve.close(or.BadResponse,wA(Pe instanceof Error?Pe.message:new Error(Pe).message,"Bad response"))}}})())));te.readyState===N.CLOSING&&await xe;let fe=()=>{};const Ee=new Promise(ye=>fe=ye);return[te,fe,Promise.race([Ee.then(()=>{if(!B){const ye=()=>te.close(1e3,"Normal Closure");isFinite(s)&&s>0?Q=setTimeout(()=>{te.readyState===N.OPEN&&ye()},s):ye()}}),xe])]}function ke(te){if(Xv(te)&&(TZ(te.code)||[or.InternalServerError,or.InternalClientError,or.BadRequest,or.BadResponse,or.Unauthorized,or.SubprotocolNotAcceptable,or.SubscriberAlreadyExists,or.TooManyInitialisationRequests].includes(te.code)))throw te;if(be)return!1;if(Xv(te)&&te.code===1e3)return B>0;if(!u||U>=u||!h(te)||p!=null&&p(te))throw te;return x=!0}r||(async()=>{for(B++;;)try{const[,,te]=await Oe();await te}catch(te){try{if(!ke(te))return}catch(xe){return i==null?void 0:i(xe)}}})();function je(te,xe){const fe=b(te);let Ee=!1,ye=!1,ut=()=>{B--,Ee=!0};return(async()=>{for(B++;;)try{const[ve,$,Z]=await Oe();if(Ee)return $();const Y=I.onMessage(fe,ee=>{switch(ee.type){case Dt.Next:{xe.next(ee.payload);return}case Dt.Error:{ye=!0,Ee=!0,xe.error(ee.payload),ut();return}case Dt.Complete:{Ee=!0,ut();return}}});ve.send($c({id:fe,type:Dt.Subscribe,payload:te},_)),ut=()=>{!Ee&&ve.readyState===N.OPEN&&ve.send($c({id:fe,type:Dt.Complete},_)),B--,Ee=!0,$()},await Z.finally(Y);return}catch(ve){if(!ke(ve))return}})().then(()=>{ye||xe.complete()}).catch(ve=>{xe.error(ve)}),()=>{Ee||ut()}}return{on:I.on,subscribe:je,iterate(te){const xe=[],fe={done:!1,error:null,resolve:()=>{}},Ee=je(te,{next(ut){xe.push(ut),fe.resolve()},error(ut){fe.done=!0,fe.error=ut,fe.resolve()},complete(){fe.done=!0,fe.resolve()}}),ye=function(){return EZ(this,arguments,function*(){for(;;){for(xe.length||(yield za(new Promise($=>fe.resolve=$)));xe.length;)yield yield za(xe.shift());if(fe.error)throw fe.error;if(fe.done)return yield za(void 0)}})}();return ye.throw=async ut=>(fe.done||(fe.done=!0,fe.error=ut,fe.resolve()),{done:!0,value:void 0}),ye.return=async()=>(Ee(),{done:!0,value:void 0}),ye},async dispose(){if(be=!0,R){const[te]=await R;te.close(1e3,"Normal Closure")}},terminate(){R&&I.emit("closed",new SA)}}}class SA extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function Xv(t){return Fo(t)&&"code"in t&&"reason"in t}function TZ(t){return[1e3,1001,1006,1005,1012,1013,1014].includes(t)?!1:t>=1e3&&t<=1999}function SZ(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}const OZ=({apiUrl:t,organizationId:e,listeners:n,lazy:r=!1,token:i})=>{const s=wZ({url:`wss://${t}`,lazy:r,connectionParams:oc.omitBy({"organization-id":e,authorization:i?`Bearer ${i}`:void 0},oc.isNil),keepAlive:1e4});return n&&(n.onConnected&&s.on("connected",n.onConnected),n.onClosed&&s.on("closed",n.onClosed),n.onError&&s.on("error",n.onError)),s},kZ=({token:t,organizationId:e,invalidationPolicies:n,handlers:r,fetchPolicy:i,websocket:s,apiBaseUrl:o})=>{const a=new ev.InvalidationPolicyCache({invalidationPolicies:{...n,timeToLive:(n==null?void 0:n.timeToLive)??12e4,renewalPolicy:(n==null?void 0:n.renewalPolicy)??ev.RenewalPolicy.None}});hZ({cache:a,storage:new yZ(window.localStorage)});const l=`api.warrior.${o??"well-played.gg"}/graphql`,u=Nm(({query:d})=>{const h=so(d);return h.kind==="OperationDefinition"&&h.operation==="subscription"},new lW(OZ({apiUrl:l,listeners:r==null?void 0:r.webSocket,organizationId:e,lazy:s==null?void 0:s.lazy,token:t})),km([sW(async()=>({headers:oc.omitBy({"organization-id":e,authorization:t?`Bearer ${t}`:void 0},oc.isNil)})),...r!=null&&r.onError?[w1(r==null?void 0:r.onError)]:[],new rf({uri:`https://${l}`})]));return new df({cache:a,link:u,defaultOptions:{watchQuery:{fetchPolicy:i??"network-only",errorPolicy:"ignore"},query:{fetchPolicy:i??"network-only",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})},OA=se.createContext({}),NZ=()=>{const t=se.useContext(OA);if(!t)throw new Error("useWellPlayed must be used within a WellPlayedProvider");return t},AZ=({children:t,clientConfig:e,organizationId:n})=>{const r=A$(),i=kZ({token:(r==null?void 0:r.accessToken)??void 0,organizationId:n,...e});return he.jsx(AT,{client:i,children:he.jsx(OA.Provider,{value:{organizationId:n,apiClient:i},children:t})})},IZ=({children:t,oidcConfig:e,wpAppConfig:n,...r})=>he.jsx(S$,{...e,configuration:{...n,...e==null?void 0:e.configuration,authority:`https://oauth.warrior.${r.apiBaseUrl??"well-played.gg"}`},children:he.jsx(AZ,{...r,children:t})});Gt.RichTextEditorContent=iW,Gt.WellPlayedProvider=IZ,Gt.graphql=wa,Gt.readFragment=L$,Gt.useConnectedPlayer=j$,Gt.usePaginatedLoadAll=wg,Gt.usePaginatedQuery=pL,Gt.usePlayers=vS,Gt.useTournamentStep=W$,Gt.useTournamentTeams=bS,Gt.useWellPlayed=NZ,Object.defineProperty(Gt,Symbol.toStringTag,{value:"Module"})});
|
|
494
|
+
`,data:{__typename:jv.cacheExtensionsCollectionTypename,id:e,data:[]}}),this.entityTypeMap.readEntityById(n)||(this._hasPendingCollectionUpdates||setTimeout(()=>this._updatePendingCollections(),0),this.pendingCollectionUpdates[r]||(this.pendingCollectionUpdates[r]={}),this.pendingCollectionUpdates[r][n]||(this.pendingCollectionUpdates[r][n]=(0,Ms.makeReference)(n)))}_expire(e=!1){const{entitiesById:n}=this.entityTypeMap.extract(),r=[];return Object.keys(n).forEach(i=>{const s=n[i],{storeFieldNames:o,dataId:a,fieldName:l,typename:u}=s;(0,mi.isQuery)(a)&&o?Object.keys(o.entries).forEach(d=>{this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,storeFieldName:d,reportOnly:e})&&r.push((0,mi.makeEntityId)(a,d))}):this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,reportOnly:e})&&r.push((0,mi.makeEntityId)(a))}),r.length>0&&this.broadcastWatches(),r}expire(){return this._expire(!1)}expiredEntities(){return this._expire(!0)}activatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.activatePolicies(...e):this.invalidationPolicyManager.activatePolicies(Rn.InvalidationPolicyEvent.Read,Rn.InvalidationPolicyEvent.Write,Rn.InvalidationPolicyEvent.Evict)}deactivatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.deactivatePolicies(...e):this.invalidationPolicyManager.deactivatePolicies(Rn.InvalidationPolicyEvent.Read,Rn.InvalidationPolicyEvent.Write,Rn.InvalidationPolicyEvent.Evict)}activePolicyEvents(){return[Rn.InvalidationPolicyEvent.Read,Rn.InvalidationPolicyEvent.Write,Rn.InvalidationPolicyEvent.Evict].filter(e=>this.invalidationPolicyManager.isPolicyEventActive(e))}read(e){const n=super.read(e);if(!this.invalidationPolicyManager.isPolicyEventActive(Rn.InvalidationPolicyEvent.Read))return n;const r=(0,mi.maybeDeepClone)(n),i=this.cacheResultProcessor.processReadResult(r,e);return i===Mc.ReadResultStatus.Complete?n:(this.broadcastWatches(),i===Mc.ReadResultStatus.Evicted?null:r)}diff(e){const n=super.diff(e);if(!this.invalidationPolicyManager.isPolicyEventActive(Rn.InvalidationPolicyEvent.Read)||this.isBroadcasting)return n;const{result:r}=n,i=(0,mi.maybeDeepClone)(r),s=this.cacheResultProcessor.processReadResult(i,e);return s===Mc.ReadResultStatus.Complete||(this.broadcastWatches(),n.complete=!1,n.result=s===Mc.ReadResultStatus.Evicted?void 0:i),n}extract(e=!1,n=!0){this._hasPendingCollectionUpdates&&this._updatePendingCollections();const r=super.extract(e);return n&&(r.invalidation=(0,tX.default)(this.entityTypeMap.extract(),"entitiesById")),r}readFragmentWhere(e){const{fragment:n,filter:r,limit:i,orderBy:s}=e,o=Vv(e,["fragment","filter","limit","orderBy"]),l=n.definitions[0].typeCondition.name.value,d=this.readReferenceWhere({__typename:l,filter:r,limit:i,orderBy:s}).map(h=>this.readFragment(Object.assign(Object.assign({},o),{fragment:n,id:h.__ref})));return(0,Z7.default)(d)}readReferenceWhere(e){const{__typename:n,filter:r,limit:i,orderBy:s}=e,o=(0,jv.collectionEntityIdForType)(n);this.pendingCollectionUpdates[o]&&this._updatePendingCollection(o);let a=this.readField("data",(0,Ms.makeReference)(o));if(!a)return[];const l=this.readField.bind(this);if(r&&(a=a.filter(u=>{if((0,iX.default)(r))return r(u,l);const d=Object.keys(r).map(h=>{const p=r[h],g=this.readField(h,u);return p===g});return(0,eX.default)(d,Boolean)})),s){const{field:u,descending:d}=s;a=(0,sX.default)(a,h=>l(u,h),[d?"desc":"asc"])}return(0,rX.default)(i)?a:(0,nX.default)(a,i)}writeFragmentWhere(e){const{update:n}=e,r=Vv(e,["update"]);this.readFragmentWhere(r).forEach(i=>{this.writeFragment({id:this.identify(i),fragment:e.fragment,data:n(i),broadcast:!1})}),this.broadcastWatches()}}yd.default=lX,function(t){var e=De&&De.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCache=t.makeCachedVar=void 0;var n=tv;Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return n.makeCachedVar}});var r=yd;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e(r).default}})}(T1);var fA={},Bv={},Rs={};const cX=ma(YM);Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.buildWatchFragmentWhereQuery=Rs.buildWatchFragmentQuery=void 0;const Ps=cX,uX=kc;function dA({fieldName:t,fragmentDefinition:e}){return{kind:Ps.Kind.DOCUMENT,definitions:[{directives:[],variableDefinitions:[],kind:Ps.Kind.OPERATION_DEFINITION,operation:Ps.OperationTypeNode.QUERY,selectionSet:{kind:Ps.Kind.SELECTION_SET,selections:[{arguments:[],kind:Ps.Kind.FIELD,name:{kind:Ps.Kind.NAME,value:t},directives:[{arguments:[],kind:Ps.Kind.DIRECTIVE,name:{kind:Ps.Kind.NAME,value:"client"}}],selectionSet:e.selectionSet}]}}]}}function fX(t){const{fragment:e,id:n,policies:r,fieldName:i}=t,s=e.definitions[0],o=dA({fragmentDefinition:s,fieldName:i});return r.getFieldPolicy("Query",i)||r.addTypePolicies({Query:{fields:{[i]:{read(a){return(0,uX.makeReference)(n)}}}}}),o}Rs.buildWatchFragmentQuery=fX;function dX(t){const{fragment:e,filterVar:n,limitVar:r,orderByVar:i,policies:s,cache:o,fieldName:a}=t,l=e.definitions[0],u=l.typeCondition.name.value,d=dA({fragmentDefinition:l,fieldName:a});return s.getFieldPolicy("Query",a)||s.addTypePolicies({Query:{fields:{[a]:{read(h){return o.readReferenceWhere({__typename:u,filter:n(),limit:r(),orderBy:i()})}}}}}),d}Rs.buildWatchFragmentWhereQuery=dX,Object.defineProperty(Bv,"__esModule",{value:!0});const jd=kc,hA=Rs,pA=xs;class hX extends jd.ApolloClient{constructor(e){super(e),this.policies=this.cache.policies}watchQueryForField(e,n){const r=this.watchQuery({fetchPolicy:"cache-only",query:e}),i=r.subscribe.bind(r);return r.subscribe=(s,...o)=>{typeof s!="object"&&(s={next:s,error:o[0],complete:o[1]});const a=s.next;s.next=d=>{var h;a&&a((h=d==null?void 0:d.data)===null||h===void 0?void 0:h[n])};const l=i(s),u=l.unsubscribe.bind(l);return l.unsubscribe=()=>{delete this.cache.policies.typePolicies.Query.fields[n],u()},l},r}watchFragment(e){const n=(0,pA.generateFragmentFieldName)(),r=(0,hA.buildWatchFragmentQuery)(Object.assign(Object.assign({},e),{fieldName:n,policies:this.policies}));return this.watchQueryForField(r,n)}watchFragmentWhere(e){const n=(0,pA.generateFragmentFieldName)(),r=(0,jd.makeVar)(e.filter),i=(0,jd.makeVar)(e.limit),s=(0,jd.makeVar)(e.orderBy),o=(0,hA.buildWatchFragmentWhereQuery)(Object.assign(Object.assign({},e),{fieldName:n,filterVar:r,limitVar:i,orderByVar:s,cache:this.cache,policies:this.policies}));return this.watchQueryForField(o,n)}}Bv.default=hX,function(t){var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.ApolloExtensionsClient=void 0;var n=Bv;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return e(n).default}})}(fA);var mA={},Uv={},Po={},pX=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Po,"__esModule",{value:!0}),Po.usePrevious=Po.useOnce=void 0;const Bd=ie,mX=pX(wd);function gX(t){const e=(0,Bd.useRef)(),n=(0,Bd.useRef)(!1);return n.current||((0,mX.default)(t)?e.current=t():e.current=t,n.current=!0),e.current}Po.useOnce=gX;const yX=t=>{const e=(0,Bd.useRef)(null);return(0,Bd.useEffect)(()=>{e.current=t}),e.current};Po.usePrevious=yX;var Rc={};Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.useFragmentTypePolicyFieldName=void 0;const vX=La,gA=ie,bX=xs,_X=Po,EX=({fragmentName:t}={})=>{const e=(0,gA.useMemo)(()=>(0,bX.generateFragmentFieldName)({fragmentName:t}),[t]),n=(0,_X.usePrevious)(e),r=(0,vX.useApolloClient)();return(0,gA.useEffect)(()=>()=>{delete r.cache.policies.typePolicies.Query.fields[n]},[e,n]),e};Rc.useFragmentTypePolicyFieldName=EX;var Pc={};Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.useGetQueryDataByFieldName=void 0;const wX=La,TX=(t,e,n)=>{var r,i;const s=(0,wX.useQuery)(t,{fetchPolicy:"cache-only",returnPartialData:n==null?void 0:n.returnPartialData});return{data:(i=(r=s==null?void 0:s.data)===null||r===void 0?void 0:r[e])!==null&&i!==void 0?i:null}};Pc.useGetQueryDataByFieldName=TX,Object.defineProperty(Uv,"__esModule",{value:!0});const SX=La,OX=ie,kX=Po,NX=Rs,AX=Rc,IX=Pc;function xX(t,e){const r=(0,OX.useContext)((0,SX.getApolloContext)()).client,i=r==null?void 0:r.cache,s=(0,AX.useFragmentTypePolicyFieldName)(),o=(0,kX.useOnce)(()=>(0,NX.buildWatchFragmentQuery)({fragment:t,fieldName:s,id:e.id,policies:i.policies}));return(0,IX.useGetQueryDataByFieldName)(o,s,e)}Uv.default=xX;var qv={};const CX=ma(JP);Object.defineProperty(qv,"__esModule",{value:!0});const DX=La,Li=ie,MX=Rs,RX=Rc,PX=Pc,Wv=La,yA=CX;function FX(t,e){var n;const r=e==null?void 0:e.filter,s=(0,Li.useRef)((0,Wv.makeVar)(r)).current,o=e==null?void 0:e.limit,l=(0,Li.useRef)((0,Wv.makeVar)(o)).current,u=e==null?void 0:e.orderBy,h=(0,Li.useRef)((0,Wv.makeVar)(u)).current,g=(0,Li.useContext)((0,DX.getApolloContext)()).client,y=g==null?void 0:g.cache,b=(0,RX.useFragmentTypePolicyFieldName)({fragmentName:e==null?void 0:e.fragmentName}),_=(0,Li.useRef)([]);(0,Li.useEffect)(()=>{(typeof r=="function"&&r!==s()||!(0,yA.equal)(r,s()))&&s(r)},[r]),(0,Li.useEffect)(()=>{o!==l()&&l(o)},[o]),(0,Li.useEffect)(()=>{(typeof u=="function"&&u!==h()||!(0,yA.equal)(u,h()))&&h(u)},[u]);const w=(0,Li.useMemo)(()=>(0,MX.buildWatchFragmentWhereQuery)({filter:r,filterVar:s,limitVar:l,orderByVar:h,fragment:t,fieldName:b,cache:y,policies:y.policies}),[b]),O=(0,PX.useGetQueryDataByFieldName)(w,b,e);return Object.assign(Object.assign({},O),{data:(n=O.data)!==null&&n!==void 0?n:_.current})}qv.default=FX,function(t){var e=De&&De.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFragmentWhere=t.useFragment=void 0;var n=Uv;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return e(n).default}});var r=qv;Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return e(r).default}})}(mA);var vA={},zv={},Fc={},LX=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.AuditType=void 0;const $X=LX(Md);var Lc;(function(t){t.Read="Read",t.Write="Write",t.Evict="Evict"})(Lc||(Fc.AuditType=Lc={}));class VX extends $X.default{constructor(e){super(e),this.auditLog=e.auditLog}runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s=!1}){return this.auditLog.log("Running read policy",Lc.Read,"InvalidationPolicyManager",{storeFieldName:i,typename:e,dataId:n,fieldName:r}),super.runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s})}runWritePolicy(e,n){return this.auditLog.log("Running write policy",Lc.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runWritePolicy(e,n)}runEvictPolicy(e,n){return this.auditLog.log("Running evict policy",Lc.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runEvictPolicy(e,n)}}Fc.default=VX;var Qv={},jX=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qv,"__esModule",{value:!0});const BX=jX(Vd);var Ud;(function(t){t.Write="Write",t.Evict="Evict"})(Ud||(Ud={}));class UX extends BX.default{constructor(e){super(),this.auditLog=e.auditLog}write(e,n,r,i){return this.auditLog.log("Writing to type map",Ud.Write,"EntityTypeMap",{typename:e,dataId:n,storeFieldName:r,variables:i}),super.write(e,n,r,i)}evict(e,n){return this.auditLog.log("Evicting from type map",Ud.Evict,"EntityTypeMap",{dataId:e,storeFieldName:n}),super.evict(e,n)}}Qv.default=UX;var Gv={},qX=av;function WX(t,e){var n=[];return qX(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}var zX=WX,QX=G1,GX=zX,HX=Sv,KX=Mn;function JX(t,e){var n=KX(t)?QX:GX;return n(t,HX(e))}var YX=JX,XX=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gv,"__esModule",{value:!0});const ZX=XX(YX);class eZ{constructor(){this._log=[]}log(e,n,r,i){const s={time:Date.now(),type:n,event:e,meta:i,group:r};this._log.push(s)}getLog(e){return(0,ZX.default)(this._log,e)}printLog(e){this.getLog(e).forEach(this.printLogEntry)}printLogEntry(e){var n;console.log(`%c event: ${e.event}`,"color: green"),console.group(),console.log(`type: ${e.type}`),console.log(`time: ${e.time}`),console.log(`meta: ${JSON.stringify((n=e.meta)!==null&&n!==void 0?n:{})}`),console.groupEnd()}}Gv.default=eZ;var qd=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zv,"__esModule",{value:!0});const tZ=qd(yd),nZ=Ro,rZ=qd(Fc),iZ=qd(Qv),sZ=qd(Gv),oZ=Pv;class aZ extends tZ.default{constructor(e){super(e),this.auditLog=new sZ.default;const{invalidationPolicies:n={}}=e;this.entityTypeMap=new iZ.default({auditLog:this.auditLog}),new oZ.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new rZ.default({auditLog:this.auditLog,policies:n,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:this.evict.bind(this),modify:this.modify.bind(this),readField:this.readField.bind(this)}}),this.cacheResultProcessor=new nZ.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this})}}zv.default=aZ,function(t){var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCacheAuditor=void 0;var n=zv;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return e(n).default}})}(vA),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RenewalPolicy=t.InvalidationPolicyEvent=t.InvalidationPolicyCacheAuditor=t.useFragmentWhere=t.useFragment=t.ApolloExtensionsClient=t.makeCachedVar=t.InvalidationPolicyCache=void 0;var e=T1;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e.InvalidationPolicyCache}}),Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return e.makeCachedVar}});var n=fA;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return n.ApolloExtensionsClient}});var r=mA;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return r.useFragment}}),Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return r.useFragmentWhere}});var i=vA;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return i.InvalidationPolicyCacheAuditor}});var s=Ir;Object.defineProperty(t,"InvalidationPolicyEvent",{enumerable:!0,get:function(){return s.InvalidationPolicyEvent}}),Object.defineProperty(t,"RenewalPolicy",{enumerable:!0,get:function(){return s.RenewalPolicy}})}(ev);var Hv=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},lZ=function(){function t(e){var n=e.debug,r=n===void 0?!1:n;this.debug=r,this.lines=[]}return t.prototype.emit=function(e,n){if(e in console){var r=t.prefix;console[e].apply(console,Hv([r],n,!1))}},t.prototype.tailLogs=function(){var e=this;this.lines.forEach(function(n){var r=n[0],i=n[1];return e.emit(r,i)})},t.prototype.getLogs=function(){return this.lines},t.prototype.write=function(e,n){var r=t.buffer;this.lines=Hv(Hv([],this.lines.slice(1-r),!0),[[e,n]],!1),(this.debug||e!=="log")&&this.emit(e,n)},t.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("log",e)},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("warn",e)},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("error",e)},t.buffer=30,t.prefix="[apollo-cache-persist]",t}(),cZ=function(){function t(e){var n=e.cache,r=e.serialize,i=r===void 0?!0:r;this.cache=n,this.serialize=i}return t.prototype.extract=function(){var e=this.cache.extract();return this.serialize&&(e=JSON.stringify(e)),e},t.prototype.restore=function(e){this.serialize&&typeof e=="string"&&(e=JSON.parse(e)),e!=null&&this.cache.restore(e)},t}(),Wd=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})},zd=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},bA=function(){function t(e){var n=e.storage,r=e.key,i=r===void 0?"apollo-cache-persist":r;this.storage=n,this.key=i}return t.prototype.read=function(){return Wd(this,void 0,void 0,function(){return zd(this,function(e){return[2,this.storage.getItem(this.key)]})})},t.prototype.write=function(e){return Wd(this,void 0,void 0,function(){return zd(this,function(n){switch(n.label){case 0:return[4,this.storage.setItem(this.key,e)];case 1:return n.sent(),[2]}})})},t.prototype.purge=function(){return Wd(this,void 0,void 0,function(){return zd(this,function(e){switch(e.label){case 0:return[4,this.storage.removeItem(this.key)];case 1:return e.sent(),[2]}})})},t.prototype.getSize=function(){return Wd(this,void 0,void 0,function(){var e;return zd(this,function(n){switch(n.label){case 0:return[4,this.storage.getItem(this.key)];case 1:return e=n.sent(),e==null?[2,0]:[2,typeof e=="string"?e.length:null]}})})},t}(),Kv=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})},Jv=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},_A=function(){function t(e,n){var r=e.log,i=e.cache,s=e.storage,o=n.maxSize,a=o===void 0?1024*1024:o,l=n.persistenceMapper;this.log=r,this.cache=i,this.storage=s,this.paused=!1,l&&(this.persistenceMapper=l),a&&(this.maxSize=a)}return t.prototype.persist=function(){return Kv(this,void 0,void 0,function(){var e,n;return Jv(this,function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),e=this.cache.extract(),!this.paused&&this.persistenceMapper?[4,this.persistenceMapper(e)]:[3,2];case 1:e=r.sent(),r.label=2;case 2:return this.maxSize!=null&&typeof e=="string"&&e.length>this.maxSize&&!this.paused?[4,this.purge()]:[3,4];case 3:return r.sent(),this.paused=!0,[2];case 4:return this.paused?[2]:[4,this.storage.write(e)];case 5:return r.sent(),this.log.info(typeof e=="string"?"Persisted cache of size ".concat(e.length," characters"):"Persisted cache"),[3,7];case 6:throw n=r.sent(),this.log.error("Error persisting cache",n),n;case 7:return[2]}})})},t.prototype.restore=function(){return Kv(this,void 0,void 0,function(){var e,n;return Jv(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),[4,this.storage.read()];case 1:return e=r.sent(),e==null?[3,3]:[4,this.cache.restore(e)];case 2:return r.sent(),this.log.info(typeof e=="string"?"Restored cache of size ".concat(e.length," characters"):"Restored cache"),[3,4];case 3:this.log.info("No stored cache to restore"),r.label=4;case 4:return[3,6];case 5:throw n=r.sent(),this.log.error("Error restoring cache",n),n;case 6:return[2]}})})},t.prototype.purge=function(){return Kv(this,void 0,void 0,function(){var e;return Jv(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.storage.purge()];case 1:return n.sent(),this.log.info("Purged cache storage"),[3,3];case 2:throw e=n.sent(),this.log.error("Error purging cache storage",e),e;case 3:return[2]}})})},t}();const EA=function(t){var e=t.cache;return function(n){var r=e.write,i=e.evict,s=e.modify,o=e.gc;return e.write=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=r.apply(e,a);return n(),u},e.evict=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=i.apply(e,a);return n(),u},e.modify=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=s.apply(e,a);return n(),u},e.gc=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=o.apply(e,a);return n(),u},function(){e.write=r,e.evict=i,e.modify=s,e.gc=o}}},uZ=function(t){var e=t.log,n=t.cache;return function(r){return e.warn("Trigger option `background` not available on web; using `write` trigger"),EA({cache:n})(r)}};var fZ=function(){function t(e,n){var r=e.log,i=e.persistor,s=this;this.fire=function(){if(!s.debounce){s.persist();return}s.timeout!=null&&clearTimeout(s.timeout),s.timeout=setTimeout(s.persist,s.debounce)},this.persist=function(){s.paused||s.persistor.persist()};var o=t.defaultDebounce,a=n.cache,l=n.debounce,u=n.trigger,d=u===void 0?"write":u;if(d)switch(this.debounce=l??o,this.persistor=i,this.paused=!1,d){case"write":this.uninstall=EA({cache:a})(this.fire);break;case"background":l&&r.warn("Debounce is not recommended with `background` trigger"),this.debounce=l,this.uninstall=uZ({cache:a,log:r})(this.fire);break;default:if(typeof d=="function")this.uninstall=d(this.fire);else throw Error("Unrecognized trigger option: ".concat(d))}}return t.prototype.pause=function(){this.paused=!0},t.prototype.resume=function(){this.paused=!1},t.prototype.remove=function(){this.uninstall&&(this.uninstall(),this.uninstall=null,this.paused=!0)},t.defaultDebounce=1e3,t}(),dZ=function(){function t(e){if(!e.cache)throw new Error("In order to persist your Apollo Cache, you need to pass in a cache. Please see https://www.apollographql.com/docs/react/basics/caching.html for our default InMemoryCache.");if(!e.storage)throw new Error("In order to persist your Apollo Cache, you need to pass in an underlying storage provider. Please see https://github.com/apollographql/apollo-cache-persist#storage-providers");var n=new lZ(e),r=new cZ(e),i=new bA(e),s=new _A({log:n,cache:r,storage:i},e),o=new fZ({log:n,persistor:s},e);this.log=n,this.cache=r,this.storage=i,this.persistor=s,this.trigger=o}return t.prototype.persist=function(){return this.persistor.persist()},t.prototype.restore=function(){return this.persistor.restore()},t.prototype.purge=function(){return this.persistor.purge()},t.prototype.pause=function(){this.trigger.pause()},t.prototype.resume=function(){this.trigger.resume()},t.prototype.remove=function(){this.trigger.remove()},t.prototype.getLogs=function(e){if(e===void 0&&(e=!1),e)this.log.tailLogs();else return this.log.getLogs()},t.prototype.getSize=function(){return this.storage.getSize()},t}(),Yv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hZ=function(t){var e=new pZ(t);e.restoreSync()},pZ=function(t){Yv(e,t);function e(n){var r=t.call(this,n)||this;return r.storage=new gZ(n),r.persistor=new mZ({log:r.log,cache:r.cache,storage:r.storage},n),r}return e.prototype.restoreSync=function(){this.persistor.restoreSync()},e}(dZ),mZ=function(t){Yv(e,t);function e(n,r){var i=n.log,s=n.cache,o=n.storage;return t.call(this,{log:i,cache:s,storage:o},r)||this}return e.prototype.restoreSync=function(){this.cache.restore(this.storage.readSync())},e}(_A),gZ=function(t){Yv(e,t);function e(n){return t.call(this,n)||this}return e.prototype.readSync=function(){return this.storage.getItem(this.key)},e}(bA),yZ=function(){function t(e){this.storage=e}return t.prototype.getItem=function(e){return this.storage.getItem(e)},t.prototype.removeItem=function(e){return this.storage.removeItem(e)},t.prototype.setItem=function(e,n){return n!==null?this.storage.setItem(e,n):this.removeItem(e)},t}();function Hn(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function Fo(t){return Hn(t)==="object"}function vZ(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function wA(t,e){return t.length<124?t:e}const bZ="graphql-transport-ws";var or;(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"})(or||(or={}));var Dt;(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"})(Dt||(Dt={}));function TA(t){if(!Fo(t))throw new Error(`Message is expected to be an object, but got ${Hn(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 ${Hn(t.type)}`);switch(t.type){case Dt.ConnectionInit:case Dt.ConnectionAck:case Dt.Ping:case Dt.Pong:{if(t.payload!=null&&!Fo(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 Dt.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Hn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Fo(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Hn(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 ${Hn(t.payload.query)}`);if(t.payload.variables!=null&&!Fo(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 ${Hn(t.payload.variables)}`);if(t.payload.operationName!=null&&Hn(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 ${Hn(t.payload.operationName)}`);if(t.payload.extensions!=null&&!Fo(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 ${Hn(t.payload.extensions)}`);break}case Dt.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Hn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Fo(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Hn(t.payload)}`);break}case Dt.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Hn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!vZ(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 Dt.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Hn(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 _Z(t,e){return TA(typeof t=="string"?JSON.parse(t,e):t)}function $c(t,e){return TA(t),JSON.stringify(t,e)}var za=function(t){return this instanceof za?(this.v=t,this):new za(t)},EZ=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(p){r[p]&&(i[p]=function(g){return new Promise(function(y,b){s.push([p,g,y,b])>1||a(p,g)})})}function a(p,g){try{l(r[p](g))}catch(y){h(s[0][3],y)}}function l(p){p.value instanceof za?Promise.resolve(p.value.v).then(u,d):h(s[0][2],p)}function u(p){a("next",p)}function d(p){a("throw",p)}function h(p,g){p(g),s.shift(),s.length&&a(s[0][0],s[0][1])}};function wZ(t){const{url:e,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:s=0,keepAlive:o=0,disablePong:a,connectionAckWaitTimeout:l=0,retryAttempts:u=5,retryWait:d=async function(xe){let fe=1e3;for(let Ee=0;Ee<xe;Ee++)fe*=2;await new Promise(Ee=>setTimeout(Ee,fe+Math.floor(Math.random()*2700+300)))},shouldRetry:h=Xv,isFatalConnectionProblem:p,on:g,webSocketImpl:y,generateID:b=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,xe=>{const fe=Math.random()*16|0;return(xe=="x"?fe:fe&3|8).toString(16)})},jsonMessageReplacer:_,jsonMessageReviver:w}=t;let O;if(y){if(!SZ(y))throw new Error("Invalid WebSocket implementation provided");O=y}else typeof WebSocket<"u"?O=WebSocket:typeof global<"u"?O=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(O=window.WebSocket||window.MozWebSocket);if(!O)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const N=O,I=(()=>{const te=(()=>{const fe={};return{on(Ee,ye){return fe[Ee]=ye,()=>{delete fe[Ee]}},emit(Ee){var ye;"id"in Ee&&((ye=fe[Ee.id])===null||ye===void 0||ye.call(fe,Ee))}}})(),xe={connecting:g!=null&&g.connecting?[g.connecting]:[],opened:g!=null&&g.opened?[g.opened]:[],connected:g!=null&&g.connected?[g.connected]:[],ping:g!=null&&g.ping?[g.ping]:[],pong:g!=null&&g.pong?[g.pong]:[],message:g!=null&&g.message?[te.emit,g.message]:[te.emit],closed:g!=null&&g.closed?[g.closed]:[],error:g!=null&&g.error?[g.error]:[]};return{onMessage:te.on,on(fe,Ee){const ye=xe[fe];return ye.push(Ee),()=>{ye.splice(ye.indexOf(Ee),1)}},emit(fe,...Ee){for(const ye of[...xe[fe]])ye(...Ee)}}})();function P(te){const xe=[I.on("error",fe=>{xe.forEach(Ee=>Ee()),te(fe)}),I.on("closed",fe=>{xe.forEach(Ee=>Ee()),te(fe)})]}let R,B=0,Q,x=!1,U=0,be=!1;async function Oe(){clearTimeout(Q);const[te,xe]=await(R??(R=new Promise((ye,ut)=>(async()=>{if(x){if(await d(U),!B)return R=void 0,ut({code:1e3,reason:"All Subscriptions Gone"});U++}I.emit("connecting",x);const ve=new N(typeof e=="function"?await e():e,bZ);let $,Z;function Y(){isFinite(o)&&o>0&&(clearTimeout(Z),Z=setTimeout(()=>{ve.readyState===N.OPEN&&(ve.send($c({type:Dt.Ping})),I.emit("ping",!1,void 0))},o))}P(we=>{R=void 0,clearTimeout($),clearTimeout(Z),ut(we),we instanceof SA&&(ve.close(4499,"Terminated"),ve.onerror=null,ve.onclose=null)}),ve.onerror=we=>I.emit("error",we),ve.onclose=we=>I.emit("closed",we),ve.onopen=async()=>{try{I.emit("opened",ve);const we=typeof n=="function"?await n():n;if(ve.readyState!==N.OPEN)return;ve.send($c(we?{type:Dt.ConnectionInit,payload:we}:{type:Dt.ConnectionInit},_)),isFinite(l)&&l>0&&($=setTimeout(()=>{ve.close(or.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),Y()}catch(we){I.emit("error",we),ve.close(or.InternalClientError,wA(we instanceof Error?we.message:new Error(we).message,"Internal client error"))}};let ee=!1;ve.onmessage=({data:we})=>{try{const Pe=_Z(we,w);if(I.emit("message",Pe),Pe.type==="ping"||Pe.type==="pong"){I.emit(Pe.type,!0,Pe.payload),Pe.type==="pong"?Y():a||(ve.send($c(Pe.payload?{type:Dt.Pong,payload:Pe.payload}:{type:Dt.Pong})),I.emit("pong",!1,Pe.payload));return}if(ee)return;if(Pe.type!==Dt.ConnectionAck)throw new Error(`First message cannot be of type ${Pe.type}`);clearTimeout($),ee=!0,I.emit("connected",ve,Pe.payload,x),x=!1,U=0,ye([ve,new Promise((Ze,ln)=>P(ln))])}catch(Pe){ve.onmessage=null,I.emit("error",Pe),ve.close(or.BadResponse,wA(Pe instanceof Error?Pe.message:new Error(Pe).message,"Bad response"))}}})())));te.readyState===N.CLOSING&&await xe;let fe=()=>{};const Ee=new Promise(ye=>fe=ye);return[te,fe,Promise.race([Ee.then(()=>{if(!B){const ye=()=>te.close(1e3,"Normal Closure");isFinite(s)&&s>0?Q=setTimeout(()=>{te.readyState===N.OPEN&&ye()},s):ye()}}),xe])]}function ke(te){if(Xv(te)&&(TZ(te.code)||[or.InternalServerError,or.InternalClientError,or.BadRequest,or.BadResponse,or.Unauthorized,or.SubprotocolNotAcceptable,or.SubscriberAlreadyExists,or.TooManyInitialisationRequests].includes(te.code)))throw te;if(be)return!1;if(Xv(te)&&te.code===1e3)return B>0;if(!u||U>=u||!h(te)||p!=null&&p(te))throw te;return x=!0}r||(async()=>{for(B++;;)try{const[,,te]=await Oe();await te}catch(te){try{if(!ke(te))return}catch(xe){return i==null?void 0:i(xe)}}})();function je(te,xe){const fe=b(te);let Ee=!1,ye=!1,ut=()=>{B--,Ee=!0};return(async()=>{for(B++;;)try{const[ve,$,Z]=await Oe();if(Ee)return $();const Y=I.onMessage(fe,ee=>{switch(ee.type){case Dt.Next:{xe.next(ee.payload);return}case Dt.Error:{ye=!0,Ee=!0,xe.error(ee.payload),ut();return}case Dt.Complete:{Ee=!0,ut();return}}});ve.send($c({id:fe,type:Dt.Subscribe,payload:te},_)),ut=()=>{!Ee&&ve.readyState===N.OPEN&&ve.send($c({id:fe,type:Dt.Complete},_)),B--,Ee=!0,$()},await Z.finally(Y);return}catch(ve){if(!ke(ve))return}})().then(()=>{ye||xe.complete()}).catch(ve=>{xe.error(ve)}),()=>{Ee||ut()}}return{on:I.on,subscribe:je,iterate(te){const xe=[],fe={done:!1,error:null,resolve:()=>{}},Ee=je(te,{next(ut){xe.push(ut),fe.resolve()},error(ut){fe.done=!0,fe.error=ut,fe.resolve()},complete(){fe.done=!0,fe.resolve()}}),ye=function(){return EZ(this,arguments,function*(){for(;;){for(xe.length||(yield za(new Promise($=>fe.resolve=$)));xe.length;)yield yield za(xe.shift());if(fe.error)throw fe.error;if(fe.done)return yield za(void 0)}})}();return ye.throw=async ut=>(fe.done||(fe.done=!0,fe.error=ut,fe.resolve()),{done:!0,value:void 0}),ye.return=async()=>(Ee(),{done:!0,value:void 0}),ye},async dispose(){if(be=!0,R){const[te]=await R;te.close(1e3,"Normal Closure")}},terminate(){R&&I.emit("closed",new SA)}}}class SA extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function Xv(t){return Fo(t)&&"code"in t&&"reason"in t}function TZ(t){return[1e3,1001,1006,1005,1012,1013,1014].includes(t)?!1:t>=1e3&&t<=1999}function SZ(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}const OZ=({apiUrl:t,organizationId:e,listeners:n,lazy:r=!1,token:i})=>{const s=wZ({url:`wss://${t}`,lazy:r,connectionParams:oc.omitBy({"organization-id":e,authorization:i?`Bearer ${i}`:void 0},oc.isNil),keepAlive:1e4});return n&&(n.onConnected&&s.on("connected",n.onConnected),n.onClosed&&s.on("closed",n.onClosed),n.onError&&s.on("error",n.onError)),s},kZ=({token:t,organizationId:e,invalidationPolicies:n,handlers:r,fetchPolicy:i,websocket:s,apiBaseUrl:o})=>{const a=new ev.InvalidationPolicyCache({invalidationPolicies:{...n,timeToLive:(n==null?void 0:n.timeToLive)??12e4,renewalPolicy:(n==null?void 0:n.renewalPolicy)??ev.RenewalPolicy.None}});hZ({cache:a,storage:new yZ(window.localStorage)});const l=`api.warrior.${o??"well-played.gg"}/graphql`,u=Nm(({query:d})=>{const h=so(d);return h.kind==="OperationDefinition"&&h.operation==="subscription"},new lW(OZ({apiUrl:l,listeners:r==null?void 0:r.webSocket,organizationId:e,lazy:s==null?void 0:s.lazy,token:t})),km([sW(async()=>({headers:oc.omitBy({"organization-id":e,authorization:t?`Bearer ${t}`:void 0},oc.isNil)})),...r!=null&&r.onError?[w1(r==null?void 0:r.onError)]:[],new rf({uri:`https://${l}`})]));return new df({cache:a,link:u,defaultOptions:{watchQuery:{fetchPolicy:i??"network-only",errorPolicy:"ignore"},query:{fetchPolicy:i??"network-only",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})},OA=ie.createContext({}),NZ=()=>{const t=ie.useContext(OA);if(!t)throw new Error("useWellPlayed must be used within a WellPlayedProvider");return t},AZ=({children:t,clientConfig:e,organizationId:n})=>{const r=A$(),i=ie.useMemo(()=>(console.log("accessToken",r==null?void 0:r.accessToken),kZ({token:(r==null?void 0:r.accessToken)??void 0,organizationId:n,...e})),[r==null?void 0:r.accessToken,n,e]);return he.jsx(AT,{client:i,children:he.jsx(OA.Provider,{value:{organizationId:n,apiClient:i},children:t})})},IZ=({children:t,oidcConfig:e,wpAppConfig:n,...r})=>he.jsx(S$,{...e,configuration:{...n,...e==null?void 0:e.configuration,authority:`https://oauth.warrior.${r.apiBaseUrl??"well-played.gg"}`},children:he.jsx(AZ,{...r,children:t})});Gt.RichTextEditorContent=iW,Gt.WellPlayedProvider=IZ,Gt.graphql=wa,Gt.readFragment=L$,Gt.useConnectedPlayer=j$,Gt.usePaginatedLoadAll=wg,Gt.usePaginatedQuery=pL,Gt.usePlayers=vS,Gt.useTournamentStep=W$,Gt.useTournamentTeams=bS,Gt.useWellPlayed=NZ,Object.defineProperty(Gt,Symbol.toStringTag,{value:"Module"})});
|