@well-played.gg/react-sdk 1.0.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.
@@ -0,0 +1,479 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ce=require("react"),VL=require("react-dom");function jL(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 Pe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function BL(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function nl(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 $g={exports:{}},zl={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var vw;function UL(){if(vw)return zl;vw=1;var t=ce,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,u){var d,h={},p=null,g=null;u!==void 0&&(p=""+u),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(g=l.ref);for(d in l)r.call(l,d)&&!s.hasOwnProperty(d)&&(h[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)h[d]===void 0&&(h[d]=l[d]);return{$$typeof:e,type:a,key:p,ref:g,props:h,_owner:i.current}}return zl.Fragment=n,zl.jsx=o,zl.jsxs=o,zl}var Ql={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var bw;function WL(){return bw||(bw=1,process.env.NODE_ENV!=="production"&&function(){var t=ce,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),y=Symbol.iterator,b="@@iterator";function _(C){if(C===null||typeof C!="object")return null;var J=y&&C[y]||C[b];return typeof J=="function"?J:null}var w=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function O(C){{for(var J=arguments.length,ie=new Array(J>1?J-1:0),Oe=1;Oe<J;Oe++)ie[Oe-1]=arguments[Oe];N("error",C,ie)}}function N(C,J,ie){{var Oe=w.ReactDebugCurrentFrame,nt=Oe.getStackAddendum();nt!==""&&(J+="%s",ie=ie.concat([nt]));var lt=ie.map(function(Je){return String(Je)});lt.unshift("Warning: "+J),Function.prototype.apply.call(console[C],console,lt)}}var I=!1,P=!1,M=!1,B=!1,Q=!1,x;x=Symbol.for("react.module.reference");function U(C){return!!(typeof C=="string"||typeof C=="function"||C===r||C===s||Q||C===i||C===u||C===d||B||C===g||I||P||M||typeof C=="object"&&C!==null&&(C.$$typeof===p||C.$$typeof===h||C.$$typeof===o||C.$$typeof===a||C.$$typeof===l||C.$$typeof===x||C.getModuleId!==void 0))}function Te(C,J,ie){var Oe=C.displayName;if(Oe)return Oe;var nt=J.displayName||J.name||"";return nt!==""?ie+"("+nt+")":ie}function ke(C){return C.displayName||"Context"}function he(C){if(C==null)return null;if(typeof C.tag=="number"&&O("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof C=="function")return C.displayName||C.name||null;if(typeof C=="string")return C;switch(C){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof C=="object")switch(C.$$typeof){case a:var J=C;return ke(J)+".Consumer";case o:var ie=C;return ke(ie._context)+".Provider";case l:return Te(C,C.render,"ForwardRef");case h:var Oe=C.displayName||null;return Oe!==null?Oe:he(C.type)||"Memo";case p:{var nt=C,lt=nt._payload,Je=nt._init;try{return he(Je(lt))}catch{return null}}}return null}var Ce=Object.assign,ee=0,Ae,fe,ve,Se,dt,Ne,L;function te(){}te.__reactDisabledLog=!0;function X(){{if(ee===0){Ae=console.log,fe=console.info,ve=console.warn,Se=console.error,dt=console.group,Ne=console.groupCollapsed,L=console.groupEnd;var C={configurable:!0,enumerable:!0,value:te,writable:!0};Object.defineProperties(console,{info:C,log:C,warn:C,error:C,group:C,groupCollapsed:C,groupEnd:C})}ee++}}function ne(){{if(ee--,ee===0){var C={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ce({},C,{value:Ae}),info:Ce({},C,{value:fe}),warn:Ce({},C,{value:ve}),error:Ce({},C,{value:Se}),group:Ce({},C,{value:dt}),groupCollapsed:Ce({},C,{value:Ne}),groupEnd:Ce({},C,{value:L})})}ee<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var be=w.ReactCurrentDispatcher,Re;function Ke(C,J,ie){{if(Re===void 0)try{throw Error()}catch(nt){var Oe=nt.stack.trim().match(/\n( *(at )?)/);Re=Oe&&Oe[1]||""}return`
18
+ `+Re+C}}var Kt=!1,ri;{var ii=typeof WeakMap=="function"?WeakMap:Map;ri=new ii}function Bt(C,J){if(!C||Kt)return"";{var ie=ri.get(C);if(ie!==void 0)return ie}var Oe;Kt=!0;var nt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var lt;lt=be.current,be.current=null,X();try{if(J){var Je=function(){throw Error()};if(Object.defineProperty(Je.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Je,[])}catch(pn){Oe=pn}Reflect.construct(C,[],Je)}else{try{Je.call()}catch(pn){Oe=pn}C.call(Je.prototype)}}else{try{throw Error()}catch(pn){Oe=pn}C()}}catch(pn){if(pn&&Oe&&typeof pn.stack=="string"){for(var ze=pn.stack.split(`
19
+ `),nn=Oe.stack.split(`
20
+ `),St=ze.length-1,At=nn.length-1;St>=1&&At>=0&&ze[St]!==nn[At];)At--;for(;St>=1&&At>=0;St--,At--)if(ze[St]!==nn[At]){if(St!==1||At!==1)do if(St--,At--,At<0||ze[St]!==nn[At]){var rn=`
21
+ `+ze[St].replace(" at new "," at ");return C.displayName&&rn.includes("<anonymous>")&&(rn=rn.replace("<anonymous>",C.displayName)),typeof C=="function"&&ri.set(C,rn),rn}while(St>=1&&At>=0);break}}}finally{Kt=!1,be.current=lt,ne(),Error.prepareStackTrace=nt}var ts=C?C.displayName||C.name:"",vr=ts?Ke(ts):"";return typeof C=="function"&&ri.set(C,vr),vr}function Tu(C,J,ie){return Bt(C,!1)}function tr(C){var J=C.prototype;return!!(J&&J.isReactComponent)}function si(C,J,ie){if(C==null)return"";if(typeof C=="function")return Bt(C,tr(C));if(typeof C=="string")return Ke(C);switch(C){case u:return Ke("Suspense");case d:return Ke("SuspenseList")}if(typeof C=="object")switch(C.$$typeof){case l:return Tu(C.render);case h:return si(C.type,J,ie);case p:{var Oe=C,nt=Oe._payload,lt=Oe._init;try{return si(lt(nt),J,ie)}catch{}}}return""}var Xs=Object.prototype.hasOwnProperty,yr={},bl=w.ReactDebugCurrentFrame;function Zo(C){if(C){var J=C._owner,ie=si(C.type,C._source,J?J.type:null);bl.setExtraStackFrame(ie)}else bl.setExtraStackFrame(null)}function Zs(C,J,ie,Oe,nt){{var lt=Function.call.bind(Xs);for(var Je in C)if(lt(C,Je)){var ze=void 0;try{if(typeof C[Je]!="function"){var nn=Error((Oe||"React class")+": "+ie+" type `"+Je+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof C[Je]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw nn.name="Invariant Violation",nn}ze=C[Je](J,Je,Oe,ie,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(St){ze=St}ze&&!(ze instanceof Error)&&(Zo(nt),O("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Oe||"React class",ie,Je,typeof ze),Zo(null)),ze instanceof Error&&!(ze.message in yr)&&(yr[ze.message]=!0,Zo(nt),O("Failed %s type: %s",ie,ze.message),Zo(null))}}}var nr=Array.isArray;function Si(C){return nr(C)}function ea(C){{var J=typeof Symbol=="function"&&Symbol.toStringTag,ie=J&&C[Symbol.toStringTag]||C.constructor.name||"Object";return ie}}function cp(C){try{return Zi(C),!1}catch{return!0}}function Zi(C){return""+C}function Su(C){if(cp(C))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ea(C)),Zi(C)}var Wr=w.ReactCurrentOwner,es={key:!0,ref:!0,__self:!0,__source:!0},ta,na,eo;eo={};function _l(C){if(Xs.call(C,"ref")){var J=Object.getOwnPropertyDescriptor(C,"ref").get;if(J&&J.isReactWarning)return!1}return C.ref!==void 0}function El(C){if(Xs.call(C,"key")){var J=Object.getOwnPropertyDescriptor(C,"key").get;if(J&&J.isReactWarning)return!1}return C.key!==void 0}function wl(C,J){if(typeof C.ref=="string"&&Wr.current&&J&&Wr.current.stateNode!==J){var ie=he(Wr.current.type);eo[ie]||(O('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',he(Wr.current.type),C.ref),eo[ie]=!0)}}function Tl(C,J){{var ie=function(){ta||(ta=!0,O("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",J))};ie.isReactWarning=!0,Object.defineProperty(C,"key",{get:ie,configurable:!0})}}function Sl(C,J){{var ie=function(){na||(na=!0,O("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",J))};ie.isReactWarning=!0,Object.defineProperty(C,"ref",{get:ie,configurable:!0})}}var Ol=function(C,J,ie,Oe,nt,lt,Je){var ze={$$typeof:e,type:C,key:J,ref:ie,props:Je,_owner:lt};return ze._store={},Object.defineProperty(ze._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ze,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Oe}),Object.defineProperty(ze,"_source",{configurable:!1,enumerable:!1,writable:!1,value:nt}),Object.freeze&&(Object.freeze(ze.props),Object.freeze(ze)),ze};function up(C,J,ie,Oe,nt){{var lt,Je={},ze=null,nn=null;ie!==void 0&&(Su(ie),ze=""+ie),El(J)&&(Su(J.key),ze=""+J.key),_l(J)&&(nn=J.ref,wl(J,nt));for(lt in J)Xs.call(J,lt)&&!es.hasOwnProperty(lt)&&(Je[lt]=J[lt]);if(C&&C.defaultProps){var St=C.defaultProps;for(lt in St)Je[lt]===void 0&&(Je[lt]=St[lt])}if(ze||nn){var At=typeof C=="function"?C.displayName||C.name||"Unknown":C;ze&&Tl(Je,At),nn&&Sl(Je,At)}return Ol(C,ze,nn,nt,Oe,Wr.current,Je)}}var kl=w.ReactCurrentOwner,Ou=w.ReactDebugCurrentFrame;function Oi(C){if(C){var J=C._owner,ie=si(C.type,C._source,J?J.type:null);Ou.setExtraStackFrame(ie)}else Ou.setExtraStackFrame(null)}var ra;ra=!1;function Nl(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function ku(){{if(kl.current){var C=he(kl.current.type);if(C)return`
22
+
23
+ Check the render method of \``+C+"`."}return""}}function fp(C){return""}var Nu={};function Au(C){{var J=ku();if(!J){var ie=typeof C=="string"?C:C.displayName||C.name;ie&&(J=`
24
+
25
+ Check the top-level render call using <`+ie+">.")}return J}}function Iu(C,J){{if(!C._store||C._store.validated||C.key!=null)return;C._store.validated=!0;var ie=Au(J);if(Nu[ie])return;Nu[ie]=!0;var Oe="";C&&C._owner&&C._owner!==kl.current&&(Oe=" It was passed a child from "+he(C._owner.type)+"."),Oi(C),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ie,Oe),Oi(null)}}function xu(C,J){{if(typeof C!="object")return;if(Si(C))for(var ie=0;ie<C.length;ie++){var Oe=C[ie];Nl(Oe)&&Iu(Oe,J)}else if(Nl(C))C._store&&(C._store.validated=!0);else if(C){var nt=_(C);if(typeof nt=="function"&&nt!==C.entries)for(var lt=nt.call(C),Je;!(Je=lt.next()).done;)Nl(Je.value)&&Iu(Je.value,J)}}}function dp(C){{var J=C.type;if(J==null||typeof J=="string")return;var ie;if(typeof J=="function")ie=J.propTypes;else if(typeof J=="object"&&(J.$$typeof===l||J.$$typeof===h))ie=J.propTypes;else return;if(ie){var Oe=he(J);Zs(ie,C.props,"prop",Oe,C)}else if(J.PropTypes!==void 0&&!ra){ra=!0;var nt=he(J);O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",nt||"Unknown")}typeof J.getDefaultProps=="function"&&!J.getDefaultProps.isReactClassApproved&&O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Al(C){{for(var J=Object.keys(C.props),ie=0;ie<J.length;ie++){var Oe=J[ie];if(Oe!=="children"&&Oe!=="key"){Oi(C),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Oe),Oi(null);break}}C.ref!==null&&(Oi(C),O("Invalid attribute `ref` supplied to `React.Fragment`."),Oi(null))}}var Cu={};function ia(C,J,ie,Oe,nt,lt){{var Je=U(C);if(!Je){var ze="";(C===void 0||typeof C=="object"&&C!==null&&Object.keys(C).length===0)&&(ze+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var nn=fp();nn?ze+=nn:ze+=ku();var St;C===null?St="null":Si(C)?St="array":C!==void 0&&C.$$typeof===e?(St="<"+(he(C.type)||"Unknown")+" />",ze=" Did you accidentally export a JSX literal instead of a component?"):St=typeof C,O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",St,ze)}var At=up(C,J,ie,nt,lt);if(At==null)return At;if(Je){var rn=J.children;if(rn!==void 0)if(Oe)if(Si(rn)){for(var ts=0;ts<rn.length;ts++)xu(rn[ts],C);Object.freeze&&Object.freeze(rn)}else O("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else xu(rn,C)}if(Xs.call(J,"key")){var vr=he(C),pn=Object.keys(J).filter(function(Du){return Du!=="key"}),Il=pn.length>0?"{key: someKey, "+pn.join(": ..., ")+": ...}":"{key: someKey}";if(!Cu[vr+Il]){var yp=pn.length>0?"{"+pn.join(": ..., ")+": ...}":"{}";O(`A props object containing a "key" prop is being spread into JSX:
26
+ let props = %s;
27
+ <%s {...props} />
28
+ React keys must be passed directly to JSX without using spread:
29
+ let props = %s;
30
+ <%s key={someKey} {...props} />`,Il,vr,yp,vr),Cu[vr+Il]=!0}}return C===r?Al(At):dp(At),At}}function hp(C,J,ie){return ia(C,J,ie,!0)}function pp(C,J,ie){return ia(C,J,ie,!1)}var mp=pp,gp=hp;Ql.Fragment=r,Ql.jsx=mp,Ql.jsxs=gp}()),Ql}process.env.NODE_ENV==="production"?$g.exports=UL():$g.exports=WL();var pe=$g.exports,Lg=function(t,e){return Lg=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])},Lg(t,e)};function Br(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Lg(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var D=function(){return D=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},D.apply(this,arguments)};function Rn(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 vs(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 bs(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 Nt(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))}var Am="Invariant Violation",_w=Object.setPrototypeOf,qL=_w===void 0?function(t,e){return t.__proto__=e,t}:_w,kk=function(t){Br(e,t);function e(n){n===void 0&&(n=Am);var r=t.call(this,typeof n=="number"?Am+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=Am,qL(r,e.prototype),r}return e}(Error);function mo(t,e){if(!t)throw new kk(e)}var od=["debug","log","warn","error","silent"],Vg=od.indexOf("log");function _f(t){return function(){if(od.indexOf(t)>=Vg){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=_f("debug"),t.log=_f("log"),t.warn=_f("warn"),t.error=_f("error")})(mo||(mo={}));function ev(t){var e=od[Vg];return Vg=Math.max(0,od.indexOf(t)),e}var tv="3.11.10";function Ar(t){try{return t()}catch{}}const jg=Ar(function(){return globalThis})||Ar(function(){return window})||Ar(function(){return self})||Ar(function(){return global})||Ar(function(){return Ar.constructor("return this")()});var Ew=new Map;function ad(t){var e=Ew.get(t)||1;return Ew.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function nv(t,e){e===void 0&&(e=0);var n=ad("stringifyForDisplay");return JSON.stringify(t,function(r,i){return i===void 0?n:i},e).split(JSON.stringify(n)).join("<undefined>")}function Ef(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=rv(i),e||(e=iv(i,n),n=[])}t.apply(void 0,[e].concat(n))}}var oe=Object.assign(function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];e||mo(e,rv(n,r)||iv(n,r))},{debug:Ef(mo.debug),log:Ef(mo.log),warn:Ef(mo.warn),error:Ef(mo.error)});function Pn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new kk(rv(t,e)||iv(t,e))}var ww=Symbol.for("ApolloErrorMessageHandler_"+tv);function Nk(t){if(typeof t=="string")return t;try{return nv(t,2).slice(0,1e3)}catch{return"<non-serializable>"}}function rv(t,e){if(e===void 0&&(e=[]),!!t)return jg[ww]&&jg[ww](t,e.map(Nk))}function iv(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:tv,message:t,args:e.map(Nk)})))}var zL=globalThis.__DEV__!==!1;const QL="16.9.0",GL=Object.freeze({major:16,minor:9,patch:0,preReleaseTag:null});function Be(t,e){if(!!!t)throw new Error(e)}function hr(t){return typeof(t==null?void 0:t.then)=="function"}function pr(t){return typeof t=="object"&&t!==null}function $t(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}const HL=/\r\n|[\n\r]/g;function ld(t,e){let n=0,r=1;for(const i of t.body.matchAll(HL)){if(typeof i.index=="number"||$t(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function Ak(t){return sv(t.source,ld(t.source,t.start))}function sv(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}
31
+ `,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+Tw([[`${o} |`,y[0]],...y.slice(1,p+1).map(b=>["|",b]),["|","^".padStart(g)],["|",y[p+1]]])}return u+Tw([[`${o-1} |`,d[i-1]],[`${o} |`,h],["|","^".padStart(l)],[`${o+1} |`,d[i+1]]])}function Tw(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(`
32
+ `)}function KL(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 Ik extends Error{constructor(e,...n){var r,i,s;const{nodes:o,source:a,positions:l,path:u,originalError:d,extensions:h}=KL(n);super(e),this.name="GraphQLError",this.path=u??void 0,this.originalError=d??void 0,this.nodes=Sw(Array.isArray(o)?o:o?[o]:void 0);const p=Sw((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=>ld(a,y)):p==null?void 0:p.map(y=>ld(y.source,y.start));const g=pr(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,Ik):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+=`
33
+
34
+ `+Ak(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+=`
35
+
36
+ `+sv(this.source,n);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function Sw(t){return t===void 0||t.length===0?void 0:t}function JL(t){return t.toString()}function YL(t){return t.toJSON()}function qt(t,e,n){return new j(`Syntax Error: ${n}`,{source:t,positions:[e]})}class xk{constructor(e,n,r){this.start=e.start,this.end=n.end,this.startToken=e,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class ov{constructor(e,n,r,i,s,o){this.kind=e,this.start=n,this.end=r,this.line=i,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Ck={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},XL=new Set(Object.keys(Ck));function Bg(t){const e=t==null?void 0:t.kind;return typeof e=="string"&&XL.has(e)}var Qt;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(Qt||(Qt={}));var me;(function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(me||(me={}));var k;(function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(k||(k={}));function Ug(t){return t===9||t===32}function Sc(t){return t>=48&&t<=57}function Dk(t){return t>=97&&t<=122||t>=65&&t<=90}function av(t){return Dk(t)||t===95}function Rk(t){return Dk(t)||Sc(t)||t===95}function ZL(t){var e;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;o<t.length;++o){var s;const a=t[o],l=eV(a);l!==a.length&&(r=(s=r)!==null&&s!==void 0?s:o,i=o,o!==0&&l<n&&(n=l))}return t.map((o,a)=>a===0?o:o.slice(n)).slice((e=r)!==null&&e!==void 0?e:0,i+1)}function eV(t){let e=0;for(;e<t.length&&Ug(t.charCodeAt(e));)++e;return e}function tV(t){if(t==="")return!0;let e=!0,n=!1,r=!0,i=!1;for(let s=0;s<t.length;++s)switch(t.codePointAt(s)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(e&&!i)return!1;i=!0,e=!0,n=!1;break;case 9:case 32:n||(n=e);break;default:r&&(r=n),e=!1}return!(e||r&&i)}function Mk(t,e){const n=t.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,s=r.length>1&&r.slice(1).every(g=>g.length===0||Ug(g.charCodeAt(0))),o=n.endsWith('\\"""'),a=t.endsWith('"')&&!o,l=t.endsWith("\\"),u=a||l,d=!(e!=null&&e.minimize)&&(!i||t.length>70||u||s||o);let h="";const p=i&&Ug(t.charCodeAt(0));return(d&&!p||s)&&(h+=`
37
+ `),h+=n,(d||u)&&(h+=`
38
+ `),'"""'+h+'"""'}var q;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(q||(q={}));class lv{constructor(e){const n=new ov(q.SOF,0,0,0,0);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==q.EOF)do if(e.next)e=e.next;else{const n=nV(this,e.end);e.next=n,n.prev=e,e=n}while(e.kind===q.COMMENT);return e}}function Pk(t){return t===q.BANG||t===q.DOLLAR||t===q.AMP||t===q.PAREN_L||t===q.PAREN_R||t===q.SPREAD||t===q.COLON||t===q.EQUALS||t===q.AT||t===q.BRACKET_L||t===q.BRACKET_R||t===q.BRACE_L||t===q.PIPE||t===q.BRACE_R}function rl(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function eh(t,e){return Fk(t.charCodeAt(e))&&$k(t.charCodeAt(e+1))}function Fk(t){return t>=55296&&t<=56319}function $k(t){return t>=56320&&t<=57343}function Do(t,e){const n=t.source.body.codePointAt(e);if(n===void 0)return q.EOF;if(n>=32&&n<=126){const r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Lt(t,e,n,r,i){const s=t.line,o=1+n-t.lineStart;return new ov(e,n,r,s,o,i)}function nV(t,e){const n=t.source.body,r=n.length;let i=e;for(;i<r;){const s=n.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++t.line,t.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++t.line,t.lineStart=i;continue;case 35:return rV(t,i);case 33:return Lt(t,q.BANG,i,i+1);case 36:return Lt(t,q.DOLLAR,i,i+1);case 38:return Lt(t,q.AMP,i,i+1);case 40:return Lt(t,q.PAREN_L,i,i+1);case 41:return Lt(t,q.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return Lt(t,q.SPREAD,i,i+3);break;case 58:return Lt(t,q.COLON,i,i+1);case 61:return Lt(t,q.EQUALS,i,i+1);case 64:return Lt(t,q.AT,i,i+1);case 91:return Lt(t,q.BRACKET_L,i,i+1);case 93:return Lt(t,q.BRACKET_R,i,i+1);case 123:return Lt(t,q.BRACE_L,i,i+1);case 124:return Lt(t,q.PIPE,i,i+1);case 125:return Lt(t,q.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?cV(t,i):sV(t,i)}if(Sc(s)||s===45)return iV(t,i,s);if(av(s))return uV(t,i);throw qt(t.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:rl(s)||eh(n,i)?`Unexpected character: ${Do(t,i)}.`:`Invalid character: ${Do(t,i)}.`)}return Lt(t,q.EOF,r,r)}function rV(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(s===10||s===13)break;if(rl(s))++i;else if(eh(n,i))i+=2;else break}return Lt(t,q.COMMENT,e,i,n.slice(e+1,i))}function iV(t,e,n){const r=t.source.body;let i=e,s=n,o=!1;if(s===45&&(s=r.charCodeAt(++i)),s===48){if(s=r.charCodeAt(++i),Sc(s))throw qt(t.source,i,`Invalid number, unexpected digit after 0: ${Do(t,i)}.`)}else i=Im(t,i,s),s=r.charCodeAt(i);if(s===46&&(o=!0,s=r.charCodeAt(++i),i=Im(t,i,s),s=r.charCodeAt(i)),(s===69||s===101)&&(o=!0,s=r.charCodeAt(++i),(s===43||s===45)&&(s=r.charCodeAt(++i)),i=Im(t,i,s),s=r.charCodeAt(i)),s===46||av(s))throw qt(t.source,i,`Invalid number, expected digit but got: ${Do(t,i)}.`);return Lt(t,o?q.FLOAT:q.INT,e,i,r.slice(e,i))}function Im(t,e,n){if(!Sc(n))throw qt(t.source,e,`Invalid number, expected digit but got: ${Do(t,e)}.`);const r=t.source.body;let i=e+1;for(;Sc(r.charCodeAt(i));)++i;return i}function sV(t,e){const n=t.source.body,r=n.length;let i=e+1,s=i,o="";for(;i<r;){const a=n.charCodeAt(i);if(a===34)return o+=n.slice(s,i),Lt(t,q.STRING,e,i+1,o);if(a===92){o+=n.slice(s,i);const l=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?oV(t,i):aV(t,i):lV(t,i);o+=l.value,i+=l.size,s=i;continue}if(a===10||a===13)break;if(rl(a))++i;else if(eh(n,i))i+=2;else throw qt(t.source,i,`Invalid character within String: ${Do(t,i)}.`)}throw qt(t.source,i,"Unterminated string.")}function oV(t,e){const n=t.source.body;let r=0,i=3;for(;i<12;){const s=n.charCodeAt(e+i++);if(s===125){if(i<5||!rl(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|sc(s),r<0)break}throw qt(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+i)}".`)}function aV(t,e){const n=t.source.body,r=Ow(n,e+2);if(rl(r))return{value:String.fromCodePoint(r),size:6};if(Fk(r)&&n.charCodeAt(e+6)===92&&n.charCodeAt(e+7)===117){const i=Ow(n,e+8);if($k(i))return{value:String.fromCodePoint(r,i),size:12}}throw qt(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function Ow(t,e){return sc(t.charCodeAt(e))<<12|sc(t.charCodeAt(e+1))<<8|sc(t.charCodeAt(e+2))<<4|sc(t.charCodeAt(e+3))}function sc(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function lV(t,e){const n=t.source.body;switch(n.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
39
+ `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw qt(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function cV(t,e){const n=t.source.body,r=n.length;let i=t.lineStart,s=e+3,o=s,a="";const l=[];for(;s<r;){const u=n.charCodeAt(s);if(u===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){a+=n.slice(o,s),l.push(a);const d=Lt(t,q.BLOCK_STRING,e,s+3,ZL(l).join(`
40
+ `));return t.line+=l.length-1,t.lineStart=i,d}if(u===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){a+=n.slice(o,s),o=s+1,s+=4;continue}if(u===10||u===13){a+=n.slice(o,s),l.push(a),u===13&&n.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,i=s;continue}if(rl(u))++s;else if(eh(n,s))s+=2;else throw qt(t.source,s,`Invalid character within String: ${Do(t,s)}.`)}throw qt(t.source,s,"Unterminated string.")}function uV(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(Rk(s))++i;else break}return Lt(t,q.NAME,e,i,n.slice(e,i))}const fV=10,Lk=2;function z(t){return th(t,[])}function th(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return dV(t,e);default:return String(t)}}function dV(t,e){if(t===null)return"null";if(e.includes(t))return"[Circular]";const n=[...e,t];if(hV(t)){const r=t.toJSON();if(r!==t)return typeof r=="string"?r:th(r,n)}else if(Array.isArray(t))return mV(t,n);return pV(t,n)}function hV(t){return typeof t.toJSON=="function"}function pV(t,e){const n=Object.entries(t);return n.length===0?"{}":e.length>Lk?"["+gV(t)+"]":"{ "+n.map(([i,s])=>i+": "+th(s,e)).join(", ")+" }"}function mV(t,e){if(t.length===0)return"[]";if(e.length>Lk)return"[Array]";const n=Math.min(fV,t.length),r=t.length-n,i=[];for(let s=0;s<n;++s)i.push(th(t[s],e));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function gV(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){const n=t.constructor.name;if(typeof n=="string"&&n!=="")return n}return e}const yV=globalThis.process&&process.env.NODE_ENV==="production",ni=yV?function(e,n){return e instanceof n}:function(e,n){if(e instanceof n)return!0;if(typeof e=="object"&&e!==null){var r;const i=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in e?e[Symbol.toStringTag]:(r=e.constructor)===null||r===void 0?void 0:r.name;if(i===s){const o=z(e);throw new Error(`Cannot use ${i} "${o}" from another module or realm.
41
+
42
+ Ensure that there is only one instance of "graphql" in the node_modules
43
+ directory. If different versions of "graphql" are the dependencies of other
44
+ relied on modules, use "resolutions" to ensure only one version is installed.
45
+
46
+ https://yarnpkg.com/en/docs/selective-version-resolutions
47
+
48
+ Duplicate "graphql" modules cannot be used at the same time since different
49
+ versions may have different capabilities and behavior. The data from one
50
+ version used in the function from another could produce confusing and
51
+ spurious results.`)}}return!1};class nh{constructor(e,n="GraphQL request",r={line:1,column:1}){typeof e=="string"||Be(!1,`Body must be a string. Received: ${z(e)}.`),this.body=e,this.name=n,this.locationOffset=r,this.locationOffset.line>0||Be(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Be(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Vk(t){return ni(t,nh)}function Kc(t,e){return new rh(t,e).parseDocument()}function jk(t,e){const n=new rh(t,e);n.expectToken(q.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(q.EOF),r}function vV(t,e){const n=new rh(t,e);n.expectToken(q.SOF);const r=n.parseConstValueLiteral();return n.expectToken(q.EOF),r}function bV(t,e){const n=new rh(t,e);n.expectToken(q.SOF);const r=n.parseTypeReference();return n.expectToken(q.EOF),r}class rh{constructor(e,n={}){const r=Vk(e)?e:new nh(e);this._lexer=new lv(r),this._options=n,this._tokenCounter=0}parseName(){const e=this.expectToken(q.NAME);return this.node(e,{kind:k.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:k.DOCUMENT,definitions:this.many(q.SOF,this.parseDefinition,q.EOF)})}parseDefinition(){if(this.peek(q.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===q.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw qt(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(q.BRACE_L))return this.node(e,{kind:k.OPERATION_DEFINITION,operation:Qt.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let r;return this.peek(q.NAME)&&(r=this.parseName()),this.node(e,{kind:k.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(q.NAME);switch(e.value){case"query":return Qt.QUERY;case"mutation":return Qt.MUTATION;case"subscription":return Qt.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(q.PAREN_L,this.parseVariableDefinition,q.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:k.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(q.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(q.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(q.DOLLAR),this.node(e,{kind:k.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:k.SELECTION_SET,selections:this.many(q.BRACE_L,this.parseSelection,q.BRACE_R)})}parseSelection(){return this.peek(q.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let r,i;return this.expectOptionalToken(q.COLON)?(r=n,i=this.parseName()):i=n,this.node(e,{kind:k.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(q.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(q.PAREN_L,n,q.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,r=this.parseName();return this.expectToken(q.COLON),this.node(n,{kind:k.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(q.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(q.NAME)?this.node(e,{kind:k.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:k.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:k.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:k.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){const n=this._lexer.token;switch(n.kind){case q.BRACKET_L:return this.parseList(e);case q.BRACE_L:return this.parseObject(e);case q.INT:return this.advanceLexer(),this.node(n,{kind:k.INT,value:n.value});case q.FLOAT:return this.advanceLexer(),this.node(n,{kind:k.FLOAT,value:n.value});case q.STRING:case q.BLOCK_STRING:return this.parseStringLiteral();case q.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:k.BOOLEAN,value:!0});case"false":return this.node(n,{kind:k.BOOLEAN,value:!1});case"null":return this.node(n,{kind:k.NULL});default:return this.node(n,{kind:k.ENUM,value:n.value})}case q.DOLLAR:if(e)if(this.expectToken(q.DOLLAR),this._lexer.token.kind===q.NAME){const r=this._lexer.token.value;throw qt(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:k.STRING,value:e.value,block:e.kind===q.BLOCK_STRING})}parseList(e){const n=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:k.LIST,values:this.any(q.BRACKET_L,n,q.BRACKET_R)})}parseObject(e){const n=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:k.OBJECT,fields:this.any(q.BRACE_L,n,q.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,r=this.parseName();return this.expectToken(q.COLON),this.node(n,{kind:k.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(q.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(q.AT),this.node(n,{kind:k.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(q.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(q.BRACKET_R),n=this.node(e,{kind:k.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(q.BANG)?this.node(e,{kind:k.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:k.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(q.STRING)||this.peek(q.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),i=this.many(q.BRACE_L,this.parseOperationTypeDefinition,q.BRACE_R);return this.node(e,{kind:k.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(q.COLON);const r=this.parseNamedType();return this.node(e,{kind:k.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:k.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:k.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(q.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(q.BRACE_L,this.parseFieldDefinition,q.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(q.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:k.FIELD_DEFINITION,description:n,name:r,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(q.PAREN_L,this.parseInputValueDef,q.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(q.COLON);const i=this.parseTypeReference();let s;this.expectOptionalToken(q.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:k.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:k.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(e,{kind:k.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(q.EQUALS)?this.delimitedMany(q.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(e,{kind:k.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(q.BRACE_L,this.parseEnumValueDefinition,q.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:k.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw qt(this._lexer.source,this._lexer.token.start,`${wf(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(e,{kind:k.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(q.BRACE_L,this.parseInputValueDef,q.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===q.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.optionalMany(q.BRACE_L,this.parseOperationTypeDefinition,q.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:k.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(e,{kind:k.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:k.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:k.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:k.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:k.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:k.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(q.AT);const r=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:k.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(q.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(me,n.value))return n;throw this.unexpected(e)}node(e,n){return this._options.noLocation!==!0&&(n.loc=new xk(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw qt(this._lexer.source,n.start,`Expected ${Bk(e)}, found ${wf(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const n=this._lexer.token;if(n.kind===q.NAME&&n.value===e)this.advanceLexer();else throw qt(this._lexer.source,n.start,`Expected "${e}", found ${wf(n)}.`)}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===q.NAME&&n.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const n=e??this._lexer.token;return qt(this._lexer.source,n.start,`Unexpected ${wf(n)}.`)}any(e,n,r){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(e,n,r){if(this.expectOptionalToken(e)){const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(e,n,r){this.expectToken(e);const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(e,n){this.expectOptionalToken(e);const r=[];do r.push(n.call(this));while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(e!==void 0&&n.kind!==q.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw qt(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function wf(t){const e=t.value;return Bk(t.kind)+(e!=null?` "${e}"`:"")}function Bk(t){return Pk(t)?`"${t}"`:t}const _V=5;function zi(t,e){const[n,r]=e?[t,e]:[void 0,t];let i=" Did you mean ";n&&(i+=n+" ");const s=r.map(l=>`"${l}"`);switch(s.length){case 0:return"";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}const o=s.slice(0,_V),a=o.pop();return i+o.join(", ")+", or "+a+"?"}function kw(t){return t}function Qi(t,e){const n=Object.create(null);for(const r of t)n[e(r)]=r;return n}function Ss(t,e,n){const r=Object.create(null);for(const i of t)r[e(i)]=n(i);return r}function ji(t,e){const n=Object.create(null);for(const r of Object.keys(t))n[r]=e(t[r],r);return n}function Jc(t,e){let n=0,r=0;for(;n<t.length&&r<e.length;){let i=t.charCodeAt(n),s=e.charCodeAt(r);if(Tf(i)&&Tf(s)){let o=0;do++n,o=o*10+i-Wg,i=t.charCodeAt(n);while(Tf(i)&&o>0);let a=0;do++r,a=a*10+s-Wg,s=e.charCodeAt(r);while(Tf(s)&&a>0);if(o<a)return-1;if(o>a)return 1}else{if(i<s)return-1;if(i>s)return 1;++n,++r}}return t.length-e.length}const Wg=48,EV=57;function Tf(t){return!isNaN(t)&&Wg<=t&&t<=EV}function Ws(t,e){const n=Object.create(null),r=new wV(t),i=Math.floor(t.length*.4)+1;for(const s of e){const o=r.measure(s,i);o!==void 0&&(n[s]=o)}return Object.keys(n).sort((s,o)=>{const a=n[s]-n[o];return a!==0?a:Jc(s,o)})}class wV{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=Nw(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,n){if(this._input===e)return 0;const r=e.toLowerCase();if(this._inputLowerCase===r)return 1;let i=Nw(r),s=this._inputArray;if(i.length<s.length){const d=i;i=s,s=d}const o=i.length,a=s.length;if(o-a>n)return;const l=this._rows;for(let d=0;d<=a;d++)l[0][d]=d;for(let d=1;d<=o;d++){const h=l[(d-1)%3],p=l[d%3];let g=p[0]=d;for(let y=1;y<=a;y++){const b=i[d-1]===s[y-1]?0:1;let _=Math.min(h[y]+1,p[y-1]+1,h[y-1]+b);if(d>1&&y>1&&i[d-1]===s[y-2]&&i[d-2]===s[y-1]){const w=l[(d-2)%3][y-2];_=Math.min(_,w+1)}_<g&&(g=_),p[y]=_}if(g>n)return}const u=l[o%3][a];return u<=n?u:void 0}}function Nw(t){const e=t.length,n=new Array(e);for(let r=0;r<e;++r)n[r]=t.charCodeAt(r);return n}function Ur(t){if(t==null)return Object.create(null);if(Object.getPrototypeOf(t)===null)return t;const e=Object.create(null);for(const[n,r]of Object.entries(t))e[n]=r;return e}function TV(t){return`"${t.replace(SV,OV)}"`}const SV=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function OV(t){return kV[t.charCodeAt(0)]}const kV=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Os=Object.freeze({});function hn(t,e,n=Ck){const r=new Map;for(const w of Object.values(k))r.set(w,ja(e,w));let i,s=Array.isArray(t),o=[t],a=-1,l=[],u=t,d,h;const p=[],g=[];do{a++;const w=a===o.length,O=w&&l.length!==0;if(w){if(d=g.length===0?void 0:p[p.length-1],u=h,h=g.pop(),O)if(s){u=u.slice();let I=0;for(const[P,M]of l){const B=P-I;M===null?(u.splice(B,1),I++):u[B]=M}}else{u=Object.defineProperties({},Object.getOwnPropertyDescriptors(u));for(const[I,P]of l)u[I]=P}a=i.index,o=i.keys,l=i.edits,s=i.inArray,i=i.prev}else if(h){if(d=s?a:o[a],u=h[d],u==null)continue;p.push(d)}let N;if(!Array.isArray(u)){var y,b;Bg(u)||Be(!1,`Invalid AST Node: ${z(u)}.`);const I=w?(y=r.get(u.kind))===null||y===void 0?void 0:y.leave:(b=r.get(u.kind))===null||b===void 0?void 0:b.enter;if(N=I==null?void 0:I.call(e,u,d,h,p,g),N===Os)break;if(N===!1){if(!w){p.pop();continue}}else if(N!==void 0&&(l.push([d,N]),!w))if(Bg(N))u=N;else{p.pop();continue}}if(N===void 0&&O&&l.push([d,u]),w)p.pop();else{var _;i={inArray:s,index:a,keys:o,edits:l,prev:i},s=Array.isArray(u),o=s?u:(_=n[u.kind])!==null&&_!==void 0?_:[],a=-1,l=[],h&&g.push(h),h=u}}while(i!==void 0);return l.length!==0?l[l.length-1][1]:t}function cv(t){const e=new Array(t.length).fill(null),n=Object.create(null);for(const r of Object.values(k)){let i=!1;const s=new Array(t.length).fill(void 0),o=new Array(t.length).fill(void 0);for(let l=0;l<t.length;++l){const{enter:u,leave:d}=ja(t[l],r);i||(i=u!=null||d!=null),s[l]=u,o[l]=d}if(!i)continue;const a={enter(...l){const u=l[0];for(let h=0;h<t.length;h++)if(e[h]===null){var d;const p=(d=s[h])===null||d===void 0?void 0:d.apply(t[h],l);if(p===!1)e[h]=u;else if(p===Os)e[h]=Os;else if(p!==void 0)return p}},leave(...l){const u=l[0];for(let h=0;h<t.length;h++)if(e[h]===null){var d;const p=(d=o[h])===null||d===void 0?void 0:d.apply(t[h],l);if(p===Os)e[h]=Os;else if(p!==void 0&&p!==!1)return p}else e[h]===u&&(e[h]=null)}};n[r]=a}return n}function ja(t,e){const n=t[e];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:t.enter,leave:t.leave}}function NV(t,e,n){const{enter:r,leave:i}=ja(t,e);return n?i:r}function yt(t){return hn(t,IV)}const AV=80,IV={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>le(t.definitions,`
52
+
53
+ `)},OperationDefinition:{leave(t){const e=Xe("(",le(t.variableDefinitions,", "),")"),n=le([t.operation,le([t.name,e]),le(t.directives," ")]," ");return(n==="query"?"":n+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:n,directives:r})=>t+": "+e+Xe(" = ",n)+Xe(" ",le(r," "))},SelectionSet:{leave:({selections:t})=>Hr(t)},Field:{leave({alias:t,name:e,arguments:n,directives:r,selectionSet:i}){const s=Xe("",t,": ")+e;let o=s+Xe("(",le(n,", "),")");return o.length>AV&&(o=s+Xe(`(
54
+ `,Wf(le(n,`
55
+ `)),`
56
+ )`)),le([o,le(r," "),i]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+Xe(" ",le(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:n})=>le(["...",Xe("on ",t),le(e," "),n]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${t}${Xe("(",le(n,", "),")")} on ${e} ${Xe("",le(r," ")," ")}`+i},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?Mk(t):TV(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+le(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+le(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+Xe("(",le(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:n})=>Xe("",t,`
57
+ `)+le(["schema",le(e," "),Hr(n)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:n})=>Xe("",t,`
58
+ `)+le(["scalar",e,le(n," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>Xe("",t,`
59
+ `)+le(["type",e,Xe("implements ",le(n," & ")),le(r," "),Hr(i)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:n,type:r,directives:i})=>Xe("",t,`
60
+ `)+e+(Aw(n)?Xe(`(
61
+ `,Wf(le(n,`
62
+ `)),`
63
+ )`):Xe("(",le(n,", "),")"))+": "+r+Xe(" ",le(i," "))},InputValueDefinition:{leave:({description:t,name:e,type:n,defaultValue:r,directives:i})=>Xe("",t,`
64
+ `)+le([e+": "+n,Xe("= ",r),le(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>Xe("",t,`
65
+ `)+le(["interface",e,Xe("implements ",le(n," & ")),le(r," "),Hr(i)]," ")},UnionTypeDefinition:{leave:({description:t,name:e,directives:n,types:r})=>Xe("",t,`
66
+ `)+le(["union",e,le(n," "),Xe("= ",le(r," | "))]," ")},EnumTypeDefinition:{leave:({description:t,name:e,directives:n,values:r})=>Xe("",t,`
67
+ `)+le(["enum",e,le(n," "),Hr(r)]," ")},EnumValueDefinition:{leave:({description:t,name:e,directives:n})=>Xe("",t,`
68
+ `)+le([e,le(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:t,name:e,directives:n,fields:r})=>Xe("",t,`
69
+ `)+le(["input",e,le(n," "),Hr(r)]," ")},DirectiveDefinition:{leave:({description:t,name:e,arguments:n,repeatable:r,locations:i})=>Xe("",t,`
70
+ `)+"directive @"+e+(Aw(n)?Xe(`(
71
+ `,Wf(le(n,`
72
+ `)),`
73
+ )`):Xe("(",le(n,", "),")"))+(r?" repeatable":"")+" on "+le(i," | ")},SchemaExtension:{leave:({directives:t,operationTypes:e})=>le(["extend schema",le(t," "),Hr(e)]," ")},ScalarTypeExtension:{leave:({name:t,directives:e})=>le(["extend scalar",t,le(e," ")]," ")},ObjectTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>le(["extend type",t,Xe("implements ",le(e," & ")),le(n," "),Hr(r)]," ")},InterfaceTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>le(["extend interface",t,Xe("implements ",le(e," & ")),le(n," "),Hr(r)]," ")},UnionTypeExtension:{leave:({name:t,directives:e,types:n})=>le(["extend union",t,le(e," "),Xe("= ",le(n," | "))]," ")},EnumTypeExtension:{leave:({name:t,directives:e,values:n})=>le(["extend enum",t,le(e," "),Hr(n)]," ")},InputObjectTypeExtension:{leave:({name:t,directives:e,fields:n})=>le(["extend input",t,le(e," "),Hr(n)]," ")}};function le(t,e=""){var n;return(n=t==null?void 0:t.filter(r=>r).join(e))!==null&&n!==void 0?n:""}function Hr(t){return Xe(`{
74
+ `,Wf(le(t,`
75
+ `)),`
76
+ }`)}function Xe(t,e,n=""){return e!=null&&e!==""?t+e+n:""}function Wf(t){return Xe(" ",t.replace(/\n/g,`
77
+ `))}function Aw(t){var e;return(e=t==null?void 0:t.some(n=>n.includes(`
78
+ `)))!==null&&e!==void 0?e:!1}function cd(t,e){switch(t.kind){case k.NULL:return null;case k.INT:return parseInt(t.value,10);case k.FLOAT:return parseFloat(t.value);case k.STRING:case k.ENUM:case k.BOOLEAN:return t.value;case k.LIST:return t.values.map(n=>cd(n,e));case k.OBJECT:return Ss(t.fields,n=>n.name.value,n=>cd(n.value,e));case k.VARIABLE:return e==null?void 0:e[t.name.value]}}function mr(t){if(t!=null||Be(!1,"Must provide name."),typeof t=="string"||Be(!1,"Expected name to be a string."),t.length===0)throw new j("Expected name to be a non-empty string.");for(let e=1;e<t.length;++e)if(!Rk(t.charCodeAt(e)))throw new j(`Names must only contain [_a-zA-Z0-9] but "${t}" does not.`);if(!av(t.charCodeAt(0)))throw new j(`Names must start with [_a-zA-Z] but "${t}" does not.`);return t}function Uk(t){if(t==="true"||t==="false"||t==="null")throw new j(`Enum values cannot be named: ${t}`);return mr(t)}function Yc(t){return gr(t)||tt(t)||at(t)||Gt(t)||jt(t)||vt(t)||wt(t)||Ie(t)}function xV(t){if(!Yc(t))throw new Error(`Expected ${z(t)} to be a GraphQL type.`);return t}function gr(t){return ni(t,bi)}function CV(t){if(!gr(t))throw new Error(`Expected ${z(t)} to be a GraphQL Scalar type.`);return t}function tt(t){return ni(t,Lr)}function Wk(t){if(!tt(t))throw new Error(`Expected ${z(t)} to be a GraphQL Object type.`);return t}function at(t){return ni(t,Ba)}function qk(t){if(!at(t))throw new Error(`Expected ${z(t)} to be a GraphQL Interface type.`);return t}function Gt(t){return ni(t,Ua)}function DV(t){if(!Gt(t))throw new Error(`Expected ${z(t)} to be a GraphQL Union type.`);return t}function jt(t){return ni(t,Fs)}function RV(t){if(!jt(t))throw new Error(`Expected ${z(t)} to be a GraphQL Enum type.`);return t}function vt(t){return ni(t,Wa)}function MV(t){if(!vt(t))throw new Error(`Expected ${z(t)} to be a GraphQL Input Object type.`);return t}function wt(t){return ni(t,dn)}function PV(t){if(!wt(t))throw new Error(`Expected ${z(t)} to be a GraphQL List type.`);return t}function Ie(t){return ni(t,je)}function FV(t){if(!Ie(t))throw new Error(`Expected ${z(t)} to be a GraphQL Non-Null type.`);return t}function Gn(t){return gr(t)||jt(t)||vt(t)||Xc(t)&&Gn(t.ofType)}function $V(t){if(!Gn(t))throw new Error(`Expected ${z(t)} to be a GraphQL input type.`);return t}function Cs(t){return gr(t)||tt(t)||at(t)||Gt(t)||jt(t)||Xc(t)&&Cs(t.ofType)}function LV(t){if(!Cs(t))throw new Error(`Expected ${z(t)} to be a GraphQL output type.`);return t}function yi(t){return gr(t)||jt(t)}function VV(t){if(!yi(t))throw new Error(`Expected ${z(t)} to be a GraphQL leaf type.`);return t}function vi(t){return tt(t)||at(t)||Gt(t)}function jV(t){if(!vi(t))throw new Error(`Expected ${z(t)} to be a GraphQL composite type.`);return t}function mi(t){return at(t)||Gt(t)}function BV(t){if(!mi(t))throw new Error(`Expected ${z(t)} to be a GraphQL abstract type.`);return t}class dn{constructor(e){Yc(e)||Be(!1,`Expected ${z(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class je{constructor(e){uv(e)||Be(!1,`Expected ${z(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function Xc(t){return wt(t)||Ie(t)}function UV(t){if(!Xc(t))throw new Error(`Expected ${z(t)} to be a GraphQL wrapping type.`);return t}function uv(t){return Yc(t)&&!Ie(t)}function zk(t){if(!uv(t))throw new Error(`Expected ${z(t)} to be a GraphQL nullable type.`);return t}function fv(t){if(t)return Ie(t)?t.ofType:t}function Zc(t){return gr(t)||tt(t)||at(t)||Gt(t)||jt(t)||vt(t)}function WV(t){if(!Zc(t))throw new Error(`Expected ${z(t)} to be a GraphQL named type.`);return t}function Dn(t){if(t){let e=t;for(;Xc(e);)e=e.ofType;return e}}function dv(t){return typeof t=="function"?t():t}function hv(t){return typeof t=="function"?t():t}class bi{constructor(e){var n,r,i,s;const o=(n=e.parseValue)!==null&&n!==void 0?n:kw;this.name=mr(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=(r=e.serialize)!==null&&r!==void 0?r:kw,this.parseValue=o,this.parseLiteral=(i=e.parseLiteral)!==null&&i!==void 0?i:(a,l)=>o(cd(a,l)),this.extensions=Ur(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(s=e.extensionASTNodes)!==null&&s!==void 0?s:[],e.specifiedByURL==null||typeof e.specifiedByURL=="string"||Be(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${z(e.specifiedByURL)}.`),e.serialize==null||typeof e.serialize=="function"||Be(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&(typeof e.parseValue=="function"&&typeof e.parseLiteral=="function"||Be(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Lr{constructor(e){var n;this.name=mr(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=Ur(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>Gk(e),this._interfaces=()=>Qk(e),e.isTypeOf==null||typeof e.isTypeOf=="function"||Be(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${z(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Kk(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Qk(t){var e;const n=dv((e=t.interfaces)!==null&&e!==void 0?e:[]);return Array.isArray(n)||Be(!1,`${t.name} interfaces must be an Array or a function which returns an Array.`),n}function Gk(t){const e=hv(t.fields);return Da(e)||Be(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),ji(e,(n,r)=>{var i;Da(n)||Be(!1,`${t.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||Be(!1,`${t.name}.${r} field resolver must be a function if provided, but got: ${z(n.resolve)}.`);const s=(i=n.args)!==null&&i!==void 0?i:{};return Da(s)||Be(!1,`${t.name}.${r} args must be an object with argument names as keys.`),{name:mr(r),description:n.description,type:n.type,args:Hk(s),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:Ur(n.extensions),astNode:n.astNode}})}function Hk(t){return Object.entries(t).map(([e,n])=>({name:mr(e),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:Ur(n.extensions),astNode:n.astNode}))}function Da(t){return pr(t)&&!Array.isArray(t)}function Kk(t){return ji(t,e=>({description:e.description,type:e.type,args:Jk(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function Jk(t){return Ss(t,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function qs(t){return Ie(t.type)&&t.defaultValue===void 0}class Ba{constructor(e){var n;this.name=mr(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Ur(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=Gk.bind(void 0,e),this._interfaces=Qk.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||Be(!1,`${this.name} must provide "resolveType" as a function, but got: ${z(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Kk(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Ua{constructor(e){var n;this.name=mr(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Ur(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=qV.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||Be(!1,`${this.name} must provide "resolveType" as a function, but got: ${z(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function qV(t){const e=dv(t.types);return Array.isArray(e)||Be(!1,`Must provide Array of types or a function which returns such an array for Union ${t.name}.`),e}class Fs{constructor(e){var n;this.name=mr(e.name),this.description=e.description,this.extensions=Ur(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof e.values=="function"?e.values:Iw(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=Iw(this.name,this._values())),this._values}getValue(e){return this._nameLookup===null&&(this._nameLookup=Qi(this.getValues(),n=>n.name)),this._nameLookup[e]}serialize(e){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(r=>[r.value,r])));const n=this._valueLookup.get(e);if(n===void 0)throw new j(`Enum "${this.name}" cannot represent value: ${z(e)}`);return n.name}parseValue(e){if(typeof e!="string"){const r=z(e);throw new j(`Enum "${this.name}" cannot represent non-string value: ${r}.`+Sf(this,r))}const n=this.getValue(e);if(n==null)throw new j(`Value "${e}" does not exist in "${this.name}" enum.`+Sf(this,e));return n.value}parseLiteral(e,n){if(e.kind!==k.ENUM){const i=yt(e);throw new j(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+Sf(this,i),{nodes:e})}const r=this.getValue(e.value);if(r==null){const i=yt(e);throw new j(`Value "${i}" does not exist in "${this.name}" enum.`+Sf(this,i),{nodes:e})}return r.value}toConfig(){const e=Ss(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Sf(t,e){const n=t.getValues().map(i=>i.name),r=Ws(e,n);return zi("the enum value",r)}function Iw(t,e){return Da(e)||Be(!1,`${t} values must be an object with value names as keys.`),Object.entries(e).map(([n,r])=>(Da(r)||Be(!1,`${t}.${n} must refer to an object with a "value" key representing an internal value but got: ${z(r)}.`),{name:Uk(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:Ur(r.extensions),astNode:r.astNode}))}class Wa{constructor(e){var n,r;this.name=mr(e.name),this.description=e.description,this.extensions=Ur(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(r=e.isOneOf)!==null&&r!==void 0?r:!1,this._fields=zV.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const e=ji(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function zV(t){const e=hv(t.fields);return Da(e)||Be(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),ji(e,(n,r)=>(!("resolve"in n)||Be(!1,`${t.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:mr(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:Ur(n.extensions),astNode:n.astNode}))}function ih(t){return Ie(t.type)&&t.defaultValue===void 0}function ud(t,e){return t===e?!0:Ie(t)&&Ie(e)||wt(t)&&wt(e)?ud(t.ofType,e.ofType):!1}function So(t,e,n){return e===n?!0:Ie(n)?Ie(e)?So(t,e.ofType,n.ofType):!1:Ie(e)?So(t,e.ofType,n):wt(n)?wt(e)?So(t,e.ofType,n.ofType):!1:wt(e)?!1:mi(n)&&(at(e)||tt(e))&&t.isSubType(n,e)}function qg(t,e,n){return e===n?!0:mi(e)?mi(n)?t.getPossibleTypes(e).some(r=>t.isSubType(n,r)):t.isSubType(e,n):mi(n)?t.isSubType(n,e):!1}const qf=2147483647,zf=-2147483648,Yk=new bi({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(t){const e=tu(t);if(typeof e=="boolean")return e?1:0;let n=e;if(typeof e=="string"&&e!==""&&(n=Number(e)),typeof n!="number"||!Number.isInteger(n))throw new j(`Int cannot represent non-integer value: ${z(e)}`);if(n>qf||n<zf)throw new j("Int cannot represent non 32-bit signed integer value: "+z(e));return n},parseValue(t){if(typeof t!="number"||!Number.isInteger(t))throw new j(`Int cannot represent non-integer value: ${z(t)}`);if(t>qf||t<zf)throw new j(`Int cannot represent non 32-bit signed integer value: ${t}`);return t},parseLiteral(t){if(t.kind!==k.INT)throw new j(`Int cannot represent non-integer value: ${yt(t)}`,{nodes:t});const e=parseInt(t.value,10);if(e>qf||e<zf)throw new j(`Int cannot represent non 32-bit signed integer value: ${t.value}`,{nodes:t});return e}}),Xk=new bi({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(t){const e=tu(t);if(typeof e=="boolean")return e?1:0;let n=e;if(typeof e=="string"&&e!==""&&(n=Number(e)),typeof n!="number"||!Number.isFinite(n))throw new j(`Float cannot represent non numeric value: ${z(e)}`);return n},parseValue(t){if(typeof t!="number"||!Number.isFinite(t))throw new j(`Float cannot represent non numeric value: ${z(t)}`);return t},parseLiteral(t){if(t.kind!==k.FLOAT&&t.kind!==k.INT)throw new j(`Float cannot represent non numeric value: ${yt(t)}`,t);return parseFloat(t.value)}}),Dt=new bi({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(t){const e=tu(t);if(typeof e=="string")return e;if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"&&Number.isFinite(e))return e.toString();throw new j(`String cannot represent value: ${z(t)}`)},parseValue(t){if(typeof t!="string")throw new j(`String cannot represent a non string value: ${z(t)}`);return t},parseLiteral(t){if(t.kind!==k.STRING)throw new j(`String cannot represent a non string value: ${yt(t)}`,{nodes:t});return t.value}}),Hn=new bi({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(t){const e=tu(t);if(typeof e=="boolean")return e;if(Number.isFinite(e))return e!==0;throw new j(`Boolean cannot represent a non boolean value: ${z(e)}`)},parseValue(t){if(typeof t!="boolean")throw new j(`Boolean cannot represent a non boolean value: ${z(t)}`);return t},parseLiteral(t){if(t.kind!==k.BOOLEAN)throw new j(`Boolean cannot represent a non boolean value: ${yt(t)}`,{nodes:t});return t.value}}),pv=new bi({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(t){const e=tu(t);if(typeof e=="string")return e;if(Number.isInteger(e))return String(e);throw new j(`ID cannot represent value: ${z(t)}`)},parseValue(t){if(typeof t=="string")return t;if(typeof t=="number"&&Number.isInteger(t))return t.toString();throw new j(`ID cannot represent value: ${z(t)}`)},parseLiteral(t){if(t.kind!==k.STRING&&t.kind!==k.INT)throw new j("ID cannot represent a non-string and non-integer value: "+yt(t),{nodes:t});return t.value}}),eu=Object.freeze([Dt,Yk,Xk,Hn,pv]);function sh(t){return eu.some(({name:e})=>t.name===e)}function tu(t){if(pr(t)){if(typeof t.valueOf=="function"){const e=t.valueOf();if(!pr(e))return e}if(typeof t.toJSON=="function")return t.toJSON()}return t}function oh(t){return ni(t,Zr)}function QV(t){if(!oh(t))throw new Error(`Expected ${z(t)} to be a GraphQL directive.`);return t}class Zr{constructor(e){var n,r;this.name=mr(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=(n=e.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=Ur(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||Be(!1,`@${e.name} locations must be an Array.`);const i=(r=e.args)!==null&&r!==void 0?r:{};pr(i)&&!Array.isArray(i)||Be(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=Hk(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Jk(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const mv=new Zr({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[me.FIELD,me.FRAGMENT_SPREAD,me.INLINE_FRAGMENT],args:{if:{type:new je(Hn),description:"Included when true."}}}),gv=new Zr({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[me.FIELD,me.FRAGMENT_SPREAD,me.INLINE_FRAGMENT],args:{if:{type:new je(Hn),description:"Skipped when true."}}}),yv="No longer supported",ah=new Zr({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[me.FIELD_DEFINITION,me.ARGUMENT_DEFINITION,me.INPUT_FIELD_DEFINITION,me.ENUM_VALUE],args:{reason:{type:Dt,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:yv}}}),vv=new Zr({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[me.SCALAR],args:{url:{type:new je(Dt),description:"The URL that specifies the behavior of this scalar."}}}),bv=new Zr({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[me.INPUT_OBJECT],args:{}}),zs=Object.freeze([mv,gv,ah,vv,bv]);function _v(t){return zs.some(({name:e})=>e===t.name)}function Ev(t){return typeof t=="object"&&typeof(t==null?void 0:t[Symbol.iterator])=="function"}function ks(t,e){if(Ie(e)){const n=ks(t,e.ofType);return(n==null?void 0:n.kind)===k.NULL?null:n}if(t===null)return{kind:k.NULL};if(t===void 0)return null;if(wt(e)){const n=e.ofType;if(Ev(t)){const r=[];for(const i of t){const s=ks(i,n);s!=null&&r.push(s)}return{kind:k.LIST,values:r}}return ks(t,n)}if(vt(e)){if(!pr(t))return null;const n=[];for(const r of Object.values(e.getFields())){const i=ks(t[r.name],r.type);i&&n.push({kind:k.OBJECT_FIELD,name:{kind:k.NAME,value:r.name},value:i})}return{kind:k.OBJECT,fields:n}}if(yi(e)){const n=e.serialize(t);if(n==null)return null;if(typeof n=="boolean")return{kind:k.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){const r=String(n);return xw.test(r)?{kind:k.INT,value:r}:{kind:k.FLOAT,value:r}}if(typeof n=="string")return jt(e)?{kind:k.ENUM,value:n}:e===pv&&xw.test(n)?{kind:k.INT,value:n}:{kind:k.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${z(n)}.`)}$t(!1,"Unexpected input type: "+z(e))}const xw=/^-?(?:0|[1-9][0-9]*)$/,lh=new Lr({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Dt,resolve:t=>t.description},types:{description:"A list of all types supported by this server.",type:new je(new dn(new je(xr))),resolve(t){return Object.values(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new je(xr),resolve:t=>t.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:xr,resolve:t=>t.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:xr,resolve:t=>t.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new je(new dn(new je(wv))),resolve:t=>t.getDirectives()}})}),wv=new Lr({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
79
+
80
+ In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new je(Dt),resolve:t=>t.name},description:{type:Dt,resolve:t=>t.description},isRepeatable:{type:new je(Hn),resolve:t=>t.isRepeatable},locations:{type:new je(new dn(new je(Tv))),resolve:t=>t.locations},args:{type:new je(new dn(new je(nu))),args:{includeDeprecated:{type:Hn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}}})}),Tv=new Fs({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:me.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:me.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:me.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:me.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:me.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:me.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:me.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:me.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:me.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:me.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:me.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:me.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:me.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:me.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:me.UNION,description:"Location adjacent to a union definition."},ENUM:{value:me.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:me.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:me.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:me.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),xr=new Lr({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new je(kv),resolve(t){if(gr(t))return ft.SCALAR;if(tt(t))return ft.OBJECT;if(at(t))return ft.INTERFACE;if(Gt(t))return ft.UNION;if(jt(t))return ft.ENUM;if(vt(t))return ft.INPUT_OBJECT;if(wt(t))return ft.LIST;if(Ie(t))return ft.NON_NULL;$t(!1,`Unexpected type: "${z(t)}".`)}},name:{type:Dt,resolve:t=>"name"in t?t.name:void 0},description:{type:Dt,resolve:t=>"description"in t?t.description:void 0},specifiedByURL:{type:Dt,resolve:t=>"specifiedByURL"in t?t.specifiedByURL:void 0},fields:{type:new dn(new je(Sv)),args:{includeDeprecated:{type:Hn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(tt(t)||at(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new dn(new je(xr)),resolve(t){if(tt(t)||at(t))return t.getInterfaces()}},possibleTypes:{type:new dn(new je(xr)),resolve(t,e,n,{schema:r}){if(mi(t))return r.getPossibleTypes(t)}},enumValues:{type:new dn(new je(Ov)),args:{includeDeprecated:{type:Hn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(jt(t)){const n=t.getValues();return e?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new dn(new je(nu)),args:{includeDeprecated:{type:Hn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(vt(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:xr,resolve:t=>"ofType"in t?t.ofType:void 0},isOneOf:{type:Hn,resolve:t=>{if(vt(t))return t.isOneOf}}})}),Sv=new Lr({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new je(Dt),resolve:t=>t.name},description:{type:Dt,resolve:t=>t.description},args:{type:new je(new dn(new je(nu))),args:{includeDeprecated:{type:Hn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}},type:{type:new je(xr),resolve:t=>t.type},isDeprecated:{type:new je(Hn),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Dt,resolve:t=>t.deprecationReason}})}),nu=new Lr({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new je(Dt),resolve:t=>t.name},description:{type:Dt,resolve:t=>t.description},type:{type:new je(xr),resolve:t=>t.type},defaultValue:{type:Dt,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(t){const{type:e,defaultValue:n}=t,r=ks(n,e);return r?yt(r):null}},isDeprecated:{type:new je(Hn),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Dt,resolve:t=>t.deprecationReason}})}),Ov=new Lr({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new je(Dt),resolve:t=>t.name},description:{type:Dt,resolve:t=>t.description},isDeprecated:{type:new je(Hn),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Dt,resolve:t=>t.deprecationReason}})});var ft;(function(t){t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.INPUT_OBJECT="INPUT_OBJECT",t.LIST="LIST",t.NON_NULL="NON_NULL"})(ft||(ft={}));const kv=new Fs({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:ft.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:ft.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:ft.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:ft.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:ft.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:ft.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:ft.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:ft.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Oc={name:"__schema",type:new je(lh),description:"Access the current type schema of this server.",args:[],resolve:(t,e,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},kc={name:"__type",type:xr,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new je(Dt),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(t,{name:e},n,{schema:r})=>r.getType(e),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Nc={name:"__typename",type:new je(Dt),description:"The name of the current Object type at runtime.",args:[],resolve:(t,e,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ru=Object.freeze([lh,wv,Tv,xr,Sv,nu,Ov,kv]);function Wo(t){return ru.some(({name:e})=>t.name===e)}function Zk(t){return ni(t,il)}function Nv(t){if(!Zk(t))throw new Error(`Expected ${z(t)} to be a GraphQL schema.`);return t}class il{constructor(e){var n,r;this.__validationErrors=e.assumeValid===!0?[]:void 0,pr(e)||Be(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||Be(!1,`"types" must be Array if provided but got: ${z(e.types)}.`),!e.directives||Array.isArray(e.directives)||Be(!1,`"directives" must be Array if provided but got: ${z(e.directives)}.`),this.description=e.description,this.extensions=Ur(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=(r=e.directives)!==null&&r!==void 0?r:zs;const i=new Set(e.types);if(e.types!=null)for(const s of e.types)i.delete(s),Kr(s,i);this._queryType!=null&&Kr(this._queryType,i),this._mutationType!=null&&Kr(this._mutationType,i),this._subscriptionType!=null&&Kr(this._subscriptionType,i);for(const s of this._directives)if(oh(s))for(const o of s.args)Kr(o.type,i);Kr(lh,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const s of i){if(s==null)continue;const o=s.name;if(o||Be(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=s,at(s)){for(const a of s.getInterfaces())if(at(a)){let l=this._implementationsMap[a.name];l===void 0&&(l=this._implementationsMap[a.name]={objects:[],interfaces:[]}),l.interfaces.push(s)}}else if(tt(s)){for(const a of s.getInterfaces())if(at(a)){let l=this._implementationsMap[a.name];l===void 0&&(l=this._implementationsMap[a.name]={objects:[],interfaces:[]}),l.objects.push(s)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case Qt.QUERY:return this.getQueryType();case Qt.MUTATION:return this.getMutationType();case Qt.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return Gt(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){const n=this._implementationsMap[e.name];return n??{objects:[],interfaces:[]}}isSubType(e,n){let r=this._subTypeMap[e.name];if(r===void 0){if(r=Object.create(null),Gt(e))for(const i of e.getTypes())r[i.name]=!0;else{const i=this.getImplementations(e);for(const s of i.objects)r[s.name]=!0;for(const s of i.interfaces)r[s.name]=!0}this._subTypeMap[e.name]=r}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(n=>n.name===e)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function Kr(t,e){const n=Dn(t);if(!e.has(n)){if(e.add(n),Gt(n))for(const r of n.getTypes())Kr(r,e);else if(tt(n)||at(n)){for(const r of n.getInterfaces())Kr(r,e);for(const r of Object.values(n.getFields())){Kr(r.type,e);for(const i of r.args)Kr(i.type,e)}}else if(vt(n))for(const r of Object.values(n.getFields()))Kr(r.type,e)}return e}function Av(t){if(Nv(t),t.__validationErrors)return t.__validationErrors;const e=new GV(t);HV(e),KV(e),JV(e);const n=e.getErrors();return t.__validationErrors=n,n}function Iv(t){const e=Av(t);if(e.length!==0)throw new Error(e.map(n=>n.message).join(`
81
+
82
+ `))}class GV{constructor(e){this._errors=[],this.schema=e}reportError(e,n){const r=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new j(e,{nodes:r}))}getErrors(){return this._errors}}function HV(t){const e=t.schema,n=e.getQueryType();if(!n)t.reportError("Query root type must be provided.",e.astNode);else if(!tt(n)){var r;t.reportError(`Query root type must be Object type, it cannot be ${z(n)}.`,(r=xm(e,Qt.QUERY))!==null&&r!==void 0?r:n.astNode)}const i=e.getMutationType();if(i&&!tt(i)){var s;t.reportError(`Mutation root type must be Object type if provided, it cannot be ${z(i)}.`,(s=xm(e,Qt.MUTATION))!==null&&s!==void 0?s:i.astNode)}const o=e.getSubscriptionType();if(o&&!tt(o)){var a;t.reportError(`Subscription root type must be Object type if provided, it cannot be ${z(o)}.`,(a=xm(e,Qt.SUBSCRIPTION))!==null&&a!==void 0?a:o.astNode)}}function xm(t,e){var n;return(n=[t.astNode,...t.extensionASTNodes].flatMap(r=>{var i;return(i=r==null?void 0:r.operationTypes)!==null&&i!==void 0?i:[]}).find(r=>r.operation===e))===null||n===void 0?void 0:n.type}function KV(t){for(const n of t.schema.getDirectives()){if(!oh(n)){t.reportError(`Expected directive but got: ${z(n)}.`,n==null?void 0:n.astNode);continue}Ro(t,n);for(const r of n.args)if(Ro(t,r),Gn(r.type)||t.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${z(r.type)}.`,r.astNode),qs(r)&&r.deprecationReason!=null){var e;t.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[xv(r.astNode),(e=r.astNode)===null||e===void 0?void 0:e.type])}}}function Ro(t,e){e.name.startsWith("__")&&t.reportError(`Name "${e.name}" must not begin with "__", which is reserved by GraphQL introspection.`,e.astNode)}function JV(t){const e=rj(t),n=t.schema.getTypeMap();for(const r of Object.values(n)){if(!Zc(r)){t.reportError(`Expected GraphQL named type but got: ${z(r)}.`,r.astNode);continue}Wo(r)||Ro(t,r),tt(r)||at(r)?(Cw(t,r),Dw(t,r)):Gt(r)?ZV(t,r):jt(r)?ej(t,r):vt(r)&&(tj(t,r),e(r))}}function Cw(t,e){const n=Object.values(e.getFields());n.length===0&&t.reportError(`Type ${e.name} must define one or more fields.`,[e.astNode,...e.extensionASTNodes]);for(const o of n){if(Ro(t,o),!Cs(o.type)){var r;t.reportError(`The type of ${e.name}.${o.name} must be Output Type but got: ${z(o.type)}.`,(r=o.astNode)===null||r===void 0?void 0:r.type)}for(const a of o.args){const l=a.name;if(Ro(t,a),!Gn(a.type)){var i;t.reportError(`The type of ${e.name}.${o.name}(${l}:) must be Input Type but got: ${z(a.type)}.`,(i=a.astNode)===null||i===void 0?void 0:i.type)}if(qs(a)&&a.deprecationReason!=null){var s;t.reportError(`Required argument ${e.name}.${o.name}(${l}:) cannot be deprecated.`,[xv(a.astNode),(s=a.astNode)===null||s===void 0?void 0:s.type])}}}}function Dw(t,e){const n=Object.create(null);for(const r of e.getInterfaces()){if(!at(r)){t.reportError(`Type ${z(e)} must only implement Interface types, it cannot implement ${z(r)}.`,fc(e,r));continue}if(e===r){t.reportError(`Type ${e.name} cannot implement itself because it would create a circular reference.`,fc(e,r));continue}if(n[r.name]){t.reportError(`Type ${e.name} can only implement ${r.name} once.`,fc(e,r));continue}n[r.name]=!0,XV(t,e,r),YV(t,e,r)}}function YV(t,e,n){const r=e.getFields();for(const l of Object.values(n.getFields())){const u=l.name,d=r[u];if(!d){t.reportError(`Interface field ${n.name}.${u} expected but ${e.name} does not provide it.`,[l.astNode,e.astNode,...e.extensionASTNodes]);continue}if(!So(t.schema,d.type,l.type)){var i,s;t.reportError(`Interface field ${n.name}.${u} expects type ${z(l.type)} but ${e.name}.${u} is type ${z(d.type)}.`,[(i=l.astNode)===null||i===void 0?void 0:i.type,(s=d.astNode)===null||s===void 0?void 0:s.type])}for(const h of l.args){const p=h.name,g=d.args.find(y=>y.name===p);if(!g){t.reportError(`Interface field argument ${n.name}.${u}(${p}:) expected but ${e.name}.${u} does not provide it.`,[h.astNode,d.astNode]);continue}if(!ud(h.type,g.type)){var o,a;t.reportError(`Interface field argument ${n.name}.${u}(${p}:) expects type ${z(h.type)} but ${e.name}.${u}(${p}:) is type ${z(g.type)}.`,[(o=h.astNode)===null||o===void 0?void 0:o.type,(a=g.astNode)===null||a===void 0?void 0:a.type])}}for(const h of d.args){const p=h.name;!l.args.find(y=>y.name===p)&&qs(h)&&t.reportError(`Object field ${e.name}.${u} includes required argument ${p} that is missing from the Interface field ${n.name}.${u}.`,[h.astNode,l.astNode])}}}function XV(t,e,n){const r=e.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||t.reportError(i===e?`Type ${e.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${e.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...fc(n,i),...fc(e,n)])}function ZV(t,e){const n=e.getTypes();n.length===0&&t.reportError(`Union type ${e.name} must define one or more member types.`,[e.astNode,...e.extensionASTNodes]);const r=Object.create(null);for(const i of n){if(r[i.name]){t.reportError(`Union type ${e.name} can only include type ${i.name} once.`,Rw(e,i.name));continue}r[i.name]=!0,tt(i)||t.reportError(`Union type ${e.name} can only include Object types, it cannot include ${z(i)}.`,Rw(e,String(i)))}}function ej(t,e){const n=e.getValues();n.length===0&&t.reportError(`Enum type ${e.name} must define one or more values.`,[e.astNode,...e.extensionASTNodes]);for(const r of n)Ro(t,r)}function tj(t,e){const n=Object.values(e.getFields());n.length===0&&t.reportError(`Input Object type ${e.name} must define one or more fields.`,[e.astNode,...e.extensionASTNodes]);for(const s of n){if(Ro(t,s),!Gn(s.type)){var r;t.reportError(`The type of ${e.name}.${s.name} must be Input Type but got: ${z(s.type)}.`,(r=s.astNode)===null||r===void 0?void 0:r.type)}if(ih(s)&&s.deprecationReason!=null){var i;t.reportError(`Required input field ${e.name}.${s.name} cannot be deprecated.`,[xv(s.astNode),(i=s.astNode)===null||i===void 0?void 0:i.type])}e.isOneOf&&nj(e,s,t)}}function nj(t,e,n){if(Ie(e.type)){var r;n.reportError(`OneOf input field ${t.name}.${e.name} must be nullable.`,(r=e.astNode)===null||r===void 0?void 0:r.type)}e.defaultValue!==void 0&&n.reportError(`OneOf input field ${t.name}.${e.name} cannot have a default value.`,e.astNode)}function rj(t){const e=Object.create(null),n=[],r=Object.create(null);return i;function i(s){if(e[s.name])return;e[s.name]=!0,r[s.name]=n.length;const o=Object.values(s.getFields());for(const a of o)if(Ie(a.type)&&vt(a.type.ofType)){const l=a.type.ofType,u=r[l.name];if(n.push(a),u===void 0)i(l);else{const d=n.slice(u),h=d.map(p=>p.name).join(".");t.reportError(`Cannot reference Input Object "${l.name}" within itself through a series of non-null fields: "${h}".`,d.map(p=>p.astNode))}n.pop()}r[s.name]=void 0}}function fc(t,e){const{astNode:n,extensionASTNodes:r}=t;return(n!=null?[n,...r]:r).flatMap(s=>{var o;return(o=s.interfaces)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===e.name)}function Rw(t,e){const{astNode:n,extensionASTNodes:r}=t;return(n!=null?[n,...r]:r).flatMap(s=>{var o;return(o=s.types)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===e)}function xv(t){var e;return t==null||(e=t.directives)===null||e===void 0?void 0:e.find(n=>n.name.value===ah.name)}function Jn(t,e){switch(e.kind){case k.LIST_TYPE:{const n=Jn(t,e.type);return n&&new dn(n)}case k.NON_NULL_TYPE:{const n=Jn(t,e.type);return n&&new je(n)}case k.NAMED_TYPE:return t.getType(e.name.value)}}class Cv{constructor(e,n,r){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=r??ij,n&&(Gn(n)&&this._inputTypeStack.push(n),vi(n)&&this._parentTypeStack.push(n),Cs(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const n=this._schema;switch(e.kind){case k.SELECTION_SET:{const i=Dn(this.getType());this._parentTypeStack.push(vi(i)?i:void 0);break}case k.FIELD:{const i=this.getParentType();let s,o;i&&(s=this._getFieldDef(n,i,e),s&&(o=s.type)),this._fieldDefStack.push(s),this._typeStack.push(Cs(o)?o:void 0);break}case k.DIRECTIVE:this._directive=n.getDirective(e.name.value);break;case k.OPERATION_DEFINITION:{const i=n.getRootType(e.operation);this._typeStack.push(tt(i)?i:void 0);break}case k.INLINE_FRAGMENT:case k.FRAGMENT_DEFINITION:{const i=e.typeCondition,s=i?Jn(n,i):Dn(this.getType());this._typeStack.push(Cs(s)?s:void 0);break}case k.VARIABLE_DEFINITION:{const i=Jn(n,e.type);this._inputTypeStack.push(Gn(i)?i:void 0);break}case k.ARGUMENT:{var r;let i,s;const o=(r=this.getDirective())!==null&&r!==void 0?r:this.getFieldDef();o&&(i=o.args.find(a=>a.name===e.name.value),i&&(s=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push(Gn(s)?s:void 0);break}case k.LIST:{const i=fv(this.getInputType()),s=wt(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Gn(s)?s:void 0);break}case k.OBJECT_FIELD:{const i=Dn(this.getInputType());let s,o;vt(i)&&(o=i.getFields()[e.name.value],o&&(s=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push(Gn(s)?s:void 0);break}case k.ENUM:{const i=Dn(this.getInputType());let s;jt(i)&&(s=i.getValue(e.value)),this._enumValue=s;break}}}leave(e){switch(e.kind){case k.SELECTION_SET:this._parentTypeStack.pop();break;case k.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case k.DIRECTIVE:this._directive=null;break;case k.OPERATION_DEFINITION:case k.INLINE_FRAGMENT:case k.FRAGMENT_DEFINITION:this._typeStack.pop();break;case k.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case k.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case k.LIST:case k.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case k.ENUM:this._enumValue=null;break}}}function ij(t,e,n){const r=n.name.value;if(r===Oc.name&&t.getQueryType()===e)return Oc;if(r===kc.name&&t.getQueryType()===e)return kc;if(r===Nc.name&&vi(e))return Nc;if(tt(e)||at(e))return e.getFields()[r]}function Dv(t,e){return{enter(...n){const r=n[0];t.enter(r);const i=ja(e,r.kind).enter;if(i){const s=i.apply(e,n);return s!==void 0&&(t.leave(r),Bg(s)&&t.enter(s)),s}},leave(...n){const r=n[0],i=ja(e,r.kind).leave;let s;return i&&(s=i.apply(e,n)),t.leave(r),s}}}function sj(t){return Rv(t)||Mv(t)||Pv(t)}function Rv(t){return t.kind===k.OPERATION_DEFINITION||t.kind===k.FRAGMENT_DEFINITION}function zg(t){return t.kind===k.FIELD||t.kind===k.FRAGMENT_SPREAD||t.kind===k.INLINE_FRAGMENT}function e1(t){return t.kind===k.VARIABLE||t.kind===k.INT||t.kind===k.FLOAT||t.kind===k.STRING||t.kind===k.BOOLEAN||t.kind===k.NULL||t.kind===k.ENUM||t.kind===k.LIST||t.kind===k.OBJECT}function Qg(t){return e1(t)&&(t.kind===k.LIST?t.values.some(Qg):t.kind===k.OBJECT?t.fields.some(e=>Qg(e.value)):t.kind!==k.VARIABLE)}function oj(t){return t.kind===k.NAMED_TYPE||t.kind===k.LIST_TYPE||t.kind===k.NON_NULL_TYPE}function Mv(t){return t.kind===k.SCHEMA_DEFINITION||sl(t)||t.kind===k.DIRECTIVE_DEFINITION}function sl(t){return t.kind===k.SCALAR_TYPE_DEFINITION||t.kind===k.OBJECT_TYPE_DEFINITION||t.kind===k.INTERFACE_TYPE_DEFINITION||t.kind===k.UNION_TYPE_DEFINITION||t.kind===k.ENUM_TYPE_DEFINITION||t.kind===k.INPUT_OBJECT_TYPE_DEFINITION}function Pv(t){return t.kind===k.SCHEMA_EXTENSION||ch(t)}function ch(t){return t.kind===k.SCALAR_TYPE_EXTENSION||t.kind===k.OBJECT_TYPE_EXTENSION||t.kind===k.INTERFACE_TYPE_EXTENSION||t.kind===k.UNION_TYPE_EXTENSION||t.kind===k.ENUM_TYPE_EXTENSION||t.kind===k.INPUT_OBJECT_TYPE_EXTENSION}function t1(t){return{Document(e){for(const n of e.definitions)if(!Rv(n)){const r=n.kind===k.SCHEMA_DEFINITION||n.kind===k.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';t.reportError(new j(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}function n1(t){return{Field(e){const n=t.getParentType();if(n&&!t.getFieldDef()){const i=t.getSchema(),s=e.name.value;let o=zi("to use an inline fragment on",aj(i,n,s));o===""&&(o=zi(lj(n,s))),t.reportError(new j(`Cannot query field "${s}" on type "${n.name}".`+o,{nodes:e}))}}}}function aj(t,e,n){if(!mi(e))return[];const r=new Set,i=Object.create(null);for(const o of t.getPossibleTypes(e))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(const a of o.getInterfaces()){var s;a.getFields()[n]&&(r.add(a),i[a.name]=((s=i[a.name])!==null&&s!==void 0?s:0)+1)}}return[...r].sort((o,a)=>{const l=i[a.name]-i[o.name];return l!==0?l:at(o)&&t.isSubType(o,a)?-1:at(a)&&t.isSubType(a,o)?1:Jc(o.name,a.name)}).map(o=>o.name)}function lj(t,e){if(tt(t)||at(t)){const n=Object.keys(t.getFields());return Ws(e,n)}return[]}function r1(t){return{InlineFragment(e){const n=e.typeCondition;if(n){const r=Jn(t.getSchema(),n);if(r&&!vi(r)){const i=yt(n);t.reportError(new j(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(e){const n=Jn(t.getSchema(),e.typeCondition);if(n&&!vi(n)){const r=yt(e.typeCondition);t.reportError(new j(`Fragment "${e.name.value}" cannot condition on non composite type "${r}".`,{nodes:e.typeCondition}))}}}}function i1(t){return{...s1(t),Argument(e){const n=t.getArgument(),r=t.getFieldDef(),i=t.getParentType();if(!n&&r&&i){const s=e.name.value,o=r.args.map(l=>l.name),a=Ws(s,o);t.reportError(new j(`Unknown argument "${s}" on field "${i.name}.${r.name}".`+zi(a),{nodes:e}))}}}}function s1(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():zs;for(const o of r)e[o.name]=o.args.map(a=>a.name);const i=t.getDocument().definitions;for(const o of i)if(o.kind===k.DIRECTIVE_DEFINITION){var s;const a=(s=o.arguments)!==null&&s!==void 0?s:[];e[o.name.value]=a.map(l=>l.name.value)}return{Directive(o){const a=o.name.value,l=e[a];if(o.arguments&&l)for(const u of o.arguments){const d=u.name.value;if(!l.includes(d)){const h=Ws(d,l);t.reportError(new j(`Unknown argument "${d}" on directive "@${a}".`+zi(h),{nodes:u}))}}return!1}}}function Fv(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():zs;for(const s of r)e[s.name]=s.locations;const i=t.getDocument().definitions;for(const s of i)s.kind===k.DIRECTIVE_DEFINITION&&(e[s.name.value]=s.locations.map(o=>o.value));return{Directive(s,o,a,l,u){const d=s.name.value,h=e[d];if(!h){t.reportError(new j(`Unknown directive "@${d}".`,{nodes:s}));return}const p=cj(u);p&&!h.includes(p)&&t.reportError(new j(`Directive "@${d}" may not be used on ${p}.`,{nodes:s}))}}}function cj(t){const e=t[t.length-1];switch("kind"in e||$t(!1),e.kind){case k.OPERATION_DEFINITION:return uj(e.operation);case k.FIELD:return me.FIELD;case k.FRAGMENT_SPREAD:return me.FRAGMENT_SPREAD;case k.INLINE_FRAGMENT:return me.INLINE_FRAGMENT;case k.FRAGMENT_DEFINITION:return me.FRAGMENT_DEFINITION;case k.VARIABLE_DEFINITION:return me.VARIABLE_DEFINITION;case k.SCHEMA_DEFINITION:case k.SCHEMA_EXTENSION:return me.SCHEMA;case k.SCALAR_TYPE_DEFINITION:case k.SCALAR_TYPE_EXTENSION:return me.SCALAR;case k.OBJECT_TYPE_DEFINITION:case k.OBJECT_TYPE_EXTENSION:return me.OBJECT;case k.FIELD_DEFINITION:return me.FIELD_DEFINITION;case k.INTERFACE_TYPE_DEFINITION:case k.INTERFACE_TYPE_EXTENSION:return me.INTERFACE;case k.UNION_TYPE_DEFINITION:case k.UNION_TYPE_EXTENSION:return me.UNION;case k.ENUM_TYPE_DEFINITION:case k.ENUM_TYPE_EXTENSION:return me.ENUM;case k.ENUM_VALUE_DEFINITION:return me.ENUM_VALUE;case k.INPUT_OBJECT_TYPE_DEFINITION:case k.INPUT_OBJECT_TYPE_EXTENSION:return me.INPUT_OBJECT;case k.INPUT_VALUE_DEFINITION:{const n=t[t.length-3];return"kind"in n||$t(!1),n.kind===k.INPUT_OBJECT_TYPE_DEFINITION?me.INPUT_FIELD_DEFINITION:me.ARGUMENT_DEFINITION}default:$t(!1,"Unexpected kind: "+z(e.kind))}}function uj(t){switch(t){case Qt.QUERY:return me.QUERY;case Qt.MUTATION:return me.MUTATION;case Qt.SUBSCRIPTION:return me.SUBSCRIPTION}}function o1(t){return{FragmentSpread(e){const n=e.name.value;t.getFragment(n)||t.reportError(new j(`Unknown fragment "${n}".`,{nodes:e.name}))}}}function $v(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);for(const s of t.getDocument().definitions)sl(s)&&(r[s.name.value]=!0);const i=[...Object.keys(n),...Object.keys(r)];return{NamedType(s,o,a,l,u){const d=s.name.value;if(!n[d]&&!r[d]){var h;const p=(h=u[2])!==null&&h!==void 0?h:a,g=p!=null&&fj(p);if(g&&Mw.includes(d))return;const y=Ws(d,g?Mw.concat(i):i);t.reportError(new j(`Unknown type "${d}".`+zi(y),{nodes:s}))}}}}const Mw=[...eu,...ru].map(t=>t.name);function fj(t){return"kind"in t&&(Mv(t)||Pv(t))}function a1(t){let e=0;return{Document(n){e=n.definitions.filter(r=>r.kind===k.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&e>1&&t.reportError(new j("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function l1(t){var e,n,r;const i=t.getSchema(),s=(e=(n=(r=i==null?void 0:i.astNode)!==null&&r!==void 0?r:i==null?void 0:i.getQueryType())!==null&&n!==void 0?n:i==null?void 0:i.getMutationType())!==null&&e!==void 0?e:i==null?void 0:i.getSubscriptionType();let o=0;return{SchemaDefinition(a){if(s){t.reportError(new j("Cannot define a new schema within a schema extension.",{nodes:a}));return}o>0&&t.reportError(new j("Must provide only one schema definition.",{nodes:a})),++o}}}const dj=3;function c1(t){function e(n,r=Object.create(null),i=0){if(n.kind===k.FRAGMENT_SPREAD){const s=n.name.value;if(r[s]===!0)return!1;const o=t.getFragment(s);if(!o)return!1;try{return r[s]=!0,e(o,r,i)}finally{r[s]=void 0}}if(n.kind===k.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(i++,i>=dj))return!0;if("selectionSet"in n&&n.selectionSet){for(const s of n.selectionSet.selections)if(e(s,r,i))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&e(n))return t.reportError(new j("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function u1(t){const e=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(s){return i(s),!1}};function i(s){if(e[s.name.value])return;const o=s.name.value;e[o]=!0;const a=t.getFragmentSpreads(s.selectionSet);if(a.length!==0){r[o]=n.length;for(const l of a){const u=l.name.value,d=r[u];if(n.push(l),d===void 0){const h=t.getFragment(u);h&&i(h)}else{const h=n.slice(d),p=h.slice(0,-1).map(g=>'"'+g.name.value+'"').join(", ");t.reportError(new j(`Cannot spread fragment "${u}" within itself`+(p!==""?` via ${p}.`:"."),{nodes:h}))}n.pop()}r[o]=void 0}}}function f1(t){let e=Object.create(null);return{OperationDefinition:{enter(){e=Object.create(null)},leave(n){const r=t.getRecursiveVariableUsages(n);for(const{node:i}of r){const s=i.name.value;e[s]!==!0&&t.reportError(new j(n.name?`Variable "$${s}" is not defined by operation "${n.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(n){e[n.variable.name.value]=!0}}}function d1(t){const e=[],n=[];return{OperationDefinition(r){return e.push(r),!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){const r=Object.create(null);for(const i of e)for(const s of t.getRecursivelyReferencedFragments(i))r[s.name.value]=!0;for(const i of n){const s=i.name.value;r[s]!==!0&&t.reportError(new j(`Fragment "${s}" is never used.`,{nodes:i}))}}}}}function h1(t){let e=[];return{OperationDefinition:{enter(){e=[]},leave(n){const r=Object.create(null),i=t.getRecursiveVariableUsages(n);for(const{node:s}of i)r[s.name.value]=!0;for(const s of e){const o=s.variable.name.value;r[o]!==!0&&t.reportError(new j(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:s}))}}},VariableDefinition(n){e.push(n)}}}function uh(t){switch(t.kind){case k.OBJECT:return{...t,fields:hj(t.fields)};case k.LIST:return{...t,values:t.values.map(uh)};case k.INT:case k.FLOAT:case k.STRING:case k.BOOLEAN:case k.NULL:case k.ENUM:case k.VARIABLE:return t}}function hj(t){return t.map(e=>({...e,value:uh(e.value)})).sort((e,n)=>Jc(e.name.value,n.name.value))}function p1(t){return Array.isArray(t)?t.map(([e,n])=>`subfields "${e}" conflict because `+p1(n)).join(" and "):t}function m1(t){const e=new bj,n=new Map;return{SelectionSet(r){const i=pj(t,n,e,t.getParentType(),r);for(const[[s,o],a,l]of i){const u=p1(o);t.reportError(new j(`Fields "${s}" conflict because ${u}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:a.concat(l)}))}}}}function pj(t,e,n,r,i){const s=[],[o,a]=hd(t,e,r,i);if(gj(t,s,e,n,o),a.length!==0)for(let l=0;l<a.length;l++){fd(t,s,e,n,!1,o,a[l]);for(let u=l+1;u<a.length;u++)dd(t,s,e,n,!1,a[l],a[u])}return s}function fd(t,e,n,r,i,s,o){const a=t.getFragment(o);if(!a)return;const[l,u]=Hg(t,n,a);if(s!==l){Lv(t,e,n,r,i,s,l);for(const d of u)r.has(d,o,i)||(r.add(d,o,i),fd(t,e,n,r,i,s,d))}}function dd(t,e,n,r,i,s,o){if(s===o||r.has(s,o,i))return;r.add(s,o,i);const a=t.getFragment(s),l=t.getFragment(o);if(!a||!l)return;const[u,d]=Hg(t,n,a),[h,p]=Hg(t,n,l);Lv(t,e,n,r,i,u,h);for(const g of p)dd(t,e,n,r,i,s,g);for(const g of d)dd(t,e,n,r,i,g,o)}function mj(t,e,n,r,i,s,o,a){const l=[],[u,d]=hd(t,e,i,s),[h,p]=hd(t,e,o,a);Lv(t,l,e,n,r,u,h);for(const g of p)fd(t,l,e,n,r,u,g);for(const g of d)fd(t,l,e,n,r,h,g);for(const g of d)for(const y of p)dd(t,l,e,n,r,g,y);return l}function gj(t,e,n,r,i){for(const[s,o]of Object.entries(i))if(o.length>1)for(let a=0;a<o.length;a++)for(let l=a+1;l<o.length;l++){const u=g1(t,n,r,!1,s,o[a],o[l]);u&&e.push(u)}}function Lv(t,e,n,r,i,s,o){for(const[a,l]of Object.entries(s)){const u=o[a];if(u)for(const d of l)for(const h of u){const p=g1(t,n,r,i,a,d,h);p&&e.push(p)}}}function g1(t,e,n,r,i,s,o){const[a,l,u]=s,[d,h,p]=o,g=r||a!==d&&tt(a)&&tt(d);if(!g){const O=l.name.value,N=h.name.value;if(O!==N)return[[i,`"${O}" and "${N}" are different fields`],[l],[h]];if(!yj(l,h))return[[i,"they have differing arguments"],[l],[h]]}const y=u==null?void 0:u.type,b=p==null?void 0:p.type;if(y&&b&&Gg(y,b))return[[i,`they return conflicting types "${z(y)}" and "${z(b)}"`],[l],[h]];const _=l.selectionSet,w=h.selectionSet;if(_&&w){const O=mj(t,e,n,g,Dn(y),_,Dn(b),w);return vj(O,i,l,h)}}function yj(t,e){const n=t.arguments,r=e.arguments;if(n===void 0||n.length===0)return r===void 0||r.length===0;if(r===void 0||r.length===0||n.length!==r.length)return!1;const i=new Map(r.map(({name:s,value:o})=>[s.value,o]));return n.every(s=>{const o=s.value,a=i.get(s.name.value);return a===void 0?!1:Pw(o)===Pw(a)})}function Pw(t){return yt(uh(t))}function Gg(t,e){return wt(t)?wt(e)?Gg(t.ofType,e.ofType):!0:wt(e)?!0:Ie(t)?Ie(e)?Gg(t.ofType,e.ofType):!0:Ie(e)?!0:yi(t)||yi(e)?t!==e:!1}function hd(t,e,n,r){const i=e.get(r);if(i)return i;const s=Object.create(null),o=Object.create(null);y1(t,n,r,s,o);const a=[s,Object.keys(o)];return e.set(r,a),a}function Hg(t,e,n){const r=e.get(n.selectionSet);if(r)return r;const i=Jn(t.getSchema(),n.typeCondition);return hd(t,e,i,n.selectionSet)}function y1(t,e,n,r,i){for(const s of n.selections)switch(s.kind){case k.FIELD:{const o=s.name.value;let a;(tt(e)||at(e))&&(a=e.getFields()[o]);const l=s.alias?s.alias.value:o;r[l]||(r[l]=[]),r[l].push([e,s,a]);break}case k.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case k.INLINE_FRAGMENT:{const o=s.typeCondition,a=o?Jn(t.getSchema(),o):e;y1(t,a,s.selectionSet,r,i);break}}}function vj(t,e,n,r){if(t.length>0)return[[e,t.map(([i])=>i)],[n,...t.map(([,i])=>i).flat()],[r,...t.map(([,,i])=>i).flat()]]}class bj{constructor(){this._data=new Map}has(e,n,r){var i;const[s,o]=e<n?[e,n]:[n,e],a=(i=this._data.get(s))===null||i===void 0?void 0:i.get(o);return a===void 0?!1:r?!0:r===a}add(e,n,r){const[i,s]=e<n?[e,n]:[n,e],o=this._data.get(i);o===void 0?this._data.set(i,new Map([[s,r]])):o.set(s,r)}}function v1(t){return{InlineFragment(e){const n=t.getType(),r=t.getParentType();if(vi(n)&&vi(r)&&!qg(t.getSchema(),n,r)){const i=z(r),s=z(n);t.reportError(new j(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${s}".`,{nodes:e}))}},FragmentSpread(e){const n=e.name.value,r=_j(t,n),i=t.getParentType();if(r&&i&&!qg(t.getSchema(),r,i)){const s=z(i),o=z(r);t.reportError(new j(`Fragment "${n}" cannot be spread here as objects of type "${s}" can never be of type "${o}".`,{nodes:e}))}}}}function _j(t,e){const n=t.getFragment(e);if(n){const r=Jn(t.getSchema(),n.typeCondition);if(vi(r))return r}}function b1(t){const e=t.getSchema(),n=Object.create(null);for(const i of t.getDocument().definitions)sl(i)&&(n[i.name.value]=i);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(i){const s=i.name.value,o=n[s],a=e==null?void 0:e.getType(s);let l;if(o?l=Ej[o.kind]:a&&(l=wj(a)),l){if(l!==i.kind){const u=Tj(i.kind);t.reportError(new j(`Cannot extend non-${u} type "${s}".`,{nodes:o?[o,i]:i}))}}else{const u=Object.keys({...n,...e==null?void 0:e.getTypeMap()}),d=Ws(s,u);t.reportError(new j(`Cannot extend type "${s}" because it is not defined.`+zi(d),{nodes:i.name}))}}}const Ej={[k.SCALAR_TYPE_DEFINITION]:k.SCALAR_TYPE_EXTENSION,[k.OBJECT_TYPE_DEFINITION]:k.OBJECT_TYPE_EXTENSION,[k.INTERFACE_TYPE_DEFINITION]:k.INTERFACE_TYPE_EXTENSION,[k.UNION_TYPE_DEFINITION]:k.UNION_TYPE_EXTENSION,[k.ENUM_TYPE_DEFINITION]:k.ENUM_TYPE_EXTENSION,[k.INPUT_OBJECT_TYPE_DEFINITION]:k.INPUT_OBJECT_TYPE_EXTENSION};function wj(t){if(gr(t))return k.SCALAR_TYPE_EXTENSION;if(tt(t))return k.OBJECT_TYPE_EXTENSION;if(at(t))return k.INTERFACE_TYPE_EXTENSION;if(Gt(t))return k.UNION_TYPE_EXTENSION;if(jt(t))return k.ENUM_TYPE_EXTENSION;if(vt(t))return k.INPUT_OBJECT_TYPE_EXTENSION;$t(!1,"Unexpected type: "+z(t))}function Tj(t){switch(t){case k.SCALAR_TYPE_EXTENSION:return"scalar";case k.OBJECT_TYPE_EXTENSION:return"object";case k.INTERFACE_TYPE_EXTENSION:return"interface";case k.UNION_TYPE_EXTENSION:return"union";case k.ENUM_TYPE_EXTENSION:return"enum";case k.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:$t(!1,"Unexpected kind: "+z(t))}}function _1(t){return{...E1(t),Field:{leave(e){var n;const r=t.getFieldDef();if(!r)return!1;const i=new Set((n=e.arguments)===null||n===void 0?void 0:n.map(s=>s.name.value));for(const s of r.args)if(!i.has(s.name)&&qs(s)){const o=z(s.type);t.reportError(new j(`Field "${r.name}" argument "${s.name}" of type "${o}" is required, but it was not provided.`,{nodes:e}))}}}}}function E1(t){var e;const n=Object.create(null),r=t.getSchema(),i=(e=r==null?void 0:r.getDirectives())!==null&&e!==void 0?e:zs;for(const a of i)n[a.name]=Qi(a.args.filter(qs),l=>l.name);const s=t.getDocument().definitions;for(const a of s)if(a.kind===k.DIRECTIVE_DEFINITION){var o;const l=(o=a.arguments)!==null&&o!==void 0?o:[];n[a.name.value]=Qi(l.filter(Sj),u=>u.name.value)}return{Directive:{leave(a){const l=a.name.value,u=n[l];if(u){var d;const h=(d=a.arguments)!==null&&d!==void 0?d:[],p=new Set(h.map(g=>g.name.value));for(const[g,y]of Object.entries(u))if(!p.has(g)){const b=Yc(y.type)?z(y.type):yt(y.type);t.reportError(new j(`Directive "@${l}" argument "${g}" of type "${b}" is required, but it was not provided.`,{nodes:a}))}}}}}}function Sj(t){return t.type.kind===k.NON_NULL_TYPE&&t.defaultValue==null}function w1(t){return{Field(e){const n=t.getType(),r=e.selectionSet;if(n){if(yi(Dn(n))){if(r){const i=e.name.value,s=z(n);t.reportError(new j(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:r}))}}else if(!r){const i=e.name.value,s=z(n);t.reportError(new j(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:e}))}}}}}function T1(t){return t.map(e=>typeof e=="number"?"["+e.toString()+"]":"."+e).join("")}function qa(t,e,n){return{prev:t,key:e,typename:n}}function Cn(t){const e=[];let n=t;for(;n;)e.push(n.key),n=n.prev;return e.reverse()}function S1(t,e,n=Oj){return oc(t,e,n,void 0)}function Oj(t,e,n){let r="Invalid value "+z(e);throw t.length>0&&(r+=` at "value${T1(t)}"`),n.message=r+": "+n.message,n}function oc(t,e,n,r){if(Ie(e)){if(t!=null)return oc(t,e.ofType,n,r);n(Cn(r),t,new j(`Expected non-nullable type "${z(e)}" not to be null.`));return}if(t==null)return null;if(wt(e)){const i=e.ofType;return Ev(t)?Array.from(t,(s,o)=>{const a=qa(r,o,void 0);return oc(s,i,n,a)}):[oc(t,i,n,r)]}if(vt(e)){if(!pr(t)){n(Cn(r),t,new j(`Expected type "${e.name}" to be an object.`));return}const i={},s=e.getFields();for(const o of Object.values(s)){const a=t[o.name];if(a===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(Ie(o.type)){const l=z(o.type);n(Cn(r),t,new j(`Field "${o.name}" of required type "${l}" was not provided.`))}continue}i[o.name]=oc(a,o.type,n,qa(r,o.name,e.name))}for(const o of Object.keys(t))if(!s[o]){const a=Ws(o,Object.keys(e.getFields()));n(Cn(r),t,new j(`Field "${o}" is not defined by type "${e.name}".`+zi(a)))}if(e.isOneOf){const o=Object.keys(i);o.length!==1&&n(Cn(r),t,new j(`Exactly one key must be specified for OneOf type "${e.name}".`));const a=o[0],l=i[a];l===null&&n(Cn(r).concat(a),l,new j(`Field "${a}" must be non-null.`))}return i}if(yi(e)){let i;try{i=e.parseValue(t)}catch(s){s instanceof j?n(Cn(r),t,s):n(Cn(r),t,new j(`Expected type "${e.name}". `+s.message,{originalError:s}));return}return i===void 0&&n(Cn(r),t,new j(`Expected type "${e.name}".`)),i}$t(!1,"Unexpected input type: "+z(e))}function di(t,e,n){if(t){if(t.kind===k.VARIABLE){const r=t.name.value;if(n==null||n[r]===void 0)return;const i=n[r];return i===null&&Ie(e)?void 0:i}if(Ie(e))return t.kind===k.NULL?void 0:di(t,e.ofType,n);if(t.kind===k.NULL)return null;if(wt(e)){const r=e.ofType;if(t.kind===k.LIST){const s=[];for(const o of t.values)if(Fw(o,n)){if(Ie(r))return;s.push(null)}else{const a=di(o,r,n);if(a===void 0)return;s.push(a)}return s}const i=di(t,r,n);return i===void 0?void 0:[i]}if(vt(e)){if(t.kind!==k.OBJECT)return;const r=Object.create(null),i=Qi(t.fields,s=>s.name.value);for(const s of Object.values(e.getFields())){const o=i[s.name];if(!o||Fw(o.value,n)){if(s.defaultValue!==void 0)r[s.name]=s.defaultValue;else if(Ie(s.type))return;continue}const a=di(o.value,s.type,n);if(a===void 0)return;r[s.name]=a}if(e.isOneOf){const s=Object.keys(r);if(s.length!==1||r[s[0]]===null)return}return r}if(yi(e)){let r;try{r=e.parseLiteral(t,n)}catch{return}return r===void 0?void 0:r}$t(!1,"Unexpected input type: "+z(e))}}function Fw(t,e){return t.kind===k.VARIABLE&&(e==null||e[t.name.value]===void 0)}function O1(t,e,n,r){const i=[],s=r==null?void 0:r.maxErrors;try{const o=kj(t,e,n,a=>{if(s!=null&&i.length>=s)throw new j("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:o}}catch(o){i.push(o)}return{errors:i}}function kj(t,e,n,r){const i={};for(const s of e){const o=s.variable.name.value,a=Jn(t,s.type);if(!Gn(a)){const u=yt(s.type);r(new j(`Variable "$${o}" expected value of type "${u}" which cannot be used as an input type.`,{nodes:s.type}));continue}if(!k1(n,o)){if(s.defaultValue)i[o]=di(s.defaultValue,a);else if(Ie(a)){const u=z(a);r(new j(`Variable "$${o}" of required type "${u}" was not provided.`,{nodes:s}))}continue}const l=n[o];if(l===null&&Ie(a)){const u=z(a);r(new j(`Variable "$${o}" of non-null type "${u}" must not be null.`,{nodes:s}));continue}i[o]=S1(l,a,(u,d,h)=>{let p=`Variable "$${o}" got invalid value `+z(d);u.length>0&&(p+=` at "${o}${T1(u)}"`),r(new j(p+"; "+h.message,{nodes:s,originalError:h}))})}return i}function fh(t,e,n){var r;const i={},s=(r=e.arguments)!==null&&r!==void 0?r:[],o=Qi(s,a=>a.name.value);for(const a of t.args){const l=a.name,u=a.type,d=o[l];if(!d){if(a.defaultValue!==void 0)i[l]=a.defaultValue;else if(Ie(u))throw new j(`Argument "${l}" of required type "${z(u)}" was not provided.`,{nodes:e});continue}const h=d.value;let p=h.kind===k.NULL;if(h.kind===k.VARIABLE){const y=h.name.value;if(n==null||!k1(n,y)){if(a.defaultValue!==void 0)i[l]=a.defaultValue;else if(Ie(u))throw new j(`Argument "${l}" of required type "${z(u)}" was provided the variable "$${y}" which was not provided a runtime value.`,{nodes:h});continue}p=n[y]==null}if(p&&Ie(u))throw new j(`Argument "${l}" of non-null type "${z(u)}" must not be null.`,{nodes:h});const g=di(h,u,n);if(g===void 0)throw new j(`Argument "${l}" has invalid value ${yt(h)}.`,{nodes:h});i[l]=g}return i}function za(t,e,n){var r;const i=(r=e.directives)===null||r===void 0?void 0:r.find(s=>s.name.value===t.name);if(i)return fh(t,i,n)}function k1(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Vv(t,e,n,r,i){const s=new Map;return pd(t,e,n,r,i,s,new Set),s}function Nj(t,e,n,r,i){const s=new Map,o=new Set;for(const a of i)a.selectionSet&&pd(t,e,n,r,a.selectionSet,s,o);return s}function pd(t,e,n,r,i,s,o){for(const a of i.selections)switch(a.kind){case k.FIELD:{if(!Cm(n,a))continue;const l=Aj(a),u=s.get(l);u!==void 0?u.push(a):s.set(l,[a]);break}case k.INLINE_FRAGMENT:{if(!Cm(n,a)||!$w(t,a,r))continue;pd(t,e,n,r,a.selectionSet,s,o);break}case k.FRAGMENT_SPREAD:{const l=a.name.value;if(o.has(l)||!Cm(n,a))continue;o.add(l);const u=e[l];if(!u||!$w(t,u,r))continue;pd(t,e,n,r,u.selectionSet,s,o);break}}}function Cm(t,e){const n=za(gv,e,t);if((n==null?void 0:n.if)===!0)return!1;const r=za(mv,e,t);return(r==null?void 0:r.if)!==!1}function $w(t,e,n){const r=e.typeCondition;if(!r)return!0;const i=Jn(t,r);return i===n?!0:mi(i)?t.isSubType(i,n):!1}function Aj(t){return t.alias?t.alias.value:t.name.value}function N1(t){return{OperationDefinition(e){if(e.operation==="subscription"){const n=t.getSchema(),r=n.getSubscriptionType();if(r){const i=e.name?e.name.value:null,s=Object.create(null),o=t.getDocument(),a=Object.create(null);for(const u of o.definitions)u.kind===k.FRAGMENT_DEFINITION&&(a[u.name.value]=u);const l=Vv(n,a,s,r,e.selectionSet);if(l.size>1){const h=[...l.values()].slice(1).flat();t.reportError(new j(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:h}))}for(const u of l.values())u[0].name.value.startsWith("__")&&t.reportError(new j(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:u}))}}}}}function jv(t,e){const n=new Map;for(const r of t){const i=e(r),s=n.get(i);s===void 0?n.set(i,[r]):s.push(r)}return n}function A1(t){return{DirectiveDefinition(r){var i;const s=(i=r.arguments)!==null&&i!==void 0?i:[];return n(`@${r.name.value}`,s)},InterfaceTypeDefinition:e,InterfaceTypeExtension:e,ObjectTypeDefinition:e,ObjectTypeExtension:e};function e(r){var i;const s=r.name.value,o=(i=r.fields)!==null&&i!==void 0?i:[];for(const l of o){var a;const u=l.name.value,d=(a=l.arguments)!==null&&a!==void 0?a:[];n(`${s}.${u}`,d)}return!1}function n(r,i){const s=jv(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&t.reportError(new j(`Argument "${r}(${o}:)" can only be defined once.`,{nodes:a.map(l=>l.name)}));return!1}}function Bv(t){return{Field:e,Directive:e};function e(n){var r;const i=(r=n.arguments)!==null&&r!==void 0?r:[],s=jv(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&t.reportError(new j(`There can be only one argument named "${o}".`,{nodes:a.map(l=>l.name)}))}}function I1(t){const e=Object.create(null),n=t.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n!=null&&n.getDirective(i)){t.reportError(new j(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return e[i]?t.reportError(new j(`There can be only one directive named "@${i}".`,{nodes:[e[i],r.name]})):e[i]=r.name,!1}}}function Uv(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():zs;for(const a of r)e[a.name]=!a.isRepeatable;const i=t.getDocument().definitions;for(const a of i)a.kind===k.DIRECTIVE_DEFINITION&&(e[a.name.value]=!a.repeatable);const s=Object.create(null),o=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let l;if(a.kind===k.SCHEMA_DEFINITION||a.kind===k.SCHEMA_EXTENSION)l=s;else if(sl(a)||ch(a)){const u=a.name.value;l=o[u],l===void 0&&(o[u]=l=Object.create(null))}else l=Object.create(null);for(const u of a.directives){const d=u.name.value;e[d]&&(l[d]?t.reportError(new j(`The directive "@${d}" can only be used once at this location.`,{nodes:[l[d],u]})):l[d]=u)}}}}function x1(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const l=(o=s.values)!==null&&o!==void 0?o:[],u=r[a];for(const d of l){const h=d.name.value,p=n[a];jt(p)&&p.getValue(h)?t.reportError(new j(`Enum value "${a}.${h}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:d.name})):u[h]?t.reportError(new j(`Enum value "${a}.${h}" can only be defined once.`,{nodes:[u[h],d.name]})):u[h]=d.name}return!1}}function C1(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const l=(o=s.fields)!==null&&o!==void 0?o:[],u=r[a];for(const d of l){const h=d.name.value;Ij(n[a],h)?t.reportError(new j(`Field "${a}.${h}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:d.name})):u[h]?t.reportError(new j(`Field "${a}.${h}" can only be defined once.`,{nodes:[u[h],d.name]})):u[h]=d.name}return!1}}function Ij(t,e){return tt(t)||at(t)||vt(t)?t.getFields()[e]!=null:!1}function D1(t){const e=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value;return e[r]?t.reportError(new j(`There can be only one fragment named "${r}".`,{nodes:[e[r],n.name]})):e[r]=n.name,!1}}}function Wv(t){const e=[];let n=Object.create(null);return{ObjectValue:{enter(){e.push(n),n=Object.create(null)},leave(){const r=e.pop();r||$t(!1),n=r}},ObjectField(r){const i=r.name.value;n[i]?t.reportError(new j(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name}}}function R1(t){const e=Object.create(null);return{OperationDefinition(n){const r=n.name;return r&&(e[r.value]?t.reportError(new j(`There can be only one operation named "${r.value}".`,{nodes:[e[r.value],r]})):e[r.value]=r),!1},FragmentDefinition:()=>!1}}function M1(t){const e=t.getSchema(),n=Object.create(null),r=e?{query:e.getQueryType(),mutation:e.getMutationType(),subscription:e.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(s){var o;const a=(o=s.operationTypes)!==null&&o!==void 0?o:[];for(const l of a){const u=l.operation,d=n[u];r[u]?t.reportError(new j(`Type for ${u} already defined in the schema. It cannot be redefined.`,{nodes:l})):d?t.reportError(new j(`There can be only one ${u} type in schema.`,{nodes:[d,l]})):n[u]=l}return!1}}function P1(t){const e=Object.create(null),n=t.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){const s=i.name.value;if(n!=null&&n.getType(s)){t.reportError(new j(`Type "${s}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return e[s]?t.reportError(new j(`There can be only one type named "${s}".`,{nodes:[e[s],i.name]})):e[s]=i.name,!1}}function F1(t){return{OperationDefinition(e){var n;const r=(n=e.variableDefinitions)!==null&&n!==void 0?n:[],i=jv(r,s=>s.variable.name.value);for(const[s,o]of i)o.length>1&&t.reportError(new j(`There can be only one variable named "$${s}".`,{nodes:o.map(a=>a.variable.name)}))}}}function $1(t){let e={};return{OperationDefinition:{enter(){e={}}},VariableDefinition(n){e[n.variable.name.value]=n},ListValue(n){const r=fv(t.getParentInputType());if(!wt(r))return uo(t,n),!1},ObjectValue(n){const r=Dn(t.getInputType());if(!vt(r))return uo(t,n),!1;const i=Qi(n.fields,s=>s.name.value);for(const s of Object.values(r.getFields()))if(!i[s.name]&&ih(s)){const a=z(s.type);t.reportError(new j(`Field "${r.name}.${s.name}" of required type "${a}" was not provided.`,{nodes:n}))}r.isOneOf&&xj(t,n,r,i,e)},ObjectField(n){const r=Dn(t.getParentInputType());if(!t.getInputType()&&vt(r)){const s=Ws(n.name.value,Object.keys(r.getFields()));t.reportError(new j(`Field "${n.name.value}" is not defined by type "${r.name}".`+zi(s),{nodes:n}))}},NullValue(n){const r=t.getInputType();Ie(r)&&t.reportError(new j(`Expected value of type "${z(r)}", found ${yt(n)}.`,{nodes:n}))},EnumValue:n=>uo(t,n),IntValue:n=>uo(t,n),FloatValue:n=>uo(t,n),StringValue:n=>uo(t,n),BooleanValue:n=>uo(t,n)}}function uo(t,e){const n=t.getInputType();if(!n)return;const r=Dn(n);if(!yi(r)){const i=z(n);t.reportError(new j(`Expected value of type "${i}", found ${yt(e)}.`,{nodes:e}));return}try{if(r.parseLiteral(e,void 0)===void 0){const s=z(n);t.reportError(new j(`Expected value of type "${s}", found ${yt(e)}.`,{nodes:e}))}}catch(i){const s=z(n);i instanceof j?t.reportError(i):t.reportError(new j(`Expected value of type "${s}", found ${yt(e)}; `+i.message,{nodes:e,originalError:i}))}}function xj(t,e,n,r,i){var s;const o=Object.keys(r);if(o.length!==1){t.reportError(new j(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[e]}));return}const l=(s=r[o[0]])===null||s===void 0?void 0:s.value,u=!l||l.kind===k.NULL,d=(l==null?void 0:l.kind)===k.VARIABLE;if(u){t.reportError(new j(`Field "${n.name}.${o[0]}" must be non-null.`,{nodes:[e]}));return}if(d){const h=l.name.value;i[h].type.kind!==k.NON_NULL_TYPE&&t.reportError(new j(`Variable "${h}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[e]}))}}function L1(t){return{VariableDefinition(e){const n=Jn(t.getSchema(),e.type);if(n!==void 0&&!Gn(n)){const r=e.variable.name.value,i=yt(e.type);t.reportError(new j(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:e.type}))}}}}function V1(t){let e=Object.create(null);return{OperationDefinition:{enter(){e=Object.create(null)},leave(n){const r=t.getRecursiveVariableUsages(n);for(const{node:i,type:s,defaultValue:o}of r){const a=i.name.value,l=e[a];if(l&&s){const u=t.getSchema(),d=Jn(u,l.type);if(d&&!Cj(u,d,l.defaultValue,s,o)){const h=z(d),p=z(s);t.reportError(new j(`Variable "$${a}" of type "${h}" used in position expecting type "${p}".`,{nodes:[l,i]}))}}}}},VariableDefinition(n){e[n.variable.name.value]=n}}}function Cj(t,e,n,r,i){if(Ie(r)&&!Ie(e)){if(!(n!=null&&n.kind!==k.NULL)&&!(i!==void 0))return!1;const a=r.ofType;return So(t,e,a)}return So(t,e,r)}const j1=Object.freeze([c1]),B1=Object.freeze([t1,R1,a1,N1,$v,r1,L1,w1,n1,D1,o1,d1,v1,u1,F1,f1,h1,Fv,Uv,i1,Bv,$1,_1,V1,m1,Wv,...j1]),Dj=Object.freeze([l1,M1,P1,x1,C1,A1,I1,$v,Fv,Uv,b1,s1,Bv,Wv,E1]);class U1{constructor(e,n){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(const r of this.getDocument().definitions)r.kind===k.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[e]}getFragmentSpreads(e){let n=this._fragmentSpreads.get(e);if(!n){n=[];const r=[e];let i;for(;i=r.pop();)for(const s of i.selections)s.kind===k.FRAGMENT_SPREAD?n.push(s):s.selectionSet&&r.push(s.selectionSet);this._fragmentSpreads.set(e,n)}return n}getRecursivelyReferencedFragments(e){let n=this._recursivelyReferencedFragments.get(e);if(!n){n=[];const r=Object.create(null),i=[e.selectionSet];let s;for(;s=i.pop();)for(const o of this.getFragmentSpreads(s)){const a=o.name.value;if(r[a]!==!0){r[a]=!0;const l=this.getFragment(a);l&&(n.push(l),i.push(l.selectionSet))}}this._recursivelyReferencedFragments.set(e,n)}return n}}class Rj extends U1{constructor(e,n,r){super(e,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class W1 extends U1{constructor(e,n,r,i){super(n,i),this._schema=e,this._typeInfo=r,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let n=this._variableUsages.get(e);if(!n){const r=[],i=new Cv(this._schema);hn(e,Dv(i,{VariableDefinition:()=>!1,Variable(s){r.push({node:s,type:i.getInputType(),defaultValue:i.getDefaultValue()})}})),n=r,this._variableUsages.set(e,n)}return n}getRecursiveVariableUsages(e){let n=this._recursiveVariableUsages.get(e);if(!n){n=this.getVariableUsages(e);for(const r of this.getRecursivelyReferencedFragments(e))n=n.concat(this.getVariableUsages(r));this._recursiveVariableUsages.set(e,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function q1(t,e,n=B1,r,i=new Cv(t)){var s;const o=(s=r==null?void 0:r.maxErrors)!==null&&s!==void 0?s:100;e||Be(!1,"Must provide document."),Iv(t);const a=Object.freeze({}),l=[],u=new W1(t,e,i,h=>{if(l.length>=o)throw l.push(new j("Too many validation errors, error limit reached. Validation aborted.")),a;l.push(h)}),d=cv(n.map(h=>h(u)));try{hn(e,Dv(i,d))}catch(h){if(h!==a)throw h}return l}function z1(t,e,n=Dj){const r=[],i=new Rj(t,e,o=>{r.push(o)}),s=n.map(o=>o(i));return hn(t,cv(s)),r}function Mj(t){const e=z1(t);if(e.length!==0)throw new Error(e.map(n=>n.message).join(`
83
+
84
+ `))}function Pj(t,e){const n=z1(t,e);if(n.length!==0)throw new Error(n.map(r=>r.message).join(`
85
+
86
+ `))}function Fj(t){let e;return function(r,i,s){e===void 0&&(e=new WeakMap);let o=e.get(r);o===void 0&&(o=new WeakMap,e.set(r,o));let a=o.get(i);a===void 0&&(a=new WeakMap,o.set(i,a));let l=a.get(s);return l===void 0&&(l=t(r,i,s),a.set(s,l)),l}}function Lw(t){return Promise.all(Object.values(t)).then(e=>{const n=Object.create(null);for(const[r,i]of Object.keys(t).entries())n[i]=e[r];return n})}function $j(t,e,n){let r=n;for(const i of t)r=hr(r)?r.then(s=>e(s,i)):e(r,i);return r}function Lj(t){return t instanceof Error?t:new Vj(t)}class Vj extends Error{constructor(e){super("Unexpected error value: "+z(e)),this.name="NonErrorThrown",this.thrownValue=e}}function Qa(t,e,n){var r;const i=Lj(t);return jj(i)?i:new j(i.message,{nodes:(r=i.nodes)!==null&&r!==void 0?r:e,source:i.source,positions:i.positions,path:n,originalError:i})}function jj(t){return Array.isArray(t.path)}const Bj=Fj((t,e,n)=>Nj(t.schema,t.fragments,t.variableValues,e,n));function dh(t){arguments.length<2||Be(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:e,document:n,variableValues:r,rootValue:i}=t;G1(e,n,r);const s=H1(t);if(!("schema"in s))return{errors:s};try{const{operation:o}=s,a=Uj(s,o,i);return hr(a)?a.then(l=>Of(l,s.errors),l=>(s.errors.push(l),Of(null,s.errors))):Of(a,s.errors)}catch(o){return s.errors.push(o),Of(null,s.errors)}}function Q1(t){const e=dh(t);if(hr(e))throw new Error("GraphQL execution failed to complete synchronously.");return e}function Of(t,e){return e.length===0?{data:t}:{errors:e,data:t}}function G1(t,e,n){e||Be(!1,"Must provide document."),Iv(t),n==null||pr(n)||Be(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function H1(t){var e,n;const{schema:r,document:i,rootValue:s,contextValue:o,variableValues:a,operationName:l,fieldResolver:u,typeResolver:d,subscribeFieldResolver:h}=t;let p;const g=Object.create(null);for(const _ of i.definitions)switch(_.kind){case k.OPERATION_DEFINITION:if(l==null){if(p!==void 0)return[new j("Must provide operation name if query contains multiple operations.")];p=_}else((e=_.name)===null||e===void 0?void 0:e.value)===l&&(p=_);break;case k.FRAGMENT_DEFINITION:g[_.name.value]=_;break}if(!p)return l!=null?[new j(`Unknown operation named "${l}".`)]:[new j("Must provide an operation.")];const y=(n=p.variableDefinitions)!==null&&n!==void 0?n:[],b=O1(r,y,a??{},{maxErrors:50});return b.errors?b.errors:{schema:r,fragments:g,rootValue:s,contextValue:o,operation:p,variableValues:b.coerced,fieldResolver:u??Jg,typeResolver:d??Y1,subscribeFieldResolver:h??Jg,errors:[]}}function Uj(t,e,n){const r=t.schema.getRootType(e.operation);if(r==null)throw new j(`Schema is not configured to execute ${e.operation} operation.`,{nodes:e});const i=Vv(t.schema,t.fragments,t.variableValues,r,e.selectionSet),s=void 0;switch(e.operation){case Qt.QUERY:return md(t,r,n,s,i);case Qt.MUTATION:return Wj(t,r,n,s,i);case Qt.SUBSCRIPTION:return md(t,r,n,s,i)}}function Wj(t,e,n,r,i){return $j(i.entries(),(s,[o,a])=>{const l=qa(r,o,e.name),u=K1(t,e,n,a,l);return u===void 0?s:hr(u)?u.then(d=>(s[o]=d,s)):(s[o]=u,s)},Object.create(null))}function md(t,e,n,r,i){const s=Object.create(null);let o=!1;try{for(const[a,l]of i.entries()){const u=qa(r,a,e.name),d=K1(t,e,n,l,u);d!==void 0&&(s[a]=d,hr(d)&&(o=!0))}}catch(a){if(o)return Lw(s).finally(()=>{throw a});throw a}return o?Lw(s):s}function K1(t,e,n,r,i){var s;const o=X1(t.schema,e,r[0]);if(!o)return;const a=o.type,l=(s=o.resolve)!==null&&s!==void 0?s:t.fieldResolver,u=J1(t,o,r,e,i);try{const d=fh(o,r[0],t.variableValues),h=t.contextValue,p=l(n,d,h,u);let g;return hr(p)?g=p.then(y=>Ac(t,a,r,u,i,y)):g=Ac(t,a,r,u,i,p),hr(g)?g.then(void 0,y=>{const b=Qa(y,r,Cn(i));return gd(b,a,t)}):g}catch(d){const h=Qa(d,r,Cn(i));return gd(h,a,t)}}function J1(t,e,n,r,i){return{fieldName:e.name,fieldNodes:n,returnType:e.type,parentType:r,path:i,schema:t.schema,fragments:t.fragments,rootValue:t.rootValue,operation:t.operation,variableValues:t.variableValues}}function gd(t,e,n){if(Ie(e))throw t;return n.errors.push(t),null}function Ac(t,e,n,r,i,s){if(s instanceof Error)throw s;if(Ie(e)){const o=Ac(t,e.ofType,n,r,i,s);if(o===null)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return o}if(s==null)return null;if(wt(e))return qj(t,e,n,r,i,s);if(yi(e))return zj(e,s);if(mi(e))return Qj(t,e,n,r,i,s);if(tt(e))return Kg(t,e,n,r,i,s);$t(!1,"Cannot complete value of unexpected output type: "+z(e))}function qj(t,e,n,r,i,s){if(!Ev(s))throw new j(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);const o=e.ofType;let a=!1;const l=Array.from(s,(u,d)=>{const h=qa(i,d,void 0);try{let p;return hr(u)?p=u.then(g=>Ac(t,o,n,r,h,g)):p=Ac(t,o,n,r,h,u),hr(p)?(a=!0,p.then(void 0,g=>{const y=Qa(g,n,Cn(h));return gd(y,o,t)})):p}catch(p){const g=Qa(p,n,Cn(h));return gd(g,o,t)}});return a?Promise.all(l):l}function zj(t,e){const n=t.serialize(e);if(n==null)throw new Error(`Expected \`${z(t)}.serialize(${z(e)})\` to return non-nullable value, returned: ${z(n)}`);return n}function Qj(t,e,n,r,i,s){var o;const a=(o=e.resolveType)!==null&&o!==void 0?o:t.typeResolver,l=t.contextValue,u=a(s,l,r,e);return hr(u)?u.then(d=>Kg(t,Vw(d,t,e,n,r,s),n,r,i,s)):Kg(t,Vw(u,t,e,n,r,s),n,r,i,s)}function Vw(t,e,n,r,i,s){if(t==null)throw new j(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if(tt(t))throw new j("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if(typeof t!="string")throw new j(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${z(s)}, received "${z(t)}".`);const o=e.schema.getType(t);if(o==null)throw new j(`Abstract type "${n.name}" was resolved to a type "${t}" that does not exist inside the schema.`,{nodes:r});if(!tt(o))throw new j(`Abstract type "${n.name}" was resolved to a non-object type "${t}".`,{nodes:r});if(!e.schema.isSubType(n,o))throw new j(`Runtime Object type "${o.name}" is not a possible type for "${n.name}".`,{nodes:r});return o}function Kg(t,e,n,r,i,s){const o=Bj(t,e,n);if(e.isTypeOf){const a=e.isTypeOf(s,t.contextValue,r);if(hr(a))return a.then(l=>{if(!l)throw jw(e,s,n);return md(t,e,s,i,o)});if(!a)throw jw(e,s,n)}return md(t,e,s,i,o)}function jw(t,e,n){return new j(`Expected value of type "${t.name}" but got: ${z(e)}.`,{nodes:n})}const Y1=function(t,e,n,r){if(pr(t)&&typeof t.__typename=="string")return t.__typename;const i=n.schema.getPossibleTypes(r),s=[];for(let o=0;o<i.length;o++){const a=i[o];if(a.isTypeOf){const l=a.isTypeOf(t,e,n);if(hr(l))s[o]=l;else if(l)return a.name}}if(s.length)return Promise.all(s).then(o=>{for(let a=0;a<o.length;a++)if(o[a])return i[a].name})},Jg=function(t,e,n,r){if(pr(t)||typeof t=="function"){const i=t[r.fieldName];return typeof i=="function"?t[r.fieldName](e,n,r):i}};function X1(t,e,n){const r=n.name.value;return r===Oc.name&&t.getQueryType()===e?Oc:r===kc.name&&t.getQueryType()===e?kc:r===Nc.name?Nc:e.getFields()[r]}function Gj(t){return new Promise(e=>e(Z1(t)))}function Hj(t){const e=Z1(t);if(hr(e))throw new Error("GraphQL execution failed to complete synchronously.");return e}function Z1(t){arguments.length<2||Be(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:e,source:n,rootValue:r,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:l}=t,u=Av(e);if(u.length>0)return{errors:u};let d;try{d=Kc(n)}catch(p){return{errors:[p]}}const h=q1(e,d);return h.length>0?{errors:h}:dh({schema:e,document:d,rootValue:r,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:l})}function eN(t){return typeof(t==null?void 0:t[Symbol.asyncIterator])=="function"}function Kj(t,e){const n=t[Symbol.asyncIterator]();async function r(i){if(i.done)return i;try{return{value:await e(i.value),done:!1}}catch(s){if(typeof n.return=="function")try{await n.return()}catch{}throw s}}return{async next(){return r(await n.next())},async return(){return typeof n.return=="function"?r(await n.return()):{value:void 0,done:!0}},async throw(i){if(typeof n.throw=="function")return r(await n.throw(i));throw i},[Symbol.asyncIterator](){return this}}}async function Jj(t){arguments.length<2||Be(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const e=await tN(t);return eN(e)?Kj(e,r=>dh({...t,rootValue:r})):e}function Yj(t){const e=t[0];return e&&"document"in e?e:{schema:e,document:t[1],rootValue:t[2],contextValue:t[3],variableValues:t[4],operationName:t[5],subscribeFieldResolver:t[6]}}async function tN(...t){const e=Yj(t),{schema:n,document:r,variableValues:i}=e;G1(n,r,i);const s=H1(e);if(!("schema"in s))return{errors:s};try{const o=await Xj(s);if(!eN(o))throw new Error(`Subscription field must return Async Iterable. Received: ${z(o)}.`);return o}catch(o){if(o instanceof j)return{errors:[o]};throw o}}async function Xj(t){const{schema:e,fragments:n,operation:r,variableValues:i,rootValue:s}=t,o=e.getSubscriptionType();if(o==null)throw new j("Schema is not configured to execute subscription operation.",{nodes:r});const a=Vv(e,n,i,o,r.selectionSet),[l,u]=[...a.entries()][0],d=X1(e,o,u[0]);if(!d){const y=u[0].name.value;throw new j(`The subscription field "${y}" is not defined.`,{nodes:u})}const h=qa(void 0,l,o.name),p=J1(t,d,u,o,h);try{var g;const y=fh(d,u[0],i),b=t.contextValue,w=await((g=d.subscribe)!==null&&g!==void 0?g:t.subscribeFieldResolver)(s,y,b,p);if(w instanceof Error)throw w;return w}catch(y){throw Qa(y,u,Cn(h))}}function Zj(t){return{Field(e){const n=t.getFieldDef(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){const i=t.getParentType();i!=null||$t(!1),t.reportError(new j(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:e}))}},Argument(e){const n=t.getArgument(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){const i=t.getDirective();if(i!=null)t.reportError(new j(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:e}));else{const s=t.getParentType(),o=t.getFieldDef();s!=null&&o!=null||$t(!1),t.reportError(new j(`Field "${s.name}.${o.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:e}))}}},ObjectField(e){const n=Dn(t.getParentInputType());if(vt(n)){const r=n.getFields()[e.name.value],i=r==null?void 0:r.deprecationReason;i!=null&&t.reportError(new j(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:e}))}},EnumValue(e){const n=t.getEnumValue(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){const i=Dn(t.getInputType());i!=null||$t(!1),t.reportError(new j(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:e}))}}}}function eB(t){return{Field(e){const n=Dn(t.getType());n&&Wo(n)&&t.reportError(new j(`GraphQL introspection has been disabled, but the requested query contained the field "${e.name.value}".`,{nodes:e}))}}}function nN(t){const e={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...t},n=e.descriptions?"description":"",r=e.specifiedByUrl?"specifiedByURL":"",i=e.directiveIsRepeatable?"isRepeatable":"",s=e.schemaDescription?n:"";function o(l){return e.inputValueDeprecation?l:""}const a=e.oneOf?"isOneOf":"";return`
87
+ query IntrospectionQuery {
88
+ __schema {
89
+ ${s}
90
+ queryType { name }
91
+ mutationType { name }
92
+ subscriptionType { name }
93
+ types {
94
+ ...FullType
95
+ }
96
+ directives {
97
+ name
98
+ ${n}
99
+ ${i}
100
+ locations
101
+ args${o("(includeDeprecated: true)")} {
102
+ ...InputValue
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ fragment FullType on __Type {
109
+ kind
110
+ name
111
+ ${n}
112
+ ${r}
113
+ ${a}
114
+ fields(includeDeprecated: true) {
115
+ name
116
+ ${n}
117
+ args${o("(includeDeprecated: true)")} {
118
+ ...InputValue
119
+ }
120
+ type {
121
+ ...TypeRef
122
+ }
123
+ isDeprecated
124
+ deprecationReason
125
+ }
126
+ inputFields${o("(includeDeprecated: true)")} {
127
+ ...InputValue
128
+ }
129
+ interfaces {
130
+ ...TypeRef
131
+ }
132
+ enumValues(includeDeprecated: true) {
133
+ name
134
+ ${n}
135
+ isDeprecated
136
+ deprecationReason
137
+ }
138
+ possibleTypes {
139
+ ...TypeRef
140
+ }
141
+ }
142
+
143
+ fragment InputValue on __InputValue {
144
+ name
145
+ ${n}
146
+ type { ...TypeRef }
147
+ defaultValue
148
+ ${o("isDeprecated")}
149
+ ${o("deprecationReason")}
150
+ }
151
+
152
+ fragment TypeRef on __Type {
153
+ kind
154
+ name
155
+ ofType {
156
+ kind
157
+ name
158
+ ofType {
159
+ kind
160
+ name
161
+ ofType {
162
+ kind
163
+ name
164
+ ofType {
165
+ kind
166
+ name
167
+ ofType {
168
+ kind
169
+ name
170
+ ofType {
171
+ kind
172
+ name
173
+ ofType {
174
+ kind
175
+ name
176
+ ofType {
177
+ kind
178
+ name
179
+ ofType {
180
+ kind
181
+ name
182
+ }
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+ }
189
+ }
190
+ }
191
+ }
192
+ `}function tB(t,e){let n=null;for(const i of t.definitions)if(i.kind===k.OPERATION_DEFINITION){var r;if(e==null){if(n)return null;n=i}else if(((r=i.name)===null||r===void 0?void 0:r.value)===e)return i}return n}function nB(t,e){if(e.operation==="query"){const n=t.getQueryType();if(!n)throw new j("Schema does not define the required query root type.",{nodes:e});return n}if(e.operation==="mutation"){const n=t.getMutationType();if(!n)throw new j("Schema is not configured for mutations.",{nodes:e});return n}if(e.operation==="subscription"){const n=t.getSubscriptionType();if(!n)throw new j("Schema is not configured for subscriptions.",{nodes:e});return n}throw new j("Can only have query, mutation and subscription operations.",{nodes:e})}function rB(t,e){const n={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,oneOf:!0,...e},r=Kc(nN(n)),i=Q1({schema:t,document:r});return!i.errors&&i.data||$t(!1),i.data}function iB(t,e){pr(t)&&pr(t.__schema)||Be(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${z(t)}.`);const n=t.__schema,r=Ss(n.types,x=>x.name,x=>p(x));for(const x of[...eu,...ru])r[x.name]&&(r[x.name]=x);const i=n.queryType?d(n.queryType):null,s=n.mutationType?d(n.mutationType):null,o=n.subscriptionType?d(n.subscriptionType):null,a=n.directives?n.directives.map(Q):[];return new il({description:n.description,query:i,mutation:s,subscription:o,types:Object.values(r),directives:a,assumeValid:e==null?void 0:e.assumeValid});function l(x){if(x.kind===ft.LIST){const U=x.ofType;if(!U)throw new Error("Decorated type deeper than introspection query.");return new dn(l(U))}if(x.kind===ft.NON_NULL){const U=x.ofType;if(!U)throw new Error("Decorated type deeper than introspection query.");const Te=l(U);return new je(zk(Te))}return u(x)}function u(x){const U=x.name;if(!U)throw new Error(`Unknown type reference: ${z(x)}.`);const Te=r[U];if(!Te)throw new Error(`Invalid or incomplete schema, unknown type: ${U}. Ensure that a full introspection query is used in order to build a client schema.`);return Te}function d(x){return Wk(u(x))}function h(x){return qk(u(x))}function p(x){if(x!=null&&x.name!=null&&x.kind!=null)switch(x.kind){case ft.SCALAR:return g(x);case ft.OBJECT:return b(x);case ft.INTERFACE:return _(x);case ft.UNION:return w(x);case ft.ENUM:return O(x);case ft.INPUT_OBJECT:return N(x)}const U=z(x);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${U}.`)}function g(x){return new bi({name:x.name,description:x.description,specifiedByURL:x.specifiedByURL})}function y(x){if(x.interfaces===null&&x.kind===ft.INTERFACE)return[];if(!x.interfaces){const U=z(x);throw new Error(`Introspection result missing interfaces: ${U}.`)}return x.interfaces.map(h)}function b(x){return new Lr({name:x.name,description:x.description,interfaces:()=>y(x),fields:()=>I(x)})}function _(x){return new Ba({name:x.name,description:x.description,interfaces:()=>y(x),fields:()=>I(x)})}function w(x){if(!x.possibleTypes){const U=z(x);throw new Error(`Introspection result missing possibleTypes: ${U}.`)}return new Ua({name:x.name,description:x.description,types:()=>x.possibleTypes.map(d)})}function O(x){if(!x.enumValues){const U=z(x);throw new Error(`Introspection result missing enumValues: ${U}.`)}return new Fs({name:x.name,description:x.description,values:Ss(x.enumValues,U=>U.name,U=>({description:U.description,deprecationReason:U.deprecationReason}))})}function N(x){if(!x.inputFields){const U=z(x);throw new Error(`Introspection result missing inputFields: ${U}.`)}return new Wa({name:x.name,description:x.description,fields:()=>M(x.inputFields),isOneOf:x.isOneOf})}function I(x){if(!x.fields)throw new Error(`Introspection result missing fields: ${z(x)}.`);return Ss(x.fields,U=>U.name,P)}function P(x){const U=l(x.type);if(!Cs(U)){const Te=z(U);throw new Error(`Introspection must provide output type for fields, but received: ${Te}.`)}if(!x.args){const Te=z(x);throw new Error(`Introspection result missing field args: ${Te}.`)}return{description:x.description,deprecationReason:x.deprecationReason,type:U,args:M(x.args)}}function M(x){return Ss(x,U=>U.name,B)}function B(x){const U=l(x.type);if(!Gn(U)){const ke=z(U);throw new Error(`Introspection must provide input type for arguments, but received: ${ke}.`)}const Te=x.defaultValue!=null?di(jk(x.defaultValue),U):void 0;return{description:x.description,type:U,defaultValue:Te,deprecationReason:x.deprecationReason}}function Q(x){if(!x.args){const U=z(x);throw new Error(`Introspection result missing directive args: ${U}.`)}if(!x.locations){const U=z(x);throw new Error(`Introspection result missing directive locations: ${U}.`)}return new Zr({name:x.name,description:x.description,isRepeatable:x.isRepeatable,locations:x.locations.slice(),args:M(x.args)})}}function sB(t,e,n){Nv(t),e!=null&&e.kind===k.DOCUMENT||Be(!1,"Must provide valid Document AST."),(n==null?void 0:n.assumeValid)!==!0&&(n==null?void 0:n.assumeValidSDL)!==!0&&Pj(e,t);const r=t.toConfig(),i=rN(r,e,n);return r===i?t:new il(i)}function rN(t,e,n){var r,i,s,o;const a=[],l=Object.create(null),u=[];let d;const h=[];for(const L of e.definitions)if(L.kind===k.SCHEMA_DEFINITION)d=L;else if(L.kind===k.SCHEMA_EXTENSION)h.push(L);else if(sl(L))a.push(L);else if(ch(L)){const te=L.name.value,X=l[te];l[te]=X?X.concat([L]):[L]}else L.kind===k.DIRECTIVE_DEFINITION&&u.push(L);if(Object.keys(l).length===0&&a.length===0&&u.length===0&&h.length===0&&d==null)return t;const p=Object.create(null);for(const L of t.types)p[L.name]=O(L);for(const L of a){var g;const te=L.name.value;p[te]=(g=Bw[te])!==null&&g!==void 0?g:Ne(L)}const y={query:t.query&&_(t.query),mutation:t.mutation&&_(t.mutation),subscription:t.subscription&&_(t.subscription),...d&&Te([d]),...Te(h)};return{description:(r=d)===null||r===void 0||(i=r.description)===null||i===void 0?void 0:i.value,...y,types:Object.values(p),directives:[...t.directives.map(w),...u.map(Ce)],extensions:Object.create(null),astNode:(s=d)!==null&&s!==void 0?s:t.astNode,extensionASTNodes:t.extensionASTNodes.concat(h),assumeValid:(o=n==null?void 0:n.assumeValid)!==null&&o!==void 0?o:!1};function b(L){return wt(L)?new dn(b(L.ofType)):Ie(L)?new je(b(L.ofType)):_(L)}function _(L){return p[L.name]}function w(L){const te=L.toConfig();return new Zr({...te,args:ji(te.args,U)})}function O(L){if(Wo(L)||sh(L))return L;if(gr(L))return P(L);if(tt(L))return M(L);if(at(L))return B(L);if(Gt(L))return Q(L);if(jt(L))return I(L);if(vt(L))return N(L);$t(!1,"Unexpected type: "+z(L))}function N(L){var te;const X=L.toConfig(),ne=(te=l[X.name])!==null&&te!==void 0?te:[];return new Wa({...X,fields:()=>({...ji(X.fields,be=>({...be,type:b(be.type)})),...fe(ne)}),extensionASTNodes:X.extensionASTNodes.concat(ne)})}function I(L){var te;const X=L.toConfig(),ne=(te=l[L.name])!==null&&te!==void 0?te:[];return new Fs({...X,values:{...X.values,...ve(ne)},extensionASTNodes:X.extensionASTNodes.concat(ne)})}function P(L){var te;const X=L.toConfig(),ne=(te=l[X.name])!==null&&te!==void 0?te:[];let be=X.specifiedByURL;for(const Ke of ne){var Re;be=(Re=Uw(Ke))!==null&&Re!==void 0?Re:be}return new bi({...X,specifiedByURL:be,extensionASTNodes:X.extensionASTNodes.concat(ne)})}function M(L){var te;const X=L.toConfig(),ne=(te=l[X.name])!==null&&te!==void 0?te:[];return new Lr({...X,interfaces:()=>[...L.getInterfaces().map(_),...Se(ne)],fields:()=>({...ji(X.fields,x),...ee(ne)}),extensionASTNodes:X.extensionASTNodes.concat(ne)})}function B(L){var te;const X=L.toConfig(),ne=(te=l[X.name])!==null&&te!==void 0?te:[];return new Ba({...X,interfaces:()=>[...L.getInterfaces().map(_),...Se(ne)],fields:()=>({...ji(X.fields,x),...ee(ne)}),extensionASTNodes:X.extensionASTNodes.concat(ne)})}function Q(L){var te;const X=L.toConfig(),ne=(te=l[X.name])!==null&&te!==void 0?te:[];return new Ua({...X,types:()=>[...L.getTypes().map(_),...dt(ne)],extensionASTNodes:X.extensionASTNodes.concat(ne)})}function x(L){return{...L,type:b(L.type),args:L.args&&ji(L.args,U)}}function U(L){return{...L,type:b(L.type)}}function Te(L){const te={};for(const ne of L){var X;const be=(X=ne.operationTypes)!==null&&X!==void 0?X:[];for(const Re of be)te[Re.operation]=ke(Re.type)}return te}function ke(L){var te;const X=L.name.value,ne=(te=Bw[X])!==null&&te!==void 0?te:p[X];if(ne===void 0)throw new Error(`Unknown type: "${X}".`);return ne}function he(L){return L.kind===k.LIST_TYPE?new dn(he(L.type)):L.kind===k.NON_NULL_TYPE?new je(he(L.type)):ke(L)}function Ce(L){var te;return new Zr({name:L.name.value,description:(te=L.description)===null||te===void 0?void 0:te.value,locations:L.locations.map(({value:X})=>X),isRepeatable:L.repeatable,args:Ae(L.arguments),astNode:L})}function ee(L){const te=Object.create(null);for(const be of L){var X;const Re=(X=be.fields)!==null&&X!==void 0?X:[];for(const Ke of Re){var ne;te[Ke.name.value]={type:he(Ke.type),description:(ne=Ke.description)===null||ne===void 0?void 0:ne.value,args:Ae(Ke.arguments),deprecationReason:kf(Ke),astNode:Ke}}}return te}function Ae(L){const te=L??[],X=Object.create(null);for(const be of te){var ne;const Re=he(be.type);X[be.name.value]={type:Re,description:(ne=be.description)===null||ne===void 0?void 0:ne.value,defaultValue:di(be.defaultValue,Re),deprecationReason:kf(be),astNode:be}}return X}function fe(L){const te=Object.create(null);for(const be of L){var X;const Re=(X=be.fields)!==null&&X!==void 0?X:[];for(const Ke of Re){var ne;const Kt=he(Ke.type);te[Ke.name.value]={type:Kt,description:(ne=Ke.description)===null||ne===void 0?void 0:ne.value,defaultValue:di(Ke.defaultValue,Kt),deprecationReason:kf(Ke),astNode:Ke}}}return te}function ve(L){const te=Object.create(null);for(const be of L){var X;const Re=(X=be.values)!==null&&X!==void 0?X:[];for(const Ke of Re){var ne;te[Ke.name.value]={description:(ne=Ke.description)===null||ne===void 0?void 0:ne.value,deprecationReason:kf(Ke),astNode:Ke}}}return te}function Se(L){return L.flatMap(te=>{var X,ne;return(X=(ne=te.interfaces)===null||ne===void 0?void 0:ne.map(ke))!==null&&X!==void 0?X:[]})}function dt(L){return L.flatMap(te=>{var X,ne;return(X=(ne=te.types)===null||ne===void 0?void 0:ne.map(ke))!==null&&X!==void 0?X:[]})}function Ne(L){var te;const X=L.name.value,ne=(te=l[X])!==null&&te!==void 0?te:[];switch(L.kind){case k.OBJECT_TYPE_DEFINITION:{var be;const Bt=[L,...ne];return new Lr({name:X,description:(be=L.description)===null||be===void 0?void 0:be.value,interfaces:()=>Se(Bt),fields:()=>ee(Bt),astNode:L,extensionASTNodes:ne})}case k.INTERFACE_TYPE_DEFINITION:{var Re;const Bt=[L,...ne];return new Ba({name:X,description:(Re=L.description)===null||Re===void 0?void 0:Re.value,interfaces:()=>Se(Bt),fields:()=>ee(Bt),astNode:L,extensionASTNodes:ne})}case k.ENUM_TYPE_DEFINITION:{var Ke;const Bt=[L,...ne];return new Fs({name:X,description:(Ke=L.description)===null||Ke===void 0?void 0:Ke.value,values:ve(Bt),astNode:L,extensionASTNodes:ne})}case k.UNION_TYPE_DEFINITION:{var Kt;const Bt=[L,...ne];return new Ua({name:X,description:(Kt=L.description)===null||Kt===void 0?void 0:Kt.value,types:()=>dt(Bt),astNode:L,extensionASTNodes:ne})}case k.SCALAR_TYPE_DEFINITION:{var ri;return new bi({name:X,description:(ri=L.description)===null||ri===void 0?void 0:ri.value,specifiedByURL:Uw(L),astNode:L,extensionASTNodes:ne})}case k.INPUT_OBJECT_TYPE_DEFINITION:{var ii;const Bt=[L,...ne];return new Wa({name:X,description:(ii=L.description)===null||ii===void 0?void 0:ii.value,fields:()=>fe(Bt),astNode:L,extensionASTNodes:ne,isOneOf:oB(L)})}}}}const Bw=Qi([...eu,...ru],t=>t.name);function kf(t){const e=za(ah,t);return e==null?void 0:e.reason}function Uw(t){const e=za(vv,t);return e==null?void 0:e.url}function oB(t){return!!za(bv,t)}function iN(t,e){t!=null&&t.kind===k.DOCUMENT||Be(!1,"Must provide valid Document AST."),(e==null?void 0:e.assumeValid)!==!0&&(e==null?void 0:e.assumeValidSDL)!==!0&&Mj(t);const r=rN({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},t,e);if(r.astNode==null)for(const s of r.types)switch(s.name){case"Query":r.query=s;break;case"Mutation":r.mutation=s;break;case"Subscription":r.subscription=s;break}const i=[...r.directives,...zs.filter(s=>r.directives.every(o=>o.name!==s.name))];return new il({...r,directives:i})}function aB(t,e){const n=Kc(t,{noLocation:e==null?void 0:e.noLocation,allowLegacyFragmentVariables:e==null?void 0:e.allowLegacyFragmentVariables});return iN(n,{assumeValidSDL:e==null?void 0:e.assumeValidSDL,assumeValid:e==null?void 0:e.assumeValid})}function lB(t){const e=t.toConfig(),n=Ss(Dm(e.types),p=>p.name,h);return new il({...e,types:Object.values(n),directives:Dm(e.directives).map(o),query:s(e.query),mutation:s(e.mutation),subscription:s(e.subscription)});function r(p){return wt(p)?new dn(r(p.ofType)):Ie(p)?new je(r(p.ofType)):i(p)}function i(p){return n[p.name]}function s(p){return p&&i(p)}function o(p){const g=p.toConfig();return new Zr({...g,locations:sN(g.locations,y=>y),args:a(g.args)})}function a(p){return Nf(p,g=>({...g,type:r(g.type)}))}function l(p){return Nf(p,g=>({...g,type:r(g.type),args:g.args&&a(g.args)}))}function u(p){return Nf(p,g=>({...g,type:r(g.type)}))}function d(p){return Dm(p).map(i)}function h(p){if(gr(p)||Wo(p))return p;if(tt(p)){const g=p.toConfig();return new Lr({...g,interfaces:()=>d(g.interfaces),fields:()=>l(g.fields)})}if(at(p)){const g=p.toConfig();return new Ba({...g,interfaces:()=>d(g.interfaces),fields:()=>l(g.fields)})}if(Gt(p)){const g=p.toConfig();return new Ua({...g,types:()=>d(g.types)})}if(jt(p)){const g=p.toConfig();return new Fs({...g,values:Nf(g.values,y=>y)})}if(vt(p)){const g=p.toConfig();return new Wa({...g,fields:()=>u(g.fields)})}$t(!1,"Unexpected type: "+z(p))}}function Nf(t,e){const n=Object.create(null);for(const r of Object.keys(t).sort(Jc))n[r]=e(t[r]);return n}function Dm(t){return sN(t,e=>e.name)}function sN(t,e){return t.slice().sort((n,r)=>{const i=e(n),s=e(r);return Jc(i,s)})}function cB(t){return oN(t,e=>!_v(e),fB)}function uB(t){return oN(t,_v,Wo)}function fB(t){return!sh(t)&&!Wo(t)}function oN(t,e,n){const r=t.getDirectives().filter(e),i=Object.values(t.getTypeMap()).filter(n);return[dB(t),...r.map(s=>_B(s)),...i.map(s=>aN(s))].filter(Boolean).join(`
193
+
194
+ `)}function dB(t){if(t.description==null&&hB(t))return;const e=[],n=t.getQueryType();n&&e.push(` query: ${n.name}`);const r=t.getMutationType();r&&e.push(` mutation: ${r.name}`);const i=t.getSubscriptionType();return i&&e.push(` subscription: ${i.name}`),Vr(t)+`schema {
195
+ ${e.join(`
196
+ `)}
197
+ }`}function hB(t){const e=t.getQueryType();if(e&&e.name!=="Query")return!1;const n=t.getMutationType();if(n&&n.name!=="Mutation")return!1;const r=t.getSubscriptionType();return!(r&&r.name!=="Subscription")}function aN(t){if(gr(t))return pB(t);if(tt(t))return mB(t);if(at(t))return gB(t);if(Gt(t))return yB(t);if(jt(t))return vB(t);if(vt(t))return bB(t);$t(!1,"Unexpected type: "+z(t))}function pB(t){return Vr(t)+`scalar ${t.name}`+EB(t)}function lN(t){const e=t.getInterfaces();return e.length?" implements "+e.map(n=>n.name).join(" & "):""}function mB(t){return Vr(t)+`type ${t.name}`+lN(t)+cN(t)}function gB(t){return Vr(t)+`interface ${t.name}`+lN(t)+cN(t)}function yB(t){const e=t.getTypes(),n=e.length?" = "+e.join(" | "):"";return Vr(t)+"union "+t.name+n}function vB(t){const e=t.getValues().map((n,r)=>Vr(n," ",!r)+" "+n.name+zv(n.deprecationReason));return Vr(t)+`enum ${t.name}`+qv(e)}function bB(t){const e=Object.values(t.getFields()).map((n,r)=>Vr(n," ",!r)+" "+Yg(n));return Vr(t)+`input ${t.name}`+(t.isOneOf?" @oneOf":"")+qv(e)}function cN(t){const e=Object.values(t.getFields()).map((n,r)=>Vr(n," ",!r)+" "+n.name+uN(n.args," ")+": "+String(n.type)+zv(n.deprecationReason));return qv(e)}function qv(t){return t.length!==0?` {
198
+ `+t.join(`
199
+ `)+`
200
+ }`:""}function uN(t,e=""){return t.length===0?"":t.every(n=>!n.description)?"("+t.map(Yg).join(", ")+")":`(
201
+ `+t.map((n,r)=>Vr(n," "+e,!r)+" "+e+Yg(n)).join(`
202
+ `)+`
203
+ `+e+")"}function Yg(t){const e=ks(t.defaultValue,t.type);let n=t.name+": "+String(t.type);return e&&(n+=` = ${yt(e)}`),n+zv(t.deprecationReason)}function _B(t){return Vr(t)+"directive @"+t.name+uN(t.args)+(t.isRepeatable?" repeatable":"")+" on "+t.locations.join(" | ")}function zv(t){return t==null?"":t!==yv?` @deprecated(reason: ${yt({kind:k.STRING,value:t})})`:" @deprecated"}function EB(t){return t.specifiedByURL==null?"":` @specifiedBy(url: ${yt({kind:k.STRING,value:t.specifiedByURL})})`}function Vr(t,e="",n=!0){const{description:r}=t;if(r==null)return"";const i=yt({kind:k.STRING,value:r,block:tV(r)});return(e&&!n?`
204
+ `+e:e)+i.replace(/\n/g,`
205
+ `+e)+`
206
+ `}function wB(t){const e=[];for(const n of t)e.push(...n.definitions);return{kind:k.DOCUMENT,definitions:e}}function TB(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]=Ww(i.selectionSet);break}const r=Object.create(null);for(const i of e){const s=new Set;for(const a of Ww(i.selectionSet))fN(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 fN(t,e,n){if(!t.has(n)){t.add(n);const r=e[n];if(r!==void 0)for(const i of r)fN(t,e,i)}}function Ww(t){const e=[];return hn(t,{FragmentSpread(n){e.push(n.name.value)}}),e}function SB(t){const e=Vk(t)?t:new nh(t),n=e.body,r=new lv(e);let i="",s=!1;for(;r.advance().kind!==q.EOF;){const o=r.token,a=o.kind,l=!Pk(o.kind);s&&(l||o.kind===q.SPREAD)&&(i+=" ");const u=n.slice(o.start,o.end);a===q.BLOCK_STRING?i+=Mk(o.value,{minimize:!0}):i+=u,s=l}return i}function OB(t){const e=dN(t);if(e)throw e;return t}function dN(t){if(typeof t=="string"||Be(!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{mr(t)}catch(e){return e}}var Ct;(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"})(Ct||(Ct={}));var Xr;(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"})(Xr||(Xr={}));function kB(t,e){return hN(t,e).filter(n=>n.type in Ct)}function NB(t,e){return hN(t,e).filter(n=>n.type in Xr)}function hN(t,e){return[...IB(t,e),...AB(t,e)]}function AB(t,e){const n=[],r=Gi(t.getDirectives(),e.getDirectives());for(const i of r.removed)n.push({type:Ct.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(const[i,s]of r.persisted){const o=Gi(i.args,s.args);for(const a of o.added)qs(a)&&n.push({type:Ct.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:Ct.DIRECTIVE_ARG_REMOVED,description:`${a.name} was removed from ${i.name}.`});i.isRepeatable&&!s.isRepeatable&&n.push({type:Ct.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(const a of i.locations)s.locations.includes(a)||n.push({type:Ct.DIRECTIVE_LOCATION_REMOVED,description:`${a} was removed from ${i.name}.`})}return n}function IB(t,e){const n=[],r=Gi(Object.values(t.getTypeMap()),Object.values(e.getTypeMap()));for(const i of r.removed)n.push({type:Ct.TYPE_REMOVED,description:sh(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(const[i,s]of r.persisted)jt(i)&&jt(s)?n.push(...DB(i,s)):Gt(i)&&Gt(s)?n.push(...CB(i,s)):vt(i)&&vt(s)?n.push(...xB(i,s)):tt(i)&&tt(s)?n.push(...zw(i,s),...qw(i,s)):at(i)&&at(s)?n.push(...zw(i,s),...qw(i,s)):i.constructor!==s.constructor&&n.push({type:Ct.TYPE_CHANGED_KIND,description:`${i.name} changed from ${Qw(i)} to ${Qw(s)}.`});return n}function xB(t,e){const n=[],r=Gi(Object.values(t.getFields()),Object.values(e.getFields()));for(const i of r.added)ih(i)?n.push({type:Ct.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${t.name} was added.`}):n.push({type:Xr.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:Ct.FIELD_REMOVED,description:`${t.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)dc(i.type,s.type)||n.push({type:Ct.FIELD_CHANGED_KIND,description:`${t.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function CB(t,e){const n=[],r=Gi(t.getTypes(),e.getTypes());for(const i of r.added)n.push({type:Xr.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${t.name}.`});for(const i of r.removed)n.push({type:Ct.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${t.name}.`});return n}function DB(t,e){const n=[],r=Gi(t.getValues(),e.getValues());for(const i of r.added)n.push({type:Xr.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${t.name}.`});for(const i of r.removed)n.push({type:Ct.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${t.name}.`});return n}function qw(t,e){const n=[],r=Gi(t.getInterfaces(),e.getInterfaces());for(const i of r.added)n.push({type:Xr.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${t.name}.`});for(const i of r.removed)n.push({type:Ct.IMPLEMENTED_INTERFACE_REMOVED,description:`${t.name} no longer implements interface ${i.name}.`});return n}function zw(t,e){const n=[],r=Gi(Object.values(t.getFields()),Object.values(e.getFields()));for(const i of r.removed)n.push({type:Ct.FIELD_REMOVED,description:`${t.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)n.push(...RB(t,i,s)),ac(i.type,s.type)||n.push({type:Ct.FIELD_CHANGED_KIND,description:`${t.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function RB(t,e,n){const r=[],i=Gi(e.args,n.args);for(const s of i.removed)r.push({type:Ct.ARG_REMOVED,description:`${t.name}.${e.name} arg ${s.name} was removed.`});for(const[s,o]of i.persisted)if(!dc(s.type,o.type))r.push({type:Ct.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:Xr.ARG_DEFAULT_VALUE_CHANGE,description:`${t.name}.${e.name} arg ${s.name} defaultValue was removed.`});else{const l=Gw(s.defaultValue,s.type),u=Gw(o.defaultValue,o.type);l!==u&&r.push({type:Xr.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)qs(s)?r.push({type:Ct.REQUIRED_ARG_ADDED,description:`A required arg ${s.name} on ${t.name}.${e.name} was added.`}):r.push({type:Xr.OPTIONAL_ARG_ADDED,description:`An optional arg ${s.name} on ${t.name}.${e.name} was added.`});return r}function ac(t,e){return wt(t)?wt(e)&&ac(t.ofType,e.ofType)||Ie(e)&&ac(t,e.ofType):Ie(t)?Ie(e)&&ac(t.ofType,e.ofType):Zc(e)&&t.name===e.name||Ie(e)&&ac(t,e.ofType)}function dc(t,e){return wt(t)?wt(e)&&dc(t.ofType,e.ofType):Ie(t)?Ie(e)&&dc(t.ofType,e.ofType)||!Ie(e)&&dc(t.ofType,e):Zc(e)&&t.name===e.name}function Qw(t){if(gr(t))return"a Scalar type";if(tt(t))return"an Object type";if(at(t))return"an Interface type";if(Gt(t))return"a Union type";if(jt(t))return"an Enum type";if(vt(t))return"an Input type";$t(!1,"Unexpected type: "+z(t))}function Gw(t,e){const n=ks(t,e);return n!=null||$t(!1),yt(uh(n))}function Gi(t,e){const n=[],r=[],i=[],s=Qi(t,({name:a})=>a),o=Qi(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 MB=Object.freeze(Object.defineProperty({__proto__:null,BREAK:Os,get BreakingChangeType(){return Ct},DEFAULT_DEPRECATION_REASON:yv,get DangerousChangeType(){return Xr},get DirectiveLocation(){return me},ExecutableDefinitionsRule:t1,FieldsOnCorrectTypeRule:n1,FragmentsOnCompositeTypesRule:r1,GRAPHQL_MAX_INT:qf,GRAPHQL_MIN_INT:zf,GraphQLBoolean:Hn,GraphQLDeprecatedDirective:ah,GraphQLDirective:Zr,GraphQLEnumType:Fs,GraphQLError:j,GraphQLFloat:Xk,GraphQLID:pv,GraphQLIncludeDirective:mv,GraphQLInputObjectType:Wa,GraphQLInt:Yk,GraphQLInterfaceType:Ba,GraphQLList:dn,GraphQLNonNull:je,GraphQLObjectType:Lr,GraphQLOneOfDirective:bv,GraphQLScalarType:bi,GraphQLSchema:il,GraphQLSkipDirective:gv,GraphQLSpecifiedByDirective:vv,GraphQLString:Dt,GraphQLUnionType:Ua,get Kind(){return k},KnownArgumentNamesRule:i1,KnownDirectivesRule:Fv,KnownFragmentNamesRule:o1,KnownTypeNamesRule:$v,Lexer:lv,Location:xk,LoneAnonymousOperationRule:a1,LoneSchemaDefinitionRule:l1,MaxIntrospectionDepthRule:c1,NoDeprecatedCustomRule:Zj,NoFragmentCyclesRule:u1,NoSchemaIntrospectionCustomRule:eB,NoUndefinedVariablesRule:f1,NoUnusedFragmentsRule:d1,NoUnusedVariablesRule:h1,get OperationTypeNode(){return Qt},OverlappingFieldsCanBeMergedRule:m1,PossibleFragmentSpreadsRule:v1,PossibleTypeExtensionsRule:b1,ProvidedRequiredArgumentsRule:_1,ScalarLeafsRule:w1,SchemaMetaFieldDef:Oc,SingleFieldSubscriptionsRule:N1,Source:nh,Token:ov,get TokenKind(){return q},TypeInfo:Cv,get TypeKind(){return ft},TypeMetaFieldDef:kc,TypeNameMetaFieldDef:Nc,UniqueArgumentDefinitionNamesRule:A1,UniqueArgumentNamesRule:Bv,UniqueDirectiveNamesRule:I1,UniqueDirectivesPerLocationRule:Uv,UniqueEnumValueNamesRule:x1,UniqueFieldDefinitionNamesRule:C1,UniqueFragmentNamesRule:D1,UniqueInputFieldNamesRule:Wv,UniqueOperationNamesRule:R1,UniqueOperationTypesRule:M1,UniqueTypeNamesRule:P1,UniqueVariableNamesRule:F1,ValidationContext:W1,ValuesOfCorrectTypeRule:$1,VariablesAreInputTypesRule:L1,VariablesInAllowedPositionRule:V1,__Directive:wv,__DirectiveLocation:Tv,__EnumValue:Ov,__Field:Sv,__InputValue:nu,__Schema:lh,__Type:xr,__TypeKind:kv,assertAbstractType:BV,assertCompositeType:jV,assertDirective:QV,assertEnumType:RV,assertEnumValueName:Uk,assertInputObjectType:MV,assertInputType:$V,assertInterfaceType:qk,assertLeafType:VV,assertListType:PV,assertName:mr,assertNamedType:WV,assertNonNullType:FV,assertNullableType:zk,assertObjectType:Wk,assertOutputType:LV,assertScalarType:CV,assertSchema:Nv,assertType:xV,assertUnionType:DV,assertValidName:OB,assertValidSchema:Iv,assertWrappingType:UV,astFromValue:ks,buildASTSchema:iN,buildClientSchema:iB,buildSchema:aB,coerceInputValue:S1,concatAST:wB,createSourceEventStream:tN,defaultFieldResolver:Jg,defaultTypeResolver:Y1,doTypesOverlap:qg,execute:dh,executeSync:Q1,extendSchema:sB,findBreakingChanges:kB,findDangerousChanges:NB,formatError:YL,getArgumentValues:fh,getDirectiveValues:za,getEnterLeaveForKind:ja,getIntrospectionQuery:nN,getLocation:ld,getNamedType:Dn,getNullableType:fv,getOperationAST:tB,getOperationRootType:nB,getVariableValues:O1,getVisitFn:NV,graphql:Gj,graphqlSync:Hj,introspectionFromSchema:rB,introspectionTypes:ru,isAbstractType:mi,isCompositeType:vi,isConstValueNode:Qg,isDefinitionNode:sj,isDirective:oh,isEnumType:jt,isEqualType:ud,isExecutableDefinitionNode:Rv,isInputObjectType:vt,isInputType:Gn,isInterfaceType:at,isIntrospectionType:Wo,isLeafType:yi,isListType:wt,isNamedType:Zc,isNonNullType:Ie,isNullableType:uv,isObjectType:tt,isOutputType:Cs,isRequiredArgument:qs,isRequiredInputField:ih,isScalarType:gr,isSchema:Zk,isSelectionNode:zg,isSpecifiedDirective:_v,isSpecifiedScalarType:sh,isType:Yc,isTypeDefinitionNode:sl,isTypeExtensionNode:ch,isTypeNode:oj,isTypeSubTypeOf:So,isTypeSystemDefinitionNode:Mv,isTypeSystemExtensionNode:Pv,isUnionType:Gt,isValidNameError:dN,isValueNode:e1,isWrappingType:Xc,lexicographicSortSchema:lB,locatedError:Qa,parse:Kc,parseConstValue:vV,parseType:bV,parseValue:jk,print:yt,printError:JL,printIntrospectionSchema:uB,printLocation:Ak,printSchema:cB,printSourceLocation:sv,printType:aN,recommendedRules:j1,resolveObjMapThunk:hv,resolveReadonlyArrayThunk:dv,responsePathAsArray:Cn,separateOperations:TB,specifiedDirectives:zs,specifiedRules:B1,specifiedScalarTypes:eu,stripIgnoredCharacters:SB,subscribe:Jj,syntaxError:qt,typeFromAST:Jn,validate:q1,validateSchema:Av,valueFromAST:di,valueFromASTUntyped:cd,version:QL,versionInfo:GL,visit:hn,visitInParallel:cv,visitWithTypeInfo:Dv},Symbol.toStringTag,{value:"Module"}));function ol(t,e){var n=t.directives;return!n||!n.length?!0:mN(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],oe(o!==void 0,70,i.name.value)):o=s.value.value,i.name.value==="skip"?!o:o})}function PB(t){var e=[];return hn(t,{Directive:function(n){e.push(n.name.value)}}),e}var FB=function(t,e){return $s(t,e,!1)},$B=function(t,e){return $s(t,e,!0)};function $s(t,e,n){var r=new Set(t),i=r.size;return hn(e,{Directive:function(s){if(r.delete(s.name.value)&&(!n||!r.size))return Os}}),n?!r.size:r.size<i}function pN(t){return t&&$s(["client","export"],t,!0)}function LB(t){var e=t.name.value;return e==="skip"||e==="include"}function mN(t){var e=[];return t&&t.length&&t.forEach(function(n){if(LB(n)){var r=n.arguments,i=n.name.value;oe(r&&r.length===1,71,i);var s=r[0];oe(s.name&&s.name.value==="if",72,i);var o=s.value;oe(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),73,i),e.push({directive:n,ifArgument:s})}}),e}const VB=()=>Object.create(null),{forEach:jB,slice:Hw}=Array.prototype,{hasOwnProperty:BB}=Object.prototype;let qo=class gN{constructor(e=!0,n=VB){this.weakness=e,this.makeData=n}lookup(){return this.lookupArray(arguments)}lookupArray(e){let n=this;return jB.call(e,r=>n=n.getChildTrie(r)),BB.call(n,"data")?n.data:n.data=this.makeData(Hw.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(Hw.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 gN(this.weakness,this.makeData)),r}mapFor(e,n){return this.weakness&&UB(e)?this.weak||(n?this.weak=new WeakMap:void 0):this.strong||(n?this.strong=new Map:void 0)}};function UB(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var yN=Ar(function(){return navigator.product})=="ReactNative",Qs=typeof WeakMap=="function"&&!(yN&&!global.HermesInternal),Qv=typeof WeakSet=="function",hh=typeof Symbol=="function"&&typeof Symbol.for=="function",iu=hh&&Symbol.asyncIterator,Gv=typeof Ar(function(){return window.document.createElement})=="function",WB=Ar(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,vN=(Gv||yN)&&!WB;function Et(t){return t!==null&&typeof t=="object"}function bN(t){return t!==null&&typeof t=="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function _N(t,e){var n=e,r=[];t.definitions.forEach(function(s){if(s.kind==="OperationDefinition")throw Pn(74,s.operation,s.name?" named '".concat(s.name.value,"'"):"");s.kind==="FragmentDefinition"&&r.push(s)}),typeof n>"u"&&(oe(r.length===1,75,r.length),n=r[0].name.value);var i=D(D({},t),{definitions:Nt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],t.definitions,!0)});return i}function su(t){t===void 0&&(t=[]);var e={};return t.forEach(function(n){e[n.name.value]=n}),e}function ou(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 oe(r,76,n),r||null}default:return null}}function qB(){}class Xg{constructor(e=1/0,n=qB){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 Zg(){}const zB=Zg,QB=typeof WeakRef<"u"?WeakRef:function(t){return{deref:()=>t}},GB=typeof WeakMap<"u"?WeakMap:Map,HB=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:Zg,unregister:Zg}},KB=10024;class yd{constructor(e=1/0,n=zB){this.max=e,this.dispose=n,this.map=new GB,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<KB;i++){const s=r.next().value;if(!s)break;this.unfinalizedNodes.delete(s);const o=s.key;delete s.key,s.keyRef=new QB(o),this.registry.register(o,s,s)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new HB(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 Rm=new WeakSet;function EN(t){t.size<=(t.max||-1)||Rm.has(t)||(Rm.add(t),setTimeout(function(){t.clean(),Rm.delete(t)},100))}var ph=function(t,e){var n=new yd(t,e);return n.set=function(r,i){var s=yd.prototype.set.call(this,r,i);return EN(this),s},n},wN=function(t,e){var n=new Xg(t,e);return n.set=function(r,i){var s=Xg.prototype.set.call(this,r,i);return EN(this),s},n},JB=Symbol.for("apollo.cacheSize"),ei=D({},jg[JB]),fo={};function Hv(t,e){fo[t]=e}var YB=globalThis.__DEV__!==!1?t2:void 0,XB=globalThis.__DEV__!==!1?n2:void 0,ZB=globalThis.__DEV__!==!1?TN:void 0;function e2(){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,ei[n]||r]}))}function t2(){var t,e,n,r,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:e2(),sizes:D({print:(t=fo.print)===null||t===void 0?void 0:t.call(fo),parser:(e=fo.parser)===null||e===void 0?void 0:e.call(fo),canonicalStringify:(n=fo.canonicalStringify)===null||n===void 0?void 0:n.call(fo),links:ty(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:ON(this.queryManager.documentTransform)}},(i=(r=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(r))}}function TN(){return{cache:{fragmentQueryDocuments:_s(this.getFragmentDoc)}}}function n2(){var t=this.config.fragments;return D(D({},TN.apply(this)),{addTypenameDocumentTransform:ON(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:_s(this.storeReader.executeSelectionSet),executeSubSelectedArray:_s(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:_s(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:_s(t==null?void 0:t.findFragmentSpreads),lookup:_s(t==null?void 0:t.lookup),transform:_s(t==null?void 0:t.transform)}})}function r2(t){return!!t&&"dirtyKey"in t}function _s(t){return r2(t)?t.size:void 0}function SN(t){return t!=null}function ON(t){return ey(t).map(function(e){return{cache:e}})}function ey(t){return t?Nt(Nt([_s(t==null?void 0:t.performWork)],ey(t==null?void 0:t.left),!0),ey(t==null?void 0:t.right),!0).filter(SN):[]}function ty(t){var e;return t?Nt(Nt([(e=t==null?void 0:t.getMemoryInternals)===null||e===void 0?void 0:e.call(t)],ty(t==null?void 0:t.left),!0),ty(t==null?void 0:t.right),!0).filter(SN):[]}var Dr=Object.assign(function(e){return JSON.stringify(e,i2)},{reset:function(){Na=new wN(ei.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&Hv("canonicalStringify",function(){return Na.size});var Na;Dr.reset();function i2(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(s2))return e;var i=JSON.stringify(r),s=Na.get(i);if(!s){r.sort();var o=JSON.stringify(r);s=Na.get(o)||r,Na.set(i,s),Na.set(o,s)}var a=Object.create(n);return s.forEach(function(l){a[l]=e[l]}),a}}return e}function s2(t,e,n){return e===0||n[e-1]<=t}function Bi(t){return{__ref:String(t)}}function rt(t){return!!(t&&typeof t=="object"&&typeof t.__ref=="string")}function kN(t){return Et(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function o2(t){return t.kind==="StringValue"}function a2(t){return t.kind==="BooleanValue"}function l2(t){return t.kind==="IntValue"}function c2(t){return t.kind==="FloatValue"}function u2(t){return t.kind==="Variable"}function f2(t){return t.kind==="ObjectValue"}function d2(t){return t.kind==="ListValue"}function h2(t){return t.kind==="EnumValue"}function p2(t){return t.kind==="NullValue"}function Mo(t,e,n,r){if(l2(n)||c2(n))t[e.value]=Number(n.value);else if(a2(n)||o2(n))t[e.value]=n.value;else if(f2(n)){var i={};n.fields.map(function(o){return Mo(i,o.name,o.value,r)}),t[e.value]=i}else if(u2(n)){var s=(r||{})[n.name.value];t[e.value]=s}else if(d2(n))t[e.value]=n.values.map(function(o){var a={};return Mo(a,e,o,r),a[e.value]});else if(h2(n))t[e.value]=n.value;else if(p2(n))t[e.value]=null;else throw Pn(85,e.value,n.kind)}function NN(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 Mo(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 Mo(r,s,o,e)})),Kv(t.name.value,r,n)}var m2=["connection","include","skip","client","rest","export","nonreactive"],Gl=Dr,Kv=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(Gl(i),")")}else return n.connection.key;var s=t;if(e){var o=Gl(e);s+="(".concat(o,")")}return n&&Object.keys(n).forEach(function(a){m2.indexOf(a)===-1&&(n[a]&&Object.keys(n[a]).length?s+="@".concat(a,"(").concat(Gl(n[a]),")"):s+="@".concat(a))}),s},{setStringify:function(t){var e=Gl;return Gl=t,e}});function au(t,e){if(t.arguments&&t.arguments.length){var n={};return t.arguments.forEach(function(r){var i=r.name,s=r.value;return Mo(n,i,s,e)}),n}return null}function Hi(t){return t.alias?t.alias.value:t.name.value}function vd(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[Hi(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=vd(t,ou(o,n).selectionSet,n);if(typeof u=="string")return u}}function Ki(t){return t.kind==="Field"}function AN(t){return t.kind==="InlineFragment"}function zo(t){oe(t&&t.kind==="Document",77);var e=t.definitions.filter(function(n){return n.kind!=="FragmentDefinition"}).map(function(n){if(n.kind!=="OperationDefinition")throw Pn(78,n.kind);return n});return oe(e.length<=1,79,e.length),t}function Qo(t){return zo(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function bd(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function lu(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Jv(t){var e=Qo(t);return oe(e&&e.operation==="query",80),e}function IN(t){oe(t.kind==="Document",81),oe(t.definitions.length<=1,82);var e=t.definitions[0];return oe(e.kind==="FragmentDefinition",83),e}function Go(t){zo(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 Pn(84)}function mh(t){var e=Object.create(null),n=t&&t.variableDefinitions;return n&&n.length&&n.forEach(function(r){r.defaultValue&&Mo(e,r.variable.name,r.defaultValue)}),e}const g2=()=>Object.create(null),{forEach:y2,slice:v2}=Array.prototype,{hasOwnProperty:b2}=Object.prototype;class Yv{constructor(e=!0,n=g2){this.weakness=e,this.makeData=n}lookup(...e){return this.lookupArray(e)}lookupArray(e){let n=this;return y2.call(e,r=>n=n.getChildTrie(r)),b2.call(n,"data")?n.data:n.data=this.makeData(v2.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&&Kw(e[r])?n.weak:n.strong;n=s&&s.get(e[r])}return n&&n.data}getChildTrie(e){const n=this.weakness&&Kw(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 Yv(this.weakness,this.makeData)),r}}function Kw(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}let an=null;const Jw={};let _2=1;const E2=()=>class{constructor(){this.id=["slot",_2++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=an;e;e=e.parent)if(this.id in e.slots){const n=e.slots[this.id];if(n===Jw)break;return e!==an&&(an.slots[this.id]=n),!0}return an&&(an.slots[this.id]=Jw),!1}getValue(){if(this.hasValue())return an.slots[this.id]}withValue(e,n,r,i){const s={__proto__:null,[this.id]:e},o=an;an={parent:o,slots:s};try{return n.apply(i,r)}finally{an=o}}static bind(e){const n=an;return function(){const r=an;try{return an=n,e.apply(this,arguments)}finally{an=r}}}static noContext(e,n,r){if(an){const i=an;try{return an=null,e.apply(r,n)}finally{an=i}}else return e.apply(r,n)}};function Yw(t){try{return t()}catch{}}const Mm="@wry/context:Slot",w2=Yw(()=>globalThis)||Yw(()=>global)||Object.create(null),Xw=w2,Xv=Xw[Mm]||Array[Mm]||function(t){try{Object.defineProperty(Xw,Mm,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(E2()),{bind:wae,noContext:Tae}=Xv,gh=new Xv,{hasOwnProperty:T2}=Object.prototype,Zv=Array.from||function(t){const e=[];return t.forEach(n=>e.push(n)),e};function eb(t){const{unsubscribe:e}=t;typeof e=="function"&&(t.unsubscribe=void 0,e())}const Ic=[],S2=100;function Ga(t,e){if(!t)throw new Error(e||"assertion failure")}function xN(t,e){const n=t.length;return n>0&&n===e.length&&t[n-1]===e[n-1]}function CN(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function DN(t){return t.slice(0)}class yh{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,++yh.count}peek(){if(this.value.length===1&&!Ls(this))return Zw(this),this.value[0]}recompute(e){return Ga(!this.recomputing,"already recomputing"),Zw(this),Ls(this)?O2(this,e):CN(this.value)}setDirty(){this.dirty||(this.dirty=!0,RN(this),eb(this))}dispose(){this.setDirty(),LN(this),tb(this,(e,n)=>{e.setDirty(),VN(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=Ic.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(Zv(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),Ic.push(this.deps),this.deps=null)}}yh.count=0;function Zw(t){const e=gh.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),Ls(t)?PN(e,t):FN(e,t),e}function O2(t,e){return LN(t),gh.withValue(t,k2,[t,e]),A2(t,e)&&N2(t),CN(t.value)}function k2(t,e){t.recomputing=!0;const{normalizeResult:n}=t;let r;n&&t.value.length===1&&(r=DN(t.value)),t.value.length=0;try{if(t.value[0]=t.fn.apply(null,e),n&&r&&!xN(r,t.value))try{t.value[0]=n(t.value[0],r[0])}catch{}}catch(i){t.value[1]=i}t.recomputing=!1}function Ls(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function N2(t){t.dirty=!1,!Ls(t)&&MN(t)}function RN(t){tb(t,PN)}function MN(t){tb(t,FN)}function tb(t,e){const n=t.parents.size;if(n){const r=Zv(t.parents);for(let i=0;i<n;++i)e(r[i],t)}}function PN(t,e){Ga(t.childValues.has(e)),Ga(Ls(e));const n=!Ls(t);if(!t.dirtyChildren)t.dirtyChildren=Ic.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),n&&RN(t)}function FN(t,e){Ga(t.childValues.has(e)),Ga(!Ls(e));const n=t.childValues.get(e);n.length===0?t.childValues.set(e,DN(e.value)):xN(n,e.value)||t.setDirty(),$N(t,e),!Ls(t)&&MN(t)}function $N(t,e){const n=t.dirtyChildren;n&&(n.delete(e),n.size===0&&(Ic.length<S2&&Ic.push(n),t.dirtyChildren=null))}function LN(t){t.childValues.size>0&&t.childValues.forEach((e,n)=>{VN(t,n)}),t.forgetDeps(),Ga(t.dirtyChildren===null)}function VN(t,e){e.parents.delete(t),t.childValues.delete(e),$N(t,e)}function A2(t,e){if(typeof t.subscribe=="function")try{eb(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}const I2={setDirty:!0,dispose:!0,forget:!0};function jN(t){const e=new Map;function n(r){const i=gh.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&&T2.call(I2,s)?s:"setDirty";Zv(o).forEach(l=>l[a]()),e.delete(i),eb(o)}},n}let eT;function x2(...t){return(eT||(eT=new Yv(typeof WeakMap=="function"))).lookupArray(t)}const Pm=new Set;function xc(t,{max:e=Math.pow(2,16),keyArgs:n,makeCacheKey:r=x2,normalizeResult:i,subscribe:s,cache:o=Xg}=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 yh(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),Pm.add(a),gh.hasValue()||(Pm.forEach(b=>b.clean()),Pm.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 C2(t){return t}var cu=function(){function t(e,n){n===void 0&&(n=Object.create(null)),this.resultCache=Qv?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(C2,{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 qo(Qs);this.performWork=xc(t.prototype.performWork.bind(this),{makeCacheKey:function(r){var i=e.getCacheKey(r);if(i)return oe(Array.isArray(i),69),n.lookupArray(i)},max:ei["documentTransform.cache"],cache:yd})}},t.prototype.performWork=function(e){return zo(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}(),hc,al=Object.assign(function(t){var e=hc.get(t);return e||(e=yt(t),hc.set(t,e)),e},{reset:function(){hc=new ph(ei.print||2e3)}});al.reset();globalThis.__DEV__!==!1&&Hv("print",function(){return hc?hc.size:0});var kt=Array.isArray;function Yn(t){return Array.isArray(t)&&t.length>0}var tT={kind:k.FIELD,name:{kind:k.NAME,value:"__typename"}};function BN(t,e){return!t||t.selectionSet.selections.every(function(n){return n.kind===k.FRAGMENT_SPREAD&&BN(e[n.name.value],e)})}function nb(t){return BN(Qo(t)||IN(t),su(lu(t)))?null:t}function D2(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 nT(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 vh(t,e){zo(e);for(var n=nT(""),r=nT(""),i=function(w){for(var O=0,N=void 0;O<w.length&&(N=w[O]);++O)if(!kt(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&&oe.error(86),null},s=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===k.OPERATION_DEFINITION&&++s;var a=D2(t),l=function(w){return Yn(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=hn(e,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(w,O,N,I,P){var M=i(P);M&&M.variables.add(w.name.value)}},FragmentSpread:{enter:function(w,O,N,I,P){if(l(w.directives))return d=!0,null;var M=i(P);M&&M.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(M){return M.kind===k.FIELD&&M.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 nb(hn(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 D(D({},w),{variableDefinitions:w.variableDefinitions.filter(function(N){return O.has(N.variable.name.value)})})}}}}))}var bh=Object.assign(function(t){return hn(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 D(D({},e),{selections:Nt(Nt([],i,!0),[tT],!1)})}}}}}})},{added:function(t){return t===tT}}),R2={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&&oe.warn(87),e}};function M2(t){return vh([R2],zo(t))}function P2(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 F2(t,e){var n=P2(t);return nb(hn(e,{OperationDefinition:{enter:function(r){return D(D({},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 $2(t,e){function n(r){if(t.some(function(i){return i.name===r.name.value}))return null}return nb(hn(e,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}function UN(t){var e=Go(t),n=e.operation;if(n==="query")return t;var r=hn(t,{OperationDefinition:{enter:function(i){return D(D({},i),{operation:"query"})}}});return r}function rb(t){zo(t);var e=vh([{test:function(n){return n.name.value==="client"},remove:!0}],t);return e}function ib(t,e){var n;return((n=Qo(t))===null||n===void 0?void 0:n.operation)===e}function L2(t){return ib(t,"mutation")}function V2(t){return ib(t,"query")}function j2(t){return ib(t,"subscription")}var B2=Object.prototype.hasOwnProperty;function Cc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ll(t)}function ll(t){var e=t[0]||{},n=t.length;if(n>1)for(var r=new Ji,i=1;i<n;++i)e=r.merge(e,t[i]);return e}var U2=function(t,e,n){return this.merge(t[n],e[n])},Ji=function(){function t(e){e===void 0&&(e=U2),this.reconciler=e,this.isObject=Et,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 Et(n)&&Et(e)?(Object.keys(n).forEach(function(o){if(B2.call(e,o)){var a=e[o];if(n[o]!==a){var l=r.reconciler.apply(r,Nt([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 Et(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=D({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function W2(t){return t===void 0&&(t=!1),{keyArgs:t,merge:function(e,n){return e?Nt(Nt([],e,!0),n,!0):n}}}function q2(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 z2(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 D(D({},Fm(e)),{edges:s,pageInfo:D(D({},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=G2()),!n)return e;var a=n.edges?n.edges.map(function(Q){return s(Q=D({},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=Cc(n,{pageInfo:{startCursor:g}}));var y=p&&p.cursor;y&&!d&&(n=Cc(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=Nt(Nt(Nt([],b,!0),a,!0),_,!0),N=D(D({},n.pageInfo),e.pageInfo);if(n.pageInfo){var I=n.pageInfo,P=I.hasPreviousPage,M=I.hasNextPage,u=I.startCursor,d=I.endCursor,B=Rn(I,["hasPreviousPage","hasNextPage","startCursor","endCursor"]);Object.assign(N,B),b.length||(P!==void 0&&(N.hasPreviousPage=P),u!==void 0&&(N.startCursor=u)),_.length||(M!==void 0&&(N.hasNextPage=M),d!==void 0&&(N.endCursor=d))}return D(D(D({},Fm(e)),Fm(n)),{edges:O,pageInfo:N})}}}var Fm=function(t){return Rn(t,Q2)},Q2=["edges","pageInfo"];function G2(){return{edges:[],pageInfo:{hasPreviousPage:!1,hasNextPage:!0,startCursor:"",endCursor:""}}}function H2(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=K2(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.
207
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K2(t,e){if(t){if(typeof t=="string")return rT(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 rT(t,e)}}function rT(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 iT(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 sb(t,e,n){return e&&iT(t.prototype,e),n&&iT(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var ob=function(){return typeof Symbol=="function"},ab=function(t){return ob()&&!!Symbol[t]},lb=function(t){return ab(t)?Symbol[t]:"@@"+t};ob()&&!ab("observable")&&(Symbol.observable=Symbol("observable"));var J2=lb("iterator"),ny=lb("observable"),WN=lb("species");function _d(t,e){var n=t[e];if(n!=null){if(typeof n!="function")throw new TypeError(n+" is not a function");return n}}function Hl(t){var e=t.constructor;return e!==void 0&&(e=e[WN],e===null&&(e=void 0)),e!==void 0?e:et}function Y2(t){return t instanceof et}function Ha(t){Ha.log?Ha.log(t):setTimeout(function(){throw t})}function Qf(t){Promise.resolve().then(function(){try{t()}catch(e){Ha(e)}})}function qN(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var n=_d(e,"unsubscribe");n&&n.call(e)}}catch(r){Ha(r)}}function ry(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function X2(t){var e=t._queue;if(e){t._queue=void 0,t._state="ready";for(var n=0;n<e.length&&(zN(t,e[n].type,e[n].value),t._state!=="closed");++n);}}function zN(t,e,n){t._state="running";var r=t._observer;try{var i=_d(r,e);switch(e){case"next":i&&i.call(r,n);break;case"error":if(ry(t),i)i.call(r,n);else throw n;break;case"complete":ry(t),i&&i.call(r);break}}catch(s){Ha(s)}t._state==="closed"?qN(t):t._state==="running"&&(t._state="ready")}function $m(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}],Qf(function(){return X2(t)});return}zN(t,e,n)}}var Z2=function(){function t(n,r){this._cleanup=void 0,this._observer=n,this._queue=void 0,this._state="initializing";var i=new eU(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"&&(ry(this),qN(this))},sb(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),eU=function(){function t(n){this._subscription=n}var e=t.prototype;return e.next=function(r){$m(this._subscription,"next",r)},e.error=function(r){$m(this._subscription,"error",r)},e.complete=function(){$m(this._subscription,"complete")},sb(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),et=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 Z2(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=Hl(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=Hl(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=Hl(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=Hl(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=Hl(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[ny]=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=_d(r,ny);if(s){var o=s.call(r);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Y2(o)&&o.constructor===i?o:new i(function(a){return o.subscribe(a)})}if(ab("iterator")&&(s=_d(r,J2),s))return new i(function(a){Qf(function(){if(!a.closed){for(var l=H2(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){Qf(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){Qf(function(){if(!a.closed){for(var l=0;l<i.length;++l)if(a.next(i[l]),a.closed)return;a.complete()}})})},sb(t,null,[{key:WN,get:function(){return this}}]),t}();ob()&&Object.defineProperty(et,Symbol("extensions"),{value:{symbol:ny,hostReportError:Ha},configurable:!0});function tU(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 Ta;typeof self<"u"?Ta=self:typeof window<"u"?Ta=window:typeof global<"u"?Ta=global:typeof module<"u"?Ta=module:Ta=Function("return this")();tU(Ta);var sT=et.prototype,oT="@@observable";sT[oT]||(sT[oT]=function(){return this});function Gf(t){var e=Promise.resolve(t);return e.status="fulfilled",e.value=t,e}function QN(t){var e=Promise.reject(t);return e.catch(function(){}),e.status="rejected",e.reason=t,e}function GN(t){return"status"in t}function cb(t){if(GN(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 nU=Object.prototype.toString;function ub(t){return iy(t)}function iy(t,e){switch(nU.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]=iy(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]=iy(t[i],e)}),r}default:return t}}function rU(t){var e=new Set([t]);return e.forEach(function(n){Et(n)&&iU(n)===n&&Object.getOwnPropertyNames(n).forEach(function(r){Et(n[r])&&e.add(n[r])})}),t}function iU(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 Ka(t){return globalThis.__DEV__!==!1&&rU(t),t}function Ra(t,e,n){var r=[];t.forEach(function(i){return i[e]&&r.push(i)}),r.forEach(function(i){return i[e](n)})}function Hf(t,e,n){return new et(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 fb(t){function e(n){Object.defineProperty(t,n,{value:et})}return hh&&Symbol.species&&e(Symbol.species),e("@@species"),t}function aT(t){return t&&typeof t.then=="function"}var go=function(t){Br(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),Ra(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),Ra(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?aT(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"),Ra(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 et(n)]),aT(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}(et);fb(go);function Oo(t){return"incremental"in t}function HN(t){return"hasNext"in t&&"data"in t}function KN(t){return Oo(t)||HN(t)}function JN(t){return Et(t)&&"payload"in t}function db(t,e){var n=t,r=new Ji;return Oo(e)&&Yn(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 pc(t){var e=Ed(t);return Yn(e)}function Ed(t){var e=Yn(t.errors)?t.errors.slice(0):[];return Oo(t)&&Yn(t.incremental)&&t.incremental.forEach(function(n){n.errors&&e.push.apply(e,n.errors)}),e}function Vs(){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 gi(t,e){return Vs(t,e,e.variables&&{variables:Vs(D(D({},t&&t.variables),e.variables))})}function YN(t,e){return sy(t,e)}function sy(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=sy(o,e,n);r||(r=l!==o),i[a]=l}),r)return i}else if(bN(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=sy(t[o],e,n);r||(r=a!==t[o]),s[o]=a}),r)return s}return t}function sU(t){return YN(t,"__typename")}const oU=Object.freeze(Object.defineProperty({__proto__:null,AutoCleanedStrongCache:wN,AutoCleanedWeakCache:ph,Concast:go,DEV:zL,DeepMerger:Ji,DocumentTransform:cu,Observable:et,addTypenameToDocument:bh,argumentsObjectFromField:au,asyncMap:Hf,buildQueryFromSelectionSet:UN,cacheSizes:ei,canUseAsyncIteratorSymbol:iu,canUseDOM:Gv,canUseLayoutEffect:vN,canUseSymbol:hh,canUseWeakMap:Qs,canUseWeakSet:Qv,canonicalStringify:Dr,checkDocument:zo,cloneDeep:ub,compact:Vs,concatPagination:W2,createFragmentMap:su,createFulfilledPromise:Gf,createRejectedPromise:QN,fixObservableSubclass:fb,getDefaultValues:mh,getDirectiveNames:PB,getFragmentDefinition:IN,getFragmentDefinitions:lu,getFragmentFromSelection:ou,getFragmentQueryDocument:_N,getGraphQLErrorsFromResult:Ed,getInclusionDirectives:mN,getMainDefinition:Go,getOperationDefinition:Qo,getOperationName:bd,getQueryDefinition:Jv,getStoreKeyName:Kv,getTypenameFromResult:vd,graphQLResultHasError:pc,hasAllDirectives:$B,hasAnyDirectives:FB,hasClientExports:pN,hasDirectives:$s,isApolloPayloadResult:JN,isArray:kt,isDocumentNode:kN,isExecutionPatchIncrementalResult:Oo,isExecutionPatchInitialResult:HN,isExecutionPatchResult:KN,isField:Ki,isInlineFragment:AN,isMutationOperation:L2,isNonEmptyArray:Yn,isNonNullObject:Et,isPlainObject:bN,isQueryOperation:V2,isReference:rt,isStatefulPromise:GN,isSubscriptionOperation:j2,iterateObserversSafely:Ra,makeReference:Bi,makeUniqueId:ad,maybe:Ar,maybeDeepFreeze:Ka,mergeDeep:Cc,mergeDeepArray:ll,mergeIncrementalData:db,mergeOptions:gi,offsetLimitPagination:q2,omitDeep:YN,print:al,relayStylePagination:z2,removeArgumentsFromDocument:F2,removeClientSetsFromDocument:rb,removeConnectionDirectiveFromDocument:M2,removeDirectivesFromDocument:vh,removeFragmentSpreadFromDocument:$2,resultKeyNameFromField:Hi,shouldInclude:ol,storeKeyNameFromField:NN,stringifyForDisplay:nv,stripTypename:sU,valueToObjectRepresentation:Mo,wrapPromiseWithState:cb},Symbol.toStringTag,{value:"Module"}));function mc(t){return new et(function(e){e.error(t)})}function XN(t){var e=!1;return new Promise(function(n,r){t.subscribe({next:function(i){e?globalThis.__DEV__!==!1&&oe.warn(43):(e=!0,n(i))},error:r})})}function ZN(t){return new et(function(e){t.then(function(n){e.next(n),e.complete()}).catch(e.error.bind(e))})}var _h=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 aU(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 Pn(44,i)}return t}function lU(t,e){var n=D({},t),r=function(s){typeof s=="function"?n=D(D({},n),s(n)):n=D(D({},n),s)},i=function(){return D({},n)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:r}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function cU(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?bd(e.query)||void 0:""),e}function uU(t,e){var n=D({},t),r=new Set(Object.keys(t));return hn(e,{Variable:function(i,s,o){o&&o.kind!=="VariableDefinition"&&r.delete(i.name.value)}}),r.forEach(function(i){delete n[i]}),n}function lT(t,e){return e?e(t):et.of()}function Kl(t){return typeof t=="function"?new Vn(t):t}function Af(t){return t.request.length<=1}var Vn=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return et.of()})},t.from=function(e){return e.length===0?t.empty():e.map(Kl).reduce(function(n,r){return n.concat(r)})},t.split=function(e,n,r){var i=Kl(n),s=Kl(r||new t(lT)),o;return Af(i)&&Af(s)?o=new t(function(a){return e(a)?i.request(a)||et.of():s.request(a)||et.of()}):o=new t(function(a,l){return e(a)?i.request(a,l)||et.of():s.request(a,l)||et.of()}),Object.assign(o,{left:i,right:s})},t.execute=function(e,n){return e.request(lU(n.context,cU(aU(n))))||et.of()},t.concat=function(e,n){var r=Kl(e);if(Af(r))return globalThis.__DEV__!==!1&&oe.warn(36,r),r;var i=Kl(n),s;return Af(i)?s=new t(function(o){return r.request(o,function(a){return i.request(a)||et.of()})||et.of()}):s=new t(function(o,a){return r.request(o,function(l){return i.request(l,a)||et.of()})||et.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(lT)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,n){throw Pn(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}(),eA=Vn.empty,hb=Vn.from,pb=Vn.split,tA=Vn.concat,Dc=Vn.execute;function fU(t){var e,n=t[Symbol.asyncIterator]();return e={next:function(){return n.next()}},e[Symbol.asyncIterator]=function(){return this},e}function dU(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 iu&&(d[Symbol.asyncIterator]=function(){return this}),d}function hU(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 iu&&(n[Symbol.asyncIterator]=function(){return this}),n}function cT(t){var e={next:function(){return t.read()}};return iu&&(e[Symbol.asyncIterator]=function(){return this}),e}function pU(t){return!!t.body}function mU(t){return!!t.getReader}function gU(t){return!!(iu&&t[Symbol.asyncIterator])}function yU(t){return!!t.stream}function vU(t){return!!t.arrayBuffer}function bU(t){return!!t.pipe}function _U(t){var e=t;if(pU(t)&&(e=t.body),gU(e))return fU(e);if(mU(e))return cT(e.getReader());if(yU(e))return cT(e.stream().getReader());if(vU(e))return hU(e.arrayBuffer());if(bU(e))return dU(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var mb=Symbol();function EU(t){return t.extensions?Array.isArray(t.extensions[mb]):!1}function Eh(t){return t.hasOwnProperty("graphQLErrors")}var wU=function(t){var e=Nt(Nt(Nt([],t.graphQLErrors,!0),t.clientErrors,!0),t.protocolErrors,!0);return t.networkError&&e.push(t.networkError),e.map(function(n){return Et(n)&&n.message||"Error message not found."}).join(`
208
+ `)},wn=function(t){Br(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||wU(u),u.extraInfo=l,u.cause=Nt(Nt(Nt([o],r||[],!0),i||[],!0),s||[],!0).find(function(d){return!!d})||null,u.__proto__=e.prototype,u}return e}(Error),uT=Object.prototype.hasOwnProperty;function TU(t,e){return vs(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,M,B,Q,x;return bs(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
209
+ --`.concat(s),a="",l=_U(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
210
+ \r
211
+ `),O=SU(_.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=nA(t,I),Object.keys(P).length>1||"data"in P||"incremental"in P||"errors"in P||"payload"in P)if(JN(P)){if(M={},"payload"in P){if(Object.keys(P).length===1&&P.payload===null)return[2];M=D({},P.payload)}"errors"in P&&(M=D(D({},M),{extensions:D(D({},"extensions"in M?M.extensions:null),(Q={},Q[mb]=P.errors,Q))})),e(M)}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 SU(t){var e={};return t.split(`
212
+ `).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 nA(t,e){if(t.status>=300){var n=function(){try{return JSON.parse(e)}catch{return e}};_h(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 OU(t,e){t.result&&t.result.errors&&t.result.data&&e.next(t.result),e.error(t)}function gb(t){return function(e){return e.text().then(function(n){return nA(e,n)}).then(function(n){return!Array.isArray(n)&&!uT.call(n,"data")&&!uT.call(n,"errors")&&_h(e,n,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(r){return r.operationName}):t.operationName,"'.")),n})}}var Rc=function(t,e){var n;try{n=JSON.stringify(t)}catch(i){var r=Pn(40,e,i.message);throw r.parseError=i,r}return n},kU={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},NU={accept:"*/*","content-type":"application/json"},AU={method:"POST"},yb={http:kU,headers:NU,options:AU},wh=function(t,e){return e(t)};function rA(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return n.unshift(e),Th.apply(void 0,Nt([t,wh],n,!1))}function Th(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={},s={};n.forEach(function(h){i=D(D(D({},i),h.options),{headers:D(D({},i.headers),h.headers)}),h.credentials&&(i.credentials=h.credentials),s=D(D({},s),h.http)}),i.headers&&(i.headers=IU(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,al)),{options:i,body:d}}function IU(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 vb=function(t){if(!t&&typeof fetch>"u")throw Pn(38)},iA=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}},bb=function(t,e){var n=t.getContext(),r=n.uri;return r||(typeof e=="function"?e(t):e||"/graphql")};function _b(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=Rc(e.variables,"Variables map")}catch(h){return{parseError:h}}r("variables",i)}if(e.extensions){var s=void 0;try{s=Rc(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 fT=Ar(function(){return fetch}),Eb=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?wh:i,o=t.includeExtensions,a=t.preserveHeaderCase,l=t.useGETForQueries,u=t.includeUnusedVariables,d=u===void 0?!1:u,h=Rn(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&vb(r||fT);var p={http:{includeExtensions:o,preserveHeaderCase:a},options:h.fetchOptions,credentials:h.credentials,headers:h.headers};return new Vn(function(g){var y=bb(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=D(D({},_),b.headers),P={http:b.http,options:b.fetchOptions,credentials:b.credentials,headers:I};if($s(["client"],g.query)){var M=rb(g.query);if(!M)return mc(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=M}var B=Th(g,s,yb,p,P),Q=B.options,x=B.body;x.variables&&!d&&(x.variables=uU(x.variables,g.query));var U;!Q.signal&&typeof AbortController<"u"&&(U=new AbortController,Q.signal=U.signal);var Te=function(Se){return Se.kind==="OperationDefinition"&&Se.operation==="mutation"},ke=function(Se){return Se.kind==="OperationDefinition"&&Se.operation==="subscription"},he=ke(Go(g.query)),Ce=$s(["defer"],g.query);if(l&&!g.query.definitions.some(Te)&&(Q.method="GET"),Ce||he){Q.headers=Q.headers||{};var ee="multipart/mixed;";he&&Ce&&globalThis.__DEV__!==!1&&oe.warn(39),he?ee+="boundary=graphql;subscriptionSpec=1.0,application/json":Ce&&(ee+="deferSpec=20220824,application/json"),Q.headers.accept=ee}if(Q.method==="GET"){var Ae=_b(y,x),fe=Ae.newURI,ve=Ae.parseError;if(ve)return mc(ve);y=fe}else try{Q.body=Rc(x,"Payload")}catch(Se){return mc(Se)}return new et(function(Se){var dt=r||Ar(function(){return fetch})||fT,Ne=Se.next.bind(Se);return dt(y,Q).then(function(L){var te;g.setContext({response:L});var X=(te=L.headers)===null||te===void 0?void 0:te.get("content-type");return X!==null&&/^multipart\/mixed/i.test(X)?TU(L,Ne):gb(g)(L).then(Ne)}).then(function(){U=void 0,Se.complete()}).catch(function(L){U=void 0,OU(L,Se)}),function(){U&&U.abort()}})})},Sh=function(t){Br(e,t);function e(n){n===void 0&&(n={});var r=t.call(this,Eb(n).request)||this;return r.options=n,r}return e}(Vn);const{toString:dT,hasOwnProperty:xU}=Object.prototype,hT=Function.prototype.toString,oy=new Map;function qe(t,e){try{return ay(t,e)}finally{oy.clear()}}function ay(t,e){if(t===e)return!0;const n=dT.call(t),r=dT.call(e);if(n!==r)return!1;switch(n){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(mT(t,e))return!0;const i=pT(t),s=pT(e),o=i.length;if(o!==s.length)return!1;for(let a=0;a<o;++a)if(!xU.call(e,i[a]))return!1;for(let a=0;a<o;++a){const l=i[a];if(!ay(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(mT(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&&!ay(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=hT.call(t);return i!==hT.call(e)?!1:!RU(i,DU)}}return!1}function pT(t){return Object.keys(t).filter(CU,t)}function CU(t){return this[t]!==void 0}const DU="{ [native code] }";function RU(t,e){const n=t.length-e.length;return n>=0&&t.indexOf(e,n)===n}function mT(t,e){let n=oy.get(t);if(n){if(n.has(e))return!0}else oy.set(t,n=new Set);return n.add(e),!1}const MU=Object.freeze(Object.defineProperty({__proto__:null,default:qe,equal:qe},Symbol.toStringTag,{value:"Module"}));function sA(t,e,n,r){var i=e.data,s=Rn(e,["data"]),o=n.data,a=Rn(n,["data"]);return qe(s,a)&&Kf(Go(t).selectionSet,i,o,{fragmentMap:su(lu(t)),variables:r})}function Kf(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),!ol(s,r.variables))||gT(s))return!0;if(Ki(s)){var o=Hi(s),a=e&&e[o],l=n&&n[o],u=s.selectionSet;if(!u)return qe(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(!Kf(u,a[g],l[g],r))return!1;return!0}return Kf(u,a,l,r)}else{var y=ou(s,r.fragmentMap);if(y)return gT(y)?!0:Kf(y.selectionSet,e,n,r)}})}function gT(t){return!!t.directives&&t.directives.some(PU)}function PU(t){return t.name.value==="nonreactive"}var Oh=function(){function t(){this.assumeImmutableResults=!1,this.getFragmentDoc=xc(_N,{max:ei["cache.fragmentQueryDocuments"]||1e3,cache:yd})}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(D(D({},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=Rn(e,["fragment","fragmentName","from","optimistic"]),u=this.getFragmentDoc(r,i),d=D(D({},l),{returnPartialData:!0,id:typeof s>"u"||typeof s=="string"?s:this.identify(s),query:u,optimistic:a}),h;return new et(function(p){return n.watch(D(D({},d),{immediate:!0,callback:function(g){if(!(h&&sA(u,{data:h==null?void 0:h.result},{data:g.result}))){var y={data:g.result,complete:!!g.complete};g.missing&&(y.missing=ll(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(D(D({},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=Rn(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=Rn(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(D(D({},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(D(D({},e),{data:s})),s)}})},t}();globalThis.__DEV__!==!1&&(Oh.prototype.getMemoryInternals=ZB);var wd;wd||(wd={});var kh=function(t){Br(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),Yt=Object.prototype.hasOwnProperty;function Jl(t){return t==null}function Nh(t,e){var n=t.__typename,r=t.id,i=t._id;if(typeof n=="string"&&(e&&(e.keyObject=Jl(r)?Jl(i)?void 0:{_id:i}:{id:r}),Jl(r)&&!Jl(i)&&(r=i),!Jl(r)))return"".concat(n,":").concat(typeof r=="number"||typeof r=="string"?r:JSON.stringify(r))}var oA={dataIdFromObject:Nh,addTypename:!0,resultCaching:!0,canonizeResults:!1};function FU(t){return Vs(oA,t)}function aA(t){var e=t.canonizeResults;return e===void 0?oA.canonizeResults:e}function $U(t,e){return rt(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var lA=/^[_a-z][_0-9a-z]*/i;function js(t){var e=t.match(lA);return e?e[0]:t}function ly(t,e,n){return Et(e)?kt(e)?e.every(function(r){return ly(t,r,n)}):t.selections.every(function(r){if(Ki(r)&&ol(r,n)){var i=Hi(r);return Yt.call(e,i)&&(!r.selectionSet||ly(r.selectionSet,e[i],n))}return!0}):!1}function Aa(t){return Et(t)&&!rt(t)&&!kt(t)}function LU(){return new Ji}function cA(t,e){var n=su(lu(t));return{fragmentMap:n,lookupFragment:function(r){var i=n[r];return!i&&e&&(i=e.lookup(r)),i||null}}}var Jf=Object.create(null),Lm=function(){return Jf},yT=Object.create(null),Mc=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 Ka(rt(i)?r.get(i.__ref,s):i&&i[s])},this.canRead=function(i){return rt(i)?r.has(i.__ref):typeof i=="object"},this.toReference=function(i,s){if(typeof i=="string")return Bi(i);if(rt(i))return i;var o=r.policies.identify(i)[0];if(o){var a=Bi(o);return s&&r.merge(o,i),a}}}return t.prototype.toObject=function(){return D({},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),Yt.call(this.data,e)){var r=this.data[e];if(r&&Yt.call(r,n))return r[n]}if(n==="__typename"&&Yt.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof ms)return this.parent.get(e,n)},t.prototype.lookup=function(e,n){if(n&&this.group.depend(e,"__exists"),Yt.call(this.data,e))return this.data[e];if(this instanceof ms)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;rt(e)&&(e=e.__ref),rt(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){oe(typeof i=="string",1);var a=new Ji(jU).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=js(u);d!==u&&!r.policies.hasKeyArgs(a.__typename,d)&&(l[d]=1),a[u]===void 0&&!(r instanceof ms)&&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:Jf,INVALIDATE:yT,isReference:rt,toReference:this.toReference,canRead:this.canRead,readField:function(u,d){return r.policies.readField(typeof u=="string"?{fieldName:u,from:d||Bi(e)}:u,{store:r})}};if(Object.keys(i).forEach(function(u){var d=js(u),h=i[u];if(h!==void 0){var p=typeof n=="function"?n:n[u]||n[d];if(p){var g=p===Lm?Jf:p(Ka(h),D(D({},l),{fieldName:d,storeFieldName:u,storage:r.getStorage(e,u)}));if(g===yT)r.group.dirty(e,u);else if(g===Jf&&(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&&oe.warn(2,P),!0};if(rt(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(rt(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&&oe.warn(3,_);break}}}}h!==void 0&&(a=!1)}}),o)return this.merge(e,s),a&&(this instanceof ms?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]=Lm,i):Lm)}return!1},t.prototype.evict=function(e,n){var r=!1;return e.id&&(Yt.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof ms&&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){Yt.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&&Yt.call(e,s)||n.delete(s)}),e){var r=e.__META,i=Rn(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 ms?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){Yt.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 ms;)s=s.parent;i.forEach(function(o){return s.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!Yt.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){rt(s)&&(n[s.__ref]=!0),Et(s)&&Object.keys(s).forEach(function(o){var a=s[o];Et(a)&&i.add(a)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}(),uA=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?jN():null,this.keyMaker=new qo(Qs)},t.prototype.depend=function(e,n){if(this.d){this.d(Vm(e,n));var r=js(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 vT(t,e){gc(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(n){Br(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 uA(a))||this;return u.stump=new VU(u),u.storageTrie=new qo(Qs),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})(Mc||(Mc={}));var ms=function(t){Br(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){qe(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 D(D({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(n){var r=this.parent.findChildRefIds(n);return Yt.call(this.data,n)?D(D({},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}(Mc),VU=function(t){Br(e,t);function e(n){return t.call(this,"EntityStore.Stump",n,function(){},new uA(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}(ms);function jU(t,e,n){var r=t[n],i=e[n];return qe(r,i)?r:i}function gc(t){return!!(t instanceof Mc&&t.group.caching)}function BU(t){return Et(t)?kt(t)?t.slice(0):D({__proto__:Object.getPrototypeOf(t)},t):t}var bT=function(){function t(){this.known=new(Qv?WeakSet:Set),this.pool=new qo(Qs),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return Et(e)&&this.known.has(e)},t.prototype.pass=function(e){if(Et(e)){var n=BU(e);return this.passes.set(n,e),n}return e},t.prototype.admit=function(e){var n=this;if(Et(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 _T(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var UU=function(){function t(e){var n=this;this.knownResults=new(Qs?WeakMap:Map),this.config=Vs(e,{addTypename:e.addTypename!==!1,canonizeResults:aA(e)}),this.canon=e.canon||new bT,this.executeSelectionSet=xc(function(r){var i,s=r.context.canonizeResults,o=_T(r);o[3]=!s;var a=(i=n.executeSelectionSet).peek.apply(i,o);return a?s?D(D({},a),{result:n.canon.admit(a.result)}):a:(vT(r.context.store,r.enclosingRef.__ref),n.execSelectionSetImpl(r))},{max:this.config.resultCacheMaxSize||ei["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:_T,makeCacheKey:function(r,i,s,o){if(gc(s.store))return s.store.makeCacheKey(r,rt(i)?i.__ref:i,s.varString,o)}}),this.executeSubSelectedArray=xc(function(r){return vT(r.context.store,r.enclosingRef.__ref),n.execSubSelectedArrayImpl(r)},{max:this.config.resultCacheMaxSize||ei["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(r){var i=r.field,s=r.array,o=r.context;if(gc(o.store))return o.store.makeCacheKey(i,s,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new bT},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=D(D({},mh(Jv(r))),o);var p=Bi(s),g=this.executeSelectionSet({selectionSet:Go(r).selectionSet,objectOrReference:p,enclosingRef:p,context:D({store:n,query:r,policies:h,variables:o,varString:Dr(o),canonizeResults:d},cA(r,this.config.fragments))}),y;if(g.missing&&(y=[new kh(WU(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(gc(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(rt(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 Ji;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(ol(N,a))if(Ki(N)){var M=l.readField({fieldName:N.name.value,field:N,variables:o.variables,from:i},o),B=Hi(N);M===void 0?bh.added(N)||(p=g.merge(p,(I={},I[B]="Can't find field '".concat(N.name.value,"' on ").concat(rt(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),I))):kt(M)?M.length>0&&(M=y(n.executeSubSelectedArray({field:N,array:M,enclosingRef:s,context:o}),B)):N.selectionSet?M!=null&&(M=y(n.executeSelectionSet({selectionSet:N.selectionSet,objectOrReference:M,enclosingRef:rt(M)?M:s,context:o}),B)):o.canonizeResults&&(M=n.canon.pass(M)),M!==void 0&&h.push((P={},P[B]=M,P))}else{var Q=ou(N,o.lookupFragment);if(!Q&&N.kind===k.FRAGMENT_SPREAD)throw Pn(9,N.name.value);Q&&l.fragmentMatches(Q,d)&&Q.selectionSet.selections.forEach(b.add,b)}});var _=ll(h),w={result:_,missing:p},O=o.canonizeResults?this.canon.admit(w):Ka(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 Ji;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:kt(d)?u(n.executeSubSelectedArray({field:r,array:d,enclosingRef:s,context:o}),h):r.selectionSet?u(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:d,enclosingRef:rt(d)?d:s,context:o}),h):(globalThis.__DEV__!==!1&&qU(o.store,r,d),d)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:a}},t}();function WU(t){try{JSON.stringify(t,function(e,n){if(typeof n=="string")throw n;return n})}catch(e){return e}}function qU(t,e,n){if(!e.selectionSet){var r=new Set([n]);r.forEach(function(i){Et(i)&&(oe(!rt(i),10,$U(t,i),e.name.value),Object.values(i).forEach(r.add,r))})}}var wb=new Xv,ET=new WeakMap;function yc(t){var e=ET.get(t);return e||ET.set(t,e={vars:new Set,dep:jN()}),e}function wT(t){yc(t).vars.forEach(function(e){return e.forgetCache(t)})}function zU(t){yc(t).vars.forEach(function(e){return e.attachCache(t)})}function Tb(t){var e=new Set,n=new Set,r=function(s){if(arguments.length>0){if(t!==s){t=s,e.forEach(function(l){yc(l).dep.dirty(r),QU(l)});var o=Array.from(n);n.clear(),o.forEach(function(l){return l(t)})}}else{var a=wb.getValue();a&&(i(a),yc(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),yc(s).vars.add(r),r};return r.forgetCache=function(s){return e.delete(s)},r}function QU(t){t.broadcastWatches&&t.broadcastWatches()}var TT=Object.create(null);function Sb(t){var e=JSON.stringify(t);return TT[e]||(TT[e]=Object.create(null))}function ST(t){var e=Sb(t);return e.keyFieldsFn||(e.keyFieldsFn=function(n,r){var i=function(o,a){return r.readField(a,o)},s=r.keyObject=Ob(t,function(o){var a=Ma(r.storeObject,o,i);return a===void 0&&n!==r.storeObject&&Yt.call(n,o[0])&&(a=Ma(n,o,dA)),oe(a!==void 0,4,o.join("."),n),a});return"".concat(r.typename,":").concat(JSON.stringify(s))})}function OT(t){var e=Sb(t);return e.keyArgsFn||(e.keyArgsFn=function(n,r){var i=r.field,s=r.variables,o=r.fieldName,a=Ob(t,function(u){var d=u[0],h=d.charAt(0);if(h==="@"){if(i&&Yn(i.directives)){var p=d.slice(1),g=i.directives.find(function(w){return w.name.value===p}),y=g&&au(g,s);return y&&Ma(y,u.slice(1))}return}if(h==="$"){var b=d.slice(1);if(s&&Yt.call(s,b)){var _=u.slice(0);return _[0]=b,Ma(s,_)}return}if(n)return Ma(n,u)}),l=JSON.stringify(a);return(n||l!=="{}")&&(o+=":"+l),o})}function Ob(t,e){var n=new Ji;return fA(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 fA(t){var e=Sb(t);if(!e.paths){var n=e.paths=[],r=[];t.forEach(function(i,s){kt(i)?(fA(i).forEach(function(o){return n.push(r.concat(o))}),r.length=0):(r.push(i),kt(t[s+1])||(n.push(r.slice(0)),r.length=0))})}return e.paths}function dA(t,e){return t[e]}function Ma(t,e,n){return n=n||dA,hA(e.reduce(function r(i,s){return kt(i)?i.map(function(o){return r(o,s)}):i&&n(i,s)},t))}function hA(t){return Et(t)?kt(t)?t.map(hA):Ob(Object.keys(t).sort(),function(e){return Ma(t,e)}):t}function cy(t){return t.args!==void 0?t.args:t.field?au(t.field,t.variables):null}var GU=function(){},kT=function(t,e){return e.fieldName},NT=function(t,e,n){var r=n.mergeObjects;return r(t,e)},AT=function(t,e){return e},HU=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=D({dataIdFromObject:Nh},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=D(D({},n),{typename:s,storeObject:o,readField:n&&n.readField||function(){var p=kb(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(D(D({},e),o),a);if(kt(h))d=ST(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=Rn(i,["queryType","mutationType","subscriptionType"]);s&&n.setRootTypename("Query",r),o&&n.setRootTypename("Mutation",r),a&&n.setRootTypename("Subscription",r),Yt.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?NT:u===!1?AT:l.merge}a(i,n.merge),i.keyFn=s===!1?GU:kt(s)?ST(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?kT:kt(h)?OT(h):typeof h=="function"?h:u.keyFn,typeof p=="function"&&(u.read=p),a(u,g)}u.read&&u.merge&&(u.keyFn=u.keyFn||kT)})},t.prototype.setRootTypename=function(e,n){n===void 0&&(n=e);var r="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[r];n!==i&&(oe(!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(lA);(!s||s[0]!==i)&&n.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var n=this;if(!Yt.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=Rn(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&&oe.warn(6,n,o),a.add(o)),!0;g.forEach(u),d&&p===l.length-1&&ly(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=cy(e);o;){var u=o(l,a);if(kt(u))o=OT(u);else{s=u||r;break}}return s===void 0&&(s=e.field?NN(e.field,e.variables):Kv(r,cy(e))),s===!1?r:r===js(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=js(o),l=n.store.getFieldValue(r,o),u=this.getFieldPolicy(e.typename,a,!1),d=u&&u.read;if(d){var h=IT(this,r,e,n,n.store.getStorage(rt(r)?r.__ref:r,o));return wb.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===NT?pA(i.store)(e,n):l===AT?n:(i.overwrite&&(e=void 0),l(e,n,IT(this,void 0,{typename:a,fieldName:o.name.value,field:o,variables:i.variables},i,s||Object.create(null))))},t}();function IT(t,e,n,r,i){var s=t.getStoreFieldName(n),o=js(s),a=n.variables||r.variables,l=r.store,u=l.toReference,d=l.canRead;return{args:cy(n),field:n.field||null,fieldName:o,storeFieldName:s,variables:a,isReference:rt,toReference:u,storage:i,cache:t.cache,canRead:d,readField:function(){return t.readField(kb(arguments,e,a),r)},mergeObjects:pA(r.store)}}function kb(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=D({},r),Yt.call(o,"from")||(o.from=e)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&oe.warn(7,nv(Array.from(t))),o.variables===void 0&&(o.variables=n),o}function pA(t){return function(n,r){if(kt(n)||kt(r))throw Pn(8);if(Et(n)&&Et(r)){var i=t.getFieldValue(n,"__typename"),s=t.getFieldValue(r,"__typename"),o=i&&s&&i!==s;if(o)return r;if(rt(n)&&Aa(r))return t.merge(n.__ref,r),n;if(Aa(n)&&rt(r))return t.merge(n,r.__ref),r;if(Aa(n)&&Aa(r))return D(D({},n),r)}return r}}function jm(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:D(D({},t),{clientOnly:e,deferred:n})),i}var KU=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=Qo(i),d=LU();a=D(D({},mh(u)),a);var h=D(D({store:e,written:Object.create(null),merge:function(g,y){return d.merge(g,y)},variables:a,varString:Dr(a)},cA(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(!rt(p))throw Pn(11,s);return h.incomingById.forEach(function(g,y){var b=g.storeObject,_=g.mergeTree,w=g.fieldNodeSet,O=Bi(y);if(_&&_.map.size){var N=r.applyMerges(_,O,b,h);if(rt(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[js(B)]===!0},M=function(B){var Q=_&&_.map.get(B);return!!(Q&&Q.info&&Q.info.merge)};Object.keys(b).forEach(function(B){P(B)&&!M(B)&&JU(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]||vd(i,s,o.fragmentMap)||r&&o.store.get(r,"__typename");typeof d=="string"&&(u.__typename=d);var h=function(){var N=kb(arguments,u,o.variables);if(rt(N.from)){var I=o.incomingById.get(N.from.__ref);if(I){var P=l.readField(D(D({},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,M=Hi(I),B=i[M];if(p.add(I),B!==void 0){var Q=l.getStoreFieldName({typename:d,fieldName:I.name.value,field:I,variables:N.variables}),x=xT(a,Q),U=n.processFieldValue(B,I,I.selectionSet?jm(N,!1,!1):N,x),Te=void 0;I.selectionSet&&(rt(U)||Aa(U))&&(Te=h("__typename",U));var ke=l.getMergeFunction(d,I.name.value,Te);ke?x.info={field:I,typename:d,merge:ke}:CT(a,Q),u=N.merge(u,(P={},P[Q]=U,P))}else globalThis.__DEV__!==!1&&!N.clientOnly&&!N.deferred&&!bh.added(I)&&!l.getReadFunction(d,I.name.value)&&globalThis.__DEV__!==!1&&oe.error(12,Hi(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 _=Bi(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=uy(O.mergeTree,a),p.forEach(function(N){return O.fieldNodeSet.add(N)})):o.incomingById.set(r,{storeObject:u,mergeTree:Td(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?ub(e):e:kt(e)?e.map(function(o,a){var l=s.processFieldValue(o,n,r,xT(i,a));return CT(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=vd(n,e,r.fragmentMap));var s=new Map,o=this.cache.policies,a=new qo(!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(ol(p,r.variables)){var g=d.clientOnly,y=d.deferred;if(!(g&&y)&&Yn(p.directives)&&p.directives.forEach(function(w){var O=w.name.value;if(O==="client"&&(g=!0),O==="defer"){var N=au(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,jm(r,g,y))}else{var _=ou(p,r.lookupFragment);if(!_&&p.kind===k.FRAGMENT_SPREAD)throw Pn(13,p.name.value);_&&o.fragmentMatches(_,i,n,r.variables)&&l(_.selectionSet,jm(r,g,y))}}}))}(e,r),s},t.prototype.applyMerges=function(e,n,r,i,s){var o,a=this;if(e.map.size&&!rt(r)){var l=!kt(r)&&(rt(n)||Aa(n))?n:void 0,u=r;l&&!s&&(s=[rt(l)?l.__ref:l]);var d,h=function(p,g){return kt(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&&oe(s.pop()===g)}}),d&&(r=kt(u)?u.slice(0):D({},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}(),mA=[];function xT(t,e){var n=t.map;return n.has(e)||n.set(e,mA.pop()||{map:new Map}),n.get(e)}function uy(t,e){if(t===e||!e||Td(e))return t;if(!t||Td(t))return e;var n=t.info&&e.info?D(D({},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,uy(a,e.map.get(l))),o.delete(l)}),o.forEach(function(a){s.map.set(a,uy(e.map.get(a),t.map.get(a)))})}return s}function Td(t){return!t||!(t.info||t.map.size)}function CT(t,e){var n=t.map,r=n.get(e);r&&Td(r)&&(mA.push(r),n.delete(e))}var DT=new Set;function JU(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&&!rt(s)&&!qe(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=js(n),u="".concat(a,".").concat(l);if(!DT.has(u)){DT.add(u);var d=[];!kt(s)&&!kt(o)&&[s,o].forEach(function(h){var p=r.getFieldValue(h,"__typename");typeof p=="string"&&!d.includes(p)&&d.push(p)}),globalThis.__DEV__!==!1&&oe.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,D({},s),D({},o))}}}}var Nb=function(t){Br(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.watches=new Set,r.addTypenameTransform=new cu(bh),r.assumeImmutableResults=!0,r.makeVar=Tb,r.txCount=0,r.config=FU(n),r.addTypename=!!r.config.addTypename,r.policies=new HU({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 Mc.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 KU(this,this.storeReader=new UU({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:aA(this.config),canon:n?void 0:i&&i.canon,fragments:s}),s),this.maybeBroadcastWatch=xc(function(o,a){return r.broadcastWatch(o,a)},{max:this.config.resultCacheMaxSize||ei["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(o){var a=o.optimistic?r.optimisticData:r.data;if(gc(a)){var l=o.optimistic,u=o.id,d=o.variables;return a.makeCacheKey(o.query,o.callback,Dr({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(D(D({},n),{store:n.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(s){if(s instanceof kh)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(Yt.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(D(D({},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||zU(this),this.watches.add(n),n.immediate&&this.maybeBroadcastWatch(n),function(){r.watches.delete(n)&&!r.watches.size&&wT(r),r.maybeBroadcastWatch.forget(n)}},e.prototype.gc=function(n){var r;Dr.reset(),al.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(rt(n))return n.__ref;try{return this.policies.identify(n)[0]}catch(r){globalThis.__DEV__!==!1&&oe.warn(r)}},e.prototype.evict=function(n){if(!n.id){if(Yt.call(n,"id"))return!1;n=D(D({},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(),Dr.reset(),n&&n.discardWatches?(this.watches.forEach(function(i){return r.maybeBroadcastWatch.forget(i)}),this.watches.clear(),wT(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(D(D({},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(D(D({},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||!qe(i.result,s.result))&&n.callback(n.lastDiff=s,i)},e}(Oh);globalThis.__DEV__!==!1&&(Nb.prototype.getMemoryInternals=XB);var He;(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"})(He||(He={}));function Pc(t){return t?t<7:!1}function gA(t){return t===7||t===8}var RT=Object.assign,YU=Object.hasOwnProperty,Fc=function(t){Br(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=XU)}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=Bm(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=D(D({},s),{initialFetchPolicy:y,fetchPolicy:p}),o.queryId=i.queryId||r.generateQueryId();var b=Qo(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||He.ready,s=D(D({},r),{loading:Pc(i),networkStatus:i}),o=this.options.fetchPolicy,a=o===void 0?"cache-first":o;if(!(Bm(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),qe(s.data,{})&&(s.data=void 0),l.complete?(delete s.partial,l.complete&&s.networkStatus===He.loading&&(a==="cache-first"||a==="cache-only")&&(s.networkStatus=He.ready,s.loading=!1)):s.partial=!0,globalThis.__DEV__!==!1&&!l.complete&&!this.options.partialRefetch&&!s.loading&&!s.data&&!s.error&&vA(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?!sA(this.query,this.last.result,n,this.variables):!qe(this.last.result,n);return i||r&&!qe(this.last.variables,r)},e.prototype.getLast=function(n,r){var i=this.last;if(i&&i[n]&&(!r||qe(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&&YU.call(n,"variables")){var o=Jv(this.query),a=o.variableDefinitions;(!a||!a.some(function(l){return l.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&oe.warn(20,n,((r=o.name)===null||r===void 0?void 0:r.value)||o)}return n&&!qe(this.options.variables,n)&&(i.variables=this.options.variables=D(D({},this.options.variables),n)),this.queryInfo.resetLastWrite(),this.reobserve(i,He.refetch)},e.prototype.fetchMore=function(n){var r=this,i=D(D({},n.query?n:D(D(D(D({},this.options),{query:this.options.query}),n),{variables:D(D({},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=He.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var l=new Set,u=n==null?void 0:n.updateQuery,d=this.options.fetchPolicy!=="no-cache";return d||oe(u,21),this.queryManager.fetchQuery(s,i,He.fetchMore).then(function(h){if(r.queryManager.removeQuery(s),o.networkStatus===He.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(D(D({},p),{data:g}),r.variables)}return h}).finally(function(){d&&!l.has(r.query)&&yA(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&&oe.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=Vs(this.options,n||{});RT(this.options,r)},e.prototype.setVariables=function(n){return qe(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},He.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)){oe(s,23);var o=i||(this.pollingInfo={});o.interval=s;var a=function(){var u,d;n.pollingInfo&&(!Pc(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"},He.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&&!qe(r,this.last.variables)&&(i=void 0),this.last=D({result:this.queryManager.assumeImmutableResults?n:ub(n),variables:r},i?{error:i}:null)},e.prototype.reobserveAsConcast=function(n,r){var i=this;this.isTornDown=!1;var s=r===He.refetch||r===He.fetchMore||r===He.poll,o=this.options.variables,a=this.options.fetchPolicy,l=Vs(this.options,n||{}),u=s?l:RT(this.options,l),d=this.transformDocument(u.query);this.lastQuery=d,s||(this.updatePolling(),n&&n.variables&&!qe(n.variables,o)&&u.fetchPolicy!=="standby"&&(u.fetchPolicy===a||typeof u.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",u),r===void 0&&(r=He.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Bm(u.fetchPolicy));var h=function(){i.concast===y&&(i.waitForOwnResult=!1)},p=u.variables&&D({},u.variables),g=this.fetch(u,r,d),y=g.concast,b=g.fromLink,_={next:function(w){qe(i.variables,p)&&(h(),i.reportResult(w,p))},error:function(w){qe(i.variables,p)&&(Eh(w)||(w=new wn({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)&&Ra(this.observers,"next",n)},e.prototype.reportError=function(n,r){var i=D(D({},this.getLastResult()),{error:n,errors:n.graphQLErrors,networkStatus:He.error,loading:!1});this.updateLastResult(i,r),Ra(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}(et);fb(Fc);function yA(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 XU(t){globalThis.__DEV__!==!1&&oe.error(24,t.message,t.stack)}function vA(t){globalThis.__DEV__!==!1&&t&&globalThis.__DEV__!==!1&&oe.debug(25,t)}function Bm(t){return t==="network-only"||t==="no-cache"||t==="standby"}var Ia=new(Qs?WeakMap:Map);function Um(t,e){var n=t[e];typeof n=="function"&&(t[e]=function(){return Ia.set(t,(Ia.get(t)+1)%1e15),n.apply(this,arguments)})}function MT(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Wm=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;Ia.has(r)||(Ia.set(r,0),Um(r,"evict"),Um(r,"modify"),Um(r,"reset"))}return t.prototype.init=function(e){var n=e.networkStatus||He.loading;return this.variables&&this.networkStatus!==He.loading&&!qe(this.variables,e.variables)&&(n=He.setVariables),qe(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(){MT(this),this.dirty=!1},t.prototype.resetDiff=function(){this.lastDiff=void 0},t.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&qe(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&&!qe(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():yA(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;MT(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(Pc(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=D(D({},this.getDiffOptions(e)),{watcher:this,callback:function(s){return n.setDiff(s)}});(!this.lastWatch||!qe(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===Ia.get(this.cache)&&qe(n,r.variables)&&qe(e.data,r.result.data))},t.prototype.markResult=function(e,n,r,i){var s=this,o=new Ji,a=Yn(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Yn(e.incremental)){var l=db(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&&(fy(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:Ia.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&&qe(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=He.ready},t.prototype.markError=function(e){return this.networkStatus=He.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function fy(t,e){e===void 0&&(e="none");var n=e==="ignore"||e==="all",r=!pc(t);return!r&&n&&t.data&&(r=!0),r}var ZU=Object.prototype.hasOwnProperty,PT=Object.create(null),eW=function(){function t(e){var n=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new ph(ei["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new qo(!1);var r=new cu(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(Pn(26))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(n){return n(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){return vs(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,M=n.errorPolicy,B=M===void 0?((u=this.defaultOptions.mutate)===null||u===void 0?void 0:u.errorPolicy)||"none":M,Q=n.keepRootFields,x=n.context;return bs(this,function(U){switch(U.label){case 0:return oe(d,27),oe(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(Te,ke){return Hf(a.getObservableFromLink(d,D(D({},x),{optimisticResponse:o?p:void 0}),h,{},!1),function(he){if(pc(he)&&B==="none")throw new wn({graphQLErrors:Ed(he)});s&&(s.loading=!1,s.error=null);var Ce=D({},he);return typeof b=="function"&&(b=b(Ce)),B==="ignore"&&pc(Ce)&&delete Ce.errors,a.markMutationResult({mutationId:r,result:Ce,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(he){a.broadcastQueries(),(!("hasNext"in he)||he.hasNext===!1)&&Te(he)},error:function(he){s&&(s.loading=!1,s.error=he),o&&a.cache.removeOptimistic(r),a.broadcastQueries(),ke(he instanceof wn?he:new wn({networkError:he}))}})})]}})})},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&&fy(i,e.errorPolicy)){if(Oo(i)||s.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Oo(i)&&Yn(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=db(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||!ZU.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 M=b(I,{mutationResult:i,queryName:w&&bd(w)||void 0,queryVariables:O});M&&s.push({result:M,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=!KN(i)||Oo(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=D(D({},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:PT}):e;return i===PT?!1:(this.cache.recordOptimisticTransaction(function(s){try{r.markMutationResult(D(D({},n),{result:{data:i}}),s)}catch(o){globalThis.__DEV__!==!1&&oe.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:pN(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:$s(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:vh([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:mh(Qo(e)),asQuery:D(D({},e),{definitions:e.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?D(D({},i),{operation:"query"}):i})})};n.set(e,r)}return n.get(e)},t.prototype.getVariables=function(e,n){return D(D({},this.getDocumentInfo(e).defaultVars),n)},t.prototype.watchQuery=function(e){var n=this.transform(e.query);e=D(D({},e),{variables:this.getVariables(n,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Wm(this),i=new Fc({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()),oe(e.query,29),oe(e.query.kind==="Document",30),oe(!e.returnPartialData,31),oe(!e.pollInterval,32),this.fetchQuery(n,D(D({},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(Pn(33)),this.queries.forEach(function(n){n.observableQuery?n.networkStatus=He.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):kN(o)?i.set(n.transform(o),!1):Et(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=ad("legacyOneTimeQuery"),l=n.getQuery(a).init({document:o.query,variables:o.variables}),u=new Fc({queryManager:n,queryInfo:l,options:D(D({},o),{fetchPolicy:"network-only"})});oe(u.queryId===a),l.setObservableQuery(u),r.set(a,u)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(o,a){o||globalThis.__DEV__!==!1&&oe.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"&&(fy(b,o)&&n.cache.write({query:r,result:b.data,dataId:"ROOT_SUBSCRIPTION",variables:y}),n.broadcastQueries());var _=pc(b),w=EU(b);if(_||w){var O={};if(_&&(O.graphQLErrors=b.errors),w&&(O.protocolErrors=b.extensions[mb]),o==="none"||w)throw new wn(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 et(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:bd(d)||void 0,context:this.prepareContext(D(D({},n),{forceFetch:!s})),extensions:i};if(n=b.context,s){var _=al(d),w=Dr(r),O=g.lookup(_,w);if(l=O.observable,!l){var N=new go([Dc(y,b)]);l=O.observable=N,N.beforeNext(function(){g.remove(_,w)})}}else l=new go([Dc(y,b)])}else l=new go([et.of({data:{}})]),n=this.prepareContext(n);return h&&(l=Hf(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 Hf(this.getObservableFromLink(s,r.context,r.variables),function(o){var a=Ed(o),l=a.length>0,u=r.errorPolicy;if(i>=e.lastRequestId){if(l&&u==="none")throw e.markError(new wn({graphQLErrors:a}));e.markResult(o,s,r,n),e.markReady()}var d={data:o.data,loading:!1,networkStatus:He.ready};return l&&u==="none"&&(d.data=void 0),l&&u!=="ignore"&&(d.errors=a,d.networkStatus=He.error),d},function(o){var a=Eh(o)?o:new wn({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=He.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 M.cancel(x)})});var M,B;if(this.getDocumentInfo(N.query).hasClientExports)M=new go(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,M=new go(Q.sources)}return M.promise.then(P,P),{concast:M,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?ad("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 Wm&&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||He.loading);var M=I.result;globalThis.__DEV__!==!1&&!d&&!qe(M,{})&&vA(I.missing);var B=function(Q){return et.of(D({data:Q,loading:Pc(P),networkStatus:P},I.complete?null:{partial:!0}))};return M&&i.getDocumentInfo(s).hasForcedResolvers?i.localState.runResolvers({document:s,remoteResult:{data:M},context:h,variables:o,onlyRunForcedResolvers:!0}).then(function(Q){return B(Q.data||void 0)}):u==="none"&&P===He.refetch&&Array.isArray(I.missing)?B(void 0):B(M)},_=a==="no-cache"?0:r===He.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&&Pc(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 Wm(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var n=this.localState.prepareContext(e);return D(D(D({},this.defaultContext),n),{clientAwareness:this.clientAwareness})},t}(),tW=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=Cc(n.resolvers,r)}):this.resolvers=Cc(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 vs(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 bs(this,function(u){return r?[2,this.resolveDocument(r,i.data,s,o,this.fragmentMatcher,l).then(function(d){return D(D({},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 $s(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return rb(e)},t.prototype.prepareContext=function(e){var n=this.cache;return D(D({},e),{cache:n,getCacheKey:function(r){return n.identify(r)}})},t.prototype.addExportedVariables=function(e){return vs(this,arguments,void 0,function(n,r,i){return r===void 0&&(r={}),i===void 0&&(i={}),bs(this,function(s){return n?[2,this.resolveDocument(n,this.buildRootValueFromCache(n,r)||{},this.prepareContext(i),r).then(function(o){return D(D({},r),o.exportedVariables)})]:[2,D({},r)]})})},t.prototype.shouldForceResolvers=function(e){var n=!1;return hn(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 Os}}}),n},t.prototype.buildRootValueFromCache=function(e,n){return this.cache.diff({query:UN(e),variables:n,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,n){return vs(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),bs(this,function(I){return u=Go(r),d=lu(r),h=su(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:D(D({},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 vs(this,void 0,void 0,function(){var s,o,a,l,u,d=this;return bs(this,function(h){return s=i.fragmentMap,o=i.context,a=i.variables,l=[r],u=function(p){return vs(d,void 0,void 0,function(){var g,y;return bs(this,function(b){return!n&&!i.selectionsToResolve.has(p)?[2]:ol(p,a)?Ki(p)?[2,this.resolveField(p,n,r,i).then(function(_){var w;typeof _<"u"&&l.push((w={},w[Hi(p)]=_,w))})]:(AN(p)?g=p:(g=s[p.name.value],oe(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 ll(l)})]})})},t.prototype.resolveField=function(e,n,r,i){return vs(this,void 0,void 0,function(){var s,o,a,l,u,d,h,p,g,y=this;return bs(this,function(b){return r?(s=i.variables,o=e.name.value,a=Hi(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(wb.withValue(this.cache,g,[r,au(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),hn(o,{Directive:function(l,u,d,h,p){l.name.value==="client"&&p.forEach(function(g){r(g)&&zg(g)&&a.add(g)})},FragmentSpread:function(l,u,d,h,p){var g=n[l.name.value];oe(g,19,l.name.value);var y=s(g);y.size>0&&(p.forEach(function(b){r(b)&&zg(b)&&a.add(b)}),a.add(l),y.forEach(function(b){a.add(b)}))}})}return i.get(o)}return s(e)},t}(),FT=!1,Ah=function(){function t(e){var n=this,r;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw Pn(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,M=e.fragmentMatcher,B=e.name,Q=e.version,x=e.devtools,U=e.link;U||(U=i?new Sh({uri:i,credentials:s,headers:o}):Vn.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=D(D({},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=tv,this.localState=new tW({cache:a,client:this,resolvers:I,fragmentMatcher:M}),this.queryManager=new eW({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,!FT&&globalThis.__DEV__!==!1&&(FT=!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&&oe.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=gi(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=D(D({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=gi(this.defaultOptions.query,e)),oe(e.fetchPolicy!=="cache-and-network",16),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=D(D({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=gi(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 Dc(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&&oe.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&&(Ah.prototype.getMemoryInternals=YB);var Yf=new Map,dy=new Map,bA=!0,Sd=!1;function _A(t){return t.replace(/[\s,]+/g," ").trim()}function nW(t){return _A(t.source.body.substring(t.start,t.end))}function rW(t){var e=new Set,n=[];return t.definitions.forEach(function(r){if(r.kind==="FragmentDefinition"){var i=r.name.value,s=nW(r.loc),o=dy.get(i);o&&!o.has(s)?bA&&console.warn("Warning: fragment with name "+i+` already exists.
213
+ graphql-tag enforces all fragment names across your application to be unique; read more about
214
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||dy.set(i,o=new Set),o.add(s),e.has(s)||(e.add(s),n.push(r))}else n.push(r)}),D(D({},t),{definitions:n})}function iW(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 sW(t){var e=_A(t);if(!Yf.has(e)){var n=Kc(t,{experimentalFragmentVariables:Sd,allowLegacyFragmentVariables:Sd});if(!n||n.kind!=="Document")throw new Error("Not a valid GraphQL document.");Yf.set(e,iW(rW(n)))}return Yf.get(e)}function Po(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]}),sW(r)}function Ab(){Yf.clear(),dy.clear()}function Ib(){bA=!1}function xb(){Sd=!0}function Cb(){Sd=!1}var Yl={gql:Po,resetCaches:Ab,disableFragmentWarnings:Ib,enableExperimentalFragmentVariables:xb,disableExperimentalFragmentVariables:Cb};(function(t){t.gql=Yl.gql,t.resetCaches=Yl.resetCaches,t.disableFragmentWarnings=Yl.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Yl.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Yl.disableExperimentalFragmentVariables})(Po||(Po={}));Po.default=Po;ev(globalThis.__DEV__!==!1?"log":"silent");const oW=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:Oh,ApolloClient:Ah,ApolloError:wn,ApolloLink:Vn,get Cache(){return wd},DocumentTransform:cu,HttpLink:Sh,InMemoryCache:Nb,MissingFieldError:kh,get NetworkStatus(){return He},Observable:et,ObservableQuery:Fc,checkFetcher:vb,concat:tA,createHttpLink:Eb,createSignalIfSupported:iA,defaultDataIdFromObject:Nh,defaultPrinter:wh,disableExperimentalFragmentVariables:Cb,disableFragmentWarnings:Ib,empty:eA,enableExperimentalFragmentVariables:xb,execute:Dc,fallbackHttpConfig:yb,from:hb,fromError:mc,fromPromise:ZN,get gql(){return Po},isApolloError:Eh,isNetworkRequestSettled:gA,isReference:rt,makeReference:Bi,makeVar:Tb,mergeOptions:gi,parseAndCheckHttpResponse:gb,resetCaches:Ab,rewriteURIForGET:_b,selectHttpOptionsAndBody:rA,selectHttpOptionsAndBodyInternal:Th,selectURI:bb,serializeFetchParameter:Rc,setLogVerbosity:ev,split:pb,throwServerError:_h,toPromise:XN},Symbol.toStringTag,{value:"Module"}));var EA={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,ce)})(EA);var Z=EA.exports;const aW=BL(Z),Db=jL({__proto__:null,default:aW},[Z]);var $T=hh?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function cl(){oe("createContext"in Db,46);var t=Z.createContext[$T];return t||(Object.defineProperty(Z.createContext,$T,{value:t=Z.createContext({}),enumerable:!1,writable:!1,configurable:!0}),t.displayName="ApolloContext"),t}var lW=cl,cW=function(t){var e=cl();return Z.createElement(e.Consumer,null,function(n){return oe(n&&n.client,45),t.children(n.client)})},wA=function(t){var e=t.client,n=t.children,r=cl(),i=Z.useContext(r),s=Z.useMemo(function(){return D(D({},i),{client:e||i.client})},[i,e]);return oe(s.client,47),Z.createElement(r.Provider,{value:s},n)};function Zn(t){var e=Z.useContext(cl()),n=t||e.client;return oe(!!n,50),n}var LT=!1,uW="useSyncExternalStore",fW=Db[uW],uu=fW||function(t,e,n){var r=e();globalThis.__DEV__!==!1&&!LT&&r!==e()&&(LT=!0,globalThis.__DEV__!==!1&&oe.error(60));var i=Z.useState({inst:{value:r,getSnapshot:e}}),s=i[0].inst,o=i[1];return vN?Z.useLayoutEffect(function(){Object.assign(s,{value:r,getSnapshot:e}),qm(s)&&o({inst:s})},[t,r,e]):Object.assign(s,{value:r,getSnapshot:e}),Z.useEffect(function(){return qm(s)&&o({inst:s}),t(function(){qm(s)&&o({inst:s})})},[t]),r};function qm(t){var e=t.value,n=t.getSnapshot;try{return e!==n()}catch{return!0}}var fr;(function(t){t[t.Query=0]="Query",t[t.Mutation=1]="Mutation",t[t.Subscription=2]="Subscription"})(fr||(fr={}));var bo;function hy(t){var e;switch(t){case fr.Query:e="Query";break;case fr.Mutation:e="Mutation";break;case fr.Subscription:e="Subscription";break}return e}function Rb(t){bo||(bo=new ph(ei.parser||1e3));var e=bo.get(t);if(e)return e;var n,r,i;oe(!!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}}oe(!s.length||o.length||a.length||l.length,63),oe(o.length+a.length+l.length<=1,64,t,o.length,l.length,a.length),r=o.length?fr.Query:fr.Mutation,!o.length&&!a.length&&(r=fr.Subscription);var p=o.length?o:a.length?a:l;oe(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 bo.set(t,y),y}Rb.resetCache=function(){bo=void 0};globalThis.__DEV__!==!1&&Hv("parser",function(){return bo?bo.size:0});function Ih(t,e){var n=Rb(t),r=hy(e),i=hy(n.type);oe(n.type===e,66,r,r,i)}function Mb(t,e){var n=Z.useRef();return(!n.current||!qe(n.current.deps,e))&&(n.current={value:t(),deps:e}),n.current.value}var Od=Gv?Z.useLayoutEffect:Z.useEffect,zm;function dW(){}function hW(){return zm||(zm=Z.createContext(null)),Z.useCallback(function(){var t=console.error;try{return console.error=dW,Z.useContext(zm),!0}catch{return!1}finally{console.error=t}},[])}var pW="use",mW=Db[pW],TA=mW||function(e){var n=cb(e);switch(n.status){case"pending":throw n;case"rejected":throw n.reason;case"fulfilled":return n.value}},gW=Symbol.for("apollo.hook.wrappers");function Ho(t,e,n){var r=n.queryManager,i=r&&r[gW],s=i&&i[t];return s?s(e):e}var yW=Object.prototype.hasOwnProperty;function VT(){}var Xf=Symbol();function xh(t,e){return e===void 0&&(e=Object.create(null)),Ho("useQuery",vW,Zn(e&&e.client))(t,e)}function vW(t,e){var n=SA(t,e),r=n.result,i=n.obsQueryFields;return Z.useMemo(function(){return D(D({},r),i)},[r,i])}function bW(t,e,n,r,i){function s(h){var p;Ih(e,fr.Query);var g={client:t,query:e,observable:r&&r.getSSRObservable(i())||t.watchQuery(Pb(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=Z.useState(s),a=o[0],l=o[1];function u(h){var p,g;Object.assign(a.observable,(p={},p[Xf]=h,p));var y=a.resultData;l(D(D({},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 SA(t,e){var n=Zn(e.client),r=Z.useContext(cl()).renderPromises,i=!!r,s=n.disableNetworkFetches,o=e.ssr!==!1&&!e.skip,a=e.partialRefetch,l=OA(n,t,e,i),u=bW(n,t,e,r,l),d=u[0],h=d.observable,p=d.resultData,g=u[1],y=l(h);wW(p,h,n,e,y);var b=Z.useMemo(function(){return OW(h)},[h]);EW(h,r,o);var _=_W(p,h,n,e,y,s,a,i,{onCompleted:e.onCompleted||VT,onError:e.onError||VT});return{result:_,obsQueryFields:b,observable:h,resultData:p,client:n,onQueryExecuted:g}}function _W(t,e,n,r,i,s,o,a,l){var u=Z.useRef(l);Z.useEffect(function(){u.current=l});var d=(a||s)&&r.ssr===!1&&!r.skip?NA:r.skip||i.fetchPolicy==="standby"?AA:void 0,h=t.previousData,p=Z.useMemo(function(){return d&&kd(d,h,e,n)},[n,e,d,h]);return uu(Z.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&&qe(w.data,O.data)||py(O,t,e,n,o,g,u.current)},b=function(w){if(_.current.unsubscribe(),_.current=e.resubscribeAfterError(y,b),!yW.call(w,"graphQLErrors"))throw w;var O=t.current;(!O||O&&O.loading||!qe(w,O.error))&&py({data:O&&O.data,error:w,loading:!1,networkStatus:He.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||jT(t,e,u.current,o,n)},function(){return p||jT(t,e,u.current,o,n)})}function EW(t,e,n){e&&n&&(e.registerSSRObservable(t),t.getCurrentResult().loading&&e.addObservableQueryPromise(t))}function wW(t,e,n,r,i){var s;e[Xf]&&!qe(e[Xf],i)&&(e.reobserve(Pb(e,n,r,i)),t.previousData=((s=t.current)===null||s===void 0?void 0:s.data)||t.previousData,t.current=void 0),e[Xf]=i}function OA(t,e,n,r){n===void 0&&(n={});var i=n.skip;n.ssr,n.onCompleted,n.onError;var s=n.defaultOptions,o=Rn(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||my(s,t.defaultOptions),l.fetchPolicy="standby"):l.fetchPolicy||(l.fetchPolicy=(a==null?void 0:a.options.initialFetchPolicy)||my(s,t.defaultOptions)),l}}function Pb(t,e,n,r){var i=[],s=e.defaultOptions.watchQuery;return s&&i.push(s),n.defaultOptions&&i.push(n.defaultOptions),i.push(Vs(t&&t.options,r)),i.reduce(gi)}function py(t,e,n,r,i,s,o){var a=e.current;a&&a.data&&(e.previousData=a.data),!t.error&&Yn(t.errors)&&(t.error=new wn({graphQLErrors:t.errors})),e.current=kd(SW(t,n,i),e.previousData,n,r),s(),TW(t,a==null?void 0:a.networkStatus,o)}function TW(t,e,n){if(!t.loading){var r=kA(t);Promise.resolve().then(function(){r?n.onError(r):t.data&&e!==t.networkStatus&&t.networkStatus===He.ready&&n.onCompleted(t.data)}).catch(function(i){globalThis.__DEV__!==!1&&oe.warn(i)})}}function jT(t,e,n,r,i){return t.current||py(e.getCurrentResult(),t,e,i,r,function(){},n),t.current}function my(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 kA(t){return Yn(t.errors)?new wn({graphQLErrors:t.errors}):t.error}function kd(t,e,n,r){var i=t.data;t.partial;var s=Rn(t,["data","partial"]),o=D(D({data:i},s),{client:r,observable:n,variables:n.variables,called:t!==NA&&t!==AA,previousData:e});return o}function SW(t,e,n){return t.partial&&n&&!t.loading&&(!t.data||Object.keys(t.data).length===0)&&e.options.fetchPolicy!=="cache-only"?(e.refetch(),D(D({},t),{loading:!0,networkStatus:He.refetch})):t}var NA=Ka({loading:!0,data:void 0,error:void 0,networkStatus:He.loading}),AA=Ka({loading:!1,data:void 0,error:void 0,networkStatus:He.ready});function OW(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 kW=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function Fb(t,e){var n,r=Z.useRef(),i=Z.useRef(),s=Z.useRef(),o=gi(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=D(D({},o),{skip:!r.current}),u=SA(a,l),d=u.obsQueryFields,h=u.result,p=u.client,g=u.resultData,y=u.observable,b=u.onQueryExecuted,_=y.options.initialFetchPolicy||my(l.defaultOptions,p.defaultOptions),w=Z.useReducer(function(Q){return Q+1},0)[1],O=Z.useMemo(function(){for(var Q={},x=function(he){var Ce=d[he];Q[he]=function(){return r.current||(r.current=Object.create(null),w()),Ce.apply(this,arguments)}},U=0,Te=kW;U<Te.length;U++){var ke=Te[U];x(ke)}return Q},[w,d]),N=!!r.current,I=Z.useMemo(function(){return D(D(D({},h),O),{called:N})},[h,O,N]),P=Z.useCallback(function(Q){r.current=Q?D(D({},Q),{fetchPolicy:Q.fetchPolicy||_}):{fetchPolicy:_};var x=gi(i.current,D({query:s.current},r.current)),U=NW(g,y,p,a,D(D({},x),{skip:!1}),b).then(function(Te){return Object.assign(Te,O)});return U.catch(function(){}),U},[p,a,O,_,y,g,b]),M=Z.useRef(P);Od(function(){M.current=P});var B=Z.useCallback(function(){for(var Q=[],x=0;x<arguments.length;x++)Q[x]=arguments[x];return M.current.apply(M,Q)},[]);return[B,I]}function NW(t,e,n,r,i,s){var o=i.query||r,a=OA(n,o,i,!1)(e),l=e.reobserveAsConcast(Pb(e,n,i,a));return s(a),new Promise(function(u){var d;l.subscribe({next:function(h){d=h},error:function(){u(kd(e.getCurrentResult(),t.previousData,e,n))},complete:function(){u(kd(d,t.previousData,e,n))}})})}function AW(t,e){var n=Zn(e==null?void 0:e.client);Ih(t,fr.Mutation);var r=Z.useState({called:!1,loading:!1,client:n}),i=r[0],s=r[1],o=Z.useRef({result:i,mutationId:0,isMounted:!0,client:n,mutation:t,options:e});Od(function(){Object.assign(o.current,{client:n,options:e,mutation:t})});var a=Z.useCallback(function(u){u===void 0&&(u={});var d=o.current,h=d.options,p=d.mutation,g=D(D({},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,_=gi(g,u);return y.mutate(_).then(function(w){var O,N,I=w.data,P=w.errors,M=P&&P.length>0?new wn({graphQLErrors:P}):void 0,B=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(M&&B&&B(M,_),b===o.current.mutationId&&!_.ignoreResults){var Q={called:!0,loading:!1,data:I,error:M,client:y};o.current.isMounted&&!qe(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 M||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};qe(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=Z.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 Z.useEffect(function(){var u=o.current;return u.isMounted=!0,function(){u.isMounted=!1}},[]),[a,D({reset:l},i)]}function IW(t,e){e===void 0&&(e=Object.create(null));var n=Z.useRef(!1),r=Zn(e.client);Ih(t,fr.Subscription),n.current||(n.current=!0,e.onSubscriptionData&&globalThis.__DEV__!==!1&&oe.warn(e.onData?53:54),e.onSubscriptionComplete&&globalThis.__DEV__!==!1&&oe.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=Mb(function(){return e.variables},[e.variables]),p=function(){return xW(r,t,h,s,o,l,u)},g=Z.useState(e.skip?null:p),y=g[0],b=g[1],_=Z.useRef(p);Od(function(){_.current=p}),i?y&&b(y=null):(!y||(r!==y.__.client||t!==y.__.query||s!==y.__.fetchPolicy||o!==y.__.errorPolicy||!qe(h,y.__.variables))&&(typeof a=="function"?!!a(e):a)!==!1)&&b(y=p());var w=Z.useRef(e);Z.useEffect(function(){w.current=e});var O=!i&&!d,N=Z.useMemo(function(){return{loading:O,error:void 0,data:void 0,variables:h}},[O,h]),I=Z.useRef(d);Od(function(){I.current=d});var P=uu(Z.useCallback(function(B){if(!y)return function(){};var Q=!1,x=y.__.variables,U=y.__.client,Te=y.subscribe({next:function(ke){var he,Ce;if(!Q){var ee={loading:!1,data:ke.data,error:kA(ke),variables:x};y.__.setResult(ee),I.current||B(),ee.error?(Ce=(he=w.current).onError)===null||Ce===void 0||Ce.call(he,ee.error):w.current.onData?w.current.onData({client:U,data:ee}):w.current.onSubscriptionData&&w.current.onSubscriptionData({client:U,subscriptionData:ee})}},error:function(ke){var he,Ce;ke=ke instanceof wn?ke:new wn({protocolErrors:[ke]}),Q||(y.__.setResult({loading:!1,data:void 0,error:ke,variables:x}),I.current||B(),(Ce=(he=w.current).onError)===null||Ce===void 0||Ce.call(he,ke))},complete:function(){Q||(w.current.onComplete?w.current.onComplete():w.current.onSubscriptionComplete&&w.current.onSubscriptionComplete())}});return function(){Q=!0,setTimeout(function(){Te.unsubscribe()})}},[y]),function(){return y&&!i&&!d?y.__.result:N},function(){return N}),M=Z.useCallback(function(){oe(!w.current.skip,57),b(_.current())},[w,_]);return Z.useMemo(function(){return D(D({},P),{restart:M})},[P,M])}function xW(t,e,n,r,i,s,o){var a={query:e,variables:n,fetchPolicy:r,errorPolicy:i,context:s,extensions:o},l=D(D({},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 et(function(d){u||(u=t.subscribe(a));var h=u.subscribe(d);return function(){return h.unsubscribe()}}),{__:l})}function CW(t){return uu(Z.useCallback(function(e){return t.onNextChange(function n(){e(),t.onNextChange(n)})},[t]),t,t)}function DW(t){return Ho("useFragment",RW,Zn(t.client))(t)}function RW(t){var e=Zn(t.client).cache,n=t.from,r=Rn(t,["from"]),i=Z.useMemo(function(){return typeof n=="string"?n:e.identify(n)},[e,n]),s=Mb(function(){return D(D({},r),{from:i})},[r,i]),o=Z.useMemo(function(){var l=s.fragment,u=s.fragmentName,d=s.from,h=s.optimistic,p=h===void 0?!0:h;return{result:MW(e.diff(D(D({},s),{returnPartialData:!0,id:d,query:e.getFragmentDoc(l,u),optimistic:p})))}},[s,e]),a=Z.useCallback(function(){return o.result},[o]);return uu(Z.useCallback(function(l){var u=0,d=e.watchFragment(s).subscribe({next:function(h){qe(h,o.result)||(o.result=h,clearTimeout(u),u=setTimeout(l))}});return function(){d.unsubscribe(),clearTimeout(u)}},[e,s,o]),a,a)}function MW(t){var e={data:t.result,complete:!!t.complete};return t.missing&&(e.missing=ll(t.missing.map(function(n){return n.missing}))),e}var $b=Symbol(),Lb=Symbol();function hi(t){var e,n=(e={toPromise:function(){return jb(n).then(function(){return n})}},e[$b]=t,e[Lb]=t.promise,e);return n}function Vb(t){oe(!t||$b in t,61)}function jb(t){var e=Ko(t);return e.promise.status==="fulfilled"?e.promise:t[Lb]}function Ko(t){return t[$b]}function $c(t,e){t[Lb]=e}var PW=["canonizeResults","context","errorPolicy","fetchPolicy","refetchWritePolicy","returnPartialData"],IA=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 PW.some(function(r){return r in e&&!qe(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=D(D({},this.result),this.observable.getCurrentResult()),this.promise=Gf(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=Gf(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=QN(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!qe(n.data,{})&&!qe(n,e.result)}).subscribe(this.handleNext,this.handleError)},t.prototype.setResult=function(){var e=this.observable.getCurrentResult(!1);qe(e,this.result)||(this.result=e,this.promise=e.data&&(!e.partial||this.watchQueryOptions.returnPartialData)?Gf(e):this.createPendingPromise())},t.prototype.createPendingPromise=function(){var e=this;return cb(new Promise(function(n,r){e.resolve=n,e.reject=r}))},t}(),FW=function(){function t(e){e===void 0&&(e=Object.create(null)),this.queryRefs=new qo(Qs),this.options=e}return t.prototype.getQueryRef=function(e,n){var r=this.queryRefs.lookupArray(e);return r.current||(r.current=new IA(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}(),Qm=Symbol.for("apollo.suspenseCache");function Bb(t){var e;return t[Qm]||(t[Qm]=new FW((e=t.defaultOptions.react)===null||e===void 0?void 0:e.suspense)),t[Qm]}var xA=Symbol.for("apollo.skipToken");function $W(t,e){return e===void 0&&(e=Object.create(null)),Ho("useSuspenseQuery",LW,Zn(typeof e=="object"?e.client:void 0))(t,e)}function LW(t,e){var n=Zn(e.client),r=Bb(n),i=Ub({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=Nt([t,Dr(o)],[].concat(l),!0),d=r.getQueryRef(u,function(){return n.watchQuery(i)}),h=Z.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)),Z.useEffect(function(){var I=d.retain(),P=d.listen(function(M){g([d.key,M])});return function(){P(),I()}},[d]);var b=Z.useMemo(function(){var I=gy(d.result);return{loading:!1,data:d.result.data,networkStatus:I?He.error:He.ready,error:I}},[d.result]),_=s==="standby"?b:TA(y),w=Z.useCallback(function(I){var P=d.fetchMore(I);return g([d.key,d.promise]),P},[d]),O=Z.useCallback(function(I){var P=d.refetch(I);return g([d.key,d.promise]),P},[d]),N=d.observable.subscribeToMore;return Z.useMemo(function(){return{client:n,data:_.data,error:gy(_),networkStatus:_.networkStatus,fetchMore:w,refetch:O,subscribeToMore:N}},[n,w,O,_,N])}function VW(t){var e=t.query,n=t.fetchPolicy,r=t.returnPartialData;Ih(e,fr.Query),jW(n),BW(n,r)}function jW(t){t===void 0&&(t="cache-first");var e=["cache-first","network-only","no-cache","cache-and-network"];oe(e.includes(t),58,t)}function BW(t,e){t==="no-cache"&&e&&globalThis.__DEV__!==!1&&oe.warn(59)}function gy(t){return Yn(t.errors)?new wn({graphQLErrors:t.errors}):t.error}function Ub(t){var e=t.client,n=t.query,r=t.options;return Mb(function(){var i;if(r===xA)return{query:n,fetchPolicy:"standby"};var s=r.fetchPolicy||((i=e.defaultOptions.watchQuery)===null||i===void 0?void 0:i.fetchPolicy)||"cache-first",o=D(D({},r),{fetchPolicy:s,query:n,notifyOnNetworkStatusChange:!1,nextFetchPolicy:void 0});return globalThis.__DEV__!==!1&&VW(o),r.skip&&(o.fetchPolicy="standby"),o},[e,r,n])}function UW(t,e){return e===void 0&&(e=Object.create(null)),Ho("useBackgroundQuery",WW,Zn(typeof e=="object"?e.client:void 0))(t,e)}function WW(t,e){var n=Zn(e.client),r=Bb(n),i=Ub({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=Z.useRef(s!=="standby");u.current||(u.current=s!=="standby");var d=Nt([t,Dr(o)],[].concat(l),!0),h=r.getQueryRef(d,function(){return n.watchQuery(i)}),p=Z.useState(hi(h)),g=p[0],y=p[1];if(Ko(g)!==h&&y(hi(h)),h.didChangeOptions(i)){var b=h.applyOptions(i);$c(g,b)}Z.useEffect(function(){var O=setTimeout(function(){h.disposed&&r.add(d,h)});return function(){return clearTimeout(O)}});var _=Z.useCallback(function(O){var N=h.fetchMore(O);return y(hi(h)),N},[h]),w=Z.useCallback(function(O){var N=h.refetch(O);return y(hi(h)),N},[h]);return Z.useEffect(function(){return h.softRetain()},[h]),[u.current?g:void 0,{fetchMore:_,refetch:w,subscribeToMore:h.observable.subscribeToMore}]}function qW(t,e){e===void 0&&(e=Object.create(null));var n=Zn(e.client),r=Bb(n),i=Ub({client:n,query:t,options:e}),s=e.queryKey,o=s===void 0?[]:s,a=Z.useState(null),l=a[0],u=a[1];Vb(l);var d=l&&Ko(l);if(l&&(d!=null&&d.didChangeOptions(i))){var h=d.applyOptions(i);$c(l,h)}var p=hW(),g=Z.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(hi(d)),N},[d]),y=Z.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(hi(d)),N},[d]),b=Z.useCallback(function(){for(var O=[],N=0;N<arguments.length;N++)O[N]=arguments[N];oe(!p(),51);var I=O[0],P=Nt([t,Dr(I)],[].concat(o),!0),M=r.getQueryRef(P,function(){return n.watchQuery(D(D({},i),{variables:I}))});u(hi(M))},[t,o,r,i,p,n]),_=Z.useCallback(function(O){return oe(d,52),d.observable.subscribeToMore(O)},[d]),w=Z.useCallback(function(){u(null)},[]);return[b,l,{fetchMore:g,refetch:y,reset:w,subscribeToMore:_}]}function zW(t){var e=Ko(t);return Ho("useQueryRefHandlers",QW,e?e.observable:Zn())(t)}function QW(t){Vb(t);var e=Z.useState(t),n=e[0],r=e[1],i=Z.useState(t),s=i[0],o=i[1],a=Ko(t);n!==t?(r(t),o(t)):$c(t,jb(s));var l=Z.useCallback(function(d){var h=a.refetch(d);return o(hi(a)),h},[a]),u=Z.useCallback(function(d){var h=a.fetchMore(d);return o(hi(a)),h},[a]);return{refetch:l,fetchMore:u,subscribeToMore:a.observable.subscribeToMore}}function GW(t){var e=Ko(t);return Ho("useReadQuery",HW,e?e.observable:Zn())(t)}function HW(t){Vb(t);var e=Z.useMemo(function(){return Ko(t)},[t]),n=Z.useCallback(function(){return jb(t)},[t]);e.disposed&&(e.reinitialize(),$c(t,e.promise)),Z.useEffect(function(){return e.retain()},[e]);var r=uu(Z.useCallback(function(s){return e.listen(function(o){$c(t,o),s()})},[e,t]),n,n),i=TA(r);return Z.useMemo(function(){return{data:i.data,networkStatus:i.networkStatus,error:gy(i)}},[i])}function KW(t){return Ho("createQueryPreloader",JW,t)(t)}var JW=function(t){return function(n,r){var i,s;r===void 0&&(r=Object.create(null));var o=new IA(t.watchQuery(D(D({},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 hi(o)}};const YW=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:Oh,ApolloClient:Ah,ApolloConsumer:cW,ApolloError:wn,ApolloLink:Vn,ApolloProvider:wA,get Cache(){return wd},DocumentTransform:cu,get DocumentType(){return fr},HttpLink:Sh,InMemoryCache:Nb,MissingFieldError:kh,get NetworkStatus(){return He},Observable:et,ObservableQuery:Fc,checkFetcher:vb,concat:tA,createHttpLink:Eb,createQueryPreloader:KW,createSignalIfSupported:iA,defaultDataIdFromObject:Nh,defaultPrinter:wh,disableExperimentalFragmentVariables:Cb,disableFragmentWarnings:Ib,empty:eA,enableExperimentalFragmentVariables:xb,execute:Dc,fallbackHttpConfig:yb,from:hb,fromError:mc,fromPromise:ZN,getApolloContext:cl,get gql(){return Po},isApolloError:Eh,isNetworkRequestSettled:gA,isReference:rt,makeReference:Bi,makeVar:Tb,mergeOptions:gi,operationName:hy,parseAndCheckHttpResponse:gb,parser:Rb,resetApolloContext:lW,resetCaches:Ab,rewriteURIForGET:_b,selectHttpOptionsAndBody:rA,selectHttpOptionsAndBodyInternal:Th,selectURI:bb,serializeFetchParameter:Rc,setLogVerbosity:ev,skipToken:xA,split:pb,throwServerError:_h,toPromise:XN,useApolloClient:Zn,useBackgroundQuery:UW,useFragment:DW,useLazyQuery:Fb,useLoadableQuery:qW,useMutation:AW,useQuery:xh,useQueryRefHandlers:zW,useReactiveVar:CW,useReadQuery:GW,useSubscription:IW,useSuspenseQuery:$W},Symbol.toStringTag,{value:"Module"}));let Ja=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 BT=2e3,ba=console;class XW{constructor(e,n,r,i=BT,s=!0){this._callback=e,this._client_id=n,this._url=r,this._interval=i||BT,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"?(ba.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):e.data==="changed"?(ba.debug(e),ba.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):ba.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))}start(e){ba.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&&(ba.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)}}const We={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"},Rr=(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 Lc=(t=>(t.AutomaticBeforeTokenExpiration="AutomaticBeforeTokensExpiration",t.AutomaticOnlyWhenFetchExecuted="AutomaticOnlyWhenFetchExecuted",t))(Lc||{});const ZW=t=>decodeURIComponent(Array.prototype.map.call(atob(t),e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")),eq=t=>JSON.parse(ZW(t.replaceAll(/-/g,"+").replaceAll(/_/g,"/"))),UT=t=>{try{return t&&tq(t,".")===2?eq(t.split(".")[1]):null}catch(e){console.warn(e)}return null},tq=(t,e)=>t.split(e).length-1,yy={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 nq(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 Wb=(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=UT(t.accessToken);let s;e!=null&&"idToken"in e&&!("idToken"in t)?s=e.idToken:s=t.idToken;const o=t.idTokenPayload?t.idTokenPayload:UT(s),a=o&&o.exp?o.exp:Number.MAX_VALUE,l=r&&r.exp?r.exp:t.issuedAt+i;t.issuedAt=nq(t,r,o);let u;t.expiresAt?u=t.expiresAt:n===yy.access_token_invalid?u=l:n===yy.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},qb=(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),Wb(r,e,n)},vc=(t,e)=>{const n=new Date().getTime()/1e3,r=e-n;return Math.round(r-t)},WT=(t,e=0)=>t?vc(e,t.expiresAt)>0:!1,CA=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==Lc.AutomaticOnlyWhenFetchExecuted){await t.renewTokensAsync({});break}else await Ch({milliseconds:e});r=r-1}return{isTokensValid:WT(t.getTokens()),tokens:t.getTokens(),numberWaited:r-n}},DA=(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:""}},Ya=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)}}(),qT="7.22.32";let zT=null,Nd;const Ch=({milliseconds:t})=>new Promise(e=>Ya.setTimeout(e,t)),RA=(t="/")=>{try{Nd=new AbortController,fetch(`${t}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`,{signal:Nd.signal}).catch(e=>{console.log(e)}),Ch({milliseconds:150*1e3}).then(RA)}catch(e){console.log(e)}},QT=()=>{Nd&&Nd.abort()},rq=(t="/")=>fetch(`${t}OidcKeepAliveServiceWorker.json`,{headers:{"oidc-vanilla":"true"}}).then(e=>e.statusText==="oidc-service-worker").catch(e=>{console.log(e)}),iq=t=>async(e,n)=>{n(),await e.update();const r=await e.unregister();console.log(`Service worker unregistration ${r?"successful":"failed"}`),await Ch({milliseconds:2e3}),t.reload()},sq=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},In=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:sq(e.configurationName)},[i.port2])}),Mr=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,QT))));try{await navigator.serviceWorker.ready,navigator.serviceWorker.controller||await In(i)({type:"claim"})}catch{return null}const s=async g=>In(i)({type:"clear",data:{status:g},configurationName:e}),o=async(g,y,b)=>{var _;const w=await In(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!==qT&&(console.warn(`Service worker ${O} version mismatch with js client version ${qT}, unregistering and reloading`),await((_=b.service_worker_update_require_callback)==null?void 0:_.call(b,i,QT))),{tokens:qb(w.tokens,null,b.token_renew_mode),status:w.status}},a=(g="/")=>{zT==null&&(zT="not_null",RA(g))},l=g=>In(i)({type:"setSessionState",data:{sessionState:g},configurationName:e}),u=async()=>(await In(i)({type:"getSessionState",data:null,configurationName:e})).sessionState,d=g=>(sessionStorage[`oidc.nonce.${e}`]=g.nonce,In(i)({type:"setNonce",data:{nonce:g},configurationName:e})),h=async()=>{let g=(await In(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:()=>rq(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 In(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,In(i)({type:"setState",data:{state:g},configurationName:e})),getCodeVerifierAsync:async()=>{let g=(await In(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,In(i)({type:"setCodeVerifier",data:{codeVerifier:g},configurationName:e})),setDemonstratingProofOfPossessionNonce:async g=>{await In(i)({type:"setDemonstratingProofOfPossessionNonce",data:{demonstratingProofOfPossessionNonce:g},configurationName:e})},getDemonstratingProofOfPossessionNonce:async()=>(await In(i)({type:"getDemonstratingProofOfPossessionNonce",data:null,configurationName:e})).demonstratingProofOfPossessionNonce,setDemonstratingProofOfPossessionJwkAsync:async g=>{const y=JSON.stringify(g);await In(i)({type:"setDemonstratingProofOfPossessionJwk",data:{demonstratingProofOfPossessionJwkJson:y},configurationName:e})},getDemonstratingProofOfPossessionJwkAsync:async()=>{const g=await In(i)({type:"getDemonstratingProofOfPossessionJwk",data:null,configurationName:e});return g.demonstratingProofOfPossessionJwkJson?JSON.parse(g.demonstratingProofOfPossessionJwkJson):null}}},Sa={},oq=(t,e=window.sessionStorage,n)=>{if(!Sa[t]&&e){const i=e.getItem(t);i&&(Sa[t]=JSON.parse(i))}const r=1e3*n;return Sa[t]&&Sa[t].timestamp+r>Date.now()?Sa[t].result:null},aq=(t,e,n=window.sessionStorage)=>{const r=Date.now();Sa[t]={result:e,timestamp:r},n&&n.setItem(t,JSON.stringify({result:e,timestamp:r}))};function MA(t){return new TextEncoder().encode(t)}function PA(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function lq(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,n){return String.fromCharCode(parseInt(n,16))})}const zb=t=>{let e="";return t.forEach(function(n){e+=String.fromCharCode(n)}),PA(e)};function GT(t){return PA(lq(t))}const cq={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"},uq=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:GT(JSON.stringify(n)),payload:GT(JSON.stringify(r))},a=i.importKeyAlgorithm,l=!0,u=["sign"],d=await t.crypto.subtle.importKey("jwk",e,a,l,u),h=MA(`${o.protected}.${o.payload}`),p=i.signAlgorithm,g=await t.crypto.subtle.sign(p,d,h);return o.signature=zb(new Uint8Array(g)),`${o.protected}.${o.payload}.${o.signature}`},fq={sign:uq},dq=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)},hq=t=>{const e=Object.assign({},t);return delete e.d,e.key_ops=["verify"],e},pq={generate:dq,neuter:hq},mq=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,MA(r));return zb(new Uint8Array(i))},gq={thumbprint:mq},yq=t=>async e=>await pq.generate(t)(e),FA=t=>e=>async(n,r="POST",i,s={})=>{const o={jti:btoa(vq()),htm:r,htu:i,iat:Math.round(Date.now()/1e3),...s},a=await gq.thumbprint(t)(n,e.digestAlgorithm);return await fq.sign(t)(n,{kid:a},o,e)},vq=()=>{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},$A=()=>{const t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return{hasCrypto:t,hasSubtleCrypto:e}},vy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",bq=t=>{const e=[];for(let n=0;n<t.byteLength;n+=1){const r=t[n]%vy.length;e.push(vy[r])}return e.join("")},by=t=>{const e=new Uint8Array(t),{hasCrypto:n}=$A();if(n)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.random()*vy.length|0;return bq(e)};function _q(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 LA(t){return new Promise((e,n)=>{crypto.subtle.digest("SHA-256",_q(t)).then(r=>e(zb(new Uint8Array(r))),r=>n(r))})}const Eq=t=>{if(t.length<43||t.length>128)return Promise.reject(new Error("Invalid code length."));const{hasSubtleCrypto:e}=$A();return e?LA(t):Promise.reject(new Error("window.crypto.subtle is unavailable."))},wq=60*60,Tq=t=>async(e,n=wq,r=window.sessionStorage,i=1e4)=>{const s=`${e}/.well-known/openid-configuration`,o=`oidc.server:${e}`,a=oq(o,r,n);if(a)return new Ey(a);const l=await fu(t)(s,{},i);if(l.status!==200)return null;const u=await l.json();return aq(o,u,r),new Ey(u)},fu=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 fu(t)(e,n,r,i+1);throw o}else throw console.error(o.message),o}return s},_y={refresh_token:"refresh_token",access_token:"access_token"},HT=t=>async(e,n,r=_y.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 fu(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:u},o)).status!==200?{success:!1}:{success:!0}},Sq=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 fu(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(Ad)&&(p=d.headers.get(Ad)),{success:!0,status:d.status,data:qb(h,i,o),demonstratingProofOfPossessionNonce:p}},Oq=(t,e)=>async(n,r)=>{r=r?{...r}:{};const i=by(128),s=await Eq(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}`)},Ad="DPoP-Nonce",kq=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 fu(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(Ad)&&(u=l.headers.get(Ad));const d=await l.json();return{success:!0,data:{state:n.state,tokens:qb(d,null,i),demonstratingProofOfPossessionNonce:u}}};async function KT(t,e,n){const r=o=>{t.tokens=o},{tokens:i,status:s}=await Zf(t)(r,0,e,n);return await Mr(t.configuration,t.configurationName)||await Rr(t.configurationName,t.configuration.storage).setTokens(t.tokens),t.tokens?i:(await t.destroyAsync(s),null)}async function VA(t,e=!1,n=null){const r=t.configuration,i=`${r.client_id}_${t.configurationName}_${r.authority}`;let s;const o=await Mr(t.configuration,t.configurationName);if((r==null?void 0:r.storage)===(window==null?void 0:window.sessionStorage)&&!o||!navigator.locks)s=await KT(t,e,n);else{let a="retry";for(;a==="retry";)a=await navigator.locks.request(i,{ifAvailable:!0},async l=>l?await KT(t,e,n):(t.publishEvent(Ui.eventNames.syncTokensAsync_lock_not_available,{lock:"lock not available"}),"retry"));s=a}return s?(t.timeoutId&&(t.timeoutId=Vc(t,t.tokens.expiresAt,n)),t.tokens):null}const Vc=(t,e,n=null)=>{const r=t.configuration.refresh_time_before_tokens_expiration_in_second;return t.timeoutId&&Ya.clearTimeout(t.timeoutId),Ya.setTimeout(async()=>{const i={timeLeft:vc(r,e)};t.publishEvent(Ui.eventNames.token_timer,i),await VA(t,!1,n)},1e3)},ds={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"},Nq=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 Mr(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=vc(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=Rr(n,e.storage??sessionStorage),h=await d.initAsync();let{tokens:p}=h;const{status:g}=h;if(p&&(p=Wb(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=vc(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=vc(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}},Zf=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 Ch({milliseconds:1e3}),s--,t.publishEvent(We.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)=>Qb(t.configurationName,t.configuration,t.publishEvent.bind(t))(d,h,p),u=async()=>{try{let d;const h=await Mr(a,t.configurationName);h?d=h.getLoginParams():d=Rr(t.configurationName,a.storage).getLoginParams();const p=await l({...d.extras,...i,prompt:"none"});return p?p.error?(e(null),t.publishEvent(We.refreshTokensAsync_error,{message:"refresh token silent"}),{tokens:null,status:"SESSION_LOST"}):(e(p.tokens),t.publishEvent(Ui.eventNames.token_renewed,{}),{tokens:p.tokens,status:"LOGGED"}):(e(null),t.publishEvent(We.refreshTokensAsync_error,{message:"refresh token silent not active"}),{tokens:null,status:"SESSION_LOST"})}catch(d){return console.error(d),t.publishEvent(We.refreshTokensAsync_silent_error,{message:"exceptionSilent",exception:d.message}),await Zf(t)(e,o,r,i)}};try{const{status:d,tokens:h,nonce:p}=await Nq(t)(a,t.configurationName,t.tokens,r);switch(d){case ds.SESSION_LOST:return e(null),t.publishEvent(We.refreshTokensAsync_error,{message:"refresh token session lost"}),{tokens:null,status:"SESSION_LOST"};case ds.NOT_CONNECTED:return e(null),{tokens:null,status:null};case ds.TOKENS_VALID:return e(h),{tokens:h,status:"LOGGED_IN"};case ds.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:return e(h),t.publishEvent(Ui.eventNames.token_renewed,{reason:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID"}),{tokens:h,status:"LOGGED_IN"};case ds.LOGOUT_FROM_ANOTHER_TAB:return e(null),t.publishEvent(We.logout_from_another_tab,{status:"session syncTokensAsync"}),{tokens:null,status:"LOGGED_OUT"};case ds.REQUIRE_SYNC_TOKENS:return a.token_automatic_renew_mode==Lc.AutomaticOnlyWhenFetchExecuted&&ds.FORCE_REFRESH!==d?(t.publishEvent(We.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"}):(t.publishEvent(We.refreshTokensAsync_begin,{tryNumber:n}),await u());default:{if(a.token_automatic_renew_mode==Lc.AutomaticOnlyWhenFetchExecuted&&ds.FORCE_REFRESH!==d)return t.publishEvent(We.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"};if(t.publishEvent(We.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 M=await Sq(t.getFetch())(I,w,_,h,P,a.token_renew_mode,N);if(M.success){const{isValid:B,reason:Q}=DA(M.data,p.nonce,O);if(!B)return e(null),t.publishEvent(We.refreshTokensAsync_error,{message:`refresh token return not valid tokens, reason: ${Q}`}),{tokens:null,status:"SESSION_LOST"};if(e(M.data),M.demonstratingProofOfPossessionNonce){const x=await Mr(a,t.configurationName);x?await x.setDemonstratingProofOfPossessionNonce(M.demonstratingProofOfPossessionNonce):await Rr(t.configurationName,a.storage).setDemonstratingProofOfPossessionNonce(M.demonstratingProofOfPossessionNonce)}return t.publishEvent(We.refreshTokensAsync_end,{success:M.success}),t.publishEvent(Ui.eventNames.token_renewed,{reason:"REFRESH_TOKEN"}),{tokens:M.data,status:"LOGGED_IN"}}else return t.publishEvent(We.refreshTokensAsync_silent_error,{message:"bad request",tokenResponse:M}),M.status>=400&&M.status<500?(e(null),t.publishEvent(We.refreshTokensAsync_error,{message:`session lost: ${M.status}`}),{tokens:null,status:"SESSION_LOST"}):await Zf(t)(e,o,r,i)})()}}}catch(d){return console.error(d),t.publishEvent(We.refreshTokensAsync_silent_error,{message:"exception",exception:d.message}),new Promise((h,p)=>{setTimeout(()=>{Zf(t)(e,o,r,i).then(h).catch(p)},1e3)})}},Qb=(t,e,n)=>(r=null,i=null,s=null)=>{if(!e.silent_redirect_uri||!e.silent_login_uri)return Promise.resolve(null);try{n(We.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(We.silentLoginAsync_end,{}),h(P),y()}else if(I.startsWith(O)){const P=JSON.parse(_.data.replace(O,""));n(We.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(We.silentLoginAsync_error,P),p(new Error(P.error)),y()}}}};try{window.addEventListener("message",b);const _=e.silent_login_timeout;setTimeout(()=>{g||(y(),n(We.silentLoginAsync_error,{reason:"timeout"}),p(new Error("timeout")))},_)}catch(_){y(),n(We.silentLoginAsync_error,_),p(_)}})}catch(o){throw n(We.silentLoginAsync_error,o),o}},Aq=(t,e,n,r,i)=>(s=null,o=void 0)=>{s={...s};const a=(l,u,d)=>Qb(e,n,r.bind(i))(l,u,d);return(async()=>{i.timeoutId&&Ya.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(We.token_acquired,{}),i.timeoutId=Vc(i,i.tokens.expiresAt,s),{}}catch(u){return u}})()},Iq=(t,e,n)=>(r,i,s,o=!1)=>{const a=(l,u=void 0,d=void 0)=>Qb(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 XW(d,i,r),t.checkSessionIFrame.load().then(()=>{t.checkSessionIFrame.start(s),l(t.checkSessionIFrame)}).catch(h=>{u(h)})}else l(null)})},xq=t=>!!(t.os==="iOS"&&t.osVersion.startsWith("12")||t.os==="Mac OS X"&&t.osVersion.startsWith("10_15_6")),Cq=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 Dq(){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 Rq=()=>{const{name:t,version:e}=Dq();if(t==="chrome"&&parseInt(e)<=70||t==="opera"&&(!e||parseInt(e.split(".")[0])<80)||t==="ie")return!1;const n=Cq(navigator);return!xq(n)},Mq=async t=>{let e;if(t.tokens!=null)return!1;t.publishEvent(We.tryKeepExistingSessionAsync_begin,{});try{const n=t.configuration,r=await t.initAsync(n.authority,n.authority_configuration);if(e=await Mr(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=Vc(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(We.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside ServiceWorker are valid"}),!0}t.publishEvent(We.tryKeepExistingSessionAsync_end,{success:!1,message:"no exiting session found"})}else{n.service_worker_relative_url&&t.publishEvent(We.service_worker_not_supported_by_browser,{message:"service worker is not supported by this browser"});const i=Rr(t.configurationName,n.storage??sessionStorage),{tokens:s}=await i.initAsync();if(s){t.tokens=Wb(s,null,n.token_renew_mode);const o=i.getLoginParams();t.timeoutId=Vc(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(We.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside storage are valid"}),!0}}return t.publishEvent(We.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(We.tryKeepExistingSessionAsync_error,"tokens inside ServiceWorker are invalid"),!1}},jA=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}},Xl=t=>{const e=jA(t);let{path:n}=e;n.endsWith("/")&&(n=n.slice(0,-1));let{hash:r}=e;return r==="#_=_"&&(r=""),r&&(n+=r),n},jc=t=>{const e=jA(t),{search:n}=e;return Pq(n)},Pq=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},Fq=(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=by(16)),n(We.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=by(12));const g={nonce:p.nonce},y=await Mr(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=Rr(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 Oq(_,i)(b.authorizationEndpoint,w)}catch(h){throw n(We.loginAsync_error,h),h}})()},$q=t=>async(e=!1)=>{try{t.publishEvent(We.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=jc(l).session_state,d=await Mr(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=Rr(t.configurationName,n.storage??sessionStorage);await U.setSessionStateAsync(u),p=await U.getNonceAsync(),g=U.getLoginParams(),y=await U.getStateAsync(),h=U}const b=jc(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,Te]of Object.entries(n.token_request_extras))w[U]=Te;if(g!=null&&g.extras)for(const[U,Te]of Object.entries(g.extras))U.endsWith(":token_request")&&(w[U.replace(":token_request","")]=Te);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 yq(window)(n.demonstrating_proof_of_possession_configuration.generateKeyAlgorithm);await Rr(t.configurationName,n.storage).setDemonstratingProofOfPossessionJwkAsync(U),N.DPoP=await FA(window)(n.demonstrating_proof_of_possession_configuration)(U,"POST",O)}const I=await kq(h)(O,{..._,...w},N,t.configuration.token_renew_mode,o);if(!I.success)throw new Error("Token request failed");let P;const M=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}=DA(M,p.nonce,a);if(!Q)throw new Error(`Tokens are not OpenID valid, reason: ${x}`);if(d){if(M.refreshToken&&!M.refreshToken.includes("SECURED_BY_OIDC_SERVICE_WORKER"))throw new Error("Refresh token should be hidden by service worker");if(B&&M!=null&&M.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=Rr(t.configurationName,n.storage);P=U.getLoginParams(),B&&await U.setDemonstratingProofOfPossessionNonce(B)}return await t.startCheckSessionAsync(a.checkSessionIframe,r,u,e),t.publishEvent(We.loginCallbackAsync_end,{}),{tokens:M,state:"request.state",callbackPath:P.callbackPath}}catch(n){throw console.error(n),t.publishEvent(We.loginCallbackAsync_error,n),n}},JT={access_token:"access_token",refresh_token:"refresh_token"},Gm=(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},Lq=t=>{const e={};if(t){for(const[n,r]of Object.entries(t))n.includes(":")||(e[n]=r);return e}return e},Vq=t=>async e=>{Ya.clearTimeout(t.timeoutId),t.timeoutId=null,t.checkSessionIFrame&&t.checkSessionIFrame.stop();const n=await Mr(t.configuration,t.configurationName);n?await n.clearAsync(e):await Rr(t.configurationName,t.configuration.storage).clearAsync(e),t.tokens=null,t.userInfo=null},jq=(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(JT.access_token)){const M=Gm(o,":revoke_access_token"),B=HT(n)(O,I,_y.access_token,u.client_id,M);N.push(B)}const P=t.tokens?t.tokens.refreshToken:null;if(P&&u.logout_tokens_to_invalidate.includes(JT.refresh_token)){const M=Gm(o,":revoke_refresh_token"),B=HT(n)(O,P,_y.refresh_token,u.client_id,M);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(We.logout_from_same_tab,{});const _=Gm(o,":oidc");if(_&&_.no_reload==="true")return;const w=Lq(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()},BA=(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 CA(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)},Bq=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 BA(fetch,t,n)(i);return o.status!==200?null:o.json()})();return t.userInfo=s,s},UA=()=>fetch;let Ey=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 _o={},Uq=(t,e=new Ja)=>(n,r="default")=>(_o[r]||(_o[r]=new Ui(n,r,t,e)),_o[r]),Wq=async t=>{const{parsedTokens:e,callbackPath:n}=await t.loginCallbackAsync();return t.timeoutId=Vc(t,e.expiresAt),{callbackPath:n}},qq=t=>Math.floor(Math.random()*t),wy=class WA{constructor(e,n="default",r,i=new Ja){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 Ja;const a=e.service_worker_update_require_callback??iq(this.location);this.configuration={...e,silent_login_uri:s,token_automatic_renew_mode:e.token_automatic_renew_mode??Lc.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??yy.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??Rq,demonstrating_proof_of_possession_configuration:e.demonstrating_proof_of_possession_configuration??cq,preload_user_info:e.preload_user_info??!1},this.getFetch=r??UA,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=qq(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(_o,e)&&n)throw Error(`OIDC library does seem initialized.
215
+ Please checkout that you are using OIDC hook inside a <OidcProvider configurationName="${e}"></OidcProvider> component.`);return _o[e]}_silentLoginCallbackFromIFrame(){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const e=this.location,n=jc(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=jc(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 Ey({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 Mr(this.configuration,this.configurationName)?window.localStorage:null;return await Tq(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=Mq(this),this.tryKeepExistingSessionPromise.finally(()=>{this.tryKeepExistingSessionPromise=null}))}async startCheckSessionAsync(e,n,r,i=!1){await Iq(this,_o,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?Aq(window,this.configurationName,this.configuration,this.publishEvent.bind(this),this)(n,i):(this.loginPromise=Fq(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 $q(this)(e),i=r.tokens;return this.tokens=i,await Mr(this.configuration,this.configurationName)||Rr(this.configurationName,this.configuration.storage).setTokens(i),this.publishEvent(WA.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 LA(e),...i};if(await Mr(s,this.configurationName))return`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${this.configurationName}`;const a=Rr(this.configurationName,s.storage),l=await a.getDemonstratingProofOfPossessionJwkAsync(),u=a.getDemonstratingProofOfPossessionNonce();return u&&(o.nonce=u),await FA(window)(s.demonstrating_proof_of_possession_configuration)(l,r,n,o)}loginCallbackWithAutoTokensRenewAsync(){return this.loginCallbackWithAutoTokensRenewPromise!==null?this.loginCallbackWithAutoTokensRenewPromise:(this.loginCallbackWithAutoTokensRenewPromise=Wq(this),this.loginCallbackWithAutoTokensRenewPromise.finally(()=>{this.loginCallbackWithAutoTokensRenewPromise=null}))}userInfoAsync(e=!1,n=!1){return this.userInfoPromise!==null?this.userInfoPromise:(this.userInfoPromise=Bq(this)(e,n),this.userInfoPromise.finally(()=>{this.userInfoPromise=null}))}async renewTokensAsync(e=null){if(this.renewTokensPromise!==null)return this.renewTokensPromise;if(this.timeoutId)return Ya.clearTimeout(this.timeoutId),this.renewTokensPromise=VA(this,!0,e),this.renewTokensPromise.finally(()=>{this.renewTokensPromise=null})}async destroyAsync(e){return await Vq(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(We.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(We.logout_from_another_tab,{message:"SessionMonitor",sub:n}))}async logoutAsync(e=void 0,n=null){return this.logoutPromise?this.logoutPromise:(this.logoutPromise=jq(this,_o,this.getFetch(),console,this.location)(e,n),this.logoutPromise.finally(()=>{this.logoutPromise=null}))}};wy.getOrCreate=(t,e)=>(n,r="default")=>Uq(t,e)(n,r),wy.eventNames=We;let Ui=wy;const ed=class qA{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 qA(Ui.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 CA(i,e,n)}fetchWithTokens(e,n=!1){return BA(e,this._oidc,n)}async userInfoAsync(e=!1,n=!1){return this._oidc.userInfoAsync(e,n)}userInfo(){return this._oidc.userInfo}};ed.getOrCreate=(t,e=new Ja)=>(n,r="default")=>new ed(Ui.getOrCreate(t,e)(n,r)),ed.eventNames=Ui.eventNames;let ut=ed;const zA=()=>pe.jsx("div",{className:"oidc-authenticating",children:pe.jsxs("div",{className:"oidc-authenticating__container",children:[pe.jsx("h1",{className:"oidc-authenticating__title",children:"Error authentication"}),pe.jsx("p",{className:"oidc-authenticating__content",children:"An error occurred during authentication."})]})}),zq=()=>pe.jsx("div",{className:"oidc-authenticating",children:pe.jsxs("div",{className:"oidc-authenticating__container",children:[pe.jsx("h1",{className:"oidc-authenticating__title",children:"Authentication in progress"}),pe.jsx("p",{className:"oidc-authenticating__content",children:"You will be redirected to the login page."})]})}),Qq=()=>Math.random().toString(36).slice(2,8),Gq=(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},Hq=(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"))}}),Kq=()=>Hq(window,Gq(window,document),Qq),QA=()=>pe.jsx("div",{className:"oidc-callback",children:pe.jsxs("div",{className:"oidc-callback__container",children:[pe.jsx("h1",{className:"oidc-callback__title",children:"Authentication complete"}),pe.jsx("p",{className:"oidc-callback__content",children:"You will be redirected to your application."})]})}),Jq=({callBackError:t,callBackSuccess:e,configurationName:n,withCustomHistory:r})=>{const[i,s]=ce.useState(!1);ce.useEffect(()=>{let l=!0;return(async()=>{const u=ut.get;try{const{callbackPath:d}=await u(n).loginCallbackAsync();(r?r():Kq()).replaceState(d||"/")}catch(d){l&&(console.warn(d),s(!0))}})(),()=>{l=!1}},[]);const o=t||zA,a=e||QA;return i?pe.jsx(o,{configurationName:n}):pe.jsx(a,{configurationName:n})},Yq=()=>pe.jsx("span",{className:"oidc-loading",children:"Loading"}),Xq=()=>pe.jsx("div",{className:"oidc-serviceworker",children:pe.jsxs("div",{className:"oidc-serviceworker__container",children:[pe.jsx("h1",{className:"oidc-serviceworker__title",children:"Unable to authenticate on this browser"}),pe.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."})]})}),Zq=()=>pe.jsx("div",{className:"oidc-session-lost",children:pe.jsxs("div",{className:"oidc-session-lost__container",children:[pe.jsx("h1",{className:"oidc-session-lost__title",children:"Session timed out"}),pe.jsx("p",{className:"oidc-session-lost__content",children:"Your session has expired. Please re-authenticate."})]})}),ez=({configurationName:t})=>(ce.useEffect(()=>{(async()=>{ut.get(t).silentLoginCallbackAsync()})().catch(e=>{console.error("Error during silent login callback:",e)})},[t]),null),tz=({configurationName:t})=>{const e=jc(window.location.href),n=ut.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 ce.useEffect(()=>{r.tokens||r.loginAsync(null,i,!0,e.scope)},[]),pe.jsx(pe.Fragment,{})},nz=({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?Xl(window.location.href):"",[u,d]=ce.useState(l);ce.useEffect(()=>{const p=()=>d(Xl(window.location.href));return p(),window.addEventListener("popstate",p,!1),()=>window.removeEventListener("popstate",p,!1)},[]);const h=Xl(n);if(r&&u===Xl(r))return pe.jsx(ez,{configurationName:o});if(i&&u===Xl(i))return pe.jsx(tz,{configurationName:o});switch(u){case h:return pe.jsx(Jq,{callBackError:t,callBackSuccess:e,configurationName:o,withCustomHistory:a});default:return pe.jsx(pe.Fragment,{children:s})}},rz=ce.memo(nz),YT={name:"",data:null},iz=({loadingComponent:t,children:e,configurationName:n})=>{const[r,i]=ce.useState(!0),s=ut.get,o=s(n);return ce.useEffect(()=>{let a=!0;return o&&o.tryKeepExistingSessionAsync().then(()=>{a&&i(!1)}),()=>{a=!1}},[n]),pe.jsx(pe.Fragment,{children:r?pe.jsx(t,{configurationName:n}):pe.jsx(pe.Fragment,{children:e})})},Zl=({isLoading:t,loadingComponent:e,children:n,configurationName:r})=>{const i=e;return t?pe.jsx(i,{configurationName:r,children:n}):pe.jsx(pe.Fragment,{children:n})},sz=({children:t,configuration:e,configurationName:n="default",callbackSuccessComponent:r=QA,authenticatingComponent:i=zq,loadingComponent:s=Yq,serviceWorkerNotSupportedComponent:o=Xq,authenticatingErrorComponent:a=zA,sessionLostComponent:l=Zq,onSessionLost:u=null,onLogoutFromAnotherTab:d=null,onLogoutFromSameTab:h=null,withCustomHistory:p=null,onEvent:g=null,getFetch:y=null,location:b=null})=>{const _=(Ce="default")=>ut.getOrCreate(y??UA,b??new Ja)(e,Ce),[w,O]=ce.useState(!0),[N,I]=ce.useState(YT),[P,M]=ce.useState("default");ce.useEffect(()=>{const Ce=_(n).subscribeEvents((ee,Ae)=>{g&&g(n,ee,Ae)});return()=>{_(n).removeEventSubscription(Ce)}},[n,g]),ce.useEffect(()=>{const Ce=_(n).subscribeEvents((ee,Ae)=>{if(ee===ut.eventNames.refreshTokensAsync_error||ee===ut.eventNames.syncTokensAsync_error){if(u!=null){u();return}I({name:ee,data:Ae})}else if(ee===ut.eventNames.logout_from_another_tab){if(d!=null){d();return}I({name:ee,data:Ae})}else ee===ut.eventNames.logout_from_same_tab?h!=null&&h():ee===ut.eventNames.loginAsync_begin||ee===ut.eventNames.loginCallbackAsync_end||ee===ut.eventNames.loginAsync_error||ee===ut.eventNames.loginCallbackAsync_error?I({name:ee,data:Ae}):ee===ut.eventNames.service_worker_not_supported_by_browser&&e.service_worker_only===!0&&I({name:ee,data:Ae})});return M(n),O(!1),()=>{_(n).removeEventSubscription(Ce),I(YT)}},[e,n]);const B=l,Q=i,x=s,U=o,Te=a,ke=w||P!==n,he=_(n);switch(N.name){case ut.eventNames.service_worker_not_supported_by_browser:return pe.jsx(Zl,{loadingComponent:x,isLoading:ke,configurationName:n,children:pe.jsx(U,{configurationName:n})});case ut.eventNames.loginAsync_begin:return pe.jsx(Zl,{loadingComponent:x,isLoading:ke,configurationName:n,children:pe.jsx(Q,{configurationName:n})});case ut.eventNames.loginAsync_error:case ut.eventNames.loginCallbackAsync_error:return pe.jsx(Zl,{loadingComponent:x,isLoading:ke,configurationName:n,children:pe.jsx(Te,{configurationName:n})});case ut.eventNames.refreshTokensAsync_error:case ut.eventNames.syncTokensAsync_error:case ut.eventNames.logout_from_another_tab:return pe.jsx(Zl,{loadingComponent:x,isLoading:ke,configurationName:n,children:pe.jsx(B,{configurationName:n})});default:return pe.jsx(Zl,{loadingComponent:x,isLoading:ke,configurationName:n,children:pe.jsx(rz,{redirect_uri:he.configuration.redirect_uri,silent_redirect_uri:he.configuration.silent_redirect_uri,silent_login_uri:he.configuration.silent_login_uri,callbackSuccessComponent:r,callbackErrorComponent:a,authenticatingComponent:i,configurationName:n,withCustomHistory:p,location:b??new Ja,children:pe.jsx(iz,{loadingComponent:x,configurationName:n,children:t})})})}},oz="default",GA={accessToken:null,accessTokenPayload:null},az=t=>{const e=ut.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 GA};function lz(t,e){return t.configuration.demonstrating_proof_of_possession?(n,r,i={})=>t.generateDemonstrationOfProofOfPossessionAsync(e.accessToken,n,r,i):null}const cz=(t=oz)=>{const e=ut.get,[n,r]=ce.useState(az(t));return ce.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===ut.eventNames.token_renewed||a===ut.eventNames.token_acquired||a===ut.eventNames.logout_from_another_tab||a===ut.eventNames.logout_from_same_tab||a===ut.eventNames.refreshTokensAsync_error||a===ut.eventNames.syncTokensAsync_error)&&i){const u=s.tokens;r(u!=null?{accessToken:u.accessToken,accessTokenPayload:u.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:lz(s,u)}:GA)}});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),n};function uz(t){return new Vn(function(e,n){var r=Rn(e,[]);return new et(function(i){var s,o=!1;return Promise.resolve(r).then(function(a){return t(a,e.getContext())}).then(e.setContext).then(function(){o||(s=n(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){o=!0,s&&s.unsubscribe()}})})}function HA(t){return new Vn(function(e,n){return new et(function(r){var i,s,o;try{i=n(e).subscribe({next:function(a){if(a.errors&&(o=t({graphQLErrors:a.errors,response:a,operation:e,forward:n}),o)){s=o.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)});return}r.next(a)},error:function(a){if(o=t({operation:e,networkError:a,graphQLErrors:a&&a.result&&a.result.errors||void 0,forward:n}),o){s=o.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)});return}r.error(a)},complete:function(){o||r.complete.bind(r)()}})}catch(a){t({networkError:a,operation:e,forward:n}),r.error(a)}return function(){i&&i.unsubscribe(),s&&i.unsubscribe()}})})}(function(t){Br(e,t);function e(n){var r=t.call(this)||this;return r.link=HA(n),r}return e.prototype.request=function(n,r){return this.link.request(n,r)},e})(Vn);function fz(t){return Et(t)&&"code"in t&&"reason"in t}function dz(t){var e;return Et(t)&&((e=t.target)===null||e===void 0?void 0:e.readyState)===WebSocket.CLOSED}var hz=function(t){Br(e,t);function e(n){var r=t.call(this)||this;return r.client=n,r}return e.prototype.request=function(n){var r=this;return new et(function(i){return r.client.subscribe(D(D({},n),{query:al(n.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(s){if(s instanceof Error)return i.error(s);var o=fz(s);return o||dz(s)?i.error(new Error("Socket closed".concat(o?" with event ".concat(s.code):"").concat(o?" ".concat(s.reason):""))):i.error(new wn({graphQLErrors:Array.isArray(s)?s:[s]}))}})})},e}(Vn),Ty={},KA={},Gb={};const ul=nl(YW);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ReactiveVarsCache=t.makeCachedVar=t.initReactiveVarsCache=t.cachedReactiveVarTypename=void 0;const e=ul;var n;t.cachedReactiveVarTypename="CachedReactiveVar";function r(a){return n=new o({cache:a}),n}t.initReactiveVarsCache=r;const i=(0,e.gql)`
216
+ fragment ReadCachedReactiveVarFragment on CachedReactiveVar {
217
+ id
218
+ value
219
+ }
220
+ `;function s(a,l){return n.registerCachedVar(a,l)}t.makeCachedVar=s;class o{constructor({cache:l}){this.registeredVars={},this.cache=l}watchReactiveVar(l,u){u.onNextChange(d=>{this.writeCachedVar(l,d),this.watchReactiveVar(l,u)})}registerCachedVar(l,u){const d=this.readCachedVar(l),h=(0,e.makeVar)(d??u);return this.registeredVars[l]&&console.warn(`Duplicate cached reactive variable with ID ${l} detected. Multiple cached reactive variables should not share the same ID.`),this.registeredVars[l]={rv:h,defaultValue:u},d||this.writeCachedVar(l,u),this.watchReactiveVar(l,h),h}readCachedVar(l){var u;const d=this.cache.identify({__typename:t.cachedReactiveVarTypename,id:l}),h=this.cache.readFragment({fragment:i,id:d});return(u=h==null?void 0:h.value)!==null&&u!==void 0?u:null}writeCachedVar(l,u){u!==void 0&&this.cache.writeFragment({id:n.cache.identify({__typename:t.cachedReactiveVarTypename,id:l}),fragment:i,data:{__typename:t.cachedReactiveVarTypename,id:l,value:u}})}reset(){Object.keys(this.registeredVars).forEach(l=>{var u;const{rv:d,defaultValue:h}=this.registeredVars[l];d((u=this.readCachedVar(l))!==null&&u!==void 0?u:h)})}}t.ReactiveVarsCache=o})(Gb);var Dh={};const du=nl(oW);function pz(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i}var JA=pz;function mz(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}var gz=mz;function yz(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[t?a:++i];if(n(s[l],l,s)===!1)break}return e}}var vz=yz,bz=vz,_z=bz(),Ez=_z;function wz(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Tz=wz,Sz=typeof Pe=="object"&&Pe&&Pe.Object===Object&&Pe,YA=Sz,Oz=YA,kz=typeof self=="object"&&self&&self.Object===Object&&self,Nz=Oz||kz||Function("return this")(),wi=Nz,Az=wi,Iz=Az.Symbol,fl=Iz,XT=fl,XA=Object.prototype,xz=XA.hasOwnProperty,Cz=XA.toString,ec=XT?XT.toStringTag:void 0;function Dz(t){var e=xz.call(t,ec),n=t[ec];try{t[ec]=void 0;var r=!0}catch{}var i=Cz.call(t);return r&&(e?t[ec]=n:delete t[ec]),i}var Rz=Dz,Mz=Object.prototype,Pz=Mz.toString;function Fz(t){return Pz.call(t)}var $z=Fz,ZT=fl,Lz=Rz,Vz=$z,jz="[object Null]",Bz="[object Undefined]",eS=ZT?ZT.toStringTag:void 0;function Uz(t){return t==null?t===void 0?Bz:jz:eS&&eS in Object(t)?Lz(t):Vz(t)}var Jo=Uz;function Wz(t){return t!=null&&typeof t=="object"}var Yi=Wz,qz=Jo,zz=Yi,Qz="[object Arguments]";function Gz(t){return zz(t)&&qz(t)==Qz}var Hz=Gz,tS=Hz,Kz=Yi,ZA=Object.prototype,Jz=ZA.hasOwnProperty,Yz=ZA.propertyIsEnumerable,Xz=tS(function(){return arguments}())?tS:function(t){return Kz(t)&&Jz.call(t,"callee")&&!Yz.call(t,"callee")},Hb=Xz,Zz=Array.isArray,jn=Zz,Id={exports:{}};function e3(){return!1}var t3=e3;Id.exports;(function(t,e){var n=wi,r=t3,i=e&&!e.nodeType&&e,s=i&&!0&&t&&!t.nodeType&&t,o=s&&s.exports===i,a=o?n.Buffer:void 0,l=a?a.isBuffer:void 0,u=l||r;t.exports=u})(Id,Id.exports);var Kb=Id.exports,n3=9007199254740991,r3=/^(?:0|[1-9]\d*)$/;function i3(t,e){var n=typeof t;return e=e??n3,!!e&&(n=="number"||n!="symbol"&&r3.test(t))&&t>-1&&t%1==0&&t<e}var Rh=i3,s3=9007199254740991;function o3(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=s3}var Jb=o3,a3=Jo,l3=Jb,c3=Yi,u3="[object Arguments]",f3="[object Array]",d3="[object Boolean]",h3="[object Date]",p3="[object Error]",m3="[object Function]",g3="[object Map]",y3="[object Number]",v3="[object Object]",b3="[object RegExp]",_3="[object Set]",E3="[object String]",w3="[object WeakMap]",T3="[object ArrayBuffer]",S3="[object DataView]",O3="[object Float32Array]",k3="[object Float64Array]",N3="[object Int8Array]",A3="[object Int16Array]",I3="[object Int32Array]",x3="[object Uint8Array]",C3="[object Uint8ClampedArray]",D3="[object Uint16Array]",R3="[object Uint32Array]",_t={};_t[O3]=_t[k3]=_t[N3]=_t[A3]=_t[I3]=_t[x3]=_t[C3]=_t[D3]=_t[R3]=!0;_t[u3]=_t[f3]=_t[T3]=_t[d3]=_t[S3]=_t[h3]=_t[p3]=_t[m3]=_t[g3]=_t[y3]=_t[v3]=_t[b3]=_t[_3]=_t[E3]=_t[w3]=!1;function M3(t){return c3(t)&&l3(t.length)&&!!_t[a3(t)]}var P3=M3;function F3(t){return function(e){return t(e)}}var Mh=F3,xd={exports:{}};xd.exports;(function(t,e){var n=YA,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===r,o=s&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();t.exports=a})(xd,xd.exports);var Yb=xd.exports,$3=P3,L3=Mh,nS=Yb,rS=nS&&nS.isTypedArray,V3=rS?L3(rS):$3,eI=V3,j3=Tz,B3=Hb,U3=jn,W3=Kb,q3=Rh,z3=eI,Q3=Object.prototype,G3=Q3.hasOwnProperty;function H3(t,e){var n=U3(t),r=!n&&B3(t),i=!n&&!r&&W3(t),s=!n&&!r&&!i&&z3(t),o=n||r||i||s,a=o?j3(t.length,String):[],l=a.length;for(var u in t)(e||G3.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||q3(u,l)))&&a.push(u);return a}var tI=H3,K3=Object.prototype;function J3(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||K3;return t===n}var Xb=J3;function Y3(t,e){return function(n){return t(e(n))}}var nI=Y3,X3=nI,Z3=X3(Object.keys,Object),eQ=Z3,tQ=Xb,nQ=eQ,rQ=Object.prototype,iQ=rQ.hasOwnProperty;function sQ(t){if(!tQ(t))return nQ(t);var e=[];for(var n in Object(t))iQ.call(t,n)&&n!="constructor"&&e.push(n);return e}var oQ=sQ;function aQ(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Xi=aQ,lQ=Jo,cQ=Xi,uQ="[object AsyncFunction]",fQ="[object Function]",dQ="[object GeneratorFunction]",hQ="[object Proxy]";function pQ(t){if(!cQ(t))return!1;var e=lQ(t);return e==fQ||e==dQ||e==uQ||e==hQ}var Ph=pQ,mQ=Ph,gQ=Jb;function yQ(t){return t!=null&&gQ(t.length)&&!mQ(t)}var hu=yQ,vQ=tI,bQ=oQ,_Q=hu;function EQ(t){return _Q(t)?vQ(t):bQ(t)}var pu=EQ,wQ=Ez,TQ=pu;function SQ(t,e){return t&&wQ(t,e,TQ)}var OQ=SQ,kQ=hu;function NQ(t,e){return function(n,r){if(n==null)return n;if(!kQ(n))return t(n,r);for(var i=n.length,s=e?i:-1,o=Object(n);(e?s--:++s<i)&&r(o[s],s,o)!==!1;);return n}}var AQ=NQ,IQ=OQ,xQ=AQ,CQ=xQ(IQ),Zb=CQ,DQ=Zb;function RQ(t,e){var n=!0;return DQ(t,function(r,i,s){return n=!!e(r,i,s),n}),n}var MQ=RQ;function PQ(){this.__data__=[],this.size=0}var FQ=PQ;function $Q(t,e){return t===e||t!==t&&e!==e}var Fh=$Q,LQ=Fh;function VQ(t,e){for(var n=t.length;n--;)if(LQ(t[n][0],e))return n;return-1}var $h=VQ,jQ=$h,BQ=Array.prototype,UQ=BQ.splice;function WQ(t){var e=this.__data__,n=jQ(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():UQ.call(e,n,1),--this.size,!0}var qQ=WQ,zQ=$h;function QQ(t){var e=this.__data__,n=zQ(e,t);return n<0?void 0:e[n][1]}var GQ=QQ,HQ=$h;function KQ(t){return HQ(this.__data__,t)>-1}var JQ=KQ,YQ=$h;function XQ(t,e){var n=this.__data__,r=YQ(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var ZQ=XQ,eG=FQ,tG=qQ,nG=GQ,rG=JQ,iG=ZQ;function dl(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}dl.prototype.clear=eG;dl.prototype.delete=tG;dl.prototype.get=nG;dl.prototype.has=rG;dl.prototype.set=iG;var Lh=dl,sG=Lh;function oG(){this.__data__=new sG,this.size=0}var aG=oG;function lG(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var cG=lG;function uG(t){return this.__data__.get(t)}var fG=uG;function dG(t){return this.__data__.has(t)}var hG=dG,pG=wi,mG=pG["__core-js_shared__"],gG=mG,Hm=gG,iS=function(){var t=/[^.]+$/.exec(Hm&&Hm.keys&&Hm.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function yG(t){return!!iS&&iS in t}var vG=yG,bG=Function.prototype,_G=bG.toString;function EG(t){if(t!=null){try{return _G.call(t)}catch{}try{return t+""}catch{}}return""}var rI=EG,wG=Ph,TG=vG,SG=Xi,OG=rI,kG=/[\\^$.*+?()[\]{}|]/g,NG=/^\[object .+?Constructor\]$/,AG=Function.prototype,IG=Object.prototype,xG=AG.toString,CG=IG.hasOwnProperty,DG=RegExp("^"+xG.call(CG).replace(kG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function RG(t){if(!SG(t)||TG(t))return!1;var e=wG(t)?DG:NG;return e.test(OG(t))}var MG=RG;function PG(t,e){return t==null?void 0:t[e]}var FG=PG,$G=MG,LG=FG;function VG(t,e){var n=LG(t,e);return $G(n)?n:void 0}var Yo=VG,jG=Yo,BG=wi,UG=jG(BG,"Map"),e0=UG,WG=Yo,qG=WG(Object,"create"),Vh=qG,sS=Vh;function zG(){this.__data__=sS?sS(null):{},this.size=0}var QG=zG;function GG(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var HG=GG,KG=Vh,JG="__lodash_hash_undefined__",YG=Object.prototype,XG=YG.hasOwnProperty;function ZG(t){var e=this.__data__;if(KG){var n=e[t];return n===JG?void 0:n}return XG.call(e,t)?e[t]:void 0}var eH=ZG,tH=Vh,nH=Object.prototype,rH=nH.hasOwnProperty;function iH(t){var e=this.__data__;return tH?e[t]!==void 0:rH.call(e,t)}var sH=iH,oH=Vh,aH="__lodash_hash_undefined__";function lH(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=oH&&e===void 0?aH:e,this}var cH=lH,uH=QG,fH=HG,dH=eH,hH=sH,pH=cH;function hl(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}hl.prototype.clear=uH;hl.prototype.delete=fH;hl.prototype.get=dH;hl.prototype.has=hH;hl.prototype.set=pH;var mH=hl,oS=mH,gH=Lh,yH=e0;function vH(){this.size=0,this.__data__={hash:new oS,map:new(yH||gH),string:new oS}}var bH=vH;function _H(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var EH=_H,wH=EH;function TH(t,e){var n=t.__data__;return wH(e)?n[typeof e=="string"?"string":"hash"]:n.map}var jh=TH,SH=jh;function OH(t){var e=SH(this,t).delete(t);return this.size-=e?1:0,e}var kH=OH,NH=jh;function AH(t){return NH(this,t).get(t)}var IH=AH,xH=jh;function CH(t){return xH(this,t).has(t)}var DH=CH,RH=jh;function MH(t,e){var n=RH(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var PH=MH,FH=bH,$H=kH,LH=IH,VH=DH,jH=PH;function pl(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}pl.prototype.clear=FH;pl.prototype.delete=$H;pl.prototype.get=LH;pl.prototype.has=VH;pl.prototype.set=jH;var t0=pl,BH=Lh,UH=e0,WH=t0,qH=200;function zH(t,e){var n=this.__data__;if(n instanceof BH){var r=n.__data__;if(!UH||r.length<qH-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new WH(r)}return n.set(t,e),this.size=n.size,this}var QH=zH,GH=Lh,HH=aG,KH=cG,JH=fG,YH=hG,XH=QH;function ml(t){var e=this.__data__=new GH(t);this.size=e.size}ml.prototype.clear=HH;ml.prototype.delete=KH;ml.prototype.get=JH;ml.prototype.has=YH;ml.prototype.set=XH;var n0=ml,ZH="__lodash_hash_undefined__";function e4(t){return this.__data__.set(t,ZH),this}var t4=e4;function n4(t){return this.__data__.has(t)}var r4=n4,i4=t0,s4=t4,o4=r4;function Cd(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new i4;++e<n;)this.add(t[e])}Cd.prototype.add=Cd.prototype.push=s4;Cd.prototype.has=o4;var a4=Cd;function l4(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var c4=l4;function u4(t,e){return t.has(e)}var f4=u4,d4=a4,h4=c4,p4=f4,m4=1,g4=2;function y4(t,e,n,r,i,s){var o=n&m4,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var u=s.get(t),d=s.get(e);if(u&&d)return u==e&&d==t;var h=-1,p=!0,g=n&g4?new d4:void 0;for(s.set(t,e),s.set(e,t);++h<a;){var y=t[h],b=e[h];if(r)var _=o?r(b,y,h,e,t,s):r(y,b,h,t,e,s);if(_!==void 0){if(_)continue;p=!1;break}if(g){if(!h4(e,function(w,O){if(!p4(g,O)&&(y===w||i(y,w,n,r,s)))return g.push(O)})){p=!1;break}}else if(!(y===b||i(y,b,n,r,s))){p=!1;break}}return s.delete(t),s.delete(e),p}var iI=y4,v4=wi,b4=v4.Uint8Array,sI=b4;function _4(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var E4=_4;function w4(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var T4=w4,aS=fl,lS=sI,S4=Fh,O4=iI,k4=E4,N4=T4,A4=1,I4=2,x4="[object Boolean]",C4="[object Date]",D4="[object Error]",R4="[object Map]",M4="[object Number]",P4="[object RegExp]",F4="[object Set]",$4="[object String]",L4="[object Symbol]",V4="[object ArrayBuffer]",j4="[object DataView]",cS=aS?aS.prototype:void 0,Km=cS?cS.valueOf:void 0;function B4(t,e,n,r,i,s,o){switch(n){case j4:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case V4:return!(t.byteLength!=e.byteLength||!s(new lS(t),new lS(e)));case x4:case C4:case M4:return S4(+t,+e);case D4:return t.name==e.name&&t.message==e.message;case P4:case $4:return t==e+"";case R4:var a=k4;case F4:var l=r&A4;if(a||(a=N4),t.size!=e.size&&!l)return!1;var u=o.get(t);if(u)return u==e;r|=I4,o.set(t,e);var d=O4(a(t),a(e),r,i,s,o);return o.delete(t),d;case L4:if(Km)return Km.call(t)==Km.call(e)}return!1}var U4=B4;function W4(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var r0=W4,q4=r0,z4=jn;function Q4(t,e,n){var r=e(t);return z4(t)?r:q4(r,n(t))}var oI=Q4;function G4(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}var aI=G4;function H4(){return[]}var lI=H4,K4=aI,J4=lI,Y4=Object.prototype,X4=Y4.propertyIsEnumerable,uS=Object.getOwnPropertySymbols,Z4=uS?function(t){return t==null?[]:(t=Object(t),K4(uS(t),function(e){return X4.call(t,e)}))}:J4,i0=Z4,e6=oI,t6=i0,n6=pu;function r6(t){return e6(t,n6,t6)}var cI=r6,fS=cI,i6=1,s6=Object.prototype,o6=s6.hasOwnProperty;function a6(t,e,n,r,i,s){var o=n&i6,a=fS(t),l=a.length,u=fS(e),d=u.length;if(l!=d&&!o)return!1;for(var h=l;h--;){var p=a[h];if(!(o?p in e:o6.call(e,p)))return!1}var g=s.get(t),y=s.get(e);if(g&&y)return g==e&&y==t;var b=!0;s.set(t,e),s.set(e,t);for(var _=o;++h<l;){p=a[h];var w=t[p],O=e[p];if(r)var N=o?r(O,w,p,e,t,s):r(w,O,p,t,e,s);if(!(N===void 0?w===O||i(w,O,n,r,s):N)){b=!1;break}_||(_=p=="constructor")}if(b&&!_){var I=t.constructor,P=e.constructor;I!=P&&"constructor"in t&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof P=="function"&&P instanceof P)&&(b=!1)}return s.delete(t),s.delete(e),b}var l6=a6,c6=Yo,u6=wi,f6=c6(u6,"DataView"),d6=f6,h6=Yo,p6=wi,m6=h6(p6,"Promise"),g6=m6,y6=Yo,v6=wi,b6=y6(v6,"Set"),_6=b6,E6=Yo,w6=wi,T6=E6(w6,"WeakMap"),S6=T6,Sy=d6,Oy=e0,ky=g6,Ny=_6,Ay=S6,uI=Jo,gl=rI,dS="[object Map]",O6="[object Object]",hS="[object Promise]",pS="[object Set]",mS="[object WeakMap]",gS="[object DataView]",k6=gl(Sy),N6=gl(Oy),A6=gl(ky),I6=gl(Ny),x6=gl(Ay),ho=uI;(Sy&&ho(new Sy(new ArrayBuffer(1)))!=gS||Oy&&ho(new Oy)!=dS||ky&&ho(ky.resolve())!=hS||Ny&&ho(new Ny)!=pS||Ay&&ho(new Ay)!=mS)&&(ho=function(t){var e=uI(t),n=e==O6?t.constructor:void 0,r=n?gl(n):"";if(r)switch(r){case k6:return gS;case N6:return dS;case A6:return hS;case I6:return pS;case x6:return mS}return e});var Bh=ho,Jm=n0,C6=iI,D6=U4,R6=l6,yS=Bh,vS=jn,bS=Kb,M6=eI,P6=1,_S="[object Arguments]",ES="[object Array]",If="[object Object]",F6=Object.prototype,wS=F6.hasOwnProperty;function $6(t,e,n,r,i,s){var o=vS(t),a=vS(e),l=o?ES:yS(t),u=a?ES:yS(e);l=l==_S?If:l,u=u==_S?If:u;var d=l==If,h=u==If,p=l==u;if(p&&bS(t)){if(!bS(e))return!1;o=!0,d=!1}if(p&&!d)return s||(s=new Jm),o||M6(t)?C6(t,e,n,r,i,s):D6(t,e,l,n,r,i,s);if(!(n&P6)){var g=d&&wS.call(t,"__wrapped__"),y=h&&wS.call(e,"__wrapped__");if(g||y){var b=g?t.value():t,_=y?e.value():e;return s||(s=new Jm),i(b,_,n,r,s)}}return p?(s||(s=new Jm),R6(t,e,n,r,i,s)):!1}var L6=$6,V6=L6,TS=Yi;function fI(t,e,n,r,i){return t===e?!0:t==null||e==null||!TS(t)&&!TS(e)?t!==t&&e!==e:V6(t,e,n,r,fI,i)}var dI=fI,j6=n0,B6=dI,U6=1,W6=2;function q6(t,e,n,r){var i=n.length,s=i,o=!r;if(t==null)return!s;for(t=Object(t);i--;){var a=n[i];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=n[i];var l=a[0],u=t[l],d=a[1];if(o&&a[2]){if(u===void 0&&!(l in t))return!1}else{var h=new j6;if(r)var p=r(u,d,l,t,e,h);if(!(p===void 0?B6(d,u,U6|W6,r,h):p))return!1}}return!0}var z6=q6,Q6=Xi;function G6(t){return t===t&&!Q6(t)}var hI=G6,H6=hI,K6=pu;function J6(t){for(var e=K6(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,H6(i)]}return e}var Y6=J6;function X6(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}var pI=X6,Z6=z6,eK=Y6,tK=pI;function nK(t){var e=eK(t);return e.length==1&&e[0][2]?tK(e[0][0],e[0][1]):function(n){return n===t||Z6(n,t,e)}}var rK=nK,iK=Jo,sK=Yi,oK="[object Symbol]";function aK(t){return typeof t=="symbol"||sK(t)&&iK(t)==oK}var mu=aK,lK=jn,cK=mu,uK=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fK=/^\w*$/;function dK(t,e){if(lK(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||cK(t)?!0:fK.test(t)||!uK.test(t)||e!=null&&t in Object(e)}var s0=dK,mI=t0,hK="Expected a function";function o0(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(hK);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(o0.Cache||mI),n}o0.Cache=mI;var pK=o0,mK=pK,gK=500;function yK(t){var e=mK(t,function(r){return n.size===gK&&n.clear(),r}),n=e.cache;return e}var vK=yK,bK=vK,_K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,EK=/\\(\\)?/g,wK=bK(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(_K,function(n,r,i,s){e.push(i?s.replace(EK,"$1"):r||n)}),e}),TK=wK;function SK(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var gI=SK,SS=fl,OK=gI,kK=jn,NK=mu,AK=1/0,OS=SS?SS.prototype:void 0,kS=OS?OS.toString:void 0;function yI(t){if(typeof t=="string")return t;if(kK(t))return OK(t,yI)+"";if(NK(t))return kS?kS.call(t):"";var e=t+"";return e=="0"&&1/t==-AK?"-0":e}var IK=yI,xK=IK;function CK(t){return t==null?"":xK(t)}var DK=CK,RK=jn,MK=s0,PK=TK,FK=DK;function $K(t,e){return RK(t)?t:MK(t,e)?[t]:PK(FK(t))}var Uh=$K,LK=mu,VK=1/0;function jK(t){if(typeof t=="string"||LK(t))return t;var e=t+"";return e=="0"&&1/t==-VK?"-0":e}var gu=jK,BK=Uh,UK=gu;function WK(t,e){e=BK(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[UK(e[n++])];return n&&n==r?t:void 0}var Wh=WK,qK=Wh;function zK(t,e,n){var r=t==null?void 0:qK(t,e);return r===void 0?n:r}var QK=zK;function GK(t,e){return t!=null&&e in Object(t)}var HK=GK,KK=Uh,JK=Hb,YK=jn,XK=Rh,ZK=Jb,e5=gu;function t5(t,e,n){e=KK(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=e5(e[r]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&ZK(i)&&XK(o,i)&&(YK(t)||JK(t)))}var n5=t5,r5=HK,i5=n5;function s5(t,e){return t!=null&&i5(t,e,r5)}var vI=s5,o5=dI,a5=QK,l5=vI,c5=s0,u5=hI,f5=pI,d5=gu,h5=1,p5=2;function m5(t,e){return c5(t)&&u5(e)?f5(d5(t),e):function(n){var r=a5(n,t);return r===void 0&&r===e?l5(n,t):o5(e,r,h5|p5)}}var g5=m5;function y5(t){return t}var a0=y5;function v5(t){return function(e){return e==null?void 0:e[t]}}var b5=v5,_5=Wh;function E5(t){return function(e){return _5(e,t)}}var w5=E5,T5=b5,S5=w5,O5=s0,k5=gu;function N5(t){return O5(t)?T5(k5(t)):S5(t)}var A5=N5,I5=rK,x5=g5,C5=a0,D5=jn,R5=A5;function M5(t){return typeof t=="function"?t:t==null?C5:typeof t=="object"?D5(t)?x5(t[0],t[1]):I5(t):R5(t)}var l0=M5,P5=Fh,F5=hu,$5=Rh,L5=Xi;function V5(t,e,n){if(!L5(n))return!1;var r=typeof e;return(r=="number"?F5(n)&&$5(e,n.length):r=="string"&&e in n)?P5(n[e],t):!1}var j5=V5,B5=gz,U5=MQ,W5=l0,q5=jn,z5=j5;function Q5(t,e,n){var r=q5(t)?B5:U5;return n&&z5(t,e,n)&&(e=void 0),r(t,W5(e))}var G5=Q5,H5=Yo,K5=function(){try{var t=H5(Object,"defineProperty");return t({},"",{}),t}catch{}}(),bI=K5,NS=bI;function J5(t,e,n){e=="__proto__"&&NS?NS(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var _I=J5,Y5=_I,X5=Fh,Z5=Object.prototype,e8=Z5.hasOwnProperty;function t8(t,e,n){var r=t[e];(!(e8.call(t,e)&&X5(r,n))||n===void 0&&!(e in t))&&Y5(t,e,n)}var c0=t8,n8=c0,r8=Uh,i8=Rh,AS=Xi,s8=gu;function o8(t,e,n,r){if(!AS(t))return t;e=r8(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var l=s8(e[i]),u=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=o){var d=a[l];u=r?r(d,l,a):void 0,u===void 0&&(u=AS(d)?d:i8(e[i+1])?[]:{})}n8(a,l,u),a=a[l]}return t}var EI=o8,a8=Wh,l8=EI,c8=Uh;function u8(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=a8(t,o);n(a,o)&&l8(s,c8(o,t),a)}return s}var f8=u8,d8=f8,h8=vI;function p8(t,e){return d8(t,e,function(n,r){return h8(t,r)})}var m8=p8,IS=fl,g8=Hb,y8=jn,xS=IS?IS.isConcatSpreadable:void 0;function v8(t){return y8(t)||g8(t)||!!(xS&&t&&t[xS])}var b8=v8,_8=r0,E8=b8;function wI(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=E8),i||(i=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?wI(a,e-1,n,r,i):_8(i,a):r||(i[i.length]=a)}return i}var w8=wI,T8=w8;function S8(t){var e=t==null?0:t.length;return e?T8(t,1):[]}var O8=S8;function k8(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var N8=k8,A8=N8,CS=Math.max;function I8(t,e,n){return e=CS(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=CS(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),A8(t,this,a)}}var x8=I8;function C8(t){return function(){return t}}var D8=C8,R8=D8,DS=bI,M8=a0,P8=DS?function(t,e){return DS(t,"toString",{configurable:!0,enumerable:!1,value:R8(e),writable:!0})}:M8,F8=P8,$8=800,L8=16,V8=Date.now;function j8(t){var e=0,n=0;return function(){var r=V8(),i=L8-(r-n);if(n=r,i>0){if(++e>=$8)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var B8=j8,U8=F8,W8=B8,q8=W8(U8),z8=q8,Q8=O8,G8=x8,H8=z8;function K8(t){return H8(G8(t,void 0,Q8),t+"")}var J8=K8,Y8=m8,X8=J8,Z8=X8(function(t,e){return t==null?{}:Y8(t,e)}),eJ=Z8;function tJ(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}var nJ=tJ,rJ=/\s/;function iJ(t){for(var e=t.length;e--&&rJ.test(t.charAt(e)););return e}var sJ=iJ,oJ=sJ,aJ=/^\s+/;function lJ(t){return t&&t.slice(0,oJ(t)+1).replace(aJ,"")}var cJ=lJ,uJ=cJ,RS=Xi,fJ=mu,MS=NaN,dJ=/^[-+]0x[0-9a-f]+$/i,hJ=/^0b[01]+$/i,pJ=/^0o[0-7]+$/i,mJ=parseInt;function gJ(t){if(typeof t=="number")return t;if(fJ(t))return MS;if(RS(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=RS(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=uJ(t);var n=hJ.test(t);return n||pJ.test(t)?mJ(t.slice(2),n?2:8):dJ.test(t)?MS:+t}var yJ=gJ,vJ=yJ,PS=1/0,bJ=17976931348623157e292;function _J(t){if(!t)return t===0?t:0;if(t=vJ(t),t===PS||t===-PS){var e=t<0?-1:1;return e*bJ}return t===t?t:0}var EJ=_J,wJ=EJ;function TJ(t){var e=wJ(t),n=e%1;return e===e?n?e-n:e:0}var SJ=TJ,OJ=nJ,kJ=SJ;function NJ(t,e,n){return t&&t.length?(e=n||e===void 0?1:kJ(e),OJ(t,0,e<0?0:e)):[]}var AJ=NJ;function IJ(t){return t==null}var xJ=IJ,CJ=Zb,DJ=hu;function RJ(t,e){var n=-1,r=DJ(t)?Array(t.length):[];return CJ(t,function(i,s,o){r[++n]=e(i,s,o)}),r}var MJ=RJ;function PJ(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}var FJ=PJ,FS=mu;function $J(t,e){if(t!==e){var n=t!==void 0,r=t===null,i=t===t,s=FS(t),o=e!==void 0,a=e===null,l=e===e,u=FS(e);if(!a&&!u&&!s&&t>e||s&&o&&l&&!a&&!u||r&&o&&l||!n&&l||!i)return 1;if(!r&&!s&&!u&&t<e||u&&n&&i&&!r&&!s||a&&n&&i||!o&&i||!l)return-1}return 0}var LJ=$J,VJ=LJ;function jJ(t,e,n){for(var r=-1,i=t.criteria,s=e.criteria,o=i.length,a=n.length;++r<o;){var l=VJ(i[r],s[r]);if(l){if(r>=a)return l;var u=n[r];return l*(u=="desc"?-1:1)}}return t.index-e.index}var BJ=jJ,Ym=gI,UJ=Wh,WJ=l0,qJ=MJ,zJ=FJ,QJ=Mh,GJ=BJ,HJ=a0,KJ=jn;function JJ(t,e,n){e.length?e=Ym(e,function(s){return KJ(s)?function(o){return UJ(o,s.length===1?s[0]:s)}:s}):e=[HJ];var r=-1;e=Ym(e,QJ(WJ));var i=qJ(t,function(s,o,a){var l=Ym(e,function(u){return u(s)});return{criteria:l,index:++r,value:s}});return zJ(i,function(s,o){return GJ(s,o,n)})}var YJ=JJ,XJ=YJ,$S=jn;function ZJ(t,e,n,r){return t==null?[]:($S(e)||(e=e==null?[]:[e]),n=r?void 0:n,$S(n)||(n=n==null?[]:[n]),XJ(t,e,n))}var e9=ZJ,qh={},t9=Jo,n9=Yi,r9="[object Number]";function i9(t){return typeof t=="number"||n9(t)&&t9(t)==r9}var s9=i9,Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.RenewalPolicy=Pr.InvalidationPolicyLifecycleEvent=Pr.InvalidationPolicyEvent=void 0;var LS;(function(t){t.Write="Write",t.Evict="Evict",t.Read="Read"})(LS||(Pr.InvalidationPolicyEvent=LS={}));var VS;(function(t){t.Write="onWrite",t.Evict="onEvict"})(VS||(Pr.InvalidationPolicyLifecycleEvent=VS={}));var jS;(function(t){t.AccessOnly="access-only",t.AccessAndWrite="access-and-write",t.WriteOnly="write-only",t.None="none"})(jS||(Pr.RenewalPolicy=jS={}));var Gs={};function o9(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var a9=o9,l9=c0,c9=_I;function u9(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=r?r(n[a],t[a],a,n,t):void 0;l===void 0&&(l=t[a]),i?c9(n,a,l):l9(n,a,l)}return n}var zh=u9,f9=zh,d9=pu;function h9(t,e){return t&&f9(e,d9(e),t)}var p9=h9;function m9(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var g9=m9,y9=Xi,v9=Xb,b9=g9,_9=Object.prototype,E9=_9.hasOwnProperty;function w9(t){if(!y9(t))return b9(t);var e=v9(t),n=[];for(var r in t)r=="constructor"&&(e||!E9.call(t,r))||n.push(r);return n}var T9=w9,S9=tI,O9=T9,k9=hu;function N9(t){return k9(t)?S9(t,!0):O9(t)}var u0=N9,A9=zh,I9=u0;function x9(t,e){return t&&A9(e,I9(e),t)}var C9=x9,Dd={exports:{}};Dd.exports;(function(t,e){var n=wi,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===r,o=s?n.Buffer:void 0,a=o?o.allocUnsafe:void 0;function l(u,d){if(d)return u.slice();var h=u.length,p=a?a(h):new u.constructor(h);return u.copy(p),p}t.exports=l})(Dd,Dd.exports);var D9=Dd.exports;function R9(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var M9=R9,P9=zh,F9=i0;function $9(t,e){return P9(t,F9(t),e)}var L9=$9,V9=nI,j9=V9(Object.getPrototypeOf,Object),f0=j9,B9=r0,U9=f0,W9=i0,q9=lI,z9=Object.getOwnPropertySymbols,Q9=z9?function(t){for(var e=[];t;)B9(e,W9(t)),t=U9(t);return e}:q9,TI=Q9,G9=zh,H9=TI;function K9(t,e){return G9(t,H9(t),e)}var J9=K9,Y9=oI,X9=TI,Z9=u0;function eY(t){return Y9(t,Z9,X9)}var tY=eY,nY=Object.prototype,rY=nY.hasOwnProperty;function iY(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&rY.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var sY=iY,BS=sI;function oY(t){var e=new t.constructor(t.byteLength);return new BS(e).set(new BS(t)),e}var d0=oY,aY=d0;function lY(t,e){var n=e?aY(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var cY=lY,uY=/\w*$/;function fY(t){var e=new t.constructor(t.source,uY.exec(t));return e.lastIndex=t.lastIndex,e}var dY=fY,US=fl,WS=US?US.prototype:void 0,qS=WS?WS.valueOf:void 0;function hY(t){return qS?Object(qS.call(t)):{}}var pY=hY,mY=d0;function gY(t,e){var n=e?mY(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var yY=gY,vY=d0,bY=cY,_Y=dY,EY=pY,wY=yY,TY="[object Boolean]",SY="[object Date]",OY="[object Map]",kY="[object Number]",NY="[object RegExp]",AY="[object Set]",IY="[object String]",xY="[object Symbol]",CY="[object ArrayBuffer]",DY="[object DataView]",RY="[object Float32Array]",MY="[object Float64Array]",PY="[object Int8Array]",FY="[object Int16Array]",$Y="[object Int32Array]",LY="[object Uint8Array]",VY="[object Uint8ClampedArray]",jY="[object Uint16Array]",BY="[object Uint32Array]";function UY(t,e,n){var r=t.constructor;switch(e){case CY:return vY(t);case TY:case SY:return new r(+t);case DY:return bY(t,n);case RY:case MY:case PY:case FY:case $Y:case LY:case VY:case jY:case BY:return wY(t,n);case OY:return new r;case kY:case IY:return new r(t);case NY:return _Y(t);case AY:return new r;case xY:return EY(t)}}var WY=UY,qY=Xi,zS=Object.create,zY=function(){function t(){}return function(e){if(!qY(e))return{};if(zS)return zS(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),QY=zY,GY=QY,HY=f0,KY=Xb;function JY(t){return typeof t.constructor=="function"&&!KY(t)?GY(HY(t)):{}}var YY=JY,XY=Bh,ZY=Yi,e7="[object Map]";function t7(t){return ZY(t)&&XY(t)==e7}var n7=t7,r7=n7,i7=Mh,QS=Yb,GS=QS&&QS.isMap,s7=GS?i7(GS):r7,o7=s7,a7=Bh,l7=Yi,c7="[object Set]";function u7(t){return l7(t)&&a7(t)==c7}var f7=u7,d7=f7,h7=Mh,HS=Yb,KS=HS&&HS.isSet,p7=KS?h7(KS):d7,m7=p7,g7=n0,y7=a9,v7=c0,b7=p9,_7=C9,E7=D9,w7=M9,T7=L9,S7=J9,O7=cI,k7=tY,N7=Bh,A7=sY,I7=WY,x7=YY,C7=jn,D7=Kb,R7=o7,M7=Xi,P7=m7,F7=pu,$7=u0,L7=1,V7=2,j7=4,SI="[object Arguments]",B7="[object Array]",U7="[object Boolean]",W7="[object Date]",q7="[object Error]",OI="[object Function]",z7="[object GeneratorFunction]",Q7="[object Map]",G7="[object Number]",kI="[object Object]",H7="[object RegExp]",K7="[object Set]",J7="[object String]",Y7="[object Symbol]",X7="[object WeakMap]",Z7="[object ArrayBuffer]",eX="[object DataView]",tX="[object Float32Array]",nX="[object Float64Array]",rX="[object Int8Array]",iX="[object Int16Array]",sX="[object Int32Array]",oX="[object Uint8Array]",aX="[object Uint8ClampedArray]",lX="[object Uint16Array]",cX="[object Uint32Array]",gt={};gt[SI]=gt[B7]=gt[Z7]=gt[eX]=gt[U7]=gt[W7]=gt[tX]=gt[nX]=gt[rX]=gt[iX]=gt[sX]=gt[Q7]=gt[G7]=gt[kI]=gt[H7]=gt[K7]=gt[J7]=gt[Y7]=gt[oX]=gt[aX]=gt[lX]=gt[cX]=!0;gt[q7]=gt[OI]=gt[X7]=!1;function td(t,e,n,r,i,s){var o,a=e&L7,l=e&V7,u=e&j7;if(n&&(o=i?n(t,r,i,s):n(t)),o!==void 0)return o;if(!M7(t))return t;var d=C7(t);if(d){if(o=A7(t),!a)return w7(t,o)}else{var h=N7(t),p=h==OI||h==z7;if(D7(t))return E7(t,a);if(h==kI||h==SI||p&&!i){if(o=l||p?{}:x7(t),!a)return l?S7(t,_7(o,t)):T7(t,b7(o,t))}else{if(!gt[h])return i?t:{};o=I7(t,h,a)}}s||(s=new g7);var g=s.get(t);if(g)return g;s.set(t,o),P7(t)?t.forEach(function(_){o.add(td(_,e,n,_,t,s))}):R7(t)&&t.forEach(function(_,w){o.set(w,td(_,e,n,w,t,s))});var y=u?l?k7:O7:l?$7:F7,b=d?void 0:y(t);return y7(b||t,function(_,w){b&&(w=_,_=t[w]),v7(o,w,td(_,e,n,w,t,s))}),o}var uX=td,fX=uX,dX=1,hX=4;function pX(t){return fX(t,dX|hX)}var mX=pX,gX=Jo,yX=f0,vX=Yi,bX="[object Object]",_X=Function.prototype,EX=Object.prototype,NI=_X.toString,wX=EX.hasOwnProperty,TX=NI.call(Object);function SX(t){if(!vX(t)||gX(t)!=bX)return!1;var e=yX(t);if(e===null)return!0;var n=wX.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&NI.call(n)==TX}var AI=SX,JS=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),OX=new Uint8Array(16);function II(){if(!JS)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return JS(OX)}var xI=[];for(var xf=0;xf<256;++xf)xI[xf]=(xf+256).toString(16).substr(1);function h0(t,e){var n=0,r=xI;return[r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]]].join("")}var YS,Xm,Zm=0,eg=0;function kX(t,e,n){var r=e&&n||0,i=e||[];t=t||{};var s=t.node||YS,o=t.clockseq!==void 0?t.clockseq:Xm;if(s==null||o==null){var a=t.random||(t.rng||II)();s==null&&(s=YS=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=Xm=(a[6]<<8|a[7])&16383)}var l=t.msecs!==void 0?t.msecs:new Date().getTime(),u=t.nsecs!==void 0?t.nsecs:eg+1,d=l-Zm+(u-eg)/1e4;if(d<0&&t.clockseq===void 0&&(o=o+1&16383),(d<0||l>Zm)&&t.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Zm=l,eg=u,Xm=o,l+=122192928e5;var h=((l&268435455)*1e4+u)%4294967296;i[r++]=h>>>24&255,i[r++]=h>>>16&255,i[r++]=h>>>8&255,i[r++]=h&255;var p=l/4294967296*1e4&268435455;i[r++]=p>>>8&255,i[r++]=p&255,i[r++]=p>>>24&15|16,i[r++]=p>>>16&255,i[r++]=o>>>8|128,i[r++]=o&255;for(var g=0;g<6;++g)i[r+g]=s[g];return e||h0(i)}function NX(t){var e=[];return t.replace(/[a-fA-F0-9]{2}/g,function(n){e.push(parseInt(n,16))}),e}function AX(t){t=unescape(encodeURIComponent(t));for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}var IX="6ba7b810-9dad-11d1-80b4-00c04fd430c8",xX="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function CI(t,e,n){var r=function(s,o,a,l){var u=a&&l||0;if(typeof s=="string"&&(s=AX(s)),typeof o=="string"&&(o=NX(o)),!Array.isArray(s))throw TypeError("value must be an array of bytes");if(!Array.isArray(o)||o.length!==16)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var d=n(o.concat(s));if(d[6]=d[6]&15|e,d[8]=d[8]&63|128,a)for(var h=0;h<16;++h)a[u+h]=d[h];return a||h0(d)};try{r.name=t}catch{}return r.DNS=IX,r.URL=xX,r}function CX(t){if(typeof t=="string"){var e=unescape(encodeURIComponent(t));t=new Array(e.length);for(var n=0;n<e.length;n++)t[n]=e.charCodeAt(n)}return DX(RX(MX(t),t.length*8))}function DX(t){var e,n,r=[],i=t.length*32,s="0123456789abcdef",o;for(e=0;e<i;e+=8)n=t[e>>5]>>>e%32&255,o=parseInt(s.charAt(n>>>4&15)+s.charAt(n&15),16),r.push(o);return r}function RX(t,e){t[e>>5]|=128<<e%32,t[(e+64>>>9<<4)+14]=e;var n,r,i,s,o,a=1732584193,l=-271733879,u=-1732584194,d=271733878;for(n=0;n<t.length;n+=16)r=a,i=l,s=u,o=d,a=yn(a,l,u,d,t[n],7,-680876936),d=yn(d,a,l,u,t[n+1],12,-389564586),u=yn(u,d,a,l,t[n+2],17,606105819),l=yn(l,u,d,a,t[n+3],22,-1044525330),a=yn(a,l,u,d,t[n+4],7,-176418897),d=yn(d,a,l,u,t[n+5],12,1200080426),u=yn(u,d,a,l,t[n+6],17,-1473231341),l=yn(l,u,d,a,t[n+7],22,-45705983),a=yn(a,l,u,d,t[n+8],7,1770035416),d=yn(d,a,l,u,t[n+9],12,-1958414417),u=yn(u,d,a,l,t[n+10],17,-42063),l=yn(l,u,d,a,t[n+11],22,-1990404162),a=yn(a,l,u,d,t[n+12],7,1804603682),d=yn(d,a,l,u,t[n+13],12,-40341101),u=yn(u,d,a,l,t[n+14],17,-1502002290),l=yn(l,u,d,a,t[n+15],22,1236535329),a=vn(a,l,u,d,t[n+1],5,-165796510),d=vn(d,a,l,u,t[n+6],9,-1069501632),u=vn(u,d,a,l,t[n+11],14,643717713),l=vn(l,u,d,a,t[n],20,-373897302),a=vn(a,l,u,d,t[n+5],5,-701558691),d=vn(d,a,l,u,t[n+10],9,38016083),u=vn(u,d,a,l,t[n+15],14,-660478335),l=vn(l,u,d,a,t[n+4],20,-405537848),a=vn(a,l,u,d,t[n+9],5,568446438),d=vn(d,a,l,u,t[n+14],9,-1019803690),u=vn(u,d,a,l,t[n+3],14,-187363961),l=vn(l,u,d,a,t[n+8],20,1163531501),a=vn(a,l,u,d,t[n+13],5,-1444681467),d=vn(d,a,l,u,t[n+2],9,-51403784),u=vn(u,d,a,l,t[n+7],14,1735328473),l=vn(l,u,d,a,t[n+12],20,-1926607734),a=bn(a,l,u,d,t[n+5],4,-378558),d=bn(d,a,l,u,t[n+8],11,-2022574463),u=bn(u,d,a,l,t[n+11],16,1839030562),l=bn(l,u,d,a,t[n+14],23,-35309556),a=bn(a,l,u,d,t[n+1],4,-1530992060),d=bn(d,a,l,u,t[n+4],11,1272893353),u=bn(u,d,a,l,t[n+7],16,-155497632),l=bn(l,u,d,a,t[n+10],23,-1094730640),a=bn(a,l,u,d,t[n+13],4,681279174),d=bn(d,a,l,u,t[n],11,-358537222),u=bn(u,d,a,l,t[n+3],16,-722521979),l=bn(l,u,d,a,t[n+6],23,76029189),a=bn(a,l,u,d,t[n+9],4,-640364487),d=bn(d,a,l,u,t[n+12],11,-421815835),u=bn(u,d,a,l,t[n+15],16,530742520),l=bn(l,u,d,a,t[n+2],23,-995338651),a=_n(a,l,u,d,t[n],6,-198630844),d=_n(d,a,l,u,t[n+7],10,1126891415),u=_n(u,d,a,l,t[n+14],15,-1416354905),l=_n(l,u,d,a,t[n+5],21,-57434055),a=_n(a,l,u,d,t[n+12],6,1700485571),d=_n(d,a,l,u,t[n+3],10,-1894986606),u=_n(u,d,a,l,t[n+10],15,-1051523),l=_n(l,u,d,a,t[n+1],21,-2054922799),a=_n(a,l,u,d,t[n+8],6,1873313359),d=_n(d,a,l,u,t[n+15],10,-30611744),u=_n(u,d,a,l,t[n+6],15,-1560198380),l=_n(l,u,d,a,t[n+13],21,1309151649),a=_n(a,l,u,d,t[n+4],6,-145523070),d=_n(d,a,l,u,t[n+11],10,-1120210379),u=_n(u,d,a,l,t[n+2],15,718787259),l=_n(l,u,d,a,t[n+9],21,-343485551),a=Ns(a,r),l=Ns(l,i),u=Ns(u,s),d=Ns(d,o);return[a,l,u,d]}function MX(t){var e,n=[];for(n[(t.length>>2)-1]=void 0,e=0;e<n.length;e+=1)n[e]=0;var r=t.length*8;for(e=0;e<r;e+=8)n[e>>5]|=(t[e/8]&255)<<e%32;return n}function Ns(t,e){var n=(t&65535)+(e&65535),r=(t>>16)+(e>>16)+(n>>16);return r<<16|n&65535}function PX(t,e){return t<<e|t>>>32-e}function Qh(t,e,n,r,i,s){return Ns(PX(Ns(Ns(e,t),Ns(r,s)),i),n)}function yn(t,e,n,r,i,s,o){return Qh(e&n|~e&r,t,e,i,s,o)}function vn(t,e,n,r,i,s,o){return Qh(e&r|n&~r,t,e,i,s,o)}function bn(t,e,n,r,i,s,o){return Qh(e^n^r,t,e,i,s,o)}function _n(t,e,n,r,i,s,o){return Qh(n^(e|~r),t,e,i,s,o)}var FX=CI("v3",48,CX);function $X(t,e,n){var r=e&&n||0;typeof t=="string"&&(e=t==="binary"?new Array(16):null,t=null),t=t||{};var i=t.random||(t.rng||II)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e)for(var s=0;s<16;++s)e[r+s]=i[s];return e||h0(i)}function LX(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:return e^n^r;case 2:return e&n^e&r^n&r;case 3:return e^n^r}}function tg(t,e){return t<<e|t>>>32-e}function VX(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var r=unescape(encodeURIComponent(t));t=new Array(r.length);for(var i=0;i<r.length;i++)t[i]=r.charCodeAt(i)}t.push(128);for(var s=t.length/4+2,o=Math.ceil(s/16),a=new Array(o),i=0;i<o;i++){a[i]=new Array(16);for(var l=0;l<16;l++)a[i][l]=t[i*64+l*4]<<24|t[i*64+l*4+1]<<16|t[i*64+l*4+2]<<8|t[i*64+l*4+3]}a[o-1][14]=(t.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(t.length-1)*8&4294967295;for(var i=0;i<o;i++){for(var u=new Array(80),d=0;d<16;d++)u[d]=a[i][d];for(var d=16;d<80;d++)u[d]=tg(u[d-3]^u[d-8]^u[d-14]^u[d-16],1);for(var h=n[0],p=n[1],g=n[2],y=n[3],b=n[4],d=0;d<80;d++){var _=Math.floor(d/20),w=tg(h,5)+LX(_,p,g,y)+b+e[_]+u[d]>>>0;b=y,y=g,g=tg(p,30)>>>0,p=h,h=w}n[0]=n[0]+h>>>0,n[1]=n[1]+p>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var jX=CI("v5",80,VX);const BX=Object.freeze(Object.defineProperty({__proto__:null,v1:kX,v3:FX,v4:$X,v5:jX},Symbol.toStringTag,{value:"Module"})),UX=nl(BX);(function(t){var e=Pe&&Pe.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(t,"__esModule",{value:!0}),t.generateFragmentFieldName=t.fieldNameFromStoreName=t.TypeOrFieldNameRegExp=t.maybeDeepClone=t.makeEntityId=t.isQuery=void 0;const n=e(mX),r=e(JA),i=e(AI),s=UX;function o(h){return h==="ROOT_QUERY"||h==="ROOT_MUTATION"}t.isQuery=o;function a(h,p){return o(h)?(0,r.default)([h,p]).join("."):h}t.makeEntityId=a;const l=h=>(0,i.default)(h)&&Object.isFrozen(h)?(0,n.default)(h):h;t.maybeDeepClone=l,t.TypeOrFieldNameRegExp=/^[_a-z][_0-9a-z]*/i;function u(h){var p=h.match(t.TypeOrFieldNameRegExp);return p?p[0]:h}t.fieldNameFromStoreName=u;function d({fragmentName:h}={}){return`-fragment-${h??(0,s.v4)()}`}t.generateFragmentFieldName=d})(Gs);var WX=Pe&&Pe.__rest||function(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},qX=Pe&&Pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qh,"__esModule",{value:!0});const zX=qX(s9),zn=Pr,QX=Gs,XS=du,GX=Pr;class HX{constructor(e){this.config=e,this.policyActionStorage={};const{cacheOperations:{readField:n,evict:r,modify:i}}=this.config;this.mutedCacheOperations={readField:n,evict:s=>r(Object.assign(Object.assign({},s),{broadcast:!1})),modify:s=>i(Object.assign(Object.assign({},s),{broadcast:!1}))},this.activePolicyEvents=this.activateInitialPolicyEvents()}activateInitialPolicyEvents(){const{policies:e}=this.config,{types:n={},timeToLive:r}=e;return Object.keys(n).reduce((i,s)=>{const o=n[s];return i[zn.InvalidationPolicyEvent.Read]=i[zn.InvalidationPolicyEvent.Read]||!!o.timeToLive,i[zn.InvalidationPolicyEvent.Write]=i[zn.InvalidationPolicyEvent.Write]||!!o[zn.InvalidationPolicyLifecycleEvent.Write],i[zn.InvalidationPolicyEvent.Evict]=i[zn.InvalidationPolicyEvent.Evict]||!!o[zn.InvalidationPolicyLifecycleEvent.Evict],i},{[zn.InvalidationPolicyEvent.Read]:!!r,[zn.InvalidationPolicyEvent.Write]:!1,[zn.InvalidationPolicyEvent.Evict]:!1})}getPolicy(e){var n,r;return((r=(n=this.config.policies)===null||n===void 0?void 0:n.types)===null||r===void 0?void 0:r[e])||null}getPolicyActionStorage(e){return this.policyActionStorage[e]||(this.policyActionStorage[e]={}),this.policyActionStorage[e]}getTypePolicyForEvent(e,n){const r=this.getPolicy(e);return r?r[zn.InvalidationPolicyLifecycleEvent[n]]:null}runPolicyEvent(e,n,r){const{entityTypeMap:i}=this.config,{mutedCacheOperations:s}=this,o=this.getTypePolicyForEvent(e,n);if(!o)return;let a,l={};if(typeof o=="object"){let{__default:u}=o,d=WX(o,["__default"]);a=u,l=d}else a=o;a&&a(s,Object.assign({storage:this.getPolicyActionStorage(`${e}__default`)},r)),Object.keys(l).forEach(u=>{var d;const h=(d=i.readEntitiesByType(u))!==null&&d!==void 0?d:{},p=o[u];Object.values(h).forEach(g=>{const{dataId:y,fieldName:b,storeFieldNames:_}=g;_?Object.keys(_.entries).forEach(w=>{p(s,Object.assign({id:y,fieldName:b,storeFieldName:w,variables:_.entries[w].variables,args:_.entries[w].args,ref:(0,XS.makeReference)(y),storage:this.getPolicyActionStorage(w)},r))}):p(s,Object.assign({id:y,storage:this.getPolicyActionStorage(y),ref:(0,XS.makeReference)(y)},r))})})}getRenewalPolicyForType(e){var n,r,i,s;const{policies:o}=this.config;return(s=(i=(r=(n=o.types)===null||n===void 0?void 0:n[e])===null||r===void 0?void 0:r.renewalPolicy)!==null&&i!==void 0?i:o.renewalPolicy)!==null&&s!==void 0?s:GX.RenewalPolicy.WriteOnly}runWritePolicy(e,n){return this.runPolicyEvent(e,zn.InvalidationPolicyEvent.Write,n)}runEvictPolicy(e,n){return this.runPolicyEvent(e,zn.InvalidationPolicyEvent.Evict,n)}runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s=!1}){var o;const{cacheOperations:a,entityTypeMap:l,policies:u}=this.config,d=(0,QX.makeEntityId)(n,r),h=l.readEntityById(d);if(!h)return!1;let p;if(i&&h.storeFieldNames){const y=h.storeFieldNames.entries[i];if(!y)return!1;p=y.cacheTime}else p=h.cacheTime;const g=((o=this.getPolicy(e))===null||o===void 0?void 0:o.timeToLive)||u.timeToLive;return(0,zX.default)(p)&&g&&Date.now()>p+g?(s||a.evict({id:n,fieldName:i,broadcast:!1}),!0):!1}activatePolicies(...e){e.forEach(n=>this.activePolicyEvents[n]=!0)}deactivatePolicies(...e){e.forEach(n=>this.activePolicyEvents[n]=!1)}isPolicyEventActive(e){return this.activePolicyEvents[e]}}qh.default=HX;var p0={},m0={},g0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.collectionEntityIdForType=t.cacheExtensionsCollectionTypename=void 0,t.cacheExtensionsCollectionTypename="CacheExtensionsCollectionEntity";function e(n){return`${t.cacheExtensionsCollectionTypename}:${n}`}t.collectionEntityIdForType=e})(g0);Object.defineProperty(m0,"__esModule",{value:!0});const ZS=Gs,KX=g0;class JX{constructor(e){this.config=e,this.delete=(o,a,l)=>{const{entityStore:u,entityTypeMap:d,policies:h}=this.config,p=this.storeFunctions.delete.call(u,o,a,l),g=d.readEntityById((0,ZS.makeEntityId)(o,a)),y=a&&l?h.getStoreFieldName({typename:g?g.typename:void 0,fieldName:a,args:l}):void 0;return d.evict(o,y||a),p},this.merge=(o,a)=>{const{entityStore:l,entityTypeMap:u}=this.config;if((0,ZS.isQuery)(o))Object.keys(a).filter(d=>d!=="__typename").forEach(d=>{const h=a[d],p=h==null?void 0:h.__typename;if(p)u.write(p,o,d);else{const g=this.config.policies.rootTypenamesById[o];u.write(g,o,d)}});else{const d=a.__typename;o&&d&&d!==KX.cacheExtensionsCollectionTypename&&(this.config.updateCollectionField(d,o),u.write(d,o))}return this.storeFunctions.merge.call(l,o,a)},this.clear=()=>{const{config:{entityStore:o,entityTypeMap:a},storeFunctions:l}=this;a.clear(),l.clear.call(o)},this.replace=o=>{const{config:{entityStore:a,entityTypeMap:l,reactiveVarsCache:u},storeFunctions:{replace:d}}=this,h=o==null?void 0:o.invalidation;if(!o||!h){d.call(a,o),u.reset();return}delete o.invalidation,l.restore(h.entitiesById),this.pause(),d.call(a,o),u.reset(),this.watch()};const{entityStore:{clear:n,delete:r,merge:i,replace:s}}=this.config;this.storeFunctions={clear:n,delete:r,merge:i,replace:s},this.watch()}watch(){const{entityStore:e}=this.config;e.clear=this.clear,e.delete=this.delete,e.merge=this.merge,e.replace=this.replace}pause(){const{entityStore:e}=this.config,{clear:n,delete:r,merge:i,replace:s}=this.storeFunctions;e.clear=n,e.delete=r,e.merge=i,e.replace=s}}m0.default=JX;var Gh={},YX=EI;function XX(t,e,n){return t==null?t:YX(t,e,n)}var ZX=XX,eZ=Pe&&Pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gh,"__esModule",{value:!0});const tZ=eZ(ZX),Pi=Gs;class nZ{constructor(){this.entitiesByType={},this.entitiesById={}}write(e,n,r,i,s){const o=r?(0,Pi.fieldNameFromStoreName)(r):void 0,a=(0,Pi.makeEntityId)(n,o),l=this.readEntityById(a);if(l){if((0,Pi.isQuery)(n)&&r){const u=l.storeFieldNames.entries[r];u?(u.variables=i,u.args=s):(l.storeFieldNames.entries[r]={variables:i,args:s},l.storeFieldNames.__size++)}}else{let u;const d=Date.now();(0,Pi.isQuery)(n)&&r?u={dataId:n,typename:e,fieldName:o,storeFieldNames:{__size:1,entries:{[r]:{variables:i,args:s,cacheTime:d}}}}:u={dataId:n,typename:e,cacheTime:d},(0,tZ.default)(this.entitiesByType,[e,a],u),this.entitiesById[a]=u}}evict(e,n){var r;const i=n?(0,Pi.fieldNameFromStoreName)(n):null,s=(0,Pi.makeEntityId)(e,i),o=this.readEntityById(s);if(o)if(n&&i!==n){const a=(r=this.entitiesByType[o.typename][s])===null||r===void 0?void 0:r.storeFieldNames;a&&(a.__size===1?(delete this.entitiesByType[o.typename][s],delete this.entitiesById[s]):(a.__size--,delete a.entries[n]))}else delete this.entitiesByType[o.typename][s],delete this.entitiesById[s]}readEntitiesByType(e){return this.entitiesByType[e]||null}readEntityById(e){return this.entitiesById[e]||null}renewEntity(e,n){const r=n?(0,Pi.fieldNameFromStoreName)(n):void 0,i=this.entitiesById[(0,Pi.makeEntityId)(e,r)];if(i){const s=Date.now();if((0,Pi.isQuery)(e)&&n){const o=i.storeFieldNames.entries[n];o&&(o.cacheTime=s)}else i.cacheTime=s}}restore(e){this.entitiesById=e,Object.keys(e).forEach(n=>{const r=e[n];this.entitiesByType[r.typename]||(this.entitiesByType[r.typename]={}),this.entitiesByType[r.typename][n]=r})}extract(){const{entitiesById:e,entitiesByType:n}=this;return{entitiesById:e,entitiesByType:n}}clear(){this.entitiesById={},this.entitiesByType={}}}Gh.default=nZ;(function(t){var e=Pe&&Pe.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.EntityTypeMap=t.EntityStoreWatcher=void 0;var n=m0;Object.defineProperty(t,"EntityStoreWatcher",{enumerable:!0,get:function(){return e(n).default}});var r=Gh;Object.defineProperty(t,"EntityTypeMap",{enumerable:!0,get:function(){return e(r).default}})})(p0);var Fo={};const rZ=nl(oU);var DI=Pe&&Pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.CacheResultProcessor=Fo.ReadResultStatus=void 0;const ng=du,_a=DI(AI),eO=DI(jn),Fi=rZ,tc=Gs,ci=Pr;var ln;(function(t){t[t.Evicted=0]="Evicted",t[t.Incomplete=1]="Incomplete",t[t.Complete=2]="Complete"})(ln||(Fo.ReadResultStatus=ln={}));class iZ{constructor(e){this.config=e}getFieldsForQuery(e){const n=(0,Fi.getOperationDefinition)(e.query),r=(0,Fi.createFragmentMap)((0,Fi.getFragmentDefinitions)(e.query));return n.selectionSet.selections.reduce((i,s)=>{var o,a;if((0,Fi.isField)(s))return i.push(s),i;const l=(a=(o=(0,Fi.getFragmentFromSelection)(s,r))===null||o===void 0?void 0:o.selectionSet)===null||a===void 0?void 0:a.selections;return l&&i.push(...l),i},[])}processReadSubResult(e,n){const{cache:r,invalidationPolicyManager:i,entityTypeMap:s}=this.config,o=n==null?e:e[n];if((0,_a.default)(o)){const{__typename:a}=o,l=Object.keys(o).reduce((u,d)=>this.processReadSubResult(o,d)===ln.Complete,!0);if(a){const u=r.identify(o);if(u){const d=i.getRenewalPolicyForType(a);if((d===ci.RenewalPolicy.AccessAndWrite||d===ci.RenewalPolicy.AccessOnly)&&s.renewEntity(u),i.runReadPolicy({typename:a,dataId:u}))return(0,_a.default)(e)&&n&&delete e[n],ln.Evicted}}return l?ln.Complete:ln.Incomplete}else if((0,eO.default)(o)){let a=ln.Complete;const l=o.map((u,d)=>{const h=this.processReadSubResult(o,d);return h<a&&(a=h),h});return a===ln.Evicted&&n&&(e[n]=o.filter((u,d)=>l[d]!==ln.Evicted)),a===ln.Complete?ln.Complete:ln.Incomplete}return ln.Complete}processReadResult(e,n){const{cache:r,entityTypeMap:i,invalidationPolicyManager:s}=this.config,{rootId:o="ROOT_QUERY"}=n;if((0,_a.default)(e)){if((0,tc.isQuery)(o)){const{variables:a}=n,l=this.getFieldsForQuery(n).reduce((u,d)=>{var h;const p=d.name.value,g=(0,Fi.resultKeyNameFromField)(d),y=this.processReadSubResult(e,g),b=(h=i.readEntityById((0,tc.makeEntityId)(o,p)))===null||h===void 0?void 0:h.typename;if(b){const _=r.policies.getStoreFieldName({typename:b,fieldName:p,field:d,variables:a}),w=r.policies.rootTypenamesById[o],O=r.policies.getStoreFieldName({typename:w,fieldName:p,field:d,variables:a}),N=s.getRenewalPolicyForType(b);(N===ci.RenewalPolicy.AccessAndWrite||N===ci.RenewalPolicy.AccessOnly)&&(i.renewEntity(o,_),i.renewEntity(o,O));const I=s.runReadPolicy({typename:b,dataId:o,fieldName:p,storeFieldName:_}),P=s.runReadPolicy({typename:b,dataId:o,fieldName:p,storeFieldName:O});if(I||P)return delete e[g],!1}return u&&y===ln.Complete},!0);return(0,Fi.maybeDeepFreeze)(e),l?ln.Complete:ln.Incomplete}return(0,Fi.maybeDeepFreeze)(e),this.processReadSubResult(e)}return ln.Complete}processWriteSubResult(e){const{cache:n,invalidationPolicyManager:r,entityTypeMap:i}=this.config;if((0,_a.default)(e)){const{__typename:s}=e;if(Object.keys(e).forEach(o=>this.processWriteSubResult(e[o])),s){const o=n.identify(e);if(o){const a=r.getRenewalPolicyForType(s);(a===ci.RenewalPolicy.WriteOnly||a===ci.RenewalPolicy.AccessAndWrite)&&i.renewEntity(o),r.runWritePolicy(s,{parent:{id:o,ref:(0,ng.makeReference)(o)}})}}}else(0,eO.default)(e)&&e.forEach(s=>this.processWriteSubResult(s))}processWriteResult(e){var n;const{dataId:r,variables:i,result:s}=e,{entityTypeMap:o,cache:a,invalidationPolicyManager:l}=this.config;if((0,_a.default)(s)&&this.processWriteSubResult(s),r&&(0,tc.isQuery)(r)&&(0,_a.default)(s))this.getFieldsForQuery(e).forEach(u=>{var d;const h=u.name.value,p=(d=o.readEntityById((0,tc.makeEntityId)(r,h)))===null||d===void 0?void 0:d.typename;if(p){const g=a.policies.getStoreFieldName({typename:p,field:u,fieldName:h,variables:i}),y=(0,Fi.argumentsObjectFromField)(u,i),b=i??(y!==null?{}:void 0),_=a.policies.rootTypenamesById[r],w=a.policies.getStoreFieldName({typename:_,fieldName:h,field:u,variables:i});o.write(p,r,g,b,y),o.write(p,r,w,b,y);const O=l.getRenewalPolicyForType(p);(O===ci.RenewalPolicy.WriteOnly||O===ci.RenewalPolicy.AccessAndWrite)&&(o.renewEntity(r,g),o.renewEntity(r,w)),l.runWritePolicy(p,{parent:{id:r,fieldName:h,storeFieldName:g,ref:(0,ng.makeReference)(r),variables:b,args:y}})}});else if(r){const u=(n=o.readEntityById((0,tc.makeEntityId)(r)))===null||n===void 0?void 0:n.typename;if(u){const d=l.getRenewalPolicyForType(u);(d===ci.RenewalPolicy.WriteOnly||d===ci.RenewalPolicy.AccessAndWrite)&&o.renewEntity(r),l.runWritePolicy(u,{parent:{id:r,ref:(0,ng.makeReference)(r),variables:i}})}}}}Fo.CacheResultProcessor=iZ;var rg=Pe&&Pe.__rest||function(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},Hs=Pe&&Pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dh,"__esModule",{value:!0});const hs=du,sZ=Hs(JA),oZ=Hs(G5),aZ=Hs(eJ),lZ=Hs(AJ),cZ=Hs(xJ),uZ=Hs(Ph),fZ=Hs(e9),dZ=Hs(qh),tO=p0,ui=Gs,nc=Fo,xn=Pr,ig=g0,hZ=Gb;class pZ extends hs.InMemoryCache{constructor(e={}){const{invalidationPolicies:n={},enableCollections:r=!1}=e,i=rg(e,["invalidationPolicies","enableCollections"]);super(i),this.pendingCollectionUpdates={},this.enableCollections=r,this.invalidationPolicies=n,this.isBroadcasting=!1,this.isInitialized=!0,this.reactiveVarsCache=(0,hZ.initReactiveVarsCache)(this),this.reinitialize()}reinitialize(){this.entityStoreRoot=this.data,this.entityTypeMap=new tO.EntityTypeMap,this.entityStoreWatcher=new tO.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new dZ.default({policies:this.invalidationPolicies,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:(...e)=>this.evict(...e),modify:(...e)=>this.modify(...e),readField:(...e)=>this.readField(...e)}}),this.cacheResultProcessor=new nc.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this}),this.reactiveVarsCache.reset()}init(){super.init(),this.isInitialized&&this.reinitialize()}readField(e,n){if(!e)return;const r=typeof e=="string"?{fieldName:e,from:n}:e;return r.from===void 0&&(r.from={__ref:"ROOT_QUERY"}),this.policies.readField(r,{store:this.entityStoreRoot})}broadcastWatches(e){this.isBroadcasting=!0,super.broadcastWatches(e),this.isBroadcasting=!1}get _hasPendingCollectionUpdates(){return Object.keys(this.pendingCollectionUpdates).length>0}isOperatingOnRootData(){return this.data===this.entityStoreRoot}modify(e){var n;const r=super.modify(e);if(!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Write)||!r)return r;const{id:i="ROOT_QUERY",fields:s}=e;if((0,ui.isQuery)(i))Object.keys(s).forEach(o=>{var a;const l=(0,ui.fieldNameFromStoreName)(o),u=(a=this.entityTypeMap.readEntityById((0,ui.makeEntityId)(i,l)))===null||a===void 0?void 0:a.typename;u&&this.invalidationPolicyManager.runWritePolicy(u,{parent:{id:i,fieldName:l,storeFieldName:o,ref:(0,hs.makeReference)(i)}})});else{const o=(n=this.entityTypeMap.readEntityById(i))===null||n===void 0?void 0:n.typename;if(!o)return r;this.invalidationPolicyManager.runWritePolicy(o,{parent:{id:i,ref:(0,hs.makeReference)(i)}})}return e.broadcast&&this.broadcastWatches(),r}write(e){const n=super.write(e);return!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Write)&&!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Read)||!this.isOperatingOnRootData()||(this.cacheResultProcessor.processWriteResult(e),e.broadcast&&this.broadcastWatches()),n}evictWhere(e){const{__typename:n,filter:r}=e,i=this.readReferenceWhere({__typename:n,filter:r});return i.forEach(s=>this.evict({id:s.__ref,broadcast:!1})),this.broadcastWatches(),i}evict(e){var n;const{fieldName:r,args:i}=e;let{id:s}=e;if(!s){if(Object.prototype.hasOwnProperty.call(e,"id"))return!1;s="ROOT_QUERY"}if(this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Evict)){const{typename:o}=(n=this.entityTypeMap.readEntityById((0,ui.makeEntityId)(s,r)))!==null&&n!==void 0?n:{};if(o){const a=(0,ui.isQuery)(s)&&r?this.policies.getStoreFieldName({typename:o,fieldName:r,args:i}):void 0;this.invalidationPolicyManager.runEvictPolicy(o,{parent:{id:s,fieldName:r,storeFieldName:a,variables:i,ref:(0,hs.makeReference)(s)}})}}return super.evict(e)}_updatePendingCollection(e){const n=this.pendingCollectionUpdates[e];n&&(this.modify({broadcast:!1,id:e,fields:{data:(r,{canRead:i})=>{const s=r;let o=!1;const a=s.reduce((u,d)=>{const{__ref:h}=d;return!o&&u[h]&&(o=!0),u[h]=d,u},{}),l=Object.values(n).filter(u=>!a[u.__ref]&&i(u));return!o&&l.length===0?r:[...Object.values(a),...l]}}}),delete this.pendingCollectionUpdates[e])}_updatePendingCollections(){this._hasPendingCollectionUpdates&&(Object.keys(this.pendingCollectionUpdates).forEach(e=>{this._updatePendingCollection(e)}),this.broadcastWatches())}updateCollectionField(e,n){if(!this.enableCollections)return;const r=(0,ig.collectionEntityIdForType)(e);!!this.readField("id",(0,hs.makeReference)(r))||this.writeFragment({id:r,fragment:(0,hs.gql)`
221
+ fragment InitializeCollectionEntity on CacheExtensionsCollectionEntity {
222
+ data
223
+ id
224
+ }
225
+ `,data:{__typename:ig.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,hs.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,ui.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,ui.makeEntityId)(a,d))}):this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,reportOnly:e})&&r.push((0,ui.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(xn.InvalidationPolicyEvent.Read,xn.InvalidationPolicyEvent.Write,xn.InvalidationPolicyEvent.Evict)}deactivatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.deactivatePolicies(...e):this.invalidationPolicyManager.deactivatePolicies(xn.InvalidationPolicyEvent.Read,xn.InvalidationPolicyEvent.Write,xn.InvalidationPolicyEvent.Evict)}activePolicyEvents(){return[xn.InvalidationPolicyEvent.Read,xn.InvalidationPolicyEvent.Write,xn.InvalidationPolicyEvent.Evict].filter(e=>this.invalidationPolicyManager.isPolicyEventActive(e))}read(e){const n=super.read(e);if(!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Read))return n;const r=(0,ui.maybeDeepClone)(n),i=this.cacheResultProcessor.processReadResult(r,e);return i===nc.ReadResultStatus.Complete?n:(this.broadcastWatches(),i===nc.ReadResultStatus.Evicted?null:r)}diff(e){const n=super.diff(e);if(!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Read)||this.isBroadcasting)return n;const{result:r}=n,i=(0,ui.maybeDeepClone)(r),s=this.cacheResultProcessor.processReadResult(i,e);return s===nc.ReadResultStatus.Complete||(this.broadcastWatches(),n.complete=!1,n.result=s===nc.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,aZ.default)(this.entityTypeMap.extract(),"entitiesById")),r}readFragmentWhere(e){const{fragment:n,filter:r,limit:i,orderBy:s}=e,o=rg(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,sZ.default)(d)}readReferenceWhere(e){const{__typename:n,filter:r,limit:i,orderBy:s}=e,o=(0,ig.collectionEntityIdForType)(n);this.pendingCollectionUpdates[o]&&this._updatePendingCollection(o);let a=this.readField("data",(0,hs.makeReference)(o));if(!a)return[];const l=this.readField.bind(this);if(r&&(a=a.filter(u=>{if((0,uZ.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,oZ.default)(d,Boolean)})),s){const{field:u,descending:d}=s;a=(0,fZ.default)(a,h=>l(u,h),[d?"desc":"asc"])}return(0,cZ.default)(i)?a:(0,lZ.default)(a,i)}writeFragmentWhere(e){const{update:n}=e,r=rg(e,["update"]);this.readFragmentWhere(r).forEach(i=>{this.writeFragment({id:this.identify(i),fragment:e.fragment,data:n(i),broadcast:!1})}),this.broadcastWatches()}}Dh.default=pZ;(function(t){var e=Pe&&Pe.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCache=t.makeCachedVar=void 0;var n=Gb;Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return n.makeCachedVar}});var r=Dh;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e(r).default}})})(KA);var RI={},y0={},Bs={};const mZ=nl(MB);Object.defineProperty(Bs,"__esModule",{value:!0});Bs.buildWatchFragmentWhereQuery=Bs.buildWatchFragmentQuery=void 0;const ps=mZ,gZ=du;function MI({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 yZ(t){const{fragment:e,id:n,policies:r,fieldName:i}=t,s=e.definitions[0],o=MI({fragmentDefinition:s,fieldName:i});return r.getFieldPolicy("Query",i)||r.addTypePolicies({Query:{fields:{[i]:{read(a){return(0,gZ.makeReference)(n)}}}}}),o}Bs.buildWatchFragmentQuery=yZ;function vZ(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=MI({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}Bs.buildWatchFragmentWhereQuery=vZ;Object.defineProperty(y0,"__esModule",{value:!0});const Cf=du,nO=Bs,rO=Gs;class bZ extends Cf.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,rO.generateFragmentFieldName)(),r=(0,nO.buildWatchFragmentQuery)(Object.assign(Object.assign({},e),{fieldName:n,policies:this.policies}));return this.watchQueryForField(r,n)}watchFragmentWhere(e){const n=(0,rO.generateFragmentFieldName)(),r=(0,Cf.makeVar)(e.filter),i=(0,Cf.makeVar)(e.limit),s=(0,Cf.makeVar)(e.orderBy),o=(0,nO.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)}}y0.default=bZ;(function(t){var e=Pe&&Pe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.ApolloExtensionsClient=void 0;var n=y0;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return e(n).default}})})(RI);var PI={},v0={},$o={},_Z=Pe&&Pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($o,"__esModule",{value:!0});$o.usePrevious=$o.useOnce=void 0;const Rd=ce,EZ=_Z(Ph);function wZ(t){const e=(0,Rd.useRef)(),n=(0,Rd.useRef)(!1);return n.current||((0,EZ.default)(t)?e.current=t():e.current=t,n.current=!0),e.current}$o.useOnce=wZ;const TZ=t=>{const e=(0,Rd.useRef)(null);return(0,Rd.useEffect)(()=>{e.current=t}),e.current};$o.usePrevious=TZ;var yu={};Object.defineProperty(yu,"__esModule",{value:!0});yu.useFragmentTypePolicyFieldName=void 0;const SZ=ul,iO=ce,OZ=Gs,kZ=$o,NZ=({fragmentName:t}={})=>{const e=(0,iO.useMemo)(()=>(0,OZ.generateFragmentFieldName)({fragmentName:t}),[t]),n=(0,kZ.usePrevious)(e),r=(0,SZ.useApolloClient)();return(0,iO.useEffect)(()=>()=>{delete r.cache.policies.typePolicies.Query.fields[n]},[e,n]),e};yu.useFragmentTypePolicyFieldName=NZ;var vu={};Object.defineProperty(vu,"__esModule",{value:!0});vu.useGetQueryDataByFieldName=void 0;const AZ=ul,IZ=(t,e,n)=>{var r,i;const s=(0,AZ.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}};vu.useGetQueryDataByFieldName=IZ;Object.defineProperty(v0,"__esModule",{value:!0});const xZ=ul,CZ=ce,DZ=$o,RZ=Bs,MZ=yu,PZ=vu;function FZ(t,e){const r=(0,CZ.useContext)((0,xZ.getApolloContext)()).client,i=r==null?void 0:r.cache,s=(0,MZ.useFragmentTypePolicyFieldName)(),o=(0,DZ.useOnce)(()=>(0,RZ.buildWatchFragmentQuery)({fragment:t,fieldName:s,id:e.id,policies:i.policies}));return(0,PZ.useGetQueryDataByFieldName)(o,s,e)}v0.default=FZ;var b0={};const $Z=nl(MU);Object.defineProperty(b0,"__esModule",{value:!0});const LZ=ul,$i=ce,VZ=Bs,jZ=yu,BZ=vu,sg=ul,sO=$Z;function UZ(t,e){var n;const r=e==null?void 0:e.filter,s=(0,$i.useRef)((0,sg.makeVar)(r)).current,o=e==null?void 0:e.limit,l=(0,$i.useRef)((0,sg.makeVar)(o)).current,u=e==null?void 0:e.orderBy,h=(0,$i.useRef)((0,sg.makeVar)(u)).current,g=(0,$i.useContext)((0,LZ.getApolloContext)()).client,y=g==null?void 0:g.cache,b=(0,jZ.useFragmentTypePolicyFieldName)({fragmentName:e==null?void 0:e.fragmentName}),_=(0,$i.useRef)([]);(0,$i.useEffect)(()=>{(typeof r=="function"&&r!==s()||!(0,sO.equal)(r,s()))&&s(r)},[r]),(0,$i.useEffect)(()=>{o!==l()&&l(o)},[o]),(0,$i.useEffect)(()=>{(typeof u=="function"&&u!==h()||!(0,sO.equal)(u,h()))&&h(u)},[u]);const w=(0,$i.useMemo)(()=>(0,VZ.buildWatchFragmentWhereQuery)({filter:r,filterVar:s,limitVar:l,orderByVar:h,fragment:t,fieldName:b,cache:y,policies:y.policies}),[b]),O=(0,BZ.useGetQueryDataByFieldName)(w,b,e);return Object.assign(Object.assign({},O),{data:(n=O.data)!==null&&n!==void 0?n:_.current})}b0.default=UZ;(function(t){var e=Pe&&Pe.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFragmentWhere=t.useFragment=void 0;var n=v0;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return e(n).default}});var r=b0;Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return e(r).default}})})(PI);var FI={},_0={},bu={},WZ=Pe&&Pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bu,"__esModule",{value:!0});bu.AuditType=void 0;const qZ=WZ(qh);var bc;(function(t){t.Read="Read",t.Write="Write",t.Evict="Evict"})(bc||(bu.AuditType=bc={}));class zZ extends qZ.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",bc.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",bc.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runWritePolicy(e,n)}runEvictPolicy(e,n){return this.auditLog.log("Running evict policy",bc.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runEvictPolicy(e,n)}}bu.default=zZ;var E0={},QZ=Pe&&Pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(E0,"__esModule",{value:!0});const GZ=QZ(Gh);var Md;(function(t){t.Write="Write",t.Evict="Evict"})(Md||(Md={}));class HZ extends GZ.default{constructor(e){super(),this.auditLog=e.auditLog}write(e,n,r,i){return this.auditLog.log("Writing to type map",Md.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",Md.Evict,"EntityTypeMap",{dataId:e,storeFieldName:n}),super.evict(e,n)}}E0.default=HZ;var w0={},KZ=Zb;function JZ(t,e){var n=[];return KZ(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}var YZ=JZ,XZ=aI,ZZ=YZ,eee=l0,tee=jn;function nee(t,e){var n=tee(t)?XZ:ZZ;return n(t,eee(e))}var ree=nee,iee=Pe&&Pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(w0,"__esModule",{value:!0});const see=iee(ree);class oee{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,see.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()}}w0.default=oee;var Hh=Pe&&Pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_0,"__esModule",{value:!0});const aee=Hh(Dh),lee=Fo,cee=Hh(bu),uee=Hh(E0),fee=Hh(w0),dee=p0;class hee extends aee.default{constructor(e){super(e),this.auditLog=new fee.default;const{invalidationPolicies:n={}}=e;this.entityTypeMap=new uee.default({auditLog:this.auditLog}),new dee.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new cee.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 lee.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this})}}_0.default=hee;(function(t){var e=Pe&&Pe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCacheAuditor=void 0;var n=_0;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return e(n).default}})})(FI);(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=KA;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e.InvalidationPolicyCache}}),Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return e.makeCachedVar}});var n=RI;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return n.ApolloExtensionsClient}});var r=PI;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return r.useFragment}}),Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return r.useFragmentWhere}});var i=FI;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return i.InvalidationPolicyCacheAuditor}});var s=Pr;Object.defineProperty(t,"InvalidationPolicyEvent",{enumerable:!0,get:function(){return s.InvalidationPolicyEvent}}),Object.defineProperty(t,"RenewalPolicy",{enumerable:!0,get:function(){return s.RenewalPolicy}})})(Ty);var og=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))},pee=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,og([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=og(og([],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}(),mee=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}(),Df=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())})},Rf=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}}},$I=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 Df(this,void 0,void 0,function(){return Rf(this,function(e){return[2,this.storage.getItem(this.key)]})})},t.prototype.write=function(e){return Df(this,void 0,void 0,function(){return Rf(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 Df(this,void 0,void 0,function(){return Rf(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 Df(this,void 0,void 0,function(){var e;return Rf(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}(),ag=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())})},lg=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}}},LI=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 ag(this,void 0,void 0,function(){var e,n;return lg(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 ag(this,void 0,void 0,function(){var e,n;return lg(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 ag(this,void 0,void 0,function(){var e;return lg(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 VI=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}}},gee=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"),VI({cache:n})(r)}};var yee=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=VI({cache:a})(this.fire);break;case"background":l&&r.warn("Debounce is not recommended with `background` trigger"),this.debounce=l,this.uninstall=gee({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}(),vee=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 pee(e),r=new mee(e),i=new $I(e),s=new LI({log:n,cache:r,storage:i},e),o=new yee({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}(),T0=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)}}(),bee=function(t){var e=new _ee(t);e.restoreSync()},_ee=function(t){T0(e,t);function e(n){var r=t.call(this,n)||this;return r.storage=new wee(n),r.persistor=new Eee({log:r.log,cache:r.cache,storage:r.storage},n),r}return e.prototype.restoreSync=function(){this.persistor.restoreSync()},e}(vee),Eee=function(t){T0(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}(LI),wee=function(t){T0(e,t);function e(n){return t.call(this,n)||this}return e.prototype.readSync=function(){return this.storage.getItem(this.key)},e}($I),Tee=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}(),Pd={exports:{}};/**
226
+ * @license
227
+ * Lodash <https://lodash.com/>
228
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
229
+ * Released under MIT license <https://lodash.com/license>
230
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
231
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
232
+ */Pd.exports;(function(t,e){(function(){var n,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,p=2,g=4,y=1,b=2,_=1,w=2,O=4,N=8,I=16,P=32,M=64,B=128,Q=256,x=512,U=30,Te="...",ke=800,he=16,Ce=1,ee=2,Ae=3,fe=1/0,ve=9007199254740991,Se=17976931348623157e292,dt=NaN,Ne=4294967295,L=Ne-1,te=Ne>>>1,X=[["ary",B],["bind",_],["bindKey",w],["curry",N],["curryRight",I],["flip",x],["partial",P],["partialRight",M],["rearg",Q]],ne="[object Arguments]",be="[object Array]",Re="[object AsyncFunction]",Ke="[object Boolean]",Kt="[object Date]",ri="[object DOMException]",ii="[object Error]",Bt="[object Function]",Tu="[object GeneratorFunction]",tr="[object Map]",si="[object Number]",Xs="[object Null]",yr="[object Object]",bl="[object Promise]",Zo="[object Proxy]",Zs="[object RegExp]",nr="[object Set]",Si="[object String]",ea="[object Symbol]",cp="[object Undefined]",Zi="[object WeakMap]",Su="[object WeakSet]",Wr="[object ArrayBuffer]",es="[object DataView]",ta="[object Float32Array]",na="[object Float64Array]",eo="[object Int8Array]",_l="[object Int16Array]",El="[object Int32Array]",wl="[object Uint8Array]",Tl="[object Uint8ClampedArray]",Sl="[object Uint16Array]",Ol="[object Uint32Array]",up=/\b__p \+= '';/g,kl=/\b(__p \+=) '' \+/g,Ou=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Oi=/&(?:amp|lt|gt|quot|#39);/g,ra=/[&<>"']/g,Nl=RegExp(Oi.source),ku=RegExp(ra.source),fp=/<%-([\s\S]+?)%>/g,Nu=/<%([\s\S]+?)%>/g,Au=/<%=([\s\S]+?)%>/g,Iu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xu=/^\w*$/,dp=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Al=/[\\^$.*+?()[\]{}|]/g,Cu=RegExp(Al.source),ia=/^\s+/,hp=/\s/,pp=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,mp=/\{\n\/\* \[wrapped with (.+)\] \*/,gp=/,? & /,C=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,ie=/\\(\\)?/g,Oe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nt=/\w*$/,lt=/^[-+]0x[0-9a-f]+$/i,Je=/^0b[01]+$/i,ze=/^\[object .+?Constructor\]$/,nn=/^0o[0-7]+$/i,St=/^(?:0|[1-9]\d*)$/,At=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rn=/($^)/,ts=/['\n\r\u2028\u2029\\]/g,vr="\\ud800-\\udfff",pn="\\u0300-\\u036f",Il="\\ufe20-\\ufe2f",yp="\\u20d0-\\u20ff",Du=pn+Il+yp,H0="\\u2700-\\u27bf",K0="a-z\\xdf-\\xf6\\xf8-\\xff",PC="\\xac\\xb1\\xd7\\xf7",FC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$C="\\u2000-\\u206f",LC=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",J0="A-Z\\xc0-\\xd6\\xd8-\\xde",Y0="\\ufe0e\\ufe0f",X0=PC+FC+$C+LC,vp="['’]",VC="["+vr+"]",Z0="["+X0+"]",Ru="["+Du+"]",e_="\\d+",jC="["+H0+"]",t_="["+K0+"]",n_="[^"+vr+X0+e_+H0+K0+J0+"]",bp="\\ud83c[\\udffb-\\udfff]",BC="(?:"+Ru+"|"+bp+")",r_="[^"+vr+"]",_p="(?:\\ud83c[\\udde6-\\uddff]){2}",Ep="[\\ud800-\\udbff][\\udc00-\\udfff]",sa="["+J0+"]",i_="\\u200d",s_="(?:"+t_+"|"+n_+")",UC="(?:"+sa+"|"+n_+")",o_="(?:"+vp+"(?:d|ll|m|re|s|t|ve))?",a_="(?:"+vp+"(?:D|LL|M|RE|S|T|VE))?",l_=BC+"?",c_="["+Y0+"]?",WC="(?:"+i_+"(?:"+[r_,_p,Ep].join("|")+")"+c_+l_+")*",qC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",u_=c_+l_+WC,QC="(?:"+[jC,_p,Ep].join("|")+")"+u_,GC="(?:"+[r_+Ru+"?",Ru,_p,Ep,VC].join("|")+")",HC=RegExp(vp,"g"),KC=RegExp(Ru,"g"),wp=RegExp(bp+"(?="+bp+")|"+GC+u_,"g"),JC=RegExp([sa+"?"+t_+"+"+o_+"(?="+[Z0,sa,"$"].join("|")+")",UC+"+"+a_+"(?="+[Z0,sa+s_,"$"].join("|")+")",sa+"?"+s_+"+"+o_,sa+"+"+a_,zC,qC,e_,QC].join("|"),"g"),YC=RegExp("["+i_+vr+Du+Y0+"]"),XC=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ZC=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eD=-1,bt={};bt[ta]=bt[na]=bt[eo]=bt[_l]=bt[El]=bt[wl]=bt[Tl]=bt[Sl]=bt[Ol]=!0,bt[ne]=bt[be]=bt[Wr]=bt[Ke]=bt[es]=bt[Kt]=bt[ii]=bt[Bt]=bt[tr]=bt[si]=bt[yr]=bt[Zs]=bt[nr]=bt[Si]=bt[Zi]=!1;var mt={};mt[ne]=mt[be]=mt[Wr]=mt[es]=mt[Ke]=mt[Kt]=mt[ta]=mt[na]=mt[eo]=mt[_l]=mt[El]=mt[tr]=mt[si]=mt[yr]=mt[Zs]=mt[nr]=mt[Si]=mt[ea]=mt[wl]=mt[Tl]=mt[Sl]=mt[Ol]=!0,mt[ii]=mt[Bt]=mt[Zi]=!1;var tD={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},nD={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},rD={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},iD={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},sD=parseFloat,oD=parseInt,f_=typeof Pe=="object"&&Pe&&Pe.Object===Object&&Pe,aD=typeof self=="object"&&self&&self.Object===Object&&self,sn=f_||aD||Function("return this")(),Tp=e&&!e.nodeType&&e,to=Tp&&!0&&t&&!t.nodeType&&t,d_=to&&to.exports===Tp,Sp=d_&&f_.process,br=function(){try{var F=to&&to.require&&to.require("util").types;return F||Sp&&Sp.binding&&Sp.binding("util")}catch{}}(),h_=br&&br.isArrayBuffer,p_=br&&br.isDate,m_=br&&br.isMap,g_=br&&br.isRegExp,y_=br&&br.isSet,v_=br&&br.isTypedArray;function rr(F,W,V){switch(V.length){case 0:return F.call(W);case 1:return F.call(W,V[0]);case 2:return F.call(W,V[0],V[1]);case 3:return F.call(W,V[0],V[1],V[2])}return F.apply(W,V)}function lD(F,W,V,ae){for(var De=-1,st=F==null?0:F.length;++De<st;){var Ut=F[De];W(ae,Ut,V(Ut),F)}return ae}function _r(F,W){for(var V=-1,ae=F==null?0:F.length;++V<ae&&W(F[V],V,F)!==!1;);return F}function cD(F,W){for(var V=F==null?0:F.length;V--&&W(F[V],V,F)!==!1;);return F}function b_(F,W){for(var V=-1,ae=F==null?0:F.length;++V<ae;)if(!W(F[V],V,F))return!1;return!0}function ns(F,W){for(var V=-1,ae=F==null?0:F.length,De=0,st=[];++V<ae;){var Ut=F[V];W(Ut,V,F)&&(st[De++]=Ut)}return st}function Mu(F,W){var V=F==null?0:F.length;return!!V&&oa(F,W,0)>-1}function Op(F,W,V){for(var ae=-1,De=F==null?0:F.length;++ae<De;)if(V(W,F[ae]))return!0;return!1}function Tt(F,W){for(var V=-1,ae=F==null?0:F.length,De=Array(ae);++V<ae;)De[V]=W(F[V],V,F);return De}function rs(F,W){for(var V=-1,ae=W.length,De=F.length;++V<ae;)F[De+V]=W[V];return F}function kp(F,W,V,ae){var De=-1,st=F==null?0:F.length;for(ae&&st&&(V=F[++De]);++De<st;)V=W(V,F[De],De,F);return V}function uD(F,W,V,ae){var De=F==null?0:F.length;for(ae&&De&&(V=F[--De]);De--;)V=W(V,F[De],De,F);return V}function Np(F,W){for(var V=-1,ae=F==null?0:F.length;++V<ae;)if(W(F[V],V,F))return!0;return!1}var fD=Ap("length");function dD(F){return F.split("")}function hD(F){return F.match(C)||[]}function __(F,W,V){var ae;return V(F,function(De,st,Ut){if(W(De,st,Ut))return ae=st,!1}),ae}function Pu(F,W,V,ae){for(var De=F.length,st=V+(ae?1:-1);ae?st--:++st<De;)if(W(F[st],st,F))return st;return-1}function oa(F,W,V){return W===W?OD(F,W,V):Pu(F,E_,V)}function pD(F,W,V,ae){for(var De=V-1,st=F.length;++De<st;)if(ae(F[De],W))return De;return-1}function E_(F){return F!==F}function w_(F,W){var V=F==null?0:F.length;return V?xp(F,W)/V:dt}function Ap(F){return function(W){return W==null?n:W[F]}}function Ip(F){return function(W){return F==null?n:F[W]}}function T_(F,W,V,ae,De){return De(F,function(st,Ut,ht){V=ae?(ae=!1,st):W(V,st,Ut,ht)}),V}function mD(F,W){var V=F.length;for(F.sort(W);V--;)F[V]=F[V].value;return F}function xp(F,W){for(var V,ae=-1,De=F.length;++ae<De;){var st=W(F[ae]);st!==n&&(V=V===n?st:V+st)}return V}function Cp(F,W){for(var V=-1,ae=Array(F);++V<F;)ae[V]=W(V);return ae}function gD(F,W){return Tt(W,function(V){return[V,F[V]]})}function S_(F){return F&&F.slice(0,A_(F)+1).replace(ia,"")}function ir(F){return function(W){return F(W)}}function Dp(F,W){return Tt(W,function(V){return F[V]})}function xl(F,W){return F.has(W)}function O_(F,W){for(var V=-1,ae=F.length;++V<ae&&oa(W,F[V],0)>-1;);return V}function k_(F,W){for(var V=F.length;V--&&oa(W,F[V],0)>-1;);return V}function yD(F,W){for(var V=F.length,ae=0;V--;)F[V]===W&&++ae;return ae}var vD=Ip(tD),bD=Ip(nD);function _D(F){return"\\"+iD[F]}function ED(F,W){return F==null?n:F[W]}function aa(F){return YC.test(F)}function wD(F){return XC.test(F)}function TD(F){for(var W,V=[];!(W=F.next()).done;)V.push(W.value);return V}function Rp(F){var W=-1,V=Array(F.size);return F.forEach(function(ae,De){V[++W]=[De,ae]}),V}function N_(F,W){return function(V){return F(W(V))}}function is(F,W){for(var V=-1,ae=F.length,De=0,st=[];++V<ae;){var Ut=F[V];(Ut===W||Ut===d)&&(F[V]=d,st[De++]=V)}return st}function Fu(F){var W=-1,V=Array(F.size);return F.forEach(function(ae){V[++W]=ae}),V}function SD(F){var W=-1,V=Array(F.size);return F.forEach(function(ae){V[++W]=[ae,ae]}),V}function OD(F,W,V){for(var ae=V-1,De=F.length;++ae<De;)if(F[ae]===W)return ae;return-1}function kD(F,W,V){for(var ae=V+1;ae--;)if(F[ae]===W)return ae;return ae}function la(F){return aa(F)?AD(F):fD(F)}function qr(F){return aa(F)?ID(F):dD(F)}function A_(F){for(var W=F.length;W--&&hp.test(F.charAt(W)););return W}var ND=Ip(rD);function AD(F){for(var W=wp.lastIndex=0;wp.test(F);)++W;return W}function ID(F){return F.match(wp)||[]}function xD(F){return F.match(JC)||[]}var CD=function F(W){W=W==null?sn:ca.defaults(sn.Object(),W,ca.pick(sn,ZC));var V=W.Array,ae=W.Date,De=W.Error,st=W.Function,Ut=W.Math,ht=W.Object,Mp=W.RegExp,DD=W.String,Er=W.TypeError,$u=V.prototype,RD=st.prototype,ua=ht.prototype,Lu=W["__core-js_shared__"],Vu=RD.toString,ct=ua.hasOwnProperty,MD=0,I_=function(){var c=/[^.]+$/.exec(Lu&&Lu.keys&&Lu.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}(),ju=ua.toString,PD=Vu.call(ht),FD=sn._,$D=Mp("^"+Vu.call(ct).replace(Al,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bu=d_?W.Buffer:n,ss=W.Symbol,Uu=W.Uint8Array,x_=Bu?Bu.allocUnsafe:n,Wu=N_(ht.getPrototypeOf,ht),C_=ht.create,D_=ua.propertyIsEnumerable,qu=$u.splice,R_=ss?ss.isConcatSpreadable:n,Cl=ss?ss.iterator:n,no=ss?ss.toStringTag:n,zu=function(){try{var c=ao(ht,"defineProperty");return c({},"",{}),c}catch{}}(),LD=W.clearTimeout!==sn.clearTimeout&&W.clearTimeout,VD=ae&&ae.now!==sn.Date.now&&ae.now,jD=W.setTimeout!==sn.setTimeout&&W.setTimeout,Qu=Ut.ceil,Gu=Ut.floor,Pp=ht.getOwnPropertySymbols,BD=Bu?Bu.isBuffer:n,M_=W.isFinite,UD=$u.join,WD=N_(ht.keys,ht),Wt=Ut.max,mn=Ut.min,qD=ae.now,zD=W.parseInt,P_=Ut.random,QD=$u.reverse,Fp=ao(W,"DataView"),Dl=ao(W,"Map"),$p=ao(W,"Promise"),fa=ao(W,"Set"),Rl=ao(W,"WeakMap"),Ml=ao(ht,"create"),Hu=Rl&&new Rl,da={},GD=lo(Fp),HD=lo(Dl),KD=lo($p),JD=lo(fa),YD=lo(Rl),Ku=ss?ss.prototype:n,Pl=Ku?Ku.valueOf:n,F_=Ku?Ku.toString:n;function T(c){if(It(c)&&!Me(c)&&!(c instanceof Ye)){if(c instanceof wr)return c;if(ct.call(c,"__wrapped__"))return $E(c)}return new wr(c)}var ha=function(){function c(){}return function(f){if(!Ot(f))return{};if(C_)return C_(f);c.prototype=f;var m=new c;return c.prototype=n,m}}();function Ju(){}function wr(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}T.templateSettings={escape:fp,evaluate:Nu,interpolate:Au,variable:"",imports:{_:T}},T.prototype=Ju.prototype,T.prototype.constructor=T,wr.prototype=ha(Ju.prototype),wr.prototype.constructor=wr;function Ye(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ne,this.__views__=[]}function XD(){var c=new Ye(this.__wrapped__);return c.__actions__=Bn(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Bn(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Bn(this.__views__),c}function ZD(){if(this.__filtered__){var c=new Ye(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function eR(){var c=this.__wrapped__.value(),f=this.__dir__,m=Me(c),v=f<0,E=m?c.length:0,S=dM(0,E,this.__views__),A=S.start,R=S.end,$=R-A,G=v?R:A-1,H=this.__iteratees__,K=H.length,re=0,de=mn($,this.__takeCount__);if(!m||!v&&E==$&&de==$)return oE(c,this.__actions__);var Ee=[];e:for(;$--&&re<de;){G+=f;for(var Ve=-1,we=c[G];++Ve<K;){var Ge=H[Ve],Ze=Ge.iteratee,ar=Ge.type,An=Ze(we);if(ar==ee)we=An;else if(!An){if(ar==Ce)continue e;break e}}Ee[re++]=we}return Ee}Ye.prototype=ha(Ju.prototype),Ye.prototype.constructor=Ye;function ro(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function tR(){this.__data__=Ml?Ml(null):{},this.size=0}function nR(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f}function rR(c){var f=this.__data__;if(Ml){var m=f[c];return m===l?n:m}return ct.call(f,c)?f[c]:n}function iR(c){var f=this.__data__;return Ml?f[c]!==n:ct.call(f,c)}function sR(c,f){var m=this.__data__;return this.size+=this.has(c)?0:1,m[c]=Ml&&f===n?l:f,this}ro.prototype.clear=tR,ro.prototype.delete=nR,ro.prototype.get=rR,ro.prototype.has=iR,ro.prototype.set=sR;function ki(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function oR(){this.__data__=[],this.size=0}function aR(c){var f=this.__data__,m=Yu(f,c);if(m<0)return!1;var v=f.length-1;return m==v?f.pop():qu.call(f,m,1),--this.size,!0}function lR(c){var f=this.__data__,m=Yu(f,c);return m<0?n:f[m][1]}function cR(c){return Yu(this.__data__,c)>-1}function uR(c,f){var m=this.__data__,v=Yu(m,c);return v<0?(++this.size,m.push([c,f])):m[v][1]=f,this}ki.prototype.clear=oR,ki.prototype.delete=aR,ki.prototype.get=lR,ki.prototype.has=cR,ki.prototype.set=uR;function Ni(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function fR(){this.size=0,this.__data__={hash:new ro,map:new(Dl||ki),string:new ro}}function dR(c){var f=uf(this,c).delete(c);return this.size-=f?1:0,f}function hR(c){return uf(this,c).get(c)}function pR(c){return uf(this,c).has(c)}function mR(c,f){var m=uf(this,c),v=m.size;return m.set(c,f),this.size+=m.size==v?0:1,this}Ni.prototype.clear=fR,Ni.prototype.delete=dR,Ni.prototype.get=hR,Ni.prototype.has=pR,Ni.prototype.set=mR;function io(c){var f=-1,m=c==null?0:c.length;for(this.__data__=new Ni;++f<m;)this.add(c[f])}function gR(c){return this.__data__.set(c,l),this}function yR(c){return this.__data__.has(c)}io.prototype.add=io.prototype.push=gR,io.prototype.has=yR;function zr(c){var f=this.__data__=new ki(c);this.size=f.size}function vR(){this.__data__=new ki,this.size=0}function bR(c){var f=this.__data__,m=f.delete(c);return this.size=f.size,m}function _R(c){return this.__data__.get(c)}function ER(c){return this.__data__.has(c)}function wR(c,f){var m=this.__data__;if(m instanceof ki){var v=m.__data__;if(!Dl||v.length<i-1)return v.push([c,f]),this.size=++m.size,this;m=this.__data__=new Ni(v)}return m.set(c,f),this.size=m.size,this}zr.prototype.clear=vR,zr.prototype.delete=bR,zr.prototype.get=_R,zr.prototype.has=ER,zr.prototype.set=wR;function $_(c,f){var m=Me(c),v=!m&&co(c),E=!m&&!v&&fs(c),S=!m&&!v&&!E&&ya(c),A=m||v||E||S,R=A?Cp(c.length,DD):[],$=R.length;for(var G in c)(f||ct.call(c,G))&&!(A&&(G=="length"||E&&(G=="offset"||G=="parent")||S&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||Ci(G,$)))&&R.push(G);return R}function L_(c){var f=c.length;return f?c[Hp(0,f-1)]:n}function TR(c,f){return ff(Bn(c),so(f,0,c.length))}function SR(c){return ff(Bn(c))}function Lp(c,f,m){(m!==n&&!Qr(c[f],m)||m===n&&!(f in c))&&Ai(c,f,m)}function Fl(c,f,m){var v=c[f];(!(ct.call(c,f)&&Qr(v,m))||m===n&&!(f in c))&&Ai(c,f,m)}function Yu(c,f){for(var m=c.length;m--;)if(Qr(c[m][0],f))return m;return-1}function OR(c,f,m,v){return as(c,function(E,S,A){f(v,E,m(E),A)}),v}function V_(c,f){return c&&ai(f,Jt(f),c)}function kR(c,f){return c&&ai(f,Wn(f),c)}function Ai(c,f,m){f=="__proto__"&&zu?zu(c,f,{configurable:!0,enumerable:!0,value:m,writable:!0}):c[f]=m}function Vp(c,f){for(var m=-1,v=f.length,E=V(v),S=c==null;++m<v;)E[m]=S?n:bm(c,f[m]);return E}function so(c,f,m){return c===c&&(m!==n&&(c=c<=m?c:m),f!==n&&(c=c>=f?c:f)),c}function Tr(c,f,m,v,E,S){var A,R=f&h,$=f&p,G=f&g;if(m&&(A=E?m(c,v,E,S):m(c)),A!==n)return A;if(!Ot(c))return c;var H=Me(c);if(H){if(A=pM(c),!R)return Bn(c,A)}else{var K=gn(c),re=K==Bt||K==Tu;if(fs(c))return cE(c,R);if(K==yr||K==ne||re&&!E){if(A=$||re?{}:AE(c),!R)return $?rM(c,kR(A,c)):nM(c,V_(A,c))}else{if(!mt[K])return E?c:{};A=mM(c,K,R)}}S||(S=new zr);var de=S.get(c);if(de)return de;S.set(c,A),rw(c)?c.forEach(function(we){A.add(Tr(we,f,m,we,c,S))}):tw(c)&&c.forEach(function(we,Ge){A.set(Ge,Tr(we,f,m,Ge,c,S))});var Ee=G?$?sm:im:$?Wn:Jt,Ve=H?n:Ee(c);return _r(Ve||c,function(we,Ge){Ve&&(Ge=we,we=c[Ge]),Fl(A,Ge,Tr(we,f,m,Ge,c,S))}),A}function NR(c){var f=Jt(c);return function(m){return j_(m,c,f)}}function j_(c,f,m){var v=m.length;if(c==null)return!v;for(c=ht(c);v--;){var E=m[v],S=f[E],A=c[E];if(A===n&&!(E in c)||!S(A))return!1}return!0}function B_(c,f,m){if(typeof c!="function")throw new Er(o);return Wl(function(){c.apply(n,m)},f)}function $l(c,f,m,v){var E=-1,S=Mu,A=!0,R=c.length,$=[],G=f.length;if(!R)return $;m&&(f=Tt(f,ir(m))),v?(S=Op,A=!1):f.length>=i&&(S=xl,A=!1,f=new io(f));e:for(;++E<R;){var H=c[E],K=m==null?H:m(H);if(H=v||H!==0?H:0,A&&K===K){for(var re=G;re--;)if(f[re]===K)continue e;$.push(H)}else S(f,K,v)||$.push(H)}return $}var as=pE(oi),U_=pE(Bp,!0);function AR(c,f){var m=!0;return as(c,function(v,E,S){return m=!!f(v,E,S),m}),m}function Xu(c,f,m){for(var v=-1,E=c.length;++v<E;){var S=c[v],A=f(S);if(A!=null&&(R===n?A===A&&!or(A):m(A,R)))var R=A,$=S}return $}function IR(c,f,m,v){var E=c.length;for(m=$e(m),m<0&&(m=-m>E?0:E+m),v=v===n||v>E?E:$e(v),v<0&&(v+=E),v=m>v?0:sw(v);m<v;)c[m++]=f;return c}function W_(c,f){var m=[];return as(c,function(v,E,S){f(v,E,S)&&m.push(v)}),m}function on(c,f,m,v,E){var S=-1,A=c.length;for(m||(m=yM),E||(E=[]);++S<A;){var R=c[S];f>0&&m(R)?f>1?on(R,f-1,m,v,E):rs(E,R):v||(E[E.length]=R)}return E}var jp=mE(),q_=mE(!0);function oi(c,f){return c&&jp(c,f,Jt)}function Bp(c,f){return c&&q_(c,f,Jt)}function Zu(c,f){return ns(f,function(m){return Di(c[m])})}function oo(c,f){f=cs(f,c);for(var m=0,v=f.length;c!=null&&m<v;)c=c[li(f[m++])];return m&&m==v?c:n}function z_(c,f,m){var v=f(c);return Me(c)?v:rs(v,m(c))}function kn(c){return c==null?c===n?cp:Xs:no&&no in ht(c)?fM(c):SM(c)}function Up(c,f){return c>f}function xR(c,f){return c!=null&&ct.call(c,f)}function CR(c,f){return c!=null&&f in ht(c)}function DR(c,f,m){return c>=mn(f,m)&&c<Wt(f,m)}function Wp(c,f,m){for(var v=m?Op:Mu,E=c[0].length,S=c.length,A=S,R=V(S),$=1/0,G=[];A--;){var H=c[A];A&&f&&(H=Tt(H,ir(f))),$=mn(H.length,$),R[A]=!m&&(f||E>=120&&H.length>=120)?new io(A&&H):n}H=c[0];var K=-1,re=R[0];e:for(;++K<E&&G.length<$;){var de=H[K],Ee=f?f(de):de;if(de=m||de!==0?de:0,!(re?xl(re,Ee):v(G,Ee,m))){for(A=S;--A;){var Ve=R[A];if(!(Ve?xl(Ve,Ee):v(c[A],Ee,m)))continue e}re&&re.push(Ee),G.push(de)}}return G}function RR(c,f,m,v){return oi(c,function(E,S,A){f(v,m(E),S,A)}),v}function Ll(c,f,m){f=cs(f,c),c=DE(c,f);var v=c==null?c:c[li(Or(f))];return v==null?n:rr(v,c,m)}function Q_(c){return It(c)&&kn(c)==ne}function MR(c){return It(c)&&kn(c)==Wr}function PR(c){return It(c)&&kn(c)==Kt}function Vl(c,f,m,v,E){return c===f?!0:c==null||f==null||!It(c)&&!It(f)?c!==c&&f!==f:FR(c,f,m,v,Vl,E)}function FR(c,f,m,v,E,S){var A=Me(c),R=Me(f),$=A?be:gn(c),G=R?be:gn(f);$=$==ne?yr:$,G=G==ne?yr:G;var H=$==yr,K=G==yr,re=$==G;if(re&&fs(c)){if(!fs(f))return!1;A=!0,H=!1}if(re&&!H)return S||(S=new zr),A||ya(c)?OE(c,f,m,v,E,S):cM(c,f,$,m,v,E,S);if(!(m&y)){var de=H&&ct.call(c,"__wrapped__"),Ee=K&&ct.call(f,"__wrapped__");if(de||Ee){var Ve=de?c.value():c,we=Ee?f.value():f;return S||(S=new zr),E(Ve,we,m,v,S)}}return re?(S||(S=new zr),uM(c,f,m,v,E,S)):!1}function $R(c){return It(c)&&gn(c)==tr}function qp(c,f,m,v){var E=m.length,S=E,A=!v;if(c==null)return!S;for(c=ht(c);E--;){var R=m[E];if(A&&R[2]?R[1]!==c[R[0]]:!(R[0]in c))return!1}for(;++E<S;){R=m[E];var $=R[0],G=c[$],H=R[1];if(A&&R[2]){if(G===n&&!($ in c))return!1}else{var K=new zr;if(v)var re=v(G,H,$,c,f,K);if(!(re===n?Vl(H,G,y|b,v,K):re))return!1}}return!0}function G_(c){if(!Ot(c)||bM(c))return!1;var f=Di(c)?$D:ze;return f.test(lo(c))}function LR(c){return It(c)&&kn(c)==Zs}function VR(c){return It(c)&&gn(c)==nr}function jR(c){return It(c)&&yf(c.length)&&!!bt[kn(c)]}function H_(c){return typeof c=="function"?c:c==null?qn:typeof c=="object"?Me(c)?Y_(c[0],c[1]):J_(c):gw(c)}function zp(c){if(!Ul(c))return WD(c);var f=[];for(var m in ht(c))ct.call(c,m)&&m!="constructor"&&f.push(m);return f}function BR(c){if(!Ot(c))return TM(c);var f=Ul(c),m=[];for(var v in c)v=="constructor"&&(f||!ct.call(c,v))||m.push(v);return m}function Qp(c,f){return c<f}function K_(c,f){var m=-1,v=Un(c)?V(c.length):[];return as(c,function(E,S,A){v[++m]=f(E,S,A)}),v}function J_(c){var f=am(c);return f.length==1&&f[0][2]?xE(f[0][0],f[0][1]):function(m){return m===c||qp(m,c,f)}}function Y_(c,f){return cm(c)&&IE(f)?xE(li(c),f):function(m){var v=bm(m,c);return v===n&&v===f?_m(m,c):Vl(f,v,y|b)}}function ef(c,f,m,v,E){c!==f&&jp(f,function(S,A){if(E||(E=new zr),Ot(S))UR(c,f,A,m,ef,v,E);else{var R=v?v(fm(c,A),S,A+"",c,f,E):n;R===n&&(R=S),Lp(c,A,R)}},Wn)}function UR(c,f,m,v,E,S,A){var R=fm(c,m),$=fm(f,m),G=A.get($);if(G){Lp(c,m,G);return}var H=S?S(R,$,m+"",c,f,A):n,K=H===n;if(K){var re=Me($),de=!re&&fs($),Ee=!re&&!de&&ya($);H=$,re||de||Ee?Me(R)?H=R:Rt(R)?H=Bn(R):de?(K=!1,H=cE($,!0)):Ee?(K=!1,H=uE($,!0)):H=[]:ql($)||co($)?(H=R,co(R)?H=ow(R):(!Ot(R)||Di(R))&&(H=AE($))):K=!1}K&&(A.set($,H),E(H,$,v,S,A),A.delete($)),Lp(c,m,H)}function X_(c,f){var m=c.length;if(m)return f+=f<0?m:0,Ci(f,m)?c[f]:n}function Z_(c,f,m){f.length?f=Tt(f,function(S){return Me(S)?function(A){return oo(A,S.length===1?S[0]:S)}:S}):f=[qn];var v=-1;f=Tt(f,ir(_e()));var E=K_(c,function(S,A,R){var $=Tt(f,function(G){return G(S)});return{criteria:$,index:++v,value:S}});return mD(E,function(S,A){return tM(S,A,m)})}function WR(c,f){return eE(c,f,function(m,v){return _m(c,v)})}function eE(c,f,m){for(var v=-1,E=f.length,S={};++v<E;){var A=f[v],R=oo(c,A);m(R,A)&&jl(S,cs(A,c),R)}return S}function qR(c){return function(f){return oo(f,c)}}function Gp(c,f,m,v){var E=v?pD:oa,S=-1,A=f.length,R=c;for(c===f&&(f=Bn(f)),m&&(R=Tt(c,ir(m)));++S<A;)for(var $=0,G=f[S],H=m?m(G):G;($=E(R,H,$,v))>-1;)R!==c&&qu.call(R,$,1),qu.call(c,$,1);return c}function tE(c,f){for(var m=c?f.length:0,v=m-1;m--;){var E=f[m];if(m==v||E!==S){var S=E;Ci(E)?qu.call(c,E,1):Yp(c,E)}}return c}function Hp(c,f){return c+Gu(P_()*(f-c+1))}function zR(c,f,m,v){for(var E=-1,S=Wt(Qu((f-c)/(m||1)),0),A=V(S);S--;)A[v?S:++E]=c,c+=m;return A}function Kp(c,f){var m="";if(!c||f<1||f>ve)return m;do f%2&&(m+=c),f=Gu(f/2),f&&(c+=c);while(f);return m}function Ue(c,f){return dm(CE(c,f,qn),c+"")}function QR(c){return L_(va(c))}function GR(c,f){var m=va(c);return ff(m,so(f,0,m.length))}function jl(c,f,m,v){if(!Ot(c))return c;f=cs(f,c);for(var E=-1,S=f.length,A=S-1,R=c;R!=null&&++E<S;){var $=li(f[E]),G=m;if($==="__proto__"||$==="constructor"||$==="prototype")return c;if(E!=A){var H=R[$];G=v?v(H,$,R):n,G===n&&(G=Ot(H)?H:Ci(f[E+1])?[]:{})}Fl(R,$,G),R=R[$]}return c}var nE=Hu?function(c,f){return Hu.set(c,f),c}:qn,HR=zu?function(c,f){return zu(c,"toString",{configurable:!0,enumerable:!1,value:wm(f),writable:!0})}:qn;function KR(c){return ff(va(c))}function Sr(c,f,m){var v=-1,E=c.length;f<0&&(f=-f>E?0:E+f),m=m>E?E:m,m<0&&(m+=E),E=f>m?0:m-f>>>0,f>>>=0;for(var S=V(E);++v<E;)S[v]=c[v+f];return S}function JR(c,f){var m;return as(c,function(v,E,S){return m=f(v,E,S),!m}),!!m}function tf(c,f,m){var v=0,E=c==null?v:c.length;if(typeof f=="number"&&f===f&&E<=te){for(;v<E;){var S=v+E>>>1,A=c[S];A!==null&&!or(A)&&(m?A<=f:A<f)?v=S+1:E=S}return E}return Jp(c,f,qn,m)}function Jp(c,f,m,v){var E=0,S=c==null?0:c.length;if(S===0)return 0;f=m(f);for(var A=f!==f,R=f===null,$=or(f),G=f===n;E<S;){var H=Gu((E+S)/2),K=m(c[H]),re=K!==n,de=K===null,Ee=K===K,Ve=or(K);if(A)var we=v||Ee;else G?we=Ee&&(v||re):R?we=Ee&&re&&(v||!de):$?we=Ee&&re&&!de&&(v||!Ve):de||Ve?we=!1:we=v?K<=f:K<f;we?E=H+1:S=H}return mn(S,L)}function rE(c,f){for(var m=-1,v=c.length,E=0,S=[];++m<v;){var A=c[m],R=f?f(A):A;if(!m||!Qr(R,$)){var $=R;S[E++]=A===0?0:A}}return S}function iE(c){return typeof c=="number"?c:or(c)?dt:+c}function sr(c){if(typeof c=="string")return c;if(Me(c))return Tt(c,sr)+"";if(or(c))return F_?F_.call(c):"";var f=c+"";return f=="0"&&1/c==-fe?"-0":f}function ls(c,f,m){var v=-1,E=Mu,S=c.length,A=!0,R=[],$=R;if(m)A=!1,E=Op;else if(S>=i){var G=f?null:aM(c);if(G)return Fu(G);A=!1,E=xl,$=new io}else $=f?[]:R;e:for(;++v<S;){var H=c[v],K=f?f(H):H;if(H=m||H!==0?H:0,A&&K===K){for(var re=$.length;re--;)if($[re]===K)continue e;f&&$.push(K),R.push(H)}else E($,K,m)||($!==R&&$.push(K),R.push(H))}return R}function Yp(c,f){return f=cs(f,c),c=DE(c,f),c==null||delete c[li(Or(f))]}function sE(c,f,m,v){return jl(c,f,m(oo(c,f)),v)}function nf(c,f,m,v){for(var E=c.length,S=v?E:-1;(v?S--:++S<E)&&f(c[S],S,c););return m?Sr(c,v?0:S,v?S+1:E):Sr(c,v?S+1:0,v?E:S)}function oE(c,f){var m=c;return m instanceof Ye&&(m=m.value()),kp(f,function(v,E){return E.func.apply(E.thisArg,rs([v],E.args))},m)}function Xp(c,f,m){var v=c.length;if(v<2)return v?ls(c[0]):[];for(var E=-1,S=V(v);++E<v;)for(var A=c[E],R=-1;++R<v;)R!=E&&(S[E]=$l(S[E]||A,c[R],f,m));return ls(on(S,1),f,m)}function aE(c,f,m){for(var v=-1,E=c.length,S=f.length,A={};++v<E;){var R=v<S?f[v]:n;m(A,c[v],R)}return A}function Zp(c){return Rt(c)?c:[]}function em(c){return typeof c=="function"?c:qn}function cs(c,f){return Me(c)?c:cm(c,f)?[c]:FE(ot(c))}var YR=Ue;function us(c,f,m){var v=c.length;return m=m===n?v:m,!f&&m>=v?c:Sr(c,f,m)}var lE=LD||function(c){return sn.clearTimeout(c)};function cE(c,f){if(f)return c.slice();var m=c.length,v=x_?x_(m):new c.constructor(m);return c.copy(v),v}function tm(c){var f=new c.constructor(c.byteLength);return new Uu(f).set(new Uu(c)),f}function XR(c,f){var m=f?tm(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.byteLength)}function ZR(c){var f=new c.constructor(c.source,nt.exec(c));return f.lastIndex=c.lastIndex,f}function eM(c){return Pl?ht(Pl.call(c)):{}}function uE(c,f){var m=f?tm(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.length)}function fE(c,f){if(c!==f){var m=c!==n,v=c===null,E=c===c,S=or(c),A=f!==n,R=f===null,$=f===f,G=or(f);if(!R&&!G&&!S&&c>f||S&&A&&$&&!R&&!G||v&&A&&$||!m&&$||!E)return 1;if(!v&&!S&&!G&&c<f||G&&m&&E&&!v&&!S||R&&m&&E||!A&&E||!$)return-1}return 0}function tM(c,f,m){for(var v=-1,E=c.criteria,S=f.criteria,A=E.length,R=m.length;++v<A;){var $=fE(E[v],S[v]);if($){if(v>=R)return $;var G=m[v];return $*(G=="desc"?-1:1)}}return c.index-f.index}function dE(c,f,m,v){for(var E=-1,S=c.length,A=m.length,R=-1,$=f.length,G=Wt(S-A,0),H=V($+G),K=!v;++R<$;)H[R]=f[R];for(;++E<A;)(K||E<S)&&(H[m[E]]=c[E]);for(;G--;)H[R++]=c[E++];return H}function hE(c,f,m,v){for(var E=-1,S=c.length,A=-1,R=m.length,$=-1,G=f.length,H=Wt(S-R,0),K=V(H+G),re=!v;++E<H;)K[E]=c[E];for(var de=E;++$<G;)K[de+$]=f[$];for(;++A<R;)(re||E<S)&&(K[de+m[A]]=c[E++]);return K}function Bn(c,f){var m=-1,v=c.length;for(f||(f=V(v));++m<v;)f[m]=c[m];return f}function ai(c,f,m,v){var E=!m;m||(m={});for(var S=-1,A=f.length;++S<A;){var R=f[S],$=v?v(m[R],c[R],R,m,c):n;$===n&&($=c[R]),E?Ai(m,R,$):Fl(m,R,$)}return m}function nM(c,f){return ai(c,lm(c),f)}function rM(c,f){return ai(c,kE(c),f)}function rf(c,f){return function(m,v){var E=Me(m)?lD:OR,S=f?f():{};return E(m,c,_e(v,2),S)}}function pa(c){return Ue(function(f,m){var v=-1,E=m.length,S=E>1?m[E-1]:n,A=E>2?m[2]:n;for(S=c.length>3&&typeof S=="function"?(E--,S):n,A&&Nn(m[0],m[1],A)&&(S=E<3?n:S,E=1),f=ht(f);++v<E;){var R=m[v];R&&c(f,R,v,S)}return f})}function pE(c,f){return function(m,v){if(m==null)return m;if(!Un(m))return c(m,v);for(var E=m.length,S=f?E:-1,A=ht(m);(f?S--:++S<E)&&v(A[S],S,A)!==!1;);return m}}function mE(c){return function(f,m,v){for(var E=-1,S=ht(f),A=v(f),R=A.length;R--;){var $=A[c?R:++E];if(m(S[$],$,S)===!1)break}return f}}function iM(c,f,m){var v=f&_,E=Bl(c);function S(){var A=this&&this!==sn&&this instanceof S?E:c;return A.apply(v?m:this,arguments)}return S}function gE(c){return function(f){f=ot(f);var m=aa(f)?qr(f):n,v=m?m[0]:f.charAt(0),E=m?us(m,1).join(""):f.slice(1);return v[c]()+E}}function ma(c){return function(f){return kp(pw(hw(f).replace(HC,"")),c,"")}}function Bl(c){return function(){var f=arguments;switch(f.length){case 0:return new c;case 1:return new c(f[0]);case 2:return new c(f[0],f[1]);case 3:return new c(f[0],f[1],f[2]);case 4:return new c(f[0],f[1],f[2],f[3]);case 5:return new c(f[0],f[1],f[2],f[3],f[4]);case 6:return new c(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new c(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var m=ha(c.prototype),v=c.apply(m,f);return Ot(v)?v:m}}function sM(c,f,m){var v=Bl(c);function E(){for(var S=arguments.length,A=V(S),R=S,$=ga(E);R--;)A[R]=arguments[R];var G=S<3&&A[0]!==$&&A[S-1]!==$?[]:is(A,$);if(S-=G.length,S<m)return EE(c,f,sf,E.placeholder,n,A,G,n,n,m-S);var H=this&&this!==sn&&this instanceof E?v:c;return rr(H,this,A)}return E}function yE(c){return function(f,m,v){var E=ht(f);if(!Un(f)){var S=_e(m,3);f=Jt(f),m=function(R){return S(E[R],R,E)}}var A=c(f,m,v);return A>-1?E[S?f[A]:A]:n}}function vE(c){return xi(function(f){var m=f.length,v=m,E=wr.prototype.thru;for(c&&f.reverse();v--;){var S=f[v];if(typeof S!="function")throw new Er(o);if(E&&!A&&cf(S)=="wrapper")var A=new wr([],!0)}for(v=A?v:m;++v<m;){S=f[v];var R=cf(S),$=R=="wrapper"?om(S):n;$&&um($[0])&&$[1]==(B|N|P|Q)&&!$[4].length&&$[9]==1?A=A[cf($[0])].apply(A,$[3]):A=S.length==1&&um(S)?A[R]():A.thru(S)}return function(){var G=arguments,H=G[0];if(A&&G.length==1&&Me(H))return A.plant(H).value();for(var K=0,re=m?f[K].apply(this,G):H;++K<m;)re=f[K].call(this,re);return re}})}function sf(c,f,m,v,E,S,A,R,$,G){var H=f&B,K=f&_,re=f&w,de=f&(N|I),Ee=f&x,Ve=re?n:Bl(c);function we(){for(var Ge=arguments.length,Ze=V(Ge),ar=Ge;ar--;)Ze[ar]=arguments[ar];if(de)var An=ga(we),lr=yD(Ze,An);if(v&&(Ze=dE(Ze,v,E,de)),S&&(Ze=hE(Ze,S,A,de)),Ge-=lr,de&&Ge<G){var Mt=is(Ze,An);return EE(c,f,sf,we.placeholder,m,Ze,Mt,R,$,G-Ge)}var Gr=K?m:this,Mi=re?Gr[c]:c;return Ge=Ze.length,R?Ze=OM(Ze,R):Ee&&Ge>1&&Ze.reverse(),H&&$<Ge&&(Ze.length=$),this&&this!==sn&&this instanceof we&&(Mi=Ve||Bl(Mi)),Mi.apply(Gr,Ze)}return we}function bE(c,f){return function(m,v){return RR(m,c,f(v),{})}}function of(c,f){return function(m,v){var E;if(m===n&&v===n)return f;if(m!==n&&(E=m),v!==n){if(E===n)return v;typeof m=="string"||typeof v=="string"?(m=sr(m),v=sr(v)):(m=iE(m),v=iE(v)),E=c(m,v)}return E}}function nm(c){return xi(function(f){return f=Tt(f,ir(_e())),Ue(function(m){var v=this;return c(f,function(E){return rr(E,v,m)})})})}function af(c,f){f=f===n?" ":sr(f);var m=f.length;if(m<2)return m?Kp(f,c):f;var v=Kp(f,Qu(c/la(f)));return aa(f)?us(qr(v),0,c).join(""):v.slice(0,c)}function oM(c,f,m,v){var E=f&_,S=Bl(c);function A(){for(var R=-1,$=arguments.length,G=-1,H=v.length,K=V(H+$),re=this&&this!==sn&&this instanceof A?S:c;++G<H;)K[G]=v[G];for(;$--;)K[G++]=arguments[++R];return rr(re,E?m:this,K)}return A}function _E(c){return function(f,m,v){return v&&typeof v!="number"&&Nn(f,m,v)&&(m=v=n),f=Ri(f),m===n?(m=f,f=0):m=Ri(m),v=v===n?f<m?1:-1:Ri(v),zR(f,m,v,c)}}function lf(c){return function(f,m){return typeof f=="string"&&typeof m=="string"||(f=kr(f),m=kr(m)),c(f,m)}}function EE(c,f,m,v,E,S,A,R,$,G){var H=f&N,K=H?A:n,re=H?n:A,de=H?S:n,Ee=H?n:S;f|=H?P:M,f&=~(H?M:P),f&O||(f&=~(_|w));var Ve=[c,f,E,de,K,Ee,re,R,$,G],we=m.apply(n,Ve);return um(c)&&RE(we,Ve),we.placeholder=v,ME(we,c,f)}function rm(c){var f=Ut[c];return function(m,v){if(m=kr(m),v=v==null?0:mn($e(v),292),v&&M_(m)){var E=(ot(m)+"e").split("e"),S=f(E[0]+"e"+(+E[1]+v));return E=(ot(S)+"e").split("e"),+(E[0]+"e"+(+E[1]-v))}return f(m)}}var aM=fa&&1/Fu(new fa([,-0]))[1]==fe?function(c){return new fa(c)}:Om;function wE(c){return function(f){var m=gn(f);return m==tr?Rp(f):m==nr?SD(f):gD(f,c(f))}}function Ii(c,f,m,v,E,S,A,R){var $=f&w;if(!$&&typeof c!="function")throw new Er(o);var G=v?v.length:0;if(G||(f&=~(P|M),v=E=n),A=A===n?A:Wt($e(A),0),R=R===n?R:$e(R),G-=E?E.length:0,f&M){var H=v,K=E;v=E=n}var re=$?n:om(c),de=[c,f,m,v,E,H,K,S,A,R];if(re&&wM(de,re),c=de[0],f=de[1],m=de[2],v=de[3],E=de[4],R=de[9]=de[9]===n?$?0:c.length:Wt(de[9]-G,0),!R&&f&(N|I)&&(f&=~(N|I)),!f||f==_)var Ee=iM(c,f,m);else f==N||f==I?Ee=sM(c,f,R):(f==P||f==(_|P))&&!E.length?Ee=oM(c,f,m,v):Ee=sf.apply(n,de);var Ve=re?nE:RE;return ME(Ve(Ee,de),c,f)}function TE(c,f,m,v){return c===n||Qr(c,ua[m])&&!ct.call(v,m)?f:c}function SE(c,f,m,v,E,S){return Ot(c)&&Ot(f)&&(S.set(f,c),ef(c,f,n,SE,S),S.delete(f)),c}function lM(c){return ql(c)?n:c}function OE(c,f,m,v,E,S){var A=m&y,R=c.length,$=f.length;if(R!=$&&!(A&&$>R))return!1;var G=S.get(c),H=S.get(f);if(G&&H)return G==f&&H==c;var K=-1,re=!0,de=m&b?new io:n;for(S.set(c,f),S.set(f,c);++K<R;){var Ee=c[K],Ve=f[K];if(v)var we=A?v(Ve,Ee,K,f,c,S):v(Ee,Ve,K,c,f,S);if(we!==n){if(we)continue;re=!1;break}if(de){if(!Np(f,function(Ge,Ze){if(!xl(de,Ze)&&(Ee===Ge||E(Ee,Ge,m,v,S)))return de.push(Ze)})){re=!1;break}}else if(!(Ee===Ve||E(Ee,Ve,m,v,S))){re=!1;break}}return S.delete(c),S.delete(f),re}function cM(c,f,m,v,E,S,A){switch(m){case es:if(c.byteLength!=f.byteLength||c.byteOffset!=f.byteOffset)return!1;c=c.buffer,f=f.buffer;case Wr:return!(c.byteLength!=f.byteLength||!S(new Uu(c),new Uu(f)));case Ke:case Kt:case si:return Qr(+c,+f);case ii:return c.name==f.name&&c.message==f.message;case Zs:case Si:return c==f+"";case tr:var R=Rp;case nr:var $=v&y;if(R||(R=Fu),c.size!=f.size&&!$)return!1;var G=A.get(c);if(G)return G==f;v|=b,A.set(c,f);var H=OE(R(c),R(f),v,E,S,A);return A.delete(c),H;case ea:if(Pl)return Pl.call(c)==Pl.call(f)}return!1}function uM(c,f,m,v,E,S){var A=m&y,R=im(c),$=R.length,G=im(f),H=G.length;if($!=H&&!A)return!1;for(var K=$;K--;){var re=R[K];if(!(A?re in f:ct.call(f,re)))return!1}var de=S.get(c),Ee=S.get(f);if(de&&Ee)return de==f&&Ee==c;var Ve=!0;S.set(c,f),S.set(f,c);for(var we=A;++K<$;){re=R[K];var Ge=c[re],Ze=f[re];if(v)var ar=A?v(Ze,Ge,re,f,c,S):v(Ge,Ze,re,c,f,S);if(!(ar===n?Ge===Ze||E(Ge,Ze,m,v,S):ar)){Ve=!1;break}we||(we=re=="constructor")}if(Ve&&!we){var An=c.constructor,lr=f.constructor;An!=lr&&"constructor"in c&&"constructor"in f&&!(typeof An=="function"&&An instanceof An&&typeof lr=="function"&&lr instanceof lr)&&(Ve=!1)}return S.delete(c),S.delete(f),Ve}function xi(c){return dm(CE(c,n,jE),c+"")}function im(c){return z_(c,Jt,lm)}function sm(c){return z_(c,Wn,kE)}var om=Hu?function(c){return Hu.get(c)}:Om;function cf(c){for(var f=c.name+"",m=da[f],v=ct.call(da,f)?m.length:0;v--;){var E=m[v],S=E.func;if(S==null||S==c)return E.name}return f}function ga(c){var f=ct.call(T,"placeholder")?T:c;return f.placeholder}function _e(){var c=T.iteratee||Tm;return c=c===Tm?H_:c,arguments.length?c(arguments[0],arguments[1]):c}function uf(c,f){var m=c.__data__;return vM(f)?m[typeof f=="string"?"string":"hash"]:m.map}function am(c){for(var f=Jt(c),m=f.length;m--;){var v=f[m],E=c[v];f[m]=[v,E,IE(E)]}return f}function ao(c,f){var m=ED(c,f);return G_(m)?m:n}function fM(c){var f=ct.call(c,no),m=c[no];try{c[no]=n;var v=!0}catch{}var E=ju.call(c);return v&&(f?c[no]=m:delete c[no]),E}var lm=Pp?function(c){return c==null?[]:(c=ht(c),ns(Pp(c),function(f){return D_.call(c,f)}))}:km,kE=Pp?function(c){for(var f=[];c;)rs(f,lm(c)),c=Wu(c);return f}:km,gn=kn;(Fp&&gn(new Fp(new ArrayBuffer(1)))!=es||Dl&&gn(new Dl)!=tr||$p&&gn($p.resolve())!=bl||fa&&gn(new fa)!=nr||Rl&&gn(new Rl)!=Zi)&&(gn=function(c){var f=kn(c),m=f==yr?c.constructor:n,v=m?lo(m):"";if(v)switch(v){case GD:return es;case HD:return tr;case KD:return bl;case JD:return nr;case YD:return Zi}return f});function dM(c,f,m){for(var v=-1,E=m.length;++v<E;){var S=m[v],A=S.size;switch(S.type){case"drop":c+=A;break;case"dropRight":f-=A;break;case"take":f=mn(f,c+A);break;case"takeRight":c=Wt(c,f-A);break}}return{start:c,end:f}}function hM(c){var f=c.match(mp);return f?f[1].split(gp):[]}function NE(c,f,m){f=cs(f,c);for(var v=-1,E=f.length,S=!1;++v<E;){var A=li(f[v]);if(!(S=c!=null&&m(c,A)))break;c=c[A]}return S||++v!=E?S:(E=c==null?0:c.length,!!E&&yf(E)&&Ci(A,E)&&(Me(c)||co(c)))}function pM(c){var f=c.length,m=new c.constructor(f);return f&&typeof c[0]=="string"&&ct.call(c,"index")&&(m.index=c.index,m.input=c.input),m}function AE(c){return typeof c.constructor=="function"&&!Ul(c)?ha(Wu(c)):{}}function mM(c,f,m){var v=c.constructor;switch(f){case Wr:return tm(c);case Ke:case Kt:return new v(+c);case es:return XR(c,m);case ta:case na:case eo:case _l:case El:case wl:case Tl:case Sl:case Ol:return uE(c,m);case tr:return new v;case si:case Si:return new v(c);case Zs:return ZR(c);case nr:return new v;case ea:return eM(c)}}function gM(c,f){var m=f.length;if(!m)return c;var v=m-1;return f[v]=(m>1?"& ":"")+f[v],f=f.join(m>2?", ":" "),c.replace(pp,`{
233
+ /* [wrapped with `+f+`] */
234
+ `)}function yM(c){return Me(c)||co(c)||!!(R_&&c&&c[R_])}function Ci(c,f){var m=typeof c;return f=f??ve,!!f&&(m=="number"||m!="symbol"&&St.test(c))&&c>-1&&c%1==0&&c<f}function Nn(c,f,m){if(!Ot(m))return!1;var v=typeof f;return(v=="number"?Un(m)&&Ci(f,m.length):v=="string"&&f in m)?Qr(m[f],c):!1}function cm(c,f){if(Me(c))return!1;var m=typeof c;return m=="number"||m=="symbol"||m=="boolean"||c==null||or(c)?!0:xu.test(c)||!Iu.test(c)||f!=null&&c in ht(f)}function vM(c){var f=typeof c;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?c!=="__proto__":c===null}function um(c){var f=cf(c),m=T[f];if(typeof m!="function"||!(f in Ye.prototype))return!1;if(c===m)return!0;var v=om(m);return!!v&&c===v[0]}function bM(c){return!!I_&&I_ in c}var _M=Lu?Di:Nm;function Ul(c){var f=c&&c.constructor,m=typeof f=="function"&&f.prototype||ua;return c===m}function IE(c){return c===c&&!Ot(c)}function xE(c,f){return function(m){return m==null?!1:m[c]===f&&(f!==n||c in ht(m))}}function EM(c){var f=mf(c,function(v){return m.size===u&&m.clear(),v}),m=f.cache;return f}function wM(c,f){var m=c[1],v=f[1],E=m|v,S=E<(_|w|B),A=v==B&&m==N||v==B&&m==Q&&c[7].length<=f[8]||v==(B|Q)&&f[7].length<=f[8]&&m==N;if(!(S||A))return c;v&_&&(c[2]=f[2],E|=m&_?0:O);var R=f[3];if(R){var $=c[3];c[3]=$?dE($,R,f[4]):R,c[4]=$?is(c[3],d):f[4]}return R=f[5],R&&($=c[5],c[5]=$?hE($,R,f[6]):R,c[6]=$?is(c[5],d):f[6]),R=f[7],R&&(c[7]=R),v&B&&(c[8]=c[8]==null?f[8]:mn(c[8],f[8])),c[9]==null&&(c[9]=f[9]),c[0]=f[0],c[1]=E,c}function TM(c){var f=[];if(c!=null)for(var m in ht(c))f.push(m);return f}function SM(c){return ju.call(c)}function CE(c,f,m){return f=Wt(f===n?c.length-1:f,0),function(){for(var v=arguments,E=-1,S=Wt(v.length-f,0),A=V(S);++E<S;)A[E]=v[f+E];E=-1;for(var R=V(f+1);++E<f;)R[E]=v[E];return R[f]=m(A),rr(c,this,R)}}function DE(c,f){return f.length<2?c:oo(c,Sr(f,0,-1))}function OM(c,f){for(var m=c.length,v=mn(f.length,m),E=Bn(c);v--;){var S=f[v];c[v]=Ci(S,m)?E[S]:n}return c}function fm(c,f){if(!(f==="constructor"&&typeof c[f]=="function")&&f!="__proto__")return c[f]}var RE=PE(nE),Wl=jD||function(c,f){return sn.setTimeout(c,f)},dm=PE(HR);function ME(c,f,m){var v=f+"";return dm(c,gM(v,kM(hM(v),m)))}function PE(c){var f=0,m=0;return function(){var v=qD(),E=he-(v-m);if(m=v,E>0){if(++f>=ke)return arguments[0]}else f=0;return c.apply(n,arguments)}}function ff(c,f){var m=-1,v=c.length,E=v-1;for(f=f===n?v:f;++m<f;){var S=Hp(m,E),A=c[S];c[S]=c[m],c[m]=A}return c.length=f,c}var FE=EM(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(dp,function(m,v,E,S){f.push(E?S.replace(ie,"$1"):v||m)}),f});function li(c){if(typeof c=="string"||or(c))return c;var f=c+"";return f=="0"&&1/c==-fe?"-0":f}function lo(c){if(c!=null){try{return Vu.call(c)}catch{}try{return c+""}catch{}}return""}function kM(c,f){return _r(X,function(m){var v="_."+m[0];f&m[1]&&!Mu(c,v)&&c.push(v)}),c.sort()}function $E(c){if(c instanceof Ye)return c.clone();var f=new wr(c.__wrapped__,c.__chain__);return f.__actions__=Bn(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}function NM(c,f,m){(m?Nn(c,f,m):f===n)?f=1:f=Wt($e(f),0);var v=c==null?0:c.length;if(!v||f<1)return[];for(var E=0,S=0,A=V(Qu(v/f));E<v;)A[S++]=Sr(c,E,E+=f);return A}function AM(c){for(var f=-1,m=c==null?0:c.length,v=0,E=[];++f<m;){var S=c[f];S&&(E[v++]=S)}return E}function IM(){var c=arguments.length;if(!c)return[];for(var f=V(c-1),m=arguments[0],v=c;v--;)f[v-1]=arguments[v];return rs(Me(m)?Bn(m):[m],on(f,1))}var xM=Ue(function(c,f){return Rt(c)?$l(c,on(f,1,Rt,!0)):[]}),CM=Ue(function(c,f){var m=Or(f);return Rt(m)&&(m=n),Rt(c)?$l(c,on(f,1,Rt,!0),_e(m,2)):[]}),DM=Ue(function(c,f){var m=Or(f);return Rt(m)&&(m=n),Rt(c)?$l(c,on(f,1,Rt,!0),n,m):[]});function RM(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:$e(f),Sr(c,f<0?0:f,v)):[]}function MM(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:$e(f),f=v-f,Sr(c,0,f<0?0:f)):[]}function PM(c,f){return c&&c.length?nf(c,_e(f,3),!0,!0):[]}function FM(c,f){return c&&c.length?nf(c,_e(f,3),!0):[]}function $M(c,f,m,v){var E=c==null?0:c.length;return E?(m&&typeof m!="number"&&Nn(c,f,m)&&(m=0,v=E),IR(c,f,m,v)):[]}function LE(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=m==null?0:$e(m);return E<0&&(E=Wt(v+E,0)),Pu(c,_e(f,3),E)}function VE(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=v-1;return m!==n&&(E=$e(m),E=m<0?Wt(v+E,0):mn(E,v-1)),Pu(c,_e(f,3),E,!0)}function jE(c){var f=c==null?0:c.length;return f?on(c,1):[]}function LM(c){var f=c==null?0:c.length;return f?on(c,fe):[]}function VM(c,f){var m=c==null?0:c.length;return m?(f=f===n?1:$e(f),on(c,f)):[]}function jM(c){for(var f=-1,m=c==null?0:c.length,v={};++f<m;){var E=c[f];v[E[0]]=E[1]}return v}function BE(c){return c&&c.length?c[0]:n}function BM(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=m==null?0:$e(m);return E<0&&(E=Wt(v+E,0)),oa(c,f,E)}function UM(c){var f=c==null?0:c.length;return f?Sr(c,0,-1):[]}var WM=Ue(function(c){var f=Tt(c,Zp);return f.length&&f[0]===c[0]?Wp(f):[]}),qM=Ue(function(c){var f=Or(c),m=Tt(c,Zp);return f===Or(m)?f=n:m.pop(),m.length&&m[0]===c[0]?Wp(m,_e(f,2)):[]}),zM=Ue(function(c){var f=Or(c),m=Tt(c,Zp);return f=typeof f=="function"?f:n,f&&m.pop(),m.length&&m[0]===c[0]?Wp(m,n,f):[]});function QM(c,f){return c==null?"":UD.call(c,f)}function Or(c){var f=c==null?0:c.length;return f?c[f-1]:n}function GM(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=v;return m!==n&&(E=$e(m),E=E<0?Wt(v+E,0):mn(E,v-1)),f===f?kD(c,f,E):Pu(c,E_,E,!0)}function HM(c,f){return c&&c.length?X_(c,$e(f)):n}var KM=Ue(UE);function UE(c,f){return c&&c.length&&f&&f.length?Gp(c,f):c}function JM(c,f,m){return c&&c.length&&f&&f.length?Gp(c,f,_e(m,2)):c}function YM(c,f,m){return c&&c.length&&f&&f.length?Gp(c,f,n,m):c}var XM=xi(function(c,f){var m=c==null?0:c.length,v=Vp(c,f);return tE(c,Tt(f,function(E){return Ci(E,m)?+E:E}).sort(fE)),v});function ZM(c,f){var m=[];if(!(c&&c.length))return m;var v=-1,E=[],S=c.length;for(f=_e(f,3);++v<S;){var A=c[v];f(A,v,c)&&(m.push(A),E.push(v))}return tE(c,E),m}function hm(c){return c==null?c:QD.call(c)}function eP(c,f,m){var v=c==null?0:c.length;return v?(m&&typeof m!="number"&&Nn(c,f,m)?(f=0,m=v):(f=f==null?0:$e(f),m=m===n?v:$e(m)),Sr(c,f,m)):[]}function tP(c,f){return tf(c,f)}function nP(c,f,m){return Jp(c,f,_e(m,2))}function rP(c,f){var m=c==null?0:c.length;if(m){var v=tf(c,f);if(v<m&&Qr(c[v],f))return v}return-1}function iP(c,f){return tf(c,f,!0)}function sP(c,f,m){return Jp(c,f,_e(m,2),!0)}function oP(c,f){var m=c==null?0:c.length;if(m){var v=tf(c,f,!0)-1;if(Qr(c[v],f))return v}return-1}function aP(c){return c&&c.length?rE(c):[]}function lP(c,f){return c&&c.length?rE(c,_e(f,2)):[]}function cP(c){var f=c==null?0:c.length;return f?Sr(c,1,f):[]}function uP(c,f,m){return c&&c.length?(f=m||f===n?1:$e(f),Sr(c,0,f<0?0:f)):[]}function fP(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:$e(f),f=v-f,Sr(c,f<0?0:f,v)):[]}function dP(c,f){return c&&c.length?nf(c,_e(f,3),!1,!0):[]}function hP(c,f){return c&&c.length?nf(c,_e(f,3)):[]}var pP=Ue(function(c){return ls(on(c,1,Rt,!0))}),mP=Ue(function(c){var f=Or(c);return Rt(f)&&(f=n),ls(on(c,1,Rt,!0),_e(f,2))}),gP=Ue(function(c){var f=Or(c);return f=typeof f=="function"?f:n,ls(on(c,1,Rt,!0),n,f)});function yP(c){return c&&c.length?ls(c):[]}function vP(c,f){return c&&c.length?ls(c,_e(f,2)):[]}function bP(c,f){return f=typeof f=="function"?f:n,c&&c.length?ls(c,n,f):[]}function pm(c){if(!(c&&c.length))return[];var f=0;return c=ns(c,function(m){if(Rt(m))return f=Wt(m.length,f),!0}),Cp(f,function(m){return Tt(c,Ap(m))})}function WE(c,f){if(!(c&&c.length))return[];var m=pm(c);return f==null?m:Tt(m,function(v){return rr(f,n,v)})}var _P=Ue(function(c,f){return Rt(c)?$l(c,f):[]}),EP=Ue(function(c){return Xp(ns(c,Rt))}),wP=Ue(function(c){var f=Or(c);return Rt(f)&&(f=n),Xp(ns(c,Rt),_e(f,2))}),TP=Ue(function(c){var f=Or(c);return f=typeof f=="function"?f:n,Xp(ns(c,Rt),n,f)}),SP=Ue(pm);function OP(c,f){return aE(c||[],f||[],Fl)}function kP(c,f){return aE(c||[],f||[],jl)}var NP=Ue(function(c){var f=c.length,m=f>1?c[f-1]:n;return m=typeof m=="function"?(c.pop(),m):n,WE(c,m)});function qE(c){var f=T(c);return f.__chain__=!0,f}function AP(c,f){return f(c),c}function df(c,f){return f(c)}var IP=xi(function(c){var f=c.length,m=f?c[0]:0,v=this.__wrapped__,E=function(S){return Vp(S,c)};return f>1||this.__actions__.length||!(v instanceof Ye)||!Ci(m)?this.thru(E):(v=v.slice(m,+m+(f?1:0)),v.__actions__.push({func:df,args:[E],thisArg:n}),new wr(v,this.__chain__).thru(function(S){return f&&!S.length&&S.push(n),S}))});function xP(){return qE(this)}function CP(){return new wr(this.value(),this.__chain__)}function DP(){this.__values__===n&&(this.__values__=iw(this.value()));var c=this.__index__>=this.__values__.length,f=c?n:this.__values__[this.__index__++];return{done:c,value:f}}function RP(){return this}function MP(c){for(var f,m=this;m instanceof Ju;){var v=$E(m);v.__index__=0,v.__values__=n,f?E.__wrapped__=v:f=v;var E=v;m=m.__wrapped__}return E.__wrapped__=c,f}function PP(){var c=this.__wrapped__;if(c instanceof Ye){var f=c;return this.__actions__.length&&(f=new Ye(this)),f=f.reverse(),f.__actions__.push({func:df,args:[hm],thisArg:n}),new wr(f,this.__chain__)}return this.thru(hm)}function FP(){return oE(this.__wrapped__,this.__actions__)}var $P=rf(function(c,f,m){ct.call(c,m)?++c[m]:Ai(c,m,1)});function LP(c,f,m){var v=Me(c)?b_:AR;return m&&Nn(c,f,m)&&(f=n),v(c,_e(f,3))}function VP(c,f){var m=Me(c)?ns:W_;return m(c,_e(f,3))}var jP=yE(LE),BP=yE(VE);function UP(c,f){return on(hf(c,f),1)}function WP(c,f){return on(hf(c,f),fe)}function qP(c,f,m){return m=m===n?1:$e(m),on(hf(c,f),m)}function zE(c,f){var m=Me(c)?_r:as;return m(c,_e(f,3))}function QE(c,f){var m=Me(c)?cD:U_;return m(c,_e(f,3))}var zP=rf(function(c,f,m){ct.call(c,m)?c[m].push(f):Ai(c,m,[f])});function QP(c,f,m,v){c=Un(c)?c:va(c),m=m&&!v?$e(m):0;var E=c.length;return m<0&&(m=Wt(E+m,0)),vf(c)?m<=E&&c.indexOf(f,m)>-1:!!E&&oa(c,f,m)>-1}var GP=Ue(function(c,f,m){var v=-1,E=typeof f=="function",S=Un(c)?V(c.length):[];return as(c,function(A){S[++v]=E?rr(f,A,m):Ll(A,f,m)}),S}),HP=rf(function(c,f,m){Ai(c,m,f)});function hf(c,f){var m=Me(c)?Tt:K_;return m(c,_e(f,3))}function KP(c,f,m,v){return c==null?[]:(Me(f)||(f=f==null?[]:[f]),m=v?n:m,Me(m)||(m=m==null?[]:[m]),Z_(c,f,m))}var JP=rf(function(c,f,m){c[m?0:1].push(f)},function(){return[[],[]]});function YP(c,f,m){var v=Me(c)?kp:T_,E=arguments.length<3;return v(c,_e(f,4),m,E,as)}function XP(c,f,m){var v=Me(c)?uD:T_,E=arguments.length<3;return v(c,_e(f,4),m,E,U_)}function ZP(c,f){var m=Me(c)?ns:W_;return m(c,gf(_e(f,3)))}function eF(c){var f=Me(c)?L_:QR;return f(c)}function tF(c,f,m){(m?Nn(c,f,m):f===n)?f=1:f=$e(f);var v=Me(c)?TR:GR;return v(c,f)}function nF(c){var f=Me(c)?SR:KR;return f(c)}function rF(c){if(c==null)return 0;if(Un(c))return vf(c)?la(c):c.length;var f=gn(c);return f==tr||f==nr?c.size:zp(c).length}function iF(c,f,m){var v=Me(c)?Np:JR;return m&&Nn(c,f,m)&&(f=n),v(c,_e(f,3))}var sF=Ue(function(c,f){if(c==null)return[];var m=f.length;return m>1&&Nn(c,f[0],f[1])?f=[]:m>2&&Nn(f[0],f[1],f[2])&&(f=[f[0]]),Z_(c,on(f,1),[])}),pf=VD||function(){return sn.Date.now()};function oF(c,f){if(typeof f!="function")throw new Er(o);return c=$e(c),function(){if(--c<1)return f.apply(this,arguments)}}function GE(c,f,m){return f=m?n:f,f=c&&f==null?c.length:f,Ii(c,B,n,n,n,n,f)}function HE(c,f){var m;if(typeof f!="function")throw new Er(o);return c=$e(c),function(){return--c>0&&(m=f.apply(this,arguments)),c<=1&&(f=n),m}}var mm=Ue(function(c,f,m){var v=_;if(m.length){var E=is(m,ga(mm));v|=P}return Ii(c,v,f,m,E)}),KE=Ue(function(c,f,m){var v=_|w;if(m.length){var E=is(m,ga(KE));v|=P}return Ii(f,v,c,m,E)});function JE(c,f,m){f=m?n:f;var v=Ii(c,N,n,n,n,n,n,f);return v.placeholder=JE.placeholder,v}function YE(c,f,m){f=m?n:f;var v=Ii(c,I,n,n,n,n,n,f);return v.placeholder=YE.placeholder,v}function XE(c,f,m){var v,E,S,A,R,$,G=0,H=!1,K=!1,re=!0;if(typeof c!="function")throw new Er(o);f=kr(f)||0,Ot(m)&&(H=!!m.leading,K="maxWait"in m,S=K?Wt(kr(m.maxWait)||0,f):S,re="trailing"in m?!!m.trailing:re);function de(Mt){var Gr=v,Mi=E;return v=E=n,G=Mt,A=c.apply(Mi,Gr),A}function Ee(Mt){return G=Mt,R=Wl(Ge,f),H?de(Mt):A}function Ve(Mt){var Gr=Mt-$,Mi=Mt-G,yw=f-Gr;return K?mn(yw,S-Mi):yw}function we(Mt){var Gr=Mt-$,Mi=Mt-G;return $===n||Gr>=f||Gr<0||K&&Mi>=S}function Ge(){var Mt=pf();if(we(Mt))return Ze(Mt);R=Wl(Ge,Ve(Mt))}function Ze(Mt){return R=n,re&&v?de(Mt):(v=E=n,A)}function ar(){R!==n&&lE(R),G=0,v=$=E=R=n}function An(){return R===n?A:Ze(pf())}function lr(){var Mt=pf(),Gr=we(Mt);if(v=arguments,E=this,$=Mt,Gr){if(R===n)return Ee($);if(K)return lE(R),R=Wl(Ge,f),de($)}return R===n&&(R=Wl(Ge,f)),A}return lr.cancel=ar,lr.flush=An,lr}var aF=Ue(function(c,f){return B_(c,1,f)}),lF=Ue(function(c,f,m){return B_(c,kr(f)||0,m)});function cF(c){return Ii(c,x)}function mf(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new Er(o);var m=function(){var v=arguments,E=f?f.apply(this,v):v[0],S=m.cache;if(S.has(E))return S.get(E);var A=c.apply(this,v);return m.cache=S.set(E,A)||S,A};return m.cache=new(mf.Cache||Ni),m}mf.Cache=Ni;function gf(c){if(typeof c!="function")throw new Er(o);return function(){var f=arguments;switch(f.length){case 0:return!c.call(this);case 1:return!c.call(this,f[0]);case 2:return!c.call(this,f[0],f[1]);case 3:return!c.call(this,f[0],f[1],f[2])}return!c.apply(this,f)}}function uF(c){return HE(2,c)}var fF=YR(function(c,f){f=f.length==1&&Me(f[0])?Tt(f[0],ir(_e())):Tt(on(f,1),ir(_e()));var m=f.length;return Ue(function(v){for(var E=-1,S=mn(v.length,m);++E<S;)v[E]=f[E].call(this,v[E]);return rr(c,this,v)})}),gm=Ue(function(c,f){var m=is(f,ga(gm));return Ii(c,P,n,f,m)}),ZE=Ue(function(c,f){var m=is(f,ga(ZE));return Ii(c,M,n,f,m)}),dF=xi(function(c,f){return Ii(c,Q,n,n,n,f)});function hF(c,f){if(typeof c!="function")throw new Er(o);return f=f===n?f:$e(f),Ue(c,f)}function pF(c,f){if(typeof c!="function")throw new Er(o);return f=f==null?0:Wt($e(f),0),Ue(function(m){var v=m[f],E=us(m,0,f);return v&&rs(E,v),rr(c,this,E)})}function mF(c,f,m){var v=!0,E=!0;if(typeof c!="function")throw new Er(o);return Ot(m)&&(v="leading"in m?!!m.leading:v,E="trailing"in m?!!m.trailing:E),XE(c,f,{leading:v,maxWait:f,trailing:E})}function gF(c){return GE(c,1)}function yF(c,f){return gm(em(f),c)}function vF(){if(!arguments.length)return[];var c=arguments[0];return Me(c)?c:[c]}function bF(c){return Tr(c,g)}function _F(c,f){return f=typeof f=="function"?f:n,Tr(c,g,f)}function EF(c){return Tr(c,h|g)}function wF(c,f){return f=typeof f=="function"?f:n,Tr(c,h|g,f)}function TF(c,f){return f==null||j_(c,f,Jt(f))}function Qr(c,f){return c===f||c!==c&&f!==f}var SF=lf(Up),OF=lf(function(c,f){return c>=f}),co=Q_(function(){return arguments}())?Q_:function(c){return It(c)&&ct.call(c,"callee")&&!D_.call(c,"callee")},Me=V.isArray,kF=h_?ir(h_):MR;function Un(c){return c!=null&&yf(c.length)&&!Di(c)}function Rt(c){return It(c)&&Un(c)}function NF(c){return c===!0||c===!1||It(c)&&kn(c)==Ke}var fs=BD||Nm,AF=p_?ir(p_):PR;function IF(c){return It(c)&&c.nodeType===1&&!ql(c)}function xF(c){if(c==null)return!0;if(Un(c)&&(Me(c)||typeof c=="string"||typeof c.splice=="function"||fs(c)||ya(c)||co(c)))return!c.length;var f=gn(c);if(f==tr||f==nr)return!c.size;if(Ul(c))return!zp(c).length;for(var m in c)if(ct.call(c,m))return!1;return!0}function CF(c,f){return Vl(c,f)}function DF(c,f,m){m=typeof m=="function"?m:n;var v=m?m(c,f):n;return v===n?Vl(c,f,n,m):!!v}function ym(c){if(!It(c))return!1;var f=kn(c);return f==ii||f==ri||typeof c.message=="string"&&typeof c.name=="string"&&!ql(c)}function RF(c){return typeof c=="number"&&M_(c)}function Di(c){if(!Ot(c))return!1;var f=kn(c);return f==Bt||f==Tu||f==Re||f==Zo}function ew(c){return typeof c=="number"&&c==$e(c)}function yf(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=ve}function Ot(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function It(c){return c!=null&&typeof c=="object"}var tw=m_?ir(m_):$R;function MF(c,f){return c===f||qp(c,f,am(f))}function PF(c,f,m){return m=typeof m=="function"?m:n,qp(c,f,am(f),m)}function FF(c){return nw(c)&&c!=+c}function $F(c){if(_M(c))throw new De(s);return G_(c)}function LF(c){return c===null}function VF(c){return c==null}function nw(c){return typeof c=="number"||It(c)&&kn(c)==si}function ql(c){if(!It(c)||kn(c)!=yr)return!1;var f=Wu(c);if(f===null)return!0;var m=ct.call(f,"constructor")&&f.constructor;return typeof m=="function"&&m instanceof m&&Vu.call(m)==PD}var vm=g_?ir(g_):LR;function jF(c){return ew(c)&&c>=-ve&&c<=ve}var rw=y_?ir(y_):VR;function vf(c){return typeof c=="string"||!Me(c)&&It(c)&&kn(c)==Si}function or(c){return typeof c=="symbol"||It(c)&&kn(c)==ea}var ya=v_?ir(v_):jR;function BF(c){return c===n}function UF(c){return It(c)&&gn(c)==Zi}function WF(c){return It(c)&&kn(c)==Su}var qF=lf(Qp),zF=lf(function(c,f){return c<=f});function iw(c){if(!c)return[];if(Un(c))return vf(c)?qr(c):Bn(c);if(Cl&&c[Cl])return TD(c[Cl]());var f=gn(c),m=f==tr?Rp:f==nr?Fu:va;return m(c)}function Ri(c){if(!c)return c===0?c:0;if(c=kr(c),c===fe||c===-fe){var f=c<0?-1:1;return f*Se}return c===c?c:0}function $e(c){var f=Ri(c),m=f%1;return f===f?m?f-m:f:0}function sw(c){return c?so($e(c),0,Ne):0}function kr(c){if(typeof c=="number")return c;if(or(c))return dt;if(Ot(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=Ot(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=S_(c);var m=Je.test(c);return m||nn.test(c)?oD(c.slice(2),m?2:8):lt.test(c)?dt:+c}function ow(c){return ai(c,Wn(c))}function QF(c){return c?so($e(c),-ve,ve):c===0?c:0}function ot(c){return c==null?"":sr(c)}var GF=pa(function(c,f){if(Ul(f)||Un(f)){ai(f,Jt(f),c);return}for(var m in f)ct.call(f,m)&&Fl(c,m,f[m])}),aw=pa(function(c,f){ai(f,Wn(f),c)}),bf=pa(function(c,f,m,v){ai(f,Wn(f),c,v)}),HF=pa(function(c,f,m,v){ai(f,Jt(f),c,v)}),KF=xi(Vp);function JF(c,f){var m=ha(c);return f==null?m:V_(m,f)}var YF=Ue(function(c,f){c=ht(c);var m=-1,v=f.length,E=v>2?f[2]:n;for(E&&Nn(f[0],f[1],E)&&(v=1);++m<v;)for(var S=f[m],A=Wn(S),R=-1,$=A.length;++R<$;){var G=A[R],H=c[G];(H===n||Qr(H,ua[G])&&!ct.call(c,G))&&(c[G]=S[G])}return c}),XF=Ue(function(c){return c.push(n,SE),rr(lw,n,c)});function ZF(c,f){return __(c,_e(f,3),oi)}function e$(c,f){return __(c,_e(f,3),Bp)}function t$(c,f){return c==null?c:jp(c,_e(f,3),Wn)}function n$(c,f){return c==null?c:q_(c,_e(f,3),Wn)}function r$(c,f){return c&&oi(c,_e(f,3))}function i$(c,f){return c&&Bp(c,_e(f,3))}function s$(c){return c==null?[]:Zu(c,Jt(c))}function o$(c){return c==null?[]:Zu(c,Wn(c))}function bm(c,f,m){var v=c==null?n:oo(c,f);return v===n?m:v}function a$(c,f){return c!=null&&NE(c,f,xR)}function _m(c,f){return c!=null&&NE(c,f,CR)}var l$=bE(function(c,f,m){f!=null&&typeof f.toString!="function"&&(f=ju.call(f)),c[f]=m},wm(qn)),c$=bE(function(c,f,m){f!=null&&typeof f.toString!="function"&&(f=ju.call(f)),ct.call(c,f)?c[f].push(m):c[f]=[m]},_e),u$=Ue(Ll);function Jt(c){return Un(c)?$_(c):zp(c)}function Wn(c){return Un(c)?$_(c,!0):BR(c)}function f$(c,f){var m={};return f=_e(f,3),oi(c,function(v,E,S){Ai(m,f(v,E,S),v)}),m}function d$(c,f){var m={};return f=_e(f,3),oi(c,function(v,E,S){Ai(m,E,f(v,E,S))}),m}var h$=pa(function(c,f,m){ef(c,f,m)}),lw=pa(function(c,f,m,v){ef(c,f,m,v)}),p$=xi(function(c,f){var m={};if(c==null)return m;var v=!1;f=Tt(f,function(S){return S=cs(S,c),v||(v=S.length>1),S}),ai(c,sm(c),m),v&&(m=Tr(m,h|p|g,lM));for(var E=f.length;E--;)Yp(m,f[E]);return m});function m$(c,f){return cw(c,gf(_e(f)))}var g$=xi(function(c,f){return c==null?{}:WR(c,f)});function cw(c,f){if(c==null)return{};var m=Tt(sm(c),function(v){return[v]});return f=_e(f),eE(c,m,function(v,E){return f(v,E[0])})}function y$(c,f,m){f=cs(f,c);var v=-1,E=f.length;for(E||(E=1,c=n);++v<E;){var S=c==null?n:c[li(f[v])];S===n&&(v=E,S=m),c=Di(S)?S.call(c):S}return c}function v$(c,f,m){return c==null?c:jl(c,f,m)}function b$(c,f,m,v){return v=typeof v=="function"?v:n,c==null?c:jl(c,f,m,v)}var uw=wE(Jt),fw=wE(Wn);function _$(c,f,m){var v=Me(c),E=v||fs(c)||ya(c);if(f=_e(f,4),m==null){var S=c&&c.constructor;E?m=v?new S:[]:Ot(c)?m=Di(S)?ha(Wu(c)):{}:m={}}return(E?_r:oi)(c,function(A,R,$){return f(m,A,R,$)}),m}function E$(c,f){return c==null?!0:Yp(c,f)}function w$(c,f,m){return c==null?c:sE(c,f,em(m))}function T$(c,f,m,v){return v=typeof v=="function"?v:n,c==null?c:sE(c,f,em(m),v)}function va(c){return c==null?[]:Dp(c,Jt(c))}function S$(c){return c==null?[]:Dp(c,Wn(c))}function O$(c,f,m){return m===n&&(m=f,f=n),m!==n&&(m=kr(m),m=m===m?m:0),f!==n&&(f=kr(f),f=f===f?f:0),so(kr(c),f,m)}function k$(c,f,m){return f=Ri(f),m===n?(m=f,f=0):m=Ri(m),c=kr(c),DR(c,f,m)}function N$(c,f,m){if(m&&typeof m!="boolean"&&Nn(c,f,m)&&(f=m=n),m===n&&(typeof f=="boolean"?(m=f,f=n):typeof c=="boolean"&&(m=c,c=n)),c===n&&f===n?(c=0,f=1):(c=Ri(c),f===n?(f=c,c=0):f=Ri(f)),c>f){var v=c;c=f,f=v}if(m||c%1||f%1){var E=P_();return mn(c+E*(f-c+sD("1e-"+((E+"").length-1))),f)}return Hp(c,f)}var A$=ma(function(c,f,m){return f=f.toLowerCase(),c+(m?dw(f):f)});function dw(c){return Em(ot(c).toLowerCase())}function hw(c){return c=ot(c),c&&c.replace(At,vD).replace(KC,"")}function I$(c,f,m){c=ot(c),f=sr(f);var v=c.length;m=m===n?v:so($e(m),0,v);var E=m;return m-=f.length,m>=0&&c.slice(m,E)==f}function x$(c){return c=ot(c),c&&ku.test(c)?c.replace(ra,bD):c}function C$(c){return c=ot(c),c&&Cu.test(c)?c.replace(Al,"\\$&"):c}var D$=ma(function(c,f,m){return c+(m?"-":"")+f.toLowerCase()}),R$=ma(function(c,f,m){return c+(m?" ":"")+f.toLowerCase()}),M$=gE("toLowerCase");function P$(c,f,m){c=ot(c),f=$e(f);var v=f?la(c):0;if(!f||v>=f)return c;var E=(f-v)/2;return af(Gu(E),m)+c+af(Qu(E),m)}function F$(c,f,m){c=ot(c),f=$e(f);var v=f?la(c):0;return f&&v<f?c+af(f-v,m):c}function $$(c,f,m){c=ot(c),f=$e(f);var v=f?la(c):0;return f&&v<f?af(f-v,m)+c:c}function L$(c,f,m){return m||f==null?f=0:f&&(f=+f),zD(ot(c).replace(ia,""),f||0)}function V$(c,f,m){return(m?Nn(c,f,m):f===n)?f=1:f=$e(f),Kp(ot(c),f)}function j$(){var c=arguments,f=ot(c[0]);return c.length<3?f:f.replace(c[1],c[2])}var B$=ma(function(c,f,m){return c+(m?"_":"")+f.toLowerCase()});function U$(c,f,m){return m&&typeof m!="number"&&Nn(c,f,m)&&(f=m=n),m=m===n?Ne:m>>>0,m?(c=ot(c),c&&(typeof f=="string"||f!=null&&!vm(f))&&(f=sr(f),!f&&aa(c))?us(qr(c),0,m):c.split(f,m)):[]}var W$=ma(function(c,f,m){return c+(m?" ":"")+Em(f)});function q$(c,f,m){return c=ot(c),m=m==null?0:so($e(m),0,c.length),f=sr(f),c.slice(m,m+f.length)==f}function z$(c,f,m){var v=T.templateSettings;m&&Nn(c,f,m)&&(f=n),c=ot(c),f=bf({},f,v,TE);var E=bf({},f.imports,v.imports,TE),S=Jt(E),A=Dp(E,S),R,$,G=0,H=f.interpolate||rn,K="__p += '",re=Mp((f.escape||rn).source+"|"+H.source+"|"+(H===Au?Oe:rn).source+"|"+(f.evaluate||rn).source+"|$","g"),de="//# sourceURL="+(ct.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++eD+"]")+`
235
+ `;c.replace(re,function(we,Ge,Ze,ar,An,lr){return Ze||(Ze=ar),K+=c.slice(G,lr).replace(ts,_D),Ge&&(R=!0,K+=`' +
236
+ __e(`+Ge+`) +
237
+ '`),An&&($=!0,K+=`';
238
+ `+An+`;
239
+ __p += '`),Ze&&(K+=`' +
240
+ ((__t = (`+Ze+`)) == null ? '' : __t) +
241
+ '`),G=lr+we.length,we}),K+=`';
242
+ `;var Ee=ct.call(f,"variable")&&f.variable;if(!Ee)K=`with (obj) {
243
+ `+K+`
244
+ }
245
+ `;else if(J.test(Ee))throw new De(a);K=($?K.replace(up,""):K).replace(kl,"$1").replace(Ou,"$1;"),K="function("+(Ee||"obj")+`) {
246
+ `+(Ee?"":`obj || (obj = {});
247
+ `)+"var __t, __p = ''"+(R?", __e = _.escape":"")+($?`, __j = Array.prototype.join;
248
+ function print() { __p += __j.call(arguments, '') }
249
+ `:`;
250
+ `)+K+`return __p
251
+ }`;var Ve=mw(function(){return st(S,de+"return "+K).apply(n,A)});if(Ve.source=K,ym(Ve))throw Ve;return Ve}function Q$(c){return ot(c).toLowerCase()}function G$(c){return ot(c).toUpperCase()}function H$(c,f,m){if(c=ot(c),c&&(m||f===n))return S_(c);if(!c||!(f=sr(f)))return c;var v=qr(c),E=qr(f),S=O_(v,E),A=k_(v,E)+1;return us(v,S,A).join("")}function K$(c,f,m){if(c=ot(c),c&&(m||f===n))return c.slice(0,A_(c)+1);if(!c||!(f=sr(f)))return c;var v=qr(c),E=k_(v,qr(f))+1;return us(v,0,E).join("")}function J$(c,f,m){if(c=ot(c),c&&(m||f===n))return c.replace(ia,"");if(!c||!(f=sr(f)))return c;var v=qr(c),E=O_(v,qr(f));return us(v,E).join("")}function Y$(c,f){var m=U,v=Te;if(Ot(f)){var E="separator"in f?f.separator:E;m="length"in f?$e(f.length):m,v="omission"in f?sr(f.omission):v}c=ot(c);var S=c.length;if(aa(c)){var A=qr(c);S=A.length}if(m>=S)return c;var R=m-la(v);if(R<1)return v;var $=A?us(A,0,R).join(""):c.slice(0,R);if(E===n)return $+v;if(A&&(R+=$.length-R),vm(E)){if(c.slice(R).search(E)){var G,H=$;for(E.global||(E=Mp(E.source,ot(nt.exec(E))+"g")),E.lastIndex=0;G=E.exec(H);)var K=G.index;$=$.slice(0,K===n?R:K)}}else if(c.indexOf(sr(E),R)!=R){var re=$.lastIndexOf(E);re>-1&&($=$.slice(0,re))}return $+v}function X$(c){return c=ot(c),c&&Nl.test(c)?c.replace(Oi,ND):c}var Z$=ma(function(c,f,m){return c+(m?" ":"")+f.toUpperCase()}),Em=gE("toUpperCase");function pw(c,f,m){return c=ot(c),f=m?n:f,f===n?wD(c)?xD(c):hD(c):c.match(f)||[]}var mw=Ue(function(c,f){try{return rr(c,n,f)}catch(m){return ym(m)?m:new De(m)}}),eL=xi(function(c,f){return _r(f,function(m){m=li(m),Ai(c,m,mm(c[m],c))}),c});function tL(c){var f=c==null?0:c.length,m=_e();return c=f?Tt(c,function(v){if(typeof v[1]!="function")throw new Er(o);return[m(v[0]),v[1]]}):[],Ue(function(v){for(var E=-1;++E<f;){var S=c[E];if(rr(S[0],this,v))return rr(S[1],this,v)}})}function nL(c){return NR(Tr(c,h))}function wm(c){return function(){return c}}function rL(c,f){return c==null||c!==c?f:c}var iL=vE(),sL=vE(!0);function qn(c){return c}function Tm(c){return H_(typeof c=="function"?c:Tr(c,h))}function oL(c){return J_(Tr(c,h))}function aL(c,f){return Y_(c,Tr(f,h))}var lL=Ue(function(c,f){return function(m){return Ll(m,c,f)}}),cL=Ue(function(c,f){return function(m){return Ll(c,m,f)}});function Sm(c,f,m){var v=Jt(f),E=Zu(f,v);m==null&&!(Ot(f)&&(E.length||!v.length))&&(m=f,f=c,c=this,E=Zu(f,Jt(f)));var S=!(Ot(m)&&"chain"in m)||!!m.chain,A=Di(c);return _r(E,function(R){var $=f[R];c[R]=$,A&&(c.prototype[R]=function(){var G=this.__chain__;if(S||G){var H=c(this.__wrapped__),K=H.__actions__=Bn(this.__actions__);return K.push({func:$,args:arguments,thisArg:c}),H.__chain__=G,H}return $.apply(c,rs([this.value()],arguments))})}),c}function uL(){return sn._===this&&(sn._=FD),this}function Om(){}function fL(c){return c=$e(c),Ue(function(f){return X_(f,c)})}var dL=nm(Tt),hL=nm(b_),pL=nm(Np);function gw(c){return cm(c)?Ap(li(c)):qR(c)}function mL(c){return function(f){return c==null?n:oo(c,f)}}var gL=_E(),yL=_E(!0);function km(){return[]}function Nm(){return!1}function vL(){return{}}function bL(){return""}function _L(){return!0}function EL(c,f){if(c=$e(c),c<1||c>ve)return[];var m=Ne,v=mn(c,Ne);f=_e(f),c-=Ne;for(var E=Cp(v,f);++m<c;)f(m);return E}function wL(c){return Me(c)?Tt(c,li):or(c)?[c]:Bn(FE(ot(c)))}function TL(c){var f=++MD;return ot(c)+f}var SL=of(function(c,f){return c+f},0),OL=rm("ceil"),kL=of(function(c,f){return c/f},1),NL=rm("floor");function AL(c){return c&&c.length?Xu(c,qn,Up):n}function IL(c,f){return c&&c.length?Xu(c,_e(f,2),Up):n}function xL(c){return w_(c,qn)}function CL(c,f){return w_(c,_e(f,2))}function DL(c){return c&&c.length?Xu(c,qn,Qp):n}function RL(c,f){return c&&c.length?Xu(c,_e(f,2),Qp):n}var ML=of(function(c,f){return c*f},1),PL=rm("round"),FL=of(function(c,f){return c-f},0);function $L(c){return c&&c.length?xp(c,qn):0}function LL(c,f){return c&&c.length?xp(c,_e(f,2)):0}return T.after=oF,T.ary=GE,T.assign=GF,T.assignIn=aw,T.assignInWith=bf,T.assignWith=HF,T.at=KF,T.before=HE,T.bind=mm,T.bindAll=eL,T.bindKey=KE,T.castArray=vF,T.chain=qE,T.chunk=NM,T.compact=AM,T.concat=IM,T.cond=tL,T.conforms=nL,T.constant=wm,T.countBy=$P,T.create=JF,T.curry=JE,T.curryRight=YE,T.debounce=XE,T.defaults=YF,T.defaultsDeep=XF,T.defer=aF,T.delay=lF,T.difference=xM,T.differenceBy=CM,T.differenceWith=DM,T.drop=RM,T.dropRight=MM,T.dropRightWhile=PM,T.dropWhile=FM,T.fill=$M,T.filter=VP,T.flatMap=UP,T.flatMapDeep=WP,T.flatMapDepth=qP,T.flatten=jE,T.flattenDeep=LM,T.flattenDepth=VM,T.flip=cF,T.flow=iL,T.flowRight=sL,T.fromPairs=jM,T.functions=s$,T.functionsIn=o$,T.groupBy=zP,T.initial=UM,T.intersection=WM,T.intersectionBy=qM,T.intersectionWith=zM,T.invert=l$,T.invertBy=c$,T.invokeMap=GP,T.iteratee=Tm,T.keyBy=HP,T.keys=Jt,T.keysIn=Wn,T.map=hf,T.mapKeys=f$,T.mapValues=d$,T.matches=oL,T.matchesProperty=aL,T.memoize=mf,T.merge=h$,T.mergeWith=lw,T.method=lL,T.methodOf=cL,T.mixin=Sm,T.negate=gf,T.nthArg=fL,T.omit=p$,T.omitBy=m$,T.once=uF,T.orderBy=KP,T.over=dL,T.overArgs=fF,T.overEvery=hL,T.overSome=pL,T.partial=gm,T.partialRight=ZE,T.partition=JP,T.pick=g$,T.pickBy=cw,T.property=gw,T.propertyOf=mL,T.pull=KM,T.pullAll=UE,T.pullAllBy=JM,T.pullAllWith=YM,T.pullAt=XM,T.range=gL,T.rangeRight=yL,T.rearg=dF,T.reject=ZP,T.remove=ZM,T.rest=hF,T.reverse=hm,T.sampleSize=tF,T.set=v$,T.setWith=b$,T.shuffle=nF,T.slice=eP,T.sortBy=sF,T.sortedUniq=aP,T.sortedUniqBy=lP,T.split=U$,T.spread=pF,T.tail=cP,T.take=uP,T.takeRight=fP,T.takeRightWhile=dP,T.takeWhile=hP,T.tap=AP,T.throttle=mF,T.thru=df,T.toArray=iw,T.toPairs=uw,T.toPairsIn=fw,T.toPath=wL,T.toPlainObject=ow,T.transform=_$,T.unary=gF,T.union=pP,T.unionBy=mP,T.unionWith=gP,T.uniq=yP,T.uniqBy=vP,T.uniqWith=bP,T.unset=E$,T.unzip=pm,T.unzipWith=WE,T.update=w$,T.updateWith=T$,T.values=va,T.valuesIn=S$,T.without=_P,T.words=pw,T.wrap=yF,T.xor=EP,T.xorBy=wP,T.xorWith=TP,T.zip=SP,T.zipObject=OP,T.zipObjectDeep=kP,T.zipWith=NP,T.entries=uw,T.entriesIn=fw,T.extend=aw,T.extendWith=bf,Sm(T,T),T.add=SL,T.attempt=mw,T.camelCase=A$,T.capitalize=dw,T.ceil=OL,T.clamp=O$,T.clone=bF,T.cloneDeep=EF,T.cloneDeepWith=wF,T.cloneWith=_F,T.conformsTo=TF,T.deburr=hw,T.defaultTo=rL,T.divide=kL,T.endsWith=I$,T.eq=Qr,T.escape=x$,T.escapeRegExp=C$,T.every=LP,T.find=jP,T.findIndex=LE,T.findKey=ZF,T.findLast=BP,T.findLastIndex=VE,T.findLastKey=e$,T.floor=NL,T.forEach=zE,T.forEachRight=QE,T.forIn=t$,T.forInRight=n$,T.forOwn=r$,T.forOwnRight=i$,T.get=bm,T.gt=SF,T.gte=OF,T.has=a$,T.hasIn=_m,T.head=BE,T.identity=qn,T.includes=QP,T.indexOf=BM,T.inRange=k$,T.invoke=u$,T.isArguments=co,T.isArray=Me,T.isArrayBuffer=kF,T.isArrayLike=Un,T.isArrayLikeObject=Rt,T.isBoolean=NF,T.isBuffer=fs,T.isDate=AF,T.isElement=IF,T.isEmpty=xF,T.isEqual=CF,T.isEqualWith=DF,T.isError=ym,T.isFinite=RF,T.isFunction=Di,T.isInteger=ew,T.isLength=yf,T.isMap=tw,T.isMatch=MF,T.isMatchWith=PF,T.isNaN=FF,T.isNative=$F,T.isNil=VF,T.isNull=LF,T.isNumber=nw,T.isObject=Ot,T.isObjectLike=It,T.isPlainObject=ql,T.isRegExp=vm,T.isSafeInteger=jF,T.isSet=rw,T.isString=vf,T.isSymbol=or,T.isTypedArray=ya,T.isUndefined=BF,T.isWeakMap=UF,T.isWeakSet=WF,T.join=QM,T.kebabCase=D$,T.last=Or,T.lastIndexOf=GM,T.lowerCase=R$,T.lowerFirst=M$,T.lt=qF,T.lte=zF,T.max=AL,T.maxBy=IL,T.mean=xL,T.meanBy=CL,T.min=DL,T.minBy=RL,T.stubArray=km,T.stubFalse=Nm,T.stubObject=vL,T.stubString=bL,T.stubTrue=_L,T.multiply=ML,T.nth=HM,T.noConflict=uL,T.noop=Om,T.now=pf,T.pad=P$,T.padEnd=F$,T.padStart=$$,T.parseInt=L$,T.random=N$,T.reduce=YP,T.reduceRight=XP,T.repeat=V$,T.replace=j$,T.result=y$,T.round=PL,T.runInContext=F,T.sample=eF,T.size=rF,T.snakeCase=B$,T.some=iF,T.sortedIndex=tP,T.sortedIndexBy=nP,T.sortedIndexOf=rP,T.sortedLastIndex=iP,T.sortedLastIndexBy=sP,T.sortedLastIndexOf=oP,T.startCase=W$,T.startsWith=q$,T.subtract=FL,T.sum=$L,T.sumBy=LL,T.template=z$,T.times=EL,T.toFinite=Ri,T.toInteger=$e,T.toLength=sw,T.toLower=Q$,T.toNumber=kr,T.toSafeInteger=QF,T.toString=ot,T.toUpper=G$,T.trim=H$,T.trimEnd=K$,T.trimStart=J$,T.truncate=Y$,T.unescape=X$,T.uniqueId=TL,T.upperCase=Z$,T.upperFirst=Em,T.each=zE,T.eachRight=QE,T.first=BE,Sm(T,function(){var c={};return oi(T,function(f,m){ct.call(T.prototype,m)||(c[m]=f)}),c}(),{chain:!1}),T.VERSION=r,_r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){T[c].placeholder=T}),_r(["drop","take"],function(c,f){Ye.prototype[c]=function(m){m=m===n?1:Wt($e(m),0);var v=this.__filtered__&&!f?new Ye(this):this.clone();return v.__filtered__?v.__takeCount__=mn(m,v.__takeCount__):v.__views__.push({size:mn(m,Ne),type:c+(v.__dir__<0?"Right":"")}),v},Ye.prototype[c+"Right"]=function(m){return this.reverse()[c](m).reverse()}}),_r(["filter","map","takeWhile"],function(c,f){var m=f+1,v=m==Ce||m==Ae;Ye.prototype[c]=function(E){var S=this.clone();return S.__iteratees__.push({iteratee:_e(E,3),type:m}),S.__filtered__=S.__filtered__||v,S}}),_r(["head","last"],function(c,f){var m="take"+(f?"Right":"");Ye.prototype[c]=function(){return this[m](1).value()[0]}}),_r(["initial","tail"],function(c,f){var m="drop"+(f?"":"Right");Ye.prototype[c]=function(){return this.__filtered__?new Ye(this):this[m](1)}}),Ye.prototype.compact=function(){return this.filter(qn)},Ye.prototype.find=function(c){return this.filter(c).head()},Ye.prototype.findLast=function(c){return this.reverse().find(c)},Ye.prototype.invokeMap=Ue(function(c,f){return typeof c=="function"?new Ye(this):this.map(function(m){return Ll(m,c,f)})}),Ye.prototype.reject=function(c){return this.filter(gf(_e(c)))},Ye.prototype.slice=function(c,f){c=$e(c);var m=this;return m.__filtered__&&(c>0||f<0)?new Ye(m):(c<0?m=m.takeRight(-c):c&&(m=m.drop(c)),f!==n&&(f=$e(f),m=f<0?m.dropRight(-f):m.take(f-c)),m)},Ye.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Ye.prototype.toArray=function(){return this.take(Ne)},oi(Ye.prototype,function(c,f){var m=/^(?:filter|find|map|reject)|While$/.test(f),v=/^(?:head|last)$/.test(f),E=T[v?"take"+(f=="last"?"Right":""):f],S=v||/^find/.test(f);E&&(T.prototype[f]=function(){var A=this.__wrapped__,R=v?[1]:arguments,$=A instanceof Ye,G=R[0],H=$||Me(A),K=function(Ge){var Ze=E.apply(T,rs([Ge],R));return v&&re?Ze[0]:Ze};H&&m&&typeof G=="function"&&G.length!=1&&($=H=!1);var re=this.__chain__,de=!!this.__actions__.length,Ee=S&&!re,Ve=$&&!de;if(!S&&H){A=Ve?A:new Ye(this);var we=c.apply(A,R);return we.__actions__.push({func:df,args:[K],thisArg:n}),new wr(we,re)}return Ee&&Ve?c.apply(this,R):(we=this.thru(K),Ee?v?we.value()[0]:we.value():we)})}),_r(["pop","push","shift","sort","splice","unshift"],function(c){var f=$u[c],m=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",v=/^(?:pop|shift)$/.test(c);T.prototype[c]=function(){var E=arguments;if(v&&!this.__chain__){var S=this.value();return f.apply(Me(S)?S:[],E)}return this[m](function(A){return f.apply(Me(A)?A:[],E)})}}),oi(Ye.prototype,function(c,f){var m=T[f];if(m){var v=m.name+"";ct.call(da,v)||(da[v]=[]),da[v].push({name:f,func:m})}}),da[sf(n,w).name]=[{name:"wrapper",func:n}],Ye.prototype.clone=XD,Ye.prototype.reverse=ZD,Ye.prototype.value=eR,T.prototype.at=IP,T.prototype.chain=xP,T.prototype.commit=CP,T.prototype.next=DP,T.prototype.plant=MP,T.prototype.reverse=PP,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=FP,T.prototype.first=T.prototype.head,Cl&&(T.prototype[Cl]=RP),T},ca=CD();to?((to.exports=ca)._=ca,Tp._=ca):sn._=ca}).call(Pe)})(Pd,Pd.exports);var Iy=Pd.exports;function Qn(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function po(t){return Qn(t)==="object"}function See(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function oO(t,e){return t.length<124?t:e}const Oee="graphql-transport-ws";var cr;(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"})(cr||(cr={}));var Pt;(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"})(Pt||(Pt={}));function jI(t){if(!po(t))throw new Error(`Message is expected to be an object, but got ${Qn(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 ${Qn(t.type)}`);switch(t.type){case Pt.ConnectionInit:case Pt.ConnectionAck:case Pt.Ping:case Pt.Pong:{if(t.payload!=null&&!po(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 Pt.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Qn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!po(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Qn(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 ${Qn(t.payload.query)}`);if(t.payload.variables!=null&&!po(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 ${Qn(t.payload.variables)}`);if(t.payload.operationName!=null&&Qn(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 ${Qn(t.payload.operationName)}`);if(t.payload.extensions!=null&&!po(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 ${Qn(t.payload.extensions)}`);break}case Pt.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Qn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!po(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Qn(t.payload)}`);break}case Pt.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Qn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!See(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 Pt.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Qn(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 kee(t,e){return jI(typeof t=="string"?JSON.parse(t,e):t)}function rc(t,e){return jI(t),JSON.stringify(t,e)}var Pa=function(t){return this instanceof Pa?(this.v=t,this):new Pa(t)},Nee=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 Pa?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 Aee(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(Ae){let fe=1e3;for(let ve=0;ve<Ae;ve++)fe*=2;await new Promise(ve=>setTimeout(ve,fe+Math.floor(Math.random()*2700+300)))},shouldRetry:h=cg,isFatalConnectionProblem:p,on:g,webSocketImpl:y,generateID:b=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Ae=>{const fe=Math.random()*16|0;return(Ae=="x"?fe:fe&3|8).toString(16)})},jsonMessageReplacer:_,jsonMessageReviver:w}=t;let O;if(y){if(!xee(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 ee=(()=>{const fe={};return{on(ve,Se){return fe[ve]=Se,()=>{delete fe[ve]}},emit(ve){var Se;"id"in ve&&((Se=fe[ve.id])===null||Se===void 0||Se.call(fe,ve))}}})(),Ae={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?[ee.emit,g.message]:[ee.emit],closed:g!=null&&g.closed?[g.closed]:[],error:g!=null&&g.error?[g.error]:[]};return{onMessage:ee.on,on(fe,ve){const Se=Ae[fe];return Se.push(ve),()=>{Se.splice(Se.indexOf(ve),1)}},emit(fe,...ve){for(const Se of[...Ae[fe]])Se(...ve)}}})();function P(ee){const Ae=[I.on("error",fe=>{Ae.forEach(ve=>ve()),ee(fe)}),I.on("closed",fe=>{Ae.forEach(ve=>ve()),ee(fe)})]}let M,B=0,Q,x=!1,U=0,Te=!1;async function ke(){clearTimeout(Q);const[ee,Ae]=await(M??(M=new Promise((Se,dt)=>(async()=>{if(x){if(await d(U),!B)return M=void 0,dt({code:1e3,reason:"All Subscriptions Gone"});U++}I.emit("connecting",x);const Ne=new N(typeof e=="function"?await e():e,Oee);let L,te;function X(){isFinite(o)&&o>0&&(clearTimeout(te),te=setTimeout(()=>{Ne.readyState===N.OPEN&&(Ne.send(rc({type:Pt.Ping})),I.emit("ping",!1,void 0))},o))}P(be=>{M=void 0,clearTimeout(L),clearTimeout(te),dt(be),be instanceof aO&&(Ne.close(4499,"Terminated"),Ne.onerror=null,Ne.onclose=null)}),Ne.onerror=be=>I.emit("error",be),Ne.onclose=be=>I.emit("closed",be),Ne.onopen=async()=>{try{I.emit("opened",Ne);const be=typeof n=="function"?await n():n;if(Ne.readyState!==N.OPEN)return;Ne.send(rc(be?{type:Pt.ConnectionInit,payload:be}:{type:Pt.ConnectionInit},_)),isFinite(l)&&l>0&&(L=setTimeout(()=>{Ne.close(cr.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),X()}catch(be){I.emit("error",be),Ne.close(cr.InternalClientError,oO(be instanceof Error?be.message:new Error(be).message,"Internal client error"))}};let ne=!1;Ne.onmessage=({data:be})=>{try{const Re=kee(be,w);if(I.emit("message",Re),Re.type==="ping"||Re.type==="pong"){I.emit(Re.type,!0,Re.payload),Re.type==="pong"?X():a||(Ne.send(rc(Re.payload?{type:Pt.Pong,payload:Re.payload}:{type:Pt.Pong})),I.emit("pong",!1,Re.payload));return}if(ne)return;if(Re.type!==Pt.ConnectionAck)throw new Error(`First message cannot be of type ${Re.type}`);clearTimeout(L),ne=!0,I.emit("connected",Ne,Re.payload,x),x=!1,U=0,Se([Ne,new Promise((Ke,Kt)=>P(Kt))])}catch(Re){Ne.onmessage=null,I.emit("error",Re),Ne.close(cr.BadResponse,oO(Re instanceof Error?Re.message:new Error(Re).message,"Bad response"))}}})())));ee.readyState===N.CLOSING&&await Ae;let fe=()=>{};const ve=new Promise(Se=>fe=Se);return[ee,fe,Promise.race([ve.then(()=>{if(!B){const Se=()=>ee.close(1e3,"Normal Closure");isFinite(s)&&s>0?Q=setTimeout(()=>{ee.readyState===N.OPEN&&Se()},s):Se()}}),Ae])]}function he(ee){if(cg(ee)&&(Iee(ee.code)||[cr.InternalServerError,cr.InternalClientError,cr.BadRequest,cr.BadResponse,cr.Unauthorized,cr.SubprotocolNotAcceptable,cr.SubscriberAlreadyExists,cr.TooManyInitialisationRequests].includes(ee.code)))throw ee;if(Te)return!1;if(cg(ee)&&ee.code===1e3)return B>0;if(!u||U>=u||!h(ee)||p!=null&&p(ee))throw ee;return x=!0}r||(async()=>{for(B++;;)try{const[,,ee]=await ke();await ee}catch(ee){try{if(!he(ee))return}catch(Ae){return i==null?void 0:i(Ae)}}})();function Ce(ee,Ae){const fe=b(ee);let ve=!1,Se=!1,dt=()=>{B--,ve=!0};return(async()=>{for(B++;;)try{const[Ne,L,te]=await ke();if(ve)return L();const X=I.onMessage(fe,ne=>{switch(ne.type){case Pt.Next:{Ae.next(ne.payload);return}case Pt.Error:{Se=!0,ve=!0,Ae.error(ne.payload),dt();return}case Pt.Complete:{ve=!0,dt();return}}});Ne.send(rc({id:fe,type:Pt.Subscribe,payload:ee},_)),dt=()=>{!ve&&Ne.readyState===N.OPEN&&Ne.send(rc({id:fe,type:Pt.Complete},_)),B--,ve=!0,L()},await te.finally(X);return}catch(Ne){if(!he(Ne))return}})().then(()=>{Se||Ae.complete()}).catch(Ne=>{Ae.error(Ne)}),()=>{ve||dt()}}return{on:I.on,subscribe:Ce,iterate(ee){const Ae=[],fe={done:!1,error:null,resolve:()=>{}},ve=Ce(ee,{next(dt){Ae.push(dt),fe.resolve()},error(dt){fe.done=!0,fe.error=dt,fe.resolve()},complete(){fe.done=!0,fe.resolve()}}),Se=function(){return Nee(this,arguments,function*(){for(;;){for(Ae.length||(yield Pa(new Promise(L=>fe.resolve=L)));Ae.length;)yield yield Pa(Ae.shift());if(fe.error)throw fe.error;if(fe.done)return yield Pa(void 0)}})}();return Se.throw=async dt=>(fe.done||(fe.done=!0,fe.error=dt,fe.resolve()),{done:!0,value:void 0}),Se.return=async()=>(ve(),{done:!0,value:void 0}),Se},async dispose(){if(Te=!0,M){const[ee]=await M;ee.close(1e3,"Normal Closure")}},terminate(){M&&I.emit("closed",new aO)}}}class aO extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function cg(t){return po(t)&&"code"in t&&"reason"in t}function Iee(t){return[1e3,1001,1006,1005,1012,1013,1014].includes(t)?!1:t>=1e3&&t<=1999}function xee(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}const Cee=({apiUrl:t,listeners:e})=>{const n=Aee({url:`wss://${t}`,connectionParams:localStorage.getItem("token")?{authorization:`Bearer ${localStorage.getItem("token")}`}:void 0,keepAlive:1e4});return e&&(e.onConnected&&n.on("connected",e.onConnected),e.onClosed&&n.on("closed",e.onClosed),e.onError&&n.on("error",e.onError)),n},lO="api.warrior.well-played.gg/graphql",Dee=({token:t,organizationId:e,invalidationPolicies:n,handlers:r})=>{const i=new Ty.InvalidationPolicyCache({invalidationPolicies:{...n,timeToLive:(n==null?void 0:n.timeToLive)??12e4,renewalPolicy:(n==null?void 0:n.renewalPolicy)??Ty.RenewalPolicy.None}});bee({cache:i,storage:new Tee(window.localStorage)});const s=pb(({query:o})=>{const a=Go(o);return a.kind==="OperationDefinition"&&a.operation==="subscription"},new hz(Cee({apiUrl:lO,listeners:r==null?void 0:r.webSocket})),hb([uz(async()=>({headers:Iy.omitBy({"organization-id":e,authorization:t?`Bearer ${t}`:void 0},Iy.isNil)})),HA(({graphQLErrors:o,networkError:a,operation:l,forward:u})=>{var d;return(d=r==null?void 0:r.onError)==null||d.call(r,{graphQLErrors:o,networkError:a}),u(l)}),new Sh({uri:`https://${lO}`})]));return new Ah({cache:i,link:s,defaultOptions:{watchQuery:{fetchPolicy:"network-only",errorPolicy:"ignore"},query:{fetchPolicy:"network-only",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})},BI=ce.createContext({}),UI=()=>{const t=ce.useContext(BI);if(!t)throw new Error("useWellPlayed must be used within a WellPlayedProvider");return t},Ree=({children:t,clientConfig:e,organizationId:n})=>{const r=cz();return pe.jsx(wA,{client:Dee({token:(r==null?void 0:r.accessToken)??void 0,organizationId:n,...e}),children:pe.jsx(BI.Provider,{value:{organizationId:n},children:t})})},Mee=({children:t,oidcConfig:e,wpAppConfig:n,...r})=>pe.jsx(sz,{...e,configuration:{...n,...e==null?void 0:e.configuration,authority:"https://oauth.warrior.well-played.gg"},children:pe.jsx(Ree,{...r,children:t})}),Pee=(t,e)=>{const{data:n,loading:r,refetch:i,fetchMore:s}=xh(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}}})}}},S0=(t,e)=>{const[n,r]=ce.useState(!(e!=null&&e.skip)),[i,s]=ce.useState([]),[o]=Fb(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 ce.useEffect(()=>{e!=null&&e.skip||a()},[e==null?void 0:e.skip]),{loading:n,results:i,refetch:a}};var Mf={DOCUMENT:"Document",FRAGMENT_DEFINITION:"FragmentDefinition"};class Fee 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 it,ge;function Ft(t){return new Fee(`Syntax Error: Unexpected token at ${ge} in ${t}`)}function dr(t){if(t.lastIndex=ge,t.test(it))return it.slice(ge,ge=t.lastIndex)}var Pf=/ +(?=[^\s])/y;function $ee(t){for(var e=t.split(`
252
+ `),n="",r=0,i=0,s=e.length-1,o=0;o<e.length;o++)Pf.lastIndex=0,Pf.test(e[o])&&(o&&(!r||Pf.lastIndex<r)&&(r=Pf.lastIndex),i=i||o,s=o);for(var a=i;a<=s;a++)a!==i&&(n+=`
253
+ `),n+=e[a].slice(r).replace(/\\"""/g,'"""');return n}function Fe(){for(var t=0|it.charCodeAt(ge++);t===9||t===10||t===13||t===32||t===35||t===44||t===65279;t=0|it.charCodeAt(ge++))if(t===35)for(;(t=it.charCodeAt(ge++))!==10&&t!==13;);ge--}var Mn=/[_A-Za-z]\w*/y,ug=new RegExp("(?:(null|true|false)|\\$("+Mn.source+')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|('+Mn.source+"))","y"),gs=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}(gs||{}),Lee=/\\/;function Fd(t){var e,n;if(ug.lastIndex=ge,it.charCodeAt(ge)===91){ge++,Fe();for(var r=[];it.charCodeAt(ge)!==93;)r.push(Fd(t));return ge++,Fe(),{kind:"ListValue",values:r}}else if(it.charCodeAt(ge)===123){ge++,Fe();for(var i=[];it.charCodeAt(ge)!==125;){if((e=dr(Mn))==null||(Fe(),it.charCodeAt(ge++)!==58))throw Ft("ObjectField");Fe(),i.push({kind:"ObjectField",name:{kind:"Name",value:e},value:Fd(t)})}return ge++,Fe(),{kind:"ObjectValue",fields:i}}else if((n=ug.exec(it))!=null){if(ge=ug.lastIndex,Fe(),(e=n[gs.Const])!=null)return e==="null"?{kind:"NullValue"}:{kind:"BooleanValue",value:e==="true"};if((e=n[gs.Var])!=null){if(t)throw Ft("Variable");return{kind:"Variable",name:{kind:"Name",value:e}}}else if((e=n[gs.Int])!=null){var s;return(s=n[gs.Float])!=null?{kind:"FloatValue",value:e+s}:{kind:"IntValue",value:e}}else{if((e=n[gs.BlockString])!=null)return{kind:"StringValue",value:$ee(e.slice(3,-3)),block:!0};if((e=n[gs.String])!=null)return{kind:"StringValue",value:Lee.test(e)?JSON.parse(e):e.slice(1,-1),block:!1};if((e=n[gs.Enum])!=null)return{kind:"EnumValue",value:e}}}throw Ft("Value")}function WI(t){if(it.charCodeAt(ge)===40){var e=[];ge++,Fe();var n;do{if((n=dr(Mn))==null||(Fe(),it.charCodeAt(ge++)!==58))throw Ft("Argument");Fe(),e.push({kind:"Argument",name:{kind:"Name",value:n},value:Fd(t)})}while(it.charCodeAt(ge)!==41);return ge++,Fe(),e}}function Fa(t){if(it.charCodeAt(ge)===64){var e=[],n;do{if(ge++,(n=dr(Mn))==null)throw Ft("Directive");Fe(),e.push({kind:"Directive",name:{kind:"Name",value:n},arguments:WI(t)})}while(it.charCodeAt(ge)===64);return e}}function Vee(){for(var t,e=0;it.charCodeAt(ge)===91;)e++,ge++,Fe();if((t=dr(Mn))==null)throw Ft("NamedType");Fe();var n={kind:"NamedType",name:{kind:"Name",value:t}};do if(it.charCodeAt(ge)===33&&(ge++,Fe(),n={kind:"NonNullType",type:n}),e){if(it.charCodeAt(ge++)!==93)throw Ft("NamedType");Fe(),n={kind:"ListType",type:n}}while(e--);return n}var fg=new RegExp("(?:(\\.{3})|("+Mn.source+"))","y"),xy=function(t){return t[t.Spread=1]="Spread",t[t.Name=2]="Name",t}(xy||{});function $d(){var t=[],e,n;do if(fg.lastIndex=ge,(n=fg.exec(it))!=null){if(ge=fg.lastIndex,n[xy.Spread]!=null){Fe();var r=dr(Mn);if(r!=null&&r!=="on")Fe(),t.push({kind:"FragmentSpread",name:{kind:"Name",value:r},directives:Fa(!1)});else{if(Fe(),r==="on"){if((r=dr(Mn))==null)throw Ft("NamedType");Fe()}var i=Fa(!1);if(it.charCodeAt(ge++)!==123)throw Ft("InlineFragment");Fe(),t.push({kind:"InlineFragment",typeCondition:r?{kind:"NamedType",name:{kind:"Name",value:r}}:void 0,directives:i,selectionSet:$d()})}}else if((e=n[xy.Name])!=null){var s=void 0;if(Fe(),it.charCodeAt(ge)===58){if(ge++,Fe(),s=e,(e=dr(Mn))==null)throw Ft("Field");Fe()}var o=WI(!1);Fe();var a=Fa(!1),l=void 0;it.charCodeAt(ge)===123&&(ge++,Fe(),l=$d()),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 Ft("SelectionSet");while(it.charCodeAt(ge)!==125);return ge++,Fe(),{kind:"SelectionSet",selections:t}}function jee(){var t,e;if((t=dr(Mn))==null||(Fe(),dr(Mn)!=="on")||(Fe(),(e=dr(Mn))==null))throw Ft("FragmentDefinition");Fe();var n=Fa(!1);if(it.charCodeAt(ge++)!==123)throw Ft("FragmentDefinition");return Fe(),{kind:"FragmentDefinition",name:{kind:"Name",value:t},typeCondition:{kind:"NamedType",name:{kind:"Name",value:e}},directives:n,selectionSet:$d()}}var Bee=/(?:query|mutation|subscription|fragment)/y;function Uee(t){var e,n,r;if(t&&(Fe(),e=dr(Mn),n=function(){if(Fe(),it.charCodeAt(ge)===40){var s=[];ge++,Fe();var o;do{if(it.charCodeAt(ge++)!==36||(o=dr(Mn))==null)throw Ft("Variable");if(Fe(),it.charCodeAt(ge++)!==58)throw Ft("VariableDefinition");Fe();var a=Vee(),l=void 0;it.charCodeAt(ge)===61&&(ge++,Fe(),l=Fd(!0)),Fe(),s.push({kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:o}},type:a,defaultValue:l,directives:Fa(!0)})}while(it.charCodeAt(ge)!==41);return ge++,Fe(),s}}(),r=Fa(!1)),it.charCodeAt(ge)===123)return ge++,Fe(),{kind:"OperationDefinition",operation:t||"query",name:e?{kind:"Name",value:e}:void 0,variableDefinitions:n,directives:r,selectionSet:$d()}}function Wee(t,e){return ge=0,function(r,i){var s,o;Fe();var a=[];do if((s=dr(Bee))==="fragment")Fe(),a.push(jee());else if((o=Uee(s))!=null)a.push(o);else throw Ft("Document");while(ge<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}}}}(it=typeof t.body=="string"?t.body:t)}var cO=0,dg=new Set;function qI(){function t(e,n){var r=Wee(e).definitions,i=new Set;for(var s of n||[])for(var o of s.definitions)o.kind===Mf.FRAGMENT_DEFINITION&&!i.has(o)&&(r.push(o),i.add(o));var a;(a=r[0].kind===Mf.FRAGMENT_DEFINITION)&&r[0].directives&&(r[0].directives=r[0].directives.filter(u=>u.name.value!=="_unmask"));var l;return{kind:Mf.DOCUMENT,definitions:r,get loc(){if(!l&&a){var u=e+function(h){try{cO++;var p="";for(var g of h)if(!dg.has(g)){dg.add(g);var{loc:y}=g;y&&(p+=y.source.body)}return p}finally{--cO==0&&dg.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:Mf.DOCUMENT,definitions:r?r.definitions:[],documentId:n}},t}function qee(...t){return t.length===2?t[1]:t[0]}qI();const yl=qI(),zee=yl(`
254
+ query organization($id: ID!) {
255
+ organization(id: $id) {
256
+ id
257
+ identityProviders(login: true) {
258
+ name
259
+ id
260
+ }
261
+ }
262
+ }
263
+ `),zI=()=>{const{organizationId:t}=UI(),{loading:e,error:n,data:r}=xh(zee,{variables:{id:t}});return{loading:e,error:n,data:r}},Qee=yl(`
264
+ query players(
265
+ $ids: [ID!]!
266
+ $page: PageInfo!
267
+ ) {
268
+ players(
269
+ ids: $ids
270
+ page: $page
271
+ ) {
272
+ nodes {
273
+ id
274
+ username
275
+ ownerId
276
+ customFields {
277
+ property
278
+ value
279
+ }
280
+ identities {
281
+ properties {
282
+ property
283
+ value
284
+ }
285
+ }
286
+ }
287
+ }
288
+ }
289
+ `),QI=({playerIds:t,skip:e})=>{const{loading:n,data:r}=zI(),[i,s]=ce.useState([]),[o,a]=ce.useState(!e),[l]=Fb(Qee),u=async d=>{var p,g;const h=[];for(;d.length>0;)h.push(...((g=(p=(await l({variables:{page:{first:100},ids:d.splice(0,100)}})).data)==null?void 0:p.players)==null?void 0:g.nodes)??[]);s(h)};return ce.useEffect(()=>{!e&&t&&r&&(a(!0),u(t).finally(()=>a(!1)))},[e,t,r]),{results:i,refetch:u,loading:o||n}},Gee=yl(`
290
+ query tournamentTeam(
291
+ $tournamentId: ID!
292
+ $page: PageInfo!
293
+ $status: TournamentTeamStatus
294
+ ) {
295
+ tournamentTeams(
296
+ tournamentId: $tournamentId
297
+ page: $page
298
+ memberStatus: ACCEPTED
299
+ status: $status
300
+ ) {
301
+ pageInfo {
302
+ endCursor
303
+ hasNextPage
304
+ }
305
+ nodes {
306
+ id
307
+ name
308
+ status
309
+ members {
310
+ status
311
+ playerProfileId
312
+ }
313
+ }
314
+ }
315
+ }
316
+ `),GI=({tournamentId:t,skip:e,status:n})=>{const[r,i]=ce.useState([]),{loading:s,results:o}=S0(Gee,{variables:{tournamentId:t,status:n},onResults:async u=>{i(u.flatMap(d=>d.members).map(d=>d.playerProfileId))},skip:e}),{loading:a,results:l}=QI({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)}))}))||[]}},Hee=yl(`
317
+ query tournamentStepGeneratedShape($stepId: ID!) {
318
+ tournamentStepGeneratedShape(stepId: $stepId) {
319
+ id
320
+ name
321
+ rounds {
322
+ id
323
+ name
324
+ order
325
+ games {
326
+ id
327
+ order
328
+ matches {
329
+ id
330
+ order
331
+ status
332
+ }
333
+ }
334
+ }
335
+ }
336
+ }
337
+ `),Kee=yl(`
338
+ query tournamentStepGroupRoundGameMatchScoresGetForStep($stepId: ID!, $page: PageInfo!) {
339
+ tournamentStepGroupRoundGameMatchScoresGetForStep(
340
+ stepId: $stepId
341
+ page: $page
342
+ ) {
343
+ pageInfo {
344
+ endCursor
345
+ hasNextPage
346
+ }
347
+ nodes {
348
+ teamId
349
+ status
350
+ score
351
+ matchId
352
+ }
353
+ }
354
+ }
355
+ `),Jee=({tournamentId:t,stepId:e,skip:n})=>{const{loading:r,data:i}=xh(Hee,{variables:{stepId:e},skip:n}),{loading:s,results:o}=S0(Kee,{skip:n,variables:{stepId:e}}),{loading:a,results:l}=GI({tournamentId:t,skip:n,status:"CONFIRMED"});return{loading:r||s||a,groups:i==null?void 0:i.tournamentStepGeneratedShape.map(u=>{const d=Iy.cloneDeep(u),h=l.reduce((g,y)=>(g[y.id]=y,g),{}),p={};for(const g of o){const y=h[g.teamId];if(!y){console.warn(`No team for score ${g.teamId}, match ${g.matchId}`);continue}const b=p[g.matchId]??[];p[g.matchId]=b.concat({...y,score:g.score})}for(const g of d.rounds)for(const y of g.games)for(const b of y.matches)b.teamScores=p[b.id]??[];return d})}};function cn(t){this.content=t}cn.prototype={constructor:cn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new cn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new cn(n)},addToStart:function(t,e){return new cn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new cn(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new cn(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=cn.from(t),t.size?new cn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=cn.from(t),t.size?new cn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=cn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};cn.from=function(t){if(t instanceof cn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new cn(e)};function HI(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=HI(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function KI(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let u=0,d=Math.min(o.text.length,a.text.length);for(;u<d&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let u=KI(o.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class Y{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,a=0;a<n;o++){let l=this.content[o],u=a+l.nodeSize;if(u>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,i+d)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new Y(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new Y(r,i)}cutByIndex(e,n){return e==n?Y.empty:e==0&&n==this.content.length?this:new Y(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Y(i,s)}addToStart(e){return new Y([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Y(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return HI(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return KI(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ff(0,e);if(e==this.size)return Ff(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let s=this.child(r),o=i+s.nodeSize;if(o>=e)return o==e||n>0?Ff(r+1,o):Ff(r,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Y.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Y(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Y.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new Y(n||e,r)}static from(e){if(!e)return Y.empty;if(e instanceof Y)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Y([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Y.empty=new Y([],0);const hg={index:0,offset:0};function Ff(t,e){return hg.index=t,hg.offset=e,hg}function Ld(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Ld(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ld(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let pt=class Cy{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ld(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Cy.none;if(e instanceof Cy)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};pt.none=[];class Vd extends Error{}class se{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=YI(this.content,e+this.openStart,n);return r&&new se(r,this.openStart,this.openEnd)}removeBetween(e,n){return new se(JI(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return se.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new se(Y.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new se(e,r,i)}}se.empty=new se(Y.empty,0,0);function JI(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(JI(s.content,e-i-1,n-i-1)))}function YI(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),o=t.maybeChild(i);if(s==e||o.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=YI(o.content,e-s-1,n);return a&&t.replaceChild(i,o.copy(a))}function Yee(t,e,n){if(n.openStart>t.depth)throw new Vd("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Vd("Inconsistent open depths");return XI(t,e,n,0)}function XI(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=XI(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return No(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=Xee(n,t);return No(s,ex(t,o,a,e,r))}else return No(s,jd(t,e,r))}function ZI(t,e){if(!e.type.compatibleContent(t.type))throw new Vd("Cannot join "+e.type.name+" onto "+t.type.name)}function Dy(t,e,n){let r=t.node(n);return ZI(r,e.node(n)),r}function ko(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function _c(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(ko(t.nodeAfter,r),s++));for(let a=s;a<o;a++)ko(i.child(a),r);e&&e.depth==n&&e.textOffset&&ko(e.nodeBefore,r)}function No(t,e){return t.type.checkContent(e),t.copy(e)}function ex(t,e,n,r,i){let s=t.depth>i&&Dy(t,e,i+1),o=r.depth>i&&Dy(n,r,i+1),a=[];return _c(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(ZI(s,o),ko(No(s,ex(t,e,n,r,i+1)),a)):(s&&ko(No(s,jd(t,e,i+1)),a),_c(e,n,i,a),o&&ko(No(o,jd(n,r,i+1)),a)),_c(r,null,i,a),new Y(a)}function jd(t,e,n){let r=[];if(_c(null,t,n,r),t.depth>n){let i=Dy(t,e,n+1);ko(No(i,jd(t,e,n+1)),r)}return _c(e,null,n,r),new Y(r)}function Xee(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(Y.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Bc{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return pt.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Bd(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),u=s-l;if(r.push(o,a,i+l),!u||(o=o.child(a),o.isText))break;s=u-1,i+=l+1}return new Bc(n,r,s)}static resolveCached(e,n){let r=uO.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else uO.set(e,r=new Zee);let i=r.elts[r.i]=Bc.resolve(e,n);return r.i=(r.i+1)%ete,i}}class Zee{constructor(){this.elts=[],this.i=0}}const ete=12,uO=new WeakMap;class Bd{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const tte=Object.create(null);let Ao=class Ry{constructor(e,n,r,i=pt.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||Y.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Ld(this.attrs,n||e.defaultAttrs||tte)&&pt.sameSet(this.marks,r||pt.none)}copy(e=null){return e==this.content?this:new Ry(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ry(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return se.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),a=i.start(o),u=i.node(o).content.cut(i.pos-a,s.pos-a);return new se(u,i.depth-o,s.depth-o)}replace(e,n,r){return Yee(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Bc.resolveCached(this,e)}resolveNoCache(e){return Bc.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),tx(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Y.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=pt.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!pt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=Y.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Ao.prototype.text=void 0;class Ud extends Ao{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):tx(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ud(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ud(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function tx(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Lo{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new nte(e,n);if(r.next==null)return Lo.empty;let i=nx(r);r.next&&r.err("Unexpected trailing text");let s=cte(lte(i));return ute(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return Y.from(a.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:d,next:h}=o.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let p=s(h,a.concat(d));if(p)return p}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
356
+ `)}}Lo.empty=new Lo(!0);class nte{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function nx(t){let e=[];do e.push(rte(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function rte(t){let e=[];do e.push(ite(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function ite(t){let e=ate(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=ste(t,e);else break;return e}function fO(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function ste(t,e){let n=fO(t),r=n;return t.eat(",")&&(t.next!="}"?r=fO(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function ote(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function ate(t){if(t.eat("(")){let e=nx(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=ote(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function lte(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let u={term:l,to:a};return e[o].push(u),u}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(s(u,a)),[]);if(o.type=="seq")for(let l=0;;l++){let u=s(o.exprs[l],a);if(l==o.exprs.length-1)return u;i(u,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let u=0;u<o.min;u++){let d=n();i(s(o.expr,l),d),l=d}if(o.max==-1)i(s(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let d=n();r(l,d),i(s(o.expr,l),d),l=d}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function rx(t,e){return e-t}function dO(t,e){let n=[];return r(e),n.sort(rx);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&n.indexOf(l)==-1&&r(l)}}}function cte(t){let e=Object.create(null);return n(dO(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let d=0;d<i.length;d++)i[d][0]==a&&(u=i[d][1]);dO(t,l).forEach(d=>{u||i.push([a,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let s=e[r.join(",")]=new Lo(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(rx);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function ute(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:u}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(u)==-1&&r.push(u)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ix(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function sx(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function ox(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function ax(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new dte(t,r,e[r]);return n}let hO=class lx{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ax(e,r.attrs),this.defaultAttrs=ix(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Lo.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:sx(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ao(this,this.computeAttrs(e),Y.from(n),pt.setFrom(r))}createChecked(e=null,n,r){return n=Y.from(n),this.checkContent(n),new Ao(this,this.computeAttrs(e),n,pt.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=Y.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(Y.empty,!0);return s?new Ao(this,e,n.append(s),pt.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){ox(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:pt.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new lx(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function fte(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class dte{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?fte(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Kh{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=ax(e,i.attrs),this.excluded=null;let s=ix(this.attrs);this.instance=s?new pt(this,s):null}create(e=null){return!e&&this.instance?this.instance:new pt(this,sx(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Kh(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){ox(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class cx{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=cn.from(e.nodes),n.marks=cn.from(e.marks||{}),this.nodes=hO.compile(this.spec.nodes,this),this.marks=Kh.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=Lo.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?pO(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:pO(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof hO){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Ud(r,r.defaultAttrs,e,pt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Ao.fromJSON(this,e)}markFromJSON(e){return pt.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function pO(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function hte(t){return t.tag!=null}function pte(t){return t.style!=null}class Ds{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(hte(i))this.tags.push(i);else if(pte(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new gO(this,n,!1);return r.addAll(e,pt.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new gO(this,n,!0);return r.addAll(e,pt.none,n.from,n.to),se.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(yte(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=yO(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=yO(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ds(e,Ds.schemaRules(e)))}}const ux={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},mte={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},fx={ol:!0,ul:!0},Wd=1,qd=2,Ec=4;function mO(t,e,n){return e!=null?(e?Wd:0)|(e==="full"?qd:0):t&&t.whitespace=="pre"?Wd|qd:n&~Ec}class $f{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=pt.none,this.match=s||(o&Ec?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Y.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Wd)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=Y.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Y.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ux.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class gO{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,s,o=mO(null,n.preserveWhitespace,0)|(r?Ec:0);i?s=new $f(i.type,i.attrs,pt.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new $f(null,null,pt.none,!0,null,o):s=new $f(e.schema.topNodeType,null,pt.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top;if(i.options&qd||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i.options&Wd)i.options&qd?r=r.replace(/\r\n?/g,`
357
+ `):r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],o=e.previousSibling;(!s||o&&o.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=e.nodeName.toLowerCase(),s;fx.hasOwnProperty(i)&&this.parser.normalizeLists&&gte(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,r));if(o?o.ignore:mte.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,n);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let a,l=this.top,u=this.needsBlock;if(ux.hasOwnProperty(i))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),a=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);return}let d=o&&o.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),a&&this.sync(l),this.needsBlock=u}else{let a=this.readStyles(e,n);a&&this.addElementByRule(e,o,a,o.consuming===!1?s:void 0)}}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
358
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n){let r,i;for(let s=this.open;s>=0;s--){let o=this.nodes[s],a=o.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,i=o,!a.length)||o.solid)break}if(!r)return null;this.sync(i);for(let s=0;s<r.length;s++)n=this.enterInner(r[s],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=pt.none;for(let o of r.concat(e.marks))(i.type?i.type.allowsMarkType(o.type):vO(o.type,e.type))&&(s=o.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=mO(e,s,o.options);o.options&Ec&&o.content.length==0&&(a|=Ec);let l=pt.none;return r=r.filter(u=>(o.type?o.type.allowsMarkType(u.type):vO(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new $f(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;l--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function gte(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&fx.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function yte(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function yO(t){let e={};for(let n in t)e[n]=t[n];return e}function vO(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:d}=a.edge(l);if(u==e||s.indexOf(d)<0&&o(d))return!0}};if(o(i.contentMatch))return!0}}class Xo{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=pg(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(s[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],d=this.serializeMark(u,o.isInline,n);d&&(s.push([u,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=nd(pg(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&nd(pg(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return nd(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Xo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=bO(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return bO(e.marks)}}function bO(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function pg(t){return t.document||window.document}const _O=new WeakMap;function vte(t){let e=_O.get(t);return e===void 0&&_O.set(t,e=bte(t)),e}function bte(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function nd(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=vte(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),u=e[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let h in u)if(u[h]!=null){let p=h.indexOf(" ");p>0?l.setAttributeNS(h.slice(0,p),h.slice(p+1),u[h]):l.setAttribute(h,u[h])}}for(let h=d;h<e.length;h++){let p=e[h];if(p===0){if(h<e.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:g,contentDOM:y}=nd(t,p,n,r);if(l.appendChild(g),y){if(a)throw new RangeError("Multiple content holes");a=y}}}return{dom:l,contentDOM:a}}const dx=65535,hx=Math.pow(2,16);function _te(t,e){return t+e*hx}function EO(t){return t&dx}function Ete(t){return(t-(t&dx))/hx}const px=1,mx=2,rd=4,gx=8;class My{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&gx)>0}get deletedBefore(){return(this.delInfo&(px|rd))>0}get deletedAfter(){return(this.delInfo&(mx|rd))>0}get deletedAcross(){return(this.delInfo&rd)>0}}class ur{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&ur.empty)return ur.empty}recover(e){let n=0,r=EO(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Ete(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+s],d=this.ranges[a+o],h=l+u;if(e<=h){let p=u?e==l?-1:e==h?1:n:n,g=l+i+(p<0?0:d);if(r)return g;let y=e==(n<0?l:h)?null:_te(a/3,e-l),b=e==l?mx:e==h?px:rd;return(n<0?e!=l:e!=h)&&(b|=gx),new My(g,b,y)}i+=d-u}return r?e+i:new My(e+i,0,null)}touches(e,n){let r=0,i=EO(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+s],d=l+u;if(e<=d&&a==i*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),u=this.ranges[i+n],d=this.ranges[i+r];e(a,a+u,l,l+d),s+=d-u}}invert(){return new ur(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ur.empty:new ur(e<0?[0,-e,0]:[0,0,e])}}ur.empty=new ur([]);class $a{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new $a(this.maps,this.mirror,e,n)}copy(){return new $a(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new $a;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this.maps[s],a=o.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this.maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new My(e,i,null)}}const mg=Object.create(null);class On{getMap(){return ur.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=mg[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in mg)throw new RangeError("Duplicate use of step JSON ID "+e);return mg[e]=n,n.prototype.jsonID=e,n}}class Vt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Vt(e,null)}static fail(e){return new Vt(null,e)}static fromReplace(e,n,r,i){try{return Vt.ok(e.replace(n,r,i))}catch(s){if(s instanceof Vd)return Vt.fail(s.message);throw s}}}function O0(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(O0(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return Y.fromArray(r)}class As extends On{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new se(O0(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return Vt.fromReplace(e,this.from,this.to,s)}invert(){return new pi(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new As(n.pos,r.pos,this.mark)}merge(e){return e instanceof As&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new As(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new As(n.from,n.to,e.markFromJSON(n.mark))}}On.jsonID("addMark",As);class pi extends On{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new se(O0(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Vt.fromReplace(e,this.from,this.to,r)}invert(){return new As(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new pi(n.pos,r.pos,this.mark)}merge(e){return e instanceof pi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new pi(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new pi(n.from,n.to,e.markFromJSON(n.mark))}}On.jsonID("removeMark",pi);class Is extends On{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Vt.fromReplace(e,this.pos,this.pos+1,new se(Y.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Is(this.pos,n.marks[i]);return new Is(this.pos,this.mark)}}return new Xa(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Is(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Is(n.pos,e.markFromJSON(n.mark))}}On.jsonID("addNodeMark",Is);class Xa extends On{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Vt.fromReplace(e,this.pos,this.pos+1,new se(Y.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Is(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Xa(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Xa(n.pos,e.markFromJSON(n.mark))}}On.jsonID("removeNodeMark",Xa);class Xt extends On{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Py(e,this.from,this.to)?Vt.fail("Structure replace would overwrite content"):Vt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ur([this.from,this.to-this.from,this.slice.size])}invert(e){return new Xt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Xt(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Xt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?se.empty:new se(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Xt(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?se.empty:new se(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Xt(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Xt(n.from,n.to,se.fromJSON(e,n.slice),!!n.structure)}}On.jsonID("replace",Xt);class Zt extends On{constructor(e,n,r,i,s,o,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(Py(e,this.from,this.gapFrom)||Py(e,this.gapTo,this.to)))return Vt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Vt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Vt.fromReplace(e,this.from,this.to,r):Vt.fail("Content does not fit in gap")}getMap(){return new ur([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Zt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new Zt(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Zt(n.from,n.to,n.gapFrom,n.gapTo,se.fromJSON(e,n.slice),n.insert,!!n.structure)}}On.jsonID("replaceAround",Zt);function Py(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function wte(t,e,n,r){let i=[],s=[],o,a;t.doc.nodesBetween(e,n,(l,u,d)=>{if(!l.isInline)return;let h=l.marks;if(!r.isInSet(h)&&d.type.allowsMarkType(r.type)){let p=Math.max(u,e),g=Math.min(u+l.nodeSize,n),y=r.addToSet(h);for(let b=0;b<h.length;b++)h[b].isInSet(y)||(o&&o.to==p&&o.mark.eq(h[b])?o.to=g:i.push(o=new pi(p,g,h[b])));a&&a.to==p?a.to=g:s.push(a=new As(p,g,r))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function Tte(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof Kh){let u=o.marks,d;for(;d=r.isInSet(u);)(l||(l=[])).push(d),u=d.removeFromSet(u)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let u=Math.min(a+o.nodeSize,n);for(let d=0;d<l.length;d++){let h=l[d],p;for(let g=0;g<i.length;g++){let y=i[g];y.step==s-1&&h.eq(i[g].style)&&(p=y)}p?(p.to=u,p.step=s):i.push({style:h,from:Math.max(a,e),to:u,step:s})}}}),i.forEach(o=>t.step(new pi(o.from,o.to,o.style)))}function k0(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let u=s.child(l),d=a+u.nodeSize,h=r.matchType(u.type);if(!h)o.push(new Xt(a,d,se.empty));else{r=h;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||t.step(new pi(a,d,u.marks[p]));if(i&&u.isText&&n.whitespace!="pre"){let p,g=/\r?\n|\r/g,y;for(;p=g.exec(u.text);)y||(y=new se(Y.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new Xt(a+p.index,a+p.index+p[0].length,y))}}a=d}if(!r.validEnd){let l=r.fillBefore(Y.empty,!0);t.replace(a,a,new se(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function Ste(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function vl(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),s=t.$from.index(r),o=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(s,o,n))return r;if(r==0||i.type.spec.isolating||!Ste(i,s,o))break}return null}function Ote(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,u=a,d=Y.empty,h=0;for(let y=s,b=!1;y>n;y--)b||r.index(y)>0?(b=!0,d=Y.from(r.node(y).copy(d)),h++):l--;let p=Y.empty,g=0;for(let y=s,b=!1;y>n;y--)b||i.after(y+1)<i.end(y)?(b=!0,p=Y.from(i.node(y).copy(p)),g++):u++;t.step(new Zt(l,u,o,a,new se(d.append(p),h,g),d.size-h,!0))}function N0(t,e,n=null,r=t){let i=kte(t,e),s=i&&Nte(r,e);return s?i.map(wO).concat({type:e,attrs:n}).concat(s.map(wO)):null}function wO(t){return{type:t,attrs:null}}function kte(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function Nte(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=r;l&&u<i;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:o}function Ate(t,e,n){let r=Y.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Y.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new Zt(i,s,i,s,new se(r,0,0),n.length,!0))}function Ite(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&xte(t.doc,t.mapping.slice(s).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let g=r.whitespace=="pre",y=!!r.contentMatch.matchType(r.schema.linebreakReplacement);g&&!y?u=!1:!g&&y&&(u=!0)}u===!1&&vx(t,o,a,s),k0(t,t.mapping.slice(s).map(a,1),r,void 0,u===null);let d=t.mapping.slice(s),h=d.map(a,1),p=d.map(a+o.nodeSize,1);return t.step(new Zt(h,p,h+1,p-1,new se(Y.from(r.create(l,null,o.marks)),0,0),1,!0)),u===!0&&yx(t,o,a,s),!1}})}function yx(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function vx(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
359
+ `))}})}function xte(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Cte(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Zt(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new se(Y.from(o),0,0),1,!0))}function Wi(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,d=n-2;u>s;u--,d--){let h=i.node(u),p=i.index(u);if(h.type.spec.isolating)return!1;let g=h.content.cutByIndex(p,h.childCount),y=r&&r[d+1];y&&(g=g.replaceChild(0,y.type.create(y.attrs)));let b=r&&r[d]||h;if(!h.canReplace(p+1,h.childCount)||!b.type.validContent(g))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function Dte(t,e,n=1,r){let i=t.doc.resolve(e),s=Y.empty,o=Y.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){s=Y.from(i.node(a).copy(s));let d=r&&r[u];o=Y.from(d?d.type.create(d.attrs,o):i.node(a).copy(o))}t.step(new Xt(e,e,new se(s.append(o),n,n),!0))}function Ks(t,e){let n=t.resolve(e),r=n.index();return bx(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Rte(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function bx(t,e){return!!(t&&e&&!t.isLeaf&&Rte(t,e))}function Jh(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,o,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):n>0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&bx(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function Mte(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),o=s.node().type;if(i&&o.inlineContent){let d=o.whitespace=="pre",h=!!o.contentMatch.matchType(i);d&&!h?r=!1:!d&&h&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);vx(t,d.node(),d.before(),a)}o.inlineContent&&k0(t,e+n-1,o,s.node().contentMatchAt(s.index()),r==null);let l=t.mapping.slice(a),u=l.map(e-n);if(t.step(new Xt(u,l.map(e+n,-1),se.empty,!0)),r===!0){let d=t.doc.resolve(u);yx(t,d.node(),d.before(),t.steps.length)}return t}function Pte(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function _x(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),u=r.node(o),d=!1;if(s==1)d=u.canReplace(l,l,i);else{let h=u.contentMatchAt(l).findWrapping(i.firstChild.type);d=h&&u.canReplaceWith(l,l,h[0])}if(d)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function Yh(t,e,n=e,r=se.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return Ex(i,s,r)?new Xt(e,n,r):new Fte(i,s,r).fit()}function Ex(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Fte{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Y.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=Y.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new se(s,o,a);return e>-1?new Zt(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Xt(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=gg(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],d,h=null;if(n==1&&(o?u.matchType(o.type)||(h=u.fillBefore(Y.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:h};if(n==2&&o&&(d=u.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:d};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=gg(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new se(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=gg(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new se(lc(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new se(lc(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let b=0;b<s.length;b++)this.openFrontierNode(s[b]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,u=0,d=[],{match:h,type:p}=this.frontier[n];if(i){for(let b=0;b<i.childCount;b++)d.push(i.child(b));h=h.matchFragment(i)}let g=a.size+e-(o.content.size-o.openEnd);for(;u<a.childCount;){let b=a.child(u),_=h.matchType(b.type);if(!_)break;u++,(u>1||l==0||b.content.size)&&(h=_,d.push(wx(b.mark(p.allowedMarks(b.marks)),u==1?l:0,u==a.childCount?g:-1)))}let y=u==a.childCount;y||(g=-1),this.placed=cc(this.placed,n,Y.from(d)),this.frontier[n].match=h,y&&g<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,_=a;b<g;b++){let w=_.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),_=w.content}this.unplaced=y?e==0?se.empty:new se(lc(o.content,e-1,1),e-1,g<0?o.openEnd:e-1):new se(lc(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!yg(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=yg(e,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],d=yg(e,a,u,l,!0);if(!d||d.childCount)continue e}return{depth:n,fit:o,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=cc(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=cc(this.placed,this.depth,Y.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Y.empty,!0);n.childCount&&(this.placed=cc(this.placed,this.frontier.length,n))}}function lc(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(lc(t.firstChild.content,e-1,n)))}function cc(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(cc(t.lastChild.content,e-1,n)))}function gg(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function wx(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,wx(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(Y.empty,!0)))),t.copy(r)}function yg(t,e,n,r,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!$te(n,s.content,o)?a:null}function $te(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function Lte(t){return t.spec.defining||t.spec.definingForContent}function Vte(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(Ex(i,s,r))return t.step(new Xt(e,n,r));let o=Sx(i,t.doc.resolve(n));o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let p=i.depth,g=i.pos-1;p>0;p--,g--){let y=i.node(p).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;o.indexOf(p)>-1?a=p:i.before(p)==g&&o.splice(1,0,-p)}let l=o.indexOf(a),u=[],d=r.openStart;for(let p=r.content,g=0;;g++){let y=p.firstChild;if(u.push(y),g==r.openStart)break;p=y.content}for(let p=d-1;p>=0;p--){let g=u[p],y=Lte(g.type);if(y&&!g.sameMarkup(i.node(Math.abs(a)-1)))d=p;else if(y||!g.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let g=(p+d+1)%(r.openStart+1),y=u[g];if(y)for(let b=0;b<o.length;b++){let _=o[(b+l)%o.length],w=!0;_<0&&(w=!1,_=-_);let O=i.node(_-1),N=i.index(_-1);if(O.canReplaceWith(N,N,y.type,y.marks))return t.replace(i.before(_),w?s.after(_):n,new se(Tx(r.content,0,r.openStart,g),g,r.openEnd))}}let h=t.steps.length;for(let p=o.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>h));p--){let g=o[p];g<0||(e=i.before(g),n=s.after(g))}}function Tx(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(Tx(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(Y.empty,!0))}return t}function jte(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=Pte(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new se(Y.from(r),0,0))}function Bte(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),s=Sx(r,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function Sx(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class La extends On{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Vt.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Vt.fromReplace(e,this.pos,this.pos+1,new se(Y.from(i),0,n.isLeaf?0:1))}getMap(){return ur.empty}invert(e){return new La(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new La(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new La(n.pos,n.attr,n.value)}}On.jsonID("attr",La);class Uc extends On{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Vt.ok(r)}getMap(){return ur.empty}invert(e){return new Uc(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Uc(n.attr,n.value)}}On.jsonID("docAttr",Uc);let Za=class extends Error{};Za=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Za.prototype=Object.create(Error.prototype);Za.prototype.constructor=Za;Za.prototype.name="TransformError";class Ute{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new $a}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Za(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=se.empty){let i=Yh(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new se(Y.from(r),0,0))}delete(e,n){return this.replace(e,n,se.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Vte(this,e,n,r),this}replaceRangeWith(e,n,r){return jte(this,e,n,r),this}deleteRange(e,n){return Bte(this,e,n),this}lift(e,n){return Ote(this,e,n),this}join(e,n=1){return Mte(this,e,n),this}wrap(e,n){return Ate(this,e,n),this}setBlockType(e,n=e,r,i=null){return Ite(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return Cte(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new La(e,n,r)),this}setDocAttribute(e,n){return this.step(new Uc(e,n)),this}addNodeMark(e,n){return this.step(new Is(e,n)),this}removeNodeMark(e,n){if(!(n instanceof pt)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Xa(e,n)),this}split(e,n=1,r){return Dte(this,e,n,r),this}addMark(e,n,r){return wte(this,e,n,r),this}removeMark(e,n,r){return Tte(this,e,n,r),this}clearIncompatible(e,n,r){return k0(this,e,n,r),this}}const vg=Object.create(null);class Le{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Wte(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=se.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:u}=o[a],d=e.mapping.slice(s);e.replaceRange(d.map(l.pos),d.map(u.pos),a?se.empty:n),a==0&&OO(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(r),u=l.map(o.pos),d=l.map(a.pos);s?e.deleteRange(u,d):(e.replaceRangeWith(u,d,n),OO(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new xe(e):Oa(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=n<0?Oa(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Oa(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Fr(e.node(0))}static atStart(e){return Oa(e,e,0,0,1)||new Fr(e)}static atEnd(e){return Oa(e,e,e.content.size,e.childCount,-1)||new Fr(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=vg[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in vg)throw new RangeError("Duplicate use of selection JSON ID "+e);return vg[e]=n,n.prototype.jsonID=e,n}getBookmark(){return xe.between(this.$anchor,this.$head).getBookmark()}}Le.prototype.visible=!0;class Wte{constructor(e,n){this.$from=e,this.$to=n}}let TO=!1;function SO(t){!TO&&!t.parent.inlineContent&&(TO=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class xe extends Le{constructor(e,n=e){SO(e),SO(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Le.near(r);let i=e.resolve(n.map(this.anchor));return new xe(i.parent.inlineContent?i:r,r)}replace(e,n=se.empty){if(super.replace(e,n),n==se.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof xe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Xh(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new xe(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=Le.findFrom(n,r,!0)||Le.findFrom(n,-r,!0);if(s)n=s.$head;else return Le.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(Le.findFrom(e,-r,!0)||Le.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new xe(e,n)}}Le.jsonID("text",xe);class Xh{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Xh(e.map(this.anchor),e.map(this.head))}resolve(e){return xe.between(e.resolve(this.anchor),e.resolve(this.head))}}class ye extends Le{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return r?Le.near(s):new ye(s)}content(){return new se(Y.from(this.node),0,0)}eq(e){return e instanceof ye&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new A0(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ye(e.resolve(n.anchor))}static create(e,n){return new ye(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ye.prototype.visible=!1;Le.jsonID("node",ye);class A0{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Xh(r,r):new A0(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&ye.isSelectable(r)?new ye(n):Le.near(n)}}class Fr extends Le{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=se.empty){if(n==se.empty){e.delete(0,e.doc.content.size);let r=Le.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Fr(e)}map(e){return new Fr(e)}eq(e){return e instanceof Fr}getBookmark(){return qte}}Le.jsonID("all",Fr);const qte={map(){return this},resolve(t){return new Fr(t)}};function Oa(t,e,n,r,i,s=!1){if(e.inlineContent)return xe.create(t,n);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&ye.isSelectable(a))return ye.create(t,n-(i<0?a.nodeSize:0))}else{let l=Oa(t,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function OO(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Xt||i instanceof Zt))return;let s=t.mapping.maps[r],o;s.forEach((a,l,u,d)=>{o==null&&(o=d)}),t.setSelection(Le.near(t.doc.resolve(o),n))}const kO=1,Lf=2,NO=4;class zte extends Ute{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|kO)&~Lf,this.storedMarks=null,this}get selectionSet(){return(this.updated&kO)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Lf,this}ensureMarks(e){return pt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Lf)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Lf,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||pt.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),this.selection.empty||this.setSelection(Le.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=NO,this}get scrolledIntoView(){return(this.updated&NO)>0}}function AO(t,e){return!e||!t?t:t.bind(e)}class uc{constructor(e,n,r){this.name=e,this.init=AO(n.init,r),this.apply=AO(n.apply,r)}}const Qte=[new uc("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new uc("selection",{init(t,e){return t.selection||Le.atStart(e.doc)},apply(t){return t.selection}}),new uc("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new uc("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class bg{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Qte.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new uc(r.key,r.spec.state,r))})}}class xa{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,u=i?i[o].state:this,d=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,u,r);if(d&&r.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let h=0;h<this.config.plugins.length;h++)i.push(h<o?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),s=!0}i&&(i[o]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new xa(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new zte(this)}static create(e){let n=new bg(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new xa(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new bg(this.schema,e.plugins),r=n.fields,i=new xa(n);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new bg(e.schema,e.plugins),s=new xa(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Ao.fromJSON(e.schema,n.doc);else if(o.name=="selection")s.selection=Le.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[o.name]=u.fromJSON.call(l,e,n[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function Ox(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Ox(i,e,{})),n[r]=i}return n}class er{constructor(e){this.spec=e,this.props={},e.props&&Ox(e.props,this,this.props),this.key=e.key?e.key.key:kx("plugin")}getState(e){return e[this.key]}}const _g=Object.create(null);function kx(t){return t in _g?t+"$"+ ++_g[t]:(_g[t]=0,t+"$")}class Ti{constructor(e="key"){this.key=kx(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const un=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Wc=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Fy=null;const Vi=function(t,e,n){let r=Fy||(Fy=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Gte=function(){Fy=null},Vo=function(t,e,n,r){return n&&(IO(t,e,n,r,-1)||IO(t,e,n,r,1))},Hte=/^(img|br|input|textarea|hr)$/i;function IO(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Ir(t))){let s=t.parentNode;if(!s||s.nodeType!=1||_u(t)||Hte.test(t.nodeName)||t.contentEditable=="false")return!1;e=un(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Ir(t):0}else return!1}}function Ir(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Kte(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Ir(t)}else if(t.parentNode&&!_u(t))e=un(t),t=t.parentNode;else return null}}function Jte(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!_u(t))e=un(t)+1,t=t.parentNode;else return null}}function Yte(t,e,n){for(let r=e==0,i=e==Ir(t);r||i;){if(t==n)return!0;let s=un(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==Ir(t)}}function _u(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Zh=function(t){return t.focusNode&&Vo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function yo(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Xte(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Zte(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Ir(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Ir(r.startContainer),r.startOffset)}}}const _i=typeof navigator<"u"?navigator:null,xO=typeof document<"u"?document:null,Js=_i&&_i.userAgent||"",$y=/Edge\/(\d+)/.exec(Js),Nx=/MSIE \d/.exec(Js),Ly=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Js),Kn=!!(Nx||Ly||$y),Rs=Nx?document.documentMode:Ly?+Ly[1]:$y?+$y[1]:0,ti=!Kn&&/gecko\/(\d+)/i.test(Js);ti&&+(/Firefox\/(\d+)/.exec(Js)||[0,0])[1];const Vy=!Kn&&/Chrome\/(\d+)/.exec(Js),Tn=!!Vy,Ax=Vy?+Vy[1]:0,Fn=!Kn&&!!_i&&/Apple Computer/.test(_i.vendor),el=Fn&&(/Mobile\/\w+/.test(Js)||!!_i&&_i.maxTouchPoints>2),Nr=el||(_i?/Mac/.test(_i.platform):!1),ene=_i?/Win/.test(_i.platform):!1,Jr=/Android \d/.test(Js),Eu=!!xO&&"webkitFontSmoothing"in xO.documentElement.style,tne=Eu?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function nne(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Li(t,e){return typeof t=="number"?t:t[e]}function rne(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function CO(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=n||t.dom;o;o=Wc(o)){if(o.nodeType!=1)continue;let a=o,l=a==s.body,u=l?nne(s):rne(a),d=0,h=0;if(e.top<u.top+Li(r,"top")?h=-(u.top-e.top+Li(i,"top")):e.bottom>u.bottom-Li(r,"bottom")&&(h=e.bottom-e.top>u.bottom-u.top?e.top+Li(i,"top")-u.top:e.bottom-u.bottom+Li(i,"bottom")),e.left<u.left+Li(r,"left")?d=-(u.left-e.left+Li(i,"left")):e.right>u.right-Li(r,"right")&&(d=e.right-u.right+Li(i,"right")),d||h)if(l)s.defaultView.scrollBy(d,h);else{let p=a.scrollLeft,g=a.scrollTop;h&&(a.scrollTop+=h),d&&(a.scrollLeft+=d);let y=a.scrollLeft-p,b=a.scrollTop-g;e={left:e.left-y,top:e.top-b,right:e.right-y,bottom:e.bottom-b}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(o).position))break}}function ine(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=t.root.elementFromPoint(s,o);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:Ix(t.dom)}}function Ix(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Wc(r));return e}function sne({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;xx(n,r==0?0:r-e)}function xx(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Ea=null;function one(t){if(t.setActive)return t.setActive();if(Ea)return t.focus(Ea);let e=Ix(t);t.focus(Ea==null?{get preventScroll(){return Ea={preventScroll:!0},!0}}:void 0),Ea||(Ea=!1,xx(e,0))}function Cx(t,e){let n,r=2e8,i,s=0,o=e.top,a=e.top,l,u;for(let d=t.firstChild,h=0;d;d=d.nextSibling,h++){let p;if(d.nodeType==1)p=d.getClientRects();else if(d.nodeType==3)p=Vi(d).getClientRects();else continue;for(let g=0;g<p.length;g++){let y=p[g];if(y.top<=o&&y.bottom>=a){o=Math.max(y.bottom,o),a=Math.min(y.top,a);let b=y.left>e.left?y.left-e.left:y.right<e.left?e.left-y.right:0;if(b<r){n=d,r=b,i=b&&n.nodeType==3?{left:y.right<e.left?y.right:y.left,top:e.top}:e,d.nodeType==1&&b&&(s=h+(e.left>=(y.left+y.right)/2?1:0));continue}}else y.top>e.top&&!l&&y.left<=e.left&&y.right>=e.left&&(l=d,u={left:Math.max(y.left,Math.min(y.right,e.left)),top:y.top});!n&&(e.left>=y.right&&e.top>=y.top||e.left>=y.left&&e.top>=y.bottom)&&(s=h+1)}}return!n&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?ane(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:Cx(n,i)}function ane(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let s=ys(r,1);if(s.top!=s.bottom&&I0(e,s))return{node:t,offset:i+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function I0(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function lne(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function cne(t,e,n){let{node:r,offset:i}=Cx(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function une(t,e,n,r){let i=-1;for(let s=e,o=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!o&&l.left>r.left||l.top>r.top?i=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}s=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function Dx(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let o=t.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(I0(e,u))return Dx(o,e,u)}}if((s=(s+1)%r)==i)break}return t}function fne(t,e){let n=t.dom.ownerDocument,r,i=0,s=Zte(n,e.left,e.top);s&&({node:r,offset:i}=s);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=t.dom.getBoundingClientRect();if(!I0(e,u)||(o=Dx(t.dom,e,u),!o))return null}if(Fn)for(let u=o;r&&u;u=Wc(u))u.draggable&&(r=void 0);if(o=lne(o,e),r){if(ti&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],h;d.nodeName=="IMG"&&(h=d.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&i++}let u;Eu&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=une(t,r,i,e))}a==null&&(a=cne(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function DO(t){return t.top<t.bottom||t.left<t.right}function ys(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(DO(r))return r}return Array.prototype.find.call(n,DO)||t.getBoundingClientRect()}const dne=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Rx(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=Eu||ti;if(r.nodeType==3)if(o&&(dne.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=ys(Vi(r,i,i),n);if(ti&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=ys(Vi(r,i-1,i-1),-1);if(u.top==l.top){let d=ys(Vi(r,i,i+1),-1);if(d.top!=l.top)return ic(d,d.left<u.left)}}return l}else{let l=i,u=i,d=n<0?1:-1;return n<0&&!i?(u++,d=-1):n>=0&&i==r.nodeValue.length?(l--,d=1):n<0?l--:u++,ic(ys(Vi(r,l,u),d),d<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Ir(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Eg(l.getBoundingClientRect(),!1)}if(s==null&&i<Ir(r)){let l=r.childNodes[i];if(l.nodeType==1)return Eg(l.getBoundingClientRect(),!0)}return Eg(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Ir(r))){let l=r.childNodes[i-1],u=l.nodeType==3?Vi(l,Ir(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return ic(ys(u,1),!1)}if(s==null&&i<Ir(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?Vi(l,0,o?0:1):l.nodeType==1?l:null:null;if(u)return ic(ys(u,-1),!0)}return ic(ys(r.nodeType==3?Vi(r):r,-n),n>=0)}function ic(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Eg(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Mx(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function hne(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return Mx(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=Rx(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Vi(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let d=l[u];if(d.bottom>d.top+1&&(n=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const pne=/[\u0590-\u08ac]/;function mne(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=t.domSelection();return a?!pne.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:Mx(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:d,anchorOffset:h}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",n,"character");let g=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:y,focusOffset:b}=t.domSelectionRange(),_=y&&!g.contains(y.nodeType==1?y:y.parentNode)||l==y&&u==b;try{a.collapse(d,h),l&&(l!=d||u!=h)&&a.extend&&a.extend(l,u)}catch{}return p!=null&&(a.caretBidiLevel=p),_}):r.pos==r.start()||r.pos==r.end()}let RO=null,MO=null,PO=!1;function gne(t,e,n){return RO==e&&MO==n?PO:(RO=e,MO=n,PO=n=="up"||n=="down"?hne(t,e,n):mne(t,e,n))}const $r=0,FO=1,Eo=2,Ei=3;class wu{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=$r,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,o;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>un(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.size;if(a>e||o instanceof Fx){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof Px&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?un(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?un(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,a=0;;a++){let l=this.children[a],u=o+l.size;if(i==-1&&e<=u){let d=o+l.border;if(e>=d&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=o;for(let h=a;h>0;h--){let p=this.children[h-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=un(p.dom)+1;break}e-=p.size}i==-1&&(i=0)}if(i>-1&&(u>n||a==this.children.length-1)){n=u;for(let d=a+1;d<this.children.length;d++){let h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){s=un(h.dom);break}n+=h.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let s=Math.min(e,n),o=Math.max(e,n);for(let p=0,g=0;p<this.children.length;p++){let y=this.children[p],b=g+y.size;if(s>g&&o<b)return y.setSelection(e-g-y.border,n-g-y.border,r,i);g=b}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),u=r.getSelection(),d=!1;if((ti||Fn)&&e==n){let{node:p,offset:g}=a;if(p.nodeType==3){if(d=!!(g&&p.nodeValue[g-1]==`
360
+ `),d&&g==p.nodeValue.length)for(let y=p,b;y;y=y.parentNode){if(b=y.nextSibling){b.nodeName=="BR"&&(a=l={node:b.parentNode,offset:un(b)+1});break}let _=y.pmViewDesc;if(_&&_.node&&_.node.isBlock)break}}else{let y=p.childNodes[g-1];d=y&&(y.nodeName=="BR"||y.contentEditable=="false")}}if(ti&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||d&&Fn)&&Vo(a.node,a.offset,u.anchorNode,u.anchorOffset)&&Vo(l.node,l.offset,u.focusNode,u.focusOffset))return;let h=!1;if((u.extend||e==n)&&!d){u.collapse(a.node,a.offset);try{e!=n&&u.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>n){let g=a;a=l,l=g}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let a=r+s.border,l=o-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?Eo:FO,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Ei:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Eo:Ei}r=o}this.dirty=Eo}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Eo:FO;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class Px extends wu{constructor(e,n,r,i){let s,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==$r&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class yne extends wu{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class jo extends wu{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=Xo.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new jo(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Ei||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ei&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=$r){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=$r}}slice(e,n,r){let i=jo.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=By(s,n,o,r)),e>0&&(s=By(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Ms extends wu{constructor(e,n,r,i,s,o,a,l,u){super(e,[],s,o),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,s,o){let a=s.nodeViews[n.type.name],l,u=a&&a(n,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),d=u&&u.dom,h=u&&u.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:h}=Xo.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let p=d;return d=Vx(d,r,n),u?l=new vne(e,n,r,i,d,h||null,p,u,s,o+1):n.isText?new ep(e,n,r,i,d,p,s):new Ms(e,n,r,i,d,h||null,p,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Y.empty)}return e}matchesNode(e,n,r){return this.dirty==$r&&e.eq(this.node)&&zd(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new _ne(this,o&&o.node,e);Tne(this.node,this.innerDeco,(u,d,h)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e):u.type.side>=0&&!h&&l.syncToMarks(d==this.node.childCount?pt.none:this.node.child(d).marks,r,e),l.placeWidget(u,e,i)},(u,d,h,p)=>{l.syncToMarks(u.marks,r,e);let g;l.findNodeMatch(u,d,h,p)||a&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(g=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(u,d,h,g,e)||l.updateNextNode(u,d,h,e,p,i)||l.addNode(u,d,h,e,i),i+=u.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Eo)&&(o&&this.protectLocalComposition(e,o),$x(this.contentDOM,this.children,e),el&&Sne(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof xe)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=One(this.node.content,o,r-n,i-n);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new yne(this,s,n,i);e.input.compositionNodes.push(o),this.children=By(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==Ei||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=$r}updateOuterDeco(e){if(zd(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Lx(this.dom,this.nodeDOM,jy(this.outerDeco,this.node,n),jy(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function $O(t,e,n,r,i){Vx(r,e,t);let s=new Ms(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class ep extends Ms{constructor(e,n,r,i,s,o,a){super(e,n,r,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Ei||this.dirty!=$r&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=$r||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=$r,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new ep(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Ei)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Fx extends wu{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==$r&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class vne extends Ms{constructor(e,n,r,i,s,o,a,l,u,d){super(e,n,r,i,s,o,a,u,d),this.spec=l}update(e,n,r,i){if(this.dirty==Ei)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function $x(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==t){for(;a!=r;)r=LO(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(o instanceof jo){let l=r?r.previousSibling:t.lastChild;$x(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=LO(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const wc=function(t){t&&(this.nodeName=t)};wc.prototype=Object.create(null);const wo=[new wc];function jy(t,e,n){if(t.length==0)return wo;let r=n?wo[0]:new wc,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new wc(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new wc(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function Lx(t,e,n,r){if(n==wo&&r==wo)return e;let i=e;for(let s=0;s<r.length;s++){let o=r[s],a=n[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=wo[0]),i=l}bne(i,a||wo[0],o)}return i}function bne(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function Vx(t,e,n){return Lx(t,t,wo,jy(e,n,t.nodeType!=1))}function zd(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function LO(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class _ne{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Ene(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,s=this.stack.length>>1,o=Math.min(s,e.length);for(;i<o&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=$r,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let u=this.top.children[l];if(u.matchesMark(e[s])&&!this.isLocked(u.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=jo.create(this.top,e[s],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,n,r)&&!this.preMatch.matched.has(u)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let o=this.top.children[i];return o.dirty==Ei&&o.dom==o.contentDOM&&(o.dirty=Eo),o.update(e,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Ms){let u=this.preMatch.matched.get(l);if(u!=null&&u!=s)return!1;let d=l.dom,h,p=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Ei&&zd(n,l.outerDeco));if(!p&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!p&&(h=this.recreateWrapper(l,e,n,r,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=Eo,h.updateChildren(i,o+1),h.dirty=$r),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!zd(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=Ms.create(this.top,n,r,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,s){let o=Ms.create(this.top,e,n,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new Px(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof jo;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof ep)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Fn||Tn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Fx(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Ene(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof jo)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function wne(t,e){return t.type.side-e.type.side}function Tne(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let u=0;u<t.childCount;u++){let d=t.child(u);r(d,i,e.forChild(s,d),u),s+=d.nodeSize}return}let o=0,a=[],l=null;for(let u=0;;){let d,h;for(;o<i.length&&i[o].to==s;){let _=i[o++];_.widget&&(d?(h||(h=[d])).push(_):d=_)}if(d)if(h){h.sort(wne);for(let _=0;_<h.length;_++)n(h[_],u,!!l)}else n(d,u,!!l);let p,g;if(l)g=-1,p=l,l=null;else if(u<t.childCount)g=u,p=t.child(u++);else break;for(let _=0;_<a.length;_++)a[_].to<=s&&a.splice(_--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let y=s+p.nodeSize;if(p.isText){let _=y;o<i.length&&i[o].from<_&&(_=i[o].from);for(let w=0;w<a.length;w++)a[w].to<_&&(_=a[w].to);_<y&&(l=p.cut(_-s),p=p.cut(0,_-s),y=_,g=-1)}else for(;o<i.length&&i[o].to<y;)o++;let b=p.isInline&&!p.isLeaf?a.filter(_=>!_.inline):a.slice();r(p,b,e.forChild(s,p),g),s=y}}function Sne(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function One(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let o=t.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<t.childCount;){let u=t.child(i++);if(s+=u.nodeSize,!u.isText)break;l+=u.text}if(s>=n){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let u=a<r?l.lastIndexOf(e,r-a-1):-1;if(u>=0&&u+e.length+a>=n)return a+u;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function By(t,e,n,r,i){let s=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],u=a,d=a+=l.size;u>=n||d<=e?s.push(l):(u<e&&s.push(l.slice(0,e-u,r)),i&&(s.push(i),i=void 0),d>n&&s.push(l.slice(n-u,l.size,r)))}return s}function x0(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,u;if(Zh(n)){for(l=o;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&ye.isSelectable(h)&&i.parent&&!(h.isInline&&Yte(n.focusNode,n.focusOffset,i.dom))){let p=i.posBefore;u=new ye(o==p?a:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=o,p=o;for(let g=0;g<n.rangeCount;g++){let y=n.getRangeAt(g);h=Math.min(h,t.docView.posFromDOM(y.startContainer,y.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(y.endContainer,y.endOffset,-1))}if(h<0)return null;[l,o]=p==t.state.selection.anchor?[p,h]:[h,p],a=r.resolve(o)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!u){let h=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;u=C0(t,d,a,h)}return u}function jx(t){return t.editable?t.hasFocus():Ux(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function qi(t,e=!1){let n=t.state.selection;if(Bx(t,n),!!jx(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Tn){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Vo(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)Nne(t);else{let{anchor:r,head:i}=n,s,o;VO&&!(n instanceof xe)&&(n.$from.parent.inlineContent||(s=jO(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=jO(t,n.to))),t.docView.setSelection(r,i,t.root,e),VO&&(s&&BO(s),o&&BO(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&kne(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const VO=Fn||Tn&&Ax<63;function jO(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Fn&&i&&i.contentEditable=="false")return wg(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return wg(i);if(s)return wg(s)}}function wg(t){return t.contentEditable="true",Fn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function BO(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function kne(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!jx(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Nne(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,un(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Kn&&Rs<=11&&(r.disabled=!0,r.disabled=!1)}function Bx(t,e){if(e instanceof ye){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(UO(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else UO(t)}function UO(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function C0(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||xe.between(e,n,r)}function WO(t){return t.editable&&!t.hasFocus()?!1:Ux(t)}function Ux(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Ane(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Vo(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Uy(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&Le.findFrom(s,e)}function Es(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function qO(t,e,n){let r=t.state.selection;if(r instanceof xe)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Es(t,new xe(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Uy(t.state,e);return i&&i instanceof ye?Es(t,i):!1}else if(!(Nr&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?ye.isSelectable(s)?Es(t,new ye(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Eu?Es(t,new xe(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ye&&r.node.isInline)return Es(t,new xe(e>0?r.$to:r.$from));{let i=Uy(t.state,e);return i?Es(t,i):!1}}}function Qd(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Tc(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function wa(t,e){return e<0?Ine(t):xne(t)}function Ine(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for(ti&&n.nodeType==1&&r<Qd(n)&&Tc(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Tc(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Wx(n))break;{let a=n.previousSibling;for(;a&&Tc(a,-1);)i=n.parentNode,s=un(a),a=a.previousSibling;if(a)n=a,r=Qd(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?Wy(t,n,r):i&&Wy(t,i,s)}function xne(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Qd(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Tc(a,1))s=n,o=++r;else break}else{if(Wx(n))break;{let a=n.nextSibling;for(;a&&Tc(a,1);)s=a.parentNode,o=un(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Qd(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&Wy(t,s,o)}function Wx(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Cne(t,e){for(;t&&e==t.childNodes.length&&!_u(t);)e=un(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function Dne(t,e){for(;t&&!e&&!_u(t);)e=un(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Wy(t,e,n){if(e.nodeType!=3){let s,o;(o=Cne(e,n))?(e=o,n=0):(s=Dne(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Zh(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&qi(t)},50)}function zO(t,e){let n=t.state.doc.resolve(e);if(!(Tn||ene)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function QO(t,e,n){let r=t.state.selection;if(r instanceof xe&&!r.empty||n.indexOf("s")>-1||Nr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=Uy(t.state,e);if(o&&o instanceof ye)return Es(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof Fr?Le.near(o,e):Le.findFrom(o,e);return a?Es(t,a):!1}return!1}function GO(t,e){if(!(t.state.selection instanceof xe))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function HO(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Rne(t){if(!Fn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;HO(t,r,"true"),setTimeout(()=>HO(t,r,"false"),20)}return!1}function Mne(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Pne(t,e){let n=e.keyCode,r=Mne(e);if(n==8||Nr&&n==72&&r=="c")return GO(t,-1)||wa(t,-1);if(n==46&&!e.shiftKey||Nr&&n==68&&r=="c")return GO(t,1)||wa(t,1);if(n==13||n==27)return!0;if(n==37||Nr&&n==66&&r=="c"){let i=n==37?zO(t,t.state.selection.from)=="ltr"?-1:1:-1;return qO(t,i,r)||wa(t,i)}else if(n==39||Nr&&n==70&&r=="c"){let i=n==39?zO(t,t.state.selection.from)=="ltr"?1:-1:1;return qO(t,i,r)||wa(t,i)}else{if(n==38||Nr&&n==80&&r=="c")return QO(t,-1,r)||wa(t,-1);if(n==40||Nr&&n==78&&r=="c")return Rne(t)||QO(t,1,r)||wa(t,1);if(r==(Nr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function qx(t,e){t.someProp("transformCopied",g=>{e=g(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let g=r.firstChild;n.push(g.type.name,g.attrs!=g.type.defaultAttrs?g.attrs:null),r=g.content}let o=t.someProp("clipboardSerializer")||Xo.fromSchema(t.state.schema),a=Jx(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let u=l.firstChild,d,h=0;for(;u&&u.nodeType==1&&(d=Kx[u.nodeName.toLowerCase()]);){for(let g=d.length-1;g>=0;g--){let y=a.createElement(d[g]);for(;l.firstChild;)y.appendChild(l.firstChild);l.appendChild(y),h++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",g=>g(e,t))||e.content.textBetween(0,e.content.size,`
361
+
362
+ `);return{dom:l,text:p,slice:e}}function zx(t,e,n,r,i){let s=i.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,s||r,t)}),s)return e?new se(Y.from(t.state.schema.text(e.replace(/\r\n?/g,`
363
+ `))),0,0):se.empty;let h=t.someProp("clipboardTextParser",p=>p(e,i,r,t));if(h)a=h;else{let p=i.marks(),{schema:g}=t.state,y=Xo.fromSchema(g);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(b=>{let _=o.appendChild(document.createElement("p"));b&&_.appendChild(y.serializeNode(g.text(b,p)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),o=Vne(n),Eu&&jne(o);let u=o&&o.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let h=+d[3];h>0;h--){let p=o.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;o=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Ds.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!Fne.test(p.parentNode.nodeName)?{ignore:!0}:null}})),d)a=Bne(KO(a,+d[1],+d[2]),d[4]);else if(a=se.maxOpen($ne(a.content,i),!0),a.openStart||a.openEnd){let h=0,p=0;for(let g=a.content.firstChild;h<a.openStart&&!g.type.spec.isolating;h++,g=g.firstChild);for(let g=a.content.lastChild;p<a.openEnd&&!g.type.spec.isolating;p++,g=g.lastChild);a=KO(a,h,p)}return t.someProp("transformPasted",h=>{a=h(a,t)}),a}const Fne=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function $ne(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),s,o=[];if(t.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),u;if(!l)return o=null;if(u=o.length&&s.length&&Gx(l,s,a,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=Hx(o[o.length-1],s.length));let d=Qx(a,l);o.push(d),i=i.matchType(d.type),s=l}}),o)return Y.from(o)}return t}function Qx(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,Y.from(t));return t}function Gx(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=Gx(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(Y.from(Qx(n,t,i+1))))}}function Hx(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Hx(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(Y.empty,!0);return t.copy(n.append(r))}function qy(t,e,n,r,i,s){let o=e<0?t.firstChild:t.lastChild,a=o.content;return t.childCount>1&&(s=0),i<r-1&&(a=qy(a,e,n,r,i+1,s)),i>=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(Y.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function KO(t,e,n){return e<t.openStart&&(t=new se(qy(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new se(qy(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Kx={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let JO=null;function Jx(){return JO||(JO=document.implementation.createHTMLDocument("title"))}let Tg=null;function Lne(t){let e=window.trustedTypes;return e?(Tg||(Tg=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Tg.createHTML(t)):t}function Vne(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Jx().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Kx[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=Lne(t),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function jne(t){let e=t.querySelectorAll(Tn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function Bne(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:o}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=Y.from(l.create(r[a+1],i)),s++,o++}return new se(i,s,o)}const $n={},Ln={},Une={touchstart:!0,touchmove:!0};class Wne{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function qne(t){for(let e in $n){let n=$n[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{Qne(t,r)&&!D0(t,r)&&(t.editable||!(r.type in Ln))&&n(t,r)},Une[e]?{passive:!0}:void 0)}Fn&&t.dom.addEventListener("input",()=>null),zy(t)}function xs(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function zne(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function zy(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>D0(t,r))})}function D0(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function Qne(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Gne(t,e){!D0(t,e)&&$n[e.type]&&(t.editable||!(e.type in Ln))&&$n[e.type](t,e)}Ln.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Xx(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Jr&&Tn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),el&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,yo(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Pne(t,n)?n.preventDefault():xs(t,"key")};Ln.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Ln.keypress=(t,e)=>{let n=e;if(Xx(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Nr&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof xe)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function tp(t){return{left:t.clientX,top:t.clientY}}function Hne(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function R0(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(t.someProp(e,a=>o>s.depth?a(t,n,s.nodeAfter,s.before(o),i,!0):a(t,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function Va(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Kne(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ye.isSelectable(r)?(Va(t,new ye(n)),!0):!1}function Jne(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof ye&&(r=n.node);let s=t.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(ye.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(Va(t,ye.create(t.state.doc,i)),!0):!1}function Yne(t,e,n,r,i){return R0(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?Jne(t,n):Kne(t,n))}function Xne(t,e,n,r){return R0(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function Zne(t,e,n,r){return R0(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||ere(t,n,r)}function ere(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Va(t,xe.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)Va(t,xe.create(r,a+1,a+1+o.content.size));else if(ye.isSelectable(o))Va(t,ye.create(r,a));else continue;return!0}}function M0(t){return Gd(t)}const Yx=Nr?"metaKey":"ctrlKey";$n.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=M0(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&Hne(n,t.input.lastClick)&&!n[Yx]&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s};let o=t.posAtCoords(tp(n));o&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new tre(t,o,n,!!r)):(s=="doubleClick"?Xne:Zne)(t,o.pos,o.inside,n)?n.preventDefault():xs(t,"pointer"))};class tre{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Yx],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),o=n.inside;else{let d=e.state.doc.resolve(n.pos);s=d.parent,o=d.depth?d.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:u}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof ye&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ti&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),xs(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>qi(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(tp(e))),this.updateAllowDefault(e),this.allowDefault||!n?xs(this.view,"pointer"):Yne(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Fn&&this.mightDrag&&!this.mightDrag.node.isAtom||Tn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Va(this.view,Le.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):xs(this.view,"pointer")}move(e){this.updateAllowDefault(e),xs(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}$n.touchstart=t=>{t.input.lastTouch=Date.now(),M0(t),xs(t,"pointer")};$n.touchmove=t=>{t.input.lastTouch=Date.now(),xs(t,"pointer")};$n.contextmenu=t=>M0(t);function Xx(t,e){return t.composing?!0:Fn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const nre=Jr?5e3:-1;Ln.compositionstart=Ln.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof xe&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Gd(t,!0),t.markCursor=null;else if(Gd(t,!e.selection.empty),ti&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}t.input.composing=!0}Zx(t,nre)};Ln.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Zx(t,20))};function Zx(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Gd(t),e))}function eC(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=ire());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function rre(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Kte(e.focusNode,e.focusOffset),r=Jte(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function ire(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Gd(t,e=!1){if(!(Jr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),eC(t),e||t.docView&&t.docView.dirty){let n=x0(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function sre(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const qc=Kn&&Rs<15||el&&tne<604;$n.copy=Ln.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=qc?null:n.clipboardData,o=r.content(),{dom:a,text:l}=qx(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):sre(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function ore(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function are(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?zc(t,r.value,null,i,e):zc(t,r.textContent,r.innerHTML,i,e)},50)}function zc(t,e,n,r,i){let s=zx(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||se.empty)))return!0;if(!s)return!1;let o=ore(s),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function tC(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Ln.paste=(t,e)=>{let n=e;if(t.composing&&!Jr)return;let r=qc?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&zc(t,tC(r),r.getData("text/html"),i,n)?n.preventDefault():are(t,n)};class nC{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const rC=Nr?"altKey":"ctrlKey";$n.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(tp(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof ye?i.to-1:i.to))){if(r&&r.mightDrag)o=ye.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=ye.create(t.state.doc,h.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:u,slice:d}=qx(t,a);(!n.dataTransfer.files.length||!Tn||Ax>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(qc?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",qc||n.dataTransfer.setData("text/plain",u),t.dragging=new nC(d,!n[rC],o)};$n.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Ln.dragover=Ln.dragenter=(t,e)=>e.preventDefault();Ln.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(tp(n));if(!i)return;let s=t.state.doc.resolve(i.pos),o=r&&r.slice;o?t.someProp("transformPasted",y=>{o=y(o,t)}):o=zx(t,tC(n.dataTransfer),qc?null:n.dataTransfer.getData("text/html"),!1,s);let a=!!(r&&!n[rC]);if(t.someProp("handleDrop",y=>y(t,n,o||se.empty,a))){n.preventDefault();return}if(!o)return;n.preventDefault();let l=o?_x(t.state.doc,s.pos,o):s.pos;l==null&&(l=s.pos);let u=t.state.tr;if(a){let{node:y}=r;y?y.replace(u):u.deleteSelection()}let d=u.mapping.map(l),h=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,p=u.doc;if(h?u.replaceRangeWith(d,d,o.content.firstChild):u.replaceRange(d,d,o),u.doc.eq(p))return;let g=u.doc.resolve(d);if(h&&ye.isSelectable(o.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(o.content.firstChild))u.setSelection(new ye(g));else{let y=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((b,_,w,O)=>y=O),u.setSelection(C0(t,g,u.doc.resolve(y)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))};$n.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&qi(t)},20))};$n.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};$n.beforeinput=(t,e)=>{if(Tn&&Jr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,yo(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Ln)$n[t]=Ln[t];function Qc(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Hd{constructor(e,n){this.toDOM=e,this.spec=n||Io,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:o}=e.mapResult(n.from+i,this.side<0?-1:1);return o?null:new Cr(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Hd&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Qc(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ps{constructor(e,n){this.attrs=e,this.spec=n||Io}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new Cr(s,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Ps&&Qc(this.attrs,e.attrs)&&Qc(this.spec,e.spec)}static is(e){return e.type instanceof Ps}destroy(){}}class P0{constructor(e,n){this.attrs=e,this.spec=n||Io}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let o=e.mapResult(n.to+i,-1);return o.deleted||o.pos<=s.pos?null:new Cr(s.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof P0&&Qc(this.attrs,e.attrs)&&Qc(this.spec,e.spec)}destroy(){}}class Cr{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Cr(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Cr(e,e,new Hd(n,r))}static inline(e,n,r,i){return new Cr(e,n,new Ps(r,i))}static node(e,n,r,i){return new Cr(e,n,new P0(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ps}get widget(){return this.type instanceof Hd}}const ka=[],Io={};class zt{constructor(e,n){this.local=e.length?e:ka,this.children=n.length?n:ka}static create(e,n){return n.length?Kd(n,e,0,Io):En}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,i+a,s)}}map(e,n,r){return this==En||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Io)}mapInner(e,n,r,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?lre(this.children,o||[],e,n,r,i,s):o?new zt(o.sort(xo),ka):En}add(e,n){return n.length?this==En?zt.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((a,l)=>{let u=l+r,d;if(d=sC(n,a,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,d,u+1):i.splice(s,0,l,l+a.nodeSize,Kd(d,a,u+1,Io)),s+=3}});let o=iC(s?oC(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new zt(o.length?this.local.concat(o).sort(xo):this.local,i||this.children)}remove(e){return e.length==0||this==En?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,a=r[s]+n,l=r[s+1]+n;for(let d=0,h;d<e.length;d++)(h=e[d])&&h.from>a&&h.to<l&&(e[d]=null,(o||(o=[])).push(h));if(!o)continue;r==this.children&&(r=this.children.slice());let u=r[s+2].removeInner(o,a+1);u!=En?r[s+2]=u:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new zt(i,r):En}forChild(e,n){if(this==En)return this;if(n.isLeaf)return zt.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof Ps){let u=Math.max(s,l.from)-s,d=Math.min(o,l.to)-s;u<d&&(i||(i=[])).push(l.copy(u,d))}}if(i){let a=new zt(i.sort(xo),ka);return r?new Ts([a,r]):a}return r||En}eq(e){if(this==e)return!0;if(!(e instanceof zt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return F0(this.localsInner(e))}localsInner(e){if(this==En)return ka;if(e.inlineContent||!this.local.some(Ps.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Ps||n.push(this.local[r]);return n}forEachSet(e){e(this)}}zt.empty=new zt([],[]);zt.removeOverlap=F0;const En=zt.empty;class Ts{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Io));return Ts.from(r)}forChild(e,n){if(n.isLeaf)return zt.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=En&&(s instanceof Ts?r=r.concat(s.members):r.push(s))}return Ts.from(r)}eq(e){if(!(e instanceof Ts)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let o=0;o<s.length;o++)n.push(s[o])}}return n?F0(r?n:n.sort(xo)):ka}static from(e){switch(e.length){case 0:return En;case 1:return e[0];default:return new Ts(e.every(n=>n instanceof zt)?e:e.reduce((n,r)=>n.concat(r instanceof zt?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function lre(t,e,n,r,i,s,o){let a=t.slice();for(let u=0,d=s;u<n.maps.length;u++){let h=0;n.maps[u].forEach((p,g,y,b)=>{let _=b-y-(g-p);for(let w=0;w<a.length;w+=3){let O=a[w+1];if(O<0||p>O+d-h)continue;let N=a[w]+d-h;g>=N?a[w+1]=p<=N?-2:-1:p>=d&&_&&(a[w]+=_,a[w+1]+=_)}h+=_}),d=n.maps[u].map(d,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let d=n.map(t[u]+s),h=d-i;if(h<0||h>=r.content.size){l=!0;continue}let p=n.map(t[u+1]+s,-1),g=p-i,{index:y,offset:b}=r.content.findIndex(h),_=r.maybeChild(y);if(_&&b==h&&b+_.nodeSize==g){let w=a[u+2].mapInner(n,_,d+1,t[u]+s+1,o);w!=En?(a[u]=h,a[u+1]=g,a[u+2]=w):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=cre(a,t,e,n,i,s,o),d=Kd(u,r,0,o);e=d.local;for(let h=0;h<a.length;h+=3)a[h+1]<0&&(a.splice(h,3),h-=3);for(let h=0,p=0;h<d.children.length;h+=3){let g=d.children[h];for(;p<a.length&&a[p]<g;)p+=3;a.splice(p,0,d.children[h],d.children[h+1],d.children[h+2])}}return new zt(e.sort(xo),a)}function iC(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Cr(i.from+e,i.to+e,i.type))}return n}function cre(t,e,n,r,i,s,o){function a(l,u){for(let d=0;d<l.local.length;d++){let h=l.local[d].map(r,i,u);h?n.push(h):o.onRemove&&o.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return n}function sC(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,o;s<t.length;s++)(o=t[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),t[s]=null);return i}function oC(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Kd(t,e,n,r){let i=[],s=!1;e.forEach((a,l)=>{let u=sC(t,a,l+n);if(u){s=!0;let d=Kd(u,a,n+l+1,r);d!=En&&i.push(l,l+a.nodeSize,d)}});let o=iC(s?oC(t):t,-n).sort(xo);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new zt(o,i):En}function xo(t,e){return t.from-e.from||t.to-e.to}function F0(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),YO(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),YO(e,i,r.copy(s.from,r.to)));break}}}return e}function YO(t,e,n){for(;e<t.length&&xo(n,t[e])>0;)e++;t.splice(e,0,n)}function Sg(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=En&&e.push(r)}),t.cursorWrapper&&e.push(zt.create(t.state.doc,[t.cursorWrapper.deco])),Ts.from(e)}const ure={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},fre=Kn&&Rs<=11;class dre{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class hre{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new dre,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Kn&&Rs<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),fre&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ure)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(WO(this.view)){if(this.suppressingSelectionUpdates)return qi(this.view);if(Kn&&Rs<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Vo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=Wc(s))n.add(s);for(let s=e.anchorNode;s;s=Wc(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&WO(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let d=0;d<n.length;d++){let h=this.registerMutation(n[d],l);h&&(s=s<0?h.from:Math.min(h.from,s),o=o<0?h.to:Math.max(h.to,o),h.typeOver&&(a=!0))}if(ti&&l.length){let d=l.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,p]=d;h.parentNode&&h.parentNode.parentNode==p.parentNode?p.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let p of d){let g=p.parentNode;g&&g.nodeName=="LI"&&(!h||gre(e,h)!=g)&&p.remove()}}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Zh(r)&&(u=x0(e))&&u.eq(Le.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,qi(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),pre(e)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||qi(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let h=e.addedNodes[d];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Kn&&Rs<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:h,nextSibling:p}=e.addedNodes[d];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(i=h),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(s=p)}let o=i&&i.parentNode==e.target?un(i)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?un(s):e.target.childNodes.length,u=r.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let XO=new WeakMap,ZO=!1;function pre(t){if(!XO.has(t)&&(XO.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=ti,ZO)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),ZO=!0}}function ek(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return Vo(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function mre(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return ek(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?ek(t,n):null}function gre(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function yre(t,e,n){let{node:r,fromOffset:i,toOffset:s,from:o,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),u,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:l.anchorOffset}],Zh(l)||u.push({node:l.focusNode,offset:l.focusOffset})),Tn&&t.input.lastKeyCode===8)for(let _=s;_>i;_--){let w=r.childNodes[_-1],O=w.pmViewDesc;if(w.nodeName=="BR"&&!O){s=_;break}if(!O||O.size)break}let h=t.state.doc,p=t.someProp("domParser")||Ds.fromSchema(t.state.schema),g=h.resolve(o),y=null,b=p.parse(r,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:s,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:vre,context:g});if(u&&u[0].pos!=null){let _=u[0].pos,w=u[1]&&u[1].pos;w==null&&(w=_),y={anchor:_+o,head:w+o}}return{doc:b,sel:y,from:o,to:a}}function vre(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Fn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Fn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const bre=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function _re(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let x=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,U=x0(t,x);if(U&&!t.state.selection.eq(U)){if(Tn&&Jr&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",ke=>ke(t,yo(13,"Enter"))))return;let Te=t.state.tr.setSelection(U);x=="pointer"?Te.setMeta("pointer",!0):x=="key"&&Te.scrollIntoView(),s&&Te.setMeta("composition",s),t.dispatch(Te)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=yre(t,e,n),d=t.state.doc,h=d.slice(u.from,u.to),p,g;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,g="end"):(p=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let y=Tre(h.content,u.doc.content,u.from,p,g);if(y&&t.input.domChangeCount++,(el&&t.input.lastIOSEnter>Date.now()-225||Jr)&&i.some(x=>x.nodeType==1&&!bre.test(x.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",x=>x(t,yo(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y)if(r&&l instanceof xe&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))y={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let x=tk(t,t.state.doc,u.sel);if(x&&!x.eq(t.state.selection)){let U=t.state.tr.setSelection(x);s&&U.setMeta("composition",s),t.dispatch(U)}}return}t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof xe&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),Kn&&Rs<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>u.from&&u.doc.textBetween(y.start-u.from-1,y.start-u.from+1)=="  "&&(y.start--,y.endA--,y.endB--);let b=u.doc.resolveNoCache(y.start-u.from),_=u.doc.resolveNoCache(y.endB-u.from),w=d.resolve(y.start),O=b.sameParent(_)&&b.parent.inlineContent&&w.end()>=y.endA,N;if((el&&t.input.lastIOSEnter>Date.now()-225&&(!O||i.some(x=>x.nodeName=="DIV"||x.nodeName=="P"))||!O&&b.pos<u.doc.content.size&&!b.sameParent(_)&&(N=Le.findFrom(u.doc.resolve(b.pos+1),1,!0))&&N.head==_.pos)&&t.someProp("handleKeyDown",x=>x(t,yo(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&wre(d,y.start,y.endA,b,_)&&t.someProp("handleKeyDown",x=>x(t,yo(8,"Backspace")))){Jr&&Tn&&t.domObserver.suppressSelectionUpdates();return}Tn&&Jr&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Jr&&!O&&b.start()!=_.start()&&_.parentOffset==0&&b.depth==_.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==y.endA&&(y.endB-=2,_=u.doc.resolveNoCache(y.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(x){return x(t,yo(13,"Enter"))})},20));let I=y.start,P=y.endA,M,B,Q;if(O){if(b.pos==_.pos)Kn&&Rs<=11&&b.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>qi(t),20)),M=t.state.tr.delete(I,P),B=d.resolve(y.start).marksAcross(d.resolve(y.endA));else if(y.endA==y.endB&&(Q=Ere(b.parent.content.cut(b.parentOffset,_.parentOffset),w.parent.content.cut(w.parentOffset,y.endA-w.start()))))M=t.state.tr,Q.type=="add"?M.addMark(I,P,Q.mark):M.removeMark(I,P,Q.mark);else if(b.parent.child(b.index()).isText&&b.index()==_.index()-(_.textOffset?0:1)){let x=b.parent.textBetween(b.parentOffset,_.parentOffset);if(t.someProp("handleTextInput",U=>U(t,I,P,x)))return;M=t.state.tr.insertText(x,I,P)}}if(M||(M=t.state.tr.replace(I,P,u.doc.slice(y.start-u.from,y.endB-u.from))),u.sel){let x=tk(t,M.doc,u.sel);x&&!(Tn&&Jr&&t.composing&&x.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(x.head==I||x.head==M.mapping.map(P)-1)||Kn&&x.empty&&x.head==I)&&M.setSelection(x)}B&&M.ensureMarks(B),s&&M.setMeta("composition",s),t.dispatch(M.scrollIntoView())}function tk(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:C0(t,e.resolve(n.anchor),e.resolve(n.head))}function Ere(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,o,a,l;for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);for(let d=0;d<n.length;d++)s=n[d].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=d=>d.mark(a.addToSet(d.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let u=[];for(let d=0;d<e.childCount;d++)u.push(l(e.child(d)));if(Y.from(u).eq(t))return{mark:a,type:o}}function wre(t,e,n,r,i){if(n-e<=i.pos-r.pos||Og(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=t.resolve(Og(s,!0,!0));return!o.parent.isTextblock||o.pos>n||Og(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Og(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function Tre(t,e,n,r,i){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:o,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(o,a));r-=o+l-s}if(o<s&&t.size<e.size){let l=r<=s&&r>=o?s-r:0;s-=l,s&&s<e.size&&nk(e.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}else if(a<s){let l=r<=s&&r>=a?s-r:0;s-=l,s&&s<t.size&&nk(t.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}function nk(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class Sre{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Wne,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(ak),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=sk(this),ik(this),this.nodeViews=ok(this),this.docView=$O(this.state.doc,rk(this),Sg(this),this.dom,this),this.domObserver=new hre(this,(r,i,s,o)=>_re(this,r,i,s,o)),this.domObserver.start(),qne(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&zy(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ak),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(eC(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let g=ok(this);kre(g,this.nodeViews)&&(this.nodeViews=g,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&zy(this),this.editable=sk(this),ik(this);let l=Sg(this),u=rk(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=s||!this.docView.matchesNode(e.doc,u,l);(h||!e.selection.eq(i.selection))&&(o=!0);let p=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&ine(this);if(o){this.domObserver.stop();let g=h&&(Kn||Tn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Ore(i.selection,e.selection);if(h){let y=Tn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=rre(this)),(s||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=$O(e.doc,u,l,this.dom,this)),y&&!this.trackWrites&&(g=!0)}g||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Ane(this))?qi(this,g):(Bx(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():p&&sne(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ye){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&CO(this,n.getBoundingClientRect(),e)}else CO(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new nC(e.slice,e.move,i<0?void 0:ye.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=n?n(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Kn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&one(this.dom),qi(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return fne(this,e)}coordsAtPos(e,n=1){return Rx(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return gne(this,n||this.state,e)}pasteHTML(e,n){return zc(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return zc(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(zne(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Sg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Gte())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Gne(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Fn&&this.root.nodeType===11&&Xte(this.dom.ownerDocument)==this.dom&&mre(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function rk(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Cr.node(0,t.state.doc.content.size,e)]}function ik(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Cr.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function sk(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Ore(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function ok(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function kre(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function ak(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Us={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Jd={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Nre=typeof navigator<"u"&&/Mac/.test(navigator.platform),Are=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var fn=0;fn<10;fn++)Us[48+fn]=Us[96+fn]=String(fn);for(var fn=1;fn<=24;fn++)Us[fn+111]="F"+fn;for(var fn=65;fn<=90;fn++)Us[fn]=String.fromCharCode(fn+32),Jd[fn]=String.fromCharCode(fn);for(var kg in Us)Jd.hasOwnProperty(kg)||(Jd[kg]=Us[kg]);function Ire(t){var e=Nre&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Are&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Jd:Us)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const xre=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Cre(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))xre?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),o&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function Dre(t){let e=Object.create(null);for(let n in t)e[Cre(n)]=t[n];return e}function Ng(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Rre(t){return new er({props:{handleKeyDown:aC(t)}})}function aC(t){let e=Dre(t);return function(n,r){let i=Ire(r),s,o=e[Ng(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Ng(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(s=Us[r.keyCode])&&s!=i){let a=e[Ng(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const $0=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function lC(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const cC=(t,e,n)=>{let r=lC(t,n);if(!r)return!1;let i=L0(r);if(!i){let o=r.blockRange(),a=o&&vl(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(vC(t,i,e,-1))return!0;if(r.parent.content.size==0&&(tl(s,"end")||ye.isSelectable(s)))for(let o=r.depth;;o--){let a=Yh(t.doc,r.before(o),r.after(o),se.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(tl(s,"end")?Le.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):ye.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},Mre=(t,e,n)=>{let r=lC(t,n);if(!r)return!1;let i=L0(r);return i?uC(t,i,e):!1},Pre=(t,e,n)=>{let r=dC(t,n);if(!r)return!1;let i=V0(r);return i?uC(t,i,e):!1};function uC(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let u=Yh(t.doc,s,l,se.empty);if(!u||u.from!=s||u instanceof Xt&&u.slice.size>=l-s)return!1;if(n){let d=t.tr.step(u);d.setSelection(xe.create(d.doc,s)),n(d.scrollIntoView())}return!0}function tl(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const fC=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=L0(r)}let o=s&&s.nodeBefore;return!o||!ye.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ye.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function L0(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function dC(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const hC=(t,e,n)=>{let r=dC(t,n);if(!r)return!1;let i=V0(r);if(!i)return!1;let s=i.nodeAfter;if(vC(t,i,e,1))return!0;if(r.parent.content.size==0&&(tl(s,"start")||ye.isSelectable(s))){let o=Yh(t.doc,r.before(),r.after(),se.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(tl(s,"start")?Le.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ye.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},pC=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=V0(r)}let o=s&&s.nodeAfter;return!o||!ye.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ye.create(t.doc,s.pos)).scrollIntoView()),!0)};function V0(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Fre=(t,e)=>{let n=t.selection,r=n instanceof ye,i;if(r){if(n.node.isTextblock||!Ks(t.doc,n.from))return!1;i=n.from}else if(i=Jh(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(ye.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},$re=(t,e)=>{let n=t.selection,r;if(n instanceof ye){if(n.node.isTextblock||!Ks(t.doc,n.to))return!1;r=n.to}else if(r=Jh(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Lre=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&vl(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},mC=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
364
+ `).scrollIntoView()),!0)};function j0(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Vre=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=j0(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(Le.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},gC=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Fr||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=j0(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(o,s.createAndFill());a.setSelection(xe.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},yC=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Wi(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&vl(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function jre(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof ye&&e.selection.node.isBlock)return!r.parentOffset||!Wi(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,a,l=!1,u=!1;for(let g=r.depth;;g--)if(r.node(g).isBlock){l=r.end(g)==r.pos+(r.depth-g),u=r.start(g)==r.pos-(r.depth-g),a=j0(r.node(g-1).contentMatchAt(r.indexAfter(g-1))),s.unshift(l&&a?{type:a}:null),o=g;break}else{if(g==1)return!1;s.unshift(null)}let d=e.tr;(e.selection instanceof xe||e.selection instanceof Fr)&&d.deleteSelection();let h=d.mapping.map(r.pos),p=Wi(d.doc,h,s.length,s);if(p||(s[0]=a?{type:a}:null,p=Wi(d.doc,h,s.length,s)),d.split(h,s.length,s),!l&&u&&r.node(o).type!=a){let g=d.mapping.map(r.before(o)),y=d.doc.resolve(g);a&&r.node(o-1).canReplaceWith(y.index(),y.index()+1,a)&&d.setNodeMarkup(d.mapping.map(r.before(o)),a)}return n&&n(d.scrollIntoView()),!0}}const Bre=jre(),Ure=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(ye.create(t.doc,i))),!0)};function Wre(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Ks(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function vC(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&Wre(t,e,n))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(n){let g=e.pos+s.nodeSize,y=Y.empty;for(let w=o.length-1;w>=0;w--)y=Y.from(o[w].create(null,y));y=Y.from(i.copy(y));let b=t.tr.step(new Zt(e.pos-1,g,e.pos,g,new se(y,1,0),o.length,!0)),_=b.doc.resolve(g+2*o.length);_.nodeAfter&&_.nodeAfter.type==i.type&&Ks(b.doc,_.pos)&&b.join(_.pos),n(b.scrollIntoView())}return!0}let d=s.type.spec.isolating||r>0&&l?null:Le.findFrom(e,1),h=d&&d.$from.blockRange(d.$to),p=h&&vl(h);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(h,p).scrollIntoView()),!0;if(u&&tl(s,"start",!0)&&tl(i,"end")){let g=i,y=[];for(;y.push(g),!g.isTextblock;)g=g.lastChild;let b=s,_=1;for(;!b.isTextblock;b=b.firstChild)_++;if(g.canReplace(g.childCount,g.childCount,b.content)){if(n){let w=Y.empty;for(let N=y.length-1;N>=0;N--)w=Y.from(y[N].copy(w));let O=t.tr.step(new Zt(e.pos-y.length,e.pos+s.nodeSize,e.pos+_,e.pos+s.nodeSize-_,new se(w,y.length,0),0,!0));n(O.scrollIntoView())}return!0}}return!1}function bC(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(xe.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const qre=bC(-1),zre=bC(1);function Qre(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&N0(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function lk(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(o,a,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let d=n.doc.resolve(u),h=d.index();i=d.parent.canReplaceWith(h,h+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[o];s.setBlockType(a,l,t,e)}r(s.scrollIntoView())}return!0}}function B0(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}B0($0,cC,fC);B0($0,hC,pC);B0(mC,gC,yC,Bre);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Gre(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=!1,l=o;if(!o)return!1;if(o.depth>=2&&i.node(o.depth-1).type.compatibleContent(t)&&o.startIndex==0){if(i.index(o.depth-1)==0)return!1;let d=n.doc.resolve(o.start-2);l=new Bd(d,d,o.depth),o.endIndex<o.parent.childCount&&(o=new Bd(i,n.doc.resolve(s.end(o.depth)),o.depth)),a=!0}let u=N0(l,t,e,o);return u?(r&&r(Hre(n.tr,o,u,a,t).scrollIntoView()),!0):!1}}function Hre(t,e,n,r,i){let s=Y.empty;for(let d=n.length-1;d>=0;d--)s=Y.from(n[d].type.create(n[d].attrs,s));t.step(new Zt(e.start-(r?2:0),e.end,e.start,e.end,new se(s,0,0),n.length,!0));let o=0;for(let d=0;d<n.length;d++)n[d].type==i&&(o=d+1);let a=n.length-o,l=e.start+n.length-(r?2:0),u=e.parent;for(let d=e.startIndex,h=e.endIndex,p=!0;d<h;d++,p=!1)!p&&Wi(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(d).nodeSize;return t}function Kre(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?Jre(e,n,t,s):Yre(e,n,s):!0:!1}}function Jre(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new Zt(s-1,o,s,o,new se(Y.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Bd(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=vl(r);if(a==null)return!1;i.lift(r,a);let l=i.mapping.map(s,-1)-1;return Ks(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function Yre(t,e,n){let r=t.tr,i=n.parent;for(let g=n.end,y=n.endIndex-1,b=n.startIndex;y>b;y--)g-=i.child(y).nodeSize,r.delete(g-1,g+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(a?0:1),d+1,o.content.append(l?Y.empty:Y.from(i))))return!1;let h=s.pos,p=h+o.nodeSize;return r.step(new Zt(h-(a?1:0),p+(l?1:0),h+1,p-1,new se((a?Y.empty:Y.from(i.copy(Y.empty))).append(l?Y.empty:Y.from(i.copy(Y.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function Xre(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,d=Y.from(u?t.create():null),h=new se(Y.from(t.create(null,Y.from(a.type.create(null,d)))),u?3:1,0),p=s.start,g=s.end;n(e.tr.step(new Zt(p-(u?3:1),g,p,g,h,1,!0)).scrollIntoView())}return!0}}function np(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}class rp{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:s}=r,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...d)=>{const h=l(...d)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a=[],l=!!e,u=e||s.tr,d=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),a.every(p=>p===!0)),h={...Object.fromEntries(Object.entries(r).map(([p,g])=>[p,(...b)=>{const _=this.buildProps(u,n),w=g(...b)(_);return a.push(w),h}])),run:d};return h}createCan(e){const{rawCommands:n,state:r}=this,i=!1,s=e||r.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...d)=>u(...d)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a={tr:e,editor:i,view:o,state:np({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...d)=>u(...d)(a)]))}};return a}}class Zre{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function ue(t,e,n){return t.config[e]===void 0&&t.parent?ue(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ue(t.parent,e,n):null}):t.config[e]}function ip(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function _C(t){const e=[],{nodeExtensions:n,markExtensions:r}=ip(t),i=[...n,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage,extensions:i},l=ue(o,"addGlobalAttributes",a);if(!l)return;l().forEach(d=>{d.types.forEach(h=>{Object.entries(d.attributes).forEach(([p,g])=>{e.push({type:h,name:p,attribute:{...s,...g}})})})})}),i.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=ue(o,"addAttributes",a);if(!l)return;const u=l();Object.entries(u).forEach(([d,h])=>{const p={...s,...h};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,e.push({type:o.name,name:d,attribute:p})})}),e}function tn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Ht(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const a=s?s.split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(d=>!l.includes(d));r[i]=[...l,...u].join(" ")}else if(i==="style"){const a=s?s.split(";").map(d=>d.trim()).filter(Boolean):[],l=r[i]?r[i].split(";").map(d=>d.trim()).filter(Boolean):[],u=new Map;l.forEach(d=>{const[h,p]=d.split(":").map(g=>g.trim());u.set(h,p)}),a.forEach(d=>{const[h,p]=d.split(":").map(g=>g.trim());u.set(h,p)}),r[i]=Array.from(u.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else r[i]=s}),r},{})}function Qy(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Ht(n,r),{})}function EC(t){return typeof t=="function"}function Qe(t,e=void 0,...n){return EC(t)?e?t.bind(e)(...n):t(...n):t}function eie(t={}){return Object.keys(t).length===0&&t.constructor===Object}function tie(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function ck(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):tie(n.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function uk(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&eie(n)?!1:n!=null))}function nie(t,e){var n;const r=_C(t),{nodeExtensions:i,markExtensions:s}=ip(t),o=(n=i.find(u=>ue(u,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(u=>{const d=r.filter(w=>w.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((w,O)=>{const N=ue(O,"extendNodeSchema",h);return{...w,...N?N(u):{}}},{}),g=uk({...p,content:Qe(ue(u,"content",h)),marks:Qe(ue(u,"marks",h)),group:Qe(ue(u,"group",h)),inline:Qe(ue(u,"inline",h)),atom:Qe(ue(u,"atom",h)),selectable:Qe(ue(u,"selectable",h)),draggable:Qe(ue(u,"draggable",h)),code:Qe(ue(u,"code",h)),whitespace:Qe(ue(u,"whitespace",h)),defining:Qe(ue(u,"defining",h)),isolating:Qe(ue(u,"isolating",h)),attrs:Object.fromEntries(d.map(w=>{var O;return[w.name,{default:(O=w==null?void 0:w.attribute)===null||O===void 0?void 0:O.default}]}))}),y=Qe(ue(u,"parseHTML",h));y&&(g.parseDOM=y.map(w=>ck(w,d)));const b=ue(u,"renderHTML",h);b&&(g.toDOM=w=>b({node:w,HTMLAttributes:Qy(w,d)}));const _=ue(u,"renderText",h);return _&&(g.toText=_),[u.name,g]})),l=Object.fromEntries(s.map(u=>{const d=r.filter(_=>_.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((_,w)=>{const O=ue(w,"extendMarkSchema",h);return{..._,...O?O(u):{}}},{}),g=uk({...p,inclusive:Qe(ue(u,"inclusive",h)),excludes:Qe(ue(u,"excludes",h)),group:Qe(ue(u,"group",h)),spanning:Qe(ue(u,"spanning",h)),code:Qe(ue(u,"code",h)),attrs:Object.fromEntries(d.map(_=>{var w;return[_.name,{default:(w=_==null?void 0:_.attribute)===null||w===void 0?void 0:w.default}]}))}),y=Qe(ue(u,"parseHTML",h));y&&(g.parseDOM=y.map(_=>ck(_,d)));const b=ue(u,"renderHTML",h);return b&&(g.toDOM=_=>b({mark:_,HTMLAttributes:Qy(_,d)})),[u.name,g]}));return new cx({topNode:o,nodes:a,marks:l})}function Ag(t,e){return e.nodes[t]||e.marks[t]||null}function fk(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const rie=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,u;const d=((u=(l=i.type.spec).toText)===null||u===void 0?void 0:u.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,r-s))}),n};function U0(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class sp{constructor(e){this.find=e.find,this.handler=e.handler}}const iie=(t,e)=>{if(U0(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Vf(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let d=!1;const h=rie(u)+s;return o.forEach(p=>{if(d)return;const g=iie(h,p.find);if(!g)return;const y=l.state.tr,b=np({state:l.state,transaction:y}),_={from:r-(g[0].length-s.length),to:i},{commands:w,chain:O,can:N}=new rp({editor:n,state:b});p.handler({state:b,range:_,match:g,commands:w,chain:O,can:N})===null||!y.steps.length||(y.setMeta(a,{transform:y,from:r,to:i,text:s}),l.dispatch(y),d=!0)}),d}function sie(t){const{editor:e,rules:n}=t,r=new er({state:{init(){return null},apply(i,s){const o=i.getMeta(r);if(o)return o;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{const{from:u,text:d}=a,h=u+d.length;Vf({editor:e,from:u,to:h,text:d,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return Vf({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Vf({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?Vf({editor:e,from:o.pos,to:o.pos,text:`
365
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function oie(t){return Object.prototype.toString.call(t).slice(8,-1)}function jf(t){return oie(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function op(t,e){const n={...t};return jf(t)&&jf(e)&&Object.keys(e).forEach(r=>{jf(e[r])&&jf(t[r])?n[r]=op(t[r],e[r]):n[r]=e[r]}),n}class jr{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Qe(ue(this,"addOptions",{name:this.name}))),this.storage=Qe(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new jr(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>op(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new jr(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Qe(ue(n,"addOptions",{name:n.name})),n.storage=Qe(ue(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=o.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function aie(t){return typeof t=="number"}class lie{constructor(e){this.find=e.find,this.handler=e.handler}}const cie=(t,e,n)=>{if(U0(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function uie(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:u,can:d}=new rp({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,i,(g,y)=>{if(!g.isTextblock||g.type.spec.code)return;const b=Math.max(r,y),_=Math.min(i,y+g.content.size),w=g.textBetween(b-y,_-y,void 0,"");cie(w,s.find,o).forEach(N=>{if(N.index===void 0)return;const I=b+N.index+1,P=I+N[0].length,M={from:n.tr.mapping.map(I),to:n.tr.mapping.map(P)},B=s.handler({state:n,range:M,match:N,commands:l,chain:u,can:d,pasteEvent:o,dropEvent:a});h.push(B)})}),h.every(g=>g!==null)}const fie=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function die(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a=typeof DragEvent<"u"?new DragEvent("drop"):null;const l=({state:d,from:h,to:p,rule:g,pasteEvt:y})=>{const b=d.tr,_=np({state:d,transaction:b});if(!(!uie({editor:e,state:_,from:Math.max(h-1,0),to:p.b-1,rule:g,pasteEvent:y,dropEvent:a})||!b.steps.length))return a=typeof DragEvent<"u"?new DragEvent("drop"):null,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,b};return n.map(d=>new er({view(h){const p=g=>{var y;r=!((y=h.dom.parentElement)===null||y===void 0)&&y.contains(g.target)?h.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(h,p)=>(s=r===h.dom.parentElement,a=p,!1),paste:(h,p)=>{var g;const y=(g=p.clipboardData)===null||g===void 0?void 0:g.getData("text/html");return o=p,i=!!(y!=null&&y.includes("data-pm-slice")),!1}}},appendTransaction:(h,p,g)=>{const y=h[0],b=y.getMeta("uiEvent")==="paste"&&!i,_=y.getMeta("uiEvent")==="drop"&&!s,w=y.getMeta("applyPasteRules"),O=!!w;if(!b&&!_&&!O)return;if(O){const{from:P,text:M}=w,B=P+M.length,Q=fie(M);return l({rule:d,state:g,from:P,to:{b:B},pasteEvt:Q})}const N=p.doc.content.findDiffStart(g.doc.content),I=p.doc.content.findDiffEnd(g.doc.content);if(!(!aie(N)||!I||N===I.b))return l({rule:d,state:g,from:N,to:I,pasteEvt:o})}}))}function hie(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class Ca{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Ca.resolve(e),this.schema=nie(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Ca.sort(Ca.flatten(e)),r=hie(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=ue(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const s=ue(r,"priority")||100,o=ue(i,"priority")||100;return s>o?-1:s<o?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Ag(n.name,this.schema)},i=ue(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=Ca.sort([...this.extensions].reverse()),r=[],i=[],s=n.map(o=>{const a={name:o.name,options:o.options,storage:o.storage,editor:e,type:Ag(o.name,this.schema)},l=[],u=ue(o,"addKeyboardShortcuts",a);let d={};if(o.type==="mark"&&ue(o,"exitable",a)&&(d.ArrowRight=()=>jr.handleExit({editor:e,mark:o})),u){const b=Object.fromEntries(Object.entries(u()).map(([_,w])=>[_,()=>w({editor:e})]));d={...d,...b}}const h=Rre(d);l.push(h);const p=ue(o,"addInputRules",a);fk(o,e.options.enableInputRules)&&p&&r.push(...p());const g=ue(o,"addPasteRules",a);fk(o,e.options.enablePasteRules)&&g&&i.push(...g());const y=ue(o,"addProseMirrorPlugins",a);if(y){const b=y();l.push(...b)}return l}).flat();return[sie({editor:e,rules:r}),...die({editor:e,rules:i}),...s]}get attributes(){return _C(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=ip(this.extensions);return Object.fromEntries(n.filter(r=>!!ue(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:tn(r.name,this.schema)},o=ue(r,"addNodeView",s);if(!o)return[];const a=(l,u,d,h,p)=>{const g=Qy(l,i);return o()({node:l,view:u,getPos:d,decorations:h,innerDecorations:p,editor:e,extension:r,HTMLAttributes:g})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Ag(e.name,this.schema)};e.type==="mark"&&(!((n=Qe(ue(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=ue(e,"onBeforeCreate",r),s=ue(e,"onCreate",r),o=ue(e,"onUpdate",r),a=ue(e,"onSelectionUpdate",r),l=ue(e,"onTransaction",r),u=ue(e,"onFocus",r),d=ue(e,"onBlur",r),h=ue(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),h&&this.editor.on("destroy",h)})}}class Sn{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Qe(ue(this,"addOptions",{name:this.name}))),this.storage=Qe(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Sn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>op(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Sn({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Qe(ue(n,"addOptions",{name:n.name})),n.storage=Qe(ue(n,"addStorage",{name:n.name,options:n.options})),n}}function wC(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=`
366
+
367
+ `,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,d,h)=>{var p;l.isBlock&&u>r&&(a+=s);const g=o==null?void 0:o[l.type.name];if(g)return d&&(a+=g({node:l,pos:u,parent:d,index:h,range:e})),!1;l.isText&&(a+=(p=l==null?void 0:l.text)===null||p===void 0?void 0:p.slice(Math.max(r,u)-u,i-u))}),a}function TC(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const pie=Sn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new er({key:new Ti("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(d=>d.$from.pos)),a=Math.max(...s.map(d=>d.$to.pos)),l=TC(n);return wC(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),mie=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),gie=(t=!1)=>({commands:e})=>e.setContent("",t),yie=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{t.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:d}=e,h=u.resolve(d.map(l)),p=u.resolve(d.map(l+a.nodeSize)),g=h.blockRange(p);if(!g)return;const y=vl(g);if(a.type.isTextblock){const{defaultType:b}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(g.start,b)}(y||y===0)&&e.lift(g,y)})}),!0},vie=t=>e=>t(e),bie=()=>({state:t,dispatch:e})=>gC(t,e),_ie=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new xe(r.doc.resolve(o-1))),!0},Eie=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1},wie=t=>({tr:e,state:n,dispatch:r})=>{const i=tn(t,n.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const l=s.before(o),u=s.after(o);e.delete(l,u).scrollIntoView()}return!0}return!1},Tie=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},Sie=()=>({state:t,dispatch:e})=>$0(t,e),Oie=()=>({commands:t})=>t.keyboardShortcut("Enter"),kie=()=>({state:t,dispatch:e})=>Vre(t,e);function Yd(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:U0(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Gy(t,e,n={}){return t.find(r=>r.type===e&&Yd(r.attrs,n))}function Nie(t,e,n={}){return!!Gy(t,e,n)}function W0(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(u=>u.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(u=>u.type===e))return;const i=Gy([...r.node.marks],e,n);if(!i)return;let s=r.index,o=t.start()+r.offset,a=s+1,l=o+r.node.nodeSize;for(Gy([...r.node.marks],e,n);s>0&&i.isInSet(t.parent.child(s-1).marks);)s-=1,o-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&Nie([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function Ys(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const Aie=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const s=Ys(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:u,to:d}=a;if(i){const h=W0(l,s,e);if(h&&h.from<=u&&h.to>=d){const p=xe.create(o,h.from,h.to);n.setSelection(p)}}return!0},Iie=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function SC(t){return t instanceof xe}function To(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function OC(t,e=null){if(!e)return null;const n=Le.atStart(t),r=Le.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?xe.create(t,To(0,i,s),To(t.content.size,i,s)):xe.create(t,To(e,i,s),To(e,i,s))}function q0(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const xie=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{q0()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!SC(n.state.selection))return o(),!0;const a=OC(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Cie=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),Die=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),kC=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&kC(r)}return t};function Bf(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return kC(n)}function Xd(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return Y.fromArray(t.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),Xd("",e,n)}if(i){if(n.errorOnInvalidContent){let o=!1,a="";const l=new cx({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?Ds.fromSchema(l).parseSlice(Bf(t),n.parseOptions):Ds.fromSchema(l).parse(Bf(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=Ds.fromSchema(e);return n.slice?s.parseSlice(Bf(t),n.parseOptions).content:s.parse(Bf(t),n.parseOptions)}return Xd("",e,n)}function Rie(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Xt||i instanceof Zt))return;const s=t.mapping.maps[r];let o=0;s.forEach((a,l,u,d)=>{o===0&&(o=d)}),t.setSelection(Le.near(t.doc.resolve(o),n))}const Mie=t=>!("type"in t),Pie=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=Xd(e,s.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(o=n.errorOnInvalidContent)!==null&&o!==void 0?o:s.options.enableContentCheck})}catch(y){return s.emit("contentError",{editor:s,error:y,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},d=!0,h=!0;if((Mie(a)?a:[a]).forEach(y=>{y.check(),d=d?y.isText&&y.marks.length===0:!1,h=h?y.isBlock:!1}),l===u&&h){const{parent:y}=r.doc.resolve(l);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(l-=1,u+=1)}let g;d?(Array.isArray(e)?g=e.map(y=>y.text||"").join(""):typeof e=="object"&&e&&e.text?g=e.text:g=e,r.insertText(g,l,u)):(g=a,r.replaceWith(l,u,g)),n.updateSelection&&Rie(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:g})}return!0},Fie=()=>({state:t,dispatch:e})=>Fre(t,e),$ie=()=>({state:t,dispatch:e})=>$re(t,e),Lie=()=>({state:t,dispatch:e})=>cC(t,e),Vie=()=>({state:t,dispatch:e})=>hC(t,e),jie=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Jh(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Bie=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Jh(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Uie=()=>({state:t,dispatch:e})=>Mre(t,e),Wie=()=>({state:t,dispatch:e})=>Pre(t,e);function NC(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function qie(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))q0()||NC()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}const zie=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=qie(t).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const d=u.map(r.mapping);d&&i&&r.maybeStep(d)}),!0};function Gc(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?tn(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(h,p)=>{if(h.isText)return;const g=Math.max(r,p),y=Math.min(i,p+h.nodeSize);a.push({node:h,from:g,to:y})});const l=i-r,u=a.filter(h=>o?o.name===h.node.type.name:!0).filter(h=>Yd(h.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((h,p)=>h+p.to-p.from,0)>=l}const Qie=(t,e={})=>({state:n,dispatch:r})=>{const i=tn(t,n.schema);return Gc(n,i,e)?Lre(n,r):!1},Gie=()=>({state:t,dispatch:e})=>yC(t,e),Hie=t=>({state:e,dispatch:n})=>{const r=tn(t,e.schema);return Kre(r)(e,n)},Kie=()=>({state:t,dispatch:e})=>mC(t,e);function ap(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function dk(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const Jie=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=ap(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=tn(t,r.schema)),a==="mark"&&(o=Ys(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,d)=>{s&&s===u.type&&n.setNodeMarkup(d,void 0,dk(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(h=>{o===h.type&&n.addMark(d,d+u.nodeSize,o.create(dk(h.attrs,e)))})})}),!0):!1},Yie=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),Xie=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),Zie=()=>({state:t,dispatch:e})=>fC(t,e),ese=()=>({state:t,dispatch:e})=>pC(t,e),tse=()=>({state:t,dispatch:e})=>Ure(t,e),nse=()=>({state:t,dispatch:e})=>zre(t,e),rse=()=>({state:t,dispatch:e})=>qre(t,e);function Hy(t,e,n={},r={}){return Xd(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const ise=(t,e=!1,n={},r={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{var l,u;const{doc:d}=s;if(n.preserveWhitespace!=="full"){const h=Hy(t,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return o&&s.replaceWith(0,d.content.size,h).setMeta("preventUpdate",!e),!0}return o&&s.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:d.content.size},t,{parseOptions:n,errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function AC(t,e){const n=Ys(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function sse(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function ose(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function z0(t){return e=>ose(e.$from,t)}function ase(t,e){const n=Xo.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function lse(t,e){const n={from:0,to:t.content.size};return wC(t,n,e)}function cse(t,e){const n=tn(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function use(t,e){const n=ap(typeof e=="string"?e:e.name,t.schema);return n==="node"?cse(t,e):n==="mark"?AC(t,e):{}}function IC(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=W0(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}function id(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function Ky(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?Ys(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>s?s.name===h.type.name:!0).find(h=>Yd(h.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:h,$to:p})=>{const g=h.pos,y=p.pos;t.doc.nodesBetween(g,y,(b,_)=>{if(!b.isText&&!b.marks.length)return;const w=Math.max(g,_),O=Math.min(y,_+b.nodeSize),N=O-w;o+=N,a.push(...b.marks.map(I=>({mark:I,from:w,to:O})))})}),o===0)return!1;const l=a.filter(h=>s?s.name===h.mark.type.name:!0).filter(h=>Yd(h.mark.attrs,n,{strict:!1})).reduce((h,p)=>h+p.to-p.from,0),u=a.filter(h=>s?h.mark.type!==s&&h.mark.type.excludes(s):!0).reduce((h,p)=>h+p.to-p.from,0);return(l>0?l+u:l)>=o}function fse(t,e,n={}){if(!e)return Gc(t,null,n)||Ky(t,null,n);const r=ap(e,t.schema);return r==="node"?Gc(t,e,n):r==="mark"?Ky(t,e,n):!1}function hk(t,e){const{nodeExtensions:n}=ip(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=Qe(ue(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Q0(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(Q0(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function dse(t){return t instanceof ye}function hse(t,e,n){var r;const{selection:i}=e;let s=null;if(SC(i)&&(s=i.$cursor),s){const a=(r=t.storedMarks)!==null&&r!==void 0?r:s.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,h,p)=>{if(u)return!1;if(d.isInline){const g=!p||p.type.allowsMarkType(n),y=!!n.isInSet(d.marks)||!d.marks.some(b=>b.type.excludes(n));u=g&&y}return!u}),u})}const pse=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=Ys(t,r.schema);if(i)if(o){const u=AC(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;r.doc.nodesBetween(d,h,(p,g)=>{const y=Math.max(g,d),b=Math.min(g+p.nodeSize,h);p.marks.find(w=>w.type===l)?p.marks.forEach(w=>{l===w.type&&n.addMark(y,b,l.create({...w.attrs,...e}))}):n.addMark(y,b,l.create(e))})});return hse(r,n,l)},mse=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),gse=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=tn(t,n.schema);return s.isTextblock?i().command(({commands:o})=>lk(s,e)(n)?!0:o.clearNodes()).command(({state:o})=>lk(s,e)(o,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},yse=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=To(t,0,r.content.size),s=ye.create(r,i);e.setSelection(s)}return!0},vse=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,o=xe.atStart(r).from,a=xe.atEnd(r).to,l=To(i,o,a),u=To(s,o,a),d=xe.create(r,l,u);e.setSelection(d)}return!0},bse=t=>({state:e,dispatch:n})=>{const r=tn(t,e.schema);return Xre(r)(e,n)};function pk(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const _se=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,u=i.extensionManager.attributes,d=id(u,a.node().type.name,a.node().attrs);if(s instanceof ye&&s.node.isBlock)return!a.parentOffset||!Wi(o,a.pos)?!1:(r&&(t&&pk(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,p=a.depth===0?void 0:sse(a.node(-1).contentMatchAt(a.indexAfter(-1)));let g=h&&p?[{type:p,attrs:d}]:void 0,y=Wi(e.doc,e.mapping.map(a.pos),1,g);if(!g&&!y&&Wi(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(y=!0,g=p?[{type:p,attrs:d}]:void 0),r){if(y&&(s instanceof xe&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,g),p&&!h&&!a.parentOffset&&a.parent.type!==p)){const b=e.mapping.map(a.before()),_=e.doc.resolve(b);a.node(-1).canReplaceWith(_.index(),_.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&pk(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return y},Ese=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=tn(t,r.schema),{$from:l,$to:u}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(u))return!1;const h=l.node(-1);if(h.type!==a)return!1;const p=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let w=Y.empty;const O=l.index(-1)?1:l.index(-2)?2:3;for(let Q=l.depth-O;Q>=l.depth-3;Q-=1)w=Y.from(l.node(Q).copy(w));const N=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,I={...id(p,l.node().type.name,l.node().attrs),...e},P=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(I))||void 0;w=w.append(Y.from(a.createAndFill(null,P)||void 0));const M=l.before(l.depth-(O-1));n.replace(M,l.after(-N),new se(w,4-O,0));let B=-1;n.doc.nodesBetween(M,n.doc.content.size,(Q,x)=>{if(B>-1)return!1;Q.isTextblock&&Q.content.size===0&&(B=x+1)}),B>-1&&n.setSelection(xe.near(n.doc.resolve(B))),n.scrollIntoView()}return!0}const g=u.pos===l.end()?h.contentMatchAt(0).defaultType:null,y={...id(p,h.type.name,h.attrs),...e},b={...id(p,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,u.pos);const _=g?[{type:a,attrs:y},{type:g,attrs:b}]:[{type:a,attrs:y}];if(!Wi(n.doc,l.pos,2))return!1;if(i){const{selection:w,storedMarks:O}=r,{splittableMarks:N}=s.extensionManager,I=O||w.$to.parentOffset&&w.$from.marks();if(n.split(l.pos,2,_).scrollIntoView(),!I||!i)return!0;const P=I.filter(M=>N.includes(M.type.name));n.ensureMarks(P)}return!0},Ig=(t,e)=>{const n=z0(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Ks(t.doc,n.pos)&&t.join(n.pos),!0},xg=(t,e)=>{const n=z0(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Ks(t.doc,r)&&t.join(r),!0},wse=(t,e,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:u,can:d})=>{const{extensions:h,splittableMarks:p}=i.extensionManager,g=tn(t,o.schema),y=tn(e,o.schema),{selection:b,storedMarks:_}=o,{$from:w,$to:O}=b,N=w.blockRange(O),I=_||b.$to.parentOffset&&b.$from.marks();if(!N)return!1;const P=z0(M=>hk(M.type.name,h))(b);if(N.depth>=1&&P&&N.depth-P.depth<=1){if(P.node.type===g)return u.liftListItem(y);if(hk(P.node.type.name,h)&&g.validContent(P.node.content)&&a)return l().command(()=>(s.setNodeMarkup(P.pos,g),!0)).command(()=>Ig(s,g)).command(()=>xg(s,g)).run()}return!n||!I||!a?l().command(()=>d().wrapInList(g,r)?!0:u.clearNodes()).wrapInList(g,r).command(()=>Ig(s,g)).command(()=>xg(s,g)).run():l().command(()=>{const M=d().wrapInList(g,r),B=I.filter(Q=>p.includes(Q.type.name));return s.ensureMarks(B),M?!0:u.clearNodes()}).wrapInList(g,r).command(()=>Ig(s,g)).command(()=>xg(s,g)).run()},Tse=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=Ys(t,r.schema);return Ky(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},Sse=(t,e,n={})=>({state:r,commands:i})=>{const s=tn(t,r.schema),o=tn(e,r.schema),a=Gc(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},Ose=(t,e={})=>({state:n,commands:r})=>{const i=tn(t,n.schema);return Gc(n,i,e)?r.lift(i):r.wrapIn(i,e)},kse=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const o=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},Nse=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},Ase=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=Ys(t,r.schema),{$from:u,empty:d,ranges:h}=a;if(!i)return!0;if(d&&o){let{from:p,to:g}=a;const y=(s=u.marks().find(_=>_.type===l))===null||s===void 0?void 0:s.attrs,b=W0(u,l,y);b&&(p=b.from,g=b.to),n.removeMark(p,g,l)}else h.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},Ise=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=ap(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=tn(t,r.schema)),a==="mark"&&(o=Ys(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,d=l.$to.pos;r.doc.nodesBetween(u,d,(h,p)=>{s&&s===h.type&&n.setNodeMarkup(p,void 0,{...h.attrs,...e}),o&&h.marks.length&&h.marks.forEach(g=>{if(o===g.type){const y=Math.max(p,u),b=Math.min(p+h.nodeSize,d);n.addMark(y,b,o.create({...g.attrs,...e}))}})})}),!0):!1},xse=(t,e={})=>({state:n,dispatch:r})=>{const i=tn(t,n.schema);return Qre(i,e)(n,r)},Cse=(t,e={})=>({state:n,dispatch:r})=>{const i=tn(t,n.schema);return Gre(i,e)(n,r)};var Dse=Object.freeze({__proto__:null,blur:mie,clearContent:gie,clearNodes:yie,command:vie,createParagraphNear:bie,cut:_ie,deleteCurrentNode:Eie,deleteNode:wie,deleteRange:Tie,deleteSelection:Sie,enter:Oie,exitCode:kie,extendMarkRange:Aie,first:Iie,focus:xie,forEach:Cie,insertContent:Die,insertContentAt:Pie,joinBackward:Lie,joinDown:$ie,joinForward:Vie,joinItemBackward:jie,joinItemForward:Bie,joinTextblockBackward:Uie,joinTextblockForward:Wie,joinUp:Fie,keyboardShortcut:zie,lift:Qie,liftEmptyBlock:Gie,liftListItem:Hie,newlineInCode:Kie,resetAttributes:Jie,scrollIntoView:Yie,selectAll:Xie,selectNodeBackward:Zie,selectNodeForward:ese,selectParentNode:tse,selectTextblockEnd:nse,selectTextblockStart:rse,setContent:ise,setMark:pse,setMeta:mse,setNode:gse,setNodeSelection:yse,setTextSelection:vse,sinkListItem:bse,splitBlock:_se,splitListItem:Ese,toggleList:wse,toggleMark:Tse,toggleNode:Sse,toggleWrap:Ose,undoInputRule:kse,unsetAllMarks:Nse,unsetMark:Ase,updateAttributes:Ise,wrapIn:xse,wrapInList:Cse});const Rse=Sn.create({name:"commands",addCommands(){return{...Dse}}}),Mse=Sn.create({name:"drop",addProseMirrorPlugins(){return[new er({key:new Ti("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),Pse=Sn.create({name:"editable",addProseMirrorPlugins(){return[new er({key:new Ti("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Fse=Sn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new er({key:new Ti("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),$se=Sn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:d,$anchor:h}=l,{pos:p,parent:g}=h,y=h.parent.isTextblock&&p>0?a.doc.resolve(p-1):h,b=y.parent.type.spec.isolating,_=h.pos-h.parentOffset,w=b&&y.parent.childCount===1?_===h.pos:Le.atStart(u).from===p;return!d||!g.type.isTextblock||g.textContent.length||!w||w&&h.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return q0()||NC()?s:i},addProseMirrorPlugins(){return[new er({key:new Ti("clearDocument"),appendTransaction:(t,e,n)=>{const r=t.some(b=>b.docChanged)&&!e.doc.eq(n.doc),i=t.some(b=>b.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:a}=e.selection,l=Le.atStart(e.doc).from,u=Le.atEnd(e.doc).to;if(s||!(o===l&&a===u)||!Q0(n.doc))return;const p=n.tr,g=np({state:n,transaction:p}),{commands:y}=new rp({editor:this.editor,state:g});if(y.clearNodes(),!!p.steps.length)return p}})]}}),Lse=Sn.create({name:"paste",addProseMirrorPlugins(){return[new er({key:new Ti("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Vse=Sn.create({name:"tabindex",addProseMirrorPlugins(){return[new er({key:new Ti("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class vo{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new vo(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new vo(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new vo(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=this.pos+r+(s?0:1),a=this.resolvedPos.doc.resolve(o);if(!i&&a.depth<=this.depth)return;const l=new vo(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new vo(a,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===e&&s.every(l=>n[l]===o.node.attrs[l])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const jse=`.ProseMirror {
368
+ position: relative;
369
+ }
370
+
371
+ .ProseMirror {
372
+ word-wrap: break-word;
373
+ white-space: pre-wrap;
374
+ white-space: break-spaces;
375
+ -webkit-font-variant-ligatures: none;
376
+ font-variant-ligatures: none;
377
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
378
+ }
379
+
380
+ .ProseMirror [contenteditable="false"] {
381
+ white-space: normal;
382
+ }
383
+
384
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
385
+ white-space: pre-wrap;
386
+ }
387
+
388
+ .ProseMirror pre {
389
+ white-space: pre-wrap;
390
+ }
391
+
392
+ img.ProseMirror-separator {
393
+ display: inline !important;
394
+ border: none !important;
395
+ margin: 0 !important;
396
+ width: 0 !important;
397
+ height: 0 !important;
398
+ }
399
+
400
+ .ProseMirror-gapcursor {
401
+ display: none;
402
+ pointer-events: none;
403
+ position: absolute;
404
+ margin: 0;
405
+ }
406
+
407
+ .ProseMirror-gapcursor:after {
408
+ content: "";
409
+ display: block;
410
+ position: absolute;
411
+ top: -2px;
412
+ width: 20px;
413
+ border-top: 1px solid black;
414
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
415
+ }
416
+
417
+ @keyframes ProseMirror-cursor-blink {
418
+ to {
419
+ visibility: hidden;
420
+ }
421
+ }
422
+
423
+ .ProseMirror-hideselection *::selection {
424
+ background: transparent;
425
+ }
426
+
427
+ .ProseMirror-hideselection *::-moz-selection {
428
+ background: transparent;
429
+ }
430
+
431
+ .ProseMirror-hideselection * {
432
+ caret-color: transparent;
433
+ }
434
+
435
+ .ProseMirror-focused .ProseMirror-gapcursor {
436
+ display: block;
437
+ }
438
+
439
+ .tippy-box[data-animation=fade][data-state=hidden] {
440
+ opacity: 0
441
+ }`;function Bse(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}class Use extends Zre{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=Bse(jse,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=EC(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(s=>{const o=typeof s=="string"?`${s}$`:s.key;r=n.filter(a=>!a.key.startsWith(o))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[Pse,pie.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),Rse,Fse,$se,Vse,Mse,Lse].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new Ca(i,this)}createCommandManager(){this.commandManager=new rp({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=Hy(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(o=>o.name!=="collaboration"),this.createExtensionManager()}}),e=Hy(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=OC(e,this.options.autofocus);this.view=new Sre(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:xa.create({doc:e,selection:n||void 0})}),this.view.dom.setAttribute("role","textbox"),this.view.dom.getAttribute("aria-label")||this.view.dom.setAttribute("aria-label","Rich-Text Editor");const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(o)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return use(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return fse(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ase(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
442
+
443
+ `,textSerializers:r={}}=e||{};return lse(this.state.doc,{blockSeparator:n,textSerializers:{...TC(this.schema),...r}})}get isEmpty(){return Q0(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new vo(n,this)}get $doc(){return this.$pos(0)}}function Bo(t){return new sp({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Qe(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),u=n.from+a.indexOf(o),d=u+o.length;if(IC(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(b=>b===t.type&&b!==g.mark.type)).filter(g=>g.to>u).length)return null;d<n.to&&s.delete(d,n.to),u>n.from&&s.delete(n.from+l,u);const p=n.from+l+o.length;s.addMark(n.from+l,p,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function Wse(t){return new sp({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Qe(t.getAttributes,void 0,r)||{},{tr:s}=e,o=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let d=o+u;d>a?d=a:a=d+r[1].length;const h=r[0][r[0].length-1];s.insertText(h,o+r[0].length-1),s.replaceWith(d,a,l)}else if(r[0]){const u=t.type.isInline?o:o-1;s.insert(u,t.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()}})}function Jy(t){return new sp({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=Qe(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function Hc(t){return new sp({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=Qe(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),u=l&&N0(l,t.type,s);if(!u)return null;if(o.wrap(l,u),t.keepMarks&&t.editor){const{selection:h,storedMarks:p}=e,{splittableMarks:g}=t.editor.extensionManager,y=p||h.$to.parentOffset&&h.$from.marks();if(y){const b=y.filter(_=>g.includes(_.type.name));o.ensureMarks(b)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,s).run()}const d=o.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Ks(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&o.join(n.from-1)}})}class Xn{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Qe(ue(this,"addOptions",{name:this.name}))),this.storage=Qe(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Xn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>op(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Xn(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Qe(ue(n,"addOptions",{name:n.name})),n.storage=Qe(ue(n,"addStorage",{name:n.name,options:n.options})),n}}function Uo(t){return new lie({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=Qe(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const d=l.search(/\S/),h=n.from+l.indexOf(a),p=h+a.length;if(IC(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(_=>_===t.type&&_!==y.mark.type)).filter(y=>y.to>h).length)return null;p<n.to&&o.delete(p,n.to),h>n.from&&o.delete(n.from+d,h),u=n.from+d+a.length,o.addMark(n.from+d,u,t.type.create(s||{})),o.removeStoredMark(t.type)}}})}const qse=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,zse=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,Qse=jr.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",Ht(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Bo({find:qse,type:this.type})]},addPasteRules(){return[Uo({find:zse,type:this.type})]}}),Gse=jr.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",Ht(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),Hse=jr.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",Ht(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),Kse=Sn.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign||this.options.defaultAlignment;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),Jse=jr.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Ht(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function Yse(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yy={exports:{}},Cg={};/**
444
+ * @license React
445
+ * use-sync-external-store-shim.production.min.js
446
+ *
447
+ * Copyright (c) Facebook, Inc. and its affiliates.
448
+ *
449
+ * This source code is licensed under the MIT license found in the
450
+ * LICENSE file in the root directory of this source tree.
451
+ */var mk;function Xse(){if(mk)return Cg;mk=1;var t=ce;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 Cg.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,Cg}var Dg={};/**
452
+ * @license React
453
+ * use-sync-external-store-shim.development.js
454
+ *
455
+ * Copyright (c) Facebook, Inc. and its affiliates.
456
+ *
457
+ * This source code is licensed under the MIT license found in the
458
+ * LICENSE file in the root directory of this source tree.
459
+ */var gk;function Zse(){return gk||(gk=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=ce,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),M=1;M<I;M++)P[M-1]=arguments[M];r("error",N,P)}}function r(N,I,P){{var M=e.ReactDebugCurrentFrame,B=M.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 M=I();if(!h){var B=I();s(M,B)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}var Q=o({inst:{value:M,getSnapshot:I}}),x=Q[0].inst,U=Q[1];return l(function(){x.value=M,x.getSnapshot=I,g(x)&&U({inst:x})},[N,M,I]),a(function(){g(x)&&U({inst:x});var Te=function(){g(x)&&U({inst:x})};return N(Te)},[N]),u(M),M}function g(N){var I=N.getSnapshot,P=N.value;try{var M=I();return!s(P,M)}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;Dg.useSyncExternalStore=O,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Dg}process.env.NODE_ENV==="production"?Yy.exports=Xse():Yy.exports=Zse();var lp=Yy.exports;const eoe=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},toe=({contentComponent:t})=>{const e=lp.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return ce.createElement(ce.Fragment,null,Object.values(e))};function noe(){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]:VL.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 roe extends ce.Component{constructor(e){var n;super(e),this.editorContentRef=ce.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=noe(),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 ce.createElement(ce.Fragment,null,ce.createElement("div",{ref:eoe(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&ce.createElement(toe,{contentComponent:e.contentComponent}))}}const ioe=ce.forwardRef((t,e)=>{const n=ce.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return ce.createElement(roe,{key:n,innerRef:e,...t})}),soe=ce.memo(ioe);var ooe=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},aoe=Yse(ooe),Xy={exports:{}},Rg={};/**
460
+ * @license React
461
+ * use-sync-external-store-shim/with-selector.production.min.js
462
+ *
463
+ * Copyright (c) Facebook, Inc. and its affiliates.
464
+ *
465
+ * This source code is licensed under the MIT license found in the
466
+ * LICENSE file in the root directory of this source tree.
467
+ */var yk;function loe(){if(yk)return Rg;yk=1;var t=ce,e=lp;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 Rg.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(M){if(!O){if(O=!0,N=M,M=p(M),g!==void 0&&b.hasValue){var B=b.value;if(g(B,M))return I=B}return I=M}if(B=I,r(N,M))return B;var Q=p(M);return g!==void 0&&g(B,Q)?B:(N=M,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(_),_},Rg}var Mg={};/**
468
+ * @license React
469
+ * use-sync-external-store-shim/with-selector.development.js
470
+ *
471
+ * Copyright (c) Facebook, Inc. and its affiliates.
472
+ *
473
+ * This source code is licensed under the MIT license found in the
474
+ * LICENSE file in the root directory of this source tree.
475
+ */var vk;function coe(){return vk||(vk=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=ce,e=lp;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,M,B,Q=function(ke){if(!P){P=!0,M=ke;var he=g(ke);if(y!==void 0&&_.hasValue){var Ce=_.value;if(y(Ce,he))return B=Ce,Ce}return B=he,he}var ee=M,Ae=B;if(r(ee,ke))return Ae;var fe=g(ke);return y!==void 0&&y(Ae,fe)?Ae:(M=ke,B=fe,fe)},x=p===void 0?null:p,U=function(){return Q(h())},Te=x===null?void 0:function(){return Q(x())};return[U,Te]},[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}Mg.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Mg}process.env.NODE_ENV==="production"?Xy.exports=loe():Xy.exports=coe();var uoe=Xy.exports;class foe{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 doe(t){var e;const[n]=ce.useState(()=>new foe(t.editor)),r=uoe.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:aoe);return ce.useEffect(()=>n.watch(t.editor),[t.editor,n]),ce.useDebugValue(r),r}const bk=process.env.NODE_ENV!=="production",Zy=typeof window>"u",hoe=Zy||!!(typeof window<"u"&&window.next);class poe{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 Zy||hoe?(bk&&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&&Zy&&bk)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 Use(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 moe(t={},e=[]){const n=ce.useRef(t);n.current=t;const[r]=ce.useState(()=>new poe(n)),i=lp.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return ce.useDebugValue(i),ce.useEffect(r.onRender(e)),doe({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&s===0?0:s+1}),i}const xC=ce.createContext({editor:null}),goe=xC.Consumer;function yoe({children:t,slotAfter:e,slotBefore:n,editorContainerProps:r={},...i}){const s=moe(i);return s?ce.createElement(xC.Provider,{value:{editor:s}},n,ce.createElement(goe,null,({editor:o})=>ce.createElement(soe,{editor:o,...r})),t,e):null}const voe=ce.createContext({onDragStart:void 0}),boe=()=>ce.useContext(voe);ce.forwardRef((t,e)=>{const{onDragStart:n}=boe(),r=t.as||"div";return ce.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});const _oe=/^\s*>\s$/,Eoe=Xn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Ht(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[Hc({find:_oe,type:this.type})]}}),woe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Toe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Soe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Ooe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,koe=jr.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",Ht(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[Bo({find:woe,type:this.type}),Bo({find:Soe,type:this.type})]},addPasteRules(){return[Uo({find:Toe,type:this.type}),Uo({find:Ooe,type:this.type})]}}),Noe="listItem",_k="textStyle",Ek=/^\s*([-+*])\s$/,Aoe=Xn.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",Ht(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(Noe,this.editor.getAttributes(_k)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Hc({find:Ek,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Hc({find:Ek,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(_k),editor:this.editor})),[t]}}),Ioe=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,xoe=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,Coe=jr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Ht(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[Bo({find:Ioe,type:this.type})]},addPasteRules(){return[Uo({find:xoe,type:this.type})]}}),Doe=/^```([a-z]+)?[\s\n]$/,Roe=/^~~~([a-z]+)?[\s\n]$/,Moe=Xn.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",Ht(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(`
476
+
477
+ `);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(Le.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[Jy({find:Doe,type:this.type,getAttributes:t=>({language:t[1]})}),Jy({find:Roe,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new er({key:new Ti("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,`
478
+ `));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(xe.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),Poe=Xn.create({name:"doc",topNode:!0,content:"block+"});function Foe(t={}){return new er({view(e){return new $oe(e,t)}})}class $oe{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=_x(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 Loe=Sn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Foe(this.options)]}});class xt extends Le{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return xt.valid(r)?new xt(r):Le.near(r)}content(){return se.empty}eq(e){return e instanceof xt&&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 xt(e.resolve(n.pos))}getBookmark(){return new G0(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!Voe(e)||!joe(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&&xt.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(xt.valid(l))return l}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!ye.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(xt.valid(a))return a}return null}}}xt.prototype.visible=!1;xt.findFrom=xt.findGapCursorFrom;Le.jsonID("gapcursor",xt);class G0{constructor(e){this.pos=e}map(e){return new G0(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return xt.valid(n)?new xt(n):Le.near(n)}}function Voe(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 joe(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 Boe(){return new er({props:{decorations:zoe,createSelectionBetween(t,e,n){return e.pos==n.pos&&xt.valid(n)?new xt(n):null},handleClick:Woe,handleKeyDown:Uoe,handleDOMEvents:{beforeinput:qoe}}})}const Uoe=aC({ArrowLeft:Uf("horiz",-1),ArrowRight:Uf("horiz",1),ArrowUp:Uf("vert",-1),ArrowDown:Uf("vert",1)});function Uf(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 xe){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=xt.findGapCursorFrom(a,e,l);return u?(i&&i(r.tr.setSelection(new xt(u))),!0):!1}}function Woe(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!xt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ye.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new xt(r))),!0)}function qoe(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof xt))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=Y.empty;for(let o=r.length-1;o>=0;o--)i=Y.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new se(i,0,0));return s.setSelection(xe.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function zoe(t){if(!(t.selection instanceof xt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",zt.create(t.doc,[Cr.widget(t.selection.head,e,{key:"gapcursor"})])}const Qoe=Sn.create({name:"gapCursor",addProseMirrorPlugins(){return[Boe()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Qe(ue(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),Goe=Xn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Ht(this.options.HTMLAttributes,t)]},renderText(){return`
479
+ `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&l&&o){const h=l.filter(p=>a.includes(p.type.name));u.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Hoe=Xn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Ht(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Jy({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Zd=200,en=function(){};en.prototype.append=function(e){return e.length?(e=en.from(e),!this.length&&e||e.length<Zd&&this.leafAppend(e)||this.length<Zd&&e.leafPrepend(this)||this.appendInner(e)):this};en.prototype.prepend=function(e){return e.length?en.from(e).append(this):this};en.prototype.appendInner=function(e){return new Koe(this,e)};en.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?en.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};en.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};en.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};en.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},n,r),i};en.from=function(e){return e instanceof en?e:e&&e.length?new CC(e):en.empty};var CC=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Zd)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Zd)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(en);en.empty=new CC([]);var Koe=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(en);const Joe=500;class Yr{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,a,l,u=[],d=[];return this.items.forEach((h,p)=>{if(!h.step){i||(i=this.remapping(r,p+1),s=i.maps.length),s--,d.push(h);return}if(i){d.push(new fi(h.map));let g=h.step.map(i.slice(s)),y;g&&o.maybeStep(g).doc&&(y=o.mapping.maps[o.mapping.maps.length-1],u.push(new fi(y,void 0,void 0,u.length+d.length))),s--,y&&i.appendMap(y,s)}else o.maybeStep(h.step);if(h.selection)return a=i?h.selection.map(i.slice(s)):h.selection,l=new Yr(this.items.slice(0,r).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let h=e.steps[d].invert(e.docs[d]),p=new fi(e.mapping.maps[d],h,n),g;(g=l&&l.merge(p))&&(p=g,d?s.pop():a=a.slice(0,a.length-1)),s.push(p),n&&(o++,n=void 0),i||(l=p)}let u=o-r.depth;return u>Xoe&&(a=Yoe(a,u),o-=u),new Yr(a.append(s),o)}remapping(e,n){let r=new $a;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new Yr(this.items.append(e.map(n=>new fi(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},i);let l=n;this.items.forEach(p=>{let g=s.getMirror(--l);if(g==null)return;o=Math.min(o,g);let y=s.maps[g];if(p.step){let b=e.steps[g].invert(e.docs[g]),_=p.selection&&p.selection.map(s.slice(l+1,g));_&&a++,r.push(new fi(y,b,_))}else r.push(new fi(y))},i);let u=[];for(let p=n;p<o;p++)u.push(new fi(s.maps[p]));let d=this.items.slice(0,i).append(u).append(r),h=new Yr(d,a);return h.emptyItemCount()>Joe&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let d=o.selection&&o.selection.map(n.slice(r));d&&s++;let h=new fi(u.invert(),l,d),p,g=i.length-1;(p=i.length&&i[g].merge(h))?i[g]=p:i.push(h)}}else o.map&&r--},this.items.length,0),new Yr(en.from(i.reverse()),s)}}Yr.empty=new Yr(en.empty,0);function Yoe(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class fi{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new fi(n.getMap().invert(),n,this.selection)}}}class ws{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const Xoe=20;function Zoe(t,e,n,r){let i=n.getMeta(Co),s;if(i)return i.historyState;n.getMeta(nae)&&(t=new ws(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Co))return o.getMeta(Co).redo?new ws(t.done.addTransform(n,void 0,r,sd(e)),t.undone,wk(n.mapping.maps),t.prevTime,t.prevComposition):new ws(t.done,t.undone.addTransform(n,void 0,r,sd(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!eae(n,t.prevRanges)),u=o?Pg(t.prevRanges,n.mapping):wk(n.mapping.maps);return new ws(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,sd(e)),Yr.empty,u,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new ws(t.done.rebased(n,s),t.undone.rebased(n,s),Pg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new ws(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Pg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function eae(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function wk(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,o)=>e.push(s,o));return e}function Pg(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function tae(t,e,n){let r=sd(e),i=Co.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),l=new ws(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(Co,{redo:n,historyState:l})}let Fg=!1,Tk=null;function sd(t){let e=t.plugins;if(Tk!=e){Fg=!1,Tk=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Fg=!0;break}}return Fg}const Co=new Ti("history"),nae=new Ti("closeHistory");function rae(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new er({key:Co,state:{init(){return new ws(Yr.empty,Yr.empty,null,0,-1)},apply(e,n,r){return Zoe(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?RC:r=="historyRedo"?MC:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function DC(t,e){return(n,r)=>{let i=Co.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=tae(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const RC=DC(!1,!0),MC=DC(!0,!0),iae=Sn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>RC(t,e),redo:()=>({state:t,dispatch:e})=>MC(t,e)}},addProseMirrorPlugins(){return[rae(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),sae=Xn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Ht(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:i}=n,s=t();return r.parentOffset===0?s.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):dse(n)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:o,dispatch:a})=>{var l;if(a){const{$to:u}=o.selection,d=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?o.setSelection(xe.create(o.doc,u.pos+1)):u.nodeAfter.isBlock?o.setSelection(ye.create(o.doc,u.pos)):o.setSelection(xe.create(o.doc,u.pos));else{const h=(l=u.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();h&&(o.insert(d,h),o.setSelection(xe.create(o.doc,d+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Wse({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),oae=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,aae=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,lae=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,cae=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,uae=jr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Ht(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Bo({find:oae,type:this.type}),Bo({find:lae,type:this.type})]},addPasteRules(){return[Uo({find:aae,type:this.type}),Uo({find:cae,type:this.type})]}}),fae=Xn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ht(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),dae="listItem",Sk="textStyle",Ok=/^(\d+)\.\s$/,hae=Xn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Ht(this.options.HTMLAttributes,n),0]:["ol",Ht(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(dae,this.editor.getAttributes(Sk)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Hc({find:Ok,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Hc({find:Ok,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Sk)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),pae=Xn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Ht(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),mae=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,gae=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,yae=jr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Ht(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Bo({find:mae,type:this.type})]},addPasteRules(){return[Uo({find:gae,type:this.type})]}}),vae=Xn.create({name:"text",group:"inline"}),bae=Sn.create({name:"starterKit",addExtensions(){var t,e,n,r,i,s,o,a,l,u,d,h,p,g,y,b,_,w;const O=[];return this.options.bold!==!1&&O.push(koe.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&O.push(Eoe.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&O.push(Aoe.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&O.push(Coe.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&O.push(Moe.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&O.push(Poe.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&O.push(Loe.configure((o=this.options)===null||o===void 0?void 0:o.dropcursor)),this.options.gapcursor!==!1&&O.push(Qoe.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&O.push(Goe.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&O.push(Hoe.configure((u=this.options)===null||u===void 0?void 0:u.heading)),this.options.history!==!1&&O.push(iae.configure((d=this.options)===null||d===void 0?void 0:d.history)),this.options.horizontalRule!==!1&&O.push(sae.configure((h=this.options)===null||h===void 0?void 0:h.horizontalRule)),this.options.italic!==!1&&O.push(uae.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&O.push(fae.configure((g=this.options)===null||g===void 0?void 0:g.listItem)),this.options.orderedList!==!1&&O.push(hae.configure((y=this.options)===null||y===void 0?void 0:y.orderedList)),this.options.paragraph!==!1&&O.push(pae.configure((b=this.options)===null||b===void 0?void 0:b.paragraph)),this.options.strike!==!1&&O.push(yae.configure((_=this.options)===null||_===void 0?void 0:_.strike)),this.options.text!==!1&&O.push(vae.configure((w=this.options)===null||w===void 0?void 0:w.text)),O}}),_ae=({content:t,style:e})=>pe.jsx("div",{style:e,children:pe.jsx(yoe,{editable:!1,extensions:[bae,Jse,Hse,Gse,Qse,Kse.configure({types:["heading","paragraph"]})],content:t})});exports.RichTextEditorContent=_ae;exports.WellPlayedProvider=Mee;exports.graphql=yl;exports.readFragment=qee;exports.useOrganization=zI;exports.usePaginatedLoadAll=S0;exports.usePaginatedQuery=Pee;exports.usePlayers=QI;exports.useTournamentStep=Jee;exports.useTournamentTeams=GI;exports.useWellPlayed=UI;