@flarehr/superhero-super-selection 5.36.60440 → 5.38.61955
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e,n,t,r,o,i,s,u={},l=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(e,n){for(var t in n)e[t]=n[t];return e}function f(e){var n=e.parentNode;n&&n.removeChild(e)}function d(n,t,r){var o,i,s,u={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:u[s]=t[s];if(arguments.length>2&&(u.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof n&&null!=n.defaultProps)for(s in n.defaultProps)void 0===u[s]&&(u[s]=n.defaultProps[s]);return h(n,u,o,i,null)}function h(e,r,o,i,s){var u={type:e,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==s?++t:s};return null==s&&null!=n.vnode&&n.vnode(u),u}function m(e){return e.children}function p(e,n){this.props=e,this.context=n}function w(e,n){if(null==n)return e.__?w(e.__,e.__.__k.indexOf(e)+1):null;for(var t;n<e.__k.length;n++)if(null!=(t=e.__k[n])&&null!=t.__e)return t.__e;return"function"==typeof e.type?w(e):null}function g(e){var n,t;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,n=0;n<e.__k.length;n++)if(null!=(t=e.__k[n])&&null!=t.__e){e.__e=e.__c.base=t.__e;break}return g(e)}}function y(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!_.__r++||i!==n.debounceRendering)&&((i=n.debounceRendering)||o)(_)}function _(){for(var e;_.__r=r.length;)e=r.sort((function(e,n){return e.__v.__b-n.__v.__b})),r=[],e.some((function(e){var n,t,r,o,i,s;e.__d&&(i=(o=(n=e).__v).__e,(s=n.__P)&&(t=[],(r=a({},o)).__v=o.__v+1,I(s,o,r,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[i]:null,t,null==i?w(o):i,o.__h),T(t,o),o.__e!=i&&g(o)))}))}function v(e,n,t,r,o,i,s,c,a,f){var d,p,g,y,_,v,b,S=r&&r.__k||l,E=S.length;for(t.__k=[],d=0;d<n.length;d++)if(null!=(y=t.__k[d]=null==(y=n[d])||"boolean"==typeof y?null:"string"==typeof y||"number"==typeof y||"bigint"==typeof y?h(null,y,null,null,y):Array.isArray(y)?h(m,{children:y},null,null,null):y.__b>0?h(y.type,y.props,y.key,null,y.__v):y)){if(y.__=t,y.__b=t.__b+1,null===(g=S[d])||g&&y.key==g.key&&y.type===g.type)S[d]=void 0;else for(p=0;p<E;p++){if((g=S[p])&&y.key==g.key&&y.type===g.type){S[p]=void 0;break}g=null}I(e,y,g=g||u,o,i,s,c,a,f),_=y.__e,(p=y.ref)&&g.ref!=p&&(b||(b=[]),g.ref&&b.push(g.ref,null,y),b.push(p,y.__c||_,y)),null!=_?(null==v&&(v=_),"function"==typeof y.type&&y.__k===g.__k?y.__d=a=C(y,a,e):a=x(e,y,g,S,_,a),"function"==typeof t.type&&(t.__d=a)):a&&g.__e==a&&a.parentNode!=e&&(a=w(g))}for(t.__e=v,d=E;d--;)null!=S[d]&&("function"==typeof t.type&&null!=S[d].__e&&S[d].__e==t.__d&&(t.__d=w(r,d+1)),O(S[d],S[d]));if(b)for(d=0;d<b.length;d++)F(b[d],b[++d],b[++d])}function C(e,n,t){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,n="function"==typeof r.type?C(r,n,t):x(t,r,r,o,r.__e,n));return n}function b(e,n){return n=n||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){b(e,n)})):n.push(e)),n}function x(e,n,t,r,o,i){var s,u,l;if(void 0!==n.__d)s=n.__d,n.__d=void 0;else if(null==t||o!=i||null==o.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(o),s=null;else{for(u=i,l=0;(u=u.nextSibling)&&l<r.length;l+=2)if(u==o)break e;e.insertBefore(o,i),s=i}return void 0!==s?s:o.nextSibling}function S(e,n,t){"-"===n[0]?e.setProperty(n,t):e[n]=null==t?"":"number"!=typeof t||c.test(n)?t:t+"px"}function E(e,n,t,r,o){var i;e:if("style"===n)if("string"==typeof t)e.style.cssText=t;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(n in r)t&&n in t||S(e.style,n,"");if(t)for(n in t)r&&t[n]===r[n]||S(e.style,n,t[n])}else if("o"===n[0]&&"n"===n[1])i=n!==(n=n.replace(/Capture$/,"")),n=n.toLowerCase()in e?n.toLowerCase().slice(2):n.slice(2),e.l||(e.l={}),e.l[n+i]=t,t?r||e.addEventListener(n,i?k:A,i):e.removeEventListener(n,i?k:A,i);else if("dangerouslySetInnerHTML"!==n){if(o)n=n.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==n&&"list"!==n&&"form"!==n&&"tabIndex"!==n&&"download"!==n&&n in e)try{e[n]=null==t?"":t;break e}catch(e){}"function"==typeof t||(null!=t&&(!1!==t||"a"===n[0]&&"r"===n[1])?e.setAttribute(n,t):e.removeAttribute(n))}}function A(e){this.l[e.type+!1](n.event?n.event(e):e)}function k(e){this.l[e.type+!0](n.event?n.event(e):e)}function I(e,t,r,o,i,s,u,l,c){var f,d,h,w,g,y,_,C,b,x,S,E=t.type;if(void 0!==t.constructor)return null;null!=r.__h&&(c=r.__h,l=t.__e=r.__e,t.__h=null,s=[l]),(f=n.__b)&&f(t);try{e:if("function"==typeof E){if(C=t.props,b=(f=E.contextType)&&o[f.__c],x=f?b?b.props.value:f.__:o,r.__c?_=(d=t.__c=r.__c).__=d.__E:("prototype"in E&&E.prototype.render?t.__c=d=new E(C,x):(t.__c=d=new p(C,x),d.constructor=E,d.render=M),b&&b.sub(d),d.props=C,d.state||(d.state={}),d.context=x,d.__n=o,h=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=E.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=a({},d.__s)),a(d.__s,E.getDerivedStateFromProps(C,d.__s))),w=d.props,g=d.state,h)null==E.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==E.getDerivedStateFromProps&&C!==w&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(C,x),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(C,d.__s,x)||t.__v===r.__v){d.props=C,d.state=d.__s,t.__v!==r.__v&&(d.__d=!1),d.__v=t,t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),d.__h.length&&u.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(C,d.__s,x),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(w,g,y)}))}d.context=x,d.props=C,d.state=d.__s,(f=n.__r)&&f(t),d.__d=!1,d.__v=t,d.__P=e,f=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(o=a(a({},o),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(y=d.getSnapshotBeforeUpdate(w,g)),S=null!=f&&f.type===m&&null==f.key?f.props.children:f,v(e,Array.isArray(S)?S:[S],t,r,o,i,s,u,l,c),d.base=t.__e,t.__h=null,d.__h.length&&u.push(d),_&&(d.__E=d.__=null),d.__e=!1}else null==s&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=N(r.__e,t,r,o,i,s,u,c);(f=n.diffed)&&f(t)}catch(e){t.__v=null,(c||null!=s)&&(t.__e=l,t.__h=!!c,s[s.indexOf(l)]=null),n.__e(e,t,r)}}function T(e,t){n.__c&&n.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){n.__e(e,t.__v)}}))}function N(n,t,r,o,i,s,l,c){var a,d,h,m=r.props,p=t.props,g=t.type,y=0;if("svg"===g&&(i=!0),null!=s)for(;y<s.length;y++)if((a=s[y])&&"setAttribute"in a==!!g&&(g?a.localName===g:3===a.nodeType)){n=a,s[y]=null;break}if(null==n){if(null===g)return document.createTextNode(p);n=i?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,p.is&&p),s=null,c=!1}if(null===g)m===p||c&&n.data===p||(n.data=p);else{if(s=s&&e.call(n.childNodes),d=(m=r.props||u).dangerouslySetInnerHTML,h=p.dangerouslySetInnerHTML,!c){if(null!=s)for(m={},y=0;y<n.attributes.length;y++)m[n.attributes[y].name]=n.attributes[y].value;(h||d)&&(h&&(d&&h.__html==d.__html||h.__html===n.innerHTML)||(n.innerHTML=h&&h.__html||""))}if(function(e,n,t,r,o){var i;for(i in t)"children"===i||"key"===i||i in n||E(e,i,null,t[i],r);for(i in n)o&&"function"!=typeof n[i]||"children"===i||"key"===i||"value"===i||"checked"===i||t[i]===n[i]||E(e,i,n[i],t[i],r)}(n,p,m,i,c),h)t.__k=[];else if(y=t.props.children,v(n,Array.isArray(y)?y:[y],t,r,o,i&&"foreignObject"!==g,s,l,s?s[0]:r.__k&&w(r,0),c),null!=s)for(y=s.length;y--;)null!=s[y]&&f(s[y]);c||("value"in p&&void 0!==(y=p.value)&&(y!==n.value||"progress"===g&&!y||"option"===g&&y!==m.value)&&E(n,"value",y,m.value,!1),"checked"in p&&void 0!==(y=p.checked)&&y!==n.checked&&E(n,"checked",y,m.checked,!1))}return n}function F(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){n.__e(e,r)}}function O(e,t,r){var o,i;if(n.unmount&&n.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||F(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){n.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&O(o[i],t,"function"!=typeof e.type);r||null==e.__e||f(e.__e),e.__e=e.__d=void 0}function M(e,n,t){return this.constructor(e,t)}function U(t,r,o){var i,s,l;n.__&&n.__(t,r),s=(i="function"==typeof o)?null:o&&o.__k||r.__k,l=[],I(r,t=(!i&&o||r).__k=d(m,null,[t]),s||u,u,void 0!==r.ownerSVGElement,!i&&o?[o]:s?null:r.firstChild?e.call(r.childNodes):null,l,!i&&o?o:s?s.__e:r.firstChild,i),T(l,t)}function D(e,n){U(e,n,D)}function P(n,t,r){var o,i,s,u=a({},n.props);for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:u[s]=t[s];return arguments.length>2&&(u.children=arguments.length>3?e.call(arguments,2):r),h(n.type,u,o||n.key,i||n.ref,null)}function R(){return(R=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function $(e){this.getChildContext=function(){return e.context};var n=e.children,t=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n.indexOf(t=i[r])>=0||(o[t]=e[t]);return o}(e,["context","children"]);return P(n,t)}function G(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=d($,R({},this._props,{context:e.detail.context}),function e(n,t){if(3===n.nodeType)return n.data;if(1!==n.nodeType)return null;var r=[],o={},i=0,s=n.attributes,u=n.childNodes;for(i=s.length;i--;)"slot"!==s[i].name&&(o[s[i].name]=s[i].value,o[H(s[i].name)]=s[i].value);for(i=u.length;i--;){var l=e(u[i],null),c=u[i].slot;c?o[c]=d(L,{name:c},l):r[i]=l}var a=t?d(L,null,r):r;return d(t||n.nodeName.toLowerCase(),o,a)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?D:U)(this._vdom,this._root)}function H(e){return e.replace(/-(\w)/g,(function(e,n){return n?n.toUpperCase():""}))}function j(e,n,t){if(this._vdom){var r={};r[e]=t=null==t?void 0:t,r[H(e)]=t,this._vdom=P(this._vdom,r),U(this._vdom,this._root)}}function B(){U(this._vdom=null,this._root)}function L(e,n){var t=this;return d("slot",R({},e,{ref:function(e){e?(t.ref=e,t._listener||(t._listener=function(e){e.stopPropagation(),e.detail.context=n},e.addEventListener("_preact",t._listener))):t.ref.removeEventListener("_preact",t._listener)}}))}function V(e,n){!function(e,n,t,r){function o(){var n=Reflect.construct(HTMLElement,[],o);return n._vdomComponent=e,n._root=n,n}(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=G,o.prototype.attributeChangedCallback=j,o.prototype.disconnectedCallback=B,t=t||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=t,t.forEach((function(e){Object.defineProperty(o.prototype,e,{get:function(){return this._vdom.props[e]},set:function(n){this._vdom?this.attributeChangedCallback(e,null,n):(this._props||(this._props={}),this._props[e]=n,this.connectedCallback());var t=typeof n;null!=n&&"string"!==t&&"boolean"!==t&&"number"!==t||this.setAttribute(e,n)}})})),customElements.define(n||e.tagName||e.displayName||e.name,o)}(e,n)}e=l.slice,n={__e:function(e,n){for(var t,r,o;n=n.__;)if((t=n.__c)&&!t.__)try{if((r=t.constructor)&&null!=r.getDerivedStateFromError&&(t.setState(r.getDerivedStateFromError(e)),o=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(e),o=t.__d),o)return t.__E=t}catch(n){e=n}throw e}},t=0,p.prototype.setState=function(e,n){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),"function"==typeof e&&(e=e(a({},t),this.props)),e&&a(t,e),null!=e&&this.__v&&(n&&this.__h.push(n),y(this))},p.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),y(this))},p.prototype.render=m,r=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_.__r=0,s=0;var z,W,q,Z=0,J=[],Y=n.__b,X=n.__r,K=n.diffed,Q=n.__c,ee=n.unmount;function ne(e,t){n.__h&&n.__h(W,e,Z||t),Z=0;var r=W.__H||(W.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function te(e,n,t){var r=ne(z++,2);return r.t=e,r.__c||(r.__=[t?t(n):fe(void 0,n),function(e){var n=r.t(r.__[0],e);r.__[0]!==n&&(r.__=[n,r.__[1]],r.__c.setState({}))}],r.__c=W),r.__}function re(e,t){var r=ne(z++,3);!n.__s&&ae(r.__H,t)&&(r.__=e,r.__H=t,W.__H.__h.push(r))}function oe(e,t){var r=ne(z++,4);!n.__s&&ae(r.__H,t)&&(r.__=e,r.__H=t,W.__h.push(r))}function ie(e,n){var t=ne(z++,7);return ae(t.__H,n)&&(t.__=e(),t.__H=n,t.__h=e),t.__}function se(){for(var e;e=J.shift();)if(e.__P)try{e.__H.__h.forEach(le),e.__H.__h.forEach(ce),e.__H.__h=[]}catch(t){e.__H.__h=[],n.__e(t,e.__v)}}n.__b=function(e){W=null,Y&&Y(e)},n.__r=function(e){X&&X(e),z=0;var n=(W=e.__c).__H;n&&(n.__h.forEach(le),n.__h.forEach(ce),n.__h=[])},n.diffed=function(e){K&&K(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==J.push(t)&&q===n.requestAnimationFrame||((q=n.requestAnimationFrame)||function(e){var n,t=function(){clearTimeout(r),ue&&cancelAnimationFrame(n),setTimeout(e)},r=setTimeout(t,100);ue&&(n=requestAnimationFrame(t))})(se)),W=null},n.__c=function(e,t){t.some((function(e){try{e.__h.forEach(le),e.__h=e.__h.filter((function(e){return!e.__||ce(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],n.__e(r,e.__v)}})),Q&&Q(e,t)},n.unmount=function(e){ee&&ee(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{le(e)}catch(e){t=e}})),t&&n.__e(t,r.__v))};var ue="function"==typeof requestAnimationFrame;function le(e){var n=W,t=e.__c;"function"==typeof t&&(e.__c=void 0,t()),W=n}function ce(e){var n=W;e.__c=e.__(),W=n}function ae(e,n){return!e||e.length!==n.length||n.some((function(n,t){return n!==e[t]}))}function fe(e,n){return"function"==typeof n?n(e):n}function de(e,n){for(var t in n)e[t]=n[t];return e}function he(e,n){for(var t in e)if("__source"!==t&&!(t in n))return!0;for(var r in n)if("__source"!==r&&e[r]!==n[r])return!0;return!1}function me(e){this.props=e}(me.prototype=new p).isPureReactComponent=!0,me.prototype.shouldComponentUpdate=function(e,n){return he(this.props,e)||he(this.state,n)};var pe=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),pe&&pe(e)};var we="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ge(e){function n(n,t){var r=de({},n);return delete r.ref,e(r,(t=n.ref||t)&&("object"!=typeof t||"current"in t)?t:null)}return n.$$typeof=we,n.render=n,n.prototype.isReactComponent=n.__f=!0,n.displayName="ForwardRef("+(e.displayName||e.name)+")",n}var ye=function(e,n){return null==e?null:b(b(e).map(n))},_e={map:ye,forEach:ye,count:function(e){return e?b(e).length:0},only:function(e){var n=b(e);if(1!==n.length)throw"Children.only";return n[0]},toArray:b},ve=n.__e;n.__e=function(e,n,t){if(e.then)for(var r,o=n;o=o.__;)if((r=o.__c)&&r.__c)return null==n.__e&&(n.__e=t.__e,n.__k=t.__k),r.__c(e,n);ve(e,n,t)};var Ce=n.unmount;function be(){this.__u=0,this.t=null,this.__b=null}function xe(e){var n=e.__.__c;return n&&n.__e&&n.__e(e)}function Se(){this.u=null,this.o=null}n.unmount=function(e){var n=e.__c;n&&n.__R&&n.__R(),n&&!0===e.__h&&(e.type=null),Ce&&Ce(e)},(be.prototype=new p).__c=function(e,n){var t=n.__c,r=this;null==r.t&&(r.t=[]),r.t.push(t);var o=xe(r.__v),i=!1,s=function(){i||(i=!0,t.__R=null,o?o(u):u())};t.__R=s;var u=function(){if(! --r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(n,t,r){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map((function(n){return e(n,t,r)})),n.__c&&n.__c.__P===t&&(n.__e&&r.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=r)),n}(e,e.__c.__P,e.__c.__O)}var n;for(r.setState({__e:r.__b=null});n=r.t.pop();)n.forceUpdate()}},l=!0===n.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(s,s)},be.prototype.componentWillUnmount=function(){this.t=[]},be.prototype.render=function(e,n){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(n,t,r){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),n.__c.__H=null),null!=(n=de({},n)).__c&&(n.__c.__P===r&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map((function(n){return e(n,t,r)}))),n}(this.__b,t,r.__O=r.__P)}this.__b=null}var o=n.__e&&d(m,null,e.fallback);return o&&(o.__h=null),[d(m,null,n.__e?null:e.children),o]};var Ee=function(e,n,t){if(++t[1]===t[0]&&e.o.delete(n),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(t=e.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;e.u=t=t[2]}};function Ae(e){return this.getChildContext=function(){return e.context},e.children}function ke(e){var n=this,t=e.i;n.componentWillUnmount=function(){U(null,n.l),n.l=null,n.i=null},n.i&&n.i!==t&&n.componentWillUnmount(),e.__v?(n.l||(n.i=t,n.l={nodeType:1,parentNode:t,childNodes:[],appendChild:function(e){this.childNodes.push(e),n.i.appendChild(e)},insertBefore:function(e,t){this.childNodes.push(e),n.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),n.i.removeChild(e)}}),U(d(Ae,{context:n.context},e.__v),n.l)):n.l&&n.componentWillUnmount()}(Se.prototype=new p).__e=function(e){var n=this,t=xe(n.__v),r=n.o.get(e);return r[0]++,function(o){var i=function(){n.props.revealOrder?(r.push(o),Ee(n,e,r)):o()};t?t(i):i()}},Se.prototype.render=function(e){this.u=null,this.o=new Map;var n=b(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&n.reverse();for(var t=n.length;t--;)this.o.set(n[t],this.u=[1,0,this.u]);return e.children},Se.prototype.componentDidUpdate=Se.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(n,t){Ee(e,t,n)}))};var Ie="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Te=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ne="undefined"!=typeof document,Fe=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};p.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(p.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})}));var Oe=n.event;function Me(){}function Ue(){return this.cancelBubble}function De(){return this.defaultPrevented}n.event=function(e){return Oe&&(e=Oe(e)),e.persist=Me,e.isPropagationStopped=Ue,e.isDefaultPrevented=De,e.nativeEvent=e};var Pe,Re={configurable:!0,get:function(){return this.class}},$e=n.vnode;n.vnode=function(e){var n=e.type,t=e.props,r=t;if("string"==typeof n){var o=-1===n.indexOf("-");for(var i in r={},t){var s=t[i];Ne&&"children"===i&&"noscript"===n||"value"===i&&"defaultValue"in t&&null==s||("defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===s?s="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+n)&&!Fe(t.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)?i=i.toLowerCase():o&&Te.test(i)?i=i.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===s&&(s=void 0),r[i]=s)}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=b(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=b(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,t.class!=t.className&&(Re.enumerable="className"in t,null!=t.className&&(r.class=t.className),Object.defineProperty(r,"className",Re))}e.$$typeof=Ie,$e&&$e(e)};var Ge=n.__r;n.__r=function(e){Ge&&Ge(e),Pe=e.__c};var He={ReactCurrentDispatcher:{current:{readContext:function(e){return Pe.__n[e.__c].props.value}}}};function je(e){return!!e&&e.$$typeof===Ie}const Be={useState:function(e){return Z=1,te(fe,e)},useReducer:te,useEffect:re,useLayoutEffect:oe,useRef:function(e){return Z=5,ie((function(){return{current:e}}),[])},useImperativeHandle:function(e,n,t){Z=6,oe((function(){"function"==typeof e?e(n()):e&&(e.current=n())}),null==t?t:t.concat(e))},useMemo:ie,useCallback:function(e,n){return Z=8,ie((function(){return e}),n)},useContext:function(e){var n=W.context[e.__c],t=ne(z++,9);return t.c=e,n?(null==t.__&&(t.__=!0,n.sub(W)),n.props.value):e.__},useDebugValue:function(e,t){n.useDebugValue&&n.useDebugValue(t?t(e):e)},version:"17.0.2",Children:_e,render:function(e,n,t){return null==n.__k&&(n.textContent=""),U(e,n),"function"==typeof t&&t(),e?e.__c:null},hydrate:function(e,n,t){return D(e,n),"function"==typeof t&&t(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(U(null,e),!0)},createPortal:function(e,n){return d(ke,{__v:e,i:n})},createElement:d,createContext:function(e,n){var t={__c:n="__cC"+s++,__:e,Consumer:function(e,n){return e.children(n)},Provider:function(e){var t,r;return this.getChildContext||(t=[],(r={})[n]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&t.some(y)},this.sub=function(e){t.push(e);var n=e.componentWillUnmount;e.componentWillUnmount=function(){t.splice(t.indexOf(e),1),n&&n.call(e)}}),e.children}};return t.Provider.__=t.Consumer.contextType=t},createFactory:function(e){return d.bind(null,e)},cloneElement:function(e){return je(e)?P.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:m,isValidElement:je,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:p,PureComponent:me,memo:function(e,n){function t(e){var t=this.props.ref,r=t==e.ref;return!r&&t&&(t.call?t(null):t.current=null),n?!n(this.props,e)||!r:he(this.props,e)}function r(n){return this.shouldComponentUpdate=t,d(e,n)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r},forwardRef:ge,flushSync:function(e,n){return e(n)},unstable_batchedUpdates:function(e,n){return e(n)},StrictMode:m,Suspense:be,SuspenseList:Se,lazy:function(e){var n,t,r;function o(o){if(n||(n=e()).then((function(e){t=e.default||e}),(function(e){r=e})),r)throw r;if(!t)throw n;return d(t,o)}return o.displayName="Lazy",o.__f=!0,o},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:He};function Le(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function Ve(e){return"function"==typeof e.GetHashCode}function ze(e){return null!=e&&"function"==typeof e.Dispose}function We(e){ze(e)&&e.Dispose()}function qe(e,n){var t,r;return(null===(t=Object.getPrototypeOf(e))||void 0===t?void 0:t.constructor)===(null===(r=Object.getPrototypeOf(n))||void 0===r?void 0:r.constructor)}class Ze{constructor(e){this.iter=e}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const e=this.iter.next();return this.current=e.value,!e.done}"System.Collections.IEnumerator.Reset"(){throw new Error("JS iterators cannot be reset")}Dispose(){}}function Je(e){return"function"==typeof e.GetEnumerator?e.GetEnumerator():new Ze(e[Symbol.iterator]())}function Ye(e){return{[Symbol.iterator](){return this},next(){const n=e["System.Collections.IEnumerator.MoveNext"]();return{done:!n,value:n?e["System.Collections.IEnumerator.get_Current"]():void 0}}}}class Xe{constructor(e){this.factory=e,this.isValueCreated=!1}get Value(){return this.isValueCreated||(this.createdValue=this.factory(),this.isValueCreated=!0),this.createdValue}get IsValueCreated(){return this.isValueCreated}}function Ke(e,n){let t=e.toString(10);for(;t.length<n;)t="0"+t;return t}function Qe(e){const n=e;return"number"==typeof n.offset?n.offset:1===e.kind?0:-6e4*e.getTimezoneOffset()}function en(e,n){return(e=e<0&&null!=n&&10!==n?4294967295+e+1:e).toString(n)}class nn{static id(e){return nn.idMap.has(e)||nn.idMap.set(e,++nn.count),nn.idMap.get(e)}}function tn(e){let n=0,t=5381;const r=e.length;for(;n<r;)t=33*t^e.charCodeAt(n++);return t}function rn(e){return 2654435761*e|0}function on(e){return 0===e.length?0:e.reduce(((e,n)=>(e<<5)+e^n))}function sn(e){var n;if(null==e)return 0;switch(typeof e){case"boolean":return e?1:0;case"number":return rn(e);case"string":return tn(e);default:return Ve(e)?e.GetHashCode():Le(e)?function(e){const n=e.length,t=new Array(n);for(let r=0;r<n;r++)t[r]=sn(e[r]);return on(t)}(e):e instanceof Date?function(e){return e.getTime()}(e):(null===(n=Object.getPrototypeOf(e))||void 0===n?void 0:n.constructor)===Object?on(Object.values(e).map((e=>sn(e)))):rn(nn.id(e))}}function un(e){return null==e?0:Ve(e)?e.GetHashCode():rn(nn.id(e))}function ln(e,n,t){if(null==e)return null==n;if(null==n)return!1;if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!t(e[r],n[r]))return!1;return!0}function cn(e,n){return ln(e,n,an)}function an(e,n){var t;return e===n||(null==e?null==n:null!=n&&"object"==typeof e&&(function(e){return"function"==typeof e.Equals}(e)?e.Equals(n):Le(e)?Le(n)&&cn(e,n):e instanceof Date?n instanceof Date&&0===fn(e,n):(null===(t=Object.getPrototypeOf(e))||void 0===t?void 0:t.constructor)===Object&&function(e,n){const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;t.sort(),r.sort();for(let o=0;o<t.length;o++)if(t[o]!==r[o]||!an(e[t[o]],n[r[o]]))return!1;return!0}(e,n)))}function fn(e,n){let t,r;return"offset"in e&&"offset"in n?(t=e.getTime(),r=n.getTime()):(t=e.getTime()+Qe(e),r=n.getTime()+Qe(n)),t===r?0:t<r?-1:1}function dn(e,n){return e===n?0:e<n?-1:1}function hn(e,n){return function(e,n,t){if(null==e)return null==n?0:1;if(null==n)return-1;if(e.length!==n.length)return e.length<n.length?-1:1;for(let r=0,o=0;r<e.length;r++)if(o=t(e[r],n[r]),0!==o)return o;return 0}(e,n,mn)}function mn(e,n){var t;return e===n?0:null==e?null==n?0:-1:null==n?1:"object"!=typeof e?e<n?-1:1:function(e){return"function"==typeof e.CompareTo}(e)?e.CompareTo(n):Le(e)?Le(n)?hn(e,n):-1:e instanceof Date?n instanceof Date?fn(e,n):-1:(null===(t=Object.getPrototypeOf(e))||void 0===t?void 0:t.constructor)===Object?function(e,n){const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return t.length<r.length?-1:1;t.sort(),r.sort();for(let o=0,i=0;o<t.length;o++){const s=t[o];if(s!==r[o])return s<r[o]?-1:1;if(i=mn(e[s],n[s]),0!==i)return i}return 0}(e,n):-1}function pn(e,n,t){return e(n,t)>0?n:t}function wn(e){const n={};for(const t of e)n[t[0]]=t[1];return n}nn.idMap=new WeakMap,nn.count=0;const gn=Symbol("curried");function yn(e,n){if(null==n||n.length>1)return n;const t=(...t)=>{let r=n;for(let n=0;n<e;n++)r=r(t[n]);return r};return t[gn]=n,t}function _n(e,n,t){return r=>1===n?t(...e.concat([r])):_n(e.concat([r]),n-1,t)}function vn(e,n,t){if(null!=n){if(gn in n){n=n[gn];for(let e=0;e<t.length;e++)n=n(t[e]);return n}return _n(t,e,n)}}function Cn(e,n=0){var t,r;if(null!=e&&"object"==typeof e){if("function"==typeof e.toString)return e.toString();if(Symbol.iterator in e)return function(e){let n=0,t="[";for(const r of e){if(0===n)t+=Cn(r);else{if(100===n){t+="; ...";break}t+="; "+Cn(r)}n++}return t+"]"}(e);{const o=null===(t=Object.getPrototypeOf(e))||void 0===t?void 0:t.constructor;return o===Object&&n<10?"{ "+Object.entries(e).map((([e,t])=>e+" = "+Cn(t,n+1))).join("\n ")+" }":null!==(r=null==o?void 0:o.name)&&void 0!==r?r:""}}return String(e)}class bn{get name(){return this.cases()[this.tag]}toJSON(){return 0===this.fields.length?this.name:[this.name].concat(this.fields)}toString(){return function(e,n){if(0===n.length)return e;{let t="",r=!0;return 1===n.length?(t=Cn(n[0]),r=t.indexOf(" ")>=0):t=n.map((e=>Cn(e))).join(", "),e+(r?" (":" ")+t+(r?")":"")}}(this.name,this.fields)}GetHashCode(){const e=this.fields.map((e=>sn(e)));return e.splice(0,0,rn(this.tag)),on(e)}Equals(e){return this===e||!!qe(this,e)&&this.tag===e.tag&&cn(this.fields,e.fields)}CompareTo(e){return this===e?0:qe(this,e)?this.tag===e.tag?hn(this.fields,e.fields):this.tag<e.tag?-1:1:-1}}class xn{toJSON(){return function(e){const n={},t=Object.keys(e);for(let r=0;r<t.length;r++)n[t[r]]=e[t[r]];return n}(this)}toString(){return e=this,"{ "+Object.entries(e).map((([e,n])=>e+" = "+Cn(n))).join("\n ")+" }";var e}GetHashCode(){return e=this,on(Object.values(e).map((e=>sn(e))));var e}Equals(e){return function(e,n){if(e===n)return!0;if(qe(e,n)){const t=Object.keys(e);for(let r=0;r<t.length;r++)if(!an(e[t[r]],n[t[r]]))return!1;return!0}return!1}(this,e)}CompareTo(e){return function(e,n){if(e===n)return 0;if(qe(e,n)){const t=Object.keys(e);for(let r=0;r<t.length;r++){const o=mn(e[t[r]],n[t[r]]);if(0!==o)return o}return 0}return-1}(this,e)}}class Sn{constructor(e,n){"function"==typeof n?(this.getter=e,this.setter=n):(this.getter=()=>e,this.setter=n=>{e=n})}get contents(){return this.getter()}set contents(e){this.setter(e)}}class En{constructor(e){this.message=e}}function An(e){return function(e){return e instanceof En||e instanceof Error}(e)?e:new Error(String(e))}class kn{constructor(e){this.value=e}toJSON(){return this.value}toString(){return String(this.value)}GetHashCode(){return sn(this.value)}Equals(e){return null!=e&&an(this.value,e instanceof kn?e.value:e)}CompareTo(e){return null==e?1:mn(this.value,e instanceof kn?e.value:e)}}function In(e){return null==e||e instanceof kn?new kn(e):e}function Tn(e){if(null==e)throw new Error("Option has no value");return e instanceof kn?e.value:e}function Nn(e){return null==e?[]:[Tn(e)]}function Fn(e,n){return null!=e?Tn(e):n}function On(e,n){return null!=n?In(e(Tn(n))):void 0}function Mn(e){const n=e<0,t=(e=Math.abs(e))%36e5/6e4;return(n?"-":"+")+Ke(~~(e/36e5),2)+":"+Ke(t,2)}function Un(e,n){const t=e.toISOString();return"first"===n?t.substring(0,t.indexOf("T")):t.substring(t.indexOf("T")+1,t.length-1)}function Dn(e,n,t){return n.replace(/(\w)\1*/g,(n=>{let r=Number.NaN;switch(n.substring(0,1)){case"y":const o=t?e.getUTCFullYear():e.getFullYear();r=n.length<4?o%100:o;break;case"M":r=(t?e.getUTCMonth():e.getMonth())+1;break;case"d":r=t?e.getUTCDate():e.getDate();break;case"H":r=t?e.getUTCHours():e.getHours();break;case"h":const i=t?e.getUTCHours():e.getHours();r=i>12?i%12:i;break;case"m":r=t?e.getUTCMinutes():e.getMinutes();break;case"s":r=t?e.getUTCSeconds():e.getSeconds();break;case"f":r=t?e.getUTCMilliseconds():e.getMilliseconds()}return Number.isNaN(r)?n:r<10&&n.length>1?"0"+r:""+r}))}function Pn(e,n,t){return null!=e.offset?function(e,n){var t,r,o;const i=new Date(e.getTime()+(null!==(t=e.offset)&&void 0!==t?t:0));if("string"!=typeof n)return i.toISOString().replace(/\.\d+/,"").replace(/[A-Z]|\.\d+/g," ")+Mn(null!==(r=e.offset)&&void 0!==r?r:0);if(1!==n.length)return Dn(i,n,!0);switch(n){case"D":case"d":return Un(i,"first");case"T":case"t":return Un(i,"second");case"O":case"o":return function(e,n){const t=e.toISOString();return t.substring(0,t.length-1)+Mn(n)}(i,null!==(o=e.offset)&&void 0!==o?o:0);default:throw new Error("Unrecognized Date print format")}}(e,n):function(e,n){const t=1===e.kind;if("string"!=typeof n)return t?e.toUTCString():e.toLocaleString();if(1!==n.length)return Dn(e,n,t);switch(n){case"D":case"d":return t?Un(e,"first"):e.toLocaleDateString();case"T":case"t":return t?Un(e,"second"):e.toLocaleTimeString();case"O":case"o":return function(e,n){if(n)return e.toISOString();{const n=null==e.kind||2===e.kind;return Ke(e.getFullYear(),4)+"-"+Ke(e.getMonth()+1,2)+"-"+Ke(e.getDate(),2)+"T"+Ke(e.getHours(),2)+":"+Ke(e.getMinutes(),2)+":"+Ke(e.getSeconds(),2)+"."+Ke(e.getMilliseconds(),3)+(n?Mn(-6e4*e.getTimezoneOffset()):"")}}(e,t);default:throw new Error("Unrecognized Date print format")}}(e,n)}function Rn(e,n){const t=new Date(e);return t.kind=0|(null==n?0:n),t}function $n(e){function n(){throw new Error(`The string is not a valid Date: ${e}`)}null!=e&&""!==e.trim()||n(),10===e.length&&"-"===e[4]&&"-"===e[7]&&(e+="T00:00:00");let t=new Date(e),r=null;if(isNaN(t.getTime())){const o=/^\s*(\d+[^\w\s:]\d+[^\w\s:]\d+)?\s*(\d+:\d+(?::\d+(?:\.\d+)?)?)?\s*([AaPp][Mm])?\s*(Z|[+-]([01]?\d):?([0-5]?\d)?)?\s*$/.exec(e);if(null!=o){let e,n=0;if(null!=o[2]){const e=o[2].split(":");n=3600*parseInt(e[0],10)+60*parseInt(e[1]||"0",10)+parseFloat(e[2]||"0"),null!=o[3]&&"PM"===o[3].toUpperCase()&&(n+=720)}if(null!=o[4]){if(null!=o[1])e=new Date(o[1]+" UTC");else{const n=new Date;e=new Date(n.getUTCFullYear()+"/"+(n.getUTCMonth()+1)+"/"+n.getUTCDate())}if("Z"===o[4])r="Z";else{let e=60*parseInt(o[5],10)+parseInt(o[6]||"0",10);"-"===o[4][0]&&(e*=-1),r=e,n-=60*e}}else if(null!=o[1])e=new Date(o[1]);else{const n=new Date;e=new Date(n.getFullYear()+"/"+(n.getMonth()+1)+"/"+n.getDate())}t=new Date(e.getTime()+1e3*n),t=new Date(t.getTime()+6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))}else n();isNaN(t.getTime())&&n()}return[t,r]}function Gn(e,n){try{return n.contents=function(e,n=!1){const[t,r]=$n(e),o=null!=r?n&&"Z"===r?1:2:0;return Rn(t.getTime(),o)}(e),!0}catch(e){return!1}}const Hn=Symbol("numeric");function jn(e){return"number"==typeof e||(null==e?void 0:e[Hn])}function Bn(e,n){return"number"==typeof e?e*n:e[Hn]().multiply(n)}function Ln(e,n){return"number"==typeof e?e.toFixed(n):e[Hn]().toFixed(n)}function Vn(e,n){return"number"==typeof e?e.toPrecision(n):e[Hn]().toPrecision(n)}function zn(e,n){return"number"==typeof e?e.toExponential(n):e[Hn]().toExponential(n)}function Wn(e){return"number"==typeof e?(Number(e)>>>0).toString(16):e[Hn]().toHex()}function qn(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function Zn(e,n,t=0){if(null==n)throw new Error("Input cannot ve null");if(!e.global)throw new Error("Non-global RegExp");e.lastIndex=t;const r=[];let o,i=-1;for(;null!=(o=e.exec(n));)o.index===i?e.lastIndex++:(i=o.index,r.push(o));return r}const Jn=/(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g,Yn=/\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g;function Xn(e,n){return function(e,n){return"number"==typeof e?e<n?-1:e>n?1:0:e.CompareTo(n)}(e,n)<0}function Kn(e){return{input:e,cont:(n=e,e=>{Jn.lastIndex=0;const t=[],r=[];let o=0,i=Jn.exec(n);for(;i;){const e=i.index+(i[1]||"").length;t.push(n.substring(o,e).replace(/%%/g,"%")),r.push(i),o=Jn.lastIndex,Jn.lastIndex-=1,i=Jn.exec(n)}return 0===t.length?e(n.replace(/%%/g,"%")):(t.push(n.substring(o).replace(/%%/g,"%")),rt(e,t,r))})};var n}function Qn(e,n){return"string"==typeof n?e(n):n.cont(e)}function et(e){return Qn((e=>e),e)}function nt(e){return Qn((e=>{throw new Error(e)}),e)}function tt(e,n,t,r,o){let i="";if(n=n||"",o=o||"",jn(e))switch("x"!==o.toLowerCase()&&(Xn(e,0)?(e=Bn(e,-1),i="-"):n.indexOf(" ")>=0?i=" ":n.indexOf("+")>=0&&(i="+")),r=null==r?null:parseInt(r,10),o){case"f":case"F":e=Ln(e,r=null!=r?r:6);break;case"g":case"G":e=null!=r?Vn(e,r):Vn(e);break;case"e":case"E":e=null!=r?zn(e,r):zn(e);break;case"x":e=Wn(e);break;case"X":e=Wn(e).toUpperCase();break;default:e=String(e)}else e=e instanceof Date?Pn(e):Cn(e);if(t="number"==typeof t?t:parseInt(t,10),isNaN(t))e=i+e;else{const r=n.indexOf("0")>=0,o=n.indexOf("-")>=0,s=o||!r?" ":"0";e="0"===s?i+(e=it(e,t-i.length,s,o)):it(i+e,t,s,o)}return e}function rt(e,n,t,r="",o=-1){return(...i)=>{let s=r;const u=n.slice(),l=t.slice();for(const e of i){const[,,n,t,r,i]=l[0];let c=t;if(o>=0)c=o,o=-1;else if("*"===c){if(e<0)throw new Error("Non-negative number required");o=e;continue}s+=u[0],s+=tt(e,n,c,r,i),u.splice(0,1),l.splice(0,1)}return 0===l.length?(s+=u[0],e(s)):rt(e,u,l,s,o)}}function ot(e,n){return Array.isArray(n)?n.join(e):Array.from(n).join(e)}function it(e,n,t,r){t=t||" ",n-=e.length;for(let o=0;o<n;o++)e=r?e+t:t+e;return e}function st(e,n,t){return it(e,n,t)}function ut(e,n,t,r){if(r="number"==typeof r?r:0,(t="number"==typeof t?t:void 0)&&t<0)throw new Error("Count cannot be less than zero");if(0===t)return[];const o=1==(1&r),i=2==(2&r);n=(n=n||[]).filter((e=>e)).map(qn),n=n.length>0?n:["\\s"];const s=[],u=new RegExp(n.join("|"),"g");let l=!0,c=0;do{const n=u.exec(e);if(null===n){const n=i?e.substring(c).trim():e.substring(c);(!o||n.length>0)&&s.push(n),l=!1}else{const r=i?e.substring(c,n.index).trim():e.substring(c,n.index);(!o||r.length>0)&&(null!=t&&s.length+1===t?(s.push(i?e.substring(c).trim():e.substring(c)),l=!1):s.push(r)),c=u.lastIndex}}while(l);return s}function lt(e,n,t){if(n+(t||0)>e.length)throw new Error("Invalid startIndex and/or length");return null!=t?e.substr(n,t):e.substr(n)}const ct="Collection was empty.";function at(e,n){return"function"==typeof e?new e(n):new Array(n)}function ft(e,n,t,r){const o=0|n;return e.fill(r,o,o+t)}function dt(e,n,t){const r=0|n.length,o=at(t,r);for(let t=0;t<=r-1;t++)o[t]=e(n[t]);return o}function ht(e,n,t){return t.reduce(e,n)}function mt(e,n,t){if(null==n)return null==t;if(null==t)return!1;{let r=0,o=!0;const i=0|n.length,s=0|t.length;if(i>s)return!1;if(i<s)return!1;for(;r<i&&o;)o=e(n[r],t[r]),r=r+1|0;return o}}class pt extends xn{constructor(e,n){super(),this.head=e,this.tail=n}toString(){return"["+ot("; ",this)+"]"}Equals(e){return this===e||((e,n)=>{e:for(;;){const t=e,r=n,o=[t.tail,r.tail];if(null!=o[0]){if(null!=o[1]){const i=o[0],s=o[1];if(an(t.head,r.head)){e=i,n=s;continue e}return!1}return!1}return null==o[1]}})(this,e)}GetHashCode(){return 0|((e,n,t)=>{for(;;){const r=e,o=n,i=t,s=i.tail;if(null==s)return 0|o;{const u=s;if(r>18)return 0|o;e=r+1,n=(o<<1)+sn(i.head)+631*r,t=u}}})(0,0,this)}toJSON(e){return Array.from(this)}CompareTo(e){return 0|((e,n)=>{e:for(;;){const t=e,r=n,o=[t.tail,r.tail];if(null!=o[0]){if(null!=o[1]){const i=o[0],s=o[1],u=0|mn(t.head,r.head);if(0===u){e=i,n=s;continue e}return 0|u}return 1}return null!=o[1]?-1:0}})(this,e)}GetEnumerator(){return new wt(this)}[Symbol.iterator](){return Ye(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return Je(this)}}class wt{constructor(e){this.xs=e,this.it=this.xs,this.current=null}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const e=this,n=e.it.tail;if(null!=n){const t=n;return e.current=e.it.head,e.it=t,!0}return!1}"System.Collections.IEnumerator.Reset"(){const e=this;e.it=e.xs,e.current=null}Dispose(){}}function gt(){return new pt(null,void 0)}function yt(e,n){return new pt(e,n)}function _t(e){return null==e.tail}function vt(e){if(null!=e.tail)return e.head;throw new Error(ct+"\\nParameter name: list")}function Ct(e){const n=e.tail;if(null!=n)return n;throw new Error(ct+"\\nParameter name: list")}function bt(){return gt()}function xt(e,n){return yt(e,n)}function St(e){return yt(e,gt())}function Et(e){return _t(e)}function At(e){return vt(e)}function kt(e){return Ct(e)}function It(e){const n=0|function(e){return 0|((e,n)=>{for(;;){const t=e,r=n.tail;if(null==r)return 0|t;e=t+1,n=r}})(0,e)}(e),t=ft(new Array(n),0,n,null);return((e,n)=>{for(;;){const r=e,o=n;if(_t(o))break;t[r]=vt(o),e=r+1,n=Ct(o)}})(0,e),t}function Tt(e,n,t){let r=n,o=t;for(;!_t(o);)r=e(r,vt(o)),o=Ct(o);return r}function Nt(e){return Tt(((e,n)=>yt(n,e)),gt(),e)}function Ft(e,n){Tt(((n,t)=>{e(t)}),void 0,n)}function Ot(e,n){let t=n;for(let n=e.length-1;n>=0;n--)t=yt(e[n],t);return t}function Mt(e){return Ot(e,gt())}function Ut(e,n){return Tt(((e,n)=>yt(n,e)),n,Nt(e))}function Dt(e,n){const t=gt(),r=Tt(((n,t)=>{const r=new pt(e(t),void 0);return n.tail=r,r}),t,n),o=gt();return r.tail=o,Ct(t)}function Pt(e,n){return function(e,n){return(n=>{e:for(;;){const t=n;if(_t(t))return;{const r=e(vt(t));if(null==r){n=Ct(t);continue e}return r}}})(n)}((n=>e(n)?In(n):void 0),n)}function Rt(e,n,t){return null!=function(e,n){return((n,t)=>{for(;;){const r=n,o=t;if(_t(o))return;if(e(vt(o)))return r;n=r+1,t=Ct(o)}})(0,n)}((n=>t.Equals(e,n)),n)}function $t(){return e=mn,{Compare:(n,t)=>e(n,t)};var e}const Gt="Enumeration already finished.",Ht="Enumeration has not started. Call MoveNext.",jt="The input sequence has an insufficient number of elements.";function Bt(){throw new Error(Ht)}function Lt(){throw new Error(Gt)}class Vt{constructor(e){this.f=e}toString(){let e=0,n="seq [";const t=Je(this);try{for(;e<4&&t["System.Collections.IEnumerator.MoveNext"]();)e>0&&(n+="; "),n+=Cn(t["System.Collections.Generic.IEnumerator`1.get_Current"]()),e=e+1|0;return 4===e&&(n+="; ..."),n+"]"}finally{We(t)}}GetEnumerator(){return this.f()}[Symbol.iterator](){return Ye(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return this.f()}}class zt{constructor(e,n,t){this.current=e,this.next=n,this.dispose=t}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current()}"System.Collections.IEnumerator.get_Current"(){return this.current()}"System.Collections.IEnumerator.MoveNext"(){return this.next()}"System.Collections.IEnumerator.Reset"(){!function(){throw new Error("Reset is not supported on this enumerator.")}()}Dispose(){this.dispose()}}function Wt(e,n,t){return new zt(e,n,t)}function qt(e,n,t){let r,o=!1,i=In(e());const s=()=>{if(null!=i){const e=Tn(i);try{t(e)}finally{i=void 0}}},u=()=>{try{s()}finally{r=void 0}};return Wt((()=>(o||Bt(),null!=r?Tn(r):Lt())),(()=>{if(o||(o=!0),null!=i){const e=Tn(i);let t;try{t=n(e)}catch(e){throw u(),e}return null!=t?(r=t,!0):(u(),!1)}return!1}),s)}function Zt(e){return function(e){return new Vt(e)}(e)}function Jt(e){return n="source",null==e&&function(e){throw new Error(e)}(n),Je(e);var n}function Yt(e){return Zt((()=>Je(e())))}function Xt(e){return Zt((()=>function(e){let n,t,r,o=!1,i=!1;const s=()=>{if(i=!0,null!=t){const e=t;try{We(e)}finally{t=void 0}}if(null!=n){const e=n;try{We(e)}finally{n=void 0}}};return Wt((()=>(o?i&&Lt():Bt(),null!=r?Tn(r):Lt())),(()=>{let u;if(o||(o=!0),i)return!1;{let o;for(;null==o;){const i=[n,t];if(null!=i[0])if(null!=i[1]){const e=i[1];if(e["System.Collections.IEnumerator.MoveNext"]())r=In(e["System.Collections.Generic.IEnumerator`1.get_Current"]()),o=!0;else try{We(e)}finally{t=void 0}}else{const e=i[0];e["System.Collections.IEnumerator.MoveNext"]()?(u=e["System.Collections.Generic.IEnumerator`1.get_Current"](),t=Je(u)):(s(),o=!1)}else n=Je(e)}return Tn(o)}}),(()=>{i||s()}))}(e)))}function Kt(e){return Yt((()=>function(e,n){const t=at(void 0,1);return t[0]=e,t}(e)))}function Qt(e){return Le(e)?Mt(e):e instanceof pt?e:function(e){let n,t;if(Le(e))return Mt(e);if(e instanceof pt)return e;{const r=gt();let o=r;const i=Je(e);try{for(;i["System.Collections.IEnumerator.MoveNext"]();){const e=i["System.Collections.Generic.IEnumerator`1.get_Current"]();n=o,t=new pt(e,void 0),n.tail=t,o=t}}finally{We(i)}const s=o,u=gt();return s.tail=u,Ct(r)}}(e)}function er(e,n,t){return Zt((()=>{let r=-1;return qt(e,(e=>(r=r+1|0,n(r,e))),t)}))}function nr(e,n){return Xt([e,n])}function tr(e,n,t){const r=Jt(n);try{let n=!1;for(;!n&&r["System.Collections.IEnumerator.MoveNext"]();)n=t.Equals(e,r["System.Collections.Generic.IEnumerator`1.get_Current"]());return n}finally{We(r)}}function rr(e,n,t){const r=Jt(t);try{let t=n;for(;r["System.Collections.IEnumerator.MoveNext"]();)t=e(t,r["System.Collections.Generic.IEnumerator`1.get_Current"]());return t}finally{We(r)}}function or(e,n){rr(((n,t)=>{e(t)}),void 0,n)}function ir(e,n){return t=()=>Jt(n),r=n=>n["System.Collections.IEnumerator.MoveNext"]()?In(e(n["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,o=e=>{We(e)},Zt((()=>qt(t,r,o)));var t,r,o}function sr(e,n){return er((()=>Jt(n)),((n,t)=>t["System.Collections.IEnumerator.MoveNext"]()?In(e(n,t["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0),(e=>{We(e)}))}function ur(e){return Yt((()=>function(e){return e.slice().reverse()}(function(e){return e instanceof pt?It(e):Array.from(e)}(e))))}function lr(e,n){return Zt((()=>{const t=Jt(n);try{for(let n=1;n<=e;n++)if(!t["System.Collections.IEnumerator.MoveNext"]())throw new Error(jt+"\\nParameter name: source");return function(e,n){return Wt((()=>n["System.Collections.Generic.IEnumerator`1.get_Current"]()),(()=>n["System.Collections.IEnumerator.MoveNext"]()),(()=>{try{We(n)}finally{e()}}))}((()=>{}),t)}catch(e){throw We(t),e}}))}Symbol.iterator;class cr{constructor(e,n){this.k=e,this.v=n}}function ar(e,n){return new cr(e,n)}function fr(e){return e.k}function dr(e){return e.v}class hr extends cr{constructor(e,n,t,r,o){super(e,n),this.left=t,this.right=r,this.h=0|o}}function mr(e,n,t,r,o){return new hr(e,n,t,r,o)}function pr(e){return e.left}function wr(e){return e.right}function gr(e){return e.h}function yr(e,n){e:for(;;){const t=e;if(null!=n){const r=n;if(r instanceof hr){e=yr(t+1,pr(r)),n=wr(r);continue e}return t+1|0}return 0|t}}function _r(e){return yr(0,e)}function vr(e,n,t,r){let o,i;o=null!=e?e instanceof hr?gr(e):1:0,i=null!=r?r instanceof hr?gr(r):1:0;const s=0|(o<i?i:o);return 0===s?ar(n,t):mr(n,t,e,r,s+1)}function Cr(e,n,t,r){let o,i,s,u,l,c;if(l=null!=e?e instanceof hr?gr(e):1:0,c=null!=r?r instanceof hr?gr(r):1:0,c>l+2){const s=Tn(r);if(s instanceof hr){if(o=pr(s),(null!=o?(i=o,i instanceof hr?gr(i):1):0)>l+1){const r=Tn(pr(s));if(r instanceof hr)return vr(vr(e,n,t,pr(r)),fr(r),dr(r),vr(wr(r),fr(s),dr(s),wr(s)));throw new Error("internal error: Map.rebalance")}return vr(vr(e,n,t,pr(s)),fr(s),dr(s),wr(s))}throw new Error("internal error: Map.rebalance")}if(l>c+2){const o=Tn(e);if(o instanceof hr){if(s=wr(o),(null!=s?(u=s,u instanceof hr?gr(u):1):0)>c+1){const e=Tn(wr(o));if(e instanceof hr)return vr(vr(pr(o),fr(o),dr(o),pr(e)),fr(e),dr(e),vr(wr(e),n,t,r));throw new Error("internal error: Map.rebalance")}return vr(pr(o),fr(o),dr(o),vr(wr(o),n,t,r))}throw new Error("internal error: Map.rebalance")}return vr(e,n,t,r)}function br(e,n,t,r){if(null!=r){const o=r,i=0|e.Compare(n,fr(o));return o instanceof hr?i<0?Cr(br(e,n,t,pr(o)),fr(o),dr(o),wr(o)):0===i?mr(n,t,pr(o),wr(o),gr(o)):Cr(pr(o),fr(o),dr(o),br(e,n,t,wr(o))):i<0?mr(n,t,void 0,r,2):0===i?ar(n,t):mr(n,t,r,void 0,2)}return ar(n,t)}function xr(e,n,t){e:for(;;){const r=e,o=n;if(null!=t){const i=t,s=0|r.Compare(o,fr(i));if(0===s)return In(dr(i));if(i instanceof hr){e=r,n=o,t=s<0?pr(i):wr(i);continue e}return}return}}function Sr(e){if(null!=e){const n=e;if(n instanceof hr){if(null==pr(n))return[fr(n),dr(n),wr(n)];{const e=Sr(pr(n));return[e[0],e[1],vr(e[2],fr(n),dr(n),wr(n))]}}return[fr(n),dr(n),void 0]}throw new Error("internal error: Map.spliceOutSuccessor")}function Er(e,n,t,r){if(null!=r){const o=r;if(o instanceof hr){const r=0|e.Compare(n,fr(o));if(r<0)return Cr(Er(e,n,t,pr(o)),fr(o),dr(o),wr(o));if(0===r){const e=t(In(dr(o)));if(null!=e)return mr(n,Tn(e),pr(o),wr(o),gr(o));if(null==pr(o))return wr(o);if(null==wr(o))return pr(o);{const e=Sr(wr(o));return vr(pr(o),e[0],e[1],e[2])}}return Cr(pr(o),fr(o),dr(o),Er(e,n,t,wr(o)))}{const i=0|e.Compare(n,fr(o));if(i<0){const e=t(void 0);return null!=e?mr(n,Tn(e),void 0,r,2):r}if(0===i){const e=t(In(dr(o)));return null!=e?ar(n,Tn(e)):void 0}{const e=t(void 0);return null!=e?mr(n,Tn(e),r,void 0,2):r}}}{const e=t(void 0);return null!=e?ar(n,Tn(e)):r}}function Ar(e,n){e:for(;;){const t=e;if(null!=n){const r=n;if(r instanceof hr){Ar(t,pr(r)),t(fr(r),dr(r)),e=t,n=wr(r);continue e}t(fr(r),dr(r))}break}}function kr(e,n){Ar(e,n)}function Ir(e,n){e:for(;;){const t=e;if(null!=n){const r=n;if(r instanceof hr){const o=Ir(t,pr(r));if(null==o){const o=t(fr(r),dr(r));if(null==o){e=t,n=wr(r);continue e}return o}return o}return t(fr(r),dr(r))}return}}function Tr(e,n){return Ir(e,n)}function Nr(e,n){if(null!=n){const t=n;if(t instanceof hr){const n=Nr(e,pr(t)),r=e(fr(t),dr(t)),o=Nr(e,wr(t));return mr(fr(t),r,n,o,gr(t))}return ar(fr(t),e(fr(t),dr(t)))}}function Fr(e,n){return Nr(e,n)}function Or(e,n){let t;for(let r=0;r<=n.length-1;r++){const o=n[r];t=br(e,o[0],o[1],t)}return t}class Mr extends xn{constructor(e,n){super(),this.stack=e,this.started=n}}function Ur(e){e:for(;;){const n=e;if(Et(n))return bt();{const t=kt(n),r=At(n);if(null!=r){const o=r;if(o instanceof hr){e=Ot([pr(o),ar(fr(o),dr(o)),wr(o)],t);continue e}return n}e=t;continue e}}}function Dr(e){return new Mr(Ur(St(e)),!1)}function Pr(e){if(e.started){const n=e.stack;if(Et(n))return function(){throw new Error("enumeration already finished")}();if(null!=At(n)){const e=At(n);if(e instanceof hr)throw new Error("Please report error: Map iterator, unexpected stack for current");return[fr(e),dr(e)]}throw new Error("Please report error: Map iterator, unexpected stack for current")}return function(){throw new Error("enumeration not started")}()}function Rr(e){let n=Dr(e);return{"System.Collections.Generic.IEnumerator`1.get_Current":()=>Pr(n),"System.Collections.IEnumerator.get_Current":()=>Pr(n),"System.Collections.IEnumerator.MoveNext":()=>function(e){if(e.started){const n=e.stack;if(Et(n))return!1;if(null!=At(n)){if(At(n)instanceof hr)throw new Error("Please report error: Map iterator, unexpected stack for moveNext");return e.stack=Ur(kt(n)),!Et(e.stack)}throw new Error("Please report error: Map iterator, unexpected stack for moveNext")}return e.started=!0,!Et(e.stack)}(n),"System.Collections.IEnumerator.Reset"(){n=Dr(e)},Dispose(){}}}class $r{constructor(e,n){this.comparer=e,this.tree=n}GetHashCode(){return 0|function(e){const n=(e,n)=>(e<<1)+n+631;let t=0;const r=Je(e);try{for(;r["System.Collections.IEnumerator.MoveNext"]();){const e=r["System.Collections.Generic.IEnumerator`1.get_Current"]();t=0|n(t,sn(e[0])),t=0|n(t,sn(e[1]))}}finally{We(r)}return 0|t}(this)}Equals(e){if(!(e instanceof $r))return!1;{const n=Je(this);try{const t=Je(e);try{const e=()=>{const r=n["System.Collections.IEnumerator.MoveNext"]();if(r===t["System.Collections.IEnumerator.MoveNext"]()){if(r){const r=n["System.Collections.Generic.IEnumerator`1.get_Current"](),o=t["System.Collections.Generic.IEnumerator`1.get_Current"]();return!(!an(r[0],o[0])||!an(r[1],o[1]))&&e()}return!0}return!1};return e()}finally{We(t)}}finally{We(n)}}}toString(){return"map ["+ot("; ",ir((e=>function(e,...n){return"object"==typeof e&&n.length>0&&(e=n[0],n.shift()),e.replace(Yn,((e,t,r,o,i,s)=>{if(t<0||t>=n.length)throw new Error("Index must be greater or equal to zero and less than the arguments' length.");let u=n[t];if(jn(u))switch(i=null==i?null:parseInt(i,10),o){case"f":case"F":u=Ln(u,i=null!=i?i:2);break;case"g":case"G":u=null!=i?Vn(u,i):Vn(u);break;case"e":case"E":u=null!=i?zn(u,i):zn(u);break;case"p":case"P":i=null!=i?i:2,u=Ln(Bn(u,100),i)+" %";break;case"d":case"D":u=null!=i?st(String(u),i,"0"):String(u);break;case"x":case"X":u=null!=i?st(Wn(u),i,"0"):Wn(u),"X"===o&&(u=u.toUpperCase());break;default:if(s){let e="";u=s.replace(/([0#,]+)(\.[0#]+)?/,((n,t,r)=>{Xn(u,0)&&(u=Bn(u,-1),e="-"),r=null==r?"":r.substring(1),u=Ln(u,Math.max(r.length,0));let[o,i]=u.split(".");i||(i=""),o=st(o,t.replace(/,/g,"").replace(/^#+/,"").length,"0");const s=r.replace(/#+$/,"").length;if(s>i.length?i=function(e,n,t){return it(e,n,"0",!0)}(i,s):s<i.length&&(i=i.substring(0,s)+i.substring(s).replace(/0+$/,"")),t.indexOf(",")>0){const e=o.length%3,n=Math.floor(o.length/3);let t=e>0?o.substr(0,e)+(n>0?",":""):"";for(let r=0;r<n;r++)t+=o.substr(e+3*r,3)+(r<n-1?",":"");o=t}return i.length>0?o+"."+i:o})),u=e+u}}else u=u instanceof Date?Pn(u,s||o):Cn(u);return r=parseInt((r||" ").substring(1),10),isNaN(r)||(u=it(String(u),Math.abs(r)," ",r<0)),u}))}("({0}, {1})",e[0],e[1])),this))+"]"}get[Symbol.toStringTag](){return"FSharpMap"}toJSON(e){return Array.from(this)}GetEnumerator(){return Rr(this.tree)}[Symbol.iterator](){return Ye(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return Rr(this.tree)}CompareTo(e){const n=this;if(e instanceof $r)return 0|function(e,n,t){const r=Jt(n);try{const n=Jt(t);try{let t=0,o=r["System.Collections.IEnumerator.MoveNext"](),i=n["System.Collections.IEnumerator.MoveNext"]();for(;0===t&&o&&i;)t=0|e(r["System.Collections.Generic.IEnumerator`1.get_Current"](),n["System.Collections.Generic.IEnumerator`1.get_Current"]()),0===t&&(o=r["System.Collections.IEnumerator.MoveNext"](),i=n["System.Collections.IEnumerator.MoveNext"]());return 0|(0!==t?t:o?1:i?-1:0)}finally{We(n)}}finally{We(r)}}(((e,t)=>{const r=0|n.comparer.Compare(e[0],t[0]);return 0|(0!==r?r:mn(e[1],t[1]))}),n,e);throw new Error("not comparable\\nParameter name: obj")}"System.Collections.Generic.ICollection`1.Add2B595"(e){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Remove2B595"(e){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Contains2B595"(e){return Lr(this,e[0])&&an(jr(this,e[0]),e[1])}"System.Collections.Generic.ICollection`1.CopyToZ2E171D71"(e,n){!function(e,n,t){let r=t;kr(((e,t)=>{n[r]=[e,t],r=r+1|0}),e)}(this.tree,e,n)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return 0|Br(this)}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return 0|Br(this)}get size(){return 0|Br(this)}clear(){throw new Error("Map cannot be mutated")}delete(e){throw new Error("Map cannot be mutated")}entries(){return ir((e=>[e[0],e[1]]),this)}get(e){return jr(this,e)}has(e){return Lr(this,e)}keys(){return ir((e=>e[0]),this)}set(e,n){throw new Error("Map cannot be mutated")}values(){return ir((e=>e[1]),this)}forEach(e,n){const t=this;or((n=>{e(n[1],n[0],t)}),t)}}function Gr(e,n){return new $r(e,n)}function Hr(e){const n=$t();return Gr(n,function(e,n){if(Le(n))return Or(e,n);if(n instanceof pt)return function(e,n){return Tt(((n,t)=>br(e,t[0],t[1],n)),void 0,n)}(e,n);{const t=Je(n);try{return function(e,n,t){for(;;){const r=e,o=n,i=t;if(!i["System.Collections.IEnumerator.MoveNext"]())return o;{const s=i["System.Collections.Generic.IEnumerator`1.get_Current"]();e=r,n=br(r,s[0],s[1],o),t=i}}}(e,void 0,t)}finally{We(t)}}}(n,e))}function jr(e,n){return function(e,n,t){const r=xr(e,n,t);if(null==r)throw new Error;return Tn(r)}(e.comparer,n,e.tree)}function Br(e){return _r(e.tree)}function Lr(e,n){return function(e,n,t){e:for(;;){const r=e,o=n;if(null!=t){const i=t,s=0|r.Compare(o,fr(i));if(i instanceof hr){if(s<0){e=r,n=o,t=pr(i);continue e}if(0===s)return!0;e=r,n=o,t=wr(i);continue e}return 0===s}return!1}}(e.comparer,n,e.tree)}function Vr(e,n){return xr(e.comparer,n,e.tree)}function zr(e,n,t){return function(e,n,t){return Gr(e.comparer,br(e.comparer,n,t,e.tree))}(t,e,n)}function Wr(e,n,t){return function(e,n,t){return Gr(e.comparer,Er(e.comparer,n,t,e.tree))}(t,e,n)}function qr(e,n){return Vr(n,e)}function Zr(e,n){return function(e,n){return Gr(e.comparer,Fr(n,e.tree))}(n,e)}function Jr(){return $r.empty}$r.empty=Gr($t(),void 0);class Yr{constructor(e,n,t,r){this.declaringType=e,this.tag=n,this.name=t,this.fields=r}}class Xr{constructor(e,n,t,r,o,i,s){this.fullname=e,this.generics=n,this.construct=t,this.parent=r,this.fields=o,this.cases=i,this.enumCases=s}toString(){return co(this)}GetHashCode(){return Qr(this)}Equals(e){return eo(this,e)}}function Kr(e){return null!=e.generics?e.generics:[]}function Qr(e){return on([tn(e.fullname),...Kr(e).map(Qr)])}function eo(e,n){return""===e.fullname?""===n.fullname&&ln(vo(e),vo(n),(([e,n],[t,r])=>e===t&&eo(n,r))):e.fullname===n.fullname&&ln(Kr(e),Kr(n),eo)}function no(e,n,t,r){return new Xr(e,n,t,void 0,r)}function to(...e){return new Xr("",void 0,void 0,void 0,(()=>e))}function ro(e){return new Xr("Microsoft.FSharp.Core.FSharpOption`1",[e])}function oo(e){return new Xr("Microsoft.FSharp.Collections.FSharpList`1",[e])}const io=new Xr("System.Object"),so=(new Xr("Microsoft.FSharp.Core.Unit"),new Xr("System.Char"),new Xr("System.String")),uo=new Xr("System.Boolean");function lo(e){if(Array.isArray(e))return e[0];if(e instanceof Xr){const n=fo(e);if(null!=n)return lo(n)+"[]";{const n=e.fullname.lastIndexOf(".");return-1===n?e.fullname:e.fullname.substr(n+1)}}return e.name}function co(e){const n=fo(e);return null!=n?co(n)+"[]":null==e.generics||0===e.generics.length?e.fullname:e.fullname+"["+e.generics.map((e=>co(e))).join(",")+"]"}function ao(e){return null!=fo(e)}function fo(e){var n;return"[]"===e.fullname&&1===(null===(n=e.generics)||void 0===n?void 0:n.length)?e.generics[0]:void 0}function ho(e){return null!=e.generics&&e.generics.length>0}function mo(e){return null!=e.enumCases&&e.enumCases.length>0}function po(e){return null==e.generics?e:new Xr(e.fullname,e.generics.map((()=>io)))}function wo(e){var n;return null===(n=e.generics)||void 0===n?void 0:n[0]}function go(e){if(mo(e)&&null!=e.enumCases)return e.enumCases.map((e=>e[1]));throw new Error(`${e.fullname} is not an enum type`)}function yo(e,n){const t=parseInt(n,10);return function(e,n){if(null!=e.enumCases){if("string"==typeof n){for(const t of e.enumCases)if(t[0]===n)return t;throw new Error(`'${n}' was not found in ${e.fullname}`)}for(const t of e.enumCases)if(t[1]===n)return t;return["",n]}throw new Error(`${e.fullname} is not an enum type`)}(e,isNaN(t)?n:t)[1]}function _o(e){if(null!=e.cases)return e.cases();throw new Error(`${e.fullname} is not an F# union type`)}function vo(e){if(null!=e.fields)return e.fields();throw new Error(`${e.fullname} is not an F# record type`)}function Co(e){if(So(e)&&null!=e.generics)return e.generics;throw new Error(`${e.fullname} is not a tuple type`)}function bo(e){return e instanceof Xr?null!=e.cases:e instanceof bn}function xo(e){return e instanceof Xr?null!=e.fields:e instanceof xn}function So(e){return e.fullname.startsWith("System.Tuple")}function Eo(e){return null==e.fields?[]:e.fields}new Xr("System.SByte"),new Xr("System.Byte"),new Xr("System.Int16"),new Xr("System.UInt16"),new Xr("System.Int32"),new Xr("System.UInt32"),new Xr("System.Single"),new Xr("System.Double"),new Xr("System.Decimal");class Ao extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Ok","Error"]}}function ko(e,n){return 0===n.tag?new Ao(0,e(n.fields[0])):new Ao(1,n.fields[0])}class Io extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["BadPrimitive","BadPrimitiveExtra","BadType","BadField","BadPath","TooSmallArray","FailMessage","BadOneOf"]}}class To extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["PascalCase","CamelCase","SnakeCase"]}}class No{constructor(){this.cache=new Map([])}}function Fo(){return new No}function Oo(e){return e.slice(void 0,1).toLowerCase()+e.slice(1,e.length)}function Mo(e,n){switch(e.tag){case 2:return function(e,n,t,r,o=0){if("string"==typeof e){const t=e;e=function(e,n=0){if(0!=(-284&n))throw new Error("RegexOptions only supports: IgnoreCase, Multiline, Compiled, Singleline and ECMAScript");let t="gu";return t+=1&n?"i":"",t+=2&n?"m":"",t+=16&n?"s":"",new RegExp(e,t)}(n,null!=r?r:0),n=t,r=void 0}if("function"==typeof t)return r=null==r?-1:r,n.substring(0,o)+n.substring(o).replace(e,(function(){let e=arguments[0];if(r){r--;const n=[],o=arguments.length,i="string"!=typeof arguments[o-1];let s=i?o-3:o-2;for(let e=0;e<s;e++)n.push(arguments[e]);n.index=arguments[s++],n.input=arguments[s++],i&&(n.groups=arguments[s]),e=t(n)}return e}));if(t=t.replace(/\$0/g,(e=>"$&")).replace(/\${([^}]+)}/g,"$<$1>"),null!=r){let i;const s=n.substring(o),u=Zn(e,s),l=Zn.length>r?(i=u[r-1],s.substring(0,i.index+i[0].length)):s;return n.substring(0,o)+l.replace(e,t)+n.substring(o+l.length)}return n.replace(e,t)}(Oo(n),"[A-Z]","_$0").toLowerCase();case 0:return n;default:return Oo(n)}}Fo(),Fo();const Uo=/^[\(\{]{0,2}[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[\)\}]{0,2}$/,Do=/^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/,Po=/^\{0x[0-9a-f]{8},(0x[0-9a-f]{4},){2}\{(0x[0-9a-f]{2},){7}0x[0-9a-f]{2}\}\}$/;function Ro(e,n){try{return n.contents=function(e){function n(e){return e.replace(Do,"$1-$2-$3-$4-$5")}const t=e.trim().toLowerCase();if(Uo.test(t))return function(e,...n){if(0===n.length)return e.trim();const t="["+qn(n.join(""))+"]+";return e.replace(new RegExp("^"+t),"").replace(new RegExp(t+"$"),"")}(t,"{","}","(",")");if(Do.test(t))return n(t);if(Po.test(t))return n(t.replace(/[\{\},]|0x/g,""));throw new Error("Guid should contain 32 digits with 4 dashes: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")}(e),!0}catch(e){return!1}}var $o;function Go(e,n){switch(n){case 8:return e?[0,255]:[-128,127];case 16:return e?[0,65535]:[-32768,32767];case 32:return e?[0,4294967295]:[-2147483648,2147483647];default:throw new Error("Invalid bit size.")}}function Ho(e,n,t,r,o){try{return o.contents=function(e,n,t,r,o){const i=function(e,n,t){const r=/^\s*([\+\-])?(0[xXoObB])?([0-9a-fA-F]+)\s*$/.exec(e.replace(/_/g,""));if(null!=r){const[,,e,o]=r;t=t||function(e,n){if(n&$o.AllowHexSpecifier)return 16;switch(e){case"0b":case"0B":return 2;case"0o":case"0O":return 8;case"0x":case"0X":return 16;default:return 10}}(e,n);const i=function(e){switch(e){case 2:return/[^0-1]/;case 8:return/[^0-7]/;case 10:return/[^0-9]/;case 16:return/[^0-9a-fA-F]/;default:throw new Error("Invalid Base.")}}(t);if(!i.test(o))return function(e,n){const[,t,r,o]=e;return{sign:t||"",prefix:r||"",digits:o,radix:n}}(r,t)}return null}(e,n,void 0);if(null!=i){let e=Number.parseInt(i.sign+i.digits,i.radix);if(!Number.isNaN(e)){const[n,o]=Go(!0,r);!t&&10!==i.radix&&e>=n&&e<=o&&(e=e<<32-r>>32-r);const[s,u]=Go(t,r);if(e>=s&&e<=u)return e}}throw new Error("Input string was not in a correct format.")}(e,n,t,r),!0}catch(e){return!1}}function jo(e,n){!function(e){if(null!=e&&0!==e){if(e%6e4!=0)throw new Error("Offset must be specified in whole minutes.");if(Math.abs(e/36e5)>14)throw new Error("Offset must be within plus or minus 14 hours.")}}(n);const t=new Date(e);return t.offset=null!=n?n:-6e4*(new Date).getTimezoneOffset(),t}function Bo(e,n){try{return n.contents=function(e){const[n,t]=$n(e),r=null==t?-6e4*n.getTimezoneOffset():"Z"===t?0:6e4*t;return jo(n.getTime(),r)}(e),!0}catch(e){return!1}}!function(e){e[e.AllowHexSpecifier=512]="AllowHexSpecifier"}($o||($o={}));var Lo=null;try{Lo=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(u){}function Vo(e,n,t){this.low=0|e,this.high=0|n,this.unsigned=!!t}function zo(e){return!0===(e&&e.__isLong__)}Vo.prototype.GetHashCode=function(){let e=this.unsigned?1:0;return e=(e<<5)+e^this.high,e=(e<<5)+e^this.low,e},Vo.prototype.Equals=function(e){return yi(this,e)},Vo.prototype.CompareTo=function(e){return bi(this,e)},Vo.prototype.toString=function(e){return mi(this,e)},Vo.prototype.toJSON=function(){return mi(this)},Vo.prototype[Hn]=function(){const e=this;return{multiply:n=>Ai(e,n),toPrecision:n=>String(e)+(0).toPrecision(n).substr(1),toExponential:n=>String(e)+(0).toExponential(n).substr(1),toFixed:n=>String(e)+(0).toFixed(n).substr(1),toHex:()=>{return mi(e.unsigned?e:function(e,n,t){return t?function(e,n){return new Vo(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,n)}(e,n):function(e,n){return new Vo(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],n)}(e,n)}((n=e,t?function(e){var n=e.high,t=e.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&n,n>>>8&255,n>>>16&255,n>>>24]}(n):function(e){var n=e.high,t=e.low;return[n>>>24,n>>>16&255,n>>>8&255,255&n,t>>>24,t>>>16&255,t>>>8&255,255&t]}(n)),!0),16);var n,t}}},Vo.prototype.__isLong__,Object.defineProperty(Vo.prototype,"__isLong__",{value:!0});var Wo={},qo={};function Zo(e,n){var t,r,o;return n?(o=0<=(e>>>=0)&&e<256)&&(r=qo[e])?r:(t=Yo(e,(0|e)<0?-1:0,!0),o&&(qo[e]=t),t):(o=-128<=(e|=0)&&e<128)&&(r=Wo[e])?r:(t=Yo(e,e<0?-1:0,!1),o&&(Wo[e]=t),t)}function Jo(e,n){if(isNaN(e))return n?ii:oi;if(n){if(e<0)return ii;if(e>=ni)return ai}else{if(e<=-ti)return fi;if(e+1>=ti)return ci}return e<0?xi(Jo(-e,n)):Yo(e%ei|0,e/ei|0,n)}function Yo(e,n,t){return new Vo(e,n,t)}var Xo=Math.pow;function Ko(e,n,t){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return oi;if("number"==typeof n?(t=n,n=!1):n=!!n,(t=t||10)<2||36<t)throw RangeError("radix");var r=e.indexOf("-");if(r>0)throw Error("interior hyphen");if(0===r)return xi(Ko(e.substring(1),n,t));for(var o=Jo(Xo(t,8)),i=oi,s=0;s<e.length;s+=8){var u=Math.min(8,e.length-s),l=parseInt(e.substring(s,s+u),t);i=Si(u<8?Ai(i,Jo(Xo(t,u))):i=Ai(i,o),Jo(l))}return i.unsigned=n,i}function Qo(e,n){return"number"==typeof e?Jo(e,n):"string"==typeof e?Ko(e,n):Yo(e.low,e.high,"boolean"==typeof n?n:e.unsigned)}var ei=4294967296,ni=ei*ei,ti=ni/2,ri=Zo(1<<24),oi=Zo(0),ii=Zo(0,!0),si=Zo(1),ui=Zo(1,!0),li=Zo(-1),ci=Yo(-1,2147483647,!1),ai=Yo(-1,-1,!0),fi=Yo(0,-2147483648,!1);function di(e){return e.unsigned?e.low>>>0:e.low}function hi(e){return e.unsigned?(e.high>>>0)*ei+(e.low>>>0):e.high*ei+(e.low>>>0)}function mi(e,n){if((n=n||10)<2||36<n)throw RangeError("radix");if(pi(e))return"0";if(wi(e)){if(yi(e,fi)){var t=Jo(n),r=ki(e,t),o=Ei(Ai(r,t),e);return mi(r,n)+di(o).toString(n)}return"-"+mi(xi(e),n)}for(var i=Jo(Xo(n,6),e.unsigned),s=e,u="";;){var l=ki(s,i),c=(di(Ei(s,Ai(l,i)))>>>0).toString(n);if(pi(s=l))return c+u;for(;c.length<6;)c="0"+c;u=""+c+u}}function pi(e){return 0===e.high&&0===e.low}function wi(e){return!e.unsigned&&e.high<0}function gi(e){return 1==(1&e.low)}function yi(e,n){return zo(n)||(n=Qo(n)),(e.unsigned===n.unsigned||e.high>>>31!=1||n.high>>>31!=1)&&e.high===n.high&&e.low===n.low}function _i(e,n){return bi(e,n)<0}function vi(e,n){return bi(e,n)>0}function Ci(e,n){return bi(e,n)>=0}function bi(e,n){if(zo(n)||(n=Qo(n)),yi(e,n))return 0;var t=wi(e),r=wi(n);return t&&!r?-1:!t&&r?1:e.unsigned?n.high>>>0>e.high>>>0||n.high===e.high&&n.low>>>0>e.low>>>0?-1:1:wi(Ei(e,n))?-1:1}function xi(e){return!e.unsigned&&yi(e,fi)?fi:Si(function(e){return Yo(~e.low,~e.high,e.unsigned)}(e),si)}function Si(e,n){zo(n)||(n=Qo(n));var t=e.high>>>16,r=65535&e.high,o=e.low>>>16,i=65535&e.low,s=n.high>>>16,u=65535&n.high,l=n.low>>>16,c=0,a=0,f=0,d=0;return f+=(d+=i+(65535&n.low))>>>16,a+=(f+=o+l)>>>16,c+=(a+=r+u)>>>16,c+=t+s,Yo((f&=65535)<<16|(d&=65535),(c&=65535)<<16|(a&=65535),e.unsigned)}function Ei(e,n){return zo(n)||(n=Qo(n)),Si(e,xi(n))}function Ai(e,n){if(pi(e))return e.unsigned?ii:oi;if(zo(n)||(n=Qo(n)),Lo)return Yo(Lo.mul(e.low,e.high,n.low,n.high),Lo.get_high(),e.unsigned);if(pi(n))return e.unsigned?ii:oi;if(yi(e,fi))return gi(n)?fi:oi;if(yi(n,fi))return gi(e)?fi:oi;if(wi(e))return wi(n)?Ai(xi(e),xi(n)):xi(Ai(xi(e),n));if(wi(n))return xi(Ai(e,xi(n)));if(_i(e,ri)&&_i(n,ri))return Jo(hi(e)*hi(n),e.unsigned);var t=e.high>>>16,r=65535&e.high,o=e.low>>>16,i=65535&e.low,s=n.high>>>16,u=65535&n.high,l=n.low>>>16,c=65535&n.low,a=0,f=0,d=0,h=0;return d+=(h+=i*c)>>>16,f+=(d+=o*c)>>>16,d&=65535,f+=(d+=i*l)>>>16,a+=(f+=r*c)>>>16,f&=65535,a+=(f+=o*l)>>>16,f&=65535,a+=(f+=i*u)>>>16,a+=t*c+r*l+o*u+i*s,Yo((d&=65535)<<16|(h&=65535),(a&=65535)<<16|(f&=65535),e.unsigned)}function ki(e,n){if(zo(n)||(n=Qo(n)),pi(n))throw Error("division by zero");var t,r,o;if(Lo)return e.unsigned||-2147483648!==e.high||-1!==n.low||-1!==n.high?Yo((e.unsigned?Lo.div_u:Lo.div_s)(e.low,e.high,n.low,n.high),Lo.get_high(),e.unsigned):e;if(pi(e))return e.unsigned?ii:oi;if(e.unsigned){if(n.unsigned||(n=function(e){return e.unsigned?e:Yo(e.low,e.high,!0)}(n)),vi(n,e))return ii;if(vi(n,function(e,n){if(zo(n)&&(n=di(n)),0==(n&=63))return e;var t=e.high;return n<32?Yo(e.low>>>n|t<<32-n,t>>>n,e.unsigned):Yo(32===n?t:t>>>n-32,0,e.unsigned)}(e,1)))return ui;o=ii}else{if(yi(e,fi))return yi(n,si)||yi(n,li)?fi:yi(n,fi)?si:yi(t=function(e,n){return zo(n)&&(n=di(n)),0==(n&=63)?e:n<32?Yo(e.low<<n,e.high<<n|e.low>>>32-n,e.unsigned):Yo(0,e.low<<n-32,e.unsigned)}(ki(function(e,n){return zo(n)&&(n=di(n)),0==(n&=63)?e:n<32?Yo(e.low>>>n|e.high<<32-n,e.high>>n,e.unsigned):Yo(e.high>>n-32,e.high>=0?0:-1,e.unsigned)}(e,1),n),1),oi)?wi(n)?si:li:o=Si(t,ki(r=Ei(e,Ai(n,t)),n));if(yi(n,fi))return e.unsigned?ii:oi;if(wi(e))return wi(n)?ki(xi(e),xi(n)):xi(ki(xi(e),n));if(wi(n))return xi(ki(e,xi(n)));o=oi}for(r=e;Ci(r,n);){t=Math.max(1,Math.floor(hi(r)/hi(n)));for(var i=Math.ceil(Math.log(t)/Math.LN2),s=i<=48?1:Xo(2,i-48),u=Jo(t),l=Ai(u,n);wi(l)||vi(l,r);)l=Ai(u=Jo(t-=s,e.unsigned),n);pi(u)&&(u=si),o=Si(o,u),r=Ei(r,l)}return o}const Ii=ki,Ti=hi;function Ni(e){return e<0?Math.ceil(e):Math.floor(e)}function Fi(e=0,n=0,t=0,r=0,o=0){switch(arguments.length){case 1:return Ti(Ii(arguments[0],1e4));case 3:e=0,n=arguments[0],t=arguments[1],r=arguments[2],o=0}return 864e5*e+36e5*n+6e4*t+1e3*r+o}function Oi(e,n){try{return n.contents=function(e){const n=e.search("\\."),t=e.search("\\:");if(-1===n&&-1===t){const n=parseInt(e,0);if(isNaN(n))throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`);return Fi(n,0,0,0,0)}if(t>0){const n=/^(-?)((\d+)\.)?(?:0*)([0-9]|0[0-9]|1[0-9]|2[0-3]):(?:0*)([0-5][0-9]|[0-9])(:(?:0*)([0-5][0-9]|[0-9]))?\.?(\d+)?$/.exec(e);if(null!=n&&null!=n[4]&&null!=n[5]){let t=0,r=0,o=0;const i=null!=n[1]&&"-"===n[1]?-1:1,s=+n[4],u=+n[5];if(null!=n[3]&&(t=+n[3]),null!=n[7]&&(o=+n[7]),null!=n[8])switch(n[8].length){case 1:r=100*+n[8];break;case 2:r=10*+n[8];break;case 3:r=+n[8];break;case 4:r=+n[8]/10;break;case 5:r=+n[8]/100;break;case 6:r=+n[8]/1e3;break;case 7:r=+n[8]/1e4;break;default:throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`)}return i*Fi(t,s,u,o,r)}}throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`)}(e),!0}catch(e){return!1}}class Mi{constructor(e){this.k=e}}function Ui(e){return new Mi(e)}function Di(e){return e.k}class Pi extends Mi{constructor(e,n,t,r){super(e),this.left=n,this.right=t,this.h=0|r}}function Ri(e,n,t,r){return new Pi(e,n,t,r)}function $i(e){return e.left}function Gi(e){return e.right}function Hi(e){return e.h}function ji(e,n){e:for(;;){const t=n;if(null!=e){const r=e;if(r instanceof Pi){e=$i(r),n=ji(Gi(r),t+1);continue e}return t+1|0}return 0|t}}function Bi(e){return ji(e,0)}function Li(e,n,t){let r,o;r=null!=e?e instanceof Pi?Hi(e):1:0,o=null!=t?t instanceof Pi?Hi(t):1:0;const i=0|(r<o?o:r);return 0===i?Ui(n):Ri(n,e,t,i+1)}function Vi(e,n,t){let r,o,i,s,u,l;if(u=null!=e?e instanceof Pi?Hi(e):1:0,l=null!=t?t instanceof Pi?Hi(t):1:0,l>u+2){const i=Tn(t);if(i instanceof Pi){if(r=$i(i),(null!=r?(o=r,o instanceof Pi?Hi(o):1):0)>u+1){const t=Tn($i(i));if(t instanceof Pi)return Li(Li(e,n,$i(t)),Di(t),Li(Gi(t),Di(i),Gi(i)));throw new Error("internal error: Set.rebalance")}return Li(Li(e,n,$i(i)),Di(i),Gi(i))}throw new Error("internal error: Set.rebalance")}if(u>l+2){const r=Tn(e);if(r instanceof Pi){if(i=Gi(r),(null!=i?(s=i,s instanceof Pi?Hi(s):1):0)>l+1){const e=Tn(Gi(r));if(e instanceof Pi)return Li(Li($i(r),Di(r),$i(e)),Di(e),Li(Gi(e),n,t));throw new Error("internal error: Set.rebalance")}return Li($i(r),Di(r),Li(Gi(r),n,t))}throw new Error("internal error: Set.rebalance")}return Li(e,n,t)}function zi(e,n,t){if(null!=t){const r=t,o=0|e.Compare(n,Di(r));if(r instanceof Pi)return o<0?Vi(zi(e,n,$i(r)),Di(r),Gi(r)):0===o?t:Vi($i(r),Di(r),zi(e,n,Gi(r)));{const o=0|e.Compare(n,Di(r));return o<0?Ri(n,void 0,t,2):0===o?t:Ri(n,t,void 0,2)}}return Ui(n)}function Wi(e,n,t){e:for(;;){const r=e,o=n;if(null!=t){const i=t,s=0|r.Compare(o,Di(i));if(i instanceof Pi){if(s<0){e=r,n=o,t=$i(i);continue e}if(0===s)return!0;e=r,n=o,t=Gi(i);continue e}return 0===s}return!1}}function qi(e,n){e:for(;;){const t=e;if(null!=n){const r=n;if(r instanceof Pi){qi(t,$i(r)),t(Di(r)),e=t,n=Gi(r);continue e}t(Di(r))}break}}class Zi extends xn{constructor(e,n){super(),this.stack=e,this.started=n}}function Ji(e){e:for(;;){const n=e;if(Et(n))return bt();{const t=At(n),r=kt(n);if(null!=t){const o=t;if(o instanceof Pi){e=Ot([$i(o),Ui(Di(o)),Gi(o)],r);continue e}return n}e=r;continue e}}}function Yi(e){return new Zi(Ji(St(e)),!1)}function Xi(e){if(e.started){const n=e.stack;if(Et(n))return function(){throw new Error("Enumeration already started")}();if(null!=At(n))return Di(At(n));throw new Error("Please report error: Set iterator, unexpected stack for current")}return function(){throw new Error("Enumeration not started")}()}function Ki(e){let n=Yi(e);return{"System.Collections.Generic.IEnumerator`1.get_Current":()=>Xi(n),"System.Collections.IEnumerator.get_Current":()=>Xi(n),"System.Collections.IEnumerator.MoveNext":()=>function(e){if(e.started){const n=e.stack;if(Et(n))return!1;if(null!=At(n)){if(At(n)instanceof Pi)throw new Error("Please report error: Set iterator, unexpected stack for moveNext");return e.stack=Ji(kt(n)),!Et(e.stack)}throw new Error("Please report error: Set iterator, unexpected stack for moveNext")}return e.started=!0,!Et(e.stack)}(n),"System.Collections.IEnumerator.Reset"(){n=Yi(e)},Dispose(){}}}function Qi(e,n,t){return null==n?null==t?0:-1:null==t?1:0|function(e,n,t){e:for(;;){const r=e,o=n,i=t,s=[o,i];if(Et(s[0]))return Et(s[1])?0:-1;if(Et(s[1]))return 1;if(null!=At(s[1]))if(null!=At(s[0])){const u=At(s[0]),l=At(s[1]);if(u instanceof Pi)if(null==$i(u)){if(!(l instanceof Pi)){const o=0|r.Compare(Di(u),Di(l));if(0!==o)return 0|o;e=r,n=xt(Gi(u),kt(s[0])),t=xt(void 0,kt(s[1]));continue e}if(null==$i(l)){const o=0|r.Compare(Di(u),Di(l));if(0!==o)return 0|o;e=r,n=xt(Gi(u),kt(s[0])),t=xt(Gi(l),kt(s[1]));continue e}{const s=[o,i];let u,l,c,a,f;switch(Et(s[0])?Et(s[1])?u=2:null!=At(s[1])?(u=1,a=kt(s[1]),f=At(s[1])):u=2:null!=At(s[0])?(u=0,l=kt(s[0]),c=At(s[0])):Et(s[1])?u=2:null!=At(s[1])?(u=1,a=kt(s[1]),f=At(s[1])):u=2,u){case 0:if(c instanceof Pi){e=r,n=Ot([$i(c),Ri(Di(c),void 0,Gi(c),0)],l),t=i;continue e}e=r,n=Ot([void 0,Ui(Di(c))],l),t=i;continue e;case 1:if(f instanceof Pi){e=r,n=o,t=Ot([$i(f),Ri(Di(f),void 0,Gi(f),0)],a);continue e}e=r,n=o,t=Ot([void 0,Ui(Di(f))],a);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}else{const s=[o,i];let u,l,c,a,f;switch(Et(s[0])?Et(s[1])?u=2:null!=At(s[1])?(u=1,a=kt(s[1]),f=At(s[1])):u=2:null!=At(s[0])?(u=0,l=kt(s[0]),c=At(s[0])):Et(s[1])?u=2:null!=At(s[1])?(u=1,a=kt(s[1]),f=At(s[1])):u=2,u){case 0:if(c instanceof Pi){e=r,n=Ot([$i(c),Ri(Di(c),void 0,Gi(c),0)],l),t=i;continue e}e=r,n=Ot([void 0,Ui(Di(c))],l),t=i;continue e;case 1:if(f instanceof Pi){e=r,n=o,t=Ot([$i(f),Ri(Di(f),void 0,Gi(f),0)],a);continue e}e=r,n=o,t=Ot([void 0,Ui(Di(f))],a);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}else{if(!(l instanceof Pi)){const o=0|r.Compare(Di(u),Di(l));if(0!==o)return 0|o;e=r,n=kt(s[0]),t=kt(s[1]);continue e}if(null==$i(l)){const o=0|r.Compare(Di(u),Di(l));if(0!==o)return 0|o;e=r,n=xt(void 0,kt(s[0])),t=xt(Gi(l),kt(s[1]));continue e}{const s=[o,i];let u,l,c,a,f;switch(Et(s[0])?Et(s[1])?u=2:null!=At(s[1])?(u=1,a=kt(s[1]),f=At(s[1])):u=2:null!=At(s[0])?(u=0,l=kt(s[0]),c=At(s[0])):Et(s[1])?u=2:null!=At(s[1])?(u=1,a=kt(s[1]),f=At(s[1])):u=2,u){case 0:if(c instanceof Pi){e=r,n=Ot([$i(c),Ri(Di(c),void 0,Gi(c),0)],l),t=i;continue e}e=r,n=Ot([void 0,Ui(Di(c))],l),t=i;continue e;case 1:if(f instanceof Pi){e=r,n=o,t=Ot([$i(f),Ri(Di(f),void 0,Gi(f),0)],a);continue e}e=r,n=o,t=Ot([void 0,Ui(Di(f))],a);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}}else{At(s[1]);const u=[o,i];let l,c,a,f,d;switch(Et(u[0])?Et(u[1])?l=2:null!=At(u[1])?(l=1,f=kt(u[1]),d=At(u[1])):l=2:null!=At(u[0])?(l=0,c=kt(u[0]),a=At(u[0])):Et(u[1])?l=2:null!=At(u[1])?(l=1,f=kt(u[1]),d=At(u[1])):l=2,l){case 0:if(a instanceof Pi){e=r,n=Ot([$i(a),Ri(Di(a),void 0,Gi(a),0)],c),t=i;continue e}e=r,n=Ot([void 0,Ui(Di(a))],c),t=i;continue e;case 1:if(d instanceof Pi){e=r,n=o,t=Ot([$i(d),Ri(Di(d),void 0,Gi(d),0)],f);continue e}e=r,n=o,t=Ot([void 0,Ui(Di(d))],f);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}else{if(null==At(s[0])){e=r,n=kt(s[0]),t=kt(s[1]);continue e}{At(s[0]);const u=[o,i];let l,c,a,f,d;switch(Et(u[0])?Et(u[1])?l=2:null!=At(u[1])?(l=1,f=kt(u[1]),d=At(u[1])):l=2:null!=At(u[0])?(l=0,c=kt(u[0]),a=At(u[0])):Et(u[1])?l=2:null!=At(u[1])?(l=1,f=kt(u[1]),d=At(u[1])):l=2,l){case 0:if(a instanceof Pi){e=r,n=Ot([$i(a),Ri(Di(a),void 0,Gi(a),0)],c),t=i;continue e}e=r,n=Ot([void 0,Ui(Di(a))],c),t=i;continue e;case 1:if(d instanceof Pi){e=r,n=o,t=Ot([$i(d),Ri(Di(d),void 0,Gi(d),0)],f);continue e}e=r,n=o,t=Ot([void 0,Ui(Di(d))],f);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}break}}(e,St(n),St(t))}function es(e,n,t){let r=t;qi((e=>{n[r]=e,r=r+1|0}),e)}function ns(e,n){if(Le(n))return function(e,n){return ht(((n,t)=>zi(e,t,n)),void 0,n)}(e,n);if(n instanceof pt)return function(e,n){return Tt(((n,t)=>zi(e,t,n)),void 0,n)}(e,n);{const t=Je(n);try{return function(e,n,t){for(;;){const r=e,o=n,i=t;if(!i["System.Collections.IEnumerator.MoveNext"]())return o;e=r,n=zi(r,i["System.Collections.Generic.IEnumerator`1.get_Current"](),o),t=i}}(e,void 0,t)}finally{We(t)}}}class ts{constructor(e,n){this.comparer=e,this.tree=n}GetHashCode(){return 0|function(e){let n,t=0;const r=Je(e);try{for(;r["System.Collections.IEnumerator.MoveNext"]();)t=0|(n=0|sn(r["System.Collections.Generic.IEnumerator`1.get_Current"]()),(t<<1)+n+631)}finally{We(r)}return 0|Math.abs(t)}(this)}Equals(e){return e instanceof ts&&0===Qi(rs(this),os(this),os(e))}toString(){return"set ["+ot("; ",ir((e=>Cn(e)),this))+"]"}get[Symbol.toStringTag](){return"FSharpSet"}toJSON(e){return Array.from(this)}CompareTo(e){return 0|Qi(rs(this),os(this),os(e))}"System.Collections.Generic.ICollection`1.Add2B595"(e){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Remove2B595"(e){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Contains2B595"(e){return Wi(rs(this),e,os(this))}"System.Collections.Generic.ICollection`1.CopyToZ2E171D71"(e,n){es(os(this),e,n)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return 0|is(this)}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return 0|is(this)}GetEnumerator(){return Ki(os(this))}[Symbol.iterator](){return Ye(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return Ki(os(this))}get size(){return 0|is(this)}add(e){throw new Error("Set cannot be mutated")}clear(){throw new Error("Set cannot be mutated")}delete(e){throw new Error("Set cannot be mutated")}has(e){return function(e,n){return Wi(rs(e),n,os(e))}(this,e)}keys(){return ir((e=>e),this)}values(){return ir((e=>e),this)}entries(){return ir((e=>[e,e]),this)}forEach(e,n){const t=this;or((n=>{e(n,n,t)}),t)}}function rs(e){return e.comparer}function os(e){return e.tree}function is(e){return Bi(os(e))}function ss(e,n,t){try{return"Expecting "+e+" but instead got:"+(t?"\n":" ")+JSON.stringify(n,null,4)}catch(n){return"Expecting "+e+" but decoder failed. Couldn't report given value due to circular structure."+(t?"\n":" ")}}function us(e,n,t){const r=n(e,t);if(1===r.tag){const e=r.fields[0];return new Ao(1,function(e,n){const t=2===n.tag?ss(n.fields[0],n.fields[1],!0):1===n.tag?ss(n.fields[0],n.fields[1],!1)+"\nReason: "+n.fields[2]:3===n.tag?ss(n.fields[0],n.fields[1],!0):4===n.tag?ss(n.fields[0],n.fields[1],!0)+"\nNode `"+n.fields[2]+"` is unkown.":5===n.tag?"Expecting "+n.fields[0]+".\n"+JSON.stringify(n.fields[1],null,4):7===n.tag?"The following errors were found:\n\n"+ot("\n\n",n.fields[0]):6===n.tag?"The following `failure` occurred with the decoder: "+n.fields[0]:ss(n.fields[0],n.fields[1],!1);return 7===n.tag?t:"Error at: `"+e+"`\n"+t}(e[0],e[1]))}return new Ao(0,r.fields[0])}function ls(e,n){try{return us("$",e,JSON.parse(n))}catch(e){if(e instanceof SyntaxError)return new Ao(1,"Given an invalid JSON: "+e.message);throw e}}function cs(e,n){return"string"==typeof n?new Ao(0,n):new Ao(1,[e,new Io(0,"a string",n)])}const as=e=>n=>{const t="a sbyte",r=e,o=n;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?-128<=e&&e<=127?new Ao(0,(e+128&255)-128):new Ao(1,[r,new Io(1,t,e,"Value was either too large or too small for "+t)]):new Ao(1,[r,new Io(1,t,e,"Value is not an integral value")])}if("string"==typeof o){let e,n=0;return e=[Ho(o,511,!1,8,new Sn((()=>n),(e=>{n=0|e}))),n],e[0]?new Ao(0,e[1]):new Ao(1,[r,new Io(0,t,o)])}return new Ao(1,[r,new Io(0,t,o)])},fs=e=>n=>{const t="a byte",r=e,o=n;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?0<=e&&e<=255?new Ao(0,255&e):new Ao(1,[r,new Io(1,t,e,"Value was either too large or too small for "+t)]):new Ao(1,[r,new Io(1,t,e,"Value is not an integral value")])}if("string"==typeof o){let e,n=0;return e=[Ho(o,511,!0,8,new Sn((()=>n),(e=>{n=e}))),n],e[0]?new Ao(0,e[1]):new Ao(1,[r,new Io(0,t,o)])}return new Ao(1,[r,new Io(0,t,o)])},ds=e=>n=>{const t="an int16",r=e,o=n;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?-32768<=e&&e<=32767?new Ao(0,(e+32768&65535)-32768):new Ao(1,[r,new Io(1,t,e,"Value was either too large or too small for "+t)]):new Ao(1,[r,new Io(1,t,e,"Value is not an integral value")])}if("string"==typeof o){let e,n=0;return e=[Ho(o,511,!1,16,new Sn((()=>n),(e=>{n=0|e}))),n],e[0]?new Ao(0,e[1]):new Ao(1,[r,new Io(0,t,o)])}return new Ao(1,[r,new Io(0,t,o)])},hs=e=>n=>{const t="an uint16",r=e,o=n;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?0<=e&&e<=65535?new Ao(0,65535&e):new Ao(1,[r,new Io(1,t,e,"Value was either too large or too small for "+t)]):new Ao(1,[r,new Io(1,t,e,"Value is not an integral value")])}if("string"==typeof o){let e,n=0;return e=[Ho(o,511,!0,16,new Sn((()=>n),(e=>{n=e}))),n],e[0]?new Ao(0,e[1]):new Ao(1,[r,new Io(0,t,o)])}return new Ao(1,[r,new Io(0,t,o)])},ms=e=>n=>{const t="an int",r=e,o=n;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?-2147483648<=e&&e<=2147483647?new Ao(0,~~e):new Ao(1,[r,new Io(1,t,e,"Value was either too large or too small for "+t)]):new Ao(1,[r,new Io(1,t,e,"Value is not an integral value")])}if("string"==typeof o){let e,n=0;return e=[Ho(o,511,!1,32,new Sn((()=>n),(e=>{n=0|e}))),n],e[0]?new Ao(0,e[1]):new Ao(1,[r,new Io(0,t,o)])}return new Ao(1,[r,new Io(0,t,o)])},ps=e=>n=>{const t="an uint32",r=e,o=n;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?0<=e&&e<=4294967295?new Ao(0,e>>>0):new Ao(1,[r,new Io(1,t,e,"Value was either too large or too small for "+t)]):new Ao(1,[r,new Io(1,t,e,"Value is not an integral value")])}if("string"==typeof o){let e,n=0;return e=[Ho(o,511,!0,32,new Sn((()=>n),(e=>{n=e}))),n],e[0]?new Ao(0,e[1]):new Ao(1,[r,new Io(0,t,o)])}return new Ao(1,[r,new Io(0,t,o)])};function ws(e,n,t,r){let o;const i=t+".["+en(e)+"]";if(Array.isArray(r)){const t=r;return e<t.length?n(i,t[e]):new Ao(1,[i,new Io(5,"a longer array. Need index `"+en(e)+"` but there are only `"+(o=t.length,en(o)+"` entries"),r)])}return new Ao(1,[i,new Io(0,"an array",r)])}function gs(e,n,t){if(Array.isArray(t)){let r=-1;return ko(Nt,ht(((t,o)=>{if(r=r+1|0,0===t.tag){const i=e(n+".["+en(r)+"]",o);return 0===i.tag?new Ao(0,xt(i.fields[0],t.fields[0])):new Ao(1,i.fields[0])}return t}),new Ao(0,bt()),t))}return new Ao(1,[n,new Io(0,"a list",t)])}function ys(e,n,t){if(Array.isArray(t)){let r=-1;const o=t;return ht(((t,o)=>{if(r=r+1|0,0===t.tag){const i=t.fields[0],s=e(n+".["+en(r)+"]",o);return 0===s.tag?(i[r]=s.fields[0],new Ao(0,i)):new Ao(1,s.fields[0])}return t}),new Ao(0,ft(new Array(o.length),0,o.length,null)),o)}return new Ao(1,[n,new Io(0,"an array",t)])}function _s(e,n,t,r){const o=n(t,r);return 0===o.tag?e(o.fields[0],t,r):new Ao(1,o.fields[0])}function vs(e,n){let t;const r=e;return t=e=>n=>ws(0,r,e,n),e=>r=>_s(yn(3,(e=>{let t;const r=n;return t=e=>n=>ws(1,r,e,n),n=>r=>_s(((n,t,r)=>new Ao(0,[e,n])),yn(2,t),n,r)})),yn(2,t),e,r)}function Cs(e){return Hr(e)}function bs(e){return function(e,n){return new ts(e,n)}(n={Compare:mn},ns(n,e));var n}function xs(e,n,t,r){let o;const i=n.length+e|0;if(i!==r.length)return new Ao(1,[t,new Io(6,(o=0|r.length,et(Kn("Expected array of length %i but got %i"))(i)(o)))]);{let o=new Ao(0,bt());for(let i=e;i<=r.length-1;i++)if(0===o.tag){const s=o.fields[0],u=et(Kn("%s[%i]"))(t)(i),l=n[i-e],c=r[i];o=ko((e=>xt(e,s)),l(u)(c))}return ko(Nt,o)}}function Ss(e,n,t,r,o,i){const s=function(e,n){return n.find((e=>lo(e)===r))}(0,_o(t));if(null!=s){const t=s,r=dt((t=>As(e,n,!1,t[1])),Eo(t));return ko((e=>function(e,n){const t=(e.fields||[]).length;if(n.length!==t)throw new Error(`Expected an array of length ${t} but got ${n.length}`);return null!=e.declaringType.construct?new e.declaringType.construct(e.tag,...n):{}}(t,It(e))),0===r.length&&i.length<=1?new Ao(0,bt()):xs(1,r,o,i))}return new Ao(1,[o,new Io(6,"Cannot find case "+r+" in "+co(t))])}function Es(e,n,t,r){const o=new Sn(null);let i;const s=co(r);let u;if(i=""===s?e:zr(s,o,e),xo(r)){const e=dt((e=>[Mo(n,lo(e)),As(i,n,!1,e[1])]),vo(r));u=n=>t=>ko((e=>function(e,n){const t=vo(e);if(t.length!==n.length)throw new Error(`Expected an array of length ${t.length} but got ${n.length}`);return null!=e.construct?new e.construct(...n):t.reduce(((e,[t,r],o)=>(e[t]=n[o],e)),{})}(r,It(e))),function(e,n,t){return null===t||Object.getPrototypeOf(t||!1)!==Object.prototype?new Ao(1,[n,new Io(0,"an object",t)]):function(e,n,t){return n.reduceRight(((n,t)=>e(t,n)),t)}(yn(2,(e=>{const r=e[0];return o=>0===o.tag?ko((e=>xt(e,o.fields[0])),e[1](n+"."+r)(t[r])):o})),e,new Ao(0,bt()))}(e,n,t))}else if(bo(r))u=e=>t=>{if("string"==typeof t)return Ss(i,n,r,t,e,[]);if(Array.isArray(t)){const u=t;return o=t=>Ss(i,n,r,t,e,u),0===(s=cs(e+"[0]",u[0])).tag?o(s.fields[0]):new Ao(1,s.fields[0])}return new Ao(1,[e,new Io(0,"a string or array",t)]);var o,s};else{if(!t){let e;const n=co(r);throw e=et(Kn("Cannot generate auto decoder for %s. Please pass an extra decoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders"))(n),new Error(e)}u=e=>n=>new Ao(1,[e,new Io(2,"an extra coder for "+co(r),n)])}return o.contents=u,u}function As(e,n,t,r){let o,i,s,u;const l=co(r),c=qr(l,e);if(null==c){if(ao(r)){const t=As(e,n,!1,fo(r));return e=>n=>ys(yn(2,t),e,n)}if(mo(r)){const e=co(wo(r));if("System.SByte"===e)return e=>n=>{const t=r,o=e,i=n,s=as(o)(i);if(1===s.tag)return new Ao(1,s.fields[0]);{const e=s.fields[0];return tr(e,go(t),{Equals:(e,n)=>e===n,GetHashCode:rn})?new Ao(0,yo(t,e.toString())):new Ao(1,[o,new Io(1,co(t),i,"Unkown value provided for the enum")])}};if("System.Byte"===e)return e=>n=>{const t=r,o=e,i=n,s=fs(o)(i);if(1===s.tag)return new Ao(1,s.fields[0]);{const e=s.fields[0];return tr(e,go(t),{Equals:(e,n)=>e===n,GetHashCode:rn})?new Ao(0,yo(t,e.toString())):new Ao(1,[o,new Io(1,co(t),i,"Unkown value provided for the enum")])}};if("System.Int16"===e)return e=>n=>{const t=r,o=e,i=n,s=ds(o)(i);if(1===s.tag)return new Ao(1,s.fields[0]);{const e=s.fields[0];return tr(e,go(t),{Equals:(e,n)=>e===n,GetHashCode:rn})?new Ao(0,yo(t,e.toString(u))):new Ao(1,[o,new Io(1,co(t),i,"Unkown value provided for the enum")])}var u};if("System.UInt16"===e)return e=>n=>{const t=r,o=e,i=n,s=hs(o)(i);if(1===s.tag)return new Ao(1,s.fields[0]);{const e=s.fields[0];return tr(e,go(t),{Equals:(e,n)=>e===n,GetHashCode:rn})?new Ao(0,yo(t,e.toString())):new Ao(1,[o,new Io(1,co(t),i,"Unkown value provided for the enum")])}};if("System.Int32"===e)return e=>n=>{const t=r,o=e,i=n,s=ms(o)(i);if(1===s.tag)return new Ao(1,s.fields[0]);{const e=s.fields[0];return tr(e,go(t),{Equals:(e,n)=>e===n,GetHashCode:rn})?new Ao(0,yo(t,en(e))):new Ao(1,[o,new Io(1,co(t),i,"Unkown value provided for the enum")])}};if("System.UInt32"===e)return e=>n=>{const t=r,o=e,i=n,s=ps(o)(i);if(1===s.tag)return new Ao(1,s.fields[0]);{const e=s.fields[0];return tr(e,go(t),{Equals:(e,n)=>e===n,GetHashCode:rn})?new Ao(0,yo(t,e.toString())):new Ao(1,[o,new Io(1,co(t),i,"Unkown value provided for the enum")])}};{const e=co(r),n=nt(Kn("Cannot generate auto decoder for %s.\nThoth.Json.Net only support the following enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\nIf you can't use one of these types, please pass an extra decoder.\n "))(e);return e=>n(e)}}if(ho(r)){if(So(r)){const t=dt((t=>As(e,n,!1,t)),Co(r));return e=>n=>Array.isArray(n)?ko((e=>It(e)),xs(0,t,e,n)):new Ao(1,[e,new Io(0,"an array",n)])}{const l=co(po(r));if("Microsoft.FSharp.Core.FSharpOption`1[System.Object]"===l)return o=As(e,n,!0,Kr(r)[0]),e=>n=>{return t=yn(2,o),r=e,null==(i=n)?new Ao(0,void 0):ko(In,t(r,i));var t,r,i};if("Microsoft.FSharp.Collections.FSharpList`1[System.Object]"===l)return i=As(e,n,!1,Kr(r)[0]),e=>n=>gs(yn(2,i),e,n);if("System.Collections.Generic.IEnumerable`1[System.Object]"===l)return s=As(e,n,!1,Kr(r)[0]),e=>n=>function(e,n,t){if(Array.isArray(t)){let r=-1;return ko(ur,ht(((t,o)=>{if(r=r+1|0,0===t.tag){const i=e(n+".["+en(r)+"]",o);return 0===i.tag?new Ao(0,nr([i.fields[0]],t.fields[0])):new Ao(1,i.fields[0])}return t}),new Ao(0,[]),t))}return new Ao(1,[n,new Io(0,"a seq",t)])}(yn(2,s),e,n);if("Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"===l){const t=As(e,n,!1,Kr(r)[0]),o=As(e,n,!1,Kr(r)[1]);let i;const s=Mt([e=>n=>function(e,n,t,r){return null===r||Object.getPrototypeOf(r||!1)!==Object.prototype?new Ao(1,[t,new Io(0,"an object",r)]):rr(((o,i)=>{if(0===o.tag){const s=e(t,i);if(0===s.tag){const e=n(t+"."+i,r[i]);return 0===e.tag?new Ao(0,xt([s.fields[0],e.fields[0]],o.fields[0])):new Ao(1,e.fields[0])}return new Ao(1,s.fields[0])}return o}),new Ao(0,bt()),Object.keys(r))}(yn(2,t),yn(2,o),e,n),(u=vs(yn(2,t),yn(2,o)),e=>n=>gs(yn(2,u),e,n))]);return i=e=>n=>{return t=e,r=n,((e,n)=>{e:for(;;){const o=e,i=n;if(Et(o))return new Ao(1,[t,new Io(7,i)]);{const s=us(t,yn(2,At(o)),r);if(1===s.tag){e=kt(o),n=Ut(i,St(s.fields[0]));continue e}return new Ao(0,s.fields[0])}}})(s,bt());var t,r},e=>n=>function(e,n,t,r){const o=n(t,r);return 1===o.tag?new Ao(1,o.fields[0]):new Ao(0,e(o.fields[0]))}(Cs,yn(2,i),e,n)}if("Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"===l){const t=As(e,n,!1,Kr(r)[0]);return e=>n=>{const r=ys(yn(2,t),e,n);return 0===r.tag?new Ao(0,bs(r.fields[0])):new Ao(1,r.fields[0])}}return Es(e,n,t,r)}}return"System.Boolean"===l?e=>n=>{return t=e,"boolean"==typeof(r=n)?new Ao(0,r):new Ao(1,[t,new Io(0,"a boolean",r)]);var t,r}:"Microsoft.FSharp.Core.Unit"===l?e=>n=>{return t=e,null==(r=n)?new Ao(0,void 0):new Ao(1,[t,new Io(0,"null",r)]);var t,r}:"System.String"===l?e=>n=>cs(e,n):"System.Char"===l?e=>n=>function(e,n){if("string"==typeof n){const t=n;return 1===t.length?new Ao(0,t[0]):new Ao(1,[e,new Io(0,"a single character string",n)])}return new Ao(1,[e,new Io(0,"a char",n)])}(e,n):"System.SByte"===l?as:"System.Byte"===l?fs:"System.Int16"===l?ds:"System.UInt16"===l?hs:"System.Int32"===l?ms:"System.UInt32"===l?ps:"System.Double"===l?e=>n=>{return t=e,"number"==typeof(r=n)?new Ao(0,r):new Ao(1,[t,new Io(0,"a float",r)]);var t,r}:"System.Single"===l?e=>n=>{return t=e,"number"==typeof(r=n)?new Ao(0,r):new Ao(1,[t,new Io(0,"a float32",r)]);var t,r}:"System.DateTime"===l?e=>n=>function(e,n){if("string"==typeof n){let r,o=Rn(-621355968e5,0);return r=[Gn(n,new Sn((()=>o),(e=>{o=e}))),o],r[0]?new Ao(0,1===(t=r[1]).kind?t:Rn(t.getTime(),1)):new Ao(1,[e,new Io(0,"a datetime",n)])}var t;return new Ao(1,[e,new Io(0,"a datetime",n)])}(e,n):"System.DateTimeOffset"===l?e=>n=>function(e,n){if("string"==typeof n){let t,r=jo(-621355968e5,0);return t=[Bo(n,new Sn((()=>r),(e=>{r=e}))),r],t[0]?new Ao(0,t[1]):new Ao(1,[e,new Io(0,"a datetimeoffset",n)])}return new Ao(1,[e,new Io(0,"a datetime",n)])}(e,n):"System.TimeSpan"===l?e=>n=>function(e,n){if("string"==typeof n){let t,r=0;return t=[Oi(n,new Sn((()=>r),(e=>{r=e}))),r],t[0]?new Ao(0,t[1]):new Ao(1,[e,new Io(0,"a timespan",n)])}return new Ao(1,[e,new Io(0,"a timespan",n)])}(e,n):"System.Guid"===l?e=>n=>function(e,n){if("string"==typeof n){let t,r="00000000-0000-0000-0000-000000000000";return t=[Ro(n,new Sn((()=>r),(e=>{r=e}))),r],t[0]?new Ao(0,t[1]):new Ao(1,[e,new Io(0,"a guid",n)])}return new Ao(1,[e,new Io(0,"a guid",n)])}(e,n):"System.Object"===l?e=>e=>new Ao(0,e):Es(e,n,t,r)}{const e=c;return n=>t=>e.contents(n)(t)}}function ks(e,n,t){const r=Fn(n,new To(0));return As(function(e){return null!=e?Zr(((e,n)=>new Sn(n[1])),e.Coders):Jr()}(t),r,!1,e)}class Is extends xn{constructor(e,n,t){super(),this.PartnerId=e,this.AccountId=n,this.Funds=t}}class Ts extends xn{constructor(e,n){super(),this.PartnerFunds=e,this.AccountFunds=n}}class Ns extends xn{constructor(e,n){super(),this.DefaultFundUSI=e,this.FeatureSet=n}}class Fs extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Basic","Promoted"]}}function Os(){return function(e,n,t,r){const o=new Xr("SuperSelection.AdminUI.Dto.FeatureSet",[],t,void 0,void 0,(()=>{const e=t.prototype.cases();return[[],[]].map(((n,t)=>new Yr(o,t,e[t],n)))}));return o}(0,0,Fs)}class Ms extends xn{constructor(e,n){super(),this.Partner=e,this.Account=n}}class Us extends xn{constructor(e,n){super(),this.PartnerId=e,this.Name=n}}class Ds extends xn{constructor(e,n){super(),this.AccountId=e,this.Name=n}}class Ps extends xn{constructor(e,n,t,r){super(),this.Id=e,this.PartnerId=n,this.Enabled=t,this.Editor=r}}class Rs extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["AccessRole"]}}function $s(e){return new Rs(0,e)}function Gs(e){return Rt(new Rs(0,"SuperSelection.Access"),e,{Equals:an,GetHashCode:un})?In(void 0):void 0}function Hs(e){return Rt(new Rs(0,"SuperSelection.EditPanel"),e,{Equals:an,GetHashCode:un})?In(void 0):void 0}class js extends xn{constructor(e,n){super(),this.UserName=e,this.Roles=n}}function Bs(e){let n;const t=ut(null==e?"":e,["."],null,0);if(mt(((e,n)=>e===n),t,null)||3!==t.length)n=new Ao(1,"Failed to identify the user");else{let e;const o=t[1];e=atob(o),n=ls(yn(2,ks(to(["Name",so],["Roles",(r=so,new Xr("[]",[r]))]),new To(1),void 0)),e)}var r;if(1===n.tag)return new js(void 0,bt());{const e=n.fields[0];return new js(e.Name,Dt($s,Mt(e.Roles)))}}class Ls extends xn{constructor(e,n){super(),this.PromotedFunds=e,this.Configuration=n}}class Vs extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["PartnerId"]}}class zs extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["AccountId"]}}const Ws=Be,qs=(e,n)=>{re((()=>{const n=e();return()=>{n.Dispose()}}),n)},Zs=e=>{oe((()=>{const n=e();return()=>{n.Dispose()}}))};function Js(e,n,t,r){const o=Ws.memo(e,yn(2,Fn(function(e,n){return null==n||1===n.length?n:gn in n?n[gn]:_n([],e,n)}(2,t),null)));return or((n=>{e.displayName=n}),Nn(n)),e=>{const n=function(e,n){if(null==e)return n;{const t=e;return n.key=t(n),n}}(r,e);return Ws.createElement(o,n)}}function Ys(e){return{Dispose(){e()}}}function Xs(e){return Ws.useState(e)}function Ks(e,n){qs(e,n)}function Qs(e){!function(e,n){qs((n=>(e(),Ys((()=>{})))),[])}(e)}function eu(e){Ks(e,[])}function nu(e){return Ws.useRef(e)}function tu(e){const n=nu(e),t=function(e,t){const r=Fn([],[]);return Ws.useCallback((e=>n.current(e)),r)}();var r;return r=()=>{n.current=e},Zs((e=>(r(),Ys((()=>{}))))),t}class ru{constructor(e=!1){this._id=0,this._cancelled=e,this._listeners=new Map}get isCancelled(){return this._cancelled}cancel(){if(!this._cancelled){this._cancelled=!0;for(const[,e]of this._listeners)e()}}addListener(e){const n=this._id;return this._listeners.set(this._id++,e),n}removeListener(e){return this._listeners.delete(e)}register(e,n){const t=this,r=this.addListener(null==n?e:()=>e(n));return{Dispose(){t.removeListener(r)}}}Dispose(){}}class ou extends Error{constructor(){super("The operation was canceled"),Object.setPrototypeOf(this,ou.prototype)}}class iu{constructor(){this.callCount=0}static get maxTrampolineCallCount(){return 2e3}incrementAndCheck(){return this.callCount++>iu.maxTrampolineCallCount}hijack(e){this.callCount=0,setTimeout(e,0)}}function su(e){return n=>{if(n.cancelToken.isCancelled)n.onCancel(new ou);else if(n.trampoline.incrementAndCheck())n.trampoline.hijack((()=>{try{e(n)}catch(e){n.onError(An(e))}}));else try{e(n)}catch(e){n.onError(An(e))}}}const uu=new class{Bind(e,n){return function(e,n){return su((t=>{e({onSuccess:e=>{try{n(e)(t)}catch(e){t.onError(An(e))}},onError:t.onError,onCancel:t.onCancel,cancelToken:t.cancelToken,trampoline:t.trampoline})}))}(e,n)}Combine(e,n){return this.Bind(e,(()=>n))}Delay(e){return su((n=>e()(n)))}For(e,n){const t=e[Symbol.iterator]();let r=t.next();return this.While((()=>!r.done),this.Delay((()=>{const e=n(r.value);return r=t.next(),e})))}Return(e){return function(e){return su((n=>n.onSuccess(e)))}(e)}ReturnFrom(e){return e}TryFinally(e,n){return su((t=>{e({onSuccess:e=>{n(),t.onSuccess(e)},onError:e=>{n(),t.onError(e)},onCancel:e=>{n(),t.onCancel(e)},cancelToken:t.cancelToken,trampoline:t.trampoline})}))}TryWith(e,n){return su((t=>{e({onSuccess:t.onSuccess,onCancel:t.onCancel,cancelToken:t.cancelToken,trampoline:t.trampoline,onError:e=>{try{n(e)(t)}catch(e){t.onError(An(e))}}})}))}Using(e,n){return this.TryFinally(n(e),(()=>e.Dispose()))}While(e,n){return e()?this.Bind(n,(()=>this.While(e,n))):this.Return(void 0)}Zero(){return su((e=>e.onSuccess(void 0)))}};function lu(e){}const cu=new ru;function au(e,n){return function(e,n){return function(e,n,t,r,o){"function"!=typeof n&&(o=n,n=void 0);const i=new iu;e({onSuccess:n||lu,onError:t||lu,onCancel:r||lu,cancelToken:o||cu,trampoline:i})}(e,n)}(e,n)}class fu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}function du(e,n){const t=nu(function(e){const n=new ru(!1);return n}());return eu((()=>Ys((()=>{t.current.cancel()})))),tu((r=>{var o;null!=(o=t.current)&&o.isCancelled||au(uu.Delay((()=>uu.TryWith(uu.Delay((()=>(n(new fu(1)),uu.Bind(e(r),(e=>(n(new fu(2,e)),uu.Zero())))))),(e=>(n(new fu(3,e)),uu.Zero()))))),t.current)}))}class hu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]}}class mu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Header"]}}class pu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Empty","Text","Binary","Form"]}}class wu extends xn{constructor(e,n,t,r,o,i,s,u){super(),this.url=e,this.method=n,this.headers=t,this.withCredentials=r,this.overridenMimeType=o,this.overridenResponseType=i,this.timeout=s,this.content=u}}class gu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Text","Blob","ArrayBuffer","Unknown"]}}class yu extends xn{constructor(e,n,t,r,o,i){super(),this.statusCode=0|e,this.responseText=n,this.responseType=t,this.responseUrl=r,this.responseHeaders=o,this.content=i}}const _u=new wu("",new hu(0),bt(),!1,void 0,void 0,void 0,new pu(0));function vu(e,n){return"string"!=typeof(t=n)||0===t.length?[n]:ut(n,[e],null,0);var t}function Cu(e){return new wu(e,_u.method,_u.headers,_u.withCredentials,_u.overridenMimeType,_u.overridenResponseType,_u.timeout,_u.content)}function bu(e,n){return new wu(n.url,e,n.headers,n.withCredentials,n.overridenMimeType,n.overridenResponseType,n.timeout,n.content)}function xu(e,n){return new wu(n.url,n.method,n.headers,n.withCredentials,n.overridenMimeType,n.overridenResponseType,n.timeout,e)}function Su(e){return function(e){return su((n=>e([n.onSuccess,n.onError,n.onCancel])))}((n=>{const t=new XMLHttpRequest;t.open(function(e){switch(e.tag){case 1:return"POST";case 3:return"PATCH";case 2:return"PUT";case 4:return"DELETE";case 6:return"OPTIONS";case 5:return"HEAD";default:return"GET"}}(e.method),e.url),t.onreadystatechange=()=>{let e,r,o,i,s,u,l;4===t.readyState&&n[0]((r=t.responseType,e=""===r||"text"===r?t.responseText:"",o=0|t.status,i=t.responseType,u=t.responseType,s=""===u||"text"===u?new gu(0,t.responseText):new gu("arraybuffer"===u?2:"blob"===u?1:3,t.response),l=function(e){const n=$t();return Gr(n,Or(n,e))}(function(e,n,t){const r=[];for(let t=0;t<=n.length-1;t++){const o=e(n[t]);if(null!=o){const e=Tn(o);r.push(e)}}return r}((e=>{const n=Mt(vu(":",e));return Et(n)?void 0:[At(n).toLocaleLowerCase(),ot(":",kt(n)).trim()]}),vu("\r\n",t.getAllResponseHeaders()))),new yu(o,e,i,t.responseURL,l,s)))};const r=Je(e.headers);try{for(;r["System.Collections.IEnumerator.MoveNext"]();){const e=r["System.Collections.Generic.IEnumerator`1.get_Current"]();t.setRequestHeader(e.fields[0],e.fields[1])}}finally{We(r)}t.withCredentials=e.withCredentials;const o=e.overridenMimeType;if(null==o);else{const e=o;t.overrideMimeType(e)}const i=e.overridenResponseType;null==i||(1===i.tag?t.responseType="blob":2===i.tag?t.responseType="arraybuffer":t.responseType="text");const s=e.timeout;if(null==s);else{const e=0|s;t.timeout=0|e}const u=e.content;switch(u.tag){case 1:case 3:case 2:t.send(In(u.fields[0]));break;default:t.send()}}))}function Eu(e){return e}new yu(0,"","","",Jr(),new gu(0,""));const Au=null;function ku(e){return Array.from(e)}function Iu(e){return Pn(e,"O")}function Tu(e){return function(e,n="c",t){if(-1===["c","g","G"].indexOf(n))throw new Error("Custom formats are not supported");const r=Math.abs(function(e){return Ni(e/864e5)}(e)),o=Math.abs(function(e){return Ni(e%864e5/36e5)}(e)),i=Math.abs(function(e){return Ni(e%36e5/6e4)}(e)),s=Math.abs(function(e){return Ni(e%6e4/1e3)}(e)),u=Math.abs(function(e){return Ni(e%1e3)}(e));return`${e<0?"-":""}${0!==r||"c"!==n&&"g"!==n?"c"===n?r+".":r+":":""}${"g"===n?o:Ke(o,2)}:${Ke(i,2)}:${Ke(s,2)}${0!==u||"c"!==n&&"g"!==n?"g"===n?"."+Ke(u,3):"."+function(e,n,t){let r=e.toString(10);for(;r.length<3;)r="0"+r;for(;r.length<7;)r+="0";return r}(u):""}`}(e)}function Nu(){return null}function Fu(e){return Pn(e,"O")}function Ou(e,n){return JSON.stringify(n,yn(2,null),In(e))}function Mu(e,n,t,r){const o=new Sn(null);let i;const s=co(r);let u;if(i=""===s?e:zr(s,o,e),xo(r)){const e=dt((e=>{const r=Mo(n,lo(e)),o=Uu(i,n,t,e[1]);return n=>i=>{const s=n[e[0]];return(!t||t&&null!=s)&&(i[r]=o(s)),i}}),vo(r));u=n=>rr(((e,t)=>t(n)(e)),{},e)}else{if(!bo(r)){let e;const n=co(r);throw e=et(Kn("Cannot generate auto encoder for %s. Please pass an extra encoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders"))(n),new Error(e)}u=e=>{const o=function(e,n){const t=_o(n)[e.tag];if(null==t)throw new Error(`Cannot find case ${e.name} in union type`);return[t,e.fields]}(e,r),s=o[0],u=o[1],l=0|u.length;if(0===l)return lo(s);{const e=0|l,r=Eo(s),o=ft(new Array(e+1),0,e+1,null);o[0]=lo(s);for(let s=1;s<=e;s++){const e=Uu(i,n,t,r[s-1][1]);o[s]=e(u[s-1])}return o}}}return o.contents=u,u}function Uu(e,n,t,r){const o=co(r),i=qr(o,e);if(null==i){if(ao(r)){const o=Uu(e,n,t,fo(r));return e=>ku(ir(o,e))}if(mo(r)){const e=co(wo(r));if("System.SByte"===e)return e=>e;if("System.Byte"===e)return e=>e;if("System.Int16"===e)return e=>e;if("System.UInt16"===e)return e=>e;if("System.Int32"===e)return e=>e;if("System.UInt32"===e)return e=>e;{const e=co(r);return nt(Kn("Cannot generate auto encoder for %s.\nThoth.Json.Net only support the following enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\n\nIf you can't use one of these types, please pass an extra encoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders\n "))(e)}}if(ho(r)){if(So(r)){const o=dt((r=>Uu(e,n,t,r)),Co(r));return e=>ku(sr(((e,n)=>o[e](n)),e))}{const o=co(po(r));if("Microsoft.FSharp.Core.FSharpOption`1[System.Object]"===o){const o=new Xe((()=>{return o=Uu(e,n,t,Kr(r)[0]),e=>{return t=()=>Au,null!=(n=On(o,e))?Tn(n):t();var n,t};var o}));return e=>null==e?Au:o.Value(e)}if("Microsoft.FSharp.Collections.FSharpList`1[System.Object]"===o||"Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"===o||"System.Collections.Generic.IEnumerable`1[System.Object]"===o){const o=Uu(e,n,t,Kr(r)[0]);return e=>ku(ir(o,e))}if("Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"===o){const o=Kr(r)[0],i=Uu(e,n,t,Kr(r)[1]);if("System.String"===co(o)||"System.Guid"===co(o))return e=>rr(((e,n)=>{const t=n;return e[t[0]]=i(t[1]),e}),{},e);{let r;const s=Uu(e,n,t,o);return r=s,e=>ku(ir((e=>{const n=e;return[r(n[0]),i(n[1])]}),e))}}return Mu(e,n,t,r)}}return"System.Boolean"===o?e=>e:"Microsoft.FSharp.Core.Unit"===o?Nu:"System.String"===o?e=>e:"System.Char"===o?e=>e:"System.SByte"===o?e=>e:"System.Byte"===o?e=>e:"System.Int16"===o?e=>e:"System.UInt16"===o?e=>e:"System.Int32"===o?e=>e:"System.UInt32"===o?e=>e:"System.Double"===o?e=>e:"System.Single"===o?e=>e:"System.DateTime"===o?Fu:"System.DateTimeOffset"===o?Iu:"System.TimeSpan"===o?Tu:"System.Guid"===o?Eu:"System.Object"===o?e=>e:Mu(e,n,t,r)}{const e=i;return n=>e.contents(n)}}function Du(e,n,t,r){const o=Fn(n,new To(0)),i=Fn(r,!0);return Uu(function(e){return null!=e?Zr(((e,n)=>new Sn(n[0])),e.Coders):Jr()}(t),o,i,e)}function Pu(e){return`${e}/super-selection/admin`}function Ru(e,n){return uu.Delay((()=>{const t=(r=function(e){return new mu(0,"Authorization",e)}(et(Kn("Bearer %s"))(e)),new wu((o=n).url,o.method,Ut(o.headers,St(r)),o.withCredentials,o.overridenMimeType,o.overridenResponseType,o.timeout,o.content));var r,o;let i;const s=Su(t);return i=uu.Bind(s,(e=>uu.Return(new Ao(0,e)))),uu.Bind(i,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];if(429===e.statusCode||e.statusCode>=500){const e=Su(t);return uu.Bind(e,(e=>uu.Return(new Ao(0,e))))}return uu.Return(new Ao(0,e))}}))}))}function $u(e,n){return uu.Delay((()=>{let t;const r=Ru(n,bu(new hu(0),Cu((t=Pu(e),`${t}/promoted-funds`))));return uu.Bind(r,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];switch(0|e.statusCode){case 200:{const n=ls(yn(2,ks(oo(no("SuperSelection.AdminUI.Dto.PromotedFundOverride",[],Is,(()=>[["PartnerId",so],["AccountId",ro(so)],["Funds",oo(so)]]))),new To(1),void 0)),e.responseText);return uu.Return(n)}case 401:return uu.Return(new Ao(1,"You do not have the appropriate permissions to view this information"));default:return uu.Return(new Ao(1,"Unexpected response from backend"))}}}))}))}function Gu(e,n,t,r){return uu.Delay((()=>{let o;const i=Ru(n,bu(new hu(0),Cu((null==r?e=>`${e}/promoted-funds/${t}`:(o=r,e=>`${e}/promoted-funds/${t}/${o}`))(Pu(e)))));return uu.Bind(i,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];if(200===e.statusCode){const n=ls(yn(2,ks(no("SuperSelection.AdminUI.Dto.PromotedFunds",[],Ts,(()=>[["PartnerFunds",oo(so)],["AccountFunds",oo(so)]])),new To(1),void 0)),e.responseText);return uu.Return(n)}return uu.Return(new Ao(1,"Unexpected response from backend"))}}))}))}function Hu(e,n,t,r){return uu.Delay((()=>{let o;const i=Ru(n,bu(new hu(4),Cu((null==r?e=>`${e}/promoted-funds/${t}`:(o=r,e=>`${e}/promoted-funds/${t}/${o}`))(Pu(e)))));return uu.Bind(i,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];return 200===e.statusCode?uu.Return(new Ao(0,void 0)):uu.Return(new Ao(1,e.responseText))}}))}))}function ju(e,n,t){Ft((t=>{try{t(n)}catch(n){e(n)}}),t)}function Bu(){return bt()}function Lu(e){return St(e)}class Vu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["ColumnHeader"]}}function zu(e){return e.fields[0]}class Wu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["RowCell"]}}function qu(e){return new Wu(0,e)}function Zu(e){return e.fields[0]}function Ju(e){return n=d("th",wn(Mt([["className","px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"],["scope","col"],["children",e]]))),new Vu(0,n);var n}function Yu(e,n){let t;return qu(d("td",wn(Mt([["className","px-6 py-4 whitespace-nowrap text-sm"],(t=[d("a",{className:"text-indigo-600 hover:text-indigo-900",children:n,href:e})],["children",Ws.Children.toArray(Array.from(t))])]))))}function Xu(e,n){return qu(d("td",{className:ot(" ",nr(e,["px-6","py-4","whitespace-nowrap","text-sm"])),children:n}))}function Ku(e,n){return 0===n.indexOf(e)?n:void 0}function Qu(e,n){return function(e,n){const t=e.lastIndexOf(n);return t>=0&&t===e.length-n.length}(n,e)?n:void 0}function el(e,n){return function(e){return 1===e?e=>{let n,t,r,o,i,s;return n=Ku("/",e),null!=n?(t=n,"#"+t):(r=Ku("#/",e),null!=r?(o=r,o):(i=Ku("#",e),null!=i?(s=i,"#/"+lt(s,1,s.length-1)):"#/"+e))}:e=>{let n,t;return n=Ku("/",e),null!=n?(t=n,t):"/"+e}}(n)(ot("/",Dt((e=>e.indexOf("?")>=0||0===e.indexOf("#")||0===e.indexOf("/")?e:encodeURIComponent(e)),e)))}Js((e=>{const n=tu((n=>{const t=Fn(e.onUrlChanged,(e=>{}));!function(e,n,t){var r,o;n((r=2===e?window.location.pathname+window.location.search:window.location.hash,o=e,function(e,n){let t,r;const o=gt();let i=o,s=n;for(;!_t(s);){let n=e(vt(s));for(;!_t(n);)t=i,r=new pt(vt(n),void 0),t.tail=r,i=r,n=Ct(n);s=Ct(s)}const u=i,l=gt();return u.tail=l,Ct(o)}((e=>{if("string"!=typeof(n=e)||/^\s*$/.test(n))return bt();{const n=function(e,...n){return 0===n.length?e.trimEnd():e.replace(new RegExp("["+qn(n.join(""))+"]+$"),"")}(e,"#");if("?"===n)return bt();if(null!=Ku("?",n))return St(n);{const e=n.split("?");if(mt(((e,n)=>e===n),e,null)||1!==e.length){if(mt(((e,n)=>e===n),e,null)||2!==e.length)return bt();if(""===e[1]){const n=e[0];return St(decodeURIComponent(n))}{const n=e[0],t=e[1];return Mt([decodeURIComponent(n),"?"+t])}}{const n=e[0];return St(decodeURIComponent(n))}}}var n}),Mt(ut(null!=Ku("#",r)?lt(r,1,r.length-1):1!==o||null==Qu("#",r)&&null==Qu("#/",r)?r:"",["/"],null,0)))))}(Fn(e.hashMode,1),t)}));eu((()=>(window.navigator.userAgent.indexOf("Trident")>=0||window.navigator.userAgent.indexOf("MSIE")>=0?window.addEventListener("hashchange",n):window.addEventListener("popstate",n),window.addEventListener("CUSTOM_NAVIGATION_EVENT",n),Ys((()=>{window.navigator.userAgent.indexOf("Trident")>=0||window.navigator.userAgent.indexOf("MSIE")>=0?window.removeEventListener("hashchange",n):window.removeEventListener("popstate",n),window.removeEventListener("CUSTOM_NAVIGATION_EVENT",n)}))))),Qs((()=>{const e=document.createEvent("CustomEvent");e.initEvent("CUSTOM_NAVIGATION_EVENT",!0,!0),window.dispatchEvent(e)}));const t=e.application;return null==t?null:t}),void 0,void 0,void 0);const nl={None:0,LowerFirst:1,SnakeCase:2,SnakeCaseAllCaps:3,KebabCase:4};function tl(e,n){return e.replace(/[a-z]?[A-Z]/g,(e=>1===e.length?e.toLowerCase():e.charAt(0)+n+e.charAt(1).toLowerCase()))}function rl(e,n=nl.None){const t={},r=n;function o(e){throw new Error("Cannot infer key and value of "+String(e))}function i(e,n,r){e=function(e,n){switch(n){case nl.LowerFirst:return e.charAt(0).toLowerCase()+e.slice(1);case nl.SnakeCase:return tl(e,"_");case nl.SnakeCaseAllCaps:return tl(e,"_").toUpperCase();case nl.KebabCase:return tl(e,"-");case nl.None:default:return e}}(e,n),t[e]=r}for(let n of e){let e=nl.None;if(null==n&&o(n),n instanceof bn){const t=n.cases()[n.tag];n=0===n.fields.length?t:[t].concat(n.fields),e=r}if(Array.isArray(n))switch(n.length){case 0:o(n);break;case 1:i(n[0],e,!0);break;case 2:const t=n[1];i(n[0],e,t);break;default:i(n[0],e,n.slice(1))}else"string"==typeof n?i(n,e,!0):o(n)}return t}const ol=ge((function(e,n){return d("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:n},e),d("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))})),il=ge((function(e,n){return d("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:n},e),d("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))}));class sl extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Pencil","Trash"]}}class ul extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["ClassName"]}}function ll(e,n){if(1===e.tag){const e=rl(n,1);return d(ol,e)}{const e=rl(n,1);return d(il,e)}}class cl extends xn{constructor(e,n){super(),this.Text=e,this.Action=n}}class al extends xn{constructor(e,n){super(),this.Text=e,this.Action=n}}class fl extends xn{constructor(e,n){super(),this.Text=e,this.Action=n}}function dl(e,n){return new cl(e.Text,vn(1,e.Action,[n]))}function hl(e,n,t){let r;return d("button",wn(Mt([["className",ot(" ",["mr-2","w-14","px-4","py-2","border","border-transparent","shadow-sm","font-medium","rounded-md","text-white","focus:outline-none","focus:ring-2","focus:ring-offset-2","sm:text-sm",`bg-${n}-600`,`hover:bg-${n}-700`,`focus:ring-${n}-500`])],["type","button"],["onClick",t],(r=[ll(e,St(new ul(0,"mr-3 flex-shrink-0 h-4 w-6")))],["children",Ws.Children.toArray(Array.from(r))])])))}const ml=e=>hl(new sl(0),"indigo",e),pl=e=>hl(new sl(1),"red",e);function wl(e,n){return d("button",{className:ot(" ",["w-full","inline-flex","justify-center","rounded-md","border","border-transparent","shadow-sm","px-4","py-2","text-base","font-medium","text-white","focus:outline-none","focus:ring-2","focus:ring-offset-2","sm:ml-3","sm:w-auto","sm:text-sm",`focus:ring-${e}-500`,`bg-${e}-600`,`hover:bg-${e}-700`]),type:"button",children:n.Text,onClick:n.Action})}function gl(e){return d("button",{className:ot(" ",["mt-3","w-full","inline-flex","justify-center","rounded-md","border","border-gray-300","shadow-sm","px-4","py-2","bg-white","text-base","font-medium","text-gray-700","hover:bg-gray-50","focus:outline-none","focus:ring-2","focus:ring-offset-2","focus:ring-indigo-500","sm:mt-0","sm:ml-3","sm:w-auto","sm:text-sm"]),type:"button",children:e.Text,onClick:e.Action})}function yl(e){return["strokeLinecap",e]}function _l(e){return["strokeLinejoin",e]}const vl=d("div",wn(Mt([["className",ot(" ",["mx-auto","flex-shrink-0","flex","items-center","justify-center","h-12","w-12","rounded-full","bg-red-100","sm:mx-0","sm:h-10","sm:w-10"])],(()=>{let e;const n=[d("svg",wn(Mt([["className",ot(" ",["h-6","w-6","text-red-600"])],["fill","none"],["stroke","currentColor"],["strokeWidth",2],["viewBox","0 0 24 24"],["xmlns","http://www.w3.org/2000/svg"],(e=St(d("path",wn(Mt([yl("round"),_l("round"),["d","M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"]])))),["children",Ws.Children.toArray(Array.from(e))])])))];return["children",Ws.Children.toArray(Array.from(n))]})()]))),Cl=d("div",wn(Mt([["className",ot(" ",["mx-auto","flex-shrink-0","flex","items-center","justify-center","h-12","w-12","rounded-full","bg-indigo-100","sm:mx-0","sm:h-10","sm:w-10"])],(()=>{let e;const n=[d("svg",wn(Mt([["className",ot(" ",["h-6","w-6","text-indigo-600"])],["fill","none"],["stroke","currentColor"],["strokeWidth",2],["viewBox","0 0 24 24"],["xmlns","http://www.w3.org/2000/svg"],(e=St(d("path",wn(Mt([yl("round"),_l("round"),["d","M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"]])))),["children",Ws.Children.toArray(Array.from(e))])])))];return["children",Ws.Children.toArray(Array.from(n))]})()])));function bl(e,n){let t;return d("div",wn(Mt([["className",ot(" ",["bg-gray-50","px-4","py-3","sm:px-6","sm:flex","sm:flex-row-reverse"])],(t=[wl("red",e),gl(n)],["children",Ws.Children.toArray(Array.from(t))])])))}function xl(e){let n;return d("div",wn(Mt([["className","mt-2"],(n=[d("p",{className:ot(" ",["text-sm","text-gray-500"]),children:e})],["children",Ws.Children.toArray(Array.from(n))])])))}function Sl(e,n,t,r){let o,i,s,u;return d("div",wn(Mt([["className",ot(" ",["relative","inline-block","align-bottom","bg-white","rounded-lg","text-left","overflow-hidden","shadow-xl","transform","transition-all","sm:my-8","sm:align-middle","sm:max-w-lg","sm:w-full"])],(o=[d("div",wn(Mt([["className",ot(" ",["bg-white","px-4","pt-5","pb-4","sm:p-6","sm:pb-4"])],(i=[d("div",wn(Mt([["className",ot(" ",["sm:flex","sm:items-start"])],(s=[vl,d("div",wn(Mt([["className",ot(" ",["mt-3","text-center","sm:mt-0","sm:ml-4","sm:text-left"])],(u=[(l=e,d("h3",{className:ot(" ",["text-lg","leading-6","font-medium","text-gray-900"]),id:"modal-title",children:l})),xl(n)],["children",Ws.Children.toArray(Array.from(u))])])))],["children",Ws.Children.toArray(Array.from(s))])])))],["children",Ws.Children.toArray(Array.from(i))])]))),bl(t,r)],["children",Ws.Children.toArray(Array.from(o))])])));var l}function El(e){let n,t,r;return d("div",wn(Mt([["className",ot(" ",["relative","z-10"])],["role",ot(" ",["dialog"])],(n=[d("div",{className:ot(" ",["fixed","inset-0","bg-gray-500","bg-opacity-75","transition-opacity"])}),d("div",wn(Mt([["className",ot(" ",["fixed","z-10","inset-0","overflow-y-auto"])],(t=[d("div",wn(Mt([["className",ot(" ",["flex","min-h-full","items-end","justify-center","p-4","text-center","sm:items-center","sm:p-0"])],(r=[d("span",{className:ot(" ",["hidden","sm:inline-block","sm:align-middle","sm:h-screen"]),children:""}),Sl(e.HeadingText,e.BodyText,e.ConfirmAction,e.CancelAction)],["children",Ws.Children.toArray(Array.from(r))])])))],["children",Ws.Children.toArray(Array.from(t))])])))],["children",Ws.Children.toArray(Array.from(n))])])))}function Al(e,n,t,r,o){const i=function(e,n,t,r){const o=0|mn(e,t);if(0===o)throw new Error("The step of a range cannot be zero");const i=o>0;return t=>{const o=0|mn(t,n);return i&&o<=0||!i&&o>=0?[t,r(t,e)]:void 0}}(n,t,r,o);return Yt((()=>{return n=i,t=e,Zt((()=>function(e,n){let t,r=n;return Wt((()=>{if(null!=t){const e=t[0];return t[1],e}return Bt()}),(()=>{if(t=e(r),null!=t){t[0];const e=t[1];return r=e,!0}return!1}),(()=>{}))}(n,t)));var n,t}))}class kl extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Writable","ReadWritable"]}}class Il{constructor(e){this.state=new kl(0,ft(new Array(pn(dn,e,10)),0,pn(dn,e,10),null),0)}}function Tl(e){const n=e.state;if(1===n.tag){const t=0|n.fields[1],r=0|n.fields[2],o=n.fields[0],i=(r+1)%o.length|0;return e.state=i===t?new kl(0,o,t):new kl(1,o,t,i),In(o[r])}}class Nl extends xn{constructor(e,n,t,r,o,i,s){super(),this.init=e,this.update=n,this.subscribe=t,this.view=r,this.setState=o,this.onError=i,this.syncDispatch=s}}function Fl(e,n){const t=n.init(e),r=t[0],o=new Il(10);let i=!1,s=r;const u=vn(1,n.syncDispatch,[e=>{if(i)!function(e,n){const t=e.state;if(1===t.tag){const i=0|t.fields[1],s=0|t.fields[2],u=t.fields[0];u[i]=n;const l=(i+1)%u.length|0;e.state=l===s?new kl(1,(r=s,o=u,Array.from(Yt((()=>nr(lr(r,o),Yt((()=>{return nr((e=r,n=o,er((()=>Jt(n)),((n,t)=>{if(n<e){if(t["System.Collections.IEnumerator.MoveNext"]())return In(t["System.Collections.Generic.IEnumerator`1.get_Current"]());throw new Error(jt+"\\nParameter name: source")}}),(e=>{We(e)}))),Yt((()=>{return n=e=>Kt(null),e=o.length,t=Al(0,1,e,0,((e,n)=>e+n)),Yt((()=>Xt(ir(n,t))));var e,n,t})));var e,n}))))))),u.length,0):new kl(1,u,l,s)}else{const r=0|t.fields[1],o=t.fields[0];o[r]=n;const i=(r+1)%o.length|0;e.state=new kl(1,o,i,r)}var r,o}(o,e);else{i=!0;let t=In(e);for(;null!=t;){const e=Tn(t);try{const t=n.update(e,s),r=t[0];n.setState(r,u),ju((t=>{n.onError([et(Kn("Error in command while handling: %A"))(e),t])}),u,t[1]),s=r}catch(t){n.onError([et(Kn("Unable to process the message: %A"))(e),t])}t=Tl(o)}i=!1}}]);n.setState(r,u),ju((e=>{n.onError(["Error intitializing:",e])}),u,function(e){const n=gt();let t=n;const r=e=>{t=Tt(((e,n)=>{const t=new pt(n,void 0);return e.tail=t,t}),t,e)};if(Le(e))e.forEach(r);else if(e instanceof pt)Ft(r,e);else{const n=Je(e);try{for(;n["System.Collections.IEnumerator.MoveNext"]();)r(n["System.Collections.Generic.IEnumerator`1.get_Current"]())}finally{We(n)}}const o=t,i=gt();return o.tail=i,Ct(n)}(Mt([(()=>{try{return n.subscribe(r)}catch(e){return n.onError(["Unable to subscribe:",e]),Bu()}})(),t[1]])))}class Ol{constructor(){this.hasDisposedOnce=!1,this.state=void 0,this.listener=void 0,this.dispatcher=void 0}}function Ml(){return new Ol}function Ul(e,n,t,r){Fl(n,function(e,n){return new Nl(n.init,n.update,n.subscribe,n.view,((e,n)=>{!function(e,n,t){e.state=In(n),e.dispatcher=t;const r=e.listener;null!=r&&r(n)}(t,e,n)}),n.onError,n.syncDispatch)}(0,e()));const o=function(e){return e.state}(t);if(null!=o)return Tn(o);throw new Error("Elmish program has not initialized")}function Dl(e,n){return function(e,n,t){const r=Xs(Ml)[0],o=Xs((()=>Ul(e,n,r))),i=o[1];return Ks((()=>(function(e){return e.hasDisposedOnce}(r)&&i(Ul(e,n,r)),Ys((()=>{!function(e){const n=e.state;if(null!=n){const e=Tn(n);ze(e)&&We(e)}e.dispatcher=void 0,e.state=void 0,e.hasDisposedOnce=!0}(r)})))),Fn(t,[])),function(e,n){null==e.listener&&(e.listener=n)}(r,i),[o[0],e=>{!function(e,n){const t=e.dispatcher;null!=t&&t(n)}(r,e)}]}(e,void 0,n)}function Pl(e,n,t){return Dl((()=>function(e,n,t){return new Nl(e,n,(e=>Bu()),t,yn(2,(e=>{const n=vn(1,t,[e]);return e=>{n(e)}})),(e=>{var n,t;n=e[0],t=e[1],console.error(In(n),t)}),yn(2,(e=>e)))}(e,n,((e,n)=>{}))),t)}function Rl(){const e=St(d("span",{children:["Please wait..."]}));return d("div",{children:Ws.Children.toArray(Array.from(e))})}function $l(e){const n=St(d("span",{children:[e.error]}));return d("div",{children:Ws.Children.toArray(Array.from(n))})}class Gl extends xn{constructor(e,n){super(),this.PartnerId=e,this.AccountId=n}}class Hl extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["LoadData","LoadDetail","ShowResetModal","CloseModal","ResetPromotedFunds","Reload"]}}class jl extends xn{constructor(e,n,t,r){super(),this.PromotedFundOverrides=e,this.FundLookup=n,this.User=t,this.ModalState=r}}class Bl extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["ShowModal","Hidden"]}}function Ll(e,n,t){if(null==n);else{const r=n;au(function(e,n,t,r){const o=[n,t];return uu.Delay((()=>{let n;const t=o[1];return n=null==t?void 0:t.fields[0],uu.Bind((i=e.backendUrl,s=e.accessToken,u=o[0].fields[0],l=n,uu.Delay((()=>{let e;const n=Ru(s,bu(new hu(0),Cu((null==l?e=>`${e}/account-registry/${u}`:(e=l,n=>`${n}/account-registry/${u}/${e}`))(Pu(i)))));return uu.Bind(n,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];if(200===e.statusCode){const n=ls(yn(2,ks(no("SuperSelection.AdminUI.Dto.PromotedFundDetail",[],Ms,(()=>[["Partner",no("SuperSelection.AdminUI.Dto.PartnerDetail",[],Us,(()=>[["PartnerId",so],["Name",so]]))],["Account",ro(no("SuperSelection.AdminUI.Dto.AccountDetail",[],Ds,(()=>[["AccountId",so],["Name",so]])))]])),new To(1),void 0)),e.responseText);return uu.Return(n)}return uu.Return(new Ao(1,"Unexpected response from backend"))}}))}))),(e=>(r(new Hl(1,o,new fu(2,e))),uu.Zero())));var i,s,u,l}))}(e,r[0],r[1],t))}}function Vl(e){const n=(t=(e,n)=>an(n,new fu(0))?In(e):void 0,function(e,n){return Tr(n,e.tree)}(e,t));var t;if(null==n)return[e,void 0];{const t=Tn(n);return[Wr(t,(e=>{let n;return null==e?void 0:(n=e,new fu(1))}),e),In(t)]}}function zl(e){let n;return[[new Vs(0,e.PartnerId),(n=e.AccountId,null==n?void 0:new zs(0,n))],new fu(0)]}function Wl(e,n,t){let r,o,i,s,u,l,c;switch(1===n.tag?(r=2,s=n.fields[1],u=n.fields[0]):2===n.tag?(r=3,l=n.fields[0]):3===n.tag?r=4:4===n.tag?(r=5,c=n.fields[0]):5===n.tag?r=6:2===n.fields[0].tag&&0===n.fields[0].fields[0].tag?(r=0,o=n.fields[0].fields[0].fields[0]):(r=1,i=n.fields[0]),r){case 0:return function(e,n,t){const r=Vl(Hr(Dt(zl,t)));return[new jl(new fu(2,new Ao(0,t)),r[0],n.User,n.ModalState),Lu((n=>{Ll(e,r[1],n)}))]}(e,t,o);case 1:return[new jl(i,t.FundLookup,t.User,t.ModalState),Bu()];case 2:return function(e,n,t,r,o){const i=Vl(Wr([t,r],(e=>null!=e?o:void 0),n.FundLookup));return[new jl(n.PromotedFundOverrides,i[0],n.User,n.ModalState),Lu((n=>{Ll(e,i[1],n)}))]}(e,t,u[0],u[1],s);case 3:return[new jl(t.PromotedFundOverrides,t.FundLookup,t.User,new Bl(0,l)),Bu()];case 4:return[new jl(t.PromotedFundOverrides,t.FundLookup,t.User,new Bl(1)),Bu()];case 5:return[new jl(new fu(1),t.FundLookup,t.User,new Bl(1)),Lu((n=>{!function(e,n,t,r){au(function(e,n,t,r){return uu.Delay((()=>uu.Bind(Hu(e.backendUrl,e.accessToken,n,t),(e=>(r(new Hl(5)),uu.Zero())))))}(e,n,t,r))}(e,c.PartnerId,c.AccountId,n)}))];case 6:return[new jl(new fu(1),t.FundLookup,t.User,t.ModalState),Lu((n=>{!function(e,n){au(function(e,n){return uu.Delay((()=>uu.Bind($u(e.backendUrl,e.accessToken),(e=>(n(new Hl(0,new fu(2,e))),uu.Zero())))))}(e,n))}(e,n)}))]}}const ql=Mt([Ju("Partner"),Ju("Account"),Ju("Promoted Funds"),Ju("")]);function Zl(e,n){return el(Mt(["account-registry","partners",e,"accounts",n,"super-configuration"]),1)}function Jl(e){let n;const t=Pl((()=>{return n=e.accessToken,[new jl(new fu(0),Jr(),Bs(n),new Bl(1)),Bu()];var n}),((n,t)=>Wl(e,n,t))),r=t[0],o=t[1];if(Qs(du((()=>function(e){return $u(e.backendUrl,e.accessToken)}(e)),(e=>{o(new Hl(0,e))}))),null==Gs(r.User.Roles))return d($l,{error:"You do not have the appropriate permissions to view this information"});{const e=r.PromotedFundOverrides;let t,i,s,u;switch(1===e.tag?t=0:2===e.tag?0===e.fields[0].tag?(t=3,u=e.fields[0].fields[0]):(t=1,i=e.fields[0].fields[0]):3===e.tag?(t=2,s=e.fields[0]):t=0,t){case 0:return d(Rl,null);case 1:return d($l,{error:i});case 2:return d($l,{error:Cn(s)});case 3:return d("div",wn(St((n=Qt(Yt((()=>nr(Kt(d("h2",{className:"text-xl text-gray-900",children:"Promoted Fund Overrides"})),Yt((()=>nr(Kt(d("p",{className:"mt-2 text-sm text-gray-700",children:"A list of all promoted fund overrides. This does not include accounts or partners that use the default configuration."})),Yt((()=>nr(Kt(function(e,n){let t,r,o,i,s,u,l;return d("div",wn(Mt([["className","flex flex-col mt-4"],(t=[d("div",wn(Mt([["className","-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"],(r=[d("div",wn(Mt([["className","py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"],(o=[d("div",wn(Mt([["className","shadow overflow-hidden border-b border-gray-200 sm:rounded-lg"],(i=[d("table",wn(Mt([["className","min-w-full divide-y divide-gray-200"],(s=[d("thead",{className:"bg-gray-50",children:(u=ir(zu,e),d("tr",{children:Ws.Children.toArray(Array.from(u))}))}),(l=sr(((e,n)=>(n=>{let t;return d("tr",wn(Mt([["className",e%2==0?"bg-white":"bg-gray-50"],(t=ir(Zu,n),["children",Ws.Children.toArray(Array.from(t))])])))})(n)),n),d("tbody",{children:Ws.Children.toArray(Array.from(l))}))],["children",Ws.Children.toArray(Array.from(s))])])))],["children",Ws.Children.toArray(Array.from(i))])])))],["children",Ws.Children.toArray(Array.from(o))])])))],["children",Ws.Children.toArray(Array.from(r))])])))],["children",Ws.Children.toArray(Array.from(t))])])))}(ql,Dt((e=>function(e,n,t){return Qt(Yt((()=>{let r;const o=function(e,n){const t=Vr(e,[new Vs(0,n.PartnerId),(r=n.AccountId,On((e=>new zs(0,e)),r))]);var r;let o,i;switch(null!=t&&2===t.tag&&0===t.fields[0].tag?(o=0,i=t.fields[0].fields[0]):o=1,o){case 0:return i;case 1:return}}(e,t),i=function(e,n){let t;return Fn((t=n,null==t?void 0:t.Partner.Name),e)}(t.PartnerId,o),s=function(e,n){let t,r;return t=n,null==(o=null==t?void 0:(r=t.Account,null==r?void 0:r.Name))?e:o;var o}(t.AccountId,o);return nr(Kt((r=[(u=t.PartnerId,el(Mt(["account-registry","partners",u,"super-configuration"]),1)),i],Yu(r[0],r[1]))),Yt((()=>{let e,r,o,i;return nr((e=[t.AccountId,s],null!=e[0]&&null!=e[1]?(r=e[0],o=e[1],Kt((i=[Zl(t.PartnerId,r),o],Yu(i[0],i[1])))):Kt(Xu(["text-gray-500"],"-"))),Yt((()=>nr(Kt(Xu(["text-gray-500"],ot(", ",t.Funds))),Yt((()=>{return Kt((e=pl((e=>{n(new Hl(2,new Gl(t.PartnerId,t.AccountId)))})),qu(d("td",{className:ot(" ",["flex justify-center py-2"]),children:Ws.Children.toArray([e])}))));var e}))))))})));var u})))}(r.FundLookup,o,e)),u))),Yt((()=>{const e=r.ModalState;return 0===e.tag?Kt(function(e,n){let t;const r=e.AccountId;return t=null==r?`Partner: ${e.PartnerId}`:`Account: ${r}`,d(El,{BodyText:`Are you sure you want to reset the current promoted funds for ${t}? This action cannot be undone.`,CancelAction:new al("Cancel",(e=>{n(new Hl(3))})),ConfirmAction:new cl("Reset",(t=>{n(new Hl(4,e))})),HeadingText:"Reset Promoted Funds"})}(e.fields[0],o)):Kt(null)})))))))))))),["children",Ws.Children.toArray(Array.from(n))]))))}}}class Yl extends xn{constructor(e,n,t){super(),this.Id=e,this.PartnerId=n,this.Enabled=t}}const Xl=St("BringYourOwnFundCustomStep");class Kl extends xn{constructor(e,n){super(),this.PromotedFunds=e,this.FeatureFlags=n}}class Ql extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Account","Partner"]}}class ec extends xn{constructor(e,n,t){super(),this.Data=e,this.User=n,this.ModalState=t}}class nc extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["ResetModal","EditModal","Hidden"]}}class tc extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["DefaultUsi","FeatureSet","PromotedFunds","FeatureFlag"]}}class rc extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["LoadData","ShowEditModal","ShowResetModal","ShowFeatureFlagModal","EnableFeatureFlag","DisableFeatureFlag","CloseModal","UpdateDefaultUsi","UpdateFeatureSet","UpdatePromotedFunds","ResetDefaultUsi","ResetPromotedFunds","PromotedFundsUpdate","FeatureFlagUpdate"]}}class oc extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Default","Inherited","Config"]}}function ic(e){switch(e.tag){case 1:return e.fields[0]+" (inherited)";case 2:return e.fields[0];default:return e.fields[0]+" (default)"}}function sc(e){switch(e.tag){case 1:default:return"";case 2:return e.fields[0]}}class uc extends xn{constructor(e,n,t,r,o,i){super(),this.UpdatePromotedFunds=e,this.DeletePromotedFunds=n,this.UpdateDefaultFundUsi=t,this.UpdateFeatureSet=r,this.UpdateFeatureFlag=o,this.ReloadData=i}}class lc extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["TextInput","Select"]}}function cc(e,n,t,r){let o,i;return d("div",wn(Mt([["className","mt-2 w-full h-full"],(o=[d("div",wn(Mt([["className","h-30"],(i=Qt(Yt((()=>nr(Kt(d("label",{className:"sr-only text-base",htmlFor:"field",children:n})),Yt((()=>{let n;const o=r;return 1===o.tag?Kt(d("select",wn(Mt([["name","field"],["id","field"],["className","shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-base border-gray-300 rounded-md"],["value",t],["onChange",n=>{e(n.target.value)}],(n=Dt((e=>d("option",{value:e,children:e})),o.fields[0]),["children",Ws.Children.toArray(Array.from(n))])])))):Kt(d("input",{type:"text",name:"field",id:"field",className:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-base border-gray-300 rounded-md",value:t,onChange:n=>{e(n.target.value)}}))})))))),["children",Ws.Children.toArray(Array.from(i))])])))],["children",Ws.Children.toArray(Array.from(o))])])))}function ac(e,n){let t;return d("div",wn(Mt([["className",ot(" ",["bg-gray-50","px-4","py-3","sm:px-6","sm:flex","sm:flex-row-reverse"])],(t=[wl("indigo",e),gl(n)],["children",Ws.Children.toArray(Array.from(t))])])))}function fc(e){let n,t,r,o,i,s,u;const l=(c=e.FieldValue,Ws.useState(c));var c;const a=l[0],f=dl(e.ConfirmAction,a);return d("div",wn(Mt([["className",ot(" ",["relative","z-10"])],["role",ot(" ",["dialog"])],(n=[d("div",{className:ot(" ",["fixed","inset-0","bg-gray-500","bg-opacity-75","transition-opacity"])}),d("div",wn(Mt([["className",ot(" ",["fixed","z-10","inset-0","overflow-y-auto"])],(t=[d("div",wn(Mt([["className",ot(" ",["flex","min-h-full","items-end","justify-center","p-4","text-center","sm:items-center","sm:p-0"])],(r=[d("span",{className:ot(" ",["hidden","sm:inline-block","sm:align-middle","sm:h-screen"]),children:""}),d("div",wn(Mt([["className",ot(" ",["relative","inline-block","align-bottom","bg-white","rounded-lg","text-left","overflow-hidden","shadow-xl","transform","transition-all","sm:my-8","sm:align-middle","sm:max-w-lg","sm:w-full"])],(o=[d("div",wn(Mt([["className",ot(" ",["bg-white","px-4","pt-5","pb-4","sm:p-6","sm:pb-4"])],(i=[d("div",wn(Mt([["className",ot(" ",["sm:flex","sm:items-start"])],(s=[Cl,d("div",wn(Mt([["className",ot(" ",["mt-3","text-center","sm:mt-0","sm:ml-4","sm:text-left","w-full"])],(u=[(h=e.HeadingText,d("h3",{className:ot(" ",["text-lg","leading-6","font-medium","text-gray-900"]),id:"modal-title",children:h})),cc(l[1],e.FieldName,a,e.FieldType)],["children",Ws.Children.toArray(Array.from(u))])])))],["children",Ws.Children.toArray(Array.from(s))])])))],["children",Ws.Children.toArray(Array.from(i))])]))),ac(f,e.CancelAction)],["children",Ws.Children.toArray(Array.from(o))])])))],["children",Ws.Children.toArray(Array.from(r))])])))],["children",Ws.Children.toArray(Array.from(t))])])))],["children",Ws.Children.toArray(Array.from(n))])])));var h}function dc(e){let n,t,r;return d("div",wn(Mt([["className","mt-2 w-full h-full"],(n=[d("div",wn(Mt([["className","h-30"],(t=[d("p",{className:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-base border-gray-300 rounded-md",value:e}),d("div",wn(Mt([["className","mt-2"],(r=[d("p",{className:"text-sm text-gray-500",children:e})],["children",Ws.Children.toArray(Array.from(r))])])))],["children",Ws.Children.toArray(Array.from(t))])])))],["children",Ws.Children.toArray(Array.from(n))])])))}function hc(e,n){let t;return d("div",wn(Mt([["className",ot(" ",["bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"])],(t=[wl("indigo",e),gl(n)],["children",Ws.Children.toArray(Array.from(t))])])))}function mc(e){let n,t,r,o,i,s,u;const l=dl(e.ConfirmAction,"");return d("div",wn(Mt([["className","relative z-10"],["role",ot(" ",["dialog"])],(n=[d("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"}),d("div",wn(Mt([["className","fixed z-10 inset-0 overflow-y-auto"],(t=[d("div",wn(Mt([["className","flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"],(r=[d("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen",children:""}),d("div",wn(Mt([["className","relative inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"],(o=[d("div",wn(Mt([["className","bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"],(i=[d("div",wn(Mt([["className","sm:flex sm:items-start"],(s=[Cl,d("div",wn(Mt([["className","mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"],(u=[(c=e.HeadingText,d("h3",{className:ot(" ",["text-lg leading-6 font-medium text-gray-900"]),id:"modal-title",children:c})),dc(e.Subtext)],["children",Ws.Children.toArray(Array.from(u))])])))],["children",Ws.Children.toArray(Array.from(s))])])))],["children",Ws.Children.toArray(Array.from(i))])]))),hc(l,e.CancelAction)],["children",Ws.Children.toArray(Array.from(o))])])))],["children",Ws.Children.toArray(Array.from(r))])])))],["children",Ws.Children.toArray(Array.from(t))])])))],["children",Ws.Children.toArray(Array.from(n))])])));var c}function pc(e,n){return d(fc,{CancelAction:new al("Cancel",(e=>{n(new rc(6))})),ConfirmAction:new fl("Save",((e,t)=>{n(new rc(9,e))})),FieldName:"Promoted Funds",FieldType:new lc(0),FieldValue:e,HeadingText:"Edit Promoted Funds"})}function wc(e,n){const t=e.Enabled?["Disable",e=>new rc(5,e)]:["Enable",e=>new rc(4,e)],r=t[0];return d(mc,{CancelAction:new al("Cancel",(e=>{n(new rc(6))})),ConfirmAction:new fl(r,((r,o)=>{n(t[1](e))})),HeadingText:e.Id,Subtext:`This will ${r.toLocaleLowerCase()} the ${e.Id} feature`})}function gc(e){return d(El,{BodyText:"Are you sure you want to reset the current promoted funds? This action cannot be undone.",CancelAction:new al("Cancel",(n=>{e(new rc(6))})),ConfirmAction:new cl("Reset",(n=>{e(new rc(11))})),HeadingText:"Reset Promoted Funds"})}function yc(e,n){au(e.ReloadData(n))}function _c(e,n,t,r){return uu.Delay((()=>{const o=Gu(e,n,t,r);return uu.Bind(o,(t=>{const o=t;if(1===o.tag)return uu.Return(new Ao(1,o.fields[0]));{const t=function(e,n,t){return uu.Delay((()=>{let r;const o=Ru(n,bu(new hu(0),Cu((r=Pu(e),`${r}/configurations/${t}`))));return uu.Bind(o,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];switch(0|e.statusCode){case 200:{const n=ls(yn(2,ks(no("SuperSelection.AdminUI.Dto.AccountConfiguration",[],Ns,(()=>[["DefaultFundUSI",ro(so)],["FeatureSet",Os()]])),new To(1),void 0)),e.responseText);return uu.Return(n)}case 404:{const e=new Ao(0,new Ns(void 0,new Fs(1)));return uu.Return(e)}default:return uu.Return(new Ao(1,"Unexpected response from backend"))}}}))}))}(e,n,r);return uu.Bind(t,(e=>{let n;const t=e;return n=1===t.tag?new Ao(1,t.fields[0]):new Ao(0,new Ql(0,new Ls(o.fields[0],t.fields[0]))),uu.Return(n)}))}}))}))}function vc(e,n,t){return uu.Delay((()=>{const r=Gu(e,n,t,void 0);return uu.Bind(r,(r=>{const o=r;if(1===o.tag)return uu.Return(new Ao(1,o.fields[0]));{const r=function(e,n,t){return uu.Delay((()=>{let r;const o=Ru(n,bu(new hu(0),Cu((r=Pu(e),`${r}/partner/${t}/feature-flags`))));return uu.Bind(o,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];switch(0|e.statusCode){case 200:{let n;const t=ls(yn(2,ks(to(["Items",oo(no("SuperSelection.AdminUI.Dto.FeatureFlag",[],Ps,(()=>[["Id",so],["PartnerId",so],["Enabled",uo],["Editor",so]])))]),new To(1),void 0)),e.responseText);return n=uu.Return(t),uu.Bind(n,(e=>{let n;const t=e;return n=1===t.tag?new Ao(1,t.fields[0]):new Ao(0,t.fields[0].Items),uu.Return(n)}))}case 404:return uu.Return(new Ao(0,bt()));default:return uu.Return(new Ao(1,"Unexpected response from backend"))}}}))}))}(e,n,t);return uu.Bind(r,(e=>{let n;const r=e;var i,s;return n=1===r.tag?new Ao(1,r.fields[0]):new Ao(0,new Ql(1,new Kl(o.fields[0],(i=t,s=r.fields[0],Dt((e=>{const n=Pt((n=>n.Id===e),s);if(null==n)return new Yl(e,i,!1);{const e=n;return new Yl(e.Id,i,e.Enabled)}}),Xl))))),uu.Return(n)}))}}))}))}function Cc(e){return new uc(((n,t)=>function(e,n,t){return uu.Delay((()=>uu.Bind(function(e,n,t,r,o){return uu.Delay((()=>{let i;const s=(null==r?e=>`${e}/promoted-funds/${t}`:(i=r,e=>`${e}/promoted-funds/${t}/${i}`))(Pu(e)),u=Ru(n,bu(new hu(1),xu(new pu(1,Ou(0,Du(to(["Funds",oo(so)]),new To(1),void 0,void 0)(o))),Cu(s))));return uu.Bind(u,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];return 200===e.statusCode?uu.Return(new Ao(0,void 0)):uu.Return(new Ao(1,e.responseText))}}))}))}(e.backendUrl,e.accessToken,e.partnerId,e.accountId,n),(e=>(t(new rc(12,e)),uu.Zero())))))}(e,n,t)),(n=>function(e,n){return uu.Delay((()=>uu.Bind(Hu(e.backendUrl,e.accessToken,e.partnerId,e.accountId),(e=>(n(new rc(12,e)),uu.Zero())))))}(e,n)),((n,t)=>function(e,n,t){return uu.Delay((()=>{const r=e.accountId;if(null==r)return uu.Zero();{const o=r;return uu.Bind(function(e,n,t,r){return uu.Delay((()=>{let o,i;const s=Ru(n,bu(new hu(2),xu(new pu(1,(o={DefaultFundUsi:r},Ou(0,Du(to(["DefaultFundUsi",so]),new To(1),void 0,void 0)(o)))),Cu((i=Pu(e),`${i}/configurations/${t}/default-fund-usi`)))));return uu.Bind(s,(e=>{const n=e;return 1===n.tag?uu.Return(new Ao(1,n.fields[0])):200===n.fields[0].statusCode?uu.Return(new Ao(0,void 0)):uu.Return(new Ao(1,"Unexpected response from backend"))}))}))}(e.backendUrl,e.accessToken,o,n),(e=>(t(new rc(12,e)),uu.Zero())))}}))}(e,n,t)),((n,t)=>function(e,n,t){return uu.Delay((()=>{const r=e.accountId;if(null==r)return uu.Zero();{const o=r;return uu.Bind(function(e,n,t,r){return uu.Delay((()=>{let o,i;const s=Ru(n,bu(new hu(2),xu(new pu(1,(o={FeatureSet:r},Ou(0,Du(to(["FeatureSet",Os()]),new To(1),void 0,void 0)(o)))),Cu((i=Pu(e),`${i}/configurations/${t}/feature-set`)))));return uu.Bind(s,(e=>{const n=e;return 1===n.tag?uu.Return(new Ao(1,n.fields[0])):200===n.fields[0].statusCode?uu.Return(new Ao(0,void 0)):uu.Return(new Ao(1,"Unexpected response from backend"))}))}))}(e.backendUrl,e.accessToken,o,n),(e=>(t(new rc(12,e)),uu.Zero())))}}))}(e,n,t)),((n,t)=>function(e,n,t,r){return uu.Delay((()=>uu.Bind(function(e,n,t,r,o){return uu.Delay((()=>{let i;const s=`${Pu(e)}/partner/${t}/feature-flags/${r}`,u=Ru(n,bu(new hu(2),xu(new pu(1,(i={Enabled:o,PartnerId:t},Ou(0,Du(to(["Enabled",uo],["PartnerId",so]),new To(1),void 0,void 0)(i)))),Cu(s))));return uu.Bind(u,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];return 200===e.statusCode?uu.Return(new Ao(0,void 0)):uu.Return(new Ao(1,e.responseText))}}))}))}(e.backendUrl,e.accessToken,e.partnerId,n,t),(e=>(r(new rc(13,e)),uu.Zero())))))}(e,n[0],n[1],t)),(n=>function(e,n){return uu.Delay((()=>{let t;return uu.Bind((t=e.accountId,null==t?vc(e.backendUrl,e.accessToken,e.partnerId):_c(e.backendUrl,e.accessToken,e.partnerId,t)),(e=>(n(new rc(0,new fu(2,e))),uu.Zero())))}))}(e,n)))}function bc(e,n,t,r){let o,i,s,u,l;const c=Mt(Nn((o=t,null==o?void 0:ml(o)))),a=Mt(Nn((i=r,null==i?void 0:pl(i))));return d("div",wn(Mt([["className",ot(" ",["px-4","py-5","sm:grid","sm:grid-cols-5","sm:gap-4","sm:px-6"])],(s=[d("dt",{className:ot(" ",["text-sm","font-medium","text-gray-500"]),children:e}),d("dd",wn(Mt([["className",ot(" ",["mt-1","text-sm","text-gray-900","sm:mt-0","sm:col-span-2"])],(u=[d("span",{className:"flex-grow",children:n})],["children",Ws.Children.toArray(Array.from(u))])]))),d("span",wn(Mt([["className","flex-grow"],(l=Qt(Yt((()=>nr(c,Yt((()=>a)))))),["children",Ws.Children.toArray(Array.from(l))])])))],["children",Ws.Children.toArray(Array.from(s))])])))}function xc(e,n,t){return bc("Default USI",n,null!=(r=e,Rt(new Rs(0,"SuperSelection.ChangeDefaultFund"),r,{Equals:an,GetHashCode:un})?In(void 0):void 0)?e=>{t(new rc(1,new tc(0)))}:void 0,void 0);var r}function Sc(e,n,t){const r=null!=(o=e,Rt(new Rs(0,"SuperSelection.ChangeFeatureSet"),o,{Equals:an,GetHashCode:un})?In(void 0):void 0)?e=>{t(new rc(1,new tc(1)))}:void 0;var o;return bc("Feature Set",Cn(n),r,void 0)}function Ec(e,n,t){return bc("Funds",n,null!=Hs(e)?e=>{t(new rc(1,new tc(2)))}:void 0,null!=Hs(e)?e=>{t(new rc(2,new tc(2)))}:void 0)}function Ac(e){let n;return d("div",wn(Mt([["className",ot(" ",["px-4 py-4 sm:px-0"])],(n=[d("h3",{className:ot(" ",["text-lg font-semibold leading-7 text-gray-900"]),children:e})],["children",Ws.Children.toArray(Array.from(n))])])))}function kc(e){let n,t;const r=Pl((()=>{return n=e.accessToken,[new ec(new fu(0),Bs(n),new nc(2)),Bu()];var n}),yn(2,(n=Cc(e),e=>t=>function(e,n,t){switch(n.tag){case 1:return[new ec(t.Data,t.User,new nc(1,n.fields[0])),Bu()];case 2:return[new ec(t.Data,t.User,new nc(0,n.fields[0])),Bu()];case 6:case 10:return[new ec(t.Data,t.User,new nc(2)),Bu()];case 7:return[new ec(t.Data,t.User,new nc(2)),Lu((t=>{au(e.UpdateDefaultFundUsi(n.fields[0],t))}))];case 8:return[new ec(t.Data,t.User,new nc(2)),Lu((t=>{au(e.UpdateFeatureSet(n.fields[0],t))}))];case 9:{const r=Mt(dt((e=>e.trim()),ut(n.fields[0],[","],null,0)));return[new ec(t.Data,t.User,new nc(2)),Lu((n=>{au(e.UpdatePromotedFunds({Funds:r},n))}))]}case 11:return[new ec(t.Data,t.User,new nc(2)),Lu((n=>{au(e.DeletePromotedFunds(n))}))];case 12:return[new ec(new fu(1),t.User,t.ModalState),Lu((n=>{yc(e,n)}))];case 3:return[new ec(t.Data,t.User,new nc(1,new tc(3,n.fields[0]))),Bu()];case 4:return[new ec(t.Data,t.User,new nc(2)),Lu((t=>{au(e.UpdateFeatureFlag([n.fields[0].Id,!0],t))}))];case 5:return[new ec(t.Data,t.User,new nc(2)),Lu((t=>{au(e.UpdateFeatureFlag([n.fields[0].Id,!1],t))}))];case 13:return[new ec(new fu(1),t.User,t.ModalState),Lu((n=>{yc(e,n)}))];default:return[new ec(n.fields[0],t.User,t.ModalState),Bu()]}}(n,e,t)))),o=r[0],i=r[1];Qs(du((()=>function(e){const n=e.accountId;return null==n?vc(e.backendUrl,e.accessToken,e.partnerId):_c(e.backendUrl,e.accessToken,e.partnerId,n)}(e)),(e=>{i(new rc(0,e))})));const s=o.User.Roles;if(null==Gs(s))return d($l,{error:"You do not have the appropriate permissions to view this information"});{const e=o.Data;let n,r,u,l;switch(1===e.tag?n=0:2===e.tag?1===e.fields[0].tag?(n=2,u=e.fields[0].fields[0]):(n=1,r=e.fields[0].fields[0]):3===e.tag?(n=3,l=e.fields[0]):n=0,n){case 0:return d(Rl,null);case 1:if(1===r.tag){const e=r.fields[0],n=Qt(Yt((()=>{let n;const t=function(e){const n=e.PartnerFunds;return Et(n)?new oc(0,"mercermychoice"):new oc(2,ot(", ",n))}(e.PromotedFunds),r=Qt(Yt((()=>ir((e=>function(e,n,t){let r,o,i;const s=null!=Hs(e)?e=>{t(new rc(3,n))}:e=>{},u=!(null!=Hs(e)),l=d("button",wn(Mt([["className",ot(" ",Qt(Yt((()=>nr(Kt("relative inline-flex h-6 w-11 gap-4 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2"),Yt((()=>nr(Kt(u?"cursor-not-allowed":""),Yt((()=>n.Enabled?Kt("bg-indigo-600"):Kt("bg-gray-300")))))))))))],["role",ot(" ",["switch"])],["type","button"],["onClick",s],(r=[d("span",{className:ot(" ",Qt(Yt((()=>nr(Kt("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out"),Yt((()=>n.Enabled?Kt("translate-x-5"):Kt("translate-x-0"))))))))})],["children",Ws.Children.toArray(Array.from(r))])])));return d("div",wn(Mt([["className",ot(" ",["px-4 py-5 sm:grid sm:grid-cols-5 sm:gap-4 sm:px-6"])],(o=[d("dt",{className:ot(" ",["text-sm font-medium text-gray-500"]),children:n.Id}),d("dd",wn(Mt([["className",ot(" ",["mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"])],(i=[d("span",{className:"flex-grow",children:Ws.Children.toArray([l])})],["children",Ws.Children.toArray(Array.from(i))])])))],["children",Ws.Children.toArray(Array.from(o))])])))}(s,e,i)),e.FeatureFlags))));return Kt(d("div",wn(St((n=Qt(Yt((()=>{let e,n,u;return nr(Kt(d("div",wn(St((e=[Ac("Promoted Funds"),(n=St(Ec(s,ic(t),i)),d("dl",{children:Ws.Children.toArray(Array.from(n))})),Ac("Feature Flags"),(u=Qt(Yt((()=>r))),d("dl",{children:Ws.Children.toArray(Array.from(u))}))],["children",Ws.Children.toArray(Array.from(e))]))))),Yt((()=>{const e=o.ModalState;switch(e.tag){case 1:{const n=e.fields[0];switch(n.tag){case 1:default:return Kt(null);case 2:return Kt(pc(sc(t),i));case 3:return Kt(wc(n.fields[0],i))}}case 2:return Kt(null);default:switch(e.fields[0].tag){case 1:case 3:default:return Kt(null);case 2:return Kt(gc(i))}}})))}))),["children",Ws.Children.toArray(Array.from(n))])))))})));return d("div",{children:Ws.Children.toArray(Array.from(n))})}{const e=r.fields[0],n=Fn(e.Configuration.DefaultFundUSI,"-"),u=Fn(e.Configuration.DefaultFundUSI,""),l=function(e){const n=[e.PartnerFunds,e.AccountFunds];let t,r;switch(Et(n[0])?Et(n[1])?t=0:(t=2,r=n[1]):Et(n[1])?t=1:(t=2,r=n[1]),t){case 0:return new oc(0,"mercermychoice");case 1:return new oc(1,ot(", ",n[0]));case 2:return new oc(2,ot(", ",r))}}(e.PromotedFunds);return d("div",wn(St((t=Qt(Yt((()=>{let t,r;return nr(Kt(d("div",wn(St((t=[(r=Mt([xc(s,n,i),Sc(s,e.Configuration.FeatureSet,i),Ec(s,ic(l),i)]),d("dl",{children:Ws.Children.toArray(Array.from(r))}))],["children",Ws.Children.toArray(Array.from(t))]))))),Yt((()=>{const n=o.ModalState;switch(n.tag){case 1:{const t=n.fields[0];switch(t.tag){case 1:return Kt(function(e,n){return d(fc,{CancelAction:new al("Cancel",(e=>{n(new rc(6))})),ConfirmAction:new fl("Save",((e,t)=>{n(new rc(8,new Fs("Basic"===e?0:1)))})),FieldName:"Feature Set",FieldType:new lc(1,Mt(["Promoted","Basic"])),FieldValue:Cn(e),HeadingText:"Change Feature Set"})}(e.Configuration.FeatureSet,i));case 2:return Kt(pc(sc(l),i));case 3:return Kt(wc(t.fields[0],i));default:return Kt(function(e,n){return d(fc,{CancelAction:new al("Cancel",(e=>{n(new rc(6))})),ConfirmAction:new fl("Save",((e,t)=>{n(new rc(7,e))})),FieldName:"Default USI",FieldType:new lc(0),FieldValue:e,HeadingText:"Edit Default USI"})}(u,i))}}case 2:return Kt(null);default:switch(n.fields[0].tag){case 1:case 3:return Kt(null);case 2:return Kt(gc(i));default:return Kt(function(e){return d(El,{BodyText:"Are you sure you want to reset the current Default USI? This action cannot be undone.",CancelAction:new al("Cancel",(n=>{e(new rc(6))})),ConfirmAction:new cl("Reset",(n=>{e(new rc(10))})),HeadingText:"Reset Default USI"})}(i))}}})))}))),["children",Ws.Children.toArray(Array.from(t))]))))}case 2:return d($l,{error:u});case 3:return d($l,{error:Cn(l)})}}}V((e=>d(Jl,e)),"superhero-super-selection"),V((e=>d(kc,e)),"superhero-super-configuration")})();
|
|
1
|
+
(()=>{"use strict";var e,n,t,r,o,i,s,u={},l=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(e,n){for(var t in n)e[t]=n[t];return e}function f(e){var n=e.parentNode;n&&n.removeChild(e)}function d(n,t,r){var o,i,s,u={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:u[s]=t[s];if(arguments.length>2&&(u.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof n&&null!=n.defaultProps)for(s in n.defaultProps)void 0===u[s]&&(u[s]=n.defaultProps[s]);return h(n,u,o,i,null)}function h(e,r,o,i,s){var u={type:e,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==s?++t:s};return null==s&&null!=n.vnode&&n.vnode(u),u}function m(e){return e.children}function p(e,n){this.props=e,this.context=n}function w(e,n){if(null==n)return e.__?w(e.__,e.__.__k.indexOf(e)+1):null;for(var t;n<e.__k.length;n++)if(null!=(t=e.__k[n])&&null!=t.__e)return t.__e;return"function"==typeof e.type?w(e):null}function g(e){var n,t;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,n=0;n<e.__k.length;n++)if(null!=(t=e.__k[n])&&null!=t.__e){e.__e=e.__c.base=t.__e;break}return g(e)}}function y(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!_.__r++||i!==n.debounceRendering)&&((i=n.debounceRendering)||o)(_)}function _(){for(var e;_.__r=r.length;)e=r.sort((function(e,n){return e.__v.__b-n.__v.__b})),r=[],e.some((function(e){var n,t,r,o,i,s;e.__d&&(i=(o=(n=e).__v).__e,(s=n.__P)&&(t=[],(r=a({},o)).__v=o.__v+1,I(s,o,r,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[i]:null,t,null==i?w(o):i,o.__h),T(t,o),o.__e!=i&&g(o)))}))}function v(e,n,t,r,o,i,s,c,a,f){var d,p,g,y,_,v,b,S=r&&r.__k||l,E=S.length;for(t.__k=[],d=0;d<n.length;d++)if(null!=(y=t.__k[d]=null==(y=n[d])||"boolean"==typeof y?null:"string"==typeof y||"number"==typeof y||"bigint"==typeof y?h(null,y,null,null,y):Array.isArray(y)?h(m,{children:y},null,null,null):y.__b>0?h(y.type,y.props,y.key,null,y.__v):y)){if(y.__=t,y.__b=t.__b+1,null===(g=S[d])||g&&y.key==g.key&&y.type===g.type)S[d]=void 0;else for(p=0;p<E;p++){if((g=S[p])&&y.key==g.key&&y.type===g.type){S[p]=void 0;break}g=null}I(e,y,g=g||u,o,i,s,c,a,f),_=y.__e,(p=y.ref)&&g.ref!=p&&(b||(b=[]),g.ref&&b.push(g.ref,null,y),b.push(p,y.__c||_,y)),null!=_?(null==v&&(v=_),"function"==typeof y.type&&y.__k===g.__k?y.__d=a=C(y,a,e):a=x(e,y,g,S,_,a),"function"==typeof t.type&&(t.__d=a)):a&&g.__e==a&&a.parentNode!=e&&(a=w(g))}for(t.__e=v,d=E;d--;)null!=S[d]&&("function"==typeof t.type&&null!=S[d].__e&&S[d].__e==t.__d&&(t.__d=w(r,d+1)),O(S[d],S[d]));if(b)for(d=0;d<b.length;d++)F(b[d],b[++d],b[++d])}function C(e,n,t){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,n="function"==typeof r.type?C(r,n,t):x(t,r,r,o,r.__e,n));return n}function b(e,n){return n=n||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){b(e,n)})):n.push(e)),n}function x(e,n,t,r,o,i){var s,u,l;if(void 0!==n.__d)s=n.__d,n.__d=void 0;else if(null==t||o!=i||null==o.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(o),s=null;else{for(u=i,l=0;(u=u.nextSibling)&&l<r.length;l+=2)if(u==o)break e;e.insertBefore(o,i),s=i}return void 0!==s?s:o.nextSibling}function S(e,n,t){"-"===n[0]?e.setProperty(n,t):e[n]=null==t?"":"number"!=typeof t||c.test(n)?t:t+"px"}function E(e,n,t,r,o){var i;e:if("style"===n)if("string"==typeof t)e.style.cssText=t;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(n in r)t&&n in t||S(e.style,n,"");if(t)for(n in t)r&&t[n]===r[n]||S(e.style,n,t[n])}else if("o"===n[0]&&"n"===n[1])i=n!==(n=n.replace(/Capture$/,"")),n=n.toLowerCase()in e?n.toLowerCase().slice(2):n.slice(2),e.l||(e.l={}),e.l[n+i]=t,t?r||e.addEventListener(n,i?k:A,i):e.removeEventListener(n,i?k:A,i);else if("dangerouslySetInnerHTML"!==n){if(o)n=n.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==n&&"list"!==n&&"form"!==n&&"tabIndex"!==n&&"download"!==n&&n in e)try{e[n]=null==t?"":t;break e}catch(e){}"function"==typeof t||(null!=t&&(!1!==t||"a"===n[0]&&"r"===n[1])?e.setAttribute(n,t):e.removeAttribute(n))}}function A(e){this.l[e.type+!1](n.event?n.event(e):e)}function k(e){this.l[e.type+!0](n.event?n.event(e):e)}function I(e,t,r,o,i,s,u,l,c){var f,d,h,w,g,y,_,C,b,x,S,E=t.type;if(void 0!==t.constructor)return null;null!=r.__h&&(c=r.__h,l=t.__e=r.__e,t.__h=null,s=[l]),(f=n.__b)&&f(t);try{e:if("function"==typeof E){if(C=t.props,b=(f=E.contextType)&&o[f.__c],x=f?b?b.props.value:f.__:o,r.__c?_=(d=t.__c=r.__c).__=d.__E:("prototype"in E&&E.prototype.render?t.__c=d=new E(C,x):(t.__c=d=new p(C,x),d.constructor=E,d.render=M),b&&b.sub(d),d.props=C,d.state||(d.state={}),d.context=x,d.__n=o,h=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=E.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=a({},d.__s)),a(d.__s,E.getDerivedStateFromProps(C,d.__s))),w=d.props,g=d.state,h)null==E.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==E.getDerivedStateFromProps&&C!==w&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(C,x),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(C,d.__s,x)||t.__v===r.__v){d.props=C,d.state=d.__s,t.__v!==r.__v&&(d.__d=!1),d.__v=t,t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),d.__h.length&&u.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(C,d.__s,x),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(w,g,y)}))}d.context=x,d.props=C,d.state=d.__s,(f=n.__r)&&f(t),d.__d=!1,d.__v=t,d.__P=e,f=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(o=a(a({},o),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(y=d.getSnapshotBeforeUpdate(w,g)),S=null!=f&&f.type===m&&null==f.key?f.props.children:f,v(e,Array.isArray(S)?S:[S],t,r,o,i,s,u,l,c),d.base=t.__e,t.__h=null,d.__h.length&&u.push(d),_&&(d.__E=d.__=null),d.__e=!1}else null==s&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=N(r.__e,t,r,o,i,s,u,c);(f=n.diffed)&&f(t)}catch(e){t.__v=null,(c||null!=s)&&(t.__e=l,t.__h=!!c,s[s.indexOf(l)]=null),n.__e(e,t,r)}}function T(e,t){n.__c&&n.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){n.__e(e,t.__v)}}))}function N(n,t,r,o,i,s,l,c){var a,d,h,m=r.props,p=t.props,g=t.type,y=0;if("svg"===g&&(i=!0),null!=s)for(;y<s.length;y++)if((a=s[y])&&"setAttribute"in a==!!g&&(g?a.localName===g:3===a.nodeType)){n=a,s[y]=null;break}if(null==n){if(null===g)return document.createTextNode(p);n=i?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,p.is&&p),s=null,c=!1}if(null===g)m===p||c&&n.data===p||(n.data=p);else{if(s=s&&e.call(n.childNodes),d=(m=r.props||u).dangerouslySetInnerHTML,h=p.dangerouslySetInnerHTML,!c){if(null!=s)for(m={},y=0;y<n.attributes.length;y++)m[n.attributes[y].name]=n.attributes[y].value;(h||d)&&(h&&(d&&h.__html==d.__html||h.__html===n.innerHTML)||(n.innerHTML=h&&h.__html||""))}if(function(e,n,t,r,o){var i;for(i in t)"children"===i||"key"===i||i in n||E(e,i,null,t[i],r);for(i in n)o&&"function"!=typeof n[i]||"children"===i||"key"===i||"value"===i||"checked"===i||t[i]===n[i]||E(e,i,n[i],t[i],r)}(n,p,m,i,c),h)t.__k=[];else if(y=t.props.children,v(n,Array.isArray(y)?y:[y],t,r,o,i&&"foreignObject"!==g,s,l,s?s[0]:r.__k&&w(r,0),c),null!=s)for(y=s.length;y--;)null!=s[y]&&f(s[y]);c||("value"in p&&void 0!==(y=p.value)&&(y!==n.value||"progress"===g&&!y||"option"===g&&y!==m.value)&&E(n,"value",y,m.value,!1),"checked"in p&&void 0!==(y=p.checked)&&y!==n.checked&&E(n,"checked",y,m.checked,!1))}return n}function F(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){n.__e(e,r)}}function O(e,t,r){var o,i;if(n.unmount&&n.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||F(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){n.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&O(o[i],t,"function"!=typeof e.type);r||null==e.__e||f(e.__e),e.__e=e.__d=void 0}function M(e,n,t){return this.constructor(e,t)}function U(t,r,o){var i,s,l;n.__&&n.__(t,r),s=(i="function"==typeof o)?null:o&&o.__k||r.__k,l=[],I(r,t=(!i&&o||r).__k=d(m,null,[t]),s||u,u,void 0!==r.ownerSVGElement,!i&&o?[o]:s?null:r.firstChild?e.call(r.childNodes):null,l,!i&&o?o:s?s.__e:r.firstChild,i),T(l,t)}function D(e,n){U(e,n,D)}function P(n,t,r){var o,i,s,u=a({},n.props);for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:u[s]=t[s];return arguments.length>2&&(u.children=arguments.length>3?e.call(arguments,2):r),h(n.type,u,o||n.key,i||n.ref,null)}function R(){return(R=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function $(e){this.getChildContext=function(){return e.context};var n=e.children,t=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n.indexOf(t=i[r])>=0||(o[t]=e[t]);return o}(e,["context","children"]);return P(n,t)}function G(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=d($,R({},this._props,{context:e.detail.context}),function e(n,t){if(3===n.nodeType)return n.data;if(1!==n.nodeType)return null;var r=[],o={},i=0,s=n.attributes,u=n.childNodes;for(i=s.length;i--;)"slot"!==s[i].name&&(o[s[i].name]=s[i].value,o[H(s[i].name)]=s[i].value);for(i=u.length;i--;){var l=e(u[i],null),c=u[i].slot;c?o[c]=d(L,{name:c},l):r[i]=l}var a=t?d(L,null,r):r;return d(t||n.nodeName.toLowerCase(),o,a)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?D:U)(this._vdom,this._root)}function H(e){return e.replace(/-(\w)/g,(function(e,n){return n?n.toUpperCase():""}))}function j(e,n,t){if(this._vdom){var r={};r[e]=t=null==t?void 0:t,r[H(e)]=t,this._vdom=P(this._vdom,r),U(this._vdom,this._root)}}function B(){U(this._vdom=null,this._root)}function L(e,n){var t=this;return d("slot",R({},e,{ref:function(e){e?(t.ref=e,t._listener||(t._listener=function(e){e.stopPropagation(),e.detail.context=n},e.addEventListener("_preact",t._listener))):t.ref.removeEventListener("_preact",t._listener)}}))}function V(e,n){!function(e,n,t,r){function o(){var n=Reflect.construct(HTMLElement,[],o);return n._vdomComponent=e,n._root=n,n}(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=G,o.prototype.attributeChangedCallback=j,o.prototype.disconnectedCallback=B,t=t||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=t,t.forEach((function(e){Object.defineProperty(o.prototype,e,{get:function(){return this._vdom.props[e]},set:function(n){this._vdom?this.attributeChangedCallback(e,null,n):(this._props||(this._props={}),this._props[e]=n,this.connectedCallback());var t=typeof n;null!=n&&"string"!==t&&"boolean"!==t&&"number"!==t||this.setAttribute(e,n)}})})),customElements.define(n||e.tagName||e.displayName||e.name,o)}(e,n)}e=l.slice,n={__e:function(e,n){for(var t,r,o;n=n.__;)if((t=n.__c)&&!t.__)try{if((r=t.constructor)&&null!=r.getDerivedStateFromError&&(t.setState(r.getDerivedStateFromError(e)),o=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(e),o=t.__d),o)return t.__E=t}catch(n){e=n}throw e}},t=0,p.prototype.setState=function(e,n){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),"function"==typeof e&&(e=e(a({},t),this.props)),e&&a(t,e),null!=e&&this.__v&&(n&&this.__h.push(n),y(this))},p.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),y(this))},p.prototype.render=m,r=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_.__r=0,s=0;var z,W,q,Z=0,J=[],Y=n.__b,X=n.__r,K=n.diffed,Q=n.__c,ee=n.unmount;function ne(e,t){n.__h&&n.__h(W,e,Z||t),Z=0;var r=W.__H||(W.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function te(e,n,t){var r=ne(z++,2);return r.t=e,r.__c||(r.__=[t?t(n):fe(void 0,n),function(e){var n=r.t(r.__[0],e);r.__[0]!==n&&(r.__=[n,r.__[1]],r.__c.setState({}))}],r.__c=W),r.__}function re(e,t){var r=ne(z++,3);!n.__s&&ae(r.__H,t)&&(r.__=e,r.__H=t,W.__H.__h.push(r))}function oe(e,t){var r=ne(z++,4);!n.__s&&ae(r.__H,t)&&(r.__=e,r.__H=t,W.__h.push(r))}function ie(e,n){var t=ne(z++,7);return ae(t.__H,n)&&(t.__=e(),t.__H=n,t.__h=e),t.__}function se(){for(var e;e=J.shift();)if(e.__P)try{e.__H.__h.forEach(le),e.__H.__h.forEach(ce),e.__H.__h=[]}catch(t){e.__H.__h=[],n.__e(t,e.__v)}}n.__b=function(e){W=null,Y&&Y(e)},n.__r=function(e){X&&X(e),z=0;var n=(W=e.__c).__H;n&&(n.__h.forEach(le),n.__h.forEach(ce),n.__h=[])},n.diffed=function(e){K&&K(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==J.push(t)&&q===n.requestAnimationFrame||((q=n.requestAnimationFrame)||function(e){var n,t=function(){clearTimeout(r),ue&&cancelAnimationFrame(n),setTimeout(e)},r=setTimeout(t,100);ue&&(n=requestAnimationFrame(t))})(se)),W=null},n.__c=function(e,t){t.some((function(e){try{e.__h.forEach(le),e.__h=e.__h.filter((function(e){return!e.__||ce(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],n.__e(r,e.__v)}})),Q&&Q(e,t)},n.unmount=function(e){ee&&ee(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{le(e)}catch(e){t=e}})),t&&n.__e(t,r.__v))};var ue="function"==typeof requestAnimationFrame;function le(e){var n=W,t=e.__c;"function"==typeof t&&(e.__c=void 0,t()),W=n}function ce(e){var n=W;e.__c=e.__(),W=n}function ae(e,n){return!e||e.length!==n.length||n.some((function(n,t){return n!==e[t]}))}function fe(e,n){return"function"==typeof n?n(e):n}function de(e,n){for(var t in n)e[t]=n[t];return e}function he(e,n){for(var t in e)if("__source"!==t&&!(t in n))return!0;for(var r in n)if("__source"!==r&&e[r]!==n[r])return!0;return!1}function me(e){this.props=e}(me.prototype=new p).isPureReactComponent=!0,me.prototype.shouldComponentUpdate=function(e,n){return he(this.props,e)||he(this.state,n)};var pe=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),pe&&pe(e)};var we="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ge(e){function n(n,t){var r=de({},n);return delete r.ref,e(r,(t=n.ref||t)&&("object"!=typeof t||"current"in t)?t:null)}return n.$$typeof=we,n.render=n,n.prototype.isReactComponent=n.__f=!0,n.displayName="ForwardRef("+(e.displayName||e.name)+")",n}var ye=function(e,n){return null==e?null:b(b(e).map(n))},_e={map:ye,forEach:ye,count:function(e){return e?b(e).length:0},only:function(e){var n=b(e);if(1!==n.length)throw"Children.only";return n[0]},toArray:b},ve=n.__e;n.__e=function(e,n,t){if(e.then)for(var r,o=n;o=o.__;)if((r=o.__c)&&r.__c)return null==n.__e&&(n.__e=t.__e,n.__k=t.__k),r.__c(e,n);ve(e,n,t)};var Ce=n.unmount;function be(){this.__u=0,this.t=null,this.__b=null}function xe(e){var n=e.__.__c;return n&&n.__e&&n.__e(e)}function Se(){this.u=null,this.o=null}n.unmount=function(e){var n=e.__c;n&&n.__R&&n.__R(),n&&!0===e.__h&&(e.type=null),Ce&&Ce(e)},(be.prototype=new p).__c=function(e,n){var t=n.__c,r=this;null==r.t&&(r.t=[]),r.t.push(t);var o=xe(r.__v),i=!1,s=function(){i||(i=!0,t.__R=null,o?o(u):u())};t.__R=s;var u=function(){if(! --r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(n,t,r){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map((function(n){return e(n,t,r)})),n.__c&&n.__c.__P===t&&(n.__e&&r.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=r)),n}(e,e.__c.__P,e.__c.__O)}var n;for(r.setState({__e:r.__b=null});n=r.t.pop();)n.forceUpdate()}},l=!0===n.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(s,s)},be.prototype.componentWillUnmount=function(){this.t=[]},be.prototype.render=function(e,n){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(n,t,r){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),n.__c.__H=null),null!=(n=de({},n)).__c&&(n.__c.__P===r&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map((function(n){return e(n,t,r)}))),n}(this.__b,t,r.__O=r.__P)}this.__b=null}var o=n.__e&&d(m,null,e.fallback);return o&&(o.__h=null),[d(m,null,n.__e?null:e.children),o]};var Ee=function(e,n,t){if(++t[1]===t[0]&&e.o.delete(n),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(t=e.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;e.u=t=t[2]}};function Ae(e){return this.getChildContext=function(){return e.context},e.children}function ke(e){var n=this,t=e.i;n.componentWillUnmount=function(){U(null,n.l),n.l=null,n.i=null},n.i&&n.i!==t&&n.componentWillUnmount(),e.__v?(n.l||(n.i=t,n.l={nodeType:1,parentNode:t,childNodes:[],appendChild:function(e){this.childNodes.push(e),n.i.appendChild(e)},insertBefore:function(e,t){this.childNodes.push(e),n.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),n.i.removeChild(e)}}),U(d(Ae,{context:n.context},e.__v),n.l)):n.l&&n.componentWillUnmount()}(Se.prototype=new p).__e=function(e){var n=this,t=xe(n.__v),r=n.o.get(e);return r[0]++,function(o){var i=function(){n.props.revealOrder?(r.push(o),Ee(n,e,r)):o()};t?t(i):i()}},Se.prototype.render=function(e){this.u=null,this.o=new Map;var n=b(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&n.reverse();for(var t=n.length;t--;)this.o.set(n[t],this.u=[1,0,this.u]);return e.children},Se.prototype.componentDidUpdate=Se.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(n,t){Ee(e,t,n)}))};var Ie="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Te=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ne="undefined"!=typeof document,Fe=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};p.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(p.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})}));var Oe=n.event;function Me(){}function Ue(){return this.cancelBubble}function De(){return this.defaultPrevented}n.event=function(e){return Oe&&(e=Oe(e)),e.persist=Me,e.isPropagationStopped=Ue,e.isDefaultPrevented=De,e.nativeEvent=e};var Pe,Re={configurable:!0,get:function(){return this.class}},$e=n.vnode;n.vnode=function(e){var n=e.type,t=e.props,r=t;if("string"==typeof n){var o=-1===n.indexOf("-");for(var i in r={},t){var s=t[i];Ne&&"children"===i&&"noscript"===n||"value"===i&&"defaultValue"in t&&null==s||("defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===s?s="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+n)&&!Fe(t.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)?i=i.toLowerCase():o&&Te.test(i)?i=i.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===s&&(s=void 0),r[i]=s)}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=b(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=b(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,t.class!=t.className&&(Re.enumerable="className"in t,null!=t.className&&(r.class=t.className),Object.defineProperty(r,"className",Re))}e.$$typeof=Ie,$e&&$e(e)};var Ge=n.__r;n.__r=function(e){Ge&&Ge(e),Pe=e.__c};var He={ReactCurrentDispatcher:{current:{readContext:function(e){return Pe.__n[e.__c].props.value}}}};function je(e){return!!e&&e.$$typeof===Ie}const Be={useState:function(e){return Z=1,te(fe,e)},useReducer:te,useEffect:re,useLayoutEffect:oe,useRef:function(e){return Z=5,ie((function(){return{current:e}}),[])},useImperativeHandle:function(e,n,t){Z=6,oe((function(){"function"==typeof e?e(n()):e&&(e.current=n())}),null==t?t:t.concat(e))},useMemo:ie,useCallback:function(e,n){return Z=8,ie((function(){return e}),n)},useContext:function(e){var n=W.context[e.__c],t=ne(z++,9);return t.c=e,n?(null==t.__&&(t.__=!0,n.sub(W)),n.props.value):e.__},useDebugValue:function(e,t){n.useDebugValue&&n.useDebugValue(t?t(e):e)},version:"17.0.2",Children:_e,render:function(e,n,t){return null==n.__k&&(n.textContent=""),U(e,n),"function"==typeof t&&t(),e?e.__c:null},hydrate:function(e,n,t){return D(e,n),"function"==typeof t&&t(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(U(null,e),!0)},createPortal:function(e,n){return d(ke,{__v:e,i:n})},createElement:d,createContext:function(e,n){var t={__c:n="__cC"+s++,__:e,Consumer:function(e,n){return e.children(n)},Provider:function(e){var t,r;return this.getChildContext||(t=[],(r={})[n]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&t.some(y)},this.sub=function(e){t.push(e);var n=e.componentWillUnmount;e.componentWillUnmount=function(){t.splice(t.indexOf(e),1),n&&n.call(e)}}),e.children}};return t.Provider.__=t.Consumer.contextType=t},createFactory:function(e){return d.bind(null,e)},cloneElement:function(e){return je(e)?P.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:m,isValidElement:je,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:p,PureComponent:me,memo:function(e,n){function t(e){var t=this.props.ref,r=t==e.ref;return!r&&t&&(t.call?t(null):t.current=null),n?!n(this.props,e)||!r:he(this.props,e)}function r(n){return this.shouldComponentUpdate=t,d(e,n)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r},forwardRef:ge,flushSync:function(e,n){return e(n)},unstable_batchedUpdates:function(e,n){return e(n)},StrictMode:m,Suspense:be,SuspenseList:Se,lazy:function(e){var n,t,r;function o(o){if(n||(n=e()).then((function(e){t=e.default||e}),(function(e){r=e})),r)throw r;if(!t)throw n;return d(t,o)}return o.displayName="Lazy",o.__f=!0,o},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:He};function Le(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function Ve(e){return"function"==typeof e.GetHashCode}function ze(e){return null!=e&&"function"==typeof e.Dispose}function We(e){ze(e)&&e.Dispose()}function qe(e,n){var t,r;return(null===(t=Object.getPrototypeOf(e))||void 0===t?void 0:t.constructor)===(null===(r=Object.getPrototypeOf(n))||void 0===r?void 0:r.constructor)}class Ze{constructor(e){this.iter=e}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const e=this.iter.next();return this.current=e.value,!e.done}"System.Collections.IEnumerator.Reset"(){throw new Error("JS iterators cannot be reset")}Dispose(){}}function Je(e){return"function"==typeof e.GetEnumerator?e.GetEnumerator():new Ze(e[Symbol.iterator]())}function Ye(e){return{[Symbol.iterator](){return this},next(){const n=e["System.Collections.IEnumerator.MoveNext"]();return{done:!n,value:n?e["System.Collections.IEnumerator.get_Current"]():void 0}}}}class Xe{constructor(e){this.factory=e,this.isValueCreated=!1}get Value(){return this.isValueCreated||(this.createdValue=this.factory(),this.isValueCreated=!0),this.createdValue}get IsValueCreated(){return this.isValueCreated}}function Ke(e,n){let t=e.toString(10);for(;t.length<n;)t="0"+t;return t}function Qe(e){const n=e;return"number"==typeof n.offset?n.offset:1===e.kind?0:-6e4*e.getTimezoneOffset()}function en(e,n){return(e=e<0&&null!=n&&10!==n?4294967295+e+1:e).toString(n)}class nn{static id(e){return nn.idMap.has(e)||nn.idMap.set(e,++nn.count),nn.idMap.get(e)}}function tn(e){let n=0,t=5381;const r=e.length;for(;n<r;)t=33*t^e.charCodeAt(n++);return t}function rn(e){return 2654435761*e|0}function on(e){return 0===e.length?0:e.reduce(((e,n)=>(e<<5)+e^n))}function sn(e){var n;if(null==e)return 0;switch(typeof e){case"boolean":return e?1:0;case"number":return rn(e);case"string":return tn(e);default:return Ve(e)?e.GetHashCode():Le(e)?function(e){const n=e.length,t=new Array(n);for(let r=0;r<n;r++)t[r]=sn(e[r]);return on(t)}(e):e instanceof Date?function(e){return e.getTime()}(e):(null===(n=Object.getPrototypeOf(e))||void 0===n?void 0:n.constructor)===Object?on(Object.values(e).map((e=>sn(e)))):rn(nn.id(e))}}function un(e){return null==e?0:Ve(e)?e.GetHashCode():rn(nn.id(e))}function ln(e,n,t){if(null==e)return null==n;if(null==n)return!1;if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!t(e[r],n[r]))return!1;return!0}function cn(e,n){return ln(e,n,an)}function an(e,n){var t;return e===n||(null==e?null==n:null!=n&&"object"==typeof e&&(function(e){return"function"==typeof e.Equals}(e)?e.Equals(n):Le(e)?Le(n)&&cn(e,n):e instanceof Date?n instanceof Date&&0===fn(e,n):(null===(t=Object.getPrototypeOf(e))||void 0===t?void 0:t.constructor)===Object&&function(e,n){const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;t.sort(),r.sort();for(let o=0;o<t.length;o++)if(t[o]!==r[o]||!an(e[t[o]],n[r[o]]))return!1;return!0}(e,n)))}function fn(e,n){let t,r;return"offset"in e&&"offset"in n?(t=e.getTime(),r=n.getTime()):(t=e.getTime()+Qe(e),r=n.getTime()+Qe(n)),t===r?0:t<r?-1:1}function dn(e,n){return e===n?0:e<n?-1:1}function hn(e,n){return function(e,n,t){if(null==e)return null==n?0:1;if(null==n)return-1;if(e.length!==n.length)return e.length<n.length?-1:1;for(let r=0,o=0;r<e.length;r++)if(o=t(e[r],n[r]),0!==o)return o;return 0}(e,n,mn)}function mn(e,n){var t;return e===n?0:null==e?null==n?0:-1:null==n?1:"object"!=typeof e?e<n?-1:1:function(e){return"function"==typeof e.CompareTo}(e)?e.CompareTo(n):Le(e)?Le(n)?hn(e,n):-1:e instanceof Date?n instanceof Date?fn(e,n):-1:(null===(t=Object.getPrototypeOf(e))||void 0===t?void 0:t.constructor)===Object?function(e,n){const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return t.length<r.length?-1:1;t.sort(),r.sort();for(let o=0,i=0;o<t.length;o++){const s=t[o];if(s!==r[o])return s<r[o]?-1:1;if(i=mn(e[s],n[s]),0!==i)return i}return 0}(e,n):-1}function pn(e,n,t){return e(n,t)>0?n:t}function wn(e){const n={};for(const t of e)n[t[0]]=t[1];return n}nn.idMap=new WeakMap,nn.count=0;const gn=Symbol("curried");function yn(e,n){if(null==n||n.length>1)return n;const t=(...t)=>{let r=n;for(let n=0;n<e;n++)r=r(t[n]);return r};return t[gn]=n,t}function _n(e,n,t){return r=>1===n?t(...e.concat([r])):_n(e.concat([r]),n-1,t)}function vn(e,n,t){if(null!=n){if(gn in n){n=n[gn];for(let e=0;e<t.length;e++)n=n(t[e]);return n}return _n(t,e,n)}}function Cn(e,n=0){var t,r;if(null!=e&&"object"==typeof e){if("function"==typeof e.toString)return e.toString();if(Symbol.iterator in e)return function(e){let n=0,t="[";for(const r of e){if(0===n)t+=Cn(r);else{if(100===n){t+="; ...";break}t+="; "+Cn(r)}n++}return t+"]"}(e);{const o=null===(t=Object.getPrototypeOf(e))||void 0===t?void 0:t.constructor;return o===Object&&n<10?"{ "+Object.entries(e).map((([e,t])=>e+" = "+Cn(t,n+1))).join("\n ")+" }":null!==(r=null==o?void 0:o.name)&&void 0!==r?r:""}}return String(e)}class bn{get name(){return this.cases()[this.tag]}toJSON(){return 0===this.fields.length?this.name:[this.name].concat(this.fields)}toString(){return function(e,n){if(0===n.length)return e;{let t="",r=!0;return 1===n.length?(t=Cn(n[0]),r=t.indexOf(" ")>=0):t=n.map((e=>Cn(e))).join(", "),e+(r?" (":" ")+t+(r?")":"")}}(this.name,this.fields)}GetHashCode(){const e=this.fields.map((e=>sn(e)));return e.splice(0,0,rn(this.tag)),on(e)}Equals(e){return this===e||!!qe(this,e)&&this.tag===e.tag&&cn(this.fields,e.fields)}CompareTo(e){return this===e?0:qe(this,e)?this.tag===e.tag?hn(this.fields,e.fields):this.tag<e.tag?-1:1:-1}}class xn{toJSON(){return function(e){const n={},t=Object.keys(e);for(let r=0;r<t.length;r++)n[t[r]]=e[t[r]];return n}(this)}toString(){return e=this,"{ "+Object.entries(e).map((([e,n])=>e+" = "+Cn(n))).join("\n ")+" }";var e}GetHashCode(){return e=this,on(Object.values(e).map((e=>sn(e))));var e}Equals(e){return function(e,n){if(e===n)return!0;if(qe(e,n)){const t=Object.keys(e);for(let r=0;r<t.length;r++)if(!an(e[t[r]],n[t[r]]))return!1;return!0}return!1}(this,e)}CompareTo(e){return function(e,n){if(e===n)return 0;if(qe(e,n)){const t=Object.keys(e);for(let r=0;r<t.length;r++){const o=mn(e[t[r]],n[t[r]]);if(0!==o)return o}return 0}return-1}(this,e)}}class Sn{constructor(e,n){"function"==typeof n?(this.getter=e,this.setter=n):(this.getter=()=>e,this.setter=n=>{e=n})}get contents(){return this.getter()}set contents(e){this.setter(e)}}class En{constructor(e){this.message=e}}function An(e){return function(e){return e instanceof En||e instanceof Error}(e)?e:new Error(String(e))}class kn{constructor(e){this.value=e}toJSON(){return this.value}toString(){return String(this.value)}GetHashCode(){return sn(this.value)}Equals(e){return null!=e&&an(this.value,e instanceof kn?e.value:e)}CompareTo(e){return null==e?1:mn(this.value,e instanceof kn?e.value:e)}}function In(e){return null==e||e instanceof kn?new kn(e):e}function Tn(e){if(null==e)throw new Error("Option has no value");return e instanceof kn?e.value:e}function Nn(e){return null==e?[]:[Tn(e)]}function Fn(e,n){return null!=e?Tn(e):n}function On(e,n){return null!=n?In(e(Tn(n))):void 0}function Mn(e){const n=e<0,t=(e=Math.abs(e))%36e5/6e4;return(n?"-":"+")+Ke(~~(e/36e5),2)+":"+Ke(t,2)}function Un(e,n){const t=e.toISOString();return"first"===n?t.substring(0,t.indexOf("T")):t.substring(t.indexOf("T")+1,t.length-1)}function Dn(e,n,t){return n.replace(/(\w)\1*/g,(n=>{let r=Number.NaN;switch(n.substring(0,1)){case"y":const o=t?e.getUTCFullYear():e.getFullYear();r=n.length<4?o%100:o;break;case"M":r=(t?e.getUTCMonth():e.getMonth())+1;break;case"d":r=t?e.getUTCDate():e.getDate();break;case"H":r=t?e.getUTCHours():e.getHours();break;case"h":const i=t?e.getUTCHours():e.getHours();r=i>12?i%12:i;break;case"m":r=t?e.getUTCMinutes():e.getMinutes();break;case"s":r=t?e.getUTCSeconds():e.getSeconds();break;case"f":r=t?e.getUTCMilliseconds():e.getMilliseconds()}return Number.isNaN(r)?n:r<10&&n.length>1?"0"+r:""+r}))}function Pn(e,n,t){return null!=e.offset?function(e,n){var t,r,o;const i=new Date(e.getTime()+(null!==(t=e.offset)&&void 0!==t?t:0));if("string"!=typeof n)return i.toISOString().replace(/\.\d+/,"").replace(/[A-Z]|\.\d+/g," ")+Mn(null!==(r=e.offset)&&void 0!==r?r:0);if(1!==n.length)return Dn(i,n,!0);switch(n){case"D":case"d":return Un(i,"first");case"T":case"t":return Un(i,"second");case"O":case"o":return function(e,n){const t=e.toISOString();return t.substring(0,t.length-1)+Mn(n)}(i,null!==(o=e.offset)&&void 0!==o?o:0);default:throw new Error("Unrecognized Date print format")}}(e,n):function(e,n){const t=1===e.kind;if("string"!=typeof n)return t?e.toUTCString():e.toLocaleString();if(1!==n.length)return Dn(e,n,t);switch(n){case"D":case"d":return t?Un(e,"first"):e.toLocaleDateString();case"T":case"t":return t?Un(e,"second"):e.toLocaleTimeString();case"O":case"o":return function(e,n){if(n)return e.toISOString();{const n=null==e.kind||2===e.kind;return Ke(e.getFullYear(),4)+"-"+Ke(e.getMonth()+1,2)+"-"+Ke(e.getDate(),2)+"T"+Ke(e.getHours(),2)+":"+Ke(e.getMinutes(),2)+":"+Ke(e.getSeconds(),2)+"."+Ke(e.getMilliseconds(),3)+(n?Mn(-6e4*e.getTimezoneOffset()):"")}}(e,t);default:throw new Error("Unrecognized Date print format")}}(e,n)}function Rn(e,n){const t=new Date(e);return t.kind=0|(null==n?0:n),t}function $n(e){function n(){throw new Error(`The string is not a valid Date: ${e}`)}null!=e&&""!==e.trim()||n(),10===e.length&&"-"===e[4]&&"-"===e[7]&&(e+="T00:00:00");let t=new Date(e),r=null;if(isNaN(t.getTime())){const o=/^\s*(\d+[^\w\s:]\d+[^\w\s:]\d+)?\s*(\d+:\d+(?::\d+(?:\.\d+)?)?)?\s*([AaPp][Mm])?\s*(Z|[+-]([01]?\d):?([0-5]?\d)?)?\s*$/.exec(e);if(null!=o){let e,n=0;if(null!=o[2]){const e=o[2].split(":");n=3600*parseInt(e[0],10)+60*parseInt(e[1]||"0",10)+parseFloat(e[2]||"0"),null!=o[3]&&"PM"===o[3].toUpperCase()&&(n+=720)}if(null!=o[4]){if(null!=o[1])e=new Date(o[1]+" UTC");else{const n=new Date;e=new Date(n.getUTCFullYear()+"/"+(n.getUTCMonth()+1)+"/"+n.getUTCDate())}if("Z"===o[4])r="Z";else{let e=60*parseInt(o[5],10)+parseInt(o[6]||"0",10);"-"===o[4][0]&&(e*=-1),r=e,n-=60*e}}else if(null!=o[1])e=new Date(o[1]);else{const n=new Date;e=new Date(n.getFullYear()+"/"+(n.getMonth()+1)+"/"+n.getDate())}t=new Date(e.getTime()+1e3*n),t=new Date(t.getTime()+6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))}else n();isNaN(t.getTime())&&n()}return[t,r]}function Gn(e,n){try{return n.contents=function(e,n=!1){const[t,r]=$n(e),o=null!=r?n&&"Z"===r?1:2:0;return Rn(t.getTime(),o)}(e),!0}catch(e){return!1}}const Hn=Symbol("numeric");function jn(e){return"number"==typeof e||(null==e?void 0:e[Hn])}function Bn(e,n){return"number"==typeof e?e*n:e[Hn]().multiply(n)}function Ln(e,n){return"number"==typeof e?e.toFixed(n):e[Hn]().toFixed(n)}function Vn(e,n){return"number"==typeof e?e.toPrecision(n):e[Hn]().toPrecision(n)}function zn(e,n){return"number"==typeof e?e.toExponential(n):e[Hn]().toExponential(n)}function Wn(e){return"number"==typeof e?(Number(e)>>>0).toString(16):e[Hn]().toHex()}function qn(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function Zn(e,n,t=0){if(null==n)throw new Error("Input cannot ve null");if(!e.global)throw new Error("Non-global RegExp");e.lastIndex=t;const r=[];let o,i=-1;for(;null!=(o=e.exec(n));)o.index===i?e.lastIndex++:(i=o.index,r.push(o));return r}const Jn=/(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g,Yn=/\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g;function Xn(e,n){return function(e,n){return"number"==typeof e?e<n?-1:e>n?1:0:e.CompareTo(n)}(e,n)<0}function Kn(e){return{input:e,cont:(n=e,e=>{Jn.lastIndex=0;const t=[],r=[];let o=0,i=Jn.exec(n);for(;i;){const e=i.index+(i[1]||"").length;t.push(n.substring(o,e).replace(/%%/g,"%")),r.push(i),o=Jn.lastIndex,Jn.lastIndex-=1,i=Jn.exec(n)}return 0===t.length?e(n.replace(/%%/g,"%")):(t.push(n.substring(o).replace(/%%/g,"%")),rt(e,t,r))})};var n}function Qn(e,n){return"string"==typeof n?e(n):n.cont(e)}function et(e){return Qn((e=>e),e)}function nt(e){return Qn((e=>{throw new Error(e)}),e)}function tt(e,n,t,r,o){let i="";if(n=n||"",o=o||"",jn(e))switch("x"!==o.toLowerCase()&&(Xn(e,0)?(e=Bn(e,-1),i="-"):n.indexOf(" ")>=0?i=" ":n.indexOf("+")>=0&&(i="+")),r=null==r?null:parseInt(r,10),o){case"f":case"F":e=Ln(e,r=null!=r?r:6);break;case"g":case"G":e=null!=r?Vn(e,r):Vn(e);break;case"e":case"E":e=null!=r?zn(e,r):zn(e);break;case"x":e=Wn(e);break;case"X":e=Wn(e).toUpperCase();break;default:e=String(e)}else e=e instanceof Date?Pn(e):Cn(e);if(t="number"==typeof t?t:parseInt(t,10),isNaN(t))e=i+e;else{const r=n.indexOf("0")>=0,o=n.indexOf("-")>=0,s=o||!r?" ":"0";e="0"===s?i+(e=it(e,t-i.length,s,o)):it(i+e,t,s,o)}return e}function rt(e,n,t,r="",o=-1){return(...i)=>{let s=r;const u=n.slice(),l=t.slice();for(const e of i){const[,,n,t,r,i]=l[0];let c=t;if(o>=0)c=o,o=-1;else if("*"===c){if(e<0)throw new Error("Non-negative number required");o=e;continue}s+=u[0],s+=tt(e,n,c,r,i),u.splice(0,1),l.splice(0,1)}return 0===l.length?(s+=u[0],e(s)):rt(e,u,l,s,o)}}function ot(e,n){return Array.isArray(n)?n.join(e):Array.from(n).join(e)}function it(e,n,t,r){t=t||" ",n-=e.length;for(let o=0;o<n;o++)e=r?e+t:t+e;return e}function st(e,n,t){return it(e,n,t)}function ut(e,n,t,r){if(r="number"==typeof r?r:0,(t="number"==typeof t?t:void 0)&&t<0)throw new Error("Count cannot be less than zero");if(0===t)return[];const o=1==(1&r),i=2==(2&r);n=(n=n||[]).filter((e=>e)).map(qn),n=n.length>0?n:["\\s"];const s=[],u=new RegExp(n.join("|"),"g");let l=!0,c=0;do{const n=u.exec(e);if(null===n){const n=i?e.substring(c).trim():e.substring(c);(!o||n.length>0)&&s.push(n),l=!1}else{const r=i?e.substring(c,n.index).trim():e.substring(c,n.index);(!o||r.length>0)&&(null!=t&&s.length+1===t?(s.push(i?e.substring(c).trim():e.substring(c)),l=!1):s.push(r)),c=u.lastIndex}}while(l);return s}function lt(e,n,t){if(n+(t||0)>e.length)throw new Error("Invalid startIndex and/or length");return null!=t?e.substr(n,t):e.substr(n)}const ct="Collection was empty.";function at(e,n){return"function"==typeof e?new e(n):new Array(n)}function ft(e,n,t,r){const o=0|n;return e.fill(r,o,o+t)}function dt(e,n,t){const r=0|n.length,o=at(t,r);for(let t=0;t<=r-1;t++)o[t]=e(n[t]);return o}function ht(e,n,t){return t.reduce(e,n)}function mt(e,n,t){if(null==n)return null==t;if(null==t)return!1;{let r=0,o=!0;const i=0|n.length,s=0|t.length;if(i>s)return!1;if(i<s)return!1;for(;r<i&&o;)o=e(n[r],t[r]),r=r+1|0;return o}}class pt extends xn{constructor(e,n){super(),this.head=e,this.tail=n}toString(){return"["+ot("; ",this)+"]"}Equals(e){return this===e||((e,n)=>{e:for(;;){const t=e,r=n,o=[t.tail,r.tail];if(null!=o[0]){if(null!=o[1]){const i=o[0],s=o[1];if(an(t.head,r.head)){e=i,n=s;continue e}return!1}return!1}return null==o[1]}})(this,e)}GetHashCode(){return 0|((e,n,t)=>{for(;;){const r=e,o=n,i=t,s=i.tail;if(null==s)return 0|o;{const u=s;if(r>18)return 0|o;e=r+1,n=(o<<1)+sn(i.head)+631*r,t=u}}})(0,0,this)}toJSON(e){return Array.from(this)}CompareTo(e){return 0|((e,n)=>{e:for(;;){const t=e,r=n,o=[t.tail,r.tail];if(null!=o[0]){if(null!=o[1]){const i=o[0],s=o[1],u=0|mn(t.head,r.head);if(0===u){e=i,n=s;continue e}return 0|u}return 1}return null!=o[1]?-1:0}})(this,e)}GetEnumerator(){return new wt(this)}[Symbol.iterator](){return Ye(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return Je(this)}}class wt{constructor(e){this.xs=e,this.it=this.xs,this.current=null}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const e=this,n=e.it.tail;if(null!=n){const t=n;return e.current=e.it.head,e.it=t,!0}return!1}"System.Collections.IEnumerator.Reset"(){const e=this;e.it=e.xs,e.current=null}Dispose(){}}function gt(){return new pt(null,void 0)}function yt(e,n){return new pt(e,n)}function _t(e){return null==e.tail}function vt(e){if(null!=e.tail)return e.head;throw new Error(ct+"\\nParameter name: list")}function Ct(e){const n=e.tail;if(null!=n)return n;throw new Error(ct+"\\nParameter name: list")}function bt(){return gt()}function xt(e,n){return yt(e,n)}function St(e){return yt(e,gt())}function Et(e){return _t(e)}function At(e){return vt(e)}function kt(e){return Ct(e)}function It(e){const n=0|function(e){return 0|((e,n)=>{for(;;){const t=e,r=n.tail;if(null==r)return 0|t;e=t+1,n=r}})(0,e)}(e),t=ft(new Array(n),0,n,null);return((e,n)=>{for(;;){const r=e,o=n;if(_t(o))break;t[r]=vt(o),e=r+1,n=Ct(o)}})(0,e),t}function Tt(e,n,t){let r=n,o=t;for(;!_t(o);)r=e(r,vt(o)),o=Ct(o);return r}function Nt(e){return Tt(((e,n)=>yt(n,e)),gt(),e)}function Ft(e,n){Tt(((n,t)=>{e(t)}),void 0,n)}function Ot(e,n){let t=n;for(let n=e.length-1;n>=0;n--)t=yt(e[n],t);return t}function Mt(e){return Ot(e,gt())}function Ut(e,n){return Tt(((e,n)=>yt(n,e)),n,Nt(e))}function Dt(e,n){const t=gt(),r=Tt(((n,t)=>{const r=new pt(e(t),void 0);return n.tail=r,r}),t,n),o=gt();return r.tail=o,Ct(t)}function Pt(e,n){return function(e,n){return(n=>{e:for(;;){const t=n;if(_t(t))return;{const r=e(vt(t));if(null==r){n=Ct(t);continue e}return r}}})(n)}((n=>e(n)?In(n):void 0),n)}function Rt(e,n,t){return null!=function(e,n){return((n,t)=>{for(;;){const r=n,o=t;if(_t(o))return;if(e(vt(o)))return r;n=r+1,t=Ct(o)}})(0,n)}((n=>t.Equals(e,n)),n)}function $t(){return e=mn,{Compare:(n,t)=>e(n,t)};var e}const Gt="Enumeration already finished.",Ht="Enumeration has not started. Call MoveNext.",jt="The input sequence has an insufficient number of elements.";function Bt(){throw new Error(Ht)}function Lt(){throw new Error(Gt)}class Vt{constructor(e){this.f=e}toString(){let e=0,n="seq [";const t=Je(this);try{for(;e<4&&t["System.Collections.IEnumerator.MoveNext"]();)e>0&&(n+="; "),n+=Cn(t["System.Collections.Generic.IEnumerator`1.get_Current"]()),e=e+1|0;return 4===e&&(n+="; ..."),n+"]"}finally{We(t)}}GetEnumerator(){return this.f()}[Symbol.iterator](){return Ye(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return this.f()}}class zt{constructor(e,n,t){this.current=e,this.next=n,this.dispose=t}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current()}"System.Collections.IEnumerator.get_Current"(){return this.current()}"System.Collections.IEnumerator.MoveNext"(){return this.next()}"System.Collections.IEnumerator.Reset"(){!function(){throw new Error("Reset is not supported on this enumerator.")}()}Dispose(){this.dispose()}}function Wt(e,n,t){return new zt(e,n,t)}function qt(e,n,t){let r,o=!1,i=In(e());const s=()=>{if(null!=i){const e=Tn(i);try{t(e)}finally{i=void 0}}},u=()=>{try{s()}finally{r=void 0}};return Wt((()=>(o||Bt(),null!=r?Tn(r):Lt())),(()=>{if(o||(o=!0),null!=i){const e=Tn(i);let t;try{t=n(e)}catch(e){throw u(),e}return null!=t?(r=t,!0):(u(),!1)}return!1}),s)}function Zt(e){return function(e){return new Vt(e)}(e)}function Jt(e){return n="source",null==e&&function(e){throw new Error(e)}(n),Je(e);var n}function Yt(e){return Zt((()=>Je(e())))}function Xt(e){return Zt((()=>function(e){let n,t,r,o=!1,i=!1;const s=()=>{if(i=!0,null!=t){const e=t;try{We(e)}finally{t=void 0}}if(null!=n){const e=n;try{We(e)}finally{n=void 0}}};return Wt((()=>(o?i&&Lt():Bt(),null!=r?Tn(r):Lt())),(()=>{let u;if(o||(o=!0),i)return!1;{let o;for(;null==o;){const i=[n,t];if(null!=i[0])if(null!=i[1]){const e=i[1];if(e["System.Collections.IEnumerator.MoveNext"]())r=In(e["System.Collections.Generic.IEnumerator`1.get_Current"]()),o=!0;else try{We(e)}finally{t=void 0}}else{const e=i[0];e["System.Collections.IEnumerator.MoveNext"]()?(u=e["System.Collections.Generic.IEnumerator`1.get_Current"](),t=Je(u)):(s(),o=!1)}else n=Je(e)}return Tn(o)}}),(()=>{i||s()}))}(e)))}function Kt(e){return Yt((()=>function(e,n){const t=at(void 0,1);return t[0]=e,t}(e)))}function Qt(e){return Le(e)?Mt(e):e instanceof pt?e:function(e){let n,t;if(Le(e))return Mt(e);if(e instanceof pt)return e;{const r=gt();let o=r;const i=Je(e);try{for(;i["System.Collections.IEnumerator.MoveNext"]();){const e=i["System.Collections.Generic.IEnumerator`1.get_Current"]();n=o,t=new pt(e,void 0),n.tail=t,o=t}}finally{We(i)}const s=o,u=gt();return s.tail=u,Ct(r)}}(e)}function er(e,n,t){return Zt((()=>{let r=-1;return qt(e,(e=>(r=r+1|0,n(r,e))),t)}))}function nr(e,n){return Xt([e,n])}function tr(e,n,t){const r=Jt(n);try{let n=!1;for(;!n&&r["System.Collections.IEnumerator.MoveNext"]();)n=t.Equals(e,r["System.Collections.Generic.IEnumerator`1.get_Current"]());return n}finally{We(r)}}function rr(e,n,t){const r=Jt(t);try{let t=n;for(;r["System.Collections.IEnumerator.MoveNext"]();)t=e(t,r["System.Collections.Generic.IEnumerator`1.get_Current"]());return t}finally{We(r)}}function or(e,n){rr(((n,t)=>{e(t)}),void 0,n)}function ir(e,n){return t=()=>Jt(n),r=n=>n["System.Collections.IEnumerator.MoveNext"]()?In(e(n["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,o=e=>{We(e)},Zt((()=>qt(t,r,o)));var t,r,o}function sr(e,n){return er((()=>Jt(n)),((n,t)=>t["System.Collections.IEnumerator.MoveNext"]()?In(e(n,t["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0),(e=>{We(e)}))}function ur(e){return Yt((()=>function(e){return e.slice().reverse()}(function(e){return e instanceof pt?It(e):Array.from(e)}(e))))}function lr(e,n){return Zt((()=>{const t=Jt(n);try{for(let n=1;n<=e;n++)if(!t["System.Collections.IEnumerator.MoveNext"]())throw new Error(jt+"\\nParameter name: source");return function(e,n){return Wt((()=>n["System.Collections.Generic.IEnumerator`1.get_Current"]()),(()=>n["System.Collections.IEnumerator.MoveNext"]()),(()=>{try{We(n)}finally{e()}}))}((()=>{}),t)}catch(e){throw We(t),e}}))}Symbol.iterator;class cr{constructor(e,n){this.k=e,this.v=n}}function ar(e,n){return new cr(e,n)}function fr(e){return e.k}function dr(e){return e.v}class hr extends cr{constructor(e,n,t,r,o){super(e,n),this.left=t,this.right=r,this.h=0|o}}function mr(e,n,t,r,o){return new hr(e,n,t,r,o)}function pr(e){return e.left}function wr(e){return e.right}function gr(e){return e.h}function yr(e,n){e:for(;;){const t=e;if(null!=n){const r=n;if(r instanceof hr){e=yr(t+1,pr(r)),n=wr(r);continue e}return t+1|0}return 0|t}}function _r(e){return yr(0,e)}function vr(e,n,t,r){let o,i;o=null!=e?e instanceof hr?gr(e):1:0,i=null!=r?r instanceof hr?gr(r):1:0;const s=0|(o<i?i:o);return 0===s?ar(n,t):mr(n,t,e,r,s+1)}function Cr(e,n,t,r){let o,i,s,u,l,c;if(l=null!=e?e instanceof hr?gr(e):1:0,c=null!=r?r instanceof hr?gr(r):1:0,c>l+2){const s=Tn(r);if(s instanceof hr){if(o=pr(s),(null!=o?(i=o,i instanceof hr?gr(i):1):0)>l+1){const r=Tn(pr(s));if(r instanceof hr)return vr(vr(e,n,t,pr(r)),fr(r),dr(r),vr(wr(r),fr(s),dr(s),wr(s)));throw new Error("internal error: Map.rebalance")}return vr(vr(e,n,t,pr(s)),fr(s),dr(s),wr(s))}throw new Error("internal error: Map.rebalance")}if(l>c+2){const o=Tn(e);if(o instanceof hr){if(s=wr(o),(null!=s?(u=s,u instanceof hr?gr(u):1):0)>c+1){const e=Tn(wr(o));if(e instanceof hr)return vr(vr(pr(o),fr(o),dr(o),pr(e)),fr(e),dr(e),vr(wr(e),n,t,r));throw new Error("internal error: Map.rebalance")}return vr(pr(o),fr(o),dr(o),vr(wr(o),n,t,r))}throw new Error("internal error: Map.rebalance")}return vr(e,n,t,r)}function br(e,n,t,r){if(null!=r){const o=r,i=0|e.Compare(n,fr(o));return o instanceof hr?i<0?Cr(br(e,n,t,pr(o)),fr(o),dr(o),wr(o)):0===i?mr(n,t,pr(o),wr(o),gr(o)):Cr(pr(o),fr(o),dr(o),br(e,n,t,wr(o))):i<0?mr(n,t,void 0,r,2):0===i?ar(n,t):mr(n,t,r,void 0,2)}return ar(n,t)}function xr(e,n,t){e:for(;;){const r=e,o=n;if(null!=t){const i=t,s=0|r.Compare(o,fr(i));if(0===s)return In(dr(i));if(i instanceof hr){e=r,n=o,t=s<0?pr(i):wr(i);continue e}return}return}}function Sr(e){if(null!=e){const n=e;if(n instanceof hr){if(null==pr(n))return[fr(n),dr(n),wr(n)];{const e=Sr(pr(n));return[e[0],e[1],vr(e[2],fr(n),dr(n),wr(n))]}}return[fr(n),dr(n),void 0]}throw new Error("internal error: Map.spliceOutSuccessor")}function Er(e,n,t,r){if(null!=r){const o=r;if(o instanceof hr){const r=0|e.Compare(n,fr(o));if(r<0)return Cr(Er(e,n,t,pr(o)),fr(o),dr(o),wr(o));if(0===r){const e=t(In(dr(o)));if(null!=e)return mr(n,Tn(e),pr(o),wr(o),gr(o));if(null==pr(o))return wr(o);if(null==wr(o))return pr(o);{const e=Sr(wr(o));return vr(pr(o),e[0],e[1],e[2])}}return Cr(pr(o),fr(o),dr(o),Er(e,n,t,wr(o)))}{const i=0|e.Compare(n,fr(o));if(i<0){const e=t(void 0);return null!=e?mr(n,Tn(e),void 0,r,2):r}if(0===i){const e=t(In(dr(o)));return null!=e?ar(n,Tn(e)):void 0}{const e=t(void 0);return null!=e?mr(n,Tn(e),r,void 0,2):r}}}{const e=t(void 0);return null!=e?ar(n,Tn(e)):r}}function Ar(e,n){e:for(;;){const t=e;if(null!=n){const r=n;if(r instanceof hr){Ar(t,pr(r)),t(fr(r),dr(r)),e=t,n=wr(r);continue e}t(fr(r),dr(r))}break}}function kr(e,n){Ar(e,n)}function Ir(e,n){e:for(;;){const t=e;if(null!=n){const r=n;if(r instanceof hr){const o=Ir(t,pr(r));if(null==o){const o=t(fr(r),dr(r));if(null==o){e=t,n=wr(r);continue e}return o}return o}return t(fr(r),dr(r))}return}}function Tr(e,n){return Ir(e,n)}function Nr(e,n){if(null!=n){const t=n;if(t instanceof hr){const n=Nr(e,pr(t)),r=e(fr(t),dr(t)),o=Nr(e,wr(t));return mr(fr(t),r,n,o,gr(t))}return ar(fr(t),e(fr(t),dr(t)))}}function Fr(e,n){return Nr(e,n)}function Or(e,n){let t;for(let r=0;r<=n.length-1;r++){const o=n[r];t=br(e,o[0],o[1],t)}return t}class Mr extends xn{constructor(e,n){super(),this.stack=e,this.started=n}}function Ur(e){e:for(;;){const n=e;if(Et(n))return bt();{const t=kt(n),r=At(n);if(null!=r){const o=r;if(o instanceof hr){e=Ot([pr(o),ar(fr(o),dr(o)),wr(o)],t);continue e}return n}e=t;continue e}}}function Dr(e){return new Mr(Ur(St(e)),!1)}function Pr(e){if(e.started){const n=e.stack;if(Et(n))return function(){throw new Error("enumeration already finished")}();if(null!=At(n)){const e=At(n);if(e instanceof hr)throw new Error("Please report error: Map iterator, unexpected stack for current");return[fr(e),dr(e)]}throw new Error("Please report error: Map iterator, unexpected stack for current")}return function(){throw new Error("enumeration not started")}()}function Rr(e){let n=Dr(e);return{"System.Collections.Generic.IEnumerator`1.get_Current":()=>Pr(n),"System.Collections.IEnumerator.get_Current":()=>Pr(n),"System.Collections.IEnumerator.MoveNext":()=>function(e){if(e.started){const n=e.stack;if(Et(n))return!1;if(null!=At(n)){if(At(n)instanceof hr)throw new Error("Please report error: Map iterator, unexpected stack for moveNext");return e.stack=Ur(kt(n)),!Et(e.stack)}throw new Error("Please report error: Map iterator, unexpected stack for moveNext")}return e.started=!0,!Et(e.stack)}(n),"System.Collections.IEnumerator.Reset"(){n=Dr(e)},Dispose(){}}}class $r{constructor(e,n){this.comparer=e,this.tree=n}GetHashCode(){return 0|function(e){const n=(e,n)=>(e<<1)+n+631;let t=0;const r=Je(e);try{for(;r["System.Collections.IEnumerator.MoveNext"]();){const e=r["System.Collections.Generic.IEnumerator`1.get_Current"]();t=0|n(t,sn(e[0])),t=0|n(t,sn(e[1]))}}finally{We(r)}return 0|t}(this)}Equals(e){if(!(e instanceof $r))return!1;{const n=Je(this);try{const t=Je(e);try{const e=()=>{const r=n["System.Collections.IEnumerator.MoveNext"]();if(r===t["System.Collections.IEnumerator.MoveNext"]()){if(r){const r=n["System.Collections.Generic.IEnumerator`1.get_Current"](),o=t["System.Collections.Generic.IEnumerator`1.get_Current"]();return!(!an(r[0],o[0])||!an(r[1],o[1]))&&e()}return!0}return!1};return e()}finally{We(t)}}finally{We(n)}}}toString(){return"map ["+ot("; ",ir((e=>function(e,...n){return"object"==typeof e&&n.length>0&&(e=n[0],n.shift()),e.replace(Yn,((e,t,r,o,i,s)=>{if(t<0||t>=n.length)throw new Error("Index must be greater or equal to zero and less than the arguments' length.");let u=n[t];if(jn(u))switch(i=null==i?null:parseInt(i,10),o){case"f":case"F":u=Ln(u,i=null!=i?i:2);break;case"g":case"G":u=null!=i?Vn(u,i):Vn(u);break;case"e":case"E":u=null!=i?zn(u,i):zn(u);break;case"p":case"P":i=null!=i?i:2,u=Ln(Bn(u,100),i)+" %";break;case"d":case"D":u=null!=i?st(String(u),i,"0"):String(u);break;case"x":case"X":u=null!=i?st(Wn(u),i,"0"):Wn(u),"X"===o&&(u=u.toUpperCase());break;default:if(s){let e="";u=s.replace(/([0#,]+)(\.[0#]+)?/,((n,t,r)=>{Xn(u,0)&&(u=Bn(u,-1),e="-"),r=null==r?"":r.substring(1),u=Ln(u,Math.max(r.length,0));let[o,i]=u.split(".");i||(i=""),o=st(o,t.replace(/,/g,"").replace(/^#+/,"").length,"0");const s=r.replace(/#+$/,"").length;if(s>i.length?i=function(e,n,t){return it(e,n,"0",!0)}(i,s):s<i.length&&(i=i.substring(0,s)+i.substring(s).replace(/0+$/,"")),t.indexOf(",")>0){const e=o.length%3,n=Math.floor(o.length/3);let t=e>0?o.substr(0,e)+(n>0?",":""):"";for(let r=0;r<n;r++)t+=o.substr(e+3*r,3)+(r<n-1?",":"");o=t}return i.length>0?o+"."+i:o})),u=e+u}}else u=u instanceof Date?Pn(u,s||o):Cn(u);return r=parseInt((r||" ").substring(1),10),isNaN(r)||(u=it(String(u),Math.abs(r)," ",r<0)),u}))}("({0}, {1})",e[0],e[1])),this))+"]"}get[Symbol.toStringTag](){return"FSharpMap"}toJSON(e){return Array.from(this)}GetEnumerator(){return Rr(this.tree)}[Symbol.iterator](){return Ye(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return Rr(this.tree)}CompareTo(e){const n=this;if(e instanceof $r)return 0|function(e,n,t){const r=Jt(n);try{const n=Jt(t);try{let t=0,o=r["System.Collections.IEnumerator.MoveNext"](),i=n["System.Collections.IEnumerator.MoveNext"]();for(;0===t&&o&&i;)t=0|e(r["System.Collections.Generic.IEnumerator`1.get_Current"](),n["System.Collections.Generic.IEnumerator`1.get_Current"]()),0===t&&(o=r["System.Collections.IEnumerator.MoveNext"](),i=n["System.Collections.IEnumerator.MoveNext"]());return 0|(0!==t?t:o?1:i?-1:0)}finally{We(n)}}finally{We(r)}}(((e,t)=>{const r=0|n.comparer.Compare(e[0],t[0]);return 0|(0!==r?r:mn(e[1],t[1]))}),n,e);throw new Error("not comparable\\nParameter name: obj")}"System.Collections.Generic.ICollection`1.Add2B595"(e){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Remove2B595"(e){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Contains2B595"(e){return Lr(this,e[0])&&an(jr(this,e[0]),e[1])}"System.Collections.Generic.ICollection`1.CopyToZ2E171D71"(e,n){!function(e,n,t){let r=t;kr(((e,t)=>{n[r]=[e,t],r=r+1|0}),e)}(this.tree,e,n)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return 0|Br(this)}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return 0|Br(this)}get size(){return 0|Br(this)}clear(){throw new Error("Map cannot be mutated")}delete(e){throw new Error("Map cannot be mutated")}entries(){return ir((e=>[e[0],e[1]]),this)}get(e){return jr(this,e)}has(e){return Lr(this,e)}keys(){return ir((e=>e[0]),this)}set(e,n){throw new Error("Map cannot be mutated")}values(){return ir((e=>e[1]),this)}forEach(e,n){const t=this;or((n=>{e(n[1],n[0],t)}),t)}}function Gr(e,n){return new $r(e,n)}function Hr(e){const n=$t();return Gr(n,function(e,n){if(Le(n))return Or(e,n);if(n instanceof pt)return function(e,n){return Tt(((n,t)=>br(e,t[0],t[1],n)),void 0,n)}(e,n);{const t=Je(n);try{return function(e,n,t){for(;;){const r=e,o=n,i=t;if(!i["System.Collections.IEnumerator.MoveNext"]())return o;{const s=i["System.Collections.Generic.IEnumerator`1.get_Current"]();e=r,n=br(r,s[0],s[1],o),t=i}}}(e,void 0,t)}finally{We(t)}}}(n,e))}function jr(e,n){return function(e,n,t){const r=xr(e,n,t);if(null==r)throw new Error;return Tn(r)}(e.comparer,n,e.tree)}function Br(e){return _r(e.tree)}function Lr(e,n){return function(e,n,t){e:for(;;){const r=e,o=n;if(null!=t){const i=t,s=0|r.Compare(o,fr(i));if(i instanceof hr){if(s<0){e=r,n=o,t=pr(i);continue e}if(0===s)return!0;e=r,n=o,t=wr(i);continue e}return 0===s}return!1}}(e.comparer,n,e.tree)}function Vr(e,n){return xr(e.comparer,n,e.tree)}function zr(e,n,t){return function(e,n,t){return Gr(e.comparer,br(e.comparer,n,t,e.tree))}(t,e,n)}function Wr(e,n,t){return function(e,n,t){return Gr(e.comparer,Er(e.comparer,n,t,e.tree))}(t,e,n)}function qr(e,n){return Vr(n,e)}function Zr(e,n){return function(e,n){return Gr(e.comparer,Fr(n,e.tree))}(n,e)}function Jr(){return $r.empty}$r.empty=Gr($t(),void 0);class Yr{constructor(e,n,t,r){this.declaringType=e,this.tag=n,this.name=t,this.fields=r}}class Xr{constructor(e,n,t,r,o,i,s){this.fullname=e,this.generics=n,this.construct=t,this.parent=r,this.fields=o,this.cases=i,this.enumCases=s}toString(){return co(this)}GetHashCode(){return Qr(this)}Equals(e){return eo(this,e)}}function Kr(e){return null!=e.generics?e.generics:[]}function Qr(e){return on([tn(e.fullname),...Kr(e).map(Qr)])}function eo(e,n){return""===e.fullname?""===n.fullname&&ln(vo(e),vo(n),(([e,n],[t,r])=>e===t&&eo(n,r))):e.fullname===n.fullname&&ln(Kr(e),Kr(n),eo)}function no(e,n,t,r){return new Xr(e,n,t,void 0,r)}function to(...e){return new Xr("",void 0,void 0,void 0,(()=>e))}function ro(e){return new Xr("Microsoft.FSharp.Core.FSharpOption`1",[e])}function oo(e){return new Xr("Microsoft.FSharp.Collections.FSharpList`1",[e])}const io=new Xr("System.Object"),so=(new Xr("Microsoft.FSharp.Core.Unit"),new Xr("System.Char"),new Xr("System.String")),uo=new Xr("System.Boolean");function lo(e){if(Array.isArray(e))return e[0];if(e instanceof Xr){const n=fo(e);if(null!=n)return lo(n)+"[]";{const n=e.fullname.lastIndexOf(".");return-1===n?e.fullname:e.fullname.substr(n+1)}}return e.name}function co(e){const n=fo(e);return null!=n?co(n)+"[]":null==e.generics||0===e.generics.length?e.fullname:e.fullname+"["+e.generics.map((e=>co(e))).join(",")+"]"}function ao(e){return null!=fo(e)}function fo(e){var n;return"[]"===e.fullname&&1===(null===(n=e.generics)||void 0===n?void 0:n.length)?e.generics[0]:void 0}function ho(e){return null!=e.generics&&e.generics.length>0}function mo(e){return null!=e.enumCases&&e.enumCases.length>0}function po(e){return null==e.generics?e:new Xr(e.fullname,e.generics.map((()=>io)))}function wo(e){var n;return null===(n=e.generics)||void 0===n?void 0:n[0]}function go(e){if(mo(e)&&null!=e.enumCases)return e.enumCases.map((e=>e[1]));throw new Error(`${e.fullname} is not an enum type`)}function yo(e,n){const t=parseInt(n,10);return function(e,n){if(null!=e.enumCases){if("string"==typeof n){for(const t of e.enumCases)if(t[0]===n)return t;throw new Error(`'${n}' was not found in ${e.fullname}`)}for(const t of e.enumCases)if(t[1]===n)return t;return["",n]}throw new Error(`${e.fullname} is not an enum type`)}(e,isNaN(t)?n:t)[1]}function _o(e){if(null!=e.cases)return e.cases();throw new Error(`${e.fullname} is not an F# union type`)}function vo(e){if(null!=e.fields)return e.fields();throw new Error(`${e.fullname} is not an F# record type`)}function Co(e){if(So(e)&&null!=e.generics)return e.generics;throw new Error(`${e.fullname} is not a tuple type`)}function bo(e){return e instanceof Xr?null!=e.cases:e instanceof bn}function xo(e){return e instanceof Xr?null!=e.fields:e instanceof xn}function So(e){return e.fullname.startsWith("System.Tuple")}function Eo(e){return null==e.fields?[]:e.fields}new Xr("System.SByte"),new Xr("System.Byte"),new Xr("System.Int16"),new Xr("System.UInt16"),new Xr("System.Int32"),new Xr("System.UInt32"),new Xr("System.Single"),new Xr("System.Double"),new Xr("System.Decimal");class Ao extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Ok","Error"]}}function ko(e,n){return 0===n.tag?new Ao(0,e(n.fields[0])):new Ao(1,n.fields[0])}class Io extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["BadPrimitive","BadPrimitiveExtra","BadType","BadField","BadPath","TooSmallArray","FailMessage","BadOneOf"]}}class To extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["PascalCase","CamelCase","SnakeCase"]}}class No{constructor(){this.cache=new Map([])}}function Fo(){return new No}function Oo(e){return e.slice(void 0,1).toLowerCase()+e.slice(1,e.length)}function Mo(e,n){switch(e.tag){case 2:return function(e,n,t,r,o=0){if("string"==typeof e){const t=e;e=function(e,n=0){if(0!=(-284&n))throw new Error("RegexOptions only supports: IgnoreCase, Multiline, Compiled, Singleline and ECMAScript");let t="gu";return t+=1&n?"i":"",t+=2&n?"m":"",t+=16&n?"s":"",new RegExp(e,t)}(n,null!=r?r:0),n=t,r=void 0}if("function"==typeof t)return r=null==r?-1:r,n.substring(0,o)+n.substring(o).replace(e,(function(){let e=arguments[0];if(r){r--;const n=[],o=arguments.length,i="string"!=typeof arguments[o-1];let s=i?o-3:o-2;for(let e=0;e<s;e++)n.push(arguments[e]);n.index=arguments[s++],n.input=arguments[s++],i&&(n.groups=arguments[s]),e=t(n)}return e}));if(t=t.replace(/\$0/g,(e=>"$&")).replace(/\${([^}]+)}/g,"$<$1>"),null!=r){let i;const s=n.substring(o),u=Zn(e,s),l=Zn.length>r?(i=u[r-1],s.substring(0,i.index+i[0].length)):s;return n.substring(0,o)+l.replace(e,t)+n.substring(o+l.length)}return n.replace(e,t)}(Oo(n),"[A-Z]","_$0").toLowerCase();case 0:return n;default:return Oo(n)}}Fo(),Fo();const Uo=/^[\(\{]{0,2}[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[\)\}]{0,2}$/,Do=/^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/,Po=/^\{0x[0-9a-f]{8},(0x[0-9a-f]{4},){2}\{(0x[0-9a-f]{2},){7}0x[0-9a-f]{2}\}\}$/;function Ro(e,n){try{return n.contents=function(e){function n(e){return e.replace(Do,"$1-$2-$3-$4-$5")}const t=e.trim().toLowerCase();if(Uo.test(t))return function(e,...n){if(0===n.length)return e.trim();const t="["+qn(n.join(""))+"]+";return e.replace(new RegExp("^"+t),"").replace(new RegExp(t+"$"),"")}(t,"{","}","(",")");if(Do.test(t))return n(t);if(Po.test(t))return n(t.replace(/[\{\},]|0x/g,""));throw new Error("Guid should contain 32 digits with 4 dashes: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")}(e),!0}catch(e){return!1}}var $o;function Go(e,n){switch(n){case 8:return e?[0,255]:[-128,127];case 16:return e?[0,65535]:[-32768,32767];case 32:return e?[0,4294967295]:[-2147483648,2147483647];default:throw new Error("Invalid bit size.")}}function Ho(e,n,t,r,o){try{return o.contents=function(e,n,t,r,o){const i=function(e,n,t){const r=/^\s*([\+\-])?(0[xXoObB])?([0-9a-fA-F]+)\s*$/.exec(e.replace(/_/g,""));if(null!=r){const[,,e,o]=r;t=t||function(e,n){if(n&$o.AllowHexSpecifier)return 16;switch(e){case"0b":case"0B":return 2;case"0o":case"0O":return 8;case"0x":case"0X":return 16;default:return 10}}(e,n);const i=function(e){switch(e){case 2:return/[^0-1]/;case 8:return/[^0-7]/;case 10:return/[^0-9]/;case 16:return/[^0-9a-fA-F]/;default:throw new Error("Invalid Base.")}}(t);if(!i.test(o))return function(e,n){const[,t,r,o]=e;return{sign:t||"",prefix:r||"",digits:o,radix:n}}(r,t)}return null}(e,n,void 0);if(null!=i){let e=Number.parseInt(i.sign+i.digits,i.radix);if(!Number.isNaN(e)){const[n,o]=Go(!0,r);!t&&10!==i.radix&&e>=n&&e<=o&&(e=e<<32-r>>32-r);const[s,u]=Go(t,r);if(e>=s&&e<=u)return e}}throw new Error("Input string was not in a correct format.")}(e,n,t,r),!0}catch(e){return!1}}function jo(e,n){!function(e){if(null!=e&&0!==e){if(e%6e4!=0)throw new Error("Offset must be specified in whole minutes.");if(Math.abs(e/36e5)>14)throw new Error("Offset must be within plus or minus 14 hours.")}}(n);const t=new Date(e);return t.offset=null!=n?n:-6e4*(new Date).getTimezoneOffset(),t}function Bo(e,n){try{return n.contents=function(e){const[n,t]=$n(e),r=null==t?-6e4*n.getTimezoneOffset():"Z"===t?0:6e4*t;return jo(n.getTime(),r)}(e),!0}catch(e){return!1}}!function(e){e[e.AllowHexSpecifier=512]="AllowHexSpecifier"}($o||($o={}));var Lo=null;try{Lo=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(u){}function Vo(e,n,t){this.low=0|e,this.high=0|n,this.unsigned=!!t}function zo(e){return!0===(e&&e.__isLong__)}Vo.prototype.GetHashCode=function(){let e=this.unsigned?1:0;return e=(e<<5)+e^this.high,e=(e<<5)+e^this.low,e},Vo.prototype.Equals=function(e){return yi(this,e)},Vo.prototype.CompareTo=function(e){return bi(this,e)},Vo.prototype.toString=function(e){return mi(this,e)},Vo.prototype.toJSON=function(){return mi(this)},Vo.prototype[Hn]=function(){const e=this;return{multiply:n=>Ai(e,n),toPrecision:n=>String(e)+(0).toPrecision(n).substr(1),toExponential:n=>String(e)+(0).toExponential(n).substr(1),toFixed:n=>String(e)+(0).toFixed(n).substr(1),toHex:()=>{return mi(e.unsigned?e:function(e,n,t){return t?function(e,n){return new Vo(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,n)}(e,n):function(e,n){return new Vo(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],n)}(e,n)}((n=e,t?function(e){var n=e.high,t=e.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&n,n>>>8&255,n>>>16&255,n>>>24]}(n):function(e){var n=e.high,t=e.low;return[n>>>24,n>>>16&255,n>>>8&255,255&n,t>>>24,t>>>16&255,t>>>8&255,255&t]}(n)),!0),16);var n,t}}},Vo.prototype.__isLong__,Object.defineProperty(Vo.prototype,"__isLong__",{value:!0});var Wo={},qo={};function Zo(e,n){var t,r,o;return n?(o=0<=(e>>>=0)&&e<256)&&(r=qo[e])?r:(t=Yo(e,(0|e)<0?-1:0,!0),o&&(qo[e]=t),t):(o=-128<=(e|=0)&&e<128)&&(r=Wo[e])?r:(t=Yo(e,e<0?-1:0,!1),o&&(Wo[e]=t),t)}function Jo(e,n){if(isNaN(e))return n?ii:oi;if(n){if(e<0)return ii;if(e>=ni)return ai}else{if(e<=-ti)return fi;if(e+1>=ti)return ci}return e<0?xi(Jo(-e,n)):Yo(e%ei|0,e/ei|0,n)}function Yo(e,n,t){return new Vo(e,n,t)}var Xo=Math.pow;function Ko(e,n,t){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return oi;if("number"==typeof n?(t=n,n=!1):n=!!n,(t=t||10)<2||36<t)throw RangeError("radix");var r=e.indexOf("-");if(r>0)throw Error("interior hyphen");if(0===r)return xi(Ko(e.substring(1),n,t));for(var o=Jo(Xo(t,8)),i=oi,s=0;s<e.length;s+=8){var u=Math.min(8,e.length-s),l=parseInt(e.substring(s,s+u),t);i=Si(u<8?Ai(i,Jo(Xo(t,u))):i=Ai(i,o),Jo(l))}return i.unsigned=n,i}function Qo(e,n){return"number"==typeof e?Jo(e,n):"string"==typeof e?Ko(e,n):Yo(e.low,e.high,"boolean"==typeof n?n:e.unsigned)}var ei=4294967296,ni=ei*ei,ti=ni/2,ri=Zo(1<<24),oi=Zo(0),ii=Zo(0,!0),si=Zo(1),ui=Zo(1,!0),li=Zo(-1),ci=Yo(-1,2147483647,!1),ai=Yo(-1,-1,!0),fi=Yo(0,-2147483648,!1);function di(e){return e.unsigned?e.low>>>0:e.low}function hi(e){return e.unsigned?(e.high>>>0)*ei+(e.low>>>0):e.high*ei+(e.low>>>0)}function mi(e,n){if((n=n||10)<2||36<n)throw RangeError("radix");if(pi(e))return"0";if(wi(e)){if(yi(e,fi)){var t=Jo(n),r=ki(e,t),o=Ei(Ai(r,t),e);return mi(r,n)+di(o).toString(n)}return"-"+mi(xi(e),n)}for(var i=Jo(Xo(n,6),e.unsigned),s=e,u="";;){var l=ki(s,i),c=(di(Ei(s,Ai(l,i)))>>>0).toString(n);if(pi(s=l))return c+u;for(;c.length<6;)c="0"+c;u=""+c+u}}function pi(e){return 0===e.high&&0===e.low}function wi(e){return!e.unsigned&&e.high<0}function gi(e){return 1==(1&e.low)}function yi(e,n){return zo(n)||(n=Qo(n)),(e.unsigned===n.unsigned||e.high>>>31!=1||n.high>>>31!=1)&&e.high===n.high&&e.low===n.low}function _i(e,n){return bi(e,n)<0}function vi(e,n){return bi(e,n)>0}function Ci(e,n){return bi(e,n)>=0}function bi(e,n){if(zo(n)||(n=Qo(n)),yi(e,n))return 0;var t=wi(e),r=wi(n);return t&&!r?-1:!t&&r?1:e.unsigned?n.high>>>0>e.high>>>0||n.high===e.high&&n.low>>>0>e.low>>>0?-1:1:wi(Ei(e,n))?-1:1}function xi(e){return!e.unsigned&&yi(e,fi)?fi:Si(function(e){return Yo(~e.low,~e.high,e.unsigned)}(e),si)}function Si(e,n){zo(n)||(n=Qo(n));var t=e.high>>>16,r=65535&e.high,o=e.low>>>16,i=65535&e.low,s=n.high>>>16,u=65535&n.high,l=n.low>>>16,c=0,a=0,f=0,d=0;return f+=(d+=i+(65535&n.low))>>>16,a+=(f+=o+l)>>>16,c+=(a+=r+u)>>>16,c+=t+s,Yo((f&=65535)<<16|(d&=65535),(c&=65535)<<16|(a&=65535),e.unsigned)}function Ei(e,n){return zo(n)||(n=Qo(n)),Si(e,xi(n))}function Ai(e,n){if(pi(e))return e.unsigned?ii:oi;if(zo(n)||(n=Qo(n)),Lo)return Yo(Lo.mul(e.low,e.high,n.low,n.high),Lo.get_high(),e.unsigned);if(pi(n))return e.unsigned?ii:oi;if(yi(e,fi))return gi(n)?fi:oi;if(yi(n,fi))return gi(e)?fi:oi;if(wi(e))return wi(n)?Ai(xi(e),xi(n)):xi(Ai(xi(e),n));if(wi(n))return xi(Ai(e,xi(n)));if(_i(e,ri)&&_i(n,ri))return Jo(hi(e)*hi(n),e.unsigned);var t=e.high>>>16,r=65535&e.high,o=e.low>>>16,i=65535&e.low,s=n.high>>>16,u=65535&n.high,l=n.low>>>16,c=65535&n.low,a=0,f=0,d=0,h=0;return d+=(h+=i*c)>>>16,f+=(d+=o*c)>>>16,d&=65535,f+=(d+=i*l)>>>16,a+=(f+=r*c)>>>16,f&=65535,a+=(f+=o*l)>>>16,f&=65535,a+=(f+=i*u)>>>16,a+=t*c+r*l+o*u+i*s,Yo((d&=65535)<<16|(h&=65535),(a&=65535)<<16|(f&=65535),e.unsigned)}function ki(e,n){if(zo(n)||(n=Qo(n)),pi(n))throw Error("division by zero");var t,r,o;if(Lo)return e.unsigned||-2147483648!==e.high||-1!==n.low||-1!==n.high?Yo((e.unsigned?Lo.div_u:Lo.div_s)(e.low,e.high,n.low,n.high),Lo.get_high(),e.unsigned):e;if(pi(e))return e.unsigned?ii:oi;if(e.unsigned){if(n.unsigned||(n=function(e){return e.unsigned?e:Yo(e.low,e.high,!0)}(n)),vi(n,e))return ii;if(vi(n,function(e,n){if(zo(n)&&(n=di(n)),0==(n&=63))return e;var t=e.high;return n<32?Yo(e.low>>>n|t<<32-n,t>>>n,e.unsigned):Yo(32===n?t:t>>>n-32,0,e.unsigned)}(e,1)))return ui;o=ii}else{if(yi(e,fi))return yi(n,si)||yi(n,li)?fi:yi(n,fi)?si:yi(t=function(e,n){return zo(n)&&(n=di(n)),0==(n&=63)?e:n<32?Yo(e.low<<n,e.high<<n|e.low>>>32-n,e.unsigned):Yo(0,e.low<<n-32,e.unsigned)}(ki(function(e,n){return zo(n)&&(n=di(n)),0==(n&=63)?e:n<32?Yo(e.low>>>n|e.high<<32-n,e.high>>n,e.unsigned):Yo(e.high>>n-32,e.high>=0?0:-1,e.unsigned)}(e,1),n),1),oi)?wi(n)?si:li:o=Si(t,ki(r=Ei(e,Ai(n,t)),n));if(yi(n,fi))return e.unsigned?ii:oi;if(wi(e))return wi(n)?ki(xi(e),xi(n)):xi(ki(xi(e),n));if(wi(n))return xi(ki(e,xi(n)));o=oi}for(r=e;Ci(r,n);){t=Math.max(1,Math.floor(hi(r)/hi(n)));for(var i=Math.ceil(Math.log(t)/Math.LN2),s=i<=48?1:Xo(2,i-48),u=Jo(t),l=Ai(u,n);wi(l)||vi(l,r);)l=Ai(u=Jo(t-=s,e.unsigned),n);pi(u)&&(u=si),o=Si(o,u),r=Ei(r,l)}return o}const Ii=ki,Ti=hi;function Ni(e){return e<0?Math.ceil(e):Math.floor(e)}function Fi(e=0,n=0,t=0,r=0,o=0){switch(arguments.length){case 1:return Ti(Ii(arguments[0],1e4));case 3:e=0,n=arguments[0],t=arguments[1],r=arguments[2],o=0}return 864e5*e+36e5*n+6e4*t+1e3*r+o}function Oi(e,n){try{return n.contents=function(e){const n=e.search("\\."),t=e.search("\\:");if(-1===n&&-1===t){const n=parseInt(e,0);if(isNaN(n))throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`);return Fi(n,0,0,0,0)}if(t>0){const n=/^(-?)((\d+)\.)?(?:0*)([0-9]|0[0-9]|1[0-9]|2[0-3]):(?:0*)([0-5][0-9]|[0-9])(:(?:0*)([0-5][0-9]|[0-9]))?\.?(\d+)?$/.exec(e);if(null!=n&&null!=n[4]&&null!=n[5]){let t=0,r=0,o=0;const i=null!=n[1]&&"-"===n[1]?-1:1,s=+n[4],u=+n[5];if(null!=n[3]&&(t=+n[3]),null!=n[7]&&(o=+n[7]),null!=n[8])switch(n[8].length){case 1:r=100*+n[8];break;case 2:r=10*+n[8];break;case 3:r=+n[8];break;case 4:r=+n[8]/10;break;case 5:r=+n[8]/100;break;case 6:r=+n[8]/1e3;break;case 7:r=+n[8]/1e4;break;default:throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`)}return i*Fi(t,s,u,o,r)}}throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`)}(e),!0}catch(e){return!1}}class Mi{constructor(e){this.k=e}}function Ui(e){return new Mi(e)}function Di(e){return e.k}class Pi extends Mi{constructor(e,n,t,r){super(e),this.left=n,this.right=t,this.h=0|r}}function Ri(e,n,t,r){return new Pi(e,n,t,r)}function $i(e){return e.left}function Gi(e){return e.right}function Hi(e){return e.h}function ji(e,n){e:for(;;){const t=n;if(null!=e){const r=e;if(r instanceof Pi){e=$i(r),n=ji(Gi(r),t+1);continue e}return t+1|0}return 0|t}}function Bi(e){return ji(e,0)}function Li(e,n,t){let r,o;r=null!=e?e instanceof Pi?Hi(e):1:0,o=null!=t?t instanceof Pi?Hi(t):1:0;const i=0|(r<o?o:r);return 0===i?Ui(n):Ri(n,e,t,i+1)}function Vi(e,n,t){let r,o,i,s,u,l;if(u=null!=e?e instanceof Pi?Hi(e):1:0,l=null!=t?t instanceof Pi?Hi(t):1:0,l>u+2){const i=Tn(t);if(i instanceof Pi){if(r=$i(i),(null!=r?(o=r,o instanceof Pi?Hi(o):1):0)>u+1){const t=Tn($i(i));if(t instanceof Pi)return Li(Li(e,n,$i(t)),Di(t),Li(Gi(t),Di(i),Gi(i)));throw new Error("internal error: Set.rebalance")}return Li(Li(e,n,$i(i)),Di(i),Gi(i))}throw new Error("internal error: Set.rebalance")}if(u>l+2){const r=Tn(e);if(r instanceof Pi){if(i=Gi(r),(null!=i?(s=i,s instanceof Pi?Hi(s):1):0)>l+1){const e=Tn(Gi(r));if(e instanceof Pi)return Li(Li($i(r),Di(r),$i(e)),Di(e),Li(Gi(e),n,t));throw new Error("internal error: Set.rebalance")}return Li($i(r),Di(r),Li(Gi(r),n,t))}throw new Error("internal error: Set.rebalance")}return Li(e,n,t)}function zi(e,n,t){if(null!=t){const r=t,o=0|e.Compare(n,Di(r));if(r instanceof Pi)return o<0?Vi(zi(e,n,$i(r)),Di(r),Gi(r)):0===o?t:Vi($i(r),Di(r),zi(e,n,Gi(r)));{const o=0|e.Compare(n,Di(r));return o<0?Ri(n,void 0,t,2):0===o?t:Ri(n,t,void 0,2)}}return Ui(n)}function Wi(e,n,t){e:for(;;){const r=e,o=n;if(null!=t){const i=t,s=0|r.Compare(o,Di(i));if(i instanceof Pi){if(s<0){e=r,n=o,t=$i(i);continue e}if(0===s)return!0;e=r,n=o,t=Gi(i);continue e}return 0===s}return!1}}function qi(e,n){e:for(;;){const t=e;if(null!=n){const r=n;if(r instanceof Pi){qi(t,$i(r)),t(Di(r)),e=t,n=Gi(r);continue e}t(Di(r))}break}}class Zi extends xn{constructor(e,n){super(),this.stack=e,this.started=n}}function Ji(e){e:for(;;){const n=e;if(Et(n))return bt();{const t=At(n),r=kt(n);if(null!=t){const o=t;if(o instanceof Pi){e=Ot([$i(o),Ui(Di(o)),Gi(o)],r);continue e}return n}e=r;continue e}}}function Yi(e){return new Zi(Ji(St(e)),!1)}function Xi(e){if(e.started){const n=e.stack;if(Et(n))return function(){throw new Error("Enumeration already started")}();if(null!=At(n))return Di(At(n));throw new Error("Please report error: Set iterator, unexpected stack for current")}return function(){throw new Error("Enumeration not started")}()}function Ki(e){let n=Yi(e);return{"System.Collections.Generic.IEnumerator`1.get_Current":()=>Xi(n),"System.Collections.IEnumerator.get_Current":()=>Xi(n),"System.Collections.IEnumerator.MoveNext":()=>function(e){if(e.started){const n=e.stack;if(Et(n))return!1;if(null!=At(n)){if(At(n)instanceof Pi)throw new Error("Please report error: Set iterator, unexpected stack for moveNext");return e.stack=Ji(kt(n)),!Et(e.stack)}throw new Error("Please report error: Set iterator, unexpected stack for moveNext")}return e.started=!0,!Et(e.stack)}(n),"System.Collections.IEnumerator.Reset"(){n=Yi(e)},Dispose(){}}}function Qi(e,n,t){return null==n?null==t?0:-1:null==t?1:0|function(e,n,t){e:for(;;){const r=e,o=n,i=t,s=[o,i];if(Et(s[0]))return Et(s[1])?0:-1;if(Et(s[1]))return 1;if(null!=At(s[1]))if(null!=At(s[0])){const u=At(s[0]),l=At(s[1]);if(u instanceof Pi)if(null==$i(u)){if(!(l instanceof Pi)){const o=0|r.Compare(Di(u),Di(l));if(0!==o)return 0|o;e=r,n=xt(Gi(u),kt(s[0])),t=xt(void 0,kt(s[1]));continue e}if(null==$i(l)){const o=0|r.Compare(Di(u),Di(l));if(0!==o)return 0|o;e=r,n=xt(Gi(u),kt(s[0])),t=xt(Gi(l),kt(s[1]));continue e}{const s=[o,i];let u,l,c,a,f;switch(Et(s[0])?Et(s[1])?u=2:null!=At(s[1])?(u=1,a=kt(s[1]),f=At(s[1])):u=2:null!=At(s[0])?(u=0,l=kt(s[0]),c=At(s[0])):Et(s[1])?u=2:null!=At(s[1])?(u=1,a=kt(s[1]),f=At(s[1])):u=2,u){case 0:if(c instanceof Pi){e=r,n=Ot([$i(c),Ri(Di(c),void 0,Gi(c),0)],l),t=i;continue e}e=r,n=Ot([void 0,Ui(Di(c))],l),t=i;continue e;case 1:if(f instanceof Pi){e=r,n=o,t=Ot([$i(f),Ri(Di(f),void 0,Gi(f),0)],a);continue e}e=r,n=o,t=Ot([void 0,Ui(Di(f))],a);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}else{const s=[o,i];let u,l,c,a,f;switch(Et(s[0])?Et(s[1])?u=2:null!=At(s[1])?(u=1,a=kt(s[1]),f=At(s[1])):u=2:null!=At(s[0])?(u=0,l=kt(s[0]),c=At(s[0])):Et(s[1])?u=2:null!=At(s[1])?(u=1,a=kt(s[1]),f=At(s[1])):u=2,u){case 0:if(c instanceof Pi){e=r,n=Ot([$i(c),Ri(Di(c),void 0,Gi(c),0)],l),t=i;continue e}e=r,n=Ot([void 0,Ui(Di(c))],l),t=i;continue e;case 1:if(f instanceof Pi){e=r,n=o,t=Ot([$i(f),Ri(Di(f),void 0,Gi(f),0)],a);continue e}e=r,n=o,t=Ot([void 0,Ui(Di(f))],a);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}else{if(!(l instanceof Pi)){const o=0|r.Compare(Di(u),Di(l));if(0!==o)return 0|o;e=r,n=kt(s[0]),t=kt(s[1]);continue e}if(null==$i(l)){const o=0|r.Compare(Di(u),Di(l));if(0!==o)return 0|o;e=r,n=xt(void 0,kt(s[0])),t=xt(Gi(l),kt(s[1]));continue e}{const s=[o,i];let u,l,c,a,f;switch(Et(s[0])?Et(s[1])?u=2:null!=At(s[1])?(u=1,a=kt(s[1]),f=At(s[1])):u=2:null!=At(s[0])?(u=0,l=kt(s[0]),c=At(s[0])):Et(s[1])?u=2:null!=At(s[1])?(u=1,a=kt(s[1]),f=At(s[1])):u=2,u){case 0:if(c instanceof Pi){e=r,n=Ot([$i(c),Ri(Di(c),void 0,Gi(c),0)],l),t=i;continue e}e=r,n=Ot([void 0,Ui(Di(c))],l),t=i;continue e;case 1:if(f instanceof Pi){e=r,n=o,t=Ot([$i(f),Ri(Di(f),void 0,Gi(f),0)],a);continue e}e=r,n=o,t=Ot([void 0,Ui(Di(f))],a);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}}else{At(s[1]);const u=[o,i];let l,c,a,f,d;switch(Et(u[0])?Et(u[1])?l=2:null!=At(u[1])?(l=1,f=kt(u[1]),d=At(u[1])):l=2:null!=At(u[0])?(l=0,c=kt(u[0]),a=At(u[0])):Et(u[1])?l=2:null!=At(u[1])?(l=1,f=kt(u[1]),d=At(u[1])):l=2,l){case 0:if(a instanceof Pi){e=r,n=Ot([$i(a),Ri(Di(a),void 0,Gi(a),0)],c),t=i;continue e}e=r,n=Ot([void 0,Ui(Di(a))],c),t=i;continue e;case 1:if(d instanceof Pi){e=r,n=o,t=Ot([$i(d),Ri(Di(d),void 0,Gi(d),0)],f);continue e}e=r,n=o,t=Ot([void 0,Ui(Di(d))],f);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}else{if(null==At(s[0])){e=r,n=kt(s[0]),t=kt(s[1]);continue e}{At(s[0]);const u=[o,i];let l,c,a,f,d;switch(Et(u[0])?Et(u[1])?l=2:null!=At(u[1])?(l=1,f=kt(u[1]),d=At(u[1])):l=2:null!=At(u[0])?(l=0,c=kt(u[0]),a=At(u[0])):Et(u[1])?l=2:null!=At(u[1])?(l=1,f=kt(u[1]),d=At(u[1])):l=2,l){case 0:if(a instanceof Pi){e=r,n=Ot([$i(a),Ri(Di(a),void 0,Gi(a),0)],c),t=i;continue e}e=r,n=Ot([void 0,Ui(Di(a))],c),t=i;continue e;case 1:if(d instanceof Pi){e=r,n=o,t=Ot([$i(d),Ri(Di(d),void 0,Gi(d),0)],f);continue e}e=r,n=o,t=Ot([void 0,Ui(Di(d))],f);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}break}}(e,St(n),St(t))}function es(e,n,t){let r=t;qi((e=>{n[r]=e,r=r+1|0}),e)}function ns(e,n){if(Le(n))return function(e,n){return ht(((n,t)=>zi(e,t,n)),void 0,n)}(e,n);if(n instanceof pt)return function(e,n){return Tt(((n,t)=>zi(e,t,n)),void 0,n)}(e,n);{const t=Je(n);try{return function(e,n,t){for(;;){const r=e,o=n,i=t;if(!i["System.Collections.IEnumerator.MoveNext"]())return o;e=r,n=zi(r,i["System.Collections.Generic.IEnumerator`1.get_Current"](),o),t=i}}(e,void 0,t)}finally{We(t)}}}class ts{constructor(e,n){this.comparer=e,this.tree=n}GetHashCode(){return 0|function(e){let n,t=0;const r=Je(e);try{for(;r["System.Collections.IEnumerator.MoveNext"]();)t=0|(n=0|sn(r["System.Collections.Generic.IEnumerator`1.get_Current"]()),(t<<1)+n+631)}finally{We(r)}return 0|Math.abs(t)}(this)}Equals(e){return e instanceof ts&&0===Qi(rs(this),os(this),os(e))}toString(){return"set ["+ot("; ",ir((e=>Cn(e)),this))+"]"}get[Symbol.toStringTag](){return"FSharpSet"}toJSON(e){return Array.from(this)}CompareTo(e){return 0|Qi(rs(this),os(this),os(e))}"System.Collections.Generic.ICollection`1.Add2B595"(e){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Remove2B595"(e){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Contains2B595"(e){return Wi(rs(this),e,os(this))}"System.Collections.Generic.ICollection`1.CopyToZ2E171D71"(e,n){es(os(this),e,n)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return 0|is(this)}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return 0|is(this)}GetEnumerator(){return Ki(os(this))}[Symbol.iterator](){return Ye(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return Ki(os(this))}get size(){return 0|is(this)}add(e){throw new Error("Set cannot be mutated")}clear(){throw new Error("Set cannot be mutated")}delete(e){throw new Error("Set cannot be mutated")}has(e){return function(e,n){return Wi(rs(e),n,os(e))}(this,e)}keys(){return ir((e=>e),this)}values(){return ir((e=>e),this)}entries(){return ir((e=>[e,e]),this)}forEach(e,n){const t=this;or((n=>{e(n,n,t)}),t)}}function rs(e){return e.comparer}function os(e){return e.tree}function is(e){return Bi(os(e))}function ss(e,n,t){try{return"Expecting "+e+" but instead got:"+(t?"\n":" ")+JSON.stringify(n,null,4)}catch(n){return"Expecting "+e+" but decoder failed. Couldn't report given value due to circular structure."+(t?"\n":" ")}}function us(e,n,t){const r=n(e,t);if(1===r.tag){const e=r.fields[0];return new Ao(1,function(e,n){const t=2===n.tag?ss(n.fields[0],n.fields[1],!0):1===n.tag?ss(n.fields[0],n.fields[1],!1)+"\nReason: "+n.fields[2]:3===n.tag?ss(n.fields[0],n.fields[1],!0):4===n.tag?ss(n.fields[0],n.fields[1],!0)+"\nNode `"+n.fields[2]+"` is unkown.":5===n.tag?"Expecting "+n.fields[0]+".\n"+JSON.stringify(n.fields[1],null,4):7===n.tag?"The following errors were found:\n\n"+ot("\n\n",n.fields[0]):6===n.tag?"The following `failure` occurred with the decoder: "+n.fields[0]:ss(n.fields[0],n.fields[1],!1);return 7===n.tag?t:"Error at: `"+e+"`\n"+t}(e[0],e[1]))}return new Ao(0,r.fields[0])}function ls(e,n){try{return us("$",e,JSON.parse(n))}catch(e){if(e instanceof SyntaxError)return new Ao(1,"Given an invalid JSON: "+e.message);throw e}}function cs(e,n){return"string"==typeof n?new Ao(0,n):new Ao(1,[e,new Io(0,"a string",n)])}const as=e=>n=>{const t="a sbyte",r=e,o=n;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?-128<=e&&e<=127?new Ao(0,(e+128&255)-128):new Ao(1,[r,new Io(1,t,e,"Value was either too large or too small for "+t)]):new Ao(1,[r,new Io(1,t,e,"Value is not an integral value")])}if("string"==typeof o){let e,n=0;return e=[Ho(o,511,!1,8,new Sn((()=>n),(e=>{n=0|e}))),n],e[0]?new Ao(0,e[1]):new Ao(1,[r,new Io(0,t,o)])}return new Ao(1,[r,new Io(0,t,o)])},fs=e=>n=>{const t="a byte",r=e,o=n;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?0<=e&&e<=255?new Ao(0,255&e):new Ao(1,[r,new Io(1,t,e,"Value was either too large or too small for "+t)]):new Ao(1,[r,new Io(1,t,e,"Value is not an integral value")])}if("string"==typeof o){let e,n=0;return e=[Ho(o,511,!0,8,new Sn((()=>n),(e=>{n=e}))),n],e[0]?new Ao(0,e[1]):new Ao(1,[r,new Io(0,t,o)])}return new Ao(1,[r,new Io(0,t,o)])},ds=e=>n=>{const t="an int16",r=e,o=n;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?-32768<=e&&e<=32767?new Ao(0,(e+32768&65535)-32768):new Ao(1,[r,new Io(1,t,e,"Value was either too large or too small for "+t)]):new Ao(1,[r,new Io(1,t,e,"Value is not an integral value")])}if("string"==typeof o){let e,n=0;return e=[Ho(o,511,!1,16,new Sn((()=>n),(e=>{n=0|e}))),n],e[0]?new Ao(0,e[1]):new Ao(1,[r,new Io(0,t,o)])}return new Ao(1,[r,new Io(0,t,o)])},hs=e=>n=>{const t="an uint16",r=e,o=n;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?0<=e&&e<=65535?new Ao(0,65535&e):new Ao(1,[r,new Io(1,t,e,"Value was either too large or too small for "+t)]):new Ao(1,[r,new Io(1,t,e,"Value is not an integral value")])}if("string"==typeof o){let e,n=0;return e=[Ho(o,511,!0,16,new Sn((()=>n),(e=>{n=e}))),n],e[0]?new Ao(0,e[1]):new Ao(1,[r,new Io(0,t,o)])}return new Ao(1,[r,new Io(0,t,o)])},ms=e=>n=>{const t="an int",r=e,o=n;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?-2147483648<=e&&e<=2147483647?new Ao(0,~~e):new Ao(1,[r,new Io(1,t,e,"Value was either too large or too small for "+t)]):new Ao(1,[r,new Io(1,t,e,"Value is not an integral value")])}if("string"==typeof o){let e,n=0;return e=[Ho(o,511,!1,32,new Sn((()=>n),(e=>{n=0|e}))),n],e[0]?new Ao(0,e[1]):new Ao(1,[r,new Io(0,t,o)])}return new Ao(1,[r,new Io(0,t,o)])},ps=e=>n=>{const t="an uint32",r=e,o=n;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?0<=e&&e<=4294967295?new Ao(0,e>>>0):new Ao(1,[r,new Io(1,t,e,"Value was either too large or too small for "+t)]):new Ao(1,[r,new Io(1,t,e,"Value is not an integral value")])}if("string"==typeof o){let e,n=0;return e=[Ho(o,511,!0,32,new Sn((()=>n),(e=>{n=e}))),n],e[0]?new Ao(0,e[1]):new Ao(1,[r,new Io(0,t,o)])}return new Ao(1,[r,new Io(0,t,o)])};function ws(e,n,t,r){let o;const i=t+".["+en(e)+"]";if(Array.isArray(r)){const t=r;return e<t.length?n(i,t[e]):new Ao(1,[i,new Io(5,"a longer array. Need index `"+en(e)+"` but there are only `"+(o=t.length,en(o)+"` entries"),r)])}return new Ao(1,[i,new Io(0,"an array",r)])}function gs(e,n,t){if(Array.isArray(t)){let r=-1;return ko(Nt,ht(((t,o)=>{if(r=r+1|0,0===t.tag){const i=e(n+".["+en(r)+"]",o);return 0===i.tag?new Ao(0,xt(i.fields[0],t.fields[0])):new Ao(1,i.fields[0])}return t}),new Ao(0,bt()),t))}return new Ao(1,[n,new Io(0,"a list",t)])}function ys(e,n,t){if(Array.isArray(t)){let r=-1;const o=t;return ht(((t,o)=>{if(r=r+1|0,0===t.tag){const i=t.fields[0],s=e(n+".["+en(r)+"]",o);return 0===s.tag?(i[r]=s.fields[0],new Ao(0,i)):new Ao(1,s.fields[0])}return t}),new Ao(0,ft(new Array(o.length),0,o.length,null)),o)}return new Ao(1,[n,new Io(0,"an array",t)])}function _s(e,n,t,r){const o=n(t,r);return 0===o.tag?e(o.fields[0],t,r):new Ao(1,o.fields[0])}function vs(e,n){let t;const r=e;return t=e=>n=>ws(0,r,e,n),e=>r=>_s(yn(3,(e=>{let t;const r=n;return t=e=>n=>ws(1,r,e,n),n=>r=>_s(((n,t,r)=>new Ao(0,[e,n])),yn(2,t),n,r)})),yn(2,t),e,r)}function Cs(e){return Hr(e)}function bs(e){return function(e,n){return new ts(e,n)}(n={Compare:mn},ns(n,e));var n}function xs(e,n,t,r){let o;const i=n.length+e|0;if(i!==r.length)return new Ao(1,[t,new Io(6,(o=0|r.length,et(Kn("Expected array of length %i but got %i"))(i)(o)))]);{let o=new Ao(0,bt());for(let i=e;i<=r.length-1;i++)if(0===o.tag){const s=o.fields[0],u=et(Kn("%s[%i]"))(t)(i),l=n[i-e],c=r[i];o=ko((e=>xt(e,s)),l(u)(c))}return ko(Nt,o)}}function Ss(e,n,t,r,o,i){const s=function(e,n){return n.find((e=>lo(e)===r))}(0,_o(t));if(null!=s){const t=s,r=dt((t=>As(e,n,!1,t[1])),Eo(t));return ko((e=>function(e,n){const t=(e.fields||[]).length;if(n.length!==t)throw new Error(`Expected an array of length ${t} but got ${n.length}`);return null!=e.declaringType.construct?new e.declaringType.construct(e.tag,...n):{}}(t,It(e))),0===r.length&&i.length<=1?new Ao(0,bt()):xs(1,r,o,i))}return new Ao(1,[o,new Io(6,"Cannot find case "+r+" in "+co(t))])}function Es(e,n,t,r){const o=new Sn(null);let i;const s=co(r);let u;if(i=""===s?e:zr(s,o,e),xo(r)){const e=dt((e=>[Mo(n,lo(e)),As(i,n,!1,e[1])]),vo(r));u=n=>t=>ko((e=>function(e,n){const t=vo(e);if(t.length!==n.length)throw new Error(`Expected an array of length ${t.length} but got ${n.length}`);return null!=e.construct?new e.construct(...n):t.reduce(((e,[t,r],o)=>(e[t]=n[o],e)),{})}(r,It(e))),function(e,n,t){return null===t||Object.getPrototypeOf(t||!1)!==Object.prototype?new Ao(1,[n,new Io(0,"an object",t)]):function(e,n,t){return n.reduceRight(((n,t)=>e(t,n)),t)}(yn(2,(e=>{const r=e[0];return o=>0===o.tag?ko((e=>xt(e,o.fields[0])),e[1](n+"."+r)(t[r])):o})),e,new Ao(0,bt()))}(e,n,t))}else if(bo(r))u=e=>t=>{if("string"==typeof t)return Ss(i,n,r,t,e,[]);if(Array.isArray(t)){const u=t;return o=t=>Ss(i,n,r,t,e,u),0===(s=cs(e+"[0]",u[0])).tag?o(s.fields[0]):new Ao(1,s.fields[0])}return new Ao(1,[e,new Io(0,"a string or array",t)]);var o,s};else{if(!t){let e;const n=co(r);throw e=et(Kn("Cannot generate auto decoder for %s. Please pass an extra decoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders"))(n),new Error(e)}u=e=>n=>new Ao(1,[e,new Io(2,"an extra coder for "+co(r),n)])}return o.contents=u,u}function As(e,n,t,r){let o,i,s,u;const l=co(r),c=qr(l,e);if(null==c){if(ao(r)){const t=As(e,n,!1,fo(r));return e=>n=>ys(yn(2,t),e,n)}if(mo(r)){const e=co(wo(r));if("System.SByte"===e)return e=>n=>{const t=r,o=e,i=n,s=as(o)(i);if(1===s.tag)return new Ao(1,s.fields[0]);{const e=s.fields[0];return tr(e,go(t),{Equals:(e,n)=>e===n,GetHashCode:rn})?new Ao(0,yo(t,e.toString())):new Ao(1,[o,new Io(1,co(t),i,"Unkown value provided for the enum")])}};if("System.Byte"===e)return e=>n=>{const t=r,o=e,i=n,s=fs(o)(i);if(1===s.tag)return new Ao(1,s.fields[0]);{const e=s.fields[0];return tr(e,go(t),{Equals:(e,n)=>e===n,GetHashCode:rn})?new Ao(0,yo(t,e.toString())):new Ao(1,[o,new Io(1,co(t),i,"Unkown value provided for the enum")])}};if("System.Int16"===e)return e=>n=>{const t=r,o=e,i=n,s=ds(o)(i);if(1===s.tag)return new Ao(1,s.fields[0]);{const e=s.fields[0];return tr(e,go(t),{Equals:(e,n)=>e===n,GetHashCode:rn})?new Ao(0,yo(t,e.toString(u))):new Ao(1,[o,new Io(1,co(t),i,"Unkown value provided for the enum")])}var u};if("System.UInt16"===e)return e=>n=>{const t=r,o=e,i=n,s=hs(o)(i);if(1===s.tag)return new Ao(1,s.fields[0]);{const e=s.fields[0];return tr(e,go(t),{Equals:(e,n)=>e===n,GetHashCode:rn})?new Ao(0,yo(t,e.toString())):new Ao(1,[o,new Io(1,co(t),i,"Unkown value provided for the enum")])}};if("System.Int32"===e)return e=>n=>{const t=r,o=e,i=n,s=ms(o)(i);if(1===s.tag)return new Ao(1,s.fields[0]);{const e=s.fields[0];return tr(e,go(t),{Equals:(e,n)=>e===n,GetHashCode:rn})?new Ao(0,yo(t,en(e))):new Ao(1,[o,new Io(1,co(t),i,"Unkown value provided for the enum")])}};if("System.UInt32"===e)return e=>n=>{const t=r,o=e,i=n,s=ps(o)(i);if(1===s.tag)return new Ao(1,s.fields[0]);{const e=s.fields[0];return tr(e,go(t),{Equals:(e,n)=>e===n,GetHashCode:rn})?new Ao(0,yo(t,e.toString())):new Ao(1,[o,new Io(1,co(t),i,"Unkown value provided for the enum")])}};{const e=co(r),n=nt(Kn("Cannot generate auto decoder for %s.\nThoth.Json.Net only support the following enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\nIf you can't use one of these types, please pass an extra decoder.\n "))(e);return e=>n(e)}}if(ho(r)){if(So(r)){const t=dt((t=>As(e,n,!1,t)),Co(r));return e=>n=>Array.isArray(n)?ko((e=>It(e)),xs(0,t,e,n)):new Ao(1,[e,new Io(0,"an array",n)])}{const l=co(po(r));if("Microsoft.FSharp.Core.FSharpOption`1[System.Object]"===l)return o=As(e,n,!0,Kr(r)[0]),e=>n=>{return t=yn(2,o),r=e,null==(i=n)?new Ao(0,void 0):ko(In,t(r,i));var t,r,i};if("Microsoft.FSharp.Collections.FSharpList`1[System.Object]"===l)return i=As(e,n,!1,Kr(r)[0]),e=>n=>gs(yn(2,i),e,n);if("System.Collections.Generic.IEnumerable`1[System.Object]"===l)return s=As(e,n,!1,Kr(r)[0]),e=>n=>function(e,n,t){if(Array.isArray(t)){let r=-1;return ko(ur,ht(((t,o)=>{if(r=r+1|0,0===t.tag){const i=e(n+".["+en(r)+"]",o);return 0===i.tag?new Ao(0,nr([i.fields[0]],t.fields[0])):new Ao(1,i.fields[0])}return t}),new Ao(0,[]),t))}return new Ao(1,[n,new Io(0,"a seq",t)])}(yn(2,s),e,n);if("Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"===l){const t=As(e,n,!1,Kr(r)[0]),o=As(e,n,!1,Kr(r)[1]);let i;const s=Mt([e=>n=>function(e,n,t,r){return null===r||Object.getPrototypeOf(r||!1)!==Object.prototype?new Ao(1,[t,new Io(0,"an object",r)]):rr(((o,i)=>{if(0===o.tag){const s=e(t,i);if(0===s.tag){const e=n(t+"."+i,r[i]);return 0===e.tag?new Ao(0,xt([s.fields[0],e.fields[0]],o.fields[0])):new Ao(1,e.fields[0])}return new Ao(1,s.fields[0])}return o}),new Ao(0,bt()),Object.keys(r))}(yn(2,t),yn(2,o),e,n),(u=vs(yn(2,t),yn(2,o)),e=>n=>gs(yn(2,u),e,n))]);return i=e=>n=>{return t=e,r=n,((e,n)=>{e:for(;;){const o=e,i=n;if(Et(o))return new Ao(1,[t,new Io(7,i)]);{const s=us(t,yn(2,At(o)),r);if(1===s.tag){e=kt(o),n=Ut(i,St(s.fields[0]));continue e}return new Ao(0,s.fields[0])}}})(s,bt());var t,r},e=>n=>function(e,n,t,r){const o=n(t,r);return 1===o.tag?new Ao(1,o.fields[0]):new Ao(0,e(o.fields[0]))}(Cs,yn(2,i),e,n)}if("Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"===l){const t=As(e,n,!1,Kr(r)[0]);return e=>n=>{const r=ys(yn(2,t),e,n);return 0===r.tag?new Ao(0,bs(r.fields[0])):new Ao(1,r.fields[0])}}return Es(e,n,t,r)}}return"System.Boolean"===l?e=>n=>{return t=e,"boolean"==typeof(r=n)?new Ao(0,r):new Ao(1,[t,new Io(0,"a boolean",r)]);var t,r}:"Microsoft.FSharp.Core.Unit"===l?e=>n=>{return t=e,null==(r=n)?new Ao(0,void 0):new Ao(1,[t,new Io(0,"null",r)]);var t,r}:"System.String"===l?e=>n=>cs(e,n):"System.Char"===l?e=>n=>function(e,n){if("string"==typeof n){const t=n;return 1===t.length?new Ao(0,t[0]):new Ao(1,[e,new Io(0,"a single character string",n)])}return new Ao(1,[e,new Io(0,"a char",n)])}(e,n):"System.SByte"===l?as:"System.Byte"===l?fs:"System.Int16"===l?ds:"System.UInt16"===l?hs:"System.Int32"===l?ms:"System.UInt32"===l?ps:"System.Double"===l?e=>n=>{return t=e,"number"==typeof(r=n)?new Ao(0,r):new Ao(1,[t,new Io(0,"a float",r)]);var t,r}:"System.Single"===l?e=>n=>{return t=e,"number"==typeof(r=n)?new Ao(0,r):new Ao(1,[t,new Io(0,"a float32",r)]);var t,r}:"System.DateTime"===l?e=>n=>function(e,n){if("string"==typeof n){let r,o=Rn(-621355968e5,0);return r=[Gn(n,new Sn((()=>o),(e=>{o=e}))),o],r[0]?new Ao(0,1===(t=r[1]).kind?t:Rn(t.getTime(),1)):new Ao(1,[e,new Io(0,"a datetime",n)])}var t;return new Ao(1,[e,new Io(0,"a datetime",n)])}(e,n):"System.DateTimeOffset"===l?e=>n=>function(e,n){if("string"==typeof n){let t,r=jo(-621355968e5,0);return t=[Bo(n,new Sn((()=>r),(e=>{r=e}))),r],t[0]?new Ao(0,t[1]):new Ao(1,[e,new Io(0,"a datetimeoffset",n)])}return new Ao(1,[e,new Io(0,"a datetime",n)])}(e,n):"System.TimeSpan"===l?e=>n=>function(e,n){if("string"==typeof n){let t,r=0;return t=[Oi(n,new Sn((()=>r),(e=>{r=e}))),r],t[0]?new Ao(0,t[1]):new Ao(1,[e,new Io(0,"a timespan",n)])}return new Ao(1,[e,new Io(0,"a timespan",n)])}(e,n):"System.Guid"===l?e=>n=>function(e,n){if("string"==typeof n){let t,r="00000000-0000-0000-0000-000000000000";return t=[Ro(n,new Sn((()=>r),(e=>{r=e}))),r],t[0]?new Ao(0,t[1]):new Ao(1,[e,new Io(0,"a guid",n)])}return new Ao(1,[e,new Io(0,"a guid",n)])}(e,n):"System.Object"===l?e=>e=>new Ao(0,e):Es(e,n,t,r)}{const e=c;return n=>t=>e.contents(n)(t)}}function ks(e,n,t){const r=Fn(n,new To(0));return As(function(e){return null!=e?Zr(((e,n)=>new Sn(n[1])),e.Coders):Jr()}(t),r,!1,e)}class Is extends xn{constructor(e,n,t){super(),this.PartnerId=e,this.AccountId=n,this.Funds=t}}class Ts extends xn{constructor(e,n){super(),this.PartnerFunds=e,this.AccountFunds=n}}class Ns extends xn{constructor(e,n){super(),this.DefaultFundUSI=e,this.FeatureSet=n}}class Fs extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Basic","Promoted"]}}function Os(){return function(e,n,t,r){const o=new Xr("SuperSelection.AdminUI.Dto.FeatureSet",[],t,void 0,void 0,(()=>{const e=t.prototype.cases();return[[],[]].map(((n,t)=>new Yr(o,t,e[t],n)))}));return o}(0,0,Fs)}class Ms extends xn{constructor(e,n){super(),this.Partner=e,this.Account=n}}class Us extends xn{constructor(e,n){super(),this.PartnerId=e,this.Name=n}}class Ds extends xn{constructor(e,n){super(),this.AccountId=e,this.Name=n}}class Ps extends xn{constructor(e,n,t,r){super(),this.Id=e,this.PartnerId=n,this.Enabled=t,this.Editor=r}}class Rs extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["AccessRole"]}}function $s(e){return new Rs(0,e)}function Gs(e){return Rt(new Rs(0,"SuperSelection.Access"),e,{Equals:an,GetHashCode:un})?In(void 0):void 0}function Hs(e){return Rt(new Rs(0,"SuperSelection.EditPanel"),e,{Equals:an,GetHashCode:un})?In(void 0):void 0}class js extends xn{constructor(e,n){super(),this.UserName=e,this.Roles=n}}function Bs(e){let n;const t=ut(null==e?"":e,["."],null,0);if(mt(((e,n)=>e===n),t,null)||3!==t.length)n=new Ao(1,"Failed to identify the user");else{let e;const o=t[1];e=atob(o),n=ls(yn(2,ks(to(["Name",so],["Roles",(r=so,new Xr("[]",[r]))]),new To(1),void 0)),e)}var r;if(1===n.tag)return new js(void 0,bt());{const e=n.fields[0];return new js(e.Name,Dt($s,Mt(e.Roles)))}}class Ls extends xn{constructor(e,n){super(),this.PromotedFunds=e,this.Configuration=n}}class Vs extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["PartnerId"]}}class zs extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["AccountId"]}}const Ws=Be,qs=(e,n)=>{re((()=>{const n=e();return()=>{n.Dispose()}}),n)},Zs=e=>{oe((()=>{const n=e();return()=>{n.Dispose()}}))};function Js(e,n,t,r){const o=Ws.memo(e,yn(2,Fn(function(e,n){return null==n||1===n.length?n:gn in n?n[gn]:_n([],e,n)}(2,t),null)));return or((n=>{e.displayName=n}),Nn(n)),e=>{const n=function(e,n){if(null==e)return n;{const t=e;return n.key=t(n),n}}(r,e);return Ws.createElement(o,n)}}function Ys(e){return{Dispose(){e()}}}function Xs(e){return Ws.useState(e)}function Ks(e,n){qs(e,n)}function Qs(e){!function(e,n){qs((n=>(e(),Ys((()=>{})))),[])}(e)}function eu(e){Ks(e,[])}function nu(e){return Ws.useRef(e)}function tu(e){const n=nu(e),t=function(e,t){const r=Fn([],[]);return Ws.useCallback((e=>n.current(e)),r)}();var r;return r=()=>{n.current=e},Zs((e=>(r(),Ys((()=>{}))))),t}class ru{constructor(e=!1){this._id=0,this._cancelled=e,this._listeners=new Map}get isCancelled(){return this._cancelled}cancel(){if(!this._cancelled){this._cancelled=!0;for(const[,e]of this._listeners)e()}}addListener(e){const n=this._id;return this._listeners.set(this._id++,e),n}removeListener(e){return this._listeners.delete(e)}register(e,n){const t=this,r=this.addListener(null==n?e:()=>e(n));return{Dispose(){t.removeListener(r)}}}Dispose(){}}class ou extends Error{constructor(){super("The operation was canceled"),Object.setPrototypeOf(this,ou.prototype)}}class iu{constructor(){this.callCount=0}static get maxTrampolineCallCount(){return 2e3}incrementAndCheck(){return this.callCount++>iu.maxTrampolineCallCount}hijack(e){this.callCount=0,setTimeout(e,0)}}function su(e){return n=>{if(n.cancelToken.isCancelled)n.onCancel(new ou);else if(n.trampoline.incrementAndCheck())n.trampoline.hijack((()=>{try{e(n)}catch(e){n.onError(An(e))}}));else try{e(n)}catch(e){n.onError(An(e))}}}const uu=new class{Bind(e,n){return function(e,n){return su((t=>{e({onSuccess:e=>{try{n(e)(t)}catch(e){t.onError(An(e))}},onError:t.onError,onCancel:t.onCancel,cancelToken:t.cancelToken,trampoline:t.trampoline})}))}(e,n)}Combine(e,n){return this.Bind(e,(()=>n))}Delay(e){return su((n=>e()(n)))}For(e,n){const t=e[Symbol.iterator]();let r=t.next();return this.While((()=>!r.done),this.Delay((()=>{const e=n(r.value);return r=t.next(),e})))}Return(e){return function(e){return su((n=>n.onSuccess(e)))}(e)}ReturnFrom(e){return e}TryFinally(e,n){return su((t=>{e({onSuccess:e=>{n(),t.onSuccess(e)},onError:e=>{n(),t.onError(e)},onCancel:e=>{n(),t.onCancel(e)},cancelToken:t.cancelToken,trampoline:t.trampoline})}))}TryWith(e,n){return su((t=>{e({onSuccess:t.onSuccess,onCancel:t.onCancel,cancelToken:t.cancelToken,trampoline:t.trampoline,onError:e=>{try{n(e)(t)}catch(e){t.onError(An(e))}}})}))}Using(e,n){return this.TryFinally(n(e),(()=>e.Dispose()))}While(e,n){return e()?this.Bind(n,(()=>this.While(e,n))):this.Return(void 0)}Zero(){return su((e=>e.onSuccess(void 0)))}};function lu(e){}const cu=new ru;function au(e,n){return function(e,n){return function(e,n,t,r,o){"function"!=typeof n&&(o=n,n=void 0);const i=new iu;e({onSuccess:n||lu,onError:t||lu,onCancel:r||lu,cancelToken:o||cu,trampoline:i})}(e,n)}(e,n)}class fu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}function du(e,n){const t=nu(function(e){const n=new ru(!1);return n}());return eu((()=>Ys((()=>{t.current.cancel()})))),tu((r=>{var o;null!=(o=t.current)&&o.isCancelled||au(uu.Delay((()=>uu.TryWith(uu.Delay((()=>(n(new fu(1)),uu.Bind(e(r),(e=>(n(new fu(2,e)),uu.Zero())))))),(e=>(n(new fu(3,e)),uu.Zero()))))),t.current)}))}class hu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]}}class mu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Header"]}}class pu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Empty","Text","Binary","Form"]}}class wu extends xn{constructor(e,n,t,r,o,i,s,u){super(),this.url=e,this.method=n,this.headers=t,this.withCredentials=r,this.overridenMimeType=o,this.overridenResponseType=i,this.timeout=s,this.content=u}}class gu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Text","Blob","ArrayBuffer","Unknown"]}}class yu extends xn{constructor(e,n,t,r,o,i){super(),this.statusCode=0|e,this.responseText=n,this.responseType=t,this.responseUrl=r,this.responseHeaders=o,this.content=i}}const _u=new wu("",new hu(0),bt(),!1,void 0,void 0,void 0,new pu(0));function vu(e,n){return"string"!=typeof(t=n)||0===t.length?[n]:ut(n,[e],null,0);var t}function Cu(e){return new wu(e,_u.method,_u.headers,_u.withCredentials,_u.overridenMimeType,_u.overridenResponseType,_u.timeout,_u.content)}function bu(e,n){return new wu(n.url,e,n.headers,n.withCredentials,n.overridenMimeType,n.overridenResponseType,n.timeout,n.content)}function xu(e,n){return new wu(n.url,n.method,n.headers,n.withCredentials,n.overridenMimeType,n.overridenResponseType,n.timeout,e)}function Su(e){return function(e){return su((n=>e([n.onSuccess,n.onError,n.onCancel])))}((n=>{const t=new XMLHttpRequest;t.open(function(e){switch(e.tag){case 1:return"POST";case 3:return"PATCH";case 2:return"PUT";case 4:return"DELETE";case 6:return"OPTIONS";case 5:return"HEAD";default:return"GET"}}(e.method),e.url),t.onreadystatechange=()=>{let e,r,o,i,s,u,l;4===t.readyState&&n[0]((r=t.responseType,e=""===r||"text"===r?t.responseText:"",o=0|t.status,i=t.responseType,u=t.responseType,s=""===u||"text"===u?new gu(0,t.responseText):new gu("arraybuffer"===u?2:"blob"===u?1:3,t.response),l=function(e){const n=$t();return Gr(n,Or(n,e))}(function(e,n,t){const r=[];for(let t=0;t<=n.length-1;t++){const o=e(n[t]);if(null!=o){const e=Tn(o);r.push(e)}}return r}((e=>{const n=Mt(vu(":",e));return Et(n)?void 0:[At(n).toLocaleLowerCase(),ot(":",kt(n)).trim()]}),vu("\r\n",t.getAllResponseHeaders()))),new yu(o,e,i,t.responseURL,l,s)))};const r=Je(e.headers);try{for(;r["System.Collections.IEnumerator.MoveNext"]();){const e=r["System.Collections.Generic.IEnumerator`1.get_Current"]();t.setRequestHeader(e.fields[0],e.fields[1])}}finally{We(r)}t.withCredentials=e.withCredentials;const o=e.overridenMimeType;if(null==o);else{const e=o;t.overrideMimeType(e)}const i=e.overridenResponseType;null==i||(1===i.tag?t.responseType="blob":2===i.tag?t.responseType="arraybuffer":t.responseType="text");const s=e.timeout;if(null==s);else{const e=0|s;t.timeout=0|e}const u=e.content;switch(u.tag){case 1:case 3:case 2:t.send(In(u.fields[0]));break;default:t.send()}}))}function Eu(e){return e}new yu(0,"","","",Jr(),new gu(0,""));const Au=null;function ku(e){return Array.from(e)}function Iu(e){return Pn(e,"O")}function Tu(e){return function(e,n="c",t){if(-1===["c","g","G"].indexOf(n))throw new Error("Custom formats are not supported");const r=Math.abs(function(e){return Ni(e/864e5)}(e)),o=Math.abs(function(e){return Ni(e%864e5/36e5)}(e)),i=Math.abs(function(e){return Ni(e%36e5/6e4)}(e)),s=Math.abs(function(e){return Ni(e%6e4/1e3)}(e)),u=Math.abs(function(e){return Ni(e%1e3)}(e));return`${e<0?"-":""}${0!==r||"c"!==n&&"g"!==n?"c"===n?r+".":r+":":""}${"g"===n?o:Ke(o,2)}:${Ke(i,2)}:${Ke(s,2)}${0!==u||"c"!==n&&"g"!==n?"g"===n?"."+Ke(u,3):"."+function(e,n,t){let r=e.toString(10);for(;r.length<3;)r="0"+r;for(;r.length<7;)r+="0";return r}(u):""}`}(e)}function Nu(){return null}function Fu(e){return Pn(e,"O")}function Ou(e,n){return JSON.stringify(n,yn(2,null),In(e))}function Mu(e,n,t,r){const o=new Sn(null);let i;const s=co(r);let u;if(i=""===s?e:zr(s,o,e),xo(r)){const e=dt((e=>{const r=Mo(n,lo(e)),o=Uu(i,n,t,e[1]);return n=>i=>{const s=n[e[0]];return(!t||t&&null!=s)&&(i[r]=o(s)),i}}),vo(r));u=n=>rr(((e,t)=>t(n)(e)),{},e)}else{if(!bo(r)){let e;const n=co(r);throw e=et(Kn("Cannot generate auto encoder for %s. Please pass an extra encoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders"))(n),new Error(e)}u=e=>{const o=function(e,n){const t=_o(n)[e.tag];if(null==t)throw new Error(`Cannot find case ${e.name} in union type`);return[t,e.fields]}(e,r),s=o[0],u=o[1],l=0|u.length;if(0===l)return lo(s);{const e=0|l,r=Eo(s),o=ft(new Array(e+1),0,e+1,null);o[0]=lo(s);for(let s=1;s<=e;s++){const e=Uu(i,n,t,r[s-1][1]);o[s]=e(u[s-1])}return o}}}return o.contents=u,u}function Uu(e,n,t,r){const o=co(r),i=qr(o,e);if(null==i){if(ao(r)){const o=Uu(e,n,t,fo(r));return e=>ku(ir(o,e))}if(mo(r)){const e=co(wo(r));if("System.SByte"===e)return e=>e;if("System.Byte"===e)return e=>e;if("System.Int16"===e)return e=>e;if("System.UInt16"===e)return e=>e;if("System.Int32"===e)return e=>e;if("System.UInt32"===e)return e=>e;{const e=co(r);return nt(Kn("Cannot generate auto encoder for %s.\nThoth.Json.Net only support the following enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\n\nIf you can't use one of these types, please pass an extra encoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders\n "))(e)}}if(ho(r)){if(So(r)){const o=dt((r=>Uu(e,n,t,r)),Co(r));return e=>ku(sr(((e,n)=>o[e](n)),e))}{const o=co(po(r));if("Microsoft.FSharp.Core.FSharpOption`1[System.Object]"===o){const o=new Xe((()=>{return o=Uu(e,n,t,Kr(r)[0]),e=>{return t=()=>Au,null!=(n=On(o,e))?Tn(n):t();var n,t};var o}));return e=>null==e?Au:o.Value(e)}if("Microsoft.FSharp.Collections.FSharpList`1[System.Object]"===o||"Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"===o||"System.Collections.Generic.IEnumerable`1[System.Object]"===o){const o=Uu(e,n,t,Kr(r)[0]);return e=>ku(ir(o,e))}if("Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"===o){const o=Kr(r)[0],i=Uu(e,n,t,Kr(r)[1]);if("System.String"===co(o)||"System.Guid"===co(o))return e=>rr(((e,n)=>{const t=n;return e[t[0]]=i(t[1]),e}),{},e);{let r;const s=Uu(e,n,t,o);return r=s,e=>ku(ir((e=>{const n=e;return[r(n[0]),i(n[1])]}),e))}}return Mu(e,n,t,r)}}return"System.Boolean"===o?e=>e:"Microsoft.FSharp.Core.Unit"===o?Nu:"System.String"===o?e=>e:"System.Char"===o?e=>e:"System.SByte"===o?e=>e:"System.Byte"===o?e=>e:"System.Int16"===o?e=>e:"System.UInt16"===o?e=>e:"System.Int32"===o?e=>e:"System.UInt32"===o?e=>e:"System.Double"===o?e=>e:"System.Single"===o?e=>e:"System.DateTime"===o?Fu:"System.DateTimeOffset"===o?Iu:"System.TimeSpan"===o?Tu:"System.Guid"===o?Eu:"System.Object"===o?e=>e:Mu(e,n,t,r)}{const e=i;return n=>e.contents(n)}}function Du(e,n,t,r){const o=Fn(n,new To(0)),i=Fn(r,!0);return Uu(function(e){return null!=e?Zr(((e,n)=>new Sn(n[0])),e.Coders):Jr()}(t),o,i,e)}function Pu(e){return`${e}/super-selection/admin`}function Ru(e,n){return uu.Delay((()=>{const t=(r=function(e){return new mu(0,"Authorization",e)}(et(Kn("Bearer %s"))(e)),new wu((o=n).url,o.method,Ut(o.headers,St(r)),o.withCredentials,o.overridenMimeType,o.overridenResponseType,o.timeout,o.content));var r,o;let i;const s=Su(t);return i=uu.Bind(s,(e=>uu.Return(new Ao(0,e)))),uu.Bind(i,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];if(429===e.statusCode||e.statusCode>=500){const e=Su(t);return uu.Bind(e,(e=>uu.Return(new Ao(0,e))))}return uu.Return(new Ao(0,e))}}))}))}function $u(e,n){return uu.Delay((()=>{let t;const r=Ru(n,bu(new hu(0),Cu((t=Pu(e),`${t}/promoted-funds`))));return uu.Bind(r,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];switch(0|e.statusCode){case 200:{const n=ls(yn(2,ks(oo(no("SuperSelection.AdminUI.Dto.PromotedFundOverride",[],Is,(()=>[["PartnerId",so],["AccountId",ro(so)],["Funds",oo(so)]]))),new To(1),void 0)),e.responseText);return uu.Return(n)}case 401:return uu.Return(new Ao(1,"You do not have the appropriate permissions to view this information"));default:return uu.Return(new Ao(1,"Unexpected response from backend"))}}}))}))}function Gu(e,n,t,r){return uu.Delay((()=>{let o;const i=Ru(n,bu(new hu(0),Cu((null==r?e=>`${e}/promoted-funds/${t}`:(o=r,e=>`${e}/promoted-funds/${t}/${o}`))(Pu(e)))));return uu.Bind(i,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];if(200===e.statusCode){const n=ls(yn(2,ks(no("SuperSelection.AdminUI.Dto.PromotedFunds",[],Ts,(()=>[["PartnerFunds",oo(so)],["AccountFunds",oo(so)]])),new To(1),void 0)),e.responseText);return uu.Return(n)}return uu.Return(new Ao(1,"Unexpected response from backend"))}}))}))}function Hu(e,n,t,r){return uu.Delay((()=>{let o;const i=Ru(n,bu(new hu(4),Cu((null==r?e=>`${e}/promoted-funds/${t}`:(o=r,e=>`${e}/promoted-funds/${t}/${o}`))(Pu(e)))));return uu.Bind(i,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];return 200===e.statusCode?uu.Return(new Ao(0,void 0)):uu.Return(new Ao(1,e.responseText))}}))}))}function ju(e,n,t){Ft((t=>{try{t(n)}catch(n){e(n)}}),t)}function Bu(){return bt()}function Lu(e){return St(e)}class Vu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["ColumnHeader"]}}function zu(e){return e.fields[0]}class Wu extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["RowCell"]}}function qu(e){return new Wu(0,e)}function Zu(e){return e.fields[0]}function Ju(e){return n=d("th",wn(Mt([["className","px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"],["scope","col"],["children",e]]))),new Vu(0,n);var n}function Yu(e,n){let t;return qu(d("td",wn(Mt([["className","px-6 py-4 whitespace-nowrap text-sm"],(t=[d("a",{className:"text-indigo-600 hover:text-indigo-900",children:n,href:e})],["children",Ws.Children.toArray(Array.from(t))])]))))}function Xu(e,n){return qu(d("td",{className:ot(" ",nr(e,["px-6","py-4","whitespace-nowrap","text-sm"])),children:n}))}function Ku(e,n){return 0===n.indexOf(e)?n:void 0}function Qu(e,n){return function(e,n){const t=e.lastIndexOf(n);return t>=0&&t===e.length-n.length}(n,e)?n:void 0}function el(e,n){return function(e){return 1===e?e=>{let n,t,r,o,i,s;return n=Ku("/",e),null!=n?(t=n,"#"+t):(r=Ku("#/",e),null!=r?(o=r,o):(i=Ku("#",e),null!=i?(s=i,"#/"+lt(s,1,s.length-1)):"#/"+e))}:e=>{let n,t;return n=Ku("/",e),null!=n?(t=n,t):"/"+e}}(n)(ot("/",Dt((e=>e.indexOf("?")>=0||0===e.indexOf("#")||0===e.indexOf("/")?e:encodeURIComponent(e)),e)))}Js((e=>{const n=tu((n=>{const t=Fn(e.onUrlChanged,(e=>{}));!function(e,n,t){var r,o;n((r=2===e?window.location.pathname+window.location.search:window.location.hash,o=e,function(e,n){let t,r;const o=gt();let i=o,s=n;for(;!_t(s);){let n=e(vt(s));for(;!_t(n);)t=i,r=new pt(vt(n),void 0),t.tail=r,i=r,n=Ct(n);s=Ct(s)}const u=i,l=gt();return u.tail=l,Ct(o)}((e=>{if("string"!=typeof(n=e)||/^\s*$/.test(n))return bt();{const n=function(e,...n){return 0===n.length?e.trimEnd():e.replace(new RegExp("["+qn(n.join(""))+"]+$"),"")}(e,"#");if("?"===n)return bt();if(null!=Ku("?",n))return St(n);{const e=n.split("?");if(mt(((e,n)=>e===n),e,null)||1!==e.length){if(mt(((e,n)=>e===n),e,null)||2!==e.length)return bt();if(""===e[1]){const n=e[0];return St(decodeURIComponent(n))}{const n=e[0],t=e[1];return Mt([decodeURIComponent(n),"?"+t])}}{const n=e[0];return St(decodeURIComponent(n))}}}var n}),Mt(ut(null!=Ku("#",r)?lt(r,1,r.length-1):1!==o||null==Qu("#",r)&&null==Qu("#/",r)?r:"",["/"],null,0)))))}(Fn(e.hashMode,1),t)}));eu((()=>(window.navigator.userAgent.indexOf("Trident")>=0||window.navigator.userAgent.indexOf("MSIE")>=0?window.addEventListener("hashchange",n):window.addEventListener("popstate",n),window.addEventListener("CUSTOM_NAVIGATION_EVENT",n),Ys((()=>{window.navigator.userAgent.indexOf("Trident")>=0||window.navigator.userAgent.indexOf("MSIE")>=0?window.removeEventListener("hashchange",n):window.removeEventListener("popstate",n),window.removeEventListener("CUSTOM_NAVIGATION_EVENT",n)}))))),Qs((()=>{const e=document.createEvent("CustomEvent");e.initEvent("CUSTOM_NAVIGATION_EVENT",!0,!0),window.dispatchEvent(e)}));const t=e.application;return null==t?null:t}),void 0,void 0,void 0);const nl={None:0,LowerFirst:1,SnakeCase:2,SnakeCaseAllCaps:3,KebabCase:4};function tl(e,n){return e.replace(/[a-z]?[A-Z]/g,(e=>1===e.length?e.toLowerCase():e.charAt(0)+n+e.charAt(1).toLowerCase()))}function rl(e,n=nl.None){const t={},r=n;function o(e){throw new Error("Cannot infer key and value of "+String(e))}function i(e,n,r){e=function(e,n){switch(n){case nl.LowerFirst:return e.charAt(0).toLowerCase()+e.slice(1);case nl.SnakeCase:return tl(e,"_");case nl.SnakeCaseAllCaps:return tl(e,"_").toUpperCase();case nl.KebabCase:return tl(e,"-");case nl.None:default:return e}}(e,n),t[e]=r}for(let n of e){let e=nl.None;if(null==n&&o(n),n instanceof bn){const t=n.cases()[n.tag];n=0===n.fields.length?t:[t].concat(n.fields),e=r}if(Array.isArray(n))switch(n.length){case 0:o(n);break;case 1:i(n[0],e,!0);break;case 2:const t=n[1];i(n[0],e,t);break;default:i(n[0],e,n.slice(1))}else"string"==typeof n?i(n,e,!0):o(n)}return t}const ol=ge((function(e,n){return d("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:n},e),d("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))})),il=ge((function(e,n){return d("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:n},e),d("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))}));class sl extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Pencil","Trash"]}}class ul extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["ClassName"]}}function ll(e,n){if(1===e.tag){const e=rl(n,1);return d(ol,e)}{const e=rl(n,1);return d(il,e)}}class cl extends xn{constructor(e,n){super(),this.Text=e,this.Action=n}}class al extends xn{constructor(e,n){super(),this.Text=e,this.Action=n}}class fl extends xn{constructor(e,n){super(),this.Text=e,this.Action=n}}function dl(e,n){return new cl(e.Text,vn(1,e.Action,[n]))}function hl(e,n,t){let r;return d("button",wn(Mt([["className",ot(" ",["mr-2","w-14","px-4","py-2","border","border-transparent","shadow-sm","font-medium","rounded-md","text-white","focus:outline-none","focus:ring-2","focus:ring-offset-2","sm:text-sm",`bg-${n}-600`,`hover:bg-${n}-700`,`focus:ring-${n}-500`])],["type","button"],["onClick",t],(r=[ll(e,St(new ul(0,"mr-3 flex-shrink-0 h-4 w-6")))],["children",Ws.Children.toArray(Array.from(r))])])))}const ml=e=>hl(new sl(0),"indigo",e),pl=e=>hl(new sl(1),"red",e);function wl(e,n){return d("button",{className:ot(" ",["w-full","inline-flex","justify-center","rounded-md","border","border-transparent","shadow-sm","px-4","py-2","text-base","font-medium","text-white","focus:outline-none","focus:ring-2","focus:ring-offset-2","sm:ml-3","sm:w-auto","sm:text-sm",`focus:ring-${e}-500`,`bg-${e}-600`,`hover:bg-${e}-700`]),type:"button",children:n.Text,onClick:n.Action})}function gl(e){return d("button",{className:ot(" ",["mt-3","w-full","inline-flex","justify-center","rounded-md","border","border-gray-300","shadow-sm","px-4","py-2","bg-white","text-base","font-medium","text-gray-700","hover:bg-gray-50","focus:outline-none","focus:ring-2","focus:ring-offset-2","focus:ring-indigo-500","sm:mt-0","sm:ml-3","sm:w-auto","sm:text-sm"]),type:"button",children:e.Text,onClick:e.Action})}function yl(e){return["strokeLinecap",e]}function _l(e){return["strokeLinejoin",e]}const vl=d("div",wn(Mt([["className",ot(" ",["mx-auto","flex-shrink-0","flex","items-center","justify-center","h-12","w-12","rounded-full","bg-red-100","sm:mx-0","sm:h-10","sm:w-10"])],(()=>{let e;const n=[d("svg",wn(Mt([["className",ot(" ",["h-6","w-6","text-red-600"])],["fill","none"],["stroke","currentColor"],["strokeWidth",2],["viewBox","0 0 24 24"],["xmlns","http://www.w3.org/2000/svg"],(e=St(d("path",wn(Mt([yl("round"),_l("round"),["d","M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"]])))),["children",Ws.Children.toArray(Array.from(e))])])))];return["children",Ws.Children.toArray(Array.from(n))]})()]))),Cl=d("div",wn(Mt([["className",ot(" ",["mx-auto","flex-shrink-0","flex","items-center","justify-center","h-12","w-12","rounded-full","bg-indigo-100","sm:mx-0","sm:h-10","sm:w-10"])],(()=>{let e;const n=[d("svg",wn(Mt([["className",ot(" ",["h-6","w-6","text-indigo-600"])],["fill","none"],["stroke","currentColor"],["strokeWidth",2],["viewBox","0 0 24 24"],["xmlns","http://www.w3.org/2000/svg"],(e=St(d("path",wn(Mt([yl("round"),_l("round"),["d","M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"]])))),["children",Ws.Children.toArray(Array.from(e))])])))];return["children",Ws.Children.toArray(Array.from(n))]})()])));function bl(e,n){let t;return d("div",wn(Mt([["className",ot(" ",["bg-gray-50","px-4","py-3","sm:px-6","sm:flex","sm:flex-row-reverse"])],(t=[wl("red",e),gl(n)],["children",Ws.Children.toArray(Array.from(t))])])))}function xl(e){let n;return d("div",wn(Mt([["className","mt-2"],(n=[d("p",{className:ot(" ",["text-sm","text-gray-500"]),children:e})],["children",Ws.Children.toArray(Array.from(n))])])))}function Sl(e,n,t,r){let o,i,s,u;return d("div",wn(Mt([["className",ot(" ",["relative","inline-block","align-bottom","bg-white","rounded-lg","text-left","overflow-hidden","shadow-xl","transform","transition-all","sm:my-8","sm:align-middle","sm:max-w-lg","sm:w-full"])],(o=[d("div",wn(Mt([["className",ot(" ",["bg-white","px-4","pt-5","pb-4","sm:p-6","sm:pb-4"])],(i=[d("div",wn(Mt([["className",ot(" ",["sm:flex","sm:items-start"])],(s=[vl,d("div",wn(Mt([["className",ot(" ",["mt-3","text-center","sm:mt-0","sm:ml-4","sm:text-left"])],(u=[(l=e,d("h3",{className:ot(" ",["text-lg","leading-6","font-medium","text-gray-900"]),id:"modal-title",children:l})),xl(n)],["children",Ws.Children.toArray(Array.from(u))])])))],["children",Ws.Children.toArray(Array.from(s))])])))],["children",Ws.Children.toArray(Array.from(i))])]))),bl(t,r)],["children",Ws.Children.toArray(Array.from(o))])])));var l}function El(e){let n,t,r;return d("div",wn(Mt([["className",ot(" ",["relative","z-10"])],["role",ot(" ",["dialog"])],(n=[d("div",{className:ot(" ",["fixed","inset-0","bg-gray-500","bg-opacity-75","transition-opacity"])}),d("div",wn(Mt([["className",ot(" ",["fixed","z-10","inset-0","overflow-y-auto"])],(t=[d("div",wn(Mt([["className",ot(" ",["flex","min-h-full","items-end","justify-center","p-4","text-center","sm:items-center","sm:p-0"])],(r=[d("span",{className:ot(" ",["hidden","sm:inline-block","sm:align-middle","sm:h-screen"]),children:""}),Sl(e.HeadingText,e.BodyText,e.ConfirmAction,e.CancelAction)],["children",Ws.Children.toArray(Array.from(r))])])))],["children",Ws.Children.toArray(Array.from(t))])])))],["children",Ws.Children.toArray(Array.from(n))])])))}function Al(e,n,t,r,o){const i=function(e,n,t,r){const o=0|mn(e,t);if(0===o)throw new Error("The step of a range cannot be zero");const i=o>0;return t=>{const o=0|mn(t,n);return i&&o<=0||!i&&o>=0?[t,r(t,e)]:void 0}}(n,t,r,o);return Yt((()=>{return n=i,t=e,Zt((()=>function(e,n){let t,r=n;return Wt((()=>{if(null!=t){const e=t[0];return t[1],e}return Bt()}),(()=>{if(t=e(r),null!=t){t[0];const e=t[1];return r=e,!0}return!1}),(()=>{}))}(n,t)));var n,t}))}class kl extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Writable","ReadWritable"]}}class Il{constructor(e){this.state=new kl(0,ft(new Array(pn(dn,e,10)),0,pn(dn,e,10),null),0)}}function Tl(e){const n=e.state;if(1===n.tag){const t=0|n.fields[1],r=0|n.fields[2],o=n.fields[0],i=(r+1)%o.length|0;return e.state=i===t?new kl(0,o,t):new kl(1,o,t,i),In(o[r])}}class Nl extends xn{constructor(e,n,t,r,o,i,s){super(),this.init=e,this.update=n,this.subscribe=t,this.view=r,this.setState=o,this.onError=i,this.syncDispatch=s}}function Fl(e,n){const t=n.init(e),r=t[0],o=new Il(10);let i=!1,s=r;const u=vn(1,n.syncDispatch,[e=>{if(i)!function(e,n){const t=e.state;if(1===t.tag){const i=0|t.fields[1],s=0|t.fields[2],u=t.fields[0];u[i]=n;const l=(i+1)%u.length|0;e.state=l===s?new kl(1,(r=s,o=u,Array.from(Yt((()=>nr(lr(r,o),Yt((()=>{return nr((e=r,n=o,er((()=>Jt(n)),((n,t)=>{if(n<e){if(t["System.Collections.IEnumerator.MoveNext"]())return In(t["System.Collections.Generic.IEnumerator`1.get_Current"]());throw new Error(jt+"\\nParameter name: source")}}),(e=>{We(e)}))),Yt((()=>{return n=e=>Kt(null),e=o.length,t=Al(0,1,e,0,((e,n)=>e+n)),Yt((()=>Xt(ir(n,t))));var e,n,t})));var e,n}))))))),u.length,0):new kl(1,u,l,s)}else{const r=0|t.fields[1],o=t.fields[0];o[r]=n;const i=(r+1)%o.length|0;e.state=new kl(1,o,i,r)}var r,o}(o,e);else{i=!0;let t=In(e);for(;null!=t;){const e=Tn(t);try{const t=n.update(e,s),r=t[0];n.setState(r,u),ju((t=>{n.onError([et(Kn("Error in command while handling: %A"))(e),t])}),u,t[1]),s=r}catch(t){n.onError([et(Kn("Unable to process the message: %A"))(e),t])}t=Tl(o)}i=!1}}]);n.setState(r,u),ju((e=>{n.onError(["Error intitializing:",e])}),u,function(e){const n=gt();let t=n;const r=e=>{t=Tt(((e,n)=>{const t=new pt(n,void 0);return e.tail=t,t}),t,e)};if(Le(e))e.forEach(r);else if(e instanceof pt)Ft(r,e);else{const n=Je(e);try{for(;n["System.Collections.IEnumerator.MoveNext"]();)r(n["System.Collections.Generic.IEnumerator`1.get_Current"]())}finally{We(n)}}const o=t,i=gt();return o.tail=i,Ct(n)}(Mt([(()=>{try{return n.subscribe(r)}catch(e){return n.onError(["Unable to subscribe:",e]),Bu()}})(),t[1]])))}class Ol{constructor(){this.hasDisposedOnce=!1,this.state=void 0,this.listener=void 0,this.dispatcher=void 0}}function Ml(){return new Ol}function Ul(e,n,t,r){Fl(n,function(e,n){return new Nl(n.init,n.update,n.subscribe,n.view,((e,n)=>{!function(e,n,t){e.state=In(n),e.dispatcher=t;const r=e.listener;null!=r&&r(n)}(t,e,n)}),n.onError,n.syncDispatch)}(0,e()));const o=function(e){return e.state}(t);if(null!=o)return Tn(o);throw new Error("Elmish program has not initialized")}function Dl(e,n){return function(e,n,t){const r=Xs(Ml)[0],o=Xs((()=>Ul(e,n,r))),i=o[1];return Ks((()=>(function(e){return e.hasDisposedOnce}(r)&&i(Ul(e,n,r)),Ys((()=>{!function(e){const n=e.state;if(null!=n){const e=Tn(n);ze(e)&&We(e)}e.dispatcher=void 0,e.state=void 0,e.hasDisposedOnce=!0}(r)})))),Fn(t,[])),function(e,n){null==e.listener&&(e.listener=n)}(r,i),[o[0],e=>{!function(e,n){const t=e.dispatcher;null!=t&&t(n)}(r,e)}]}(e,void 0,n)}function Pl(e,n,t){return Dl((()=>function(e,n,t){return new Nl(e,n,(e=>Bu()),t,yn(2,(e=>{const n=vn(1,t,[e]);return e=>{n(e)}})),(e=>{var n,t;n=e[0],t=e[1],console.error(In(n),t)}),yn(2,(e=>e)))}(e,n,((e,n)=>{}))),t)}function Rl(){const e=St(d("span",{children:["Please wait..."]}));return d("div",{children:Ws.Children.toArray(Array.from(e))})}function $l(e){const n=St(d("span",{children:[e.error]}));return d("div",{children:Ws.Children.toArray(Array.from(n))})}class Gl extends xn{constructor(e,n){super(),this.PartnerId=e,this.AccountId=n}}class Hl extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["LoadData","LoadDetail","ShowResetModal","CloseModal","ResetPromotedFunds","Reload"]}}class jl extends xn{constructor(e,n,t,r){super(),this.PromotedFundOverrides=e,this.FundLookup=n,this.User=t,this.ModalState=r}}class Bl extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["ShowModal","Hidden"]}}function Ll(e,n,t){if(null==n);else{const r=n;au(function(e,n,t,r){const o=[n,t];return uu.Delay((()=>{let n;const t=o[1];return n=null==t?void 0:t.fields[0],uu.Bind((i=e.backendUrl,s=e.accessToken,u=o[0].fields[0],l=n,uu.Delay((()=>{let e;const n=Ru(s,bu(new hu(0),Cu((null==l?e=>`${e}/account-registry/${u}`:(e=l,n=>`${n}/account-registry/${u}/${e}`))(Pu(i)))));return uu.Bind(n,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];if(200===e.statusCode){const n=ls(yn(2,ks(no("SuperSelection.AdminUI.Dto.PromotedFundDetail",[],Ms,(()=>[["Partner",no("SuperSelection.AdminUI.Dto.PartnerDetail",[],Us,(()=>[["PartnerId",so],["Name",so]]))],["Account",ro(no("SuperSelection.AdminUI.Dto.AccountDetail",[],Ds,(()=>[["AccountId",so],["Name",so]])))]])),new To(1),void 0)),e.responseText);return uu.Return(n)}return uu.Return(new Ao(1,"Unexpected response from backend"))}}))}))),(e=>(r(new Hl(1,o,new fu(2,e))),uu.Zero())));var i,s,u,l}))}(e,r[0],r[1],t))}}function Vl(e){const n=(t=(e,n)=>an(n,new fu(0))?In(e):void 0,function(e,n){return Tr(n,e.tree)}(e,t));var t;if(null==n)return[e,void 0];{const t=Tn(n);return[Wr(t,(e=>{let n;return null==e?void 0:(n=e,new fu(1))}),e),In(t)]}}function zl(e){let n;return[[new Vs(0,e.PartnerId),(n=e.AccountId,null==n?void 0:new zs(0,n))],new fu(0)]}function Wl(e,n,t){let r,o,i,s,u,l,c;switch(1===n.tag?(r=2,s=n.fields[1],u=n.fields[0]):2===n.tag?(r=3,l=n.fields[0]):3===n.tag?r=4:4===n.tag?(r=5,c=n.fields[0]):5===n.tag?r=6:2===n.fields[0].tag&&0===n.fields[0].fields[0].tag?(r=0,o=n.fields[0].fields[0].fields[0]):(r=1,i=n.fields[0]),r){case 0:return function(e,n,t){const r=Vl(Hr(Dt(zl,t)));return[new jl(new fu(2,new Ao(0,t)),r[0],n.User,n.ModalState),Lu((n=>{Ll(e,r[1],n)}))]}(e,t,o);case 1:return[new jl(i,t.FundLookup,t.User,t.ModalState),Bu()];case 2:return function(e,n,t,r,o){const i=Vl(Wr([t,r],(e=>null!=e?o:void 0),n.FundLookup));return[new jl(n.PromotedFundOverrides,i[0],n.User,n.ModalState),Lu((n=>{Ll(e,i[1],n)}))]}(e,t,u[0],u[1],s);case 3:return[new jl(t.PromotedFundOverrides,t.FundLookup,t.User,new Bl(0,l)),Bu()];case 4:return[new jl(t.PromotedFundOverrides,t.FundLookup,t.User,new Bl(1)),Bu()];case 5:return[new jl(new fu(1),t.FundLookup,t.User,new Bl(1)),Lu((n=>{!function(e,n,t,r){au(function(e,n,t,r){return uu.Delay((()=>uu.Bind(Hu(e.backendUrl,e.accessToken,n,t),(e=>(r(new Hl(5)),uu.Zero())))))}(e,n,t,r))}(e,c.PartnerId,c.AccountId,n)}))];case 6:return[new jl(new fu(1),t.FundLookup,t.User,t.ModalState),Lu((n=>{!function(e,n){au(function(e,n){return uu.Delay((()=>uu.Bind($u(e.backendUrl,e.accessToken),(e=>(n(new Hl(0,new fu(2,e))),uu.Zero())))))}(e,n))}(e,n)}))]}}const ql=Mt([Ju("Partner"),Ju("Account"),Ju("Promoted Funds"),Ju("")]);function Zl(e,n){return el(Mt(["account-registry","partners",e,"accounts",n,"super-configuration"]),1)}function Jl(e){let n;const t=Pl((()=>{return n=e.accessToken,[new jl(new fu(0),Jr(),Bs(n),new Bl(1)),Bu()];var n}),((n,t)=>Wl(e,n,t))),r=t[0],o=t[1];if(Qs(du((()=>function(e){return $u(e.backendUrl,e.accessToken)}(e)),(e=>{o(new Hl(0,e))}))),null==Gs(r.User.Roles))return d($l,{error:"You do not have the appropriate permissions to view this information"});{const e=r.PromotedFundOverrides;let t,i,s,u;switch(1===e.tag?t=0:2===e.tag?0===e.fields[0].tag?(t=3,u=e.fields[0].fields[0]):(t=1,i=e.fields[0].fields[0]):3===e.tag?(t=2,s=e.fields[0]):t=0,t){case 0:return d(Rl,null);case 1:return d($l,{error:i});case 2:return d($l,{error:Cn(s)});case 3:return d("div",wn(St((n=Qt(Yt((()=>nr(Kt(d("h2",{className:"text-xl text-gray-900",children:"Promoted Fund Overrides"})),Yt((()=>nr(Kt(d("p",{className:"mt-2 text-sm text-gray-700",children:"A list of all promoted fund overrides. This does not include accounts or partners that use the default configuration."})),Yt((()=>nr(Kt(function(e,n){let t,r,o,i,s,u,l;return d("div",wn(Mt([["className","flex flex-col mt-4"],(t=[d("div",wn(Mt([["className","-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"],(r=[d("div",wn(Mt([["className","py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"],(o=[d("div",wn(Mt([["className","shadow overflow-hidden border-b border-gray-200 sm:rounded-lg"],(i=[d("table",wn(Mt([["className","min-w-full divide-y divide-gray-200"],(s=[d("thead",{className:"bg-gray-50",children:(u=ir(zu,e),d("tr",{children:Ws.Children.toArray(Array.from(u))}))}),(l=sr(((e,n)=>(n=>{let t;return d("tr",wn(Mt([["className",e%2==0?"bg-white":"bg-gray-50"],(t=ir(Zu,n),["children",Ws.Children.toArray(Array.from(t))])])))})(n)),n),d("tbody",{children:Ws.Children.toArray(Array.from(l))}))],["children",Ws.Children.toArray(Array.from(s))])])))],["children",Ws.Children.toArray(Array.from(i))])])))],["children",Ws.Children.toArray(Array.from(o))])])))],["children",Ws.Children.toArray(Array.from(r))])])))],["children",Ws.Children.toArray(Array.from(t))])])))}(ql,Dt((e=>function(e,n,t){return Qt(Yt((()=>{let r;const o=function(e,n){const t=Vr(e,[new Vs(0,n.PartnerId),(r=n.AccountId,On((e=>new zs(0,e)),r))]);var r;let o,i;switch(null!=t&&2===t.tag&&0===t.fields[0].tag?(o=0,i=t.fields[0].fields[0]):o=1,o){case 0:return i;case 1:return}}(e,t),i=function(e,n){let t;return Fn((t=n,null==t?void 0:t.Partner.Name),e)}(t.PartnerId,o),s=function(e,n){let t,r;return t=n,null==(o=null==t?void 0:(r=t.Account,null==r?void 0:r.Name))?e:o;var o}(t.AccountId,o);return nr(Kt((r=[(u=t.PartnerId,el(Mt(["account-registry","partners",u,"super-configuration"]),1)),i],Yu(r[0],r[1]))),Yt((()=>{let e,r,o,i;return nr((e=[t.AccountId,s],null!=e[0]&&null!=e[1]?(r=e[0],o=e[1],Kt((i=[Zl(t.PartnerId,r),o],Yu(i[0],i[1])))):Kt(Xu(["text-gray-500"],"-"))),Yt((()=>nr(Kt(Xu(["text-gray-500"],ot(", ",t.Funds))),Yt((()=>{return Kt((e=pl((e=>{n(new Hl(2,new Gl(t.PartnerId,t.AccountId)))})),qu(d("td",{className:ot(" ",["flex justify-center py-2"]),children:Ws.Children.toArray([e])}))));var e}))))))})));var u})))}(r.FundLookup,o,e)),u))),Yt((()=>{const e=r.ModalState;return 0===e.tag?Kt(function(e,n){let t;const r=e.AccountId;return t=null==r?`Partner: ${e.PartnerId}`:`Account: ${r}`,d(El,{BodyText:`Are you sure you want to reset the current promoted funds for ${t}? This action cannot be undone.`,CancelAction:new al("Cancel",(e=>{n(new Hl(3))})),ConfirmAction:new cl("Reset",(t=>{n(new Hl(4,e))})),HeadingText:"Reset Promoted Funds"})}(e.fields[0],o)):Kt(null)})))))))))))),["children",Ws.Children.toArray(Array.from(n))]))))}}}class Yl extends xn{constructor(e,n,t){super(),this.Id=e,this.PartnerId=n,this.Enabled=t}}const Xl=Mt(["BringYourOwnFundCustomStep","FeaturedFunds"]);class Kl extends xn{constructor(e,n){super(),this.PromotedFunds=e,this.FeatureFlags=n}}class Ql extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Account","Partner"]}}class ec extends xn{constructor(e,n,t){super(),this.Data=e,this.User=n,this.ModalState=t}}class nc extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["ResetModal","EditModal","Hidden"]}}class tc extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["DefaultUsi","FeatureSet","PromotedFunds","FeatureFlag"]}}class rc extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["LoadData","ShowEditModal","ShowResetModal","ShowFeatureFlagModal","EnableFeatureFlag","DisableFeatureFlag","CloseModal","UpdateDefaultUsi","UpdateFeatureSet","UpdatePromotedFunds","ResetDefaultUsi","ResetPromotedFunds","PromotedFundsUpdate","FeatureFlagUpdate"]}}class oc extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["Default","Inherited","Config"]}}function ic(e){switch(e.tag){case 1:return e.fields[0]+" (inherited)";case 2:return e.fields[0];default:return e.fields[0]+" (default)"}}function sc(e){switch(e.tag){case 1:default:return"";case 2:return e.fields[0]}}class uc extends xn{constructor(e,n,t,r,o,i){super(),this.UpdatePromotedFunds=e,this.DeletePromotedFunds=n,this.UpdateDefaultFundUsi=t,this.UpdateFeatureSet=r,this.UpdateFeatureFlag=o,this.ReloadData=i}}class lc extends bn{constructor(e,...n){super(),this.tag=0|e,this.fields=n}cases(){return["TextInput","Select"]}}function cc(e,n,t,r){let o,i;return d("div",wn(Mt([["className","mt-2 w-full h-full"],(o=[d("div",wn(Mt([["className","h-30"],(i=Qt(Yt((()=>nr(Kt(d("label",{className:"sr-only text-base",htmlFor:"field",children:n})),Yt((()=>{let n;const o=r;return 1===o.tag?Kt(d("select",wn(Mt([["name","field"],["id","field"],["className","shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-base border-gray-300 rounded-md"],["value",t],["onChange",n=>{e(n.target.value)}],(n=Dt((e=>d("option",{value:e,children:e})),o.fields[0]),["children",Ws.Children.toArray(Array.from(n))])])))):Kt(d("input",{type:"text",name:"field",id:"field",className:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-base border-gray-300 rounded-md",value:t,onChange:n=>{e(n.target.value)}}))})))))),["children",Ws.Children.toArray(Array.from(i))])])))],["children",Ws.Children.toArray(Array.from(o))])])))}function ac(e,n){let t;return d("div",wn(Mt([["className",ot(" ",["bg-gray-50","px-4","py-3","sm:px-6","sm:flex","sm:flex-row-reverse"])],(t=[wl("indigo",e),gl(n)],["children",Ws.Children.toArray(Array.from(t))])])))}function fc(e){let n,t,r,o,i,s,u;const l=(c=e.FieldValue,Ws.useState(c));var c;const a=l[0],f=dl(e.ConfirmAction,a);return d("div",wn(Mt([["className",ot(" ",["relative","z-10"])],["role",ot(" ",["dialog"])],(n=[d("div",{className:ot(" ",["fixed","inset-0","bg-gray-500","bg-opacity-75","transition-opacity"])}),d("div",wn(Mt([["className",ot(" ",["fixed","z-10","inset-0","overflow-y-auto"])],(t=[d("div",wn(Mt([["className",ot(" ",["flex","min-h-full","items-end","justify-center","p-4","text-center","sm:items-center","sm:p-0"])],(r=[d("span",{className:ot(" ",["hidden","sm:inline-block","sm:align-middle","sm:h-screen"]),children:""}),d("div",wn(Mt([["className",ot(" ",["relative","inline-block","align-bottom","bg-white","rounded-lg","text-left","overflow-hidden","shadow-xl","transform","transition-all","sm:my-8","sm:align-middle","sm:max-w-lg","sm:w-full"])],(o=[d("div",wn(Mt([["className",ot(" ",["bg-white","px-4","pt-5","pb-4","sm:p-6","sm:pb-4"])],(i=[d("div",wn(Mt([["className",ot(" ",["sm:flex","sm:items-start"])],(s=[Cl,d("div",wn(Mt([["className",ot(" ",["mt-3","text-center","sm:mt-0","sm:ml-4","sm:text-left","w-full"])],(u=[(h=e.HeadingText,d("h3",{className:ot(" ",["text-lg","leading-6","font-medium","text-gray-900"]),id:"modal-title",children:h})),cc(l[1],e.FieldName,a,e.FieldType)],["children",Ws.Children.toArray(Array.from(u))])])))],["children",Ws.Children.toArray(Array.from(s))])])))],["children",Ws.Children.toArray(Array.from(i))])]))),ac(f,e.CancelAction)],["children",Ws.Children.toArray(Array.from(o))])])))],["children",Ws.Children.toArray(Array.from(r))])])))],["children",Ws.Children.toArray(Array.from(t))])])))],["children",Ws.Children.toArray(Array.from(n))])])));var h}function dc(e){let n,t,r;return d("div",wn(Mt([["className","mt-2 w-full h-full"],(n=[d("div",wn(Mt([["className","h-30"],(t=[d("p",{className:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-base border-gray-300 rounded-md",value:e}),d("div",wn(Mt([["className","mt-2"],(r=[d("p",{className:"text-sm text-gray-500",children:e})],["children",Ws.Children.toArray(Array.from(r))])])))],["children",Ws.Children.toArray(Array.from(t))])])))],["children",Ws.Children.toArray(Array.from(n))])])))}function hc(e,n){let t;return d("div",wn(Mt([["className",ot(" ",["bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"])],(t=[wl("indigo",e),gl(n)],["children",Ws.Children.toArray(Array.from(t))])])))}function mc(e){let n,t,r,o,i,s,u;const l=dl(e.ConfirmAction,"");return d("div",wn(Mt([["className","relative z-10"],["role",ot(" ",["dialog"])],(n=[d("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"}),d("div",wn(Mt([["className","fixed z-10 inset-0 overflow-y-auto"],(t=[d("div",wn(Mt([["className","flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"],(r=[d("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen",children:""}),d("div",wn(Mt([["className","relative inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"],(o=[d("div",wn(Mt([["className","bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"],(i=[d("div",wn(Mt([["className","sm:flex sm:items-start"],(s=[Cl,d("div",wn(Mt([["className","mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"],(u=[(c=e.HeadingText,d("h3",{className:ot(" ",["text-lg leading-6 font-medium text-gray-900"]),id:"modal-title",children:c})),dc(e.Subtext)],["children",Ws.Children.toArray(Array.from(u))])])))],["children",Ws.Children.toArray(Array.from(s))])])))],["children",Ws.Children.toArray(Array.from(i))])]))),hc(l,e.CancelAction)],["children",Ws.Children.toArray(Array.from(o))])])))],["children",Ws.Children.toArray(Array.from(r))])])))],["children",Ws.Children.toArray(Array.from(t))])])))],["children",Ws.Children.toArray(Array.from(n))])])));var c}function pc(e,n){return d(fc,{CancelAction:new al("Cancel",(e=>{n(new rc(6))})),ConfirmAction:new fl("Save",((e,t)=>{n(new rc(9,e))})),FieldName:"Promoted Funds",FieldType:new lc(0),FieldValue:e,HeadingText:"Edit Promoted Funds"})}function wc(e,n){const t=e.Enabled?["Disable",e=>new rc(5,e)]:["Enable",e=>new rc(4,e)],r=t[0];return d(mc,{CancelAction:new al("Cancel",(e=>{n(new rc(6))})),ConfirmAction:new fl(r,((r,o)=>{n(t[1](e))})),HeadingText:e.Id,Subtext:`This will ${r.toLocaleLowerCase()} the ${e.Id} feature`})}function gc(e){return d(El,{BodyText:"Are you sure you want to reset the current promoted funds? This action cannot be undone.",CancelAction:new al("Cancel",(n=>{e(new rc(6))})),ConfirmAction:new cl("Reset",(n=>{e(new rc(11))})),HeadingText:"Reset Promoted Funds"})}function yc(e,n){au(e.ReloadData(n))}function _c(e,n,t,r){return uu.Delay((()=>{const o=Gu(e,n,t,r);return uu.Bind(o,(t=>{const o=t;if(1===o.tag)return uu.Return(new Ao(1,o.fields[0]));{const t=function(e,n,t){return uu.Delay((()=>{let r;const o=Ru(n,bu(new hu(0),Cu((r=Pu(e),`${r}/configurations/${t}`))));return uu.Bind(o,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];switch(0|e.statusCode){case 200:{const n=ls(yn(2,ks(no("SuperSelection.AdminUI.Dto.AccountConfiguration",[],Ns,(()=>[["DefaultFundUSI",ro(so)],["FeatureSet",Os()]])),new To(1),void 0)),e.responseText);return uu.Return(n)}case 404:{const e=new Ao(0,new Ns(void 0,new Fs(1)));return uu.Return(e)}default:return uu.Return(new Ao(1,"Unexpected response from backend"))}}}))}))}(e,n,r);return uu.Bind(t,(e=>{let n;const t=e;return n=1===t.tag?new Ao(1,t.fields[0]):new Ao(0,new Ql(0,new Ls(o.fields[0],t.fields[0]))),uu.Return(n)}))}}))}))}function vc(e,n,t){return uu.Delay((()=>{const r=Gu(e,n,t,void 0);return uu.Bind(r,(r=>{const o=r;if(1===o.tag)return uu.Return(new Ao(1,o.fields[0]));{const r=function(e,n,t){return uu.Delay((()=>{let r;const o=Ru(n,bu(new hu(0),Cu((r=Pu(e),`${r}/partner/${t}/feature-flags`))));return uu.Bind(o,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];switch(0|e.statusCode){case 200:{let n;const t=ls(yn(2,ks(to(["Items",oo(no("SuperSelection.AdminUI.Dto.FeatureFlag",[],Ps,(()=>[["Id",so],["PartnerId",so],["Enabled",uo],["Editor",so]])))]),new To(1),void 0)),e.responseText);return n=uu.Return(t),uu.Bind(n,(e=>{let n;const t=e;return n=1===t.tag?new Ao(1,t.fields[0]):new Ao(0,t.fields[0].Items),uu.Return(n)}))}case 404:return uu.Return(new Ao(0,bt()));default:return uu.Return(new Ao(1,"Unexpected response from backend"))}}}))}))}(e,n,t);return uu.Bind(r,(e=>{let n;const r=e;var i,s;return n=1===r.tag?new Ao(1,r.fields[0]):new Ao(0,new Ql(1,new Kl(o.fields[0],(i=t,s=r.fields[0],Dt((e=>{const n=Pt((n=>n.Id===e),s);if(null==n)return new Yl(e,i,!1);{const e=n;return new Yl(e.Id,i,e.Enabled)}}),Xl))))),uu.Return(n)}))}}))}))}function Cc(e){return new uc(((n,t)=>function(e,n,t){return uu.Delay((()=>uu.Bind(function(e,n,t,r,o){return uu.Delay((()=>{let i;const s=(null==r?e=>`${e}/promoted-funds/${t}`:(i=r,e=>`${e}/promoted-funds/${t}/${i}`))(Pu(e)),u=Ru(n,bu(new hu(1),xu(new pu(1,Ou(0,Du(to(["Funds",oo(so)]),new To(1),void 0,void 0)(o))),Cu(s))));return uu.Bind(u,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];return 200===e.statusCode?uu.Return(new Ao(0,void 0)):uu.Return(new Ao(1,e.responseText))}}))}))}(e.backendUrl,e.accessToken,e.partnerId,e.accountId,n),(e=>(t(new rc(12,e)),uu.Zero())))))}(e,n,t)),(n=>function(e,n){return uu.Delay((()=>uu.Bind(Hu(e.backendUrl,e.accessToken,e.partnerId,e.accountId),(e=>(n(new rc(12,e)),uu.Zero())))))}(e,n)),((n,t)=>function(e,n,t){return uu.Delay((()=>{const r=e.accountId;if(null==r)return uu.Zero();{const o=r;return uu.Bind(function(e,n,t,r){return uu.Delay((()=>{let o,i;const s=Ru(n,bu(new hu(2),xu(new pu(1,(o={DefaultFundUsi:r},Ou(0,Du(to(["DefaultFundUsi",so]),new To(1),void 0,void 0)(o)))),Cu((i=Pu(e),`${i}/configurations/${t}/default-fund-usi`)))));return uu.Bind(s,(e=>{const n=e;return 1===n.tag?uu.Return(new Ao(1,n.fields[0])):200===n.fields[0].statusCode?uu.Return(new Ao(0,void 0)):uu.Return(new Ao(1,"Unexpected response from backend"))}))}))}(e.backendUrl,e.accessToken,o,n),(e=>(t(new rc(12,e)),uu.Zero())))}}))}(e,n,t)),((n,t)=>function(e,n,t){return uu.Delay((()=>{const r=e.accountId;if(null==r)return uu.Zero();{const o=r;return uu.Bind(function(e,n,t,r){return uu.Delay((()=>{let o,i;const s=Ru(n,bu(new hu(2),xu(new pu(1,(o={FeatureSet:r},Ou(0,Du(to(["FeatureSet",Os()]),new To(1),void 0,void 0)(o)))),Cu((i=Pu(e),`${i}/configurations/${t}/feature-set`)))));return uu.Bind(s,(e=>{const n=e;return 1===n.tag?uu.Return(new Ao(1,n.fields[0])):200===n.fields[0].statusCode?uu.Return(new Ao(0,void 0)):uu.Return(new Ao(1,"Unexpected response from backend"))}))}))}(e.backendUrl,e.accessToken,o,n),(e=>(t(new rc(12,e)),uu.Zero())))}}))}(e,n,t)),((n,t)=>function(e,n,t,r){return uu.Delay((()=>uu.Bind(function(e,n,t,r,o){return uu.Delay((()=>{let i;const s=`${Pu(e)}/partner/${t}/feature-flags/${r}`,u=Ru(n,bu(new hu(2),xu(new pu(1,(i={Enabled:o,PartnerId:t},Ou(0,Du(to(["Enabled",uo],["PartnerId",so]),new To(1),void 0,void 0)(i)))),Cu(s))));return uu.Bind(u,(e=>{const n=e;if(1===n.tag)return uu.Return(new Ao(1,n.fields[0]));{const e=n.fields[0];return 200===e.statusCode?uu.Return(new Ao(0,void 0)):uu.Return(new Ao(1,e.responseText))}}))}))}(e.backendUrl,e.accessToken,e.partnerId,n,t),(e=>(r(new rc(13,e)),uu.Zero())))))}(e,n[0],n[1],t)),(n=>function(e,n){return uu.Delay((()=>{let t;return uu.Bind((t=e.accountId,null==t?vc(e.backendUrl,e.accessToken,e.partnerId):_c(e.backendUrl,e.accessToken,e.partnerId,t)),(e=>(n(new rc(0,new fu(2,e))),uu.Zero())))}))}(e,n)))}function bc(e,n,t,r){let o,i,s,u,l;const c=Mt(Nn((o=t,null==o?void 0:ml(o)))),a=Mt(Nn((i=r,null==i?void 0:pl(i))));return d("div",wn(Mt([["className",ot(" ",["px-4","py-5","sm:grid","sm:grid-cols-5","sm:gap-4","sm:px-6"])],(s=[d("dt",{className:ot(" ",["text-sm","font-medium","text-gray-500"]),children:e}),d("dd",wn(Mt([["className",ot(" ",["mt-1","text-sm","text-gray-900","sm:mt-0","sm:col-span-2"])],(u=[d("span",{className:"flex-grow",children:n})],["children",Ws.Children.toArray(Array.from(u))])]))),d("span",wn(Mt([["className","flex-grow"],(l=Qt(Yt((()=>nr(c,Yt((()=>a)))))),["children",Ws.Children.toArray(Array.from(l))])])))],["children",Ws.Children.toArray(Array.from(s))])])))}function xc(e,n,t){return bc("Default USI",n,null!=(r=e,Rt(new Rs(0,"SuperSelection.ChangeDefaultFund"),r,{Equals:an,GetHashCode:un})?In(void 0):void 0)?e=>{t(new rc(1,new tc(0)))}:void 0,void 0);var r}function Sc(e,n,t){const r=null!=(o=e,Rt(new Rs(0,"SuperSelection.ChangeFeatureSet"),o,{Equals:an,GetHashCode:un})?In(void 0):void 0)?e=>{t(new rc(1,new tc(1)))}:void 0;var o;return bc("Feature Set",Cn(n),r,void 0)}function Ec(e,n,t){return bc("Funds",n,null!=Hs(e)?e=>{t(new rc(1,new tc(2)))}:void 0,null!=Hs(e)?e=>{t(new rc(2,new tc(2)))}:void 0)}function Ac(e){let n;return d("div",wn(Mt([["className",ot(" ",["px-4 py-4 sm:px-0"])],(n=[d("h3",{className:ot(" ",["text-lg font-semibold leading-7 text-gray-900"]),children:e})],["children",Ws.Children.toArray(Array.from(n))])])))}function kc(e){let n,t;const r=Pl((()=>{return n=e.accessToken,[new ec(new fu(0),Bs(n),new nc(2)),Bu()];var n}),yn(2,(n=Cc(e),e=>t=>function(e,n,t){switch(n.tag){case 1:return[new ec(t.Data,t.User,new nc(1,n.fields[0])),Bu()];case 2:return[new ec(t.Data,t.User,new nc(0,n.fields[0])),Bu()];case 6:case 10:return[new ec(t.Data,t.User,new nc(2)),Bu()];case 7:return[new ec(t.Data,t.User,new nc(2)),Lu((t=>{au(e.UpdateDefaultFundUsi(n.fields[0],t))}))];case 8:return[new ec(t.Data,t.User,new nc(2)),Lu((t=>{au(e.UpdateFeatureSet(n.fields[0],t))}))];case 9:{const r=Mt(dt((e=>e.trim()),ut(n.fields[0],[","],null,0)));return[new ec(t.Data,t.User,new nc(2)),Lu((n=>{au(e.UpdatePromotedFunds({Funds:r},n))}))]}case 11:return[new ec(t.Data,t.User,new nc(2)),Lu((n=>{au(e.DeletePromotedFunds(n))}))];case 12:return[new ec(new fu(1),t.User,t.ModalState),Lu((n=>{yc(e,n)}))];case 3:return[new ec(t.Data,t.User,new nc(1,new tc(3,n.fields[0]))),Bu()];case 4:return[new ec(t.Data,t.User,new nc(2)),Lu((t=>{au(e.UpdateFeatureFlag([n.fields[0].Id,!0],t))}))];case 5:return[new ec(t.Data,t.User,new nc(2)),Lu((t=>{au(e.UpdateFeatureFlag([n.fields[0].Id,!1],t))}))];case 13:return[new ec(new fu(1),t.User,t.ModalState),Lu((n=>{yc(e,n)}))];default:return[new ec(n.fields[0],t.User,t.ModalState),Bu()]}}(n,e,t)))),o=r[0],i=r[1];Qs(du((()=>function(e){const n=e.accountId;return null==n?vc(e.backendUrl,e.accessToken,e.partnerId):_c(e.backendUrl,e.accessToken,e.partnerId,n)}(e)),(e=>{i(new rc(0,e))})));const s=o.User.Roles;if(null==Gs(s))return d($l,{error:"You do not have the appropriate permissions to view this information"});{const e=o.Data;let n,r,u,l;switch(1===e.tag?n=0:2===e.tag?1===e.fields[0].tag?(n=2,u=e.fields[0].fields[0]):(n=1,r=e.fields[0].fields[0]):3===e.tag?(n=3,l=e.fields[0]):n=0,n){case 0:return d(Rl,null);case 1:if(1===r.tag){const e=r.fields[0],n=Qt(Yt((()=>{let n;const t=function(e){const n=e.PartnerFunds;return Et(n)?new oc(0,"mercermychoice"):new oc(2,ot(", ",n))}(e.PromotedFunds),r=Qt(Yt((()=>ir((e=>function(e,n,t){let r,o,i;const s=null!=Hs(e)?e=>{t(new rc(3,n))}:e=>{},u=!(null!=Hs(e)),l=d("button",wn(Mt([["className",ot(" ",Qt(Yt((()=>nr(Kt("relative inline-flex h-6 w-11 gap-4 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2"),Yt((()=>nr(Kt(u?"cursor-not-allowed":""),Yt((()=>n.Enabled?Kt("bg-indigo-600"):Kt("bg-gray-300")))))))))))],["role",ot(" ",["switch"])],["type","button"],["onClick",s],(r=[d("span",{className:ot(" ",Qt(Yt((()=>nr(Kt("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out"),Yt((()=>n.Enabled?Kt("translate-x-5"):Kt("translate-x-0"))))))))})],["children",Ws.Children.toArray(Array.from(r))])])));return d("div",wn(Mt([["className",ot(" ",["px-4 py-5 sm:grid sm:grid-cols-5 sm:gap-4 sm:px-6"])],(o=[d("dt",{className:ot(" ",["text-sm font-medium text-gray-500"]),children:n.Id}),d("dd",wn(Mt([["className",ot(" ",["mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"])],(i=[d("span",{className:"flex-grow",children:Ws.Children.toArray([l])})],["children",Ws.Children.toArray(Array.from(i))])])))],["children",Ws.Children.toArray(Array.from(o))])])))}(s,e,i)),e.FeatureFlags))));return Kt(d("div",wn(St((n=Qt(Yt((()=>{let e,n,u;return nr(Kt(d("div",wn(St((e=[Ac("Promoted Funds"),(n=St(Ec(s,ic(t),i)),d("dl",{children:Ws.Children.toArray(Array.from(n))})),Ac("Feature Flags"),(u=Qt(Yt((()=>r))),d("dl",{children:Ws.Children.toArray(Array.from(u))}))],["children",Ws.Children.toArray(Array.from(e))]))))),Yt((()=>{const e=o.ModalState;switch(e.tag){case 1:{const n=e.fields[0];switch(n.tag){case 1:default:return Kt(null);case 2:return Kt(pc(sc(t),i));case 3:return Kt(wc(n.fields[0],i))}}case 2:return Kt(null);default:switch(e.fields[0].tag){case 1:case 3:default:return Kt(null);case 2:return Kt(gc(i))}}})))}))),["children",Ws.Children.toArray(Array.from(n))])))))})));return d("div",{children:Ws.Children.toArray(Array.from(n))})}{const e=r.fields[0],n=Fn(e.Configuration.DefaultFundUSI,"-"),u=Fn(e.Configuration.DefaultFundUSI,""),l=function(e){const n=[e.PartnerFunds,e.AccountFunds];let t,r;switch(Et(n[0])?Et(n[1])?t=0:(t=2,r=n[1]):Et(n[1])?t=1:(t=2,r=n[1]),t){case 0:return new oc(0,"mercermychoice");case 1:return new oc(1,ot(", ",n[0]));case 2:return new oc(2,ot(", ",r))}}(e.PromotedFunds);return d("div",wn(St((t=Qt(Yt((()=>{let t,r;return nr(Kt(d("div",wn(St((t=[(r=Mt([xc(s,n,i),Sc(s,e.Configuration.FeatureSet,i),Ec(s,ic(l),i)]),d("dl",{children:Ws.Children.toArray(Array.from(r))}))],["children",Ws.Children.toArray(Array.from(t))]))))),Yt((()=>{const n=o.ModalState;switch(n.tag){case 1:{const t=n.fields[0];switch(t.tag){case 1:return Kt(function(e,n){return d(fc,{CancelAction:new al("Cancel",(e=>{n(new rc(6))})),ConfirmAction:new fl("Save",((e,t)=>{n(new rc(8,new Fs("Basic"===e?0:1)))})),FieldName:"Feature Set",FieldType:new lc(1,Mt(["Promoted","Basic"])),FieldValue:Cn(e),HeadingText:"Change Feature Set"})}(e.Configuration.FeatureSet,i));case 2:return Kt(pc(sc(l),i));case 3:return Kt(wc(t.fields[0],i));default:return Kt(function(e,n){return d(fc,{CancelAction:new al("Cancel",(e=>{n(new rc(6))})),ConfirmAction:new fl("Save",((e,t)=>{n(new rc(7,e))})),FieldName:"Default USI",FieldType:new lc(0),FieldValue:e,HeadingText:"Edit Default USI"})}(u,i))}}case 2:return Kt(null);default:switch(n.fields[0].tag){case 1:case 3:return Kt(null);case 2:return Kt(gc(i));default:return Kt(function(e){return d(El,{BodyText:"Are you sure you want to reset the current Default USI? This action cannot be undone.",CancelAction:new al("Cancel",(n=>{e(new rc(6))})),ConfirmAction:new cl("Reset",(n=>{e(new rc(10))})),HeadingText:"Reset Default USI"})}(i))}}})))}))),["children",Ws.Children.toArray(Array.from(t))]))))}case 2:return d($l,{error:u});case 3:return d($l,{error:Cn(l)})}}}V((e=>d(Jl,e)),"superhero-super-selection"),V((e=>d(kc,e)),"superhero-super-configuration")})();
|