@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
+ (function(Kt,ae){typeof exports=="object"&&typeof module<"u"?ae(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],ae):(Kt=typeof globalThis<"u"?globalThis:Kt||self,ae(Kt.WellPlayedReactSDK={},Kt.React,Kt.ReactDOM))})(this,function(Kt,ae,FC){"use strict";function LC(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 Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $C(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ea(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 up={exports:{}},_l={};/**
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 K0;function VC(){if(K0)return _l;K0=1;var t=ae,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 _l.Fragment=n,_l.jsx=o,_l.jsxs=o,_l}var El={};/**
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 J0;function jC(){return J0||(J0=1,process.env.NODE_ENV!=="production"&&function(){var t=ae,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,rt=Oe.getStackAddendum();rt!==""&&(J+="%s",ie=ie.concat([rt]));var ct=ie.map(function(Ye){return String(Ye)});ct.unshift("Warning: "+J),Function.prototype.apply.call(console[C],console,ct)}}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 rt=J.displayName||J.name||"";return rt!==""?ie+"("+rt+")":ie}function ke(C){return C.displayName||"Context"}function pe(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:pe(C.type)||"Memo";case p:{var rt=C,ct=rt._payload,Ye=rt._init;try{return pe(Ye(ct))}catch{return null}}}return null}var Ce=Object.assign,ee=0,Ae,fe,ve,Se,ht,Ne,$;function te(){}te.__reactDisabledLog=!0;function Z(){{if(ee===0){Ae=console.log,fe=console.info,ve=console.warn,Se=console.error,ht=console.group,Ne=console.groupCollapsed,$=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:ht}),groupCollapsed:Ce({},C,{value:Ne}),groupEnd:Ce({},C,{value:$})})}ee<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var be=w.ReactCurrentDispatcher,Me;function Je(C,J,ie){{if(Me===void 0)try{throw Error()}catch(rt){var Oe=rt.stack.trim().match(/\n( *(at )?)/);Me=Oe&&Oe[1]||""}return`
18
+ `+Me+C}}var tn=!1,bi;{var _i=typeof WeakMap=="function"?WeakMap:Map;bi=new _i}function Qt(C,J){if(!C||tn)return"";{var ie=bi.get(C);if(ie!==void 0)return ie}var Oe;tn=!0;var rt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ct;ct=be.current,be.current=null,Z();try{if(J){var Ye=function(){throw Error()};if(Object.defineProperty(Ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ye,[])}catch(Sn){Oe=Sn}Reflect.construct(C,[],Ye)}else{try{Ye.call()}catch(Sn){Oe=Sn}C.call(Ye.prototype)}}else{try{throw Error()}catch(Sn){Oe=Sn}C()}}catch(Sn){if(Sn&&Oe&&typeof Sn.stack=="string"){for(var Qe=Sn.stack.split(`
19
+ `),fn=Oe.stack.split(`
20
+ `),kt=Qe.length-1,Ct=fn.length-1;kt>=1&&Ct>=0&&Qe[kt]!==fn[Ct];)Ct--;for(;kt>=1&&Ct>=0;kt--,Ct--)if(Qe[kt]!==fn[Ct]){if(kt!==1||Ct!==1)do if(kt--,Ct--,Ct<0||Qe[kt]!==fn[Ct]){var dn=`
21
+ `+Qe[kt].replace(" at new "," at ");return C.displayName&&dn.includes("<anonymous>")&&(dn=dn.replace("<anonymous>",C.displayName)),typeof C=="function"&&bi.set(C,dn),dn}while(kt>=1&&Ct>=0);break}}}finally{tn=!1,be.current=ct,ne(),Error.prepareStackTrace=rt}var Ws=C?C.displayName||C.name:"",Pr=Ws?Je(Ws):"";return typeof C=="function"&&bi.set(C,Pr),Pr}function ph(C,J,ie){return Qt(C,!1)}function ur(C){var J=C.prototype;return!!(J&&J.isReactComponent)}function Ei(C,J,ie){if(C==null)return"";if(typeof C=="function")return Qt(C,ur(C));if(typeof C=="string")return Je(C);switch(C){case u:return Je("Suspense");case d:return Je("SuspenseList")}if(typeof C=="object")switch(C.$$typeof){case l:return ph(C.render);case h:return Ei(C.type,J,ie);case p:{var Oe=C,rt=Oe._payload,ct=Oe._init;try{return Ei(ct(rt),J,ie)}catch{}}}return""}var Uo=Object.prototype.hasOwnProperty,Mr={},Xc=w.ReactDebugCurrentFrame;function el(C){if(C){var J=C._owner,ie=Ei(C.type,C._source,J?J.type:null);Xc.setExtraStackFrame(ie)}else Xc.setExtraStackFrame(null)}function Wo(C,J,ie,Oe,rt){{var ct=Function.call.bind(Uo);for(var Ye in C)if(ct(C,Ye)){var Qe=void 0;try{if(typeof C[Ye]!="function"){var fn=Error((Oe||"React class")+": "+ie+" type `"+Ye+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof C[Ye]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw fn.name="Invariant Violation",fn}Qe=C[Ye](J,Ye,Oe,ie,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(kt){Qe=kt}Qe&&!(Qe instanceof Error)&&(el(rt),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,Ye,typeof Qe),el(null)),Qe instanceof Error&&!(Qe.message in Mr)&&(Mr[Qe.message]=!0,el(rt),O("Failed %s type: %s",ie,Qe.message),el(null))}}}var fr=Array.isArray;function Wi(C){return fr(C)}function tl(C){{var J=typeof Symbol=="function"&&Symbol.toStringTag,ie=J&&C[Symbol.toStringTag]||C.constructor.name||"Object";return ie}}function Ab(C){try{return Bs(C),!1}catch{return!0}}function Bs(C){return""+C}function mh(C){if(Ab(C))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",tl(C)),Bs(C)}var Zr=w.ReactCurrentOwner,Us={key:!0,ref:!0,__self:!0,__source:!0},nl,rl,qo;qo={};function Zc(C){if(Uo.call(C,"ref")){var J=Object.getOwnPropertyDescriptor(C,"ref").get;if(J&&J.isReactWarning)return!1}return C.ref!==void 0}function eu(C){if(Uo.call(C,"key")){var J=Object.getOwnPropertyDescriptor(C,"key").get;if(J&&J.isReactWarning)return!1}return C.key!==void 0}function tu(C,J){if(typeof C.ref=="string"&&Zr.current&&J&&Zr.current.stateNode!==J){var ie=pe(Zr.current.type);qo[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',pe(Zr.current.type),C.ref),qo[ie]=!0)}}function nu(C,J){{var ie=function(){nl||(nl=!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 ru(C,J){{var ie=function(){rl||(rl=!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 iu=function(C,J,ie,Oe,rt,ct,Ye){var Qe={$$typeof:e,type:C,key:J,ref:ie,props:Ye,_owner:ct};return Qe._store={},Object.defineProperty(Qe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Qe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Oe}),Object.defineProperty(Qe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:rt}),Object.freeze&&(Object.freeze(Qe.props),Object.freeze(Qe)),Qe};function Ib(C,J,ie,Oe,rt){{var ct,Ye={},Qe=null,fn=null;ie!==void 0&&(mh(ie),Qe=""+ie),eu(J)&&(mh(J.key),Qe=""+J.key),Zc(J)&&(fn=J.ref,tu(J,rt));for(ct in J)Uo.call(J,ct)&&!Us.hasOwnProperty(ct)&&(Ye[ct]=J[ct]);if(C&&C.defaultProps){var kt=C.defaultProps;for(ct in kt)Ye[ct]===void 0&&(Ye[ct]=kt[ct])}if(Qe||fn){var Ct=typeof C=="function"?C.displayName||C.name||"Unknown":C;Qe&&nu(Ye,Ct),fn&&ru(Ye,Ct)}return iu(C,Qe,fn,rt,Oe,Zr.current,Ye)}}var su=w.ReactCurrentOwner,gh=w.ReactDebugCurrentFrame;function qi(C){if(C){var J=C._owner,ie=Ei(C.type,C._source,J?J.type:null);gh.setExtraStackFrame(ie)}else gh.setExtraStackFrame(null)}var il;il=!1;function ou(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function yh(){{if(su.current){var C=pe(su.current.type);if(C)return`
22
+
23
+ Check the render method of \``+C+"`."}return""}}function xb(C){return""}var vh={};function bh(C){{var J=yh();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 _h(C,J){{if(!C._store||C._store.validated||C.key!=null)return;C._store.validated=!0;var ie=bh(J);if(vh[ie])return;vh[ie]=!0;var Oe="";C&&C._owner&&C._owner!==su.current&&(Oe=" It was passed a child from "+pe(C._owner.type)+"."),qi(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),qi(null)}}function Eh(C,J){{if(typeof C!="object")return;if(Wi(C))for(var ie=0;ie<C.length;ie++){var Oe=C[ie];ou(Oe)&&_h(Oe,J)}else if(ou(C))C._store&&(C._store.validated=!0);else if(C){var rt=_(C);if(typeof rt=="function"&&rt!==C.entries)for(var ct=rt.call(C),Ye;!(Ye=ct.next()).done;)ou(Ye.value)&&_h(Ye.value,J)}}}function Cb(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=pe(J);Wo(ie,C.props,"prop",Oe,C)}else if(J.PropTypes!==void 0&&!il){il=!0;var rt=pe(J);O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",rt||"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 au(C){{for(var J=Object.keys(C.props),ie=0;ie<J.length;ie++){var Oe=J[ie];if(Oe!=="children"&&Oe!=="key"){qi(C),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Oe),qi(null);break}}C.ref!==null&&(qi(C),O("Invalid attribute `ref` supplied to `React.Fragment`."),qi(null))}}var wh={};function sl(C,J,ie,Oe,rt,ct){{var Ye=U(C);if(!Ye){var Qe="";(C===void 0||typeof C=="object"&&C!==null&&Object.keys(C).length===0)&&(Qe+=" 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 fn=xb();fn?Qe+=fn:Qe+=yh();var kt;C===null?kt="null":Wi(C)?kt="array":C!==void 0&&C.$$typeof===e?(kt="<"+(pe(C.type)||"Unknown")+" />",Qe=" Did you accidentally export a JSX literal instead of a component?"):kt=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",kt,Qe)}var Ct=Ib(C,J,ie,rt,ct);if(Ct==null)return Ct;if(Ye){var dn=J.children;if(dn!==void 0)if(Oe)if(Wi(dn)){for(var Ws=0;Ws<dn.length;Ws++)Eh(dn[Ws],C);Object.freeze&&Object.freeze(dn)}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 Eh(dn,C)}if(Uo.call(J,"key")){var Pr=pe(C),Sn=Object.keys(J).filter(function(Th){return Th!=="key"}),lu=Sn.length>0?"{key: someKey, "+Sn.join(": ..., ")+": ...}":"{key: someKey}";if(!wh[Pr+lu]){var Fb=Sn.length>0?"{"+Sn.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} />`,lu,Pr,Fb,Pr),wh[Pr+lu]=!0}}return C===r?au(Ct):Cb(Ct),Ct}}function Db(C,J,ie){return sl(C,J,ie,!0)}function Rb(C,J,ie){return sl(C,J,ie,!1)}var Mb=Rb,Pb=Db;El.Fragment=r,El.jsx=Mb,El.jsxs=Pb}()),El}process.env.NODE_ENV==="production"?up.exports=VC():up.exports=jC();var he=up.exports,fp=function(t,e){return fp=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])},fp(t,e)};function vr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");fp(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 Nn(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 es(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 ts(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 St(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var dp="Invariant Violation",Y0=Object.setPrototypeOf,BC=Y0===void 0?function(t,e){return t.__proto__=e,t}:Y0,X0=function(t){vr(e,t);function e(n){n===void 0&&(n=dp);var r=t.call(this,typeof n=="number"?dp+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=dp,BC(r,e.prototype),r}return e}(Error);function Zs(t,e){if(!t)throw new X0(e)}var Su=["debug","log","warn","error","silent"],hp=Su.indexOf("log");function Ou(t){return function(){if(Su.indexOf(t)>=hp){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Ou("debug"),t.log=Ou("log"),t.warn=Ou("warn"),t.error=Ou("error")})(Zs||(Zs={}));function pp(t){var e=Su[hp];return hp=Math.max(0,Su.indexOf(t)),e}var mp="3.11.10";function br(t){try{return t()}catch{}}const gp=br(function(){return globalThis})||br(function(){return window})||br(function(){return self})||br(function(){return global})||br(function(){return br.constructor("return this")()});var Z0=new Map;function ku(t){var e=Z0.get(t)||1;return Z0.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function yp(t,e){e===void 0&&(e=0);var n=ku("stringifyForDisplay");return JSON.stringify(t,function(r,i){return i===void 0?n:i},e).split(JSON.stringify(n)).join("<undefined>")}function Nu(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=vp(i),e||(e=bp(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||Zs(e,vp(n,r)||bp(n,r))},{debug:Nu(Zs.debug),log:Nu(Zs.log),warn:Nu(Zs.warn),error:Nu(Zs.error)});function An(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new X0(vp(t,e)||bp(t,e))}var e_=Symbol.for("ApolloErrorMessageHandler_"+mp);function t_(t){if(typeof t=="string")return t;try{return yp(t,2).slice(0,1e3)}catch{return"<non-serializable>"}}function vp(t,e){if(e===void 0&&(e=[]),!!t)return gp[e_]&&gp[e_](t,e.map(t_))}function bp(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:mp,message:t,args:e.map(t_)})))}var UC=globalThis.__DEV__!==!1;const WC="16.9.0",qC=Object.freeze({major:16,minor:9,patch:0,preReleaseTag:null});function Ve(t,e){if(!!!t)throw new Error(e)}function nr(t){return typeof(t==null?void 0:t.then)=="function"}function rr(t){return typeof t=="object"&&t!==null}function Rt(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}const zC=/\r\n|[\n\r]/g;function Au(t,e){let n=0,r=1;for(const i of t.body.matchAll(zC)){if(typeof i.index=="number"||Rt(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function n_(t){return _p(t.source,Au(t.source,t.start))}function _p(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+r_([[`${o} |`,y[0]],...y.slice(1,p+1).map(b=>["|",b]),["|","^".padStart(g)],["|",y[p+1]]])}return u+r_([[`${o-1} |`,d[i-1]],[`${o} |`,h],["|","^".padStart(l)],[`${o+1} |`,d[i+1]]])}function r_(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 QC(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 CC extends Error{constructor(e,...n){var r,i,s;const{nodes:o,source:a,positions:l,path:u,originalError:d,extensions:h}=QC(n);super(e),this.name="GraphQLError",this.path=u??void 0,this.originalError=d??void 0,this.nodes=i_(Array.isArray(o)?o:o?[o]:void 0);const p=i_((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=>Au(a,y)):p==null?void 0:p.map(y=>Au(y.source,y.start));const g=rr(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,CC):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
+ `+n_(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+=`
35
+
36
+ `+_p(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 i_(t){return t===void 0||t.length===0?void 0:t}function GC(t){return t.toString()}function HC(t){return t.toJSON()}function Bt(t,e,n){return new j(`Syntax Error: ${n}`,{source:t,positions:[e]})}class s_{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 Ep{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 o_={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"]},KC=new Set(Object.keys(o_));function wp(t){const e=t==null?void 0:t.kind;return typeof e=="string"&&KC.has(e)}var Ut;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(Ut||(Ut={}));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 Tp(t){return t===9||t===32}function wl(t){return t>=48&&t<=57}function a_(t){return t>=97&&t<=122||t>=65&&t<=90}function Sp(t){return a_(t)||t===95}function l_(t){return a_(t)||wl(t)||t===95}function JC(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=YC(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 YC(t){let e=0;for(;e<t.length&&Tp(t.charCodeAt(e));)++e;return e}function XC(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 c_(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||Tp(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&&Tp(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 Op{constructor(e){const n=new Ep(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=ZC(this,e.end);e.next=n,n.prev=e,e=n}while(e.kind===q.COMMENT);return e}}function u_(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 ta(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function Iu(t,e){return f_(t.charCodeAt(e))&&d_(t.charCodeAt(e+1))}function f_(t){return t>=55296&&t<=56319}function d_(t){return t>=56320&&t<=57343}function eo(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 $t(t,e,n,r,i){const s=t.line,o=1+n-t.lineStart;return new Ep(e,n,r,s,o,i)}function ZC(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 eD(t,i);case 33:return $t(t,q.BANG,i,i+1);case 36:return $t(t,q.DOLLAR,i,i+1);case 38:return $t(t,q.AMP,i,i+1);case 40:return $t(t,q.PAREN_L,i,i+1);case 41:return $t(t,q.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return $t(t,q.SPREAD,i,i+3);break;case 58:return $t(t,q.COLON,i,i+1);case 61:return $t(t,q.EQUALS,i,i+1);case 64:return $t(t,q.AT,i,i+1);case 91:return $t(t,q.BRACKET_L,i,i+1);case 93:return $t(t,q.BRACKET_R,i,i+1);case 123:return $t(t,q.BRACE_L,i,i+1);case 124:return $t(t,q.PIPE,i,i+1);case 125:return $t(t,q.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?oD(t,i):nD(t,i)}if(wl(s)||s===45)return tD(t,i,s);if(Sp(s))return aD(t,i);throw Bt(t.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:ta(s)||Iu(n,i)?`Unexpected character: ${eo(t,i)}.`:`Invalid character: ${eo(t,i)}.`)}return $t(t,q.EOF,r,r)}function eD(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(ta(s))++i;else if(Iu(n,i))i+=2;else break}return $t(t,q.COMMENT,e,i,n.slice(e+1,i))}function tD(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),wl(s))throw Bt(t.source,i,`Invalid number, unexpected digit after 0: ${eo(t,i)}.`)}else i=kp(t,i,s),s=r.charCodeAt(i);if(s===46&&(o=!0,s=r.charCodeAt(++i),i=kp(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=kp(t,i,s),s=r.charCodeAt(i)),s===46||Sp(s))throw Bt(t.source,i,`Invalid number, expected digit but got: ${eo(t,i)}.`);return $t(t,o?q.FLOAT:q.INT,e,i,r.slice(e,i))}function kp(t,e,n){if(!wl(n))throw Bt(t.source,e,`Invalid number, expected digit but got: ${eo(t,e)}.`);const r=t.source.body;let i=e+1;for(;wl(r.charCodeAt(i));)++i;return i}function nD(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),$t(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?rD(t,i):iD(t,i):sD(t,i);o+=l.value,i+=l.size,s=i;continue}if(a===10||a===13)break;if(ta(a))++i;else if(Iu(n,i))i+=2;else throw Bt(t.source,i,`Invalid character within String: ${eo(t,i)}.`)}throw Bt(t.source,i,"Unterminated string.")}function rD(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||!ta(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Tl(s),r<0)break}throw Bt(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+i)}".`)}function iD(t,e){const n=t.source.body,r=h_(n,e+2);if(ta(r))return{value:String.fromCodePoint(r),size:6};if(f_(r)&&n.charCodeAt(e+6)===92&&n.charCodeAt(e+7)===117){const i=h_(n,e+8);if(d_(i))return{value:String.fromCodePoint(r,i),size:12}}throw Bt(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function h_(t,e){return Tl(t.charCodeAt(e))<<12|Tl(t.charCodeAt(e+1))<<8|Tl(t.charCodeAt(e+2))<<4|Tl(t.charCodeAt(e+3))}function Tl(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function sD(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 Bt(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function oD(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=$t(t,q.BLOCK_STRING,e,s+3,JC(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(ta(u))++s;else if(Iu(n,s))s+=2;else throw Bt(t.source,s,`Invalid character within String: ${eo(t,s)}.`)}throw Bt(t.source,s,"Unterminated string.")}function aD(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(l_(s))++i;else break}return $t(t,q.NAME,e,i,n.slice(e,i))}const lD=10,p_=2;function z(t){return xu(t,[])}function xu(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return cD(t,e);default:return String(t)}}function cD(t,e){if(t===null)return"null";if(e.includes(t))return"[Circular]";const n=[...e,t];if(uD(t)){const r=t.toJSON();if(r!==t)return typeof r=="string"?r:xu(r,n)}else if(Array.isArray(t))return dD(t,n);return fD(t,n)}function uD(t){return typeof t.toJSON=="function"}function fD(t,e){const n=Object.entries(t);return n.length===0?"{}":e.length>p_?"["+hD(t)+"]":"{ "+n.map(([i,s])=>i+": "+xu(s,e)).join(", ")+" }"}function dD(t,e){if(t.length===0)return"[]";if(e.length>p_)return"[Array]";const n=Math.min(lD,t.length),r=t.length-n,i=[];for(let s=0;s<n;++s)i.push(xu(t[s],e));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function hD(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 qr=globalThis.process&&process.env.NODE_ENV==="production"?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 Cu{constructor(e,n="GraphQL request",r={line:1,column:1}){typeof e=="string"||Ve(!1,`Body must be a string. Received: ${z(e)}.`),this.body=e,this.name=n,this.locationOffset=r,this.locationOffset.line>0||Ve(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ve(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function m_(t){return qr(t,Cu)}function Sl(t,e){return new Du(t,e).parseDocument()}function g_(t,e){const n=new Du(t,e);n.expectToken(q.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(q.EOF),r}function pD(t,e){const n=new Du(t,e);n.expectToken(q.SOF);const r=n.parseConstValueLiteral();return n.expectToken(q.EOF),r}function mD(t,e){const n=new Du(t,e);n.expectToken(q.SOF);const r=n.parseTypeReference();return n.expectToken(q.EOF),r}class Du{constructor(e,n={}){const r=m_(e)?e:new Cu(e);this._lexer=new Op(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 Bt(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:Ut.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 Ut.QUERY;case"mutation":return Ut.MUTATION;case"subscription":return Ut.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 Bt(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 Bt(this._lexer.source,this._lexer.token.start,`${Ru(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 s_(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 Bt(this._lexer.source,n.start,`Expected ${y_(e)}, found ${Ru(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 Bt(this._lexer.source,n.start,`Expected "${e}", found ${Ru(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 Bt(this._lexer.source,n.start,`Unexpected ${Ru(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 Bt(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function Ru(t){const e=t.value;return y_(t.kind)+(e!=null?` "${e}"`:"")}function y_(t){return u_(t)?`"${t}"`:t}const gD=5;function Oi(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,gD),a=o.pop();return i+o.join(", ")+", or "+a+"?"}function v_(t){return t}function ki(t,e){const n=Object.create(null);for(const r of t)n[e(r)]=r;return n}function ns(t,e,n){const r=Object.create(null);for(const i of t)r[e(i)]=n(i);return r}function Ni(t,e){const n=Object.create(null);for(const r of Object.keys(t))n[r]=e(t[r],r);return n}function Ol(t,e){let n=0,r=0;for(;n<t.length&&r<e.length;){let i=t.charCodeAt(n),s=e.charCodeAt(r);if(Mu(i)&&Mu(s)){let o=0;do++n,o=o*10+i-Np,i=t.charCodeAt(n);while(Mu(i)&&o>0);let a=0;do++r,a=a*10+s-Np,s=e.charCodeAt(r);while(Mu(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 Np=48,yD=57;function Mu(t){return!isNaN(t)&&Np<=t&&t<=yD}function rs(t,e){const n=Object.create(null),r=new vD(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:Ol(s,o)})}class vD{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=b_(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=b_(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 b_(t){const e=t.length,n=new Array(e);for(let r=0;r<e;++r)n[r]=t.charCodeAt(r);return n}function _r(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 bD(t){return`"${t.replace(_D,ED)}"`}const _D=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function ED(t){return wD[t.charCodeAt(0)]}const wD=["\\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"],is=Object.freeze({});function rn(t,e,n=o_){const r=new Map;for(const w of Object.values(k))r.set(w,na(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;wp(u)||Ve(!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===is)break;if(N===!1){if(!w){p.pop();continue}}else if(N!==void 0&&(l.push([d,N]),!w))if(wp(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 Ap(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}=na(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===is)e[h]=is;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===is)e[h]=is;else if(p!==void 0&&p!==!1)return p}else e[h]===u&&(e[h]=null)}};n[r]=a}return n}function na(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 TD(t,e,n){const{enter:r,leave:i}=na(t,e);return n?i:r}function mt(t){return rn(t,OD)}const SD=80,OD={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>ce(t.definitions,`
52
+
53
+ `)},OperationDefinition:{leave(t){const e=Ke("(",ce(t.variableDefinitions,", "),")"),n=ce([t.operation,ce([t.name,e]),ce(t.directives," ")]," ");return(n==="query"?"":n+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:n,directives:r})=>t+": "+e+Ke(" = ",n)+Ke(" ",ce(r," "))},SelectionSet:{leave:({selections:t})=>zr(t)},Field:{leave({alias:t,name:e,arguments:n,directives:r,selectionSet:i}){const s=Ke("",t,": ")+e;let o=s+Ke("(",ce(n,", "),")");return o.length>SD&&(o=s+Ke(`(
54
+ `,Pu(ce(n,`
55
+ `)),`
56
+ )`)),ce([o,ce(r," "),i]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+Ke(" ",ce(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:n})=>ce(["...",Ke("on ",t),ce(e," "),n]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${t}${Ke("(",ce(n,", "),")")} on ${e} ${Ke("",ce(r," ")," ")}`+i},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?c_(t):bD(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+ce(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+ce(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+Ke("(",ce(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:n})=>Ke("",t,`
57
+ `)+ce(["schema",ce(e," "),zr(n)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:n})=>Ke("",t,`
58
+ `)+ce(["scalar",e,ce(n," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>Ke("",t,`
59
+ `)+ce(["type",e,Ke("implements ",ce(n," & ")),ce(r," "),zr(i)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:n,type:r,directives:i})=>Ke("",t,`
60
+ `)+e+(__(n)?Ke(`(
61
+ `,Pu(ce(n,`
62
+ `)),`
63
+ )`):Ke("(",ce(n,", "),")"))+": "+r+Ke(" ",ce(i," "))},InputValueDefinition:{leave:({description:t,name:e,type:n,defaultValue:r,directives:i})=>Ke("",t,`
64
+ `)+ce([e+": "+n,Ke("= ",r),ce(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>Ke("",t,`
65
+ `)+ce(["interface",e,Ke("implements ",ce(n," & ")),ce(r," "),zr(i)]," ")},UnionTypeDefinition:{leave:({description:t,name:e,directives:n,types:r})=>Ke("",t,`
66
+ `)+ce(["union",e,ce(n," "),Ke("= ",ce(r," | "))]," ")},EnumTypeDefinition:{leave:({description:t,name:e,directives:n,values:r})=>Ke("",t,`
67
+ `)+ce(["enum",e,ce(n," "),zr(r)]," ")},EnumValueDefinition:{leave:({description:t,name:e,directives:n})=>Ke("",t,`
68
+ `)+ce([e,ce(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:t,name:e,directives:n,fields:r})=>Ke("",t,`
69
+ `)+ce(["input",e,ce(n," "),zr(r)]," ")},DirectiveDefinition:{leave:({description:t,name:e,arguments:n,repeatable:r,locations:i})=>Ke("",t,`
70
+ `)+"directive @"+e+(__(n)?Ke(`(
71
+ `,Pu(ce(n,`
72
+ `)),`
73
+ )`):Ke("(",ce(n,", "),")"))+(r?" repeatable":"")+" on "+ce(i," | ")},SchemaExtension:{leave:({directives:t,operationTypes:e})=>ce(["extend schema",ce(t," "),zr(e)]," ")},ScalarTypeExtension:{leave:({name:t,directives:e})=>ce(["extend scalar",t,ce(e," ")]," ")},ObjectTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>ce(["extend type",t,Ke("implements ",ce(e," & ")),ce(n," "),zr(r)]," ")},InterfaceTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>ce(["extend interface",t,Ke("implements ",ce(e," & ")),ce(n," "),zr(r)]," ")},UnionTypeExtension:{leave:({name:t,directives:e,types:n})=>ce(["extend union",t,ce(e," "),Ke("= ",ce(n," | "))]," ")},EnumTypeExtension:{leave:({name:t,directives:e,values:n})=>ce(["extend enum",t,ce(e," "),zr(n)]," ")},InputObjectTypeExtension:{leave:({name:t,directives:e,fields:n})=>ce(["extend input",t,ce(e," "),zr(n)]," ")}};function ce(t,e=""){var n;return(n=t==null?void 0:t.filter(r=>r).join(e))!==null&&n!==void 0?n:""}function zr(t){return Ke(`{
74
+ `,Pu(ce(t,`
75
+ `)),`
76
+ }`)}function Ke(t,e,n=""){return e!=null&&e!==""?t+e+n:""}function Pu(t){return Ke(" ",t.replace(/\n/g,`
77
+ `))}function __(t){var e;return(e=t==null?void 0:t.some(n=>n.includes(`
78
+ `)))!==null&&e!==void 0?e:!1}function Fu(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=>Fu(n,e));case k.OBJECT:return ns(t.fields,n=>n.name.value,n=>Fu(n.value,e));case k.VARIABLE:return e==null?void 0:e[t.name.value]}}function ir(t){if(t!=null||Ve(!1,"Must provide name."),typeof t=="string"||Ve(!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(!l_(t.charCodeAt(e)))throw new j(`Names must only contain [_a-zA-Z0-9] but "${t}" does not.`);if(!Sp(t.charCodeAt(0)))throw new j(`Names must start with [_a-zA-Z] but "${t}" does not.`);return t}function E_(t){if(t==="true"||t==="false"||t==="null")throw new j(`Enum values cannot be named: ${t}`);return ir(t)}function kl(t){return sr(t)||et(t)||ot(t)||Wt(t)||Vt(t)||gt(t)||bt(t)||Ie(t)}function kD(t){if(!kl(t))throw new Error(`Expected ${z(t)} to be a GraphQL type.`);return t}function sr(t){return qr(t,ai)}function ND(t){if(!sr(t))throw new Error(`Expected ${z(t)} to be a GraphQL Scalar type.`);return t}function et(t){return qr(t,Er)}function w_(t){if(!et(t))throw new Error(`Expected ${z(t)} to be a GraphQL Object type.`);return t}function ot(t){return qr(t,ia)}function T_(t){if(!ot(t))throw new Error(`Expected ${z(t)} to be a GraphQL Interface type.`);return t}function Wt(t){return qr(t,sa)}function AD(t){if(!Wt(t))throw new Error(`Expected ${z(t)} to be a GraphQL Union type.`);return t}function Vt(t){return qr(t,ls)}function ID(t){if(!Vt(t))throw new Error(`Expected ${z(t)} to be a GraphQL Enum type.`);return t}function gt(t){return qr(t,oa)}function xD(t){if(!gt(t))throw new Error(`Expected ${z(t)} to be a GraphQL Input Object type.`);return t}function bt(t){return qr(t,sn)}function CD(t){if(!bt(t))throw new Error(`Expected ${z(t)} to be a GraphQL List type.`);return t}function Ie(t){return qr(t,je)}function DD(t){if(!Ie(t))throw new Error(`Expected ${z(t)} to be a GraphQL Non-Null type.`);return t}function Un(t){return sr(t)||Vt(t)||gt(t)||Nl(t)&&Un(t.ofType)}function RD(t){if(!Un(t))throw new Error(`Expected ${z(t)} to be a GraphQL input type.`);return t}function ss(t){return sr(t)||et(t)||ot(t)||Wt(t)||Vt(t)||Nl(t)&&ss(t.ofType)}function MD(t){if(!ss(t))throw new Error(`Expected ${z(t)} to be a GraphQL output type.`);return t}function ii(t){return sr(t)||Vt(t)}function PD(t){if(!ii(t))throw new Error(`Expected ${z(t)} to be a GraphQL leaf type.`);return t}function si(t){return et(t)||ot(t)||Wt(t)}function FD(t){if(!si(t))throw new Error(`Expected ${z(t)} to be a GraphQL composite type.`);return t}function oi(t){return ot(t)||Wt(t)}function LD(t){if(!oi(t))throw new Error(`Expected ${z(t)} to be a GraphQL abstract type.`);return t}class sn{constructor(e){kl(e)||Ve(!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){Ip(e)||Ve(!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 Nl(t){return bt(t)||Ie(t)}function $D(t){if(!Nl(t))throw new Error(`Expected ${z(t)} to be a GraphQL wrapping type.`);return t}function Ip(t){return kl(t)&&!Ie(t)}function S_(t){if(!Ip(t))throw new Error(`Expected ${z(t)} to be a GraphQL nullable type.`);return t}function xp(t){if(t)return Ie(t)?t.ofType:t}function Al(t){return sr(t)||et(t)||ot(t)||Wt(t)||Vt(t)||gt(t)}function VD(t){if(!Al(t))throw new Error(`Expected ${z(t)} to be a GraphQL named type.`);return t}function In(t){if(t){let e=t;for(;Nl(e);)e=e.ofType;return e}}function Cp(t){return typeof t=="function"?t():t}function Dp(t){return typeof t=="function"?t():t}class ai{constructor(e){var n,r,i,s;const o=(n=e.parseValue)!==null&&n!==void 0?n:v_;this.name=ir(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=(r=e.serialize)!==null&&r!==void 0?r:v_,this.parseValue=o,this.parseLiteral=(i=e.parseLiteral)!==null&&i!==void 0?i:(a,l)=>o(Fu(a,l)),this.extensions=_r(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(s=e.extensionASTNodes)!==null&&s!==void 0?s:[],e.specifiedByURL==null||typeof e.specifiedByURL=="string"||Ve(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${z(e.specifiedByURL)}.`),e.serialize==null||typeof e.serialize=="function"||Ve(!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"||Ve(!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 Er{constructor(e){var n;this.name=ir(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=_r(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>k_(e),this._interfaces=()=>O_(e),e.isTypeOf==null||typeof e.isTypeOf=="function"||Ve(!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:A_(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function O_(t){var e;const n=Cp((e=t.interfaces)!==null&&e!==void 0?e:[]);return Array.isArray(n)||Ve(!1,`${t.name} interfaces must be an Array or a function which returns an Array.`),n}function k_(t){const e=Dp(t.fields);return ra(e)||Ve(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),Ni(e,(n,r)=>{var i;ra(n)||Ve(!1,`${t.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||Ve(!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 ra(s)||Ve(!1,`${t.name}.${r} args must be an object with argument names as keys.`),{name:ir(r),description:n.description,type:n.type,args:N_(s),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:_r(n.extensions),astNode:n.astNode}})}function N_(t){return Object.entries(t).map(([e,n])=>({name:ir(e),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:_r(n.extensions),astNode:n.astNode}))}function ra(t){return rr(t)&&!Array.isArray(t)}function A_(t){return Ni(t,e=>({description:e.description,type:e.type,args:I_(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function I_(t){return ns(t,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function as(t){return Ie(t.type)&&t.defaultValue===void 0}class ia{constructor(e){var n;this.name=ir(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=_r(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=k_.bind(void 0,e),this._interfaces=O_.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||Ve(!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:A_(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class sa{constructor(e){var n;this.name=ir(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=_r(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=jD.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||Ve(!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 jD(t){const e=Cp(t.types);return Array.isArray(e)||Ve(!1,`Must provide Array of types or a function which returns such an array for Union ${t.name}.`),e}class ls{constructor(e){var n;this.name=ir(e.name),this.description=e.description,this.extensions=_r(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof e.values=="function"?e.values:x_(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=x_(this.name,this._values())),this._values}getValue(e){return this._nameLookup===null&&(this._nameLookup=ki(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}.`+Lu(this,r))}const n=this.getValue(e);if(n==null)throw new j(`Value "${e}" does not exist in "${this.name}" enum.`+Lu(this,e));return n.value}parseLiteral(e,n){if(e.kind!==k.ENUM){const i=mt(e);throw new j(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+Lu(this,i),{nodes:e})}const r=this.getValue(e.value);if(r==null){const i=mt(e);throw new j(`Value "${i}" does not exist in "${this.name}" enum.`+Lu(this,i),{nodes:e})}return r.value}toConfig(){const e=ns(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 Lu(t,e){const n=t.getValues().map(i=>i.name),r=rs(e,n);return Oi("the enum value",r)}function x_(t,e){return ra(e)||Ve(!1,`${t} values must be an object with value names as keys.`),Object.entries(e).map(([n,r])=>(ra(r)||Ve(!1,`${t}.${n} must refer to an object with a "value" key representing an internal value but got: ${z(r)}.`),{name:E_(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:_r(r.extensions),astNode:r.astNode}))}class oa{constructor(e){var n,r;this.name=ir(e.name),this.description=e.description,this.extensions=_r(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=BD.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const e=Ni(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 BD(t){const e=Dp(t.fields);return ra(e)||Ve(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),Ni(e,(n,r)=>(!("resolve"in n)||Ve(!1,`${t.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:ir(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:_r(n.extensions),astNode:n.astNode}))}function $u(t){return Ie(t.type)&&t.defaultValue===void 0}function Vu(t,e){return t===e?!0:Ie(t)&&Ie(e)||bt(t)&&bt(e)?Vu(t.ofType,e.ofType):!1}function to(t,e,n){return e===n?!0:Ie(n)?Ie(e)?to(t,e.ofType,n.ofType):!1:Ie(e)?to(t,e.ofType,n):bt(n)?bt(e)?to(t,e.ofType,n.ofType):!1:bt(e)?!1:oi(n)&&(ot(e)||et(e))&&t.isSubType(n,e)}function Rp(t,e,n){return e===n?!0:oi(e)?oi(n)?t.getPossibleTypes(e).some(r=>t.isSubType(n,r)):t.isSubType(e,n):oi(n)?t.isSubType(n,e):!1}const ju=2147483647,Bu=-2147483648,C_=new ai({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=xl(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>ju||n<Bu)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>ju||t<Bu)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: ${mt(t)}`,{nodes:t});const e=parseInt(t.value,10);if(e>ju||e<Bu)throw new j(`Int cannot represent non 32-bit signed integer value: ${t.value}`,{nodes:t});return e}}),D_=new ai({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=xl(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: ${mt(t)}`,t);return parseFloat(t.value)}}),At=new ai({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=xl(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: ${mt(t)}`,{nodes:t});return t.value}}),Wn=new ai({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(t){const e=xl(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: ${mt(t)}`,{nodes:t});return t.value}}),Mp=new ai({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=xl(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: "+mt(t),{nodes:t});return t.value}}),Il=Object.freeze([At,C_,D_,Wn,Mp]);function Uu(t){return Il.some(({name:e})=>t.name===e)}function xl(t){if(rr(t)){if(typeof t.valueOf=="function"){const e=t.valueOf();if(!rr(e))return e}if(typeof t.toJSON=="function")return t.toJSON()}return t}function Wu(t){return qr(t,Qr)}function UD(t){if(!Wu(t))throw new Error(`Expected ${z(t)} to be a GraphQL directive.`);return t}class Qr{constructor(e){var n,r;this.name=ir(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=(n=e.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=_r(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||Ve(!1,`@${e.name} locations must be an Array.`);const i=(r=e.args)!==null&&r!==void 0?r:{};rr(i)&&!Array.isArray(i)||Ve(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=N_(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:I_(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const Pp=new Qr({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(Wn),description:"Included when true."}}}),Fp=new Qr({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(Wn),description:"Skipped when true."}}}),Lp="No longer supported",qu=new Qr({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:At,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:Lp}}}),$p=new Qr({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[me.SCALAR],args:{url:{type:new je(At),description:"The URL that specifies the behavior of this scalar."}}}),Vp=new Qr({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[me.INPUT_OBJECT],args:{}}),cs=Object.freeze([Pp,Fp,qu,$p,Vp]);function jp(t){return cs.some(({name:e})=>e===t.name)}function Bp(t){return typeof t=="object"&&typeof(t==null?void 0:t[Symbol.iterator])=="function"}function us(t,e){if(Ie(e)){const n=us(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(bt(e)){const n=e.ofType;if(Bp(t)){const r=[];for(const i of t){const s=us(i,n);s!=null&&r.push(s)}return{kind:k.LIST,values:r}}return us(t,n)}if(gt(e)){if(!rr(t))return null;const n=[];for(const r of Object.values(e.getFields())){const i=us(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(ii(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 R_.test(r)?{kind:k.INT,value:r}:{kind:k.FLOAT,value:r}}if(typeof n=="string")return Vt(e)?{kind:k.ENUM,value:n}:e===Mp&&R_.test(n)?{kind:k.INT,value:n}:{kind:k.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${z(n)}.`)}Rt(!1,"Unexpected input type: "+z(e))}const R_=/^-?(?:0|[1-9][0-9]*)$/,zu=new Er({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:At,resolve:t=>t.description},types:{description:"A list of all types supported by this server.",type:new je(new sn(new je(wr))),resolve(t){return Object.values(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new je(wr),resolve:t=>t.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:wr,resolve:t=>t.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:wr,resolve:t=>t.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new je(new sn(new je(Up))),resolve:t=>t.getDirectives()}})}),Up=new Er({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(At),resolve:t=>t.name},description:{type:At,resolve:t=>t.description},isRepeatable:{type:new je(Wn),resolve:t=>t.isRepeatable},locations:{type:new je(new sn(new je(Wp))),resolve:t=>t.locations},args:{type:new je(new sn(new je(Cl))),args:{includeDeprecated:{type:Wn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}}})}),Wp=new ls({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."}}}),wr=new Er({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(Qp),resolve(t){if(sr(t))return ft.SCALAR;if(et(t))return ft.OBJECT;if(ot(t))return ft.INTERFACE;if(Wt(t))return ft.UNION;if(Vt(t))return ft.ENUM;if(gt(t))return ft.INPUT_OBJECT;if(bt(t))return ft.LIST;if(Ie(t))return ft.NON_NULL;Rt(!1,`Unexpected type: "${z(t)}".`)}},name:{type:At,resolve:t=>"name"in t?t.name:void 0},description:{type:At,resolve:t=>"description"in t?t.description:void 0},specifiedByURL:{type:At,resolve:t=>"specifiedByURL"in t?t.specifiedByURL:void 0},fields:{type:new sn(new je(qp)),args:{includeDeprecated:{type:Wn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(et(t)||ot(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new sn(new je(wr)),resolve(t){if(et(t)||ot(t))return t.getInterfaces()}},possibleTypes:{type:new sn(new je(wr)),resolve(t,e,n,{schema:r}){if(oi(t))return r.getPossibleTypes(t)}},enumValues:{type:new sn(new je(zp)),args:{includeDeprecated:{type:Wn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(Vt(t)){const n=t.getValues();return e?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new sn(new je(Cl)),args:{includeDeprecated:{type:Wn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(gt(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:wr,resolve:t=>"ofType"in t?t.ofType:void 0},isOneOf:{type:Wn,resolve:t=>{if(gt(t))return t.isOneOf}}})}),qp=new Er({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(At),resolve:t=>t.name},description:{type:At,resolve:t=>t.description},args:{type:new je(new sn(new je(Cl))),args:{includeDeprecated:{type:Wn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}},type:{type:new je(wr),resolve:t=>t.type},isDeprecated:{type:new je(Wn),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:At,resolve:t=>t.deprecationReason}})}),Cl=new Er({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(At),resolve:t=>t.name},description:{type:At,resolve:t=>t.description},type:{type:new je(wr),resolve:t=>t.type},defaultValue:{type:At,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(t){const{type:e,defaultValue:n}=t,r=us(n,e);return r?mt(r):null}},isDeprecated:{type:new je(Wn),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:At,resolve:t=>t.deprecationReason}})}),zp=new Er({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(At),resolve:t=>t.name},description:{type:At,resolve:t=>t.description},isDeprecated:{type:new je(Wn),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:At,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 Qp=new ls({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."}}}),Dl={name:"__schema",type:new je(zu),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},Rl={name:"__type",type:wr,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new je(At),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},Ml={name:"__typename",type:new je(At),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},Pl=Object.freeze([zu,Up,Wp,wr,qp,Cl,zp,Qp]);function no(t){return Pl.some(({name:e})=>t.name===e)}function M_(t){return qr(t,aa)}function Gp(t){if(!M_(t))throw new Error(`Expected ${z(t)} to be a GraphQL schema.`);return t}class aa{constructor(e){var n,r;this.__validationErrors=e.assumeValid===!0?[]:void 0,rr(e)||Ve(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||Ve(!1,`"types" must be Array if provided but got: ${z(e.types)}.`),!e.directives||Array.isArray(e.directives)||Ve(!1,`"directives" must be Array if provided but got: ${z(e.directives)}.`),this.description=e.description,this.extensions=_r(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:cs;const i=new Set(e.types);if(e.types!=null)for(const s of e.types)i.delete(s),Gr(s,i);this._queryType!=null&&Gr(this._queryType,i),this._mutationType!=null&&Gr(this._mutationType,i),this._subscriptionType!=null&&Gr(this._subscriptionType,i);for(const s of this._directives)if(Wu(s))for(const o of s.args)Gr(o.type,i);Gr(zu,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||Ve(!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,ot(s)){for(const a of s.getInterfaces())if(ot(a)){let l=this._implementationsMap[a.name];l===void 0&&(l=this._implementationsMap[a.name]={objects:[],interfaces:[]}),l.interfaces.push(s)}}else if(et(s)){for(const a of s.getInterfaces())if(ot(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 Ut.QUERY:return this.getQueryType();case Ut.MUTATION:return this.getMutationType();case Ut.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return Wt(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),Wt(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 Gr(t,e){const n=In(t);if(!e.has(n)){if(e.add(n),Wt(n))for(const r of n.getTypes())Gr(r,e);else if(et(n)||ot(n)){for(const r of n.getInterfaces())Gr(r,e);for(const r of Object.values(n.getFields())){Gr(r.type,e);for(const i of r.args)Gr(i.type,e)}}else if(gt(n))for(const r of Object.values(n.getFields()))Gr(r.type,e)}return e}function Hp(t){if(Gp(t),t.__validationErrors)return t.__validationErrors;const e=new WD(t);qD(e),zD(e),QD(e);const n=e.getErrors();return t.__validationErrors=n,n}function Kp(t){const e=Hp(t);if(e.length!==0)throw new Error(e.map(n=>n.message).join(`
81
+
82
+ `))}class WD{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 qD(t){const e=t.schema,n=e.getQueryType();if(!n)t.reportError("Query root type must be provided.",e.astNode);else if(!et(n)){var r;t.reportError(`Query root type must be Object type, it cannot be ${z(n)}.`,(r=Jp(e,Ut.QUERY))!==null&&r!==void 0?r:n.astNode)}const i=e.getMutationType();if(i&&!et(i)){var s;t.reportError(`Mutation root type must be Object type if provided, it cannot be ${z(i)}.`,(s=Jp(e,Ut.MUTATION))!==null&&s!==void 0?s:i.astNode)}const o=e.getSubscriptionType();if(o&&!et(o)){var a;t.reportError(`Subscription root type must be Object type if provided, it cannot be ${z(o)}.`,(a=Jp(e,Ut.SUBSCRIPTION))!==null&&a!==void 0?a:o.astNode)}}function Jp(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 zD(t){for(const n of t.schema.getDirectives()){if(!Wu(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),Un(r.type)||t.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${z(r.type)}.`,r.astNode),as(r)&&r.deprecationReason!=null){var e;t.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[Yp(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 QD(t){const e=ZD(t),n=t.schema.getTypeMap();for(const r of Object.values(n)){if(!Al(r)){t.reportError(`Expected GraphQL named type but got: ${z(r)}.`,r.astNode);continue}no(r)||ro(t,r),et(r)||ot(r)?(P_(t,r),F_(t,r)):Wt(r)?KD(t,r):Vt(r)?JD(t,r):gt(r)&&(YD(t,r),e(r))}}function P_(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),!ss(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),!Un(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(as(a)&&a.deprecationReason!=null){var s;t.reportError(`Required argument ${e.name}.${o.name}(${l}:) cannot be deprecated.`,[Yp(a.astNode),(s=a.astNode)===null||s===void 0?void 0:s.type])}}}}function F_(t,e){const n=Object.create(null);for(const r of e.getInterfaces()){if(!ot(r)){t.reportError(`Type ${z(e)} must only implement Interface types, it cannot implement ${z(r)}.`,Fl(e,r));continue}if(e===r){t.reportError(`Type ${e.name} cannot implement itself because it would create a circular reference.`,Fl(e,r));continue}if(n[r.name]){t.reportError(`Type ${e.name} can only implement ${r.name} once.`,Fl(e,r));continue}n[r.name]=!0,HD(t,e,r),GD(t,e,r)}}function GD(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(!to(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(!Vu(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)&&as(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 HD(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}.`,[...Fl(n,i),...Fl(e,n)])}function KD(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.`,L_(e,i.name));continue}r[i.name]=!0,et(i)||t.reportError(`Union type ${e.name} can only include Object types, it cannot include ${z(i)}.`,L_(e,String(i)))}}function JD(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 YD(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),!Un(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($u(s)&&s.deprecationReason!=null){var i;t.reportError(`Required input field ${e.name}.${s.name} cannot be deprecated.`,[Yp(s.astNode),(i=s.astNode)===null||i===void 0?void 0:i.type])}e.isOneOf&&XD(e,s,t)}}function XD(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 ZD(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)&&gt(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 Fl(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 L_(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 Yp(t){var e;return t==null||(e=t.directives)===null||e===void 0?void 0:e.find(n=>n.name.value===qu.name)}function qn(t,e){switch(e.kind){case k.LIST_TYPE:{const n=qn(t,e.type);return n&&new sn(n)}case k.NON_NULL_TYPE:{const n=qn(t,e.type);return n&&new je(n)}case k.NAMED_TYPE:return t.getType(e.name.value)}}class Xp{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??eR,n&&(Un(n)&&this._inputTypeStack.push(n),si(n)&&this._parentTypeStack.push(n),ss(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=In(this.getType());this._parentTypeStack.push(si(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(ss(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(et(i)?i:void 0);break}case k.INLINE_FRAGMENT:case k.FRAGMENT_DEFINITION:{const i=e.typeCondition,s=i?qn(n,i):In(this.getType());this._typeStack.push(ss(s)?s:void 0);break}case k.VARIABLE_DEFINITION:{const i=qn(n,e.type);this._inputTypeStack.push(Un(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(Un(s)?s:void 0);break}case k.LIST:{const i=xp(this.getInputType()),s=bt(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Un(s)?s:void 0);break}case k.OBJECT_FIELD:{const i=In(this.getInputType());let s,o;gt(i)&&(o=i.getFields()[e.name.value],o&&(s=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push(Un(s)?s:void 0);break}case k.ENUM:{const i=In(this.getInputType());let s;Vt(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 eR(t,e,n){const r=n.name.value;if(r===Dl.name&&t.getQueryType()===e)return Dl;if(r===Rl.name&&t.getQueryType()===e)return Rl;if(r===Ml.name&&si(e))return Ml;if(et(e)||ot(e))return e.getFields()[r]}function Zp(t,e){return{enter(...n){const r=n[0];t.enter(r);const i=na(e,r.kind).enter;if(i){const s=i.apply(e,n);return s!==void 0&&(t.leave(r),wp(s)&&t.enter(s)),s}},leave(...n){const r=n[0],i=na(e,r.kind).leave;let s;return i&&(s=i.apply(e,n)),t.leave(r),s}}}function tR(t){return em(t)||rm(t)||im(t)}function em(t){return t.kind===k.OPERATION_DEFINITION||t.kind===k.FRAGMENT_DEFINITION}function tm(t){return t.kind===k.FIELD||t.kind===k.FRAGMENT_SPREAD||t.kind===k.INLINE_FRAGMENT}function $_(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 nm(t){return $_(t)&&(t.kind===k.LIST?t.values.some(nm):t.kind===k.OBJECT?t.fields.some(e=>nm(e.value)):t.kind!==k.VARIABLE)}function nR(t){return t.kind===k.NAMED_TYPE||t.kind===k.LIST_TYPE||t.kind===k.NON_NULL_TYPE}function rm(t){return t.kind===k.SCHEMA_DEFINITION||la(t)||t.kind===k.DIRECTIVE_DEFINITION}function la(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 im(t){return t.kind===k.SCHEMA_EXTENSION||Qu(t)}function Qu(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 V_(t){return{Document(e){for(const n of e.definitions)if(!em(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 j_(t){return{Field(e){const n=t.getParentType();if(n&&!t.getFieldDef()){const i=t.getSchema(),s=e.name.value;let o=Oi("to use an inline fragment on",rR(i,n,s));o===""&&(o=Oi(iR(n,s))),t.reportError(new j(`Cannot query field "${s}" on type "${n.name}".`+o,{nodes:e}))}}}}function rR(t,e,n){if(!oi(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:ot(o)&&t.isSubType(o,a)?-1:ot(a)&&t.isSubType(a,o)?1:Ol(o.name,a.name)}).map(o=>o.name)}function iR(t,e){if(et(t)||ot(t)){const n=Object.keys(t.getFields());return rs(e,n)}return[]}function B_(t){return{InlineFragment(e){const n=e.typeCondition;if(n){const r=qn(t.getSchema(),n);if(r&&!si(r)){const i=mt(n);t.reportError(new j(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(e){const n=qn(t.getSchema(),e.typeCondition);if(n&&!si(n)){const r=mt(e.typeCondition);t.reportError(new j(`Fragment "${e.name.value}" cannot condition on non composite type "${r}".`,{nodes:e.typeCondition}))}}}}function U_(t){return{...W_(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=rs(s,o);t.reportError(new j(`Unknown argument "${s}" on field "${i.name}.${r.name}".`+Oi(a),{nodes:e}))}}}}function W_(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():cs;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=rs(d,l);t.reportError(new j(`Unknown argument "${d}" on directive "@${a}".`+Oi(h),{nodes:u}))}}return!1}}}function sm(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():cs;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=sR(u);p&&!h.includes(p)&&t.reportError(new j(`Directive "@${d}" may not be used on ${p}.`,{nodes:s}))}}}function sR(t){const e=t[t.length-1];switch("kind"in e||Rt(!1),e.kind){case k.OPERATION_DEFINITION:return oR(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||Rt(!1),n.kind===k.INPUT_OBJECT_TYPE_DEFINITION?me.INPUT_FIELD_DEFINITION:me.ARGUMENT_DEFINITION}default:Rt(!1,"Unexpected kind: "+z(e.kind))}}function oR(t){switch(t){case Ut.QUERY:return me.QUERY;case Ut.MUTATION:return me.MUTATION;case Ut.SUBSCRIPTION:return me.SUBSCRIPTION}}function q_(t){return{FragmentSpread(e){const n=e.name.value;t.getFragment(n)||t.reportError(new j(`Unknown fragment "${n}".`,{nodes:e.name}))}}}function om(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);for(const s of t.getDocument().definitions)la(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&&aR(p);if(g&&z_.includes(d))return;const y=rs(d,g?z_.concat(i):i);t.reportError(new j(`Unknown type "${d}".`+Oi(y),{nodes:s}))}}}}const z_=[...Il,...Pl].map(t=>t.name);function aR(t){return"kind"in t&&(rm(t)||im(t))}function Q_(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 G_(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 lR=3;function H_(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>=lR))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 K_(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 J_(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 Y_(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 X_(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 Gu(t){switch(t.kind){case k.OBJECT:return{...t,fields:cR(t.fields)};case k.LIST:return{...t,values:t.values.map(Gu)};case k.INT:case k.FLOAT:case k.STRING:case k.BOOLEAN:case k.NULL:case k.ENUM:case k.VARIABLE:return t}}function cR(t){return t.map(e=>({...e,value:Gu(e.value)})).sort((e,n)=>Ol(e.name.value,n.name.value))}function Z_(t){return Array.isArray(t)?t.map(([e,n])=>`subfields "${e}" conflict because `+Z_(n)).join(" and "):t}function eE(t){const e=new mR,n=new Map;return{SelectionSet(r){const i=uR(t,n,e,t.getParentType(),r);for(const[[s,o],a,l]of i){const u=Z_(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 uR(t,e,n,r,i){const s=[],[o,a]=Ju(t,e,r,i);if(dR(t,s,e,n,o),a.length!==0)for(let l=0;l<a.length;l++){Hu(t,s,e,n,!1,o,a[l]);for(let u=l+1;u<a.length;u++)Ku(t,s,e,n,!1,a[l],a[u])}return s}function Hu(t,e,n,r,i,s,o){const a=t.getFragment(o);if(!a)return;const[l,u]=cm(t,n,a);if(s!==l){am(t,e,n,r,i,s,l);for(const d of u)r.has(d,o,i)||(r.add(d,o,i),Hu(t,e,n,r,i,s,d))}}function Ku(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]=cm(t,n,a),[h,p]=cm(t,n,l);am(t,e,n,r,i,u,h);for(const g of p)Ku(t,e,n,r,i,s,g);for(const g of d)Ku(t,e,n,r,i,g,o)}function fR(t,e,n,r,i,s,o,a){const l=[],[u,d]=Ju(t,e,i,s),[h,p]=Ju(t,e,o,a);am(t,l,e,n,r,u,h);for(const g of p)Hu(t,l,e,n,r,u,g);for(const g of d)Hu(t,l,e,n,r,h,g);for(const g of d)for(const y of p)Ku(t,l,e,n,r,g,y);return l}function dR(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=tE(t,n,r,!1,s,o[a],o[l]);u&&e.push(u)}}function am(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=tE(t,n,r,i,a,d,h);p&&e.push(p)}}}function tE(t,e,n,r,i,s,o){const[a,l,u]=s,[d,h,p]=o,g=r||a!==d&&et(a)&&et(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(!hR(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&&lm(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=fR(t,e,n,g,In(y),_,In(b),w);return pR(O,i,l,h)}}function hR(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:nE(o)===nE(a)})}function nE(t){return mt(Gu(t))}function lm(t,e){return bt(t)?bt(e)?lm(t.ofType,e.ofType):!0:bt(e)?!0:Ie(t)?Ie(e)?lm(t.ofType,e.ofType):!0:Ie(e)?!0:ii(t)||ii(e)?t!==e:!1}function Ju(t,e,n,r){const i=e.get(r);if(i)return i;const s=Object.create(null),o=Object.create(null);rE(t,n,r,s,o);const a=[s,Object.keys(o)];return e.set(r,a),a}function cm(t,e,n){const r=e.get(n.selectionSet);if(r)return r;const i=qn(t.getSchema(),n.typeCondition);return Ju(t,e,i,n.selectionSet)}function rE(t,e,n,r,i){for(const s of n.selections)switch(s.kind){case k.FIELD:{const o=s.name.value;let a;(et(e)||ot(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?qn(t.getSchema(),o):e;rE(t,a,s.selectionSet,r,i);break}}}function pR(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 mR{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 iE(t){return{InlineFragment(e){const n=t.getType(),r=t.getParentType();if(si(n)&&si(r)&&!Rp(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=gR(t,n),i=t.getParentType();if(r&&i&&!Rp(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 gR(t,e){const n=t.getFragment(e);if(n){const r=qn(t.getSchema(),n.typeCondition);if(si(r))return r}}function sE(t){const e=t.getSchema(),n=Object.create(null);for(const i of t.getDocument().definitions)la(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=yR[o.kind]:a&&(l=vR(a)),l){if(l!==i.kind){const u=bR(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=rs(s,u);t.reportError(new j(`Cannot extend type "${s}" because it is not defined.`+Oi(d),{nodes:i.name}))}}}const yR={[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 vR(t){if(sr(t))return k.SCALAR_TYPE_EXTENSION;if(et(t))return k.OBJECT_TYPE_EXTENSION;if(ot(t))return k.INTERFACE_TYPE_EXTENSION;if(Wt(t))return k.UNION_TYPE_EXTENSION;if(Vt(t))return k.ENUM_TYPE_EXTENSION;if(gt(t))return k.INPUT_OBJECT_TYPE_EXTENSION;Rt(!1,"Unexpected type: "+z(t))}function bR(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:Rt(!1,"Unexpected kind: "+z(t))}}function oE(t){return{...aE(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)&&as(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 aE(t){var e;const n=Object.create(null),r=t.getSchema(),i=(e=r==null?void 0:r.getDirectives())!==null&&e!==void 0?e:cs;for(const a of i)n[a.name]=ki(a.args.filter(as),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]=ki(l.filter(_R),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=kl(y.type)?z(y.type):mt(y.type);t.reportError(new j(`Directive "@${l}" argument "${g}" of type "${b}" is required, but it was not provided.`,{nodes:a}))}}}}}}function _R(t){return t.type.kind===k.NON_NULL_TYPE&&t.defaultValue==null}function lE(t){return{Field(e){const n=t.getType(),r=e.selectionSet;if(n){if(ii(In(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 cE(t){return t.map(e=>typeof e=="number"?"["+e.toString()+"]":"."+e).join("")}function ca(t,e,n){return{prev:t,key:e,typename:n}}function xn(t){const e=[];let n=t;for(;n;)e.push(n.key),n=n.prev;return e.reverse()}function uE(t,e,n=ER){return Ll(t,e,n,void 0)}function ER(t,e,n){let r="Invalid value "+z(e);throw t.length>0&&(r+=` at "value${cE(t)}"`),n.message=r+": "+n.message,n}function Ll(t,e,n,r){if(Ie(e)){if(t!=null)return Ll(t,e.ofType,n,r);n(xn(r),t,new j(`Expected non-nullable type "${z(e)}" not to be null.`));return}if(t==null)return null;if(bt(e)){const i=e.ofType;return Bp(t)?Array.from(t,(s,o)=>{const a=ca(r,o,void 0);return Ll(s,i,n,a)}):[Ll(t,i,n,r)]}if(gt(e)){if(!rr(t)){n(xn(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(xn(r),t,new j(`Field "${o.name}" of required type "${l}" was not provided.`))}continue}i[o.name]=Ll(a,o.type,n,ca(r,o.name,e.name))}for(const o of Object.keys(t))if(!s[o]){const a=rs(o,Object.keys(e.getFields()));n(xn(r),t,new j(`Field "${o}" is not defined by type "${e.name}".`+Oi(a)))}if(e.isOneOf){const o=Object.keys(i);o.length!==1&&n(xn(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(xn(r).concat(a),l,new j(`Field "${a}" must be non-null.`))}return i}if(ii(e)){let i;try{i=e.parseValue(t)}catch(s){s instanceof j?n(xn(r),t,s):n(xn(r),t,new j(`Expected type "${e.name}". `+s.message,{originalError:s}));return}return i===void 0&&n(xn(r),t,new j(`Expected type "${e.name}".`)),i}Rt(!1,"Unexpected input type: "+z(e))}function li(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:li(t,e.ofType,n);if(t.kind===k.NULL)return null;if(bt(e)){const r=e.ofType;if(t.kind===k.LIST){const s=[];for(const o of t.values)if(fE(o,n)){if(Ie(r))return;s.push(null)}else{const a=li(o,r,n);if(a===void 0)return;s.push(a)}return s}const i=li(t,r,n);return i===void 0?void 0:[i]}if(gt(e)){if(t.kind!==k.OBJECT)return;const r=Object.create(null),i=ki(t.fields,s=>s.name.value);for(const s of Object.values(e.getFields())){const o=i[s.name];if(!o||fE(o.value,n)){if(s.defaultValue!==void 0)r[s.name]=s.defaultValue;else if(Ie(s.type))return;continue}const a=li(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(ii(e)){let r;try{r=e.parseLiteral(t,n)}catch{return}return r===void 0?void 0:r}Rt(!1,"Unexpected input type: "+z(e))}}function fE(t,e){return t.kind===k.VARIABLE&&(e==null||e[t.name.value]===void 0)}function dE(t,e,n,r){const i=[],s=r==null?void 0:r.maxErrors;try{const o=wR(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 wR(t,e,n,r){const i={};for(const s of e){const o=s.variable.name.value,a=qn(t,s.type);if(!Un(a)){const u=mt(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(!hE(n,o)){if(s.defaultValue)i[o]=li(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]=uE(l,a,(u,d,h)=>{let p=`Variable "$${o}" got invalid value `+z(d);u.length>0&&(p+=` at "${o}${cE(u)}"`),r(new j(p+"; "+h.message,{nodes:s,originalError:h}))})}return i}function Yu(t,e,n){var r;const i={},s=(r=e.arguments)!==null&&r!==void 0?r:[],o=ki(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||!hE(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=li(h,u,n);if(g===void 0)throw new j(`Argument "${l}" has invalid value ${mt(h)}.`,{nodes:h});i[l]=g}return i}function ua(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 Yu(t,i,n)}function hE(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function um(t,e,n,r,i){const s=new Map;return Xu(t,e,n,r,i,s,new Set),s}function TR(t,e,n,r,i){const s=new Map,o=new Set;for(const a of i)a.selectionSet&&Xu(t,e,n,r,a.selectionSet,s,o);return s}function Xu(t,e,n,r,i,s,o){for(const a of i.selections)switch(a.kind){case k.FIELD:{if(!fm(n,a))continue;const l=SR(a),u=s.get(l);u!==void 0?u.push(a):s.set(l,[a]);break}case k.INLINE_FRAGMENT:{if(!fm(n,a)||!pE(t,a,r))continue;Xu(t,e,n,r,a.selectionSet,s,o);break}case k.FRAGMENT_SPREAD:{const l=a.name.value;if(o.has(l)||!fm(n,a))continue;o.add(l);const u=e[l];if(!u||!pE(t,u,r))continue;Xu(t,e,n,r,u.selectionSet,s,o);break}}}function fm(t,e){const n=ua(Fp,e,t);if((n==null?void 0:n.if)===!0)return!1;const r=ua(Pp,e,t);return(r==null?void 0:r.if)!==!1}function pE(t,e,n){const r=e.typeCondition;if(!r)return!0;const i=qn(t,r);return i===n?!0:oi(i)?t.isSubType(i,n):!1}function SR(t){return t.alias?t.alias.value:t.name.value}function mE(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=um(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 dm(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 gE(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=dm(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 hm(t){return{Field:e,Directive:e};function e(n){var r;const i=(r=n.arguments)!==null&&r!==void 0?r:[],s=dm(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 yE(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 pm(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():cs;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(la(a)||Qu(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 vE(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];Vt(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 bE(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;OR(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 OR(t,e){return et(t)||ot(t)||gt(t)?t.getFields()[e]!=null:!1}function _E(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 mm(t){const e=[];let n=Object.create(null);return{ObjectValue:{enter(){e.push(n),n=Object.create(null)},leave(){const r=e.pop();r||Rt(!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 EE(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 wE(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 TE(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 SE(t){return{OperationDefinition(e){var n;const r=(n=e.variableDefinitions)!==null&&n!==void 0?n:[],i=dm(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 OE(t){let e={};return{OperationDefinition:{enter(){e={}}},VariableDefinition(n){e[n.variable.name.value]=n},ListValue(n){const r=xp(t.getParentInputType());if(!bt(r))return io(t,n),!1},ObjectValue(n){const r=In(t.getInputType());if(!gt(r))return io(t,n),!1;const i=ki(n.fields,s=>s.name.value);for(const s of Object.values(r.getFields()))if(!i[s.name]&&$u(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&&kR(t,n,r,i,e)},ObjectField(n){const r=In(t.getParentInputType());if(!t.getInputType()&&gt(r)){const s=rs(n.name.value,Object.keys(r.getFields()));t.reportError(new j(`Field "${n.name.value}" is not defined by type "${r.name}".`+Oi(s),{nodes:n}))}},NullValue(n){const r=t.getInputType();Ie(r)&&t.reportError(new j(`Expected value of type "${z(r)}", found ${mt(n)}.`,{nodes:n}))},EnumValue:n=>io(t,n),IntValue:n=>io(t,n),FloatValue:n=>io(t,n),StringValue:n=>io(t,n),BooleanValue:n=>io(t,n)}}function io(t,e){const n=t.getInputType();if(!n)return;const r=In(n);if(!ii(r)){const i=z(n);t.reportError(new j(`Expected value of type "${i}", found ${mt(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 ${mt(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 ${mt(e)}; `+i.message,{nodes:e,originalError:i}))}}function kR(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 kE(t){return{VariableDefinition(e){const n=qn(t.getSchema(),e.type);if(n!==void 0&&!Un(n)){const r=e.variable.name.value,i=mt(e.type);t.reportError(new j(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:e.type}))}}}}function NE(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=qn(u,l.type);if(d&&!NR(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 NR(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 to(t,e,a)}return to(t,e,r)}const AE=Object.freeze([H_]),IE=Object.freeze([V_,EE,Q_,mE,om,B_,kE,lE,j_,_E,q_,Y_,iE,K_,SE,J_,X_,sm,pm,U_,hm,OE,oE,NE,eE,mm,...AE]),AR=Object.freeze([G_,wE,TE,vE,bE,gE,yE,om,sm,pm,sE,W_,hm,mm,aE]);class xE{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 IR extends xE{constructor(e,n,r){super(e,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class CE extends xE{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 Xp(this._schema);rn(e,Zp(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 DE(t,e,n=IE,r,i=new Xp(t)){var s;const o=(s=r==null?void 0:r.maxErrors)!==null&&s!==void 0?s:100;e||Ve(!1,"Must provide document."),Kp(t);const a=Object.freeze({}),l=[],u=new CE(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=Ap(n.map(h=>h(u)));try{rn(e,Zp(i,d))}catch(h){if(h!==a)throw h}return l}function RE(t,e,n=AR){const r=[],i=new IR(t,e,o=>{r.push(o)}),s=n.map(o=>o(i));return rn(t,Ap(s)),r}function xR(t){const e=RE(t);if(e.length!==0)throw new Error(e.map(n=>n.message).join(`
83
+
84
+ `))}function CR(t,e){const n=RE(t,e);if(n.length!==0)throw new Error(n.map(r=>r.message).join(`
85
+
86
+ `))}function DR(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 ME(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 RR(t,e,n){let r=n;for(const i of t)r=nr(r)?r.then(s=>e(s,i)):e(r,i);return r}function MR(t){return t instanceof Error?t:new PR(t)}class PR extends Error{constructor(e){super("Unexpected error value: "+z(e)),this.name="NonErrorThrown",this.thrownValue=e}}function fa(t,e,n){var r;const i=MR(t);return FR(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 FR(t){return Array.isArray(t.path)}const LR=DR((t,e,n)=>TR(t.schema,t.fragments,t.variableValues,e,n));function Zu(t){arguments.length<2||Ve(!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;FE(e,n,r);const s=LE(t);if(!("schema"in s))return{errors:s};try{const{operation:o}=s,a=$R(s,o,i);return nr(a)?a.then(l=>ef(l,s.errors),l=>(s.errors.push(l),ef(null,s.errors))):ef(a,s.errors)}catch(o){return s.errors.push(o),ef(null,s.errors)}}function PE(t){const e=Zu(t);if(nr(e))throw new Error("GraphQL execution failed to complete synchronously.");return e}function ef(t,e){return e.length===0?{data:t}:{errors:e,data:t}}function FE(t,e,n){e||Ve(!1,"Must provide document."),Kp(t),n==null||rr(n)||Ve(!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 LE(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=dE(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??ym,typeResolver:d??UE,subscribeFieldResolver:h??ym,errors:[]}}function $R(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=um(t.schema,t.fragments,t.variableValues,r,e.selectionSet),s=void 0;switch(e.operation){case Ut.QUERY:return tf(t,r,n,s,i);case Ut.MUTATION:return VR(t,r,n,s,i);case Ut.SUBSCRIPTION:return tf(t,r,n,s,i)}}function VR(t,e,n,r,i){return RR(i.entries(),(s,[o,a])=>{const l=ca(r,o,e.name),u=$E(t,e,n,a,l);return u===void 0?s:nr(u)?u.then(d=>(s[o]=d,s)):(s[o]=u,s)},Object.create(null))}function tf(t,e,n,r,i){const s=Object.create(null);let o=!1;try{for(const[a,l]of i.entries()){const u=ca(r,a,e.name),d=$E(t,e,n,l,u);d!==void 0&&(s[a]=d,nr(d)&&(o=!0))}}catch(a){if(o)return ME(s).finally(()=>{throw a});throw a}return o?ME(s):s}function $E(t,e,n,r,i){var s;const o=WE(t.schema,e,r[0]);if(!o)return;const a=o.type,l=(s=o.resolve)!==null&&s!==void 0?s:t.fieldResolver,u=VE(t,o,r,e,i);try{const d=Yu(o,r[0],t.variableValues),h=t.contextValue,p=l(n,d,h,u);let g;return nr(p)?g=p.then(y=>$l(t,a,r,u,i,y)):g=$l(t,a,r,u,i,p),nr(g)?g.then(void 0,y=>{const b=fa(y,r,xn(i));return nf(b,a,t)}):g}catch(d){const h=fa(d,r,xn(i));return nf(h,a,t)}}function VE(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 nf(t,e,n){if(Ie(e))throw t;return n.errors.push(t),null}function $l(t,e,n,r,i,s){if(s instanceof Error)throw s;if(Ie(e)){const o=$l(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(bt(e))return jR(t,e,n,r,i,s);if(ii(e))return BR(e,s);if(oi(e))return UR(t,e,n,r,i,s);if(et(e))return gm(t,e,n,r,i,s);Rt(!1,"Cannot complete value of unexpected output type: "+z(e))}function jR(t,e,n,r,i,s){if(!Bp(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=ca(i,d,void 0);try{let p;return nr(u)?p=u.then(g=>$l(t,o,n,r,h,g)):p=$l(t,o,n,r,h,u),nr(p)?(a=!0,p.then(void 0,g=>{const y=fa(g,n,xn(h));return nf(y,o,t)})):p}catch(p){const g=fa(p,n,xn(h));return nf(g,o,t)}});return a?Promise.all(l):l}function BR(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 UR(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 nr(u)?u.then(d=>gm(t,jE(d,t,e,n,r,s),n,r,i,s)):gm(t,jE(u,t,e,n,r,s),n,r,i,s)}function jE(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(et(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(!et(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 gm(t,e,n,r,i,s){const o=LR(t,e,n);if(e.isTypeOf){const a=e.isTypeOf(s,t.contextValue,r);if(nr(a))return a.then(l=>{if(!l)throw BE(e,s,n);return tf(t,e,s,i,o)});if(!a)throw BE(e,s,n)}return tf(t,e,s,i,o)}function BE(t,e,n){return new j(`Expected value of type "${t.name}" but got: ${z(e)}.`,{nodes:n})}const UE=function(t,e,n,r){if(rr(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(nr(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})},ym=function(t,e,n,r){if(rr(t)||typeof t=="function"){const i=t[r.fieldName];return typeof i=="function"?t[r.fieldName](e,n,r):i}};function WE(t,e,n){const r=n.name.value;return r===Dl.name&&t.getQueryType()===e?Dl:r===Rl.name&&t.getQueryType()===e?Rl:r===Ml.name?Ml:e.getFields()[r]}function WR(t){return new Promise(e=>e(qE(t)))}function qR(t){const e=qE(t);if(nr(e))throw new Error("GraphQL execution failed to complete synchronously.");return e}function qE(t){arguments.length<2||Ve(!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=Hp(e);if(u.length>0)return{errors:u};let d;try{d=Sl(n)}catch(p){return{errors:[p]}}const h=DE(e,d);return h.length>0?{errors:h}:Zu({schema:e,document:d,rootValue:r,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:l})}function zE(t){return typeof(t==null?void 0:t[Symbol.asyncIterator])=="function"}function zR(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 QR(t){arguments.length<2||Ve(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const e=await QE(t);return zE(e)?zR(e,r=>Zu({...t,rootValue:r})):e}function GR(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 QE(...t){const e=GR(t),{schema:n,document:r,variableValues:i}=e;FE(n,r,i);const s=LE(e);if(!("schema"in s))return{errors:s};try{const o=await HR(s);if(!zE(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 HR(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=um(e,n,i,o,r.selectionSet),[l,u]=[...a.entries()][0],d=WE(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=ca(void 0,l,o.name),p=VE(t,d,u,o,h);try{var g;const y=Yu(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 fa(y,u,xn(h))}}function KR(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||Rt(!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||Rt(!1),t.reportError(new j(`Field "${s.name}.${o.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:e}))}}},ObjectField(e){const n=In(t.getParentInputType());if(gt(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=In(t.getInputType());i!=null||Rt(!1),t.reportError(new j(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:e}))}}}}function JR(t){return{Field(e){const n=In(t.getType());n&&no(n)&&t.reportError(new j(`GraphQL introspection has been disabled, but the requested query contained the field "${e.name.value}".`,{nodes:e}))}}}function GE(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 YR(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 XR(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 ZR(t,e){const n={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,oneOf:!0,...e},r=Sl(GE(n)),i=PE({schema:t,document:r});return!i.errors&&i.data||Rt(!1),i.data}function eM(t,e){rr(t)&&rr(t.__schema)||Ve(!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=ns(n.types,x=>x.name,x=>p(x));for(const x of[...Il,...Pl])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 aa({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 sn(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(S_(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 w_(u(x))}function h(x){return T_(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 ai({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 Er({name:x.name,description:x.description,interfaces:()=>y(x),fields:()=>I(x)})}function _(x){return new ia({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 sa({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 ls({name:x.name,description:x.description,values:ns(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 oa({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 ns(x.fields,U=>U.name,P)}function P(x){const U=l(x.type);if(!ss(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 ns(x,U=>U.name,B)}function B(x){const U=l(x.type);if(!Un(U)){const ke=z(U);throw new Error(`Introspection must provide input type for arguments, but received: ${ke}.`)}const Te=x.defaultValue!=null?li(g_(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 Qr({name:x.name,description:x.description,isRepeatable:x.isRepeatable,locations:x.locations.slice(),args:M(x.args)})}}function tM(t,e,n){Gp(t),e!=null&&e.kind===k.DOCUMENT||Ve(!1,"Must provide valid Document AST."),(n==null?void 0:n.assumeValid)!==!0&&(n==null?void 0:n.assumeValidSDL)!==!0&&CR(e,t);const r=t.toConfig(),i=HE(r,e,n);return r===i?t:new aa(i)}function HE(t,e,n){var r,i,s,o;const a=[],l=Object.create(null),u=[];let d;const h=[];for(const $ of e.definitions)if($.kind===k.SCHEMA_DEFINITION)d=$;else if($.kind===k.SCHEMA_EXTENSION)h.push($);else if(la($))a.push($);else if(Qu($)){const te=$.name.value,Z=l[te];l[te]=Z?Z.concat([$]):[$]}else $.kind===k.DIRECTIVE_DEFINITION&&u.push($);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 $ of t.types)p[$.name]=O($);for(const $ of a){var g;const te=$.name.value;p[te]=(g=KE[te])!==null&&g!==void 0?g:Ne($)}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($){return bt($)?new sn(b($.ofType)):Ie($)?new je(b($.ofType)):_($)}function _($){return p[$.name]}function w($){const te=$.toConfig();return new Qr({...te,args:Ni(te.args,U)})}function O($){if(no($)||Uu($))return $;if(sr($))return P($);if(et($))return M($);if(ot($))return B($);if(Wt($))return Q($);if(Vt($))return I($);if(gt($))return N($);Rt(!1,"Unexpected type: "+z($))}function N($){var te;const Z=$.toConfig(),ne=(te=l[Z.name])!==null&&te!==void 0?te:[];return new oa({...Z,fields:()=>({...Ni(Z.fields,be=>({...be,type:b(be.type)})),...fe(ne)}),extensionASTNodes:Z.extensionASTNodes.concat(ne)})}function I($){var te;const Z=$.toConfig(),ne=(te=l[$.name])!==null&&te!==void 0?te:[];return new ls({...Z,values:{...Z.values,...ve(ne)},extensionASTNodes:Z.extensionASTNodes.concat(ne)})}function P($){var te;const Z=$.toConfig(),ne=(te=l[Z.name])!==null&&te!==void 0?te:[];let be=Z.specifiedByURL;for(const Je of ne){var Me;be=(Me=JE(Je))!==null&&Me!==void 0?Me:be}return new ai({...Z,specifiedByURL:be,extensionASTNodes:Z.extensionASTNodes.concat(ne)})}function M($){var te;const Z=$.toConfig(),ne=(te=l[Z.name])!==null&&te!==void 0?te:[];return new Er({...Z,interfaces:()=>[...$.getInterfaces().map(_),...Se(ne)],fields:()=>({...Ni(Z.fields,x),...ee(ne)}),extensionASTNodes:Z.extensionASTNodes.concat(ne)})}function B($){var te;const Z=$.toConfig(),ne=(te=l[Z.name])!==null&&te!==void 0?te:[];return new ia({...Z,interfaces:()=>[...$.getInterfaces().map(_),...Se(ne)],fields:()=>({...Ni(Z.fields,x),...ee(ne)}),extensionASTNodes:Z.extensionASTNodes.concat(ne)})}function Q($){var te;const Z=$.toConfig(),ne=(te=l[Z.name])!==null&&te!==void 0?te:[];return new sa({...Z,types:()=>[...$.getTypes().map(_),...ht(ne)],extensionASTNodes:Z.extensionASTNodes.concat(ne)})}function x($){return{...$,type:b($.type),args:$.args&&Ni($.args,U)}}function U($){return{...$,type:b($.type)}}function Te($){const te={};for(const ne of $){var Z;const be=(Z=ne.operationTypes)!==null&&Z!==void 0?Z:[];for(const Me of be)te[Me.operation]=ke(Me.type)}return te}function ke($){var te;const Z=$.name.value,ne=(te=KE[Z])!==null&&te!==void 0?te:p[Z];if(ne===void 0)throw new Error(`Unknown type: "${Z}".`);return ne}function pe($){return $.kind===k.LIST_TYPE?new sn(pe($.type)):$.kind===k.NON_NULL_TYPE?new je(pe($.type)):ke($)}function Ce($){var te;return new Qr({name:$.name.value,description:(te=$.description)===null||te===void 0?void 0:te.value,locations:$.locations.map(({value:Z})=>Z),isRepeatable:$.repeatable,args:Ae($.arguments),astNode:$})}function ee($){const te=Object.create(null);for(const be of $){var Z;const Me=(Z=be.fields)!==null&&Z!==void 0?Z:[];for(const Je of Me){var ne;te[Je.name.value]={type:pe(Je.type),description:(ne=Je.description)===null||ne===void 0?void 0:ne.value,args:Ae(Je.arguments),deprecationReason:rf(Je),astNode:Je}}}return te}function Ae($){const te=$??[],Z=Object.create(null);for(const be of te){var ne;const Me=pe(be.type);Z[be.name.value]={type:Me,description:(ne=be.description)===null||ne===void 0?void 0:ne.value,defaultValue:li(be.defaultValue,Me),deprecationReason:rf(be),astNode:be}}return Z}function fe($){const te=Object.create(null);for(const be of $){var Z;const Me=(Z=be.fields)!==null&&Z!==void 0?Z:[];for(const Je of Me){var ne;const tn=pe(Je.type);te[Je.name.value]={type:tn,description:(ne=Je.description)===null||ne===void 0?void 0:ne.value,defaultValue:li(Je.defaultValue,tn),deprecationReason:rf(Je),astNode:Je}}}return te}function ve($){const te=Object.create(null);for(const be of $){var Z;const Me=(Z=be.values)!==null&&Z!==void 0?Z:[];for(const Je of Me){var ne;te[Je.name.value]={description:(ne=Je.description)===null||ne===void 0?void 0:ne.value,deprecationReason:rf(Je),astNode:Je}}}return te}function Se($){return $.flatMap(te=>{var Z,ne;return(Z=(ne=te.interfaces)===null||ne===void 0?void 0:ne.map(ke))!==null&&Z!==void 0?Z:[]})}function ht($){return $.flatMap(te=>{var Z,ne;return(Z=(ne=te.types)===null||ne===void 0?void 0:ne.map(ke))!==null&&Z!==void 0?Z:[]})}function Ne($){var te;const Z=$.name.value,ne=(te=l[Z])!==null&&te!==void 0?te:[];switch($.kind){case k.OBJECT_TYPE_DEFINITION:{var be;const Qt=[$,...ne];return new Er({name:Z,description:(be=$.description)===null||be===void 0?void 0:be.value,interfaces:()=>Se(Qt),fields:()=>ee(Qt),astNode:$,extensionASTNodes:ne})}case k.INTERFACE_TYPE_DEFINITION:{var Me;const Qt=[$,...ne];return new ia({name:Z,description:(Me=$.description)===null||Me===void 0?void 0:Me.value,interfaces:()=>Se(Qt),fields:()=>ee(Qt),astNode:$,extensionASTNodes:ne})}case k.ENUM_TYPE_DEFINITION:{var Je;const Qt=[$,...ne];return new ls({name:Z,description:(Je=$.description)===null||Je===void 0?void 0:Je.value,values:ve(Qt),astNode:$,extensionASTNodes:ne})}case k.UNION_TYPE_DEFINITION:{var tn;const Qt=[$,...ne];return new sa({name:Z,description:(tn=$.description)===null||tn===void 0?void 0:tn.value,types:()=>ht(Qt),astNode:$,extensionASTNodes:ne})}case k.SCALAR_TYPE_DEFINITION:{var bi;return new ai({name:Z,description:(bi=$.description)===null||bi===void 0?void 0:bi.value,specifiedByURL:JE($),astNode:$,extensionASTNodes:ne})}case k.INPUT_OBJECT_TYPE_DEFINITION:{var _i;const Qt=[$,...ne];return new oa({name:Z,description:(_i=$.description)===null||_i===void 0?void 0:_i.value,fields:()=>fe(Qt),astNode:$,extensionASTNodes:ne,isOneOf:nM($)})}}}}const KE=ki([...Il,...Pl],t=>t.name);function rf(t){const e=ua(qu,t);return e==null?void 0:e.reason}function JE(t){const e=ua($p,t);return e==null?void 0:e.url}function nM(t){return!!ua(Vp,t)}function YE(t,e){t!=null&&t.kind===k.DOCUMENT||Ve(!1,"Must provide valid Document AST."),(e==null?void 0:e.assumeValid)!==!0&&(e==null?void 0:e.assumeValidSDL)!==!0&&xR(t);const r=HE({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,...cs.filter(s=>r.directives.every(o=>o.name!==s.name))];return new aa({...r,directives:i})}function rM(t,e){const n=Sl(t,{noLocation:e==null?void 0:e.noLocation,allowLegacyFragmentVariables:e==null?void 0:e.allowLegacyFragmentVariables});return YE(n,{assumeValidSDL:e==null?void 0:e.assumeValidSDL,assumeValid:e==null?void 0:e.assumeValid})}function iM(t){const e=t.toConfig(),n=ns(vm(e.types),p=>p.name,h);return new aa({...e,types:Object.values(n),directives:vm(e.directives).map(o),query:s(e.query),mutation:s(e.mutation),subscription:s(e.subscription)});function r(p){return bt(p)?new sn(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 Qr({...g,locations:XE(g.locations,y=>y),args:a(g.args)})}function a(p){return sf(p,g=>({...g,type:r(g.type)}))}function l(p){return sf(p,g=>({...g,type:r(g.type),args:g.args&&a(g.args)}))}function u(p){return sf(p,g=>({...g,type:r(g.type)}))}function d(p){return vm(p).map(i)}function h(p){if(sr(p)||no(p))return p;if(et(p)){const g=p.toConfig();return new Er({...g,interfaces:()=>d(g.interfaces),fields:()=>l(g.fields)})}if(ot(p)){const g=p.toConfig();return new ia({...g,interfaces:()=>d(g.interfaces),fields:()=>l(g.fields)})}if(Wt(p)){const g=p.toConfig();return new sa({...g,types:()=>d(g.types)})}if(Vt(p)){const g=p.toConfig();return new ls({...g,values:sf(g.values,y=>y)})}if(gt(p)){const g=p.toConfig();return new oa({...g,fields:()=>u(g.fields)})}Rt(!1,"Unexpected type: "+z(p))}}function sf(t,e){const n=Object.create(null);for(const r of Object.keys(t).sort(Ol))n[r]=e(t[r]);return n}function vm(t){return XE(t,e=>e.name)}function XE(t,e){return t.slice().sort((n,r)=>{const i=e(n),s=e(r);return Ol(i,s)})}function sM(t){return ZE(t,e=>!jp(e),aM)}function oM(t){return ZE(t,jp,no)}function aM(t){return!Uu(t)&&!no(t)}function ZE(t,e,n){const r=t.getDirectives().filter(e),i=Object.values(t.getTypeMap()).filter(n);return[lM(t),...r.map(s=>gM(s)),...i.map(s=>ew(s))].filter(Boolean).join(`
193
+
194
+ `)}function lM(t){if(t.description==null&&cM(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}`),Tr(t)+`schema {
195
+ ${e.join(`
196
+ `)}
197
+ }`}function cM(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 ew(t){if(sr(t))return uM(t);if(et(t))return fM(t);if(ot(t))return dM(t);if(Wt(t))return hM(t);if(Vt(t))return pM(t);if(gt(t))return mM(t);Rt(!1,"Unexpected type: "+z(t))}function uM(t){return Tr(t)+`scalar ${t.name}`+yM(t)}function tw(t){const e=t.getInterfaces();return e.length?" implements "+e.map(n=>n.name).join(" & "):""}function fM(t){return Tr(t)+`type ${t.name}`+tw(t)+nw(t)}function dM(t){return Tr(t)+`interface ${t.name}`+tw(t)+nw(t)}function hM(t){const e=t.getTypes(),n=e.length?" = "+e.join(" | "):"";return Tr(t)+"union "+t.name+n}function pM(t){const e=t.getValues().map((n,r)=>Tr(n," ",!r)+" "+n.name+Em(n.deprecationReason));return Tr(t)+`enum ${t.name}`+bm(e)}function mM(t){const e=Object.values(t.getFields()).map((n,r)=>Tr(n," ",!r)+" "+_m(n));return Tr(t)+`input ${t.name}`+(t.isOneOf?" @oneOf":"")+bm(e)}function nw(t){const e=Object.values(t.getFields()).map((n,r)=>Tr(n," ",!r)+" "+n.name+rw(n.args," ")+": "+String(n.type)+Em(n.deprecationReason));return bm(e)}function bm(t){return t.length!==0?` {
198
+ `+t.join(`
199
+ `)+`
200
+ }`:""}function rw(t,e=""){return t.length===0?"":t.every(n=>!n.description)?"("+t.map(_m).join(", ")+")":`(
201
+ `+t.map((n,r)=>Tr(n," "+e,!r)+" "+e+_m(n)).join(`
202
+ `)+`
203
+ `+e+")"}function _m(t){const e=us(t.defaultValue,t.type);let n=t.name+": "+String(t.type);return e&&(n+=` = ${mt(e)}`),n+Em(t.deprecationReason)}function gM(t){return Tr(t)+"directive @"+t.name+rw(t.args)+(t.isRepeatable?" repeatable":"")+" on "+t.locations.join(" | ")}function Em(t){return t==null?"":t!==Lp?` @deprecated(reason: ${mt({kind:k.STRING,value:t})})`:" @deprecated"}function yM(t){return t.specifiedByURL==null?"":` @specifiedBy(url: ${mt({kind:k.STRING,value:t.specifiedByURL})})`}function Tr(t,e="",n=!0){const{description:r}=t;if(r==null)return"";const i=mt({kind:k.STRING,value:r,block:XC(r)});return(e&&!n?`
204
+ `+e:e)+i.replace(/\n/g,`
205
+ `+e)+`
206
+ `}function vM(t){const e=[];for(const n of t)e.push(...n.definitions);return{kind:k.DOCUMENT,definitions:e}}function bM(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]=sw(i.selectionSet);break}const r=Object.create(null);for(const i of e){const s=new Set;for(const a of sw(i.selectionSet))iw(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 iw(t,e,n){if(!t.has(n)){t.add(n);const r=e[n];if(r!==void 0)for(const i of r)iw(t,e,i)}}function sw(t){const e=[];return rn(t,{FragmentSpread(n){e.push(n.name.value)}}),e}function _M(t){const e=m_(t)?t:new Cu(t),n=e.body,r=new Op(e);let i="",s=!1;for(;r.advance().kind!==q.EOF;){const o=r.token,a=o.kind,l=!u_(o.kind);s&&(l||o.kind===q.SPREAD)&&(i+=" ");const u=n.slice(o.start,o.end);a===q.BLOCK_STRING?i+=c_(o.value,{minimize:!0}):i+=u,s=l}return i}function EM(t){const e=ow(t);if(e)throw e;return t}function ow(t){if(typeof t=="string"||Ve(!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{ir(t)}catch(e){return e}}var It;(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"})(It||(It={}));var Hr;(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"})(Hr||(Hr={}));function wM(t,e){return aw(t,e).filter(n=>n.type in It)}function TM(t,e){return aw(t,e).filter(n=>n.type in Hr)}function aw(t,e){return[...OM(t,e),...SM(t,e)]}function SM(t,e){const n=[],r=Ai(t.getDirectives(),e.getDirectives());for(const i of r.removed)n.push({type:It.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(const[i,s]of r.persisted){const o=Ai(i.args,s.args);for(const a of o.added)as(a)&&n.push({type:It.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:It.DIRECTIVE_ARG_REMOVED,description:`${a.name} was removed from ${i.name}.`});i.isRepeatable&&!s.isRepeatable&&n.push({type:It.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(const a of i.locations)s.locations.includes(a)||n.push({type:It.DIRECTIVE_LOCATION_REMOVED,description:`${a} was removed from ${i.name}.`})}return n}function OM(t,e){const n=[],r=Ai(Object.values(t.getTypeMap()),Object.values(e.getTypeMap()));for(const i of r.removed)n.push({type:It.TYPE_REMOVED,description:Uu(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(const[i,s]of r.persisted)Vt(i)&&Vt(s)?n.push(...AM(i,s)):Wt(i)&&Wt(s)?n.push(...NM(i,s)):gt(i)&&gt(s)?n.push(...kM(i,s)):et(i)&&et(s)?n.push(...cw(i,s),...lw(i,s)):ot(i)&&ot(s)?n.push(...cw(i,s),...lw(i,s)):i.constructor!==s.constructor&&n.push({type:It.TYPE_CHANGED_KIND,description:`${i.name} changed from ${uw(i)} to ${uw(s)}.`});return n}function kM(t,e){const n=[],r=Ai(Object.values(t.getFields()),Object.values(e.getFields()));for(const i of r.added)$u(i)?n.push({type:It.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${t.name} was added.`}):n.push({type:Hr.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:It.FIELD_REMOVED,description:`${t.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)jl(i.type,s.type)||n.push({type:It.FIELD_CHANGED_KIND,description:`${t.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function NM(t,e){const n=[],r=Ai(t.getTypes(),e.getTypes());for(const i of r.added)n.push({type:Hr.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${t.name}.`});for(const i of r.removed)n.push({type:It.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${t.name}.`});return n}function AM(t,e){const n=[],r=Ai(t.getValues(),e.getValues());for(const i of r.added)n.push({type:Hr.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${t.name}.`});for(const i of r.removed)n.push({type:It.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${t.name}.`});return n}function lw(t,e){const n=[],r=Ai(t.getInterfaces(),e.getInterfaces());for(const i of r.added)n.push({type:Hr.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${t.name}.`});for(const i of r.removed)n.push({type:It.IMPLEMENTED_INTERFACE_REMOVED,description:`${t.name} no longer implements interface ${i.name}.`});return n}function cw(t,e){const n=[],r=Ai(Object.values(t.getFields()),Object.values(e.getFields()));for(const i of r.removed)n.push({type:It.FIELD_REMOVED,description:`${t.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)n.push(...IM(t,i,s)),Vl(i.type,s.type)||n.push({type:It.FIELD_CHANGED_KIND,description:`${t.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function IM(t,e,n){const r=[],i=Ai(e.args,n.args);for(const s of i.removed)r.push({type:It.ARG_REMOVED,description:`${t.name}.${e.name} arg ${s.name} was removed.`});for(const[s,o]of i.persisted)if(!jl(s.type,o.type))r.push({type:It.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:Hr.ARG_DEFAULT_VALUE_CHANGE,description:`${t.name}.${e.name} arg ${s.name} defaultValue was removed.`});else{const l=fw(s.defaultValue,s.type),u=fw(o.defaultValue,o.type);l!==u&&r.push({type:Hr.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)as(s)?r.push({type:It.REQUIRED_ARG_ADDED,description:`A required arg ${s.name} on ${t.name}.${e.name} was added.`}):r.push({type:Hr.OPTIONAL_ARG_ADDED,description:`An optional arg ${s.name} on ${t.name}.${e.name} was added.`});return r}function Vl(t,e){return bt(t)?bt(e)&&Vl(t.ofType,e.ofType)||Ie(e)&&Vl(t,e.ofType):Ie(t)?Ie(e)&&Vl(t.ofType,e.ofType):Al(e)&&t.name===e.name||Ie(e)&&Vl(t,e.ofType)}function jl(t,e){return bt(t)?bt(e)&&jl(t.ofType,e.ofType):Ie(t)?Ie(e)&&jl(t.ofType,e.ofType)||!Ie(e)&&jl(t.ofType,e):Al(e)&&t.name===e.name}function uw(t){if(sr(t))return"a Scalar type";if(et(t))return"an Object type";if(ot(t))return"an Interface type";if(Wt(t))return"a Union type";if(Vt(t))return"an Enum type";if(gt(t))return"an Input type";Rt(!1,"Unexpected type: "+z(t))}function fw(t,e){const n=us(t,e);return n!=null||Rt(!1),mt(Gu(n))}function Ai(t,e){const n=[],r=[],i=[],s=ki(t,({name:a})=>a),o=ki(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 xM=Object.freeze(Object.defineProperty({__proto__:null,BREAK:is,get BreakingChangeType(){return It},DEFAULT_DEPRECATION_REASON:Lp,get DangerousChangeType(){return Hr},get DirectiveLocation(){return me},ExecutableDefinitionsRule:V_,FieldsOnCorrectTypeRule:j_,FragmentsOnCompositeTypesRule:B_,GRAPHQL_MAX_INT:ju,GRAPHQL_MIN_INT:Bu,GraphQLBoolean:Wn,GraphQLDeprecatedDirective:qu,GraphQLDirective:Qr,GraphQLEnumType:ls,GraphQLError:j,GraphQLFloat:D_,GraphQLID:Mp,GraphQLIncludeDirective:Pp,GraphQLInputObjectType:oa,GraphQLInt:C_,GraphQLInterfaceType:ia,GraphQLList:sn,GraphQLNonNull:je,GraphQLObjectType:Er,GraphQLOneOfDirective:Vp,GraphQLScalarType:ai,GraphQLSchema:aa,GraphQLSkipDirective:Fp,GraphQLSpecifiedByDirective:$p,GraphQLString:At,GraphQLUnionType:sa,get Kind(){return k},KnownArgumentNamesRule:U_,KnownDirectivesRule:sm,KnownFragmentNamesRule:q_,KnownTypeNamesRule:om,Lexer:Op,Location:s_,LoneAnonymousOperationRule:Q_,LoneSchemaDefinitionRule:G_,MaxIntrospectionDepthRule:H_,NoDeprecatedCustomRule:KR,NoFragmentCyclesRule:K_,NoSchemaIntrospectionCustomRule:JR,NoUndefinedVariablesRule:J_,NoUnusedFragmentsRule:Y_,NoUnusedVariablesRule:X_,get OperationTypeNode(){return Ut},OverlappingFieldsCanBeMergedRule:eE,PossibleFragmentSpreadsRule:iE,PossibleTypeExtensionsRule:sE,ProvidedRequiredArgumentsRule:oE,ScalarLeafsRule:lE,SchemaMetaFieldDef:Dl,SingleFieldSubscriptionsRule:mE,Source:Cu,Token:Ep,get TokenKind(){return q},TypeInfo:Xp,get TypeKind(){return ft},TypeMetaFieldDef:Rl,TypeNameMetaFieldDef:Ml,UniqueArgumentDefinitionNamesRule:gE,UniqueArgumentNamesRule:hm,UniqueDirectiveNamesRule:yE,UniqueDirectivesPerLocationRule:pm,UniqueEnumValueNamesRule:vE,UniqueFieldDefinitionNamesRule:bE,UniqueFragmentNamesRule:_E,UniqueInputFieldNamesRule:mm,UniqueOperationNamesRule:EE,UniqueOperationTypesRule:wE,UniqueTypeNamesRule:TE,UniqueVariableNamesRule:SE,ValidationContext:CE,ValuesOfCorrectTypeRule:OE,VariablesAreInputTypesRule:kE,VariablesInAllowedPositionRule:NE,__Directive:Up,__DirectiveLocation:Wp,__EnumValue:zp,__Field:qp,__InputValue:Cl,__Schema:zu,__Type:wr,__TypeKind:Qp,assertAbstractType:LD,assertCompositeType:FD,assertDirective:UD,assertEnumType:ID,assertEnumValueName:E_,assertInputObjectType:xD,assertInputType:RD,assertInterfaceType:T_,assertLeafType:PD,assertListType:CD,assertName:ir,assertNamedType:VD,assertNonNullType:DD,assertNullableType:S_,assertObjectType:w_,assertOutputType:MD,assertScalarType:ND,assertSchema:Gp,assertType:kD,assertUnionType:AD,assertValidName:EM,assertValidSchema:Kp,assertWrappingType:$D,astFromValue:us,buildASTSchema:YE,buildClientSchema:eM,buildSchema:rM,coerceInputValue:uE,concatAST:vM,createSourceEventStream:QE,defaultFieldResolver:ym,defaultTypeResolver:UE,doTypesOverlap:Rp,execute:Zu,executeSync:PE,extendSchema:tM,findBreakingChanges:wM,findDangerousChanges:TM,formatError:HC,getArgumentValues:Yu,getDirectiveValues:ua,getEnterLeaveForKind:na,getIntrospectionQuery:GE,getLocation:Au,getNamedType:In,getNullableType:xp,getOperationAST:YR,getOperationRootType:XR,getVariableValues:dE,getVisitFn:TD,graphql:WR,graphqlSync:qR,introspectionFromSchema:ZR,introspectionTypes:Pl,isAbstractType:oi,isCompositeType:si,isConstValueNode:nm,isDefinitionNode:tR,isDirective:Wu,isEnumType:Vt,isEqualType:Vu,isExecutableDefinitionNode:em,isInputObjectType:gt,isInputType:Un,isInterfaceType:ot,isIntrospectionType:no,isLeafType:ii,isListType:bt,isNamedType:Al,isNonNullType:Ie,isNullableType:Ip,isObjectType:et,isOutputType:ss,isRequiredArgument:as,isRequiredInputField:$u,isScalarType:sr,isSchema:M_,isSelectionNode:tm,isSpecifiedDirective:jp,isSpecifiedScalarType:Uu,isType:kl,isTypeDefinitionNode:la,isTypeExtensionNode:Qu,isTypeNode:nR,isTypeSubTypeOf:to,isTypeSystemDefinitionNode:rm,isTypeSystemExtensionNode:im,isUnionType:Wt,isValidNameError:ow,isValueNode:$_,isWrappingType:Nl,lexicographicSortSchema:iM,locatedError:fa,parse:Sl,parseConstValue:pD,parseType:mD,parseValue:g_,print:mt,printError:GC,printIntrospectionSchema:oM,printLocation:n_,printSchema:sM,printSourceLocation:_p,printType:ew,recommendedRules:AE,resolveObjMapThunk:Dp,resolveReadonlyArrayThunk:Cp,responsePathAsArray:xn,separateOperations:bM,specifiedDirectives:cs,specifiedRules:IE,specifiedScalarTypes:Il,stripIgnoredCharacters:_M,subscribe:QR,syntaxError:Bt,typeFromAST:qn,validate:DE,validateSchema:Hp,valueFromAST:li,valueFromASTUntyped:Fu,version:WC,versionInfo:qC,visit:rn,visitInParallel:Ap,visitWithTypeInfo:Zp},Symbol.toStringTag,{value:"Module"}));function da(t,e){var n=t.directives;return!n||!n.length?!0:hw(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 CM(t){var e=[];return rn(t,{Directive:function(n){e.push(n.name.value)}}),e}var DM=function(t,e){return fs(t,e,!1)},RM=function(t,e){return fs(t,e,!0)};function fs(t,e,n){var r=new Set(t),i=r.size;return rn(e,{Directive:function(s){if(r.delete(s.name.value)&&(!n||!r.size))return is}}),n?!r.size:r.size<i}function dw(t){return t&&fs(["client","export"],t,!0)}function MM(t){var e=t.name.value;return e==="skip"||e==="include"}function hw(t){var e=[];return t&&t.length&&t.forEach(function(n){if(MM(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 PM=()=>Object.create(null),{forEach:FM,slice:pw}=Array.prototype,{hasOwnProperty:LM}=Object.prototype;let so=class DC{constructor(e=!0,n=PM){this.weakness=e,this.makeData=n}lookup(){return this.lookupArray(arguments)}lookupArray(e){let n=this;return FM.call(e,r=>n=n.getChildTrie(r)),LM.call(n,"data")?n.data:n.data=this.makeData(pw.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(pw.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 DC(this.weakness,this.makeData)),r}mapFor(e,n){return this.weakness&&$M(e)?this.weak||(n?this.weak=new WeakMap:void 0):this.strong||(n?this.strong=new Map:void 0)}};function $M(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var mw=br(function(){return navigator.product})=="ReactNative",ds=typeof WeakMap=="function"&&!(mw&&!global.HermesInternal),wm=typeof WeakSet=="function",of=typeof Symbol=="function"&&typeof Symbol.for=="function",Bl=of&&Symbol.asyncIterator,Tm=typeof br(function(){return window.document.createElement})=="function",VM=br(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,gw=(Tm||mw)&&!VM;function _t(t){return t!==null&&typeof t=="object"}function yw(t){return t!==null&&typeof t=="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function vw(t,e){var n=e,r=[];t.definitions.forEach(function(s){if(s.kind==="OperationDefinition")throw An(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:St([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],t.definitions,!0)});return i}function Ul(t){t===void 0&&(t=[]);var e={};return t.forEach(function(n){e[n.name.value]=n}),e}function Wl(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 jM(){}class Sm{constructor(e=1/0,n=jM){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 Om(){}const BM=Om,UM=typeof WeakRef<"u"?WeakRef:function(t){return{deref:()=>t}},WM=typeof WeakMap<"u"?WeakMap:Map,qM=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:Om,unregister:Om}},zM=10024;class af{constructor(e=1/0,n=BM){this.max=e,this.dispose=n,this.map=new WM,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<zM;i++){const s=r.next().value;if(!s)break;this.unfinalizedNodes.delete(s);const o=s.key;delete s.key,s.keyRef=new UM(o),this.registry.register(o,s,s)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new qM(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 km=new WeakSet;function bw(t){t.size<=(t.max||-1)||km.has(t)||(km.add(t),setTimeout(function(){t.clean(),km.delete(t)},100))}var lf=function(t,e){var n=new af(t,e);return n.set=function(r,i){var s=af.prototype.set.call(this,r,i);return bw(this),s},n},_w=function(t,e){var n=new Sm(t,e);return n.set=function(r,i){var s=Sm.prototype.set.call(this,r,i);return bw(this),s},n},QM=Symbol.for("apollo.cacheSize"),Kr=D({},gp[QM]),oo={};function Nm(t,e){oo[t]=e}var GM=globalThis.__DEV__!==!1?YM:void 0,HM=globalThis.__DEV__!==!1?XM:void 0,KM=globalThis.__DEV__!==!1?Ew:void 0;function JM(){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,Kr[n]||r]}))}function YM(){var t,e,n,r,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:JM(),sizes:D({print:(t=oo.print)===null||t===void 0?void 0:t.call(oo),parser:(e=oo.parser)===null||e===void 0?void 0:e.call(oo),canonicalStringify:(n=oo.canonicalStringify)===null||n===void 0?void 0:n.call(oo),links:Im(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:Tw(this.queryManager.documentTransform)}},(i=(r=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(r))}}function Ew(){return{cache:{fragmentQueryDocuments:hs(this.getFragmentDoc)}}}function XM(){var t=this.config.fragments;return D(D({},Ew.apply(this)),{addTypenameDocumentTransform:Tw(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:hs(this.storeReader.executeSelectionSet),executeSubSelectedArray:hs(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:hs(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:hs(t==null?void 0:t.findFragmentSpreads),lookup:hs(t==null?void 0:t.lookup),transform:hs(t==null?void 0:t.transform)}})}function ZM(t){return!!t&&"dirtyKey"in t}function hs(t){return ZM(t)?t.size:void 0}function ww(t){return t!=null}function Tw(t){return Am(t).map(function(e){return{cache:e}})}function Am(t){return t?St(St([hs(t==null?void 0:t.performWork)],Am(t==null?void 0:t.left),!0),Am(t==null?void 0:t.right),!0).filter(ww):[]}function Im(t){var e;return t?St(St([(e=t==null?void 0:t.getMemoryInternals)===null||e===void 0?void 0:e.call(t)],Im(t==null?void 0:t.left),!0),Im(t==null?void 0:t.right),!0).filter(ww):[]}var Sr=Object.assign(function(e){return JSON.stringify(e,eP)},{reset:function(){ha=new _w(Kr.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&Nm("canonicalStringify",function(){return ha.size});var ha;Sr.reset();function eP(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(tP))return e;var i=JSON.stringify(r),s=ha.get(i);if(!s){r.sort();var o=JSON.stringify(r);s=ha.get(o)||r,ha.set(i,s),ha.set(o,s)}var a=Object.create(n);return s.forEach(function(l){a[l]=e[l]}),a}}return e}function tP(t,e,n){return e===0||n[e-1]<=t}function Ii(t){return{__ref:String(t)}}function nt(t){return!!(t&&typeof t=="object"&&typeof t.__ref=="string")}function Sw(t){return _t(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function nP(t){return t.kind==="StringValue"}function rP(t){return t.kind==="BooleanValue"}function iP(t){return t.kind==="IntValue"}function sP(t){return t.kind==="FloatValue"}function oP(t){return t.kind==="Variable"}function aP(t){return t.kind==="ObjectValue"}function lP(t){return t.kind==="ListValue"}function cP(t){return t.kind==="EnumValue"}function uP(t){return t.kind==="NullValue"}function ao(t,e,n,r){if(iP(n)||sP(n))t[e.value]=Number(n.value);else if(rP(n)||nP(n))t[e.value]=n.value;else if(aP(n)){var i={};n.fields.map(function(o){return ao(i,o.name,o.value,r)}),t[e.value]=i}else if(oP(n)){var s=(r||{})[n.name.value];t[e.value]=s}else if(lP(n))t[e.value]=n.values.map(function(o){var a={};return ao(a,e,o,r),a[e.value]});else if(cP(n))t[e.value]=n.value;else if(uP(n))t[e.value]=null;else throw An(85,e.value,n.kind)}function Ow(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 ao(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 ao(r,s,o,e)})),xm(t.name.value,r,n)}var fP=["connection","include","skip","client","rest","export","nonreactive"],ql=Sr,xm=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(ql(i),")")}else return n.connection.key;var s=t;if(e){var o=ql(e);s+="(".concat(o,")")}return n&&Object.keys(n).forEach(function(a){fP.indexOf(a)===-1&&(n[a]&&Object.keys(n[a]).length?s+="@".concat(a,"(").concat(ql(n[a]),")"):s+="@".concat(a))}),s},{setStringify:function(t){var e=ql;return ql=t,e}});function zl(t,e){if(t.arguments&&t.arguments.length){var n={};return t.arguments.forEach(function(r){var i=r.name,s=r.value;return ao(n,i,s,e)}),n}return null}function xi(t){return t.alias?t.alias.value:t.name.value}function cf(t,e,n){for(var r,i=0,s=e.selections;i<s.length;i++){var o=s[i];if(Ci(o)){if(o.name.value==="__typename")return t[xi(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=cf(t,Wl(o,n).selectionSet,n);if(typeof u=="string")return u}}function Ci(t){return t.kind==="Field"}function kw(t){return t.kind==="InlineFragment"}function lo(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 An(78,n.kind);return n});return oe(e.length<=1,79,e.length),t}function co(t){return lo(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function uf(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Ql(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Cm(t){var e=co(t);return oe(e&&e.operation==="query",80),e}function Nw(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 uo(t){lo(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 An(84)}function ff(t){var e=Object.create(null),n=t&&t.variableDefinitions;return n&&n.length&&n.forEach(function(r){r.defaultValue&&ao(e,r.variable.name,r.defaultValue)}),e}const dP=()=>Object.create(null),{forEach:hP,slice:pP}=Array.prototype,{hasOwnProperty:mP}=Object.prototype;class Dm{constructor(e=!0,n=dP){this.weakness=e,this.makeData=n}lookup(...e){return this.lookupArray(e)}lookupArray(e){let n=this;return hP.call(e,r=>n=n.getChildTrie(r)),mP.call(n,"data")?n.data:n.data=this.makeData(pP.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&&Aw(e[r])?n.weak:n.strong;n=s&&s.get(e[r])}return n&&n.data}getChildTrie(e){const n=this.weakness&&Aw(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 Dm(this.weakness,this.makeData)),r}}function Aw(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}let on=null;const Iw={};let gP=1;const yP=()=>class{constructor(){this.id=["slot",gP++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=on;e;e=e.parent)if(this.id in e.slots){const n=e.slots[this.id];if(n===Iw)break;return e!==on&&(on.slots[this.id]=n),!0}return on&&(on.slots[this.id]=Iw),!1}getValue(){if(this.hasValue())return on.slots[this.id]}withValue(e,n,r,i){const s={__proto__:null,[this.id]:e},o=on;on={parent:o,slots:s};try{return n.apply(i,r)}finally{on=o}}static bind(e){const n=on;return function(){const r=on;try{return on=n,e.apply(this,arguments)}finally{on=r}}}static noContext(e,n,r){if(on){const i=on;try{return on=null,e.apply(r,n)}finally{on=i}}else return e.apply(r,n)}};function xw(t){try{return t()}catch{}}const Rm="@wry/context:Slot",Cw=xw(()=>globalThis)||xw(()=>global)||Object.create(null),Mm=Cw[Rm]||Array[Rm]||function(t){try{Object.defineProperty(Cw,Rm,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(yP()),{bind:uae,noContext:fae}=Mm,df=new Mm,{hasOwnProperty:vP}=Object.prototype,Pm=Array.from||function(t){const e=[];return t.forEach(n=>e.push(n)),e};function Fm(t){const{unsubscribe:e}=t;typeof e=="function"&&(t.unsubscribe=void 0,e())}const Gl=[],bP=100;function pa(t,e){if(!t)throw new Error(e||"assertion failure")}function Dw(t,e){const n=t.length;return n>0&&n===e.length&&t[n-1]===e[n-1]}function Rw(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Mw(t){return t.slice(0)}class hf{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,++hf.count}peek(){if(this.value.length===1&&!ps(this))return Pw(this),this.value[0]}recompute(e){return pa(!this.recomputing,"already recomputing"),Pw(this),ps(this)?_P(this,e):Rw(this.value)}setDirty(){this.dirty||(this.dirty=!0,Fw(this),Fm(this))}dispose(){this.setDirty(),Bw(this),Lm(this,(e,n)=>{e.setDirty(),Uw(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=Gl.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(Pm(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),Gl.push(this.deps),this.deps=null)}}hf.count=0;function Pw(t){const e=df.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),ps(t)?$w(e,t):Vw(e,t),e}function _P(t,e){return Bw(t),df.withValue(t,EP,[t,e]),TP(t,e)&&wP(t),Rw(t.value)}function EP(t,e){t.recomputing=!0;const{normalizeResult:n}=t;let r;n&&t.value.length===1&&(r=Mw(t.value)),t.value.length=0;try{if(t.value[0]=t.fn.apply(null,e),n&&r&&!Dw(r,t.value))try{t.value[0]=n(t.value[0],r[0])}catch{}}catch(i){t.value[1]=i}t.recomputing=!1}function ps(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function wP(t){t.dirty=!1,!ps(t)&&Lw(t)}function Fw(t){Lm(t,$w)}function Lw(t){Lm(t,Vw)}function Lm(t,e){const n=t.parents.size;if(n){const r=Pm(t.parents);for(let i=0;i<n;++i)e(r[i],t)}}function $w(t,e){pa(t.childValues.has(e)),pa(ps(e));const n=!ps(t);if(!t.dirtyChildren)t.dirtyChildren=Gl.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),n&&Fw(t)}function Vw(t,e){pa(t.childValues.has(e)),pa(!ps(e));const n=t.childValues.get(e);n.length===0?t.childValues.set(e,Mw(e.value)):Dw(n,e.value)||t.setDirty(),jw(t,e),!ps(t)&&Lw(t)}function jw(t,e){const n=t.dirtyChildren;n&&(n.delete(e),n.size===0&&(Gl.length<bP&&Gl.push(n),t.dirtyChildren=null))}function Bw(t){t.childValues.size>0&&t.childValues.forEach((e,n)=>{Uw(t,n)}),t.forgetDeps(),pa(t.dirtyChildren===null)}function Uw(t,e){e.parents.delete(t),t.childValues.delete(e),jw(t,e)}function TP(t,e){if(typeof t.subscribe=="function")try{Fm(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}const SP={setDirty:!0,dispose:!0,forget:!0};function Ww(t){const e=new Map;function n(r){const i=df.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&&vP.call(SP,s)?s:"setDirty";Pm(o).forEach(l=>l[a]()),e.delete(i),Fm(o)}},n}let qw;function OP(...t){return(qw||(qw=new Dm(typeof WeakMap=="function"))).lookupArray(t)}const $m=new Set;function Hl(t,{max:e=Math.pow(2,16),keyArgs:n,makeCacheKey:r=OP,normalizeResult:i,subscribe:s,cache:o=Sm}=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 hf(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),$m.add(a),df.hasValue()||($m.forEach(b=>b.clean()),$m.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 kP(t){return t}var Kl=function(){function t(e,n){n===void 0&&(n=Object.create(null)),this.resultCache=wm?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(kP,{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 so(ds);this.performWork=Hl(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:Kr["documentTransform.cache"],cache:af})}},t.prototype.performWork=function(e){return lo(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}(),Jl,ma=Object.assign(function(t){var e=Jl.get(t);return e||(e=mt(t),Jl.set(t,e)),e},{reset:function(){Jl=new lf(Kr.print||2e3)}});ma.reset(),globalThis.__DEV__!==!1&&Nm("print",function(){return Jl?Jl.size:0});var Ot=Array.isArray;function zn(t){return Array.isArray(t)&&t.length>0}var zw={kind:k.FIELD,name:{kind:k.NAME,value:"__typename"}};function Qw(t,e){return!t||t.selectionSet.selections.every(function(n){return n.kind===k.FRAGMENT_SPREAD&&Qw(e[n.name.value],e)})}function Vm(t){return Qw(co(t)||Nw(t),Ul(Ql(t)))?null:t}function NP(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 Gw(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 pf(t,e){lo(e);for(var n=Gw(""),r=Gw(""),i=function(w){for(var O=0,N=void 0;O<w.length&&(N=w[O]);++O)if(!Ot(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=NP(t),l=function(w){return zn(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=rn(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 Vm(rn(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 mf=Object.assign(function(t){return rn(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 Ci(a)&&(a.name.value==="__typename"||a.name.value.lastIndexOf("__",0)===0)});if(!s){var o=r;if(!(Ci(o)&&o.directives&&o.directives.some(function(a){return a.name.value==="export"})))return D(D({},e),{selections:St(St([],i,!0),[zw],!1)})}}}}}})},{added:function(t){return t===zw}}),AP={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 IP(t){return pf([AP],lo(t))}function xP(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 CP(t,e){var n=xP(t);return Vm(rn(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 DP(t,e){function n(r){if(t.some(function(i){return i.name===r.name.value}))return null}return Vm(rn(e,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}function Hw(t){var e=uo(t),n=e.operation;if(n==="query")return t;var r=rn(t,{OperationDefinition:{enter:function(i){return D(D({},i),{operation:"query"})}}});return r}function jm(t){lo(t);var e=pf([{test:function(n){return n.name.value==="client"},remove:!0}],t);return e}function Bm(t,e){var n;return((n=co(t))===null||n===void 0?void 0:n.operation)===e}function RP(t){return Bm(t,"mutation")}function MP(t){return Bm(t,"query")}function PP(t){return Bm(t,"subscription")}var FP=Object.prototype.hasOwnProperty;function Yl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ga(t)}function ga(t){var e=t[0]||{},n=t.length;if(n>1)for(var r=new Di,i=1;i<n;++i)e=r.merge(e,t[i]);return e}var LP=function(t,e,n){return this.merge(t[n],e[n])},Di=function(){function t(e){e===void 0&&(e=LP),this.reconciler=e,this.isObject=_t,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 _t(n)&&_t(e)?(Object.keys(n).forEach(function(o){if(FP.call(e,o)){var a=e[o];if(n[o]!==a){var l=r.reconciler.apply(r,St([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 _t(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 $P(t){return t===void 0&&(t=!1),{keyArgs:t,merge:function(e,n){return e?St(St([],e,!0),n,!0):n}}}function VP(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 jP(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({},Um(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=UP()),!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=Yl(n,{pageInfo:{startCursor:g}}));var y=p&&p.cursor;y&&!d&&(n=Yl(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=St(St(St([],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=Nn(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({},Um(e)),Um(n)),{edges:O,pageInfo:N})}}}var Um=function(t){return Nn(t,BP)},BP=["edges","pageInfo"];function UP(){return{edges:[],pageInfo:{hasPreviousPage:!1,hasNextPage:!0,startCursor:"",endCursor:""}}}function WP(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=qP(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 qP(t,e){if(t){if(typeof t=="string")return Kw(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 Kw(t,e)}}function Kw(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 Jw(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 Wm(t,e,n){return e&&Jw(t.prototype,e),n&&Jw(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var qm=function(){return typeof Symbol=="function"},zm=function(t){return qm()&&!!Symbol[t]},Qm=function(t){return zm(t)?Symbol[t]:"@@"+t};qm()&&!zm("observable")&&(Symbol.observable=Symbol("observable"));var zP=Qm("iterator"),Gm=Qm("observable"),Yw=Qm("species");function gf(t,e){var n=t[e];if(n!=null){if(typeof n!="function")throw new TypeError(n+" is not a function");return n}}function Xl(t){var e=t.constructor;return e!==void 0&&(e=e[Yw],e===null&&(e=void 0)),e!==void 0?e:tt}function QP(t){return t instanceof tt}function ya(t){ya.log?ya.log(t):setTimeout(function(){throw t})}function yf(t){Promise.resolve().then(function(){try{t()}catch(e){ya(e)}})}function Xw(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var n=gf(e,"unsubscribe");n&&n.call(e)}}catch(r){ya(r)}}function Hm(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function GP(t){var e=t._queue;if(e){t._queue=void 0,t._state="ready";for(var n=0;n<e.length&&(Zw(t,e[n].type,e[n].value),t._state!=="closed");++n);}}function Zw(t,e,n){t._state="running";var r=t._observer;try{var i=gf(r,e);switch(e){case"next":i&&i.call(r,n);break;case"error":if(Hm(t),i)i.call(r,n);else throw n;break;case"complete":Hm(t),i&&i.call(r);break}}catch(s){ya(s)}t._state==="closed"?Xw(t):t._state==="running"&&(t._state="ready")}function Km(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}],yf(function(){return GP(t)});return}Zw(t,e,n)}}var HP=function(){function t(n,r){this._cleanup=void 0,this._observer=n,this._queue=void 0,this._state="initializing";var i=new KP(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"&&(Hm(this),Xw(this))},Wm(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),KP=function(){function t(n){this._subscription=n}var e=t.prototype;return e.next=function(r){Km(this._subscription,"next",r)},e.error=function(r){Km(this._subscription,"error",r)},e.complete=function(){Km(this._subscription,"complete")},Wm(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),tt=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 HP(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=Xl(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=Xl(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=Xl(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=Xl(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=Xl(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[Gm]=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=gf(r,Gm);if(s){var o=s.call(r);if(Object(o)!==o)throw new TypeError(o+" is not an object");return QP(o)&&o.constructor===i?o:new i(function(a){return o.subscribe(a)})}if(zm("iterator")&&(s=gf(r,zP),s))return new i(function(a){yf(function(){if(!a.closed){for(var l=WP(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){yf(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){yf(function(){if(!a.closed){for(var l=0;l<i.length;++l)if(a.next(i[l]),a.closed)return;a.complete()}})})},Wm(t,null,[{key:Yw,get:function(){return this}}]),t}();qm()&&Object.defineProperty(tt,Symbol("extensions"),{value:{symbol:Gm,hostReportError:ya},configurable:!0});function JP(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 va;typeof self<"u"?va=self:typeof window<"u"?va=window:typeof global<"u"?va=global:typeof module<"u"?va=module:va=Function("return this")(),JP(va);var eT=tt.prototype,tT="@@observable";eT[tT]||(eT[tT]=function(){return this});function vf(t){var e=Promise.resolve(t);return e.status="fulfilled",e.value=t,e}function nT(t){var e=Promise.reject(t);return e.catch(function(){}),e.status="rejected",e.reason=t,e}function rT(t){return"status"in t}function Jm(t){if(rT(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 YP=Object.prototype.toString;function Ym(t){return Xm(t)}function Xm(t,e){switch(YP.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]=Xm(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]=Xm(t[i],e)}),r}default:return t}}function XP(t){var e=new Set([t]);return e.forEach(function(n){_t(n)&&ZP(n)===n&&Object.getOwnPropertyNames(n).forEach(function(r){_t(n[r])&&e.add(n[r])})}),t}function ZP(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 ba(t){return globalThis.__DEV__!==!1&&XP(t),t}function _a(t,e,n){var r=[];t.forEach(function(i){return i[e]&&r.push(i)}),r.forEach(function(i){return i[e](n)})}function bf(t,e,n){return new tt(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 Zm(t){function e(n){Object.defineProperty(t,n,{value:tt})}return of&&Symbol.species&&e(Symbol.species),e("@@species"),t}function iT(t){return t&&typeof t.then=="function"}var fo=function(t){vr(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),_a(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),_a(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?iT(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"),_a(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 tt(n)]),iT(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}(tt);Zm(fo);function ho(t){return"incremental"in t}function sT(t){return"hasNext"in t&&"data"in t}function oT(t){return ho(t)||sT(t)}function aT(t){return _t(t)&&"payload"in t}function eg(t,e){var n=t,r=new Di;return ho(e)&&zn(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 Zl(t){var e=_f(t);return zn(e)}function _f(t){var e=zn(t.errors)?t.errors.slice(0):[];return ho(t)&&zn(t.incremental)&&t.incremental.forEach(function(n){n.errors&&e.push.apply(e,n.errors)}),e}function ms(){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 ci(t,e){return ms(t,e,e.variables&&{variables:ms(D(D({},t&&t.variables),e.variables))})}function lT(t,e){return tg(t,e)}function tg(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=tg(o,e,n);r||(r=l!==o),i[a]=l}),r)return i}else if(yw(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=tg(t[o],e,n);r||(r=a!==t[o]),s[o]=a}),r)return s}return t}function eF(t){return lT(t,"__typename")}const tF=Object.freeze(Object.defineProperty({__proto__:null,AutoCleanedStrongCache:_w,AutoCleanedWeakCache:lf,Concast:fo,DEV:UC,DeepMerger:Di,DocumentTransform:Kl,Observable:tt,addTypenameToDocument:mf,argumentsObjectFromField:zl,asyncMap:bf,buildQueryFromSelectionSet:Hw,cacheSizes:Kr,canUseAsyncIteratorSymbol:Bl,canUseDOM:Tm,canUseLayoutEffect:gw,canUseSymbol:of,canUseWeakMap:ds,canUseWeakSet:wm,canonicalStringify:Sr,checkDocument:lo,cloneDeep:Ym,compact:ms,concatPagination:$P,createFragmentMap:Ul,createFulfilledPromise:vf,createRejectedPromise:nT,fixObservableSubclass:Zm,getDefaultValues:ff,getDirectiveNames:CM,getFragmentDefinition:Nw,getFragmentDefinitions:Ql,getFragmentFromSelection:Wl,getFragmentQueryDocument:vw,getGraphQLErrorsFromResult:_f,getInclusionDirectives:hw,getMainDefinition:uo,getOperationDefinition:co,getOperationName:uf,getQueryDefinition:Cm,getStoreKeyName:xm,getTypenameFromResult:cf,graphQLResultHasError:Zl,hasAllDirectives:RM,hasAnyDirectives:DM,hasClientExports:dw,hasDirectives:fs,isApolloPayloadResult:aT,isArray:Ot,isDocumentNode:Sw,isExecutionPatchIncrementalResult:ho,isExecutionPatchInitialResult:sT,isExecutionPatchResult:oT,isField:Ci,isInlineFragment:kw,isMutationOperation:RP,isNonEmptyArray:zn,isNonNullObject:_t,isPlainObject:yw,isQueryOperation:MP,isReference:nt,isStatefulPromise:rT,isSubscriptionOperation:PP,iterateObserversSafely:_a,makeReference:Ii,makeUniqueId:ku,maybe:br,maybeDeepFreeze:ba,mergeDeep:Yl,mergeDeepArray:ga,mergeIncrementalData:eg,mergeOptions:ci,offsetLimitPagination:VP,omitDeep:lT,print:ma,relayStylePagination:jP,removeArgumentsFromDocument:CP,removeClientSetsFromDocument:jm,removeConnectionDirectiveFromDocument:IP,removeDirectivesFromDocument:pf,removeFragmentSpreadFromDocument:DP,resultKeyNameFromField:xi,shouldInclude:da,storeKeyNameFromField:Ow,stringifyForDisplay:yp,stripTypename:eF,valueToObjectRepresentation:ao,wrapPromiseWithState:Jm},Symbol.toStringTag,{value:"Module"}));function ec(t){return new tt(function(e){e.error(t)})}function cT(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 uT(t){return new tt(function(e){t.then(function(n){e.next(n),e.complete()}).catch(e.error.bind(e))})}var Ef=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 nF(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 An(44,i)}return t}function rF(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 iF(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?uf(e.query)||void 0:""),e}function sF(t,e){var n=D({},t),r=new Set(Object.keys(t));return rn(e,{Variable:function(i,s,o){o&&o.kind!=="VariableDefinition"&&r.delete(i.name.value)}}),r.forEach(function(i){delete n[i]}),n}function fT(t,e){return e?e(t):tt.of()}function tc(t){return typeof t=="function"?new Cn(t):t}function wf(t){return t.request.length<=1}var Cn=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return tt.of()})},t.from=function(e){return e.length===0?t.empty():e.map(tc).reduce(function(n,r){return n.concat(r)})},t.split=function(e,n,r){var i=tc(n),s=tc(r||new t(fT)),o;return wf(i)&&wf(s)?o=new t(function(a){return e(a)?i.request(a)||tt.of():s.request(a)||tt.of()}):o=new t(function(a,l){return e(a)?i.request(a,l)||tt.of():s.request(a,l)||tt.of()}),Object.assign(o,{left:i,right:s})},t.execute=function(e,n){return e.request(rF(n.context,iF(nF(n))))||tt.of()},t.concat=function(e,n){var r=tc(e);if(wf(r))return globalThis.__DEV__!==!1&&oe.warn(36,r),r;var i=tc(n),s;return wf(i)?s=new t(function(o){return r.request(o,function(a){return i.request(a)||tt.of()})||tt.of()}):s=new t(function(o,a){return r.request(o,function(l){return i.request(l,a)||tt.of()})||tt.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(fT)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,n){throw An(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}(),dT=Cn.empty,ng=Cn.from,rg=Cn.split,hT=Cn.concat,nc=Cn.execute;function oF(t){var e,n=t[Symbol.asyncIterator]();return e={next:function(){return n.next()}},e[Symbol.asyncIterator]=function(){return this},e}function aF(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 Bl&&(d[Symbol.asyncIterator]=function(){return this}),d}function lF(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 Bl&&(n[Symbol.asyncIterator]=function(){return this}),n}function pT(t){var e={next:function(){return t.read()}};return Bl&&(e[Symbol.asyncIterator]=function(){return this}),e}function cF(t){return!!t.body}function uF(t){return!!t.getReader}function fF(t){return!!(Bl&&t[Symbol.asyncIterator])}function dF(t){return!!t.stream}function hF(t){return!!t.arrayBuffer}function pF(t){return!!t.pipe}function mF(t){var e=t;if(cF(t)&&(e=t.body),fF(e))return oF(e);if(uF(e))return pT(e.getReader());if(dF(e))return pT(e.stream().getReader());if(hF(e))return lF(e.arrayBuffer());if(pF(e))return aF(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var ig=Symbol();function gF(t){return t.extensions?Array.isArray(t.extensions[ig]):!1}function Tf(t){return t.hasOwnProperty("graphQLErrors")}var yF=function(t){var e=St(St(St([],t.graphQLErrors,!0),t.clientErrors,!0),t.protocolErrors,!0);return t.networkError&&e.push(t.networkError),e.map(function(n){return _t(n)&&n.message||"Error message not found."}).join(`
208
+ `)},mn=function(t){vr(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||yF(u),u.extraInfo=l,u.cause=St(St(St([o],r||[],!0),i||[],!0),s||[],!0).find(function(d){return!!d})||null,u.__proto__=e.prototype,u}return e}(Error),mT=Object.prototype.hasOwnProperty;function vF(t,e){return es(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 ts(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=mF(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=bF(_.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=gT(t,I),Object.keys(P).length>1||"data"in P||"incremental"in P||"errors"in P||"payload"in P)if(aT(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[ig]=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 bF(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 gT(t,e){if(t.status>=300){var n=function(){try{return JSON.parse(e)}catch{return e}};Ef(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 _F(t,e){t.result&&t.result.errors&&t.result.data&&e.next(t.result),e.error(t)}function sg(t){return function(e){return e.text().then(function(n){return gT(e,n)}).then(function(n){return!Array.isArray(n)&&!mT.call(n,"data")&&!mT.call(n,"errors")&&Ef(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=An(40,e,i.message);throw r.parseError=i,r}return n},EF={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},wF={accept:"*/*","content-type":"application/json"},TF={method:"POST"},og={http:EF,headers:wF,options:TF},Sf=function(t,e){return e(t)};function yT(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return n.unshift(e),Of.apply(void 0,St([t,Sf],n,!1))}function Of(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=SF(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,ma)),{options:i,body:d}}function SF(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 ag=function(t){if(!t&&typeof fetch>"u")throw An(38)},vT=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}},lg=function(t,e){var n=t.getContext(),r=n.uri;return r||(typeof e=="function"?e(t):e||"/graphql")};function cg(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 bT=br(function(){return fetch}),ug=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?Sf:i,o=t.includeExtensions,a=t.preserveHeaderCase,l=t.useGETForQueries,u=t.includeUnusedVariables,d=u===void 0?!1:u,h=Nn(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&ag(r||bT);var p={http:{includeExtensions:o,preserveHeaderCase:a},options:h.fetchOptions,credentials:h.credentials,headers:h.headers};return new Cn(function(g){var y=lg(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(fs(["client"],g.query)){var M=jm(g.query);if(!M)return ec(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=Of(g,s,og,p,P),Q=B.options,x=B.body;x.variables&&!d&&(x.variables=sF(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"},pe=ke(uo(g.query)),Ce=fs(["defer"],g.query);if(l&&!g.query.definitions.some(Te)&&(Q.method="GET"),Ce||pe){Q.headers=Q.headers||{};var ee="multipart/mixed;";pe&&Ce&&globalThis.__DEV__!==!1&&oe.warn(39),pe?ee+="boundary=graphql;subscriptionSpec=1.0,application/json":Ce&&(ee+="deferSpec=20220824,application/json"),Q.headers.accept=ee}if(Q.method==="GET"){var Ae=cg(y,x),fe=Ae.newURI,ve=Ae.parseError;if(ve)return ec(ve);y=fe}else try{Q.body=rc(x,"Payload")}catch(Se){return ec(Se)}return new tt(function(Se){var ht=r||br(function(){return fetch})||bT,Ne=Se.next.bind(Se);return ht(y,Q).then(function($){var te;g.setContext({response:$});var Z=(te=$.headers)===null||te===void 0?void 0:te.get("content-type");return Z!==null&&/^multipart\/mixed/i.test(Z)?vF($,Ne):sg(g)($).then(Ne)}).then(function(){U=void 0,Se.complete()}).catch(function($){U=void 0,_F($,Se)}),function(){U&&U.abort()}})})},kf=function(t){vr(e,t);function e(n){n===void 0&&(n={});var r=t.call(this,ug(n).request)||this;return r.options=n,r}return e}(Cn);const{toString:_T,hasOwnProperty:OF}=Object.prototype,ET=Function.prototype.toString,fg=new Map;function Ue(t,e){try{return dg(t,e)}finally{fg.clear()}}function dg(t,e){if(t===e)return!0;const n=_T.call(t),r=_T.call(e);if(n!==r)return!1;switch(n){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(TT(t,e))return!0;const i=wT(t),s=wT(e),o=i.length;if(o!==s.length)return!1;for(let a=0;a<o;++a)if(!OF.call(e,i[a]))return!1;for(let a=0;a<o;++a){const l=i[a];if(!dg(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(TT(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&&!dg(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=ET.call(t);return i!==ET.call(e)?!1:!AF(i,NF)}}return!1}function wT(t){return Object.keys(t).filter(kF,t)}function kF(t){return this[t]!==void 0}const NF="{ [native code] }";function AF(t,e){const n=t.length-e.length;return n>=0&&t.indexOf(e,n)===n}function TT(t,e){let n=fg.get(t);if(n){if(n.has(e))return!0}else fg.set(t,n=new Set);return n.add(e),!1}const IF=Object.freeze(Object.defineProperty({__proto__:null,default:Ue,equal:Ue},Symbol.toStringTag,{value:"Module"}));function ST(t,e,n,r){var i=e.data,s=Nn(e,["data"]),o=n.data,a=Nn(n,["data"]);return Ue(s,a)&&Nf(uo(t).selectionSet,i,o,{fragmentMap:Ul(Ql(t)),variables:r})}function Nf(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),!da(s,r.variables))||OT(s))return!0;if(Ci(s)){var o=xi(s),a=e&&e[o],l=n&&n[o],u=s.selectionSet;if(!u)return Ue(a,l);var d=Array.isArray(a),h=Array.isArray(l);if(d!==h)return!1;if(d&&h){var p=a.length;if(l.length!==p)return!1;for(var g=0;g<p;++g)if(!Nf(u,a[g],l[g],r))return!1;return!0}return Nf(u,a,l,r)}else{var y=Wl(s,r.fragmentMap);if(y)return OT(y)?!0:Nf(y.selectionSet,e,n,r)}})}function OT(t){return!!t.directives&&t.directives.some(xF)}function xF(t){return t.name.value==="nonreactive"}var Af=function(){function t(){this.assumeImmutableResults=!1,this.getFragmentDoc=Hl(vw,{max:Kr["cache.fragmentQueryDocuments"]||1e3,cache:af})}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=Nn(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 tt(function(p){return n.watch(D(D({},d),{immediate:!0,callback:function(g){if(!(h&&ST(u,{data:h==null?void 0:h.result},{data:g.result}))){var y={data:g.result,complete:!!g.complete};g.missing&&(y.missing=ga(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=Nn(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=Nn(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&&(Af.prototype.getMemoryInternals=KM);var If;If||(If={});var xf=function(t){vr(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),Jt=Object.prototype.hasOwnProperty;function ic(t){return t==null}function Cf(t,e){var n=t.__typename,r=t.id,i=t._id;if(typeof n=="string"&&(e&&(e.keyObject=ic(r)?ic(i)?void 0:{_id:i}:{id:r}),ic(r)&&!ic(i)&&(r=i),!ic(r)))return"".concat(n,":").concat(typeof r=="number"||typeof r=="string"?r:JSON.stringify(r))}var kT={dataIdFromObject:Cf,addTypename:!0,resultCaching:!0,canonizeResults:!1};function CF(t){return ms(kT,t)}function NT(t){var e=t.canonizeResults;return e===void 0?kT.canonizeResults:e}function DF(t,e){return nt(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var AT=/^[_a-z][_0-9a-z]*/i;function gs(t){var e=t.match(AT);return e?e[0]:t}function hg(t,e,n){return _t(e)?Ot(e)?e.every(function(r){return hg(t,r,n)}):t.selections.every(function(r){if(Ci(r)&&da(r,n)){var i=xi(r);return Jt.call(e,i)&&(!r.selectionSet||hg(r.selectionSet,e[i],n))}return!0}):!1}function Ea(t){return _t(t)&&!nt(t)&&!Ot(t)}function RF(){return new Di}function IT(t,e){var n=Ul(Ql(t));return{fragmentMap:n,lookupFragment:function(r){var i=n[r];return!i&&e&&(i=e.lookup(r)),i||null}}}var Df=Object.create(null),pg=function(){return Df},xT=Object.create(null),sc=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 ba(nt(i)?r.get(i.__ref,s):i&&i[s])},this.canRead=function(i){return nt(i)?r.has(i.__ref):typeof i=="object"},this.toReference=function(i,s){if(typeof i=="string")return Ii(i);if(nt(i))return i;var o=r.policies.identify(i)[0];if(o){var a=Ii(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),Jt.call(this.data,e)){var r=this.data[e];if(r&&Jt.call(r,n))return r[n]}if(n==="__typename"&&Jt.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof ys)return this.parent.get(e,n)},t.prototype.lookup=function(e,n){if(n&&this.group.depend(e,"__exists"),Jt.call(this.data,e))return this.data[e];if(this instanceof ys)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;nt(e)&&(e=e.__ref),nt(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 Di(PF).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=gs(u);d!==u&&!r.policies.hasKeyArgs(a.__typename,d)&&(l[d]=1),a[u]===void 0&&!(r instanceof ys)&&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:Df,INVALIDATE:xT,isReference:nt,toReference:this.toReference,canRead:this.canRead,readField:function(u,d){return r.policies.readField(typeof u=="string"?{fieldName:u,from:d||Ii(e)}:u,{store:r})}};if(Object.keys(i).forEach(function(u){var d=gs(u),h=i[u];if(h!==void 0){var p=typeof n=="function"?n:n[u]||n[d];if(p){var g=p===pg?Df:p(ba(h),D(D({},l),{fieldName:d,storeFieldName:u,storage:r.getStorage(e,u)}));if(g===xT)r.group.dirty(e,u);else if(g===Df&&(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(nt(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(nt(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 ys?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]=pg,i):pg)}return!1},t.prototype.evict=function(e,n){var r=!1;return e.id&&(Jt.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof ys&&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){Jt.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&&Jt.call(e,s)||n.delete(s)}),e){var r=e.__META,i=Nn(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 ys?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){Jt.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 ys;)s=s.parent;i.forEach(function(o){return s.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!Jt.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){nt(s)&&(n[s.__ref]=!0),_t(s)&&Object.keys(s).forEach(function(o){var a=s[o];_t(a)&&i.add(a)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}(),CT=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?Ww():null,this.keyMaker=new so(ds)},t.prototype.depend=function(e,n){if(this.d){this.d(mg(e,n));var r=gs(n);r!==n&&this.d(mg(e,r)),this.parent&&this.parent.depend(e,n)}},t.prototype.dirty=function(e,n){this.d&&this.d.dirty(mg(e,n),n==="__exists"?"forget":"setDirty")},t}();function mg(t,e){return e+"#"+t}function DT(t,e){oc(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(n){vr(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 CT(a))||this;return u.stump=new MF(u),u.storageTrie=new so(ds),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})(sc||(sc={}));var ys=function(t){vr(e,t);function e(n,r,i,s){var o=t.call(this,r.policies,s)||this;return o.id=n,o.parent=r,o.replay=i,o.group=s,i(o),o}return e.prototype.addLayer=function(n,r){return new e(n,this,r,this.group)},e.prototype.removeLayer=function(n){var r=this,i=this.parent.removeLayer(n);return n===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(s){var o=r.data[s],a=i.lookup(s);a?o?o!==a&&Object.keys(o).forEach(function(l){Ue(o[l],a[l])||r.group.dirty(s,l)}):(r.group.dirty(s,"__exists"),Object.keys(a).forEach(function(l){r.group.dirty(s,l)})):r.delete(s)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return D(D({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(n){var r=this.parent.findChildRefIds(n);return Jt.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}(sc),MF=function(t){vr(e,t);function e(n){return t.call(this,"EntityStore.Stump",n,function(){},new CT(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}(ys);function PF(t,e,n){var r=t[n],i=e[n];return Ue(r,i)?r:i}function oc(t){return!!(t instanceof sc&&t.group.caching)}function FF(t){return _t(t)?Ot(t)?t.slice(0):D({__proto__:Object.getPrototypeOf(t)},t):t}var RT=function(){function t(){this.known=new(wm?WeakSet:Set),this.pool=new so(ds),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return _t(e)&&this.known.has(e)},t.prototype.pass=function(e){if(_t(e)){var n=FF(e);return this.passes.set(n,e),n}return e},t.prototype.admit=function(e){var n=this;if(_t(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 MT(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var LF=function(){function t(e){var n=this;this.knownResults=new(ds?WeakMap:Map),this.config=ms(e,{addTypename:e.addTypename!==!1,canonizeResults:NT(e)}),this.canon=e.canon||new RT,this.executeSelectionSet=Hl(function(r){var i,s=r.context.canonizeResults,o=MT(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:(DT(r.context.store,r.enclosingRef.__ref),n.execSelectionSetImpl(r))},{max:this.config.resultCacheMaxSize||Kr["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:MT,makeCacheKey:function(r,i,s,o){if(oc(s.store))return s.store.makeCacheKey(r,nt(i)?i.__ref:i,s.varString,o)}}),this.executeSubSelectedArray=Hl(function(r){return DT(r.context.store,r.enclosingRef.__ref),n.execSubSelectedArrayImpl(r)},{max:this.config.resultCacheMaxSize||Kr["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(r){var i=r.field,s=r.array,o=r.context;if(oc(o.store))return o.store.makeCacheKey(i,s,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new RT},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({},ff(Cm(r))),o);var p=Ii(s),g=this.executeSelectionSet({selectionSet:uo(r).selectionSet,objectOrReference:p,enclosingRef:p,context:D({store:n,query:r,policies:h,variables:o,varString:Sr(o),canonizeResults:d},IT(r,this.config.fragments))}),y;if(g.missing&&(y=[new xf($F(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(oc(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(nt(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 Di;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(da(N,a))if(Ci(N)){var M=l.readField({fieldName:N.name.value,field:N,variables:o.variables,from:i},o),B=xi(N);M===void 0?mf.added(N)||(p=g.merge(p,(I={},I[B]="Can't find field '".concat(N.name.value,"' on ").concat(nt(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),I))):Ot(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:nt(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=Wl(N,o.lookupFragment);if(!Q&&N.kind===k.FRAGMENT_SPREAD)throw An(9,N.name.value);Q&&l.fragmentMatches(Q,d)&&Q.selectionSet.selections.forEach(b.add,b)}});var _=ga(h),w={result:_,missing:p},O=o.canonizeResults?this.canon.admit(w):ba(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 Di;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:Ot(d)?u(n.executeSubSelectedArray({field:r,array:d,enclosingRef:s,context:o}),h):r.selectionSet?u(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:d,enclosingRef:nt(d)?d:s,context:o}),h):(globalThis.__DEV__!==!1&&VF(o.store,r,d),d)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:a}},t}();function $F(t){try{JSON.stringify(t,function(e,n){if(typeof n=="string")throw n;return n})}catch(e){return e}}function VF(t,e,n){if(!e.selectionSet){var r=new Set([n]);r.forEach(function(i){_t(i)&&(oe(!nt(i),10,DF(t,i),e.name.value),Object.values(i).forEach(r.add,r))})}}var gg=new Mm,PT=new WeakMap;function ac(t){var e=PT.get(t);return e||PT.set(t,e={vars:new Set,dep:Ww()}),e}function FT(t){ac(t).vars.forEach(function(e){return e.forgetCache(t)})}function jF(t){ac(t).vars.forEach(function(e){return e.attachCache(t)})}function yg(t){var e=new Set,n=new Set,r=function(s){if(arguments.length>0){if(t!==s){t=s,e.forEach(function(l){ac(l).dep.dirty(r),BF(l)});var o=Array.from(n);n.clear(),o.forEach(function(l){return l(t)})}}else{var a=gg.getValue();a&&(i(a),ac(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),ac(s).vars.add(r),r};return r.forgetCache=function(s){return e.delete(s)},r}function BF(t){t.broadcastWatches&&t.broadcastWatches()}var LT=Object.create(null);function vg(t){var e=JSON.stringify(t);return LT[e]||(LT[e]=Object.create(null))}function $T(t){var e=vg(t);return e.keyFieldsFn||(e.keyFieldsFn=function(n,r){var i=function(o,a){return r.readField(a,o)},s=r.keyObject=bg(t,function(o){var a=wa(r.storeObject,o,i);return a===void 0&&n!==r.storeObject&&Jt.call(n,o[0])&&(a=wa(n,o,BT)),oe(a!==void 0,4,o.join("."),n),a});return"".concat(r.typename,":").concat(JSON.stringify(s))})}function VT(t){var e=vg(t);return e.keyArgsFn||(e.keyArgsFn=function(n,r){var i=r.field,s=r.variables,o=r.fieldName,a=bg(t,function(u){var d=u[0],h=d.charAt(0);if(h==="@"){if(i&&zn(i.directives)){var p=d.slice(1),g=i.directives.find(function(w){return w.name.value===p}),y=g&&zl(g,s);return y&&wa(y,u.slice(1))}return}if(h==="$"){var b=d.slice(1);if(s&&Jt.call(s,b)){var _=u.slice(0);return _[0]=b,wa(s,_)}return}if(n)return wa(n,u)}),l=JSON.stringify(a);return(n||l!=="{}")&&(o+=":"+l),o})}function bg(t,e){var n=new Di;return jT(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 jT(t){var e=vg(t);if(!e.paths){var n=e.paths=[],r=[];t.forEach(function(i,s){Ot(i)?(jT(i).forEach(function(o){return n.push(r.concat(o))}),r.length=0):(r.push(i),Ot(t[s+1])||(n.push(r.slice(0)),r.length=0))})}return e.paths}function BT(t,e){return t[e]}function wa(t,e,n){return n=n||BT,UT(e.reduce(function r(i,s){return Ot(i)?i.map(function(o){return r(o,s)}):i&&n(i,s)},t))}function UT(t){return _t(t)?Ot(t)?t.map(UT):bg(Object.keys(t).sort(),function(e){return wa(t,e)}):t}function _g(t){return t.args!==void 0?t.args:t.field?zl(t.field,t.variables):null}var UF=function(){},WT=function(t,e){return e.fieldName},qT=function(t,e,n){var r=n.mergeObjects;return r(t,e)},zT=function(t,e){return e},WF=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:Cf},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,n){var r,i=this,s=n&&(n.typename||((r=n.storeObject)===null||r===void 0?void 0:r.__typename))||e.__typename;if(s===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=n&&n.storeObject||e,a=D(D({},n),{typename:s,storeObject:o,readField:n&&n.readField||function(){var p=Eg(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(Ot(h))d=$T(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=Nn(i,["queryType","mutationType","subscriptionType"]);s&&n.setRootTypename("Query",r),o&&n.setRootTypename("Mutation",r),a&&n.setRootTypename("Subscription",r),Jt.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?qT:u===!1?zT:l.merge}a(i,n.merge),i.keyFn=s===!1?UF:Ot(s)?$T(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?WT:Ot(h)?VT(h):typeof h=="function"?h:u.keyFn,typeof p=="function"&&(u.read=p),a(u,g)}u.read&&u.merge&&(u.keyFn=u.keyFn||WT)})},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(AT);(!s||s[0]!==i)&&n.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var n=this;if(!Jt.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=Nn(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&&hg(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=_g(e);o;){var u=o(l,a);if(Ot(u))o=VT(u);else{s=u||r;break}}return s===void 0&&(s=e.field?Ow(e.field,e.variables):xm(r,_g(e))),s===!1?r:r===gs(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=gs(o),l=n.store.getFieldValue(r,o),u=this.getFieldPolicy(e.typename,a,!1),d=u&&u.read;if(d){var h=QT(this,r,e,n,n.store.getStorage(nt(r)?r.__ref:r,o));return gg.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===qT?GT(i.store)(e,n):l===zT?n:(i.overwrite&&(e=void 0),l(e,n,QT(this,void 0,{typename:a,fieldName:o.name.value,field:o,variables:i.variables},i,s||Object.create(null))))},t}();function QT(t,e,n,r,i){var s=t.getStoreFieldName(n),o=gs(s),a=n.variables||r.variables,l=r.store,u=l.toReference,d=l.canRead;return{args:_g(n),field:n.field||null,fieldName:o,storeFieldName:s,variables:a,isReference:nt,toReference:u,storage:i,cache:t.cache,canRead:d,readField:function(){return t.readField(Eg(arguments,e,a),r)},mergeObjects:GT(r.store)}}function Eg(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),Jt.call(o,"from")||(o.from=e)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&oe.warn(7,yp(Array.from(t))),o.variables===void 0&&(o.variables=n),o}function GT(t){return function(n,r){if(Ot(n)||Ot(r))throw An(8);if(_t(n)&&_t(r)){var i=t.getFieldValue(n,"__typename"),s=t.getFieldValue(r,"__typename"),o=i&&s&&i!==s;if(o)return r;if(nt(n)&&Ea(r))return t.merge(n.__ref,r),n;if(Ea(n)&&nt(r))return t.merge(n,r.__ref),r;if(Ea(n)&&Ea(r))return D(D({},n),r)}return r}}function wg(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 qF=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=co(i),d=RF();a=D(D({},ff(u)),a);var h=D(D({store:e,written:Object.create(null),merge:function(g,y){return d.merge(g,y)},variables:a,varString:Sr(a)},IT(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(!nt(p))throw An(11,s);return h.incomingById.forEach(function(g,y){var b=g.storeObject,_=g.mergeTree,w=g.fieldNodeSet,O=Ii(y);if(_&&_.map.size){var N=r.applyMerges(_,O,b,h);if(nt(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[gs(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)&&zF(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]||cf(i,s,o.fragmentMap)||r&&o.store.get(r,"__typename");typeof d=="string"&&(u.__typename=d);var h=function(){var N=Eg(arguments,u,o.variables);if(nt(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=xi(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=KT(a,Q),U=n.processFieldValue(B,I,I.selectionSet?wg(N,!1,!1):N,x),Te=void 0;I.selectionSet&&(nt(U)||Ea(U))&&(Te=h("__typename",U));var ke=l.getMergeFunction(d,I.name.value,Te);ke?x.info={field:I,typename:d,merge:ke}:JT(a,Q),u=N.merge(u,(P={},P[Q]=U,P))}else globalThis.__DEV__!==!1&&!N.clientOnly&&!N.deferred&&!mf.added(I)&&!l.getReadFunction(d,I.name.value)&&globalThis.__DEV__!==!1&&oe.error(12,xi(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 _=Ii(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=Tg(O.mergeTree,a),p.forEach(function(N){return O.fieldNodeSet.add(N)})):o.incomingById.set(r,{storeObject:u,mergeTree:Rf(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?Ym(e):e:Ot(e)?e.map(function(o,a){var l=s.processFieldValue(o,n,r,KT(i,a));return JT(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=cf(n,e,r.fragmentMap));var s=new Map,o=this.cache.policies,a=new so(!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(da(p,r.variables)){var g=d.clientOnly,y=d.deferred;if(!(g&&y)&&zn(p.directives)&&p.directives.forEach(function(w){var O=w.name.value;if(O==="client"&&(g=!0),O==="defer"){var N=zl(w,r.variables);(!N||N.if!==!1)&&(y=!0)}}),Ci(p)){var b=s.get(p);b&&(g=g&&b.clientOnly,y=y&&b.deferred),s.set(p,wg(r,g,y))}else{var _=Wl(p,r.lookupFragment);if(!_&&p.kind===k.FRAGMENT_SPREAD)throw An(13,p.name.value);_&&o.fragmentMatches(_,i,n,r.variables)&&l(_.selectionSet,wg(r,g,y))}}}))}(e,r),s},t.prototype.applyMerges=function(e,n,r,i,s){var o,a=this;if(e.map.size&&!nt(r)){var l=!Ot(r)&&(nt(n)||Ea(n))?n:void 0,u=r;l&&!s&&(s=[nt(l)?l.__ref:l]);var d,h=function(p,g){return Ot(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=Ot(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}(),HT=[];function KT(t,e){var n=t.map;return n.has(e)||n.set(e,HT.pop()||{map:new Map}),n.get(e)}function Tg(t,e){if(t===e||!e||Rf(e))return t;if(!t||Rf(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,Tg(a,e.map.get(l))),o.delete(l)}),o.forEach(function(a){s.map.set(a,Tg(e.map.get(a),t.map.get(a)))})}return s}function Rf(t){return!t||!(t.info||t.map.size)}function JT(t,e){var n=t.map,r=n.get(e);r&&Rf(r)&&(HT.push(r),n.delete(e))}var YT=new Set;function zF(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&&!nt(s)&&!Ue(s,o)&&!Object.keys(s).every(function(h){return r.getFieldValue(o,h)!==void 0})){var a=r.getFieldValue(t,"__typename")||r.getFieldValue(e,"__typename"),l=gs(n),u="".concat(a,".").concat(l);if(!YT.has(u)){YT.add(u);var d=[];!Ot(s)&&!Ot(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 Sg=function(t){vr(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.watches=new Set,r.addTypenameTransform=new Kl(mf),r.assumeImmutableResults=!0,r.makeVar=yg,r.txCount=0,r.config=CF(n),r.addTypename=!!r.config.addTypename,r.policies=new WF({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 sc.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 qF(this,this.storeReader=new LF({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:NT(this.config),canon:n?void 0:i&&i.canon,fragments:s}),s),this.maybeBroadcastWatch=Hl(function(o,a){return r.broadcastWatch(o,a)},{max:this.config.resultCacheMaxSize||Kr["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(o){var a=o.optimistic?r.optimisticData:r.data;if(oc(a)){var l=o.optimistic,u=o.id,d=o.variables;return a.makeCacheKey(o.query,o.callback,Sr({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 xf)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(Jt.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||jF(this),this.watches.add(n),n.immediate&&this.maybeBroadcastWatch(n),function(){r.watches.delete(n)&&!r.watches.size&&FT(r),r.maybeBroadcastWatch.forget(n)}},e.prototype.gc=function(n){var r;Sr.reset(),ma.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(nt(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(Jt.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(),Sr.reset(),n&&n.discardWatches?(this.watches.forEach(function(i){return r.maybeBroadcastWatch.forget(i)}),this.watches.clear(),FT(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||!Ue(i.result,s.result))&&n.callback(n.lastDiff=s,i)},e}(Af);globalThis.__DEV__!==!1&&(Sg.prototype.getMemoryInternals=HM);var Ge;(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"})(Ge||(Ge={}));function lc(t){return t?t<7:!1}function XT(t){return t===7||t===8}var ZT=Object.assign,QF=Object.hasOwnProperty,cc=function(t){vr(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=GF)}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=Og(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=co(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||Ge.ready,s=D(D({},r),{loading:lc(i),networkStatus:i}),o=this.options.fetchPolicy,a=o===void 0?"cache-first":o;if(!(Og(a)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var l=this.queryInfo.getDiff();(l.complete||this.options.returnPartialData)&&(s.data=l.result),Ue(s.data,{})&&(s.data=void 0),l.complete?(delete s.partial,l.complete&&s.networkStatus===Ge.loading&&(a==="cache-first"||a==="cache-only")&&(s.networkStatus=Ge.ready,s.loading=!1)):s.partial=!0,globalThis.__DEV__!==!1&&!l.complete&&!this.options.partialRefetch&&!s.loading&&!s.data&&!s.error&&tS(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?!ST(this.query,this.last.result,n,this.variables):!Ue(this.last.result,n);return i||r&&!Ue(this.last.variables,r)},e.prototype.getLast=function(n,r){var i=this.last;if(i&&i[n]&&(!r||Ue(i.variables,this.variables)))return i[n]},e.prototype.getLastResult=function(n){return this.getLast("result",n)},e.prototype.getLastError=function(n){return this.getLast("error",n)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(n){var r,i={pollInterval:0},s=this.options.fetchPolicy;if(s==="cache-and-network"?i.fetchPolicy=s:s==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&n&&QF.call(n,"variables")){var o=Cm(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&&!Ue(this.options.variables,n)&&(i.variables=this.options.variables=D(D({},this.options.variables),n)),this.queryInfo.resetLastWrite(),this.reobserve(i,Ge.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=Ge.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,Ge.fetchMore).then(function(h){if(r.queryManager.removeQuery(s),o.networkStatus===Ge.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)&&eS(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=ms(this.options,n||{});ZT(this.options,r)},e.prototype.setVariables=function(n){return Ue(this.variables,n)?this.observers.size?this.result():Promise.resolve():(this.options.variables=n,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:n},Ge.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&&(!lc(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"},Ge.poll).then(l,l):l())},l=function(){var u=n.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(a,u.interval))};l()}}},e.prototype.updateLastResult=function(n,r){r===void 0&&(r=this.variables);var i=this.getLastError();return i&&this.last&&!Ue(r,this.last.variables)&&(i=void 0),this.last=D({result:this.queryManager.assumeImmutableResults?n:Ym(n),variables:r},i?{error:i}:null)},e.prototype.reobserveAsConcast=function(n,r){var i=this;this.isTornDown=!1;var s=r===Ge.refetch||r===Ge.fetchMore||r===Ge.poll,o=this.options.variables,a=this.options.fetchPolicy,l=ms(this.options,n||{}),u=s?l:ZT(this.options,l),d=this.transformDocument(u.query);this.lastQuery=d,s||(this.updatePolling(),n&&n.variables&&!Ue(n.variables,o)&&u.fetchPolicy!=="standby"&&(u.fetchPolicy===a||typeof u.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",u),r===void 0&&(r=Ge.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Og(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){Ue(i.variables,p)&&(h(),i.reportResult(w,p))},error:function(w){Ue(i.variables,p)&&(Tf(w)||(w=new mn({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)&&_a(this.observers,"next",n)},e.prototype.reportError=function(n,r){var i=D(D({},this.getLastResult()),{error:n,errors:n.graphQLErrors,networkStatus:Ge.error,loading:!1});this.updateLastResult(i,r),_a(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}(tt);Zm(cc);function eS(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 GF(t){globalThis.__DEV__!==!1&&oe.error(24,t.message,t.stack)}function tS(t){globalThis.__DEV__!==!1&&t&&globalThis.__DEV__!==!1&&oe.debug(25,t)}function Og(t){return t==="network-only"||t==="no-cache"||t==="standby"}var Ta=new(ds?WeakMap:Map);function kg(t,e){var n=t[e];typeof n=="function"&&(t[e]=function(){return Ta.set(t,(Ta.get(t)+1)%1e15),n.apply(this,arguments)})}function nS(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Ng=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;Ta.has(r)||(Ta.set(r,0),kg(r,"evict"),kg(r,"modify"),kg(r,"reset"))}return t.prototype.init=function(e){var n=e.networkStatus||Ge.loading;return this.variables&&this.networkStatus!==Ge.loading&&!Ue(this.variables,e.variables)&&(n=Ge.setVariables),Ue(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:n}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){nS(this),this.dirty=!1},t.prototype.resetDiff=function(){this.lastDiff=void 0},t.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&Ue(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var r=this.cache.diff(e);return this.updateLastDiff(r,e),r},t.prototype.updateLastDiff=function(e,n){this.lastDiff=e?{diff:e,options:n||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var n;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(n=this.observableQuery)===null||n===void 0?void 0:n.options.canonizeResults}},t.prototype.setDiff=function(e){var n=this,r,i=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(!((r=this.observableQuery)===null||r===void 0)&&r.getLastError())||(this.updateLastDiff(e),!this.dirty&&!Ue(i&&i.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return n.notify()},0))))},t.prototype.setObservableQuery=function(e){var n=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var r=n.getDiff();r.fromOptimisticTransaction?e.observe():eS(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;nS(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(lc(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||!Ue(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,n){var r=this.lastWrite;return!(r&&r.dmCount===Ta.get(this.cache)&&Ue(n,r.variables)&&Ue(e.data,r.result.data))},t.prototype.markResult=function(e,n,r,i){var s=this,o=new Di,a=zn(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&zn(e.incremental)){var l=eg(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&&(Ag(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:Ta.get(s.cache)};else if(s.lastDiff&&s.lastDiff.diff.complete){e.data=s.lastDiff.diff.result;return}var h=s.getDiffOptions(r.variables),p=d.diff(h);!s.stopped&&Ue(s.variables,r.variables)&&s.updateWatch(r.variables),s.updateLastDiff(p,h),p.complete&&(e.data=p.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Ge.ready},t.prototype.markError=function(e){return this.networkStatus=Ge.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Ag(t,e){e===void 0&&(e="none");var n=e==="ignore"||e==="all",r=!Zl(t);return!r&&n&&t.data&&(r=!0),r}var HF=Object.prototype.hasOwnProperty,rS=Object.create(null),KF=function(){function t(e){var n=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new lf(Kr["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new so(!1);var r=new Kl(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(An(26))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(n){return n(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){return es(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 ts(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 bf(a.getObservableFromLink(d,D(D({},x),{optimisticResponse:o?p:void 0}),h,{},!1),function(pe){if(Zl(pe)&&B==="none")throw new mn({graphQLErrors:_f(pe)});s&&(s.loading=!1,s.error=null);var Ce=D({},pe);return typeof b=="function"&&(b=b(Ce)),B==="ignore"&&Zl(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(pe){a.broadcastQueries(),(!("hasNext"in pe)||pe.hasNext===!1)&&Te(pe)},error:function(pe){s&&(s.loading=!1,s.error=pe),o&&a.cache.removeOptimistic(r),a.broadcastQueries(),ke(pe instanceof mn?pe:new mn({networkError:pe}))}})})]}})})},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&&Ag(i,e.errorPolicy)){if(ho(i)||s.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),ho(i)&&zn(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=eg(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||!HF.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&&uf(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=!oT(i)||ho(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:rS}):e;return i===rS?!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:dw(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:fs(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:pf([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:ff(co(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 Ng(this),i=new cc({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(An(33)),this.queries.forEach(function(n){n.observableQuery?n.networkStatus=Ge.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):Sw(o)?i.set(n.transform(o),!1):_t(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=ku("legacyOneTimeQuery"),l=n.getQuery(a).init({document:o.query,variables:o.variables}),u=new cc({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"&&(Ag(b,o)&&n.cache.write({query:r,result:b.data,dataId:"ROOT_SUBSCRIPTION",variables:y}),n.broadcastQueries());var _=Zl(b),w=gF(b);if(_||w){var O={};if(_&&(O.graphQLErrors=b.errors),w&&(O.protocolErrors=b.extensions[ig]),o==="none"||w)throw new mn(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 tt(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:uf(d)||void 0,context:this.prepareContext(D(D({},n),{forceFetch:!s})),extensions:i};if(n=b.context,s){var _=ma(d),w=Sr(r),O=g.lookup(_,w);if(l=O.observable,!l){var N=new fo([nc(y,b)]);l=O.observable=N,N.beforeNext(function(){g.remove(_,w)})}}else l=new fo([nc(y,b)])}else l=new fo([tt.of({data:{}})]),n=this.prepareContext(n);return h&&(l=bf(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 bf(this.getObservableFromLink(s,r.context,r.variables),function(o){var a=_f(o),l=a.length>0,u=r.errorPolicy;if(i>=e.lastRequestId){if(l&&u==="none")throw e.markError(new mn({graphQLErrors:a}));e.markResult(o,s,r,n),e.markReady()}var d={data:o.data,loading:!1,networkStatus:Ge.ready};return l&&u==="none"&&(d.data=void 0),l&&u!=="ignore"&&(d.errors=a,d.networkStatus=Ge.error),d},function(o){var a=Tf(o)?o:new mn({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=Ge.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 fo(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 fo(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?ku("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 Ng&&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||Ge.loading);var M=I.result;globalThis.__DEV__!==!1&&!d&&!Ue(M,{})&&tS(I.missing);var B=function(Q){return tt.of(D({data:Q,loading:lc(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===Ge.refetch&&Array.isArray(I.missing)?B(void 0):B(M)},_=a==="no-cache"?0:r===Ge.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&&lc(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 Ng(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}(),JF=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=Yl(n.resolvers,r)}):this.resolvers=Yl(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 es(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 ts(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 fs(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return jm(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 es(this,arguments,void 0,function(n,r,i){return r===void 0&&(r={}),i===void 0&&(i={}),ts(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 rn(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 is}}}),n},t.prototype.buildRootValueFromCache=function(e,n){return this.cache.diff({query:Hw(e),variables:n,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,n){return es(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),ts(this,function(I){return u=uo(r),d=Ql(r),h=Ul(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 es(this,void 0,void 0,function(){var s,o,a,l,u,d=this;return ts(this,function(h){return s=i.fragmentMap,o=i.context,a=i.variables,l=[r],u=function(p){return es(d,void 0,void 0,function(){var g,y;return ts(this,function(b){return!n&&!i.selectionsToResolve.has(p)?[2]:da(p,a)?Ci(p)?[2,this.resolveField(p,n,r,i).then(function(_){var w;typeof _<"u"&&l.push((w={},w[xi(p)]=_,w))})]:(kw(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 ga(l)})]})})},t.prototype.resolveField=function(e,n,r,i){return es(this,void 0,void 0,function(){var s,o,a,l,u,d,h,p,g,y=this;return ts(this,function(b){return r?(s=i.variables,o=e.name.value,a=xi(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(gg.withValue(this.cache,g,[r,zl(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),rn(o,{Directive:function(l,u,d,h,p){l.name.value==="client"&&p.forEach(function(g){r(g)&&tm(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)&&tm(b)&&a.add(b)}),a.add(l),y.forEach(function(b){a.add(b)}))}})}return i.get(o)}return s(e)},t}(),iS=!1,Mf=function(){function t(e){var n=this,r;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw An(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 kf({uri:i,credentials:s,headers:o}):Cn.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=mp,this.localState=new JF({cache:a,client:this,resolvers:I,fragmentMatcher:M}),this.queryManager=new KF({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,!iS&&globalThis.__DEV__!==!1&&(iS=!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=ci(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=ci(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=ci(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 nc(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&&(Mf.prototype.getMemoryInternals=GM);var Pf=new Map,Ig=new Map,sS=!0,Ff=!1;function oS(t){return t.replace(/[\s,]+/g," ").trim()}function YF(t){return oS(t.source.body.substring(t.start,t.end))}function XF(t){var e=new Set,n=[];return t.definitions.forEach(function(r){if(r.kind==="FragmentDefinition"){var i=r.name.value,s=YF(r.loc),o=Ig.get(i);o&&!o.has(s)?sS&&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||Ig.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 ZF(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 eL(t){var e=oS(t);if(!Pf.has(e)){var n=Sl(t,{experimentalFragmentVariables:Ff,allowLegacyFragmentVariables:Ff});if(!n||n.kind!=="Document")throw new Error("Not a valid GraphQL document.");Pf.set(e,ZF(XF(n)))}return Pf.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]}),eL(r)}function xg(){Pf.clear(),Ig.clear()}function Cg(){sS=!1}function Dg(){Ff=!0}function Rg(){Ff=!1}var uc={gql:po,resetCaches:xg,disableFragmentWarnings:Cg,enableExperimentalFragmentVariables:Dg,disableExperimentalFragmentVariables:Rg};(function(t){t.gql=uc.gql,t.resetCaches=uc.resetCaches,t.disableFragmentWarnings=uc.disableFragmentWarnings,t.enableExperimentalFragmentVariables=uc.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=uc.disableExperimentalFragmentVariables})(po||(po={})),po.default=po,pp(globalThis.__DEV__!==!1?"log":"silent");const tL=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:Af,ApolloClient:Mf,ApolloError:mn,ApolloLink:Cn,get Cache(){return If},DocumentTransform:Kl,HttpLink:kf,InMemoryCache:Sg,MissingFieldError:xf,get NetworkStatus(){return Ge},Observable:tt,ObservableQuery:cc,checkFetcher:ag,concat:hT,createHttpLink:ug,createSignalIfSupported:vT,defaultDataIdFromObject:Cf,defaultPrinter:Sf,disableExperimentalFragmentVariables:Rg,disableFragmentWarnings:Cg,empty:dT,enableExperimentalFragmentVariables:Dg,execute:nc,fallbackHttpConfig:og,from:ng,fromError:ec,fromPromise:uT,get gql(){return po},isApolloError:Tf,isNetworkRequestSettled:XT,isReference:nt,makeReference:Ii,makeVar:yg,mergeOptions:ci,parseAndCheckHttpResponse:sg,resetCaches:xg,rewriteURIForGET:cg,selectHttpOptionsAndBody:yT,selectHttpOptionsAndBodyInternal:Of,selectURI:lg,serializeFetchParameter:rc,setLogVerbosity:pp,split:rg,throwServerError:Ef,toPromise:cT},Symbol.toStringTag,{value:"Module"}));var aS={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,ae)})(aS);var X=aS.exports;const Mg=LC({__proto__:null,default:$C(X)},[X]);var lS=of?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function Sa(){oe("createContext"in Mg,46);var t=X.createContext[lS];return t||(Object.defineProperty(X.createContext,lS,{value:t=X.createContext({}),enumerable:!1,writable:!1,configurable:!0}),t.displayName="ApolloContext"),t}var nL=Sa,rL=function(t){var e=Sa();return X.createElement(e.Consumer,null,function(n){return oe(n&&n.client,45),t.children(n.client)})},cS=function(t){var e=t.client,n=t.children,r=Sa(),i=X.useContext(r),s=X.useMemo(function(){return D(D({},i),{client:e||i.client})},[i,e]);return oe(s.client,47),X.createElement(r.Provider,{value:s},n)};function Qn(t){var e=X.useContext(Sa()),n=t||e.client;return oe(!!n,50),n}var uS=!1,iL="useSyncExternalStore",sL=Mg[iL],fc=sL||function(t,e,n){var r=e();globalThis.__DEV__!==!1&&!uS&&r!==e()&&(uS=!0,globalThis.__DEV__!==!1&&oe.error(60));var i=X.useState({inst:{value:r,getSnapshot:e}}),s=i[0].inst,o=i[1];return gw?X.useLayoutEffect(function(){Object.assign(s,{value:r,getSnapshot:e}),Pg(s)&&o({inst:s})},[t,r,e]):Object.assign(s,{value:r,getSnapshot:e}),X.useEffect(function(){return Pg(s)&&o({inst:s}),t(function(){Pg(s)&&o({inst:s})})},[t]),r};function Pg(t){var e=t.value,n=t.getSnapshot;try{return e!==n()}catch{return!0}}var or;(function(t){t[t.Query=0]="Query",t[t.Mutation=1]="Mutation",t[t.Subscription=2]="Subscription"})(or||(or={}));var mo;function Fg(t){var e;switch(t){case or.Query:e="Query";break;case or.Mutation:e="Mutation";break;case or.Subscription:e="Subscription";break}return e}function Lg(t){mo||(mo=new lf(Kr.parser||1e3));var e=mo.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?or.Query:or.Mutation,!o.length&&!a.length&&(r=or.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 mo.set(t,y),y}Lg.resetCache=function(){mo=void 0},globalThis.__DEV__!==!1&&Nm("parser",function(){return mo?mo.size:0});function Lf(t,e){var n=Lg(t),r=Fg(e),i=Fg(n.type);oe(n.type===e,66,r,r,i)}function $g(t,e){var n=X.useRef();return(!n.current||!Ue(n.current.deps,e))&&(n.current={value:t(),deps:e}),n.current.value}var $f=Tm?X.useLayoutEffect:X.useEffect,Vg;function oL(){}function aL(){return Vg||(Vg=X.createContext(null)),X.useCallback(function(){var t=console.error;try{return console.error=oL,X.useContext(Vg),!0}catch{return!1}finally{console.error=t}},[])}var lL="use",cL=Mg[lL],fS=cL||function(e){var n=Jm(e);switch(n.status){case"pending":throw n;case"rejected":throw n.reason;case"fulfilled":return n.value}},uL=Symbol.for("apollo.hook.wrappers");function go(t,e,n){var r=n.queryManager,i=r&&r[uL],s=i&&i[t];return s?s(e):e}var fL=Object.prototype.hasOwnProperty;function dS(){}var Vf=Symbol();function jf(t,e){return e===void 0&&(e=Object.create(null)),go("useQuery",dL,Qn(e&&e.client))(t,e)}function dL(t,e){var n=hS(t,e),r=n.result,i=n.obsQueryFields;return X.useMemo(function(){return D(D({},r),i)},[r,i])}function hL(t,e,n,r,i){function s(h){var p;Lf(e,or.Query);var g={client:t,query:e,observable:r&&r.getSSRObservable(i())||t.watchQuery(jg(void 0,t,n,i())),resultData:{previousData:(p=h==null?void 0:h.resultData.current)===null||p===void 0?void 0:p.data}};return g}var o=X.useState(s),a=o[0],l=o[1];function u(h){var p,g;Object.assign(a.observable,(p={},p[Vf]=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 hS(t,e){var n=Qn(e.client),r=X.useContext(Sa()).renderPromises,i=!!r,s=n.disableNetworkFetches,o=e.ssr!==!1&&!e.skip,a=e.partialRefetch,l=pS(n,t,e,i),u=hL(n,t,e,r,l),d=u[0],h=d.observable,p=d.resultData,g=u[1],y=l(h);gL(p,h,n,e,y);var b=X.useMemo(function(){return bL(h)},[h]);mL(h,r,o);var _=pL(p,h,n,e,y,s,a,i,{onCompleted:e.onCompleted||dS,onError:e.onError||dS});return{result:_,obsQueryFields:b,observable:h,resultData:p,client:n,onQueryExecuted:g}}function pL(t,e,n,r,i,s,o,a,l){var u=X.useRef(l);X.useEffect(function(){u.current=l});var d=(a||s)&&r.ssr===!1&&!r.skip?yS:r.skip||i.fetchPolicy==="standby"?vS:void 0,h=t.previousData,p=X.useMemo(function(){return d&&Bf(d,h,e,n)},[n,e,d,h]);return fc(X.useCallback(function(g){if(a)return function(){};var y=function(){var w=t.current,O=e.getCurrentResult();w&&w.loading===O.loading&&w.networkStatus===O.networkStatus&&Ue(w.data,O.data)||Bg(O,t,e,n,o,g,u.current)},b=function(w){if(_.current.unsubscribe(),_.current=e.resubscribeAfterError(y,b),!fL.call(w,"graphQLErrors"))throw w;var O=t.current;(!O||O&&O.loading||!Ue(w,O.error))&&Bg({data:O&&O.data,error:w,loading:!1,networkStatus:Ge.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||mS(t,e,u.current,o,n)},function(){return p||mS(t,e,u.current,o,n)})}function mL(t,e,n){e&&n&&(e.registerSSRObservable(t),t.getCurrentResult().loading&&e.addObservableQueryPromise(t))}function gL(t,e,n,r,i){var s;e[Vf]&&!Ue(e[Vf],i)&&(e.reobserve(jg(e,n,r,i)),t.previousData=((s=t.current)===null||s===void 0?void 0:s.data)||t.previousData,t.current=void 0),e[Vf]=i}function pS(t,e,n,r){n===void 0&&(n={});var i=n.skip;n.ssr,n.onCompleted,n.onError;var s=n.defaultOptions,o=Nn(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||Ug(s,t.defaultOptions),l.fetchPolicy="standby"):l.fetchPolicy||(l.fetchPolicy=(a==null?void 0:a.options.initialFetchPolicy)||Ug(s,t.defaultOptions)),l}}function jg(t,e,n,r){var i=[],s=e.defaultOptions.watchQuery;return s&&i.push(s),n.defaultOptions&&i.push(n.defaultOptions),i.push(ms(t&&t.options,r)),i.reduce(ci)}function Bg(t,e,n,r,i,s,o){var a=e.current;a&&a.data&&(e.previousData=a.data),!t.error&&zn(t.errors)&&(t.error=new mn({graphQLErrors:t.errors})),e.current=Bf(vL(t,n,i),e.previousData,n,r),s(),yL(t,a==null?void 0:a.networkStatus,o)}function yL(t,e,n){if(!t.loading){var r=gS(t);Promise.resolve().then(function(){r?n.onError(r):t.data&&e!==t.networkStatus&&t.networkStatus===Ge.ready&&n.onCompleted(t.data)}).catch(function(i){globalThis.__DEV__!==!1&&oe.warn(i)})}}function mS(t,e,n,r,i){return t.current||Bg(e.getCurrentResult(),t,e,i,r,function(){},n),t.current}function Ug(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 gS(t){return zn(t.errors)?new mn({graphQLErrors:t.errors}):t.error}function Bf(t,e,n,r){var i=t.data;t.partial;var s=Nn(t,["data","partial"]),o=D(D({data:i},s),{client:r,observable:n,variables:n.variables,called:t!==yS&&t!==vS,previousData:e});return o}function vL(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:Ge.refetch})):t}var yS=ba({loading:!0,data:void 0,error:void 0,networkStatus:Ge.loading}),vS=ba({loading:!1,data:void 0,error:void 0,networkStatus:Ge.ready});function bL(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 _L=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function Wg(t,e){var n,r=X.useRef(),i=X.useRef(),s=X.useRef(),o=ci(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=hS(a,l),d=u.obsQueryFields,h=u.result,p=u.client,g=u.resultData,y=u.observable,b=u.onQueryExecuted,_=y.options.initialFetchPolicy||Ug(l.defaultOptions,p.defaultOptions),w=X.useReducer(function(Q){return Q+1},0)[1],O=X.useMemo(function(){for(var Q={},x=function(pe){var Ce=d[pe];Q[pe]=function(){return r.current||(r.current=Object.create(null),w()),Ce.apply(this,arguments)}},U=0,Te=_L;U<Te.length;U++){var ke=Te[U];x(ke)}return Q},[w,d]),N=!!r.current,I=X.useMemo(function(){return D(D(D({},h),O),{called:N})},[h,O,N]),P=X.useCallback(function(Q){r.current=Q?D(D({},Q),{fetchPolicy:Q.fetchPolicy||_}):{fetchPolicy:_};var x=ci(i.current,D({query:s.current},r.current)),U=EL(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=X.useRef(P);$f(function(){M.current=P});var B=X.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 EL(t,e,n,r,i,s){var o=i.query||r,a=pS(n,o,i,!1)(e),l=e.reobserveAsConcast(jg(e,n,i,a));return s(a),new Promise(function(u){var d;l.subscribe({next:function(h){d=h},error:function(){u(Bf(e.getCurrentResult(),t.previousData,e,n))},complete:function(){u(Bf(d,t.previousData,e,n))}})})}function wL(t,e){var n=Qn(e==null?void 0:e.client);Lf(t,or.Mutation);var r=X.useState({called:!1,loading:!1,client:n}),i=r[0],s=r[1],o=X.useRef({result:i,mutationId:0,isMounted:!0,client:n,mutation:t,options:e});$f(function(){Object.assign(o.current,{client:n,options:e,mutation:t})});var a=X.useCallback(function(u){u===void 0&&(u={});var d=o.current,h=d.options,p=d.mutation,g=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,_=ci(g,u);return y.mutate(_).then(function(w){var O,N,I=w.data,P=w.errors,M=P&&P.length>0?new mn({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&&!Ue(o.current.result,Q)&&s(o.current.result=Q)}var x=u.onCompleted||((N=o.current.options)===null||N===void 0?void 0:N.onCompleted);return 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};Ue(o.current.result,N)||s(o.current.result=N)}var I=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(I)return I(w,_),{data:void 0,errors:w};throw w})},[]),l=X.useCallback(function(){if(o.current.isMounted){var u={called:!1,loading:!1,client:o.current.client};Object.assign(o.current,{mutationId:0,result:u}),s(u)}},[]);return X.useEffect(function(){var u=o.current;return u.isMounted=!0,function(){u.isMounted=!1}},[]),[a,D({reset:l},i)]}function TL(t,e){e===void 0&&(e=Object.create(null));var n=X.useRef(!1),r=Qn(e.client);Lf(t,or.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=$g(function(){return e.variables},[e.variables]),p=function(){return SL(r,t,h,s,o,l,u)},g=X.useState(e.skip?null:p),y=g[0],b=g[1],_=X.useRef(p);$f(function(){_.current=p}),i?y&&b(y=null):(!y||(r!==y.__.client||t!==y.__.query||s!==y.__.fetchPolicy||o!==y.__.errorPolicy||!Ue(h,y.__.variables))&&(typeof a=="function"?!!a(e):a)!==!1)&&b(y=p());var w=X.useRef(e);X.useEffect(function(){w.current=e});var O=!i&&!d,N=X.useMemo(function(){return{loading:O,error:void 0,data:void 0,variables:h}},[O,h]),I=X.useRef(d);$f(function(){I.current=d});var P=fc(X.useCallback(function(B){if(!y)return function(){};var Q=!1,x=y.__.variables,U=y.__.client,Te=y.subscribe({next:function(ke){var pe,Ce;if(!Q){var ee={loading:!1,data:ke.data,error:gS(ke),variables:x};y.__.setResult(ee),I.current||B(),ee.error?(Ce=(pe=w.current).onError)===null||Ce===void 0||Ce.call(pe,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 pe,Ce;ke=ke instanceof mn?ke:new mn({protocolErrors:[ke]}),Q||(y.__.setResult({loading:!1,data:void 0,error:ke,variables:x}),I.current||B(),(Ce=(pe=w.current).onError)===null||Ce===void 0||Ce.call(pe,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=X.useCallback(function(){oe(!w.current.skip,57),b(_.current())},[w,_]);return X.useMemo(function(){return D(D({},P),{restart:M})},[P,M])}function SL(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 tt(function(d){u||(u=t.subscribe(a));var h=u.subscribe(d);return function(){return h.unsubscribe()}}),{__:l})}function OL(t){return fc(X.useCallback(function(e){return t.onNextChange(function n(){e(),t.onNextChange(n)})},[t]),t,t)}function kL(t){return go("useFragment",NL,Qn(t.client))(t)}function NL(t){var e=Qn(t.client).cache,n=t.from,r=Nn(t,["from"]),i=X.useMemo(function(){return typeof n=="string"?n:e.identify(n)},[e,n]),s=$g(function(){return D(D({},r),{from:i})},[r,i]),o=X.useMemo(function(){var l=s.fragment,u=s.fragmentName,d=s.from,h=s.optimistic,p=h===void 0?!0:h;return{result:AL(e.diff(D(D({},s),{returnPartialData:!0,id:d,query:e.getFragmentDoc(l,u),optimistic:p})))}},[s,e]),a=X.useCallback(function(){return o.result},[o]);return fc(X.useCallback(function(l){var u=0,d=e.watchFragment(s).subscribe({next:function(h){Ue(h,o.result)||(o.result=h,clearTimeout(u),u=setTimeout(l))}});return function(){d.unsubscribe(),clearTimeout(u)}},[e,s,o]),a,a)}function AL(t){var e={data:t.result,complete:!!t.complete};return t.missing&&(e.missing=ga(t.missing.map(function(n){return n.missing}))),e}var qg=Symbol(),zg=Symbol();function ui(t){var e,n=(e={toPromise:function(){return Gg(n).then(function(){return n})}},e[qg]=t,e[zg]=t.promise,e);return n}function Qg(t){oe(!t||qg in t,61)}function Gg(t){var e=yo(t);return e.promise.status==="fulfilled"?e.promise:t[zg]}function yo(t){return t[qg]}function dc(t,e){t[zg]=e}var IL=["canonizeResults","context","errorPolicy","fetchPolicy","refetchWritePolicy","returnPartialData"],bS=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 IL.some(function(r){return r in e&&!Ue(n.watchQueryOptions[r],e[r])})},t.prototype.applyOptions=function(e){var n=this.watchQueryOptions,r=n.fetchPolicy,i=n.canonizeResults;return r==="standby"&&r!==e.fetchPolicy?this.initiateFetch(this.observable.reobserve(e)):(this.observable.silentSetOptions(e),i!==e.canonizeResults&&(this.result=D(D({},this.result),this.observable.getCurrentResult()),this.promise=vf(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=vf(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=nT(e),this.deliver(this.promise)}},t.prototype.deliver=function(e){this.listeners.forEach(function(n){return n(e)})},t.prototype.initiateFetch=function(e){var n=this;return this.promise=this.createPendingPromise(),this.promise.catch(function(){}),e.then(function(){setTimeout(function(){var r;n.promise.status==="pending"&&(n.result=n.observable.getCurrentResult(),(r=n.resolve)===null||r===void 0||r.call(n,n.result))})}).catch(function(r){var i;return(i=n.reject)===null||i===void 0?void 0:i.call(n,r)}),e},t.prototype.subscribeToQuery=function(){var e=this;this.subscription=this.observable.filter(function(n){return!Ue(n.data,{})&&!Ue(n,e.result)}).subscribe(this.handleNext,this.handleError)},t.prototype.setResult=function(){var e=this.observable.getCurrentResult(!1);Ue(e,this.result)||(this.result=e,this.promise=e.data&&(!e.partial||this.watchQueryOptions.returnPartialData)?vf(e):this.createPendingPromise())},t.prototype.createPendingPromise=function(){var e=this;return Jm(new Promise(function(n,r){e.resolve=n,e.reject=r}))},t}(),xL=function(){function t(e){e===void 0&&(e=Object.create(null)),this.queryRefs=new so(ds),this.options=e}return t.prototype.getQueryRef=function(e,n){var r=this.queryRefs.lookupArray(e);return r.current||(r.current=new bS(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}(),Hg=Symbol.for("apollo.suspenseCache");function Kg(t){var e;return t[Hg]||(t[Hg]=new xL((e=t.defaultOptions.react)===null||e===void 0?void 0:e.suspense)),t[Hg]}var _S=Symbol.for("apollo.skipToken");function CL(t,e){return e===void 0&&(e=Object.create(null)),go("useSuspenseQuery",DL,Qn(typeof e=="object"?e.client:void 0))(t,e)}function DL(t,e){var n=Qn(e.client),r=Kg(n),i=Yg({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=St([t,Sr(o)],[].concat(l),!0),d=r.getQueryRef(u,function(){return n.watchQuery(i)}),h=X.useState([d.key,d.promise]),p=h[0],g=h[1];p[0]!==d.key&&(p[0]=d.key,p[1]=d.promise);var y=p[1];d.didChangeOptions(i)&&(p[1]=y=d.applyOptions(i)),X.useEffect(function(){var I=d.retain(),P=d.listen(function(M){g([d.key,M])});return function(){P(),I()}},[d]);var b=X.useMemo(function(){var I=Jg(d.result);return{loading:!1,data:d.result.data,networkStatus:I?Ge.error:Ge.ready,error:I}},[d.result]),_=s==="standby"?b:fS(y),w=X.useCallback(function(I){var P=d.fetchMore(I);return g([d.key,d.promise]),P},[d]),O=X.useCallback(function(I){var P=d.refetch(I);return g([d.key,d.promise]),P},[d]),N=d.observable.subscribeToMore;return X.useMemo(function(){return{client:n,data:_.data,error:Jg(_),networkStatus:_.networkStatus,fetchMore:w,refetch:O,subscribeToMore:N}},[n,w,O,_,N])}function RL(t){var e=t.query,n=t.fetchPolicy,r=t.returnPartialData;Lf(e,or.Query),ML(n),PL(n,r)}function ML(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 PL(t,e){t==="no-cache"&&e&&globalThis.__DEV__!==!1&&oe.warn(59)}function Jg(t){return zn(t.errors)?new mn({graphQLErrors:t.errors}):t.error}function Yg(t){var e=t.client,n=t.query,r=t.options;return $g(function(){var i;if(r===_S)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&&RL(o),r.skip&&(o.fetchPolicy="standby"),o},[e,r,n])}function FL(t,e){return e===void 0&&(e=Object.create(null)),go("useBackgroundQuery",LL,Qn(typeof e=="object"?e.client:void 0))(t,e)}function LL(t,e){var n=Qn(e.client),r=Kg(n),i=Yg({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=X.useRef(s!=="standby");u.current||(u.current=s!=="standby");var d=St([t,Sr(o)],[].concat(l),!0),h=r.getQueryRef(d,function(){return n.watchQuery(i)}),p=X.useState(ui(h)),g=p[0],y=p[1];if(yo(g)!==h&&y(ui(h)),h.didChangeOptions(i)){var b=h.applyOptions(i);dc(g,b)}X.useEffect(function(){var O=setTimeout(function(){h.disposed&&r.add(d,h)});return function(){return clearTimeout(O)}});var _=X.useCallback(function(O){var N=h.fetchMore(O);return y(ui(h)),N},[h]),w=X.useCallback(function(O){var N=h.refetch(O);return y(ui(h)),N},[h]);return X.useEffect(function(){return h.softRetain()},[h]),[u.current?g:void 0,{fetchMore:_,refetch:w,subscribeToMore:h.observable.subscribeToMore}]}function $L(t,e){e===void 0&&(e=Object.create(null));var n=Qn(e.client),r=Kg(n),i=Yg({client:n,query:t,options:e}),s=e.queryKey,o=s===void 0?[]:s,a=X.useState(null),l=a[0],u=a[1];Qg(l);var d=l&&yo(l);if(l&&(d!=null&&d.didChangeOptions(i))){var h=d.applyOptions(i);dc(l,h)}var p=aL(),g=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.fetchMore(O);return u(ui(d)),N},[d]),y=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.refetch(O);return u(ui(d)),N},[d]),b=X.useCallback(function(){for(var O=[],N=0;N<arguments.length;N++)O[N]=arguments[N];oe(!p(),51);var I=O[0],P=St([t,Sr(I)],[].concat(o),!0),M=r.getQueryRef(P,function(){return n.watchQuery(D(D({},i),{variables:I}))});u(ui(M))},[t,o,r,i,p,n]),_=X.useCallback(function(O){return oe(d,52),d.observable.subscribeToMore(O)},[d]),w=X.useCallback(function(){u(null)},[]);return[b,l,{fetchMore:g,refetch:y,reset:w,subscribeToMore:_}]}function VL(t){var e=yo(t);return go("useQueryRefHandlers",jL,e?e.observable:Qn())(t)}function jL(t){Qg(t);var e=X.useState(t),n=e[0],r=e[1],i=X.useState(t),s=i[0],o=i[1],a=yo(t);n!==t?(r(t),o(t)):dc(t,Gg(s));var l=X.useCallback(function(d){var h=a.refetch(d);return o(ui(a)),h},[a]),u=X.useCallback(function(d){var h=a.fetchMore(d);return o(ui(a)),h},[a]);return{refetch:l,fetchMore:u,subscribeToMore:a.observable.subscribeToMore}}function BL(t){var e=yo(t);return go("useReadQuery",UL,e?e.observable:Qn())(t)}function UL(t){Qg(t);var e=X.useMemo(function(){return yo(t)},[t]),n=X.useCallback(function(){return Gg(t)},[t]);e.disposed&&(e.reinitialize(),dc(t,e.promise)),X.useEffect(function(){return e.retain()},[e]);var r=fc(X.useCallback(function(s){return e.listen(function(o){dc(t,o),s()})},[e,t]),n,n),i=fS(r);return X.useMemo(function(){return{data:i.data,networkStatus:i.networkStatus,error:Jg(i)}},[i])}function WL(t){return go("createQueryPreloader",qL,t)(t)}var qL=function(t){return function(n,r){var i,s;r===void 0&&(r=Object.create(null));var o=new bS(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 ui(o)}};const zL=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:Af,ApolloClient:Mf,ApolloConsumer:rL,ApolloError:mn,ApolloLink:Cn,ApolloProvider:cS,get Cache(){return If},DocumentTransform:Kl,get DocumentType(){return or},HttpLink:kf,InMemoryCache:Sg,MissingFieldError:xf,get NetworkStatus(){return Ge},Observable:tt,ObservableQuery:cc,checkFetcher:ag,concat:hT,createHttpLink:ug,createQueryPreloader:WL,createSignalIfSupported:vT,defaultDataIdFromObject:Cf,defaultPrinter:Sf,disableExperimentalFragmentVariables:Rg,disableFragmentWarnings:Cg,empty:dT,enableExperimentalFragmentVariables:Dg,execute:nc,fallbackHttpConfig:og,from:ng,fromError:ec,fromPromise:uT,getApolloContext:Sa,get gql(){return po},isApolloError:Tf,isNetworkRequestSettled:XT,isReference:nt,makeReference:Ii,makeVar:yg,mergeOptions:ci,operationName:Fg,parseAndCheckHttpResponse:sg,parser:Lg,resetApolloContext:nL,resetCaches:xg,rewriteURIForGET:cg,selectHttpOptionsAndBody:yT,selectHttpOptionsAndBodyInternal:Of,selectURI:lg,serializeFetchParameter:rc,setLogVerbosity:pp,skipToken:_S,split:rg,throwServerError:Ef,toPromise:cT,useApolloClient:Qn,useBackgroundQuery:FL,useFragment:kL,useLazyQuery:Wg,useLoadableQuery:$L,useMutation:wL,useQuery:jf,useQueryRefHandlers:VL,useReactiveVar:OL,useReadQuery:BL,useSubscription:TL,useSuspenseQuery:CL},Symbol.toStringTag,{value:"Module"}));let Oa=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 ES=2e3,ka=console;class QL{constructor(e,n,r,i=ES,s=!0){this._callback=e,this._client_id=n,this._url=r,this._interval=i||ES,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"?(ka.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):e.data==="changed"?(ka.debug(e),ka.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):ka.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))}start(e){ka.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&&(ka.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"},Or=(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 hc=(t=>(t.AutomaticBeforeTokenExpiration="AutomaticBeforeTokensExpiration",t.AutomaticOnlyWhenFetchExecuted="AutomaticOnlyWhenFetchExecuted",t))(hc||{});const GL=t=>decodeURIComponent(Array.prototype.map.call(atob(t),e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")),HL=t=>JSON.parse(GL(t.replaceAll(/-/g,"+").replaceAll(/_/g,"/"))),wS=t=>{try{return t&&KL(t,".")===2?HL(t.split(".")[1]):null}catch(e){console.warn(e)}return null},KL=(t,e)=>t.split(e).length-1,Xg={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 JL(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 Zg=(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=wS(t.accessToken);let s;e!=null&&"idToken"in e&&!("idToken"in t)?s=e.idToken:s=t.idToken;const o=t.idTokenPayload?t.idTokenPayload:wS(s),a=o&&o.exp?o.exp:Number.MAX_VALUE,l=r&&r.exp?r.exp:t.issuedAt+i;t.issuedAt=JL(t,r,o);let u;t.expiresAt?u=t.expiresAt:n===Xg.access_token_invalid?u=l:n===Xg.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},ey=(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),Zg(r,e,n)},pc=(t,e)=>{const n=new Date().getTime()/1e3,r=e-n;return Math.round(r-t)},TS=(t,e=0)=>t?pc(e,t.expiresAt)>0:!1,SS=async(t,e=200,n=50)=>{let r=n;if(!t.getTokens())return null;for(;!TS(t.getTokens(),t.configuration.refresh_time_before_tokens_expiration_in_second)&&r>0;){if(t.configuration.token_automatic_renew_mode==hc.AutomaticOnlyWhenFetchExecuted){await t.renewTokensAsync({});break}else await Wf({milliseconds:e});r=r-1}return{isTokensValid:TS(t.getTokens()),tokens:t.getTokens(),numberWaited:r-n}},OS=(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:""}},Na=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)}}(),kS="7.22.32";let NS=null,Uf;const Wf=({milliseconds:t})=>new Promise(e=>Na.setTimeout(e,t)),AS=(t="/")=>{try{Uf=new AbortController,fetch(`${t}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`,{signal:Uf.signal}).catch(e=>{console.log(e)}),Wf({milliseconds:150*1e3}).then(AS)}catch(e){console.log(e)}},IS=()=>{Uf&&Uf.abort()},YL=(t="/")=>fetch(`${t}OidcKeepAliveServiceWorker.json`,{headers:{"oidc-vanilla":"true"}}).then(e=>e.statusText==="oidc-service-worker").catch(e=>{console.log(e)}),XL=t=>async(e,n)=>{n(),await e.update();const r=await e.unregister();console.log(`Service worker unregistration ${r?"successful":"failed"}`),await Wf({milliseconds:2e3}),t.reload()},ZL=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},Dn=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:ZL(e.configurationName)},[i.port2])}),kr=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,IS))));try{await navigator.serviceWorker.ready,navigator.serviceWorker.controller||await Dn(i)({type:"claim"})}catch{return null}const s=async g=>Dn(i)({type:"clear",data:{status:g},configurationName:e}),o=async(g,y,b)=>{var _;const w=await Dn(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!==kS&&(console.warn(`Service worker ${O} version mismatch with js client version ${kS}, unregistering and reloading`),await((_=b.service_worker_update_require_callback)==null?void 0:_.call(b,i,IS))),{tokens:ey(w.tokens,null,b.token_renew_mode),status:w.status}},a=(g="/")=>{NS==null&&(NS="not_null",AS(g))},l=g=>Dn(i)({type:"setSessionState",data:{sessionState:g},configurationName:e}),u=async()=>(await Dn(i)({type:"getSessionState",data:null,configurationName:e})).sessionState,d=g=>(sessionStorage[`oidc.nonce.${e}`]=g.nonce,Dn(i)({type:"setNonce",data:{nonce:g},configurationName:e})),h=async()=>{let g=(await Dn(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:()=>YL(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 Dn(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,Dn(i)({type:"setState",data:{state:g},configurationName:e})),getCodeVerifierAsync:async()=>{let g=(await Dn(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,Dn(i)({type:"setCodeVerifier",data:{codeVerifier:g},configurationName:e})),setDemonstratingProofOfPossessionNonce:async g=>{await Dn(i)({type:"setDemonstratingProofOfPossessionNonce",data:{demonstratingProofOfPossessionNonce:g},configurationName:e})},getDemonstratingProofOfPossessionNonce:async()=>(await Dn(i)({type:"getDemonstratingProofOfPossessionNonce",data:null,configurationName:e})).demonstratingProofOfPossessionNonce,setDemonstratingProofOfPossessionJwkAsync:async g=>{const y=JSON.stringify(g);await Dn(i)({type:"setDemonstratingProofOfPossessionJwk",data:{demonstratingProofOfPossessionJwkJson:y},configurationName:e})},getDemonstratingProofOfPossessionJwkAsync:async()=>{const g=await Dn(i)({type:"getDemonstratingProofOfPossessionJwk",data:null,configurationName:e});return g.demonstratingProofOfPossessionJwkJson?JSON.parse(g.demonstratingProofOfPossessionJwkJson):null}}},Aa={},e$=(t,e=window.sessionStorage,n)=>{if(!Aa[t]&&e){const i=e.getItem(t);i&&(Aa[t]=JSON.parse(i))}const r=1e3*n;return Aa[t]&&Aa[t].timestamp+r>Date.now()?Aa[t].result:null},t$=(t,e,n=window.sessionStorage)=>{const r=Date.now();Aa[t]={result:e,timestamp:r},n&&n.setItem(t,JSON.stringify({result:e,timestamp:r}))};function xS(t){return new TextEncoder().encode(t)}function CS(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function n$(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,n){return String.fromCharCode(parseInt(n,16))})}const ty=t=>{let e="";return t.forEach(function(n){e+=String.fromCharCode(n)}),CS(e)};function DS(t){return CS(n$(t))}const r$={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"},i$=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:DS(JSON.stringify(n)),payload:DS(JSON.stringify(r))},a=i.importKeyAlgorithm,l=!0,u=["sign"],d=await t.crypto.subtle.importKey("jwk",e,a,l,u),h=xS(`${o.protected}.${o.payload}`),p=i.signAlgorithm,g=await t.crypto.subtle.sign(p,d,h);return o.signature=ty(new Uint8Array(g)),`${o.protected}.${o.payload}.${o.signature}`},s$={sign:i$},o$=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)},a$=t=>{const e=Object.assign({},t);return delete e.d,e.key_ops=["verify"],e},l$={generate:o$,neuter:a$},c$=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,xS(r));return ty(new Uint8Array(i))},u$={thumbprint:c$},f$=t=>async e=>await l$.generate(t)(e),RS=t=>e=>async(n,r="POST",i,s={})=>{const o={jti:btoa(d$()),htm:r,htu:i,iat:Math.round(Date.now()/1e3),...s},a=await u$.thumbprint(t)(n,e.digestAlgorithm);return await s$.sign(t)(n,{kid:a},o,e)},d$=()=>{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},MS=()=>{const t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return{hasCrypto:t,hasSubtleCrypto:e}},ny="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",h$=t=>{const e=[];for(let n=0;n<t.byteLength;n+=1){const r=t[n]%ny.length;e.push(ny[r])}return e.join("")},ry=t=>{const e=new Uint8Array(t),{hasCrypto:n}=MS();if(n)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.random()*ny.length|0;return h$(e)};function p$(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 PS(t){return new Promise((e,n)=>{crypto.subtle.digest("SHA-256",p$(t)).then(r=>e(ty(new Uint8Array(r))),r=>n(r))})}const m$=t=>{if(t.length<43||t.length>128)return Promise.reject(new Error("Invalid code length."));const{hasSubtleCrypto:e}=MS();return e?PS(t):Promise.reject(new Error("window.crypto.subtle is unavailable."))},g$=60*60,y$=t=>async(e,n=g$,r=window.sessionStorage,i=1e4)=>{const s=`${e}/.well-known/openid-configuration`,o=`oidc.server:${e}`,a=e$(o,r,n);if(a)return new ay(a);const l=await mc(t)(s,{},i);if(l.status!==200)return null;const u=await l.json();return t$(o,u,r),new ay(u)},mc=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 mc(t)(e,n,r,i+1);throw o}else throw console.error(o.message),o}return s},iy={refresh_token:"refresh_token",access_token:"access_token"},FS=t=>async(e,n,r=iy.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 mc(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:u},o)).status!==200?{success:!1}:{success:!0}},v$=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 mc(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(qf)&&(p=d.headers.get(qf)),{success:!0,status:d.status,data:ey(h,i,o),demonstratingProofOfPossessionNonce:p}},b$=(t,e)=>async(n,r)=>{r=r?{...r}:{};const i=ry(128),s=await m$(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}`)},qf="DPoP-Nonce",_$=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 mc(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(qf)&&(u=l.headers.get(qf));const d=await l.json();return{success:!0,data:{state:n.state,tokens:ey(d,null,i),demonstratingProofOfPossessionNonce:u}}};async function LS(t,e,n){const r=o=>{t.tokens=o},{tokens:i,status:s}=await zf(t)(r,0,e,n);return await kr(t.configuration,t.configurationName)||await Or(t.configurationName,t.configuration.storage).setTokens(t.tokens),t.tokens?i:(await t.destroyAsync(s),null)}async function $S(t,e=!1,n=null){const r=t.configuration,i=`${r.client_id}_${t.configurationName}_${r.authority}`;let s;const o=await kr(t.configuration,t.configurationName);if((r==null?void 0:r.storage)===(window==null?void 0:window.sessionStorage)&&!o||!navigator.locks)s=await LS(t,e,n);else{let a="retry";for(;a==="retry";)a=await navigator.locks.request(i,{ifAvailable:!0},async l=>l?await LS(t,e,n):(t.publishEvent(Ri.eventNames.syncTokensAsync_lock_not_available,{lock:"lock not available"}),"retry"));s=a}return s?(t.timeoutId&&(t.timeoutId=gc(t,t.tokens.expiresAt,n)),t.tokens):null}const gc=(t,e,n=null)=>{const r=t.configuration.refresh_time_before_tokens_expiration_in_second;return t.timeoutId&&Na.clearTimeout(t.timeoutId),Na.setTimeout(async()=>{const i={timeLeft:pc(r,e)};t.publishEvent(Ri.eventNames.token_timer,i),await $S(t,!1,n)},1e3)},vs={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"},E$=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 kr(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=pc(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=Or(n,e.storage??sessionStorage),h=await d.initAsync();let{tokens:p}=h;const{status:g}=h;if(p&&(p=Zg(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=pc(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=pc(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 Wf({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)=>sy(t.configurationName,t.configuration,t.publishEvent.bind(t))(d,h,p),u=async()=>{try{let d;const h=await kr(a,t.configurationName);h?d=h.getLoginParams():d=Or(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(Ri.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 E$(t)(a,t.configurationName,t.tokens,r);switch(d){case vs.SESSION_LOST:return e(null),t.publishEvent(We.refreshTokensAsync_error,{message:"refresh token session lost"}),{tokens:null,status:"SESSION_LOST"};case vs.NOT_CONNECTED:return e(null),{tokens:null,status:null};case vs.TOKENS_VALID:return e(h),{tokens:h,status:"LOGGED_IN"};case vs.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:return e(h),t.publishEvent(Ri.eventNames.token_renewed,{reason:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID"}),{tokens:h,status:"LOGGED_IN"};case vs.LOGOUT_FROM_ANOTHER_TAB:return e(null),t.publishEvent(We.logout_from_another_tab,{status:"session syncTokensAsync"}),{tokens:null,status:"LOGGED_OUT"};case vs.REQUIRE_SYNC_TOKENS:return a.token_automatic_renew_mode==hc.AutomaticOnlyWhenFetchExecuted&&vs.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==hc.AutomaticOnlyWhenFetchExecuted&&vs.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 v$(t.getFetch())(I,w,_,h,P,a.token_renew_mode,N);if(M.success){const{isValid:B,reason:Q}=OS(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 kr(a,t.configurationName);x?await x.setDemonstratingProofOfPossessionNonce(M.demonstratingProofOfPossessionNonce):await Or(t.configurationName,a.storage).setDemonstratingProofOfPossessionNonce(M.demonstratingProofOfPossessionNonce)}return t.publishEvent(We.refreshTokensAsync_end,{success:M.success}),t.publishEvent(Ri.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)})}},sy=(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}},w$=(t,e,n,r,i)=>(s=null,o=void 0)=>{s={...s};const a=(l,u,d)=>sy(e,n,r.bind(i))(l,u,d);return(async()=>{i.timeoutId&&Na.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=gc(i,i.tokens.expiresAt,s),{}}catch(u){return u}})()},T$=(t,e,n)=>(r,i,s,o=!1)=>{const a=(l,u=void 0,d=void 0)=>sy(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 QL(d,i,r),t.checkSessionIFrame.load().then(()=>{t.checkSessionIFrame.start(s),l(t.checkSessionIFrame)}).catch(h=>{u(h)})}else l(null)})},S$=t=>!!(t.os==="iOS"&&t.osVersion.startsWith("12")||t.os==="Mac OS X"&&t.osVersion.startsWith("10_15_6")),O$=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 k$(){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 N$=()=>{const{name:t,version:e}=k$();if(t==="chrome"&&parseInt(e)<=70||t==="opera"&&(!e||parseInt(e.split(".")[0])<80)||t==="ie")return!1;const n=O$(navigator);return!S$(n)},A$=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 kr(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=gc(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=Or(t.configurationName,n.storage??sessionStorage),{tokens:s}=await i.initAsync();if(s){t.tokens=Zg(s,null,n.token_renew_mode);const o=i.getLoginParams();t.timeoutId=gc(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}},VS=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}},yc=t=>{const e=VS(t);let{path:n}=e;n.endsWith("/")&&(n=n.slice(0,-1));let{hash:r}=e;return r==="#_=_"&&(r=""),r&&(n+=r),n},vc=t=>{const e=VS(t),{search:n}=e;return I$(n)},I$=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},x$=(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=ry(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=ry(12));const g={nonce:p.nonce},y=await kr(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=Or(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 b$(_,i)(b.authorizationEndpoint,w)}catch(h){throw n(We.loginAsync_error,h),h}})()},C$=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=vc(l).session_state,d=await kr(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=Or(t.configurationName,n.storage??sessionStorage);await U.setSessionStateAsync(u),p=await U.getNonceAsync(),g=U.getLoginParams(),y=await U.getStateAsync(),h=U}const b=vc(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 f$(window)(n.demonstrating_proof_of_possession_configuration.generateKeyAlgorithm);await Or(t.configurationName,n.storage).setDemonstratingProofOfPossessionJwkAsync(U),N.DPoP=await RS(window)(n.demonstrating_proof_of_possession_configuration)(U,"POST",O)}const I=await _$(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}=OS(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=Or(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}},jS={access_token:"access_token",refresh_token:"refresh_token"},oy=(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},D$=t=>{const e={};if(t){for(const[n,r]of Object.entries(t))n.includes(":")||(e[n]=r);return e}return e},R$=t=>async e=>{Na.clearTimeout(t.timeoutId),t.timeoutId=null,t.checkSessionIFrame&&t.checkSessionIFrame.stop();const n=await kr(t.configuration,t.configurationName);n?await n.clearAsync(e):await Or(t.configurationName,t.configuration.storage).clearAsync(e),t.tokens=null,t.userInfo=null},M$=(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(jS.access_token)){const M=oy(o,":revoke_access_token"),B=FS(n)(O,I,iy.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(jS.refresh_token)){const M=oy(o,":revoke_refresh_token"),B=FS(n)(O,P,iy.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 _=oy(o,":oidc");if(_&&_.no_reload==="true")return;const w=D$(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()},BS=(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 SS(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)},P$=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 BS(fetch,t,n)(i);return o.status!==200?null:o.json()})();return t.userInfo=s,s},US=()=>fetch;let ay=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 vo={},F$=(t,e=new Oa)=>(n,r="default")=>(vo[r]||(vo[r]=new Ri(n,r,t,e)),vo[r]),L$=async t=>{const{parsedTokens:e,callbackPath:n}=await t.loginCallbackAsync();return t.timeoutId=gc(t,e.expiresAt),{callbackPath:n}},$$=t=>Math.floor(Math.random()*t),ly=class RC{constructor(e,n="default",r,i=new Oa){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 Oa;const a=e.service_worker_update_require_callback??XL(this.location);this.configuration={...e,silent_login_uri:s,token_automatic_renew_mode:e.token_automatic_renew_mode??hc.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??Xg.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??N$,demonstrating_proof_of_possession_configuration:e.demonstrating_proof_of_possession_configuration??r$,preload_user_info:e.preload_user_info??!1},this.getFetch=r??US,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=$$(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(vo,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 vo[e]}_silentLoginCallbackFromIFrame(){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const e=this.location,n=vc(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=vc(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 ay({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 kr(this.configuration,this.configurationName)?window.localStorage:null;return await y$(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=A$(this),this.tryKeepExistingSessionPromise.finally(()=>{this.tryKeepExistingSessionPromise=null}))}async startCheckSessionAsync(e,n,r,i=!1){await T$(this,vo,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?w$(window,this.configurationName,this.configuration,this.publishEvent.bind(this),this)(n,i):(this.loginPromise=x$(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 C$(this)(e),i=r.tokens;return this.tokens=i,await kr(this.configuration,this.configurationName)||Or(this.configurationName,this.configuration.storage).setTokens(i),this.publishEvent(RC.eventNames.token_acquired,i),this.configuration.preload_user_info&&await this.userInfoAsync(),{parsedTokens:i,state:r.state,callbackPath:r.callbackPath}};return this.loginCallbackPromise=n(),this.loginCallbackPromise.finally(()=>{this.loginCallbackPromise=null})}async generateDemonstrationOfProofOfPossessionAsync(e,n,r,i={}){const s=this.configuration,o={ath:await PS(e),...i};if(await kr(s,this.configurationName))return`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${this.configurationName}`;const a=Or(this.configurationName,s.storage),l=await a.getDemonstratingProofOfPossessionJwkAsync(),u=a.getDemonstratingProofOfPossessionNonce();return u&&(o.nonce=u),await RS(window)(s.demonstrating_proof_of_possession_configuration)(l,r,n,o)}loginCallbackWithAutoTokensRenewAsync(){return this.loginCallbackWithAutoTokensRenewPromise!==null?this.loginCallbackWithAutoTokensRenewPromise:(this.loginCallbackWithAutoTokensRenewPromise=L$(this),this.loginCallbackWithAutoTokensRenewPromise.finally(()=>{this.loginCallbackWithAutoTokensRenewPromise=null}))}userInfoAsync(e=!1,n=!1){return this.userInfoPromise!==null?this.userInfoPromise:(this.userInfoPromise=P$(this)(e,n),this.userInfoPromise.finally(()=>{this.userInfoPromise=null}))}async renewTokensAsync(e=null){if(this.renewTokensPromise!==null)return this.renewTokensPromise;if(this.timeoutId)return Na.clearTimeout(this.timeoutId),this.renewTokensPromise=$S(this,!0,e),this.renewTokensPromise.finally(()=>{this.renewTokensPromise=null})}async destroyAsync(e){return await R$(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=M$(this,vo,this.getFetch(),console,this.location)(e,n),this.logoutPromise.finally(()=>{this.logoutPromise=null}))}};ly.getOrCreate=(t,e)=>(n,r="default")=>F$(t,e)(n,r),ly.eventNames=We;let Ri=ly;const Qf=class MC{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 MC(Ri.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 SS(i,e,n)}fetchWithTokens(e,n=!1){return BS(e,this._oidc,n)}async userInfoAsync(e=!1,n=!1){return this._oidc.userInfoAsync(e,n)}userInfo(){return this._oidc.userInfo}};Qf.getOrCreate=(t,e=new Oa)=>(n,r="default")=>new Qf(Ri.getOrCreate(t,e)(n,r)),Qf.eventNames=Ri.eventNames;let lt=Qf;const WS=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Error authentication"}),he.jsx("p",{className:"oidc-authenticating__content",children:"An error occurred during authentication."})]})}),V$=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Authentication in progress"}),he.jsx("p",{className:"oidc-authenticating__content",children:"You will be redirected to the login page."})]})}),j$=()=>Math.random().toString(36).slice(2,8),B$=(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},U$=(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"))}}),W$=()=>U$(window,B$(window,document),j$),qS=()=>he.jsx("div",{className:"oidc-callback",children:he.jsxs("div",{className:"oidc-callback__container",children:[he.jsx("h1",{className:"oidc-callback__title",children:"Authentication complete"}),he.jsx("p",{className:"oidc-callback__content",children:"You will be redirected to your application."})]})}),q$=({callBackError:t,callBackSuccess:e,configurationName:n,withCustomHistory:r})=>{const[i,s]=ae.useState(!1);ae.useEffect(()=>{let l=!0;return(async()=>{const u=lt.get;try{const{callbackPath:d}=await u(n).loginCallbackAsync();(r?r():W$()).replaceState(d||"/")}catch(d){l&&(console.warn(d),s(!0))}})(),()=>{l=!1}},[]);const o=t||WS,a=e||qS;return i?he.jsx(o,{configurationName:n}):he.jsx(a,{configurationName:n})},z$=()=>he.jsx("span",{className:"oidc-loading",children:"Loading"}),Q$=()=>he.jsx("div",{className:"oidc-serviceworker",children:he.jsxs("div",{className:"oidc-serviceworker__container",children:[he.jsx("h1",{className:"oidc-serviceworker__title",children:"Unable to authenticate on this browser"}),he.jsx("p",{className:"oidc-serviceworker__content",children:"Your browser is not secure enough to make authentication work. Try updating your browser or use a newer browser."})]})}),G$=()=>he.jsx("div",{className:"oidc-session-lost",children:he.jsxs("div",{className:"oidc-session-lost__container",children:[he.jsx("h1",{className:"oidc-session-lost__title",children:"Session timed out"}),he.jsx("p",{className:"oidc-session-lost__content",children:"Your session has expired. Please re-authenticate."})]})}),H$=({configurationName:t})=>(ae.useEffect(()=>{(async()=>{lt.get(t).silentLoginCallbackAsync()})().catch(e=>{console.error("Error during silent login callback:",e)})},[t]),null),K$=({configurationName:t})=>{const e=vc(window.location.href),n=lt.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 ae.useEffect(()=>{r.tokens||r.loginAsync(null,i,!0,e.scope)},[]),he.jsx(he.Fragment,{})},J$=({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?yc(window.location.href):"",[u,d]=ae.useState(l);ae.useEffect(()=>{const p=()=>d(yc(window.location.href));return p(),window.addEventListener("popstate",p,!1),()=>window.removeEventListener("popstate",p,!1)},[]);const h=yc(n);if(r&&u===yc(r))return he.jsx(H$,{configurationName:o});if(i&&u===yc(i))return he.jsx(K$,{configurationName:o});switch(u){case h:return he.jsx(q$,{callBackError:t,callBackSuccess:e,configurationName:o,withCustomHistory:a});default:return he.jsx(he.Fragment,{children:s})}},Y$=ae.memo(J$),zS={name:"",data:null},X$=({loadingComponent:t,children:e,configurationName:n})=>{const[r,i]=ae.useState(!0),s=lt.get,o=s(n);return ae.useEffect(()=>{let a=!0;return o&&o.tryKeepExistingSessionAsync().then(()=>{a&&i(!1)}),()=>{a=!1}},[n]),he.jsx(he.Fragment,{children:r?he.jsx(t,{configurationName:n}):he.jsx(he.Fragment,{children:e})})},bc=({isLoading:t,loadingComponent:e,children:n,configurationName:r})=>{const i=e;return t?he.jsx(i,{configurationName:r,children:n}):he.jsx(he.Fragment,{children:n})},Z$=({children:t,configuration:e,configurationName:n="default",callbackSuccessComponent:r=qS,authenticatingComponent:i=V$,loadingComponent:s=z$,serviceWorkerNotSupportedComponent:o=Q$,authenticatingErrorComponent:a=WS,sessionLostComponent:l=G$,onSessionLost:u=null,onLogoutFromAnotherTab:d=null,onLogoutFromSameTab:h=null,withCustomHistory:p=null,onEvent:g=null,getFetch:y=null,location:b=null})=>{const _=(Ce="default")=>lt.getOrCreate(y??US,b??new Oa)(e,Ce),[w,O]=ae.useState(!0),[N,I]=ae.useState(zS),[P,M]=ae.useState("default");ae.useEffect(()=>{const Ce=_(n).subscribeEvents((ee,Ae)=>{g&&g(n,ee,Ae)});return()=>{_(n).removeEventSubscription(Ce)}},[n,g]),ae.useEffect(()=>{const Ce=_(n).subscribeEvents((ee,Ae)=>{if(ee===lt.eventNames.refreshTokensAsync_error||ee===lt.eventNames.syncTokensAsync_error){if(u!=null){u();return}I({name:ee,data:Ae})}else if(ee===lt.eventNames.logout_from_another_tab){if(d!=null){d();return}I({name:ee,data:Ae})}else ee===lt.eventNames.logout_from_same_tab?h!=null&&h():ee===lt.eventNames.loginAsync_begin||ee===lt.eventNames.loginCallbackAsync_end||ee===lt.eventNames.loginAsync_error||ee===lt.eventNames.loginCallbackAsync_error?I({name:ee,data:Ae}):ee===lt.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(zS)}},[e,n]);const B=l,Q=i,x=s,U=o,Te=a,ke=w||P!==n,pe=_(n);switch(N.name){case lt.eventNames.service_worker_not_supported_by_browser:return he.jsx(bc,{loadingComponent:x,isLoading:ke,configurationName:n,children:he.jsx(U,{configurationName:n})});case lt.eventNames.loginAsync_begin:return he.jsx(bc,{loadingComponent:x,isLoading:ke,configurationName:n,children:he.jsx(Q,{configurationName:n})});case lt.eventNames.loginAsync_error:case lt.eventNames.loginCallbackAsync_error:return he.jsx(bc,{loadingComponent:x,isLoading:ke,configurationName:n,children:he.jsx(Te,{configurationName:n})});case lt.eventNames.refreshTokensAsync_error:case lt.eventNames.syncTokensAsync_error:case lt.eventNames.logout_from_another_tab:return he.jsx(bc,{loadingComponent:x,isLoading:ke,configurationName:n,children:he.jsx(B,{configurationName:n})});default:return he.jsx(bc,{loadingComponent:x,isLoading:ke,configurationName:n,children:he.jsx(Y$,{redirect_uri:pe.configuration.redirect_uri,silent_redirect_uri:pe.configuration.silent_redirect_uri,silent_login_uri:pe.configuration.silent_login_uri,callbackSuccessComponent:r,callbackErrorComponent:a,authenticatingComponent:i,configurationName:n,withCustomHistory:p,location:b??new Oa,children:he.jsx(X$,{loadingComponent:x,configurationName:n,children:t})})})}},eV="default",QS={accessToken:null,accessTokenPayload:null},tV=t=>{const e=lt.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 QS};function nV(t,e){return t.configuration.demonstrating_proof_of_possession?(n,r,i={})=>t.generateDemonstrationOfProofOfPossessionAsync(e.accessToken,n,r,i):null}const rV=(t=eV)=>{const e=lt.get,[n,r]=ae.useState(tV(t));return ae.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===lt.eventNames.token_renewed||a===lt.eventNames.token_acquired||a===lt.eventNames.logout_from_another_tab||a===lt.eventNames.logout_from_same_tab||a===lt.eventNames.refreshTokensAsync_error||a===lt.eventNames.syncTokensAsync_error)&&i){const u=s.tokens;r(u!=null?{accessToken:u.accessToken,accessTokenPayload:u.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:nV(s,u)}:QS)}});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),n};function iV(t){return new Cn(function(e,n){var r=Nn(e,[]);return new tt(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 GS(t){return new Cn(function(e,n){return new tt(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){vr(e,t);function e(n){var r=t.call(this)||this;return r.link=GS(n),r}return e.prototype.request=function(n,r){return this.link.request(n,r)},e})(Cn);function sV(t){return _t(t)&&"code"in t&&"reason"in t}function oV(t){var e;return _t(t)&&((e=t.target)===null||e===void 0?void 0:e.readyState)===WebSocket.CLOSED}var aV=function(t){vr(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 tt(function(i){return r.client.subscribe(D(D({},n),{query:ma(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=sV(s);return o||oV(s)?i.error(new Error("Socket closed".concat(o?" with event ".concat(s.code):"").concat(o?" ".concat(s.reason):""))):i.error(new mn({graphQLErrors:Array.isArray(s)?s:[s]}))}})})},e}(Cn),cy={},HS={},uy={};const Ia=ea(zL);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ReactiveVarsCache=t.makeCachedVar=t.initReactiveVarsCache=t.cachedReactiveVarTypename=void 0;const e=Ia;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})(uy);var Gf={};const _c=ea(tL);function lV(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 KS=lV;function cV(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 uV=cV;function fV(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 dV=fV,hV=dV,pV=hV(),mV=pV;function gV(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var yV=gV,vV=typeof Re=="object"&&Re&&Re.Object===Object&&Re,JS=vV,bV=JS,_V=typeof self=="object"&&self&&self.Object===Object&&self,EV=bV||_V||Function("return this")(),fi=EV,wV=fi,TV=wV.Symbol,xa=TV,YS=xa,XS=Object.prototype,SV=XS.hasOwnProperty,OV=XS.toString,Ec=YS?YS.toStringTag:void 0;function kV(t){var e=SV.call(t,Ec),n=t[Ec];try{t[Ec]=void 0;var r=!0}catch{}var i=OV.call(t);return r&&(e?t[Ec]=n:delete t[Ec]),i}var NV=kV,AV=Object.prototype,IV=AV.toString;function xV(t){return IV.call(t)}var CV=xV,ZS=xa,DV=NV,RV=CV,MV="[object Null]",PV="[object Undefined]",eO=ZS?ZS.toStringTag:void 0;function FV(t){return t==null?t===void 0?PV:MV:eO&&eO in Object(t)?DV(t):RV(t)}var bo=FV;function LV(t){return t!=null&&typeof t=="object"}var Mi=LV,$V=bo,VV=Mi,jV="[object Arguments]";function BV(t){return VV(t)&&$V(t)==jV}var UV=BV,tO=UV,WV=Mi,nO=Object.prototype,qV=nO.hasOwnProperty,zV=nO.propertyIsEnumerable,QV=tO(function(){return arguments}())?tO:function(t){return WV(t)&&qV.call(t,"callee")&&!zV.call(t,"callee")},fy=QV,GV=Array.isArray,Rn=GV,Hf={exports:{}};function HV(){return!1}var KV=HV;Hf.exports,function(t,e){var n=fi,r=KV,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}(Hf,Hf.exports);var dy=Hf.exports,JV=9007199254740991,YV=/^(?:0|[1-9]\d*)$/;function XV(t,e){var n=typeof t;return e=e??JV,!!e&&(n=="number"||n!="symbol"&&YV.test(t))&&t>-1&&t%1==0&&t<e}var Kf=XV,ZV=9007199254740991;function ej(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ZV}var hy=ej,tj=bo,nj=hy,rj=Mi,ij="[object Arguments]",sj="[object Array]",oj="[object Boolean]",aj="[object Date]",lj="[object Error]",cj="[object Function]",uj="[object Map]",fj="[object Number]",dj="[object Object]",hj="[object RegExp]",pj="[object Set]",mj="[object String]",gj="[object WeakMap]",yj="[object ArrayBuffer]",vj="[object DataView]",bj="[object Float32Array]",_j="[object Float64Array]",Ej="[object Int8Array]",wj="[object Int16Array]",Tj="[object Int32Array]",Sj="[object Uint8Array]",Oj="[object Uint8ClampedArray]",kj="[object Uint16Array]",Nj="[object Uint32Array]",Et={};Et[bj]=Et[_j]=Et[Ej]=Et[wj]=Et[Tj]=Et[Sj]=Et[Oj]=Et[kj]=Et[Nj]=!0,Et[ij]=Et[sj]=Et[yj]=Et[oj]=Et[vj]=Et[aj]=Et[lj]=Et[cj]=Et[uj]=Et[fj]=Et[dj]=Et[hj]=Et[pj]=Et[mj]=Et[gj]=!1;function Aj(t){return rj(t)&&nj(t.length)&&!!Et[tj(t)]}var Ij=Aj;function xj(t){return function(e){return t(e)}}var Jf=xj,Yf={exports:{}};Yf.exports,function(t,e){var n=JS,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}(Yf,Yf.exports);var py=Yf.exports,Cj=Ij,Dj=Jf,rO=py,iO=rO&&rO.isTypedArray,Rj=iO?Dj(iO):Cj,sO=Rj,Mj=yV,Pj=fy,Fj=Rn,Lj=dy,$j=Kf,Vj=sO,jj=Object.prototype,Bj=jj.hasOwnProperty;function Uj(t,e){var n=Fj(t),r=!n&&Pj(t),i=!n&&!r&&Lj(t),s=!n&&!r&&!i&&Vj(t),o=n||r||i||s,a=o?Mj(t.length,String):[],l=a.length;for(var u in t)(e||Bj.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||$j(u,l)))&&a.push(u);return a}var oO=Uj,Wj=Object.prototype;function qj(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Wj;return t===n}var my=qj;function zj(t,e){return function(n){return t(e(n))}}var aO=zj,Qj=aO,Gj=Qj(Object.keys,Object),Hj=Gj,Kj=my,Jj=Hj,Yj=Object.prototype,Xj=Yj.hasOwnProperty;function Zj(t){if(!Kj(t))return Jj(t);var e=[];for(var n in Object(t))Xj.call(t,n)&&n!="constructor"&&e.push(n);return e}var eB=Zj;function tB(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Pi=tB,nB=bo,rB=Pi,iB="[object AsyncFunction]",sB="[object Function]",oB="[object GeneratorFunction]",aB="[object Proxy]";function lB(t){if(!rB(t))return!1;var e=nB(t);return e==sB||e==oB||e==iB||e==aB}var Xf=lB,cB=Xf,uB=hy;function fB(t){return t!=null&&uB(t.length)&&!cB(t)}var wc=fB,dB=oO,hB=eB,pB=wc;function mB(t){return pB(t)?dB(t):hB(t)}var Tc=mB,gB=mV,yB=Tc;function vB(t,e){return t&&gB(t,e,yB)}var bB=vB,_B=wc;function EB(t,e){return function(n,r){if(n==null)return n;if(!_B(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 wB=EB,TB=bB,SB=wB,OB=SB(TB),gy=OB,kB=gy;function NB(t,e){var n=!0;return kB(t,function(r,i,s){return n=!!e(r,i,s),n}),n}var AB=NB;function IB(){this.__data__=[],this.size=0}var xB=IB;function CB(t,e){return t===e||t!==t&&e!==e}var Zf=CB,DB=Zf;function RB(t,e){for(var n=t.length;n--;)if(DB(t[n][0],e))return n;return-1}var ed=RB,MB=ed,PB=Array.prototype,FB=PB.splice;function LB(t){var e=this.__data__,n=MB(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():FB.call(e,n,1),--this.size,!0}var $B=LB,VB=ed;function jB(t){var e=this.__data__,n=VB(e,t);return n<0?void 0:e[n][1]}var BB=jB,UB=ed;function WB(t){return UB(this.__data__,t)>-1}var qB=WB,zB=ed;function QB(t,e){var n=this.__data__,r=zB(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var GB=QB,HB=xB,KB=$B,JB=BB,YB=qB,XB=GB;function Ca(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])}}Ca.prototype.clear=HB,Ca.prototype.delete=KB,Ca.prototype.get=JB,Ca.prototype.has=YB,Ca.prototype.set=XB;var td=Ca,ZB=td;function e2(){this.__data__=new ZB,this.size=0}var t2=e2;function n2(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var r2=n2;function i2(t){return this.__data__.get(t)}var s2=i2;function o2(t){return this.__data__.has(t)}var a2=o2,l2=fi,c2=l2["__core-js_shared__"],u2=c2,yy=u2,lO=function(){var t=/[^.]+$/.exec(yy&&yy.keys&&yy.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function f2(t){return!!lO&&lO in t}var d2=f2,h2=Function.prototype,p2=h2.toString;function m2(t){if(t!=null){try{return p2.call(t)}catch{}try{return t+""}catch{}}return""}var cO=m2,g2=Xf,y2=d2,v2=Pi,b2=cO,_2=/[\\^$.*+?()[\]{}|]/g,E2=/^\[object .+?Constructor\]$/,w2=Function.prototype,T2=Object.prototype,S2=w2.toString,O2=T2.hasOwnProperty,k2=RegExp("^"+S2.call(O2).replace(_2,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function N2(t){if(!v2(t)||y2(t))return!1;var e=g2(t)?k2:E2;return e.test(b2(t))}var A2=N2;function I2(t,e){return t==null?void 0:t[e]}var x2=I2,C2=A2,D2=x2;function R2(t,e){var n=D2(t,e);return C2(n)?n:void 0}var _o=R2,M2=_o,P2=fi,F2=M2(P2,"Map"),vy=F2,L2=_o,$2=L2(Object,"create"),nd=$2,uO=nd;function V2(){this.__data__=uO?uO(null):{},this.size=0}var j2=V2;function B2(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var U2=B2,W2=nd,q2="__lodash_hash_undefined__",z2=Object.prototype,Q2=z2.hasOwnProperty;function G2(t){var e=this.__data__;if(W2){var n=e[t];return n===q2?void 0:n}return Q2.call(e,t)?e[t]:void 0}var H2=G2,K2=nd,J2=Object.prototype,Y2=J2.hasOwnProperty;function X2(t){var e=this.__data__;return K2?e[t]!==void 0:Y2.call(e,t)}var Z2=X2,eU=nd,tU="__lodash_hash_undefined__";function nU(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=eU&&e===void 0?tU:e,this}var rU=nU,iU=j2,sU=U2,oU=H2,aU=Z2,lU=rU;function Da(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])}}Da.prototype.clear=iU,Da.prototype.delete=sU,Da.prototype.get=oU,Da.prototype.has=aU,Da.prototype.set=lU;var cU=Da,fO=cU,uU=td,fU=vy;function dU(){this.size=0,this.__data__={hash:new fO,map:new(fU||uU),string:new fO}}var hU=dU;function pU(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var mU=pU,gU=mU;function yU(t,e){var n=t.__data__;return gU(e)?n[typeof e=="string"?"string":"hash"]:n.map}var rd=yU,vU=rd;function bU(t){var e=vU(this,t).delete(t);return this.size-=e?1:0,e}var _U=bU,EU=rd;function wU(t){return EU(this,t).get(t)}var TU=wU,SU=rd;function OU(t){return SU(this,t).has(t)}var kU=OU,NU=rd;function AU(t,e){var n=NU(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var IU=AU,xU=hU,CU=_U,DU=TU,RU=kU,MU=IU;function Ra(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])}}Ra.prototype.clear=xU,Ra.prototype.delete=CU,Ra.prototype.get=DU,Ra.prototype.has=RU,Ra.prototype.set=MU;var by=Ra,PU=td,FU=vy,LU=by,$U=200;function VU(t,e){var n=this.__data__;if(n instanceof PU){var r=n.__data__;if(!FU||r.length<$U-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new LU(r)}return n.set(t,e),this.size=n.size,this}var jU=VU,BU=td,UU=t2,WU=r2,qU=s2,zU=a2,QU=jU;function Ma(t){var e=this.__data__=new BU(t);this.size=e.size}Ma.prototype.clear=UU,Ma.prototype.delete=WU,Ma.prototype.get=qU,Ma.prototype.has=zU,Ma.prototype.set=QU;var _y=Ma,GU="__lodash_hash_undefined__";function HU(t){return this.__data__.set(t,GU),this}var KU=HU;function JU(t){return this.__data__.has(t)}var YU=JU,XU=by,ZU=KU,eW=YU;function id(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new XU;++e<n;)this.add(t[e])}id.prototype.add=id.prototype.push=ZU,id.prototype.has=eW;var tW=id;function nW(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 rW=nW;function iW(t,e){return t.has(e)}var sW=iW,oW=tW,aW=rW,lW=sW,cW=1,uW=2;function fW(t,e,n,r,i,s){var o=n&cW,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&uW?new oW: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(!aW(e,function(w,O){if(!lW(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 dO=fW,dW=fi,hW=dW.Uint8Array,hO=hW;function pW(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var mW=pW;function gW(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var yW=gW,pO=xa,mO=hO,vW=Zf,bW=dO,_W=mW,EW=yW,wW=1,TW=2,SW="[object Boolean]",OW="[object Date]",kW="[object Error]",NW="[object Map]",AW="[object Number]",IW="[object RegExp]",xW="[object Set]",CW="[object String]",DW="[object Symbol]",RW="[object ArrayBuffer]",MW="[object DataView]",gO=pO?pO.prototype:void 0,Ey=gO?gO.valueOf:void 0;function PW(t,e,n,r,i,s,o){switch(n){case MW:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case RW:return!(t.byteLength!=e.byteLength||!s(new mO(t),new mO(e)));case SW:case OW:case AW:return vW(+t,+e);case kW:return t.name==e.name&&t.message==e.message;case IW:case CW:return t==e+"";case NW:var a=_W;case xW:var l=r&wW;if(a||(a=EW),t.size!=e.size&&!l)return!1;var u=o.get(t);if(u)return u==e;r|=TW,o.set(t,e);var d=bW(a(t),a(e),r,i,s,o);return o.delete(t),d;case DW:if(Ey)return Ey.call(t)==Ey.call(e)}return!1}var FW=PW;function LW(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var wy=LW,$W=wy,VW=Rn;function jW(t,e,n){var r=e(t);return VW(t)?r:$W(r,n(t))}var yO=jW;function BW(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 vO=BW;function UW(){return[]}var bO=UW,WW=vO,qW=bO,zW=Object.prototype,QW=zW.propertyIsEnumerable,_O=Object.getOwnPropertySymbols,GW=_O?function(t){return t==null?[]:(t=Object(t),WW(_O(t),function(e){return QW.call(t,e)}))}:qW,Ty=GW,HW=yO,KW=Ty,JW=Tc;function YW(t){return HW(t,JW,KW)}var EO=YW,wO=EO,XW=1,ZW=Object.prototype,eq=ZW.hasOwnProperty;function tq(t,e,n,r,i,s){var o=n&XW,a=wO(t),l=a.length,u=wO(e),d=u.length;if(l!=d&&!o)return!1;for(var h=l;h--;){var p=a[h];if(!(o?p in e:eq.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 nq=tq,rq=_o,iq=fi,sq=rq(iq,"DataView"),oq=sq,aq=_o,lq=fi,cq=aq(lq,"Promise"),uq=cq,fq=_o,dq=fi,hq=fq(dq,"Set"),pq=hq,mq=_o,gq=fi,yq=mq(gq,"WeakMap"),vq=yq,Sy=oq,Oy=vy,ky=uq,Ny=pq,Ay=vq,TO=bo,Pa=cO,SO="[object Map]",bq="[object Object]",OO="[object Promise]",kO="[object Set]",NO="[object WeakMap]",AO="[object DataView]",_q=Pa(Sy),Eq=Pa(Oy),wq=Pa(ky),Tq=Pa(Ny),Sq=Pa(Ay),Eo=TO;(Sy&&Eo(new Sy(new ArrayBuffer(1)))!=AO||Oy&&Eo(new Oy)!=SO||ky&&Eo(ky.resolve())!=OO||Ny&&Eo(new Ny)!=kO||Ay&&Eo(new Ay)!=NO)&&(Eo=function(t){var e=TO(t),n=e==bq?t.constructor:void 0,r=n?Pa(n):"";if(r)switch(r){case _q:return AO;case Eq:return SO;case wq:return OO;case Tq:return kO;case Sq:return NO}return e});var sd=Eo,Iy=_y,Oq=dO,kq=FW,Nq=nq,IO=sd,xO=Rn,CO=dy,Aq=sO,Iq=1,DO="[object Arguments]",RO="[object Array]",od="[object Object]",xq=Object.prototype,MO=xq.hasOwnProperty;function Cq(t,e,n,r,i,s){var o=xO(t),a=xO(e),l=o?RO:IO(t),u=a?RO:IO(e);l=l==DO?od:l,u=u==DO?od:u;var d=l==od,h=u==od,p=l==u;if(p&&CO(t)){if(!CO(e))return!1;o=!0,d=!1}if(p&&!d)return s||(s=new Iy),o||Aq(t)?Oq(t,e,n,r,i,s):kq(t,e,l,n,r,i,s);if(!(n&Iq)){var g=d&&MO.call(t,"__wrapped__"),y=h&&MO.call(e,"__wrapped__");if(g||y){var b=g?t.value():t,_=y?e.value():e;return s||(s=new Iy),i(b,_,n,r,s)}}return p?(s||(s=new Iy),Nq(t,e,n,r,i,s)):!1}var Dq=Cq,Rq=Dq,PO=Mi;function FO(t,e,n,r,i){return t===e?!0:t==null||e==null||!PO(t)&&!PO(e)?t!==t&&e!==e:Rq(t,e,n,r,FO,i)}var LO=FO,Mq=_y,Pq=LO,Fq=1,Lq=2;function $q(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 Mq;if(r)var p=r(u,d,l,t,e,h);if(!(p===void 0?Pq(d,u,Fq|Lq,r,h):p))return!1}}return!0}var Vq=$q,jq=Pi;function Bq(t){return t===t&&!jq(t)}var $O=Bq,Uq=$O,Wq=Tc;function qq(t){for(var e=Wq(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Uq(i)]}return e}var zq=qq;function Qq(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}var VO=Qq,Gq=Vq,Hq=zq,Kq=VO;function Jq(t){var e=Hq(t);return e.length==1&&e[0][2]?Kq(e[0][0],e[0][1]):function(n){return n===t||Gq(n,t,e)}}var Yq=Jq,Xq=bo,Zq=Mi,ez="[object Symbol]";function tz(t){return typeof t=="symbol"||Zq(t)&&Xq(t)==ez}var Sc=tz,nz=Rn,rz=Sc,iz=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sz=/^\w*$/;function oz(t,e){if(nz(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||rz(t)?!0:sz.test(t)||!iz.test(t)||e!=null&&t in Object(e)}var xy=oz,jO=by,az="Expected a function";function Cy(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(az);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(Cy.Cache||jO),n}Cy.Cache=jO;var lz=Cy,cz=lz,uz=500;function fz(t){var e=cz(t,function(r){return n.size===uz&&n.clear(),r}),n=e.cache;return e}var dz=fz,hz=dz,pz=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mz=/\\(\\)?/g,gz=hz(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(pz,function(n,r,i,s){e.push(i?s.replace(mz,"$1"):r||n)}),e}),yz=gz;function vz(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 BO=vz,UO=xa,bz=BO,_z=Rn,Ez=Sc,wz=1/0,WO=UO?UO.prototype:void 0,qO=WO?WO.toString:void 0;function zO(t){if(typeof t=="string")return t;if(_z(t))return bz(t,zO)+"";if(Ez(t))return qO?qO.call(t):"";var e=t+"";return e=="0"&&1/t==-wz?"-0":e}var Tz=zO,Sz=Tz;function Oz(t){return t==null?"":Sz(t)}var kz=Oz,Nz=Rn,Az=xy,Iz=yz,xz=kz;function Cz(t,e){return Nz(t)?t:Az(t,e)?[t]:Iz(xz(t))}var ad=Cz,Dz=Sc,Rz=1/0;function Mz(t){if(typeof t=="string"||Dz(t))return t;var e=t+"";return e=="0"&&1/t==-Rz?"-0":e}var Oc=Mz,Pz=ad,Fz=Oc;function Lz(t,e){e=Pz(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Fz(e[n++])];return n&&n==r?t:void 0}var ld=Lz,$z=ld;function Vz(t,e,n){var r=t==null?void 0:$z(t,e);return r===void 0?n:r}var jz=Vz;function Bz(t,e){return t!=null&&e in Object(t)}var Uz=Bz,Wz=ad,qz=fy,zz=Rn,Qz=Kf,Gz=hy,Hz=Oc;function Kz(t,e,n){e=Wz(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Hz(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&&Gz(i)&&Qz(o,i)&&(zz(t)||qz(t)))}var Jz=Kz,Yz=Uz,Xz=Jz;function Zz(t,e){return t!=null&&Xz(t,e,Yz)}var QO=Zz,e3=LO,t3=jz,n3=QO,r3=xy,i3=$O,s3=VO,o3=Oc,a3=1,l3=2;function c3(t,e){return r3(t)&&i3(e)?s3(o3(t),e):function(n){var r=t3(n,t);return r===void 0&&r===e?n3(n,t):e3(e,r,a3|l3)}}var u3=c3;function f3(t){return t}var Dy=f3;function d3(t){return function(e){return e==null?void 0:e[t]}}var h3=d3,p3=ld;function m3(t){return function(e){return p3(e,t)}}var g3=m3,y3=h3,v3=g3,b3=xy,_3=Oc;function E3(t){return b3(t)?y3(_3(t)):v3(t)}var w3=E3,T3=Yq,S3=u3,O3=Dy,k3=Rn,N3=w3;function A3(t){return typeof t=="function"?t:t==null?O3:typeof t=="object"?k3(t)?S3(t[0],t[1]):T3(t):N3(t)}var Ry=A3,I3=Zf,x3=wc,C3=Kf,D3=Pi;function R3(t,e,n){if(!D3(n))return!1;var r=typeof e;return(r=="number"?x3(n)&&C3(e,n.length):r=="string"&&e in n)?I3(n[e],t):!1}var M3=R3,P3=uV,F3=AB,L3=Ry,$3=Rn,V3=M3;function j3(t,e,n){var r=$3(t)?P3:F3;return n&&V3(t,e,n)&&(e=void 0),r(t,L3(e))}var B3=j3,U3=_o,W3=function(){try{var t=U3(Object,"defineProperty");return t({},"",{}),t}catch{}}(),GO=W3,HO=GO;function q3(t,e,n){e=="__proto__"&&HO?HO(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var KO=q3,z3=KO,Q3=Zf,G3=Object.prototype,H3=G3.hasOwnProperty;function K3(t,e,n){var r=t[e];(!(H3.call(t,e)&&Q3(r,n))||n===void 0&&!(e in t))&&z3(t,e,n)}var My=K3,J3=My,Y3=ad,X3=Kf,JO=Pi,Z3=Oc;function eQ(t,e,n,r){if(!JO(t))return t;e=Y3(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var l=Z3(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=JO(d)?d:X3(e[i+1])?[]:{})}J3(a,l,u),a=a[l]}return t}var YO=eQ,tQ=ld,nQ=YO,rQ=ad;function iQ(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=tQ(t,o);n(a,o)&&nQ(s,rQ(o,t),a)}return s}var sQ=iQ,oQ=sQ,aQ=QO;function lQ(t,e){return oQ(t,e,function(n,r){return aQ(t,r)})}var cQ=lQ,XO=xa,uQ=fy,fQ=Rn,ZO=XO?XO.isConcatSpreadable:void 0;function dQ(t){return fQ(t)||uQ(t)||!!(ZO&&t&&t[ZO])}var hQ=dQ,pQ=wy,mQ=hQ;function ek(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=mQ),i||(i=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?ek(a,e-1,n,r,i):pQ(i,a):r||(i[i.length]=a)}return i}var gQ=ek,yQ=gQ;function vQ(t){var e=t==null?0:t.length;return e?yQ(t,1):[]}var bQ=vQ;function _Q(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 EQ=_Q,wQ=EQ,tk=Math.max;function TQ(t,e,n){return e=tk(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=tk(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),wQ(t,this,a)}}var SQ=TQ;function OQ(t){return function(){return t}}var kQ=OQ,NQ=kQ,nk=GO,AQ=Dy,IQ=nk?function(t,e){return nk(t,"toString",{configurable:!0,enumerable:!1,value:NQ(e),writable:!0})}:AQ,xQ=IQ,CQ=800,DQ=16,RQ=Date.now;function MQ(t){var e=0,n=0;return function(){var r=RQ(),i=DQ-(r-n);if(n=r,i>0){if(++e>=CQ)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var PQ=MQ,FQ=xQ,LQ=PQ,$Q=LQ(FQ),VQ=$Q,jQ=bQ,BQ=SQ,UQ=VQ;function WQ(t){return UQ(BQ(t,void 0,jQ),t+"")}var qQ=WQ,zQ=cQ,QQ=qQ,GQ=QQ(function(t,e){return t==null?{}:zQ(t,e)}),HQ=GQ;function KQ(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 JQ=KQ,YQ=/\s/;function XQ(t){for(var e=t.length;e--&&YQ.test(t.charAt(e)););return e}var ZQ=XQ,eG=ZQ,tG=/^\s+/;function nG(t){return t&&t.slice(0,eG(t)+1).replace(tG,"")}var rG=nG,iG=rG,rk=Pi,sG=Sc,ik=NaN,oG=/^[-+]0x[0-9a-f]+$/i,aG=/^0b[01]+$/i,lG=/^0o[0-7]+$/i,cG=parseInt;function uG(t){if(typeof t=="number")return t;if(sG(t))return ik;if(rk(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=rk(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=iG(t);var n=aG.test(t);return n||lG.test(t)?cG(t.slice(2),n?2:8):oG.test(t)?ik:+t}var fG=uG,dG=fG,sk=1/0,hG=17976931348623157e292;function pG(t){if(!t)return t===0?t:0;if(t=dG(t),t===sk||t===-sk){var e=t<0?-1:1;return e*hG}return t===t?t:0}var mG=pG,gG=mG;function yG(t){var e=gG(t),n=e%1;return e===e?n?e-n:e:0}var vG=yG,bG=JQ,_G=vG;function EG(t,e,n){return t&&t.length?(e=n||e===void 0?1:_G(e),bG(t,0,e<0?0:e)):[]}var wG=EG;function TG(t){return t==null}var SG=TG,OG=gy,kG=wc;function NG(t,e){var n=-1,r=kG(t)?Array(t.length):[];return OG(t,function(i,s,o){r[++n]=e(i,s,o)}),r}var AG=NG;function IG(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}var xG=IG,ok=Sc;function CG(t,e){if(t!==e){var n=t!==void 0,r=t===null,i=t===t,s=ok(t),o=e!==void 0,a=e===null,l=e===e,u=ok(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 DG=CG,RG=DG;function MG(t,e,n){for(var r=-1,i=t.criteria,s=e.criteria,o=i.length,a=n.length;++r<o;){var l=RG(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 PG=MG,Py=BO,FG=ld,LG=Ry,$G=AG,VG=xG,jG=Jf,BG=PG,UG=Dy,WG=Rn;function qG(t,e,n){e.length?e=Py(e,function(s){return WG(s)?function(o){return FG(o,s.length===1?s[0]:s)}:s}):e=[UG];var r=-1;e=Py(e,jG(LG));var i=$G(t,function(s,o,a){var l=Py(e,function(u){return u(s)});return{criteria:l,index:++r,value:s}});return VG(i,function(s,o){return BG(s,o,n)})}var zG=qG,QG=zG,ak=Rn;function GG(t,e,n,r){return t==null?[]:(ak(e)||(e=e==null?[]:[e]),n=r?void 0:n,ak(n)||(n=n==null?[]:[n]),QG(t,e,n))}var HG=GG,cd={},KG=bo,JG=Mi,YG="[object Number]";function XG(t){return typeof t=="number"||JG(t)&&KG(t)==YG}var ZG=XG,Nr={};Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.RenewalPolicy=Nr.InvalidationPolicyLifecycleEvent=Nr.InvalidationPolicyEvent=void 0;var lk;(function(t){t.Write="Write",t.Evict="Evict",t.Read="Read"})(lk||(Nr.InvalidationPolicyEvent=lk={}));var ck;(function(t){t.Write="onWrite",t.Evict="onEvict"})(ck||(Nr.InvalidationPolicyLifecycleEvent=ck={}));var uk;(function(t){t.AccessOnly="access-only",t.AccessAndWrite="access-and-write",t.WriteOnly="write-only",t.None="none"})(uk||(Nr.RenewalPolicy=uk={}));var bs={};function eH(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var tH=eH,nH=My,rH=KO;function iH(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?rH(n,a,l):nH(n,a,l)}return n}var ud=iH,sH=ud,oH=Tc;function aH(t,e){return t&&sH(e,oH(e),t)}var lH=aH;function cH(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var uH=cH,fH=Pi,dH=my,hH=uH,pH=Object.prototype,mH=pH.hasOwnProperty;function gH(t){if(!fH(t))return hH(t);var e=dH(t),n=[];for(var r in t)r=="constructor"&&(e||!mH.call(t,r))||n.push(r);return n}var yH=gH,vH=oO,bH=yH,_H=wc;function EH(t){return _H(t)?vH(t,!0):bH(t)}var Fy=EH,wH=ud,TH=Fy;function SH(t,e){return t&&wH(e,TH(e),t)}var OH=SH,fd={exports:{}};fd.exports,function(t,e){var n=fi,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}(fd,fd.exports);var kH=fd.exports;function NH(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var AH=NH,IH=ud,xH=Ty;function CH(t,e){return IH(t,xH(t),e)}var DH=CH,RH=aO,MH=RH(Object.getPrototypeOf,Object),Ly=MH,PH=wy,FH=Ly,LH=Ty,$H=bO,VH=Object.getOwnPropertySymbols,jH=VH?function(t){for(var e=[];t;)PH(e,LH(t)),t=FH(t);return e}:$H,fk=jH,BH=ud,UH=fk;function WH(t,e){return BH(t,UH(t),e)}var qH=WH,zH=yO,QH=fk,GH=Fy;function HH(t){return zH(t,GH,QH)}var KH=HH,JH=Object.prototype,YH=JH.hasOwnProperty;function XH(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&YH.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var ZH=XH,dk=hO;function e4(t){var e=new t.constructor(t.byteLength);return new dk(e).set(new dk(t)),e}var $y=e4,t4=$y;function n4(t,e){var n=e?t4(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var r4=n4,i4=/\w*$/;function s4(t){var e=new t.constructor(t.source,i4.exec(t));return e.lastIndex=t.lastIndex,e}var o4=s4,hk=xa,pk=hk?hk.prototype:void 0,mk=pk?pk.valueOf:void 0;function a4(t){return mk?Object(mk.call(t)):{}}var l4=a4,c4=$y;function u4(t,e){var n=e?c4(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var f4=u4,d4=$y,h4=r4,p4=o4,m4=l4,g4=f4,y4="[object Boolean]",v4="[object Date]",b4="[object Map]",_4="[object Number]",E4="[object RegExp]",w4="[object Set]",T4="[object String]",S4="[object Symbol]",O4="[object ArrayBuffer]",k4="[object DataView]",N4="[object Float32Array]",A4="[object Float64Array]",I4="[object Int8Array]",x4="[object Int16Array]",C4="[object Int32Array]",D4="[object Uint8Array]",R4="[object Uint8ClampedArray]",M4="[object Uint16Array]",P4="[object Uint32Array]";function F4(t,e,n){var r=t.constructor;switch(e){case O4:return d4(t);case y4:case v4:return new r(+t);case k4:return h4(t,n);case N4:case A4:case I4:case x4:case C4:case D4:case R4:case M4:case P4:return g4(t,n);case b4:return new r;case _4:case T4:return new r(t);case E4:return p4(t);case w4:return new r;case S4:return m4(t)}}var L4=F4,$4=Pi,gk=Object.create,V4=function(){function t(){}return function(e){if(!$4(e))return{};if(gk)return gk(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),j4=V4,B4=j4,U4=Ly,W4=my;function q4(t){return typeof t.constructor=="function"&&!W4(t)?B4(U4(t)):{}}var z4=q4,Q4=sd,G4=Mi,H4="[object Map]";function K4(t){return G4(t)&&Q4(t)==H4}var J4=K4,Y4=J4,X4=Jf,yk=py,vk=yk&&yk.isMap,Z4=vk?X4(vk):Y4,e6=Z4,t6=sd,n6=Mi,r6="[object Set]";function i6(t){return n6(t)&&t6(t)==r6}var s6=i6,o6=s6,a6=Jf,bk=py,_k=bk&&bk.isSet,l6=_k?a6(_k):o6,c6=l6,u6=_y,f6=tH,d6=My,h6=lH,p6=OH,m6=kH,g6=AH,y6=DH,v6=qH,b6=EO,_6=KH,E6=sd,w6=ZH,T6=L4,S6=z4,O6=Rn,k6=dy,N6=e6,A6=Pi,I6=c6,x6=Tc,C6=Fy,D6=1,R6=2,M6=4,Ek="[object Arguments]",P6="[object Array]",F6="[object Boolean]",L6="[object Date]",$6="[object Error]",wk="[object Function]",V6="[object GeneratorFunction]",j6="[object Map]",B6="[object Number]",Tk="[object Object]",U6="[object RegExp]",W6="[object Set]",q6="[object String]",z6="[object Symbol]",Q6="[object WeakMap]",G6="[object ArrayBuffer]",H6="[object DataView]",K6="[object Float32Array]",J6="[object Float64Array]",Y6="[object Int8Array]",X6="[object Int16Array]",Z6="[object Int32Array]",eK="[object Uint8Array]",tK="[object Uint8ClampedArray]",nK="[object Uint16Array]",rK="[object Uint32Array]",yt={};yt[Ek]=yt[P6]=yt[G6]=yt[H6]=yt[F6]=yt[L6]=yt[K6]=yt[J6]=yt[Y6]=yt[X6]=yt[Z6]=yt[j6]=yt[B6]=yt[Tk]=yt[U6]=yt[W6]=yt[q6]=yt[z6]=yt[eK]=yt[tK]=yt[nK]=yt[rK]=!0,yt[$6]=yt[wk]=yt[Q6]=!1;function dd(t,e,n,r,i,s){var o,a=e&D6,l=e&R6,u=e&M6;if(n&&(o=i?n(t,r,i,s):n(t)),o!==void 0)return o;if(!A6(t))return t;var d=O6(t);if(d){if(o=w6(t),!a)return g6(t,o)}else{var h=E6(t),p=h==wk||h==V6;if(k6(t))return m6(t,a);if(h==Tk||h==Ek||p&&!i){if(o=l||p?{}:S6(t),!a)return l?v6(t,p6(o,t)):y6(t,h6(o,t))}else{if(!yt[h])return i?t:{};o=T6(t,h,a)}}s||(s=new u6);var g=s.get(t);if(g)return g;s.set(t,o),I6(t)?t.forEach(function(_){o.add(dd(_,e,n,_,t,s))}):N6(t)&&t.forEach(function(_,w){o.set(w,dd(_,e,n,w,t,s))});var y=u?l?_6:b6:l?C6:x6,b=d?void 0:y(t);return f6(b||t,function(_,w){b&&(w=_,_=t[w]),d6(o,w,dd(_,e,n,w,t,s))}),o}var iK=dd,sK=iK,oK=1,aK=4;function lK(t){return sK(t,oK|aK)}var cK=lK,uK=bo,fK=Ly,dK=Mi,hK="[object Object]",pK=Function.prototype,mK=Object.prototype,Sk=pK.toString,gK=mK.hasOwnProperty,yK=Sk.call(Object);function vK(t){if(!dK(t)||uK(t)!=hK)return!1;var e=fK(t);if(e===null)return!0;var n=gK.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Sk.call(n)==yK}var Ok=vK,kk=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),bK=new Uint8Array(16);function Nk(){if(!kk)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return kk(bK)}for(var Ak=[],hd=0;hd<256;++hd)Ak[hd]=(hd+256).toString(16).substr(1);function Vy(t,e){var n=0,r=Ak;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 Ik,jy,By=0,Uy=0;function _K(t,e,n){var r=e&&n||0,i=e||[];t=t||{};var s=t.node||Ik,o=t.clockseq!==void 0?t.clockseq:jy;if(s==null||o==null){var a=t.random||(t.rng||Nk)();s==null&&(s=Ik=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=jy=(a[6]<<8|a[7])&16383)}var l=t.msecs!==void 0?t.msecs:new Date().getTime(),u=t.nsecs!==void 0?t.nsecs:Uy+1,d=l-By+(u-Uy)/1e4;if(d<0&&t.clockseq===void 0&&(o=o+1&16383),(d<0||l>By)&&t.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");By=l,Uy=u,jy=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||Vy(i)}function EK(t){var e=[];return t.replace(/[a-fA-F0-9]{2}/g,function(n){e.push(parseInt(n,16))}),e}function wK(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 TK="6ba7b810-9dad-11d1-80b4-00c04fd430c8",SK="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function xk(t,e,n){var r=function(s,o,a,l){var u=a&&l||0;if(typeof s=="string"&&(s=wK(s)),typeof o=="string"&&(o=EK(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||Vy(d)};try{r.name=t}catch{}return r.DNS=TK,r.URL=SK,r}function OK(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 kK(NK(AK(t),t.length*8))}function kK(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 NK(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=gn(a,l,u,d,t[n],7,-680876936),d=gn(d,a,l,u,t[n+1],12,-389564586),u=gn(u,d,a,l,t[n+2],17,606105819),l=gn(l,u,d,a,t[n+3],22,-1044525330),a=gn(a,l,u,d,t[n+4],7,-176418897),d=gn(d,a,l,u,t[n+5],12,1200080426),u=gn(u,d,a,l,t[n+6],17,-1473231341),l=gn(l,u,d,a,t[n+7],22,-45705983),a=gn(a,l,u,d,t[n+8],7,1770035416),d=gn(d,a,l,u,t[n+9],12,-1958414417),u=gn(u,d,a,l,t[n+10],17,-42063),l=gn(l,u,d,a,t[n+11],22,-1990404162),a=gn(a,l,u,d,t[n+12],7,1804603682),d=gn(d,a,l,u,t[n+13],12,-40341101),u=gn(u,d,a,l,t[n+14],17,-1502002290),l=gn(l,u,d,a,t[n+15],22,1236535329),a=yn(a,l,u,d,t[n+1],5,-165796510),d=yn(d,a,l,u,t[n+6],9,-1069501632),u=yn(u,d,a,l,t[n+11],14,643717713),l=yn(l,u,d,a,t[n],20,-373897302),a=yn(a,l,u,d,t[n+5],5,-701558691),d=yn(d,a,l,u,t[n+10],9,38016083),u=yn(u,d,a,l,t[n+15],14,-660478335),l=yn(l,u,d,a,t[n+4],20,-405537848),a=yn(a,l,u,d,t[n+9],5,568446438),d=yn(d,a,l,u,t[n+14],9,-1019803690),u=yn(u,d,a,l,t[n+3],14,-187363961),l=yn(l,u,d,a,t[n+8],20,1163531501),a=yn(a,l,u,d,t[n+13],5,-1444681467),d=yn(d,a,l,u,t[n+2],9,-51403784),u=yn(u,d,a,l,t[n+7],14,1735328473),l=yn(l,u,d,a,t[n+12],20,-1926607734),a=vn(a,l,u,d,t[n+5],4,-378558),d=vn(d,a,l,u,t[n+8],11,-2022574463),u=vn(u,d,a,l,t[n+11],16,1839030562),l=vn(l,u,d,a,t[n+14],23,-35309556),a=vn(a,l,u,d,t[n+1],4,-1530992060),d=vn(d,a,l,u,t[n+4],11,1272893353),u=vn(u,d,a,l,t[n+7],16,-155497632),l=vn(l,u,d,a,t[n+10],23,-1094730640),a=vn(a,l,u,d,t[n+13],4,681279174),d=vn(d,a,l,u,t[n],11,-358537222),u=vn(u,d,a,l,t[n+3],16,-722521979),l=vn(l,u,d,a,t[n+6],23,76029189),a=vn(a,l,u,d,t[n+9],4,-640364487),d=vn(d,a,l,u,t[n+12],11,-421815835),u=vn(u,d,a,l,t[n+15],16,530742520),l=vn(l,u,d,a,t[n+2],23,-995338651),a=bn(a,l,u,d,t[n],6,-198630844),d=bn(d,a,l,u,t[n+7],10,1126891415),u=bn(u,d,a,l,t[n+14],15,-1416354905),l=bn(l,u,d,a,t[n+5],21,-57434055),a=bn(a,l,u,d,t[n+12],6,1700485571),d=bn(d,a,l,u,t[n+3],10,-1894986606),u=bn(u,d,a,l,t[n+10],15,-1051523),l=bn(l,u,d,a,t[n+1],21,-2054922799),a=bn(a,l,u,d,t[n+8],6,1873313359),d=bn(d,a,l,u,t[n+15],10,-30611744),u=bn(u,d,a,l,t[n+6],15,-1560198380),l=bn(l,u,d,a,t[n+13],21,1309151649),a=bn(a,l,u,d,t[n+4],6,-145523070),d=bn(d,a,l,u,t[n+11],10,-1120210379),u=bn(u,d,a,l,t[n+2],15,718787259),l=bn(l,u,d,a,t[n+9],21,-343485551),a=_s(a,r),l=_s(l,i),u=_s(u,s),d=_s(d,o);return[a,l,u,d]}function AK(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 _s(t,e){var n=(t&65535)+(e&65535),r=(t>>16)+(e>>16)+(n>>16);return r<<16|n&65535}function IK(t,e){return t<<e|t>>>32-e}function pd(t,e,n,r,i,s){return _s(IK(_s(_s(e,t),_s(r,s)),i),n)}function gn(t,e,n,r,i,s,o){return pd(e&n|~e&r,t,e,i,s,o)}function yn(t,e,n,r,i,s,o){return pd(e&r|n&~r,t,e,i,s,o)}function vn(t,e,n,r,i,s,o){return pd(e^n^r,t,e,i,s,o)}function bn(t,e,n,r,i,s,o){return pd(n^(e|~r),t,e,i,s,o)}var xK=xk("v3",48,OK);function CK(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||Nk)();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||Vy(i)}function DK(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 Wy(t,e){return t<<e|t>>>32-e}function RK(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]=Wy(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=Wy(h,5)+DK(_,p,g,y)+b+e[_]+u[d]>>>0;b=y,y=g,g=Wy(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 MK=xk("v5",80,RK);const PK=ea(Object.freeze(Object.defineProperty({__proto__:null,v1:_K,v3:xK,v4:CK,v5:MK},Symbol.toStringTag,{value:"Module"})));(function(t){var e=Re&&Re.__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(cK),r=e(KS),i=e(Ok),s=PK;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})(bs);var FK=Re&&Re.__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},LK=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(cd,"__esModule",{value:!0});const $K=LK(ZG),Gn=Nr,VK=bs,Ck=_c,jK=Nr;class BK{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[Gn.InvalidationPolicyEvent.Read]=i[Gn.InvalidationPolicyEvent.Read]||!!o.timeToLive,i[Gn.InvalidationPolicyEvent.Write]=i[Gn.InvalidationPolicyEvent.Write]||!!o[Gn.InvalidationPolicyLifecycleEvent.Write],i[Gn.InvalidationPolicyEvent.Evict]=i[Gn.InvalidationPolicyEvent.Evict]||!!o[Gn.InvalidationPolicyLifecycleEvent.Evict],i},{[Gn.InvalidationPolicyEvent.Read]:!!r,[Gn.InvalidationPolicyEvent.Write]:!1,[Gn.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[Gn.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=FK(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,Ck.makeReference)(y),storage:this.getPolicyActionStorage(w)},r))}):p(s,Object.assign({id:y,storage:this.getPolicyActionStorage(y),ref:(0,Ck.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:jK.RenewalPolicy.WriteOnly}runWritePolicy(e,n){return this.runPolicyEvent(e,Gn.InvalidationPolicyEvent.Write,n)}runEvictPolicy(e,n){return this.runPolicyEvent(e,Gn.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,VK.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,$K.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]}}cd.default=BK;var qy={},zy={},Qy={};(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})(Qy),Object.defineProperty(zy,"__esModule",{value:!0});const Dk=bs,UK=Qy;class WK{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,Dk.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,Dk.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!==UK.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}}zy.default=WK;var md={},qK=YO;function zK(t,e,n){return t==null?t:qK(t,e,n)}var QK=zK,GK=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(md,"__esModule",{value:!0});const HK=GK(QK),Fi=bs;class KK{constructor(){this.entitiesByType={},this.entitiesById={}}write(e,n,r,i,s){const o=r?(0,Fi.fieldNameFromStoreName)(r):void 0,a=(0,Fi.makeEntityId)(n,o),l=this.readEntityById(a);if(l){if((0,Fi.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,Fi.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,HK.default)(this.entitiesByType,[e,a],u),this.entitiesById[a]=u}}evict(e,n){var r;const i=n?(0,Fi.fieldNameFromStoreName)(n):null,s=(0,Fi.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,Fi.fieldNameFromStoreName)(n):void 0,i=this.entitiesById[(0,Fi.makeEntityId)(e,r)];if(i){const s=Date.now();if((0,Fi.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={}}}md.default=KK,function(t){var e=Re&&Re.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.EntityTypeMap=t.EntityStoreWatcher=void 0;var n=zy;Object.defineProperty(t,"EntityStoreWatcher",{enumerable:!0,get:function(){return e(n).default}});var r=md;Object.defineProperty(t,"EntityTypeMap",{enumerable:!0,get:function(){return e(r).default}})}(qy);var wo={};const JK=ea(tF);var Rk=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wo,"__esModule",{value:!0}),wo.CacheResultProcessor=wo.ReadResultStatus=void 0;const Gy=_c,Fa=Rk(Ok),Mk=Rk(Rn),Li=JK,kc=bs,di=Nr;var an;(function(t){t[t.Evicted=0]="Evicted",t[t.Incomplete=1]="Incomplete",t[t.Complete=2]="Complete"})(an||(wo.ReadResultStatus=an={}));class YK{constructor(e){this.config=e}getFieldsForQuery(e){const n=(0,Li.getOperationDefinition)(e.query),r=(0,Li.createFragmentMap)((0,Li.getFragmentDefinitions)(e.query));return n.selectionSet.selections.reduce((i,s)=>{var o,a;if((0,Li.isField)(s))return i.push(s),i;const l=(a=(o=(0,Li.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,Fa.default)(o)){const{__typename:a}=o,l=Object.keys(o).reduce((u,d)=>this.processReadSubResult(o,d)===an.Complete,!0);if(a){const u=r.identify(o);if(u){const d=i.getRenewalPolicyForType(a);if((d===di.RenewalPolicy.AccessAndWrite||d===di.RenewalPolicy.AccessOnly)&&s.renewEntity(u),i.runReadPolicy({typename:a,dataId:u}))return(0,Fa.default)(e)&&n&&delete e[n],an.Evicted}}return l?an.Complete:an.Incomplete}else if((0,Mk.default)(o)){let a=an.Complete;const l=o.map((u,d)=>{const h=this.processReadSubResult(o,d);return h<a&&(a=h),h});return a===an.Evicted&&n&&(e[n]=o.filter((u,d)=>l[d]!==an.Evicted)),a===an.Complete?an.Complete:an.Incomplete}return an.Complete}processReadResult(e,n){const{cache:r,entityTypeMap:i,invalidationPolicyManager:s}=this.config,{rootId:o="ROOT_QUERY"}=n;if((0,Fa.default)(e)){if((0,kc.isQuery)(o)){const{variables:a}=n,l=this.getFieldsForQuery(n).reduce((u,d)=>{var h;const p=d.name.value,g=(0,Li.resultKeyNameFromField)(d),y=this.processReadSubResult(e,g),b=(h=i.readEntityById((0,kc.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===di.RenewalPolicy.AccessAndWrite||N===di.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===an.Complete},!0);return(0,Li.maybeDeepFreeze)(e),l?an.Complete:an.Incomplete}return(0,Li.maybeDeepFreeze)(e),this.processReadSubResult(e)}return an.Complete}processWriteSubResult(e){const{cache:n,invalidationPolicyManager:r,entityTypeMap:i}=this.config;if((0,Fa.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===di.RenewalPolicy.WriteOnly||a===di.RenewalPolicy.AccessAndWrite)&&i.renewEntity(o),r.runWritePolicy(s,{parent:{id:o,ref:(0,Gy.makeReference)(o)}})}}}else(0,Mk.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,Fa.default)(s)&&this.processWriteSubResult(s),r&&(0,kc.isQuery)(r)&&(0,Fa.default)(s))this.getFieldsForQuery(e).forEach(u=>{var d;const h=u.name.value,p=(d=o.readEntityById((0,kc.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,Li.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===di.RenewalPolicy.WriteOnly||O===di.RenewalPolicy.AccessAndWrite)&&(o.renewEntity(r,g),o.renewEntity(r,w)),l.runWritePolicy(p,{parent:{id:r,fieldName:h,storeFieldName:g,ref:(0,Gy.makeReference)(r),variables:b,args:y}})}});else if(r){const u=(n=o.readEntityById((0,kc.makeEntityId)(r)))===null||n===void 0?void 0:n.typename;if(u){const d=l.getRenewalPolicyForType(u);(d===di.RenewalPolicy.WriteOnly||d===di.RenewalPolicy.AccessAndWrite)&&o.renewEntity(r),l.runWritePolicy(u,{parent:{id:r,ref:(0,Gy.makeReference)(r),variables:i}})}}}}wo.CacheResultProcessor=YK;var Hy=Re&&Re.__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},Es=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gf,"__esModule",{value:!0});const ws=_c,XK=Es(KS),ZK=Es(B3),e5=Es(HQ),t5=Es(wG),n5=Es(SG),r5=Es(Xf),i5=Es(HG),s5=Es(cd),Pk=qy,hi=bs,Nc=wo,Mn=Nr,Ky=Qy,o5=uy;class a5 extends ws.InMemoryCache{constructor(e={}){const{invalidationPolicies:n={},enableCollections:r=!1}=e,i=Hy(e,["invalidationPolicies","enableCollections"]);super(i),this.pendingCollectionUpdates={},this.enableCollections=r,this.invalidationPolicies=n,this.isBroadcasting=!1,this.isInitialized=!0,this.reactiveVarsCache=(0,o5.initReactiveVarsCache)(this),this.reinitialize()}reinitialize(){this.entityStoreRoot=this.data,this.entityTypeMap=new Pk.EntityTypeMap,this.entityStoreWatcher=new Pk.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new s5.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(Mn.InvalidationPolicyEvent.Write)||!r)return r;const{id:i="ROOT_QUERY",fields:s}=e;if((0,hi.isQuery)(i))Object.keys(s).forEach(o=>{var a;const l=(0,hi.fieldNameFromStoreName)(o),u=(a=this.entityTypeMap.readEntityById((0,hi.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,ws.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,ws.makeReference)(i)}})}return e.broadcast&&this.broadcastWatches(),r}write(e){const n=super.write(e);return!this.invalidationPolicyManager.isPolicyEventActive(Mn.InvalidationPolicyEvent.Write)&&!this.invalidationPolicyManager.isPolicyEventActive(Mn.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(Mn.InvalidationPolicyEvent.Evict)){const{typename:o}=(n=this.entityTypeMap.readEntityById((0,hi.makeEntityId)(s,r)))!==null&&n!==void 0?n:{};if(o){const a=(0,hi.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,ws.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,Ky.collectionEntityIdForType)(e);!!this.readField("id",(0,ws.makeReference)(r))||this.writeFragment({id:r,fragment:(0,ws.gql)`
221
+ fragment InitializeCollectionEntity on CacheExtensionsCollectionEntity {
222
+ data
223
+ id
224
+ }
225
+ `,data:{__typename:Ky.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,ws.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,hi.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,hi.makeEntityId)(a,d))}):this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,reportOnly:e})&&r.push((0,hi.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(Mn.InvalidationPolicyEvent.Read,Mn.InvalidationPolicyEvent.Write,Mn.InvalidationPolicyEvent.Evict)}deactivatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.deactivatePolicies(...e):this.invalidationPolicyManager.deactivatePolicies(Mn.InvalidationPolicyEvent.Read,Mn.InvalidationPolicyEvent.Write,Mn.InvalidationPolicyEvent.Evict)}activePolicyEvents(){return[Mn.InvalidationPolicyEvent.Read,Mn.InvalidationPolicyEvent.Write,Mn.InvalidationPolicyEvent.Evict].filter(e=>this.invalidationPolicyManager.isPolicyEventActive(e))}read(e){const n=super.read(e);if(!this.invalidationPolicyManager.isPolicyEventActive(Mn.InvalidationPolicyEvent.Read))return n;const r=(0,hi.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(Mn.InvalidationPolicyEvent.Read)||this.isBroadcasting)return n;const{result:r}=n,i=(0,hi.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,e5.default)(this.entityTypeMap.extract(),"entitiesById")),r}readFragmentWhere(e){const{fragment:n,filter:r,limit:i,orderBy:s}=e,o=Hy(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,XK.default)(d)}readReferenceWhere(e){const{__typename:n,filter:r,limit:i,orderBy:s}=e,o=(0,Ky.collectionEntityIdForType)(n);this.pendingCollectionUpdates[o]&&this._updatePendingCollection(o);let a=this.readField("data",(0,ws.makeReference)(o));if(!a)return[];const l=this.readField.bind(this);if(r&&(a=a.filter(u=>{if((0,r5.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,ZK.default)(d,Boolean)})),s){const{field:u,descending:d}=s;a=(0,i5.default)(a,h=>l(u,h),[d?"desc":"asc"])}return(0,n5.default)(i)?a:(0,t5.default)(a,i)}writeFragmentWhere(e){const{update:n}=e,r=Hy(e,["update"]);this.readFragmentWhere(r).forEach(i=>{this.writeFragment({id:this.identify(i),fragment:e.fragment,data:n(i),broadcast:!1})}),this.broadcastWatches()}}Gf.default=a5,function(t){var e=Re&&Re.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCache=t.makeCachedVar=void 0;var n=uy;Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return n.makeCachedVar}});var r=Gf;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e(r).default}})}(HS);var Fk={},Jy={},Ts={};const l5=ea(xM);Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.buildWatchFragmentWhereQuery=Ts.buildWatchFragmentQuery=void 0;const Ss=l5,c5=_c;function Lk({fieldName:t,fragmentDefinition:e}){return{kind:Ss.Kind.DOCUMENT,definitions:[{directives:[],variableDefinitions:[],kind:Ss.Kind.OPERATION_DEFINITION,operation:Ss.OperationTypeNode.QUERY,selectionSet:{kind:Ss.Kind.SELECTION_SET,selections:[{arguments:[],kind:Ss.Kind.FIELD,name:{kind:Ss.Kind.NAME,value:t},directives:[{arguments:[],kind:Ss.Kind.DIRECTIVE,name:{kind:Ss.Kind.NAME,value:"client"}}],selectionSet:e.selectionSet}]}}]}}function u5(t){const{fragment:e,id:n,policies:r,fieldName:i}=t,s=e.definitions[0],o=Lk({fragmentDefinition:s,fieldName:i});return r.getFieldPolicy("Query",i)||r.addTypePolicies({Query:{fields:{[i]:{read(a){return(0,c5.makeReference)(n)}}}}}),o}Ts.buildWatchFragmentQuery=u5;function f5(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=Lk({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}Ts.buildWatchFragmentWhereQuery=f5,Object.defineProperty(Jy,"__esModule",{value:!0});const gd=_c,$k=Ts,Vk=bs;class d5 extends gd.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,Vk.generateFragmentFieldName)(),r=(0,$k.buildWatchFragmentQuery)(Object.assign(Object.assign({},e),{fieldName:n,policies:this.policies}));return this.watchQueryForField(r,n)}watchFragmentWhere(e){const n=(0,Vk.generateFragmentFieldName)(),r=(0,gd.makeVar)(e.filter),i=(0,gd.makeVar)(e.limit),s=(0,gd.makeVar)(e.orderBy),o=(0,$k.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)}}Jy.default=d5,function(t){var e=Re&&Re.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.ApolloExtensionsClient=void 0;var n=Jy;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return e(n).default}})}(Fk);var jk={},Yy={},To={},h5=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(To,"__esModule",{value:!0}),To.usePrevious=To.useOnce=void 0;const yd=ae,p5=h5(Xf);function m5(t){const e=(0,yd.useRef)(),n=(0,yd.useRef)(!1);return n.current||((0,p5.default)(t)?e.current=t():e.current=t,n.current=!0),e.current}To.useOnce=m5;const g5=t=>{const e=(0,yd.useRef)(null);return(0,yd.useEffect)(()=>{e.current=t}),e.current};To.usePrevious=g5;var Ac={};Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.useFragmentTypePolicyFieldName=void 0;const y5=Ia,Bk=ae,v5=bs,b5=To,_5=({fragmentName:t}={})=>{const e=(0,Bk.useMemo)(()=>(0,v5.generateFragmentFieldName)({fragmentName:t}),[t]),n=(0,b5.usePrevious)(e),r=(0,y5.useApolloClient)();return(0,Bk.useEffect)(()=>()=>{delete r.cache.policies.typePolicies.Query.fields[n]},[e,n]),e};Ac.useFragmentTypePolicyFieldName=_5;var Ic={};Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.useGetQueryDataByFieldName=void 0;const E5=Ia,w5=(t,e,n)=>{var r,i;const s=(0,E5.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}};Ic.useGetQueryDataByFieldName=w5,Object.defineProperty(Yy,"__esModule",{value:!0});const T5=Ia,S5=ae,O5=To,k5=Ts,N5=Ac,A5=Ic;function I5(t,e){const r=(0,S5.useContext)((0,T5.getApolloContext)()).client,i=r==null?void 0:r.cache,s=(0,N5.useFragmentTypePolicyFieldName)(),o=(0,O5.useOnce)(()=>(0,k5.buildWatchFragmentQuery)({fragment:t,fieldName:s,id:e.id,policies:i.policies}));return(0,A5.useGetQueryDataByFieldName)(o,s,e)}Yy.default=I5;var Xy={};const x5=ea(IF);Object.defineProperty(Xy,"__esModule",{value:!0});const C5=Ia,$i=ae,D5=Ts,R5=Ac,M5=Ic,Zy=Ia,Uk=x5;function P5(t,e){var n;const r=e==null?void 0:e.filter,s=(0,$i.useRef)((0,Zy.makeVar)(r)).current,o=e==null?void 0:e.limit,l=(0,$i.useRef)((0,Zy.makeVar)(o)).current,u=e==null?void 0:e.orderBy,h=(0,$i.useRef)((0,Zy.makeVar)(u)).current,g=(0,$i.useContext)((0,C5.getApolloContext)()).client,y=g==null?void 0:g.cache,b=(0,R5.useFragmentTypePolicyFieldName)({fragmentName:e==null?void 0:e.fragmentName}),_=(0,$i.useRef)([]);(0,$i.useEffect)(()=>{(typeof r=="function"&&r!==s()||!(0,Uk.equal)(r,s()))&&s(r)},[r]),(0,$i.useEffect)(()=>{o!==l()&&l(o)},[o]),(0,$i.useEffect)(()=>{(typeof u=="function"&&u!==h()||!(0,Uk.equal)(u,h()))&&h(u)},[u]);const w=(0,$i.useMemo)(()=>(0,D5.buildWatchFragmentWhereQuery)({filter:r,filterVar:s,limitVar:l,orderByVar:h,fragment:t,fieldName:b,cache:y,policies:y.policies}),[b]),O=(0,M5.useGetQueryDataByFieldName)(w,b,e);return Object.assign(Object.assign({},O),{data:(n=O.data)!==null&&n!==void 0?n:_.current})}Xy.default=P5,function(t){var e=Re&&Re.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFragmentWhere=t.useFragment=void 0;var n=Yy;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return e(n).default}});var r=Xy;Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return e(r).default}})}(jk);var Wk={},ev={},xc={},F5=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xc,"__esModule",{value:!0}),xc.AuditType=void 0;const L5=F5(cd);var Cc;(function(t){t.Read="Read",t.Write="Write",t.Evict="Evict"})(Cc||(xc.AuditType=Cc={}));class $5 extends L5.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",Cc.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",Cc.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runWritePolicy(e,n)}runEvictPolicy(e,n){return this.auditLog.log("Running evict policy",Cc.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runEvictPolicy(e,n)}}xc.default=$5;var tv={},V5=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tv,"__esModule",{value:!0});const j5=V5(md);var vd;(function(t){t.Write="Write",t.Evict="Evict"})(vd||(vd={}));class B5 extends j5.default{constructor(e){super(),this.auditLog=e.auditLog}write(e,n,r,i){return this.auditLog.log("Writing to type map",vd.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",vd.Evict,"EntityTypeMap",{dataId:e,storeFieldName:n}),super.evict(e,n)}}tv.default=B5;var nv={},U5=gy;function W5(t,e){var n=[];return U5(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}var q5=W5,z5=vO,Q5=q5,G5=Ry,H5=Rn;function K5(t,e){var n=H5(t)?z5:Q5;return n(t,G5(e))}var J5=K5,Y5=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nv,"__esModule",{value:!0});const X5=Y5(J5);class Z5{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,X5.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()}}nv.default=Z5;var bd=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ev,"__esModule",{value:!0});const e8=bd(Gf),t8=wo,n8=bd(xc),r8=bd(tv),i8=bd(nv),s8=qy;class o8 extends e8.default{constructor(e){super(e),this.auditLog=new i8.default;const{invalidationPolicies:n={}}=e;this.entityTypeMap=new r8.default({auditLog:this.auditLog}),new s8.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new n8.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 t8.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this})}}ev.default=o8,function(t){var e=Re&&Re.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCacheAuditor=void 0;var n=ev;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return e(n).default}})}(Wk),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=HS;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e.InvalidationPolicyCache}}),Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return e.makeCachedVar}});var n=Fk;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return n.ApolloExtensionsClient}});var r=jk;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return r.useFragment}}),Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return r.useFragmentWhere}});var i=Wk;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return i.InvalidationPolicyCacheAuditor}});var s=Nr;Object.defineProperty(t,"InvalidationPolicyEvent",{enumerable:!0,get:function(){return s.InvalidationPolicyEvent}}),Object.defineProperty(t,"RenewalPolicy",{enumerable:!0,get:function(){return s.RenewalPolicy}})}(cy);var rv=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))},a8=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,rv([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=rv(rv([],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}(),l8=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}(),_d=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())})},Ed=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}}},qk=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 _d(this,void 0,void 0,function(){return Ed(this,function(e){return[2,this.storage.getItem(this.key)]})})},t.prototype.write=function(e){return _d(this,void 0,void 0,function(){return Ed(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 _d(this,void 0,void 0,function(){return Ed(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 _d(this,void 0,void 0,function(){var e;return Ed(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}(),iv=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())})},sv=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}}},zk=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 iv(this,void 0,void 0,function(){var e,n;return sv(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 iv(this,void 0,void 0,function(){var e,n;return sv(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 iv(this,void 0,void 0,function(){var e;return sv(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 Qk=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}}},c8=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"),Qk({cache:n})(r)}};var u8=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=Qk({cache:a})(this.fire);break;case"background":l&&r.warn("Debounce is not recommended with `background` trigger"),this.debounce=l,this.uninstall=c8({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}(),f8=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 a8(e),r=new l8(e),i=new qk(e),s=new zk({log:n,cache:r,storage:i},e),o=new u8({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}(),ov=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)}}(),d8=function(t){var e=new h8(t);e.restoreSync()},h8=function(t){ov(e,t);function e(n){var r=t.call(this,n)||this;return r.storage=new m8(n),r.persistor=new p8({log:r.log,cache:r.cache,storage:r.storage},n),r}return e.prototype.restoreSync=function(){this.persistor.restoreSync()},e}(f8),p8=function(t){ov(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}(zk),m8=function(t){ov(e,t);function e(n){return t.call(this,n)||this}return e.prototype.readSync=function(){return this.storage.getItem(this.key)},e}(qk),g8=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}(),wd={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
+ */wd.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,pe=16,Ce=1,ee=2,Ae=3,fe=1/0,ve=9007199254740991,Se=17976931348623157e292,ht=NaN,Ne=4294967295,$=Ne-1,te=Ne>>>1,Z=[["ary",B],["bind",_],["bindKey",w],["curry",N],["curryRight",I],["flip",x],["partial",P],["partialRight",M],["rearg",Q]],ne="[object Arguments]",be="[object Array]",Me="[object AsyncFunction]",Je="[object Boolean]",tn="[object Date]",bi="[object DOMException]",_i="[object Error]",Qt="[object Function]",ph="[object GeneratorFunction]",ur="[object Map]",Ei="[object Number]",Uo="[object Null]",Mr="[object Object]",Xc="[object Promise]",el="[object Proxy]",Wo="[object RegExp]",fr="[object Set]",Wi="[object String]",tl="[object Symbol]",Ab="[object Undefined]",Bs="[object WeakMap]",mh="[object WeakSet]",Zr="[object ArrayBuffer]",Us="[object DataView]",nl="[object Float32Array]",rl="[object Float64Array]",qo="[object Int8Array]",Zc="[object Int16Array]",eu="[object Int32Array]",tu="[object Uint8Array]",nu="[object Uint8ClampedArray]",ru="[object Uint16Array]",iu="[object Uint32Array]",Ib=/\b__p \+= '';/g,su=/\b(__p \+=) '' \+/g,gh=/(__e\(.*?\)|\b__t\)) \+\n'';/g,qi=/&(?:amp|lt|gt|quot|#39);/g,il=/[&<>"']/g,ou=RegExp(qi.source),yh=RegExp(il.source),xb=/<%-([\s\S]+?)%>/g,vh=/<%([\s\S]+?)%>/g,bh=/<%=([\s\S]+?)%>/g,_h=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Eh=/^\w*$/,Cb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,au=/[\\^$.*+?()[\]{}|]/g,wh=RegExp(au.source),sl=/^\s+/,Db=/\s/,Rb=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Mb=/\{\n\/\* \[wrapped with (.+)\] \*/,Pb=/,? & /,C=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,ie=/\\(\\)?/g,Oe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,ct=/^[-+]0x[0-9a-f]+$/i,Ye=/^0b[01]+$/i,Qe=/^\[object .+?Constructor\]$/,fn=/^0o[0-7]+$/i,kt=/^(?:0|[1-9]\d*)$/,Ct=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,dn=/($^)/,Ws=/['\n\r\u2028\u2029\\]/g,Pr="\\ud800-\\udfff",Sn="\\u0300-\\u036f",lu="\\ufe20-\\ufe2f",Fb="\\u20d0-\\u20ff",Th=Sn+lu+Fb,aI="\\u2700-\\u27bf",lI="a-z\\xdf-\\xf6\\xf8-\\xff",iee="\\xac\\xb1\\xd7\\xf7",see="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",oee="\\u2000-\\u206f",aee=" \\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",cI="A-Z\\xc0-\\xd6\\xd8-\\xde",uI="\\ufe0e\\ufe0f",fI=iee+see+oee+aee,Lb="['’]",lee="["+Pr+"]",dI="["+fI+"]",Sh="["+Th+"]",hI="\\d+",cee="["+aI+"]",pI="["+lI+"]",mI="[^"+Pr+fI+hI+aI+lI+cI+"]",$b="\\ud83c[\\udffb-\\udfff]",uee="(?:"+Sh+"|"+$b+")",gI="[^"+Pr+"]",Vb="(?:\\ud83c[\\udde6-\\uddff]){2}",jb="[\\ud800-\\udbff][\\udc00-\\udfff]",ol="["+cI+"]",yI="\\u200d",vI="(?:"+pI+"|"+mI+")",fee="(?:"+ol+"|"+mI+")",bI="(?:"+Lb+"(?:d|ll|m|re|s|t|ve))?",_I="(?:"+Lb+"(?:D|LL|M|RE|S|T|VE))?",EI=uee+"?",wI="["+uI+"]?",dee="(?:"+yI+"(?:"+[gI,Vb,jb].join("|")+")"+wI+EI+")*",hee="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pee="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",TI=wI+EI+dee,mee="(?:"+[cee,Vb,jb].join("|")+")"+TI,gee="(?:"+[gI+Sh+"?",Sh,Vb,jb,lee].join("|")+")",yee=RegExp(Lb,"g"),vee=RegExp(Sh,"g"),Bb=RegExp($b+"(?="+$b+")|"+gee+TI,"g"),bee=RegExp([ol+"?"+pI+"+"+bI+"(?="+[dI,ol,"$"].join("|")+")",fee+"+"+_I+"(?="+[dI,ol+vI,"$"].join("|")+")",ol+"?"+vI+"+"+bI,ol+"+"+_I,pee,hee,hI,mee].join("|"),"g"),_ee=RegExp("["+yI+Pr+Th+uI+"]"),Eee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,wee=["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"],Tee=-1,wt={};wt[nl]=wt[rl]=wt[qo]=wt[Zc]=wt[eu]=wt[tu]=wt[nu]=wt[ru]=wt[iu]=!0,wt[ne]=wt[be]=wt[Zr]=wt[Je]=wt[Us]=wt[tn]=wt[_i]=wt[Qt]=wt[ur]=wt[Ei]=wt[Mr]=wt[Wo]=wt[fr]=wt[Wi]=wt[Bs]=!1;var vt={};vt[ne]=vt[be]=vt[Zr]=vt[Us]=vt[Je]=vt[tn]=vt[nl]=vt[rl]=vt[qo]=vt[Zc]=vt[eu]=vt[ur]=vt[Ei]=vt[Mr]=vt[Wo]=vt[fr]=vt[Wi]=vt[tl]=vt[tu]=vt[nu]=vt[ru]=vt[iu]=!0,vt[_i]=vt[Qt]=vt[Bs]=!1;var See={À:"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"},Oee={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},kee={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Nee={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Aee=parseFloat,Iee=parseInt,SI=typeof Re=="object"&&Re&&Re.Object===Object&&Re,xee=typeof self=="object"&&self&&self.Object===Object&&self,hn=SI||xee||Function("return this")(),Ub=e&&!e.nodeType&&e,zo=Ub&&!0&&t&&!t.nodeType&&t,OI=zo&&zo.exports===Ub,Wb=OI&&SI.process,Fr=function(){try{var F=zo&&zo.require&&zo.require("util").types;return F||Wb&&Wb.binding&&Wb.binding("util")}catch{}}(),kI=Fr&&Fr.isArrayBuffer,NI=Fr&&Fr.isDate,AI=Fr&&Fr.isMap,II=Fr&&Fr.isRegExp,xI=Fr&&Fr.isSet,CI=Fr&&Fr.isTypedArray;function dr(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 Cee(F,W,V,le){for(var De=-1,st=F==null?0:F.length;++De<st;){var Gt=F[De];W(le,Gt,V(Gt),F)}return le}function Lr(F,W){for(var V=-1,le=F==null?0:F.length;++V<le&&W(F[V],V,F)!==!1;);return F}function Dee(F,W){for(var V=F==null?0:F.length;V--&&W(F[V],V,F)!==!1;);return F}function DI(F,W){for(var V=-1,le=F==null?0:F.length;++V<le;)if(!W(F[V],V,F))return!1;return!0}function qs(F,W){for(var V=-1,le=F==null?0:F.length,De=0,st=[];++V<le;){var Gt=F[V];W(Gt,V,F)&&(st[De++]=Gt)}return st}function Oh(F,W){var V=F==null?0:F.length;return!!V&&al(F,W,0)>-1}function qb(F,W,V){for(var le=-1,De=F==null?0:F.length;++le<De;)if(V(W,F[le]))return!0;return!1}function Tt(F,W){for(var V=-1,le=F==null?0:F.length,De=Array(le);++V<le;)De[V]=W(F[V],V,F);return De}function zs(F,W){for(var V=-1,le=W.length,De=F.length;++V<le;)F[De+V]=W[V];return F}function zb(F,W,V,le){var De=-1,st=F==null?0:F.length;for(le&&st&&(V=F[++De]);++De<st;)V=W(V,F[De],De,F);return V}function Ree(F,W,V,le){var De=F==null?0:F.length;for(le&&De&&(V=F[--De]);De--;)V=W(V,F[De],De,F);return V}function Qb(F,W){for(var V=-1,le=F==null?0:F.length;++V<le;)if(W(F[V],V,F))return!0;return!1}var Mee=Gb("length");function Pee(F){return F.split("")}function Fee(F){return F.match(C)||[]}function RI(F,W,V){var le;return V(F,function(De,st,Gt){if(W(De,st,Gt))return le=st,!1}),le}function kh(F,W,V,le){for(var De=F.length,st=V+(le?1:-1);le?st--:++st<De;)if(W(F[st],st,F))return st;return-1}function al(F,W,V){return W===W?Hee(F,W,V):kh(F,MI,V)}function Lee(F,W,V,le){for(var De=V-1,st=F.length;++De<st;)if(le(F[De],W))return De;return-1}function MI(F){return F!==F}function PI(F,W){var V=F==null?0:F.length;return V?Kb(F,W)/V:ht}function Gb(F){return function(W){return W==null?n:W[F]}}function Hb(F){return function(W){return F==null?n:F[W]}}function FI(F,W,V,le,De){return De(F,function(st,Gt,pt){V=le?(le=!1,st):W(V,st,Gt,pt)}),V}function $ee(F,W){var V=F.length;for(F.sort(W);V--;)F[V]=F[V].value;return F}function Kb(F,W){for(var V,le=-1,De=F.length;++le<De;){var st=W(F[le]);st!==n&&(V=V===n?st:V+st)}return V}function Jb(F,W){for(var V=-1,le=Array(F);++V<F;)le[V]=W(V);return le}function Vee(F,W){return Tt(W,function(V){return[V,F[V]]})}function LI(F){return F&&F.slice(0,BI(F)+1).replace(sl,"")}function hr(F){return function(W){return F(W)}}function Yb(F,W){return Tt(W,function(V){return F[V]})}function cu(F,W){return F.has(W)}function $I(F,W){for(var V=-1,le=F.length;++V<le&&al(W,F[V],0)>-1;);return V}function VI(F,W){for(var V=F.length;V--&&al(W,F[V],0)>-1;);return V}function jee(F,W){for(var V=F.length,le=0;V--;)F[V]===W&&++le;return le}var Bee=Hb(See),Uee=Hb(Oee);function Wee(F){return"\\"+Nee[F]}function qee(F,W){return F==null?n:F[W]}function ll(F){return _ee.test(F)}function zee(F){return Eee.test(F)}function Qee(F){for(var W,V=[];!(W=F.next()).done;)V.push(W.value);return V}function Xb(F){var W=-1,V=Array(F.size);return F.forEach(function(le,De){V[++W]=[De,le]}),V}function jI(F,W){return function(V){return F(W(V))}}function Qs(F,W){for(var V=-1,le=F.length,De=0,st=[];++V<le;){var Gt=F[V];(Gt===W||Gt===d)&&(F[V]=d,st[De++]=V)}return st}function Nh(F){var W=-1,V=Array(F.size);return F.forEach(function(le){V[++W]=le}),V}function Gee(F){var W=-1,V=Array(F.size);return F.forEach(function(le){V[++W]=[le,le]}),V}function Hee(F,W,V){for(var le=V-1,De=F.length;++le<De;)if(F[le]===W)return le;return-1}function Kee(F,W,V){for(var le=V+1;le--;)if(F[le]===W)return le;return le}function cl(F){return ll(F)?Yee(F):Mee(F)}function ei(F){return ll(F)?Xee(F):Pee(F)}function BI(F){for(var W=F.length;W--&&Db.test(F.charAt(W)););return W}var Jee=Hb(kee);function Yee(F){for(var W=Bb.lastIndex=0;Bb.test(F);)++W;return W}function Xee(F){return F.match(Bb)||[]}function Zee(F){return F.match(bee)||[]}var ete=function F(W){W=W==null?hn:ul.defaults(hn.Object(),W,ul.pick(hn,wee));var V=W.Array,le=W.Date,De=W.Error,st=W.Function,Gt=W.Math,pt=W.Object,Zb=W.RegExp,tte=W.String,$r=W.TypeError,Ah=V.prototype,nte=st.prototype,fl=pt.prototype,Ih=W["__core-js_shared__"],xh=nte.toString,ut=fl.hasOwnProperty,rte=0,UI=function(){var c=/[^.]+$/.exec(Ih&&Ih.keys&&Ih.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}(),Ch=fl.toString,ite=xh.call(pt),ste=hn._,ote=Zb("^"+xh.call(ut).replace(au,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Dh=OI?W.Buffer:n,Gs=W.Symbol,Rh=W.Uint8Array,WI=Dh?Dh.allocUnsafe:n,Mh=jI(pt.getPrototypeOf,pt),qI=pt.create,zI=fl.propertyIsEnumerable,Ph=Ah.splice,QI=Gs?Gs.isConcatSpreadable:n,uu=Gs?Gs.iterator:n,Qo=Gs?Gs.toStringTag:n,Fh=function(){try{var c=Yo(pt,"defineProperty");return c({},"",{}),c}catch{}}(),ate=W.clearTimeout!==hn.clearTimeout&&W.clearTimeout,lte=le&&le.now!==hn.Date.now&&le.now,cte=W.setTimeout!==hn.setTimeout&&W.setTimeout,Lh=Gt.ceil,$h=Gt.floor,e0=pt.getOwnPropertySymbols,ute=Dh?Dh.isBuffer:n,GI=W.isFinite,fte=Ah.join,dte=jI(pt.keys,pt),Ht=Gt.max,On=Gt.min,hte=le.now,pte=W.parseInt,HI=Gt.random,mte=Ah.reverse,t0=Yo(W,"DataView"),fu=Yo(W,"Map"),n0=Yo(W,"Promise"),dl=Yo(W,"Set"),du=Yo(W,"WeakMap"),hu=Yo(pt,"create"),Vh=du&&new du,hl={},gte=Xo(t0),yte=Xo(fu),vte=Xo(n0),bte=Xo(dl),_te=Xo(du),jh=Gs?Gs.prototype:n,pu=jh?jh.valueOf:n,KI=jh?jh.toString:n;function T(c){if(Dt(c)&&!Pe(c)&&!(c instanceof Xe)){if(c instanceof Vr)return c;if(ut.call(c,"__wrapped__"))return Jx(c)}return new Vr(c)}var pl=function(){function c(){}return function(f){if(!Nt(f))return{};if(qI)return qI(f);c.prototype=f;var m=new c;return c.prototype=n,m}}();function Bh(){}function Vr(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}T.templateSettings={escape:xb,evaluate:vh,interpolate:bh,variable:"",imports:{_:T}},T.prototype=Bh.prototype,T.prototype.constructor=T,Vr.prototype=pl(Bh.prototype),Vr.prototype.constructor=Vr;function Xe(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ne,this.__views__=[]}function Ete(){var c=new Xe(this.__wrapped__);return c.__actions__=Xn(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Xn(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Xn(this.__views__),c}function wte(){if(this.__filtered__){var c=new Xe(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function Tte(){var c=this.__wrapped__.value(),f=this.__dir__,m=Pe(c),v=f<0,E=m?c.length:0,S=Pne(0,E,this.__views__),A=S.start,R=S.end,L=R-A,G=v?R:A-1,H=this.__iteratees__,K=H.length,re=0,de=On(L,this.__takeCount__);if(!m||!v&&E==L&&de==L)return bx(c,this.__actions__);var Ee=[];e:for(;L--&&re<de;){G+=f;for(var Be=-1,we=c[G];++Be<K;){var He=H[Be],Ze=He.iteratee,gr=He.type,Bn=Ze(we);if(gr==ee)we=Bn;else if(!Bn){if(gr==Ce)continue e;break e}}Ee[re++]=we}return Ee}Xe.prototype=pl(Bh.prototype),Xe.prototype.constructor=Xe;function Go(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 Ste(){this.__data__=hu?hu(null):{},this.size=0}function Ote(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f}function kte(c){var f=this.__data__;if(hu){var m=f[c];return m===l?n:m}return ut.call(f,c)?f[c]:n}function Nte(c){var f=this.__data__;return hu?f[c]!==n:ut.call(f,c)}function Ate(c,f){var m=this.__data__;return this.size+=this.has(c)?0:1,m[c]=hu&&f===n?l:f,this}Go.prototype.clear=Ste,Go.prototype.delete=Ote,Go.prototype.get=kte,Go.prototype.has=Nte,Go.prototype.set=Ate;function zi(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 Ite(){this.__data__=[],this.size=0}function xte(c){var f=this.__data__,m=Uh(f,c);if(m<0)return!1;var v=f.length-1;return m==v?f.pop():Ph.call(f,m,1),--this.size,!0}function Cte(c){var f=this.__data__,m=Uh(f,c);return m<0?n:f[m][1]}function Dte(c){return Uh(this.__data__,c)>-1}function Rte(c,f){var m=this.__data__,v=Uh(m,c);return v<0?(++this.size,m.push([c,f])):m[v][1]=f,this}zi.prototype.clear=Ite,zi.prototype.delete=xte,zi.prototype.get=Cte,zi.prototype.has=Dte,zi.prototype.set=Rte;function Qi(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 Mte(){this.size=0,this.__data__={hash:new Go,map:new(fu||zi),string:new Go}}function Pte(c){var f=ep(this,c).delete(c);return this.size-=f?1:0,f}function Fte(c){return ep(this,c).get(c)}function Lte(c){return ep(this,c).has(c)}function $te(c,f){var m=ep(this,c),v=m.size;return m.set(c,f),this.size+=m.size==v?0:1,this}Qi.prototype.clear=Mte,Qi.prototype.delete=Pte,Qi.prototype.get=Fte,Qi.prototype.has=Lte,Qi.prototype.set=$te;function Ho(c){var f=-1,m=c==null?0:c.length;for(this.__data__=new Qi;++f<m;)this.add(c[f])}function Vte(c){return this.__data__.set(c,l),this}function jte(c){return this.__data__.has(c)}Ho.prototype.add=Ho.prototype.push=Vte,Ho.prototype.has=jte;function ti(c){var f=this.__data__=new zi(c);this.size=f.size}function Bte(){this.__data__=new zi,this.size=0}function Ute(c){var f=this.__data__,m=f.delete(c);return this.size=f.size,m}function Wte(c){return this.__data__.get(c)}function qte(c){return this.__data__.has(c)}function zte(c,f){var m=this.__data__;if(m instanceof zi){var v=m.__data__;if(!fu||v.length<i-1)return v.push([c,f]),this.size=++m.size,this;m=this.__data__=new Qi(v)}return m.set(c,f),this.size=m.size,this}ti.prototype.clear=Bte,ti.prototype.delete=Ute,ti.prototype.get=Wte,ti.prototype.has=qte,ti.prototype.set=zte;function JI(c,f){var m=Pe(c),v=!m&&Zo(c),E=!m&&!v&&Xs(c),S=!m&&!v&&!E&&vl(c),A=m||v||E||S,R=A?Jb(c.length,tte):[],L=R.length;for(var G in c)(f||ut.call(c,G))&&!(A&&(G=="length"||E&&(G=="offset"||G=="parent")||S&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||Ji(G,L)))&&R.push(G);return R}function YI(c){var f=c.length;return f?c[h0(0,f-1)]:n}function Qte(c,f){return tp(Xn(c),Ko(f,0,c.length))}function Gte(c){return tp(Xn(c))}function r0(c,f,m){(m!==n&&!ni(c[f],m)||m===n&&!(f in c))&&Gi(c,f,m)}function mu(c,f,m){var v=c[f];(!(ut.call(c,f)&&ni(v,m))||m===n&&!(f in c))&&Gi(c,f,m)}function Uh(c,f){for(var m=c.length;m--;)if(ni(c[m][0],f))return m;return-1}function Hte(c,f,m,v){return Hs(c,function(E,S,A){f(v,E,m(E),A)}),v}function XI(c,f){return c&&Ti(f,nn(f),c)}function Kte(c,f){return c&&Ti(f,er(f),c)}function Gi(c,f,m){f=="__proto__"&&Fh?Fh(c,f,{configurable:!0,enumerable:!0,value:m,writable:!0}):c[f]=m}function i0(c,f){for(var m=-1,v=f.length,E=V(v),S=c==null;++m<v;)E[m]=S?n:$0(c,f[m]);return E}function Ko(c,f,m){return c===c&&(m!==n&&(c=c<=m?c:m),f!==n&&(c=c>=f?c:f)),c}function jr(c,f,m,v,E,S){var A,R=f&h,L=f&p,G=f&g;if(m&&(A=E?m(c,v,E,S):m(c)),A!==n)return A;if(!Nt(c))return c;var H=Pe(c);if(H){if(A=Lne(c),!R)return Xn(c,A)}else{var K=kn(c),re=K==Qt||K==ph;if(Xs(c))return wx(c,R);if(K==Mr||K==ne||re&&!E){if(A=L||re?{}:Bx(c),!R)return L?kne(c,Kte(A,c)):One(c,XI(A,c))}else{if(!vt[K])return E?c:{};A=$ne(c,K,R)}}S||(S=new ti);var de=S.get(c);if(de)return de;S.set(c,A),gC(c)?c.forEach(function(we){A.add(jr(we,f,m,we,c,S))}):pC(c)&&c.forEach(function(we,He){A.set(He,jr(we,f,m,He,c,S))});var Ee=G?L?S0:T0:L?er:nn,Be=H?n:Ee(c);return Lr(Be||c,function(we,He){Be&&(He=we,we=c[He]),mu(A,He,jr(we,f,m,He,c,S))}),A}function Jte(c){var f=nn(c);return function(m){return ZI(m,c,f)}}function ZI(c,f,m){var v=m.length;if(c==null)return!v;for(c=pt(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 ex(c,f,m){if(typeof c!="function")throw new $r(o);return wu(function(){c.apply(n,m)},f)}function gu(c,f,m,v){var E=-1,S=Oh,A=!0,R=c.length,L=[],G=f.length;if(!R)return L;m&&(f=Tt(f,hr(m))),v?(S=qb,A=!1):f.length>=i&&(S=cu,A=!1,f=new Ho(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;L.push(H)}else S(f,K,v)||L.push(H)}return L}var Hs=Nx(wi),tx=Nx(o0,!0);function Yte(c,f){var m=!0;return Hs(c,function(v,E,S){return m=!!f(v,E,S),m}),m}function Wh(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&&!mr(A):m(A,R)))var R=A,L=S}return L}function Xte(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:vC(v);m<v;)c[m++]=f;return c}function nx(c,f){var m=[];return Hs(c,function(v,E,S){f(v,E,S)&&m.push(v)}),m}function pn(c,f,m,v,E){var S=-1,A=c.length;for(m||(m=jne),E||(E=[]);++S<A;){var R=c[S];f>0&&m(R)?f>1?pn(R,f-1,m,v,E):zs(E,R):v||(E[E.length]=R)}return E}var s0=Ax(),rx=Ax(!0);function wi(c,f){return c&&s0(c,f,nn)}function o0(c,f){return c&&rx(c,f,nn)}function qh(c,f){return qs(f,function(m){return Yi(c[m])})}function Jo(c,f){f=Js(f,c);for(var m=0,v=f.length;c!=null&&m<v;)c=c[Si(f[m++])];return m&&m==v?c:n}function ix(c,f,m){var v=f(c);return Pe(c)?v:zs(v,m(c))}function Vn(c){return c==null?c===n?Ab:Uo:Qo&&Qo in pt(c)?Mne(c):Gne(c)}function a0(c,f){return c>f}function Zte(c,f){return c!=null&&ut.call(c,f)}function ene(c,f){return c!=null&&f in pt(c)}function tne(c,f,m){return c>=On(f,m)&&c<Ht(f,m)}function l0(c,f,m){for(var v=m?qb:Oh,E=c[0].length,S=c.length,A=S,R=V(S),L=1/0,G=[];A--;){var H=c[A];A&&f&&(H=Tt(H,hr(f))),L=On(H.length,L),R[A]=!m&&(f||E>=120&&H.length>=120)?new Ho(A&&H):n}H=c[0];var K=-1,re=R[0];e:for(;++K<E&&G.length<L;){var de=H[K],Ee=f?f(de):de;if(de=m||de!==0?de:0,!(re?cu(re,Ee):v(G,Ee,m))){for(A=S;--A;){var Be=R[A];if(!(Be?cu(Be,Ee):v(c[A],Ee,m)))continue e}re&&re.push(Ee),G.push(de)}}return G}function nne(c,f,m,v){return wi(c,function(E,S,A){f(v,m(E),S,A)}),v}function yu(c,f,m){f=Js(f,c),c=zx(c,f);var v=c==null?c:c[Si(Ur(f))];return v==null?n:dr(v,c,m)}function sx(c){return Dt(c)&&Vn(c)==ne}function rne(c){return Dt(c)&&Vn(c)==Zr}function ine(c){return Dt(c)&&Vn(c)==tn}function vu(c,f,m,v,E){return c===f?!0:c==null||f==null||!Dt(c)&&!Dt(f)?c!==c&&f!==f:sne(c,f,m,v,vu,E)}function sne(c,f,m,v,E,S){var A=Pe(c),R=Pe(f),L=A?be:kn(c),G=R?be:kn(f);L=L==ne?Mr:L,G=G==ne?Mr:G;var H=L==Mr,K=G==Mr,re=L==G;if(re&&Xs(c)){if(!Xs(f))return!1;A=!0,H=!1}if(re&&!H)return S||(S=new ti),A||vl(c)?$x(c,f,m,v,E,S):Dne(c,f,L,m,v,E,S);if(!(m&y)){var de=H&&ut.call(c,"__wrapped__"),Ee=K&&ut.call(f,"__wrapped__");if(de||Ee){var Be=de?c.value():c,we=Ee?f.value():f;return S||(S=new ti),E(Be,we,m,v,S)}}return re?(S||(S=new ti),Rne(c,f,m,v,E,S)):!1}function one(c){return Dt(c)&&kn(c)==ur}function c0(c,f,m,v){var E=m.length,S=E,A=!v;if(c==null)return!S;for(c=pt(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 L=R[0],G=c[L],H=R[1];if(A&&R[2]){if(G===n&&!(L in c))return!1}else{var K=new ti;if(v)var re=v(G,H,L,c,f,K);if(!(re===n?vu(H,G,y|b,v,K):re))return!1}}return!0}function ox(c){if(!Nt(c)||Une(c))return!1;var f=Yi(c)?ote:Qe;return f.test(Xo(c))}function ane(c){return Dt(c)&&Vn(c)==Wo}function lne(c){return Dt(c)&&kn(c)==fr}function cne(c){return Dt(c)&&ap(c.length)&&!!wt[Vn(c)]}function ax(c){return typeof c=="function"?c:c==null?tr:typeof c=="object"?Pe(c)?ux(c[0],c[1]):cx(c):IC(c)}function u0(c){if(!Eu(c))return dte(c);var f=[];for(var m in pt(c))ut.call(c,m)&&m!="constructor"&&f.push(m);return f}function une(c){if(!Nt(c))return Qne(c);var f=Eu(c),m=[];for(var v in c)v=="constructor"&&(f||!ut.call(c,v))||m.push(v);return m}function f0(c,f){return c<f}function lx(c,f){var m=-1,v=Zn(c)?V(c.length):[];return Hs(c,function(E,S,A){v[++m]=f(E,S,A)}),v}function cx(c){var f=k0(c);return f.length==1&&f[0][2]?Wx(f[0][0],f[0][1]):function(m){return m===c||c0(m,c,f)}}function ux(c,f){return A0(c)&&Ux(f)?Wx(Si(c),f):function(m){var v=$0(m,c);return v===n&&v===f?V0(m,c):vu(f,v,y|b)}}function zh(c,f,m,v,E){c!==f&&s0(f,function(S,A){if(E||(E=new ti),Nt(S))fne(c,f,A,m,zh,v,E);else{var R=v?v(x0(c,A),S,A+"",c,f,E):n;R===n&&(R=S),r0(c,A,R)}},er)}function fne(c,f,m,v,E,S,A){var R=x0(c,m),L=x0(f,m),G=A.get(L);if(G){r0(c,m,G);return}var H=S?S(R,L,m+"",c,f,A):n,K=H===n;if(K){var re=Pe(L),de=!re&&Xs(L),Ee=!re&&!de&&vl(L);H=L,re||de||Ee?Pe(R)?H=R:Ft(R)?H=Xn(R):de?(K=!1,H=wx(L,!0)):Ee?(K=!1,H=Tx(L,!0)):H=[]:Tu(L)||Zo(L)?(H=R,Zo(R)?H=bC(R):(!Nt(R)||Yi(R))&&(H=Bx(L))):K=!1}K&&(A.set(L,H),E(H,L,v,S,A),A.delete(L)),r0(c,m,H)}function fx(c,f){var m=c.length;if(m)return f+=f<0?m:0,Ji(f,m)?c[f]:n}function dx(c,f,m){f.length?f=Tt(f,function(S){return Pe(S)?function(A){return Jo(A,S.length===1?S[0]:S)}:S}):f=[tr];var v=-1;f=Tt(f,hr(_e()));var E=lx(c,function(S,A,R){var L=Tt(f,function(G){return G(S)});return{criteria:L,index:++v,value:S}});return $ee(E,function(S,A){return Sne(S,A,m)})}function dne(c,f){return hx(c,f,function(m,v){return V0(c,v)})}function hx(c,f,m){for(var v=-1,E=f.length,S={};++v<E;){var A=f[v],R=Jo(c,A);m(R,A)&&bu(S,Js(A,c),R)}return S}function hne(c){return function(f){return Jo(f,c)}}function d0(c,f,m,v){var E=v?Lee:al,S=-1,A=f.length,R=c;for(c===f&&(f=Xn(f)),m&&(R=Tt(c,hr(m)));++S<A;)for(var L=0,G=f[S],H=m?m(G):G;(L=E(R,H,L,v))>-1;)R!==c&&Ph.call(R,L,1),Ph.call(c,L,1);return c}function px(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;Ji(E)?Ph.call(c,E,1):g0(c,E)}}return c}function h0(c,f){return c+$h(HI()*(f-c+1))}function pne(c,f,m,v){for(var E=-1,S=Ht(Lh((f-c)/(m||1)),0),A=V(S);S--;)A[v?S:++E]=c,c+=m;return A}function p0(c,f){var m="";if(!c||f<1||f>ve)return m;do f%2&&(m+=c),f=$h(f/2),f&&(c+=c);while(f);return m}function qe(c,f){return C0(qx(c,f,tr),c+"")}function mne(c){return YI(bl(c))}function gne(c,f){var m=bl(c);return tp(m,Ko(f,0,m.length))}function bu(c,f,m,v){if(!Nt(c))return c;f=Js(f,c);for(var E=-1,S=f.length,A=S-1,R=c;R!=null&&++E<S;){var L=Si(f[E]),G=m;if(L==="__proto__"||L==="constructor"||L==="prototype")return c;if(E!=A){var H=R[L];G=v?v(H,L,R):n,G===n&&(G=Nt(H)?H:Ji(f[E+1])?[]:{})}mu(R,L,G),R=R[L]}return c}var mx=Vh?function(c,f){return Vh.set(c,f),c}:tr,yne=Fh?function(c,f){return Fh(c,"toString",{configurable:!0,enumerable:!1,value:B0(f),writable:!0})}:tr;function vne(c){return tp(bl(c))}function Br(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 bne(c,f){var m;return Hs(c,function(v,E,S){return m=f(v,E,S),!m}),!!m}function Qh(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&&!mr(A)&&(m?A<=f:A<f)?v=S+1:E=S}return E}return m0(c,f,tr,m)}function m0(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,L=mr(f),G=f===n;E<S;){var H=$h((E+S)/2),K=m(c[H]),re=K!==n,de=K===null,Ee=K===K,Be=mr(K);if(A)var we=v||Ee;else G?we=Ee&&(v||re):R?we=Ee&&re&&(v||!de):L?we=Ee&&re&&!de&&(v||!Be):de||Be?we=!1:we=v?K<=f:K<f;we?E=H+1:S=H}return On(S,$)}function gx(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||!ni(R,L)){var L=R;S[E++]=A===0?0:A}}return S}function yx(c){return typeof c=="number"?c:mr(c)?ht:+c}function pr(c){if(typeof c=="string")return c;if(Pe(c))return Tt(c,pr)+"";if(mr(c))return KI?KI.call(c):"";var f=c+"";return f=="0"&&1/c==-fe?"-0":f}function Ks(c,f,m){var v=-1,E=Oh,S=c.length,A=!0,R=[],L=R;if(m)A=!1,E=qb;else if(S>=i){var G=f?null:xne(c);if(G)return Nh(G);A=!1,E=cu,L=new Ho}else L=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=L.length;re--;)if(L[re]===K)continue e;f&&L.push(K),R.push(H)}else E(L,K,m)||(L!==R&&L.push(K),R.push(H))}return R}function g0(c,f){return f=Js(f,c),c=zx(c,f),c==null||delete c[Si(Ur(f))]}function vx(c,f,m,v){return bu(c,f,m(Jo(c,f)),v)}function Gh(c,f,m,v){for(var E=c.length,S=v?E:-1;(v?S--:++S<E)&&f(c[S],S,c););return m?Br(c,v?0:S,v?S+1:E):Br(c,v?S+1:0,v?E:S)}function bx(c,f){var m=c;return m instanceof Xe&&(m=m.value()),zb(f,function(v,E){return E.func.apply(E.thisArg,zs([v],E.args))},m)}function y0(c,f,m){var v=c.length;if(v<2)return v?Ks(c[0]):[];for(var E=-1,S=V(v);++E<v;)for(var A=c[E],R=-1;++R<v;)R!=E&&(S[E]=gu(S[E]||A,c[R],f,m));return Ks(pn(S,1),f,m)}function _x(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 v0(c){return Ft(c)?c:[]}function b0(c){return typeof c=="function"?c:tr}function Js(c,f){return Pe(c)?c:A0(c,f)?[c]:Kx(at(c))}var _ne=qe;function Ys(c,f,m){var v=c.length;return m=m===n?v:m,!f&&m>=v?c:Br(c,f,m)}var Ex=ate||function(c){return hn.clearTimeout(c)};function wx(c,f){if(f)return c.slice();var m=c.length,v=WI?WI(m):new c.constructor(m);return c.copy(v),v}function _0(c){var f=new c.constructor(c.byteLength);return new Rh(f).set(new Rh(c)),f}function Ene(c,f){var m=f?_0(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.byteLength)}function wne(c){var f=new c.constructor(c.source,rt.exec(c));return f.lastIndex=c.lastIndex,f}function Tne(c){return pu?pt(pu.call(c)):{}}function Tx(c,f){var m=f?_0(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.length)}function Sx(c,f){if(c!==f){var m=c!==n,v=c===null,E=c===c,S=mr(c),A=f!==n,R=f===null,L=f===f,G=mr(f);if(!R&&!G&&!S&&c>f||S&&A&&L&&!R&&!G||v&&A&&L||!m&&L||!E)return 1;if(!v&&!S&&!G&&c<f||G&&m&&E&&!v&&!S||R&&m&&E||!A&&E||!L)return-1}return 0}function Sne(c,f,m){for(var v=-1,E=c.criteria,S=f.criteria,A=E.length,R=m.length;++v<A;){var L=Sx(E[v],S[v]);if(L){if(v>=R)return L;var G=m[v];return L*(G=="desc"?-1:1)}}return c.index-f.index}function Ox(c,f,m,v){for(var E=-1,S=c.length,A=m.length,R=-1,L=f.length,G=Ht(S-A,0),H=V(L+G),K=!v;++R<L;)H[R]=f[R];for(;++E<A;)(K||E<S)&&(H[m[E]]=c[E]);for(;G--;)H[R++]=c[E++];return H}function kx(c,f,m,v){for(var E=-1,S=c.length,A=-1,R=m.length,L=-1,G=f.length,H=Ht(S-R,0),K=V(H+G),re=!v;++E<H;)K[E]=c[E];for(var de=E;++L<G;)K[de+L]=f[L];for(;++A<R;)(re||E<S)&&(K[de+m[A]]=c[E++]);return K}function Xn(c,f){var m=-1,v=c.length;for(f||(f=V(v));++m<v;)f[m]=c[m];return f}function Ti(c,f,m,v){var E=!m;m||(m={});for(var S=-1,A=f.length;++S<A;){var R=f[S],L=v?v(m[R],c[R],R,m,c):n;L===n&&(L=c[R]),E?Gi(m,R,L):mu(m,R,L)}return m}function One(c,f){return Ti(c,N0(c),f)}function kne(c,f){return Ti(c,Vx(c),f)}function Hh(c,f){return function(m,v){var E=Pe(m)?Cee:Hte,S=f?f():{};return E(m,c,_e(v,2),S)}}function ml(c){return qe(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&&jn(m[0],m[1],A)&&(S=E<3?n:S,E=1),f=pt(f);++v<E;){var R=m[v];R&&c(f,R,v,S)}return f})}function Nx(c,f){return function(m,v){if(m==null)return m;if(!Zn(m))return c(m,v);for(var E=m.length,S=f?E:-1,A=pt(m);(f?S--:++S<E)&&v(A[S],S,A)!==!1;);return m}}function Ax(c){return function(f,m,v){for(var E=-1,S=pt(f),A=v(f),R=A.length;R--;){var L=A[c?R:++E];if(m(S[L],L,S)===!1)break}return f}}function Nne(c,f,m){var v=f&_,E=_u(c);function S(){var A=this&&this!==hn&&this instanceof S?E:c;return A.apply(v?m:this,arguments)}return S}function Ix(c){return function(f){f=at(f);var m=ll(f)?ei(f):n,v=m?m[0]:f.charAt(0),E=m?Ys(m,1).join(""):f.slice(1);return v[c]()+E}}function gl(c){return function(f){return zb(NC(kC(f).replace(yee,"")),c,"")}}function _u(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=pl(c.prototype),v=c.apply(m,f);return Nt(v)?v:m}}function Ane(c,f,m){var v=_u(c);function E(){for(var S=arguments.length,A=V(S),R=S,L=yl(E);R--;)A[R]=arguments[R];var G=S<3&&A[0]!==L&&A[S-1]!==L?[]:Qs(A,L);if(S-=G.length,S<m)return Mx(c,f,Kh,E.placeholder,n,A,G,n,n,m-S);var H=this&&this!==hn&&this instanceof E?v:c;return dr(H,this,A)}return E}function xx(c){return function(f,m,v){var E=pt(f);if(!Zn(f)){var S=_e(m,3);f=nn(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 Cx(c){return Ki(function(f){var m=f.length,v=m,E=Vr.prototype.thru;for(c&&f.reverse();v--;){var S=f[v];if(typeof S!="function")throw new $r(o);if(E&&!A&&Zh(S)=="wrapper")var A=new Vr([],!0)}for(v=A?v:m;++v<m;){S=f[v];var R=Zh(S),L=R=="wrapper"?O0(S):n;L&&I0(L[0])&&L[1]==(B|N|P|Q)&&!L[4].length&&L[9]==1?A=A[Zh(L[0])].apply(A,L[3]):A=S.length==1&&I0(S)?A[R]():A.thru(S)}return function(){var G=arguments,H=G[0];if(A&&G.length==1&&Pe(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 Kh(c,f,m,v,E,S,A,R,L,G){var H=f&B,K=f&_,re=f&w,de=f&(N|I),Ee=f&x,Be=re?n:_u(c);function we(){for(var He=arguments.length,Ze=V(He),gr=He;gr--;)Ze[gr]=arguments[gr];if(de)var Bn=yl(we),yr=jee(Ze,Bn);if(v&&(Ze=Ox(Ze,v,E,de)),S&&(Ze=kx(Ze,S,A,de)),He-=yr,de&&He<G){var Lt=Qs(Ze,Bn);return Mx(c,f,Kh,we.placeholder,m,Ze,Lt,R,L,G-He)}var ri=K?m:this,Zi=re?ri[c]:c;return He=Ze.length,R?Ze=Hne(Ze,R):Ee&&He>1&&Ze.reverse(),H&&L<He&&(Ze.length=L),this&&this!==hn&&this instanceof we&&(Zi=Be||_u(Zi)),Zi.apply(ri,Ze)}return we}function Dx(c,f){return function(m,v){return nne(m,c,f(v),{})}}function Jh(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=pr(m),v=pr(v)):(m=yx(m),v=yx(v)),E=c(m,v)}return E}}function E0(c){return Ki(function(f){return f=Tt(f,hr(_e())),qe(function(m){var v=this;return c(f,function(E){return dr(E,v,m)})})})}function Yh(c,f){f=f===n?" ":pr(f);var m=f.length;if(m<2)return m?p0(f,c):f;var v=p0(f,Lh(c/cl(f)));return ll(f)?Ys(ei(v),0,c).join(""):v.slice(0,c)}function Ine(c,f,m,v){var E=f&_,S=_u(c);function A(){for(var R=-1,L=arguments.length,G=-1,H=v.length,K=V(H+L),re=this&&this!==hn&&this instanceof A?S:c;++G<H;)K[G]=v[G];for(;L--;)K[G++]=arguments[++R];return dr(re,E?m:this,K)}return A}function Rx(c){return function(f,m,v){return v&&typeof v!="number"&&jn(f,m,v)&&(m=v=n),f=Xi(f),m===n?(m=f,f=0):m=Xi(m),v=v===n?f<m?1:-1:Xi(v),pne(f,m,v,c)}}function Xh(c){return function(f,m){return typeof f=="string"&&typeof m=="string"||(f=Wr(f),m=Wr(m)),c(f,m)}}function Mx(c,f,m,v,E,S,A,R,L,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 Be=[c,f,E,de,K,Ee,re,R,L,G],we=m.apply(n,Be);return I0(c)&&Qx(we,Be),we.placeholder=v,Gx(we,c,f)}function w0(c){var f=Gt[c];return function(m,v){if(m=Wr(m),v=v==null?0:On($e(v),292),v&&GI(m)){var E=(at(m)+"e").split("e"),S=f(E[0]+"e"+(+E[1]+v));return E=(at(S)+"e").split("e"),+(E[0]+"e"+(+E[1]-v))}return f(m)}}var xne=dl&&1/Nh(new dl([,-0]))[1]==fe?function(c){return new dl(c)}:q0;function Px(c){return function(f){var m=kn(f);return m==ur?Xb(f):m==fr?Gee(f):Vee(f,c(f))}}function Hi(c,f,m,v,E,S,A,R){var L=f&w;if(!L&&typeof c!="function")throw new $r(o);var G=v?v.length:0;if(G||(f&=~(P|M),v=E=n),A=A===n?A:Ht($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=L?n:O0(c),de=[c,f,m,v,E,H,K,S,A,R];if(re&&zne(de,re),c=de[0],f=de[1],m=de[2],v=de[3],E=de[4],R=de[9]=de[9]===n?L?0:c.length:Ht(de[9]-G,0),!R&&f&(N|I)&&(f&=~(N|I)),!f||f==_)var Ee=Nne(c,f,m);else f==N||f==I?Ee=Ane(c,f,R):(f==P||f==(_|P))&&!E.length?Ee=Ine(c,f,m,v):Ee=Kh.apply(n,de);var Be=re?mx:Qx;return Gx(Be(Ee,de),c,f)}function Fx(c,f,m,v){return c===n||ni(c,fl[m])&&!ut.call(v,m)?f:c}function Lx(c,f,m,v,E,S){return Nt(c)&&Nt(f)&&(S.set(f,c),zh(c,f,n,Lx,S),S.delete(f)),c}function Cne(c){return Tu(c)?n:c}function $x(c,f,m,v,E,S){var A=m&y,R=c.length,L=f.length;if(R!=L&&!(A&&L>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 Ho:n;for(S.set(c,f),S.set(f,c);++K<R;){var Ee=c[K],Be=f[K];if(v)var we=A?v(Be,Ee,K,f,c,S):v(Ee,Be,K,c,f,S);if(we!==n){if(we)continue;re=!1;break}if(de){if(!Qb(f,function(He,Ze){if(!cu(de,Ze)&&(Ee===He||E(Ee,He,m,v,S)))return de.push(Ze)})){re=!1;break}}else if(!(Ee===Be||E(Ee,Be,m,v,S))){re=!1;break}}return S.delete(c),S.delete(f),re}function Dne(c,f,m,v,E,S,A){switch(m){case Us:if(c.byteLength!=f.byteLength||c.byteOffset!=f.byteOffset)return!1;c=c.buffer,f=f.buffer;case Zr:return!(c.byteLength!=f.byteLength||!S(new Rh(c),new Rh(f)));case Je:case tn:case Ei:return ni(+c,+f);case _i:return c.name==f.name&&c.message==f.message;case Wo:case Wi:return c==f+"";case ur:var R=Xb;case fr:var L=v&y;if(R||(R=Nh),c.size!=f.size&&!L)return!1;var G=A.get(c);if(G)return G==f;v|=b,A.set(c,f);var H=$x(R(c),R(f),v,E,S,A);return A.delete(c),H;case tl:if(pu)return pu.call(c)==pu.call(f)}return!1}function Rne(c,f,m,v,E,S){var A=m&y,R=T0(c),L=R.length,G=T0(f),H=G.length;if(L!=H&&!A)return!1;for(var K=L;K--;){var re=R[K];if(!(A?re in f:ut.call(f,re)))return!1}var de=S.get(c),Ee=S.get(f);if(de&&Ee)return de==f&&Ee==c;var Be=!0;S.set(c,f),S.set(f,c);for(var we=A;++K<L;){re=R[K];var He=c[re],Ze=f[re];if(v)var gr=A?v(Ze,He,re,f,c,S):v(He,Ze,re,c,f,S);if(!(gr===n?He===Ze||E(He,Ze,m,v,S):gr)){Be=!1;break}we||(we=re=="constructor")}if(Be&&!we){var Bn=c.constructor,yr=f.constructor;Bn!=yr&&"constructor"in c&&"constructor"in f&&!(typeof Bn=="function"&&Bn instanceof Bn&&typeof yr=="function"&&yr instanceof yr)&&(Be=!1)}return S.delete(c),S.delete(f),Be}function Ki(c){return C0(qx(c,n,Zx),c+"")}function T0(c){return ix(c,nn,N0)}function S0(c){return ix(c,er,Vx)}var O0=Vh?function(c){return Vh.get(c)}:q0;function Zh(c){for(var f=c.name+"",m=hl[f],v=ut.call(hl,f)?m.length:0;v--;){var E=m[v],S=E.func;if(S==null||S==c)return E.name}return f}function yl(c){var f=ut.call(T,"placeholder")?T:c;return f.placeholder}function _e(){var c=T.iteratee||U0;return c=c===U0?ax:c,arguments.length?c(arguments[0],arguments[1]):c}function ep(c,f){var m=c.__data__;return Bne(f)?m[typeof f=="string"?"string":"hash"]:m.map}function k0(c){for(var f=nn(c),m=f.length;m--;){var v=f[m],E=c[v];f[m]=[v,E,Ux(E)]}return f}function Yo(c,f){var m=qee(c,f);return ox(m)?m:n}function Mne(c){var f=ut.call(c,Qo),m=c[Qo];try{c[Qo]=n;var v=!0}catch{}var E=Ch.call(c);return v&&(f?c[Qo]=m:delete c[Qo]),E}var N0=e0?function(c){return c==null?[]:(c=pt(c),qs(e0(c),function(f){return zI.call(c,f)}))}:z0,Vx=e0?function(c){for(var f=[];c;)zs(f,N0(c)),c=Mh(c);return f}:z0,kn=Vn;(t0&&kn(new t0(new ArrayBuffer(1)))!=Us||fu&&kn(new fu)!=ur||n0&&kn(n0.resolve())!=Xc||dl&&kn(new dl)!=fr||du&&kn(new du)!=Bs)&&(kn=function(c){var f=Vn(c),m=f==Mr?c.constructor:n,v=m?Xo(m):"";if(v)switch(v){case gte:return Us;case yte:return ur;case vte:return Xc;case bte:return fr;case _te:return Bs}return f});function Pne(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=On(f,c+A);break;case"takeRight":c=Ht(c,f-A);break}}return{start:c,end:f}}function Fne(c){var f=c.match(Mb);return f?f[1].split(Pb):[]}function jx(c,f,m){f=Js(f,c);for(var v=-1,E=f.length,S=!1;++v<E;){var A=Si(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&&ap(E)&&Ji(A,E)&&(Pe(c)||Zo(c)))}function Lne(c){var f=c.length,m=new c.constructor(f);return f&&typeof c[0]=="string"&&ut.call(c,"index")&&(m.index=c.index,m.input=c.input),m}function Bx(c){return typeof c.constructor=="function"&&!Eu(c)?pl(Mh(c)):{}}function $ne(c,f,m){var v=c.constructor;switch(f){case Zr:return _0(c);case Je:case tn:return new v(+c);case Us:return Ene(c,m);case nl:case rl:case qo:case Zc:case eu:case tu:case nu:case ru:case iu:return Tx(c,m);case ur:return new v;case Ei:case Wi:return new v(c);case Wo:return wne(c);case fr:return new v;case tl:return Tne(c)}}function Vne(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(Rb,`{
233
+ /* [wrapped with `+f+`] */
234
+ `)}function jne(c){return Pe(c)||Zo(c)||!!(QI&&c&&c[QI])}function Ji(c,f){var m=typeof c;return f=f??ve,!!f&&(m=="number"||m!="symbol"&&kt.test(c))&&c>-1&&c%1==0&&c<f}function jn(c,f,m){if(!Nt(m))return!1;var v=typeof f;return(v=="number"?Zn(m)&&Ji(f,m.length):v=="string"&&f in m)?ni(m[f],c):!1}function A0(c,f){if(Pe(c))return!1;var m=typeof c;return m=="number"||m=="symbol"||m=="boolean"||c==null||mr(c)?!0:Eh.test(c)||!_h.test(c)||f!=null&&c in pt(f)}function Bne(c){var f=typeof c;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?c!=="__proto__":c===null}function I0(c){var f=Zh(c),m=T[f];if(typeof m!="function"||!(f in Xe.prototype))return!1;if(c===m)return!0;var v=O0(m);return!!v&&c===v[0]}function Une(c){return!!UI&&UI in c}var Wne=Ih?Yi:Q0;function Eu(c){var f=c&&c.constructor,m=typeof f=="function"&&f.prototype||fl;return c===m}function Ux(c){return c===c&&!Nt(c)}function Wx(c,f){return function(m){return m==null?!1:m[c]===f&&(f!==n||c in pt(m))}}function qne(c){var f=sp(c,function(v){return m.size===u&&m.clear(),v}),m=f.cache;return f}function zne(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 L=c[3];c[3]=L?Ox(L,R,f[4]):R,c[4]=L?Qs(c[3],d):f[4]}return R=f[5],R&&(L=c[5],c[5]=L?kx(L,R,f[6]):R,c[6]=L?Qs(c[5],d):f[6]),R=f[7],R&&(c[7]=R),v&B&&(c[8]=c[8]==null?f[8]:On(c[8],f[8])),c[9]==null&&(c[9]=f[9]),c[0]=f[0],c[1]=E,c}function Qne(c){var f=[];if(c!=null)for(var m in pt(c))f.push(m);return f}function Gne(c){return Ch.call(c)}function qx(c,f,m){return f=Ht(f===n?c.length-1:f,0),function(){for(var v=arguments,E=-1,S=Ht(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),dr(c,this,R)}}function zx(c,f){return f.length<2?c:Jo(c,Br(f,0,-1))}function Hne(c,f){for(var m=c.length,v=On(f.length,m),E=Xn(c);v--;){var S=f[v];c[v]=Ji(S,m)?E[S]:n}return c}function x0(c,f){if(!(f==="constructor"&&typeof c[f]=="function")&&f!="__proto__")return c[f]}var Qx=Hx(mx),wu=cte||function(c,f){return hn.setTimeout(c,f)},C0=Hx(yne);function Gx(c,f,m){var v=f+"";return C0(c,Vne(v,Kne(Fne(v),m)))}function Hx(c){var f=0,m=0;return function(){var v=hte(),E=pe-(v-m);if(m=v,E>0){if(++f>=ke)return arguments[0]}else f=0;return c.apply(n,arguments)}}function tp(c,f){var m=-1,v=c.length,E=v-1;for(f=f===n?v:f;++m<f;){var S=h0(m,E),A=c[S];c[S]=c[m],c[m]=A}return c.length=f,c}var Kx=qne(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(Cb,function(m,v,E,S){f.push(E?S.replace(ie,"$1"):v||m)}),f});function Si(c){if(typeof c=="string"||mr(c))return c;var f=c+"";return f=="0"&&1/c==-fe?"-0":f}function Xo(c){if(c!=null){try{return xh.call(c)}catch{}try{return c+""}catch{}}return""}function Kne(c,f){return Lr(Z,function(m){var v="_."+m[0];f&m[1]&&!Oh(c,v)&&c.push(v)}),c.sort()}function Jx(c){if(c instanceof Xe)return c.clone();var f=new Vr(c.__wrapped__,c.__chain__);return f.__actions__=Xn(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}function Jne(c,f,m){(m?jn(c,f,m):f===n)?f=1:f=Ht($e(f),0);var v=c==null?0:c.length;if(!v||f<1)return[];for(var E=0,S=0,A=V(Lh(v/f));E<v;)A[S++]=Br(c,E,E+=f);return A}function Yne(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 Xne(){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 zs(Pe(m)?Xn(m):[m],pn(f,1))}var Zne=qe(function(c,f){return Ft(c)?gu(c,pn(f,1,Ft,!0)):[]}),ere=qe(function(c,f){var m=Ur(f);return Ft(m)&&(m=n),Ft(c)?gu(c,pn(f,1,Ft,!0),_e(m,2)):[]}),tre=qe(function(c,f){var m=Ur(f);return Ft(m)&&(m=n),Ft(c)?gu(c,pn(f,1,Ft,!0),n,m):[]});function nre(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:$e(f),Br(c,f<0?0:f,v)):[]}function rre(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:$e(f),f=v-f,Br(c,0,f<0?0:f)):[]}function ire(c,f){return c&&c.length?Gh(c,_e(f,3),!0,!0):[]}function sre(c,f){return c&&c.length?Gh(c,_e(f,3),!0):[]}function ore(c,f,m,v){var E=c==null?0:c.length;return E?(m&&typeof m!="number"&&jn(c,f,m)&&(m=0,v=E),Xte(c,f,m,v)):[]}function Yx(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=Ht(v+E,0)),kh(c,_e(f,3),E)}function Xx(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?Ht(v+E,0):On(E,v-1)),kh(c,_e(f,3),E,!0)}function Zx(c){var f=c==null?0:c.length;return f?pn(c,1):[]}function are(c){var f=c==null?0:c.length;return f?pn(c,fe):[]}function lre(c,f){var m=c==null?0:c.length;return m?(f=f===n?1:$e(f),pn(c,f)):[]}function cre(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 eC(c){return c&&c.length?c[0]:n}function ure(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=Ht(v+E,0)),al(c,f,E)}function fre(c){var f=c==null?0:c.length;return f?Br(c,0,-1):[]}var dre=qe(function(c){var f=Tt(c,v0);return f.length&&f[0]===c[0]?l0(f):[]}),hre=qe(function(c){var f=Ur(c),m=Tt(c,v0);return f===Ur(m)?f=n:m.pop(),m.length&&m[0]===c[0]?l0(m,_e(f,2)):[]}),pre=qe(function(c){var f=Ur(c),m=Tt(c,v0);return f=typeof f=="function"?f:n,f&&m.pop(),m.length&&m[0]===c[0]?l0(m,n,f):[]});function mre(c,f){return c==null?"":fte.call(c,f)}function Ur(c){var f=c==null?0:c.length;return f?c[f-1]:n}function gre(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?Ht(v+E,0):On(E,v-1)),f===f?Kee(c,f,E):kh(c,MI,E,!0)}function yre(c,f){return c&&c.length?fx(c,$e(f)):n}var vre=qe(tC);function tC(c,f){return c&&c.length&&f&&f.length?d0(c,f):c}function bre(c,f,m){return c&&c.length&&f&&f.length?d0(c,f,_e(m,2)):c}function _re(c,f,m){return c&&c.length&&f&&f.length?d0(c,f,n,m):c}var Ere=Ki(function(c,f){var m=c==null?0:c.length,v=i0(c,f);return px(c,Tt(f,function(E){return Ji(E,m)?+E:E}).sort(Sx)),v});function wre(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 px(c,E),m}function D0(c){return c==null?c:mte.call(c)}function Tre(c,f,m){var v=c==null?0:c.length;return v?(m&&typeof m!="number"&&jn(c,f,m)?(f=0,m=v):(f=f==null?0:$e(f),m=m===n?v:$e(m)),Br(c,f,m)):[]}function Sre(c,f){return Qh(c,f)}function Ore(c,f,m){return m0(c,f,_e(m,2))}function kre(c,f){var m=c==null?0:c.length;if(m){var v=Qh(c,f);if(v<m&&ni(c[v],f))return v}return-1}function Nre(c,f){return Qh(c,f,!0)}function Are(c,f,m){return m0(c,f,_e(m,2),!0)}function Ire(c,f){var m=c==null?0:c.length;if(m){var v=Qh(c,f,!0)-1;if(ni(c[v],f))return v}return-1}function xre(c){return c&&c.length?gx(c):[]}function Cre(c,f){return c&&c.length?gx(c,_e(f,2)):[]}function Dre(c){var f=c==null?0:c.length;return f?Br(c,1,f):[]}function Rre(c,f,m){return c&&c.length?(f=m||f===n?1:$e(f),Br(c,0,f<0?0:f)):[]}function Mre(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:$e(f),f=v-f,Br(c,f<0?0:f,v)):[]}function Pre(c,f){return c&&c.length?Gh(c,_e(f,3),!1,!0):[]}function Fre(c,f){return c&&c.length?Gh(c,_e(f,3)):[]}var Lre=qe(function(c){return Ks(pn(c,1,Ft,!0))}),$re=qe(function(c){var f=Ur(c);return Ft(f)&&(f=n),Ks(pn(c,1,Ft,!0),_e(f,2))}),Vre=qe(function(c){var f=Ur(c);return f=typeof f=="function"?f:n,Ks(pn(c,1,Ft,!0),n,f)});function jre(c){return c&&c.length?Ks(c):[]}function Bre(c,f){return c&&c.length?Ks(c,_e(f,2)):[]}function Ure(c,f){return f=typeof f=="function"?f:n,c&&c.length?Ks(c,n,f):[]}function R0(c){if(!(c&&c.length))return[];var f=0;return c=qs(c,function(m){if(Ft(m))return f=Ht(m.length,f),!0}),Jb(f,function(m){return Tt(c,Gb(m))})}function nC(c,f){if(!(c&&c.length))return[];var m=R0(c);return f==null?m:Tt(m,function(v){return dr(f,n,v)})}var Wre=qe(function(c,f){return Ft(c)?gu(c,f):[]}),qre=qe(function(c){return y0(qs(c,Ft))}),zre=qe(function(c){var f=Ur(c);return Ft(f)&&(f=n),y0(qs(c,Ft),_e(f,2))}),Qre=qe(function(c){var f=Ur(c);return f=typeof f=="function"?f:n,y0(qs(c,Ft),n,f)}),Gre=qe(R0);function Hre(c,f){return _x(c||[],f||[],mu)}function Kre(c,f){return _x(c||[],f||[],bu)}var Jre=qe(function(c){var f=c.length,m=f>1?c[f-1]:n;return m=typeof m=="function"?(c.pop(),m):n,nC(c,m)});function rC(c){var f=T(c);return f.__chain__=!0,f}function Yre(c,f){return f(c),c}function np(c,f){return f(c)}var Xre=Ki(function(c){var f=c.length,m=f?c[0]:0,v=this.__wrapped__,E=function(S){return i0(S,c)};return f>1||this.__actions__.length||!(v instanceof Xe)||!Ji(m)?this.thru(E):(v=v.slice(m,+m+(f?1:0)),v.__actions__.push({func:np,args:[E],thisArg:n}),new Vr(v,this.__chain__).thru(function(S){return f&&!S.length&&S.push(n),S}))});function Zre(){return rC(this)}function eie(){return new Vr(this.value(),this.__chain__)}function tie(){this.__values__===n&&(this.__values__=yC(this.value()));var c=this.__index__>=this.__values__.length,f=c?n:this.__values__[this.__index__++];return{done:c,value:f}}function nie(){return this}function rie(c){for(var f,m=this;m instanceof Bh;){var v=Jx(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 iie(){var c=this.__wrapped__;if(c instanceof Xe){var f=c;return this.__actions__.length&&(f=new Xe(this)),f=f.reverse(),f.__actions__.push({func:np,args:[D0],thisArg:n}),new Vr(f,this.__chain__)}return this.thru(D0)}function sie(){return bx(this.__wrapped__,this.__actions__)}var oie=Hh(function(c,f,m){ut.call(c,m)?++c[m]:Gi(c,m,1)});function aie(c,f,m){var v=Pe(c)?DI:Yte;return m&&jn(c,f,m)&&(f=n),v(c,_e(f,3))}function lie(c,f){var m=Pe(c)?qs:nx;return m(c,_e(f,3))}var cie=xx(Yx),uie=xx(Xx);function fie(c,f){return pn(rp(c,f),1)}function die(c,f){return pn(rp(c,f),fe)}function hie(c,f,m){return m=m===n?1:$e(m),pn(rp(c,f),m)}function iC(c,f){var m=Pe(c)?Lr:Hs;return m(c,_e(f,3))}function sC(c,f){var m=Pe(c)?Dee:tx;return m(c,_e(f,3))}var pie=Hh(function(c,f,m){ut.call(c,m)?c[m].push(f):Gi(c,m,[f])});function mie(c,f,m,v){c=Zn(c)?c:bl(c),m=m&&!v?$e(m):0;var E=c.length;return m<0&&(m=Ht(E+m,0)),lp(c)?m<=E&&c.indexOf(f,m)>-1:!!E&&al(c,f,m)>-1}var gie=qe(function(c,f,m){var v=-1,E=typeof f=="function",S=Zn(c)?V(c.length):[];return Hs(c,function(A){S[++v]=E?dr(f,A,m):yu(A,f,m)}),S}),yie=Hh(function(c,f,m){Gi(c,m,f)});function rp(c,f){var m=Pe(c)?Tt:lx;return m(c,_e(f,3))}function vie(c,f,m,v){return c==null?[]:(Pe(f)||(f=f==null?[]:[f]),m=v?n:m,Pe(m)||(m=m==null?[]:[m]),dx(c,f,m))}var bie=Hh(function(c,f,m){c[m?0:1].push(f)},function(){return[[],[]]});function _ie(c,f,m){var v=Pe(c)?zb:FI,E=arguments.length<3;return v(c,_e(f,4),m,E,Hs)}function Eie(c,f,m){var v=Pe(c)?Ree:FI,E=arguments.length<3;return v(c,_e(f,4),m,E,tx)}function wie(c,f){var m=Pe(c)?qs:nx;return m(c,op(_e(f,3)))}function Tie(c){var f=Pe(c)?YI:mne;return f(c)}function Sie(c,f,m){(m?jn(c,f,m):f===n)?f=1:f=$e(f);var v=Pe(c)?Qte:gne;return v(c,f)}function Oie(c){var f=Pe(c)?Gte:vne;return f(c)}function kie(c){if(c==null)return 0;if(Zn(c))return lp(c)?cl(c):c.length;var f=kn(c);return f==ur||f==fr?c.size:u0(c).length}function Nie(c,f,m){var v=Pe(c)?Qb:bne;return m&&jn(c,f,m)&&(f=n),v(c,_e(f,3))}var Aie=qe(function(c,f){if(c==null)return[];var m=f.length;return m>1&&jn(c,f[0],f[1])?f=[]:m>2&&jn(f[0],f[1],f[2])&&(f=[f[0]]),dx(c,pn(f,1),[])}),ip=lte||function(){return hn.Date.now()};function Iie(c,f){if(typeof f!="function")throw new $r(o);return c=$e(c),function(){if(--c<1)return f.apply(this,arguments)}}function oC(c,f,m){return f=m?n:f,f=c&&f==null?c.length:f,Hi(c,B,n,n,n,n,f)}function aC(c,f){var m;if(typeof f!="function")throw new $r(o);return c=$e(c),function(){return--c>0&&(m=f.apply(this,arguments)),c<=1&&(f=n),m}}var M0=qe(function(c,f,m){var v=_;if(m.length){var E=Qs(m,yl(M0));v|=P}return Hi(c,v,f,m,E)}),lC=qe(function(c,f,m){var v=_|w;if(m.length){var E=Qs(m,yl(lC));v|=P}return Hi(f,v,c,m,E)});function cC(c,f,m){f=m?n:f;var v=Hi(c,N,n,n,n,n,n,f);return v.placeholder=cC.placeholder,v}function uC(c,f,m){f=m?n:f;var v=Hi(c,I,n,n,n,n,n,f);return v.placeholder=uC.placeholder,v}function fC(c,f,m){var v,E,S,A,R,L,G=0,H=!1,K=!1,re=!0;if(typeof c!="function")throw new $r(o);f=Wr(f)||0,Nt(m)&&(H=!!m.leading,K="maxWait"in m,S=K?Ht(Wr(m.maxWait)||0,f):S,re="trailing"in m?!!m.trailing:re);function de(Lt){var ri=v,Zi=E;return v=E=n,G=Lt,A=c.apply(Zi,ri),A}function Ee(Lt){return G=Lt,R=wu(He,f),H?de(Lt):A}function Be(Lt){var ri=Lt-L,Zi=Lt-G,xC=f-ri;return K?On(xC,S-Zi):xC}function we(Lt){var ri=Lt-L,Zi=Lt-G;return L===n||ri>=f||ri<0||K&&Zi>=S}function He(){var Lt=ip();if(we(Lt))return Ze(Lt);R=wu(He,Be(Lt))}function Ze(Lt){return R=n,re&&v?de(Lt):(v=E=n,A)}function gr(){R!==n&&Ex(R),G=0,v=L=E=R=n}function Bn(){return R===n?A:Ze(ip())}function yr(){var Lt=ip(),ri=we(Lt);if(v=arguments,E=this,L=Lt,ri){if(R===n)return Ee(L);if(K)return Ex(R),R=wu(He,f),de(L)}return R===n&&(R=wu(He,f)),A}return yr.cancel=gr,yr.flush=Bn,yr}var xie=qe(function(c,f){return ex(c,1,f)}),Cie=qe(function(c,f,m){return ex(c,Wr(f)||0,m)});function Die(c){return Hi(c,x)}function sp(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new $r(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(sp.Cache||Qi),m}sp.Cache=Qi;function op(c){if(typeof c!="function")throw new $r(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 Rie(c){return aC(2,c)}var Mie=_ne(function(c,f){f=f.length==1&&Pe(f[0])?Tt(f[0],hr(_e())):Tt(pn(f,1),hr(_e()));var m=f.length;return qe(function(v){for(var E=-1,S=On(v.length,m);++E<S;)v[E]=f[E].call(this,v[E]);return dr(c,this,v)})}),P0=qe(function(c,f){var m=Qs(f,yl(P0));return Hi(c,P,n,f,m)}),dC=qe(function(c,f){var m=Qs(f,yl(dC));return Hi(c,M,n,f,m)}),Pie=Ki(function(c,f){return Hi(c,Q,n,n,n,f)});function Fie(c,f){if(typeof c!="function")throw new $r(o);return f=f===n?f:$e(f),qe(c,f)}function Lie(c,f){if(typeof c!="function")throw new $r(o);return f=f==null?0:Ht($e(f),0),qe(function(m){var v=m[f],E=Ys(m,0,f);return v&&zs(E,v),dr(c,this,E)})}function $ie(c,f,m){var v=!0,E=!0;if(typeof c!="function")throw new $r(o);return Nt(m)&&(v="leading"in m?!!m.leading:v,E="trailing"in m?!!m.trailing:E),fC(c,f,{leading:v,maxWait:f,trailing:E})}function Vie(c){return oC(c,1)}function jie(c,f){return P0(b0(f),c)}function Bie(){if(!arguments.length)return[];var c=arguments[0];return Pe(c)?c:[c]}function Uie(c){return jr(c,g)}function Wie(c,f){return f=typeof f=="function"?f:n,jr(c,g,f)}function qie(c){return jr(c,h|g)}function zie(c,f){return f=typeof f=="function"?f:n,jr(c,h|g,f)}function Qie(c,f){return f==null||ZI(c,f,nn(f))}function ni(c,f){return c===f||c!==c&&f!==f}var Gie=Xh(a0),Hie=Xh(function(c,f){return c>=f}),Zo=sx(function(){return arguments}())?sx:function(c){return Dt(c)&&ut.call(c,"callee")&&!zI.call(c,"callee")},Pe=V.isArray,Kie=kI?hr(kI):rne;function Zn(c){return c!=null&&ap(c.length)&&!Yi(c)}function Ft(c){return Dt(c)&&Zn(c)}function Jie(c){return c===!0||c===!1||Dt(c)&&Vn(c)==Je}var Xs=ute||Q0,Yie=NI?hr(NI):ine;function Xie(c){return Dt(c)&&c.nodeType===1&&!Tu(c)}function Zie(c){if(c==null)return!0;if(Zn(c)&&(Pe(c)||typeof c=="string"||typeof c.splice=="function"||Xs(c)||vl(c)||Zo(c)))return!c.length;var f=kn(c);if(f==ur||f==fr)return!c.size;if(Eu(c))return!u0(c).length;for(var m in c)if(ut.call(c,m))return!1;return!0}function ese(c,f){return vu(c,f)}function tse(c,f,m){m=typeof m=="function"?m:n;var v=m?m(c,f):n;return v===n?vu(c,f,n,m):!!v}function F0(c){if(!Dt(c))return!1;var f=Vn(c);return f==_i||f==bi||typeof c.message=="string"&&typeof c.name=="string"&&!Tu(c)}function nse(c){return typeof c=="number"&&GI(c)}function Yi(c){if(!Nt(c))return!1;var f=Vn(c);return f==Qt||f==ph||f==Me||f==el}function hC(c){return typeof c=="number"&&c==$e(c)}function ap(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=ve}function Nt(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function Dt(c){return c!=null&&typeof c=="object"}var pC=AI?hr(AI):one;function rse(c,f){return c===f||c0(c,f,k0(f))}function ise(c,f,m){return m=typeof m=="function"?m:n,c0(c,f,k0(f),m)}function sse(c){return mC(c)&&c!=+c}function ose(c){if(Wne(c))throw new De(s);return ox(c)}function ase(c){return c===null}function lse(c){return c==null}function mC(c){return typeof c=="number"||Dt(c)&&Vn(c)==Ei}function Tu(c){if(!Dt(c)||Vn(c)!=Mr)return!1;var f=Mh(c);if(f===null)return!0;var m=ut.call(f,"constructor")&&f.constructor;return typeof m=="function"&&m instanceof m&&xh.call(m)==ite}var L0=II?hr(II):ane;function cse(c){return hC(c)&&c>=-ve&&c<=ve}var gC=xI?hr(xI):lne;function lp(c){return typeof c=="string"||!Pe(c)&&Dt(c)&&Vn(c)==Wi}function mr(c){return typeof c=="symbol"||Dt(c)&&Vn(c)==tl}var vl=CI?hr(CI):cne;function use(c){return c===n}function fse(c){return Dt(c)&&kn(c)==Bs}function dse(c){return Dt(c)&&Vn(c)==mh}var hse=Xh(f0),pse=Xh(function(c,f){return c<=f});function yC(c){if(!c)return[];if(Zn(c))return lp(c)?ei(c):Xn(c);if(uu&&c[uu])return Qee(c[uu]());var f=kn(c),m=f==ur?Xb:f==fr?Nh:bl;return m(c)}function Xi(c){if(!c)return c===0?c:0;if(c=Wr(c),c===fe||c===-fe){var f=c<0?-1:1;return f*Se}return c===c?c:0}function $e(c){var f=Xi(c),m=f%1;return f===f?m?f-m:f:0}function vC(c){return c?Ko($e(c),0,Ne):0}function Wr(c){if(typeof c=="number")return c;if(mr(c))return ht;if(Nt(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=Nt(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=LI(c);var m=Ye.test(c);return m||fn.test(c)?Iee(c.slice(2),m?2:8):ct.test(c)?ht:+c}function bC(c){return Ti(c,er(c))}function mse(c){return c?Ko($e(c),-ve,ve):c===0?c:0}function at(c){return c==null?"":pr(c)}var gse=ml(function(c,f){if(Eu(f)||Zn(f)){Ti(f,nn(f),c);return}for(var m in f)ut.call(f,m)&&mu(c,m,f[m])}),_C=ml(function(c,f){Ti(f,er(f),c)}),cp=ml(function(c,f,m,v){Ti(f,er(f),c,v)}),yse=ml(function(c,f,m,v){Ti(f,nn(f),c,v)}),vse=Ki(i0);function bse(c,f){var m=pl(c);return f==null?m:XI(m,f)}var _se=qe(function(c,f){c=pt(c);var m=-1,v=f.length,E=v>2?f[2]:n;for(E&&jn(f[0],f[1],E)&&(v=1);++m<v;)for(var S=f[m],A=er(S),R=-1,L=A.length;++R<L;){var G=A[R],H=c[G];(H===n||ni(H,fl[G])&&!ut.call(c,G))&&(c[G]=S[G])}return c}),Ese=qe(function(c){return c.push(n,Lx),dr(EC,n,c)});function wse(c,f){return RI(c,_e(f,3),wi)}function Tse(c,f){return RI(c,_e(f,3),o0)}function Sse(c,f){return c==null?c:s0(c,_e(f,3),er)}function Ose(c,f){return c==null?c:rx(c,_e(f,3),er)}function kse(c,f){return c&&wi(c,_e(f,3))}function Nse(c,f){return c&&o0(c,_e(f,3))}function Ase(c){return c==null?[]:qh(c,nn(c))}function Ise(c){return c==null?[]:qh(c,er(c))}function $0(c,f,m){var v=c==null?n:Jo(c,f);return v===n?m:v}function xse(c,f){return c!=null&&jx(c,f,Zte)}function V0(c,f){return c!=null&&jx(c,f,ene)}var Cse=Dx(function(c,f,m){f!=null&&typeof f.toString!="function"&&(f=Ch.call(f)),c[f]=m},B0(tr)),Dse=Dx(function(c,f,m){f!=null&&typeof f.toString!="function"&&(f=Ch.call(f)),ut.call(c,f)?c[f].push(m):c[f]=[m]},_e),Rse=qe(yu);function nn(c){return Zn(c)?JI(c):u0(c)}function er(c){return Zn(c)?JI(c,!0):une(c)}function Mse(c,f){var m={};return f=_e(f,3),wi(c,function(v,E,S){Gi(m,f(v,E,S),v)}),m}function Pse(c,f){var m={};return f=_e(f,3),wi(c,function(v,E,S){Gi(m,E,f(v,E,S))}),m}var Fse=ml(function(c,f,m){zh(c,f,m)}),EC=ml(function(c,f,m,v){zh(c,f,m,v)}),Lse=Ki(function(c,f){var m={};if(c==null)return m;var v=!1;f=Tt(f,function(S){return S=Js(S,c),v||(v=S.length>1),S}),Ti(c,S0(c),m),v&&(m=jr(m,h|p|g,Cne));for(var E=f.length;E--;)g0(m,f[E]);return m});function $se(c,f){return wC(c,op(_e(f)))}var Vse=Ki(function(c,f){return c==null?{}:dne(c,f)});function wC(c,f){if(c==null)return{};var m=Tt(S0(c),function(v){return[v]});return f=_e(f),hx(c,m,function(v,E){return f(v,E[0])})}function jse(c,f,m){f=Js(f,c);var v=-1,E=f.length;for(E||(E=1,c=n);++v<E;){var S=c==null?n:c[Si(f[v])];S===n&&(v=E,S=m),c=Yi(S)?S.call(c):S}return c}function Bse(c,f,m){return c==null?c:bu(c,f,m)}function Use(c,f,m,v){return v=typeof v=="function"?v:n,c==null?c:bu(c,f,m,v)}var TC=Px(nn),SC=Px(er);function Wse(c,f,m){var v=Pe(c),E=v||Xs(c)||vl(c);if(f=_e(f,4),m==null){var S=c&&c.constructor;E?m=v?new S:[]:Nt(c)?m=Yi(S)?pl(Mh(c)):{}:m={}}return(E?Lr:wi)(c,function(A,R,L){return f(m,A,R,L)}),m}function qse(c,f){return c==null?!0:g0(c,f)}function zse(c,f,m){return c==null?c:vx(c,f,b0(m))}function Qse(c,f,m,v){return v=typeof v=="function"?v:n,c==null?c:vx(c,f,b0(m),v)}function bl(c){return c==null?[]:Yb(c,nn(c))}function Gse(c){return c==null?[]:Yb(c,er(c))}function Hse(c,f,m){return m===n&&(m=f,f=n),m!==n&&(m=Wr(m),m=m===m?m:0),f!==n&&(f=Wr(f),f=f===f?f:0),Ko(Wr(c),f,m)}function Kse(c,f,m){return f=Xi(f),m===n?(m=f,f=0):m=Xi(m),c=Wr(c),tne(c,f,m)}function Jse(c,f,m){if(m&&typeof m!="boolean"&&jn(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=Xi(c),f===n?(f=c,c=0):f=Xi(f)),c>f){var v=c;c=f,f=v}if(m||c%1||f%1){var E=HI();return On(c+E*(f-c+Aee("1e-"+((E+"").length-1))),f)}return h0(c,f)}var Yse=gl(function(c,f,m){return f=f.toLowerCase(),c+(m?OC(f):f)});function OC(c){return j0(at(c).toLowerCase())}function kC(c){return c=at(c),c&&c.replace(Ct,Bee).replace(vee,"")}function Xse(c,f,m){c=at(c),f=pr(f);var v=c.length;m=m===n?v:Ko($e(m),0,v);var E=m;return m-=f.length,m>=0&&c.slice(m,E)==f}function Zse(c){return c=at(c),c&&yh.test(c)?c.replace(il,Uee):c}function eoe(c){return c=at(c),c&&wh.test(c)?c.replace(au,"\\$&"):c}var toe=gl(function(c,f,m){return c+(m?"-":"")+f.toLowerCase()}),noe=gl(function(c,f,m){return c+(m?" ":"")+f.toLowerCase()}),roe=Ix("toLowerCase");function ioe(c,f,m){c=at(c),f=$e(f);var v=f?cl(c):0;if(!f||v>=f)return c;var E=(f-v)/2;return Yh($h(E),m)+c+Yh(Lh(E),m)}function soe(c,f,m){c=at(c),f=$e(f);var v=f?cl(c):0;return f&&v<f?c+Yh(f-v,m):c}function ooe(c,f,m){c=at(c),f=$e(f);var v=f?cl(c):0;return f&&v<f?Yh(f-v,m)+c:c}function aoe(c,f,m){return m||f==null?f=0:f&&(f=+f),pte(at(c).replace(sl,""),f||0)}function loe(c,f,m){return(m?jn(c,f,m):f===n)?f=1:f=$e(f),p0(at(c),f)}function coe(){var c=arguments,f=at(c[0]);return c.length<3?f:f.replace(c[1],c[2])}var uoe=gl(function(c,f,m){return c+(m?"_":"")+f.toLowerCase()});function foe(c,f,m){return m&&typeof m!="number"&&jn(c,f,m)&&(f=m=n),m=m===n?Ne:m>>>0,m?(c=at(c),c&&(typeof f=="string"||f!=null&&!L0(f))&&(f=pr(f),!f&&ll(c))?Ys(ei(c),0,m):c.split(f,m)):[]}var doe=gl(function(c,f,m){return c+(m?" ":"")+j0(f)});function hoe(c,f,m){return c=at(c),m=m==null?0:Ko($e(m),0,c.length),f=pr(f),c.slice(m,m+f.length)==f}function poe(c,f,m){var v=T.templateSettings;m&&jn(c,f,m)&&(f=n),c=at(c),f=cp({},f,v,Fx);var E=cp({},f.imports,v.imports,Fx),S=nn(E),A=Yb(E,S),R,L,G=0,H=f.interpolate||dn,K="__p += '",re=Zb((f.escape||dn).source+"|"+H.source+"|"+(H===bh?Oe:dn).source+"|"+(f.evaluate||dn).source+"|$","g"),de="//# sourceURL="+(ut.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Tee+"]")+`
235
+ `;c.replace(re,function(we,He,Ze,gr,Bn,yr){return Ze||(Ze=gr),K+=c.slice(G,yr).replace(Ws,Wee),He&&(R=!0,K+=`' +
236
+ __e(`+He+`) +
237
+ '`),Bn&&(L=!0,K+=`';
238
+ `+Bn+`;
239
+ __p += '`),Ze&&(K+=`' +
240
+ ((__t = (`+Ze+`)) == null ? '' : __t) +
241
+ '`),G=yr+we.length,we}),K+=`';
242
+ `;var Ee=ut.call(f,"variable")&&f.variable;if(!Ee)K=`with (obj) {
243
+ `+K+`
244
+ }
245
+ `;else if(J.test(Ee))throw new De(a);K=(L?K.replace(Ib,""):K).replace(su,"$1").replace(gh,"$1;"),K="function("+(Ee||"obj")+`) {
246
+ `+(Ee?"":`obj || (obj = {});
247
+ `)+"var __t, __p = ''"+(R?", __e = _.escape":"")+(L?`, __j = Array.prototype.join;
248
+ function print() { __p += __j.call(arguments, '') }
249
+ `:`;
250
+ `)+K+`return __p
251
+ }`;var Be=AC(function(){return st(S,de+"return "+K).apply(n,A)});if(Be.source=K,F0(Be))throw Be;return Be}function moe(c){return at(c).toLowerCase()}function goe(c){return at(c).toUpperCase()}function yoe(c,f,m){if(c=at(c),c&&(m||f===n))return LI(c);if(!c||!(f=pr(f)))return c;var v=ei(c),E=ei(f),S=$I(v,E),A=VI(v,E)+1;return Ys(v,S,A).join("")}function voe(c,f,m){if(c=at(c),c&&(m||f===n))return c.slice(0,BI(c)+1);if(!c||!(f=pr(f)))return c;var v=ei(c),E=VI(v,ei(f))+1;return Ys(v,0,E).join("")}function boe(c,f,m){if(c=at(c),c&&(m||f===n))return c.replace(sl,"");if(!c||!(f=pr(f)))return c;var v=ei(c),E=$I(v,ei(f));return Ys(v,E).join("")}function _oe(c,f){var m=U,v=Te;if(Nt(f)){var E="separator"in f?f.separator:E;m="length"in f?$e(f.length):m,v="omission"in f?pr(f.omission):v}c=at(c);var S=c.length;if(ll(c)){var A=ei(c);S=A.length}if(m>=S)return c;var R=m-cl(v);if(R<1)return v;var L=A?Ys(A,0,R).join(""):c.slice(0,R);if(E===n)return L+v;if(A&&(R+=L.length-R),L0(E)){if(c.slice(R).search(E)){var G,H=L;for(E.global||(E=Zb(E.source,at(rt.exec(E))+"g")),E.lastIndex=0;G=E.exec(H);)var K=G.index;L=L.slice(0,K===n?R:K)}}else if(c.indexOf(pr(E),R)!=R){var re=L.lastIndexOf(E);re>-1&&(L=L.slice(0,re))}return L+v}function Eoe(c){return c=at(c),c&&ou.test(c)?c.replace(qi,Jee):c}var woe=gl(function(c,f,m){return c+(m?" ":"")+f.toUpperCase()}),j0=Ix("toUpperCase");function NC(c,f,m){return c=at(c),f=m?n:f,f===n?zee(c)?Zee(c):Fee(c):c.match(f)||[]}var AC=qe(function(c,f){try{return dr(c,n,f)}catch(m){return F0(m)?m:new De(m)}}),Toe=Ki(function(c,f){return Lr(f,function(m){m=Si(m),Gi(c,m,M0(c[m],c))}),c});function Soe(c){var f=c==null?0:c.length,m=_e();return c=f?Tt(c,function(v){if(typeof v[1]!="function")throw new $r(o);return[m(v[0]),v[1]]}):[],qe(function(v){for(var E=-1;++E<f;){var S=c[E];if(dr(S[0],this,v))return dr(S[1],this,v)}})}function Ooe(c){return Jte(jr(c,h))}function B0(c){return function(){return c}}function koe(c,f){return c==null||c!==c?f:c}var Noe=Cx(),Aoe=Cx(!0);function tr(c){return c}function U0(c){return ax(typeof c=="function"?c:jr(c,h))}function Ioe(c){return cx(jr(c,h))}function xoe(c,f){return ux(c,jr(f,h))}var Coe=qe(function(c,f){return function(m){return yu(m,c,f)}}),Doe=qe(function(c,f){return function(m){return yu(c,m,f)}});function W0(c,f,m){var v=nn(f),E=qh(f,v);m==null&&!(Nt(f)&&(E.length||!v.length))&&(m=f,f=c,c=this,E=qh(f,nn(f)));var S=!(Nt(m)&&"chain"in m)||!!m.chain,A=Yi(c);return Lr(E,function(R){var L=f[R];c[R]=L,A&&(c.prototype[R]=function(){var G=this.__chain__;if(S||G){var H=c(this.__wrapped__),K=H.__actions__=Xn(this.__actions__);return K.push({func:L,args:arguments,thisArg:c}),H.__chain__=G,H}return L.apply(c,zs([this.value()],arguments))})}),c}function Roe(){return hn._===this&&(hn._=ste),this}function q0(){}function Moe(c){return c=$e(c),qe(function(f){return fx(f,c)})}var Poe=E0(Tt),Foe=E0(DI),Loe=E0(Qb);function IC(c){return A0(c)?Gb(Si(c)):hne(c)}function $oe(c){return function(f){return c==null?n:Jo(c,f)}}var Voe=Rx(),joe=Rx(!0);function z0(){return[]}function Q0(){return!1}function Boe(){return{}}function Uoe(){return""}function Woe(){return!0}function qoe(c,f){if(c=$e(c),c<1||c>ve)return[];var m=Ne,v=On(c,Ne);f=_e(f),c-=Ne;for(var E=Jb(v,f);++m<c;)f(m);return E}function zoe(c){return Pe(c)?Tt(c,Si):mr(c)?[c]:Xn(Kx(at(c)))}function Qoe(c){var f=++rte;return at(c)+f}var Goe=Jh(function(c,f){return c+f},0),Hoe=w0("ceil"),Koe=Jh(function(c,f){return c/f},1),Joe=w0("floor");function Yoe(c){return c&&c.length?Wh(c,tr,a0):n}function Xoe(c,f){return c&&c.length?Wh(c,_e(f,2),a0):n}function Zoe(c){return PI(c,tr)}function eae(c,f){return PI(c,_e(f,2))}function tae(c){return c&&c.length?Wh(c,tr,f0):n}function nae(c,f){return c&&c.length?Wh(c,_e(f,2),f0):n}var rae=Jh(function(c,f){return c*f},1),iae=w0("round"),sae=Jh(function(c,f){return c-f},0);function oae(c){return c&&c.length?Kb(c,tr):0}function aae(c,f){return c&&c.length?Kb(c,_e(f,2)):0}return T.after=Iie,T.ary=oC,T.assign=gse,T.assignIn=_C,T.assignInWith=cp,T.assignWith=yse,T.at=vse,T.before=aC,T.bind=M0,T.bindAll=Toe,T.bindKey=lC,T.castArray=Bie,T.chain=rC,T.chunk=Jne,T.compact=Yne,T.concat=Xne,T.cond=Soe,T.conforms=Ooe,T.constant=B0,T.countBy=oie,T.create=bse,T.curry=cC,T.curryRight=uC,T.debounce=fC,T.defaults=_se,T.defaultsDeep=Ese,T.defer=xie,T.delay=Cie,T.difference=Zne,T.differenceBy=ere,T.differenceWith=tre,T.drop=nre,T.dropRight=rre,T.dropRightWhile=ire,T.dropWhile=sre,T.fill=ore,T.filter=lie,T.flatMap=fie,T.flatMapDeep=die,T.flatMapDepth=hie,T.flatten=Zx,T.flattenDeep=are,T.flattenDepth=lre,T.flip=Die,T.flow=Noe,T.flowRight=Aoe,T.fromPairs=cre,T.functions=Ase,T.functionsIn=Ise,T.groupBy=pie,T.initial=fre,T.intersection=dre,T.intersectionBy=hre,T.intersectionWith=pre,T.invert=Cse,T.invertBy=Dse,T.invokeMap=gie,T.iteratee=U0,T.keyBy=yie,T.keys=nn,T.keysIn=er,T.map=rp,T.mapKeys=Mse,T.mapValues=Pse,T.matches=Ioe,T.matchesProperty=xoe,T.memoize=sp,T.merge=Fse,T.mergeWith=EC,T.method=Coe,T.methodOf=Doe,T.mixin=W0,T.negate=op,T.nthArg=Moe,T.omit=Lse,T.omitBy=$se,T.once=Rie,T.orderBy=vie,T.over=Poe,T.overArgs=Mie,T.overEvery=Foe,T.overSome=Loe,T.partial=P0,T.partialRight=dC,T.partition=bie,T.pick=Vse,T.pickBy=wC,T.property=IC,T.propertyOf=$oe,T.pull=vre,T.pullAll=tC,T.pullAllBy=bre,T.pullAllWith=_re,T.pullAt=Ere,T.range=Voe,T.rangeRight=joe,T.rearg=Pie,T.reject=wie,T.remove=wre,T.rest=Fie,T.reverse=D0,T.sampleSize=Sie,T.set=Bse,T.setWith=Use,T.shuffle=Oie,T.slice=Tre,T.sortBy=Aie,T.sortedUniq=xre,T.sortedUniqBy=Cre,T.split=foe,T.spread=Lie,T.tail=Dre,T.take=Rre,T.takeRight=Mre,T.takeRightWhile=Pre,T.takeWhile=Fre,T.tap=Yre,T.throttle=$ie,T.thru=np,T.toArray=yC,T.toPairs=TC,T.toPairsIn=SC,T.toPath=zoe,T.toPlainObject=bC,T.transform=Wse,T.unary=Vie,T.union=Lre,T.unionBy=$re,T.unionWith=Vre,T.uniq=jre,T.uniqBy=Bre,T.uniqWith=Ure,T.unset=qse,T.unzip=R0,T.unzipWith=nC,T.update=zse,T.updateWith=Qse,T.values=bl,T.valuesIn=Gse,T.without=Wre,T.words=NC,T.wrap=jie,T.xor=qre,T.xorBy=zre,T.xorWith=Qre,T.zip=Gre,T.zipObject=Hre,T.zipObjectDeep=Kre,T.zipWith=Jre,T.entries=TC,T.entriesIn=SC,T.extend=_C,T.extendWith=cp,W0(T,T),T.add=Goe,T.attempt=AC,T.camelCase=Yse,T.capitalize=OC,T.ceil=Hoe,T.clamp=Hse,T.clone=Uie,T.cloneDeep=qie,T.cloneDeepWith=zie,T.cloneWith=Wie,T.conformsTo=Qie,T.deburr=kC,T.defaultTo=koe,T.divide=Koe,T.endsWith=Xse,T.eq=ni,T.escape=Zse,T.escapeRegExp=eoe,T.every=aie,T.find=cie,T.findIndex=Yx,T.findKey=wse,T.findLast=uie,T.findLastIndex=Xx,T.findLastKey=Tse,T.floor=Joe,T.forEach=iC,T.forEachRight=sC,T.forIn=Sse,T.forInRight=Ose,T.forOwn=kse,T.forOwnRight=Nse,T.get=$0,T.gt=Gie,T.gte=Hie,T.has=xse,T.hasIn=V0,T.head=eC,T.identity=tr,T.includes=mie,T.indexOf=ure,T.inRange=Kse,T.invoke=Rse,T.isArguments=Zo,T.isArray=Pe,T.isArrayBuffer=Kie,T.isArrayLike=Zn,T.isArrayLikeObject=Ft,T.isBoolean=Jie,T.isBuffer=Xs,T.isDate=Yie,T.isElement=Xie,T.isEmpty=Zie,T.isEqual=ese,T.isEqualWith=tse,T.isError=F0,T.isFinite=nse,T.isFunction=Yi,T.isInteger=hC,T.isLength=ap,T.isMap=pC,T.isMatch=rse,T.isMatchWith=ise,T.isNaN=sse,T.isNative=ose,T.isNil=lse,T.isNull=ase,T.isNumber=mC,T.isObject=Nt,T.isObjectLike=Dt,T.isPlainObject=Tu,T.isRegExp=L0,T.isSafeInteger=cse,T.isSet=gC,T.isString=lp,T.isSymbol=mr,T.isTypedArray=vl,T.isUndefined=use,T.isWeakMap=fse,T.isWeakSet=dse,T.join=mre,T.kebabCase=toe,T.last=Ur,T.lastIndexOf=gre,T.lowerCase=noe,T.lowerFirst=roe,T.lt=hse,T.lte=pse,T.max=Yoe,T.maxBy=Xoe,T.mean=Zoe,T.meanBy=eae,T.min=tae,T.minBy=nae,T.stubArray=z0,T.stubFalse=Q0,T.stubObject=Boe,T.stubString=Uoe,T.stubTrue=Woe,T.multiply=rae,T.nth=yre,T.noConflict=Roe,T.noop=q0,T.now=ip,T.pad=ioe,T.padEnd=soe,T.padStart=ooe,T.parseInt=aoe,T.random=Jse,T.reduce=_ie,T.reduceRight=Eie,T.repeat=loe,T.replace=coe,T.result=jse,T.round=iae,T.runInContext=F,T.sample=Tie,T.size=kie,T.snakeCase=uoe,T.some=Nie,T.sortedIndex=Sre,T.sortedIndexBy=Ore,T.sortedIndexOf=kre,T.sortedLastIndex=Nre,T.sortedLastIndexBy=Are,T.sortedLastIndexOf=Ire,T.startCase=doe,T.startsWith=hoe,T.subtract=sae,T.sum=oae,T.sumBy=aae,T.template=poe,T.times=qoe,T.toFinite=Xi,T.toInteger=$e,T.toLength=vC,T.toLower=moe,T.toNumber=Wr,T.toSafeInteger=mse,T.toString=at,T.toUpper=goe,T.trim=yoe,T.trimEnd=voe,T.trimStart=boe,T.truncate=_oe,T.unescape=Eoe,T.uniqueId=Qoe,T.upperCase=woe,T.upperFirst=j0,T.each=iC,T.eachRight=sC,T.first=eC,W0(T,function(){var c={};return wi(T,function(f,m){ut.call(T.prototype,m)||(c[m]=f)}),c}(),{chain:!1}),T.VERSION=r,Lr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){T[c].placeholder=T}),Lr(["drop","take"],function(c,f){Xe.prototype[c]=function(m){m=m===n?1:Ht($e(m),0);var v=this.__filtered__&&!f?new Xe(this):this.clone();return v.__filtered__?v.__takeCount__=On(m,v.__takeCount__):v.__views__.push({size:On(m,Ne),type:c+(v.__dir__<0?"Right":"")}),v},Xe.prototype[c+"Right"]=function(m){return this.reverse()[c](m).reverse()}}),Lr(["filter","map","takeWhile"],function(c,f){var m=f+1,v=m==Ce||m==Ae;Xe.prototype[c]=function(E){var S=this.clone();return S.__iteratees__.push({iteratee:_e(E,3),type:m}),S.__filtered__=S.__filtered__||v,S}}),Lr(["head","last"],function(c,f){var m="take"+(f?"Right":"");Xe.prototype[c]=function(){return this[m](1).value()[0]}}),Lr(["initial","tail"],function(c,f){var m="drop"+(f?"":"Right");Xe.prototype[c]=function(){return this.__filtered__?new Xe(this):this[m](1)}}),Xe.prototype.compact=function(){return this.filter(tr)},Xe.prototype.find=function(c){return this.filter(c).head()},Xe.prototype.findLast=function(c){return this.reverse().find(c)},Xe.prototype.invokeMap=qe(function(c,f){return typeof c=="function"?new Xe(this):this.map(function(m){return yu(m,c,f)})}),Xe.prototype.reject=function(c){return this.filter(op(_e(c)))},Xe.prototype.slice=function(c,f){c=$e(c);var m=this;return m.__filtered__&&(c>0||f<0)?new Xe(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)},Xe.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Xe.prototype.toArray=function(){return this.take(Ne)},wi(Xe.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,L=A instanceof Xe,G=R[0],H=L||Pe(A),K=function(He){var Ze=E.apply(T,zs([He],R));return v&&re?Ze[0]:Ze};H&&m&&typeof G=="function"&&G.length!=1&&(L=H=!1);var re=this.__chain__,de=!!this.__actions__.length,Ee=S&&!re,Be=L&&!de;if(!S&&H){A=Be?A:new Xe(this);var we=c.apply(A,R);return we.__actions__.push({func:np,args:[K],thisArg:n}),new Vr(we,re)}return Ee&&Be?c.apply(this,R):(we=this.thru(K),Ee?v?we.value()[0]:we.value():we)})}),Lr(["pop","push","shift","sort","splice","unshift"],function(c){var f=Ah[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(Pe(S)?S:[],E)}return this[m](function(A){return f.apply(Pe(A)?A:[],E)})}}),wi(Xe.prototype,function(c,f){var m=T[f];if(m){var v=m.name+"";ut.call(hl,v)||(hl[v]=[]),hl[v].push({name:f,func:m})}}),hl[Kh(n,w).name]=[{name:"wrapper",func:n}],Xe.prototype.clone=Ete,Xe.prototype.reverse=wte,Xe.prototype.value=Tte,T.prototype.at=Xre,T.prototype.chain=Zre,T.prototype.commit=eie,T.prototype.next=tie,T.prototype.plant=rie,T.prototype.reverse=iie,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=sie,T.prototype.first=T.prototype.head,uu&&(T.prototype[uu]=nie),T},ul=ete();zo?((zo.exports=ul)._=ul,Ub._=ul):hn._=ul}).call(Re)}(wd,wd.exports);var av=wd.exports;function Hn(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function So(t){return Hn(t)==="object"}function y8(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function Gk(t,e){return t.length<124?t:e}const v8="graphql-transport-ws";var ar;(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"})(ar||(ar={}));var Mt;(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"})(Mt||(Mt={}));function Hk(t){if(!So(t))throw new Error(`Message is expected to be an object, but got ${Hn(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${Hn(t.type)}`);switch(t.type){case Mt.ConnectionInit:case Mt.ConnectionAck:case Mt.Ping:case Mt.Pong:{if(t.payload!=null&&!So(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 Mt.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Hn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!So(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Hn(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${Hn(t.payload.query)}`);if(t.payload.variables!=null&&!So(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${Hn(t.payload.variables)}`);if(t.payload.operationName!=null&&Hn(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${Hn(t.payload.operationName)}`);if(t.payload.extensions!=null&&!So(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${Hn(t.payload.extensions)}`);break}case Mt.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Hn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!So(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Hn(t.payload)}`);break}case Mt.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Hn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!y8(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 Mt.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Hn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function b8(t,e){return Hk(typeof t=="string"?JSON.parse(t,e):t)}function Dc(t,e){return Hk(t),JSON.stringify(t,e)}var La=function(t){return this instanceof La?(this.v=t,this):new La(t)},_8=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 La?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 E8(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=lv,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(!T8(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,ht)=>(async()=>{if(x){if(await d(U),!B)return M=void 0,ht({code:1e3,reason:"All Subscriptions Gone"});U++}I.emit("connecting",x);const Ne=new N(typeof e=="function"?await e():e,v8);let $,te;function Z(){isFinite(o)&&o>0&&(clearTimeout(te),te=setTimeout(()=>{Ne.readyState===N.OPEN&&(Ne.send(Dc({type:Mt.Ping})),I.emit("ping",!1,void 0))},o))}P(be=>{M=void 0,clearTimeout($),clearTimeout(te),ht(be),be instanceof Kk&&(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(Dc(be?{type:Mt.ConnectionInit,payload:be}:{type:Mt.ConnectionInit},_)),isFinite(l)&&l>0&&($=setTimeout(()=>{Ne.close(ar.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),Z()}catch(be){I.emit("error",be),Ne.close(ar.InternalClientError,Gk(be instanceof Error?be.message:new Error(be).message,"Internal client error"))}};let ne=!1;Ne.onmessage=({data:be})=>{try{const Me=b8(be,w);if(I.emit("message",Me),Me.type==="ping"||Me.type==="pong"){I.emit(Me.type,!0,Me.payload),Me.type==="pong"?Z():a||(Ne.send(Dc(Me.payload?{type:Mt.Pong,payload:Me.payload}:{type:Mt.Pong})),I.emit("pong",!1,Me.payload));return}if(ne)return;if(Me.type!==Mt.ConnectionAck)throw new Error(`First message cannot be of type ${Me.type}`);clearTimeout($),ne=!0,I.emit("connected",Ne,Me.payload,x),x=!1,U=0,Se([Ne,new Promise((Je,tn)=>P(tn))])}catch(Me){Ne.onmessage=null,I.emit("error",Me),Ne.close(ar.BadResponse,Gk(Me instanceof Error?Me.message:new Error(Me).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 pe(ee){if(lv(ee)&&(w8(ee.code)||[ar.InternalServerError,ar.InternalClientError,ar.BadRequest,ar.BadResponse,ar.Unauthorized,ar.SubprotocolNotAcceptable,ar.SubscriberAlreadyExists,ar.TooManyInitialisationRequests].includes(ee.code)))throw ee;if(Te)return!1;if(lv(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(!pe(ee))return}catch(Ae){return i==null?void 0:i(Ae)}}})();function Ce(ee,Ae){const fe=b(ee);let ve=!1,Se=!1,ht=()=>{B--,ve=!0};return(async()=>{for(B++;;)try{const[Ne,$,te]=await ke();if(ve)return $();const Z=I.onMessage(fe,ne=>{switch(ne.type){case Mt.Next:{Ae.next(ne.payload);return}case Mt.Error:{Se=!0,ve=!0,Ae.error(ne.payload),ht();return}case Mt.Complete:{ve=!0,ht();return}}});Ne.send(Dc({id:fe,type:Mt.Subscribe,payload:ee},_)),ht=()=>{!ve&&Ne.readyState===N.OPEN&&Ne.send(Dc({id:fe,type:Mt.Complete},_)),B--,ve=!0,$()},await te.finally(Z);return}catch(Ne){if(!pe(Ne))return}})().then(()=>{Se||Ae.complete()}).catch(Ne=>{Ae.error(Ne)}),()=>{ve||ht()}}return{on:I.on,subscribe:Ce,iterate(ee){const Ae=[],fe={done:!1,error:null,resolve:()=>{}},ve=Ce(ee,{next(ht){Ae.push(ht),fe.resolve()},error(ht){fe.done=!0,fe.error=ht,fe.resolve()},complete(){fe.done=!0,fe.resolve()}}),Se=function(){return _8(this,arguments,function*(){for(;;){for(Ae.length||(yield La(new Promise($=>fe.resolve=$)));Ae.length;)yield yield La(Ae.shift());if(fe.error)throw fe.error;if(fe.done)return yield La(void 0)}})}();return Se.throw=async ht=>(fe.done||(fe.done=!0,fe.error=ht,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 Kk)}}}class Kk extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function lv(t){return So(t)&&"code"in t&&"reason"in t}function w8(t){return[1e3,1001,1006,1005,1012,1013,1014].includes(t)?!1:t>=1e3&&t<=1999}function T8(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}const S8=({apiUrl:t,listeners:e})=>{const n=E8({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},Jk="api.warrior.well-played.gg/graphql",O8=({token:t,organizationId:e,invalidationPolicies:n,handlers:r})=>{const i=new cy.InvalidationPolicyCache({invalidationPolicies:{...n,timeToLive:(n==null?void 0:n.timeToLive)??12e4,renewalPolicy:(n==null?void 0:n.renewalPolicy)??cy.RenewalPolicy.None}});d8({cache:i,storage:new g8(window.localStorage)});const s=rg(({query:o})=>{const a=uo(o);return a.kind==="OperationDefinition"&&a.operation==="subscription"},new aV(S8({apiUrl:Jk,listeners:r==null?void 0:r.webSocket})),ng([iV(async()=>({headers:av.omitBy({"organization-id":e,authorization:t?`Bearer ${t}`:void 0},av.isNil)})),GS(({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 kf({uri:`https://${Jk}`})]));return new Mf({cache:i,link:s,defaultOptions:{watchQuery:{fetchPolicy:"network-only",errorPolicy:"ignore"},query:{fetchPolicy:"network-only",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})},Yk=ae.createContext({}),Xk=()=>{const t=ae.useContext(Yk);if(!t)throw new Error("useWellPlayed must be used within a WellPlayedProvider");return t},k8=({children:t,clientConfig:e,organizationId:n})=>{const r=rV();return he.jsx(cS,{client:O8({token:(r==null?void 0:r.accessToken)??void 0,organizationId:n,...e}),children:he.jsx(Yk.Provider,{value:{organizationId:n},children:t})})},N8=({children:t,oidcConfig:e,wpAppConfig:n,...r})=>he.jsx(Z$,{...e,configuration:{...n,...e==null?void 0:e.configuration,authority:"https://oauth.warrior.well-played.gg"},children:he.jsx(k8,{...r,children:t})}),A8=(t,e)=>{const{data:n,loading:r,refetch:i,fetchMore:s}=jf(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}}})}}},cv=(t,e)=>{const[n,r]=ae.useState(!(e!=null&&e.skip)),[i,s]=ae.useState([]),[o]=Wg(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 ae.useEffect(()=>{e!=null&&e.skip||a()},[e==null?void 0:e.skip]),{loading:n,results:i,refetch:a}};var Td={DOCUMENT:"Document",FRAGMENT_DEFINITION:"FragmentDefinition"};class I8 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 Pt(t){return new I8(`Syntax Error: Unexpected token at ${ge} in ${t}`)}function lr(t){if(t.lastIndex=ge,t.test(it))return it.slice(ge,ge=t.lastIndex)}var Sd=/ +(?=[^\s])/y;function x8(t){for(var e=t.split(`
252
+ `),n="",r=0,i=0,s=e.length-1,o=0;o<e.length;o++)Sd.lastIndex=0,Sd.test(e[o])&&(o&&(!r||Sd.lastIndex<r)&&(r=Sd.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 Pn=/[_A-Za-z]\w*/y,uv=new RegExp("(?:(null|true|false)|\\$("+Pn.source+')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|('+Pn.source+"))","y"),Os=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}(Os||{}),C8=/\\/;function Od(t){var e,n;if(uv.lastIndex=ge,it.charCodeAt(ge)===91){ge++,Fe();for(var r=[];it.charCodeAt(ge)!==93;)r.push(Od(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=lr(Pn))==null||(Fe(),it.charCodeAt(ge++)!==58))throw Pt("ObjectField");Fe(),i.push({kind:"ObjectField",name:{kind:"Name",value:e},value:Od(t)})}return ge++,Fe(),{kind:"ObjectValue",fields:i}}else if((n=uv.exec(it))!=null){if(ge=uv.lastIndex,Fe(),(e=n[Os.Const])!=null)return e==="null"?{kind:"NullValue"}:{kind:"BooleanValue",value:e==="true"};if((e=n[Os.Var])!=null){if(t)throw Pt("Variable");return{kind:"Variable",name:{kind:"Name",value:e}}}else if((e=n[Os.Int])!=null){var s;return(s=n[Os.Float])!=null?{kind:"FloatValue",value:e+s}:{kind:"IntValue",value:e}}else{if((e=n[Os.BlockString])!=null)return{kind:"StringValue",value:x8(e.slice(3,-3)),block:!0};if((e=n[Os.String])!=null)return{kind:"StringValue",value:C8.test(e)?JSON.parse(e):e.slice(1,-1),block:!1};if((e=n[Os.Enum])!=null)return{kind:"EnumValue",value:e}}}throw Pt("Value")}function Zk(t){if(it.charCodeAt(ge)===40){var e=[];ge++,Fe();var n;do{if((n=lr(Pn))==null||(Fe(),it.charCodeAt(ge++)!==58))throw Pt("Argument");Fe(),e.push({kind:"Argument",name:{kind:"Name",value:n},value:Od(t)})}while(it.charCodeAt(ge)!==41);return ge++,Fe(),e}}function $a(t){if(it.charCodeAt(ge)===64){var e=[],n;do{if(ge++,(n=lr(Pn))==null)throw Pt("Directive");Fe(),e.push({kind:"Directive",name:{kind:"Name",value:n},arguments:Zk(t)})}while(it.charCodeAt(ge)===64);return e}}function D8(){for(var t,e=0;it.charCodeAt(ge)===91;)e++,ge++,Fe();if((t=lr(Pn))==null)throw Pt("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 Pt("NamedType");Fe(),n={kind:"ListType",type:n}}while(e--);return n}var fv=new RegExp("(?:(\\.{3})|("+Pn.source+"))","y"),dv=function(t){return t[t.Spread=1]="Spread",t[t.Name=2]="Name",t}(dv||{});function kd(){var t=[],e,n;do if(fv.lastIndex=ge,(n=fv.exec(it))!=null){if(ge=fv.lastIndex,n[dv.Spread]!=null){Fe();var r=lr(Pn);if(r!=null&&r!=="on")Fe(),t.push({kind:"FragmentSpread",name:{kind:"Name",value:r},directives:$a(!1)});else{if(Fe(),r==="on"){if((r=lr(Pn))==null)throw Pt("NamedType");Fe()}var i=$a(!1);if(it.charCodeAt(ge++)!==123)throw Pt("InlineFragment");Fe(),t.push({kind:"InlineFragment",typeCondition:r?{kind:"NamedType",name:{kind:"Name",value:r}}:void 0,directives:i,selectionSet:kd()})}}else if((e=n[dv.Name])!=null){var s=void 0;if(Fe(),it.charCodeAt(ge)===58){if(ge++,Fe(),s=e,(e=lr(Pn))==null)throw Pt("Field");Fe()}var o=Zk(!1);Fe();var a=$a(!1),l=void 0;it.charCodeAt(ge)===123&&(ge++,Fe(),l=kd()),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 Pt("SelectionSet");while(it.charCodeAt(ge)!==125);return ge++,Fe(),{kind:"SelectionSet",selections:t}}function R8(){var t,e;if((t=lr(Pn))==null||(Fe(),lr(Pn)!=="on")||(Fe(),(e=lr(Pn))==null))throw Pt("FragmentDefinition");Fe();var n=$a(!1);if(it.charCodeAt(ge++)!==123)throw Pt("FragmentDefinition");return Fe(),{kind:"FragmentDefinition",name:{kind:"Name",value:t},typeCondition:{kind:"NamedType",name:{kind:"Name",value:e}},directives:n,selectionSet:kd()}}var M8=/(?:query|mutation|subscription|fragment)/y;function P8(t){var e,n,r;if(t&&(Fe(),e=lr(Pn),n=function(){if(Fe(),it.charCodeAt(ge)===40){var s=[];ge++,Fe();var o;do{if(it.charCodeAt(ge++)!==36||(o=lr(Pn))==null)throw Pt("Variable");if(Fe(),it.charCodeAt(ge++)!==58)throw Pt("VariableDefinition");Fe();var a=D8(),l=void 0;it.charCodeAt(ge)===61&&(ge++,Fe(),l=Od(!0)),Fe(),s.push({kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:o}},type:a,defaultValue:l,directives:$a(!0)})}while(it.charCodeAt(ge)!==41);return ge++,Fe(),s}}(),r=$a(!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:kd()}}function F8(t,e){return ge=0,function(r,i){var s,o;Fe();var a=[];do if((s=lr(M8))==="fragment")Fe(),a.push(R8());else if((o=P8(s))!=null)a.push(o);else throw Pt("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 e1=0,hv=new Set;function t1(){function t(e,n){var r=F8(e).definitions,i=new Set;for(var s of n||[])for(var o of s.definitions)o.kind===Td.FRAGMENT_DEFINITION&&!i.has(o)&&(r.push(o),i.add(o));var a;(a=r[0].kind===Td.FRAGMENT_DEFINITION)&&r[0].directives&&(r[0].directives=r[0].directives.filter(u=>u.name.value!=="_unmask"));var l;return{kind:Td.DOCUMENT,definitions:r,get loc(){if(!l&&a){var u=e+function(h){try{e1++;var p="";for(var g of h)if(!hv.has(g)){hv.add(g);var{loc:y}=g;y&&(p+=y.source.body)}return p}finally{--e1==0&&hv.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:Td.DOCUMENT,definitions:r?r.definitions:[],documentId:n}},t}function L8(...t){return t.length===2?t[1]:t[0]}t1();const Va=t1(),$8=Va(`
254
+ query organization($id: ID!) {
255
+ organization(id: $id) {
256
+ id
257
+ identityProviders(login: true) {
258
+ name
259
+ id
260
+ }
261
+ }
262
+ }
263
+ `),n1=()=>{const{organizationId:t}=Xk(),{loading:e,error:n,data:r}=jf($8,{variables:{id:t}});return{loading:e,error:n,data:r}},V8=Va(`
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
+ `),r1=({playerIds:t,skip:e})=>{const{loading:n,data:r}=n1(),[i,s]=ae.useState([]),[o,a]=ae.useState(!e),[l]=Wg(V8),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 ae.useEffect(()=>{!e&&t&&r&&(a(!0),u(t).finally(()=>a(!1)))},[e,t,r]),{results:i,refetch:u,loading:o||n}},j8=Va(`
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
+ `),i1=({tournamentId:t,skip:e,status:n})=>{const[r,i]=ae.useState([]),{loading:s,results:o}=cv(j8,{variables:{tournamentId:t,status:n},onResults:async u=>{i(u.flatMap(d=>d.members).map(d=>d.playerProfileId))},skip:e}),{loading:a,results:l}=r1({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)}))}))||[]}},B8=Va(`
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
+ `),U8=Va(`
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
+ `),W8=({tournamentId:t,stepId:e,skip:n})=>{const{loading:r,data:i}=jf(B8,{variables:{stepId:e},skip:n}),{loading:s,results:o}=cv(U8,{skip:n,variables:{stepId:e}}),{loading:a,results:l}=i1({tournamentId:t,skip:n,status:"CONFIRMED"});return{loading:r||s||a,groups:i==null?void 0:i.tournamentStepGeneratedShape.map(u=>{const d=av.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 ln(t){this.content=t}ln.prototype={constructor:ln,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 ln(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 ln(n)},addToStart:function(t,e){return new ln([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new ln(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 ln(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=ln.from(t),t.size?new ln(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=ln.from(t),t.size?new ln(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=ln.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}},ln.from=function(t){if(t instanceof ln)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new ln(e)};function s1(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=s1(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function o1(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=o1(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 s1(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return o1(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Nd(0,e);if(e==this.size)return Nd(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?Nd(r+1,o):Nd(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 pv={index:0,offset:0};function Nd(t,e){return pv.index=t,pv.offset=e,pv}function Ad(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(!Ad(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ad(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let dt=class G0{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&&Ad(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 G0.none;if(e instanceof G0)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};dt.none=[];class Id 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=l1(this.content,e+this.openStart,n);return r&&new se(r,this.openStart,this.openEnd)}removeBetween(e,n){return new se(a1(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 a1(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(a1(s.content,e-i-1,n-i-1)))}function l1(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=l1(o.content,e-s-1,n);return a&&t.replaceChild(i,o.copy(a))}function q8(t,e,n){if(n.openStart>t.depth)throw new Id("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Id("Inconsistent open depths");return c1(t,e,n,0)}function c1(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=c1(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 ko(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=z8(n,t);return ko(s,f1(t,o,a,e,r))}else return ko(s,xd(t,e,r))}function u1(t,e){if(!e.type.compatibleContent(t.type))throw new Id("Cannot join "+e.type.name+" onto "+t.type.name)}function mv(t,e,n){let r=t.node(n);return u1(r,e.node(n)),r}function Oo(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 Rc(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&&(Oo(t.nodeAfter,r),s++));for(let a=s;a<o;a++)Oo(i.child(a),r);e&&e.depth==n&&e.textOffset&&Oo(e.nodeBefore,r)}function ko(t,e){return t.type.checkContent(e),t.copy(e)}function f1(t,e,n,r,i){let s=t.depth>i&&mv(t,e,i+1),o=r.depth>i&&mv(n,r,i+1),a=[];return Rc(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(u1(s,o),Oo(ko(s,f1(t,e,n,r,i+1)),a)):(s&&Oo(ko(s,xd(t,e,i+1)),a),Rc(e,n,i,a),o&&Oo(ko(o,xd(n,r,i+1)),a)),Rc(r,null,i,a),new Y(a)}function xd(t,e,n){let r=[];if(Rc(null,t,n,r),t.depth>n){let i=mv(t,e,n+1);Oo(ko(i,xd(t,e,n+1)),r)}return Rc(e,null,n,r),new Y(r)}function z8(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 Mc{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 dt.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 Cd(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 Mc(n,r,s)}static resolveCached(e,n){let r=d1.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 d1.set(e,r=new Q8);let i=r.elts[r.i]=Mc.resolve(e,n);return r.i=(r.i+1)%G8,i}}class Q8{constructor(){this.elts=[],this.i=0}}const G8=12,d1=new WeakMap;class Cd{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 H8=Object.create(null);let No=class H0{constructor(e,n,r,i=dt.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&&Ad(this.attrs,n||e.defaultAttrs||H8)&&dt.sameSet(this.marks,r||dt.none)}copy(e=null){return e==this.content?this:new H0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new H0(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 q8(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 Mc.resolveCached(this,e)}resolveNoCache(e){return Mc.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()+")"),h1(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=dt.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(!dt.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}};No.prototype.text=void 0;class Dd extends No{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):h1(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 Dd(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Dd(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 h1(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ao{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new K8(e,n);if(r.next==null)return Ao.empty;let i=p1(r);r.next&&r.err("Unexpected trailing text");let s=nJ(tJ(i));return rJ(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
+ `)}}Ao.empty=new Ao(!0);class K8{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 p1(t){let e=[];do e.push(J8(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function J8(t){let e=[];do e.push(Y8(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Y8(t){let e=eJ(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=X8(t,e);else break;return e}function m1(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function X8(t,e){let n=m1(t),r=n;return t.eat(",")&&(t.next!="}"?r=m1(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Z8(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 eJ(t){if(t.eat("(")){let e=p1(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=Z8(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 tJ(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 g1(t,e){return e-t}function y1(t,e){let n=[];return r(e),n.sort(g1);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 nJ(t){let e=Object.create(null);return n(y1(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]);y1(t,l).forEach(d=>{u||i.push([a,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let s=e[r.join(",")]=new Ao(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(g1);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function rJ(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 v1(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 b1(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 _1(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 E1(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new sJ(t,r,e[r]);return n}let w1=class PC{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=E1(e,r.attrs),this.defaultAttrs=v1(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==Ao.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:b1(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new No(this,this.computeAttrs(e),Y.from(n),dt.setFrom(r))}createChecked(e=null,n,r){return n=Y.from(n),this.checkContent(n),new No(this,this.computeAttrs(e),n,dt.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 No(this,e,n.append(s),dt.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){_1(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:dt.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new PC(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 iJ(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 sJ{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?iJ(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Rd{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=E1(e,i.attrs),this.excluded=null;let s=v1(this.attrs);this.instance=s?new dt(this,s):null}create(e=null){return!e&&this.instance?this.instance:new dt(this,b1(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Rd(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){_1(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class T1{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=ln.from(e.nodes),n.marks=ln.from(e.marks||{}),this.nodes=w1.compile(this.spec.nodes,this),this.marks=Rd.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]=Ao.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?S1(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==""?[]:S1(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 w1){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 Dd(r,r.defaultAttrs,e,dt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return No.fromJSON(this,e)}markFromJSON(e){return dt.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function S1(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 oJ(t){return t.tag!=null}function aJ(t){return t.style!=null}class ks{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(oJ(i))this.tags.push(i);else if(aJ(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 A1(this,n,!1);return r.addAll(e,dt.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new A1(this,n,!0);return r.addAll(e,dt.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(uJ(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=I1(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=I1(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ks(e,ks.schemaRules(e)))}}const O1={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},lJ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},k1={ol:!0,ul:!0},Md=1,Pd=2,Pc=4;function N1(t,e,n){return e!=null?(e?Md:0)|(e==="full"?Pd:0):t&&t.whitespace=="pre"?Md|Pd:n&~Pc}class Fd{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=dt.none,this.match=s||(o&Pc?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&Md)){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&&!O1.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class A1{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,s,o=N1(null,n.preserveWhitespace,0)|(r?Pc:0);i?s=new Fd(i.type,i.attrs,dt.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new Fd(null,null,dt.none,!0,null,o):s=new Fd(e.schema.topNodeType,null,dt.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&Pd||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i.options&Md)i.options&Pd?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;k1.hasOwnProperty(i)&&this.parser.normalizeLists&&cJ(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,r));if(o?o.ignore:lJ.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(O1.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=dt.none;for(let o of r.concat(e.marks))(i.type?i.type.allowsMarkType(o.type):x1(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=N1(e,s,o.options);o.options&Pc&&o.content.length==0&&(a|=Pc);let l=dt.none;return r=r.filter(u=>(o.type?o.type.allowsMarkType(u.type):x1(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Fd(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 cJ(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&k1.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function uJ(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function I1(t){let e={};for(let n in t)e[n]=t[n];return e}function x1(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 Io{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=gv(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}=Ld(gv(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&&Ld(gv(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Ld(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Io(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=C1(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return C1(e.marks)}}function C1(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function gv(t){return t.document||window.document}const D1=new WeakMap;function fJ(t){let e=D1.get(t);return e===void 0&&D1.set(t,e=dJ(t)),e}function dJ(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 Ld(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=fJ(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}=Ld(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 R1=65535,M1=Math.pow(2,16);function hJ(t,e){return t+e*M1}function P1(t){return t&R1}function pJ(t){return(t-(t&R1))/M1}const F1=1,L1=2,$d=4,$1=8;class yv{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&$1)>0}get deletedBefore(){return(this.delInfo&(F1|$d))>0}get deletedAfter(){return(this.delInfo&(L1|$d))>0}get deletedAcross(){return(this.delInfo&$d)>0}}class cr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&cr.empty)return cr.empty}recover(e){let n=0,r=P1(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+pJ(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:hJ(a/3,e-l),b=e==l?L1:e==h?F1:$d;return(n<0?e!=l:e!=h)&&(b|=$1),new yv(g,b,y)}i+=d-u}return r?e+i:new yv(e+i,0,null)}touches(e,n){let r=0,i=P1(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 cr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?cr.empty:new cr(e<0?[0,-e,0]:[0,0,e])}}cr.empty=new cr([]);class ja{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 ja(this.maps,this.mirror,e,n)}copy(){return new ja(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 ja;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 yv(e,i,null)}}const vv=Object.create(null);class _n{getMap(){return cr.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=vv[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 vv)throw new RangeError("Duplicate use of step JSON ID "+e);return vv[e]=n,n.prototype.jsonID=e,n}}class jt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new jt(e,null)}static fail(e){return new jt(null,e)}static fromReplace(e,n,r,i){try{return jt.ok(e.replace(n,r,i))}catch(s){if(s instanceof Id)return jt.fail(s.message);throw s}}}function bv(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(bv(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return Y.fromArray(r)}class Ns extends _n{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(bv(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 jt.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 Ns(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ns&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ns(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 Ns(n.from,n.to,e.markFromJSON(n.mark))}}_n.jsonID("addMark",Ns);class pi extends _n{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(bv(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return jt.fromReplace(e,this.from,this.to,r)}invert(){return new Ns(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))}}_n.jsonID("removeMark",pi);class As extends _n{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return jt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return jt.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 As(this.pos,n.marks[i]);return new As(this.pos,this.mark)}}return new Ba(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new As(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 As(n.pos,e.markFromJSON(n.mark))}}_n.jsonID("addNodeMark",As);class Ba extends _n{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return jt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return jt.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 As(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ba(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 Ba(n.pos,e.markFromJSON(n.mark))}}_n.jsonID("removeNodeMark",Ba);class Yt extends _n{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&_v(e,this.from,this.to)?jt.fail("Structure replace would overwrite content"):jt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new cr([this.from,this.to-this.from,this.slice.size])}invert(e){return new Yt(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 Yt(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Yt)||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 Yt(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 Yt(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 Yt(n.from,n.to,se.fromJSON(e,n.slice),!!n.structure)}}_n.jsonID("replace",Yt);class Xt extends _n{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&&(_v(e,this.from,this.gapFrom)||_v(e,this.gapTo,this.to)))return jt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return jt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?jt.fromReplace(e,this.from,this.to,r):jt.fail("Content does not fit in gap")}getMap(){return new cr([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 Xt(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 Xt(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 Xt(n.from,n.to,n.gapFrom,n.gapTo,se.fromJSON(e,n.slice),n.insert,!!n.structure)}}_n.jsonID("replaceAround",Xt);function _v(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 mJ(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 Ns(p,g,r))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function gJ(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 Rd){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 Ev(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 Yt(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 Yt(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 yJ(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ua(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||!yJ(i,s,o))break}return null}function vJ(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 Xt(l,u,o,a,new se(d.append(p),h,g),d.size-h,!0))}function wv(t,e,n=null,r=t){let i=bJ(t,e),s=i&&_J(r,e);return s?i.map(V1).concat({type:e,attrs:n}).concat(s.map(V1)):null}function V1(t){return{type:t,attrs:null}}function bJ(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 _J(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 EJ(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 Xt(i,s,i,s,new se(r,0,0),n.length,!0))}function wJ(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)&&TJ(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&&B1(t,o,a,s),Ev(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 Xt(h,p,h+1,p-1,new se(Y.from(r.create(l,null,o.marks)),0,0),1,!0)),u===!0&&j1(t,o,a,s),!1}})}function j1(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 B1(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 TJ(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function SJ(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 Xt(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new se(Y.from(o),0,0),1,!0))}function Vi(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 OJ(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 Yt(e,e,new se(s.append(o),n,n),!0))}function Is(t,e){let n=t.resolve(e),r=n.index();return U1(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function kJ(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 U1(t,e){return!!(t&&e&&!t.isLeaf&&kJ(t,e))}function Vd(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&&U1(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 NJ(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);B1(t,d.node(),d.before(),a)}o.inlineContent&&Ev(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 Yt(u,l.map(e+n,-1),se.empty,!0)),r===!0){let d=t.doc.resolve(u);j1(t,d.node(),d.before(),t.steps.length)}return t}function AJ(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 W1(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 jd(t,e,n=e,r=se.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return q1(i,s,r)?new Yt(e,n,r):new IJ(i,s,r).fit()}function q1(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class IJ{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 Xt(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Yt(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=Tv(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=Tv(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=Tv(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new se(Fc(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new se(Fc(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(z1(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=Lc(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(Fc(o.content,e-1,1),e-1,g<0?o.openEnd:e-1):new se(Fc(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||!Sv(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=Sv(e,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],d=Sv(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=Lc(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=Lc(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=Lc(this.placed,this.frontier.length,n))}}function Fc(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Fc(t.firstChild.content,e-1,n)))}function Lc(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Lc(t.lastChild.content,e-1,n)))}function Tv(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function z1(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,z1(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 Sv(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&&!xJ(n,s.content,o)?a:null}function xJ(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function CJ(t){return t.spec.defining||t.spec.definingForContent}function DJ(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(q1(i,s,r))return t.step(new Yt(e,n,r));let o=G1(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=CJ(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(Q1(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 Q1(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(Q1(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 RJ(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=AJ(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new se(Y.from(r),0,0))}function MJ(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),s=G1(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 G1(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 Wa extends _n{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 jt.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 jt.fromReplace(e,this.pos,this.pos+1,new se(Y.from(i),0,n.isLeaf?0:1))}getMap(){return cr.empty}invert(e){return new Wa(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 Wa(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 Wa(n.pos,n.attr,n.value)}}_n.jsonID("attr",Wa);class $c extends _n{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 jt.ok(r)}getMap(){return cr.empty}invert(e){return new $c(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 $c(n.attr,n.value)}}_n.jsonID("docAttr",$c);let qa=class extends Error{};qa=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},qa.prototype=Object.create(Error.prototype),qa.prototype.constructor=qa,qa.prototype.name="TransformError";class PJ{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ja}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new qa(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=jd(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 DJ(this,e,n,r),this}replaceRangeWith(e,n,r){return RJ(this,e,n,r),this}deleteRange(e,n){return MJ(this,e,n),this}lift(e,n){return vJ(this,e,n),this}join(e,n=1){return NJ(this,e,n),this}wrap(e,n){return EJ(this,e,n),this}setBlockType(e,n=e,r,i=null){return wJ(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return SJ(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Wa(e,n,r)),this}setDocAttribute(e,n){return this.step(new $c(e,n)),this}addNodeMark(e,n){return this.step(new As(e,n)),this}removeNodeMark(e,n){if(!(n instanceof dt)){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 Ba(e,n)),this}split(e,n=1,r){return OJ(this,e,n,r),this}addMark(e,n,r){return mJ(this,e,n,r),this}removeMark(e,n,r){return gJ(this,e,n,r),this}clearIncompatible(e,n,r){return Ev(this,e,n,r),this}}const Ov=Object.create(null);class Le{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new FJ(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&&J1(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),J1(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new xe(e):za(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?za(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):za(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 Ar(e.node(0))}static atStart(e){return za(e,e,0,0,1)||new Ar(e)}static atEnd(e){return za(e,e,e.content.size,e.childCount,-1)||new Ar(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Ov[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 Ov)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ov[e]=n,n.prototype.jsonID=e,n}getBookmark(){return xe.between(this.$anchor,this.$head).getBookmark()}}Le.prototype.visible=!0;class FJ{constructor(e,n){this.$from=e,this.$to=n}}let H1=!1;function K1(t){!H1&&!t.parent.inlineContent&&(H1=!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){K1(e),K1(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 Bd(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 Bd{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Bd(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 kv(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 kv{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Bd(r,r):new kv(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&ye.isSelectable(r)?new ye(n):Le.near(n)}}class Ar 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 Ar(e)}map(e){return new Ar(e)}eq(e){return e instanceof Ar}getBookmark(){return LJ}}Le.jsonID("all",Ar);const LJ={map(){return this},resolve(t){return new Ar(t)}};function za(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=za(t,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function J1(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Yt||i instanceof Xt))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 Y1=1,Ud=2,X1=4;class $J extends PJ{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|Y1)&~Ud,this.storedMarks=null,this}get selectionSet(){return(this.updated&Y1)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ud,this}ensureMarks(e){return dt.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&Ud)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Ud,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)||dt.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|=X1,this}get scrolledIntoView(){return(this.updated&X1)>0}}function Z1(t,e){return!e||!t?t:t.bind(e)}class Vc{constructor(e,n,r){this.name=e,this.init=Z1(n.init,r),this.apply=Z1(n.apply,r)}}const VJ=[new Vc("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Vc("selection",{init(t,e){return t.selection||Le.atStart(e.doc)},apply(t){return t.selection}}),new Vc("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Vc("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Nv{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=VJ.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 Vc(r.key,r.spec.state,r))})}}class Qa{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 Qa(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 $J(this)}static create(e){let n=new Nv(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Qa(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 Nv(this.schema,e.plugins),r=n.fields,i=new Qa(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 Nv(e.schema,e.plugins),s=new Qa(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=No.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 eN(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=eN(i,e,{})),n[r]=i}return n}class Kn{constructor(e){this.spec=e,this.props={},e.props&&eN(e.props,this,this.props),this.key=e.key?e.key.key:tN("plugin")}getState(e){return e[this.key]}}const Av=Object.create(null);function tN(t){return t in Av?t+"$"+ ++Av[t]:(Av[t]=0,t+"$")}class mi{constructor(e="key"){this.key=tN(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const cn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},jc=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Iv=null;const ji=function(t,e,n){let r=Iv||(Iv=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},jJ=function(){Iv=null},xo=function(t,e,n,r){return n&&(nN(t,e,n,r,-1)||nN(t,e,n,r,1))},BJ=/^(img|br|input|textarea|hr)$/i;function nN(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||Bc(t)||BJ.test(t.nodeName)||t.contentEditable=="false")return!1;e=cn(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 UJ(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&&!Bc(t))e=cn(t),t=t.parentNode;else return null}}function WJ(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&&!Bc(t))e=cn(t)+1,t=t.parentNode;else return null}}function qJ(t,e,n){for(let r=e==0,i=e==Ir(t);r||i;){if(t==n)return!0;let s=cn(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==Ir(t)}}function Bc(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 Wd=function(t){return t.focusNode&&xo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Co(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function zJ(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function QJ(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 gi=typeof navigator<"u"?navigator:null,rN=typeof document<"u"?document:null,xs=gi&&gi.userAgent||"",xv=/Edge\/(\d+)/.exec(xs),iN=/MSIE \d/.exec(xs),Cv=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xs),Jn=!!(iN||Cv||xv),Cs=iN?document.documentMode:Cv?+Cv[1]:xv?+xv[1]:0,Jr=!Jn&&/gecko\/(\d+)/i.test(xs);Jr&&+(/Firefox\/(\d+)/.exec(xs)||[0,0])[1];const Dv=!Jn&&/Chrome\/(\d+)/.exec(xs),En=!!Dv,sN=Dv?+Dv[1]:0,Fn=!Jn&&!!gi&&/Apple Computer/.test(gi.vendor),Ga=Fn&&(/Mobile\/\w+/.test(xs)||!!gi&&gi.maxTouchPoints>2),xr=Ga||(gi?/Mac/.test(gi.platform):!1),GJ=gi?/Win/.test(gi.platform):!1,Yr=/Android \d/.test(xs),Uc=!!rN&&"webkitFontSmoothing"in rN.documentElement.style,HJ=Uc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function KJ(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 Bi(t,e){return typeof t=="number"?t:t[e]}function JJ(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 oN(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=jc(o)){if(o.nodeType!=1)continue;let a=o,l=a==s.body,u=l?KJ(s):JJ(a),d=0,h=0;if(e.top<u.top+Bi(r,"top")?h=-(u.top-e.top+Bi(i,"top")):e.bottom>u.bottom-Bi(r,"bottom")&&(h=e.bottom-e.top>u.bottom-u.top?e.top+Bi(i,"top")-u.top:e.bottom-u.bottom+Bi(i,"bottom")),e.left<u.left+Bi(r,"left")?d=-(u.left-e.left+Bi(i,"left")):e.right>u.right-Bi(r,"right")&&(d=e.right-u.right+Bi(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 YJ(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:aN(t.dom)}}function aN(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=jc(r));return e}function XJ({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;lN(n,r==0?0:r-e)}function lN(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 Ha=null;function ZJ(t){if(t.setActive)return t.setActive();if(Ha)return t.focus(Ha);let e=aN(t);t.focus(Ha==null?{get preventScroll(){return Ha={preventScroll:!0},!0}}:void 0),Ha||(Ha=!1,lN(e,0))}function cN(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=ji(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?e9(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:cN(n,i)}function e9(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=Ds(r,1);if(s.top!=s.bottom&&Rv(e,s))return{node:t,offset:i+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function Rv(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function t9(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function n9(t,e,n){let{node:r,offset:i}=cN(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 r9(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 uN(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(Rv(e,u))return uN(o,e,u)}}if((s=(s+1)%r)==i)break}return t}function i9(t,e){let n=t.dom.ownerDocument,r,i=0,s=QJ(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(!Rv(e,u)||(o=uN(t.dom,e,u),!o))return null}if(Fn)for(let u=o;r&&u;u=jc(u))u.draggable&&(r=void 0);if(o=t9(o,e),r){if(Jr&&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;Uc&&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=r9(t,r,i,e))}a==null&&(a=n9(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function fN(t){return t.top<t.bottom||t.left<t.right}function Ds(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(fN(r))return r}return Array.prototype.find.call(n,fN)||t.getBoundingClientRect()}const s9=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function dN(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=Uc||Jr;if(r.nodeType==3)if(o&&(s9.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=Ds(ji(r,i,i),n);if(Jr&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=Ds(ji(r,i-1,i-1),-1);if(u.top==l.top){let d=Ds(ji(r,i,i+1),-1);if(d.top!=l.top)return Wc(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++,Wc(Ds(ji(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 Mv(l.getBoundingClientRect(),!1)}if(s==null&&i<Ir(r)){let l=r.childNodes[i];if(l.nodeType==1)return Mv(l.getBoundingClientRect(),!0)}return Mv(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Ir(r))){let l=r.childNodes[i-1],u=l.nodeType==3?ji(l,Ir(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return Wc(Ds(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?ji(l,0,o?0:1):l.nodeType==1?l:null:null;if(u)return Wc(Ds(u,-1),!0)}return Wc(Ds(r.nodeType==3?ji(r):r,-n),n>=0)}function Wc(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 Mv(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 hN(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 o9(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return hN(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=dN(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=ji(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 a9=/[\u0590-\u08ac]/;function l9(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?!a9.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:hN(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 pN=null,mN=null,gN=!1;function c9(t,e,n){return pN==e&&mN==n?gN:(pN=e,mN=n,gN=n=="up"||n=="down"?o9(t,e,n):l9(t,e,n))}const Cr=0,yN=1,Do=2,yi=3;class qc{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Cr,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>cn(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 _N){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 vN&&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?cn(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?cn(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=cn(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=cn(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((Jr||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:cn(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(Jr&&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)&&xo(a.node,a.offset,u.anchorNode,u.anchorOffset)&&xo(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?Do:yN,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=yi:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Do:yi}r=o}this.dirty=Do}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Do:yN;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class vN extends qc{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==Cr&&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 u9 extends qc{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 Ro extends qc{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=Io.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Ro(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&yi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=yi&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Cr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Cr}}slice(e,n,r){let i=Ro.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=Fv(s,n,o,r)),e>0&&(s=Fv(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 Rs extends qc{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}=Io.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=TN(d,r,n),u?l=new f9(e,n,r,i,d,h||null,p,u,s,o+1):n.isText?new qd(e,n,r,i,d,p,s):new Rs(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==Cr&&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 h9(this,o&&o.node,e);g9(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?dt.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==Do)&&(o&&this.protectLocalComposition(e,o),EN(this.contentDOM,this.children,e),Ga&&y9(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=v9(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 u9(this,s,n,i);e.input.compositionNodes.push(o),this.children=Fv(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==yi||!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=Cr}updateOuterDeco(e){if(zd(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=wN(this.dom,this.nodeDOM,Pv(this.outerDeco,this.node,n),Pv(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 bN(t,e,n,r,i){TN(r,e,t);let s=new Rs(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class qd extends Rs{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==yi||this.dirty!=Cr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Cr||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=Cr,!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 qd(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=yi)}get domAtom(){return!1}isText(e){return this.node.text==e}}class _N extends qc{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Cr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class f9 extends Rs{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==yi)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 EN(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=SN(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(o instanceof Ro){let l=r?r.previousSibling:t.lastChild;EN(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=SN(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const zc=function(t){t&&(this.nodeName=t)};zc.prototype=Object.create(null);const Mo=[new zc];function Pv(t,e,n){if(t.length==0)return Mo;let r=n?Mo[0]:new zc,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new zc(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new zc(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 wN(t,e,n,r){if(n==Mo&&r==Mo)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=Mo[0]),i=l}d9(i,a||Mo[0],o)}return i}function d9(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 TN(t,e,n){return wN(t,t,Mo,Pv(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 SN(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class h9{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=p9(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=Cr,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=Ro.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==yi&&o.dom==o.contentDOM&&(o.dirty=Do),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 Rs){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!=yi&&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=Do,h.updateChildren(i,o+1),h.dirty=Cr),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=Rs.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=Rs.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 vN(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 Ro;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof qd)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Fn||En)&&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 _N(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 p9(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 Ro)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 m9(t,e){return t.type.side-e.type.side}function g9(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(m9);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 y9(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 v9(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 Fv(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 Lv(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(Wd(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&&qJ(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=Vv(t,d,a,h)}return u}function ON(t){return t.editable?t.hasFocus():DN(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ui(t,e=!1){let n=t.state.selection;if(IN(t,n),!!ON(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&En){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&xo(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)_9(t);else{let{anchor:r,head:i}=n,s,o;kN&&!(n instanceof xe)&&(n.$from.parent.inlineContent||(s=NN(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=NN(t,n.to))),t.docView.setSelection(r,i,t.root,e),kN&&(s&&AN(s),o&&AN(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&b9(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const kN=Fn||En&&sN<63;function NN(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 $v(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return $v(i);if(s)return $v(s)}}function $v(t){return t.contentEditable="true",Fn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function AN(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function b9(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(()=>{(!ON(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function _9(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,cn(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Jn&&Cs<=11&&(r.disabled=!0,r.disabled=!1)}function IN(t,e){if(e instanceof ye){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(xN(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else xN(t)}function xN(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Vv(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||xe.between(e,n,r)}function CN(t){return t.editable&&!t.hasFocus()?!1:DN(t)}function DN(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 E9(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return xo(e.node,e.offset,n.anchorNode,n.anchorOffset)}function jv(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 Ms(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function RN(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 Ms(t,new xe(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=jv(t.state,e);return i&&i instanceof ye?Ms(t,i):!1}else if(!(xr&&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)?Ms(t,new ye(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Uc?Ms(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 Ms(t,new xe(e>0?r.$to:r.$from));{let i=jv(t.state,e);return i?Ms(t,i):!1}}}function Qd(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Qc(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ka(t,e){return e<0?w9(t):T9(t)}function w9(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for(Jr&&n.nodeType==1&&r<Qd(n)&&Qc(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Qc(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(MN(n))break;{let a=n.previousSibling;for(;a&&Qc(a,-1);)i=n.parentNode,s=cn(a),a=a.previousSibling;if(a)n=a,r=Qd(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?Bv(t,n,r):i&&Bv(t,i,s)}function T9(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(Qc(a,1))s=n,o=++r;else break}else{if(MN(n))break;{let a=n.nextSibling;for(;a&&Qc(a,1);)s=a.parentNode,o=cn(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&&Bv(t,s,o)}function MN(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function S9(t,e){for(;t&&e==t.childNodes.length&&!Bc(t);)e=cn(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 O9(t,e){for(;t&&!e&&!Bc(t);)e=cn(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 Bv(t,e,n){if(e.nodeType!=3){let s,o;(o=S9(e,n))?(e=o,n=0):(s=O9(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Wd(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&&Ui(t)},50)}function PN(t,e){let n=t.state.doc.resolve(e);if(!(En||GJ)&&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 FN(t,e,n){let r=t.state.selection;if(r instanceof xe&&!r.empty||n.indexOf("s")>-1||xr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=jv(t.state,e);if(o&&o instanceof ye)return Ms(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof Ar?Le.near(o,e):Le.findFrom(o,e);return a?Ms(t,a):!1}return!1}function LN(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 $N(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function k9(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;$N(t,r,"true"),setTimeout(()=>$N(t,r,"false"),20)}return!1}function N9(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function A9(t,e){let n=e.keyCode,r=N9(e);if(n==8||xr&&n==72&&r=="c")return LN(t,-1)||Ka(t,-1);if(n==46&&!e.shiftKey||xr&&n==68&&r=="c")return LN(t,1)||Ka(t,1);if(n==13||n==27)return!0;if(n==37||xr&&n==66&&r=="c"){let i=n==37?PN(t,t.state.selection.from)=="ltr"?-1:1:-1;return RN(t,i,r)||Ka(t,i)}else if(n==39||xr&&n==70&&r=="c"){let i=n==39?PN(t,t.state.selection.from)=="ltr"?1:-1:1;return RN(t,i,r)||Ka(t,i)}else{if(n==38||xr&&n==80&&r=="c")return FN(t,-1,r)||Ka(t,-1);if(n==40||xr&&n==78&&r=="c")return k9(t)||FN(t,1,r)||Ka(t,1);if(r==(xr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function VN(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")||Io.fromSchema(t.state.schema),a=GN(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let u=l.firstChild,d,h=0;for(;u&&u.nodeType==1&&(d=zN[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 jN(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=Io.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=D9(n),Uc&&R9(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")||ks.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!I9.test(p.parentNode.nodeName)?{ignore:!0}:null}})),d)a=M9(qN(a,+d[1],+d[2]),d[4]);else if(a=se.maxOpen(x9(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=qN(a,h,p)}return t.someProp("transformPasted",h=>{a=h(a,t)}),a}const I9=/^(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 x9(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&&UN(l,s,a,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=WN(o[o.length-1],s.length));let d=BN(a,l);o.push(d),i=i.matchType(d.type),s=l}}),o)return Y.from(o)}return t}function BN(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,Y.from(t));return t}function UN(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=UN(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(BN(n,t,i+1))))}}function WN(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,WN(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(Y.empty,!0);return t.copy(n.append(r))}function Uv(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=Uv(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 qN(t,e,n){return e<t.openStart&&(t=new se(Uv(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new se(Uv(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const zN={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 QN=null;function GN(){return QN||(QN=document.implementation.createHTMLDocument("title"))}let Wv=null;function C9(t){let e=window.trustedTypes;return e?(Wv||(Wv=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Wv.createHTML(t)):t}function D9(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=GN().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&zN[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=C9(t),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function R9(t){let e=t.querySelectorAll(En?"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 M9(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 Ln={},$n={},P9={touchstart:!0,touchmove:!0};class F9{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 L9(t){for(let e in Ln){let n=Ln[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{V9(t,r)&&!zv(t,r)&&(t.editable||!(r.type in $n))&&n(t,r)},P9[e]?{passive:!0}:void 0)}Fn&&t.dom.addEventListener("input",()=>null),qv(t)}function Ps(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function $9(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 qv(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>zv(t,r))})}function zv(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function V9(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 j9(t,e){!zv(t,e)&&Ln[e.type]&&(t.editable||!(e.type in $n))&&Ln[e.type](t,e)}$n.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!KN(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Yr&&En&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Ga&&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,Co(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||A9(t,n)?n.preventDefault():Ps(t,"key")},$n.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},$n.keypress=(t,e)=>{let n=e;if(KN(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||xr&&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 Gd(t){return{left:t.clientX,top:t.clientY}}function B9(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Qv(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 Ja(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 U9(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ye.isSelectable(r)?(Ja(t,new ye(n)),!0):!1}function W9(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?(Ja(t,ye.create(t.state.doc,i)),!0):!1}function q9(t,e,n,r,i){return Qv(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?W9(t,n):U9(t,n))}function z9(t,e,n,r){return Qv(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function Q9(t,e,n,r){return Qv(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||G9(t,n,r)}function G9(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ja(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)Ja(t,xe.create(r,a+1,a+1+o.content.size));else if(ye.isSelectable(o))Ja(t,ye.create(r,a));else continue;return!0}}function Gv(t){return Hd(t)}const HN=xr?"metaKey":"ctrlKey";Ln.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Gv(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&B9(n,t.input.lastClick)&&!n[HN]&&(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(Gd(n));o&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new H9(t,o,n,!!r)):(s=="doubleClick"?z9:Q9)(t,o.pos,o.inside,n)?n.preventDefault():Ps(t,"pointer"))};class H9{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[HN],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&&Jr&&!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)),Ps(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(()=>Ui(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(Gd(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ps(this.view,"pointer"):q9(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Fn&&this.mightDrag&&!this.mightDrag.node.isAtom||En&&!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)?(Ja(this.view,Le.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Ps(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ps(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)}}Ln.touchstart=t=>{t.input.lastTouch=Date.now(),Gv(t),Ps(t,"pointer")},Ln.touchmove=t=>{t.input.lastTouch=Date.now(),Ps(t,"pointer")},Ln.contextmenu=t=>Gv(t);function KN(t,e){return t.composing?!0:Fn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const K9=Yr?5e3:-1;$n.compositionstart=$n.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(),Hd(t,!0),t.markCursor=null;else if(Hd(t,!e.selection.empty),Jr&&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}JN(t,K9)},$n.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++,JN(t,20))};function JN(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Hd(t),e))}function YN(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Y9());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function J9(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=UJ(e.focusNode,e.focusOffset),r=WJ(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 Y9(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Hd(t,e=!1){if(!(Yr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),YN(t),e||t.docView&&t.docView.dirty){let n=Lv(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 X9(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 Gc=Jn&&Cs<15||Ga&&HJ<604;Ln.copy=$n.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=Gc?null:n.clipboardData,o=r.content(),{dom:a,text:l}=VN(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):X9(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Z9(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function eY(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?Hc(t,r.value,null,i,e):Hc(t,r.textContent,r.innerHTML,i,e)},50)}function Hc(t,e,n,r,i){let s=jN(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=Z9(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 XN(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," "):""}$n.paste=(t,e)=>{let n=e;if(t.composing&&!Yr)return;let r=Gc?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Hc(t,XN(r),r.getData("text/html"),i,n)?n.preventDefault():eY(t,n)};class ZN{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const eA=xr?"altKey":"ctrlKey";Ln.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(Gd(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}=VN(t,a);(!n.dataTransfer.files.length||!En||sN>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Gc?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Gc||n.dataTransfer.setData("text/plain",u),t.dragging=new ZN(d,!n[eA],o)},Ln.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},$n.dragover=$n.dragenter=(t,e)=>e.preventDefault(),$n.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Gd(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=jN(t,XN(n.dataTransfer),Gc?null:n.dataTransfer.getData("text/html"),!1,s);let a=!!(r&&!n[eA]);if(t.someProp("handleDrop",y=>y(t,n,o||se.empty,a))){n.preventDefault();return}if(!o)return;n.preventDefault();let l=o?W1(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(Vv(t,g,u.doc.resolve(y)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))},Ln.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())&&Ui(t)},20))},Ln.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)},Ln.beforeinput=(t,e)=>{if(En&&Yr&&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,Co(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 $n)Ln[t]=$n[t];function Kc(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 Kd{constructor(e,n){this.toDOM=e,this.spec=n||Po,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 Dr(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Kd&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Kc(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Fs{constructor(e,n){this.attrs=e,this.spec=n||Po}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 Dr(s,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Fs&&Kc(this.attrs,e.attrs)&&Kc(this.spec,e.spec)}static is(e){return e.type instanceof Fs}destroy(){}}class Hv{constructor(e,n){this.attrs=e,this.spec=n||Po}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 Dr(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 Hv&&Kc(this.attrs,e.attrs)&&Kc(this.spec,e.spec)}destroy(){}}class Dr{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Dr(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 Dr(e,e,new Kd(n,r))}static inline(e,n,r,i){return new Dr(e,n,new Fs(r,i))}static node(e,n,r,i){return new Dr(e,n,new Hv(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Fs}get widget(){return this.type instanceof Kd}}const Ya=[],Po={};class qt{constructor(e,n){this.local=e.length?e:Ya,this.children=n.length?n:Ya}static create(e,n){return n.length?Jd(n,e,0,Po):wn}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==wn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Po)}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?tY(this.children,o||[],e,n,r,i,s):o?new qt(o.sort(Fo),Ya):wn}add(e,n){return n.length?this==wn?qt.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=nA(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,Jd(d,a,u+1,Po)),s+=3}});let o=tA(s?rA(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new qt(o.length?this.local.concat(o).sort(Fo):this.local,i||this.children)}remove(e){return e.length==0||this==wn?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!=wn?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 qt(i,r):wn}forChild(e,n){if(this==wn)return this;if(n.isLeaf)return qt.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 Fs){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 qt(i.sort(Fo),Ya);return r?new Ls([a,r]):a}return r||wn}eq(e){if(this==e)return!0;if(!(e instanceof qt)||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 Kv(this.localsInner(e))}localsInner(e){if(this==wn)return Ya;if(e.inlineContent||!this.local.some(Fs.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Fs||n.push(this.local[r]);return n}forEachSet(e){e(this)}}qt.empty=new qt([],[]),qt.removeOverlap=Kv;const wn=qt.empty;class Ls{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Po));return Ls.from(r)}forChild(e,n){if(n.isLeaf)return qt.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=wn&&(s instanceof Ls?r=r.concat(s.members):r.push(s))}return Ls.from(r)}eq(e){if(!(e instanceof Ls)||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?Kv(r?n:n.sort(Fo)):Ya}static from(e){switch(e.length){case 0:return wn;case 1:return e[0];default:return new Ls(e.every(n=>n instanceof qt)?e:e.reduce((n,r)=>n.concat(r instanceof qt?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function tY(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!=wn?(a[u]=h,a[u+1]=g,a[u+2]=w):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=nY(a,t,e,n,i,s,o),d=Jd(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 qt(e.sort(Fo),a)}function tA(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 Dr(i.from+e,i.to+e,i.type))}return n}function nY(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 nA(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 rA(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Jd(t,e,n,r){let i=[],s=!1;e.forEach((a,l)=>{let u=nA(t,a,l+n);if(u){s=!0;let d=Jd(u,a,n+l+1,r);d!=wn&&i.push(l,l+a.nodeSize,d)}});let o=tA(s?rA(t):t,-n).sort(Fo);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 qt(o,i):wn}function Fo(t,e){return t.from-e.from||t.to-e.to}function Kv(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),iA(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),iA(e,i,r.copy(s.from,r.to)));break}}}return e}function iA(t,e,n){for(;e<t.length&&Fo(n,t[e])>0;)e++;t.splice(e,0,n)}function Jv(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=wn&&e.push(r)}),t.cursorWrapper&&e.push(qt.create(t.state.doc,[t.cursorWrapper.deco])),Ls.from(e)}const rY={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},iY=Jn&&Cs<=11;class sY{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 oY{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new sY,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]);Jn&&Cs<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),iY&&(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,rY)),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(CN(this.view)){if(this.suppressingSelectionUpdates)return Ui(this.view);if(Jn&&Cs<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&xo(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=jc(s))n.add(s);for(let s=e.anchorNode;s;s=jc(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)&&CN(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(Jr&&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||cY(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&&Wd(r)&&(u=Lv(e))&&u.eq(Le.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ui(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),aY(e)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ui(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(Jn&&Cs<=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?cn(i)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?cn(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 sA=new WeakMap,oA=!1;function aY(t){if(!sA.has(t)&&(sA.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Jr,oA)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."),oA=!0}}function aA(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return xo(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function lY(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return aA(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?aA(t,n):null}function cY(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 uY(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}],Wd(l)||u.push({node:l.focusNode,offset:l.focusOffset})),En&&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")||ks.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:fY,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 fY(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 dY=/^(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 hY(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=Lv(t,x);if(U&&!t.state.selection.eq(U)){if(En&&Yr&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",ke=>ke(t,Co(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=uY(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=gY(h.content,u.doc.content,u.from,p,g);if(y&&t.input.domChangeCount++,(Ga&&t.input.lastIOSEnter>Date.now()-225||Yr)&&i.some(x=>x.nodeType==1&&!dY.test(x.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",x=>x(t,Co(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=lA(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)),Jn&&Cs<=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((Ga&&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,Co(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&mY(d,y.start,y.endA,b,_)&&t.someProp("handleKeyDown",x=>x(t,Co(8,"Backspace")))){Yr&&En&&t.domObserver.suppressSelectionUpdates();return}En&&Yr&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Yr&&!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,Co(13,"Enter"))})},20));let I=y.start,P=y.endA,M,B,Q;if(O){if(b.pos==_.pos)Jn&&Cs<=11&&b.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ui(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=pY(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=lA(t,M.doc,u.sel);x&&!(En&&Yr&&t.composing&&x.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(x.head==I||x.head==M.mapping.map(P)-1)||Jn&&x.empty&&x.head==I)&&M.setSelection(x)}B&&M.ensureMarks(B),s&&M.setMeta("composition",s),t.dispatch(M.scrollIntoView())}function lA(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Vv(t,e.resolve(n.anchor),e.resolve(n.head))}function pY(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 mY(t,e,n,r,i){if(n-e<=i.pos-r.pos||Yv(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(Yv(s,!0,!0));return!o.parent.isTextblock||o.pos>n||Yv(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Yv(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 gY(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&&cA(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&&cA(t.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}function cA(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 yY{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 F9,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(pA),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=dA(this),fA(this),this.nodeViews=hA(this),this.docView=bN(this.state.doc,uA(this),Jv(this),this.dom,this),this.domObserver=new oY(this,(r,i,s,o)=>hY(this,r,i,s,o)),this.domObserver.start(),L9(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&&qv(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(pA),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&&(YN(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=hA(this);bY(g,this.nodeViews)&&(this.nodeViews=g,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&qv(this),this.editable=dA(this),fA(this);let l=Jv(this),u=uA(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&&YJ(this);if(o){this.domObserver.stop();let g=h&&(Jn||En)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&vY(i.selection,e.selection);if(h){let y=En?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=J9(this)),(s||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=bN(e.doc,u,l,this.dom,this)),y&&!this.trackWrites&&(g=!0)}g||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&E9(this))?Ui(this,g):(IN(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&&XJ(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&&oN(this,n.getBoundingClientRect(),e)}else oN(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 ZN(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(Jn){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&&ZJ(this.dom),Ui(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 i9(this,e)}coordsAtPos(e,n=1){return dN(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 c9(this,n||this.state,e)}pasteHTML(e,n){return Hc(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Hc(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&($9(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Jv(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,jJ())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return j9(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&&zJ(this.dom.ownerDocument)==this.dom&&lY(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function uA(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"),[Dr.node(0,t.state.doc.content.size,e)]}function fA(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:Dr.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function dA(t){return!t.someProp("editable",e=>e(t.state)===!1)}function vY(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 hA(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 bY(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 pA(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")}for(var $s={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:"'"},Yd={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},_Y=typeof navigator<"u"&&/Mac/.test(navigator.platform),EY=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),un=0;un<10;un++)$s[48+un]=$s[96+un]=String(un);for(var un=1;un<=24;un++)$s[un+111]="F"+un;for(var un=65;un<=90;un++)$s[un]=String.fromCharCode(un+32),Yd[un]=String.fromCharCode(un);for(var Xv in $s)Yd.hasOwnProperty(Xv)||(Yd[Xv]=$s[Xv]);function wY(t){var e=_Y&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||EY&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Yd:$s)[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 TY=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function SY(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))TY?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 OY(t){let e=Object.create(null);for(let n in t)e[SY(n)]=t[n];return e}function Zv(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 kY(t){return new Kn({props:{handleKeyDown:mA(t)}})}function mA(t){let e=OY(t);return function(n,r){let i=wY(r),s,o=e[Zv(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Zv(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=$s[r.keyCode])&&s!=i){let a=e[Zv(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const eb=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function gA(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const yA=(t,e,n)=>{let r=gA(t,n);if(!r)return!1;let i=tb(r);if(!i){let o=r.blockRange(),a=o&&Ua(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(kA(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Xa(s,"end")||ye.isSelectable(s)))for(let o=r.depth;;o--){let a=jd(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(Xa(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},NY=(t,e,n)=>{let r=gA(t,n);if(!r)return!1;let i=tb(r);return i?vA(t,i,e):!1},AY=(t,e,n)=>{let r=_A(t,n);if(!r)return!1;let i=nb(r);return i?vA(t,i,e):!1};function vA(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=jd(t.doc,s,l,se.empty);if(!u||u.from!=s||u instanceof Yt&&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 Xa(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 bA=(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=tb(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 tb(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 _A(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const EA=(t,e,n)=>{let r=_A(t,n);if(!r)return!1;let i=nb(r);if(!i)return!1;let s=i.nodeAfter;if(kA(t,i,e,1))return!0;if(r.parent.content.size==0&&(Xa(s,"start")||ye.isSelectable(s))){let o=jd(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(Xa(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},wA=(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=nb(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 nb(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 IY=(t,e)=>{let n=t.selection,r=n instanceof ye,i;if(r){if(n.node.isTextblock||!Is(t.doc,n.from))return!1;i=n.from}else if(i=Vd(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},xY=(t,e)=>{let n=t.selection,r;if(n instanceof ye){if(n.node.isTextblock||!Is(t.doc,n.to))return!1;r=n.to}else if(r=Vd(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},CY=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&Ua(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},TA=(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 rb(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 DY=(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=rb(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},SA=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Ar||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=rb(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},OA=(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(Vi(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Ua(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function RY(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof ye&&e.selection.node.isBlock)return!r.parentOffset||!Vi(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=rb(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 Ar)&&d.deleteSelection();let h=d.mapping.map(r.pos),p=Vi(d.doc,h,s.length,s);if(p||(s[0]=a?{type:a}:null,p=Vi(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 MY=RY(),PY=(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 FY(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||Is(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function kA(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&FY(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 Xt(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&&Is(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&&Ua(h);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(h,p).scrollIntoView()),!0;if(u&&Xa(s,"start",!0)&&Xa(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 Xt(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 NA(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 LY=NA(-1),$Y=NA(1);function VY(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&wv(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function AA(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 ib(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}ib(eb,yA,bA),ib(eb,EA,wA),ib(TA,SA,OA,MY),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function jY(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 Cd(d,d,o.depth),o.endIndex<o.parent.childCount&&(o=new Cd(i,n.doc.resolve(s.end(o.depth)),o.depth)),a=!0}let u=wv(l,t,e,o);return u?(r&&r(BY(n.tr,o,u,a,t).scrollIntoView()),!0):!1}}function BY(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 Xt(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&&Vi(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(d).nodeSize;return t}function UY(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?WY(e,n,t,s):qY(e,n,s):!0:!1}}function WY(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new Xt(s-1,o,s,o,new se(Y.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Cd(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=Ua(r);if(a==null)return!1;i.lift(r,a);let l=i.mapping.map(s,-1)-1;return Is(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function qY(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 Xt(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 zY(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 Xt(p-(u?3:1),g,p,g,h,1,!0)).scrollIntoView())}return!0}}function Xd(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 Zd{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:Xd({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 QY{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 eh(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 IA(t){const e=[],{nodeExtensions:n,markExtensions:r}=eh(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 Zt(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 zt(...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 sb(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)=>zt(n,r),{})}function xA(t){return typeof t=="function"}function ze(t,e=void 0,...n){return xA(t)?e?t.bind(e)(...n):t(...n):t}function GY(t={}){return Object.keys(t).length===0&&t.constructor===Object}function HY(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function CA(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):HY(n.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function DA(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&GY(n)?!1:n!=null))}function KY(t,e){var n;const r=IA(t),{nodeExtensions:i,markExtensions:s}=eh(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=DA({...p,content:ze(ue(u,"content",h)),marks:ze(ue(u,"marks",h)),group:ze(ue(u,"group",h)),inline:ze(ue(u,"inline",h)),atom:ze(ue(u,"atom",h)),selectable:ze(ue(u,"selectable",h)),draggable:ze(ue(u,"draggable",h)),code:ze(ue(u,"code",h)),whitespace:ze(ue(u,"whitespace",h)),defining:ze(ue(u,"defining",h)),isolating:ze(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=ze(ue(u,"parseHTML",h));y&&(g.parseDOM=y.map(w=>CA(w,d)));const b=ue(u,"renderHTML",h);b&&(g.toDOM=w=>b({node:w,HTMLAttributes:sb(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=DA({...p,inclusive:ze(ue(u,"inclusive",h)),excludes:ze(ue(u,"excludes",h)),group:ze(ue(u,"group",h)),spanning:ze(ue(u,"spanning",h)),code:ze(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=ze(ue(u,"parseHTML",h));y&&(g.parseDOM=y.map(_=>CA(_,d)));const b=ue(u,"renderHTML",h);return b&&(g.toDOM=_=>b({mark:_,HTMLAttributes:sb(_,d)})),[u.name,g]}));return new T1({topNode:o,nodes:a,marks:l})}function ob(t,e){return e.nodes[t]||e.marks[t]||null}function RA(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const JY=(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 ab(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class th{constructor(e){this.find=e.find,this.handler=e.handler}}const YY=(t,e)=>{if(ab(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 nh(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=JY(u)+s;return o.forEach(p=>{if(d)return;const g=YY(h,p.find);if(!g)return;const y=l.state.tr,b=Xd({state:l.state,transaction:y}),_={from:r-(g[0].length-s.length),to:i},{commands:w,chain:O,can:N}=new Zd({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 XY(t){const{editor:e,rules:n}=t,r=new Kn({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;nh({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 nh({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&nh({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?nh({editor:e,from:o.pos,to:o.pos,text:`
365
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function ZY(t){return Object.prototype.toString.call(t).slice(8,-1)}function rh(t){return ZY(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function ih(t,e){const n={...t};return rh(t)&&rh(e)&&Object.keys(e).forEach(r=>{rh(e[r])&&rh(t[r])?n[r]=ih(t[r],e[r]):n[r]=e[r]}),n}class Rr{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=ze(ue(this,"addOptions",{name:this.name}))),this.storage=ze(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Rr(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>ih(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Rr(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=ze(ue(n,"addOptions",{name:n.name})),n.storage=ze(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 e7(t){return typeof t=="number"}class t7{constructor(e){this.find=e.find,this.handler=e.handler}}const n7=(t,e,n)=>{if(ab(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 r7(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:u,can:d}=new Zd({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,"");n7(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 i7=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 s7(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,_=Xd({state:d,transaction:b});if(!(!r7({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 Kn({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=i7(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(!(!e7(N)||!I||N===I.b))return l({rule:d,state:g,from:N,to:I,pasteEvt:o})}}))}function o7(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class Za{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Za.resolve(e),this.schema=KY(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Za.sort(Za.flatten(e)),r=o7(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:ob(n.name,this.schema)},i=ue(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=Za.sort([...this.extensions].reverse()),r=[],i=[],s=n.map(o=>{const a={name:o.name,options:o.options,storage:o.storage,editor:e,type:ob(o.name,this.schema)},l=[],u=ue(o,"addKeyboardShortcuts",a);let d={};if(o.type==="mark"&&ue(o,"exitable",a)&&(d.ArrowRight=()=>Rr.handleExit({editor:e,mark:o})),u){const b=Object.fromEntries(Object.entries(u()).map(([_,w])=>[_,()=>w({editor:e})]));d={...d,...b}}const h=kY(d);l.push(h);const p=ue(o,"addInputRules",a);RA(o,e.options.enableInputRules)&&p&&r.push(...p());const g=ue(o,"addPasteRules",a);RA(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[XY({editor:e,rules:r}),...s7({editor:e,rules:i}),...s]}get attributes(){return IA(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=eh(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:Zt(r.name,this.schema)},o=ue(r,"addNodeView",s);if(!o)return[];const a=(l,u,d,h,p)=>{const g=sb(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:ob(e.name,this.schema)};e.type==="mark"&&(!((n=ze(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 Tn{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=ze(ue(this,"addOptions",{name:this.name}))),this.storage=ze(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Tn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>ih(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Tn({...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=ze(ue(n,"addOptions",{name:n.name})),n.storage=ze(ue(n,"addStorage",{name:n.name,options:n.options})),n}}function MA(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 PA(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const a7=Tn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Kn({key:new mi("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=PA(n);return MA(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),l7=()=>({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),c7=(t=!1)=>({commands:e})=>e.setContent("",t),u7=()=>({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=Ua(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},f7=t=>e=>t(e),d7=()=>({state:t,dispatch:e})=>SA(t,e),h7=(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},p7=()=>({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},m7=t=>({tr:e,state:n,dispatch:r})=>{const i=Zt(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},g7=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},y7=()=>({state:t,dispatch:e})=>eb(t,e),v7=()=>({commands:t})=>t.keyboardShortcut("Enter"),b7=()=>({state:t,dispatch:e})=>DY(t,e);function sh(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:ab(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function lb(t,e,n={}){return t.find(r=>r.type===e&&sh(r.attrs,n))}function _7(t,e,n={}){return!!lb(t,e,n)}function cb(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=lb([...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(lb([...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&&_7([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function Vs(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 E7=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const s=Vs(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:u,to:d}=a;if(i){const h=cb(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},w7=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 FA(t){return t instanceof xe}function Lo(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function LA(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,Lo(0,i,s),Lo(t.content.size,i,s)):xe.create(t,Lo(e,i,s),Lo(e,i,s))}function ub(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const T7=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{ub()&&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&&!FA(n.state.selection))return o(),!0;const a=LA(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},S7=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),O7=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),$A=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&&$A(r)}return t};function oh(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return $A(n)}function ah(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),ah("",e,n)}if(i){if(n.errorOnInvalidContent){let o=!1,a="";const l=new T1({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?ks.fromSchema(l).parseSlice(oh(t),n.parseOptions):ks.fromSchema(l).parse(oh(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=ks.fromSchema(e);return n.slice?s.parseSlice(oh(t),n.parseOptions).content:s.parse(oh(t),n.parseOptions)}return ah("",e,n)}function k7(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Yt||i instanceof Xt))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 N7=t=>!("type"in t),A7=(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=ah(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((N7(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&&k7(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},I7=()=>({state:t,dispatch:e})=>IY(t,e),x7=()=>({state:t,dispatch:e})=>xY(t,e),C7=()=>({state:t,dispatch:e})=>yA(t,e),D7=()=>({state:t,dispatch:e})=>EA(t,e),R7=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Vd(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},M7=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Vd(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},P7=()=>({state:t,dispatch:e})=>NY(t,e),F7=()=>({state:t,dispatch:e})=>AY(t,e);function VA(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function L7(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))ub()||VA()?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 $7=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=L7(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 Jc(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?Zt(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=>sh(h.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((h,p)=>h+p.to-p.from,0)>=l}const V7=(t,e={})=>({state:n,dispatch:r})=>{const i=Zt(t,n.schema);return Jc(n,i,e)?CY(n,r):!1},j7=()=>({state:t,dispatch:e})=>OA(t,e),B7=t=>({state:e,dispatch:n})=>{const r=Zt(t,e.schema);return UY(r)(e,n)},U7=()=>({state:t,dispatch:e})=>TA(t,e);function lh(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function jA(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 W7=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=lh(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=Zt(t,r.schema)),a==="mark"&&(o=Vs(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,jA(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(h=>{o===h.type&&n.addMark(d,d+u.nodeSize,o.create(jA(h.attrs,e)))})})}),!0):!1},q7=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),z7=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),Q7=()=>({state:t,dispatch:e})=>bA(t,e),G7=()=>({state:t,dispatch:e})=>wA(t,e),H7=()=>({state:t,dispatch:e})=>PY(t,e),K7=()=>({state:t,dispatch:e})=>$Y(t,e),J7=()=>({state:t,dispatch:e})=>LY(t,e);function fb(t,e,n={},r={}){return ah(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const Y7=(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=fb(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 BA(t,e){const n=Vs(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 X7(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 Z7(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 db(t){return e=>Z7(e.$from,t)}function eX(t,e){const n=Io.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function tX(t,e){const n={from:0,to:t.content.size};return MA(t,n,e)}function nX(t,e){const n=Zt(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 rX(t,e){const n=lh(typeof e=="string"?e:e.name,t.schema);return n==="node"?nX(t,e):n==="mark"?BA(t,e):{}}function UA(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=cb(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 ch(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 hb(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?Vs(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>s?s.name===h.type.name:!0).find(h=>sh(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=>sh(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 iX(t,e,n={}){if(!e)return Jc(t,null,n)||hb(t,null,n);const r=lh(e,t.schema);return r==="node"?Jc(t,e,n):r==="mark"?hb(t,e,n):!1}function WA(t,e){const{nodeExtensions:n}=eh(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=ze(ue(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function pb(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&&(pb(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function sX(t){return t instanceof ye}function oX(t,e,n){var r;const{selection:i}=e;let s=null;if(FA(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 aX=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=Vs(t,r.schema);if(i)if(o){const u=BA(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 oX(r,n,l)},lX=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),cX=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=Zt(t,n.schema);return s.isTextblock?i().command(({commands:o})=>AA(s,e)(n)?!0:o.clearNodes()).command(({state:o})=>AA(s,e)(o,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},uX=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Lo(t,0,r.content.size),s=ye.create(r,i);e.setSelection(s)}return!0},fX=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=Lo(i,o,a),u=Lo(s,o,a),d=xe.create(r,l,u);e.setSelection(d)}return!0},dX=t=>({state:e,dispatch:n})=>{const r=Zt(t,e.schema);return zY(r)(e,n)};function qA(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 hX=({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=ch(u,a.node().type.name,a.node().attrs);if(s instanceof ye&&s.node.isBlock)return!a.parentOffset||!Vi(o,a.pos)?!1:(r&&(t&&qA(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:X7(a.node(-1).contentMatchAt(a.indexAfter(-1)));let g=h&&p?[{type:p,attrs:d}]:void 0,y=Vi(e.doc,e.mapping.map(a.pos),1,g);if(!g&&!y&&Vi(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&&qA(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return y},pX=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=Zt(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={...ch(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={...ch(p,h.type.name,h.attrs),...e},b={...ch(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(!Vi(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},mb=(t,e)=>{const n=db(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)&&Is(t.doc,n.pos)&&t.join(n.pos),!0},gb=(t,e)=>{const n=db(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)&&Is(t.doc,r)&&t.join(r),!0};var mX=Object.freeze({__proto__:null,blur:l7,clearContent:c7,clearNodes:u7,command:f7,createParagraphNear:d7,cut:h7,deleteCurrentNode:p7,deleteNode:m7,deleteRange:g7,deleteSelection:y7,enter:v7,exitCode:b7,extendMarkRange:E7,first:w7,focus:T7,forEach:S7,insertContent:O7,insertContentAt:A7,joinBackward:C7,joinDown:x7,joinForward:D7,joinItemBackward:R7,joinItemForward:M7,joinTextblockBackward:P7,joinTextblockForward:F7,joinUp:I7,keyboardShortcut:$7,lift:V7,liftEmptyBlock:j7,liftListItem:B7,newlineInCode:U7,resetAttributes:W7,scrollIntoView:q7,selectAll:z7,selectNodeBackward:Q7,selectNodeForward:G7,selectParentNode:H7,selectTextblockEnd:K7,selectTextblockStart:J7,setContent:Y7,setMark:aX,setMeta:lX,setNode:cX,setNodeSelection:uX,setTextSelection:fX,sinkListItem:dX,splitBlock:hX,splitListItem:pX,toggleList:(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=Zt(t,o.schema),y=Zt(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=db(M=>WA(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(WA(P.node.type.name,h)&&g.validContent(P.node.content)&&a)return l().command(()=>(s.setNodeMarkup(P.pos,g),!0)).command(()=>mb(s,g)).command(()=>gb(s,g)).run()}return!n||!I||!a?l().command(()=>d().wrapInList(g,r)?!0:u.clearNodes()).wrapInList(g,r).command(()=>mb(s,g)).command(()=>gb(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(()=>mb(s,g)).command(()=>gb(s,g)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=Vs(t,r.schema);return hb(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const s=Zt(t,r.schema),o=Zt(e,r.schema),a=Jc(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})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const i=Zt(t,n.schema);return Jc(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({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},unsetAllMarks:()=>({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},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=Vs(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=cb(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},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=lh(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=Zt(t,r.schema)),a==="mark"&&(o=Vs(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},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const i=Zt(t,n.schema);return VY(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Zt(t,n.schema);return jY(i,e)(n,r)}});const gX=Tn.create({name:"commands",addCommands(){return{...mX}}}),yX=Tn.create({name:"drop",addProseMirrorPlugins(){return[new Kn({key:new mi("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),vX=Tn.create({name:"editable",addProseMirrorPlugins(){return[new Kn({key:new mi("editable"),props:{editable:()=>this.editor.options.editable}})]}}),bX=Tn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Kn({key:new mi("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}}}})]}}),_X=Tn.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 ub()||VA()?s:i},addProseMirrorPlugins(){return[new Kn({key:new mi("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)||!pb(n.doc))return;const p=n.tr,g=Xd({state:n,transaction:p}),{commands:y}=new Zd({editor:this.editor,state:g});if(y.clearNodes(),!!p.steps.length)return p}})]}}),EX=Tn.create({name:"paste",addProseMirrorPlugins(){return[new Kn({key:new mi("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),wX=Tn.create({name:"tabindex",addProseMirrorPlugins(){return[new Kn({key:new mi("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class $o{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 $o(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 $o(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 $o(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 $o(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new $o(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 TX=`.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 SX(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 OX extends QY{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=SX(TX,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=xA(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?[vX,a7.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),gX,bX,_X,wX,yX,EX].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 Za(i,this)}createCommandManager(){this.commandManager=new Zd({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=fb(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=fb(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=LA(e,this.options.autofocus);this.view=new yY(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Qa.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 rX(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return iX(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return eX(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
442
+
443
+ `,textSerializers:r={}}=e||{};return tX(this.state.doc,{blockSeparator:n,textSerializers:{...PA(this.schema),...r}})}get isEmpty(){return pb(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 $o(n,this)}get $doc(){return this.$pos(0)}}function Vo(t){return new th({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ze(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(UA(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 kX(t){return new th({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ze(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 yb(t){return new th({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=ze(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 Yc(t){return new th({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=ze(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),u=l&&wv(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&&Is(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&o.join(n.from-1)}})}class Yn{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=ze(ue(this,"addOptions",{name:this.name}))),this.storage=ze(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Yn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>ih(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Yn(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=ze(ue(n,"addOptions",{name:n.name})),n.storage=ze(ue(n,"addStorage",{name:n.name,options:n.options})),n}}function jo(t){return new t7({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=ze(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(UA(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 NX=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,AX=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,IX=Rr.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",zt(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[Vo({find:NX,type:this.type})]},addPasteRules(){return[jo({find:AX,type:this.type})]}}),xX=Rr.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",zt(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()}}}),CX=Rr.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",zt(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()}}}),DX=Tn.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")}}}),RX=Rr.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",zt(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 MX(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vb={exports:{}},bb={};/**
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 zA;function PX(){if(zA)return bb;zA=1;var t=ae;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 bb.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,bb}var _b={};/**
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 QA;function FX(){return QA||(QA=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=ae,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;_b.useSyncExternalStore=O,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),_b}process.env.NODE_ENV==="production"?vb.exports=PX():vb.exports=FX();var uh=vb.exports;const LX=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},$X=({contentComponent:t})=>{const e=uh.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return ae.createElement(ae.Fragment,null,Object.values(e))};function VX(){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]:FC.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 jX extends ae.Component{constructor(e){var n;super(e),this.editorContentRef=ae.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=VX(),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 ae.createElement(ae.Fragment,null,ae.createElement("div",{ref:LX(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&ae.createElement($X,{contentComponent:e.contentComponent}))}}const BX=ae.forwardRef((t,e)=>{const n=ae.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return ae.createElement(jX,{key:n,innerRef:e,...t})}),UX=ae.memo(BX);var WX=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},qX=MX(WX),Eb={exports:{}},wb={};/**
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 GA;function zX(){if(GA)return wb;GA=1;var t=ae,e=uh;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 wb.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(_),_},wb}var Tb={};/**
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 HA;function QX(){return HA||(HA=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=ae,e=uh;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 pe=g(ke);if(y!==void 0&&_.hasValue){var Ce=_.value;if(y(Ce,pe))return B=Ce,Ce}return B=pe,pe}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}Tb.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Tb}process.env.NODE_ENV==="production"?Eb.exports=zX():Eb.exports=QX();var GX=Eb.exports;class HX{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 KX(t){var e;const[n]=ae.useState(()=>new HX(t.editor)),r=GX.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:qX);return ae.useEffect(()=>n.watch(t.editor),[t.editor,n]),ae.useDebugValue(r),r}const KA=process.env.NODE_ENV!=="production",Sb=typeof window>"u",JX=Sb||!!(typeof window<"u"&&window.next);class YX{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 Sb||JX?(KA&&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&&Sb&&KA)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 OX(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 XX(t={},e=[]){const n=ae.useRef(t);n.current=t;const[r]=ae.useState(()=>new YX(n)),i=uh.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return ae.useDebugValue(i),ae.useEffect(r.onRender(e)),KX({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&s===0?0:s+1}),i}const JA=ae.createContext({editor:null}),ZX=JA.Consumer;function eZ({children:t,slotAfter:e,slotBefore:n,editorContainerProps:r={},...i}){const s=XX(i);return s?ae.createElement(JA.Provider,{value:{editor:s}},n,ae.createElement(ZX,null,({editor:o})=>ae.createElement(UX,{editor:o,...r})),t,e):null}const tZ=ae.createContext({onDragStart:void 0}),nZ=()=>ae.useContext(tZ);ae.forwardRef((t,e)=>{const{onDragStart:n}=nZ(),r=t.as||"div";return ae.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});const rZ=/^\s*>\s$/,iZ=Yn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",zt(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[Yc({find:rZ,type:this.type})]}}),sZ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,oZ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,aZ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,lZ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,cZ=Rr.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",zt(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[Vo({find:sZ,type:this.type}),Vo({find:aZ,type:this.type})]},addPasteRules(){return[jo({find:oZ,type:this.type}),jo({find:lZ,type:this.type})]}}),uZ="listItem",YA="textStyle",XA=/^\s*([-+*])\s$/,fZ=Yn.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",zt(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(uZ,this.editor.getAttributes(YA)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Yc({find:XA,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Yc({find:XA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(YA),editor:this.editor})),[t]}}),dZ=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,hZ=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,pZ=Rr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",zt(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[Vo({find:dZ,type:this.type})]},addPasteRules(){return[jo({find:hZ,type:this.type})]}}),mZ=/^```([a-z]+)?[\s\n]$/,gZ=/^~~~([a-z]+)?[\s\n]$/,yZ=Yn.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",zt(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[yb({find:mZ,type:this.type,getAttributes:t=>({language:t[1]})}),yb({find:gZ,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Kn({key:new mi("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}}})]}}),vZ=Yn.create({name:"doc",topNode:!0,content:"block+"});function bZ(t={}){return new Kn({view(e){return new _Z(e,t)}})}class _Z{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=W1(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 EZ=Tn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[bZ(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 Ob(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!wZ(e)||!TZ(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 Ob{constructor(e){this.pos=e}map(e){return new Ob(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return xt.valid(n)?new xt(n):Le.near(n)}}function wZ(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 TZ(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 SZ(){return new Kn({props:{decorations:AZ,createSelectionBetween(t,e,n){return e.pos==n.pos&&xt.valid(n)?new xt(n):null},handleClick:kZ,handleKeyDown:OZ,handleDOMEvents:{beforeinput:NZ}}})}const OZ=mA({ArrowLeft:fh("horiz",-1),ArrowRight:fh("horiz",1),ArrowUp:fh("vert",-1),ArrowDown:fh("vert",1)});function fh(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 kZ(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 NZ(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 AZ(t){if(!(t.selection instanceof xt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",qt.create(t.doc,[Dr.widget(t.selection.head,e,{key:"gapcursor"})])}const IZ=Tn.create({name:"gapCursor",addProseMirrorPlugins(){return[SZ()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ze(ue(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),xZ=Yn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",zt(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()}}}),CZ=Yn.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]}`,zt(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=>yb({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var dh=200,en=function(){};en.prototype.append=function(e){return e.length?(e=en.from(e),!this.length&&e||e.length<dh&&this.leafAppend(e)||this.length<dh&&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 DZ(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 ZA(e):en.empty};var ZA=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<=dh)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=dh)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 ZA([]);var DZ=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 RZ=500;class Xr{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 vi(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 vi(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 Xr(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 vi(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>PZ&&(a=MZ(a,u),o-=u),new Xr(a.append(s),o)}remapping(e,n){let r=new ja;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 Xr(this.items.append(e.map(n=>new vi(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 vi(y,b,_))}else r.push(new vi(y))},i);let u=[];for(let p=n;p<o;p++)u.push(new vi(s.maps[p]));let d=this.items.slice(0,i).append(u).append(r),h=new Xr(d,a);return h.emptyItemCount()>RZ&&(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 vi(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 Xr(en.from(i.reverse()),s)}}Xr.empty=new Xr(en.empty,0);function MZ(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class vi{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 vi(n.getMap().invert(),n,this.selection)}}}class js{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const PZ=20;function FZ(t,e,n,r){let i=n.getMeta(Bo),s;if(i)return i.historyState;n.getMeta(VZ)&&(t=new js(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Bo))return o.getMeta(Bo).redo?new js(t.done.addTransform(n,void 0,r,hh(e)),t.undone,eI(n.mapping.maps),t.prevTime,t.prevComposition):new js(t.done,t.undone.addTransform(n,void 0,r,hh(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||!LZ(n,t.prevRanges)),u=o?kb(t.prevRanges,n.mapping):eI(n.mapping.maps);return new js(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,hh(e)),Xr.empty,u,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new js(t.done.rebased(n,s),t.undone.rebased(n,s),kb(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new js(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),kb(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function LZ(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 eI(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 kb(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 $Z(t,e,n){let r=hh(e),i=Bo.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 js(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(Bo,{redo:n,historyState:l})}let Nb=!1,tI=null;function hh(t){let e=t.plugins;if(tI!=e){Nb=!1,tI=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Nb=!0;break}}return Nb}const Bo=new mi("history"),VZ=new mi("closeHistory");function jZ(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Kn({key:Bo,state:{init(){return new js(Xr.empty,Xr.empty,null,0,-1)},apply(e,n,r){return FZ(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?rI:r=="historyRedo"?iI:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function nI(t,e){return(n,r)=>{let i=Bo.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=$Z(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const rI=nI(!1,!0),iI=nI(!0,!0),BZ=Tn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>rI(t,e),redo:()=>({state:t,dispatch:e})=>iI(t,e)}},addProseMirrorPlugins(){return[jZ(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()}}}),UZ=Yn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",zt(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}):sX(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[kX({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),WZ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,qZ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,zZ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,QZ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,GZ=Rr.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",zt(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[Vo({find:WZ,type:this.type}),Vo({find:zZ,type:this.type})]},addPasteRules(){return[jo({find:qZ,type:this.type}),jo({find:QZ,type:this.type})]}}),HZ=Yn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",zt(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)}}}),KZ="listItem",sI="textStyle",oI=/^(\d+)\.\s$/,JZ=Yn.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",zt(this.options.HTMLAttributes,n),0]:["ol",zt(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(KZ,this.editor.getAttributes(sI)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Yc({find:oI,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=Yc({find:oI,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(sI)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),YZ=Yn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),XZ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,ZZ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,eee=Rr.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",zt(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[Vo({find:XZ,type:this.type})]},addPasteRules(){return[jo({find:ZZ,type:this.type})]}}),tee=Yn.create({name:"text",group:"inline"}),nee=Tn.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(cZ.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&O.push(iZ.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&O.push(fZ.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&O.push(pZ.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&O.push(yZ.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&O.push(vZ.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&O.push(EZ.configure((o=this.options)===null||o===void 0?void 0:o.dropcursor)),this.options.gapcursor!==!1&&O.push(IZ.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&O.push(xZ.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&O.push(CZ.configure((u=this.options)===null||u===void 0?void 0:u.heading)),this.options.history!==!1&&O.push(BZ.configure((d=this.options)===null||d===void 0?void 0:d.history)),this.options.horizontalRule!==!1&&O.push(UZ.configure((h=this.options)===null||h===void 0?void 0:h.horizontalRule)),this.options.italic!==!1&&O.push(GZ.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&O.push(HZ.configure((g=this.options)===null||g===void 0?void 0:g.listItem)),this.options.orderedList!==!1&&O.push(JZ.configure((y=this.options)===null||y===void 0?void 0:y.orderedList)),this.options.paragraph!==!1&&O.push(YZ.configure((b=this.options)===null||b===void 0?void 0:b.paragraph)),this.options.strike!==!1&&O.push(eee.configure((_=this.options)===null||_===void 0?void 0:_.strike)),this.options.text!==!1&&O.push(tee.configure((w=this.options)===null||w===void 0?void 0:w.text)),O}}),ree=({content:t,style:e})=>he.jsx("div",{style:e,children:he.jsx(eZ,{editable:!1,extensions:[nee,RX,CX,xX,IX,DX.configure({types:["heading","paragraph"]})],content:t})});Kt.RichTextEditorContent=ree,Kt.WellPlayedProvider=N8,Kt.graphql=Va,Kt.readFragment=L8,Kt.useOrganization=n1,Kt.usePaginatedLoadAll=cv,Kt.usePaginatedQuery=A8,Kt.usePlayers=r1,Kt.useTournamentStep=W8,Kt.useTournamentTeams=i1,Kt.useWellPlayed=Xk,Object.defineProperty(Kt,Symbol.toStringTag,{value:"Module"})});