diff --git a/build/.circleci/config.yml b/build/.circleci/config.yml new file mode 100644 index 0000000..e6d068e --- /dev/null +++ b/build/.circleci/config.yml @@ -0,0 +1,10 @@ +# Circle CI 2.0 Config File +# This config file will prevent tests from being run on the gh-pages branch. +version: 2 +jobs: + build: + machine: true + branches: + ignore: gh-pages + steps: + -run: echo "Skipping tests on gh-pages branch" diff --git a/build/.nojekyll b/build/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/build/004bd376.a6decadd.js b/build/004bd376.a6decadd.js deleted file mode 100644 index 5bc0dad..0000000 --- a/build/004bd376.a6decadd.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{58:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return s})),n.d(t,"rightToc",(function(){return d})),n.d(t,"default",(function(){return l}));var r=n(2),a=n(6),o=(n(0),n(93)),c=["components"],i={id:"advanced-concepts",title:"Advanced concepts"},s={unversionedId:"advanced-concepts",id:"advanced-concepts",isDocsHomePage:!1,title:"Advanced concepts",description:"Deriving state from external sources",source:"@site/main/docs/advanced-concepts.md",slug:"/advanced-concepts",permalink:"/docs/advanced-concepts",editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/advanced-concepts.md",version:"current",sidebar:"docs",previous:{title:"Streams",permalink:"/docs/streams"},next:{title:"Introduction",permalink:"/docs/framework-integrations/introduction"}},d=[{value:"Deriving state from external sources",id:"deriving-state-from-external-sources",children:[]},{value:"Enhanced atoms",id:"enhanced-atoms",children:[]}],p={rightToc:d},u="wrapper";function l(e){var t=e.components,n=Object(a.a)(e,c);return Object(o.b)(u,Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("h2",{id:"deriving-state-from-external-sources"},"Deriving state from external sources"),Object(o.b)("p",null,"With an additional overload of the ",Object(o.b)("inlineCode",{parentName:"p"},"read")," function, you can consume external (non-",Object(o.b)("strong",{parentName:"p"},"xoid"),") sources. This can be a Redux store, an RxJS observable, or anything that implements getState & subscribe pair. Here is an atom that derives its state from a Redux store:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"import store from './reduxStore'\n\nconst derivedAtom = create((read) => read(store.getState, store.subscribe))\n")),Object(o.b)("p",null,"As long as the external source implements a getState & subscribe, pair, it can be consumed by ",Object(o.b)("strong",{parentName:"p"},"xoid"),"."),Object(o.b)("h2",{id:"enhanced-atoms"},"Enhanced atoms"),Object(o.b)("p",null,"An enhanced atom is an atom whose default ",Object(o.b)("inlineCode",{parentName:"p"},".set"),' method is swapped with something else. This technique can be used to create "pass through atoms" that act as a mediators. Most people using ',Object(o.b)("strong",{parentName:"p"},"xoid")," will not need to write enhanced atoms.\nThis naming is inspired by Redux's concept of enhancers. For a real-life scenario, see ",Object(o.b)("a",{parentName:"p",href:"recipes/redux-interop"},"Using in an existing Redux App"),"."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"import store from './reduxStore'\n\nconst $mediator = create((read) => read(store.getState, store.subscribe))\n\n// we swap the default`.set` method\n$mediator.set = (value: number) => store.dispatch({ type: 'ACTION', payload: value })\n\n$mediator.update(s => s + 1) // modifications to `$mediator` will be directly forwarded to Redux dispatch.\n")),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"Swapping ",Object(o.b)("inlineCode",{parentName:"p"},".set")," also modifies the behavior of ",Object(o.b)("inlineCode",{parentName:"p"},".update"),", because it uses ",Object(o.b)("inlineCode",{parentName:"p"},".set")," internally. This is an intentional feature.")))}l.isMDXComponent=!0},93:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return f}));var r=n(0),a=n.n(r);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var d=a.a.createContext({}),p=function(e){var t=a.a.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=p(e.components);return a.a.createElement(d.Provider,{value:t},e.children)},l="mdxType",b={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},m=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,c=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),u=p(n),l=r,m=u["".concat(c,".").concat(l)]||u[l]||b[l]||o;return n?a.a.createElement(m,i(i({ref:t},d),{},{components:n})):a.a.createElement(m,i({ref:t},d))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,c=new Array(o);c[0]=m;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[l]="string"==typeof e?e:r,c[1]=i;for(var d=2;d {\n const atom = create(state)\n const dispatch = (action) => atom.update((s) => reducer(s, action))\n return { atom, dispatch }\n}\n")),Object(o.b)("p",null,"Let's take this simple reducer:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},'const types = { increase: "INCREASE", decrease: "DECREASE" }\n\nconst counterReducer = (state, { type, by }) => {\n switch (type) {\n case types.increase: return {\n ...state,\n count: state.count + by \n }\n case types.decrease: return {\n ...state,\n count: state.count - by\n }\n }\n}\n')),Object(o.b)("p",null,"Usage:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"const { atom, dispatch } = createStore({ count: 0 }, counterReducer)\n\ndispatch({ type: types.increase, by: 1 })\n")),Object(o.b)("p",null,"Connecting existing reducers to ",Object(o.b)("strong",{parentName:"p"},"xoid")," can be beneficial, especially if you're planning to gradually refactor your reducers. The above reducer can be simplified into to the following:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"const CounterModel = (state) => create(state, (atom) => {\n const $count = atom.focus('count')\n return {\n increment: (by) => $count.update(s => s + by),\n decrement: (by) => $count.update(s => s - by),\n }\n})\n")),Object(o.b)("p",null,"To see another demonstration with a more dramatic refactor, you can check ",Object(o.b)("a",{parentName:"p",href:"nested-state"},"Working with nested state")),Object(o.b)("p",null,"Related: ",Object(o.b)("a",{parentName:"p",href:"redux-interop"},"Using in an existing Redux App")))}l.isMDXComponent=!0},93:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return f}));var r=n(0),c=n.n(r);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(c[n]=e[n]);return c}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}var u=c.a.createContext({}),p=function(e){var t=c.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},d=function(e){var t=p(e.components);return c.a.createElement(u.Provider,{value:t},e.children)},l="mdxType",b={inlineCode:"code",wrapper:function(e){var t=e.children;return c.a.createElement(c.a.Fragment,{},t)}},m=c.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,a=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),d=p(n),l=r,m=d["".concat(a,".").concat(l)]||d[l]||b[l]||o;return n?c.a.createElement(m,i(i({ref:t},u),{},{components:n})):c.a.createElement(m,i({ref:t},u))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,a=new Array(o);a[0]=m;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[l]="string"==typeof e?e:r,a[1]=i;for(var u=2;u=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},W=function(e){return!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},z=function(e){var t=Q(e,w.TITLE),n=Q(e,R);if(n&&t)return n.replace(/%s/g,(function(){return Array.isArray(t)?t.join(""):t}));var r=Q(e,I);return t||r||void 0},K=function(e){return Q(e,M)||function(){}},J=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return F({},e,t)}),{})},$=function(e,t){return t.filter((function(e){return void 0!==e[w.BASE]})).map((function(e){return e[w.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),o=0;o=0;n--){var r=e[n];if(r.hasOwnProperty(t))return r[t]}return null},X=(r=Date.now(),function(e){var t=Date.now();t-r>16?(r=t,e(t)):setTimeout((function(){X(e)}),0)}),Z=function(e){return clearTimeout(e)},ee="undefined"!=typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||X:e.requestAnimationFrame||X,te="undefined"!=typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Z:e.cancelAnimationFrame||Z,ne=function(e){return console&&"function"==typeof console.warn&&console.warn(e)},re=null,oe=function(e,t){var n=e.baseTag,r=e.bodyAttributes,o=e.htmlAttributes,i=e.linkTags,u=e.metaTags,a=e.noscriptTags,c=e.onChangeClientState,s=e.scriptTags,f=e.styleTags,l=e.title,d=e.titleAttributes;ae(w.BODY,r),ae(w.HTML,o),ue(l,d);var p={baseTag:ce(w.BASE,n),linkTags:ce(w.LINK,i),metaTags:ce(w.META,u),noscriptTags:ce(w.NOSCRIPT,a),scriptTags:ce(w.SCRIPT,s),styleTags:ce(w.STYLE,f)},v={},h={};Object.keys(p).forEach((function(e){var t=p[e],n=t.newTags,r=t.oldTags;n.length&&(v[e]=n),r.length&&(h[e]=p[e].oldTags)})),t&&t(),c(e,v,h)},ie=function(e){return Array.isArray(e)?e.join(""):e},ue=function(e,t){void 0!==e&&document.title!==e&&(document.title=ie(e)),ae(w.TITLE,t)},ae=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute(H),o=r?r.split(","):[],i=[].concat(o),u=Object.keys(t),a=0;a=0;l--)n.removeAttribute(i[l]);o.length===i.length?n.removeAttribute(H):n.getAttribute(H)!==u.join(",")&&n.setAttribute(H,u.join(","))}},ce=function(e,t){var n=document.head||document.querySelector(w.HEAD),r=n.querySelectorAll(e+"["+H+"]"),o=Array.prototype.slice.call(r),i=[],u=void 0;return t&&t.length&&t.forEach((function(t){var n=document.createElement(e);for(var r in t)if(t.hasOwnProperty(r))if(r===j)n.innerHTML=t.innerHTML;else if(r===T)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{var a=void 0===t[r]?"":t[r];n.setAttribute(r,a)}n.setAttribute(H,"true"),o.some((function(e,t){return u=t,n.isEqualNode(e)}))?o.splice(u,1):i.push(n)})),o.forEach((function(e){return e.parentNode.removeChild(e)})),i.forEach((function(e){return n.appendChild(e)})),{oldTags:o,newTags:i}},se=function(e){return Object.keys(e).reduce((function(t,n){var r=void 0!==e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r}),"")},fe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[x[n]||n]=e[n],t}),t)},le=function(e,t,n){switch(e){case w.TITLE:return{toComponent:function(){return e=t.title,n=t.titleAttributes,(r={key:e})[H]=!0,o=fe(n,r),[v.a.createElement(w.TITLE,o,e)];var e,n,r,o},toString:function(){return function(e,t,n,r){var o=se(n),i=ie(t);return o?"<"+e+" "+H+'="true" '+o+">"+W(i,r)+"":"<"+e+" "+H+'="true">'+W(i,r)+""}(e,t.title,t.titleAttributes,n)}};case y:case g:return{toComponent:function(){return fe(t)},toString:function(){return se(t)}};default:return{toComponent:function(){return function(e,t){return t.map((function(t,n){var r,o=((r={key:n})[H]=!0,r);return Object.keys(t).forEach((function(e){var n=x[e]||e;if(n===j||n===T){var r=t.innerHTML||t.cssText;o.dangerouslySetInnerHTML={__html:r}}else o[n]=t[e]})),v.a.createElement(e,o)}))}(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var o=Object.keys(r).filter((function(e){return!(e===j||e===T)})).reduce((function(e,t){var o=void 0===r[t]?t:t+'="'+W(r[t],n)+'"';return e?e+" "+o:o}),""),i=r.innerHTML||r.cssText||"",u=-1===B.indexOf(e);return t+"<"+e+" "+H+'="true" '+o+(u?"/>":">"+i+"")}),"")}(e,t,n)}}}},de=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,o=e.htmlAttributes,i=e.linkTags,u=e.metaTags,a=e.noscriptTags,c=e.scriptTags,s=e.styleTags,f=e.title,l=void 0===f?"":f,d=e.titleAttributes;return{base:le(w.BASE,t,r),bodyAttributes:le(y,n,r),htmlAttributes:le(g,o,r),link:le(w.LINK,i,r),meta:le(w.META,u,r),noscript:le(w.NOSCRIPT,a,r),script:le(w.SCRIPT,c,r),style:le(w.STYLE,s,r),title:le(w.TITLE,{title:l,titleAttributes:d},r)}},pe=f()((function(e){return{baseTag:$([A,k],e),bodyAttributes:J(y,e),defer:Q(e,V),encode:Q(e,N),htmlAttributes:J(g,e),linkTags:G(w.LINK,[D,A],e),metaTags:G(w.META,[S,O,C,P,E],e),noscriptTags:G(w.NOSCRIPT,[j],e),onChangeClientState:K(e),scriptTags:G(w.SCRIPT,[L,j],e),styleTags:G(w.STYLE,[T],e),title:z(e),titleAttributes:J(m,e)}}),(function(e){re&&te(re),e.defer?re=ee((function(){oe(e,(function(){re=null}))})):(oe(e),re=null)}),de)((function(){return null})),ve=(o=pe,u=i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.shouldComponentUpdate=function(e){return!d()(this.props,e)},t.prototype.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case w.SCRIPT:case w.NOSCRIPT:return{innerHTML:t};case w.STYLE:return{cssText:t}}throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},t.prototype.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren,o=e.newChildProps,i=e.nestedChildren;return F({},r,((t={})[n.type]=[].concat(r[n.type]||[],[F({},o,this.mapNestedChildrenToProps(n,i))]),t))},t.prototype.mapObjectTypeChildren=function(e){var t,n,r=e.child,o=e.newProps,i=e.newChildProps,u=e.nestedChildren;switch(r.type){case w.TITLE:return F({},o,((t={})[r.type]=u,t.titleAttributes=F({},i),t));case w.BODY:return F({},o,{bodyAttributes:F({},i)});case w.HTML:return F({},o,{htmlAttributes:F({},i)})}return F({},o,((n={})[r.type]=F({},i),n))},t.prototype.mapArrayTypeChildrenToProps=function(e,t){var n=F({},t);return Object.keys(e).forEach((function(t){var r;n=F({},n,((r={})[t]=e[t],r))})),n},t.prototype.warnOnInvalidChildren=function(e,t){return!0},t.prototype.mapChildrenToProps=function(e,t){var n=this,r={};return v.a.Children.forEach(e,(function(e){if(e&&e.props){var o=e.props,i=o.children,u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[_[n]||n]=e[n],t}),t)}(Y(o,["children"]));switch(n.warnOnInvalidChildren(e,i),e.type){case w.LINK:case w.META:case w.NOSCRIPT:case w.SCRIPT:case w.STYLE:r=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:r,newChildProps:u,nestedChildren:i});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:u,nestedChildren:i})}}})),t=this.mapArrayTypeChildrenToProps(r,t)},t.prototype.render=function(){var e=this.props,t=e.children,n=Y(e,["children"]),r=F({},n);return t&&(r=this.mapChildrenToProps(t,r)),v.a.createElement(o,r)},q(t,null,[{key:"canUseDOM",set:function(e){o.canUseDOM=e}}]),t}(v.a.Component),i.propTypes={base:c.a.object,bodyAttributes:c.a.object,children:c.a.oneOfType([c.a.arrayOf(c.a.node),c.a.node]),defaultTitle:c.a.string,defer:c.a.bool,encodeSpecialCharacters:c.a.bool,htmlAttributes:c.a.object,link:c.a.arrayOf(c.a.object),meta:c.a.arrayOf(c.a.object),noscript:c.a.arrayOf(c.a.object),onChangeClientState:c.a.func,script:c.a.arrayOf(c.a.object),style:c.a.arrayOf(c.a.object),title:c.a.string,titleAttributes:c.a.object,titleTemplate:c.a.string},i.defaultProps={defer:!0,encodeSpecialCharacters:!0},i.peek=o.peek,i.rewind=function(){var e=o.rewind();return e||(e=de({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),e},u);ve.renderStatic=ve.rewind}).call(this,n(28))},145:function(e,t,n){"use strict";var r,o=n(0),i=(r=o)&&"object"==typeof r&&"default"in r?r.default:r;function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=function(e,t,n){if("function"!=typeof e)throw new Error("Expected reducePropsToState to be a function.");if("function"!=typeof t)throw new Error("Expected handleStateChangeOnClient to be a function.");if(void 0!==n&&"function"!=typeof n)throw new Error("Expected mapStateOnServer to either be undefined or a function.");return function(r){if("function"!=typeof r)throw new Error("Expected WrappedComponent to be a React component.");var c,s=[];function f(){c=e(s.map((function(e){return e.props}))),l.canUseDOM?t(c):n&&(c=n(c))}var l=function(e){var t,n;function o(){return e.apply(this,arguments)||this}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o.peek=function(){return c},o.rewind=function(){if(o.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var e=c;return c=void 0,s=[],e};var u=o.prototype;return u.UNSAFE_componentWillMount=function(){s.push(this),f()},u.componentDidUpdate=function(){f()},u.componentWillUnmount=function(){var e=s.indexOf(this);s.splice(e,1),f()},u.render=function(){return i.createElement(r,this.props)},o}(o.PureComponent);return u(l,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(r)+")"),u(l,"canUseDOM",a),l}}},146:function(e,t){var n="undefined"!=typeof Element,r="function"==typeof Map,o="function"==typeof Set,i="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function u(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var a,c,s,f;if(Array.isArray(e)){if((a=e.length)!=t.length)return!1;for(c=a;0!=c--;)if(!u(e[c],t[c]))return!1;return!0}if(r&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(f=e.entries();!(c=f.next()).done;)if(!t.has(c.value[0]))return!1;for(f=e.entries();!(c=f.next()).done;)if(!u(c.value[1],t.get(c.value[0])))return!1;return!0}if(o&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(f=e.entries();!(c=f.next()).done;)if(!t.has(c.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((a=e.length)!=t.length)return!1;for(c=a;0!=c--;)if(e[c]!==t[c])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof t.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof t.toString)return e.toString()===t.toString();if((a=(s=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(c=a;0!=c--;)if(!Object.prototype.hasOwnProperty.call(t,s[c]))return!1;if(n&&e instanceof Element)return!1;for(c=a;0!=c--;)if(("_owner"!==s[c]&&"__v"!==s[c]&&"__o"!==s[c]||!e.$$typeof)&&!u(e[s[c]],t[s[c]]))return!1;return!0}return e!=e&&t!=t}e.exports=function(e,t){try{return u(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},147:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDocVersionSuggestions=t.useActiveDocContext=t.useActiveVersion=t.useLatestVersion=t.useVersions=t.useActivePluginAndVersion=t.useActivePlugin=t.useDocsData=t.useAllDocsData=void 0;var r=n(97),o=n(148),i=n(149);t.useAllDocsData=function(){return o.useAllPluginInstancesData("docusaurus-plugin-content-docs")},t.useDocsData=function(e){return o.usePluginData("docusaurus-plugin-content-docs",e)},t.useActivePlugin=function(e){void 0===e&&(e={});var n=t.useAllDocsData(),o=r.useLocation().pathname;return i.getActivePlugin(n,o,e)},t.useActivePluginAndVersion=function(e){void 0===e&&(e={});var n=t.useActivePlugin(e),o=r.useLocation().pathname;if(n)return{activePlugin:n,activeVersion:i.getActiveVersion(n.pluginData,o)}},t.useVersions=function(e){return t.useDocsData(e).versions},t.useLatestVersion=function(e){var n=t.useDocsData(e);return i.getLatestVersion(n)},t.useActiveVersion=function(e){var n=t.useDocsData(e),o=r.useLocation().pathname;return i.getActiveVersion(n,o)},t.useActiveDocContext=function(e){var n=t.useDocsData(e),o=r.useLocation().pathname;return i.getActiveDocContext(n,o)},t.useDocVersionSuggestions=function(e){var n=t.useDocsData(e),o=r.useLocation().pathname;return i.getDocVersionSuggestions(n,o)}},148:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return i})),n.d(t,"useAllPluginInstancesData",(function(){return u})),n.d(t,"usePluginData",(function(){return a}));var r=n(96),o="default";function i(){var e=Object(r.a)().globalData;if(!e)throw new Error("Docusaurus global data not found");return e}function u(e){var t=i()[e];if(!t)throw new Error("Docusaurus plugin global data not found for pluginName="+e);return t}function a(e,t){void 0===t&&(t=o);var n=u(e)[t];if(!n)throw new Error("Docusaurus plugin global data not found for pluginName="+e+" and pluginId="+t);return n}},149:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDocVersionSuggestions=t.getActiveDocContext=t.getActiveVersion=t.getLatestVersion=t.getActivePlugin=void 0;var r=n(97);t.getActivePlugin=function(e,t,n){void 0===n&&(n={});var o=Object.entries(e).find((function(e){e[0];var n=e[1];return!!r.matchPath(t,{path:n.path,exact:!1,strict:!1})})),i=o?{pluginId:o[0],pluginData:o[1]}:void 0;if(!i&&n.failfast)throw new Error("Can't find active docs plugin for pathname="+t+", while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: "+Object.values(e).map((function(e){return e.path})).join(", "));return i},t.getLatestVersion=function(e){return e.versions.find((function(e){return e.isLast}))},t.getActiveVersion=function(e,n){var o=t.getLatestVersion(e);return[].concat(e.versions.filter((function(e){return e!==o})),[o]).find((function(e){return!!r.matchPath(n,{path:e.path,exact:!1,strict:!1})}))},t.getActiveDocContext=function(e,n){var o,i,u=t.getActiveVersion(e,n),a=null==u?void 0:u.docs.find((function(e){return!!r.matchPath(n,{path:e.path,exact:!0,strict:!1})}));return{activeVersion:u,activeDoc:a,alternateDocVersions:a?(o=a.id,i={},e.versions.forEach((function(e){e.docs.forEach((function(t){t.id===o&&(i[e.name]=t)}))})),i):{}}},t.getDocVersionSuggestions=function(e,n){var r=t.getLatestVersion(e),o=t.getActiveDocContext(e,n),i=o.activeVersion!==r;return{latestDocSuggestion:i?null==o?void 0:o.alternateDocVersions[r.name]:void 0,latestVersionSuggestion:i?r:void 0}}},94:function(e,t,n){"use strict";function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t0)&&(l.unobserve(t),l.disconnect(),n())}))}))).observe(t))},to:C||""},d&&{isActive:b,activeClassName:h}))}}}]); \ No newline at end of file diff --git a/build/17896441.14da49cd.js b/build/17896441.14da49cd.js deleted file mode 100644 index 12f2cba..0000000 --- a/build/17896441.14da49cd.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{90:function(e,t,a){"use strict";a.r(t);var n=a(0),l=a.n(n),r=a(104),i=a(96),c=a(101),m=a(99);var o=function(e){var t=e.metadata;return l.a.createElement("nav",{className:"pagination-nav","aria-label":"Blog list page navigation"},l.a.createElement("div",{className:"pagination-nav__item"},t.previous&&l.a.createElement(m.a,{className:"pagination-nav__link",to:t.previous.permalink},l.a.createElement("div",{className:"pagination-nav__sublabel"},"Previous"),l.a.createElement("div",{className:"pagination-nav__label"},"\xab ",t.previous.title))),l.a.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},t.next&&l.a.createElement(m.a,{className:"pagination-nav__link",to:t.next.permalink},l.a.createElement("div",{className:"pagination-nav__sublabel"},"Next"),l.a.createElement("div",{className:"pagination-nav__label"},t.next.title," \xbb"))))},s=a(98),d=a(105);var u=function(){var e=Object(i.a)().siteConfig.title,t=Object(s.useActivePlugin)({failfast:!0}).pluginId,a=Object(d.a)(t).savePreferredVersionName,n=Object(s.useActiveVersion)(t),r=Object(s.useDocVersionSuggestions)(t),c=r.latestDocSuggestion,o=r.latestVersionSuggestion;if(!o)return l.a.createElement(l.a.Fragment,null);var u,g=null!=c?c:(u=o).docs.find((function(e){return e.id===u.mainDocId}));return l.a.createElement("div",{className:"alert alert--warning margin-bottom--md",role:"alert"},"current"===n.name?l.a.createElement("div",null,"This is unreleased documentation for ",e," ",l.a.createElement("strong",null,n.label)," version."):l.a.createElement("div",null,"This is documentation for ",e," ",l.a.createElement("strong",null,n.label),", which is no longer actively maintained."),l.a.createElement("div",{className:"margin-top--md"},"For up-to-date documentation, see the"," ",l.a.createElement("strong",null,l.a.createElement(m.a,{to:g.path,onClick:function(){return a(o.name)}},"latest version"))," ","(",o.label,")."))};var g=function(e,t,a){var l=Object(n.useState)(void 0),r=l[0],i=l[1];Object(n.useEffect)((function(){function n(){var n=function(){var e=Array.from(document.getElementsByClassName("anchor")),t=e.find((function(e){return e.getBoundingClientRect().top>=a}));if(t){if(t.getBoundingClientRect().top>=a){var n=e[e.indexOf(t)-1];return null!=n?n:t}return t}return e[e.length-1]}();if(n)for(var l=0,c=!1,m=document.getElementsByClassName(e);l1,B=p?p+" "+d+" "+m:m,D=Object(c.a)(k,{absolute:!0});return l.a.createElement(l.a.Fragment,null,l.a.createElement(r.a,null,l.a.createElement("title",null,B),l.a.createElement("meta",{property:"og:title",content:B}),E&&l.a.createElement("meta",{name:"description",content:E}),E&&l.a.createElement("meta",{property:"og:description",content:E}),j&&j.length&&l.a.createElement("meta",{name:"keywords",content:j.join(",")}),k&&l.a.createElement("meta",{property:"og:image",content:D}),k&&l.a.createElement("meta",{property:"twitter:image",content:D}),k&&l.a.createElement("meta",{name:"twitter:image:alt",content:"Image for "+p}),f&&l.a.createElement("meta",{property:"og:url",content:n+f}),f&&l.a.createElement("link",{rel:"canonical",href:n+f})),l.a.createElement("div",{className:Object(h.a)("container padding-vert--lg",_.a.docItemWrapper)},l.a.createElement("div",{className:"row"},l.a.createElement("div",{className:Object(h.a)("col",(t={},t[_.a.docItemCol]=!x,t))},l.a.createElement(u,null),l.a.createElement("div",{className:_.a.docItemContainer},l.a.createElement("article",null,S&&l.a.createElement("div",null,l.a.createElement("span",{className:"badge badge--secondary"},"Version: ",A.label)),!C&&l.a.createElement("header",null,l.a.createElement("h1",{className:_.a.docTitle},p)),l.a.createElement("div",{className:"markdown"},l.a.createElement(g,null))),(N||w||O)&&l.a.createElement("div",{className:"margin-vert--xl"},l.a.createElement("div",{className:"row"},l.a.createElement("div",{className:"col"},N&&l.a.createElement("a",{href:N,target:"_blank",rel:"noreferrer noopener"},l.a.createElement("svg",{fill:"currentColor",height:"1.2em",width:"1.2em",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 40 40",style:{marginRight:"0.3em",verticalAlign:"sub"}},l.a.createElement("g",null,l.a.createElement("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"}))),"Edit this page")),(w||O)&&l.a.createElement("div",{className:"col text--right"},l.a.createElement("em",null,l.a.createElement("small",null,"Last updated"," ",w&&l.a.createElement(l.a.Fragment,null,"on"," ",l.a.createElement("time",{dateTime:new Date(1e3*w).toISOString(),className:_.a.docLastUpdatedAt},new Date(1e3*w).toLocaleDateString()),O&&" "),O&&l.a.createElement(l.a.Fragment,null,"by ",l.a.createElement("strong",null,O)),!1))))),l.a.createElement("div",{className:"margin-vert--lg"},l.a.createElement(o,{metadata:v})))),!x&&g.rightToc&&l.a.createElement("div",{className:"col col--3"},l.a.createElement(b,{headings:g.rightToc})))))}}}]); \ No newline at end of file diff --git a/build/1be78505.467dc9a6.js b/build/1be78505.467dc9a6.js deleted file mode 100644 index 26271ef..0000000 --- a/build/1be78505.467dc9a6.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[6,15],{100:function(e,t,n){"use strict";var a=n(0),c=n.n(a),r=n(112),l=n(97),i=function(){var e=Object(l.useLocation)().pathname;return e.endsWith("/")?c.a.createElement(l.Redirect,{to:e.slice(0,-1)}):e.endsWith(".html")?c.a.createElement(l.Redirect,{to:e.slice(0,-5)}):null};t.a=function(e){return c.a.createElement(c.a.Fragment,null,c.a.createElement(i,null),c.a.createElement(r.a,e))}}}]); \ No newline at end of file diff --git a/build/2.262a37bb.js b/build/2.262a37bb.js deleted file mode 100644 index c025d01..0000000 --- a/build/2.262a37bb.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see 2.262a37bb.js.LICENSE.txt */ -(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{102:function(e,t,n){"use strict";var a=n(0),r=n(103);t.a=function(){var e=Object(a.useContext)(r.a);if(null==e)throw new Error("`useUserPreferencesContext` is used outside of `Layout` Component.");return e}},103:function(e,t,n){"use strict";var a=n(0),r=Object(a.createContext)(void 0);t.a=r},107:function(e,t,n){"use strict";var a=n(0),r=n(127);t.a=function(){var e=Object(a.useContext)(r.a);if(null==e)throw new Error("`useThemeContext` is used outside of `Layout` Component. See https://v2.docusaurus.io/docs/theme-classic#usethemecontext.");return e}},108:function(e,t,n){"use strict";var a=n(2),r=n(6),c=n(0),o=n.n(c),l=n(94),i=n(99),s=n(101),u=n(97),d=n(132),f=["activeBasePath","activeBaseRegex","to","href","label","activeClassName","prependBaseUrlToHref"],m=["items","position","className"],h=["className"],v=["items","className","position"],b=["className"],p=["mobile"];function g(e){var t=e.activeBasePath,n=e.activeBaseRegex,c=e.to,l=e.href,u=e.label,d=e.activeClassName,m=void 0===d?"navbar__link--active":d,h=e.prependBaseUrlToHref,v=Object(r.a)(e,f),b=Object(s.a)(c),p=Object(s.a)(t),g=Object(s.a)(l,{forcePrependBaseUrl:!0});return o.a.createElement(i.a,Object(a.a)({},l?{target:"_blank",rel:"noopener noreferrer",href:h?g:l}:Object.assign({isNavLink:!0,activeClassName:m,to:b},t||n?{isActive:function(e,t){return n?new RegExp(n).test(t.pathname):t.pathname.startsWith(p)}}:null),v),u)}function O(e){var t=e.items,n=e.position,i=e.className,s=Object(r.a)(e,m),u=Object(c.useRef)(null),d=Object(c.useRef)(null),f=Object(c.useState)(!1),v=f[0],b=f[1];Object(c.useEffect)((function(){var e=function(e){u.current&&!u.current.contains(e.target)&&b(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),function(){document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[u]);var p=function(e,t){return void 0===t&&(t=!1),Object(l.a)({"navbar__item navbar__link":!t,dropdown__link:t},e)};return t?o.a.createElement("div",{ref:u,className:Object(l.a)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--left":"left"===n,"dropdown--right":"right"===n,"dropdown--show":v})},o.a.createElement(g,Object(a.a)({className:p(i)},s,{onClick:s.to?void 0:function(e){return e.preventDefault()},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),b(!v))}}),s.label),o.a.createElement("ul",{ref:d,className:"dropdown__menu"},t.map((function(e,n){var c=e.className,l=Object(r.a)(e,h);return o.a.createElement("li",{key:n},o.a.createElement(g,Object(a.a)({onKeyDown:function(e){if(n===t.length-1&&"Tab"===e.key){e.preventDefault(),b(!1);var a=u.current.nextElementSibling;a&&a.focus()}},activeClassName:"dropdown__link--active",className:p(c,!0)},l)))})))):o.a.createElement(g,Object(a.a)({className:p(i)},s))}function E(e){var t=e.items,n=e.className,i=(e.position,Object(r.a)(e,v)),s=Object(u.useLocation)().pathname,f=Object(c.useState)((function(){var e;return null===(e=!(null!=t&&t.some((function(e){return Object(d.a)(e.to,s)}))))||void 0===e||e})),m=f[0],h=f[1],p=function(e,t){return void 0===t&&(t=!1),Object(l.a)("menu__link",{"menu__link--sublist":t},e)};return t?o.a.createElement("li",{className:Object(l.a)("menu__list-item",{"menu__list-item--collapsed":m})},o.a.createElement(g,Object(a.a)({role:"button",className:p(n,!0)},i,{onClick:function(){h((function(e){return!e}))}}),i.label),o.a.createElement("ul",{className:"menu__list"},t.map((function(e,t){var n=e.className,c=Object(r.a)(e,b);return o.a.createElement("li",{className:"menu__list-item",key:t},o.a.createElement(g,Object(a.a)({activeClassName:"menu__link--active",className:p(n)},c,{onClick:i.onClick})))})))):o.a.createElement("li",{className:"menu__list-item"},o.a.createElement(g,Object(a.a)({className:p(n)},i)))}t.a=function(e){var t=e.mobile,n=void 0!==t&&t,a=Object(r.a)(e,p),c=n?E:O;return o.a.createElement(c,a)}},112:function(e,t,n){"use strict";var a=n(0),r=n.n(a),c=n(94),o=n(95),l=n(102),i=n(53),s=n.n(i);var u=function(){var e,t=Object(l.a)(),n=t.isAnnouncementBarClosed,a=t.closeAnnouncementBar,i=Object(o.a)().announcementBar;if(!i)return null;var u=i.content,d=i.backgroundColor,f=i.textColor,m=i.isCloseable;return!u||m&&n?null:r.a.createElement("div",{className:s.a.announcementBar,style:{backgroundColor:d,color:f},role:"banner"},r.a.createElement("div",{className:Object(c.a)(s.a.announcementBarContent,(e={},e[s.a.announcementBarCloseable]=m,e)),dangerouslySetInnerHTML:{__html:u}}),m?r.a.createElement("button",{type:"button",className:s.a.announcementBarClose,onClick:a,"aria-label":"Close"},r.a.createElement("span",{"aria-hidden":"true"},"\xd7")):null)},d=n(2),f=n(99),m=n(96),h=n(6),v=n(21),b=n(97),p=n(101),g=n(104),O=n(125);function E(){return r.a.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},r.a.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}var k=n(126);function j(){return j=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,a=new Array(t);n=s?r(!1):n+c0&&r.a.createElement("div",{className:"row footer__links"},l.map((function(e,t){return r.a.createElement("div",{key:t,className:"col footer__col"},null!=e.title?r.a.createElement("h4",{className:"footer__title"},e.title):null,null!=e.items&&Array.isArray(e.items)&&e.items.length>0?r.a.createElement("ul",{className:"footer__items"},e.items.map((function(e,t){return e.html?r.a.createElement("li",{key:t,className:"footer__item",dangerouslySetInnerHTML:{__html:e.html}}):r.a.createElement("li",{key:e.href||e.to,className:"footer__item"},r.a.createElement(ue,e))}))):null)}))),(s||n)&&r.a.createElement("div",{className:"text--center"},s&&s.src&&r.a.createElement("div",{className:"margin-bottom--sm"},s.href?r.a.createElement("a",{href:s.href,target:"_blank",rel:"noopener noreferrer",className:ie.a.footerLogoLink},r.a.createElement(de,{alt:s.alt,url:u})):r.a.createElement(de,{alt:s.alt,url:u})),r.a.createElement("div",{dangerouslySetInnerHTML:{__html:n}})))):null},me=n(10),he="light",ve="dark",be=function(e){return e===ve?ve:he},pe=function(){return me.a.canUseDOM?be(document.documentElement.getAttribute("data-theme")):he},ge=function(e){try{localStorage.setItem("theme",be(e))}catch(t){console.error(t)}},Oe=function(){var e=Object(o.a)().colorMode.disableSwitch,t=void 0!==e&&e,n=Object(a.useState)(pe),r=n[0],c=n[1],l=Object(a.useCallback)((function(){c(he),ge(he)}),[]),i=Object(a.useCallback)((function(){c(ve),ge(ve)}),[]);return Object(a.useEffect)((function(){document.documentElement.setAttribute("data-theme",be(r))}),[r]),Object(a.useEffect)((function(){if(!t)try{var e=localStorage.getItem("theme");null!==e&&c(be(e))}catch(n){console.error(n)}}),[c]),Object(a.useEffect)((function(){t||window.matchMedia("(prefers-color-scheme: dark)").addListener((function(e){var t=e.matches;c(t?ve:he)}))}),[]),{isDarkTheme:r===ve,setLightTheme:l,setDarkTheme:i}},Ee=n(127);var ke=function(e){var t=Oe(),n=t.isDarkTheme,a=t.setLightTheme,c=t.setDarkTheme;return r.a.createElement(Ee.a.Provider,{value:{isDarkTheme:n,setLightTheme:a,setDarkTheme:c}},e.children)},je="docusaurus.tab.",ye=function(){var e=Object(a.useState)({}),t=e[0],n=e[1],r=Object(a.useCallback)((function(e,t){try{localStorage.setItem(""+je+e,t)}catch(n){console.error(n)}}),[]);return Object(a.useEffect)((function(){try{for(var e={},t=0;t996?r.desktop:r.mobile}var n=Object(a.useState)(t),c=n[0],o=n[1];return Object(a.useEffect)((function(){if(e)return window.addEventListener("resize",n),function(){return window.removeEventListener("resize",n)};function n(){o(t())}}),[]),c}},131:function(e,t,n){"use strict";var a=n(107),r=n(101),c=n(106),o=n(95);t.a=function(){var e=Object(o.a)().navbar.logo,t=Object(a.a)().isDarkTheme,n=Object(r.a)(e.href||"/"),l={};e.target?l={target:e.target}:Object(c.a)(n)||(l={rel:"noopener noreferrer",target:"_blank"});var i=e.srcDark&&t?e.srcDark:e.src;return{logoLink:n,logoLinkProps:l,logoImageUrl:Object(r.a)(i),logoAlt:e.alt}}},132:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var a=function(e,t){var n=function(e){return e.endsWith("/")?e:e+"/"};return n(e)===n(t)}},150:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;tthis.startX&&(this.setState({checked:!0}),this.startX=t,this.activated=tn?this.previouslyChecked!==this.state.checked&&(this.setState({checked:!1}),this.previouslyChecked=this.state.checked,t.click()):this.startX-4=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}(t,["className","icons"])),c=(0,l.default)("react-toggle",{"react-toggle--checked":this.state.checked,"react-toggle--focus":this.state.hasFocus,"react-toggle--disabled":this.props.disabled},n);return o.default.createElement("div",{className:c,onClick:this.handleClick,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd},o.default.createElement("div",{className:"react-toggle-track"},o.default.createElement("div",{className:"react-toggle-track-check"},this.getIcon("checked")),o.default.createElement("div",{className:"react-toggle-track-x"},this.getIcon("unchecked"))),o.default.createElement("div",{className:"react-toggle-thumb"}),o.default.createElement("input",a({},r,{ref:function(t){e.input=t},onFocus:this.handleFocus,onBlur:this.handleBlur,className:"react-toggle-screenreader-only",type:"checkbox"})))}}]),t}(c.PureComponent);t.default=m,m.displayName="Toggle",m.defaultProps={icons:{checked:o.default.createElement(s.default,null),unchecked:o.default.createElement(u.default,null)}},m.propTypes={checked:i.default.bool,disabled:i.default.bool,defaultChecked:i.default.bool,onChange:i.default.func,onFocus:i.default.func,onBlur:i.default.func,className:i.default.string,name:i.default.string,value:i.default.string,id:i.default.string,"aria-labelledby":i.default.string,"aria-label":i.default.string,icons:i.default.oneOfType([i.default.bool,i.default.shape({checked:i.default.node,unchecked:i.default.node})])}},151:function(e,t,n){var a;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e="",t=0;t0){var n=t[0];return{x:n.clientX,y:n.clientY}}var a=e.pageX;if(void 0!==a)return{x:a,y:e.pageY}}return{x:0,y:0}}},155:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return f}));var a=n(2),r=n(6),c=n(0),o=n.n(c),l=n(108),i=n(98),s=n(105),u=["label","to","docsPluginId"],d=function(e){return e.docs.find((function(t){return t.id===e.mainDocId}))};function f(e){var t,n=e.label,c=e.to,f=e.docsPluginId,m=Object(r.a)(e,u),h=Object(i.useActiveVersion)(f),v=Object(s.a)(f).preferredVersion,b=Object(i.useLatestVersion)(f),p=null!==(t=null!=h?h:v)&&void 0!==t?t:b,g=null!=n?n:p.label,O=null!=c?c:d(p).path;return o.a.createElement(l.a,Object(a.a)({},m,{label:g,to:O}))}},156:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return f}));var a=n(2),r=n(6),c=n(0),o=n.n(c),l=n(108),i=n(98),s=n(105),u=["mobile","docsPluginId","dropdownActiveClassDisabled","dropdownItemsBefore","dropdownItemsAfter"],d=function(e){return e.docs.find((function(t){return t.id===e.mainDocId}))};function f(e){var t,n,c=e.mobile,f=e.docsPluginId,m=e.dropdownActiveClassDisabled,h=e.dropdownItemsBefore,v=e.dropdownItemsAfter,b=Object(r.a)(e,u),p=Object(i.useActiveDocContext)(f),g=Object(i.useVersions)(f),O=Object(i.useLatestVersion)(f),E=Object(s.a)(f),k=E.preferredVersion,j=E.savePreferredVersionName;var y=null!==(t=null!==(n=p.activeVersion)&&void 0!==n?n:k)&&void 0!==t?t:O,w=c?"Versions":y.label,C=c?void 0:d(y).path;return o.a.createElement(l.a,Object(a.a)({},b,{mobile:c,label:w,to:C,items:function(){var e=g.map((function(e){var t=(null==p?void 0:p.alternateDocVersions[e.name])||d(e);return{isNavLink:!0,label:e.label,to:t.path,isActive:function(){return e===(null==p?void 0:p.activeVersion)},onClick:function(){j(e.name)}}})),t=[].concat(h,e,v);if(!(t.length<=1))return t}(),isActive:m?function(){return!1}:void 0}))}},157:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return f}));var a=n(2),r=n(6),c=n(0),o=n.n(c),l=n(108),i=n(98),s=n(94),u=n(105),d=["docId","activeSidebarClassName","label","docsPluginId"];function f(e){var t,n,c=e.docId,f=e.activeSidebarClassName,m=e.label,h=e.docsPluginId,v=Object(r.a)(e,d),b=Object(i.useActiveDocContext)(h),p=b.activeVersion,g=b.activeDoc,O=Object(u.a)(h).preferredVersion,E=Object(i.useLatestVersion)(h),k=null!==(t=null!=p?p:O)&&void 0!==t?t:E,j=k.docs.find((function(e){return e.id===c}));if(!j)throw new Error("DocNavbarItem: couldn't find any doc with id="+c+" in version "+k.name+".\nAvailable docIds=\n- "+k.docs.join("\n- "));return o.a.createElement(l.a,Object(a.a)({exact:!0},v,{className:Object(s.a)(v.className,(n={},n[f]=g&&g.sidebar===j.sidebar,n)),label:null!=m?m:j.id,to:j.path}))}}}]); \ No newline at end of file diff --git a/build/2.262a37bb.js.LICENSE.txt b/build/2.262a37bb.js.LICENSE.txt deleted file mode 100644 index 827f273..0000000 --- a/build/2.262a37bb.js.LICENSE.txt +++ /dev/null @@ -1,5 +0,0 @@ -/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ diff --git a/build/249cd168.e7e389d5.js b/build/249cd168.e7e389d5.js deleted file mode 100644 index 622c950..0000000 --- a/build/249cd168.e7e389d5.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{67:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return s})),n.d(t,"rightToc",(function(){return p})),n.d(t,"default",(function(){return l}));var r=n(2),a=n(6),o=(n(0),n(93)),i=["components"],c={id:"redux-interop",title:"Using in an existing Redux App"},s={unversionedId:"recipes/redux-interop",id:"recipes/redux-interop",isDocsHomePage:!1,title:"Using in an existing Redux App",description:"xoid and Redux can coexist in a project without a problem. There's no requirement to get rid of Redux when xoid is added. If you're planning to gradually move away from Redux however, xoid is a good candidate to do so. For this, one thing you can do is to start managing some part of your Redux state via xoid. You can follow these steps:",source:"@site/main/docs/recipes/redux-interop.md",slug:"/recipes/redux-interop",permalink:"/docs/recipes/redux-interop",editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes/redux-interop.md",version:"current",sidebar:"docs",previous:{title:"Using reducers",permalink:"/docs/recipes/using-reducers"},next:{title:"Redux Devtools integration",permalink:"/docs/recipes/redux-devtools-integration"}},p=[{value:"Step 1: create an "omnipotent" action that has the ability to replace the Redux state",id:"step-1-create-an-omnipotent-action-that-has-the-ability-to-replace-the-redux-state",children:[]},{value:"Step 2: Create an "enhanced atom"",id:"step-2-create-an-enhanced-atom",children:[]}],d={rightToc:p},u="wrapper";function l(e){var t=e.components,n=Object(a.a)(e,i);return Object(o.b)(u,Object(r.a)({},d,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"xoid")," and Redux can coexist in a project without a problem. There's no requirement to get rid of Redux when ",Object(o.b)("strong",{parentName:"p"},"xoid")," is added. If you're planning to gradually move away from Redux however, ",Object(o.b)("strong",{parentName:"p"},"xoid")," is a good candidate to do so. For this, one thing you can do is to start managing some part of your Redux state via ",Object(o.b)("strong",{parentName:"p"},"xoid"),". You can follow these steps:"),Object(o.b)("h3",{id:"step-1-create-an-omnipotent-action-that-has-the-ability-to-replace-the-redux-state"},'Step 1: create an "omnipotent" action that has the ability to replace the Redux state'),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"const someExistingReducer = (state, action) => {\n switch(action.type) {\n case 'EXTERNAL_XOID_UPDATE': {\n return action.payload\n }\n ... // other `case` clauses\n }\n")),Object(o.b)("h3",{id:"step-2-create-an-enhanced-atom"},'Step 2: Create an "enhanced atom"'),Object(o.b)("p",null,"This will forward subscriptions and state modifications directly to the Redux store."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"import { store } from './store'\n\nconst $mediatorAtom = create((read) => read(store.getState, store.subscribe))\n$mediatorAtom.set = (payload) => store.dispatch({ type: 'EXTERNAL_XOID_UPDATE', payload })\n")),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"Usually, atoms are derived from other ",Object(o.b)("strong",{parentName:"p"},"atoms")," (as ",Object(o.b)("inlineCode",{parentName:"p"},"create((read) => get($someAtom))"),"). Observe how ",Object(o.b)("inlineCode",{parentName:"p"},"read")," is used with two arguments in this example. This is an additional overload that is used to consume an external (non-",Object(o.b)("strong",{parentName:"p"},"xoid"),") source. As long as the external source implements some getState & subscribe pair, it can be consumed by ",Object(o.b)("strong",{parentName:"p"},"xoid")," like this. (See ",Object(o.b)("a",{parentName:"p",href:"../advanced-concepts#deriving-state-from-external-sources"},"Deriving state from external sources"),")"),Object(o.b)("p",{parentName:"blockquote"},"Also, in the second line, you may see that the default ",Object(o.b)("inlineCode",{parentName:"p"},"set")," method is overriden. In ",Object(o.b)("strong",{parentName:"p"},"xoid"),"'s terminology, atoms like these are called ",Object(o.b)("a",{parentName:"p",href:"../advanced-concepts#enhanced-atoms"},"enhanced atoms"),". Overriding the default ",Object(o.b)("inlineCode",{parentName:"p"},"set")," method also will modify the ",Object(o.b)("inlineCode",{parentName:"p"},"update")," method's behavior.")),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"Note: If a partial Redux state is desired, A selector instead of the ",Object(o.b)("inlineCode",{parentName:"p"},"store.getState")," can be used. Second argument remains same as ",Object(o.b)("inlineCode",{parentName:"p"},"store.subscribe"),".")))}l.isMDXComponent=!0},93:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return h}));var r=n(0),a=n.n(r);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=a.a.createContext({}),d=function(e){var t=a.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},u=function(e){var t=d(e.components);return a.a.createElement(p.Provider,{value:t},e.children)},l="mdxType",b={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},m=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,i=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),u=d(n),l=r,m=u["".concat(i,".").concat(l)]||u[l]||b[l]||o;return n?a.a.createElement(m,c(c({ref:t},p),{},{components:n})):a.a.createElement(m,c({ref:t},p))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=m;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c[l]="string"==typeof e?e:r,i[1]=c;for(var p=2;p {\n function melt() {\n machine.set(liquid)\n console.log('I melted')\n }\n\n function freeze() {\n machine.set(solid)\n console.log('I freezed')\n }\n\n function condense() {\n machine.set(liquid)\n console.log('I condensed')\n }\n\n function vaporize() {\n machine.set(gas)\n console.log('I vaporized')\n }\n\n const solid = { name: \"ice\", actions: { melt } };\n const liquid = { name: \"water\", actions: { freeze, vaporize } };\n const gas = { name: \"vapor\", actions: { condense } };\n\n const machine = create(solid)\n return machine;\n}\n\nconst App = () => {\n const { name, actions } = useAtom(createMachine)\n return (\n
\n {name}\n {Object.keys(actions).map((key) => (\n \n ))}\n
\n )\n}\n")))}m.isMDXComponent=!0},93:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return b}));var r=t(0),i=t.n(r);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function c(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=i.a.createContext({}),p=function(e){var n=i.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},u=function(e){var n=p(e.components);return i.a.createElement(l.Provider,{value:n},e.children)},m="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},f=i.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,o=e.originalType,a=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),u=p(t),m=r,f=u["".concat(a,".").concat(m)]||u[m]||d[m]||o;return t?i.a.createElement(f,c(c({ref:n},l),{},{components:t})):i.a.createElement(f,c({ref:n},l))}));function b(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var o=t.length,a=new Array(o);a[0]=f;var c={};for(var s in n)hasOwnProperty.call(n,s)&&(c[s]=n[s]);c.originalType=e,c[m]="string"==typeof e?e:r,a[1]=c;for(var l=2;l {\n const $alpha = atom.focus(s => s.alpha)\n return {\n inc: () => $alpha.update(s => s + 1),\n resetState: () => atom.set({ alpha: 5 })\n deeply: {\n nested: {\n action: () => $alpha.set(5)\n }\n } \n }\n }\n)\n\natom.debugValue = 'myAtom' // enable watching it by the devtools\n\nconst { deeply, incrementAlpha } = atom.actions // destructuring is no problem\nincrementAlpha() // logs \"(myAtom).incrementAlpha\"\ndeeply.nested.action() // logs \"(myAtom).deeply.nested.action\"\natom.focus(s => s.alpha).set(25) // logs \"(myAtom) Update ([timestamp])\n")))}d.isMDXComponent=!0},93:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return b}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=o.a.createContext({}),p=function(e){var t=o.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},u=function(e){var t=p(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},f=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,i=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),u=p(n),d=r,f=u["".concat(i,".").concat(d)]||u[d]||m[d]||a;return n?o.a.createElement(f,c(c({ref:t},l),{},{components:n})):o.a.createElement(f,c({ref:t},l))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=f;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c[d]="string"==typeof e?e:r,i[1]=c;for(var l=2;l\n create(value, (atom) => ({\n increment: () => atom.update((s) => s + 1),\n decrement: () => atom.update((s) => s - 1),\n }))\n\nconst useCounter = (value: number) => useAtom(() => CounterModel(value), true)\n")),Object(c.b)("blockquote",null,Object(c.b)("p",{parentName:"blockquote"},"With the second argument set to ",Object(c.b)("inlineCode",{parentName:"p"},"true"),", ",Object(c.b)("inlineCode",{parentName:"p"},"useAtom")," returns a 2-item tuple.")),Object(c.b)("pre",null,Object(c.b)("code",{parentName:"pre",className:"language-js"},"const [state, { increment, decrement }] = useCounter(0)\n")))}m.isMDXComponent=!0},93:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return f}));var n=r(0),o=r.n(n);function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var s=o.a.createContext({}),p=function(e){var t=o.a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},l=function(e){var t=p(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},m="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},b=o.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,c=e.originalType,a=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),l=p(r),m=n,b=l["".concat(a,".").concat(m)]||l[m]||d[m]||c;return r?o.a.createElement(b,i(i({ref:t},s),{},{components:r})):o.a.createElement(b,i({ref:t},s))}));function f(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=r.length,a=new Array(c);a[0]=b;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i[m]="string"==typeof e?e:n,a[1]=i;for(var s=2;s0}},119:function(e,t,r){"use strict";e.exports=function(e,t){if(null===e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}},120:function(e,t,r){"use strict";e.exports=function(){return Array.prototype.slice.call(arguments).reduceRight((function(e,t){return Object.keys(Object(t)).forEach((function(r){void 0!==t[r]&&(void 0!==e[r]&&delete e[r],e[r]=t[r])})),e}),{})}},133:function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,s,c,u,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var f=new Error('Uncaught, unspecified "error" event. ('+t+")");throw f.context=t,f}if(a(r=this._events[e]))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:c=Array.prototype.slice.call(arguments,1),r.apply(this,c)}else if(i(r))for(c=Array.prototype.slice.call(arguments,1),s=(o=r.slice()).length,u=0;u0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},r.prototype.removeListener=function(e,t){var r,a,s,c;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(s=(r=this._events[e]).length,a=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(c=s;c-- >0;)if(r[c]===t||r[c].listener&&r[c].listener===t){a=c;break}if(a<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},134:function(e,t,r){"use strict";e.exports=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}},135:function(e,t,r){"use strict";var n=r(120),i=r(110),a=r(162),s=r(109),c=r(118),u=r(119),o=r(163),f=r(164),h=r(165);function l(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((function(e,r){return l(t[r],e)})):e===t}function m(e){var t=e?m._parseNumbers(e):{};void 0===t.userToken||f(t.userToken)||console.warn("[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\n - Format: [a-zA-Z0-9_-]{1,64}"),this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{};var r=this;Object.keys(t).forEach((function(e){var n=-1!==m.PARAMETERS.indexOf(e),i=void 0!==t[e];!n&&i&&(r[e]=t[e])}))}m.PARAMETERS=Object.keys(new m),m._parseNumbers=function(e){if(e instanceof m)return e;var t={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach((function(r){var n=e[r];if("string"==typeof n){var i=parseFloat(n);t[r]=isNaN(i)?n:i}})),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map((function(e){return Array.isArray(e)?e.map((function(e){return parseFloat(e)})):e}))),e.numericRefinements){var r={};Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t]||{};r[t]={},Object.keys(n).forEach((function(e){var i=n[e].map((function(e){return Array.isArray(e)?e.map((function(e){return"string"==typeof e?parseFloat(e):e})):"string"==typeof e?parseFloat(e):e}));r[t][e]=i}))})),t.numericRefinements=r}return s({},e,t)},m.make=function(e){var t=new m(e);return(e.hierarchicalFacets||[]).forEach((function(e){if(e.rootPath){var r=t.getHierarchicalRefinement(e.name);r.length>0&&0!==r[0].indexOf(e.rootPath)&&(t=t.clearRefinements(e.name)),0===(r=t.getHierarchicalRefinement(e.name)).length&&(t=t.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}})),t},m.validate=function(e,t){var r=t||{};return e.tagFilters&&r.tagRefinements&&r.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&r.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&r.numericRefinements&&c(r.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):c(e.numericRefinements)&&r.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},m.prototype={constructor:m,clearRefinements:function(e){var t={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:h.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:h.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:h.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:h.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return t.numericRefinements===this.numericRefinements&&t.facetsRefinements===this.facetsRefinements&&t.facetsExcludes===this.facetsExcludes&&t.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&t.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(t)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,r){var n=o(r);if(this.isNumericRefined(e,t,n))return this;var i=s({},this.numericRefinements);return i[e]=s({},i[e]),i[e][t]?(i[e][t]=i[e][t].slice(),i[e][t].push(n)):i[e][t]=[n],this.setQueryParameters({numericRefinements:i})},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(e,t,r){var n=r;return void 0!==n?this.isNumericRefined(e,t,n)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(r,i){return i===e&&r.op===t&&l(r.val,o(n))}))}):this:void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(r,n){return n===e&&r.op===t}))}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(t,r){return r===e}))}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){if(void 0===e)return c(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof e)return u(this.numericRefinements,[e]);if("function"==typeof e){var t=!1,r=this.numericRefinements,n=Object.keys(r).reduce((function(n,i){var a=r[i],s={};return a=a||{},Object.keys(a).forEach((function(r){var n=a[r]||[],c=[];n.forEach((function(t){e({val:t,op:r},i,"numeric")||c.push(t)})),c.length!==n.length&&(t=!0),s[r]=c})),n[i]=s,n}),{});return t?n:this.numericRefinements}},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return h.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:h.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return h.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:h.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return h.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:h.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},removeFacet:function(e){return this.isConjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({facets:this.facets.filter((function(t){return t!==e}))}):this},removeDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter((function(t){return t!==e}))}):this},removeHierarchicalFacet:function(e){return this.isHierarchicalFacet(e)?this.clearRefinements(e).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter((function(t){return t.name!==e}))}):this},removeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return h.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:h.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return h.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:h.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return h.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:h.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(e){if(!this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.filter((function(t){return t!==e}))};return this.setQueryParameters(t)},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:h.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:h.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:h.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),i={};return void 0!==this.hierarchicalFacetsRefinements[e]&&this.hierarchicalFacetsRefinements[e].length>0&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+r))?-1===t.indexOf(r)?i[e]=[]:i[e]=[t.slice(0,t.lastIndexOf(r))]:i[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:n({},i,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var r={};return r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:n({},r,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:n({},t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return this.disjunctiveFacets.indexOf(e)>-1},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return this.facets.indexOf(e)>-1},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&h.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&h.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&h.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))return!1;var r=this.getHierarchicalRefinement(e);return t?-1!==r.indexOf(t):r.length>0},isNumericRefined:function(e,t,r){if(void 0===r&&void 0===t)return Boolean(this.numericRefinements[e]);var n=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===r||!n)return n;var a,s,c=o(r),u=void 0!==(a=this.numericRefinements[e][t],s=c,i(a,(function(e){return l(e,s)})));return n&&u},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var e=this,t=a(Object.keys(this.numericRefinements).filter((function(t){return Object.keys(e.numericRefinements[t]).length>0})),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter((function(t){return e.disjunctiveFacetsRefinements[t].length>0})).concat(t).concat(this.getRefinedHierarchicalFacets()).sort()},getRefinedHierarchicalFacets:function(){var e=this;return a(this.hierarchicalFacets.map((function(e){return e.name})),Object.keys(this.hierarchicalFacetsRefinements).filter((function(t){return e.hierarchicalFacetsRefinements[t].length>0}))).sort()},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter((function(t){return-1===e.indexOf(t)}))},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={},r=this;return Object.keys(this).forEach((function(n){var i=r[n];-1===e.indexOf(n)&&void 0!==i&&(t[n]=i)})),t},setQueryParameter:function(e,t){if(this[e]===t)return this;var r={};return r[e]=t,this.setQueryParameters(r)},setQueryParameters:function(e){if(!e)return this;var t=m.validate(this,e);if(t)throw t;var r=this,n=m._parseNumbers(e),i=Object.keys(this).reduce((function(e,t){return e[t]=r[t],e}),{}),a=Object.keys(n).reduce((function(e,t){var r=void 0!==e[t],i=void 0!==n[t];return r&&!i?u(e,[t]):(i&&(e[t]=n[t]),e)}),i);return new this.constructor(a)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(e){return i(this.hierarchicalFacets,(function(t){return t.name===e}))},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(r).map((function(e){return e.trim()}))},toString:function(){return JSON.stringify(this,null,2)}},e.exports=m},136:function(e,t,r){"use strict";var n=r(166),i=r(120),a=r(117),s=r(110),c=r(167),u=r(137),o=r(109),f=r(138),h=a.escapeFacetValue,l=a.unescapeFacetValue,m=r(168);function d(e){var t={};return e.forEach((function(e,r){t[e]=r})),t}function v(e,t,r){t&&t[r]&&(e.stats=t[r])}function p(e,t,r){var a=t[0];this._rawResults=t;var u=this;Object.keys(a).forEach((function(e){u[e]=a[e]}));var f=o({persistHierarchicalRootCount:!1},r);Object.keys(f).forEach((function(e){u[e]=f[e]})),this.processingTimeMS=t.reduce((function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS}),0),this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map((function(){return[]})),this.facets=[];var h=e.getRefinedDisjunctiveFacets(),p=d(e.facets),g=d(e.disjunctiveFacets),y=1,R=a.facets||{};Object.keys(R).forEach((function(t){var r,n,i=R[t],o=(r=e.hierarchicalFacets,n=t,s(r,(function(e){return(e.attributes||[]).indexOf(n)>-1})));if(o){var f=o.attributes.indexOf(t),h=c(e.hierarchicalFacets,(function(e){return e.name===o.name}));u.hierarchicalFacets[h][f]={attribute:t,data:i,exhaustive:a.exhaustiveFacetsCount}}else{var l,m=-1!==e.disjunctiveFacets.indexOf(t),d=-1!==e.facets.indexOf(t);m&&(l=g[t],u.disjunctiveFacets[l]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},v(u.disjunctiveFacets[l],a.facets_stats,t)),d&&(l=p[t],u.facets[l]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},v(u.facets[l],a.facets_stats,t))}})),this.hierarchicalFacets=n(this.hierarchicalFacets),h.forEach((function(r){var n=t[y],s=n&&n.facets?n.facets:{},f=e.getHierarchicalFacetByName(r);Object.keys(s).forEach((function(t){var r,h=s[t];if(f){r=c(e.hierarchicalFacets,(function(e){return e.name===f.name}));var m=c(u.hierarchicalFacets[r],(function(e){return e.attribute===t}));if(-1===m)return;u.hierarchicalFacets[r][m].data=o({},u.hierarchicalFacets[r][m].data,h)}else{r=g[t];var d=a.facets&&a.facets[t]||{};u.disjunctiveFacets[r]={name:t,data:i({},h,d),exhaustive:n.exhaustiveFacetsCount},v(u.disjunctiveFacets[r],n.facets_stats,t),e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].forEach((function(n){!u.disjunctiveFacets[r].data[n]&&e.disjunctiveFacetsRefinements[t].indexOf(l(n))>-1&&(u.disjunctiveFacets[r].data[n]=0)}))}})),y++})),e.getRefinedHierarchicalFacets().forEach((function(r){var n=e.getHierarchicalFacetByName(r),a=e._getHierarchicalFacetSeparator(n),s=e.getHierarchicalRefinement(r);0===s.length||s[0].split(a).length<2||t.slice(y).forEach((function(t){var r=t&&t.facets?t.facets:{};Object.keys(r).forEach((function(t){var o=r[t],f=c(e.hierarchicalFacets,(function(e){return e.name===n.name})),h=c(u.hierarchicalFacets[f],(function(e){return e.attribute===t}));if(-1!==h){var l={};if(s.length>0&&!u.persistHierarchicalRootCount){var m=s[0].split(a)[0];l[m]=u.hierarchicalFacets[f][h].data[m]}u.hierarchicalFacets[f][h].data=i(l,o,u.hierarchicalFacets[f][h].data)}})),y++}))})),Object.keys(e.facetsExcludes).forEach((function(t){var r=e.facetsExcludes[t],n=p[t];u.facets[n]={name:t,data:R[t],exhaustive:a.exhaustiveFacetsCount},r.forEach((function(e){u.facets[n]=u.facets[n]||{name:t},u.facets[n].data=u.facets[n].data||{},u.facets[n].data[e]=0}))})),this.hierarchicalFacets=this.hierarchicalFacets.map(m(e)),this.facets=n(this.facets),this.disjunctiveFacets=n(this.disjunctiveFacets),this._state=e}function g(e,t){function r(e){return e.name===t}if(e._state.isConjunctiveFacet(t)){var n=s(e.facets,r);return n?Object.keys(n.data).map((function(r){var i=h(r);return{name:r,escapedValue:i,count:n.data[r],isRefined:e._state.isFacetRefined(t,i),isExcluded:e._state.isExcludeRefined(t,r)}})):[]}if(e._state.isDisjunctiveFacet(t)){var i=s(e.disjunctiveFacets,r);return i?Object.keys(i.data).map((function(r){var n=h(r);return{name:r,escapedValue:n,count:i.data[r],isRefined:e._state.isDisjunctiveFacetRefined(t,n)}})):[]}if(e._state.isHierarchicalFacet(t)){var a=s(e.hierarchicalFacets,r);if(!a)return a;var c=e._state.getHierarchicalFacetByName(t),u=e._state._getHierarchicalFacetSeparator(c),o=l(e._state.getHierarchicalRefinement(t)[0]||"");0===o.indexOf(c.rootPath)&&(o=o.replace(c.rootPath+u,""));var f=o.split(u);return f.unshift(t),y(a,f,0),a}}function y(e,t,r){e.isRefined=e.name===t[r],e.data&&e.data.forEach((function(e){y(e,t,r+1)}))}function R(e,t,r,n){if(n=n||0,Array.isArray(t))return e(t,r[n]);if(!t.data||0===t.data.length)return t;var a=t.data.map((function(t){return R(e,t,r,n+1)})),s=e(a,r[n]);return i({data:s},t)}function F(e,t){var r=s(e,(function(e){return e.name===t}));return r&&r.stats}function b(e,t,r,n,i){var a=s(i,(function(e){return e.name===r})),c=a&&a.data&&a.data[n]?a.data[n]:0,u=a&&a.exhaustive||!1;return{type:t,attributeName:r,name:n,count:c,exhaustive:u}}p.prototype.getFacetByName=function(e){function t(t){return t.name===e}return s(this.facets,t)||s(this.disjunctiveFacets,t)||s(this.hierarchicalFacets,t)},p.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],p.prototype.getFacetValues=function(e,t){var r=g(this,e);if(r){var n,a=i({},t,{sortBy:p.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),s=this;if(Array.isArray(r))n=[e];else n=s._state.getHierarchicalFacetByName(r.name).attributes;return R((function(e,t){if(a.facetOrdering){var r=function(e,t){return e.renderingContent&&e.renderingContent.facetOrdering&&e.renderingContent.facetOrdering.values&&e.renderingContent.facetOrdering.values[t]}(s,t);if(r)return function(e,t){var r=[],n=[],i=(t.order||[]).reduce((function(e,t,r){return e[t]=r,e}),{});e.forEach((function(e){var t=e.path||e.name;void 0!==i[t]?r[i[t]]=e:n.push(e)})),r=r.filter((function(e){return e}));var a,s=t.sortRemainingBy;return"hidden"===s?r:(a="alpha"===s?[["path","name"],["asc","asc"]]:[["count"],["desc"]],r.concat(f(n,a[0],a[1])))}(e,r)}if(Array.isArray(a.sortBy)){var n=u(a.sortBy,p.DEFAULT_SORT);return f(e,n[0],n[1])}if("function"==typeof a.sortBy)return function(e,t){return t.sort(e)}(a.sortBy,e);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")}),r,n)}},p.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?F(this.facets,e):this._state.isDisjunctiveFacet(e)?F(this.disjunctiveFacets,e):void 0},p.prototype.getRefinements=function(){var e=this._state,t=this,r=[];return Object.keys(e.facetsRefinements).forEach((function(n){e.facetsRefinements[n].forEach((function(i){r.push(b(e,"facet",n,i,t.facets))}))})),Object.keys(e.facetsExcludes).forEach((function(n){e.facetsExcludes[n].forEach((function(i){r.push(b(e,"exclude",n,i,t.facets))}))})),Object.keys(e.disjunctiveFacetsRefinements).forEach((function(n){e.disjunctiveFacetsRefinements[n].forEach((function(i){r.push(b(e,"disjunctive",n,i,t.disjunctiveFacets))}))})),Object.keys(e.hierarchicalFacetsRefinements).forEach((function(n){e.hierarchicalFacetsRefinements[n].forEach((function(i){r.push(function(e,t,r,n){var i=e.getHierarchicalFacetByName(t),a=e._getHierarchicalFacetSeparator(i),c=r.split(a),u=s(n,(function(e){return e.name===t})),o=c.reduce((function(e,t){var r=e&&s(e.data,(function(e){return e.name===t}));return void 0!==r?r:e}),u),f=o&&o.count||0,h=o&&o.exhaustive||!1,l=o&&o.path||"";return{type:"hierarchical",attributeName:t,name:l,count:f,exhaustive:h}}(e,n,i,t.hierarchicalFacets))}))})),Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t];Object.keys(n).forEach((function(e){n[e].forEach((function(n){r.push({type:"numeric",attributeName:t,name:n,numericValue:n,operator:e})}))}))})),e.tagRefinements.forEach((function(e){r.push({type:"tag",attributeName:"_tags",name:e})})),r},e.exports=p},137:function(e,t,r){"use strict";var n=r(110);e.exports=function(e,t){var r=(t||[]).map((function(e){return e.split(":")}));return e.reduce((function(e,t){var i=t.split(":"),a=n(r,(function(e){return e[0]===i[0]}));return i.length>1||!a?(e[0].push(i[0]),e[1].push(i[1]),e):(e[0].push(a[0]),e[1].push(a[1]),e)}),[[],[]])}},138:function(e,t,r){"use strict";function n(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=void 0!==t,a=null===t;if(!a&&e>t||n&&i||!r)return 1;if(!n&&e=r.length?a:"desc"===r[i]?-a:a}return e.index-t.index})),i.map((function(e){return e.value}))}},139:function(e,t,r){"use strict";e.exports="3.16.1"},158:function(e,t,r){"use strict";var n=r(159),i=r(135),a=r(136);function s(e,t,r,i){return new n(e,t,r,i)}s.version=r(139),s.AlgoliaSearchHelper=n,s.SearchParameters=i,s.SearchResults=a,e.exports=s},159:function(e,t,r){"use strict";var n=r(133),i=r(160),a=r(117).escapeFacetValue,s=r(134),c=r(109),u=r(118),o=r(119),f=r(161),h=r(135),l=r(136),m=r(139);function d(e,t,r,n){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+m+")"),this.setClient(e);var i=r||{};i.index=t,this.state=h.make(i),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0,this._searchResultsOptions=n}function v(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function p(){return this.state.page}s(d,n),d.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},d.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},d.prototype.getQuery=function(){var e=this.state;return f._getHitsSearchParams(e)},d.prototype.searchOnce=function(e,t){var r=e?this.state.setQueryParameters(e):this.state,n=f._getQueries(r.index,r),i=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:r}),!t)return this.client.search(n).then((function(e){return i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),{content:new l(r,e.results),state:r,_originalResponse:e}}),(function(e){throw i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),e}));this.client.search(n).then((function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(null,new l(r,e.results),r)})).catch((function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(e,null,r)}))},d.prototype.findAnswers=function(e){console.warn("[algoliasearch-helper] answers is no longer supported");var t=this.state,r=this.derivedHelpers[0];if(!r)return Promise.resolve([]);var n=r.getModifiedState(t),i=c({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:o(f._getHitsSearchParams(n),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),a="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if("function"!=typeof this.client.initIndex)throw new Error(a);var s=this.client.initIndex(n.index);if("function"!=typeof s.findAnswers)throw new Error(a);return s.findAnswers(n.query,e.queryLanguages,i)},d.prototype.searchForFacetValues=function(e,t,r,n){var i="function"==typeof this.client.searchForFacetValues,s="function"==typeof this.client.initIndex;if(!i&&!s&&"function"!=typeof this.client.search)throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues");var c=this.state.setQueryParameters(n||{}),u=c.isDisjunctiveFacet(e),o=f.getSearchForFacetQuery(e,t,r,c);this._currentNbQueries++;var h,l=this;return i?h=this.client.searchForFacetValues([{indexName:c.index,params:o}]):s?h=this.client.initIndex(c.index).searchForFacetValues(o):(delete o.facetName,h=this.client.search([{type:"facet",facet:e,indexName:c.index,params:o}]).then((function(e){return e.results[0]}))),this.emit("searchForFacetValues",{state:c,facet:e,query:t}),h.then((function(t){return l._currentNbQueries--,0===l._currentNbQueries&&l.emit("searchQueueEmpty"),(t=Array.isArray(t)?t[0]:t).facetHits.forEach((function(t){t.escapedValue=a(t.value),t.isRefined=u?c.isDisjunctiveFacetRefined(e,t.escapedValue):c.isFacetRefined(e,t.escapedValue)})),t}),(function(e){throw l._currentNbQueries--,0===l._currentNbQueries&&l.emit("searchQueueEmpty"),e}))},d.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},d.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},d.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},d.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},d.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,r),isPageReset:!0}),this},d.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},d.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},d.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},d.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},d.prototype.removeNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,r),isPageReset:!0}),this},d.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},d.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},d.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},d.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},d.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},d.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},d.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},d.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},d.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},d.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},d.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},d.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},d.prototype.setCurrentPage=v,d.prototype.setPage=v,d.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},d.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},d.prototype.setState=function(e){return this._change({state:h.make(e),isPageReset:!1}),this},d.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new h(e),this},d.prototype.hasRefinements=function(e){return!!u(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},d.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},d.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},d.prototype.hasTag=function(e){return this.state.isTagRefined(e)},d.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},d.prototype.getIndex=function(){return this.state.index},d.prototype.getCurrentPage=p,d.prototype.getPage=p,d.prototype.getTags=function(){return this.state.tagRefinements},d.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e))this.state.getConjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"conjunctive"})})),this.state.getExcludeRefinements(e).forEach((function(e){t.push({value:e,type:"exclude"})}));else if(this.state.isDisjunctiveFacet(e)){this.state.getDisjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"disjunctive"})}))}var r=this.state.getNumericRefinements(e);return Object.keys(r).forEach((function(e){var n=r[e];t.push({value:n,operator:e,type:"numeric"})})),t},d.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},d.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},d.prototype._search=function(e){var t=this.state,r=[],n=[];e.onlyWithDerivedHelpers||(n=f._getQueries(t.index,t),r.push({state:t,queriesCount:n.length,helper:this}),this.emit("search",{state:t,results:this.lastResults}));var i=this.derivedHelpers.map((function(e){var n=e.getModifiedState(t),i=n.index?f._getQueries(n.index,n):[];return r.push({state:n,queriesCount:i.length,helper:e}),e.emit("search",{state:n,results:e.lastResults}),i})),a=Array.prototype.concat.apply(n,i),s=this._queryId++;if(this._currentNbQueries++,!a.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,r,s));try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,r,s)).catch(this._dispatchAlgoliaError.bind(this,s))}catch(c){this.emit("error",{error:c})}},d.prototype._dispatchAlgoliaResponse=function(e,t,r){var n=this;if(!(t0},d.prototype._change=function(e){var t=e.state,r=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:r}))},d.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},d.prototype.setClient=function(e){return this.client===e||("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+m+")"),this.client=e),this},d.prototype.getClient=function(){return this.client},d.prototype.derive=function(e){var t=new i(this,e);return this.derivedHelpers.push(t),t},d.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(-1===t)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)},d.prototype.hasPendingRequests=function(){return this._currentNbQueries>0},e.exports=d},160:function(e,t,r){"use strict";var n=r(133);function i(e,t){this.main=e,this.fn=t,this.lastResults=null}r(134)(i,n),i.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},i.prototype.getModifiedState=function(e){return this.fn(e)},e.exports=i},161:function(e,t,r){"use strict";var n=r(109);function i(e){return Object.keys(e).sort().reduce((function(t,r){return t[r]=e[r],t}),{})}var a={_getQueries:function(e,t){var r=[];return r.push({indexName:e,params:a._getHitsSearchParams(t)}),t.getRefinedDisjunctiveFacets().forEach((function(n){r.push({indexName:e,params:a._getDisjunctiveFacetSearchParams(t,n)})})),t.getRefinedHierarchicalFacets().forEach((function(n){var i=t.getHierarchicalFacetByName(n),s=t.getHierarchicalRefinement(n),c=t._getHierarchicalFacetSeparator(i);if(s.length>0&&s[0].split(c).length>1){var u=s[0].split(c).slice(0,-1).reduce((function(e,t,r){return e.concat({attribute:i.attributes[r],value:0===r?t:[e[e.length-1].value,t].join(c)})}),[]);u.forEach((function(n,s){var c=a._getDisjunctiveFacetSearchParams(t,n.attribute,0===s);function o(e){return i.attributes.some((function(t){return t===e.split(":")[0]}))}var f=(c.facetFilters||[]).reduce((function(e,t){if(Array.isArray(t)){var r=t.filter((function(e){return!o(e)}));r.length>0&&e.push(r)}return"string"!=typeof t||o(t)||e.push(t),e}),[]),h=u[s-1];c.facetFilters=s>0?f.concat(h.attribute+":"+h.value):f.length>0?f:void 0,r.push({indexName:e,params:c})}))}})),r},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(a._getHitsHierarchicalFacetsAttributes(e)).sort(),r=a._getFacetFilters(e),s=a._getNumericFilters(e),c=a._getTagFilters(e),u={facets:t.indexOf("*")>-1?["*"]:t,tagFilters:c};return r.length>0&&(u.facetFilters=r),s.length>0&&(u.numericFilters=s),i(n({},e.getQueryParams(),u))},_getDisjunctiveFacetSearchParams:function(e,t,r){var s=a._getFacetFilters(e,t,r),c=a._getNumericFilters(e,t),u=a._getTagFilters(e),o={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};u.length>0&&(o.tagFilters=u);var f=e.getHierarchicalFacetByName(t);return o.facets=f?a._getDisjunctiveHierarchicalFacetAttribute(e,f,r):t,c.length>0&&(o.numericFilters=c),s.length>0&&(o.facetFilters=s),i(n({},e.getQueryParams(),o))},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var r=[];return Object.keys(e.numericRefinements).forEach((function(n){var i=e.numericRefinements[n]||{};Object.keys(i).forEach((function(e){var a=i[e]||[];t!==n&&a.forEach((function(t){if(Array.isArray(t)){var i=t.map((function(t){return n+e+t}));r.push(i)}else r.push(n+e+t)}))}))})),r},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,r){var n=[],i=e.facetsRefinements||{};Object.keys(i).sort().forEach((function(e){(i[e]||[]).sort().forEach((function(t){n.push(e+":"+t)}))}));var a=e.facetsExcludes||{};Object.keys(a).sort().forEach((function(e){(a[e]||[]).sort().forEach((function(t){n.push(e+":-"+t)}))}));var s=e.disjunctiveFacetsRefinements||{};Object.keys(s).sort().forEach((function(e){var r=s[e]||[];if(e!==t&&r&&0!==r.length){var i=[];r.sort().forEach((function(t){i.push(e+":"+t)})),n.push(i)}}));var c=e.hierarchicalFacetsRefinements||{};return Object.keys(c).sort().forEach((function(i){var a=(c[i]||[])[0];if(void 0!==a){var s,u,o=e.getHierarchicalFacetByName(i),f=e._getHierarchicalFacetSeparator(o),h=e._getHierarchicalRootPath(o);if(t===i){if(-1===a.indexOf(f)||!h&&!0===r||h&&h.split(f).length===a.split(f).length)return;h?(u=h.split(f).length-1,a=h):(u=a.split(f).length-2,a=a.slice(0,a.lastIndexOf(f))),s=o.attributes[u]}else u=a.split(f).length-1,s=o.attributes[u];s&&n.push([s+":"+a])}})),n},_getHitsHierarchicalFacetsAttributes:function(e){return e.hierarchicalFacets.reduce((function(t,r){var n=e.getHierarchicalRefinement(r.name)[0];if(!n)return t.push(r.attributes[0]),t;var i=e._getHierarchicalFacetSeparator(r),a=n.split(i).length,s=r.attributes.slice(0,a+1);return t.concat(s)}),[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,r){var n=e._getHierarchicalFacetSeparator(t);if(!0===r){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(n).length),[t.attributes[a]]}var s=(e.getHierarchicalRefinement(t.name)[0]||"").split(n).length-1;return t.attributes.slice(0,s+1)},getSearchForFacetQuery:function(e,t,r,s){var c=s.isDisjunctiveFacet(e)?s.clearRefinements(e):s,u={facetQuery:t,facetName:e};return"number"==typeof r&&(u.maxFacetHits=r),i(n({},a._getHitsSearchParams(c),u))}};e.exports=a},162:function(e,t,r){"use strict";e.exports=function(e,t){return e.filter((function(r,n){return t.indexOf(r)>-1&&e.indexOf(r)===n}))}},163:function(e,t,r){"use strict";e.exports=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")}},164:function(e,t,r){"use strict";e.exports=function(e){return null!==e&&/^[a-zA-Z0-9_-]{1,64}$/.test(e)}},165:function(e,t,r){"use strict";var n=r(120),i=r(118),a=r(119),s={addRefinement:function(e,t,r){if(s.isRefined(e,t,r))return e;var i=""+r,a=e[t]?e[t].concat(i):[i],c={};return c[t]=a,n({},c,e)},removeRefinement:function(e,t,r){if(void 0===r)return s.clearRefinement(e,(function(e,r){return t===r}));var n=""+r;return s.clearRefinement(e,(function(e,r){return t===r&&n===e}))},toggleRefinement:function(e,t,r){if(void 0===r)throw new Error("toggleRefinement should be used with a value");return s.isRefined(e,t,r)?s.removeRefinement(e,t,r):s.addRefinement(e,t,r)},clearRefinement:function(e,t,r){if(void 0===t)return i(e)?{}:e;if("string"==typeof t)return a(e,[t]);if("function"==typeof t){var n=!1,s=Object.keys(e).reduce((function(i,a){var s=e[a]||[],c=s.filter((function(e){return!t(e,a,r)}));return c.length!==s.length&&(n=!0),i[a]=c,i}),{});return n?s:e}},isRefined:function(e,t,r){var n=Boolean(e[t])&&e[t].length>0;if(void 0===r||!n)return n;var i=""+r;return-1!==e[t].indexOf(i)}};e.exports=s},166:function(e,t,r){"use strict";e.exports=function(e){return Array.isArray(e)?e.filter(Boolean):[]}},167:function(e,t,r){"use strict";e.exports=function(e,t){if(!Array.isArray(e))return-1;for(var r=0;r0){var m=0;for(l=o;m0,versions:n,latestVersion:n[0]}}},170:function(e,t,r){e.exports=function(){"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var s,c=e[Symbol.iterator]();!(n=(s=c.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(i)throw a}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){c();var t=JSON.stringify(e);return a()[t]})).then((function(e){return Promise.all([e?e.value:t(),void 0!==e])})).then((function(e){var t=i(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var i=a();return i[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},n().setItem(r,JSON.stringify(i)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function c(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,i).catch((function(){return c({caches:t}).get(e,n,i)}))},set:function(e,n){return r.set(e,n).catch((function(){return c({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return c({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return c({caches:t}).clear()}))}}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var s=n(),c=i&&i.miss||function(){return Promise.resolve()};return s.then((function(e){return c(e)})).then((function(){return s}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function o(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function f(e,t){return t?(Object.keys(t).forEach((function(r){e[r]=t[r](e)})),e):e}function h(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var d={Read:1,Write:2,Any:3},v=1,p=2,g=3;function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return r(r({},e),{},{status:t,lastUpdate:Date.now()})}function R(e){return"string"==typeof e?{protocol:"https",url:e,accept:d.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||d.Any}}var F="GET",b="POST";function j(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(y(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===v||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===g&&Date.now()-e.lastUpdate<=12e4}(e)})),i=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:i.length>0?i.map((function(e){return R(e)})):t}}))}function P(e,t,n,i){var s=[],c=function(e,t){if(e.method!==F&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:r(r({},e.data),t.data);return JSON.stringify(n)}}(n,i),u=function(e,t){var n=r(r({},e.headers),t.headers),i={};return Object.keys(n).forEach((function(e){var t=n[e];i[e.toLowerCase()]=t})),i}(e,i),o=n.method,f=n.method!==F?{}:r(r({},n.data),i.data),h=r(r(r({"x-algolia-agent":e.userAgent.value},e.queryParameters),f),i.queryParameters),l=0,m=function t(r,a){var f=r.pop();if(void 0===f)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:O(s)};var m={data:c,headers:u,method:o,url:E(f,n.path,h),connectTimeout:a(l,e.timeouts.connect),responseTimeout:a(l,i.timeout)},d=function(e){var t={request:m,response:e,host:f,triesLeft:r.length};return s.push(t),t},v={onSuccess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var i=d(n);return n.isTimedOut&&l++,Promise.all([e.logger.info("Retryable failure",w(i)),e.hostsCache.set(f,y(f,n.isTimedOut?g:p))]).then((function(){return t(r,a)}))},onFail:function(e){throw d(e),function(e,t){var r=e.content,n=e.status,i=r;try{i=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(i,n,t)}(e,O(s))}};return e.requester.send(m).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&0==~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSuccess(e):t.onFail(e)}(e,v)}))};return j(e.hostsCache,t).then((function(e){return m(a(e.statelessHosts).reverse(),e.getTimeout)}))}function _(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var r="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(r)&&(t.value="".concat(t.value).concat(r)),t}};return t}function E(e,t,r){var n=x(r),i="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(i+="?".concat(n)),i}function x(e){return Object.keys(e).map((function(t){return h("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function O(e){return e.map((function(e){return w(e)}))}function w(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return r(r({},e),{},{request:r(r({},e.request),{},{headers:r(r({},e.request.headers),t)})})}var N=function(e){var t=e.appId,n=function(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===l.WithinHeaders?n:{}},queryParameters:function(){return e===l.WithinQueryParameters?n:{}}}}(void 0!==e.authMode?e.authMode:l.WithinHeaders,t,e.apiKey),a=function(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,s=e.responsesCache,c=e.timeouts,u=e.userAgent,o=e.hosts,f=e.queryParameters,h={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:s,timeouts:c,userAgent:u,headers:e.headers,queryParameters:f,hosts:o.map((function(e){return R(e)})),read:function(e,t){var r=m(t,h.timeouts.read),n=function(){return P(h,h.hosts.filter((function(e){return 0!=(e.accept&d.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:h.queryParameters,headers:h.headers}};return h.responsesCache.get(a,(function(){return h.requestsCache.get(a,(function(){return h.requestsCache.set(a,n()).then((function(e){return Promise.all([h.requestsCache.delete(a),e])}),(function(e){return Promise.all([h.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=i(e,2);return t[0],t[1]}))}))}),{miss:function(e){return h.responsesCache.set(a,e)}})},write:function(e,t){return P(h,h.hosts.filter((function(e){return 0!=(e.accept&d.Write)})),e,m(t,h.timeouts.write))}};return h}(r(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:d.Read},{url:"".concat(t,".algolia.net"),accept:d.Write}].concat(o([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return f({transporter:a,appId:t,addAlgoliaAgent:function(e,t){a.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then((function(){}))}},e.methods)},H=function(e){return function(t,r){return t.method===F?e.transporter.read(t,r):e.transporter.write(t,r)}},A=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return f({transporter:e.transporter,appId:e.appId,indexName:t},r.methods)}},S=function(e){return function(t,n){var i=t.map((function(e){return r(r({},e),{},{params:x(e.params||{})})}));return e.transporter.read({method:b,path:"1/indexes/*/queries",data:{requests:i},cacheable:!0},n)}},Q=function(e){return function(t,i){return Promise.all(t.map((function(t){var a=t.params,s=a.facetName,c=a.facetQuery,u=n(a,["facetName","facetQuery"]);return A(e)(t.indexName,{methods:{searchForFacetValues:k}}).searchForFacetValues(s,c,r(r({},i),u))})))}},T=function(e){return function(t,r,n){return e.transporter.read({method:b,path:h("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n)}},C=function(e){return function(t,r){return e.transporter.read({method:b,path:h("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},k=function(e){return function(t,r,n){return e.transporter.read({method:b,path:h("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},D=1,q=2,I=3;function L(e,t,n){var i,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,i=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=i(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=i(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(i=I,{debug:function(e,t){return D>=i&&console.debug(e,t),Promise.resolve()},info:function(e,t){return q>=i&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:c({caches:[s({key:"".concat("4.22.1","-").concat(e)}),u()]}),userAgent:_("4.22.1").add({segment:"Browser",version:"lite"}),authMode:l.WithinQueryParameters};return N(r(r(r({},a),n),{},{methods:{search:S,searchForFacetValues:Q,multipleQueries:S,multipleSearchForFacetValues:Q,customRequest:H,initIndex:function(e){return function(t){return A(e)(t,{methods:{search:C,searchForFacetValues:k,findAnswers:T}})}}}}))}return L.version="4.22.1",L}()},75:function(e,t,r){"use strict";r.r(t);var n=r(0),i=r.n(n),a=r(170),s=r.n(a),c=r(158),u=r.n(c),o=r(94),f=r(104),h=r(10),l=r(96),m=r(169),d=r.n(m),v=r(125),p=r(99),g=r(100),y=r(76),R=r.n(y);t.default=function(){var e=Object(l.a)().siteConfig,t=(void 0===e?{}:e).themeConfig.algolia,r=void 0===t?{}:t,a=r.appId,c=void 0===a?"BH4D9OD16A":a,m=r.apiKey,y=r.indexName,F=Object(v.a)(),b=F.searchValue,j=F.updateSearchPath,P=d()(),_=P.versioningEnabled,E=P.versions,x=P.latestVersion,O=Object(n.useState)(x),w=O[0],N=O[1],H=Object(n.useState)(b),A=H[0],S=H[1],Q={items:[],query:null,totalResults:null,totalPages:null,lastPage:null,hasMore:null,loading:null},T=Object(n.useReducer)((function(e,t){var r=t.type,n=t.value;switch(r){case"reset":return Q;case"loading":return Object.assign({},e,{loading:!0});case"update":return A!==n.query?e:Object.assign({},n,{items:0===n.lastPage?n.items:e.items.concat(n.items)});case"advance":var i=e.totalPages>e.lastPage+1;return Object.assign({},e,{lastPage:i?e.lastPage+1:e.lastPage,hasMore:i});default:return e}}),Q),C=T[0],k=T[1],D=s()(c,m),q=u()(D,y,{hitsPerPage:15,advancedSyntax:!0,facets:w?["version"]:[]});q.on("result",(function(e){var t=e.results,r=t.query,n=t.hits,i=t.page,a=t.nbHits,s=t.nbPages;if(""!==r&&n instanceof Array){var c=function(e){return e.replace(/algolia-docsearch-suggestion--highlight/g,"search-result-match")},u=n.map((function(e){var t=e.url,r=e._highlightResult.hierarchy,n=e._snippetResult,i=void 0===n?{}:n,a=new URL(t),s=a.pathname,u=a.hash,o=Object.keys(r).map((function(e){return c(r[e].value)}));return{title:o.pop(),url:s+u,summary:i.content?c(i.content.value)+"...":"",breadcrumbs:o}}));k({type:"update",value:{items:u,query:r,totalResults:a,totalPages:s,lastPage:i,hasMore:s>i+1,loading:!1}})}else k({type:"reset"})}));var I,L,V=Object(n.useState)(null),B=V[0],M=V[1],z=Object(n.useRef)(0),J=Object(n.useRef)(h.a.canUseDOM&&new IntersectionObserver((function(e){var t=e[0],r=t.isIntersecting,n=t.boundingClientRect.y;r&&z.current>n&&k({type:"advance"}),z.current=n}),{threshold:1})),W=function(){return A?'Search results for "'+A+'"':"Search the documentation"},U=function(e){void 0===e&&(e=0),w?q.setQuery(A).addFacetRefinement("version",w).setPage(e).search():q.setQuery(A).setPage(e).search()},K=function(e){var t=e.target.value;"SELECT"===e.target.tagName?N(t):S(t)};return Object(n.useEffect)((function(){if(B)return J.current.observe(B),function(){J.current.unobserve(B)}}),[B]),Object(n.useEffect)((function(){j(A),k({type:"reset"}),A&&(k({type:"loading"}),setTimeout((function(){U()}),300))}),[A,w]),Object(n.useEffect)((function(){C.lastPage&&0!==C.lastPage&&U(C.lastPage)}),[C.lastPage]),Object(n.useEffect)((function(){b&&b!==A&&S(b)}),[b]),i.a.createElement(g.a,{title:W()},i.a.createElement(f.a,null,i.a.createElement("meta",{property:"robots",content:"noindex, follow"})),i.a.createElement("div",{className:"container margin-vert--lg"},i.a.createElement("h1",null,W()),i.a.createElement("form",{className:"row",onSubmit:function(e){return e.preventDefault()}},i.a.createElement("div",{className:Object(o.a)("col",R.a.searchQueryColumn,{"col--9":_,"col--12":!_})},i.a.createElement("input",{type:"search",name:"q",className:R.a.searchQueryInput,placeholder:"Type your search here","aria-label":"Search",onChange:K,value:A,autoComplete:"off",autoFocus:!0})),_&&i.a.createElement("div",{className:Object(o.a)("col","col--3","padding-left--none",R.a.searchVersionColumn)},i.a.createElement("select",{onChange:K,defaultValue:w,className:R.a.searchVersionInput},E.map((function(e,t){return i.a.createElement("option",{key:t,value:e},e)}))))),i.a.createElement("div",{className:Object(o.a)("row","margin-vert--sm")},i.a.createElement("div",{className:Object(o.a)("col","col--8",R.a.searchResultsColumn)},!!C.totalResults&&i.a.createElement("strong",null,C.totalResults," ",(I=C.totalResults,L="document",I>1?L+"s":L)," found")),i.a.createElement("div",{className:Object(o.a)("col","col--4",R.a.searchLogoColumn)},i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://www.algolia.com/","aria-label":"Search"},i.a.createElement("svg",{viewBox:"0 0 168 24",className:R.a.algoliaLogo,xmlns:"http://www.w3.org/2000/svg","aria-label":"Search by Algolia"},i.a.createElement("g",{fill:"none"},i.a.createElement("path",{className:R.a.algoliaLogoPathFill,d:"M120.925 18.804c-4.386.02-4.386-3.54-4.386-4.106l-.007-13.336 2.675-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-10.846-2.18c.821 0 1.43-.047 1.855-.129v-2.719a6.334 6.334 0 0 0-1.574-.199 5.7 5.7 0 0 0-.897.069 2.699 2.699 0 0 0-.814.24c-.24.116-.439.28-.582.491-.15.212-.219.335-.219.656 0 .628.219.991.616 1.23s.938.362 1.615.362zm-.233-9.7c.883 0 1.629.109 2.231.328.602.218 1.088.525 1.444.915.363.396.609.922.76 1.483.157.56.232 1.175.232 1.85v6.874a32.5 32.5 0 0 1-1.868.314c-.834.123-1.772.185-2.813.185-.69 0-1.327-.069-1.895-.198a4.001 4.001 0 0 1-1.471-.636 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.803 0-.656.13-1.073.384-1.525a3.24 3.24 0 0 1 1.047-1.106c.445-.287.95-.492 1.532-.615a8.8 8.8 0 0 1 1.82-.185 8.404 8.404 0 0 1 1.972.24v-.438c0-.307-.035-.6-.11-.874a1.88 1.88 0 0 0-.384-.73 1.784 1.784 0 0 0-.724-.493 3.164 3.164 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.735 7.735 0 0 0-1.26.307l-.321-2.192c.335-.117.834-.233 1.478-.349a10.98 10.98 0 0 1 2.073-.178zm52.842 9.626c.822 0 1.43-.048 1.854-.13V13.7a6.347 6.347 0 0 0-1.574-.199c-.294 0-.595.021-.896.069a2.7 2.7 0 0 0-.814.24 1.46 1.46 0 0 0-.582.491c-.15.212-.218.335-.218.656 0 .628.218.991.615 1.23.404.245.938.362 1.615.362zm-.226-9.694c.883 0 1.629.108 2.231.327.602.219 1.088.526 1.444.915.355.39.609.923.759 1.483a6.8 6.8 0 0 1 .233 1.852v6.873c-.41.088-1.034.19-1.868.314-.834.123-1.772.184-2.813.184-.69 0-1.327-.068-1.895-.198a4.001 4.001 0 0 1-1.471-.635 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.804 0-.656.13-1.073.384-1.524.26-.45.608-.82 1.047-1.107.445-.286.95-.491 1.532-.614a8.803 8.803 0 0 1 2.751-.13c.329.034.671.096 1.04.185v-.437a3.3 3.3 0 0 0-.109-.875 1.873 1.873 0 0 0-.384-.731 1.784 1.784 0 0 0-.724-.492 3.165 3.165 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.75 7.75 0 0 0-1.26.307l-.321-2.193c.335-.116.834-.232 1.478-.348a11.633 11.633 0 0 1 2.073-.177zm-8.034-1.271a1.626 1.626 0 0 1-1.628-1.62c0-.895.725-1.62 1.628-1.62.904 0 1.63.725 1.63 1.62 0 .895-.733 1.62-1.63 1.62zm1.348 13.22h-2.689V7.27l2.69-.423v11.956zm-4.714 0c-4.386.02-4.386-3.54-4.386-4.107l-.008-13.336 2.676-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-8.698-5.903c0-1.156-.253-2.119-.746-2.788-.493-.677-1.183-1.01-2.067-1.01-.882 0-1.574.333-2.065 1.01-.493.676-.733 1.632-.733 2.788 0 1.168.246 1.953.74 2.63.492.683 1.183 1.018 2.066 1.018.882 0 1.574-.342 2.067-1.019.492-.683.738-1.46.738-2.63zm2.737-.007c0 .902-.13 1.584-.397 2.33a5.52 5.52 0 0 1-1.128 1.906 4.986 4.986 0 0 1-1.752 1.223c-.685.286-1.739.45-2.265.45-.528-.006-1.574-.157-2.252-.45a5.096 5.096 0 0 1-1.744-1.223c-.487-.527-.863-1.162-1.137-1.906a6.345 6.345 0 0 1-.41-2.33c0-.902.123-1.77.397-2.508a5.554 5.554 0 0 1 1.15-1.892 5.133 5.133 0 0 1 1.75-1.216c.679-.287 1.425-.423 2.232-.423.808 0 1.553.142 2.237.423a4.88 4.88 0 0 1 1.753 1.216 5.644 5.644 0 0 1 1.135 1.892c.287.738.431 1.606.431 2.508zm-20.138 0c0 1.12.246 2.363.738 2.882.493.52 1.13.78 1.91.78.424 0 .828-.062 1.204-.178.377-.116.677-.253.917-.417V9.33a10.476 10.476 0 0 0-1.766-.226c-.971-.028-1.71.37-2.23 1.004-.513.636-.773 1.75-.773 2.788zm7.438 5.274c0 1.824-.466 3.156-1.404 4.004-.936.846-2.367 1.27-4.296 1.27-.705 0-2.17-.137-3.34-.396l.431-2.118c.98.205 2.272.26 2.95.26 1.074 0 1.84-.219 2.299-.656.459-.437.684-1.086.684-1.948v-.437a8.07 8.07 0 0 1-1.047.397c-.43.13-.93.198-1.492.198-.739 0-1.41-.116-2.018-.349a4.206 4.206 0 0 1-1.567-1.025c-.431-.45-.774-1.017-1.013-1.694-.24-.677-.363-1.885-.363-2.773 0-.834.13-1.88.384-2.577.26-.696.629-1.298 1.129-1.796.493-.498 1.095-.881 1.8-1.162a6.605 6.605 0 0 1 2.428-.457c.87 0 1.67.109 2.45.24.78.129 1.444.265 1.985.415V18.17zM6.972 6.677v1.627c-.712-.446-1.52-.67-2.425-.67-.585 0-1.045.13-1.38.391a1.24 1.24 0 0 0-.502 1.03c0 .425.164.765.494 1.02.33.256.835.532 1.516.83.447.192.795.356 1.045.495.25.138.537.332.862.582.324.25.563.548.718.894.154.345.23.741.23 1.188 0 .947-.334 1.691-1.004 2.234-.67.542-1.537.814-2.601.814-1.18 0-2.16-.229-2.936-.686v-1.708c.84.628 1.814.942 2.92.942.585 0 1.048-.136 1.388-.407.34-.271.51-.646.51-1.125 0-.287-.1-.55-.302-.79-.203-.24-.42-.42-.655-.542-.234-.123-.585-.29-1.053-.503a61.27 61.27 0 0 1-.582-.271 13.67 13.67 0 0 1-.55-.287 4.275 4.275 0 0 1-.567-.351 6.92 6.92 0 0 1-.455-.4c-.18-.17-.31-.34-.39-.51-.08-.17-.155-.37-.224-.598a2.553 2.553 0 0 1-.104-.742c0-.915.333-1.638.998-2.17.664-.532 1.523-.798 2.576-.798.968 0 1.793.17 2.473.51zm7.468 5.696v-.287c-.022-.607-.187-1.088-.495-1.444-.309-.357-.75-.535-1.324-.535-.532 0-.99.194-1.373.583-.382.388-.622.949-.717 1.683h3.909zm1.005 2.792v1.404c-.596.34-1.383.51-2.362.51-1.255 0-2.255-.377-3-1.132-.744-.755-1.116-1.744-1.116-2.968 0-1.297.34-2.316 1.021-3.055.68-.74 1.548-1.11 2.6-1.11 1.033 0 1.852.323 2.458.966.606.644.91 1.572.91 2.784 0 .33-.033.676-.096 1.038h-5.314c.107.702.405 1.239.894 1.611.49.372 1.106.558 1.85.558.862 0 1.58-.202 2.155-.606zm6.605-1.77h-1.212c-.596 0-1.045.116-1.349.35-.303.234-.454.532-.454.894 0 .372.117.664.35.877.235.213.575.32 1.022.32.51 0 .912-.142 1.204-.424.293-.281.44-.651.44-1.108v-.91zm-4.068-2.554V9.325c.627-.361 1.457-.542 2.489-.542 2.116 0 3.175 1.026 3.175 3.08V17h-1.548v-.957c-.415.68-1.143 1.02-2.186 1.02-.766 0-1.38-.22-1.843-.661-.462-.442-.694-1.003-.694-1.684 0-.776.293-1.38.878-1.81.585-.431 1.404-.647 2.457-.647h1.34V11.8c0-.554-.133-.971-.399-1.253-.266-.282-.707-.423-1.324-.423a4.07 4.07 0 0 0-2.345.718zm9.333-1.93v1.42c.394-1 1.101-1.5 2.123-1.5.148 0 .313.016.494.048v1.531a1.885 1.885 0 0 0-.75-.143c-.542 0-.989.24-1.34.718-.351.479-.527 1.048-.527 1.707V17h-1.563V8.91h1.563zm5.01 4.084c.022.82.272 1.492.75 2.019.479.526 1.15.79 2.01.79.639 0 1.235-.176 1.788-.527v1.404c-.521.319-1.186.479-1.995.479-1.265 0-2.276-.4-3.031-1.197-.755-.798-1.133-1.792-1.133-2.984 0-1.16.38-2.151 1.14-2.975.761-.825 1.79-1.237 3.088-1.237.702 0 1.346.149 1.93.447v1.436a3.242 3.242 0 0 0-1.77-.495c-.84 0-1.513.266-2.019.798-.505.532-.758 1.213-.758 2.042zM40.24 5.72v4.579c.458-1 1.293-1.5 2.505-1.5.787 0 1.42.245 1.899.734.479.49.718 1.17.718 2.042V17h-1.564v-5.106c0-.553-.14-.98-.422-1.284-.282-.303-.652-.455-1.11-.455-.531 0-1.002.202-1.411.606-.41.405-.615 1.022-.615 1.851V17h-1.563V5.72h1.563zm14.966 10.02c.596 0 1.096-.253 1.5-.758.404-.506.606-1.157.606-1.955 0-.915-.202-1.62-.606-2.114-.404-.495-.92-.742-1.548-.742-.553 0-1.05.224-1.491.67-.442.447-.662 1.133-.662 2.058 0 .958.212 1.67.638 2.138.425.469.946.703 1.563.703zM53.004 5.72v4.42c.574-.894 1.388-1.341 2.44-1.341 1.022 0 1.857.383 2.506 1.149.649.766.973 1.781.973 3.047 0 1.138-.309 2.109-.925 2.912-.617.803-1.463 1.205-2.537 1.205-1.075 0-1.894-.447-2.457-1.34V17h-1.58V5.72h1.58zm9.908 11.104l-3.223-7.913h1.739l1.005 2.632 1.26 3.415c.096-.32.48-1.458 1.15-3.415l.909-2.632h1.66l-2.92 7.866c-.777 2.074-1.963 3.11-3.559 3.11a2.92 2.92 0 0 1-.734-.079v-1.34c.17.042.351.064.543.064 1.032 0 1.755-.57 2.17-1.708z"}),i.a.createElement("path",{fill:"#5468FF",d:"M78.988.938h16.594a2.968 2.968 0 0 1 2.966 2.966V20.5a2.967 2.967 0 0 1-2.966 2.964H78.988a2.967 2.967 0 0 1-2.966-2.964V3.897A2.961 2.961 0 0 1 78.988.938z"}),i.a.createElement("path",{fill:"white",d:"M89.632 5.967v-.772a.978.978 0 0 0-.978-.977h-2.28a.978.978 0 0 0-.978.977v.793c0 .088.082.15.171.13a7.127 7.127 0 0 1 1.984-.28c.65 0 1.295.088 1.917.259.082.02.164-.04.164-.13m-6.248 1.01l-.39-.389a.977.977 0 0 0-1.382 0l-.465.465a.973.973 0 0 0 0 1.38l.383.383c.062.061.15.047.205-.014.226-.307.472-.601.746-.874.281-.28.568-.526.883-.751.068-.042.075-.137.02-.2m4.16 2.453v3.341c0 .096.104.165.192.117l2.97-1.537c.068-.034.089-.117.055-.184a3.695 3.695 0 0 0-3.08-1.866c-.068 0-.136.054-.136.13m0 8.048a4.489 4.489 0 0 1-4.49-4.482 4.488 4.488 0 0 1 4.49-4.482 4.488 4.488 0 0 1 4.489 4.482 4.484 4.484 0 0 1-4.49 4.482m0-10.85a6.363 6.363 0 1 0 0 12.729 6.37 6.37 0 0 0 6.372-6.368 6.358 6.358 0 0 0-6.371-6.36"})))))),C.items.length>0?i.a.createElement("section",null,C.items.map((function(e,t){var r=e.title,n=e.url,a=e.summary,s=e.breadcrumbs;return i.a.createElement("article",{key:t,className:R.a.searchResultItem},i.a.createElement(p.a,{to:n,className:R.a.searchResultItemHeading,dangerouslySetInnerHTML:{__html:r}}),s.length>0&&i.a.createElement("span",{className:R.a.searchResultItemPath,dangerouslySetInnerHTML:{__html:s.join(" \u203a ")}}),a&&i.a.createElement("p",{className:R.a.searchResultItemSummary,dangerouslySetInnerHTML:{__html:a}}))}))):[A&&!C.loading&&i.a.createElement("p",{key:"no-results"},"No results were found"),!!C.loading&&i.a.createElement("div",{key:"spinner",className:R.a.loadingSpinner})],C.hasMore&&i.a.createElement("div",{className:R.a.loader,ref:M},i.a.createElement("span",null,"Fetching new results..."))))}}}]); \ No newline at end of file diff --git a/build/31ee3e38.68a53005.js b/build/31ee3e38.68a53005.js deleted file mode 100644 index 4b42742..0000000 --- a/build/31ee3e38.68a53005.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{71:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return i})),a.d(t,"metadata",(function(){return s})),a.d(t,"rightToc",(function(){return l})),a.d(t,"default",(function(){return d}));var o=a(2),r=a(6),n=(a(0),a(93)),b=["components"],i={title:"Examples"},s={unversionedId:"examples",id:"examples",isDocsHomePage:!1,title:"Examples",description:"- Counter Open in CodeSandbox",source:"@site/main/docs/examples.md",slug:"/examples",permalink:"/docs/examples",editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/examples.md",version:"current"},l=[],p={rightToc:l},c="wrapper";function d(e){var t=e.components,a=Object(r.a)(e,b);return Object(n.b)(c,Object(o.a)({},p,a,{components:t,mdxType:"MDXLayout"}),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},Object(n.b)("p",{parentName:"li"},Object(n.b)("a",{parentName:"p",href:"https://github.com/xoidlabs/xoid/blob/master/examples/counter"},"Counter")," ",Object(n.b)("a",{parentName:"p",href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/counter"},Object(n.b)("img",{parentName:"a",src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})))),Object(n.b)("li",{parentName:"ul"},Object(n.b)("p",{parentName:"li"},Object(n.b)("a",{parentName:"p",href:"https://github.com/xoidlabs/xoid/blob/master/examples/todos-basic"},"Todos (Basic)")," ",Object(n.b)("a",{parentName:"p",href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/todos-basic"},Object(n.b)("img",{parentName:"a",src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})))),Object(n.b)("li",{parentName:"ul"},Object(n.b)("p",{parentName:"li"},Object(n.b)("a",{parentName:"p",href:"https://github.com/xoidlabs/xoid/blob/master/examples/todos-filtered"},"Todos (Filtered)")," ",Object(n.b)("a",{parentName:"p",href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/todos-filtered"},Object(n.b)("img",{parentName:"a",src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})))),Object(n.b)("li",{parentName:"ul"},Object(n.b)("p",{parentName:"li"},Object(n.b)("a",{parentName:"p",href:"https://github.com/xoidlabs/xoid/blob/master/examples/celcius-fahrenheit"},"Celcius-Fahrenheit conversion")," ",Object(n.b)("a",{parentName:"p",href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/celcius-fahrenheit"},Object(n.b)("img",{parentName:"a",src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})))),Object(n.b)("li",{parentName:"ul"},Object(n.b)("p",{parentName:"li"},Object(n.b)("a",{parentName:"p",href:"https://github.com/xoidlabs/xoid/blob/master/examples/finite-state-stopwatch"},"Finite state stopwatch")," ",Object(n.b)("a",{parentName:"p",href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/finite-state-stopwatch"},Object(n.b)("img",{parentName:"a",src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})))),Object(n.b)("li",{parentName:"ul"},Object(n.b)("p",{parentName:"li"},Object(n.b)("a",{parentName:"p",href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/dots-and-arrows"},"Dots and arrows")," ",Object(n.b)("a",{parentName:"p",href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/dots-and-arrows"},Object(n.b)("img",{parentName:"a",src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})))),Object(n.b)("li",{parentName:"ul"},Object(n.b)("p",{parentName:"li"},Object(n.b)("a",{parentName:"p",href:"https://github.com/xoidlabs/xoid/blob/master/examples/transient-update-resize-observer"},"Transient update resize observer")," ",Object(n.b)("a",{parentName:"p",href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/transient-update-resize-observer"},Object(n.b)("img",{parentName:"a",src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})))),Object(n.b)("li",{parentName:"ul"},Object(n.b)("p",{parentName:"li"},Object(n.b)("a",{parentName:"p",href:"https://github.com/xoidlabs/xoid/tree/master/examples/xoid-vs-usereducer-vs-usemethods"},"xoid vs useReducer vs useMethods")," ",Object(n.b)("a",{parentName:"p",href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/xoid-vs-usereducer-vs-usemethods"},Object(n.b)("img",{parentName:"a",src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"}))))))}d.isMDXComponent=!0},93:function(e,t,a){"use strict";a.d(t,"a",(function(){return c})),a.d(t,"b",(function(){return x}));var o=a(0),r=a.n(o);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function b(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var l=r.a.createContext({}),p=function(e){var t=r.a.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},c=function(e){var t=p(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},u=r.a.forwardRef((function(e,t){var a=e.components,o=e.mdxType,n=e.originalType,b=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),c=p(a),d=o,u=c["".concat(b,".").concat(d)]||c[d]||m[d]||n;return a?r.a.createElement(u,i(i({ref:t},l),{},{components:a})):r.a.createElement(u,i({ref:t},l))}));function x(e,t){var a=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var n=a.length,b=new Array(n);b[0]=u;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[d]="string"==typeof e?e:o,b[1]=i;for(var l=2;l{const n=document.createElement("textarea"),r=document.activeElement;n.value=e,n.setAttribute("readonly",""),n.style.contain="strict",n.style.position="absolute",n.style.left="-9999px",n.style.fontSize="12pt";const a=document.getSelection();let i=!1;a.rangeCount>0&&(i=a.getRangeAt(0)),t.append(n),n.select(),n.selectionStart=0,n.selectionEnd=e.length;let o=!1;try{o=document.execCommand("copy")}catch(s){}return n.remove(),i&&(a.removeAllRanges(),a.addRange(i)),r&&r.focus(),o};e.exports=r,e.exports.default=r},116:function(e,t){e.exports.parse=function(e){var t=e.split(",").map((function(e){return function(e){if(/^-?\d+$/.test(e))return parseInt(e,10);var t;if(t=e.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){var n=t[1],r=t[2],a=t[3];if(n&&a){var i=[],o=(n=parseInt(n))<(a=parseInt(a))?1:-1;"-"!=r&&".."!=r&&"\u2025"!=r||(a+=o);for(var s=n;s!=a;s+=o)i.push(s);return i}}return[]}(e)}));return 0===t.length?[]:1===t.length?Array.isArray(t[0])?t[0]:t:t.reduce((function(e,t){return Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]),e.concat(t)}))}},123:function(e,t,n){"use strict";var r=n(2),a=n(0),i=n.n(a),o=n(94),s={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},l={Prism:n(18).a,theme:s};function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(){return u=Object.assign||function(e){for(var t=1;t0&&e[n-1]===t?e:e.concat(t)};function h(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}var f=function(e){function t(){for(var t=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];e.apply(this,n),c(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var n=e.theme?function(e,t){var n=e.plain,r=Object.create(null),a=e.styles.reduce((function(e,n){var r=n.languages,a=n.style;return r&&!r.includes(t)||n.types.forEach((function(t){var n=u({},e[t],a);e[t]=n})),e}),r);return a.root=n,a.plain=u({},n,{backgroundColor:null}),a}(e.theme,e.language):void 0;return t.themeDict=n})),c(this,"getLineProps",(function(e){var n=e.key,r=e.className,a=e.style,i=u({},h(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),o=t.getThemeDict(t.props);return void 0!==o&&(i.style=o.plain),void 0!==a&&(i.style=void 0!==i.style?u({},i.style,a):a),void 0!==n&&(i.key=n),r&&(i.className+=" "+r),i})),c(this,"getStyleForToken",(function(e){var n=e.types,r=e.empty,a=n.length,i=t.getThemeDict(t.props);if(void 0!==i){if(1===a&&"plain"===n[0])return r?{display:"inline-block"}:void 0;if(1===a&&!r)return i[n[0]];var o=r?{display:"inline-block"}:{},s=n.map((function(e){return i[e]}));return Object.assign.apply(Object,[o].concat(s))}})),c(this,"getTokenProps",(function(e){var n=e.key,r=e.className,a=e.style,i=e.token,o=u({},h(e,["key","className","style","token"]),{className:"token "+i.types.join(" "),children:i.content,style:t.getStyleForToken(i),key:void 0});return void 0!==a&&(o.style=void 0!==o.style?u({},o.style,a):a),void 0!==n&&(o.key=n),r&&(o.className+=" "+r),o})),c(this,"tokenize",(function(e,t,n,r){var a={code:t,grammar:n,language:r,tokens:[]};e.hooks.run("before-tokenize",a);var i=a.tokens=e.tokenize(a.code,a.grammar,a.language);return e.hooks.run("after-tokenize",a),i}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,n=e.language,r=e.code,a=e.children,i=this.getThemeDict(this.props),o=t.languages[n];return a({tokens:function(e){for(var t=[[]],n=[e],r=[0],a=[e.length],i=0,o=0,s=[],l=[s];o>-1;){for(;(i=r[o]++)0?u:["plain"],c=h):(u=d(u,h.type),h.alias&&(u=d(u,h.alias)),c=h.content),"string"==typeof c){var f=c.split(p),m=f.length;s.push({types:u,content:f[0]});for(var b=1;b0}))}s&&E.test(s)&&(x=s.match(E)[0].split("title=")[1].replace(/"+/g,""));var C=n&&n.replace(/language-/,"");!C&&c.defaultLanguage&&(C=c.defaultLanguage);var j=t.replace(/\n$/,"");if(0===k.length&&void 0!==C){for(var T,R="",O=function(e){switch(e){case"js":case"javascript":case"ts":case"typescript":return z(["js","jsBlock"]);case"jsx":case"tsx":return z(["js","jsBlock","jsx"]);case"html":return z(["js","jsBlock","html"]);case"python":case"py":return z(["python"]);default:return z()}}(C),L=t.replace(/\n$/,"").split("\n"),M=0;M{const t=function(e){const t=e.reduce(((e,t)=>[...e,...Array.from(t.addedNodes),...Array.from(t.removedNodes)]),[]);return!t.every((e=>"#comment"===e.nodeName))&&e.reduce(((e,t)=>{if(!1===e)return!1;if(t.target instanceof Element){if(S(t.target),!e.has(t.target)){e.add(t.target);for(let n=0;nfunction(e){var t;const n=e.isConnected,r=a.has(e);n&&i.has(e)&&i.delete(e);o.has(e)&&(null===(t=o.get(e))||void 0===t||t.cancel());b in e?L(e):r&&n?function(e){const t=a.get(e),n=F(e);if(!j(e))return a.set(e,n);let r;if(!t)return;const i=E(e);if("function"!=typeof i){const a=t.left-n.left,o=t.top-n.top,[s,l,c,u]=z(e,t,n),p={transform:`translate(${a}px, ${o}px)`},g={transform:"translate(0, 0)"};s!==l&&(p.width=`${s}px`,g.width=`${l}px`),c!==u&&(p.height=`${c}px`,g.height=`${u}px`),r=e.animate([p,g],{duration:i.duration,easing:i.easing})}else{const[a]=R(i(e,"remain",t,n));r=new Animation(a),r.play()}o.set(e,r),a.set(e,n),r.addEventListener("finish",y.bind(null,e))}(e):r&&!n?function(e){var t;if(!i.has(e)||!a.has(e))return;const[n,r]=i.get(e);Object.defineProperty(e,m,{value:!0,configurable:!0});const s=window.scrollX,l=window.scrollY;r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):n&&n.parentNode?n.parentNode.appendChild(e):null===(t=C(e))||void 0===t||t.appendChild(e);if(!j(e))return M(e);const[c,u,p,f]=function(e){const t=a.get(e),[n,,r]=z(e,t,F(e));let i=e.parentElement;for(;i&&("static"===getComputedStyle(i).position||i instanceof HTMLBodyElement);)i=i.parentElement;i||(i=document.body);const o=getComputedStyle(i),s=a.get(i)||F(i),l=Math.round(t.top-s.top)-$(o.borderTopWidth),c=Math.round(t.left-s.left)-$(o.borderLeftWidth);return[l,c,n,r]}(e),b=E(e),v=a.get(e);s===d&&l===h||function(e,t,n,r){const a=d-t,i=h-n,o=document.documentElement.style.scrollBehavior;"smooth"===getComputedStyle(g).scrollBehavior&&(document.documentElement.style.scrollBehavior="auto");if(window.scrollTo(window.scrollX+a,window.scrollY+i),!e.parentElement)return;const s=e.parentElement;let l=s.clientHeight,c=s.clientWidth;const u=performance.now();function p(){requestAnimationFrame((()=>{if(!O(r)){const e=l-s.clientHeight,t=c-s.clientWidth;u+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-t,top:window.scrollY-e}),l=s.clientHeight,c=s.clientWidth,p()):document.documentElement.style.scrollBehavior=o}}))}p()}(e,s,l,b);let k,y={position:"absolute",top:`${c}px`,left:`${u}px`,width:`${p}px`,height:`${f}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(O(b)){const[t,n]=R(b(e,"remove",v));!1!==(null==n?void 0:n.styleReset)&&(y=(null==n?void 0:n.styleReset)||y,Object.assign(e.style,y)),k=new Animation(t),k.play()}else Object.assign(e.style,y),k=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:b.duration,easing:"ease-out"});o.set(e,k),k.addEventListener("finish",M.bind(null,e,y))}(e):L(e)}(e)))},k=e=>{e.forEach((e=>{e.target===g&&(clearTimeout(u.get(g)),u.set(g,setTimeout((()=>{r.forEach((e=>T(e,(e=>w((()=>y(e)))))))}),100))),a.has(e.target)&&y(e.target)}))};function y(e){clearTimeout(u.get(e));const t=E(e),n=O(t)?500:t.duration;u.set(e,setTimeout((async()=>{const t=o.get(e);try{await(null==t?void 0:t.finished),a.set(e,F(e)),function(e){const t=s.get(e);null==t||t.disconnect();let n=a.get(e),r=0;n||(n=F(e),a.set(e,n));const{offsetWidth:i,offsetHeight:o}=g,l=[n.top-5,i-(n.left+5+n.width),o-(n.top+5+n.height),n.left-5].map((e=>-1*Math.floor(e)+"px")).join(" "),c=new IntersectionObserver((()=>{++r>1&&y(e)}),{root:g,threshold:1,rootMargin:l});c.observe(e),s.set(e,c)}(e)}catch{}}),n))}function x(e){setTimeout((()=>{l.set(e,setInterval((()=>w(y.bind(null,e))),2e3))}),Math.round(2e3*Math.random()))}function w(e){"function"==typeof requestIdleCallback?requestIdleCallback((()=>e())):requestAnimationFrame((()=>e()))}let A,_;function S(e,t){t||f in e?t&&!(f in t)&&Object.defineProperty(t,f,{value:e}):Object.defineProperty(e,f,{value:e})}function $(e){return Number(e.replace(/[^0-9.\-]/g,""))}function F(e){const t=e.getBoundingClientRect(),{x:n,y:r}=function(e){let t=e.parentElement;for(;t;){if(t.scrollLeft||t.scrollTop)return{x:t.scrollLeft,y:t.scrollTop};t=t.parentElement}return{x:0,y:0}}(e);return{top:t.top+r,left:t.left+n,width:t.width,height:t.height}}function z(e,t,n){let r=t.width,a=t.height,i=n.width,o=n.height;const s=getComputedStyle(e);if("content-box"===s.getPropertyValue("box-sizing")){const e=$(s.paddingTop)+$(s.paddingBottom)+$(s.borderTopWidth)+$(s.borderBottomWidth),t=$(s.paddingLeft)+$(s.paddingRight)+$(s.borderRightWidth)+$(s.borderLeftWidth);r-=t,i-=t,a-=e,o-=e}return[r,i,a,o].map(Math.round)}function E(e){return f in e&&c.has(e[f])?c.get(e[f]):{duration:250,easing:"ease-in-out"}}function C(e){if(f in e)return e[f]}function j(e){const t=C(e);return!!t&&p.has(t)}function T(e,...t){t.forEach((t=>t(e,c.has(e))));for(let n=0;ne(r,c.has(r))))}}function R(e){return Array.isArray(e)?e:[e]}function O(e){return"function"==typeof e}function L(e){b in e&&delete e[b];const t=F(e);a.set(e,t);const n=E(e);if(!j(e))return;let r;if("function"!=typeof n)r=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:1.5*n.duration,easing:"ease-in"});else{const[a]=R(n(e,"add",t));r=new Animation(a),r.play()}o.set(e,r),r.addEventListener("finish",y.bind(null,e))}function M(e,t){var n;e.remove(),a.delete(e),i.delete(e),o.delete(e),null===(n=s.get(e))||void 0===n||n.disconnect(),setTimeout((()=>{if(m in e&&delete e[m],Object.defineProperty(e,b,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const n in t)e.style[n]=""}),0)}function Z(e,t={}){if(A&&_){window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!O(t)&&!t.disrespectUserMotionPreference||(p.add(e),"static"===getComputedStyle(e).position&&Object.assign(e.style,{position:"relative"}),T(e,y,x,(e=>null==_?void 0:_.observe(e))),O(t)?c.set(e,t):c.set(e,{duration:250,easing:"ease-in-out",...t}),A.observe(e,{childList:!0}),r.add(e))}return Object.freeze({parent:e,enable:()=>{p.add(e)},disable:()=>{p.delete(e)},isEnabled:()=>p.has(e)})}"undefined"!=typeof window&&(g=document.documentElement,A=new MutationObserver(v),_=new ResizeObserver(k),window.addEventListener("scroll",(()=>{h=window.scrollY,d=window.scrollX})),_.observe(g))},141:function(e,t,n){(function(t){var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=p.reach);A+=w.value.length,w=w.next){var _=w.value;if(t.length>e.length)return;if(!(_ instanceof i)){var S,$=1;if(v){if(!(S=o(x,A,e,b))||S.index>=e.length)break;var F=S.index,z=S.index+S[0].length,E=A;for(E+=w.value.length;F>=E;)E+=(w=w.next).value.length;if(A=E-=w.value.length,w.value instanceof i)continue;for(var C=w;C!==t.tail&&(Ep.reach&&(p.reach=O);var L=w.prev;if(T&&(L=c(t,L,T),A+=T.length),u(t,L,$),w=c(t,L,new i(g,m?a.tokenize(j,m):j,k,j)),R&&c(t,w,R),$>1){var M={cause:g+","+h,reach:O};s(e,t,n,w.prev,A,M),p&&M.reach>p.reach&&(p.reach=M.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function u(e,t,n){for(var r=t.next,a=0;a"+i.content+""},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,o=n.immediateClose;e.postMessage(a.highlight(i,a.languages[r],r)),o&&e.close()}),!1),a):a;var p=a.util.currentScript();function g(){a.manual||a.highlightAll()}if(p&&(a.filename=p.src,p.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var d=document.readyState;"loading"===d||"interactive"===d&&p&&p.defer?document.addEventListener("DOMContentLoaded",g):window.requestAnimationFrame?window.requestAnimationFrame(g):window.setTimeout(g,16)}return a}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=n),void 0!==t&&(t.Prism=n),n.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^$/i;var a={"included-cdata":{pattern://i,inside:r}};a["language-"+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:a},n.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(e,t){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(void 0!==n&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",r="loading",a="loaded",i="pre[data-src]:not(["+t+'="'+a+'"]):not(['+t+'="'+r+'"])';n.hooks.add("before-highlightall",(function(e){e.selector+=", "+i})),n.hooks.add("before-sanity-check",(function(o){var s=o.element;if(s.matches(i)){o.code="",s.setAttribute(t,r);var l=s.appendChild(document.createElement("CODE"));l.textContent="Loading\u2026";var c=s.getAttribute("data-src"),u=o.language;if("none"===u){var p=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=e[p]||p}n.util.setLanguage(l,u),n.util.setLanguage(s,u);var g=n.plugins.autoloader;g&&g.loadLanguages(u),function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?t(r.responseText):r.status>=400?n("\u2716 Error "+r.status+" while fetching file: "+r.statusText):n("\u2716 Error: File does not exist or is empty"))},r.send(null)}(c,(function(e){s.setAttribute(t,a);var r=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],a=t[3];return r?a?[n,Number(a)]:[n,void 0]:[n,n]}}(s.getAttribute("data-range"));if(r){var i=e.split(/\r\n?|\n/g),o=r[0],c=null==r[1]?i.length:r[1];o<0&&(o+=i.length),o=Math.max(0,Math.min(o-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(o,c).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(o+1))}l.textContent=e,n.highlightElement(l)}),(function(e){s.setAttribute(t,"failed"),l.textContent=e}))}})),n.plugins.fileHighlight={highlight:function(e){for(var t,r=(e||document).querySelectorAll(i),a=0;t=r[a++];)n.highlightElement(t)}};var o=!1;n.fileHighlight=function(){o||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),o=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}}()}).call(this,n(28))},171:function(e,t,n){"use strict";var r=n(0),a=n.n(r);class i extends r.PureComponent{constructor(e){super(e),this.$=a.a.createRef(),this._=a.a.createRef()}render(){return a.a.createElement("span",{ref:this.$},a.a.createElement("a",{...this.props,ref:this._},this.props.children))}componentDidMount(){this.paint()}getSnapshotBeforeUpdate(){return this.reset(),null}componentDidUpdate(){this.paint()}componentWillUnmount(){this.reset()}paint(){const e=this.$.current.appendChild(document.createElement("span"));Promise.resolve().then(n.bind(null,172)).then((({render:t})=>{null!=this._.current&&t(e.appendChild(this._.current),(function(t){try{e.parentNode.replaceChild(t,e)}catch(e){}}))}))}reset(){this.$.current.replaceChild(this._.current,this.$.current.lastChild)}}t.a=i},172:function(e,t,n){"use strict";n.r(t),n.d(t,"render",(function(){return E}));var r=window.document,a=window.Math,i=window.HTMLElement,o=window.XMLHttpRequest,s=function(e,t){for(var n=0,r=e.length;n'}}},download:{heights:{16:{width:16,path:''}}},eye:{heights:{16:{width:16,path:''}}},heart:{heights:{16:{width:16,path:''}}},"issue-opened":{heights:{16:{width:16,path:''}}},"mark-github":{heights:{16:{width:16,path:''}}},package:{heights:{16:{width:16,path:''}}},play:{heights:{16:{width:16,path:''}}},"repo-forked":{heights:{16:{width:16,path:''}}},"repo-template":{heights:{16:{width:16,path:''}}},star:{heights:{16:{width:16,path:''}}}},w=function(e,t){e=p(e).replace(/^octicon-/,""),u(x,e)||(e="mark-github");var n=t>=24&&24 in x[e].heights?24:16,r=x[e].heights[n];return'"},A={},_=function(e,t){var n=A[e]||(A[e]=[]);if(!(n.push(t)>1)){var r=function(e){var t;return function(){t||(t=1,e.apply(this,arguments))}}((function(){for(delete A[e];t=n.shift();)t.apply(null,arguments)}));if(h){var a=new o;m(a,"abort",r),m(a,"error",r),m(a,"load",(function(){var e;try{e=JSON.parse(this.responseText)}catch(t){return void r(t)}r(200!==this.status,e)})),a.open("GET",e),a.send()}else{var i=this||window;i._=function(e){i._=null,r(200!==e.meta.status,e.data)};var s=l(i.document)("script",{async:!0,src:e+(-1!==e.indexOf("?")?"&":"?")+"callback=_"}),c=function(){i._&&i._({meta:{}})};m(s,"load",c),m(s,"error",c),function(e,t,n){if(null!=e.readyState){var r="readystatechange",a=function(){if(t.test(e.readyState))return b(e,r,a),n.apply(this,arguments)};m(e,r,a)}}(s,/de|m/,c),i.document.getElementsByTagName("head")[0].appendChild(s)}}},S=function(e,t,n){var r=l(e.ownerDocument),a=e.appendChild(r("style",{type:"text/css"})),i="body{margin:0}a{text-decoration:none;outline:0}.widget{display:inline-block;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;font-size:0;line-height:0;white-space:nowrap}.btn,.social-count{position:relative;display:inline-block;display:inline-flex;height:14px;padding:2px 5px;font-size:11px;font-weight:600;line-height:14px;vertical-align:bottom;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-repeat:repeat-x;background-position:-1px -1px;background-size:110% 110%;border:1px solid}.btn{border-radius:.25em}.btn:not(:last-child){border-radius:.25em 0 0 .25em}.social-count{border-left:0;border-radius:0 .25em .25em 0}.widget-lg .btn,.widget-lg .social-count{height:16px;padding:5px 10px;font-size:12px;line-height:16px}.octicon{display:inline-block;vertical-align:text-top;fill:currentColor;overflow:visible}"+y(t["data-color-scheme"]);a.styleSheet?a.styleSheet.cssText=i:a.appendChild(e.ownerDocument.createTextNode(i));var o="large"===p(t["data-size"]),s=r("a",{className:"btn",href:t.href,rel:"noopener",target:"_blank",title:t.title||void 0,"aria-label":t["aria-label"]||void 0,innerHTML:w(t["data-icon"],o?16:14)+" "},[r("span",{},[t["data-text"]||""])]),c=e.appendChild(r("div",{className:"widget"+(o?" widget-lg":"")},[s])),u=s.hostname.replace(/\.$/,"");if(("."+u).substring(u.length-10)!=="."+g)return s.removeAttribute("href"),void n(c);var h=(" /"+s.pathname).split(/\/+/);if(((u===g||u==="gist."+g)&&"archive"===h[3]||u===g&&"releases"===h[3]&&("download"===h[4]||"latest"===h[4]&&"download"===h[5])||u==="codeload."+g)&&(s.target="_top"),"true"===p(t["data-show-count"])&&u===g&&"marketplace"!==h[1]&&"sponsors"!==h[1]&&"orgs"!==h[1]&&"users"!==h[1]&&"-"!==h[1]){var f,m;if(!h[2]&&h[1])m="followers",f="?tab=followers";else if(!h[3]&&h[2])m="stargazers_count",f="/stargazers";else if(h[4]||"subscription"!==h[3])if(h[4]||"fork"!==h[3]){if("issues"!==h[3])return void n(c);m="open_issues_count",f="/issues"}else m="forks_count",f="/forks";else m="subscribers_count",f="/watchers";var b=h[2]?"/repos/"+h[1]+"/"+h[2]:"/users/"+h[1];_.call(this,d+b,(function(e,t){if(!e){var a=t[m];c.appendChild(r("a",{className:"social-count",href:t.html_url+f,rel:"noopener",target:"_blank","aria-label":a+" "+m.replace(/_count$/,"").replace("_"," ").slice(0,a<2?-1:void 0)+" on GitHub"},[(""+a).replace(/\B(?=(\d{3})+(?!\d))/g,",")]))}n(c)}))}else n(c)},$=window.devicePixelRatio||1,F=function(e){return($>1?a.ceil(a.round(e*$)/$*2)/2:a.ceil(e))||0},z=function(e,t){e.style.width=t[0]+"px",e.style.height=t[1]+"px"},E=function(e,t){if(null!=e&&null!=t)if(e.getAttribute&&(e=function(e){var t={href:e.href,title:e.title,"aria-label":e.getAttribute("aria-label")};return s(["icon","color-scheme","text","size","show-count"],(function(n){var r="data-"+n;t[r]=e.getAttribute(r)})),null==t["data-text"]&&(t["data-text"]=e.textContent||e.innerText),t}(e)),f){var n=c("span");S(n.attachShadow({mode:"closed"}),e,(function(){t(n)}))}else{var i=c("iframe",{src:"javascript:0",title:e.title||void 0,allowtransparency:!0,scrolling:"no",frameBorder:0});z(i,[0,0]),i.style.border="none";var o=function(){var n,s=i.contentWindow;try{n=s.document.body}catch(l){return void r.body.appendChild(i.parentNode.removeChild(i))}b(i,"load",o),S.call(s,n,e,(function(n){var r=function(e){var t=e.offsetWidth,n=e.offsetHeight;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=a.max(t,F(r.width)),n=a.max(n,F(r.height))}return[t,n]}(n);i.parentNode.removeChild(i),function(e,t,n){var r=function(){return b(e,t,r),n.apply(this,arguments)};m(e,t,r)}(i,"load",(function(){z(i,r)})),i.src="https://unpkg.com/github-buttons@2.27.0/dist/buttons.html#"+(i.name=function(e,t,n,r){null==t&&(t="&"),null==n&&(n="="),null==r&&(r=window.encodeURIComponent);var a=[];for(var i in e){var o=e[i];null!=o&&a.push(r(i)+n+r(o))}return a.join(t)}(e)),t(i)}))};m(i,"load",o),r.body.appendChild(i)}}},173:function(e,t,n){e.exports=function(){"use strict";function e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function i(e){var t={exports:{}};return e(t,t.exports),t.exports}var o=i((function(e){function t(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function n(t){e.exports.defaults=t}e.exports={defaults:t(),getDefaults:t,changeDefaults:n}})),s=/[&<>"']/,l=/[&<>"']/g,c=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,p={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(e){return p[e]};function d(e,t){if(t){if(s.test(e))return e.replace(l,g)}else if(c.test(e))return e.replace(u,g);return e}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function f(e){return e.replace(h,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var m=/(^|[^\[])\^/g;function b(e,t){e=e.source||e,t=t||"";var n={replace:function(t,r){return r=(r=r.source||r).replace(m,"$1"),e=e.replace(t,r),n},getRegex:function(){return new RegExp(e,t)}};return n}var v=/[^\w:]/g,k=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function y(e,t,n){if(e){var r;try{r=decodeURIComponent(f(n)).replace(v,"").toLowerCase()}catch(a){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}t&&!k.test(n)&&(n=S(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(a){return null}return n}var x={},w=/^[^:]+:\/*[^/]*$/,A=/^([^:]+:)[\s\S]*$/,_=/^([^:]+:\/*[^/]*)[\s\S]*$/;function S(e,t){x[" "+e]||(w.test(e)?x[" "+e]=e+"/":x[" "+e]=z(e,"/",!0));var n=-1===(e=x[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(A,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(_,"$1")+t:e+t}function $(e){for(var t,n,r=1;r=0&&"\\"===n[a];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}var T={escape:d,unescape:f,edit:b,cleanUrl:y,resolveUrl:S,noopTest:{exec:function(){}},merge:$,splitCells:F,rtrim:z,findClosingBracket:E,checkSanitizeDeprecation:C,repeatString:j},R=o.defaults,O=T.rtrim,L=T.splitCells,M=T.escape,Z=T.findClosingBracket;function I(e,t,n){var r=t.href,a=t.title?M(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:a,text:i}:{type:"image",raw:n,href:r,title:a,text:M(i)}}function N(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var r=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=r.length?e.slice(r.length):e})).join("\n")}var P=function(){function e(e){this.options=e||R}var t=e.prototype;return t.space=function(e){var t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e,t){var n=this.rules.block.code.exec(e);if(n){var r=t[t.length-1];if(r&&"paragraph"===r.type)return{raw:n[0],text:n[0].trimRight()};var a=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?a:O(a,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=N(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:r}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(/#$/.test(n)){var r=O(n,"#");this.options.pedantic?n=r.trim():r&&!/ $/.test(r)||(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n}}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var n={type:"table",header:L(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(n.header.length===n.align.length){var r,a=n.align.length;for(r=0;r ?/gm,"");return{type:"blockquote",raw:t[0],text:n}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){var n,r,a,i,o,s,l,c,u=t[0],p=t[2],g=p.length>1,d={type:"list",raw:u,ordered:g,start:g?+p.slice(0,-1):"",loose:!1,items:[]},h=t[0].match(this.rules.block.item),f=!1,m=h.length;a=this.rules.block.listItemStart.exec(h[0]);for(var b=0;ba[1].length:i[1].length>a[0].length||i[1].length>3){h.splice(b,2,h[b]+"\n"+h[b+1]),b--,m--;continue}(!this.options.pedantic||this.options.smartLists?i[2][i[2].length-1]!==p[p.length-1]:g===(1===i[2].length))&&(o=h.slice(b+1).join("\n"),d.raw=d.raw.substring(0,d.raw.length-o.length),b=m-1),a=i}r=n.length,~(n=n.replace(/^ *([*+-]|\d+[.)]) ?/,"")).indexOf("\n ")&&(r-=n.length,n=this.options.pedantic?n.replace(/^ {1,4}/gm,""):n.replace(new RegExp("^ {1,"+r+"}","gm"),"")),s=f||/\n\n(?!\s*$)/.test(n),b!==m-1&&(f="\n"===n.charAt(n.length-1),s||(s=f)),s&&(d.loose=!0),this.options.gfm&&(c=void 0,(l=/^\[[ xX]\] /.test(n))&&(c=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,""))),d.items.push({type:"list_item",raw:u,task:l,checked:c,loose:s,text:n})}return d}},t.html=function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):M(t[0]):t[0]}},t.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},t.table=function(e){var t=this.rules.block.table.exec(e);if(t){var n={type:"table",header:L(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=t[0];var r,a=n.align.length;for(r=0;r/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):M(r[0]):r[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;var r=O(n.slice(0,-1),"\\");if((n.length-r.length)%2==0)return}else{var a=Z(t[2],"()");if(a>-1){var i=(0===t[0].indexOf("!")?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,i).trim(),t[3]=""}}var o=t[2],s="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);l&&(o=l[1],s=l[3])}else s=t[3]?t[3].slice(1,-1):"";return o=o.trim(),/^$/.test(n)?o.slice(1):o.slice(1,-1)),I(t,{href:o?o.replace(this.rules.inline._escapes,"$1"):o,title:s?s.replace(this.rules.inline._escapes,"$1"):s},t[0])}},t.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var r=(n[2]||n[1]).replace(/\s+/g," ");if(!(r=t[r.toLowerCase()])||!r.href){var a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return I(n,r,n[0])}},t.strong=function(e,t,n){void 0===n&&(n="");var r=this.rules.inline.strong.start.exec(e);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var a,i="**"===r[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(i.lastIndex=0;null!=(r=i.exec(t));)if(a=this.rules.inline.strong.middle.exec(t.slice(0,r.index+3)))return{type:"strong",raw:e.slice(0,a[0].length),text:e.slice(2,a[0].length-2)}}},t.em=function(e,t,n){void 0===n&&(n="");var r=this.rules.inline.em.start.exec(e);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var a,i="*"===r[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(i.lastIndex=0;null!=(r=i.exec(t));)if(a=this.rules.inline.em.middle.exec(t.slice(0,r.index+2)))return{type:"em",raw:e.slice(0,a[0].length),text:e.slice(1,a[0].length-1)}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),r=/[^ ]/.test(n),a=/^ /.test(n)&&/ $/.test(n);return r&&a&&(n=n.substring(1,n.length-1)),n=M(n,!0),{type:"codespan",raw:t[0],text:n}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}},t.autolink=function(e,t){var n,r,a=this.rules.inline.autolink.exec(e);if(a)return r="@"===a[2]?"mailto:"+(n=M(this.options.mangle?t(a[1]):a[1])):n=M(a[1]),{type:"link",raw:a[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}},t.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var r,a;if("@"===n[2])a="mailto:"+(r=M(this.options.mangle?t(n[0]):n[0]));else{var i;do{i=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(i!==n[0]);r=M(n[0]),a="www."===n[1]?"http://"+r:r}return{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}},t.inlineText=function(e,t,n){var r,a=this.rules.inline.text.exec(e);if(a)return r=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):M(a[0]):a[0]:M(this.options.smartypants?n(a[0]):a[0]),{type:"text",raw:a[0],text:r}},e}(),B=T.noopTest,D=T.edit,q=T.merge,W={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:B,table:B,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};W.def=D(W.def).replace("label",W._label).replace("title",W._title).getRegex(),W.bullet=/(?:[*+-]|\d{1,9}[.)])/,W.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,W.item=D(W.item,"gm").replace(/bull/g,W.bullet).getRegex(),W.listItemStart=D(/^( *)(bull)/).replace("bull",W.bullet).getRegex(),W.list=D(W.list).replace(/bull/g,W.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+W.def.source+")").getRegex(),W._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",W._comment=/|$)/,W.html=D(W.html,"i").replace("comment",W._comment).replace("tag",W._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),W.paragraph=D(W._paragraph).replace("hr",W.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",W._tag).getRegex(),W.blockquote=D(W.blockquote).replace("paragraph",W.paragraph).getRegex(),W.normal=q({},W),W.gfm=q({},W.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),W.gfm.nptable=D(W.gfm.nptable).replace("hr",W.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",W._tag).getRegex(),W.gfm.table=D(W.gfm.table).replace("hr",W.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",W._tag).getRegex(),W.pedantic=q({},W.normal,{html:D("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",W._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:B,paragraph:D(W.normal._paragraph).replace("hr",W.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",W.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var U={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:B,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation*\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation*\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:B,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};U.punctuation=D(U.punctuation).replace(/punctuation/g,U._punctuation).getRegex(),U._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",U._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",U._comment=D(W._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),U.em.start=D(U.em.start).replace(/punctuation/g,U._punctuation).getRegex(),U.em.middle=D(U.em.middle).replace(/punctuation/g,U._punctuation).replace(/overlapSkip/g,U._overlapSkip).getRegex(),U.em.endAst=D(U.em.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.em.endUnd=D(U.em.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.start=D(U.strong.start).replace(/punctuation/g,U._punctuation).getRegex(),U.strong.middle=D(U.strong.middle).replace(/punctuation/g,U._punctuation).replace(/overlapSkip/g,U._overlapSkip).getRegex(),U.strong.endAst=D(U.strong.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.endUnd=D(U.strong.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.blockSkip=D(U._blockSkip,"g").getRegex(),U.overlapSkip=D(U._overlapSkip,"g").getRegex(),U._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,U._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,U._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,U.autolink=D(U.autolink).replace("scheme",U._scheme).replace("email",U._email).getRegex(),U._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,U.tag=D(U.tag).replace("comment",U._comment).replace("attribute",U._attribute).getRegex(),U._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,U._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,U._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,U.link=D(U.link).replace("label",U._label).replace("href",U._href).replace("title",U._title).getRegex(),U.reflink=D(U.reflink).replace("label",U._label).getRegex(),U.reflinkSearch=D(U.reflinkSearch,"g").replace("reflink",U.reflink).replace("nolink",U.nolink).getRegex(),U.normal=q({},U),U.pedantic=q({},U.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:D(/^!?\[(label)\]\((.*?)\)/).replace("label",U._label).getRegex(),reflink:D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",U._label).getRegex()}),U.gfm=q({},U.normal,{escape:D(U.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}var Q=function(){function e(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||H,this.options.tokenizer=this.options.tokenizer||new P,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:X.normal,inline:V.normal};this.options.pedantic?(t.block=X.pedantic,t.inline=V.pedantic):this.options.gfm&&(t.block=X.gfm,this.options.breaks?t.inline=V.breaks:t.inline=V.gfm),this.tokenizer.rules=t}e.lex=function(t,n){return new e(n).lex(t)},e.lexInline=function(t,n){return new e(n).inlineTokens(t)};var n=e.prototype;return n.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},n.blockTokens=function(e,t,n){var r,a,i,o;for(void 0===t&&(t=[]),void 0===n&&(n=!0),this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e,t))e=e.substring(r.raw.length),r.type?t.push(r):((o=t[t.length-1]).raw+="\n"+r.raw,o.text+="\n"+r.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),i=r.items.length,a=0;a0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)c.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+Y("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+Y("a",i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;)if(o||(s=""),o=!1,a=this.tokenizer.escape(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.tag(e,n,r))e=e.substring(a.raw.length),n=a.inLink,r=a.inRawBlock,t.push(a);else if(a=this.tokenizer.link(e))e=e.substring(a.raw.length),"link"===a.type&&(a.tokens=this.inlineTokens(a.text,[],!0,r)),t.push(a);else if(a=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(a.raw.length),"link"===a.type&&(a.tokens=this.inlineTokens(a.text,[],!0,r)),t.push(a);else if(a=this.tokenizer.strong(e,l,s))e=e.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],n,r),t.push(a);else if(a=this.tokenizer.em(e,l,s))e=e.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],n,r),t.push(a);else if(a=this.tokenizer.codespan(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.br(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.del(e))e=e.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],n,r),t.push(a);else if(a=this.tokenizer.autolink(e,K))e=e.substring(a.raw.length),t.push(a);else if(n||!(a=this.tokenizer.url(e,K))){if(a=this.tokenizer.inlineText(e,r,J))e=e.substring(a.raw.length),s=a.raw.slice(-1),o=!0,t.push(a);else if(e){var u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}throw new Error(u)}}else e=e.substring(a.raw.length),t.push(a);return t},t(e,null,[{key:"rules",get:function(){return{block:X,inline:V}}}]),e}(),ee=o.defaults,te=T.cleanUrl,ne=T.escape,re=function(){function e(e){this.options=e||ee}var t=e.prototype;return t.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var a=this.options.highlight(e,r);null!=a&&a!==e&&(n=!0,e=a)}return e=e.replace(/\n$/,"")+"\n",r?'
'+(n?e:ne(e,!0))+"
\n":"
"+(n?e:ne(e,!0))+"
\n"},t.blockquote=function(e){return"
\n"+e+"
\n"},t.html=function(e){return e},t.heading=function(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"},t.hr=function(){return this.options.xhtml?"
\n":"
\n"},t.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},t.listitem=function(e){return"
  • "+e+"
  • \n"},t.checkbox=function(e){return" "},t.paragraph=function(e){return"

    "+e+"

    \n"},t.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},t.tablerow=function(e){return"\n"+e+"\n"},t.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},t.strong=function(e){return""+e+""},t.em=function(e){return""+e+""},t.codespan=function(e){return""+e+""},t.br=function(){return this.options.xhtml?"
    ":"
    "},t.del=function(e){return""+e+""},t.link=function(e,t,n){if(null===(e=te(this.options.sanitize,this.options.baseUrl,e)))return n;var r='"},t.image=function(e,t,n){if(null===(e=te(this.options.sanitize,this.options.baseUrl,e)))return n;var r=''+n+'":">"},t.text=function(e){return e},e}(),ae=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),ie=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{n=e+"-"+ ++r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n},t.slug=function(e,t){void 0===t&&(t={});var n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)},e}(),oe=o.defaults,se=T.unescape,le=function(){function e(e){this.options=e||oe,this.options.renderer=this.options.renderer||new re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ae,this.slugger=new ie}e.parse=function(t,n){return new e(n).parse(t)},e.parseInline=function(t,n){return new e(n).parseInline(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var n,r,a,i,o,s,l,c,u,p,g,d,h,f,m,b,v,k,y="",x=e.length;for(n=0;n0&&"text"===m.tokens[0].type?(m.tokens[0].text=k+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=k+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:k}):f+=k),f+=this.parse(m.tokens,h),u+=this.renderer.listitem(f,v,b);y+=this.renderer.list(u,g,d);continue;case"html":y+=this.renderer.html(p.text);continue;case"paragraph":y+=this.renderer.paragraph(this.parseInline(p.tokens));continue;case"text":for(u=p.tokens?this.parseInline(p.tokens):p.text;n+1An error occurred:

    "+pe(l.message+"",!0)+"
    ";throw l}}return fe.options=fe.setOptions=function(e){return ce(fe.defaults,e),de(fe.defaults),fe},fe.getDefaults=ge,fe.defaults=he,fe.use=function(e){var t=ce({},e);if(e.renderer&&function(){var n=fe.defaults.renderer||new re,r=function(t){var r=n[t];n[t]=function(){for(var a=arguments.length,i=new Array(a),o=0;oAn error occurred:

    "+pe(r.message+"",!0)+"
    ";throw r}},fe.Parser=le,fe.parser=le.parse,fe.Renderer=re,fe.TextRenderer=ae,fe.Lexer=Q,fe.lexer=Q.lex,fe.Tokenizer=P,fe.Slugger=ie,fe.parse=fe,fe}()},177:function(e,t){!function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,a=/(?:\{*\.{3}(?:[^{}]|)*\})/.source;function i(e,t){return e=e.replace(//g,(function(){return n})).replace(//g,(function(){return r})).replace(//g,(function(){return a})),RegExp(e,t)}a=i(a).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=i(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:i(//.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:i(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(o).join(""):""},s=function(t){for(var n=[],r=0;r0&&n[n.length-1].tagName===o(a.content[0].content[1])&&n.pop():"/>"===a.content[a.content.length-1].content||n.push({tagName:o(a.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===a.type&&"{"===a.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===a.type&&"}"===a.content?n[n.length-1].openedBraces--:i=!0),(i||"string"==typeof a)&&n.length>0&&0===n[n.length-1].openedBraces){var l=o(a);r0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(l=o(t[r-1])+l,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",l,null,l)}a.content&&"string"!=typeof a.content&&s(a.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||s(e.tokens)}))}(Prism)}}]); \ No newline at end of file diff --git a/build/33.48d28b97.js b/build/33.48d28b97.js deleted file mode 100644 index 82f0178..0000000 --- a/build/33.48d28b97.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{115:function(e,t,n){"use strict";const a=(e,{target:t=document.body}={})=>{const n=document.createElement("textarea"),a=document.activeElement;n.value=e,n.setAttribute("readonly",""),n.style.contain="strict",n.style.position="absolute",n.style.left="-9999px",n.style.fontSize="12pt";const r=document.getSelection();let o=!1;r.rangeCount>0&&(o=r.getRangeAt(0)),t.append(n),n.select(),n.selectionStart=0,n.selectionEnd=e.length;let l=!1;try{l=document.execCommand("copy")}catch(c){}return n.remove(),o&&(r.removeAllRanges(),r.addRange(o)),a&&a.focus(),l};e.exports=a,e.exports.default=a},116:function(e,t){e.exports.parse=function(e){var t=e.split(",").map((function(e){return function(e){if(/^-?\d+$/.test(e))return parseInt(e,10);var t;if(t=e.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){var n=t[1],a=t[2],r=t[3];if(n&&r){var o=[],l=(n=parseInt(n))<(r=parseInt(r))?1:-1;"-"!=a&&".."!=a&&"\u2025"!=a||(r+=l);for(var c=n;c!=r;c+=l)o.push(c);return o}}return[]}(e)}));return 0===t.length?[]:1===t.length?Array.isArray(t[0])?t[0]:t:t.reduce((function(e,t){return Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]),e.concat(t)}))}},123:function(e,t,n){"use strict";var a=n(2),r=n(0),o=n.n(r),l=n(94),c={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},i={Prism:n(18).a,theme:c};function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(){return u=Object.assign||function(e){for(var t=1;t0&&e[n-1]===t?e:e.concat(t)};function y(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&-1===t.indexOf(a)&&(n[a]=e[a]);return n}var f=function(e){function t(){for(var t=this,n=[],a=arguments.length;a--;)n[a]=arguments[a];e.apply(this,n),s(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var n=e.theme?function(e,t){var n=e.plain,a=Object.create(null),r=e.styles.reduce((function(e,n){var a=n.languages,r=n.style;return a&&!a.includes(t)||n.types.forEach((function(t){var n=u({},e[t],r);e[t]=n})),e}),a);return r.root=n,r.plain=u({},n,{backgroundColor:null}),r}(e.theme,e.language):void 0;return t.themeDict=n})),s(this,"getLineProps",(function(e){var n=e.key,a=e.className,r=e.style,o=u({},y(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),l=t.getThemeDict(t.props);return void 0!==l&&(o.style=l.plain),void 0!==r&&(o.style=void 0!==o.style?u({},o.style,r):r),void 0!==n&&(o.key=n),a&&(o.className+=" "+a),o})),s(this,"getStyleForToken",(function(e){var n=e.types,a=e.empty,r=n.length,o=t.getThemeDict(t.props);if(void 0!==o){if(1===r&&"plain"===n[0])return a?{display:"inline-block"}:void 0;if(1===r&&!a)return o[n[0]];var l=a?{display:"inline-block"}:{},c=n.map((function(e){return o[e]}));return Object.assign.apply(Object,[l].concat(c))}})),s(this,"getTokenProps",(function(e){var n=e.key,a=e.className,r=e.style,o=e.token,l=u({},y(e,["key","className","style","token"]),{className:"token "+o.types.join(" "),children:o.content,style:t.getStyleForToken(o),key:void 0});return void 0!==r&&(l.style=void 0!==l.style?u({},l.style,r):r),void 0!==n&&(l.key=n),a&&(l.className+=" "+a),l})),s(this,"tokenize",(function(e,t,n,a){var r={code:t,grammar:n,language:a,tokens:[]};e.hooks.run("before-tokenize",r);var o=r.tokens=e.tokenize(r.code,r.grammar,r.language);return e.hooks.run("after-tokenize",r),o}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,n=e.language,a=e.code,r=e.children,o=this.getThemeDict(this.props),l=t.languages[n];return r({tokens:function(e){for(var t=[[]],n=[e],a=[0],r=[e.length],o=0,l=0,c=[],i=[c];l>-1;){for(;(o=a[l]++)0?u:["plain"],s=y):(u=d(u,y.type),y.alias&&(u=d(u,y.alias)),s=y.content),"string"==typeof s){var f=s.split(p),h=f.length;c.push({types:u,content:f[0]});for(var b=1;b0}))}c&&_.test(c)&&(j=c.match(_)[0].split("title=")[1].replace(/"+/g,""));var T=n&&n.replace(/language-/,"");!T&&s.defaultLanguage&&(T=s.defaultLanguage);var S=t.replace(/\n$/,"");if(0===v.length&&void 0!==T){for(var I,D="",L=function(e){switch(e){case"js":case"javascript":case"ts":case"typescript":return P(["js","jsBlock"]);case"jsx":case"tsx":return P(["js","jsBlock","jsx"]);case"html":return P(["js","jsBlock","html"]);case"python":case"py":return P(["python"]);default:return P()}}(T),M=t.replace(/\n$/,"").split("\n"),B=0;B=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=r.a.createContext({}),u=function(e){var t=r.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},p=function(e){var t=u(e.components);return r.a.createElement(s.Provider,{value:t},e.children)},m="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},y=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,l=e.parentName,s=i(e,["components","mdxType","originalType","parentName"]),p=u(n),m=a,y=p["".concat(l,".").concat(m)]||p[m]||d[m]||o;return n?r.a.createElement(y,c(c({ref:t},s),{},{components:n})):r.a.createElement(y,c({ref:t},s))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,l=new Array(o);l[0]=y;var c={};for(var i in t)hasOwnProperty.call(t,i)&&(c[i]=t[i]);c.originalType=e,c[m]="string"==typeof e?e:a,l[1]=c;for(var s=2;s=n?null===r?null:0:o}function l(e){var t=e.state,n=function(e){var t=e.state,n=t.suggestions.map((function(e){return e.items.length})).reduce((function(e,t,n){var r=(e[n-1]||0)+t;return e.push(r),e}),[]).reduce((function(e,n){return n<=t.highlightedIndex?e+1:e}),0);return t.suggestions[n]}({state:t});if(!n)return null;var r=n.items[function(e){for(var t=e.state,n=e.suggestion,r=!1,o=0,a=0;!1===r;){var s=t.suggestions[o];if(s===n){r=!0;break}a+=s.items.length,o++}return t.highlightedIndex-a}({state:t,suggestion:n})],o=n.source;return{item:r,itemValue:o.getInputValue({suggestion:r,state:t}),itemUrl:o.getSuggestionUrl({suggestion:r,state:t}),source:o}}function h(e,t){return e===t||e.contains&&e.contains(t)}function g(e){var t=e.state;if(!1===e.props.enableCompletion||!1===t.isOpen||null===t.highlightedIndex||"stalled"===t.status)return null;var n=l({state:t}).itemValue;if(t.query.length>0&&0===n.toLocaleLowerCase().indexOf(t.query.toLocaleLowerCase())){var r=t.query+n.slice(t.query.length);return r===t.query?null:r}return null}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t0)&&x({query:t.getState().query,store:t,props:n,setHighlightedIndex:r,setQuery:o,setSuggestions:a,setIsOpen:s,setStatus:i,setContext:c}),t.send("focus",null)}var h="ontouchstart"in n.environment,m=e||{},p=(m.inputElement,m.maxLength),f=void 0===p?512:p,d=I(m,["inputElement","maxLength"]);return k({"aria-autocomplete":n.enableCompletion?"both":"list","aria-activedescendant":t.getState().isOpen&&null!==t.getState().highlightedIndex?"".concat(n.id,"-item-").concat(t.getState().highlightedIndex):void 0,"aria-controls":t.getState().isOpen?"".concat(n.id,"-menu"):void 0,"aria-labelledby":"".concat(n.id,"-label"),value:t.getState().query,id:"".concat(n.id,"-input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",autoFocus:n.autoFocus,placeholder:n.placeholder,maxLength:f,type:"search",onChange:function(e){x({query:e.currentTarget.value.slice(0,f),store:t,props:n,setHighlightedIndex:r,setQuery:o,setSuggestions:a,setIsOpen:s,setStatus:i,setContext:c})},onKeyDown:function(e){!function(e){var t=e.event,n=e.store,r=e.props,o=e.setHighlightedIndex,a=e.setQuery,s=e.setSuggestions,i=e.setIsOpen,c=e.setStatus,u=e.setContext;if("ArrowUp"===t.key||"ArrowDown"===t.key){t.preventDefault(),n.send(t.key,{shiftKey:t.shiftKey});var h=r.environment.document.getElementById("".concat(r.id,"-item-").concat(n.getState().highlightedIndex));null==h||h.scrollIntoView(!1);var m=l({state:n.getState()});if(null!==n.getState().highlightedIndex&&m){var p=m.item,f=m.itemValue,d=m.itemUrl,v=m.source;v.onHighlight({suggestion:p,suggestionValue:f,suggestionUrl:d,source:v,state:n.getState(),setHighlightedIndex:o,setQuery:a,setSuggestions:s,setIsOpen:i,setStatus:c,setContext:u,event:t})}}else if(("Tab"===t.key||"ArrowRight"===t.key&&t.target.selectionStart===n.getState().query.length)&&r.enableCompletion&&null!==n.getState().highlightedIndex){t.preventDefault();var y=g({state:n.getState(),props:r});y&&x({query:y,store:n,props:r,setHighlightedIndex:o,setQuery:a,setSuggestions:s,setIsOpen:i,setStatus:c,setContext:u})}else if("Escape"===t.key)t.preventDefault(),n.send(t.key,null);else if("Enter"===t.key){if(null===n.getState().highlightedIndex||n.getState().suggestions.every((function(e){return 0===e.items.length})))return;t.preventDefault();var b=l({state:n.getState()}),O=b.item,S=b.itemValue,E=b.itemUrl,w=b.source;t.metaKey||t.ctrlKey?void 0!==E&&r.navigator.navigateNewTab({suggestionUrl:E,suggestion:O,state:n.getState()}):t.shiftKey?void 0!==E&&r.navigator.navigateNewWindow({suggestionUrl:E,suggestion:O,state:n.getState()}):t.altKey||(x({query:S,store:n,props:r,setHighlightedIndex:o,setQuery:a,setSuggestions:s,setIsOpen:i,setStatus:c,setContext:u,nextState:{isOpen:!1}}).then((function(){w.onSelect({suggestion:O,suggestionValue:S,suggestionUrl:E,source:w,state:n.getState(),setHighlightedIndex:o,setQuery:a,setSuggestions:s,setIsOpen:i,setStatus:c,setContext:u,event:t})})),void 0!==E&&r.navigator.navigate({suggestionUrl:E,suggestion:O,state:n.getState()}))}}({event:e,store:t,props:n,setHighlightedIndex:r,setQuery:o,setSuggestions:a,setIsOpen:s,setStatus:i,setContext:c})},onFocus:u,onBlur:function(){h||t.send("blur",null)},onClick:function(){e.inputElement!==n.environment.document.activeElement||t.getState().isOpen||u()}},d)},getDropdownProps:function(e){return k({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){t.send("mouseleave",null)}},e)},getMenuProps:function(e){return k({role:"listbox","aria-labelledby":"".concat(n.id,"-label"),id:"".concat(n.id,"-menu")},e)},getItemProps:function(e){var u=e.item,h=e.source,g=I(e,["item","source"]);return k({id:"".concat(n.id,"-item-").concat(u.__autocomplete_id),role:"option","aria-selected":t.getState().highlightedIndex===u.__autocomplete_id,onMouseMove:function(e){if(u.__autocomplete_id!==t.getState().highlightedIndex){t.send("mousemove",u.__autocomplete_id);var n=l({state:t.getState()});if(null!==t.getState().highlightedIndex&&n){var h=n.item,g=n.itemValue,m=n.itemUrl,p=n.source;p.onHighlight({suggestion:h,suggestionValue:g,suggestionUrl:m,source:p,state:t.getState(),setHighlightedIndex:r,setQuery:o,setSuggestions:a,setIsOpen:s,setStatus:i,setContext:c,event:e})}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){if(void 0===h.getSuggestionUrl({suggestion:u,state:t.getState()})&&!function(e){return 1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)){var l=h.getInputValue({suggestion:u,state:t.getState()});x({query:l,store:t,props:n,setHighlightedIndex:r,setQuery:o,setSuggestions:a,setIsOpen:s,setStatus:i,setContext:c,nextState:{isOpen:!1}}).then((function(){h.onSelect({suggestion:u,suggestionValue:l,suggestionUrl:h.getSuggestionUrl({suggestion:u,state:t.getState()}),source:h,state:t.getState(),setHighlightedIndex:r,setQuery:o,setSuggestions:a,setIsOpen:s,setStatus:i,setContext:c,event:e})}))}}},g)}}}function q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t0});case"blur":return T(T({},t),{},{isOpen:!1,highlightedIndex:null});case"mouseleave":return T(T({},t),{},{highlightedIndex:n.defaultHighlightedIndex});default:return t}};function L(e){var t=function(e){var t,n,r="undefined"!=typeof window?window:{};return S(S({openOnFocus:!1,placeholder:"",autoFocus:!1,defaultHighlightedIndex:null,enableCompletion:!1,stallThreshold:300,environment:r,shouldDropdownShow:function(e){return i(e.state)>0},onStateChange:a,onSubmit:a},e),{},{id:null!==(t=e.id)&&void 0!==t?t:"autocomplete-".concat(s++),initialState:S({highlightedIndex:null,query:"",completion:null,suggestions:[],isOpen:!1,status:"idle",statusContext:{},context:{}},e.initialState),getSources:(n=e.getSources,function(e){return Promise.resolve(n(e)).then((function(e){return Promise.all(e.filter(Boolean).map((function(e){return Promise.resolve(c(e))})))}))}),navigator:S({navigate:function(e){var t=e.suggestionUrl;r.location.assign(t)},navigateNewTab:function(e){var t=e.suggestionUrl,n=r.open(t,"_blank","noopener");n&&n.focus()},navigateNewWindow:function(e){var t=e.suggestionUrl;r.open(t,"_blank","noopener")}},e.navigator)})}(e),n=d(R,t),r=function(e){var t=e.store;return{setHighlightedIndex:function(e){t.send("setHighlightedIndex",e)},setQuery:function(e){t.send("setQuery",e)},setSuggestions:function(e){var n=0,r=e.map((function(e){return y(y({},e),{},{items:e.items.map((function(e){return y(y({},e),{},{__autocomplete_id:n++})}))})}));t.send("setSuggestions",r)},setIsOpen:function(e){t.send("setIsOpen",e)},setStatus:function(e){t.send("setStatus",e)},setContext:function(e){t.send("setContext",e)}}}({store:n}),o=r.setHighlightedIndex,u=r.setQuery,l=r.setSuggestions,h=r.setIsOpen,g=r.setStatus,m=r.setContext,p=H({store:n,props:t,setHighlightedIndex:o,setQuery:u,setSuggestions:l,setIsOpen:h,setStatus:g,setContext:m}),f=p.getEnvironmentProps,v=p.getRootProps,b=p.getFormProps,O=p.getLabelProps,E=p.getInputProps,w=p.getDropdownProps,P=p.getMenuProps,j=p.getItemProps;return{setHighlightedIndex:o,setQuery:u,setSuggestions:l,setIsOpen:h,setStatus:g,setContext:m,getEnvironmentProps:f,getRootProps:v,getFormProps:b,getInputProps:E,getLabelProps:O,getDropdownProps:w,getMenuProps:P,getItemProps:j,refresh:function(){return x({query:n.getState().query,store:n,props:t,setHighlightedIndex:o,setQuery:u,setSuggestions:l,setIsOpen:h,setStatus:g,setContext:m})}}}function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t",highlightPostTag:""},e.params)}})))}var z=n(0),V=n.n(z),Q=64;function B(){return V.a.createElement("a",{href:"https://www.algolia.com/docsearch",target:"_blank",rel:"noopener noreferrer"},V.a.createElement("span",{className:"DocSearch-Label"},"Search by"),V.a.createElement("svg",{width:"77",height:"19"},V.a.createElement("path",{d:"M2.5067 0h14.0245c1.384.001 2.5058 1.1205 2.5068 2.5017V16.5c-.0014 1.3808-1.1232 2.4995-2.5068 2.5H2.5067C1.1232 18.9995.0014 17.8808 0 16.5V2.4958A2.495 2.495 0 01.735.7294 2.505 2.505 0 012.5068 0zM37.95 15.0695c-3.7068.0168-3.7068-2.986-3.7068-3.4634L34.2372.3576 36.498 0v11.1794c0 .2715 0 1.9889 1.452 1.994v1.8961zm-9.1666-1.8388c.694 0 1.2086-.0397 1.5678-.1088v-2.2934a5.3639 5.3639 0 00-1.3303-.1679 4.8283 4.8283 0 00-.758.0582 2.2845 2.2845 0 00-.688.2024c-.2029.0979-.371.2362-.4919.4142-.1268.1788-.185.2826-.185.5533 0 .5297.185.8359.5205 1.0375.3355.2016.7928.3053 1.365.3053v-.0008zm-.1969-8.1817c.7463 0 1.3768.092 1.8856.2767.5088.1838.9195.4428 1.2204.7717.3068.334.5147.7777.6423 1.251.1327.4723.196.991.196 1.5603v5.798c-.5235.1036-1.05.192-1.5787.2649-.7048.1037-1.4976.156-2.3774.156-.5832 0-1.1215-.0582-1.6016-.167a3.385 3.385 0 01-1.2432-.5364 2.6034 2.6034 0 01-.8037-.9565c-.191-.3922-.29-.9447-.29-1.5208 0-.5533.11-.905.3246-1.2863a2.7351 2.7351 0 01.8849-.9329c.376-.242.8029-.415 1.2948-.5187a7.4517 7.4517 0 011.5381-.156 7.1162 7.1162 0 011.6667.2024V8.886c0-.259-.0296-.5061-.093-.7372a1.5847 1.5847 0 00-.3245-.6158 1.5079 1.5079 0 00-.6119-.4158 2.6788 2.6788 0 00-.966-.173c-.5206 0-.9948.0634-1.4283.1384a6.5481 6.5481 0 00-1.065.259l-.2712-1.849c.2831-.0986.7048-.1964 1.2491-.2943a9.2979 9.2979 0 011.752-.1501v.0008zm44.6597 8.1193c.6947 0 1.2086-.0405 1.567-.1097v-2.2942a5.3743 5.3743 0 00-1.3303-.1679c-.2485 0-.503.0177-.7573.0582a2.2853 2.2853 0 00-.688.2024 1.2333 1.2333 0 00-.4918.4142c-.1268.1788-.1843.2826-.1843.5533 0 .5297.1843.8359.5198 1.0375.3414.2066.7927.3053 1.365.3053v.0009zm-.191-8.1767c.7463 0 1.3768.0912 1.8856.2759.5087.1847.9195.4436 1.2204.7717.3.329.5147.7786.6414 1.251a5.7248 5.7248 0 01.197 1.562v5.7972c-.3466.0742-.874.1602-1.5788.2648-.7049.1038-1.4976.1552-2.3774.1552-.5832 0-1.1215-.0573-1.6016-.167a3.385 3.385 0 01-1.2432-.5356 2.6034 2.6034 0 01-.8038-.9565c-.191-.3922-.2898-.9447-.2898-1.5216 0-.5533.1098-.905.3245-1.2854a2.7373 2.7373 0 01.8849-.9338c.376-.2412.8029-.4141 1.2947-.5178a7.4545 7.4545 0 012.325-.1097c.2781.0287.5672.081.879.156v-.3686a2.7781 2.7781 0 00-.092-.738 1.5788 1.5788 0 00-.3246-.6166 1.5079 1.5079 0 00-.612-.415 2.6797 2.6797 0 00-.966-.1729c-.5205 0-.9947.0633-1.4282.1384a6.5608 6.5608 0 00-1.065.259l-.2712-1.8498c.283-.0979.7048-.1957 1.2491-.2935a9.8597 9.8597 0 011.752-.1494zm-6.79-1.072c-.7576.001-1.373-.6103-1.3759-1.3664 0-.755.6128-1.3664 1.376-1.3664.764 0 1.3775.6115 1.3775 1.3664s-.6195 1.3664-1.3776 1.3664zm1.1393 11.1507h-2.2726V5.3409l2.2734-.3568v10.0845l-.0008.0017zm-3.984 0c-3.707.0168-3.707-2.986-3.707-3.4642L59.7069.3576 61.9685 0v11.1794c0 .2715 0 1.9889 1.452 1.994V15.0703zm-7.3512-4.979c0-.975-.2138-1.7873-.6305-2.3516-.4167-.571-.9998-.852-1.747-.852-.7454 0-1.3302.281-1.7452.852-.4166.5702-.6195 1.3765-.6195 2.3516 0 .9851.208 1.6473.6254 2.2183.4158.576.9998.8587 1.7461.8587.7454 0 1.3303-.2885 1.747-.8595.4158-.5761.6237-1.2315.6237-2.2184v.0009zm2.3132-.006c0 .7609-.1099 1.3361-.3356 1.9654a4.654 4.654 0 01-.9533 1.6076A4.214 4.214 0 0155.613 14.69c-.579.2412-1.4697.3795-1.9143.3795-.4462-.005-1.3303-.1324-1.9033-.3795a4.307 4.307 0 01-1.474-1.0316c-.4115-.4445-.7293-.9801-.9609-1.6076a5.3423 5.3423 0 01-.3465-1.9653c0-.7608.104-1.493.3356-2.1155a4.683 4.683 0 01.9719-1.5958 4.3383 4.3383 0 011.479-1.0257c.5739-.242 1.2043-.3567 1.8864-.3567.6829 0 1.3125.1197 1.8906.3567a4.1245 4.1245 0 011.4816 1.0257 4.7587 4.7587 0 01.9592 1.5958c.2426.6225.3643 1.3547.3643 2.1155zm-17.0198 0c0 .9448.208 1.9932.6238 2.431.4166.4386.955.6579 1.6142.6579.3584 0 .6998-.0523 1.0176-.1502.3186-.0978.5721-.2134.775-.3517V7.0784a8.8706 8.8706 0 00-1.4926-.1906c-.8206-.0236-1.4452.312-1.8847.8468-.4335.5365-.6533 1.476-.6533 2.3516v-.0008zm6.2863 4.4485c0 1.5385-.3938 2.662-1.1866 3.3773-.791.7136-2.0005 1.0712-3.6308 1.0712-.5958 0-1.834-.1156-2.8228-.334l.3643-1.7865c.8282.173 1.9202.2193 2.4932.2193.9077 0 1.555-.1847 1.943-.5533.388-.3686.578-.916.578-1.643v-.3687a6.8289 6.8289 0 01-.8848.3349c-.3634.1096-.786.167-1.261.167-.6246 0-1.1917-.0979-1.7055-.2944a3.5554 3.5554 0 01-1.3244-.8645c-.3642-.3796-.6541-.8579-.8561-1.4289-.2028-.571-.3068-1.59-.3068-2.339 0-.7034.1099-1.5856.3245-2.1735.2198-.5871.5316-1.0949.9542-1.515.4167-.42.9255-.743 1.5213-.98a5.5923 5.5923 0 012.052-.3855c.7353 0 1.4114.092 2.0707.2024.6592.1088 1.2204.2236 1.6776.35v8.945-.0008zM11.5026 4.2418v-.6511c-.0005-.4553-.3704-.8241-.8266-.8241H8.749c-.4561 0-.826.3688-.8265.824v.669c0 .0742.0693.1264.1445.1096a6.0346 6.0346 0 011.6768-.2362 6.125 6.125 0 011.6202.2185.1116.1116 0 00.1386-.1097zm-5.2806.852l-.3296-.3282a.8266.8266 0 00-1.168 0l-.393.3922a.8199.8199 0 000 1.164l.3237.323c.0524.0515.1268.0397.1733-.0117.191-.259.3989-.507.6305-.7372.2374-.2362.48-.4437.7462-.6335.0575-.0354.0634-.1155.017-.1687zm3.5159 2.069v2.818c0 .081.0879.1392.1622.0987l2.5102-1.2964c.0574-.0287.0752-.0987.0464-.1552a3.1237 3.1237 0 00-2.603-1.574c-.0575 0-.115.0456-.115.1097l-.0008-.0009zm.0008 6.789c-2.0933.0005-3.7915-1.6912-3.7947-3.7804C5.9468 8.0821 7.6452 6.39 9.7387 6.391c2.0932-.0005 3.7911 1.6914 3.794 3.7804a3.7783 3.7783 0 01-1.1124 2.675 3.7936 3.7936 0 01-2.6824 1.1054h.0008zM9.738 4.8002c-1.9218 0-3.6975 1.0232-4.6584 2.6841a5.359 5.359 0 000 5.3683c.9609 1.661 2.7366 2.6841 4.6584 2.6841a5.3891 5.3891 0 003.8073-1.5725 5.3675 5.3675 0 001.578-3.7987 5.3574 5.3574 0 00-1.5771-3.797A5.379 5.379 0 009.7387 4.801l-.0008-.0008z",fill:"currentColor",fillRule:"evenodd"})))}function J(){return V.a.createElement(V.a.Fragment,null,V.a.createElement("div",{className:"DocSearch-Logo"},V.a.createElement(B,null)),V.a.createElement("ul",{className:"DocSearch-Commands"},V.a.createElement("li",null,V.a.createElement("span",{className:"DocSearch-Commands-Key"},V.a.createElement($,null,V.a.createElement("path",{d:"M12 3.53088v3c0 1-1 2-2 2H4M7 11.53088l-3-3 3-3"}))),V.a.createElement("span",{className:"DocSearch-Label"},"to select")),V.a.createElement("li",null,V.a.createElement("span",{className:"DocSearch-Commands-Key"},V.a.createElement($,null,V.a.createElement("path",{d:"M7.5 3.5v8M10.5 8.5l-3 3-3-3"}))),V.a.createElement("span",{className:"DocSearch-Commands-Key"},V.a.createElement($,null,V.a.createElement("path",{d:"M7.5 11.5v-8M10.5 6.5l-3-3-3 3"}))),V.a.createElement("span",{className:"DocSearch-Label"},"to navigate")),V.a.createElement("li",null,V.a.createElement("span",{className:"DocSearch-Commands-Key"},V.a.createElement($,null,V.a.createElement("path",{d:"M13.6167 8.936c-.1065.3583-.6883.962-1.4875.962-.7993 0-1.653-.9165-1.653-2.1258v-.5678c0-1.2548.7896-2.1016 1.653-2.1016.8634 0 1.3601.4778 1.4875 1.0724M9 6c-.1352-.4735-.7506-.9219-1.46-.8972-.7092.0246-1.344.57-1.344 1.2166s.4198.8812 1.3445.9805C8.465 7.3992 8.968 7.9337 9 8.5c.032.5663-.454 1.398-1.4595 1.398C6.6593 9.898 6 9 5.963 8.4851m-1.4748.5368c-.2635.5941-.8099.876-1.5443.876s-1.7073-.6248-1.7073-2.204v-.4603c0-1.0416.721-2.131 1.7073-2.131.9864 0 1.6425 1.031 1.5443 2.2492h-2.956"}))),V.a.createElement("span",{className:"DocSearch-Label"},"to close"))))}function $(e){return V.a.createElement("svg",{width:"15",height:"15"},V.a.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"},e.children))}function K(e){var t=e.hit,n=e.children;return V.a.createElement("a",{href:t.url},n)}function W(){return V.a.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},V.a.createElement("path",{d:"M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0"}))}function G(){return V.a.createElement("div",{className:"DocSearch-ErrorScreen"},V.a.createElement("div",{className:"DocSearch-Screen-Icon"},V.a.createElement(W,null)),V.a.createElement("p",{className:"DocSearch-Title"},"Unable to fetch results"),V.a.createElement("p",{className:"DocSearch-Help"},"You might want to check your network connection."))}function Y(){return V.a.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},V.a.createElement("path",{d:"M15.5 4.8c2 3 1.7 7-1 9.7h0l4.3 4.3-4.3-4.3a7.8 7.8 0 01-9.8 1m-2.2-2.2A7.8 7.8 0 0113.2 2.4M2 18L18 2"}))}function X(e){return function(e){if(Array.isArray(e))return Z(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&V.a.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},V.a.createElement("p",{className:"DocSearch-Help"},"Try searching for:"),V.a.createElement("ul",null,t.slice(0,3).reduce((function(t,n){return[].concat(X(t),[V.a.createElement("li",{key:n},V.a.createElement("button",{className:"DocSearch-Prefill",key:n,onClick:function(){e.setQuery(n.toLowerCase()+" "),e.refresh(),e.inputRef.current.focus()}},n))])}),[]))),V.a.createElement("p",{className:"DocSearch-Help"},"Believe this query should return results?"," ",V.a.createElement("a",{href:"https://github.com/algolia/docsearch-configs/issues/new?template=Missing_results.md&title=[".concat(e.indexName,']+Missing+results+for+query+"').concat(e.state.query,'"'),target:"_blank",rel:"noopener noreferrer"},"Let us know"),"."))}function te(e){switch(e.type){case"lvl1":return V.a.createElement(ne,null);case"content":return V.a.createElement(oe,null);default:return V.a.createElement(re,null)}}function ne(){return V.a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},V.a.createElement("path",{d:"M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function re(){return V.a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},V.a.createElement("path",{d:"M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function oe(){return V.a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},V.a.createElement("path",{d:"M17 5H3h14zm0 5H3h14zm0 5H3h14z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function ae(){return V.a.createElement("svg",{className:"DocSearch-Hit-Select-Icon",width:"20",height:"20",viewBox:"0 0 20 20"},V.a.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},V.a.createElement("path",{d:"M18 3v4c0 2-2 4-4 4H2"}),V.a.createElement("path",{d:"M8 17l-6-6 6-6"})))}function se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ie(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function le(e,t){return t.split(".").reduce((function(e,t){return e&&e[t]}),e)}function he(e){var t=e.hit,n=e.attribute,r=e.tagName,o=void 0===r?"span":r,a=ue(e,["hit","attribute","tagName"]);return Object(z.createElement)(o,ie(ie({},a),{},{dangerouslySetInnerHTML:{__html:le(t,"_snippetResult.".concat(n,".value"))||le(t,n)}}))}function ge(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var s,i=e[Symbol.iterator]();!(r=(s=i.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(c){o=!0,a=c}finally{try{r||null==i.return||i.return()}finally{if(o)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return me(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}));return e.state.query?!1===t?V.a.createElement(ee,e):V.a.createElement(ye,e):V.a.createElement(we,Pe({},e,{hasSuggestions:t}))}),(function(e,t){return"loading"===t.state.status||"stalled"===t.state.status}));function De(){return V.a.createElement("svg",{viewBox:"0 0 38 38",stroke:"currentColor",strokeOpacity:".5"},V.a.createElement("g",{fill:"none",fillRule:"evenodd"},V.a.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},V.a.createElement("circle",{strokeOpacity:".3",cx:"18",cy:"18",r:"18"}),V.a.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},V.a.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}var xe=n(126);function Ie(){return Ie=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Ne(e){return!1===function(){var e="__TEST_KEY__";try{return localStorage.setItem(e,""),localStorage.removeItem(e),!0}catch(t){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){return window.localStorage.setItem(e,JSON.stringify(t))},getItem:function(){var t=window.localStorage.getItem(e);return t?JSON.parse(t):[]}}}function He(e){var t=e.key,n=e.limit,r=void 0===n?5:n,o=Ne(t),a=o.getItem().slice(0,r);return{add:function(e){var t=e,n=(t._highlightResult,t._snippetResult,ke(t,["_highlightResult","_snippetResult"])),s=a.findIndex((function(e){return e.objectID===n.objectID}));s>-1&&a.splice(s,1),a.unshift(n),a=a.slice(0,r),o.setItem(a)},remove:function(e){a=a.filter((function(t){return t.objectID!==e.objectID})),o.setItem(a)},getAll:function(){return a}}}function qe(e){const t=`algoliasearch-client-js-${e.key}`;let n;const r=()=>(void 0===n&&(n=e.localStorage||window.localStorage),n),o=()=>JSON.parse(r().getItem(t)||"{}"),a=e=>{r().setItem(t,JSON.stringify(e))};return{get:(t,n,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{(()=>{const t=e.timeToLive?1e3*e.timeToLive:null,n=o(),r=Object.fromEntries(Object.entries(n).filter((([,e])=>void 0!==e.timestamp)));if(a(r),!t)return;const s=Object.fromEntries(Object.entries(r).filter((([,e])=>{const n=(new Date).getTime();return!(e.timestamp+tPromise.all([e?e.value:n(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,n)=>Promise.resolve().then((()=>{const a=o();return a[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:n},r().setItem(t,JSON.stringify(a)),n})),delete:e=>Promise.resolve().then((()=>{const n=o();delete n[JSON.stringify(e)],r().setItem(t,JSON.stringify(n))})),clear:()=>Promise.resolve().then((()=>{r().removeItem(t)}))}}function Te(e){const t=[...e.caches],n=t.shift();return void 0===n?{get:(e,t,n={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,n.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,r,o={miss:()=>Promise.resolve()})=>n.get(e,r,o).catch((()=>Te({caches:t}).get(e,r,o))),set:(e,r)=>n.set(e,r).catch((()=>Te({caches:t}).set(e,r))),delete:e=>n.delete(e).catch((()=>Te({caches:t}).delete(e))),clear:()=>n.clear().catch((()=>Te({caches:t}).clear()))}}function Ae(e={serializable:!0}){let t={};return{get(n,r,o={miss:()=>Promise.resolve()}){const a=JSON.stringify(n);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);const s=r(),i=o&&o.miss||(()=>Promise.resolve());return s.then((e=>i(e))).then((()=>s))},set:(n,r)=>(t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}function Re(e){let t=e.length-1;for(;t>0;t--){const n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function Le(e,t){return t?(Object.keys(t).forEach((n=>{e[n]=t[n](e)})),e):e}function Me(e,...t){let n=0;return e.replace(/%s/g,(()=>encodeURIComponent(t[n++])))}const _e="4.22.1",Fe={WithinQueryParameters:0,WithinHeaders:1};function Ue(e,t){const n=e||{},r=n.data||{};return Object.keys(n).forEach((e=>{-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(r[e]=n[e])})),{data:Object.entries(r).length>0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}const ze={Read:1,Write:2,Any:3},Ve={Up:1,Down:2,Timeouted:3},Qe=12e4;function Be(e,t=Ve.Up){return{...e,status:t,lastUpdate:Date.now()}}function Je(e){return"string"==typeof e?{protocol:"https",url:e,accept:ze.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||ze.Any}}const $e={Delete:"DELETE",Get:"GET",Post:"POST",Put:"PUT"};function Ke(e,t){return Promise.all(t.map((t=>e.get(t,(()=>Promise.resolve(Be(t))))))).then((e=>{const n=e.filter((e=>function(e){return e.status===Ve.Up||Date.now()-e.lastUpdate>Qe}(e))),r=e.filter((e=>function(e){return e.status===Ve.Timeouted&&Date.now()-e.lastUpdate<=Qe}(e))),o=[...n,...r];return{getTimeout:(e,t)=>(0===r.length&&0===e?1:r.length+3+e)*t,statelessHosts:o.length>0?o.map((e=>Je(e))):t}}))}const We=(e,t)=>(e=>{const t=e.status;return e.isTimedOut||(({isTimedOut:e,status:t})=>!e&&0==~~t)(e)||2!=~~(t/100)&&4!=~~(t/100)})(e)?t.onRetry(e):(({status:e})=>2==~~(e/100))(e)?t.onSuccess(e):t.onFail(e);function Ge(e,t,n,r){const o=[],a=function(e,t){if(e.method===$e.Get||void 0===e.data&&void 0===t.data)return;const n=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(n)}(n,r),s=function(e,t){const n={...e.headers,...t.headers},r={};return Object.keys(n).forEach((e=>{const t=n[e];r[e.toLowerCase()]=t})),r}(e,r),i=n.method,c=n.method!==$e.Get?{}:{...n.data,...r.data},u={"x-algolia-agent":e.userAgent.value,...e.queryParameters,...c,...r.queryParameters};let l=0;const h=(t,c)=>{const g=t.pop();if(void 0===g)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:et(o)};const m={data:a,headers:s,method:i,url:Xe(g,n.path,u),connectTimeout:c(l,e.timeouts.connect),responseTimeout:c(l,r.timeout)},p=e=>{const n={request:m,response:e,host:g,triesLeft:t.length};return o.push(n),n},f={onSuccess:e=>function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e),onRetry(n){const r=p(n);return n.isTimedOut&&l++,Promise.all([e.logger.info("Retryable failure",tt(r)),e.hostsCache.set(g,Be(g,n.isTimedOut?Ve.Timeouted:Ve.Down))]).then((()=>h(t,c)))},onFail(e){throw p(e),function({content:e,status:t},n){let r=e;try{r=JSON.parse(e).message}catch(o){}return function(e,t,n){return{name:"ApiError",message:e,status:t,transporterStackTrace:n}}(r,t,n)}(e,et(o))}};return e.requester.send(m).then((e=>We(e,f)))};return Ke(e.hostsCache,t).then((e=>h([...e.statelessHosts].reverse(),e.getTimeout)))}function Ye(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const n=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(n)&&(t.value=`${t.value}${n}`),t}};return t}function Xe(e,t,n){const r=Ze(n);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return r.length&&(o+=`?${r}`),o}function Ze(e){return Object.keys(e).map((t=>{return Me("%s=%s",t,(n=e[t],"[object Object]"===Object.prototype.toString.call(n)||"[object Array]"===Object.prototype.toString.call(n)?JSON.stringify(e[t]):e[t]));var n})).join("&")}function et(e){return e.map((e=>tt(e)))}function tt(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}const nt=e=>{const t=e.appId,n=function(e,t,n){const r={"x-algolia-api-key":n,"x-algolia-application-id":t};return{headers:()=>e===Fe.WithinHeaders?r:{},queryParameters:()=>e===Fe.WithinQueryParameters?r:{}}}(void 0!==e.authMode?e.authMode:Fe.WithinHeaders,t,e.apiKey),r=function(e){const{hostsCache:t,logger:n,requester:r,requestsCache:o,responsesCache:a,timeouts:s,userAgent:i,hosts:c,queryParameters:u,headers:l}=e,h={hostsCache:t,logger:n,requester:r,requestsCache:o,responsesCache:a,timeouts:s,userAgent:i,headers:l,queryParameters:u,hosts:c.map((e=>Je(e))),read(e,t){const n=Ue(t,h.timeouts.read),r=()=>Ge(h,h.hosts.filter((e=>0!=(e.accept&ze.Read))),e,n);if(!0!==(void 0!==n.cacheable?n.cacheable:e.cacheable))return r();const o={request:e,mappedRequestOptions:n,transporter:{queryParameters:h.queryParameters,headers:h.headers}};return h.responsesCache.get(o,(()=>h.requestsCache.get(o,(()=>h.requestsCache.set(o,r()).then((e=>Promise.all([h.requestsCache.delete(o),e])),(e=>Promise.all([h.requestsCache.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>h.responsesCache.set(o,e)})},write:(e,t)=>Ge(h,h.hosts.filter((e=>0!=(e.accept&ze.Write))),e,Ue(t,h.timeouts.write))};return h}({hosts:[{url:`${t}-dsn.algolia.net`,accept:ze.Read},{url:`${t}.algolia.net`,accept:ze.Write}].concat(Re([{url:`${t}-1.algolianet.com`},{url:`${t}-2.algolianet.com`},{url:`${t}-3.algolianet.com`}])),...e,headers:{...n.headers(),"content-type":"application/x-www-form-urlencoded",...e.headers},queryParameters:{...n.queryParameters(),...e.queryParameters}}),o={transporter:r,appId:t,addAlgoliaAgent(e,t){r.userAgent.add({segment:e,version:t})},clearCache:()=>Promise.all([r.requestsCache.clear(),r.responsesCache.clear()]).then((()=>{}))};return Le(o,e.methods)},rt=e=>(t,n)=>t.method===$e.Get?e.transporter.read(t,n):e.transporter.write(t,n),ot=e=>(t,n={})=>Le({transporter:e.transporter,appId:e.appId,indexName:t},n.methods),at=e=>(t,n)=>{const r=t.map((e=>({...e,params:Ze(e.params||{})})));return e.transporter.read({method:$e.Post,path:"1/indexes/*/queries",data:{requests:r},cacheable:!0},n)},st=e=>(t,n)=>Promise.all(t.map((t=>{const{facetName:r,facetQuery:o,...a}=t.params;return ot(e)(t.indexName,{methods:{searchForFacetValues:ut}}).searchForFacetValues(r,o,{...n,...a})}))),it=e=>(t,n,r)=>e.transporter.read({method:$e.Post,path:Me("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:n},cacheable:!0},r),ct=e=>(t,n)=>e.transporter.read({method:$e.Post,path:Me("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},n),ut=e=>(t,n,r)=>e.transporter.read({method:$e.Post,path:Me("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:n},cacheable:!0},r),lt={Debug:1,Info:2,Error:3};function ht(e,t,n){const r={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:e=>new Promise((t=>{const n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>n.setRequestHeader(t,e.headers[t])));const r=(e,r)=>setTimeout((()=>{n.abort(),t({status:0,content:r,isTimedOut:!0})}),1e3*e),o=r(e.connectTimeout,"Connection timeout");let a;n.onreadystatechange=()=>{n.readyState>n.OPENED&&void 0===a&&(clearTimeout(o),a=r(e.responseTimeout,"Socket timeout"))},n.onerror=()=>{0===n.status&&(clearTimeout(o),clearTimeout(a),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=()=>{clearTimeout(o),clearTimeout(a),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)}))},logger:(o=lt.Error,{debug:(e,t)=>(lt.Debug>=o&&console.debug(e,t),Promise.resolve()),info:(e,t)=>(lt.Info>=o&&console.info(e,t),Promise.resolve()),error:(e,t)=>(console.error(e,t),Promise.resolve())}),responsesCache:Ae(),requestsCache:Ae({serializable:!1}),hostsCache:Te({caches:[qe({key:`${_e}-${e}`}),Ae()]}),userAgent:Ye(_e).add({segment:"Browser",version:"lite"}),authMode:Fe.WithinQueryParameters};var o;return nt({...r,...n,methods:{search:at,searchForFacetValues:st,multipleQueries:at,multipleSearchForFacetValues:st,customRequest:rt,initIndex:e=>t=>ot(e)(t,{methods:{search:ct,searchForFacetValues:ut,findAnswers:it}})}})}ht.version=_e;var gt=ht,mt="1.0.0-alpha.28";function pt(){}function ft(e){return e}function dt(e,t){return e.reduce((function(e,n){var r=t(n);return e.hasOwnProperty(r)||(e[r]=[]),e[r].length<5&&e[r].push(n),e}),{})}function vt(){return vt=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n",highlightPostTag:"",hitsPerPage:20},i)}]},U({searchClient:t.searchClient,queries:t.queries}).then((function(e){return e.results}))).catch((function(e){throw"RetryError"===e.name&&s("error"),e})).then((function(e){var t=e[0].hits,n=e[0].nbHits,o=dt(t,(function(e){return e.hierarchy.lvl0}));return r.context.searchSuggestions.length0&&(B(),N.current&&N.current.focus())}),[q,B]),V.a.createElement("div",vt({ref:I},z({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===D.status&&"DocSearch-Container--Stalled","error"===D.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),onMouseDown:function(e){e.target===e.currentTarget&&u()}}),V.a.createElement("div",{className:"DocSearch-Modal"},V.a.createElement("header",{className:"DocSearch-SearchBar",ref:C},V.a.createElement(Ce,vt({},_,{state:D,autoFocus:0===q.length,onClose:u,inputRef:N}))),V.a.createElement("div",{className:"DocSearch-Dropdown",ref:k},V.a.createElement(je,vt({},_,{indexName:o,state:D,hitComponent:m,resultsFooterComponent:f,disableUserPersonalization:E,recentSearches:R,favoriteSearches:A,onItemClick:function(e){M(e),u()},inputRef:N}))),V.a.createElement("footer",{className:"DocSearch-Footer"},V.a.createElement(J,null))))}}}]); \ No newline at end of file diff --git a/build/36.5eabf4cf.js b/build/36.5eabf4cf.js deleted file mode 100644 index 49a3248..0000000 --- a/build/36.5eabf4cf.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{184:function(n,i,o){"use strict";o.r(i);var r=o(52);for(var t in r)["default"].indexOf(t)<0&&function(n){o.d(i,n,(function(){return r[n]}))}(t)}}]); \ No newline at end of file diff --git a/build/37baf4df.a1be473b.js b/build/37baf4df.a1be473b.js deleted file mode 100644 index 3076246..0000000 --- a/build/37baf4df.a1be473b.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{72:function(e,n,r){"use strict";r.r(n),r.d(n,"frontMatter",(function(){return c})),r.d(n,"metadata",(function(){return s})),r.d(n,"rightToc",(function(){return p})),r.d(n,"default",(function(){return m}));var t=r(2),o=r(6),i=(r(0),r(93)),a=["components"],c={id:"using-immer",title:"Using immer"},s={unversionedId:"recipes/using-immer",id:"recipes/using-immer",isDocsHomePage:!1,title:"Using immer",description:"While xoid's API surface is kept small intentionally, there's a way for extensions.",source:"@site/main/docs/recipes/using-immer.md",slug:"/recipes/using-immer",permalink:"/docs/recipes/using-immer",editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes/using-immer.md",version:"current",sidebar:"docs",previous:{title:"Working with nested state",permalink:"/docs/recipes/nested-state"},next:{title:"Using reducers",permalink:"/docs/recipes/using-reducers"}},p=[],u={rightToc:p},l="wrapper";function m(e){var n=e.components,r=Object(o.a)(e,a);return Object(i.b)(l,Object(t.a)({},u,r,{components:n,mdxType:"MDXLayout"}),Object(i.b)("p",null,"While ",Object(i.b)("strong",{parentName:"p"},"xoid"),"'s API surface is kept small intentionally, there's a way for extensions.\nIf you'd like to add a ",Object(i.b)("inlineCode",{parentName:"p"},".produce")," method that uses ",Object(i.b)("strong",{parentName:"p"},"immer")," internally, you can do it like the following."),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre",className:"language-js"},"import { create } from 'xoid'\nimport { produce } from 'immer'\n\ncreate.plugins.push((atom) => {\n atom.produce = (fn) => atom.update((s) => produce(s, fn))\n})\n")),Object(i.b)("p",null,"If you're using TypeScript, simply apply the following module augmentation:"),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre",className:"language-js"},"declare module 'xoid' {\n interface Atom {\n produce: (fn: (draft: T) => void) => void\n }\n interface Stream {\n produce: (fn: (draft: T) => void) => void\n }\n}\n")))}m.isMDXComponent=!0},93:function(e,n,r){"use strict";r.d(n,"a",(function(){return l})),r.d(n,"b",(function(){return b}));var t=r(0),o=r.n(t);function i(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function a(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function c(e){for(var n=1;n=0||(o[r]=e[r]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var p=o.a.createContext({}),u=function(e){var n=o.a.useContext(p),r=n;return e&&(r="function"==typeof e?e(n):c(c({},n),e)),r},l=function(e){var n=u(e.components);return o.a.createElement(p.Provider,{value:n},e.children)},m="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return o.a.createElement(o.a.Fragment,{},n)}},f=o.a.forwardRef((function(e,n){var r=e.components,t=e.mdxType,i=e.originalType,a=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),l=u(r),m=t,f=l["".concat(a,".").concat(m)]||l[m]||d[m]||i;return r?o.a.createElement(f,c(c({ref:n},p),{},{components:r})):o.a.createElement(f,c({ref:n},p))}));function b(e,n){var r=arguments,t=n&&n.mdxType;if("string"==typeof e||t){var i=r.length,a=new Array(i);a[0]=f;var c={};for(var s in n)hasOwnProperty.call(n,s)&&(c[s]=n[s]);c.originalType=e,c[m]="string"==typeof e?e:t,a[1]=c;for(var p=2;p + + + + +Page Not Found · xoid + + + + + + + \ No newline at end of file diff --git a/build/4c274390.cd7e9bbb.js b/build/4c274390.cd7e9bbb.js deleted file mode 100644 index 1a31c4b..0000000 --- a/build/4c274390.cd7e9bbb.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{73:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return s})),n.d(t,"rightToc",(function(){return l})),n.d(t,"default",(function(){return b}));var a=n(2),r=n(6),o=(n(0),n(93)),i=["components"],c={id:"streams",title:"Streams"},s={unversionedId:"streams",id:"streams",isDocsHomePage:!1,title:"Streams",description:"xoid offers basic support for streams. Streams are generally treated as a whole different concept than atoms. They're actually very close, and there's no need for a completely different library for them. xoid thinks that streams can easily be a a \"bonus feature\" of an atomic state management library.",source:"@site/main/docs/streams.md",slug:"/streams",permalink:"/docs/streams",editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/streams.md",version:"current",sidebar:"docs",previous:{title:"Performance optimizations",permalink:"/docs/performance-optimizations"},next:{title:"Advanced concepts",permalink:"/docs/advanced-concepts"}},l=[{value:"Using the .map method with true as the second argument",id:"using-the-map-method-with-true-as-the-second-argument",children:[]},{value:"Using create with no arguments",id:"using-create-with-no-arguments",children:[]}],p={rightToc:l},u="wrapper";function b(e){var t=e.components,n=Object(r.a)(e,i);return Object(o.b)(u,Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"xoid")," offers basic support for ",Object(o.b)("strong",{parentName:"p"},"streams"),". Streams are generally treated as a whole different concept than atoms. They're actually very close, and there's no need for a completely different library for them. ",Object(o.b)("strong",{parentName:"p"},"xoid"),' thinks that streams can easily be a a "bonus feature" of an atomic state management library. '),Object(o.b)("p",null,"Our definition of a stream is the following:"),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"A ",Object(o.b)("strong",{parentName:"p"},"stream")," is an ",Object(o.b)("strong",{parentName:"p"},"atom")," that ",Object(o.b)("strong",{parentName:"p"},"may not")," have an immediate value.")),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"xoid")," have a separate ",Object(o.b)("inlineCode",{parentName:"p"},"Stream")," type along with the ",Object(o.b)("inlineCode",{parentName:"p"},"Atom"),".\nStreams differ from atoms not only by types, but also in terms of the runtime behaviour. "),Object(o.b)("p",null,"There are two ways to produce a stream in ",Object(o.b)("strong",{parentName:"p"},"xoid"),":"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Using the ",Object(o.b)("inlineCode",{parentName:"li"},".map")," method with ",Object(o.b)("inlineCode",{parentName:"li"},"true")," as the second argument "),Object(o.b)("li",{parentName:"ul"},"Using ",Object(o.b)("inlineCode",{parentName:"li"},"create")," with no arguments")),Object(o.b)("h3",{id:"using-the-map-method-with-true-as-the-second-argument"},"Using the ",Object(o.b)("inlineCode",{parentName:"h3"},".map")," method with ",Object(o.b)("inlineCode",{parentName:"h3"},"true")," as the second argument"),Object(o.b)("p",null,"Imagine we're setting up a basic counter, and we're deriving another counter that takes only the odd values from the first.\nWe can set this up in the following way:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"const $counter = create(0)\nconst $odd = $counter.map((s) => s % 2 ? s : undefined, true) \n// Type of `$odd` would be `Stream`\n")),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"true"),' in the second argument means "filter out falsy values" here.\nIf we didn\'t use this overload of ',Object(o.b)("inlineCode",{parentName:"p"},".map"),", we would end up with a ",Object(o.b)("inlineCode",{parentName:"p"},"Atom"),".\nHowever, we would lose the following benefits:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"const $doubleOdd = $odd.map((value) => value * 2)\n")),Object(o.b)("p",null,"Here, the type of ",Object(o.b)("inlineCode",{parentName:"p"},"value")," is always a ",Object(o.b)("inlineCode",{parentName:"p"},"number"),". If we were working with a ",Object(o.b)("inlineCode",{parentName:"p"},"Atom")," instead of a ",Object(o.b)("inlineCode",{parentName:"p"},"Stream"),", ",Object(o.b)("inlineCode",{parentName:"p"},"value")," would also be ",Object(o.b)("inlineCode",{parentName:"p"},"number | undefined")," and our code would be slightly more verbose to cover those cases."),Object(o.b)("h3",{id:"using-create-with-no-arguments"},"Using ",Object(o.b)("inlineCode",{parentName:"h3"},"create")," with no arguments"),Object(o.b)("p",null,"When no arguments are used, ",Object(o.b)("inlineCode",{parentName:"p"},"create")," function produces a ",Object(o.b)("inlineCode",{parentName:"p"},"Stream")," instead of an ",Object(o.b)("inlineCode",{parentName:"p"},"Atom"),". Let's assume we're creating a ",Object(o.b)("inlineCode",{parentName:"p"},"$clickStream")," and a ",Object(o.b)("inlineCode",{parentName:"p"},"$clickAtom")," like the following:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"import create from 'xoid'\n\nconst $clickStream = create() // Stream\nconst $clickAtom = create(undefined) // Atom\n\n// Imagine we're going to satisfy the internal value of these atoms later as:\nwindow.addEventListener('click', $clickStream.set)\nwindow.addEventListener('click', $clickAtom.set)\n")),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"Note that in JavaScript, calling a function with no arguments can be different than calling it with ",Object(o.b)("inlineCode",{parentName:"p"},"undefined"),", if the internal implementation of the function makes use of the ",Object(o.b)("inlineCode",{parentName:"p"},"arguments.length")," builtin. ",Object(o.b)("strong",{parentName:"p"},"xoid")," makes use of exactly that.")),Object(o.b)("p",null,"Let's look at the similarities and differences between ",Object(o.b)("inlineCode",{parentName:"p"},"$clickStream")," and ",Object(o.b)("inlineCode",{parentName:"p"},"$clickAtom"),".\nFirst of all, their ",Object(o.b)("inlineCode",{parentName:"p"},".value")," getter types are the same."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"$clickStream.value // MouseEvent | undefined\n$clickAtom.value // MouseEvent | undefined\n")),Object(o.b)("p",null,"However, there's a difference in ",Object(o.b)("inlineCode",{parentName:"p"},".set")," method's types. This applies for ",Object(o.b)("inlineCode",{parentName:"p"},".update")," as well."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"$clickStream.set // (value: MouseEvent) => void\n$clickAtom.set // (value: MouseEvent | undefined) => void\n")),Object(o.b)("p",null,"A stream's key feature is the behavior of its ",Object(o.b)("inlineCode",{parentName:"p"},".map")," and ",Object(o.b)("inlineCode",{parentName:"p"},".focus")," methods.\nFirst, let's look at the ",Object(o.b)("inlineCode",{parentName:"p"},".map")," method's types."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"$clickStream.map((value) => { /* `value` has the `MouseEvent` type */ })\n$clickAtom.map((value) => { /* `value` has the `MouseEvent | undefined` type */ })\n")),Object(o.b)("p",null,"As you can see, even though ",Object(o.b)("inlineCode",{parentName:"p"},"$clickStream")," starts off ",Object(o.b)("inlineCode",{parentName:"p"},"undefined")," as its internal value, we do not run into any ",Object(o.b)("inlineCode",{parentName:"p"},"undefined")," type inside the ",Object(o.b)("inlineCode",{parentName:"p"},".map")," method callback. This can be beneficial, because now you can chain multiple ",Object(o.b)("inlineCode",{parentName:"p"},".map")," methods without caring about the ",Object(o.b)("inlineCode",{parentName:"p"},"undefined")," states."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"const double = (value: number) => value * 2\n\nconst $doubleX = clickStream\n .map((event) => event.clientX)\n .map(double)\n")),Object(o.b)("hr",null),Object(o.b)("p",null,"Lastly, here's the difference of the two, from the ",Object(o.b)("inlineCode",{parentName:"p"},"index.d.ts")," file of ",Object(o.b)("strong",{parentName:"p"},"xoid"),". "),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"export type Atom = {\n value: T\n set(state: T): void\n update(fn: (state: T) => T): void\n subscribe(fn: (state: T, prevState: T) => unknown): () => void\n watch(fn: (state: T, prevState: T) => unknown): () => void\n focus(fn: (state: T) => U): Atom\n focus(key: U): Atom\n map(fn: (state: T, prevState: T) => U): Atom\n map(fn: (state: T, prevState: T) => U, filterOutFalsyValues: true): Stream>\n}\n\nexport type Stream = {\n value: T | undefined\n set(state: T): void\n update(fn: (state: T | undefined) => T): void\n subscribe(fn: (state: T, prevState: T | undefined) => unknown): () => void\n watch(fn: (state: T | undefined, prevState: T | undefined) => unknown): () => void\n focus(fn: (state: T) => U): Stream\n focus(key: U): Stream\n map(fn: (state: T, prevState: T | undefined) => U): Stream\n map(\n fn: (state: T, prevState: T | undefined) => U,\n filterOutFalsyValues: true\n ): Stream>\n}\n")),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"Observe that the few major differences are the ",Object(o.b)("inlineCode",{parentName:"p"},".value")," getter and bunch of ",Object(o.b)("inlineCode",{parentName:"p"},"prevState"),"s.")))}b.isMDXComponent=!0},93:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return f}));var a=n(0),r=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=r.a.createContext({}),p=function(e){var t=r.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},u=function(e){var t=p(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},b="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),u=p(n),b=a,d=u["".concat(i,".").concat(b)]||u[b]||m[b]||o;return n?r.a.createElement(d,c(c({ref:t},l),{},{components:n})):r.a.createElement(d,c({ref:t},l))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=d;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c[b]="string"==typeof e?e:a,i[1]=c;for(var l=2;l \n JSON.parse(localStorage.getItem(key))\n\nconst setLocalStorage = (key) => (state) => \n localStorage.setItem(key, JSON.stringify(state))\n\n// usage\nconst atom = create(getLocalStorage('foo') || initialState)\natom.subscribe(setLocalStorage('foo'))\n")))}f.isMDXComponent=!0},93:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return g}));var n=r(0),a=r.n(n);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=a.a.createContext({}),p=function(e){var t=a.a.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},u=function(e){var t=p(e.components);return a.a.createElement(l.Provider,{value:t},e.children)},f="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,i=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),u=p(r),f=n,d=u["".concat(i,".").concat(f)]||u[f]||m[f]||o;return r?a.a.createElement(d,c(c({ref:t},l),{},{components:r})):a.a.createElement(d,c({ref:t},l))}));function g(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,i=new Array(o);i[0]=d;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c[f]="string"==typeof e?e:n,i[1]=c;for(var l=2;luseSetup for React users",id:"importance-of-usesetup-for-react-users",children:[]}],l={rightToc:p},u="wrapper";function m(e){var t=e.components,n=Object(o.a)(e,c);return Object(a.b)(u,Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)("p",null,Object(a.b)("inlineCode",{parentName:"p"},"import { useSetup } from '@xoid/react'")),Object(a.b)("p",null,Object(a.b)("inlineCode",{parentName:"p"},"import { useSetup } from '@xoid/svelte'")),Object(a.b)("p",null,Object(a.b)("inlineCode",{parentName:"p"},"import { useSetup } from '@xoid/vue'")),Object(a.b)("h2",{id:"basic-usage"},"Basic usage"),Object(a.b)("pre",null,Object(a.b)("code",{parentName:"pre",className:"language-js"},"import { create } from 'xoid'\nimport { useSetup } from '@xoid/react'\n\n// inside a component\nconst $num = useSetup(() => create(5))\n")),Object(a.b)("p",null,"When a second argument is provided, it'll be available in the callback argument ",Object(a.b)("strong",{parentName:"p"},"as a reactive atom"),"."),Object(a.b)("pre",null,Object(a.b)("code",{parentName:"pre",className:"language-js"},"import { subscribe, use } from 'xoid'\nimport { useSetup } from '@xoid/react'\n\nconst App = (props: Props) => {\n useSetup(($props) => {// `$props` has the type: Atom\n $props.focus(s => s.something).subscribe(console.log)\n }, props)\n ...\n}\n")),Object(a.b)("h2",{id:"importance-of-usesetup-for-react-users"},"Importance of ",Object(a.b)("inlineCode",{parentName:"h2"},"useSetup")," for React users"),Object(a.b)("p",null,"While Vue and Svelte chooses a static closure as the component mental model, React chooses a render cycle. Although a render cycle might look like a real closure, it's not. Some people may find it more comfortable, but it brings some difficulties to the table:"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},'The runtime relies on the call order of hooks. This implies a strict "rules of hooks" to the user.'),Object(a.b)("li",{parentName:"ul"},"The API surface has to increase. There comes hooks like ",Object(a.b)("inlineCode",{parentName:"li"},"useCallback"),", ",Object(a.b)("inlineCode",{parentName:"li"},"useMemo"),", ",Object(a.b)("inlineCode",{parentName:"li"},"useRef")," just to persist variables.")),Object(a.b)("p",null,"Vue, Svelte, and more other frameworks on the other hand, use a real closure instead of a render cycle. They never need abstractions such as ",Object(a.b)("inlineCode",{parentName:"p"},"useCallback"),", ",Object(a.b)("inlineCode",{parentName:"p"},"useMemo"),", ",Object(a.b)("inlineCode",{parentName:"p"},"useRef"),", nor they need a strict rules of hooks. ",Object(a.b)("strong",{parentName:"p"},"xoid")," aims to bring the same to React."),Object(a.b)("pre",null,Object(a.b)("code",{parentName:"pre",className:"language-js"},"import { useSetup } from '@xoid/react'\nimport { effect } from 'xoid/setup'\n\nconst App = (props: Props) => {\n useSetup(() => {\n const callback = () => { ... }\n\n effect(() => {\n window.addEventListener('resize', callback)\n window.addEventListener('orientationchange', callback)\n\n return () => {\n window.removeEventListener('resize', callback)\n window.removeEventListener('orientationchange', callback)\n }\n })\n })\n ...\n}\n")),Object(a.b)("p",null,"You can call ",Object(a.b)("inlineCode",{parentName:"p"},"effect")," multiple times, or conditionally. It'll connect to the same ",Object(a.b)("inlineCode",{parentName:"p"},"useEffect")," call. "),Object(a.b)("pre",null,Object(a.b)("code",{parentName:"pre",className:"language-js"},"import { useSetup } from '@xoid/react'\nimport { effect } from 'xoid/setup'\n\nconst App = (props: Props) => {\n useSetup(() => {\n const callback = () => { ... }\n\n effect(() => {\n window.addEventListener('resize', callback)\n return () => window.removeEventListener('resize', callback)\n })\n\n effect(() => {\n window.addEventListener('orientationchange', callback)\n return () => window.removeEventListener('orientationchange', callback)\n })\n })\n ...\n}\n")),Object(a.b)("p",null,"Same applies for ",Object(a.b)("inlineCode",{parentName:"p"},"inject"),"."),Object(a.b)("pre",null,Object(a.b)("code",{parentName:"pre",className:"language-js"},"import { useSetup } from '@xoid/react'\nimport { inject } from 'xoid/setup'\nimport { ThemeSymbol } from './some-module'\n\nconst App = (props: Props) => {\n useSetup(() => {\n const theme = inject(ThemeSymbol)\n // do something with the theme\n })\n ...\n}\n")),Object(a.b)("blockquote",null,Object(a.b)("p",{parentName:"blockquote"},Object(a.b)("inlineCode",{parentName:"p"},"useSetup")," is actually more suitable than ",Object(a.b)("inlineCode",{parentName:"p"},"React.useMemo")," to create values ",Object(a.b)("strong",{parentName:"p"},"exactly once"),". According to ",Object(a.b)("a",{parentName:"p",href:"https://reactjs.org/docs/hooks-faq.html#how-to-create-expensive-objects-lazily"},"React docs"),', "You may rely on useMemo as a performance optimization, not as a semantic guarantee. In the future, React may choose to \u201cforget\u201d some previously memoized values and recalculate them on next render, e.g. to free memory for offscreen components.". ',Object(a.b)("inlineCode",{parentName:"p"},"useSetup")," hook is based on ",Object(a.b)("inlineCode",{parentName:"p"},"useRef"),", thus it's guaranteed to run the callback exactly ",Object(a.b)("strong",{parentName:"p"},"once"),".")),Object(a.b)("blockquote",null,Object(a.b)("p",{parentName:"blockquote"},"Warning: ",Object(a.b)("inlineCode",{parentName:"p"},"@xoid/react"),"'s way of implementing ",Object(a.b)("inlineCode",{parentName:"p"},"inject")," relies on React internals that ",Object(a.b)("em",{parentName:"p"},"MIGHT")," change in the future. This works properly since the React version 16 to the latest version 18 as of now, however if you choose to not use it, we would like to assure you that it has no runtime effect when it's not called. You can see the implementation ",Object(a.b)("a",{parentName:"p",href:"https://github.com/xoidlabs/xoid/tree/master/packages/react/src/index.tsx"},"here"),". It's known that ",Object(a.b)("inlineCode",{parentName:"p"},"react-relay")," uses the same internal, and it's even supported by ",Object(a.b)("inlineCode",{parentName:"p"},"preact/compat"),". So it's likely there to stay, or at least an equivalent mechanism looks like is going to be supported in the next Fiber versions.")))}m.isMDXComponent=!0},93:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return f}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var p=o.a.createContext({}),l=function(e){var t=o.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=l(e.components);return o.a.createElement(p.Provider,{value:t},e.children)},m="mdxType",b={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),u=l(n),m=r,d=u["".concat(c,".").concat(m)]||u[m]||b[m]||a;return n?o.a.createElement(d,i(i({ref:t},p),{},{components:n})):o.a.createElement(d,i({ref:t},p))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=d;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[m]="string"==typeof e?e:r,c[1]=i;for(var p=2;p state + 1)\nconsole.log($count.value) // 6\n")),Object(o.b)("p",null,"Atoms may have actions."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"import create from 'xoid'\n\nconst $count = create(5, (atom) => ({\n increment: () => atom.update(s => s + 1),\n decrement: () => atom.value-- // `.value` setter is supported too\n}))\n\n$count.actions.increment()\n")),Object(o.b)("p",null,"There's the ",Object(o.b)("inlineCode",{parentName:"p"},".focus")," method, which can be used as a selector/lens. ",Object(o.b)("strong",{parentName:"p"},"xoid"),' is based on immutable updates, so if you "surgically" set state of a focused branch, changes will propagate to the root.'),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"import create from 'xoid'\n\nconst $atom = create({ deeply: { nested: { alpha: 5 } } })\nconst previousValue = $atom.value\n\n// select `.deeply.nested.alpha`\nconst $alpha = $atom.focus(s => s.deeply.nested.alpha)\n$alpha.set(6)\n\n// root state is replaced with new immutable state\nassert($atom.value !== previousValue) // \u2705\nassert($atom.value.deeply.nested.alpha === 6) // \u2705\n")),Object(o.b)("h3",{id:"derived-state"},"Derived state"),Object(o.b)("p",null,"State can be derived from other atoms. This API was heavily inspired by ",Object(o.b)("strong",{parentName:"p"},"Recoil"),"."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"const $alpha = create(3)\nconst $beta = create(5)\n// derived atom\nconst $sum = create((read) => read($alpha) + read($beta))\n")),Object(o.b)("p",null,"Alternatively, ",Object(o.b)("inlineCode",{parentName:"p"},".map")," method can be used to quickly derive the state from a single atom."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"const $alpha = create(3)\n// derived atom\nconst $doubleAlpha = $alpha.map((s) => s * 2)\n")),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"Atoms are lazily evaluated. This means that the callback functions of ",Object(o.b)("inlineCode",{parentName:"p"},"$sum")," and ",Object(o.b)("inlineCode",{parentName:"p"},"$doubleAlpha")," in this example won't execute until the first subscription to these atoms. This is a performance optimization.")),Object(o.b)("h3",{id:"subscriptions"},"Subscriptions"),Object(o.b)("p",null,"For subscriptions, ",Object(o.b)("inlineCode",{parentName:"p"},"subscribe")," and ",Object(o.b)("inlineCode",{parentName:"p"},"watch")," are used. They are the same, except ",Object(o.b)("inlineCode",{parentName:"p"},"watch")," runs the callback immediately, while ",Object(o.b)("inlineCode",{parentName:"p"},"subscribe")," waits for the first update after subscription."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"const unsub = $atom.subscribe((state, previousState) => {\n console.log(state, previousState)\n})\n\n// later\nunsub()\n")),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"All methods of a ",Object(o.b)("strong",{parentName:"p"},"xoid")," atom are covered up to this point. This concludes the basic usage! \ud83c\udf89")))}b.isMDXComponent=!0},93:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return f}));var a=n(0),r=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=r.a.createContext({}),u=function(e){var t=r.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=u(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},b="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},m=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,c=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),p=u(n),b=a,m=p["".concat(c,".").concat(b)]||p[b]||d[b]||o;return n?r.a.createElement(m,i(i({ref:t},l),{},{components:n})):r.a.createElement(m,i({ref:t},l))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,c=new Array(o);c[0]=m;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[b]="string"==typeof e?e:a,c[1]=i;for(var l=2;l {\n const callback = () => console.log(props.number)\n window.addEventListener('click', callback)\n return () => window.removeEventListener('click', callback)\n}, [props.number])\n")),Object(c.b)("p",null,"Let's assume that, due to changed app requirements, we want to attach the listener only once, and remove it once the component is unmounted. This can be achieved in React way as the following:"),Object(c.b)("pre",null,Object(c.b)("code",{parentName:"pre",className:"language-js"},"// a ref to keep the value\nconst numberRef = useRef(props.number)\n// an effect to update ref's current value when the `props.number` is changed\nuseEffect(() => (numberRef.current = props.number), [props.number])\n\n// This time useEffect is with an empty dependency array, and it references the ref.\nuseEffect(() => {\n const callback = () => console.log(numberRef.current)\n window.addEventListener('click', callback)\n return () => window.removeEventListener('click', callback)\n}, [])\n")),Object(c.b)("p",null,"With ",Object(c.b)("strong",{parentName:"p"},"xoid"),", the equivalent optimization is simply the following:"),Object(c.b)("pre",null,Object(c.b)("code",{parentName:"pre",className:"language-js"},"useSetup(($props, { effect }) => {\n effect(() => {\n const callback = () => console.log($props.value.number)\n window.addEventListener('click', callback)\n return () => window.removeEventListener('click', callback)\n })\n}, props)\n")),Object(c.b)("p",null,"After getting used to, ",Object(c.b)("strong",{parentName:"p"},"xoid")," can feel more intuitive than React hooks in a lot of cases."),Object(c.b)("h3",{id:"another-example"},"Another Example"),Object(c.b)("p",null,"Let's propose another problem, this time let's examine it in a more concrete scenario."),Object(c.b)("p",null,"Let's imagine, inside a React component, we're supposed to initialize a class called ",Object(c.b)("inlineCode",{parentName:"p"},"DragDropLibrary")," ",Object(c.b)("strong",{parentName:"p"},"only once")," as ",Object(c.b)("inlineCode",{parentName:"p"},"new DragDropLibrary({ onDrop })"),". Let's assume we have only one chance to supply ",Object(c.b)("inlineCode",{parentName:"p"},"onDrop")," to the class instance, and this function cannot be replaced afterwards."),Object(c.b)("p",null,"Imagine that ",Object(c.b)("inlineCode",{parentName:"p"},"props.func")," is our dynamic function that changes in every render, and we're supposed to feed it to ",Object(c.b)("inlineCode",{parentName:"p"},"onDrop"),"."),Object(c.b)("p",null,"With ",Object(c.b)("strong",{parentName:"p"},"xoid"),":"),Object(c.b)("pre",null,Object(c.b)("code",{parentName:"pre",className:"language-js"},"useSetup(($props) => {\n const onDrop = (...args) => $props.value.func(...args)\n new DragDropLibrary({ onDrop })\n}, props)\n")),Object(c.b)("blockquote",null,Object(c.b)("p",{parentName:"blockquote"},"Think of ",Object(c.b)("inlineCode",{parentName:"p"},"useSetup")," as not a hook, but as something unchanging, some closure that does not ever rerender. ",Object(c.b)("strong",{parentName:"p"},"@xoid/react"),", in some sense, is a React without hooks.")),Object(c.b)("p",null,"Without ",Object(c.b)("strong",{parentName:"p"},"xoid"),": "),Object(c.b)("pre",null,Object(c.b)("code",{parentName:"pre",className:"language-js"},"const funcRef = useRef((...args) => props.func(...args))\nuseEffect(() => { funcRef.current = (...args) => props.func(...args) }, [props.func])\nuseMemo(() => {\n new DragDropLibrary({ onDrop: funcRef.current })\n}, [])\n")))}b.isMDXComponent=!0},93:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return f}));var r=t(0),a=t.n(r);function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function i(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var p=a.a.createContext({}),l=function(e){var n=a.a.useContext(p),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},u=function(e){var n=l(e.components);return a.a.createElement(p.Provider,{value:n},e.children)},b="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return a.a.createElement(a.a.Fragment,{},n)}},m=a.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,c=e.originalType,o=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),u=l(t),b=r,m=u["".concat(o,".").concat(b)]||u[b]||d[b]||c;return t?a.a.createElement(m,i(i({ref:n},p),{},{components:t})):a.a.createElement(m,i({ref:n},p))}));function f(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var c=t.length,o=new Array(c);o[0]=m;var i={};for(var s in n)hasOwnProperty.call(n,s)&&(i[s]=n[s]);i.originalType=e,i[b]="string"==typeof e?e:r,o[1]=i;for(var p=2;p=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var u=r.a.createContext({}),s=function(e){var t=r.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},b=function(e){var t=s(e.components);return r.a.createElement(u.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},m=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,c=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),b=s(n),p=a,m=b["".concat(c,".").concat(p)]||b[p]||d[p]||o;return n?r.a.createElement(m,i(i({ref:t},u),{},{components:n})):r.a.createElement(m,i({ref:t},u))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,c=new Array(o);c[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i[p]="string"==typeof e?e:a,c[1]=i;for(var u=2;u {\n this.setState({ alpha: this.state.alpha + 1 })\n }\n render() {\n // render\n return
    {this.state.alpha}
    \n }\n}\n")),Object(o.b)("p",null,"Here's a basic React-like class component runtime prepared with ",Object(o.b)("strong",{parentName:"p"},"xoid"),"."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"import { create, Atom } from 'xoid'\n\nclass Runtime {\n $props: Atom;\n $state!: Atom;\n constructor($props: Atom) {\n this.$props = $props;\n }\n get props() {\n return this.$props.value;\n }\n get state() {\n return this.$state.value;\n }\n setState(partial: Partial) {\n this.$state.update((s) => ({ ...s, ...partial }));\n }\n}\n")),Object(o.b)("p",null,"We can then easily evolve into the following, working structure without too much refactor:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"class AppRuntime extends Runtime<{}, { alpha: number }> {\n $state = create({ alpha: 5 });\n incrementAlpha = () => {\n this.setState({ alpha: this.state.alpha + 1 });\n };\n}\n\nconst App = (props: Props) => {\n const self = useSetup(($props) => new AppRuntime($props), props)\n useAtom(self.$state)\n\n return
    {self.state.alpha}
    \n}\n")),Object(o.b)("p",null,"Observe that the only big differece is replacing ",Object(o.b)("inlineCode",{parentName:"p"},"this")," in the render function with ",Object(o.b)("inlineCode",{parentName:"p"},"self"),"."),Object(o.b)("p",null,"After getting rid of ",Object(o.b)("inlineCode",{parentName:"p"},"this.setState")," usages, we can get rid of the ",Object(o.b)("inlineCode",{parentName:"p"},"Runtime")," class too."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-js"},"const AppSetup = ($props: Atom) => {\n const $state = create({ alpha: 5 })\n const incrementAlpha = () => $state.focus('alpha').update((s) => s + 1)\n return { $state, incrementAlpha }\n}\n\nconst App = (props: Props) => {\n const { $state, incrementAlpha } = useSetup(AppSetup, props)\n const { alpha } = useAtom(self.$state)\n\n return
    {alpha}
    \n}\n")))}f.isMDXComponent=!0},93:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return d}));var r=n(0),a=n.n(r);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=a.a.createContext({}),l=function(e){var t=a.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},u=function(e){var t=l(e.components);return a.a.createElement(p.Provider,{value:t},e.children)},f="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},b=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,c=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),u=l(n),f=r,b=u["".concat(c,".").concat(f)]||u[f]||m[f]||o;return n?a.a.createElement(b,s(s({ref:t},p),{},{components:n})):a.a.createElement(b,s({ref:t},p))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,c=new Array(o);c[0]=b;var s={};for(var i in t)hasOwnProperty.call(t,i)&&(s[i]=t[i]);s.originalType=e,s[f]="string"==typeof e?e:r,c[1]=s;for(var p=2;ph2,.markdown>h3,.markdown>h4,.markdown>h5,.markdown>h6{margin-bottom:calc(var(--ifm-heading-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown li,body{word-wrap:break-word}body,ol ol,ol ul,ul ol,ul ul{margin:0}pre,table{overflow:auto}blockquote,pre{margin:0 0 var(--ifm-spacing-vertical)}.breadcrumbs__link,.button{transition-timing-function:var(--ifm-transition-timing-default)}.button,code{vertical-align:middle}.button--outline.button--active,.button--outline:active,.button--outline:hover,:root{--ifm-button-color:var(--ifm-font-color-base-inverse)}.menu__link:hover,a{transition:color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.navbar--dark,:root{--ifm-navbar-link-hover-color:var(--ifm-color-primary)}.menu,.navbar-sidebar{overflow-x:hidden}:root,html[data-theme=dark]{--ifm-color-emphasis-500:var(--ifm-color-gray-500)}.markdown table,table{border-collapse:collapse}.markdown .tabs .tabs__item.tabs__item--active,code .token.important.bold{font-weight:700}.GetStarted .steps,.main-wrapper{align-self:center}.toggleButton_gllP,html{-webkit-tap-highlight-color:transparent}*,.DocSearch-Container,.DocSearch-Container *,.HeaderHero .spinner{box-sizing:border-box}:root{--ifm-color-scheme:light;--ifm-dark-value:10%;--ifm-darker-value:15%;--ifm-darkest-value:30%;--ifm-light-value:15%;--ifm-lighter-value:30%;--ifm-lightest-value:50%;--ifm-contrast-background-value:90%;--ifm-contrast-foreground-value:70%;--ifm-contrast-background-dark-value:70%;--ifm-contrast-foreground-dark-value:90%;--ifm-color-primary:#3578e5;--ifm-color-secondary:#ebedf0;--ifm-color-success:#00a400;--ifm-color-info:#54c7ec;--ifm-color-warning:#ffba00;--ifm-color-danger:#fa383e;--ifm-color-primary-dark:#306cce;--ifm-color-primary-darker:#2d66c3;--ifm-color-primary-darkest:#2554a0;--ifm-color-primary-light:#538ce9;--ifm-color-primary-lighter:#72a1ed;--ifm-color-primary-lightest:#9abcf2;--ifm-color-primary-contrast-background:#ebf2fc;--ifm-color-primary-contrast-foreground:#102445;--ifm-color-secondary-dark:#d4d5d8;--ifm-color-secondary-darker:#c8c9cc;--ifm-color-secondary-darkest:#a4a6a8;--ifm-color-secondary-light:#eef0f2;--ifm-color-secondary-lighter:#f1f2f5;--ifm-color-secondary-lightest:#f5f6f8;--ifm-color-secondary-contrast-background:#fdfdfe;--ifm-color-secondary-contrast-foreground:#474748;--ifm-color-success-dark:#009400;--ifm-color-success-darker:#008b00;--ifm-color-success-darkest:#007300;--ifm-color-success-light:#26b226;--ifm-color-success-lighter:#4dbf4d;--ifm-color-success-lightest:#80d280;--ifm-color-success-contrast-background:#e6f6e6;--ifm-color-success-contrast-foreground:#003100;--ifm-color-info-dark:#4cb3d4;--ifm-color-info-darker:#47a9c9;--ifm-color-info-darkest:#3b8ba5;--ifm-color-info-light:#6ecfef;--ifm-color-info-lighter:#87d8f2;--ifm-color-info-lightest:#aae3f6;--ifm-color-info-contrast-background:#eef9fd;--ifm-color-info-contrast-foreground:#193c47;--ifm-color-warning-dark:#e6a700;--ifm-color-warning-darker:#d99e00;--ifm-color-warning-darkest:#b38200;--ifm-color-warning-light:#ffc426;--ifm-color-warning-lighter:#ffcf4d;--ifm-color-warning-lightest:#ffdd80;--ifm-color-warning-contrast-background:#fff8e6;--ifm-color-warning-contrast-foreground:#4d3800;--ifm-color-danger-dark:#e13238;--ifm-color-danger-darker:#d53035;--ifm-color-danger-darkest:#af272b;--ifm-color-danger-light:#fb565b;--ifm-color-danger-lighter:#fb7478;--ifm-color-danger-lightest:#fd9c9f;--ifm-color-danger-contrast-background:#ffebec;--ifm-color-danger-contrast-foreground:#4b1113;--ifm-color-white:#fff;--ifm-color-black:#000;--ifm-color-gray-0:var(--ifm-color-white);--ifm-color-gray-100:#f5f6f7;--ifm-color-gray-200:#ebedf0;--ifm-color-gray-300:#dadde1;--ifm-color-gray-400:#ccd0d5;--ifm-color-gray-500:#bec3c9;--ifm-color-gray-600:#8d949e;--ifm-color-gray-700:#606770;--ifm-color-gray-800:#444950;--ifm-color-gray-900:#1c1e21;--ifm-color-gray-1000:var(--ifm-color-black);--ifm-color-emphasis-0:var(--ifm-color-gray-0);--ifm-color-emphasis-100:var(--ifm-color-gray-100);--ifm-color-emphasis-200:var(--ifm-color-gray-200);--ifm-color-emphasis-300:var(--ifm-color-gray-300);--ifm-color-emphasis-400:var(--ifm-color-gray-400);--ifm-color-emphasis-600:var(--ifm-color-gray-600);--ifm-color-emphasis-700:var(--ifm-color-gray-700);--ifm-color-emphasis-800:var(--ifm-color-gray-800);--ifm-color-emphasis-900:var(--ifm-color-gray-900);--ifm-color-emphasis-1000:var(--ifm-color-gray-1000);--ifm-color-content:var(--ifm-color-emphasis-900);--ifm-color-content-inverse:var(--ifm-color-emphasis-0);--ifm-color-content-secondary:#525860;--ifm-background-color:transparent;--ifm-background-surface-color:var(--ifm-color-content-inverse);--ifm-global-border-width:1px;--ifm-global-radius:0.4rem;--ifm-hover-overlay:rgba(0,0,0,.05);--ifm-font-color-base:var(--ifm-color-content);--ifm-font-color-base-inverse:var(--ifm-color-content-inverse);--ifm-font-color-secondary:var(--ifm-color-content-secondary);--ifm-font-family-base:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ifm-font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--ifm-font-size-base:100%;--ifm-font-weight-light:300;--ifm-font-weight-normal:400;--ifm-font-weight-semibold:500;--ifm-font-weight-bold:700;--ifm-font-weight-base:var(--ifm-font-weight-normal);--ifm-line-height-base:1.65;--ifm-global-spacing:1rem;--ifm-spacing-vertical:var(--ifm-global-spacing);--ifm-spacing-horizontal:var(--ifm-global-spacing);--ifm-transition-fast:200ms;--ifm-transition-slow:400ms;--ifm-transition-timing-default:cubic-bezier(0.08,0.52,0.52,1);--ifm-global-shadow-lw:0 1px 2px 0 rgba(0,0,0,.1);--ifm-global-shadow-md:0 5px 40px rgba(0,0,0,.2);--ifm-global-shadow-tl:0 12px 28px 0 rgba(0,0,0,.2),0 2px 4px 0 rgba(0,0,0,.1);--ifm-z-index-dropdown:100;--ifm-z-index-fixed:200;--ifm-z-index-overlay:400;--ifm-container-width:1140px;--ifm-container-width-xl:1320px;--ifm-code-background:#f6f7f8;--ifm-code-border-radius:var(--ifm-global-radius);--ifm-code-font-size:90%;--ifm-code-padding-horizontal:0.1rem;--ifm-code-padding-vertical:0.1rem;--ifm-pre-background:var(--ifm-code-background);--ifm-pre-border-radius:var(--ifm-code-border-radius);--ifm-pre-color:inherit;--ifm-pre-line-height:1.45;--ifm-heading-color:inherit;--ifm-heading-margin-top:0;--ifm-heading-margin-bottom:var(--ifm-spacing-vertical);--ifm-heading-font-family:var(--ifm-font-family-base);--ifm-heading-font-weight:var(--ifm-font-weight-bold);--ifm-heading-line-height:1.25;--ifm-h1-font-size:2rem;--ifm-h2-font-size:1.5rem;--ifm-h3-font-size:1.25rem;--ifm-h4-font-size:1rem;--ifm-h5-font-size:0.875rem;--ifm-h6-font-size:0.85rem;--ifm-image-alignment-padding:1.25rem;--ifm-leading-desktop:1.25;--ifm-leading:calc(var(--ifm-leading-desktop)*1rem);--ifm-list-left-padding:2rem;--ifm-list-margin:1rem;--ifm-list-item-margin:0.25rem;--ifm-list-paragraph-margin:1rem;--ifm-table-cell-padding:0.75rem;--ifm-table-background:transparent;--ifm-table-stripe-background:rgba(0,0,0,.03);--ifm-table-border-width:1px;--ifm-table-border-color:var(--ifm-color-emphasis-300);--ifm-table-head-background:inherit;--ifm-table-head-color:inherit;--ifm-table-head-font-weight:var(--ifm-font-weight-bold);--ifm-table-cell-color:inherit;--ifm-link-color:var(--ifm-color-primary);--ifm-link-decoration:none;--ifm-link-hover-color:var(--ifm-link-color);--ifm-link-hover-decoration:underline;--ifm-paragraph-margin-bottom:var(--ifm-leading);--ifm-blockquote-font-size:var(--ifm-font-size-base);--ifm-blockquote-border-left-width:2px;--ifm-blockquote-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-blockquote-padding-vertical:0;--ifm-blockquote-shadow:none;--ifm-blockquote-color:var(--ifm-color-emphasis-800);--ifm-blockquote-border-color:var(--ifm-color-emphasis-300);--ifm-hr-background-color:var(--ifm-color-emphasis-500);--ifm-hr-height:1px;--ifm-hr-margin-vertical:1.5rem;--ifm-scrollbar-size:7px;--ifm-scrollbar-track-background-color:#f1f1f1;--ifm-scrollbar-thumb-background-color:silver;--ifm-scrollbar-thumb-hover-background-color:#a7a7a7;--ifm-alert-background-color:inherit;--ifm-alert-border-color:inherit;--ifm-alert-border-radius:var(--ifm-global-radius);--ifm-alert-border-width:0px;--ifm-alert-border-left-width:5px;--ifm-alert-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-alert-padding-vertical:var(--ifm-spacing-vertical);--ifm-alert-shadow:var(--ifm-global-shadow-lw);--ifm-avatar-intro-margin:1rem;--ifm-avatar-intro-alignment:inherit;--ifm-avatar-photo-size:3rem;--ifm-badge-background-color:inherit;--ifm-badge-border-color:inherit;--ifm-badge-border-radius:var(--ifm-global-radius);--ifm-badge-border-width:var(--ifm-global-border-width);--ifm-badge-color:var(--ifm-color-white);--ifm-badge-padding-horizontal:calc(var(--ifm-spacing-horizontal)*0.5);--ifm-badge-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-breadcrumb-border-radius:1.5rem;--ifm-breadcrumb-spacing:0.5rem;--ifm-breadcrumb-color-active:var(--ifm-color-primary);--ifm-breadcrumb-item-background-active:var(--ifm-hover-overlay);--ifm-breadcrumb-padding-horizontal:0.8rem;--ifm-breadcrumb-padding-vertical:0.4rem;--ifm-breadcrumb-size-multiplier:1;--ifm-breadcrumb-separator:url('data:image/svg+xml;utf8,');--ifm-breadcrumb-separator-filter:none;--ifm-breadcrumb-separator-size:0.5rem;--ifm-breadcrumb-separator-size-multiplier:1.25;--ifm-button-background-color:inherit;--ifm-button-border-color:var(--ifm-button-background-color);--ifm-button-border-width:var(--ifm-global-border-width);--ifm-button-font-weight:var(--ifm-font-weight-bold);--ifm-button-padding-horizontal:1.5rem;--ifm-button-padding-vertical:0.375rem;--ifm-button-size-multiplier:1;--ifm-button-transition-duration:var(--ifm-transition-fast);--ifm-button-border-radius:calc(var(--ifm-global-radius)*var(--ifm-button-size-multiplier));--ifm-button-group-spacing:2px;--ifm-card-background-color:var(--ifm-background-surface-color);--ifm-card-border-radius:calc(var(--ifm-global-radius)*2);--ifm-card-horizontal-spacing:var(--ifm-global-spacing);--ifm-card-vertical-spacing:var(--ifm-global-spacing);--ifm-toc-border-color:var(--ifm-color-emphasis-300);--ifm-toc-link-color:var(--ifm-color-content-secondary);--ifm-toc-padding-vertical:0.5rem;--ifm-toc-padding-horizontal:0.5rem;--ifm-dropdown-background-color:var(--ifm-background-surface-color);--ifm-dropdown-font-weight:var(--ifm-font-weight-semibold);--ifm-dropdown-link-color:var(--ifm-font-color-base);--ifm-dropdown-hover-background-color:var(--ifm-hover-overlay);--ifm-footer-background-color:var(--ifm-color-emphasis-100);--ifm-footer-color:inherit;--ifm-footer-link-color:var(--ifm-color-emphasis-700);--ifm-footer-link-hover-color:var(--ifm-color-primary);--ifm-footer-link-horizontal-spacing:0.5rem;--ifm-footer-padding-horizontal:calc(var(--ifm-spacing-horizontal)*2);--ifm-footer-padding-vertical:calc(var(--ifm-spacing-vertical)*2);--ifm-footer-title-color:inherit;--ifm-footer-logo-max-width:min(30rem,90vw);--ifm-hero-background-color:var(--ifm-background-surface-color);--ifm-hero-text-color:var(--ifm-color-emphasis-800);--ifm-menu-color:var(--ifm-color-emphasis-700);--ifm-menu-color-active:var(--ifm-color-primary);--ifm-menu-color-background-active:var(--ifm-hover-overlay);--ifm-menu-color-background-hover:var(--ifm-hover-overlay);--ifm-menu-link-padding-horizontal:0.75rem;--ifm-menu-link-padding-vertical:0.375rem;--ifm-menu-link-sublist-icon:url('data:image/svg+xml;utf8,');--ifm-menu-link-sublist-icon-filter:none;--ifm-navbar-background-color:var(--ifm-background-surface-color);--ifm-navbar-height:3.75rem;--ifm-navbar-item-padding-horizontal:0.75rem;--ifm-navbar-item-padding-vertical:0.25rem;--ifm-navbar-link-color:var(--ifm-font-color-base);--ifm-navbar-link-active-color:var(--ifm-link-color);--ifm-navbar-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-navbar-padding-vertical:calc(var(--ifm-spacing-vertical)*0.5);--ifm-navbar-shadow:var(--ifm-global-shadow-lw);--ifm-navbar-search-input-background-color:var(--ifm-color-emphasis-200);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-800);--ifm-navbar-search-input-placeholder-color:var(--ifm-color-emphasis-500);--ifm-navbar-search-input-icon:url('data:image/svg+xml;utf8,');--ifm-navbar-sidebar-width:83vw;--ifm-pagination-border-radius:var(--ifm-global-radius);--ifm-pagination-color-active:var(--ifm-color-primary);--ifm-pagination-font-size:1rem;--ifm-pagination-item-active-background:var(--ifm-hover-overlay);--ifm-pagination-page-spacing:0.2em;--ifm-pagination-padding-horizontal:calc(var(--ifm-spacing-horizontal)*1);--ifm-pagination-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-pagination-nav-border-radius:var(--ifm-global-radius);--ifm-pagination-nav-color-hover:var(--ifm-color-primary);--ifm-pills-color-active:var(--ifm-color-primary);--ifm-pills-color-background-active:var(--ifm-hover-overlay);--ifm-pills-spacing:0.125rem;--ifm-tabs-color:var(--ifm-font-color-secondary);--ifm-tabs-color-active:var(--ifm-color-primary);--ifm-tabs-color-active-border:var(--ifm-tabs-color-active);--ifm-tabs-padding-horizontal:1rem;--ifm-tabs-padding-vertical:1rem}.badge--danger,.badge--info,.badge--primary,.badge--secondary,.badge--success,.badge--warning{--ifm-badge-border-color:var(--ifm-badge-background-color)}.button--link,.button--outline{--ifm-button-background-color:transparent}html{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--ifm-background-color);color:var(--ifm-font-color-base);color-scheme:var(--ifm-color-scheme);font:var(--ifm-font-size-base)/var(--ifm-line-height-base) var(--ifm-font-family-base);text-rendering:optimizelegibility}.code-demo-container .filename,code{font-family:var(--ifm-font-family-monospace)}iframe{border:0;color-scheme:auto}.container{margin:0 auto;max-width:var(--ifm-container-width)}.container--fluid{max-width:inherit}.row{display:flex;flex-wrap:wrap;margin:0 calc(var(--ifm-spacing-horizontal)*-1)}.margin-bottom--none,.margin-vert--none,.markdown>:last-child{margin-bottom:0!important}.margin-top--none,.margin-vert--none,.tabItem_LNqP{margin-top:0!important}.row--no-gutters{margin-left:0;margin-right:0}.margin-horiz--none,.margin-right--none{margin-right:0!important}.row--no-gutters>.col{padding-left:0;padding-right:0}.row--align-top{align-items:flex-start}.row--align-bottom{align-items:flex-end}.HeaderHero .TwoColumns,.menuExternalLink_NmtK,.row--align-center{align-items:center}.row--align-stretch{align-items:stretch}.row--align-baseline{align-items:baseline}.col{--ifm-col-width:100%;flex:1 0;margin-left:0;max-width:var(--ifm-col-width)}.padding-bottom--none,.padding-vert--none{padding-bottom:0!important}.community-page .container--fluid>div,.padding-top--none,.padding-vert--none{padding-top:0!important}.padding-horiz--none,.padding-left--none{padding-left:0!important}.padding-horiz--none,.padding-right--none{padding-right:0!important}.col[class*=col--]{flex:0 0 var(--ifm-col-width)}.col--1{--ifm-col-width:8.33333%}.col--offset-1{margin-left:8.33333%}.col--2{--ifm-col-width:16.66667%}.col--offset-2{margin-left:16.66667%}.col--3{--ifm-col-width:25%}.col--offset-3{margin-left:25%}.col--4{--ifm-col-width:33.33333%}.col--offset-4{margin-left:33.33333%}.col--5{--ifm-col-width:41.66667%}.col--offset-5{margin-left:41.66667%}.col--6{--ifm-col-width:50%}.col--offset-6{margin-left:50%}.col--7{--ifm-col-width:58.33333%}.col--offset-7{margin-left:58.33333%}.col--8{--ifm-col-width:66.66667%}.col--offset-8{margin-left:66.66667%}.col--9{--ifm-col-width:75%}.col--offset-9{margin-left:75%}.col--10{--ifm-col-width:83.33333%}.col--offset-10{margin-left:83.33333%}.col--11{--ifm-col-width:91.66667%}.col--offset-11{margin-left:91.66667%}.col--12{--ifm-col-width:100%}.col--offset-12{margin-left:100%}.margin-horiz--none,.margin-left--none{margin-left:0!important}.margin--none{margin:0!important}.margin-bottom--xs,.margin-vert--xs{margin-bottom:.25rem!important}.margin-top--xs,.margin-vert--xs{margin-top:.25rem!important}.margin-horiz--xs,.margin-left--xs{margin-left:.25rem!important}.margin-horiz--xs,.margin-right--xs{margin-right:.25rem!important}.margin--xs{margin:.25rem!important}.margin-bottom--sm,.margin-vert--sm{margin-bottom:.5rem!important}.margin-top--sm,.margin-vert--sm{margin-top:.5rem!important}.margin-horiz--sm,.margin-left--sm{margin-left:.5rem!important}.margin-horiz--sm,.margin-right--sm{margin-right:.5rem!important}.margin--sm{margin:.5rem!important}.margin-bottom--md,.margin-vert--md{margin-bottom:1rem!important}.margin-top--md,.margin-vert--md{margin-top:1rem!important}.margin-horiz--md,.margin-left--md{margin-left:1rem!important}.margin-horiz--md,.margin-right--md{margin-right:1rem!important}.margin--md{margin:1rem!important}.margin-bottom--lg,.margin-vert--lg{margin-bottom:2rem!important}.margin-top--lg,.margin-vert--lg{margin-top:2rem!important}.margin-horiz--lg,.margin-left--lg{margin-left:2rem!important}.margin-horiz--lg,.margin-right--lg{margin-right:2rem!important}.margin--lg{margin:2rem!important}.margin-bottom--xl,.margin-vert--xl{margin-bottom:5rem!important}.margin-top--xl,.margin-vert--xl{margin-top:5rem!important}.margin-horiz--xl,.margin-left--xl{margin-left:5rem!important}.margin-horiz--xl,.margin-right--xl{margin-right:5rem!important}.margin--xl{margin:5rem!important}.padding--none{padding:0!important}.padding-bottom--xs,.padding-vert--xs{padding-bottom:.25rem!important}.padding-top--xs,.padding-vert--xs{padding-top:.25rem!important}.padding-horiz--xs,.padding-left--xs{padding-left:.25rem!important}.padding-horiz--xs,.padding-right--xs{padding-right:.25rem!important}.padding--xs{padding:.25rem!important}.padding-bottom--sm,.padding-vert--sm{padding-bottom:.5rem!important}.padding-top--sm,.padding-vert--sm{padding-top:.5rem!important}.padding-horiz--sm,.padding-left--sm{padding-left:.5rem!important}.padding-horiz--sm,.padding-right--sm{padding-right:.5rem!important}.padding--sm{padding:.5rem!important}.padding-bottom--md,.padding-vert--md{padding-bottom:1rem!important}.padding-top--md,.padding-vert--md{padding-top:1rem!important}.padding-horiz--md,.padding-left--md{padding-left:1rem!important}.padding-horiz--md,.padding-right--md{padding-right:1rem!important}.padding--md{padding:1rem!important}.padding-bottom--lg,.padding-vert--lg{padding-bottom:2rem!important}.padding-top--lg,.padding-vert--lg{padding-top:2rem!important}.padding-horiz--lg,.padding-left--lg{padding-left:2rem!important}.padding-horiz--lg,.padding-right--lg{padding-right:2rem!important}.padding--lg{padding:2rem!important}.padding-bottom--xl,.padding-vert--xl{padding-bottom:5rem!important}.padding-top--xl,.padding-vert--xl{padding-top:5rem!important}.padding-horiz--xl,.padding-left--xl{padding-left:5rem!important}.padding-horiz--xl,.padding-right--xl{padding-right:5rem!important}.padding--xl{padding:5rem!important}code{background-color:var(--ifm-code-background);border:.1rem solid rgba(0,0,0,.1);border-radius:var(--ifm-code-border-radius);font-size:var(--ifm-code-font-size);padding:var(--ifm-code-padding-vertical) var(--ifm-code-padding-horizontal)}a code{color:inherit}pre{background-color:var(--ifm-pre-background);border-radius:var(--ifm-pre-border-radius);color:var(--ifm-pre-color);font:var(--ifm-code-font-size)/var(--ifm-pre-line-height) var(--ifm-font-family-monospace);padding:var(--ifm-pre-padding)}pre code{background-color:transparent;border:none;font-size:100%;line-height:inherit;padding:0}kbd{background-color:var(--ifm-color-emphasis-0);border:1px solid var(--ifm-color-emphasis-400);border-radius:.2rem;box-shadow:inset 0 -1px 0 var(--ifm-color-emphasis-400);color:var(--ifm-color-emphasis-800);font:80% var(--ifm-font-family-monospace);padding:.15rem .3rem}h1,h2,h3,h4,h5,h6{color:var(--ifm-heading-color);font-family:var(--ifm-heading-font-family);font-weight:var(--ifm-heading-font-weight);line-height:var(--ifm-heading-line-height);margin:var(--ifm-heading-margin-top) 0 var(--ifm-heading-margin-bottom) 0}h1{font-size:var(--ifm-h1-font-size)}h2{font-size:var(--ifm-h2-font-size)}h3{font-size:var(--ifm-h3-font-size)}h4{font-size:var(--ifm-h4-font-size)}h5{font-size:var(--ifm-h5-font-size)}h6{font-size:var(--ifm-h6-font-size)}img{max-width:100%}img[align=right]{padding-left:var(--image-alignment-padding)}img[align=left]{padding-right:var(--image-alignment-padding)}.markdown{--ifm-h1-vertical-rhythm-top:3;--ifm-h2-vertical-rhythm-top:2;--ifm-h3-vertical-rhythm-top:1.5;--ifm-heading-vertical-rhythm-top:1.25;--ifm-h1-vertical-rhythm-bottom:1.25;--ifm-heading-vertical-rhythm-bottom:1}.markdown:after,.markdown:before{content:"";display:table}.markdown:after{clear:both}.markdown h1:first-child{--ifm-h1-font-size:3rem;margin-bottom:calc(var(--ifm-h1-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown>h2{--ifm-h2-font-size:2rem;margin-top:calc(var(--ifm-h2-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h3{--ifm-h3-font-size:1.5rem;margin-top:calc(var(--ifm-h3-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h4,.markdown>h5,.markdown>h6{margin-top:calc(var(--ifm-heading-vertical-rhythm-top)*var(--ifm-leading))}.markdown>p,.markdown>pre,.markdown>ul,.tabList__CuJ{margin-bottom:var(--ifm-leading)}.markdown li>p{margin-top:var(--ifm-list-paragraph-margin)}.markdown li+li{margin-top:var(--ifm-list-item-margin)}ol,ul{margin:0 0 var(--ifm-list-margin);padding-left:var(--ifm-list-left-padding)}ol ol,ul ol{list-style-type:lower-roman}ol ol ol,ol ul ol,ul ol ol,ul ul ol{list-style-type:lower-alpha}table{display:block;margin-bottom:var(--ifm-spacing-vertical)}table thead tr{border-bottom:2px solid var(--ifm-table-border-color)}table thead,table tr:nth-child(2n){background-color:var(--ifm-table-stripe-background)}table tr{background-color:var(--ifm-table-background);border-top:var(--ifm-table-border-width) solid var(--ifm-table-border-color)}table td,table th{border:var(--ifm-table-border-width) solid var(--ifm-table-border-color);padding:var(--ifm-table-cell-padding)}table th{background-color:var(--ifm-table-head-background);color:var(--ifm-table-head-color);font-weight:var(--ifm-table-head-font-weight)}table td{color:var(--ifm-table-cell-color)}strong{font-weight:var(--ifm-font-weight-bold)}a{color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}a:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button:hover,.text--no-decoration,.text--no-decoration:hover,a:not([href]){text-decoration:none}p{margin:0 0 var(--ifm-paragraph-margin-bottom)}blockquote{border-left:var(--ifm-blockquote-border-left-width) solid var(--ifm-blockquote-border-color);box-shadow:var(--ifm-blockquote-shadow);color:var(--ifm-blockquote-color);font-size:var(--ifm-blockquote-font-size);padding:var(--ifm-blockquote-padding-vertical) var(--ifm-blockquote-padding-horizontal)}blockquote>:first-child{margin-top:0}blockquote>:last-child{margin-bottom:0}.shadow--lw{box-shadow:var(--ifm-global-shadow-lw)!important}.shadow--md{box-shadow:var(--ifm-global-shadow-md)!important}.shadow--tl{box-shadow:var(--ifm-global-shadow-tl)!important}.docMetadata a svg,.text--primary,.wordWrapButtonEnabled_EoeP .wordWrapButtonIcon_Bwma{color:var(--ifm-color-primary)}.text--secondary{color:var(--ifm-color-secondary)}.text--success{color:var(--ifm-color-success)}.text--info{color:var(--ifm-color-info)}.text--warning{color:var(--ifm-color-warning)}.text--danger{color:var(--ifm-color-danger)}.text--center{text-align:center}.text--left{text-align:left}.text--justify{text-align:justify}.text--right{text-align:right}.text--capitalize{text-transform:capitalize}.text--lowercase{text-transform:lowercase}.admonitionHeading_Gvgb,.alert__heading,.controls-container fieldset,.footer .footer__title,.markdown table tr th,.text--uppercase{text-transform:uppercase}.text--light{font-weight:var(--ifm-font-weight-light)}.text--normal{font-weight:var(--ifm-font-weight-normal)}.text--semibold{font-weight:var(--ifm-font-weight-semibold)}.text--bold{font-weight:var(--ifm-font-weight-bold)}.text--italic,code .token.italic{font-style:italic}.text--truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text--break{word-wrap:break-word!important;word-break:break-word!important}.clean-btn{background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;padding:0}.alert,.alert .close{color:var(--ifm-alert-foreground-color)}.clean-list{list-style:none;padding-left:0}.alert--primary{--ifm-alert-background-color:var(--ifm-color-primary-contrast-background);--ifm-alert-background-color-highlight:rgba(53,120,229,.15);--ifm-alert-foreground-color:var(--ifm-color-primary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-primary-dark)}.alert--secondary{--ifm-alert-background-color:var(--ifm-color-secondary-contrast-background);--ifm-alert-background-color-highlight:rgba(235,237,240,.15);--ifm-alert-foreground-color:var(--ifm-color-secondary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-secondary-dark)}.alert--success{--ifm-alert-background-color:var(--ifm-color-success-contrast-background);--ifm-alert-background-color-highlight:rgba(0,164,0,.15);--ifm-alert-foreground-color:var(--ifm-color-success-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-success-dark)}.alert--info{--ifm-alert-background-color:var(--ifm-color-info-contrast-background);--ifm-alert-background-color-highlight:rgba(84,199,236,.15);--ifm-alert-foreground-color:var(--ifm-color-info-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-info-dark)}.alert--warning{--ifm-alert-background-color:var(--ifm-color-warning-contrast-background);--ifm-alert-background-color-highlight:rgba(255,186,0,.15);--ifm-alert-foreground-color:var(--ifm-color-warning-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-warning-dark)}.alert--danger{--ifm-alert-background-color:var(--ifm-color-danger-contrast-background);--ifm-alert-background-color-highlight:rgba(250,56,62,.15);--ifm-alert-foreground-color:var(--ifm-color-danger-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-danger-dark)}.alert{--ifm-code-background:var(--ifm-alert-background-color-highlight);--ifm-link-color:var(--ifm-alert-foreground-color);--ifm-link-hover-color:var(--ifm-alert-foreground-color);--ifm-link-decoration:underline;--ifm-tabs-color:var(--ifm-alert-foreground-color);--ifm-tabs-color-active:var(--ifm-alert-foreground-color);--ifm-tabs-color-active-border:var(--ifm-alert-border-color);background-color:var(--ifm-alert-background-color);border:var(--ifm-alert-border-width) solid var(--ifm-alert-border-color);border-left-width:var(--ifm-alert-border-left-width);border-radius:var(--ifm-alert-border-radius);box-shadow:var(--ifm-alert-shadow);padding:var(--ifm-alert-padding-vertical) var(--ifm-alert-padding-horizontal)}.alert__heading{align-items:center;display:flex;font:700 var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family);margin-bottom:.5rem}.alert__icon{display:inline-flex;margin-right:.4em}.alert__icon svg{fill:var(--ifm-alert-foreground-color);stroke:var(--ifm-alert-foreground-color);stroke-width:0}.alert .close{margin:calc(var(--ifm-alert-padding-vertical)*-1) calc(var(--ifm-alert-padding-horizontal)*-1) 0 0;opacity:.75}.alert .close:focus,.alert .close:hover{opacity:1}.alert a{text-decoration-color:var(--ifm-alert-border-color)}.alert a:hover{text-decoration-thickness:2px}.avatar{-moz-column-gap:var(--ifm-avatar-intro-margin);column-gap:var(--ifm-avatar-intro-margin);display:flex}.avatar__photo{border-radius:50%;display:block;height:var(--ifm-avatar-photo-size);overflow:hidden;width:var(--ifm-avatar-photo-size)}.card--full-height,.navbar__logo img,body,html{height:100%}.avatar__photo--sm{--ifm-avatar-photo-size:2rem}.avatar__photo--lg{--ifm-avatar-photo-size:4rem}.avatar__photo--xl{--ifm-avatar-photo-size:6rem}.avatar__intro{display:flex;flex:1 1;flex-direction:column;justify-content:center;text-align:var(--ifm-avatar-intro-alignment)}.badge,.breadcrumbs__item,.breadcrumbs__link,.button,.dropdown>.navbar__link:after{display:inline-block}.avatar__name{font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base)}.avatar--vertical{--ifm-avatar-intro-alignment:center;--ifm-avatar-intro-margin:0.5rem;align-items:center;flex-direction:column}.badge{background-color:var(--ifm-badge-background-color);border:var(--ifm-badge-border-width) solid var(--ifm-badge-border-color);border-radius:var(--ifm-badge-border-radius);color:var(--ifm-badge-color);font-size:75%;font-weight:var(--ifm-font-weight-bold);line-height:1;padding:var(--ifm-badge-padding-vertical) var(--ifm-badge-padding-horizontal)}.badge--primary{--ifm-badge-background-color:var(--ifm-color-primary)}.badge--secondary{--ifm-badge-background-color:var(--ifm-color-secondary);color:var(--ifm-color-black)}.breadcrumbs__link,.button.button--secondary.button--outline:not(.button--active):not(:hover),article header h2 a,html[data-theme=dark] .banner-native-code-required h2,html[data-theme=dark] .banner-native-code-required h3{color:var(--ifm-font-color-base)}.badge--success{--ifm-badge-background-color:var(--ifm-color-success)}.badge--info{--ifm-badge-background-color:var(--ifm-color-info)}.badge--warning{--ifm-badge-background-color:var(--ifm-color-warning)}.badge--danger{--ifm-badge-background-color:var(--ifm-color-danger)}.breadcrumbs{margin-bottom:0;padding-left:0}.breadcrumbs__item:not(:last-child):after{background:var(--ifm-breadcrumb-separator) center;content:" ";display:inline-block;filter:var(--ifm-breadcrumb-separator-filter);height:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier));margin:0 var(--ifm-breadcrumb-spacing);opacity:.5;width:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier))}.breadcrumbs__item--active .breadcrumbs__link{background:var(--ifm-breadcrumb-item-background-active);color:var(--ifm-breadcrumb-color-active)}.breadcrumbs__link{border-radius:var(--ifm-breadcrumb-border-radius);font-size:calc(1rem*var(--ifm-breadcrumb-size-multiplier));padding:calc(var(--ifm-breadcrumb-padding-vertical)*var(--ifm-breadcrumb-size-multiplier)) calc(var(--ifm-breadcrumb-padding-horizontal)*var(--ifm-breadcrumb-size-multiplier));transition-duration:var(--ifm-transition-fast);transition-property:background,color}.breadcrumbs__link:link:hover,.breadcrumbs__link:visited:hover,area[href].breadcrumbs__link:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs__link:-moz-any-link:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs__link:any-link:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs--sm{--ifm-breadcrumb-size-multiplier:0.8}.breadcrumbs--lg{--ifm-breadcrumb-size-multiplier:1.2}.button{background-color:var(--ifm-button-background-color);border:var(--ifm-button-border-width) solid var(--ifm-button-border-color);border-radius:var(--ifm-button-border-radius);cursor:pointer;font-size:calc(.875rem*var(--ifm-button-size-multiplier));font-weight:var(--ifm-button-font-weight);line-height:1.5;padding:calc(var(--ifm-button-padding-vertical)*var(--ifm-button-size-multiplier)) calc(var(--ifm-button-padding-horizontal)*var(--ifm-button-size-multiplier));text-align:center;transition-duration:var(--ifm-button-transition-duration);transition-property:color,background,border-color;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.button,.button:hover{color:var(--ifm-button-color)}.button--outline{--ifm-button-color:var(--ifm-button-border-color)}.button--outline:hover{--ifm-button-background-color:var(--ifm-button-border-color)}.button--link{--ifm-button-border-color:transparent;color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}.button--link.button--active,.button--link:active,.button--link:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button.disabled,.button:disabled,.button[disabled]{opacity:.65;pointer-events:none}.button--sm{--ifm-button-size-multiplier:0.8}.button--lg{--ifm-button-size-multiplier:1.35}.button--block{display:block;width:100%}.button.button--secondary{color:var(--ifm-color-gray-900)}:where(.button--primary){--ifm-button-background-color:var(--ifm-color-primary);--ifm-button-border-color:var(--ifm-color-primary)}:where(.button--primary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-primary-dark);--ifm-button-border-color:var(--ifm-color-primary-dark)}.button--primary.button--active,.button--primary:active{--ifm-button-background-color:var(--ifm-color-primary-darker);--ifm-button-border-color:var(--ifm-color-primary-darker)}:where(.button--secondary){--ifm-button-background-color:var(--ifm-color-secondary);--ifm-button-border-color:var(--ifm-color-secondary)}:where(.button--secondary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-secondary-dark);--ifm-button-border-color:var(--ifm-color-secondary-dark)}.button--secondary.button--active,.button--secondary:active{--ifm-button-background-color:var(--ifm-color-secondary-darker);--ifm-button-border-color:var(--ifm-color-secondary-darker)}:where(.button--success){--ifm-button-background-color:var(--ifm-color-success);--ifm-button-border-color:var(--ifm-color-success)}:where(.button--success):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-success-dark);--ifm-button-border-color:var(--ifm-color-success-dark)}.button--success.button--active,.button--success:active{--ifm-button-background-color:var(--ifm-color-success-darker);--ifm-button-border-color:var(--ifm-color-success-darker)}:where(.button--info){--ifm-button-background-color:var(--ifm-color-info);--ifm-button-border-color:var(--ifm-color-info)}:where(.button--info):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-info-dark);--ifm-button-border-color:var(--ifm-color-info-dark)}.button--info.button--active,.button--info:active{--ifm-button-background-color:var(--ifm-color-info-darker);--ifm-button-border-color:var(--ifm-color-info-darker)}:where(.button--warning){--ifm-button-background-color:var(--ifm-color-warning);--ifm-button-border-color:var(--ifm-color-warning)}:where(.button--warning):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-warning-dark);--ifm-button-border-color:var(--ifm-color-warning-dark)}.button--warning.button--active,.button--warning:active{--ifm-button-background-color:var(--ifm-color-warning-darker);--ifm-button-border-color:var(--ifm-color-warning-darker)}:where(.button--danger){--ifm-button-background-color:var(--ifm-color-danger);--ifm-button-border-color:var(--ifm-color-danger)}:where(.button--danger):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-danger-dark);--ifm-button-border-color:var(--ifm-color-danger-dark)}.button--danger.button--active,.button--danger:active{--ifm-button-background-color:var(--ifm-color-danger-darker);--ifm-button-border-color:var(--ifm-color-danger-darker)}.button-group{display:inline-flex;gap:var(--ifm-button-group-spacing)}.button-group>.button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.button-group>.button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.button-group--block{display:flex;justify-content:stretch}.button-group--block>.button{flex-grow:1}.card{background-color:var(--ifm-card-background-color);border-radius:var(--ifm-card-border-radius);box-shadow:var(--ifm-global-shadow-lw);display:flex;flex-direction:column;overflow:hidden}.card__image{padding-top:var(--ifm-card-vertical-spacing)}.card__image:first-child{padding-top:0}.card__body,.card__footer,.card__header{padding:var(--ifm-card-vertical-spacing) var(--ifm-card-horizontal-spacing)}.card__body:not(:last-child),.card__footer:not(:last-child),.card__header:not(:last-child){padding-bottom:0}.card__body>:last-child,.card__footer>:last-child,.card__header>:last-child{margin-bottom:0}.card__footer{margin-top:auto}.table-of-contents{font-size:.8rem;margin-bottom:0;padding:var(--ifm-toc-padding-vertical) 0}.table-of-contents,.table-of-contents ul{list-style:none;padding-left:var(--ifm-toc-padding-horizontal)}.table-of-contents li{margin:var(--ifm-toc-padding-vertical) var(--ifm-toc-padding-horizontal)}.table-of-contents__left-border{border-left:1px solid var(--ifm-toc-border-color)}.table-of-contents__link{color:var(--ifm-toc-link-color);display:block}.table-of-contents__link--active,.table-of-contents__link--active code,.table-of-contents__link:hover,.table-of-contents__link:hover code{color:var(--ifm-color-primary);text-decoration:none}.close{color:var(--ifm-color-black);float:right;font-size:1.5rem;font-weight:var(--ifm-font-weight-bold);line-height:1;opacity:.5;padding:1rem;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.close:hover,code .token.namespace{opacity:.7}.close:focus,.theme-code-block-highlighted-line .codeLineNumber_Tfdd:before{opacity:.8}.dropdown{display:inline-flex;font-weight:var(--ifm-dropdown-font-weight);position:relative;vertical-align:top}.dropdown--hoverable:hover .dropdown__menu,.dropdown--show .dropdown__menu{opacity:1;pointer-events:all;transform:translateY(-1px);visibility:visible}.dropdown--right .dropdown__menu{left:inherit;right:0}.dropdown--nocaret .navbar__link:after{content:none!important}.dropdown__menu{background-color:var(--ifm-dropdown-background-color);border-radius:var(--ifm-global-radius);box-shadow:var(--ifm-global-shadow-md);left:0;list-style:none;max-height:80vh;min-width:10rem;opacity:0;overflow-y:auto;padding:.5rem;pointer-events:none;position:absolute;top:calc(100% - var(--ifm-navbar-item-padding-vertical) + .3rem);transform:translateY(-.625rem);transition-duration:var(--ifm-transition-fast);transition-property:opacity,transform,visibility;transition-timing-function:var(--ifm-transition-timing-default);visibility:hidden;z-index:var(--ifm-z-index-dropdown)}.menu__caret,.menu__link,.menu__list-item-collapsible{border-radius:.25rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.dropdown__link{border-radius:.25rem;color:var(--ifm-dropdown-link-color);display:block;font-size:.875rem;margin-top:.2rem;padding:.25rem .5rem;white-space:nowrap}.dropdown__link--active,.dropdown__link:hover{background-color:var(--ifm-dropdown-hover-background-color);color:var(--ifm-dropdown-link-color);text-decoration:none}.dropdown__link--active,.dropdown__link--active:hover{--ifm-dropdown-link-color:var(--ifm-link-color)}.dropdown>.navbar__link:after{border-color:currentcolor transparent;border-style:solid;border-width:.4em .4em 0;content:"";margin-left:.3em;position:relative;top:2px;transform:translateY(-50%)}.footer{background-color:var(--ifm-footer-background-color);color:var(--ifm-footer-color);padding:var(--ifm-footer-padding-vertical) var(--ifm-footer-padding-horizontal)}.footer--dark{--ifm-footer-background-color:#303846;--ifm-footer-color:var(--ifm-footer-link-color);--ifm-footer-link-color:var(--ifm-color-secondary);--ifm-footer-title-color:var(--ifm-color-white)}.footer__links{margin-bottom:1rem}.footer__link-item{color:var(--ifm-footer-link-color);line-height:2}.footer__link-item:hover{color:var(--ifm-footer-link-hover-color)}.footer__link-separator{margin:0 var(--ifm-footer-link-horizontal-spacing)}.footer__logo{margin-top:1rem;max-width:var(--ifm-footer-logo-max-width)}.footer__title{color:var(--ifm-footer-title-color);font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base);margin-bottom:var(--ifm-heading-margin-bottom)}.menu,.navbar__link{font-weight:var(--ifm-font-weight-semibold)}.avatar__subtitle,.docItemContainer_Djhp article>:first-child,.docItemContainer_Djhp header+*,.footer__item{margin-top:0}.footer__items{margin-bottom:0}.codeBlockStandalone_MEMb,[type=checkbox]{padding:0}.hero{align-items:center;background-color:var(--ifm-hero-background-color);color:var(--ifm-hero-text-color);display:flex;padding:4rem 2rem}.hero--primary{--ifm-hero-background-color:var(--ifm-color-primary);--ifm-hero-text-color:var(--ifm-font-color-base-inverse)}.hero--dark{--ifm-hero-background-color:#303846;--ifm-hero-text-color:var(--ifm-color-white)}.hero__title{font-size:3rem}.hero__subtitle{font-size:1.5rem}.menu__list{list-style:none;margin:0;padding-left:0}.menu__caret,.menu__link{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu__list .menu__list{flex:0 0 100%;margin-top:.25rem;padding-left:var(--ifm-menu-link-padding-horizontal)}.menu__list-item:not(:first-child){margin-top:.25rem}.menu__list-item--collapsed .menu__list{height:0;overflow:hidden}.details_lb9f[data-collapsed=false].isBrowser_bmU9>summary:before,.details_lb9f[open]:not(.isBrowser_bmU9)>summary:before,.menu__list-item--collapsed .menu__caret:before,.menu__list-item--collapsed .menu__link--sublist:after{transform:rotate(90deg)}.menu__list-item-collapsible{display:flex;flex-wrap:wrap;position:relative}.menu__caret:hover,.menu__link:hover,.menu__list-item-collapsible--active,.menu__list-item-collapsible:hover{background:var(--ifm-menu-color-background-hover)}.menu__list-item-collapsible .menu__link--active,.menu__list-item-collapsible .menu__link:hover{background:none!important}.menu__caret,.menu__link{align-items:center;display:flex}.navbar-sidebar,.navbar-sidebar__backdrop{bottom:0;opacity:0;transition-duration:var(--ifm-transition-fast);transition-timing-function:ease-in-out;left:0;top:0;visibility:hidden}.menu__link{color:var(--ifm-menu-color);flex:1;line-height:1.25}.menu__link:hover{color:var(--ifm-menu-color);text-decoration:none}.menu__caret:before,.menu__link--sublist-caret:after{content:"";height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast) linear;width:1.25rem;filter:var(--ifm-menu-link-sublist-icon-filter)}.menu__link--sublist-caret:after{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem;margin-left:auto;min-width:1.25rem}.menu__link--active,.menu__link--active:hover{color:var(--ifm-menu-color-active)}.navbar__brand,.navbar__link{color:var(--ifm-navbar-link-color)}.menu__link--active:not(.menu__link--sublist),html[data-theme=dark] .markdown table thead tr{background-color:var(--ifm-menu-color-background-active)}.menu__caret:before{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem}.navbar--dark,html[data-theme=dark]{--ifm-menu-link-sublist-icon-filter:invert(100%) sepia(94%) saturate(17%) hue-rotate(223deg) brightness(104%) contrast(98%)}.navbar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-navbar-shadow);height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.navbar,.navbar>.container,.navbar>.container-fluid,.tablist>div{display:flex}.navbar--fixed-top{position:sticky;top:0;z-index:var(--ifm-z-index-fixed)}.navbar__inner{display:flex;flex-wrap:wrap;justify-content:space-between;width:100%}.navbar__brand{align-items:center;display:flex;margin-right:1rem;min-width:0}.navbar__brand:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.navbar__title{flex:1 1 auto;font-family:Consolas,Courier New,monospace}.navbar__toggle{display:none;margin-right:.5rem}.navbar__logo{flex:0 0 auto;height:2rem;margin-right:.5rem}.navbar__items{align-items:center;display:flex;flex:1;min-width:0}.navbar__items--center{flex:0 0 auto}.NativeCode pre,.navbar__items--center .navbar__brand{margin:0}.Section.demo>div>div,.navbar__items--center+.navbar__items--right{flex:1}.navbar__items--right{flex:0 0 auto;justify-content:flex-end}.navbar__items--right>:last-child{padding-right:0}.navbar__item{display:inline-block;padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}#nprogress,.navbar__item.dropdown .navbar__link:not([href]){pointer-events:none}.navbar__link--active,.navbar__link:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.navbar--dark,.navbar--primary{--ifm-menu-color:var(--ifm-color-gray-300);--ifm-navbar-link-color:var(--ifm-color-gray-100);--ifm-navbar-search-input-background-color:hsla(0,0%,100%,.1);--ifm-navbar-search-input-placeholder-color:hsla(0,0%,100%,.5);color:var(--ifm-color-white)}.navbar--dark{--ifm-navbar-background-color:#242526;--ifm-menu-color-background-active:hsla(0,0%,100%,.05);--ifm-navbar-search-input-color:var(--ifm-color-white)}.navbar--primary{--ifm-navbar-background-color:var(--ifm-color-primary);--ifm-navbar-link-hover-color:var(--ifm-color-white);--ifm-menu-color-active:var(--ifm-color-white);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-500)}.navbar__search-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ifm-navbar-search-input-background-color) var(--ifm-navbar-search-input-icon) no-repeat .75rem center/1rem 1rem;border:none;border-radius:2rem;color:var(--ifm-navbar-search-input-color);cursor:text;display:inline-block;font-size:.9rem;height:2rem;padding:0 .5rem 0 2.25rem;width:12.5rem}.navbar__search-input::-moz-placeholder{color:var(--ifm-navbar-search-input-placeholder-color)}.navbar__search-input::placeholder{color:var(--ifm-navbar-search-input-placeholder-color)}.navbar-sidebar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-global-shadow-md);position:fixed;transform:translate3d(-100%,0,0);transition-property:opacity,visibility,transform;width:var(--ifm-navbar-sidebar-width)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar__items{transform:translateZ(0)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar--show .navbar-sidebar__backdrop{opacity:1;visibility:visible}.navbar-sidebar__backdrop{background-color:rgba(0,0,0,.6);position:fixed;right:0;transition-property:opacity,visibility}.navbar-sidebar__brand{align-items:center;box-shadow:var(--ifm-navbar-shadow);display:flex;flex:1;height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.navbar-sidebar__items{display:flex;height:calc(100% - var(--ifm-navbar-height));transition:transform var(--ifm-transition-fast) ease-in-out}.navbar-sidebar__items--show-secondary{transform:translate3d(calc((var(--ifm-navbar-sidebar-width))*-1),0,0)}.navbar-sidebar__item{flex-shrink:0;padding:.5rem;width:calc(var(--ifm-navbar-sidebar-width))}.navbar-sidebar__back{background:var(--ifm-menu-color-background-active);font-size:15px;font-weight:var(--ifm-button-font-weight);margin:0 0 .2rem -.5rem;padding:.6rem 1.5rem;position:relative;text-align:left;top:-.5rem;width:calc(100% + 1rem)}.navbar-sidebar__close{display:flex;margin-left:auto}.pagination{-moz-column-gap:var(--ifm-pagination-page-spacing);column-gap:var(--ifm-pagination-page-spacing);display:flex;font-size:var(--ifm-pagination-font-size);padding-left:0}.pagination--sm{--ifm-pagination-font-size:0.8rem;--ifm-pagination-padding-horizontal:0.8rem;--ifm-pagination-padding-vertical:0.2rem}.pagination--lg{--ifm-pagination-font-size:1.2rem;--ifm-pagination-padding-horizontal:1.2rem;--ifm-pagination-padding-vertical:0.3rem}.pagination__item{display:inline-flex}.pagination__item>span{padding:var(--ifm-pagination-padding-vertical)}.pagination__item--active .pagination__link{color:var(--ifm-pagination-color-active)}.pagination__item--active .pagination__link,.pagination__item:not(.pagination__item--active):hover .pagination__link{background:var(--ifm-pagination-item-active-background)}.pagination__item--disabled,.pagination__item[disabled]{opacity:.25;pointer-events:none}.pagination__link{border-radius:var(--ifm-pagination-border-radius);color:var(--ifm-font-color-base);display:inline-block;padding:var(--ifm-pagination-padding-vertical) var(--ifm-pagination-padding-horizontal);transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination__link:hover{text-decoration:none}.pagination-nav{grid-gap:var(--ifm-spacing-horizontal);display:grid;gap:var(--ifm-spacing-horizontal);grid-template-columns:repeat(2,1fr)}.pagination-nav__link{border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-pagination-nav-border-radius);display:block;height:100%;line-height:var(--ifm-heading-line-height);padding:var(--ifm-global-spacing);transition:border-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination-nav__link:hover{border-color:var(--ifm-pagination-nav-color-hover);text-decoration:none}.announcement a,.content_knG7 a,.github-star:hover{text-decoration:underline}.pagination-nav__link--next{grid-column:2/3;text-align:right}.pagination-nav__label{font-size:var(--ifm-h4-font-size);font-weight:var(--ifm-heading-font-weight);word-break:break-word}.pagination-nav__link--prev .pagination-nav__label:before{content:"« "}.pagination-nav__link--next .pagination-nav__label:after{content:" »"}.pagination-nav__sublabel{color:var(--ifm-color-content-secondary);font-size:var(--ifm-h5-font-size);font-weight:var(--ifm-font-weight-semibold);margin-bottom:.25rem}.pills__item,.tabs{font-weight:var(--ifm-font-weight-bold)}.pills{display:flex;gap:var(--ifm-pills-spacing);padding-left:0}.pills__item{border-radius:.5rem;cursor:pointer;display:inline-block;padding:.25rem 1rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pills__item--active{color:var(--ifm-pills-color-active)}.pills__item--active,.pills__item:not(.pills__item--active):hover{background:var(--ifm-pills-color-background-active)}.pills--block{justify-content:stretch}.pills--block .pills__item{flex-grow:1;text-align:center}.tabs{color:var(--ifm-tabs-color);display:flex;margin-bottom:0;overflow-x:auto;padding-left:0}.tabs__item{border-bottom:3px solid transparent;border-radius:var(--ifm-global-radius);cursor:pointer;display:inline-flex;padding:var(--ifm-tabs-padding-vertical) var(--ifm-tabs-padding-horizontal);transition:background-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.tabs__item--active{border-bottom-color:var(--ifm-tabs-color-active-border);border-bottom-left-radius:0;border-bottom-right-radius:0;color:var(--ifm-tabs-color-active)}.tabs__item:hover{background-color:var(--ifm-hover-overlay)}.tabs--block{justify-content:stretch}.tabs--block .tabs__item{flex-grow:1;justify-content:center}html[data-theme=dark]{--ifm-color-scheme:dark;--ifm-color-emphasis-0:var(--ifm-color-gray-1000);--ifm-color-emphasis-100:var(--ifm-color-gray-900);--ifm-color-emphasis-200:var(--ifm-color-gray-800);--ifm-color-emphasis-300:var(--ifm-color-gray-700);--ifm-color-emphasis-400:var(--ifm-color-gray-600);--ifm-color-emphasis-600:var(--ifm-color-gray-400);--ifm-color-emphasis-700:var(--ifm-color-gray-300);--ifm-color-emphasis-800:var(--ifm-color-gray-200);--ifm-color-emphasis-900:var(--ifm-color-gray-100);--ifm-color-emphasis-1000:var(--ifm-color-gray-0);--ifm-background-color:#1b1b1d;--ifm-background-surface-color:#242526;--ifm-hover-overlay:hsla(0,0%,100%,.05);--ifm-color-content:#e3e3e3;--ifm-color-content-secondary:#fff;--ifm-breadcrumb-separator-filter:invert(64%) sepia(11%) saturate(0%) hue-rotate(149deg) brightness(99%) contrast(95%);--ifm-code-background:hsla(0,0%,100%,.1);--ifm-scrollbar-track-background-color:#444;--ifm-scrollbar-thumb-background-color:#686868;--ifm-scrollbar-thumb-hover-background-color:#7a7a7a;--ifm-table-stripe-background:hsla(0,0%,100%,.07);--ifm-toc-border-color:var(--ifm-color-emphasis-200);--ifm-color-primary-contrast-background:#102445;--ifm-color-primary-contrast-foreground:#ebf2fc;--ifm-color-secondary-contrast-background:#474748;--ifm-color-secondary-contrast-foreground:#fdfdfe;--ifm-color-success-contrast-background:#003100;--ifm-color-success-contrast-foreground:#e6f6e6;--ifm-color-info-contrast-background:#193c47;--ifm-color-info-contrast-foreground:#eef9fd;--ifm-color-warning-contrast-background:#4d3800;--ifm-color-warning-contrast-foreground:#fff8e6;--ifm-color-danger-contrast-background:#4b1113;--ifm-color-danger-contrast-foreground:#ffebec;--ifm-code-background:hsla(0,0%,100%,.06);--ifm-toc-border-color:var(--dark);--ifm-color-emphasis-300:var(--dark);--ifm-hr-border-color:hsla(0,0%,100%,.06);--docsearch-searchbox-background:var(--ifm-background-color);--docsearch-modal-background:var(--deepdark);--docsearch-footer-background:var(--dark);--docsearch-key-gradient:var(--deepdark);--docsearch-key-shadow:inset 0 -2px 0 0 var(--light),inset 0 0 1px 1px var(--light),0 1px 2px 1px var(--ifm-table-border-color);--docsearch-container-background:rgba(0,0,0,.6);--ifm-background-color:#1f2031;--docsearch-text-color:#f5f6f7;--docsearch-container-background:rgba(9,10,17,.8);--docsearch-modal-background:#15172a;--docsearch-modal-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--docsearch-searchbox-background:#090a11;--docsearch-searchbox-focus-background:#000;--docsearch-hit-color:#bec3c9;--docsearch-hit-shadow:none;--docsearch-hit-background:#090a11;--docsearch-key-gradient:linear-gradient(-26.5deg,#565872,#31355b);--docsearch-key-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 2px 2px 0 rgba(3,4,9,.3);--docsearch-footer-background:#1e2136;--docsearch-footer-shadow:inset 0 1px 0 0 rgba(73,76,106,.5),0 -4px 8px 0 rgba(0,0,0,.2);--docsearch-logo-color:#fff;--docsearch-muted-color:#7f8497}#nprogress .bar{background:var(--docusaurus-progress-bar-color);height:2px;left:0;position:fixed;top:0;width:100%;z-index:1031}#nprogress .peg{box-shadow:0 0 10px var(--docusaurus-progress-bar-color),0 0 5px var(--docusaurus-progress-bar-color);height:100%;opacity:1;position:absolute;right:0;transform:rotate(3deg) translateY(-4px);width:100px}.code-demo-container{background:0 0;background-image:linear-gradient(180deg,#212150,transparent);border-radius:14px;margin-left:-24px;margin-right:-50vw;overflow:hidden;padding-left:27px;padding-right:50vw;padding-top:25px;position:relative}.code-demo-container .window-buttons{display:flex;left:12px;position:absolute;top:6px}.code-demo-container .window-buttons .btn{background-color:hsla(0,0%,100%,.5);border-radius:6px;height:12px;margin:3px;opacity:.5;width:12px}.code-demo-container .filename.main{display:none;margin-left:-26px;margin-top:5px}.code-demo-container.split .filename.main{animation:.3s a;display:block;opacity:1}.code-demo-container:before{background-image:radial-gradient(farthest-corner at 0 0,hsla(0,0%,100%,.5) 0,transparent 50%);border-radius:inherit;content:"";display:block;inset:0;-webkit-mask:linear-gradient(#000,#000) content-box content-box,linear-gradient(#000,#000);-webkit-mask-composite:xor;opacity:.5;padding:1px;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.code-demo-container:after{background-image:radial-gradient(farthest-corner at 0 0,hsla(0,0%,100%,.6) 0,transparent 40%);content:"";display:block;height:2.5px;left:1px;opacity:.5;position:absolute;top:29px;width:100%}.code-demo-container .splitter{animation:1s f;background-image:radial-gradient(farthest-corner at 0 0,hsla(0,0%,100%,.3) 0,transparent 40%);display:block;height:2.5px;margin-left:-26px;position:relative;width:50%}.code-demo-container .splitter .filename{top:1px}.code-demo-container .filename{border:1px solid hsla(0,0%,100%,.2);border-bottom-right-radius:9px;-o-border-image:initial;border-image:initial;border-left:none;border-top:none;color:hsla(0,0%,100%,.4);font-size:11px;padding:2px 7px;position:absolute;-moz-user-select:none;user-select:none;-webkit-user-select:none}.hash-link,.markdown .tabs .tabs__item{-webkit-user-select:none;-moz-user-select:none}.code-demo-container.animate .window-buttons .btn,.code-demo-container.animate:after,.code-demo-container.animate:before{animation:3s b}@keyframes a{0%{opacity:0;transform:translateX(20px)}to{opacity:1;transform:translateX(0)}}@keyframes b{0%{opacity:1}to{opacity:.5}}html[data-theme=light] .Section.demo{background:linear-gradient(-55deg,#1b1c3b,#3f2793)}html[data-theme=dark] .NativeApps,html[data-theme=dark] .Section.demo{background-color:rgba(0,0,0,.14)}.code-demo-container code{background:0 0;color:#fff;display:block;padding-bottom:4px;padding-left:0;padding-top:27px;width:120vw}code>.line{line-height:1.4;white-space:pre-wrap}code .token.builtin,code .token.char,code .token.entity,code .token.property,code .token.selector,code .token.url{color:#2aa198}code .token.attr-name,code .token.cdata,code .token.comment,code .token.doctype,code .token.prolog{color:hsla(201,7%,60%,.82)}code .token.punctuation{color:#657b83}code .token.atrule,code .token.inserted{color:#859900}code .token.deleted,code .token.important,code .token.operator,code .token.tag,code .token.variable{color:#fc929e}code .token.entity{cursor:help}code .token.attr-name,code .token.keyword{color:#b390d1}code .token.attr-value,code .token.regex,code .token.string{color:#8dc891}code .token.constant,code .token.number,code .token.symbol{color:#5a9bcf}code .token.boolean{color:#ff8b50}code .token.class-name{color:#fac863}code .token.function{color:#79b6f2}.controls-container{align-items:flex-end;align-items:center;color:#b7b6d6;display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem;justify-content:flex-end;padding-right:20px}.controls-container label:focus{border-color:#2260ff;box-shadow:0 0 0 4px #b5c9fc;outline:red solid 10px}.controls-container fieldset{align-items:center;border:0;display:flex;flex-direction:row;gap:1rem;margin:0;min-width:0;padding:0}.controls-container fieldset div{display:flex;font-size:14px;justify-content:center;margin-bottom:.5rem}.controls-container input[type=radio]{clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.controls-container input[type=radio]:hover+span{background-color:rgba(64,64,137,.2);color:hsla(0,0%,100%,.8)}.controls-container input[type=radio]:checked+span{background-color:rgba(64,64,137,.392);box-shadow:0 0 0 .0625em #b0add5;color:hsla(0,0%,100%,.867);z-index:1}.controls-container label span{background-color:rgba(33,33,80,.631);cursor:pointer;display:block;font-size:12px;height:3.2rem;letter-spacing:.05em;line-height:3.2rem;margin-left:1px;position:relative;text-align:center;transition:background-color .5s;width:4.9rem;box-shadow:0 0 0 1px #605e81;white-space:nowrap}.controls-container label:first-child span{border-radius:14px 0 0 14px}.controls-container label:last-child span{border-radius:0 14px 14px 0}html[data-theme=light] .Section.demo .code-demo-container{background-image:linear-gradient(rgba(33,33,80,.37),transparent)}html[data-theme=light] .Section.demo h2,html[data-theme=light] .Section.demo p{color:#fff}html[data-theme=light] .Section.demo .controls-container{color:hsla(0,0%,100%,.867)}html[data-theme=light] .Section.demo .controls-container label span{background-color:rgba(33,33,80,.086);box-shadow:0 0 0 1px rgba(113,100,173,.97)}html[data-theme=light] .Section.demo input[type=radio]:checked+span{background-color:hsla(0,0%,100%,.03);box-shadow:0 0 0 1px hsla(0,0%,100%,.8);color:hsla(0,0%,100%,.8);z-index:1}html[data-theme=light] .Section.demo input[type=radio]:hover+span{background-color:hsla(0,0%,100%,.02)}.Section.demo>div{display:flex;gap:39px;margin:auto;max-width:900px;position:relative}fieldset.large label span{min-width:4.9rem;padding:0 15px;width:auto}@supports(-webkit-appearance:none) or (-moz-appearance:none){.Section.demo .checkbox input[type=checkbox]{--active:#fff3;--active-inner:#fff;--focus:4px #fff3;--border:#c8cdec;--background:transparent;--disabled:#f6f8ff;--disabled-inner:#e1e6f9;-webkit-appearance:none;-moz-appearance:none;background:var(--b,var(--background));border:1px solid var(--bc,var(--border));cursor:pointer;display:inline-block;height:21px;margin:0 0 0 10px;outline:0;position:relative;transition:background .3s,border-color .3s,box-shadow .2s;vertical-align:top}.Section.demo .checkbox input[type=checkbox]:after{content:"";display:block;left:0;position:absolute;top:0;transition:transform var(--d-t,.3s) var(--d-t-e,ease),opacity var(--d-o,.2s)}.Section.demo .checkbox input[type=checkbox]:checked{--b:var(--active);--bc:#fff9;--d-o:.3s;--d-t:.6s;--d-t-e:cubic-bezier(.2,.85,.32,1.2)}.Section.demo .checkbox input[type=checkbox]:disabled{--bc:#fff6;cursor:not-allowed;opacity:.5}.Section.demo .checkbox input[type=checkbox]:disabled:checked{--b:var(--disabled-inner);opacity:.5}.Section.demo .checkbox input[type=checkbox]:disabled+label{cursor:not-allowed;opacity:.5}.Section.demo .checkbox input[type=checkbox]:focus{box-shadow:0 0 0 var(--focus)}.Section.demo .checkbox input[type=checkbox]:not(.switch){width:21px;border-radius:7px}.Section.demo .checkbox input[type=checkbox]:not(.switch):after{opacity:var(--o,0);border:2px solid var(--active-inner);border-left:0;border-top:0;height:9px;left:7px;top:4px;transform:rotate(var(--r,20deg));width:5px}.Section.demo .checkbox input[type=checkbox]:not(.switch):checked{--o:1;--r:43deg}.Section.demo .checkbox input[type=checkbox]+label{cursor:pointer;display:inline-block;font-size:14px;line-height:21px;margin-left:6px;vertical-align:top}}.Section.demo .checkbox *,.Section.demo .checkbox :after,.Section.demo .checkbox :before{box-sizing:inherit}html[data-theme=dark] input[type=checkbox]{--active:rgba(64,64,137,.455)!important}.HeaderHero .mask-container{-webkit-mask:url('data:image/svg+xml;utf8,') 0/100% 100%;mask:url('data:image/svg+xml;utf8,') 0/100% 100%}.HeaderHero .pencil-container{align-items:center;display:flex;height:260px;justify-content:center;left:1px;position:absolute;top:-1px;width:260px}.HeaderHero .spinner{animation:1.2s infinite c;background-clip:padding-box;border:14px solid hsla(0,0%,100%,.27);border-radius:125px;height:250px;margin:auto;-webkit-mask:linear-gradient(rgba(0,0,0,.1),#000 90%);position:relative;transform:perspective(250px) rotateX(76deg);transform-origin:50% 60%;width:250px}@keyframes c{30%{transform:perspective(250px) rotateX(76deg)}40%{transform:perspective(250px) rotateX(75deg)}50%{transform:perspective(250px) rotateX(78deg)}60%{transform:perspective(250px) rotateX(74deg)}}.HeaderHero .spinner:after,.HeaderHero .spinner:before{animation:1.2s cubic-bezier(.6,.2,0,.8) infinite e,1.2s linear infinite d;border:inherit;border-radius:inherit;box-sizing:inherit;content:"";height:inherit;margin:-14px;opacity:.05;position:absolute;width:inherit}.HeaderHero .spinner:before{border-top-color:#66e6ff}.HeaderHero .spinner:after{animation-delay:.3s;border-top-color:#b475f0}.HeaderHero .delay.spinner:before{animation-delay:.6s;border-top-color:#66e6ff}.HeaderHero .delay.spinner:after{animation-delay:.3s}@keyframes d{20%,60%{opacity:.1}40%{opacity:1}}.HeaderHero .outer-container{overflow:hidden;position:relative;transform:scale(.9)}html[data-theme=light] .HeaderHero .delay.spinner:before{border-top-color:#fff}html[data-theme=light] .HeaderHero .spinner{border:14px solid rgba(25,16,95,.51)}.Section p a,.avatar__name a,.community-page .row .col p a,.main-wrapper:not(.community-page) .container.margin-vert--lg a.margin-horiz--sm,.main-wrapper:not(.community-page) .container.margin-vert--lg a.padding-right--md,.markdown a{background-color:rgba(106,103,255,.15);border-bottom:1px solid rgba(106,103,255,.8);color:var(--ifm-font-color-base);display:initial}.Section p a:hover,.avatar__name a:hover,.community-page .row .col p a:hover,.main-wrapper:not(.community-page) .container.margin-vert--lg a.margin-horiz--sm:hover,.main-wrapper:not(.community-page) .container.margin-vert--lg a.padding-right--md:hover,.markdown a:hover{background-color:rgba(106,103,255,.22)}html[data-theme=dark] .Section p a,html[data-theme=dark] .avatar__name a,html[data-theme=dark] .community-page .row .col p a,html[data-theme=dark] .main-wrapper:not(.community-page) .container.margin-vert--lg a.margin-horiz--sm,html[data-theme=dark] .main-wrapper:not(.community-page) .container.margin-vert--lg a.padding-right--md,html[data-theme=dark] .markdown a{background-color:rgba(106,103,255,.25);border-bottom-color:var(--brand)}html[data-theme=dark] .Section p a:hover,html[data-theme=dark] .avatar__name a:hover,html[data-theme=dark] .community-page .row .col p a:hover,html[data-theme=dark] .main-wrapper:not(.community-page) .container.margin-vert--lg a.margin-horiz--sm:hover,html[data-theme=dark] .main-wrapper:not(.community-page) .container.margin-vert--lg a.padding-right--md:hover,html[data-theme=dark] .markdown a:hover{background-color:rgba(106,103,255,.4)}.Section p td a,.avatar__name td a,.community-page .row .col p td a,.main-wrapper:not(.community-page) .container.margin-vert--lg td a.margin-horiz--sm,.main-wrapper:not(.community-page) .container.margin-vert--lg td a.padding-right--md,.markdown td a,td .Section p a,td .avatar__name a,td .community-page .row .col p a,td .main-wrapper:not(.community-page) .container.margin-vert--lg a.margin-horiz--sm,td .main-wrapper:not(.community-page) .container.margin-vert--lg a.padding-right--md,td .markdown a{padding-top:4px}.community-page .hash-link,.markdown .hash-link,html[data-theme=dark] .community-page .hash-link,html[data-theme=dark] .markdown .hash-link{background-color:transparent;border-bottom:0;color:var(--subtle)}.community-page .hash-link:hover,.markdown .hash-link:hover,html[data-theme=dark] .community-page .hash-link:hover,html[data-theme=dark] .markdown .hash-link:hover{background-color:transparent;color:var(--brand)}.docMetadata a,.main-wrapper:not(.community-page) .container.margin-vert--lg .col.text--right a{border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-global-radius);color:var(--ifm-color-content-secondary);display:inline-block;padding:8px 16px}.docMetadata a:hover,.main-wrapper:not(.community-page) .container.margin-vert--lg .col.text--right a:hover{background:var(--ifm-menu-color-background-hover);color:var(--ifm-color-primary)}.main-wrapper:not(.community-page) .container .row .col.col--2 div[class^=sidebar]::-webkit-scrollbar,.markdown .prism-code::-webkit-scrollbar{height:7px;width:7px}.main-wrapper:not(.community-page) .container .row .col.col--2 div[class^=sidebar]::-webkit-scrollbar-thumb,.markdown .prism-code::-webkit-scrollbar-thumb{background:#888;border-radius:10px}.main-wrapper:not(.community-page) .container .row .col.col--2 div[class^=sidebar]::-webkit-scrollbar-track,.markdown .prism-code::-webkit-scrollbar-track{background:#f1f1f1;border-radius:10px}html[data-theme=dark] .main-wrapper:not(.community-page) .row .col.col--2 div[class^=sidebar]::-webkit-scrollbar-track,html[data-theme=dark] .markdown .prism-code::-webkit-scrollbar-track,html[data-theme=dark] .menu::-webkit-scrollbar-track,html[data-theme=dark]::-webkit-scrollbar-track{background:#141414}html[data-theme=dark] .main-wrapper:not(.community-page) .row .col.col--2 div[class^=sidebar]::-webkit-scrollbar-thumb,html[data-theme=dark] .markdown .prism-code::-webkit-scrollbar-thumb,html[data-theme=dark] .menu::-webkit-scrollbar-thumb,html[data-theme=dark]::-webkit-scrollbar-thumb{background:var(--ifm-color-emphasis-200)}:root{--docusaurus-progress-bar-color:var(--ifm-color-primary);--ifm-pre-padding:1rem;--ifm-color-info:rgba(170,155,255,.42);--docsearch-highlight-color:#8642ffba;--ifm-color-primary:#6a67ff;--brand:hsla(0,0%,100%,.9);--ifm-navbar-link-hover-color:var(--brand);--dark:#232c3b;--deepdark:#1a1a2c;--light:#373940;--text:#1a1a1a;--subtle:#647899;--divider:#ececec;--tintColor:#f7f7f7;--rn-note-background:rgba(106,103,255,.25);--ifm-font-size-base:16px;--ifm-font-family-base:Inter,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ifm-font-family-monospace:"Roboto Mono",SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--ifm-line-height-base:1.5;--ifm-spacing-horizontal:16px;--ifm-navbar-item-padding-horizontal:20px;--ifm-menu-link-padding-horizontal:10px;--ifm-toc-padding-vertical:6px;--ifm-toc-link-color:var(--ifm-color-emphasis-700);--ifm-code-font-size:85%;--ifm-code-border-radius:3px;--ifm-blockquote-color:var(--ifm-font-color-base);--ifm-table-head-color:var(--subtle);--ifm-link-hover-decoration:none;--ifm-navbar-background-color:var(--deepdark);--ifm-transition-fast:0;--ifm-transition-slow:0;--ifm-pre-line-height:1.5;--ifm-tabs-padding-vertical:6px;--ifm-color-warning:#ffe56479;--ifm-alert-border-width:0;--ifm-alert-border-radius:0;--ifm-alert-color:var(--ifm-font-color-base);--ifm-pagination-nav-color-hover:var(--ifm-color-emphasis-300);--ifm-navbar-sidebar-width:50%;--doc-sidebar-width:100%;--docusaurus-announcement-bar-height:auto!important;--docusaurus-announcement-bar-height:auto;--docusaurus-tag-list-border:var(--ifm-color-emphasis-300);--docusaurus-collapse-button-bg:transparent;--docusaurus-collapse-button-bg-hover:rgba(0,0,0,.1);--doc-sidebar-width:300px;--doc-sidebar-hidden-width:30px;--docsearch-primary-color:#5468ff;--docsearch-text-color:#1c1e21;--docsearch-spacing:12px;--docsearch-icon-stroke-width:1.4;--docsearch-highlight-color:var(--docsearch-primary-color);--docsearch-muted-color:#969faf;--docsearch-container-background:rgba(101,108,133,.8);--docsearch-logo-color:#5468ff;--docsearch-modal-width:560px;--docsearch-modal-height:600px;--docsearch-modal-background:#f5f6f7;--docsearch-modal-shadow:inset 1px 1px 0 0 hsla(0,0%,100%,.5),0 3px 8px 0 #555a64;--docsearch-searchbox-height:56px;--docsearch-searchbox-background:#ebedf0;--docsearch-searchbox-focus-background:#fff;--docsearch-searchbox-shadow:inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-height:56px;--docsearch-hit-color:#444950;--docsearch-hit-active-color:#fff;--docsearch-hit-background:#fff;--docsearch-hit-shadow:0 1px 3px 0 #d4d9e1;--docsearch-key-gradient:linear-gradient(-225deg,#d5dbe4,#f8f8f8);--docsearch-key-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px rgba(30,35,90,.4);--docsearch-footer-height:44px;--docsearch-footer-background:#fff;--docsearch-footer-shadow:0 -1px 0 0 #e0e3e8,0 -3px 6px 0 rgba(69,98,155,.12);--docsearch-primary-color:var(--ifm-color-primary);--docsearch-text-color:var(--ifm-font-color-base)}html[data-theme=light]{--ifm-code-background:rgba(0,0,0,.06);--docsearch-container-background:rgba(32,35,42,.6)}.main-wrapper{max-width:1400px;width:1400px}.main-wrapper h1[class^=docTitle]{font-size:2.5rem}hr{background-color:var(--ifm-hr-background-color);height:var(--ifm-hr-height);margin:var(--ifm-hr-margin-vertical) 0;background-color:var(--ifm-hr-border-color);border:0;height:2px}.markdown blockquote{background-color:var(--rn-note-background);border-left:8px solid var(--rn-note-background);padding:15px 30px 15px 15px}.markdown blockquote code{background-color:rgba(0,0,0,.07)}.markdown a code,.markdown blockquote a code,html[data-theme=dark] .markdown blockquote a code{background-color:transparent}.markdown blockquote a code{white-space:pre}.markdown a code{font-size:90%;padding:0 6px}.markdown strong{font-weight:600}.markdown table{display:table;margin:20px 0;width:100%}.markdown table thead tr{background-color:var(--divider)}.markdown table tr th{font-size:.7rem;padding:6px 10px;text-align:left}.markdown table tr td{font-size:14px;line-height:1.3em;padding:10px;text-align:left}.markdown table tr td code{display:inline-block;line-height:1.1em;vertical-align:top}.markdown table tr td ul{margin:8px 0 0;padding:4px 0 4px 20px}.markdown table hr{margin:12px 0}.markdown table .wideColumn{width:128px}.markdown table .widerColumn{width:180px}.markdown figure{padding:8px;text-align:center}.markdown figure figcaption{color:var(--subtle);font-size:.9rem;padding:8px}.markdown figure figcaption code{color:var(--subtle)}.markdown .docusaurus-highlight-code-line{background-color:var(--light)}.markdown div[class^=mdxCodeBlock]{font-size:80%}.markdown div[class^=codeBlockTitle]{background-color:var(--ifm-table-border-color)!important;color:var(--subtle)!important}.docMetadata small,.markdown button[class^=copyButton]{font-size:13px}.markdown .tabs{border-bottom:1px solid var(--ifm-table-border-color);color:var(--ifm-font-color-base)}.markdown .tabs .tabs__item{color:var(--ifm-font-color-base);font-size:15px;font-weight:400;user-select:none}.markdown .tabs .tabs__item:hover{border-radius:var(--ifm-global-radius) var(--ifm-global-radius) 0 0}html[data-theme=dark] .markdown blockquote code{background-color:hsla(0,0%,100%,.09)}html[data-theme=dark] .markdown div[class^=codeBlockLines],html[data-theme=dark] .markdown div[class^=codeBlockTitle]{background-color:var(--deepdark)!important}.pagination-nav .pagination-nav__label,article .badge{font-weight:500}html[data-theme=dark] article .badge{background:var(--deepdark);border-color:var(--deepdark);color:var(--ifm-font-color-base)}.alert--warning{border-left:8px solid var(--ifm-alert-border-color);font-size:14px}.alert--warning .margin-top--md{margin-top:.33rem!important}.community-page{max-width:1280px}.community-page h1{font-size:2.8rem}.community-page h2{font-size:2rem;margin-top:36px}.community-page h3{display:inline-block;font-size:1.5rem;margin-top:16px}div[class*=docItemWrapper] .row .col>.alert--warning{background-color:rgba(100,215,255,.3)}.avatar__name{line-height:24px}html[data-theme=dark] .Section.tint,html[data-theme=dark] .navbar .DocSearch-Button{background:rgba(0,0,0,.14)}html[data-theme=dark] .navbar{background:rgba(17,17,38,.4)}.navbar-sidebar,.navbar-sidebar__backdrop{height:100vh}.navbar:after{background:linear-gradient(45deg,#6b26ff,rgba(222,73,255,.67),#339ce5);content:"";height:3px;left:0;position:absolute;top:0;width:100%}.navbar{-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background:0 0;background:linear-gradient(-55deg,rgba(54,33,127,.84),rgba(47,25,135,.84));padding:0}.navbar .navbar__inner{margin:0 auto;max-width:1360px;padding:.5rem 1rem}.navbar .navbar__title{font-size:22px;font-weight:500;text-shadow:1px 1px 2px rgba(0,0,0,.2);transform:scaleX(.9)}.GetStarted,.GetStarted p,.navbar .navbar__title:hover,.navbar .navbar__toggle,article .component-grid .component h3 a,html[data-theme=dark] .HeaderHero svg,html[data-theme=light] .ActionButton.secondary:hover,html[data-theme=light] .github-star,html[data-theme=light] .navbar__link--active,html[data-theme=light] .navbar__link:hover{color:#fff}.HeaderHero .title,.navbar .navbar__brand:hover,.navbar__link--active,.navbar__link:hover{color:var(--brand)}.navbar .navbar__item.navbar__link{font-size:18px;font-weight:400}.navbar .navbar__item.dropdown a{font-size:14px;font-weight:400}.navbar .navbar__logo{height:29px}.navbar .react-toggle{margin:0 8px}.navbar .react-toggle .react-toggle-track,.pagination-nav .pagination-nav__sublabel{font-size:15px}.navbar .react-toggle .react-toggle-thumb{border:2px solid #4d4d4d}.navbar .react-toggle:hover .react-toggle-thumb{border-color:var(--ifm-color-primary)}.navbar .react-toggle--focus .react-toggle-thumb{box-shadow:0 0 2px 3px rgba(0,153,224,.522)}.navbar .DocSearch-Button{border-radius:var(--ifm-global-radius);padding:0 6px 0 10px}.navbar .DocSearch-Button .DocSearch-Search-Icon{margin-top:-1px;width:16px}.navbar .DocSearch-Button-Key,.navbar .DocSearch-Button-Placeholder{font-size:14px!important}.navbar .DocSearch-Button-Key{padding-bottom:0!important}.navbar .DocSearch-Button-Key svg{margin-bottom:1px!important}.navbar .dropdown__menu{min-width:120px}.docMetadata strong,.docMetadata time,.navbar .dropdown__menu a.dropdown__link--active{font-weight:600}.navbar .navbar-github-link:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23fff' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;content:"";display:flex;height:24px;transition:opacity .2s;width:24px}.navbar .navbar-github-link:hover:after{opacity:.5}.navbar .navbar__link--active:after{background:var(--brand);content:"";display:flex;height:4px;margin-left:-20px;margin-right:-20px;margin-top:-4px;position:relative;top:17px;width:calc(100% + 40px)}html[data-theme=dark] .label.ios,html[data-theme=light] .NativeCode.corner .TwoColumns .column.last.right,html[data-theme=light] .navbar .navbar__link--active:after{background:#fff}.navbar-sidebar{background:var(--divider)}.navbar-sidebar .navbar-sidebar__brand,div[class^=announcementBarContent]{background-color:var(--deepdark)}.navbar-sidebar .navbar-sidebar__items{padding:12px}.navbar-sidebar .navbar-sidebar__items .menu__list-item a{padding:6px 12px 8px}.navbar-sidebar .navbar-github-link:after{background-image:none;content:"GitHub";height:20px}.footerLogoLink_BH7S:hover,.hash-link:focus,.navbar-sidebar .navbar-github-link:hover:after,:hover>.hash-link{opacity:1}#__docusaurus-base-url-issue-banner-container,.label.basic:after,.label.basic:before,.navbar-sidebar .navbar__link--active:after,.themedComponent_mlkZ,[data-theme=dark] .lightToggleIcon_pyhR,[data-theme=light] .darkToggleIcon_wfgR,html[data-announcement-bar-initially-dismissed=true] .announcementBar_mb4j{display:none}html[data-theme=dark] .label:after,html[data-theme=dark] .navbar-sidebar{background:var(--ifm-background-color)}div[class^=docSidebarContainer]{margin-right:16px;min-width:296px;width:296px}.menu__list{margin-bottom:10px}.menu__list .menu__list-item{margin-bottom:2px;margin-top:2px}.menu__list .menu__list .menu__link{color:var(--ifm-font-color-base);font-size:15px;font-weight:400;padding:4px 12px}.menu__list .menu__list .menu__link--sublist{font-weight:600!important;margin-top:4px}.menu__list .menu__link--sublist{color:var(--subtle)!important;font-size:16px!important;font-weight:700!important;padding:5px 12px!important}.menu__list .menu__link--sublist:after{background-size:1.66rem 1.66rem;margin-right:-6px}.menu__list .menu__link--active.active{border-left:4px solid var(--ifm-menu-color-active)!important;font-weight:700!important;padding-left:8px}.admonitionContent_BuS1>:last-child,.banner-native-code-required p,.collapsibleContent_i85q p:last-child,.details_lb9f>summary>p:last-child,.menu__list .menu__list-item--collapsed .menu__list,.tabItem_Ymn6>:last-child{margin-bottom:0}.menu--responsive .menu__button{bottom:1.3rem;right:1.3rem}div[class^=tableOfContents]{min-width:100%;width:100%}.table-of-contents li{margin:7px var(--ifm-toc-padding-vertical)}.table-of-contents ul{padding-left:.35rem}.table-of-contents ul li{margin:4px var(--ifm-toc-padding-vertical)}.table-of-contents .table-of-contents__link{display:block;font-size:15px}.table-of-contents .table-of-contents__link code{background:none;padding:0}.table-of-contents .table-of-contents__link--active{border-left:4px solid var(--ifm-color-primary);color:var(--ifm-font-color-base);font-weight:500;margin-left:-16px;padding-left:12px}.table-of-contents .table-of-contents__link--active code{color:var(--ifm-font-color-base);font-weight:600;white-space:nowrap}.docMetadata{color:var(--subtle);font-size:15px;margin-bottom:16px!important;margin-top:40px!important}.docMetadata .docMetadata-updated{line-height:18px}.pagination-nav .pagination-nav__link:hover{background:var(--ifm-menu-color-background-hover);border-color:var(--ifm-color-emphasis-300)}.footer{background:#17182d;box-shadow:inset 0 2px 0 -1px hsla(0,0%,100%,.08)}.footer .container{max-width:700px}.footer .text--center{color:rgba(238,238,255,.467);font-size:13px}.footer .footer__item{font-size:14px;min-height:30px;padding:8px 0 0}.footer .footer__title{color:rgba(238,238,255,.467);font-size:14px;font-weight:500;margin:0 0 8px}.footer .footer__col{margin:4px 0 12px 2%;padding-left:0!important}.footer .footer__link-item{display:inline-block;line-height:1.44}.footer .footer__links{margin-bottom:8px}article header h2 a:hover{color:var(--light)}.avatar__subtitle{color:var(--subtle);font-weight:600}.announcement{background-color:var(--deepdark);color:#fff;font-size:24px;font-weight:700;height:60px;line-height:40px;padding:8px 30px;text-align:center;width:100%}.Heading,.docsRating,.label,.main-wrapper:not(.community-page) .container.margin-vert--lg footer strong,h1,h2,h3,h4,h5,h6{font-weight:500}.announcement a{color:var(--brand)!important;display:inline-block}.announcement a:hover{color:#fff!important}.content-banner{background:#99d5e7;color:var(--dark);left:-1em;margin-bottom:2em;overflow:hidden;padding:1em 1.2em;position:relative;width:calc(100% + 2em)}.content-banner p{margin:0;width:calc(75% - 2em)}.content-banner-img{position:absolute;right:2em;top:2em;width:25%}.content-banner a:active,.content-banner a:focus,.content-banner a:hover,.content-banner a:link,.content-banner a:visited{background:none!important;border-bottom-color:#134484!important;border-bottom-width:2px;color:#134484!important}.banner-native-code-required{background:#eeebfe;border-left:8px solid #6170af;margin-bottom:24px;overflow:hidden;padding:24px 48px 24px 24px;position:relative}.banner-native-code-required h2,.banner-native-code-required h3{color:#6170af;margin-top:0}.banner-native-code-required h2:before,.banner-native-code-required h3:before{background-color:#6170af;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 23 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M0 18.036c.042.507.221 1.016.692 1.699.558.81 1.518 1.254 2.218.54.473-.481 5.582-9.335 8.045-12.69a.737.737 0 0 1 1.202 0c2.463 3.355 7.572 12.209 8.045 12.69.7.714 1.66.27 2.218-.54.55-.798.702-1.358.702-1.955 0-.407-7.958-15.086-8.76-16.308C13.593.297 13.357.042 12.053 0h-.994c-1.304.041-1.54.297-2.31 1.472C7.964 2.67.317 16.77 0 17.737v.299z' fill='%23fff'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:20px;border-radius:4px;content:" ";float:left;height:32px;margin-right:12px;margin-top:-2px;width:32px}.banner-native-code-required code{background-color:rgba(89,91,145,.12)}html[data-theme=dark] .banner-native-code-required{background:rgba(123,132,172,.35);border-left-color:#5d659a}html[data-theme=dark] .banner-native-code-required h2:before,html[data-theme=dark] .banner-native-code-required h3:before{background-color:#5d659a}html[data-theme=dark] .banner-native-code-required code{background:rgba(165,175,219,.15)}.color-box{border:.05rem solid var(--deepdark);border-radius:3px;float:left;height:24px;margin:2px 8px 0 0;width:24px}td .color-box{height:20px;width:20px}.label{border-radius:0 2px 2px 0;color:#fff;display:inline-block;font-size:.85rem;padding:2px 12px;position:relative}.label:before{border:12px solid transparent;border-left-width:0;left:-12px;top:0}.label:after,.label:before{content:"";position:absolute}.label:after{background:#fff;border-radius:2px;height:4px;left:0;top:10px;width:4px}.label.basic{border-radius:3px;border-style:solid;border-width:2px}.label.android{background:#a4c936}.label.android:before{border-right-color:#a4c936}.label.ios{background:#222}.label.ios:before{border-right-color:#222}.label.tv{background:#6170af}.label.tv:before{border-right-color:#6170af}.label.required{border-color:#fa5035;color:#fa5035;margin-left:0;margin-right:16px}html[data-theme=dark] .label{color:var(--text)}html[data-theme=dark] .label.ios:before{border-right-color:#fff}html[data-theme=dark] .label.required{color:#fa5035}h2 .label{margin-left:12px;padding:3px 12px;top:-6px}h3 .label{line-height:20px;margin-left:22px;top:-2px}td .label{font-size:.7rem;margin-left:14px;padding:0 8px 0 10px}td .label:before{border-width:9px 8px 9px 0;left:-8px}td .label:after{top:7px}td .label.required{border-width:1px;letter-spacing:.02rem;margin-left:8px;margin-right:0;padding:0 6px}td .label.two-lines{margin-left:0;margin-top:5px}td .label.two-lines.android,td .label.two-lines.ios,td .label.two-lines.tv{margin-left:8px}.table-of-contents .label{border-radius:100%;color:transparent;float:none;height:6px;margin-left:4px;margin-top:8px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:6px}.table-of-contents .label.required{background:#fa5035;border-width:3px;margin-left:0;margin-right:6px;position:static}.table-of-contents .label:nth-child(3){margin-left:13px}.menu__link[href*=dynamiccolorios]:after,.menu__link[href*=platformcolor]:after,.menu__link[href*=pressable]:after{border:1px solid #86b300;border-radius:3px;color:#86b300;content:"new";display:inline-block;font-size:10px;font-weight:600;height:10px;line-height:10px;margin-right:-6px;padding:3px 6px;position:relative;text-transform:uppercase;top:1px}article .component-grid{margin-bottom:22px;max-width:800px}article .component-grid .component{border:1px solid var(--ifm-color-emphasis-500);border-radius:var(--ifm-global-radius);display:inline-block;margin:0 auto 24px;overflow:hidden;transition:transform .2s ease-in-out;width:100%}article .component-grid .component:hover{transform:scale(1.05)}article .component-grid .component h3{background-color:var(--ifm-color-primary);color:#fff;font-size:16px;font-weight:600;line-height:36px;margin:0;padding:0 10px}article .component-grid .component p{font-size:15px;margin:2px;padding:10px}article .component-grid .component p code{font-size:15px;padding:0 1px}html[data-theme=dark] .component{border:1px solid var(--ifm-color-emphasis-200)}@supports(display:grid){article .component-grid{grid-column-gap:22px;display:grid}}.docsRating{background-color:rgba(100,215,255,.3);border-radius:0 var(--ifm-global-radius) var(--ifm-global-radius) 0;color:#0780ab;display:inline-block;line-height:32px;margin-left:-40px;margin-top:42px;min-height:66px;padding:16px 30px 16px 40px;text-align:center}.AppList,.TwoColumns,.two-columns{display:grid}.docsRating svg{height:1.5em;margin:0 0 0 6px;width:1.5em}.docsRating svg:focus,.docsRating svg:hover{fill:var(--ifm-color-primary);cursor:pointer}.docsRating .i_thumbsup{fill:#56a211;margin-left:12px;transform:translateY(.25em)}.docsRating .i_thumbsdown{fill:#e9430f;transform:scale(-1) translateY(-.25em)}html[data-theme=dark] .docsRating{color:#cee9f3}.snack-player{border:1px solid var(--ifm-table-border-color);border-radius:var(--ifm-global-radius);height:505px;margin-bottom:24px;overflow:hidden;width:100%}.two-columns{gap:0 2%;grid-template-areas:". .";grid-template-columns:1fr 1fr;grid-template-rows:1fr}.two-columns div[class^=codeBlockLines]{white-space:pre-wrap}.main-wrapper:not(.community-page) .container.margin-vert--lg{margin-bottom:0!important;margin-top:0!important;max-width:calc(100% - (var(--ifm-spacing-horizontal))*4)}.main-wrapper:not(.community-page) .container.margin-vert--lg .col.text--right a{padding:8px 32px}.main-wrapper:not(.community-page) .container.margin-vert--lg a.margin-horiz--sm,.main-wrapper:not(.community-page) .container.margin-vert--lg a.padding-right--md{margin-right:16px;padding-right:0!important}.main-wrapper:not(.community-page) .container .row .col.col--2{--ifm-col-width:20.83333%;padding-left:0}.main-wrapper:not(.community-page) .container .row .col.col--2:last-child{--ifm-col-width:16.66667%;padding-right:0}.main-wrapper:not(.community-page) .container .row .col.col--2 div[class^=sidebar]{border-right:1px solid var(--ifm-toc-border-color);margin-left:-32px;max-height:calc(100vh - var(--ifm-navbar-height));min-height:calc(100vh - var(--ifm-navbar-height));padding:24px 12px 0;top:var(--ifm-navbar-height)}.main-wrapper:not(.community-page) .container .row .col.col--2 div[class^=sidebar] li[class^=sidebarItem]{line-height:18px;margin-bottom:2px;margin-top:0;min-height:26px}.main-wrapper:not(.community-page) .container .row .col.col--2 div[class^=sidebar] a[class^=sidebarItemLink]{border-left:4px solid transparent;border-radius:.25rem;display:inline-flex;font-size:13px;min-width:100%;padding:4px 8px}.main-wrapper:not(.community-page) .container .row .col.col--2 div[class^=sidebar] a[class^=sidebarItemLink]:hover{background:var(--ifm-menu-color-background-active);color:var(--ifm-font-color-base)}.main-wrapper:not(.community-page) .container .row .col.col--2 div[class^=sidebar] a[class*=sidebarItemLinkActive]{background:var(--ifm-menu-color-background-active);border-left-color:var(--ifm-menu-color-active);color:var(--ifm-font-color-base);font-weight:700}.main-wrapper:not(.community-page) .container .row .col.col--2 div[class^=sidebar] h3{color:var(--subtle);font-size:16px;margin-bottom:12px;padding-left:12px}.main-wrapper:not(.community-page) .container .row .col.col--8{--ifm-col-width:62.5%;padding:24px 16px 24px 20px}.main-wrapper:not(.community-page) .container .row .col.col--8:last-child{--ifm-col-width:75%}.markdown .tabs.pill-tabs{border-bottom:0}.markdown .tabs.pill-tabs .tabs__item{border:2px solid var(--ifm-table-border-color);border-radius:var(--ifm-global-radius);margin-right:10px}.markdown .tabs.pill-tabs .tabs__item:hover{border-radius:var(--ifm-global-radius)}.markdown .tabs.pill-tabs .tabs__item.tabs__item--active{border-color:var(--ifm-tabs-color-active)}.navbar .react-toggle .react-toggle-track{background:rgba(24,6,78,.49)}html[data-theme=dark] .menu--show,html[data-theme=dark] .navbar-sidebar{background:var(--deepdark)}.navbar-sidebar .navbar-sidebar__brand{background:linear-gradient(-60deg,#6941a0,#372d7c);box-shadow:none}.title .gradient{background:radial-gradient(circle at 50% 40%,rgba(182,106,255,.5) 0,rgba(182,106,255,.2) 16%,rgba(182,106,255,.06) 50%,transparent 100%);height:100%;opacity:.6;pointer-events:none;position:absolute;right:0;top:0;transition:opacity 1s;width:100%;z-index:-1}html[data-theme=light] .title .gradient{background:radial-gradient(circle at 50% 40%,hsla(0,0%,100%,.5) 0,hsla(0,0%,100%,.3) 16%,hsla(0,0%,100%,.06) 50%,transparent 100%)}.title:hover .gradient{opacity:.85}.homepage{margin-top:-60px;max-width:100%;width:100%}html[data-theme=dark] .homepage{background:linear-gradient(-60deg,rgba(24,34,92,.733),rgba(63,43,167,.3) 50%,#18225c) #151515}.ActionButton.primary{background-color:var(--brand);color:var(--dark)}.ActionButton.secondary{background:none;color:var(--brand)}.AppList{grid-gap:16px;grid-template-columns:1fr 1fr 1fr 1fr 1fr;padding:0}.AppList .item,.containsTaskList_mC6p{list-style:none}.AppList .item a img{border-radius:20%;overflow:hidden}.Community .content,.GetStarted .content{display:flex;flex-direction:column;margin:0 auto;max-width:900px}.Community .content .firstP img{float:left;height:56px;margin-right:20px;width:56px}.CrossPlatform svg{margin:-20px 0;max-width:400px}.CrossPlatform svg text{fill:var(--ifm-color-content-secondary)}.FastRefresh,.NativeCode .column.last{margin-bottom:-39px}.FastRefresh .column.last{margin-bottom:-6px}.GetStarted .Heading{color:var(--brand);text-align:center}.GetStarted .steps li{font-size:28px;margin-bottom:8px}.GetStarted .steps li p{font-size:17px}.GetStarted .terminal{border-left:1px solid gray;border-right:1px solid gray;border-top:1px solid gray;border-top-left-radius:10px;border-top-right-radius:10px;display:flex;flex-direction:column;padding:30px 30px 0;position:relative;width:600px}.GetStarted .terminal:before{color:gray;content:"○ ○ ○";font-size:16px;left:15px;position:absolute;top:5px}.GetStarted code{background:none;color:#fff;font-size:18px;position:relative}.GetStarted code:first-child:before{color:gray;content:">";left:-13px;position:absolute}.HeaderHero{padding-top:20px}.HeaderHero .TwoColumns .column{max-width:none}.HeaderHero .socialLinks{display:flex;justify-content:flex-end;margin:-10px auto 0;max-width:1200px}.HeaderHero .socialLinks .github-button,.HeaderHero .socialLinks .twitter-follow-button{margin-right:1rem}.HeaderHero .tagline{color:#fff;font-size:28px}.Heading{color:var(--ifm-font-color-base);font-size:39px;line-height:1.2;margin-bottom:20px;margin-top:0}.HomePage{overflow-x:hidden;width:100%}.LogoAnimation{width:350px}.Section,.TwoColumns .column,.tablist svg{width:100%}.LogoAnimation .screen{stroke-opacity:0;stroke-width:5px;transform:scale(2.25,1.33) rotate(0);transition:.85s ease-in-out}.LogoAnimation .background{fill:var(--dark)}.LogoAnimation .logoInner{transform:scale(1);transition:.85s ease-in-out 50ms}.LogoAnimation.mobile .logoInner,.LogoAnimation.mobile2 .logoInner{transform:scale(.4)}.LogoAnimation.desktop .logoInner{transform:scale(.5)}.LogoAnimation.laptop .logoInner{transform:scale(.35)}.LogoAnimation.full .screen{stroke-opacity:0;opacity:1;transform:scale(2.25,1.33) rotate(0);transition:none}.LogoAnimation.mobile .screen{stroke-opacity:1;stroke-width:5px;opacity:1;transform:scale(1) rotate(0)}.LogoAnimation.desktop .screen{stroke-opacity:1;stroke-width:8px;opacity:1;transform:scale(1.125,1.1) rotate(-90deg)}.LogoAnimation.laptop .screen{stroke-opacity:1;stroke-width:5px;opacity:1;transform:scale(.83) rotate(-90deg)}.LogoAnimation.mobile2 .screen{stroke-opacity:1;stroke-width:5px;opacity:1;transform:scale(1) rotate(-180deg)}.LogoAnimation.full2 .screen{stroke-opacity:0;transform:scale(2.25,1.33) rotate(-180deg)}.LogoAnimation:not(.mobile):not(.mobile2) .speaker{opacity:0;transform:scaleX(0)}.LogoAnimation:not(.desktop) .stand,.LogoAnimation:not(.laptop) .base{transform:scaleX(0)}.LogoAnimation .base,.LogoAnimation .speaker,.LogoAnimation .stand{transition:.85s ease-in-out}.Embed{overflow:hidden}.NativeDevelopment{overflow-y:hidden}.NativeDevelopment .dissection{margin-top:-39px;position:relative}.NativeDevelopment .dissection img{left:0;position:absolute;top:0}.Section{overflow-x:hidden;padding-bottom:39px;padding-top:39px}.Section+.Section{box-shadow:inset 0 2px 0 -1px rgba(203,201,255,.12)}.Section.demo{border:1px solid rgba(203,201,255,.12);border-left:0;border-right:0}.Section.tint{background-color:rgba(17,0,98,.027)}.Section.dark{background-color:var(--dark)}.Talks .twitter-follow-button{margin-top:1.5rem}.TwoColumns .column.first{grid-area:c}.TwoColumns .column.last{font-size:18px;grid-area:d}html[data-theme=light] .TwoColumns .column.last{background:linear-gradient(-60deg,rgba(0,100,204,.29),rgba(62,43,167,.302) 50%,rgba(24,34,92,.8)) #000}.twitter-follow-button{background-color:#1b95e0;border-radius:4px;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-size:13px;font-weight:400;height:28px;line-height:26px;padding:1px 10px 1px 9px;position:relative}.twitter-follow-button:hover{background-color:#0c7abf;color:#fff}.ActionButton.primary,.ActionButton.secondary,.HeaderHero .tagline{color:var(--current-color,#fff)}.twitter-follow-button .icon{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 72'%3E%3Cpath fill='none' d='M0 0h72v72H0z'/%3E%3Cpath class='icon' fill='%23fff' d='M68.812 15.14a26.189 26.189 0 0 1-7.52 2.06 13.125 13.125 0 0 0 5.757-7.243 26.133 26.133 0 0 1-8.314 3.176A13.066 13.066 0 0 0 49.182 9c-7.23 0-13.092 5.86-13.092 13.093 0 1.026.118 2.02.338 2.98C25.543 24.527 15.9 19.318 9.44 11.396a13.057 13.057 0 0 0-1.77 6.58c0 4.543 2.312 8.552 5.824 10.9a13.05 13.05 0 0 1-5.93-1.64c-.002.056-.002.11-.002.163 0 6.345 4.513 11.638 10.504 12.84-1.1.298-2.256.457-3.45.457-.845 0-1.666-.078-2.464-.23 1.667 5.2 6.5 8.985 12.23 9.09a26.29 26.29 0 0 1-16.26 5.605c-1.055 0-2.096-.06-3.122-.184a37.036 37.036 0 0 0 20.067 5.882c24.083 0 37.25-19.95 37.25-37.25 0-.565-.013-1.133-.038-1.693a26.61 26.61 0 0 0 6.532-6.774z'/%3E%3C/svg%3E") no-repeat;display:inline-block;height:18px;margin-right:4px;position:relative;top:4px;width:18px}.HeaderHero{background:#eae6ff;display:flex}.HeaderHero svg{color:#503a98}html[data-theme=dark] .HeaderHero{background:none}.HeaderHero .titleContainer{display:flex;flex-flow:column nowrap;margin:auto}.HeaderHero .title{font-size:85px;font-weight:100;line-height:1;margin:0 auto auto}.HeaderHero .tagline{font-weight:400;line-height:1.3;margin:12px;max-width:660px;text-align:center}.HeaderHero .buttons{margin:20px auto 12px}.HeaderHero .image{align-items:center;display:flex;justify-content:center}.ActionButton{max-width:50%;border-bottom:none;font-size:1.25rem;font-weight:400;padding:.82rem 1.5rem;text-align:center;text-decoration:none!important;transition:border .4s,background-color .4s}.ActionButton.primary{background-color:transparent;border:1px solid var(--current-color,#fff);border-radius:14px}html[data-theme=dark] .ActionButton.primary{background-color:rgba(135,137,255,.071);border-color:hsla(0,0%,100%,.25)}html[data-theme=dark] .ActionButton.primary:hover{background-color:rgba(135,137,255,.133);border-color:hsla(0,0%,100%,.35)}.ActionButton.secondary:after{content:"›";font-size:24px;margin-left:5px}html[data-theme=light] .HeaderHero{--current-color:#000}.NativeCode .prism-code{border-radius:0;font-size:80%;height:100%;background:0 0}.prism-code{background:var(--deepdark);font-size:15px}.theme-code-block{background-color:#1a1a2c!important}html[data-theme=light] .NativeCode.corner .prism-code{border-top-left-radius:18px;box-shadow:-20px -20px 0 0 #fff}.NativeApps{background-color:#1f1e42}.FeatureSection{display:flex;font-size:16px;margin:0 auto;max-width:870px}.FeatureSection ul{align-items:center;cursor:default;display:flex;flex-flow:row wrap;justify-content:center;list-style-type:none;margin-bottom:0;padding-left:0}.FeatureSection li{background:rgba(33,33,80,.631);border:1px solid hsla(0,0%,100%,.267);border-radius:14px;color:hsla(0,0%,100%,.6);display:inline-block;font-size:17px;list-style-type:none;margin:6px;padding:9px 21px}.FeatureSection li:hover{border-color:hsla(0,0%,100%,.6);color:#fff}::-moz-selection{background:rgba(100,57,255,.25)}::selection{background:rgba(100,57,255,.25)}html[data-theme=dark] ::-moz-selection{background:rgba(102,39,202,.733)}html[data-theme=dark] ::selection{background:rgba(102,39,202,.733)}.react-toggle .react-toggle-thumb{box-shadow:none!important}.tablist{display:flex;flex-flow:row wrap;justify-content:center;margin:auto auto 4px}.github-star,.tablist button{align-items:center;display:flex}.tablist button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;border:none;border-radius:8px;color:var(--current-color,#fff);flex-direction:row;font-family:var(--ifm-font-family-base);font-size:19px;gap:8px;margin:0 8px;padding:4px 8px}.tablist button div{display:flex;width:30px}.feature-columns{display:flex;flex-wrap:wrap;margin:auto;max-width:900px}.feature-columns>*{flex:1;margin:0 12px;min-width:270px}.feature-columns .chakra-stack{position:relative}.feature-columns .css-1rtuhur{left:-30px;position:absolute;top:5px}html[data-theme=dark] .Section p{color:rgba(215,214,255,.88)}html[data-theme=dark] .menu__link{color:rgba(217,220,255,.573)}.github-star{border-radius:25px;flex-direction:row;font-size:15px;gap:10px;justify-content:flex-end;width:100%;opacity:.82}.github-star:hover{opacity:1}body:not(.navigation-with-keyboard) :not(input):focus{outline:0}.skipToContent_fXgn{background-color:var(--ifm-background-surface-color);color:var(--ifm-color-emphasis-900);left:100%;padding:calc(var(--ifm-global-spacing)/2) var(--ifm-global-spacing);position:fixed;top:1rem;z-index:calc(var(--ifm-z-index-fixed) + 1)}.skipToContent_fXgn:focus{box-shadow:var(--ifm-global-shadow-md);left:1rem}.closeButton_CVFx{line-height:0;padding:0}.content_knG7{font-size:85%;padding:5px 0;text-align:center}.content_knG7 a{color:inherit}.DocSearch-Container a,.tag_zVej:hover{text-decoration:none}.announcementBar_mb4j{align-items:center;background-color:var(--ifm-color-white);border-bottom:1px solid var(--ifm-color-emphasis-100);color:var(--ifm-color-black);display:flex;height:var(--docusaurus-announcement-bar-height)}.announcementBarPlaceholder_vyr4{flex:0 0 10px}.announcementBarClose_gvF7{align-self:stretch;flex:0 0 30px}.announcementBarContent_xLdY{flex:1 1 auto}.toggle_vylO{height:2rem;width:2rem}.toggleButton_gllP{align-items:center;border-radius:50%;display:flex;height:100%;justify-content:center;transition:background var(--ifm-transition-fast);width:100%}.toggleButton_gllP:hover{background:var(--ifm-color-emphasis-200)}.toggleButtonDisabled_aARS{cursor:not-allowed}.darkNavbarColorModeToggle_X3D1:hover{background:var(--ifm-color-gray-800)}[data-theme=dark] .themedComponent--dark_xIcU,[data-theme=light] .themedComponent--light_NVdE,html:not([data-theme]) .themedComponent--light_NVdE{display:initial}.iconExternalLink_nPIU{margin-left:.3rem}.dropdownNavbarItemMobile_S0Fm{cursor:pointer}.iconLanguage_nlXk{margin-right:5px;vertical-align:text-bottom}@supports selector(:has(*)){.navbarSearchContainer_Bca1:not(:has(>*)){display:none}}.navbarHideable_m1mJ{transition:transform var(--ifm-transition-fast) ease}.navbarHidden_jGov{transform:translate3d(0,calc(-100% - 2px),0)}.errorBoundaryError_a6uf{color:red;white-space:pre-wrap}.errorBoundaryFallback_VBag{color:red;padding:.55rem}.footerLogoLink_BH7S{opacity:.5;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.anchorWithStickyNavbar_LWe7{scroll-margin-top:calc(var(--ifm-navbar-height) + .5rem)}.anchorWithHideOnScrollNavbar_WYt5{scroll-margin-top:.5rem}.hash-link{opacity:0;padding-left:.5rem;transition:opacity var(--ifm-transition-fast);user-select:none}.DocSearch-Button,.DocSearch-Help{-webkit-user-select:none;-moz-user-select:none}.hash-link:before{content:"#"}.mainWrapper_z2l0{display:flex;flex:1 0 auto;flex-direction:column}.docusaurus-mt-lg{margin-top:3rem}#__docusaurus{display:flex;flex-direction:column;min-height:100%}.iconEdit_Z9Sw{margin-right:.3em;vertical-align:sub}.tag_zVej{border:1px solid var(--docusaurus-tag-list-border);transition:border var(--ifm-transition-fast)}.tag_zVej:hover{--docusaurus-tag-list-border:var(--ifm-link-color)}.tagRegular_sFm0{border-radius:var(--ifm-global-radius);font-size:90%;padding:.2rem .5rem .3rem}.tagWithCount_h2kH{align-items:center;border-left:0;display:flex;padding:0 .5rem 0 1rem;position:relative}.tagWithCount_h2kH:after,.tagWithCount_h2kH:before{border:1px solid var(--docusaurus-tag-list-border);content:"";position:absolute;top:50%;transition:inherit}.tagWithCount_h2kH:before{border-bottom:0;border-right:0;height:1.18rem;right:100%;transform:translate(50%,-50%) rotate(-45deg);width:1.18rem}.tagWithCount_h2kH:after{border-radius:50%;height:.5rem;left:0;transform:translateY(-50%);width:.5rem}.tagWithCount_h2kH span{background:var(--ifm-color-secondary);border-radius:var(--ifm-global-radius);color:var(--ifm-color-black);font-size:.7rem;line-height:1.2;margin-left:.3rem;padding:.1rem .4rem}.tags_jXut{display:inline}.tag_QGVx{display:inline-block;margin:0 .4rem .5rem 0}.lastUpdated_vwxv{font-size:smaller;font-style:italic;margin-top:.2rem}.tocCollapsibleButton_TO0P{align-items:center;display:flex;font-size:inherit;justify-content:space-between;padding:.4rem .8rem;width:100%}.tocCollapsibleButton_TO0P:after{background:var(--ifm-menu-link-sublist-icon) 50% 50%/2rem 2rem no-repeat;content:"";filter:var(--ifm-menu-link-sublist-icon-filter);height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast);width:1.25rem}.tocCollapsibleButtonExpanded_MG3E:after,.tocCollapsibleExpanded_sAul{transform:none}.tocCollapsible_ETCw{background-color:var(--ifm-menu-color-background-active);border-radius:var(--ifm-global-radius);margin:1rem 0}.buttonGroup__atx button,.codeBlockContainer_Ckt0{background:var(--prism-background-color);color:var(--prism-color)}.tocCollapsibleContent_vkbj>ul{border-left:none;border-top:1px solid var(--ifm-color-emphasis-300);font-size:15px;padding:.2rem 0}.tocCollapsibleContent_vkbj ul li{margin:.4rem .8rem}.tocCollapsibleContent_vkbj a{display:block}.tableOfContents_bqdL{max-height:calc(100vh - var(--ifm-navbar-height) - 2rem);overflow-y:auto;position:sticky;top:calc(var(--ifm-navbar-height) + 1rem)}.codeBlockContainer_Ckt0{border-radius:var(--ifm-code-border-radius);box-shadow:var(--ifm-global-shadow-lw);margin-bottom:var(--ifm-leading)}.codeBlockContent_biex{border-radius:inherit;direction:ltr;position:relative}.codeBlockTitle_Ktv7{border-bottom:1px solid var(--ifm-color-emphasis-300);border-top-left-radius:inherit;border-top-right-radius:inherit;font-size:var(--ifm-code-font-size);font-weight:500;padding:.75rem var(--ifm-pre-padding)}.codeBlock_bY9V{--ifm-pre-background:var(--prism-background-color);margin:0;padding:0}.codeBlockTitle_Ktv7+.codeBlockContent_biex .codeBlock_bY9V{border-top-left-radius:0;border-top-right-radius:0}.codeBlockLines_e6Vv{float:left;font:inherit;min-width:100%;padding:var(--ifm-pre-padding)}.codeBlockLinesWithNumbering_o6Pm{display:table;padding:var(--ifm-pre-padding) 0}.buttonGroup__atx{-moz-column-gap:.2rem;column-gap:.2rem;display:flex;position:absolute;right:calc(var(--ifm-pre-padding)/2);top:calc(var(--ifm-pre-padding)/2)}.buttonGroup__atx button{align-items:center;border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-global-radius);display:flex;line-height:0;opacity:0;padding:.4rem;transition:opacity var(--ifm-transition-fast) ease-in-out}.buttonGroup__atx button:focus-visible,.buttonGroup__atx button:hover{opacity:1!important}.theme-code-block:hover .buttonGroup__atx button{opacity:.4}:where(:root){--docusaurus-highlighted-code-line-bg:#484d5b}:where([data-theme=dark]){--docusaurus-highlighted-code-line-bg:#646464}.theme-code-block-highlighted-line{background-color:var(--docusaurus-highlighted-code-line-bg);display:block;margin:0 calc(var(--ifm-pre-padding)*-1);padding:0 var(--ifm-pre-padding)}.codeLine_lJS_{counter-increment:a;display:table-row}.codeLineNumber_Tfdd{background:var(--ifm-pre-background);display:table-cell;left:0;overflow-wrap:normal;padding:0 var(--ifm-pre-padding);position:sticky;text-align:right;width:1%}.codeLineNumber_Tfdd:before{content:counter(a);opacity:.4}.codeLineContent_feaV{padding-right:var(--ifm-pre-padding)}.theme-code-block:hover .copyButtonCopied_obH4{opacity:1!important}.copyButtonIcons_eSgA{height:1.125rem;position:relative;width:1.125rem}.copyButtonIcon_y97N,.copyButtonSuccessIcon_LjdS{fill:currentColor;height:inherit;left:0;opacity:inherit;position:absolute;top:0;transition:all var(--ifm-transition-fast) ease;width:inherit}.copyButtonSuccessIcon_LjdS{color:#00d600;left:50%;opacity:0;top:50%;transform:translate(-50%,-50%) scale(.33)}.copyButtonCopied_obH4 .copyButtonIcon_y97N{opacity:0;transform:scale(.33)}.copyButtonCopied_obH4 .copyButtonSuccessIcon_LjdS{opacity:1;transform:translate(-50%,-50%) scale(1);transition-delay:75ms}.wordWrapButtonIcon_Bwma{height:1.2rem;width:1.2rem}.details_lb9f{--docusaurus-details-summary-arrow-size:0.38rem;--docusaurus-details-transition:transform 200ms ease;--docusaurus-details-decoration-color:grey}.details_lb9f>summary{cursor:pointer;list-style:none;padding-left:1rem;position:relative}.details_lb9f>summary::-webkit-details-marker{display:none}.details_lb9f>summary:before{border-color:transparent transparent transparent var(--docusaurus-details-decoration-color);border-style:solid;border-width:var(--docusaurus-details-summary-arrow-size);content:"";left:0;position:absolute;top:.45rem;transform:rotate(0);transform-origin:calc(var(--docusaurus-details-summary-arrow-size)/2) 50%;transition:var(--docusaurus-details-transition)}.collapsibleContent_i85q{border-top:1px solid var(--docusaurus-details-decoration-color);margin-top:1rem;padding-top:1rem}.details_b_Ee{--docusaurus-details-decoration-color:var(--ifm-alert-border-color);--docusaurus-details-transition:transform var(--ifm-transition-fast) ease;border:1px solid var(--ifm-alert-border-color);margin:0 0 var(--ifm-spacing-vertical)}:not(.containsTaskList_mC6p>li)>.containsTaskList_mC6p{padding-left:0}.img_ev3q{height:auto}.admonition_xJq3{margin-bottom:1em}.admonitionHeading_Gvgb{font:var(--ifm-heading-font-weight) var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family)}.admonitionHeading_Gvgb:not(:last-child){margin-bottom:.3rem}.admonitionHeading_Gvgb code{text-transform:none}.admonitionIcon_Rf37{display:inline-block;margin-right:.4em;vertical-align:middle}.admonitionIcon_Rf37 svg{fill:var(--ifm-alert-foreground-color);display:inline-block;height:1.6em;width:1.6em}.breadcrumbHomeIcon_YNFT{height:1.1rem;position:relative;top:1px;vertical-align:top;width:1.1rem}.breadcrumbsContainer_Z_bl{--ifm-breadcrumb-size-multiplier:0.8;margin-bottom:.8rem}.searchQueryInput_u2C7,.searchVersionInput_m0Ui{background:var(--docsearch-searchbox-focus-background);border:2px solid var(--ifm-toc-border-color);border-radius:var(--ifm-global-radius);color:var(--docsearch-text-color);font:var(--ifm-font-size-base) var(--ifm-font-family-base);margin-bottom:.5rem;padding:.8rem;transition:border var(--ifm-transition-fast) ease;width:100%}.searchQueryInput_u2C7:focus,.searchVersionInput_m0Ui:focus{border-color:var(--docsearch-primary-color);outline:0}.searchQueryInput_u2C7::-moz-placeholder{color:var(--docsearch-muted-color)}.searchQueryInput_u2C7::placeholder{color:var(--docsearch-muted-color)}.searchResultsColumn_JPFH{font-size:.9rem;font-weight:700}.algoliaLogo_rT1R{max-width:150px}.algoliaLogoPathFill_WdUC{fill:var(--ifm-font-color-base)}.searchResultItem_Tv2o{border-bottom:1px solid var(--ifm-toc-border-color);padding:1rem 0}.searchResultItemHeading_KbCB{font-weight:400;margin-bottom:0}.searchResultItemPath_lhe1{--ifm-breadcrumb-separator-size-multiplier:1;color:var(--ifm-color-content-secondary);font-size:.8rem}.searchResultItemSummary_AEaO{font-style:italic;margin:.5rem 0 0}.loadingSpinner_XVxU{animation:1s linear infinite e;border:.4em solid #eee;border-radius:50%;border-top:.4em solid var(--ifm-color-primary);height:3rem;margin:0 auto;width:3rem}@keyframes e{to{transform:rotate(1turn)}}.loader_vvXV{margin-top:2rem}.search-result-match{background:rgba(255,215,142,.25);color:var(--docsearch-hit-color);padding:.09em 0}.backToTopButton_sjWU{background-color:var(--ifm-color-emphasis-200);border-radius:50%;bottom:1.3rem;box-shadow:var(--ifm-global-shadow-lw);height:3rem;opacity:0;position:fixed;right:1.3rem;transform:scale(0);transition:all var(--ifm-transition-fast) var(--ifm-transition-timing-default);visibility:hidden;width:3rem;z-index:calc(var(--ifm-z-index-fixed) - 1)}.backToTopButton_sjWU:after{background-color:var(--ifm-color-emphasis-1000);content:" ";display:inline-block;height:100%;-webkit-mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;width:100%}.backToTopButtonShow_xfvO{opacity:1;transform:scale(1);visibility:visible}[data-theme=dark]:root{--docusaurus-collapse-button-bg:hsla(0,0%,100%,.05);--docusaurus-collapse-button-bg-hover:hsla(0,0%,100%,.1)}.collapseSidebarButton_PEFL{display:none;margin:0}.docSidebarContainer_YfHR,.sidebarLogo_isFc{display:none}.docMainContainer_TBSr,.docRoot_UBD9{display:flex;width:100%}.docsWrapper_hBAB{display:flex;flex:1 0 auto}.DocSearch-Button,.DocSearch-Button-Container{align-items:center;display:flex}.DocSearch-Button{background:var(--docsearch-searchbox-background);border:0;border-radius:40px;color:var(--docsearch-muted-color);cursor:pointer;font-weight:500;height:36px;justify-content:space-between;padding:0 8px;user-select:none}.DocSearch-Button:active,.DocSearch-Button:focus,.DocSearch-Button:hover{background:var(--docsearch-searchbox-focus-background);box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:0}.DocSearch-Search-Icon{stroke-width:1.6}.DocSearch-Hit-Tree,.DocSearch-Hit-action,.DocSearch-Hit-icon,.DocSearch-Reset{stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Button .DocSearch-Search-Icon{color:var(--docsearch-text-color)}.DocSearch-Button-Placeholder{font-size:1rem;padding:0 12px 0 6px}.DocSearch-Input,.DocSearch-Link{-webkit-appearance:none;-moz-appearance:none;font:inherit}.DocSearch-Button-Keys{display:flex;min-width:calc(40px + .8em)}.DocSearch-Button-Key{align-items:center;background:var(--docsearch-key-gradient);border:0;border-radius:3px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 2px;position:relative;top:-1px;width:20px}.DocSearch--active{overflow:hidden!important}.DocSearch-Container{background-color:var(--docsearch-container-background);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:200}.DocSearch-Link{appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;margin:0;padding:0}.DocSearch-Modal{background:var(--docsearch-modal-background);border-radius:6px;box-shadow:var(--docsearch-modal-shadow);flex-direction:column;margin:60px auto auto;max-width:var(--docsearch-modal-width);position:relative}.DocSearch-SearchBar{display:flex;padding:var(--docsearch-spacing) var(--docsearch-spacing) 0}.DocSearch-Form{align-items:center;background:var(--docsearch-searchbox-focus-background);border-radius:4px;box-shadow:var(--docsearch-searchbox-shadow);display:flex;height:var(--docsearch-searchbox-height);margin:0;padding:0 var(--docsearch-spacing);position:relative;width:100%}.DocSearch-Input{appearance:none;background:0 0;border:0;color:var(--docsearch-text-color);flex:1;font-size:1.2em;height:100%;outline:0;padding:0 0 0 8px;width:80%}.DocSearch-Hit-action-button,.DocSearch-Reset{-webkit-appearance:none;-moz-appearance:none;border:0;cursor:pointer}.DocSearch-Input::-moz-placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::-webkit-search-cancel-button,.DocSearch-Input::-webkit-search-decoration,.DocSearch-Input::-webkit-search-results-button,.DocSearch-Input::-webkit-search-results-decoration{display:none}.DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{margin:0;padding:0}.DocSearch-Container--Stalled .DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}.DocSearch-Cancel,.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,.DocSearch-LoadingIndicator,.DocSearch-Reset[hidden]{display:none}.DocSearch-Reset{animation:.1s ease-in forwards f;appearance:none;background:none;border-radius:50%;color:var(--docsearch-icon-color);padding:2px;right:0}.DocSearch-Help,.DocSearch-HitsFooter,.DocSearch-Label{color:var(--docsearch-muted-color)}.DocSearch-Reset:hover{color:var(--docsearch-highlight-color)}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{height:24px;width:24px}.DocSearch-Dropdown{max-height:calc(var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));min-height:var(--docsearch-spacing);overflow-y:auto;overflow-y:overlay;padding:0 var(--docsearch-spacing);scrollbar-color:var(--docsearch-muted-color) var(--docsearch-modal-background);scrollbar-width:thin}.DocSearch-Dropdown::-webkit-scrollbar{width:12px}.DocSearch-Dropdown::-webkit-scrollbar-track{background:0 0}.DocSearch-Dropdown::-webkit-scrollbar-thumb{background-color:var(--docsearch-muted-color);border:3px solid var(--docsearch-modal-background);border-radius:20px}.DocSearch-Dropdown ul{list-style:none;margin:0;padding:0}.DocSearch-Label{font-size:.75em;line-height:1.6em}.DocSearch-Help{font-size:.9em;margin:0;user-select:none}.DocSearch-Title{font-size:1.2em}.DocSearch-Logo a{display:flex}.DocSearch-Logo svg{color:var(--docsearch-logo-color);margin-left:8px}.DocSearch-Hits:last-of-type{margin-bottom:24px}.DocSearch-Hits mark{background:none;color:var(--docsearch-highlight-color)}.DocSearch-HitsFooter{display:flex;font-size:.85em;justify-content:center;margin-bottom:var(--docsearch-spacing);padding:var(--docsearch-spacing)}.DocSearch-HitsFooter a{border-bottom:1px solid;color:inherit}.DocSearch-Hit{border-radius:4px;display:flex;padding-bottom:4px;position:relative}.DocSearch-Hit--deleting{opacity:0;transition:.25s linear}.DocSearch-Hit--favoriting{transform:scale(0);transform-origin:top center;transition:.25s linear .25s}.DocSearch-Hit a{background:var(--docsearch-hit-background);border-radius:4px;box-shadow:var(--docsearch-hit-shadow);display:block;padding-left:var(--docsearch-spacing);width:100%}.DocSearch-Hit-source{background:var(--docsearch-modal-background);color:var(--docsearch-highlight-color);font-size:.85em;font-weight:600;line-height:32px;margin:0 -4px;padding:8px 4px 0;position:sticky;top:0;z-index:10}.DocSearch-Hit-Tree{color:var(--docsearch-muted-color);height:var(--docsearch-hit-height);opacity:.5;width:24px}.DocSearch-Hit[aria-selected=true] a{background-color:var(--docsearch-highlight-color)}.DocSearch-Hit[aria-selected=true] mark{text-decoration:underline}.DocSearch-Hit-Container{align-items:center;color:var(--docsearch-hit-color);display:flex;flex-direction:row;height:var(--docsearch-hit-height);padding:0 var(--docsearch-spacing) 0 0}.DocSearch-Hit-icon{height:20px;width:20px}.DocSearch-Hit-action,.DocSearch-Hit-icon{color:var(--docsearch-muted-color)}.DocSearch-Hit-action{align-items:center;display:flex;height:22px;width:22px}.DocSearch-Hit-action svg{display:block;height:18px;width:18px}.DocSearch-Hit-action+.DocSearch-Hit-action{margin-left:6px}.DocSearch-Hit-action-button{appearance:none;background:none;border-radius:50%;color:inherit;padding:2px}svg.DocSearch-Hit-Select-Icon{display:none}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Select-Icon{display:block}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:rgba(0,0,0,.2);transition:background-color .1s ease-in}.DocSearch-Hit-action-button:focus path,.DocSearch-Hit-action-button:hover path{fill:#fff}.DocSearch-Hit-content-wrapper{display:flex;flex:1 1 auto;flex-direction:column;font-weight:500;justify-content:center;line-height:1.2em;margin:0 8px;overflow-x:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:80%}.DocSearch-Hit-title{font-size:.9em}.DocSearch-Hit-path{color:var(--docsearch-muted-color);font-size:.75em}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-action,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-icon,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-text,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-title,.DocSearch-Hit[aria-selected=true] mark{color:var(--docsearch-hit-active-color)!important}.DocSearch-ErrorScreen,.DocSearch-NoResults,.DocSearch-StartScreen{font-size:.9em;margin:0 auto;padding:36px 0;text-align:center;width:80%}.DocSearch-Screen-Icon{color:var(--docsearch-muted-color);padding-bottom:12px}.DocSearch-NoResults-Prefill-List{display:inline-block;padding-bottom:24px;text-align:left}.DocSearch-NoResults-Prefill-List ul{display:inline-block;padding:8px 0 0}.DocSearch-NoResults-Prefill-List li{list-style-position:inside;list-style-type:"» "}.DocSearch-Prefill{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:1em;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;font-size:1em;font-weight:700;padding:0}.DocSearch-Prefill:focus,.DocSearch-Prefill:hover{outline:0;text-decoration:underline}.DocSearch-Footer{align-items:center;background:var(--docsearch-footer-background);border-radius:0 0 8px 8px;box-shadow:var(--docsearch-footer-shadow);display:flex;flex-direction:row-reverse;flex-shrink:0;height:var(--docsearch-footer-height);justify-content:space-between;padding:0 var(--docsearch-spacing);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:300}.DocSearch-Commands{color:var(--docsearch-muted-color);display:flex;list-style:none;margin:0;padding:0}.DocSearch-Commands li{align-items:center;display:flex}.DocSearch-Commands li:not(:last-of-type){margin-right:.8em}.DocSearch-Commands-Key{align-items:center;background:var(--docsearch-key-gradient);border:0;border-radius:2px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 1px;width:20px}@keyframes f{0%{opacity:0}to{opacity:1}}.DocSearch-Button{margin:0;transition:all var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.DocSearch-Container{z-index:calc(var(--ifm-z-index-fixed) + 1)}@media only screen and (min-width:481px)and (max-width:960px){.Community .Heading{margin-bottom:1.5rem;padding:0 4rem;width:100%}.Community .AppList{margin:2rem auto;max-width:500px;width:100%}.CrossPlatform .column.last{margin:0 auto;text-align:center;width:86%}.FastRefresh .TwoColumns{grid-gap:2rem}.FastRefresh .column.last{padding:0;width:100%}.FastRefresh video{width:100%}.HeaderHero .column.first{display:flex;justify-content:center}.HeaderHero .column.last{text-align:center}.NativeApps .column.last{margin:0 auto;width:66.7%}.NativeDevelopment .dissection{height:450px}}@media screen and (min-width:481px)and (max-width:960px){.NativeCode .TwoColumns{grid-gap:.5rem}.NativeCode .column.last{overflow-y:auto;padding:0;width:100%}.NativeCode .prism-code{margin:0 auto;padding-bottom:1.5rem;width:30rem}}@media only screen and (min-width:540px)and (max-width:996px){.docMetadata .col{flex-basis:50%!important;max-width:50%!important}}@media only screen and (min-width:768px){article .component-grid.component-grid-border{border-bottom:1px solid var(--ifm-table-border-color)}article .component{height:150px;margin:0 22px 22px auto;vertical-align:top;width:30%}@supports(display:grid){article .component-grid{grid-template-columns:repeat(2,1fr)}@media only screen and (min-width:768px)and (min-width:1440px){article .component-grid{grid-template-columns:repeat(3,1fr)}}article .component{height:auto;margin:0;width:auto}}}@media only screen and (min-width:768px)and (min-width:1440px){article .component-grid{grid-template-columns:repeat(3,1fr)}}@media only screen and (min-width:961px){.Community .column.first{border-right:1px solid var(--ifm-table-border-color)}.FastRefresh .TwoColumns{grid-template-columns:2fr 1fr}.FastRefresh .last,.NativeApps .column.left{margin-top:-39px}.FastRefresh video{height:340px}.HeaderHero .TwoColumns{grid-template-columns:3fr 1fr}.HeaderHero .TwoColumns .column.left{padding-right:0}.HeaderHero .TwoColumns .column.right{padding-left:0}.NativeApps{max-height:400px}.NativeCode .TwoColumns .column.right{display:flex;margin-top:-39px;padding-left:0}.NativeCode .column.right .prism-code{margin-right:-9999px;max-height:410px}.NativeDevelopment .dissection{height:300px}.Talks .TwoColumns{grid-template-columns:1fr 2fr}.Talks iframe{height:315px;width:560px}.TwoColumns{grid-template-areas:"c d";grid-template-columns:repeat(2,1fr);margin:0 auto;max-width:900px}.TwoColumns.reverse{grid-template-areas:"d c"}.TwoColumns .column{max-width:450px}.TwoColumns .column.left{padding-right:39px}html[data-theme=light] .NativeCode .prism-code{background:#1f1e42;box-shadow:inset 0 2px 0 -1px hsla(0,0%,100%,.08)}html[data-theme=light] .NativeCode.tint .prism-code{background:#1b1c3b}}@media (min-width:997px){.collapseSidebarButton_PEFL,.expandButton_TmdG{background-color:var(--docusaurus-collapse-button-bg)}:root{--docusaurus-announcement-bar-height:30px}.announcementBarClose_gvF7,.announcementBarPlaceholder_vyr4{flex-basis:50px}.navbarSearchContainer_Bca1{padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.lastUpdated_vwxv{text-align:right}.tocMobile_ITEo{display:none}.docItemCol_VOVn{max-width:75%!important}.collapseSidebarButton_PEFL{border:1px solid var(--ifm-toc-border-color);border-radius:0;bottom:0;display:block!important;height:40px;position:sticky}.collapseSidebarButtonIcon_kv0_{margin-top:4px;transform:rotate(180deg)}.expandButtonIcon_i1dp,[dir=rtl] .collapseSidebarButtonIcon_kv0_{transform:rotate(0)}.collapseSidebarButton_PEFL:focus,.collapseSidebarButton_PEFL:hover,.expandButton_TmdG:focus,.expandButton_TmdG:hover{background-color:var(--docusaurus-collapse-button-bg-hover)}.menuHtmlItem_M9Kj{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu_SIkG{flex-grow:1;padding:.5rem}@supports (scrollbar-gutter:stable){.menu_SIkG{padding:.5rem 0 .5rem .5rem;scrollbar-gutter:stable}}.menuWithAnnouncementBar_GW3s{margin-bottom:var(--docusaurus-announcement-bar-height)}.sidebar_njMd{display:flex;flex-direction:column;height:100%;padding-top:var(--ifm-navbar-height);width:var(--doc-sidebar-width)}.sidebarWithHideableNavbar_wUlq{padding-top:0}.sidebarHidden_VK0M{opacity:0;visibility:hidden}.sidebarLogo_isFc{align-items:center;color:inherit!important;display:flex!important;margin:0 var(--ifm-navbar-padding-horizontal);max-height:var(--ifm-navbar-height);min-height:var(--ifm-navbar-height);text-decoration:none!important}.sidebarLogo_isFc img{height:2rem;margin-right:.5rem}.expandButton_TmdG{align-items:center;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;transition:background-color var(--ifm-transition-fast) ease;width:100%}[dir=rtl] .expandButtonIcon_i1dp{transform:rotate(180deg)}.docSidebarContainer_YfHR{border-right:1px solid var(--ifm-toc-border-color);-webkit-clip-path:inset(0);clip-path:inset(0);display:block;margin-top:calc(var(--ifm-navbar-height)*-1);transition:width var(--ifm-transition-fast) ease;width:var(--doc-sidebar-width);will-change:width}.docSidebarContainerHidden_DPk8{cursor:pointer;width:var(--doc-sidebar-hidden-width)}.sidebarViewport_aRkj{height:100%;max-height:100vh;position:sticky;top:0}.docMainContainer_TBSr{flex-grow:1;max-width:calc(100% - var(--doc-sidebar-width))}.docMainContainerEnhanced_lQrH{max-width:calc(100% - var(--doc-sidebar-hidden-width))}.docItemWrapperEnhanced_JWYK{max-width:calc(var(--ifm-container-width) + var(--doc-sidebar-width))!important}}@media only screen and (min-width:997px){div[class^=docSidebarContainer] .menu{padding:12px}}@media (min-width:1440px){.container{max-width:var(--ifm-container-width-xl)}}@media (max-width:1416px){.main-wrapper{max-width:100%;width:100%}}@media (max-width:1320px)and (min-width:997px){.container{max-width:calc(var(--ifm-container-width) - 139px - var(--ifm-spacing-horizontal)*2)}}@media only screen and (max-width:1120px){div[class^=docSidebarContainer]{min-width:276px;width:276px}}@media (max-width:1080px){.navbar .DocSearch-Button{padding:0 12px}.navbar .DocSearch-Button-Key,.navbar .DocSearch-Button-KeySeparator,.navbar .DocSearch-Button-Placeholder{display:none}}@media (max-width:996px){.col{--ifm-col-width:100%;flex-basis:var(--ifm-col-width);margin-left:0}.footer{--ifm-footer-padding-horizontal:0}.colorModeToggle_DEke,.footer__link-separator,.navbar__item,.tableOfContents_bqdL{display:none}.footer__col{margin-bottom:calc(var(--ifm-spacing-vertical)*3)}.footer__link-item{display:block}.hero{padding-left:0;padding-right:0}.navbar>.container,.navbar>.container-fluid{padding:0}.navbar__toggle{display:inherit}.navbar__search-input{width:9rem}.pills--block,.tabs--block{flex-direction:column}.navbarSearchContainer_Bca1{position:absolute;right:var(--ifm-navbar-padding-horizontal)}.docItemContainer_F8PC{padding:0 .3rem}}@media only screen and (max-width:996px){.footer .footer__col{flex-basis:48%!important;margin-bottom:28px;max-width:48%!important;text-align:center}.footer .footer__links{padding:0 20px}.docsRating{border-radius:var(--ifm-global-radius);margin:36px 0 0!important;width:100%}.two-columns{gap:0;grid-template-areas:"." ".";grid-template-columns:1fr;grid-template-rows:1fr 1fr}.container.margin-vert--lg .row .col.col--2{display:none}.container.margin-vert--lg .row .col.col--8{--ifm-col-width:100%!important}.searchQueryColumn_RTkw,.searchResultsColumn_JPFH{max-width:60%!important}.searchLogoColumn_rJIA,.searchVersionColumn_ypXd{max-width:40%!important}.searchLogoColumn_rJIA{padding-left:0!important}}@media only screen and (max-width:960px){.Section.demo>div{flex-direction:column;gap:0}.Section.demo .column{margin:0 60px}.code-demo-container{margin:30px}.CrossPlatform .TwoColumns,.NativeDevelopment .TwoColumns,.Talks .TwoColumns{grid-gap:2rem}.CrossPlatform svg{margin:0 auto;max-width:100%}.NativeApps .column.last{max-height:300px}.Talks .column.last{display:flex;justify-content:center;width:100%}.Talks .vidWrapper{padding-top:56.25%;position:relative;width:100%}.Talks iframe{height:100%;left:0;position:absolute;top:0;width:100%}.TwoColumns,.TwoColumns.reverse{grid-template-areas:"c" "d";grid-template-columns:1fr}.TwoColumns .column{padding:0 4rem}.feature-columns{flex-direction:column;margin:0 50px}}@media (max-width:768px){.DocSearch-Button-Keys,.DocSearch-Button-Placeholder,.DocSearch-Commands,.DocSearch-Hit-Tree{display:none}:root{--docsearch-spacing:10px;--docsearch-footer-height:40px}.DocSearch-Dropdown{height:100%;max-height:calc(var(--docsearch-vh,1vh)*100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height))}.DocSearch-Container{height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh,1vh)*100);position:absolute}.DocSearch-Footer{border-radius:0;bottom:0;position:absolute}.DocSearch-Hit-content-wrapper{display:flex;position:relative;width:80%}.DocSearch-Modal{border-radius:0;box-shadow:none;height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh,1vh)*100);margin:0;max-width:100%;width:100%}.DocSearch-Cancel{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;flex:none;font:inherit;font-size:1em;font-weight:500;margin-left:var(--docsearch-spacing);outline:0;overflow:hidden;padding:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}}@media only screen and (max-width:768px){.announcement{font-size:18px}}@media only screen and (max-width:760px){.HeaderHero .outer-container{transform:scale(.85)}.HeaderHero .title{font-size:60px}.LogoAnimation{width:100%}.HeaderHero .tagline{text-wrap:balance}}@media screen and (max-width:760px){.GetStarted .content{width:80%}.GetStarted .steps li{margin-left:-1rem}.GetStarted .terminal{width:100%}}@media only screen and (max-width:600px){.Section.demo .column{margin:0 30px}.controls-container{zoom:.9;padding-right:0}.HeaderHero .outer-container{transform:scale(.8)}.HeaderHero .tagline{font-size:23px}.NativeCode .prism-code{font-size:12px}.FeatureSection{font-size:12px;margin:0 32px}.FeatureSection li{margin:3px;padding:6px 14px}.tablist button{font-size:16px;margin:0 5px}.tablist button div{width:27px}.HeaderHero .title{margin-bottom:-10px;margin-top:-35px}}@media (max-width:576px){.markdown h1:first-child{--ifm-h1-font-size:2rem}.markdown>h2{--ifm-h2-font-size:1.5rem}.markdown>h3{--ifm-h3-font-size:1.25rem}}@media screen and (max-width:576px){.searchQueryColumn_RTkw{max-width:100%!important}.searchVersionColumn_ypXd{max-width:100%!important;padding-left:var(--ifm-spacing-horizontal)!important}}@media only screen and (max-width:539px){.docMetadata .col{text-align:center}.docMetadata .col:first-child{margin-bottom:16px}}@media only screen and (max-width:500px){.footer .footer__col{flex-basis:99%!important;margin-bottom:24px;max-width:99%!important;text-align:center}.announcement{font-size:15px;line-height:22px;padding:6px 30px}}@media only screen and (max-width:480px){.ActionButton{max-width:100%;white-space:nowrap;width:100%}.Community .Heading{margin-bottom:1.5rem;padding:0 1rem;width:100%}.FastRefresh .column.last{padding:0}.FastRefresh video{width:100%}.NativeCode .column.last{overflow-x:hidden;padding:0;width:100%}.NativeCode .prism-code{font-size:10px;padding:1.25rem}.NativeDevelopment .dissection{height:350px}.TwoColumns .column{padding:0 1.25rem}.FeatureSection{margin:0 4px}.feature-columns{margin:0 35px}}@media only screen and (max-width:420px){.controls-container label span{height:3rem;line-height:3rem;width:4.2rem}.controls-container{zoom:.87}}@media only screen and (max-width:400px){.NativeCode .prism-code{padding:0}}@media (hover:hover){.backToTopButton_sjWU:hover{background-color:var(--ifm-color-emphasis-300)}}@media (pointer:fine){.thin-scrollbar{scrollbar-width:thin}.thin-scrollbar::-webkit-scrollbar{height:var(--ifm-scrollbar-size);width:var(--ifm-scrollbar-size)}.thin-scrollbar::-webkit-scrollbar-track{background:var(--ifm-scrollbar-track-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb{background:var(--ifm-scrollbar-thumb-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb:hover{background:var(--ifm-scrollbar-thumb-hover-background-color)}}@media (prefers-reduced-motion:reduce){:root{--ifm-transition-fast:0ms;--ifm-transition-slow:0ms}}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Reset{stroke-width:var(--docsearch-icon-stroke-width);animation:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;right:0}.DocSearch-Hit--deleting,.DocSearch-Hit--favoriting{transition:none}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:rgba(0,0,0,.2);transition:none}}@media print{.announcementBar_mb4j,.footer,.menu,.navbar,.pagination-nav,.table-of-contents,.tocMobile_ITEo{display:none}.tabs{page-break-inside:avoid}.codeBlockLines_e6Vv{white-space:pre-wrap}} \ No newline at end of file diff --git a/build/assets/js/004bd376.be8c8fa4.js b/build/assets/js/004bd376.be8c8fa4.js new file mode 100644 index 0000000..9608acb --- /dev/null +++ b/build/assets/js/004bd376.be8c8fa4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[554],{5812:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>a,metadata:()=>i,toc:()=>d});var s=n(5893),o=n(1151);const a={id:"advanced-concepts",title:"Advanced concepts"},r=void 0,i={id:"advanced-concepts",title:"Advanced concepts",description:"Deriving state from external sources",source:"@site/main/docs/advanced-concepts.md",sourceDirName:".",slug:"/advanced-concepts",permalink:"/docs/advanced-concepts",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/advanced-concepts.md",tags:[],version:"current",lastUpdatedAt:1696460720,formattedLastUpdatedAt:"Oct 4, 2023",frontMatter:{id:"advanced-concepts",title:"Advanced concepts"},sidebar:"docs",previous:{title:"Streams",permalink:"/docs/streams"},next:{title:"Introduction",permalink:"/docs/framework-integrations/introduction"}},c={},d=[{value:"Deriving state from external sources",id:"deriving-state-from-external-sources",level:2},{value:"Enhanced atoms",id:"enhanced-atoms",level:2}];function l(e){const t={a:"a",blockquote:"blockquote",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h2,{id:"deriving-state-from-external-sources",children:"Deriving state from external sources"}),"\n",(0,s.jsxs)(t.p,{children:["With an additional overload of the ",(0,s.jsx)(t.code,{children:"read"})," function, you can consume external (non-",(0,s.jsx)(t.strong,{children:"xoid"}),") sources. This can be a Redux store, an RxJS observable, or anything that implements getState & subscribe pair. Here is an atom that derives its state from a Redux store:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"import store from './reduxStore'\n\nconst derivedAtom = create((read) => read(store.getState, store.subscribe))\n"})}),"\n",(0,s.jsxs)(t.p,{children:["As long as the external source implements a getState & subscribe, pair, it can be consumed by ",(0,s.jsx)(t.strong,{children:"xoid"}),"."]}),"\n",(0,s.jsx)(t.h2,{id:"enhanced-atoms",children:"Enhanced atoms"}),"\n",(0,s.jsxs)(t.p,{children:["An enhanced atom is an atom whose default ",(0,s.jsx)(t.code,{children:".set"}),' method is swapped with something else. This technique can be used to create "pass through atoms" that act as a mediators. Most people using ',(0,s.jsx)(t.strong,{children:"xoid"})," will not need to write enhanced atoms.\nThis naming is inspired by Redux's concept of enhancers. For a real-life scenario, see ",(0,s.jsx)(t.a,{href:"recipes/redux-interop",children:"Using in an existing Redux App"}),"."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"import store from './reduxStore'\n\nconst $mediator = create((read) => read(store.getState, store.subscribe))\n\n// we swap the default`.set` method\n$mediator.set = (value: number) => store.dispatch({ type: 'ACTION', payload: value })\n\n$mediator.update(s => s + 1) // modifications to `$mediator` will be directly forwarded to Redux dispatch.\n"})}),"\n",(0,s.jsxs)(t.blockquote,{children:["\n",(0,s.jsxs)(t.p,{children:["Swapping ",(0,s.jsx)(t.code,{children:".set"})," also modifies the behavior of ",(0,s.jsx)(t.code,{children:".update"}),", because it uses ",(0,s.jsx)(t.code,{children:".set"})," internally. This is an intentional feature."]}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>i,a:()=>r});var s=n(7294);const o={},a=s.createContext(o);function r(e){const t=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),s.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/0414c4f7.8dfdd6bb.js b/build/assets/js/0414c4f7.8dfdd6bb.js new file mode 100644 index 0000000..22562c7 --- /dev/null +++ b/build/assets/js/0414c4f7.8dfdd6bb.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[995],{6161:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>o,default:()=>l,frontMatter:()=>c,metadata:()=>i,toc:()=>d});var s=t(5893),r=t(1151);const c={id:"using-reducers",title:"Using reducers"},o=void 0,i={id:"recipes/using-reducers",title:"Using reducers",description:"xoid doesn't need reducers, but if you prefer to use them, or if you're moving away from Redux, but want to reuse your existing reducers, you can easily do that with xoid.",source:"@site/main/docs/recipes/using-reducers.md",sourceDirName:"recipes",slug:"/recipes/using-reducers",permalink:"/docs/recipes/using-reducers",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes/using-reducers.md",tags:[],version:"current",lastUpdatedAt:1673200693,formattedLastUpdatedAt:"Jan 8, 2023",frontMatter:{id:"using-reducers",title:"Using reducers"},sidebar:"docs",previous:{title:"Using immer",permalink:"/docs/recipes/using-immer"},next:{title:"Using in an existing Redux App",permalink:"/docs/recipes/redux-interop"}},a={},d=[];function u(e){const n={a:"a",code:"code",p:"p",pre:"pre",strong:"strong",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"xoid"})," doesn't need reducers, but if you prefer to use them, or if you're moving away from Redux, but want to reuse your existing reducers, you can easily do that with ",(0,s.jsx)(n.strong,{children:"xoid"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"The following function can be used to create a Redux-like atom."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const createStore = (reducer, state) => {\n const atom = create(state)\n const dispatch = (action) => atom.update((s) => reducer(s, action))\n return { atom, dispatch }\n}\n"})}),"\n",(0,s.jsx)(n.p,{children:"Let's take this simple reducer:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'const types = { increase: "INCREASE", decrease: "DECREASE" }\n\nconst counterReducer = (state, { type, by }) => {\n switch (type) {\n case types.increase: return {\n ...state,\n count: state.count + by \n }\n case types.decrease: return {\n ...state,\n count: state.count - by\n }\n }\n}\n'})}),"\n",(0,s.jsx)(n.p,{children:"Usage:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const { atom, dispatch } = createStore({ count: 0 }, counterReducer)\n\ndispatch({ type: types.increase, by: 1 })\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Connecting existing reducers to ",(0,s.jsx)(n.strong,{children:"xoid"})," can be beneficial, especially if you're planning to gradually refactor your reducers. The above reducer can be simplified into to the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const CounterModel = (state) => create(state, (atom) => {\n const $count = atom.focus('count')\n return {\n increment: (by) => $count.update(s => s + by),\n decrement: (by) => $count.update(s => s - by),\n }\n})\n"})}),"\n",(0,s.jsxs)(n.p,{children:["To see another demonstration with a more dramatic refactor, you can check ",(0,s.jsx)(n.a,{href:"nested-state",children:"Working with nested state"})]}),"\n",(0,s.jsxs)(n.p,{children:["Related: ",(0,s.jsx)(n.a,{href:"redux-interop",children:"Using in an existing Redux App"})]})]})}function l(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>i,a:()=>o});var s=t(7294);const r={},c=s.createContext(r);function o(e){const n=s.useContext(c);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),s.createElement(c.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/17896441.ee6540b7.js b/build/assets/js/17896441.ee6540b7.js new file mode 100644 index 0000000..d6dbfeb --- /dev/null +++ b/build/assets/js/17896441.ee6540b7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[918],{8835:(e,n,t)=>{t.r(n),t.d(n,{default:()=>Tn});var a=t(7294),i=t(833),s=t(9688),r=t(5893),l=a.createContext(null);function o(e){var n=e.children,t=function(e){return(0,a.useMemo)((function(){return{metadata:e.metadata,frontMatter:e.frontMatter,assets:e.assets,contentTitle:e.contentTitle,toc:e.toc}}),[e])}(e.content);return(0,r.jsx)(l.Provider,{value:t,children:n})}function c(){var e=(0,a.useContext)(l);if(null===e)throw new s.i6("DocProvider");return e}function d(){var e,n=c(),t=n.metadata,a=n.frontMatter,s=n.assets;return(0,r.jsx)(i.d,{title:t.title,description:t.description,keywords:a.keywords,image:null!=(e=s.image)?e:a.image})}var u=t(512),m=t(7524),h=t(5999),v=t(3692);function f(e){var n=e.permalink,t=e.title,a=e.subLabel,i=e.isNext;return(0,r.jsxs)(v.Z,{className:(0,u.Z)("pagination-nav__link",i?"pagination-nav__link--next":"pagination-nav__link--prev"),to:n,children:[a&&(0,r.jsx)("div",{className:"pagination-nav__sublabel",children:a}),(0,r.jsx)("div",{className:"pagination-nav__label",children:t})]})}function x(e){var n=e.previous,t=e.next;return(0,r.jsxs)("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,h.I)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages",description:"The ARIA label for the docs pagination"}),children:[n&&(0,r.jsx)(f,Object.assign({},n,{subLabel:(0,r.jsx)(h.Z,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc",children:"Previous"})})),t&&(0,r.jsx)(f,Object.assign({},t,{subLabel:(0,r.jsx)(h.Z,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc",children:"Next"}),isNext:!0}))]})}function j(){var e=c().metadata;return(0,r.jsx)(x,{previous:e.previous,next:e.next})}var g=t(2263),b=t(143),p=t(5281),N=t(373),C=t(4477);var L={unreleased:function(e){var n=e.siteTitle,t=e.versionMetadata;return(0,r.jsx)(h.Z,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:n,versionLabel:(0,r.jsx)("b",{children:t.label})},children:"This is unreleased documentation for {siteTitle} {versionLabel} version."})},unmaintained:function(e){var n=e.siteTitle,t=e.versionMetadata;return(0,r.jsx)(h.Z,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:n,versionLabel:(0,r.jsx)("b",{children:t.label})},children:"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained."})}};function _(e){var n=L[e.versionMetadata.banner];return(0,r.jsx)(n,Object.assign({},e))}function Z(e){var n=e.versionLabel,t=e.to,a=e.onClick;return(0,r.jsx)(h.Z,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:n,latestVersionLink:(0,r.jsx)("b",{children:(0,r.jsx)(v.Z,{to:t,onClick:a,children:(0,r.jsx)(h.Z,{id:"theme.docs.versions.latestVersionLinkLabel",description:"The label used for the latest version suggestion link label",children:"latest version"})})})},children:"For up-to-date documentation, see the {latestVersionLink} ({versionLabel})."})}function k(e){var n,t=e.className,a=e.versionMetadata,i=(0,g.Z)().siteConfig.title,s=(0,b.gA)({failfast:!0}).pluginId,l=(0,N.J)(s).savePreferredVersionName,o=(0,b.Jo)(s),c=o.latestDocSuggestion,d=o.latestVersionSuggestion,m=null!=c?c:(n=d).docs.find((function(e){return e.id===n.mainDocId}));return(0,r.jsxs)("div",{className:(0,u.Z)(t,p.k.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert",children:[(0,r.jsx)("div",{children:(0,r.jsx)(_,{siteTitle:i,versionMetadata:a})}),(0,r.jsx)("div",{className:"margin-top--md",children:(0,r.jsx)(Z,{versionLabel:d.label,to:m.path,onClick:function(){return l(d.name)}})})]})}function T(e){var n=e.className,t=(0,C.E)();return t.banner?(0,r.jsx)(k,{className:n,versionMetadata:t}):null}function y(e){var n=e.className,t=(0,C.E)();return t.badge?(0,r.jsx)("span",{className:(0,u.Z)(n,p.k.docs.docVersionBadge,"badge badge--secondary"),children:(0,r.jsx)(h.Z,{id:"theme.docs.versionBadge.label",values:{versionLabel:t.label},children:"Version: {versionLabel}"})}):null}function O(e){var n=e.lastUpdatedAt,t=e.formattedLastUpdatedAt;return(0,r.jsx)(h.Z,{id:"theme.lastUpdated.atDate",description:"The words used to describe on which date a page has been last updated",values:{date:(0,r.jsx)("b",{children:(0,r.jsx)("time",{dateTime:new Date(1e3*n).toISOString(),children:t})})},children:" on {date}"})}function w(e){var n=e.lastUpdatedBy;return(0,r.jsx)(h.Z,{id:"theme.lastUpdated.byUser",description:"The words used to describe by who the page has been last updated",values:{user:(0,r.jsx)("b",{children:n})},children:" by {user}"})}function H(e){var n=e.lastUpdatedAt,t=e.formattedLastUpdatedAt,a=e.lastUpdatedBy;return(0,r.jsxs)("span",{className:p.k.common.lastUpdated,children:[(0,r.jsx)(h.Z,{id:"theme.lastUpdated.lastUpdatedAtBy",description:"The sentence used to display when a page has been last updated, and by who",values:{atDate:n&&t?(0,r.jsx)(O,{lastUpdatedAt:n,formattedLastUpdatedAt:t}):"",byUser:a?(0,r.jsx)(w,{lastUpdatedBy:a}):""},children:"Last updated{atDate}{byUser}"}),!1]})}var M=t(3366);const U={iconEdit:"iconEdit_Z9Sw"};var A=["className"];function E(e){var n=e.className,t=(0,M.Z)(e,A);return(0,r.jsx)("svg",Object.assign({fill:"currentColor",height:"20",width:"20",viewBox:"0 0 40 40",className:(0,u.Z)(U.iconEdit,n),"aria-hidden":"true"},t,{children:(0,r.jsx)("g",{children:(0,r.jsx)("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})})}))}function B(e){var n=e.editUrl;return(0,r.jsxs)(v.Z,{to:n,className:p.k.common.editThisPage,children:[(0,r.jsx)(E,{}),(0,r.jsx)(h.Z,{id:"theme.common.editThisPage",description:"The link label to edit the current page",children:"Edit this page"})]})}const I={tag:"tag_zVej",tagRegular:"tagRegular_sFm0",tagWithCount:"tagWithCount_h2kH"};function z(e){var n=e.permalink,t=e.label,a=e.count;return(0,r.jsxs)(v.Z,{href:n,className:(0,u.Z)(I.tag,a?I.tagWithCount:I.tagRegular),children:[t,a&&(0,r.jsx)("span",{children:a})]})}const S={tags:"tags_jXut",tag:"tag_QGVx"};function R(e){var n=e.tags;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(h.Z,{id:"theme.tags.tagsListLabel",description:"The label alongside a tag list",children:"Tags:"})}),(0,r.jsx)("ul",{className:(0,u.Z)(S.tags,"padding--none","margin-left--sm"),children:n.map((function(e){var n=e.label,t=e.permalink;return(0,r.jsx)("li",{className:S.tag,children:(0,r.jsx)(z,{label:n,permalink:t})},t)}))})]})}const V={lastUpdated:"lastUpdated_vwxv"};function D(e){return(0,r.jsx)("div",{className:(0,u.Z)(p.k.docs.docFooterTagsRow,"row margin-bottom--sm"),children:(0,r.jsx)("div",{className:"col",children:(0,r.jsx)(R,Object.assign({},e))})})}function P(e){var n=e.editUrl,t=e.lastUpdatedAt,a=e.lastUpdatedBy,i=e.formattedLastUpdatedAt;return(0,r.jsxs)("div",{className:(0,u.Z)(p.k.docs.docFooterEditMetaRow,"row"),children:[(0,r.jsx)("div",{className:"col",children:n&&(0,r.jsx)(B,{editUrl:n})}),(0,r.jsx)("div",{className:(0,u.Z)("col",V.lastUpdated),children:(t||a)&&(0,r.jsx)(H,{lastUpdatedAt:t,formattedLastUpdatedAt:i,lastUpdatedBy:a})})]})}function F(){var e=c().metadata,n=e.editUrl,t=e.lastUpdatedAt,a=e.formattedLastUpdatedAt,i=e.lastUpdatedBy,s=e.tags,l=s.length>0,o=!!(n||t||i);return l||o?(0,r.jsxs)("footer",{className:(0,u.Z)(p.k.docs.docFooter,"docusaurus-mt-lg"),children:[l&&(0,r.jsx)(D,{tags:s}),o&&(0,r.jsx)(P,{editUrl:n,lastUpdatedAt:t,lastUpdatedBy:i,formattedLastUpdatedAt:a})]}):null}var q=t(6043),G=t(6668),W=["parentIndex"];function J(e){var n=e.map((function(e){return Object.assign({},e,{parentIndex:-1,children:[]})})),t=Array(7).fill(-1);n.forEach((function(e,n){var a=t.slice(2,e.level);e.parentIndex=Math.max.apply(Math,a),t[e.level]=n}));var a=[];return n.forEach((function(e){var t=e.parentIndex,i=(0,M.Z)(e,W);t>=0?n[t].children.push(i):a.push(i)})),a}function Y(e){var n=e.toc,t=e.minHeadingLevel,a=e.maxHeadingLevel;return n.flatMap((function(e){var n=Y({toc:e.children,minHeadingLevel:t,maxHeadingLevel:a});return function(e){return e.level>=t&&e.level<=a}(e)?[Object.assign({},e,{children:n})]:n}))}function Q(e){var n=e.getBoundingClientRect();return n.top===n.bottom?Q(e.parentNode):n}function X(e,n){var t,a,i=n.anchorTopOffset,s=e.find((function(e){return Q(e).top>=i}));return s?function(e){return e.top>0&&e.bottom1&&e.preventDefault()},onClick:function(e){e.stopPropagation();var n=e.target;Ze(n)&&ke(n,l.current)&&(e.preventDefault(),c?(d(!1),v(!0)):d(!0))},children:[f,(0,r.jsx)(q.z,{lazy:!1,collapsed:c,disableSSRStyle:!0,onCollapseTransitionEnd:function(e){d(e),v(!e)},children:(0,r.jsx)("div",{className:Le.collapsibleContent,children:t})})]}))}const ye={details:"details_b_Ee"};var Oe="alert alert--info";function we(e){var n=Object.assign({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));return(0,r.jsx)(Te,Object.assign({},n,{className:(0,u.Z)(Oe,ye.details,n.className)}))}function He(e){var n=a.Children.toArray(e.children),t=n.find((function(e){return a.isValidElement(e)&&"summary"===e.type})),i=(0,r.jsx)(r.Fragment,{children:n.filter((function(e){return e!==t}))});return(0,r.jsx)(we,Object.assign({},e,{summary:t,children:i}))}function Me(e){return(0,r.jsx)(je.Z,Object.assign({},e))}const Ue={containsTaskList:"containsTaskList_mC6p"};function Ae(e){if(void 0!==e)return(0,u.Z)(e,(null==e?void 0:e.includes("contains-task-list"))&&Ue.containsTaskList)}const Ee={img:"img_ev3q"};function Be(e){var n,t=function(e){var n=a.Children.toArray(e),t=n.find((function(e){return a.isValidElement(e)&&"mdxAdmonitionTitle"===e.type})),i=n.filter((function(e){return e!==t}));return{mdxAdmonitionTitle:null==t?void 0:t.props.children,rest:i.length>0?(0,r.jsx)(r.Fragment,{children:i}):null}}(e.children),i=t.mdxAdmonitionTitle,s=t.rest,l=null!=(n=e.title)?n:i;return Object.assign({},e,l&&{title:l},{children:s})}const Ie={admonition:"admonition_xJq3",admonitionHeading:"admonitionHeading_Gvgb",admonitionIcon:"admonitionIcon_Rf37",admonitionContent:"admonitionContent_BuS1"};function ze(e){var n=e.type,t=e.className,a=e.children;return(0,r.jsx)("div",{className:(0,u.Z)(p.k.common.admonition,p.k.common.admonitionType(n),Ie.admonition,t),children:a})}function Se(e){var n=e.icon,t=e.title;return(0,r.jsxs)("div",{className:Ie.admonitionHeading,children:[(0,r.jsx)("span",{className:Ie.admonitionIcon,children:n}),t]})}function Re(e){var n=e.children;return n?(0,r.jsx)("div",{className:Ie.admonitionContent,children:n}):null}function Ve(e){var n=e.type,t=e.icon,a=e.title,i=e.children,s=e.className;return(0,r.jsxs)(ze,{type:n,className:s,children:[(0,r.jsx)(Se,{title:a,icon:t}),(0,r.jsx)(Re,{children:i})]})}function De(e){return(0,r.jsx)("svg",Object.assign({viewBox:"0 0 14 16"},e,{children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})}))}var Pe={icon:(0,r.jsx)(De,{}),title:(0,r.jsx)(h.Z,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)",children:"note"})};function Fe(e){return(0,r.jsx)(Ve,Object.assign({},Pe,e,{className:(0,u.Z)("alert alert--secondary",e.className),children:e.children}))}function qe(e){return(0,r.jsx)("svg",Object.assign({viewBox:"0 0 12 16"},e,{children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})}))}var Ge={icon:(0,r.jsx)(qe,{}),title:(0,r.jsx)(h.Z,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)",children:"tip"})};function We(e){return(0,r.jsx)(Ve,Object.assign({},Ge,e,{className:(0,u.Z)("alert alert--success",e.className),children:e.children}))}function Je(e){return(0,r.jsx)("svg",Object.assign({viewBox:"0 0 14 16"},e,{children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})}))}var Ye={icon:(0,r.jsx)(Je,{}),title:(0,r.jsx)(h.Z,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)",children:"info"})};function Qe(e){return(0,r.jsx)(Ve,Object.assign({},Ye,e,{className:(0,u.Z)("alert alert--info",e.className),children:e.children}))}function Xe(e){return(0,r.jsx)("svg",Object.assign({viewBox:"0 0 16 16"},e,{children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})}))}var Ke={icon:(0,r.jsx)(Xe,{}),title:(0,r.jsx)(h.Z,{id:"theme.admonition.warning",description:"The default label used for the Warning admonition (:::warning)",children:"warning"})};function $e(e){return(0,r.jsx)("svg",Object.assign({viewBox:"0 0 12 16"},e,{children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})}))}var en={icon:(0,r.jsx)($e,{}),title:(0,r.jsx)(h.Z,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)",children:"danger"})};var nn={icon:(0,r.jsx)(Xe,{}),title:(0,r.jsx)(h.Z,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)",children:"caution"})};var tn={note:Fe,tip:We,info:Qe,warning:function(e){return(0,r.jsx)(Ve,Object.assign({},Ke,e,{className:(0,u.Z)("alert alert--warning",e.className),children:e.children}))},danger:function(e){return(0,r.jsx)(Ve,Object.assign({},en,e,{className:(0,u.Z)("alert alert--danger",e.className),children:e.children}))}},an={secondary:function(e){return(0,r.jsx)(Fe,Object.assign({title:"secondary"},e))},important:function(e){return(0,r.jsx)(Qe,Object.assign({title:"important"},e))},success:function(e){return(0,r.jsx)(We,Object.assign({title:"success"},e))},caution:function(e){return(0,r.jsx)(Ve,Object.assign({},nn,e,{className:(0,u.Z)("alert alert--warning",e.className),children:e.children}))}};const sn=Object.assign({},tn,an);function rn(e){var n,t=Be(e),a=(n=t.type,sn[n]||(console.warn('No admonition component found for admonition type "'+n+'". Using Info as fallback.'),sn.info));return(0,r.jsx)(a,Object.assign({},t))}const ln={Head:be.Z,details:He,Details:He,code:function(e){return function(e){return void 0!==e.children&&a.Children.toArray(e.children).every((function(e){return"string"==typeof e&&!e.includes("\n")}))}(e)?(0,r.jsx)(Ne,Object.assign({},e)):(0,r.jsx)(pe.Z,Object.assign({},e))},a:function(e){return(0,r.jsx)(v.Z,Object.assign({},e))},pre:function(e){return(0,r.jsx)(r.Fragment,{children:e.children})},ul:function(e){return(0,r.jsx)("ul",Object.assign({},e,{className:Ae(e.className)}))},img:function(e){return(0,r.jsx)("img",Object.assign({loading:"lazy"},e,{className:(n=e.className,(0,u.Z)(n,Ee.img))}));var n},h1:function(e){return(0,r.jsx)(Me,Object.assign({as:"h1"},e))},h2:function(e){return(0,r.jsx)(Me,Object.assign({as:"h2"},e))},h3:function(e){return(0,r.jsx)(Me,Object.assign({as:"h3"},e))},h4:function(e){return(0,r.jsx)(Me,Object.assign({as:"h4"},e))},h5:function(e){return(0,r.jsx)(Me,Object.assign({as:"h5"},e))},h6:function(e){return(0,r.jsx)(Me,Object.assign({as:"h6"},e))},admonition:rn,mermaid:function(){return null}};function on(e){var n=e.children;return(0,r.jsx)(ge.Z,{components:ln,children:n})}function cn(e){var n,t,a,i,s=e.children,l=(n=c(),t=n.metadata,a=n.frontMatter,i=n.contentTitle,a.hide_title||void 0!==i?null:t.title);return(0,r.jsxs)("div",{className:(0,u.Z)(p.k.docs.docMarkdown,"markdown"),children:[l&&(0,r.jsx)("header",{children:(0,r.jsx)(je.Z,{as:"h1",children:l})}),(0,r.jsx)(on,{children:s})]})}var dn=t(3791),un=t(8596),mn=t(4996);function hn(e){return(0,r.jsx)("svg",Object.assign({viewBox:"0 0 24 24"},e,{children:(0,r.jsx)("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z",fill:"currentColor"})}))}const vn={breadcrumbHomeIcon:"breadcrumbHomeIcon_YNFT"};function fn(){var e=(0,mn.Z)("/");return(0,r.jsx)("li",{className:"breadcrumbs__item",children:(0,r.jsx)(v.Z,{"aria-label":(0,h.I)({id:"theme.docs.breadcrumbs.home",message:"Home page",description:"The ARIA label for the home page in the breadcrumbs"}),className:"breadcrumbs__link",href:e,children:(0,r.jsx)(hn,{className:vn.breadcrumbHomeIcon})})})}const xn={breadcrumbsContainer:"breadcrumbsContainer_Z_bl"};function jn(e){var n=e.children,t=e.href,a="breadcrumbs__link";return e.isLast?(0,r.jsx)("span",{className:a,itemProp:"name",children:n}):t?(0,r.jsx)(v.Z,{className:a,href:t,itemProp:"item",children:(0,r.jsx)("span",{itemProp:"name",children:n})}):(0,r.jsx)("span",{className:a,children:n})}function gn(e){var n=e.children,t=e.active,a=e.index,i=e.addMicrodata;return(0,r.jsxs)("li",Object.assign({},i&&{itemScope:!0,itemProp:"itemListElement",itemType:"https://schema.org/ListItem"},{className:(0,u.Z)("breadcrumbs__item",{"breadcrumbs__item--active":t}),children:[n,(0,r.jsx)("meta",{itemProp:"position",content:String(a+1)})]}))}function bn(){var e=(0,dn.s1)(),n=(0,un.Ns)();return e?(0,r.jsx)("nav",{className:(0,u.Z)(p.k.docs.docBreadcrumbs,xn.breadcrumbsContainer),"aria-label":(0,h.I)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"}),children:(0,r.jsxs)("ul",{className:"breadcrumbs",itemScope:!0,itemType:"https://schema.org/BreadcrumbList",children:[n&&(0,r.jsx)(fn,{}),e.map((function(n,t){var a=t===e.length-1,i="category"===n.type&&n.linkUnlisted?void 0:n.href;return(0,r.jsx)(gn,{active:a,index:t,addMicrodata:!!i,children:(0,r.jsx)(jn,{href:i,isLast:a,children:n.label})},t)}))]})}):null}function pn(){return(0,r.jsx)(h.Z,{id:"theme.unlistedContent.title",description:"The unlisted content banner title",children:"Unlisted page"})}function Nn(){return(0,r.jsx)(h.Z,{id:"theme.unlistedContent.message",description:"The unlisted content banner message",children:"This page is unlisted. Search engines will not index it, and only users having a direct link can access it."})}function Cn(){return(0,r.jsx)(be.Z,{children:(0,r.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})}function Ln(e){var n=e.className;return(0,r.jsx)(rn,{type:"caution",title:(0,r.jsx)(pn,{}),className:(0,u.Z)(n,p.k.common.unlistedBanner),children:(0,r.jsx)(Nn,{})})}function _n(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Cn,{}),(0,r.jsx)(Ln,Object.assign({},e))]})}const Zn={docItemContainer:"docItemContainer_Djhp",docItemCol:"docItemCol_VOVn"};function kn(e){var n,t,a,i,s,l,o=e.children,d=(n=c(),t=n.frontMatter,a=n.toc,i=(0,m.i)(),s=t.hide_table_of_contents,l=!s&&a.length>0,{hidden:s,mobile:l?(0,r.jsx)(de,{}):void 0,desktop:!l||"desktop"!==i&&"ssr"!==i?void 0:(0,r.jsx)(xe,{})}),h=c().metadata.unlisted;return(0,r.jsxs)("div",{className:"row",children:[(0,r.jsxs)("div",{className:(0,u.Z)("col",!d.hidden&&Zn.docItemCol),children:[h&&(0,r.jsx)(_n,{}),(0,r.jsx)(T,{}),(0,r.jsxs)("div",{className:Zn.docItemContainer,children:[(0,r.jsxs)("article",{children:[(0,r.jsx)(bn,{}),(0,r.jsx)(y,{}),d.mobile,(0,r.jsx)(cn,{children:o}),(0,r.jsx)(F,{})]}),(0,r.jsx)(j,{})]})]}),d.desktop&&(0,r.jsx)("div",{className:"col col--3",children:d.desktop})]})}function Tn(e){var n="docs-doc-id-"+e.content.metadata.id,t=e.content;return(0,r.jsx)(o,{content:e.content,children:(0,r.jsxs)(i.FG,{className:n,children:[(0,r.jsx)(d,{}),(0,r.jsx)(kn,{children:(0,r.jsx)(t,{})})]})})}},1151:(e,n,t)=>{t.d(n,{Z:()=>l,a:()=>r});var a=t(7294);const i={},s=a.createContext(i);function r(e){const n=a.useContext(s);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),a.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/1a4e3797.639f43a6.js b/build/assets/js/1a4e3797.639f43a6.js new file mode 100644 index 0000000..bcf52ae --- /dev/null +++ b/build/assets/js/1a4e3797.639f43a6.js @@ -0,0 +1,2 @@ +/*! For license information please see 1a4e3797.639f43a6.js.LICENSE.txt */ +(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[920],{7331:e=>{function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function n(e){return"object"==typeof e&&null!==e}function i(e){return void 0===e}e.exports=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},t.prototype.emit=function(e){var t,a,s,c,u,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var h=new Error('Uncaught, unspecified "error" event. ('+t+")");throw h.context=t,h}if(i(a=this._events[e]))return!1;if(r(a))switch(arguments.length){case 1:a.call(this);break;case 2:a.call(this,arguments[1]);break;case 3:a.call(this,arguments[1],arguments[2]);break;default:c=Array.prototype.slice.call(arguments,1),a.apply(this,c)}else if(n(a))for(c=Array.prototype.slice.call(arguments,1),s=(o=a.slice()).length,u=0;u0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},t.prototype.removeListener=function(e,t){var i,a,s,c;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(s=(i=this._events[e]).length,a=-1,i===t||r(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(n(i)){for(c=s;c-- >0;)if(i[c]===t||i[c].listener&&i[c].listener===t){a=c;break}if(a<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},t.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},t.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},t.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},t.listenerCount=function(e,t){return e.listenerCount(t)}},8131:(e,t,r)=>{"use strict";var n=r(9374),i=r(7775),a=r(3076);function s(e,t,r,i){return new n(e,t,r,i)}s.version=r(4336),s.AlgoliaSearchHelper=n,s.SearchParameters=i,s.SearchResults=a,e.exports=s},8078:(e,t,r)=>{"use strict";var n=r(7331);function i(e,t){this.main=e,this.fn=t,this.lastResults=null}r(4853)(i,n),i.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},i.prototype.getModifiedState=function(e){return this.fn(e)},e.exports=i},2437:(e,t,r)=>{"use strict";var n=r(2344),i=r(116),a=r(9803),s={addRefinement:function(e,t,r){if(s.isRefined(e,t,r))return e;var i=""+r,a=e[t]?e[t].concat(i):[i],c={};return c[t]=a,n({},c,e)},removeRefinement:function(e,t,r){if(void 0===r)return s.clearRefinement(e,(function(e,r){return t===r}));var n=""+r;return s.clearRefinement(e,(function(e,r){return t===r&&n===e}))},toggleRefinement:function(e,t,r){if(void 0===r)throw new Error("toggleRefinement should be used with a value");return s.isRefined(e,t,r)?s.removeRefinement(e,t,r):s.addRefinement(e,t,r)},clearRefinement:function(e,t,r){if(void 0===t)return i(e)?{}:e;if("string"==typeof t)return a(e,[t]);if("function"==typeof t){var n=!1,s=Object.keys(e).reduce((function(i,a){var s=e[a]||[],c=s.filter((function(e){return!t(e,a,r)}));return c.length!==s.length&&(n=!0),i[a]=c,i}),{});return n?s:e}},isRefined:function(e,t,r){var n=Boolean(e[t])&&e[t].length>0;if(void 0===r||!n)return n;var i=""+r;return-1!==e[t].indexOf(i)}};e.exports=s},7775:(e,t,r)=>{"use strict";var n=r(2344),i=r(7888),a=r(2686),s=r(185),c=r(116),u=r(9803),o=r(8023),h=r(6801),f=r(2437);function l(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((function(e,r){return l(t[r],e)})):e===t}function m(e){var t=e?m._parseNumbers(e):{};void 0===t.userToken||h(t.userToken)||console.warn("[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\n - Format: [a-zA-Z0-9_-]{1,64}"),this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{};var r=this;Object.keys(t).forEach((function(e){var n=-1!==m.PARAMETERS.indexOf(e),i=void 0!==t[e];!n&&i&&(r[e]=t[e])}))}m.PARAMETERS=Object.keys(new m),m._parseNumbers=function(e){if(e instanceof m)return e;var t={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach((function(r){var n=e[r];if("string"==typeof n){var i=parseFloat(n);t[r]=isNaN(i)?n:i}})),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map((function(e){return Array.isArray(e)?e.map((function(e){return parseFloat(e)})):e}))),e.numericRefinements){var r={};Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t]||{};r[t]={},Object.keys(n).forEach((function(e){var i=n[e].map((function(e){return Array.isArray(e)?e.map((function(e){return"string"==typeof e?parseFloat(e):e})):"string"==typeof e?parseFloat(e):e}));r[t][e]=i}))})),t.numericRefinements=r}return s({},e,t)},m.make=function(e){var t=new m(e);return(e.hierarchicalFacets||[]).forEach((function(e){if(e.rootPath){var r=t.getHierarchicalRefinement(e.name);r.length>0&&0!==r[0].indexOf(e.rootPath)&&(t=t.clearRefinements(e.name)),0===(r=t.getHierarchicalRefinement(e.name)).length&&(t=t.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}})),t},m.validate=function(e,t){var r=t||{};return e.tagFilters&&r.tagRefinements&&r.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&r.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&r.numericRefinements&&c(r.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):c(e.numericRefinements)&&r.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},m.prototype={constructor:m,clearRefinements:function(e){var t={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:f.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:f.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:f.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:f.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return t.numericRefinements===this.numericRefinements&&t.facetsRefinements===this.facetsRefinements&&t.facetsExcludes===this.facetsExcludes&&t.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&t.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(t)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,r){var n=o(r);if(this.isNumericRefined(e,t,n))return this;var i=s({},this.numericRefinements);return i[e]=s({},i[e]),i[e][t]?(i[e][t]=i[e][t].slice(),i[e][t].push(n)):i[e][t]=[n],this.setQueryParameters({numericRefinements:i})},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(e,t,r){var n=r;return void 0!==n?this.isNumericRefined(e,t,n)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(r,i){return i===e&&r.op===t&&l(r.val,o(n))}))}):this:void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(r,n){return n===e&&r.op===t}))}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(t,r){return r===e}))}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){if(void 0===e)return c(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof e)return u(this.numericRefinements,[e]);if("function"==typeof e){var t=!1,r=this.numericRefinements,n=Object.keys(r).reduce((function(n,i){var a=r[i],s={};return a=a||{},Object.keys(a).forEach((function(r){var n=a[r]||[],c=[];n.forEach((function(t){e({val:t,op:r},i,"numeric")||c.push(t)})),c.length!==n.length&&(t=!0),s[r]=c})),n[i]=s,n}),{});return t?n:this.numericRefinements}},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:f.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:f.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:f.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},removeFacet:function(e){return this.isConjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({facets:this.facets.filter((function(t){return t!==e}))}):this},removeDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter((function(t){return t!==e}))}):this},removeHierarchicalFacet:function(e){return this.isHierarchicalFacet(e)?this.clearRefinements(e).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter((function(t){return t.name!==e}))}):this},removeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:f.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:f.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:f.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(e){if(!this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.filter((function(t){return t!==e}))};return this.setQueryParameters(t)},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:f.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:f.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:f.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),i={};return void 0!==this.hierarchicalFacetsRefinements[e]&&this.hierarchicalFacetsRefinements[e].length>0&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+r))?-1===t.indexOf(r)?i[e]=[]:i[e]=[t.slice(0,t.lastIndexOf(r))]:i[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:n({},i,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var r={};return r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:n({},r,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:n({},t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return this.disjunctiveFacets.indexOf(e)>-1},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return this.facets.indexOf(e)>-1},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&f.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))return!1;var r=this.getHierarchicalRefinement(e);return t?-1!==r.indexOf(t):r.length>0},isNumericRefined:function(e,t,r){if(void 0===r&&void 0===t)return Boolean(this.numericRefinements[e]);var n=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===r||!n)return n;var a,s,c=o(r),u=void 0!==(a=this.numericRefinements[e][t],s=c,i(a,(function(e){return l(e,s)})));return n&&u},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var e=this,t=a(Object.keys(this.numericRefinements).filter((function(t){return Object.keys(e.numericRefinements[t]).length>0})),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter((function(t){return e.disjunctiveFacetsRefinements[t].length>0})).concat(t).concat(this.getRefinedHierarchicalFacets()).sort()},getRefinedHierarchicalFacets:function(){var e=this;return a(this.hierarchicalFacets.map((function(e){return e.name})),Object.keys(this.hierarchicalFacetsRefinements).filter((function(t){return e.hierarchicalFacetsRefinements[t].length>0}))).sort()},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter((function(t){return-1===e.indexOf(t)}))},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={},r=this;return Object.keys(this).forEach((function(n){var i=r[n];-1===e.indexOf(n)&&void 0!==i&&(t[n]=i)})),t},setQueryParameter:function(e,t){if(this[e]===t)return this;var r={};return r[e]=t,this.setQueryParameters(r)},setQueryParameters:function(e){if(!e)return this;var t=m.validate(this,e);if(t)throw t;var r=this,n=m._parseNumbers(e),i=Object.keys(this).reduce((function(e,t){return e[t]=r[t],e}),{}),a=Object.keys(n).reduce((function(e,t){var r=void 0!==e[t],i=void 0!==n[t];return r&&!i?u(e,[t]):(i&&(e[t]=n[t]),e)}),i);return new this.constructor(a)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(e){return i(this.hierarchicalFacets,(function(t){return t.name===e}))},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(r).map((function(e){return e.trim()}))},toString:function(){return JSON.stringify(this,null,2)}},e.exports=m},210:(e,t,r)=>{"use strict";e.exports=function(e){return function(t,r){var n=e.hierarchicalFacets[r],o=e.hierarchicalFacetsRefinements[n.name]&&e.hierarchicalFacetsRefinements[n.name][0]||"",h=e._getHierarchicalFacetSeparator(n),f=e._getHierarchicalRootPath(n),l=e._getHierarchicalShowParentLevel(n),m=a(e._getHierarchicalFacetSortBy(n)),d=t.every((function(e){return e.exhaustive})),p=function(e,t,r,n,a){return function(o,h,f){var l=o;if(f>0){var m=0;for(l=o;m{"use strict";var n=r(4587),i=r(2344),a=r(4039),s=r(7888),c=r(9725),u=r(2293),o=r(185),h=r(2148),f=a.escapeFacetValue,l=a.unescapeFacetValue,m=r(210);function d(e){var t={};return e.forEach((function(e,r){t[e]=r})),t}function p(e,t,r){t&&t[r]&&(e.stats=t[r])}function v(e,t,r){var a=t[0];this._rawResults=t;var u=this;Object.keys(a).forEach((function(e){u[e]=a[e]}));var h=o({persistHierarchicalRootCount:!1},r);Object.keys(h).forEach((function(e){u[e]=h[e]})),this.processingTimeMS=t.reduce((function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS}),0),this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map((function(){return[]})),this.facets=[];var f=e.getRefinedDisjunctiveFacets(),v=d(e.facets),g=d(e.disjunctiveFacets),y=1,R=a.facets||{};Object.keys(R).forEach((function(t){var r,n,i=R[t],o=(r=e.hierarchicalFacets,n=t,s(r,(function(e){return(e.attributes||[]).indexOf(n)>-1})));if(o){var h=o.attributes.indexOf(t),f=c(e.hierarchicalFacets,(function(e){return e.name===o.name}));u.hierarchicalFacets[f][h]={attribute:t,data:i,exhaustive:a.exhaustiveFacetsCount}}else{var l,m=-1!==e.disjunctiveFacets.indexOf(t),d=-1!==e.facets.indexOf(t);m&&(l=g[t],u.disjunctiveFacets[l]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},p(u.disjunctiveFacets[l],a.facets_stats,t)),d&&(l=v[t],u.facets[l]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},p(u.facets[l],a.facets_stats,t))}})),this.hierarchicalFacets=n(this.hierarchicalFacets),f.forEach((function(r){var n=t[y],s=n&&n.facets?n.facets:{},h=e.getHierarchicalFacetByName(r);Object.keys(s).forEach((function(t){var r,f=s[t];if(h){r=c(e.hierarchicalFacets,(function(e){return e.name===h.name}));var m=c(u.hierarchicalFacets[r],(function(e){return e.attribute===t}));if(-1===m)return;u.hierarchicalFacets[r][m].data=o({},u.hierarchicalFacets[r][m].data,f)}else{r=g[t];var d=a.facets&&a.facets[t]||{};u.disjunctiveFacets[r]={name:t,data:i({},f,d),exhaustive:n.exhaustiveFacetsCount},p(u.disjunctiveFacets[r],n.facets_stats,t),e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].forEach((function(n){!u.disjunctiveFacets[r].data[n]&&e.disjunctiveFacetsRefinements[t].indexOf(l(n))>-1&&(u.disjunctiveFacets[r].data[n]=0)}))}})),y++})),e.getRefinedHierarchicalFacets().forEach((function(r){var n=e.getHierarchicalFacetByName(r),a=e._getHierarchicalFacetSeparator(n),s=e.getHierarchicalRefinement(r);0===s.length||s[0].split(a).length<2||t.slice(y).forEach((function(t){var r=t&&t.facets?t.facets:{};Object.keys(r).forEach((function(t){var o=r[t],h=c(e.hierarchicalFacets,(function(e){return e.name===n.name})),f=c(u.hierarchicalFacets[h],(function(e){return e.attribute===t}));if(-1!==f){var l={};if(s.length>0&&!u.persistHierarchicalRootCount){var m=s[0].split(a)[0];l[m]=u.hierarchicalFacets[h][f].data[m]}u.hierarchicalFacets[h][f].data=i(l,o,u.hierarchicalFacets[h][f].data)}})),y++}))})),Object.keys(e.facetsExcludes).forEach((function(t){var r=e.facetsExcludes[t],n=v[t];u.facets[n]={name:t,data:R[t],exhaustive:a.exhaustiveFacetsCount},r.forEach((function(e){u.facets[n]=u.facets[n]||{name:t},u.facets[n].data=u.facets[n].data||{},u.facets[n].data[e]=0}))})),this.hierarchicalFacets=this.hierarchicalFacets.map(m(e)),this.facets=n(this.facets),this.disjunctiveFacets=n(this.disjunctiveFacets),this._state=e}function g(e,t){function r(e){return e.name===t}if(e._state.isConjunctiveFacet(t)){var n=s(e.facets,r);return n?Object.keys(n.data).map((function(r){var i=f(r);return{name:r,escapedValue:i,count:n.data[r],isRefined:e._state.isFacetRefined(t,i),isExcluded:e._state.isExcludeRefined(t,r)}})):[]}if(e._state.isDisjunctiveFacet(t)){var i=s(e.disjunctiveFacets,r);return i?Object.keys(i.data).map((function(r){var n=f(r);return{name:r,escapedValue:n,count:i.data[r],isRefined:e._state.isDisjunctiveFacetRefined(t,n)}})):[]}if(e._state.isHierarchicalFacet(t)){var a=s(e.hierarchicalFacets,r);if(!a)return a;var c=e._state.getHierarchicalFacetByName(t),u=e._state._getHierarchicalFacetSeparator(c),o=l(e._state.getHierarchicalRefinement(t)[0]||"");0===o.indexOf(c.rootPath)&&(o=o.replace(c.rootPath+u,""));var h=o.split(u);return h.unshift(t),y(a,h,0),a}}function y(e,t,r){e.isRefined=e.name===t[r],e.data&&e.data.forEach((function(e){y(e,t,r+1)}))}function R(e,t,r,n){if(n=n||0,Array.isArray(t))return e(t,r[n]);if(!t.data||0===t.data.length)return t;var a=t.data.map((function(t){return R(e,t,r,n+1)})),s=e(a,r[n]);return i({data:s},t)}function F(e,t){var r=s(e,(function(e){return e.name===t}));return r&&r.stats}function b(e,t,r,n,i){var a=s(i,(function(e){return e.name===r})),c=a&&a.data&&a.data[n]?a.data[n]:0,u=a&&a.exhaustive||!1;return{type:t,attributeName:r,name:n,count:c,exhaustive:u}}v.prototype.getFacetByName=function(e){function t(t){return t.name===e}return s(this.facets,t)||s(this.disjunctiveFacets,t)||s(this.hierarchicalFacets,t)},v.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],v.prototype.getFacetValues=function(e,t){var r=g(this,e);if(r){var n,a=i({},t,{sortBy:v.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),s=this;if(Array.isArray(r))n=[e];else n=s._state.getHierarchicalFacetByName(r.name).attributes;return R((function(e,t){if(a.facetOrdering){var r=function(e,t){return e.renderingContent&&e.renderingContent.facetOrdering&&e.renderingContent.facetOrdering.values&&e.renderingContent.facetOrdering.values[t]}(s,t);if(r)return function(e,t){var r=[],n=[],i=(t.order||[]).reduce((function(e,t,r){return e[t]=r,e}),{});e.forEach((function(e){var t=e.path||e.name;void 0!==i[t]?r[i[t]]=e:n.push(e)})),r=r.filter((function(e){return e}));var a,s=t.sortRemainingBy;return"hidden"===s?r:(a="alpha"===s?[["path","name"],["asc","asc"]]:[["count"],["desc"]],r.concat(h(n,a[0],a[1])))}(e,r)}if(Array.isArray(a.sortBy)){var n=u(a.sortBy,v.DEFAULT_SORT);return h(e,n[0],n[1])}if("function"==typeof a.sortBy)return function(e,t){return t.sort(e)}(a.sortBy,e);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")}),r,n)}},v.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?F(this.facets,e):this._state.isDisjunctiveFacet(e)?F(this.disjunctiveFacets,e):void 0},v.prototype.getRefinements=function(){var e=this._state,t=this,r=[];return Object.keys(e.facetsRefinements).forEach((function(n){e.facetsRefinements[n].forEach((function(i){r.push(b(e,"facet",n,i,t.facets))}))})),Object.keys(e.facetsExcludes).forEach((function(n){e.facetsExcludes[n].forEach((function(i){r.push(b(e,"exclude",n,i,t.facets))}))})),Object.keys(e.disjunctiveFacetsRefinements).forEach((function(n){e.disjunctiveFacetsRefinements[n].forEach((function(i){r.push(b(e,"disjunctive",n,i,t.disjunctiveFacets))}))})),Object.keys(e.hierarchicalFacetsRefinements).forEach((function(n){e.hierarchicalFacetsRefinements[n].forEach((function(i){r.push(function(e,t,r,n){var i=e.getHierarchicalFacetByName(t),a=e._getHierarchicalFacetSeparator(i),c=r.split(a),u=s(n,(function(e){return e.name===t})),o=c.reduce((function(e,t){var r=e&&s(e.data,(function(e){return e.name===t}));return void 0!==r?r:e}),u),h=o&&o.count||0,f=o&&o.exhaustive||!1,l=o&&o.path||"";return{type:"hierarchical",attributeName:t,name:l,count:h,exhaustive:f}}(e,n,i,t.hierarchicalFacets))}))})),Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t];Object.keys(n).forEach((function(e){n[e].forEach((function(n){r.push({type:"numeric",attributeName:t,name:n,numericValue:n,operator:e})}))}))})),e.tagRefinements.forEach((function(e){r.push({type:"tag",attributeName:"_tags",name:e})})),r},e.exports=v},9374:(e,t,r)=>{"use strict";var n=r(7331),i=r(8078),a=r(4039).escapeFacetValue,s=r(4853),c=r(185),u=r(116),o=r(9803),h=r(6394),f=r(7775),l=r(3076),m=r(4336);function d(e,t,r,n){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+m+")"),this.setClient(e);var i=r||{};i.index=t,this.state=f.make(i),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0,this._searchResultsOptions=n}function p(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function v(){return this.state.page}s(d,n),d.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},d.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},d.prototype.getQuery=function(){var e=this.state;return h._getHitsSearchParams(e)},d.prototype.searchOnce=function(e,t){var r=e?this.state.setQueryParameters(e):this.state,n=h._getQueries(r.index,r),i=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:r}),!t)return this.client.search(n).then((function(e){return i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),{content:new l(r,e.results),state:r,_originalResponse:e}}),(function(e){throw i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),e}));this.client.search(n).then((function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(null,new l(r,e.results),r)})).catch((function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(e,null,r)}))},d.prototype.findAnswers=function(e){console.warn("[algoliasearch-helper] answers is no longer supported");var t=this.state,r=this.derivedHelpers[0];if(!r)return Promise.resolve([]);var n=r.getModifiedState(t),i=c({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:o(h._getHitsSearchParams(n),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),a="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if("function"!=typeof this.client.initIndex)throw new Error(a);var s=this.client.initIndex(n.index);if("function"!=typeof s.findAnswers)throw new Error(a);return s.findAnswers(n.query,e.queryLanguages,i)},d.prototype.searchForFacetValues=function(e,t,r,n){var i="function"==typeof this.client.searchForFacetValues,s="function"==typeof this.client.initIndex;if(!i&&!s&&"function"!=typeof this.client.search)throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues");var c=this.state.setQueryParameters(n||{}),u=c.isDisjunctiveFacet(e),o=h.getSearchForFacetQuery(e,t,r,c);this._currentNbQueries++;var f,l=this;return i?f=this.client.searchForFacetValues([{indexName:c.index,params:o}]):s?f=this.client.initIndex(c.index).searchForFacetValues(o):(delete o.facetName,f=this.client.search([{type:"facet",facet:e,indexName:c.index,params:o}]).then((function(e){return e.results[0]}))),this.emit("searchForFacetValues",{state:c,facet:e,query:t}),f.then((function(t){return l._currentNbQueries--,0===l._currentNbQueries&&l.emit("searchQueueEmpty"),(t=Array.isArray(t)?t[0]:t).facetHits.forEach((function(t){t.escapedValue=a(t.value),t.isRefined=u?c.isDisjunctiveFacetRefined(e,t.escapedValue):c.isFacetRefined(e,t.escapedValue)})),t}),(function(e){throw l._currentNbQueries--,0===l._currentNbQueries&&l.emit("searchQueueEmpty"),e}))},d.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},d.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},d.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},d.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},d.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,r),isPageReset:!0}),this},d.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},d.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},d.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},d.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},d.prototype.removeNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,r),isPageReset:!0}),this},d.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},d.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},d.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},d.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},d.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},d.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},d.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},d.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},d.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},d.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},d.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},d.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},d.prototype.setCurrentPage=p,d.prototype.setPage=p,d.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},d.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},d.prototype.setState=function(e){return this._change({state:f.make(e),isPageReset:!1}),this},d.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new f(e),this},d.prototype.hasRefinements=function(e){return!!u(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},d.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},d.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},d.prototype.hasTag=function(e){return this.state.isTagRefined(e)},d.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},d.prototype.getIndex=function(){return this.state.index},d.prototype.getCurrentPage=v,d.prototype.getPage=v,d.prototype.getTags=function(){return this.state.tagRefinements},d.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e))this.state.getConjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"conjunctive"})})),this.state.getExcludeRefinements(e).forEach((function(e){t.push({value:e,type:"exclude"})}));else if(this.state.isDisjunctiveFacet(e)){this.state.getDisjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"disjunctive"})}))}var r=this.state.getNumericRefinements(e);return Object.keys(r).forEach((function(e){var n=r[e];t.push({value:n,operator:e,type:"numeric"})})),t},d.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},d.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},d.prototype._search=function(e){var t=this.state,r=[],n=[];e.onlyWithDerivedHelpers||(n=h._getQueries(t.index,t),r.push({state:t,queriesCount:n.length,helper:this}),this.emit("search",{state:t,results:this.lastResults}));var i=this.derivedHelpers.map((function(e){var n=e.getModifiedState(t),i=n.index?h._getQueries(n.index,n):[];return r.push({state:n,queriesCount:i.length,helper:e}),e.emit("search",{state:n,results:e.lastResults}),i})),a=Array.prototype.concat.apply(n,i),s=this._queryId++;if(this._currentNbQueries++,!a.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,r,s));try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,r,s)).catch(this._dispatchAlgoliaError.bind(this,s))}catch(c){this.emit("error",{error:c})}},d.prototype._dispatchAlgoliaResponse=function(e,t,r){var n=this;if(!(t0},d.prototype._change=function(e){var t=e.state,r=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:r}))},d.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},d.prototype.setClient=function(e){return this.client===e||("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+m+")"),this.client=e),this},d.prototype.getClient=function(){return this.client},d.prototype.derive=function(e){var t=new i(this,e);return this.derivedHelpers.push(t),t},d.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(-1===t)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)},d.prototype.hasPendingRequests=function(){return this._currentNbQueries>0},e.exports=d},4587:e=>{"use strict";e.exports=function(e){return Array.isArray(e)?e.filter(Boolean):[]}},2344:e=>{"use strict";e.exports=function(){return Array.prototype.slice.call(arguments).reduceRight((function(e,t){return Object.keys(Object(t)).forEach((function(r){void 0!==t[r]&&(void 0!==e[r]&&delete e[r],e[r]=t[r])})),e}),{})}},4039:e=>{"use strict";e.exports={escapeFacetValue:function(e){return"string"!=typeof e?e:String(e).replace(/^-/,"\\-")},unescapeFacetValue:function(e){return"string"!=typeof e?e:e.replace(/^\\-/,"-")}}},7888:e=>{"use strict";e.exports=function(e,t){if(Array.isArray(e))for(var r=0;r{"use strict";e.exports=function(e,t){if(!Array.isArray(e))return-1;for(var r=0;r{"use strict";var n=r(7888);e.exports=function(e,t){var r=(t||[]).map((function(e){return e.split(":")}));return e.reduce((function(e,t){var i=t.split(":"),a=n(r,(function(e){return e[0]===i[0]}));return i.length>1||!a?(e[0].push(i[0]),e[1].push(i[1]),e):(e[0].push(a[0]),e[1].push(a[1]),e)}),[[],[]])}},4853:e=>{"use strict";e.exports=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}},2686:e=>{"use strict";e.exports=function(e,t){return e.filter((function(r,n){return t.indexOf(r)>-1&&e.indexOf(r)===n}))}},185:e=>{"use strict";function t(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function r(e,n){if(e===n)return e;for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&"__proto__"!==i&&"constructor"!==i){var a=n[i],s=e[i];void 0!==s&&void 0===a||(t(s)&&t(a)?e[i]=r(s,a):e[i]="object"==typeof(c=a)&&null!==c?r(Array.isArray(c)?[]:{},c):c)}var c;return e}e.exports=function(e){t(e)||(e={});for(var n=1,i=arguments.length;n{"use strict";e.exports=function(e){return e&&Object.keys(e).length>0}},9803:e=>{"use strict";e.exports=function(e,t){if(null===e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}},2148:e=>{"use strict";function t(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=void 0!==t,a=null===t;if(!a&&e>t||n&&i||!r)return 1;if(!n&&e=n.length?a:"desc"===n[i]?-a:a}return e.index-r.index})),i.map((function(e){return e.value}))}},8023:e=>{"use strict";e.exports=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")}},6394:(e,t,r)=>{"use strict";var n=r(185);function i(e){return Object.keys(e).sort().reduce((function(t,r){return t[r]=e[r],t}),{})}var a={_getQueries:function(e,t){var r=[];return r.push({indexName:e,params:a._getHitsSearchParams(t)}),t.getRefinedDisjunctiveFacets().forEach((function(n){r.push({indexName:e,params:a._getDisjunctiveFacetSearchParams(t,n)})})),t.getRefinedHierarchicalFacets().forEach((function(n){var i=t.getHierarchicalFacetByName(n),s=t.getHierarchicalRefinement(n),c=t._getHierarchicalFacetSeparator(i);if(s.length>0&&s[0].split(c).length>1){var u=s[0].split(c).slice(0,-1).reduce((function(e,t,r){return e.concat({attribute:i.attributes[r],value:0===r?t:[e[e.length-1].value,t].join(c)})}),[]);u.forEach((function(n,s){var c=a._getDisjunctiveFacetSearchParams(t,n.attribute,0===s);function o(e){return i.attributes.some((function(t){return t===e.split(":")[0]}))}var h=(c.facetFilters||[]).reduce((function(e,t){if(Array.isArray(t)){var r=t.filter((function(e){return!o(e)}));r.length>0&&e.push(r)}return"string"!=typeof t||o(t)||e.push(t),e}),[]),f=u[s-1];c.facetFilters=s>0?h.concat(f.attribute+":"+f.value):h.length>0?h:void 0,r.push({indexName:e,params:c})}))}})),r},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(a._getHitsHierarchicalFacetsAttributes(e)).sort(),r=a._getFacetFilters(e),s=a._getNumericFilters(e),c=a._getTagFilters(e),u={facets:t.indexOf("*")>-1?["*"]:t,tagFilters:c};return r.length>0&&(u.facetFilters=r),s.length>0&&(u.numericFilters=s),i(n({},e.getQueryParams(),u))},_getDisjunctiveFacetSearchParams:function(e,t,r){var s=a._getFacetFilters(e,t,r),c=a._getNumericFilters(e,t),u=a._getTagFilters(e),o={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};u.length>0&&(o.tagFilters=u);var h=e.getHierarchicalFacetByName(t);return o.facets=h?a._getDisjunctiveHierarchicalFacetAttribute(e,h,r):t,c.length>0&&(o.numericFilters=c),s.length>0&&(o.facetFilters=s),i(n({},e.getQueryParams(),o))},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var r=[];return Object.keys(e.numericRefinements).forEach((function(n){var i=e.numericRefinements[n]||{};Object.keys(i).forEach((function(e){var a=i[e]||[];t!==n&&a.forEach((function(t){if(Array.isArray(t)){var i=t.map((function(t){return n+e+t}));r.push(i)}else r.push(n+e+t)}))}))})),r},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,r){var n=[],i=e.facetsRefinements||{};Object.keys(i).sort().forEach((function(e){(i[e]||[]).sort().forEach((function(t){n.push(e+":"+t)}))}));var a=e.facetsExcludes||{};Object.keys(a).sort().forEach((function(e){(a[e]||[]).sort().forEach((function(t){n.push(e+":-"+t)}))}));var s=e.disjunctiveFacetsRefinements||{};Object.keys(s).sort().forEach((function(e){var r=s[e]||[];if(e!==t&&r&&0!==r.length){var i=[];r.sort().forEach((function(t){i.push(e+":"+t)})),n.push(i)}}));var c=e.hierarchicalFacetsRefinements||{};return Object.keys(c).sort().forEach((function(i){var a=(c[i]||[])[0];if(void 0!==a){var s,u,o=e.getHierarchicalFacetByName(i),h=e._getHierarchicalFacetSeparator(o),f=e._getHierarchicalRootPath(o);if(t===i){if(-1===a.indexOf(h)||!f&&!0===r||f&&f.split(h).length===a.split(h).length)return;f?(u=f.split(h).length-1,a=f):(u=a.split(h).length-2,a=a.slice(0,a.lastIndexOf(h))),s=o.attributes[u]}else u=a.split(h).length-1,s=o.attributes[u];s&&n.push([s+":"+a])}})),n},_getHitsHierarchicalFacetsAttributes:function(e){return e.hierarchicalFacets.reduce((function(t,r){var n=e.getHierarchicalRefinement(r.name)[0];if(!n)return t.push(r.attributes[0]),t;var i=e._getHierarchicalFacetSeparator(r),a=n.split(i).length,s=r.attributes.slice(0,a+1);return t.concat(s)}),[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,r){var n=e._getHierarchicalFacetSeparator(t);if(!0===r){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(n).length),[t.attributes[a]]}var s=(e.getHierarchicalRefinement(t.name)[0]||"").split(n).length-1;return t.attributes.slice(0,s+1)},getSearchForFacetQuery:function(e,t,r,s){var c=s.isDisjunctiveFacet(e)?s.clearRefinements(e):s,u={facetQuery:t,facetName:e};return"number"==typeof r&&(u.maxFacetHits=r),i(n({},a._getHitsSearchParams(c),u))}};e.exports=a},6801:e=>{"use strict";e.exports=function(e){return null!==e&&/^[a-zA-Z0-9_-]{1,64}$/.test(e)}},4336:e=>{"use strict";e.exports="3.16.1"},290:function(e){e.exports=function(){"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var s,c=e[Symbol.iterator]();!(n=(s=c.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(i)throw a}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){c();var t=JSON.stringify(e);return a()[t]})).then((function(e){return Promise.all([e?e.value:t(),void 0!==e])})).then((function(e){var t=i(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var i=a();return i[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},n().setItem(r,JSON.stringify(i)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function c(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,i).catch((function(){return c({caches:t}).get(e,n,i)}))},set:function(e,n){return r.set(e,n).catch((function(){return c({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return c({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return c({caches:t}).clear()}))}}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var s=n(),c=i&&i.miss||function(){return Promise.resolve()};return s.then((function(e){return c(e)})).then((function(){return s}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function o(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function h(e,t){return t?(Object.keys(t).forEach((function(r){e[r]=t[r](e)})),e):e}function f(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var d={Read:1,Write:2,Any:3},p=1,v=2,g=3;function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;return r(r({},e),{},{status:t,lastUpdate:Date.now()})}function R(e){return"string"==typeof e?{protocol:"https",url:e,accept:d.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||d.Any}}var F="GET",b="POST";function j(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(y(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===p||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===g&&Date.now()-e.lastUpdate<=12e4}(e)})),i=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:i.length>0?i.map((function(e){return R(e)})):t}}))}function P(e,t,n,i){var s=[],c=function(e,t){if(e.method!==F&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:r(r({},e.data),t.data);return JSON.stringify(n)}}(n,i),u=function(e,t){var n=r(r({},e.headers),t.headers),i={};return Object.keys(n).forEach((function(e){var t=n[e];i[e.toLowerCase()]=t})),i}(e,i),o=n.method,h=n.method!==F?{}:r(r({},n.data),i.data),f=r(r(r({"x-algolia-agent":e.userAgent.value},e.queryParameters),h),i.queryParameters),l=0,m=function t(r,a){var h=r.pop();if(void 0===h)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:E(s)};var m={data:c,headers:u,method:o,url:_(h,n.path,f),connectTimeout:a(l,e.timeouts.connect),responseTimeout:a(l,i.timeout)},d=function(e){var t={request:m,response:e,host:h,triesLeft:r.length};return s.push(t),t},p={onSuccess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var i=d(n);return n.isTimedOut&&l++,Promise.all([e.logger.info("Retryable failure",w(i)),e.hostsCache.set(h,y(h,n.isTimedOut?g:v))]).then((function(){return t(r,a)}))},onFail:function(e){throw d(e),function(e,t){var r=e.content,n=e.status,i=r;try{i=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(i,n,t)}(e,E(s))}};return e.requester.send(m).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&0==~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSuccess(e):t.onFail(e)}(e,p)}))};return j(e.hostsCache,t).then((function(e){return m(a(e.statelessHosts).reverse(),e.getTimeout)}))}function x(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var r="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(r)&&(t.value="".concat(t.value).concat(r)),t}};return t}function _(e,t,r){var n=O(r),i="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(i+="?".concat(n)),i}function O(e){return Object.keys(e).map((function(t){return f("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function E(e){return e.map((function(e){return w(e)}))}function w(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return r(r({},e),{},{request:r(r({},e.request),{},{headers:r(r({},e.request.headers),t)})})}var N=function(e){var t=e.appId,n=function(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===l.WithinHeaders?n:{}},queryParameters:function(){return e===l.WithinQueryParameters?n:{}}}}(void 0!==e.authMode?e.authMode:l.WithinHeaders,t,e.apiKey),a=function(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,s=e.responsesCache,c=e.timeouts,u=e.userAgent,o=e.hosts,h=e.queryParameters,f={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:s,timeouts:c,userAgent:u,headers:e.headers,queryParameters:h,hosts:o.map((function(e){return R(e)})),read:function(e,t){var r=m(t,f.timeouts.read),n=function(){return P(f,f.hosts.filter((function(e){return 0!=(e.accept&d.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(a,(function(){return f.requestsCache.get(a,(function(){return f.requestsCache.set(a,n()).then((function(e){return Promise.all([f.requestsCache.delete(a),e])}),(function(e){return Promise.all([f.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=i(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(a,e)}})},write:function(e,t){return P(f,f.hosts.filter((function(e){return 0!=(e.accept&d.Write)})),e,m(t,f.timeouts.write))}};return f}(r(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:d.Read},{url:"".concat(t,".algolia.net"),accept:d.Write}].concat(o([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({transporter:a,appId:t,addAlgoliaAgent:function(e,t){a.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then((function(){}))}},e.methods)},A=function(e){return function(t,r){return t.method===F?e.transporter.read(t,r):e.transporter.write(t,r)}},H=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({transporter:e.transporter,appId:e.appId,indexName:t},r.methods)}},S=function(e){return function(t,n){var i=t.map((function(e){return r(r({},e),{},{params:O(e.params||{})})}));return e.transporter.read({method:b,path:"1/indexes/*/queries",data:{requests:i},cacheable:!0},n)}},T=function(e){return function(t,i){return Promise.all(t.map((function(t){var a=t.params,s=a.facetName,c=a.facetQuery,u=n(a,["facetName","facetQuery"]);return H(e)(t.indexName,{methods:{searchForFacetValues:I}}).searchForFacetValues(s,c,r(r({},i),u))})))}},Q=function(e){return function(t,r,n){return e.transporter.read({method:b,path:f("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n)}},C=function(e){return function(t,r){return e.transporter.read({method:b,path:f("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},I=function(e){return function(t,r,n){return e.transporter.read({method:b,path:f("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},D=1,k=2,q=3;function V(e,t,n){var i,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,i=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=i(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=i(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(i=q,{debug:function(e,t){return D>=i&&console.debug(e,t),Promise.resolve()},info:function(e,t){return k>=i&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:c({caches:[s({key:"".concat("4.22.1","-").concat(e)}),u()]}),userAgent:x("4.22.1").add({segment:"Browser",version:"lite"}),authMode:l.WithinQueryParameters};return N(r(r(r({},a),n),{},{methods:{search:S,searchForFacetValues:T,multipleQueries:S,multipleSearchForFacetValues:T,customRequest:A,initIndex:function(e){return function(t){return H(e)(t,{methods:{search:C,searchForFacetValues:I,findAnswers:Q}})}}}}))}return V.version="4.22.1",V}()},6675:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>S});var n=r(7294),i=r(512),a=r(8131),s=r.n(a),c=r(290),u=r.n(c),o=r(412),h=r(5742),f=r(3692),l=r(143),m=r(2263),d=["zero","one","two","few","many","other"];function p(e){return d.filter((function(t){return e.includes(t)}))}var v={locale:"en",pluralForms:p(["one","other"]),select:function(e){return 1===e?"one":"other"}};function g(){var e=(0,m.Z)().i18n.currentLocale;return(0,n.useMemo)((function(){try{return t=e,r=new Intl.PluralRules(t),{locale:t,pluralForms:p(r.resolvedOptions().pluralCategories),select:function(e){return r.select(e)}}}catch(n){return console.error('Failed to use Intl.PluralRules for locale "'+e+'".\nDocusaurus will fallback to the default (English) implementation.\nError: '+n.message+"\n"),v}var t,r}),[e])}function y(){var e=g();return{selectMessage:function(t,r){return function(e,t,r){var n=e.split("|");if(1===n.length)return n[0];n.length>r.pluralForms.length&&console.error("For locale="+r.locale+", a maximum of "+r.pluralForms.length+" plural forms are expected ("+r.pluralForms.join(",")+"), but the message contains "+n.length+": "+e);var i=r.select(t),a=r.pluralForms.indexOf(i);return n[Math.min(a,n.length-1)]}(r,t,e)}}}var R=r(6177),F=r(9688),b=r(833),j=r(2128),P=r(5999),x=r(6278),_=r(239),O=r(5296),E=r(2503);const w={searchQueryInput:"searchQueryInput_u2C7",searchVersionInput:"searchVersionInput_m0Ui",searchResultsColumn:"searchResultsColumn_JPFH",algoliaLogo:"algoliaLogo_rT1R",algoliaLogoPathFill:"algoliaLogoPathFill_WdUC",searchResultItem:"searchResultItem_Tv2o",searchResultItemHeading:"searchResultItemHeading_KbCB",searchResultItemPath:"searchResultItemPath_lhe1",searchResultItemSummary:"searchResultItemSummary_AEaO",searchQueryColumn:"searchQueryColumn_RTkw",searchVersionColumn:"searchVersionColumn_ypXd",searchLogoColumn:"searchLogoColumn_rJIA",loadingSpinner:"loadingSpinner_XVxU","loading-spin":"loading-spin_vzvp",loader:"loader_vvXV"};var N=r(5893);function A(e){var t=e.docsSearchVersionsHelpers,r=Object.entries(t.allDocsData).filter((function(e){return e[1].versions.length>1}));return(0,N.jsx)("div",{className:(0,i.Z)("col","col--3","padding-left--none",w.searchVersionColumn),children:r.map((function(e){var n=e[0],i=e[1],a=r.length>1?n+": ":"";return(0,N.jsx)("select",{onChange:function(e){return t.setSearchVersion(n,e.target.value)},defaultValue:t.searchVersions[n],className:w.searchVersionInput,children:i.versions.map((function(e,t){return(0,N.jsx)("option",{label:""+a+e.label,value:e.name},t)}))},n)}))})}function H(){var e,t,r,a,c,d,p=(0,m.Z)().i18n.currentLocale,v=(0,x.L)().algolia,g=v.appId,b=v.apiKey,H=v.indexName,S=(0,_.l)(),T=(e=y().selectMessage,function(t){return e(t,(0,P.I)({id:"theme.SearchPage.documentsFound.plurals",description:'Pluralized label for "{count} documents found". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',message:"One document found|{count} documents found"},{count:t}))}),Q=(t=(0,l._r)(),r=(0,n.useState)((function(){return Object.entries(t).reduce((function(e,t){var r,n=t[0],i=t[1];return Object.assign({},e,((r={})[n]=i.versions[0].name,r))}),{})})),a=r[0],c=r[1],d=Object.values(t).some((function(e){return e.versions.length>1})),{allDocsData:t,versioningEnabled:d,searchVersions:a,setSearchVersion:function(e,t){return c((function(r){var n;return Object.assign({},r,((n={})[e]=t,n))}))}}),C=(0,R.K)(),I=C[0],D=C[1],k={items:[],query:null,totalResults:null,totalPages:null,lastPage:null,hasMore:null,loading:null},q=(0,n.useReducer)((function(e,t){switch(t.type){case"reset":return k;case"loading":return Object.assign({},e,{loading:!0});case"update":return I!==t.value.query?e:Object.assign({},t.value,{items:0===t.value.lastPage?t.value.items:e.items.concat(t.value.items)});case"advance":var r=e.totalPages>e.lastPage+1;return Object.assign({},e,{lastPage:r?e.lastPage+1:e.lastPage,hasMore:r});default:return e}}),k),V=q[0],L=q[1],B=u()(g,b),z=s()(B,H,{hitsPerPage:15,advancedSyntax:!0,disjunctiveFacets:["language","docusaurus_tag"]});z.on("result",(function(e){var t=e.results,r=t.query,n=t.hits,i=t.page,a=t.nbHits,s=t.nbPages;if(""!==r&&Array.isArray(n)){var c=function(e){return e.replace(/algolia-docsearch-suggestion--highlight/g,"search-result-match")},u=n.map((function(e){var t=e.url,r=e._highlightResult.hierarchy,n=e._snippetResult,i=void 0===n?{}:n,a=Object.keys(r).map((function(e){return c(r[e].value)}));return{title:a.pop(),url:S(t),summary:i.content?c(i.content.value)+"...":"",breadcrumbs:a}}));L({type:"update",value:{items:u,query:r,totalResults:a,totalPages:s,lastPage:i,hasMore:s>i+1,loading:!1}})}else L({type:"reset"})}));var M=(0,n.useState)(null),J=M[0],Z=M[1],W=(0,n.useRef)(0),U=(0,n.useRef)(o.Z.canUseIntersectionObserver&&new IntersectionObserver((function(e){var t=e[0],r=t.isIntersecting,n=t.boundingClientRect.y;r&&W.current>n&&L({type:"advance"}),W.current=n}),{threshold:1})),K=function(){return I?(0,P.I)({id:"theme.SearchPage.existingResultsTitle",message:'Search results for "{query}"',description:"The search page title for non-empty query"},{query:I}):(0,P.I)({id:"theme.SearchPage.emptyResultsTitle",message:"Search the documentation",description:"The search page title for empty query"})},X=(0,F.zX)((function(e){void 0===e&&(e=0),z.addDisjunctiveFacetRefinement("docusaurus_tag","default"),z.addDisjunctiveFacetRefinement("language",p),Object.entries(Q.searchVersions).forEach((function(e){var t=e[0],r=e[1];z.addDisjunctiveFacetRefinement("docusaurus_tag","docs-"+t+"-"+r)})),z.setQuery(I).setPage(e).search()}));return(0,n.useEffect)((function(){if(J){var e=U.current;return e?(e.observe(J),function(){return e.unobserve(J)}):function(){return!0}}}),[J]),(0,n.useEffect)((function(){L({type:"reset"}),I&&(L({type:"loading"}),setTimeout((function(){X()}),300))}),[I,Q.searchVersions,X]),(0,n.useEffect)((function(){V.lastPage&&0!==V.lastPage&&X(V.lastPage)}),[X,V.lastPage]),(0,N.jsxs)(O.Z,{children:[(0,N.jsxs)(h.Z,{children:[(0,N.jsx)("title",{children:(0,j.p)(K())}),(0,N.jsx)("meta",{property:"robots",content:"noindex, follow"})]}),(0,N.jsxs)("div",{className:"container margin-vert--lg",children:[(0,N.jsx)(E.Z,{as:"h1",children:K()}),(0,N.jsxs)("form",{className:"row",onSubmit:function(e){return e.preventDefault()},children:[(0,N.jsx)("div",{className:(0,i.Z)("col",w.searchQueryColumn,{"col--9":Q.versioningEnabled,"col--12":!Q.versioningEnabled}),children:(0,N.jsx)("input",{type:"search",name:"q",className:w.searchQueryInput,placeholder:(0,P.I)({id:"theme.SearchPage.inputPlaceholder",message:"Type your search here",description:"The placeholder for search page input"}),"aria-label":(0,P.I)({id:"theme.SearchPage.inputLabel",message:"Search",description:"The ARIA label for search page input"}),onChange:function(e){return D(e.target.value)},value:I,autoComplete:"off",autoFocus:!0})}),Q.versioningEnabled&&(0,N.jsx)(A,{docsSearchVersionsHelpers:Q})]}),(0,N.jsxs)("div",{className:"row",children:[(0,N.jsx)("div",{className:(0,i.Z)("col","col--8",w.searchResultsColumn),children:!!V.totalResults&&T(V.totalResults)}),(0,N.jsx)("div",{className:(0,i.Z)("col","col--4","text--right",w.searchLogoColumn),children:(0,N.jsx)(f.Z,{to:"https://www.algolia.com/","aria-label":(0,P.I)({id:"theme.SearchPage.algoliaLabel",message:"Search by Algolia",description:"The ARIA label for Algolia mention"}),children:(0,N.jsx)("svg",{viewBox:"0 0 168 24",className:w.algoliaLogo,children:(0,N.jsxs)("g",{fill:"none",children:[(0,N.jsx)("path",{className:w.algoliaLogoPathFill,d:"M120.925 18.804c-4.386.02-4.386-3.54-4.386-4.106l-.007-13.336 2.675-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-10.846-2.18c.821 0 1.43-.047 1.855-.129v-2.719a6.334 6.334 0 0 0-1.574-.199 5.7 5.7 0 0 0-.897.069 2.699 2.699 0 0 0-.814.24c-.24.116-.439.28-.582.491-.15.212-.219.335-.219.656 0 .628.219.991.616 1.23s.938.362 1.615.362zm-.233-9.7c.883 0 1.629.109 2.231.328.602.218 1.088.525 1.444.915.363.396.609.922.76 1.483.157.56.232 1.175.232 1.85v6.874a32.5 32.5 0 0 1-1.868.314c-.834.123-1.772.185-2.813.185-.69 0-1.327-.069-1.895-.198a4.001 4.001 0 0 1-1.471-.636 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.803 0-.656.13-1.073.384-1.525a3.24 3.24 0 0 1 1.047-1.106c.445-.287.95-.492 1.532-.615a8.8 8.8 0 0 1 1.82-.185 8.404 8.404 0 0 1 1.972.24v-.438c0-.307-.035-.6-.11-.874a1.88 1.88 0 0 0-.384-.73 1.784 1.784 0 0 0-.724-.493 3.164 3.164 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.735 7.735 0 0 0-1.26.307l-.321-2.192c.335-.117.834-.233 1.478-.349a10.98 10.98 0 0 1 2.073-.178zm52.842 9.626c.822 0 1.43-.048 1.854-.13V13.7a6.347 6.347 0 0 0-1.574-.199c-.294 0-.595.021-.896.069a2.7 2.7 0 0 0-.814.24 1.46 1.46 0 0 0-.582.491c-.15.212-.218.335-.218.656 0 .628.218.991.615 1.23.404.245.938.362 1.615.362zm-.226-9.694c.883 0 1.629.108 2.231.327.602.219 1.088.526 1.444.915.355.39.609.923.759 1.483a6.8 6.8 0 0 1 .233 1.852v6.873c-.41.088-1.034.19-1.868.314-.834.123-1.772.184-2.813.184-.69 0-1.327-.068-1.895-.198a4.001 4.001 0 0 1-1.471-.635 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.804 0-.656.13-1.073.384-1.524.26-.45.608-.82 1.047-1.107.445-.286.95-.491 1.532-.614a8.803 8.803 0 0 1 2.751-.13c.329.034.671.096 1.04.185v-.437a3.3 3.3 0 0 0-.109-.875 1.873 1.873 0 0 0-.384-.731 1.784 1.784 0 0 0-.724-.492 3.165 3.165 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.75 7.75 0 0 0-1.26.307l-.321-2.193c.335-.116.834-.232 1.478-.348a11.633 11.633 0 0 1 2.073-.177zm-8.034-1.271a1.626 1.626 0 0 1-1.628-1.62c0-.895.725-1.62 1.628-1.62.904 0 1.63.725 1.63 1.62 0 .895-.733 1.62-1.63 1.62zm1.348 13.22h-2.689V7.27l2.69-.423v11.956zm-4.714 0c-4.386.02-4.386-3.54-4.386-4.107l-.008-13.336 2.676-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-8.698-5.903c0-1.156-.253-2.119-.746-2.788-.493-.677-1.183-1.01-2.067-1.01-.882 0-1.574.333-2.065 1.01-.493.676-.733 1.632-.733 2.788 0 1.168.246 1.953.74 2.63.492.683 1.183 1.018 2.066 1.018.882 0 1.574-.342 2.067-1.019.492-.683.738-1.46.738-2.63zm2.737-.007c0 .902-.13 1.584-.397 2.33a5.52 5.52 0 0 1-1.128 1.906 4.986 4.986 0 0 1-1.752 1.223c-.685.286-1.739.45-2.265.45-.528-.006-1.574-.157-2.252-.45a5.096 5.096 0 0 1-1.744-1.223c-.487-.527-.863-1.162-1.137-1.906a6.345 6.345 0 0 1-.41-2.33c0-.902.123-1.77.397-2.508a5.554 5.554 0 0 1 1.15-1.892 5.133 5.133 0 0 1 1.75-1.216c.679-.287 1.425-.423 2.232-.423.808 0 1.553.142 2.237.423a4.88 4.88 0 0 1 1.753 1.216 5.644 5.644 0 0 1 1.135 1.892c.287.738.431 1.606.431 2.508zm-20.138 0c0 1.12.246 2.363.738 2.882.493.52 1.13.78 1.91.78.424 0 .828-.062 1.204-.178.377-.116.677-.253.917-.417V9.33a10.476 10.476 0 0 0-1.766-.226c-.971-.028-1.71.37-2.23 1.004-.513.636-.773 1.75-.773 2.788zm7.438 5.274c0 1.824-.466 3.156-1.404 4.004-.936.846-2.367 1.27-4.296 1.27-.705 0-2.17-.137-3.34-.396l.431-2.118c.98.205 2.272.26 2.95.26 1.074 0 1.84-.219 2.299-.656.459-.437.684-1.086.684-1.948v-.437a8.07 8.07 0 0 1-1.047.397c-.43.13-.93.198-1.492.198-.739 0-1.41-.116-2.018-.349a4.206 4.206 0 0 1-1.567-1.025c-.431-.45-.774-1.017-1.013-1.694-.24-.677-.363-1.885-.363-2.773 0-.834.13-1.88.384-2.577.26-.696.629-1.298 1.129-1.796.493-.498 1.095-.881 1.8-1.162a6.605 6.605 0 0 1 2.428-.457c.87 0 1.67.109 2.45.24.78.129 1.444.265 1.985.415V18.17zM6.972 6.677v1.627c-.712-.446-1.52-.67-2.425-.67-.585 0-1.045.13-1.38.391a1.24 1.24 0 0 0-.502 1.03c0 .425.164.765.494 1.02.33.256.835.532 1.516.83.447.192.795.356 1.045.495.25.138.537.332.862.582.324.25.563.548.718.894.154.345.23.741.23 1.188 0 .947-.334 1.691-1.004 2.234-.67.542-1.537.814-2.601.814-1.18 0-2.16-.229-2.936-.686v-1.708c.84.628 1.814.942 2.92.942.585 0 1.048-.136 1.388-.407.34-.271.51-.646.51-1.125 0-.287-.1-.55-.302-.79-.203-.24-.42-.42-.655-.542-.234-.123-.585-.29-1.053-.503a61.27 61.27 0 0 1-.582-.271 13.67 13.67 0 0 1-.55-.287 4.275 4.275 0 0 1-.567-.351 6.92 6.92 0 0 1-.455-.4c-.18-.17-.31-.34-.39-.51-.08-.17-.155-.37-.224-.598a2.553 2.553 0 0 1-.104-.742c0-.915.333-1.638.998-2.17.664-.532 1.523-.798 2.576-.798.968 0 1.793.17 2.473.51zm7.468 5.696v-.287c-.022-.607-.187-1.088-.495-1.444-.309-.357-.75-.535-1.324-.535-.532 0-.99.194-1.373.583-.382.388-.622.949-.717 1.683h3.909zm1.005 2.792v1.404c-.596.34-1.383.51-2.362.51-1.255 0-2.255-.377-3-1.132-.744-.755-1.116-1.744-1.116-2.968 0-1.297.34-2.316 1.021-3.055.68-.74 1.548-1.11 2.6-1.11 1.033 0 1.852.323 2.458.966.606.644.91 1.572.91 2.784 0 .33-.033.676-.096 1.038h-5.314c.107.702.405 1.239.894 1.611.49.372 1.106.558 1.85.558.862 0 1.58-.202 2.155-.606zm6.605-1.77h-1.212c-.596 0-1.045.116-1.349.35-.303.234-.454.532-.454.894 0 .372.117.664.35.877.235.213.575.32 1.022.32.51 0 .912-.142 1.204-.424.293-.281.44-.651.44-1.108v-.91zm-4.068-2.554V9.325c.627-.361 1.457-.542 2.489-.542 2.116 0 3.175 1.026 3.175 3.08V17h-1.548v-.957c-.415.68-1.143 1.02-2.186 1.02-.766 0-1.38-.22-1.843-.661-.462-.442-.694-1.003-.694-1.684 0-.776.293-1.38.878-1.81.585-.431 1.404-.647 2.457-.647h1.34V11.8c0-.554-.133-.971-.399-1.253-.266-.282-.707-.423-1.324-.423a4.07 4.07 0 0 0-2.345.718zm9.333-1.93v1.42c.394-1 1.101-1.5 2.123-1.5.148 0 .313.016.494.048v1.531a1.885 1.885 0 0 0-.75-.143c-.542 0-.989.24-1.34.718-.351.479-.527 1.048-.527 1.707V17h-1.563V8.91h1.563zm5.01 4.084c.022.82.272 1.492.75 2.019.479.526 1.15.79 2.01.79.639 0 1.235-.176 1.788-.527v1.404c-.521.319-1.186.479-1.995.479-1.265 0-2.276-.4-3.031-1.197-.755-.798-1.133-1.792-1.133-2.984 0-1.16.38-2.151 1.14-2.975.761-.825 1.79-1.237 3.088-1.237.702 0 1.346.149 1.93.447v1.436a3.242 3.242 0 0 0-1.77-.495c-.84 0-1.513.266-2.019.798-.505.532-.758 1.213-.758 2.042zM40.24 5.72v4.579c.458-1 1.293-1.5 2.505-1.5.787 0 1.42.245 1.899.734.479.49.718 1.17.718 2.042V17h-1.564v-5.106c0-.553-.14-.98-.422-1.284-.282-.303-.652-.455-1.11-.455-.531 0-1.002.202-1.411.606-.41.405-.615 1.022-.615 1.851V17h-1.563V5.72h1.563zm14.966 10.02c.596 0 1.096-.253 1.5-.758.404-.506.606-1.157.606-1.955 0-.915-.202-1.62-.606-2.114-.404-.495-.92-.742-1.548-.742-.553 0-1.05.224-1.491.67-.442.447-.662 1.133-.662 2.058 0 .958.212 1.67.638 2.138.425.469.946.703 1.563.703zM53.004 5.72v4.42c.574-.894 1.388-1.341 2.44-1.341 1.022 0 1.857.383 2.506 1.149.649.766.973 1.781.973 3.047 0 1.138-.309 2.109-.925 2.912-.617.803-1.463 1.205-2.537 1.205-1.075 0-1.894-.447-2.457-1.34V17h-1.58V5.72h1.58zm9.908 11.104l-3.223-7.913h1.739l1.005 2.632 1.26 3.415c.096-.32.48-1.458 1.15-3.415l.909-2.632h1.66l-2.92 7.866c-.777 2.074-1.963 3.11-3.559 3.11a2.92 2.92 0 0 1-.734-.079v-1.34c.17.042.351.064.543.064 1.032 0 1.755-.57 2.17-1.708z"}),(0,N.jsx)("path",{fill:"#5468FF",d:"M78.988.938h16.594a2.968 2.968 0 0 1 2.966 2.966V20.5a2.967 2.967 0 0 1-2.966 2.964H78.988a2.967 2.967 0 0 1-2.966-2.964V3.897A2.961 2.961 0 0 1 78.988.938z"}),(0,N.jsx)("path",{fill:"white",d:"M89.632 5.967v-.772a.978.978 0 0 0-.978-.977h-2.28a.978.978 0 0 0-.978.977v.793c0 .088.082.15.171.13a7.127 7.127 0 0 1 1.984-.28c.65 0 1.295.088 1.917.259.082.02.164-.04.164-.13m-6.248 1.01l-.39-.389a.977.977 0 0 0-1.382 0l-.465.465a.973.973 0 0 0 0 1.38l.383.383c.062.061.15.047.205-.014.226-.307.472-.601.746-.874.281-.28.568-.526.883-.751.068-.042.075-.137.02-.2m4.16 2.453v3.341c0 .096.104.165.192.117l2.97-1.537c.068-.034.089-.117.055-.184a3.695 3.695 0 0 0-3.08-1.866c-.068 0-.136.054-.136.13m0 8.048a4.489 4.489 0 0 1-4.49-4.482 4.488 4.488 0 0 1 4.49-4.482 4.488 4.488 0 0 1 4.489 4.482 4.484 4.484 0 0 1-4.49 4.482m0-10.85a6.363 6.363 0 1 0 0 12.729 6.37 6.37 0 0 0 6.372-6.368 6.358 6.358 0 0 0-6.371-6.36"})]})})})})]}),V.items.length>0?(0,N.jsx)("main",{children:V.items.map((function(e,t){var r=e.title,n=e.url,a=e.summary,s=e.breadcrumbs;return(0,N.jsxs)("article",{className:w.searchResultItem,children:[(0,N.jsx)(E.Z,{as:"h2",className:w.searchResultItemHeading,children:(0,N.jsx)(f.Z,{to:n,dangerouslySetInnerHTML:{__html:r}})}),s.length>0&&(0,N.jsx)("nav",{"aria-label":"breadcrumbs",children:(0,N.jsx)("ul",{className:(0,i.Z)("breadcrumbs",w.searchResultItemPath),children:s.map((function(e,t){return(0,N.jsx)("li",{className:"breadcrumbs__item",dangerouslySetInnerHTML:{__html:e}},t)}))})}),a&&(0,N.jsx)("p",{className:w.searchResultItemSummary,dangerouslySetInnerHTML:{__html:a}})]},t)}))}):[I&&!V.loading&&(0,N.jsx)("p",{children:(0,N.jsx)(P.Z,{id:"theme.SearchPage.noResultsText",description:"The paragraph for empty search result",children:"No results were found"})},"no-results"),!!V.loading&&(0,N.jsx)("div",{className:w.loadingSpinner},"spinner")],V.hasMore&&(0,N.jsx)("div",{className:w.loader,ref:Z,children:(0,N.jsx)(P.Z,{id:"theme.SearchPage.fetchingNewResults",description:"The paragraph for fetching new search results",children:"Fetching new results..."})})]})]})}function S(){return(0,N.jsx)(b.FG,{className:"search-page-wrapper",children:(0,N.jsx)(H,{})})}}}]); \ No newline at end of file diff --git a/build/31.477ee4ad.js.LICENSE.txt b/build/assets/js/1a4e3797.639f43a6.js.LICENSE.txt similarity index 100% rename from build/31.477ee4ad.js.LICENSE.txt rename to build/assets/js/1a4e3797.639f43a6.js.LICENSE.txt diff --git a/build/assets/js/249cd168.98cd599b.js b/build/assets/js/249cd168.98cd599b.js new file mode 100644 index 0000000..4ab73c1 --- /dev/null +++ b/build/assets/js/249cd168.98cd599b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[496],{1639:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>u,frontMatter:()=>a,metadata:()=>r,toc:()=>c});var n=o(5893),s=o(1151);const a={id:"redux-interop",title:"Using in an existing Redux App"},i=void 0,r={id:"recipes/redux-interop",title:"Using in an existing Redux App",description:"xoid and Redux can coexist in a project without a problem. There's no requirement to get rid of Redux when xoid is added. If you're planning to gradually move away from Redux however, xoid is a good candidate to do so. For this, one thing you can do is to start managing some part of your Redux state via xoid. You can follow these steps:",source:"@site/main/docs/recipes/redux-interop.md",sourceDirName:"recipes",slug:"/recipes/redux-interop",permalink:"/docs/recipes/redux-interop",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes/redux-interop.md",tags:[],version:"current",lastUpdatedAt:1696460720,formattedLastUpdatedAt:"Oct 4, 2023",frontMatter:{id:"redux-interop",title:"Using in an existing Redux App"},sidebar:"docs",previous:{title:"Using reducers",permalink:"/docs/recipes/using-reducers"},next:{title:"Redux Devtools integration",permalink:"/docs/recipes/redux-devtools-integration"}},d={},c=[{value:"Step 1: create an "omnipotent" action that has the ability to replace the Redux state",id:"step-1-create-an-omnipotent-action-that-has-the-ability-to-replace-the-redux-state",level:3},{value:"Step 2: Create an "enhanced atom"",id:"step-2-create-an-enhanced-atom",level:3}];function l(e){const t={a:"a",blockquote:"blockquote",code:"code",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,s.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.strong,{children:"xoid"})," and Redux can coexist in a project without a problem. There's no requirement to get rid of Redux when ",(0,n.jsx)(t.strong,{children:"xoid"})," is added. If you're planning to gradually move away from Redux however, ",(0,n.jsx)(t.strong,{children:"xoid"})," is a good candidate to do so. For this, one thing you can do is to start managing some part of your Redux state via ",(0,n.jsx)(t.strong,{children:"xoid"}),". You can follow these steps:"]}),"\n",(0,n.jsx)(t.h3,{id:"step-1-create-an-omnipotent-action-that-has-the-ability-to-replace-the-redux-state",children:'Step 1: create an "omnipotent" action that has the ability to replace the Redux state'}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"const someExistingReducer = (state, action) => {\n switch(action.type) {\n case 'EXTERNAL_XOID_UPDATE': {\n return action.payload\n }\n ... // other `case` clauses\n }\n"})}),"\n",(0,n.jsx)(t.h3,{id:"step-2-create-an-enhanced-atom",children:'Step 2: Create an "enhanced atom"'}),"\n",(0,n.jsx)(t.p,{children:"This will forward subscriptions and state modifications directly to the Redux store."}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"import { store } from './store'\n\nconst $mediatorAtom = create((read) => read(store.getState, store.subscribe))\n$mediatorAtom.set = (payload) => store.dispatch({ type: 'EXTERNAL_XOID_UPDATE', payload })\n"})}),"\n",(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsxs)(t.p,{children:["Usually, atoms are derived from other ",(0,n.jsx)(t.strong,{children:"atoms"})," (as ",(0,n.jsx)(t.code,{children:"create((read) => get($someAtom))"}),"). Observe how ",(0,n.jsx)(t.code,{children:"read"})," is used with two arguments in this example. This is an additional overload that is used to consume an external (non-",(0,n.jsx)(t.strong,{children:"xoid"}),") source. As long as the external source implements some getState & subscribe pair, it can be consumed by ",(0,n.jsx)(t.strong,{children:"xoid"})," like this. (See ",(0,n.jsx)(t.a,{href:"../advanced-concepts#deriving-state-from-external-sources",children:"Deriving state from external sources"}),")"]}),"\n",(0,n.jsxs)(t.p,{children:["Also, in the second line, you may see that the default ",(0,n.jsx)(t.code,{children:"set"})," method is overriden. In ",(0,n.jsx)(t.strong,{children:"xoid"}),"'s terminology, atoms like these are called ",(0,n.jsx)(t.a,{href:"../advanced-concepts#enhanced-atoms",children:"enhanced atoms"}),". Overriding the default ",(0,n.jsx)(t.code,{children:"set"})," method also will modify the ",(0,n.jsx)(t.code,{children:"update"})," method's behavior."]}),"\n"]}),"\n",(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsxs)(t.p,{children:["Note: If a partial Redux state is desired, A selector instead of the ",(0,n.jsx)(t.code,{children:"store.getState"})," can be used. Second argument remains same as ",(0,n.jsx)(t.code,{children:"store.subscribe"}),"."]}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},1151:(e,t,o)=>{o.d(t,{Z:()=>r,a:()=>i});var n=o(7294);const s={},a=n.createContext(s);function i(e){const t=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),n.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/286.d838aa6a.js b/build/assets/js/286.d838aa6a.js new file mode 100644 index 0000000..03ddb1f --- /dev/null +++ b/build/assets/js/286.d838aa6a.js @@ -0,0 +1 @@ +(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[286],{9286:(e,t,n)=>{"use strict";n.d(t,{Z:()=>$});var o=n(3366),r=n(7294),s=n(2389),c=n(512),a=n(2949),l=n(6668);function i(){var e=(0,l.L)().prism,t=(0,a.I)().colorMode,n=e.theme,o=e.darkTheme||n;return"dark"===t?o:n}var u=n(5281),d=n(6528),m=n(7594),f=n.n(m),p=(0,d.Z)(/title=(["'])(.*?)\1/,{quote:1,title:2}),b=(0,d.Z)(/\{([\d,-]+)\}/,{range:1}),h={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},g=Object.assign({},h,{lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}}),v=Object.keys(h);function k(e,t){var n=e.map((function(e){var n=g[e],o=n.start,r=n.end;return"(?:"+o+"\\s*("+t.flatMap((function(e){var t,n;return[e.line,null==(t=e.block)?void 0:t.start,null==(n=e.block)?void 0:n.end].filter(Boolean)})).join("|")+")\\s*"+r+")"})).join("|");return new RegExp("^\\s*(?:"+n+")\\s*$")}function j(e,t){var n=e.replace(/\n$/,""),o=t.language,r=t.magicComments,s=t.metastring;if(s&&b.test(s)){var c=s.match(b).groups.range;if(0===r.length)throw new Error("A highlight range has been given in code block's metastring (``` "+s+"), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.");var a=r[0].className,l=f()(c).filter((function(e){return e>0})).map((function(e){return[e-1,[a]]}));return{lineClassNames:Object.fromEntries(l),code:n}}if(void 0===o)return{lineClassNames:{},code:n};for(var i=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return k(["js","jsBlock"],t);case"jsx":case"tsx":return k(["js","jsBlock","jsx"],t);case"html":return k(["js","jsBlock","html"],t);case"python":case"py":case"bash":return k(["bash"],t);case"markdown":case"md":return k(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return k(["tex"],t);case"lua":case"haskell":case"sql":return k(["lua"],t);case"wasm":return k(["wasm"],t);case"vb":case"vbnet":case"vba":case"visual-basic":return k(["vb","rem"],t);case"batch":return k(["rem"],t);case"basic":return k(["rem","f90"],t);case"fsharp":return k(["js","ml"],t);case"ocaml":case"sml":return k(["ml"],t);case"fortran":return k(["f90"],t);case"cobol":return k(["cobol"],t);default:return k(v,t)}}(o,r),u=n.split("\n"),d=Object.fromEntries(r.map((function(e){return[e.className,{start:0,range:""}]}))),m=Object.fromEntries(r.filter((function(e){return e.line})).map((function(e){var t=e.className;return[e.line,t]}))),p=Object.fromEntries(r.filter((function(e){return e.block})).map((function(e){var t=e.className;return[e.block.start,t]}))),h=Object.fromEntries(r.filter((function(e){return e.block})).map((function(e){var t=e.className;return[e.block.end,t]}))),g=0;g0&&c.getRangeAt(0);o.append(r),r.select(),r.selectionStart=0,r.selectionEnd=e.length;var l=!1;try{l=document.execCommand("copy")}catch(i){}r.remove(),a&&(c.removeAllRanges(),c.addRange(a)),s&&s.focus()}(t),a(!0),l.current=window.setTimeout((function(){a(!1)}),1e3)}),[t]);return(0,r.useEffect)((function(){return function(){return window.clearTimeout(l.current)}}),[]),(0,x.jsx)("button",{type:"button","aria-label":s?(0,O.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,O.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,O.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,c.Z)("clean-btn",n,W.copyButton,s&&W.copyButtonCopied),onClick:i,children:(0,x.jsxs)("span",{className:W.copyButtonIcons,"aria-hidden":"true",children:[(0,x.jsx)(T,{className:W.copyButtonIcon}),(0,x.jsx)(Z,{className:W.copyButtonSuccessIcon})]})})}function M(e){return(0,x.jsx)("svg",Object.assign({viewBox:"0 0 24 24"},e,{children:(0,x.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})}))}const V={wordWrapButtonIcon:"wordWrapButtonIcon_Bwma",wordWrapButtonEnabled:"wordWrapButtonEnabled_EoeP"};function R(e){var t=e.className,n=e.onClick,o=e.isEnabled,r=(0,O.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,x.jsx)("button",{type:"button",onClick:n,className:(0,c.Z)("clean-btn",t,o&&V.wordWrapButtonEnabled),"aria-label":r,title:r,children:(0,x.jsx)(M,{className:V.wordWrapButtonIcon,"aria-hidden":"true"})})}function P(e){var t,n,o,s,a,u,d,m,f,b,h,g=e.children,v=e.className,k=void 0===v?"":v,B=e.metastring,y=e.title,C=e.showLineNumbers,L=e.language,E=(0,l.L)().prism,_=E.defaultLanguage,O=E.magicComments,T=function(e){return null==e?void 0:e.toLowerCase()}(null!=(t=null!=L?L:null==(n=k.split(" ").find((function(e){return e.startsWith("language-")})))?void 0:n.replace(/language-/,""))?t:_),Z=i(),W=(o=(0,r.useState)(!1),s=o[0],a=o[1],u=(0,r.useState)(!1),d=u[0],m=u[1],f=(0,r.useRef)(null),b=(0,r.useCallback)((function(){var e=f.current.querySelector("code");s?e.removeAttribute("style"):(e.style.whiteSpace="pre-wrap",e.style.overflowWrap="anywhere"),a((function(e){return!e}))}),[f,s]),h=(0,r.useCallback)((function(){var e=f.current,t=e.scrollWidth>e.clientWidth||f.current.querySelector("code").hasAttribute("style");m(t)}),[f]),I(f,h),(0,r.useEffect)((function(){h()}),[s,h]),(0,r.useEffect)((function(){return window.addEventListener("resize",h,{passive:!0}),function(){window.removeEventListener("resize",h)}}),[h]),{codeBlockRef:f,isEnabled:s,isCodeScrollable:d,toggle:b}),M=function(e){var t,n;return null!=(t=null==e||null==(n=e.match(p))?void 0:n.groups.title)?t:""}(B)||y,V=j(g,{metastring:B,language:T,magicComments:O}),P=V.lineClassNames,z=V.code,$=null!=C?C:function(e){return Boolean(null==e?void 0:e.includes("showLineNumbers"))}(B);return(0,x.jsxs)(N,{as:"div",className:(0,c.Z)(k,T&&!k.includes("language-"+T)&&"language-"+T),children:[M&&(0,x.jsx)("div",{className:w.codeBlockTitle,children:M}),(0,x.jsxs)("div",{className:w.codeBlockContent,children:[(0,x.jsx)(S.y$,{theme:Z,code:z,language:null!=T?T:"text",children:function(e){var t=e.className,n=e.style,o=e.tokens,r=e.getLineProps,s=e.getTokenProps;return(0,x.jsx)("pre",{tabIndex:0,ref:W.codeBlockRef,className:(0,c.Z)(t,w.codeBlock,"thin-scrollbar"),style:n,children:(0,x.jsx)("code",{className:(0,c.Z)(w.codeBlockLines,$&&w.codeBlockLinesWithNumbering),children:o.map((function(e,t){return(0,x.jsx)(A,{line:e,getLineProps:r,getTokenProps:s,classNames:P[t],showLineNumbers:$},t)}))})})}}),(0,x.jsxs)("div",{className:w.buttonGroup,children:[(W.isEnabled||W.isCodeScrollable)&&(0,x.jsx)(R,{className:w.codeButton,onClick:function(){return W.toggle()},isEnabled:W.isEnabled}),(0,x.jsx)(H,{className:w.codeButton,code:z})]})]})]})}var z=["children"];function $(e){var t=e.children,n=(0,o.Z)(e,z),c=(0,s.Z)(),a=function(e){return r.Children.toArray(e).some((function(e){return(0,r.isValidElement)(e)}))?e:Array.isArray(e)?e.join(""):e}(t),l="string"==typeof a?P:C;return(0,x.jsx)(l,Object.assign({},n,{children:a}),String(c))}},7594:(e,t)=>{function n(e){let t,n=[];for(let o of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(o))n.push(parseInt(o,10));else if(t=o.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,o,r,s]=t;if(o&&s){o=parseInt(o),s=parseInt(s);const e=o{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>c,default:()=>m,frontMatter:()=>o,metadata:()=>a,toc:()=>d});var i=t(5893),s=t(1151);const o={id:"finite-state-machines",title:"Finite state machines"},c=void 0,a={id:"recipes/finite-state-machines",title:"Finite state machines",description:"With xoid, a wide range of finite state machines can be expressed.",source:"@site/main/docs/recipes/finite-state-machines.md",sourceDirName:"recipes",slug:"/recipes/finite-state-machines",permalink:"/docs/recipes/finite-state-machines",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes/finite-state-machines.md",tags:[],version:"current",lastUpdatedAt:1696460720,formattedLastUpdatedAt:"Oct 4, 2023",frontMatter:{id:"finite-state-machines",title:"Finite state machines"},sidebar:"docs",previous:{title:"Redux Devtools integration",permalink:"/docs/recipes/redux-devtools-integration"},next:{title:"Persisting data with localStorage",permalink:"/docs/recipes/persist-localstorage"}},r={},d=[];function l(e){const n={code:"code",p:"p",pre:"pre",strong:"strong",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["With ",(0,i.jsx)(n.strong,{children:"xoid"}),", a wide range of finite state machines can be expressed."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"const createMachine = () => {\n function melt() {\n machine.set(liquid)\n console.log('I melted')\n }\n\n function freeze() {\n machine.set(solid)\n console.log('I freezed')\n }\n\n function condense() {\n machine.set(liquid)\n console.log('I condensed')\n }\n\n function vaporize() {\n machine.set(gas)\n console.log('I vaporized')\n }\n\n const solid = { name: \"ice\", actions: { melt } };\n const liquid = { name: \"water\", actions: { freeze, vaporize } };\n const gas = { name: \"vapor\", actions: { condense } };\n\n const machine = create(solid)\n return machine;\n}\n\nconst App = () => {\n const { name, actions } = useAtom(createMachine)\n return (\n
    \n {name}\n {Object.keys(actions).map((key) => (\n \n ))}\n
    \n )\n}\n"})})]})}function m(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>c});var i=t(7294);const s={},o=i.createContext(s);function c(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/2ed64405.6bb1ff25.js b/build/assets/js/2ed64405.6bb1ff25.js new file mode 100644 index 0000000..082c3b0 --- /dev/null +++ b/build/assets/js/2ed64405.6bb1ff25.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[841],{9250:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>a,default:()=>p,frontMatter:()=>i,metadata:()=>r,toc:()=>c});var o=n(5893),s=n(1151);const i={id:"redux-devtools-integration",title:"Redux Devtools integration"},a=void 0,r={id:"recipes/redux-devtools-integration",title:"Redux Devtools integration",description:"Import @xoid/devtools and set a debugValue to your atom. It will send values to the Redux Devtools Extension.",source:"@site/main/docs/recipes/redux-devtools-integration.md",sourceDirName:"recipes",slug:"/recipes/redux-devtools-integration",permalink:"/docs/recipes/redux-devtools-integration",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes/redux-devtools-integration.md",tags:[],version:"current",lastUpdatedAt:1673200693,formattedLastUpdatedAt:"Jan 8, 2023",frontMatter:{id:"redux-devtools-integration",title:"Redux Devtools integration"},sidebar:"docs",previous:{title:"Using in an existing Redux App",permalink:"/docs/recipes/redux-interop"},next:{title:"Finite state machines",permalink:"/docs/recipes/finite-state-machines"}},d={},c=[];function l(e){const t={code:"code",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.p,{children:["Import ",(0,o.jsx)(t.code,{children:"@xoid/devtools"})," and set a ",(0,o.jsx)(t.code,{children:"debugValue"})," to your atom. It will send values to the Redux Devtools Extension."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",children:"import { devtools } from '@xoid/devtools'\nimport { create, use } from 'xoid'\ndevtools() // run once\n\nconst atom = create(\n { alpha: 5 }, \n (atom) => {\n const $alpha = atom.focus(s => s.alpha)\n return {\n inc: () => $alpha.update(s => s + 1),\n resetState: () => atom.set({ alpha: 5 })\n deeply: {\n nested: {\n action: () => $alpha.set(5)\n }\n } \n }\n }\n)\n\natom.debugValue = 'myAtom' // enable watching it by the devtools\n\nconst { deeply, incrementAlpha } = atom.actions // destructuring is no problem\nincrementAlpha() // logs \"(myAtom).incrementAlpha\"\ndeeply.nested.action() // logs \"(myAtom).deeply.nested.action\"\natom.focus(s => s.alpha).set(25) // logs \"(myAtom) Update ([timestamp])\n"})})]})}function p(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>r,a:()=>a});var o=n(7294);const s={},i=o.createContext(s);function a(e){const t=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),o.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/2f347b4a.66b84b62.js b/build/assets/js/2f347b4a.66b84b62.js new file mode 100644 index 0000000..b1fd512 --- /dev/null +++ b/build/assets/js/2f347b4a.66b84b62.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[984],{2135:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>s,default:()=>l,frontMatter:()=>r,metadata:()=>a,toc:()=>u});var c=n(5893),o=n(1151);const r={id:"creating-react-custom-hooks",title:"Creating React custom hooks"},s=void 0,a={id:"recipes-react/creating-react-custom-hooks",title:"Creating React custom hooks",description:"With the second argument set to true, useAtom returns a 2-item tuple.",source:"@site/main/docs/recipes-react/creating-react-custom-hooks.md",sourceDirName:"recipes-react",slug:"/recipes-react/creating-react-custom-hooks",permalink:"/docs/recipes-react/creating-react-custom-hooks",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes-react/creating-react-custom-hooks.md",tags:[],version:"current",lastUpdatedAt:1696460720,formattedLastUpdatedAt:"Oct 4, 2023",frontMatter:{id:"creating-react-custom-hooks",title:"Creating React custom hooks"},sidebar:"docs",previous:{title:"Using context correctly",permalink:"/docs/recipes-react/using-context-correctly"},next:{title:"Dynamic functions with fixed references",permalink:"/docs/recipes-react/dynamic-functions-with-fixed-references"}},i={},u=[];function d(e){const t={blockquote:"blockquote",code:"code",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t.pre,{children:(0,c.jsx)(t.code,{className:"language-js",children:"const CounterModel = (value: number) =>\n create(value, (atom) => ({\n increment: () => atom.update((s) => s + 1),\n decrement: () => atom.update((s) => s - 1),\n }))\n\nconst useCounter = (value: number) => useAtom(() => CounterModel(value), true)\n"})}),"\n",(0,c.jsxs)(t.blockquote,{children:["\n",(0,c.jsxs)(t.p,{children:["With the second argument set to ",(0,c.jsx)(t.code,{children:"true"}),", ",(0,c.jsx)(t.code,{children:"useAtom"})," returns a 2-item tuple."]}),"\n"]}),"\n",(0,c.jsx)(t.pre,{children:(0,c.jsx)(t.code,{className:"language-js",children:"const [state, { increment, decrement }] = useCounter(0)\n"})})]})}function l(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,c.jsx)(t,{...e,children:(0,c.jsx)(d,{...e})}):d(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>s});var c=n(7294);const o={},r=c.createContext(o);function s(e){const t=c.useContext(r);return c.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),c.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/31ee3e38.0790777c.js b/build/assets/js/31ee3e38.0790777c.js new file mode 100644 index 0000000..e4ca552 --- /dev/null +++ b/build/assets/js/31ee3e38.0790777c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[75],{4680:(e,s,o)=>{o.r(s),o.d(s,{assets:()=>a,contentTitle:()=>d,default:()=>c,frontMatter:()=>n,metadata:()=>l,toc:()=>r});var t=o(5893),i=o(1151);const n={title:"Examples"},d=void 0,l={id:"examples",title:"Examples",description:"- Counter Open in CodeSandbox",source:"@site/main/docs/examples.md",sourceDirName:".",slug:"/examples",permalink:"/docs/examples",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/examples.md",tags:[],version:"current",lastUpdatedAt:1696936626,formattedLastUpdatedAt:"Oct 10, 2023",frontMatter:{title:"Examples"}},a={},r=[];function x(e){const s={a:"a",img:"img",li:"li",p:"p",ul:"ul",...(0,i.a)(),...e.components};return(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://github.com/xoidlabs/xoid/blob/master/examples/counter",children:"Counter"})," ",(0,t.jsx)(s.a,{href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/counter",children:(0,t.jsx)(s.img,{src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})})]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://github.com/xoidlabs/xoid/blob/master/examples/todos-basic",children:"Todos (Basic)"})," ",(0,t.jsx)(s.a,{href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/todos-basic",children:(0,t.jsx)(s.img,{src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})})]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://github.com/xoidlabs/xoid/blob/master/examples/todos-filtered",children:"Todos (Filtered)"})," ",(0,t.jsx)(s.a,{href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/todos-filtered",children:(0,t.jsx)(s.img,{src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})})]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://github.com/xoidlabs/xoid/blob/master/examples/celcius-fahrenheit",children:"Celcius-Fahrenheit conversion"})," ",(0,t.jsx)(s.a,{href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/celcius-fahrenheit",children:(0,t.jsx)(s.img,{src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})})]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://github.com/xoidlabs/xoid/blob/master/examples/finite-state-stopwatch",children:"Finite state stopwatch"})," ",(0,t.jsx)(s.a,{href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/finite-state-stopwatch",children:(0,t.jsx)(s.img,{src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})})]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/dots-and-arrows",children:"Dots and arrows"})," ",(0,t.jsx)(s.a,{href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/dots-and-arrows",children:(0,t.jsx)(s.img,{src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})})]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://github.com/xoidlabs/xoid/blob/master/examples/transient-update-resize-observer",children:"Transient update resize observer"})," ",(0,t.jsx)(s.a,{href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/transient-update-resize-observer",children:(0,t.jsx)(s.img,{src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})})]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:[(0,t.jsx)(s.a,{href:"https://github.com/xoidlabs/xoid/tree/master/examples/xoid-vs-usereducer-vs-usemethods",children:"xoid vs useReducer vs useMethods"})," ",(0,t.jsx)(s.a,{href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/xoid-vs-usereducer-vs-usemethods",children:(0,t.jsx)(s.img,{src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})})]}),"\n"]}),"\n"]})}function c(e={}){const{wrapper:s}={...(0,i.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(x,{...e})}):x(e)}},1151:(e,s,o)=>{o.d(s,{Z:()=>l,a:()=>d});var t=o(7294);const i={},n=t.createContext(i);function d(e){const s=t.useContext(n);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:d(e.components),t.createElement(n.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/37baf4df.2dc4f4ea.js b/build/assets/js/37baf4df.2dc4f4ea.js new file mode 100644 index 0000000..dddd902 --- /dev/null +++ b/build/assets/js/37baf4df.2dc4f4ea.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[893],{6671:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>m,frontMatter:()=>r,metadata:()=>c,toc:()=>a});var i=t(5893),s=t(1151);const r={id:"using-immer",title:"Using immer"},o=void 0,c={id:"recipes/using-immer",title:"Using immer",description:"While xoid's API surface is kept small intentionally, there's a way for extensions.",source:"@site/main/docs/recipes/using-immer.md",sourceDirName:"recipes",slug:"/recipes/using-immer",permalink:"/docs/recipes/using-immer",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes/using-immer.md",tags:[],version:"current",lastUpdatedAt:1675507638,formattedLastUpdatedAt:"Feb 4, 2023",frontMatter:{id:"using-immer",title:"Using immer"},sidebar:"docs",previous:{title:"Working with nested state",permalink:"/docs/recipes/nested-state"},next:{title:"Using reducers",permalink:"/docs/recipes/using-reducers"}},d={},a=[];function l(e){const n={code:"code",p:"p",pre:"pre",strong:"strong",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["While ",(0,i.jsx)(n.strong,{children:"xoid"}),"'s API surface is kept small intentionally, there's a way for extensions.\nIf you'd like to add a ",(0,i.jsx)(n.code,{children:".produce"})," method that uses ",(0,i.jsx)(n.strong,{children:"immer"})," internally, you can do it like the following."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"import { create } from 'xoid'\nimport { produce } from 'immer'\n\ncreate.plugins.push((atom) => {\n atom.produce = (fn) => atom.update((s) => produce(s, fn))\n})\n"})}),"\n",(0,i.jsx)(n.p,{children:"If you're using TypeScript, simply apply the following module augmentation:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"declare module 'xoid' {\n interface Atom {\n produce: (fn: (draft: T) => void) => void\n }\n interface Stream {\n produce: (fn: (draft: T) => void) => void\n }\n}\n"})})]})}function m(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>o});var i=t(7294);const s={},r=i.createContext(s);function o(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/426.1e26114b.js b/build/assets/js/426.1e26114b.js new file mode 100644 index 0000000..7deb0cd --- /dev/null +++ b/build/assets/js/426.1e26114b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[426],{1426:(e,t,r)=>{function n(e,t){var r=void 0;return function(){for(var n=arguments.length,o=new Array(n),i=0;ipn});var a=function(){};function c(e){var t=e.item,r=e.items;return{index:t.__autocomplete_indexName,items:[t],positions:[1+r.findIndex((function(e){return e.objectID===t.objectID}))],queryID:t.__autocomplete_queryID,algoliaSource:["autocomplete"]}}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,c=[],l=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(s){u=!0,o=s}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t=3||2===r&&n>=4||1===r&&n>=10);function i(t,r,n){if(o&&void 0!==n){var i=n[0].__autocomplete_algoliaCredentials,a={"X-Algolia-Application-Id":i.appId,"X-Algolia-API-Key":i.apiKey};e.apply(void 0,[t].concat(p(r),[{headers:a}]))}else e.apply(void 0,[t].concat(p(r)))}return{init:function(t,r){e("init",{appId:t,apiKey:r})},setUserToken:function(t){e("setUserToken",t)},clickedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&i("clickedObjectIDsAfterSearch",g(t),t[0].items)},clickedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&i("clickedObjectIDs",g(t),t[0].items)},clickedFilters:function(){for(var t=arguments.length,r=new Array(t),n=0;n0&&e.apply(void 0,["clickedFilters"].concat(r))},convertedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&i("convertedObjectIDsAfterSearch",g(t),t[0].items)},convertedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&i("convertedObjectIDs",g(t),t[0].items)},convertedFilters:function(){for(var t=arguments.length,r=new Array(t),n=0;n0&&e.apply(void 0,["convertedFilters"].concat(r))},viewedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&t.reduce((function(e,t){var r=t.items,n=d(t,f);return[].concat(p(e),p(function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,r=[],n=0;n0&&e.apply(void 0,["viewedFilters"].concat(r))}}}function S(e){var t=e.items.reduce((function(e,t){var r;return e[t.__autocomplete_indexName]=(null!==(r=e[t.__autocomplete_indexName])&&void 0!==r?r:[]).concat(t),e}),{});return Object.keys(t).map((function(e){return{index:e,items:t[e],algoliaSource:["autocomplete"]}}))}function j(e){return e.objectID&&e.__autocomplete_indexName&&e.__autocomplete_queryID}function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function E(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return P(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&C({onItemsChange:o,items:r,insights:f,state:t}))}}),0);return{name:"aa.algoliaInsightsPlugin",subscribe:function(e){var t=e.setContext,r=e.onSelect,n=e.onActive;s("addAlgoliaAgent","insights-plugin"),t({algoliaInsightsPlugin:{__algoliaSearchParameters:{clickAnalytics:!0},insights:f}}),r((function(e){var t=e.item,r=e.state,n=e.event;j(t)&&l({state:r,event:n,insights:f,item:t,insightsEvents:[D({eventName:"Item Selected"},c({item:t,items:m.current}))]})})),n((function(e){var t=e.item,r=e.state,n=e.event;j(t)&&u({state:r,event:n,insights:f,item:t,insightsEvents:[D({eventName:"Item Active"},c({item:t,items:m.current}))]})}))},onStateChange:function(e){var t=e.state;p({state:t})},__autocomplete_pluginOptions:e}}function N(e){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N(e)}function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function q(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==N(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==N(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===N(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R(e,t,r){var n,o=t.initialState;return{getState:function(){return o},dispatch:function(n,i){var a=function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0},reshape:function(e){return e.sources}},e),{},{id:null!==(r=e.id)&&void 0!==r?r:"autocomplete-".concat(V++),plugins:o,initialState:X({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var r;null===(r=e.onStateChange)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onStateChange)||void 0===r?void 0:r.call(e,t)}))},onSubmit:function(t){var r;null===(r=e.onSubmit)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onSubmit)||void 0===r?void 0:r.call(e,t)}))},onReset:function(t){var r;null===(r=e.onReset)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onReset)||void 0===r?void 0:r.call(e,t)}))},getSources:function(r){return Promise.all([].concat(Q(o.map((function(e){return e.getSources}))),[e.getSources]).filter(Boolean).map((function(e){return function(e,t){var r=[];return Promise.resolve(e(t)).then((function(e){return Array.isArray(e),Promise.all(e.filter((function(e){return Boolean(e)})).map((function(e){if(e.sourceId,r.includes(e.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(e.sourceId)," is not unique."));r.push(e.sourceId);var t={getItemInputValue:function(e){return e.state.query},getItemUrl:function(){},onSelect:function(e){(0,e.setIsOpen)(!1)},onActive:a,onResolve:a};Object.keys(t).forEach((function(e){t[e].__default=!0}));var n=$($({},t),e);return Promise.resolve(n)})))}))}(e,r)}))).then((function(e){return L(e)})).then((function(e){return e.map((function(e){return X(X({},e),{},{onSelect:function(r){e.onSelect(r),t.forEach((function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,r)}))},onActive:function(r){e.onActive(r),t.forEach((function(e){var t;return null===(t=e.onActive)||void 0===t?void 0:t.call(e,r)}))},onResolve:function(r){e.onResolve(r),t.forEach((function(e){var t;return null===(t=e.onResolve)||void 0===t?void 0:t.call(e,r)}))}})}))}))},navigator:X({navigate:function(e){var t=e.itemUrl;n.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,r=n.open(t,"_blank","noopener");null==r||r.focus()},navigateNewWindow:function(e){var t=e.itemUrl;n.open(t,"_blank","noopener")}},e.navigator)})}function te(e){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(e)}function re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ne(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Ie,De,Ae,ke=null,xe=(Ie=-1,De=-1,Ae=void 0,function(e){var t=++Ie;return Promise.resolve(e).then((function(e){return Ae&&t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Me=/((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i;function He(e){return He="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},He(e)}var Fe=["props","refresh","store"],Ue=["inputElement","formElement","panelElement"],Be=["inputElement"],Ve=["inputElement","maxLength"],Ke=["sourceIndex"],$e=["sourceIndex"],Je=["item","source","sourceIndex"];function ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function We(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Ge(e){var t=e.props,r=e.refresh,n=e.store,o=Ze(e,Fe),i=function(e,t){return void 0!==t?"".concat(e,"-").concat(t):e};return{getEnvironmentProps:function(e){var r=e.inputElement,o=e.formElement,i=e.panelElement;function a(e){!n.getState().isOpen&&n.pendingRequests.isEmpty()||e.target===r||!1===[o,i].some((function(t){return r=t,n=e.target,r===n||r.contains(n);var r,n}))&&(n.dispatch("blur",null),t.debug||n.pendingRequests.cancelAll())}return We({onTouchStart:a,onMouseDown:a,onTouchMove:function(e){!1!==n.getState().isOpen&&r===t.environment.document.activeElement&&e.target!==r&&r.blur()}},Ze(e,Ue))},getRootProps:function(e){return We({role:"combobox","aria-expanded":n.getState().isOpen,"aria-haspopup":"listbox","aria-owns":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label")},e)},getFormProps:function(e){e.inputElement;return We({action:"",noValidate:!0,role:"search",onSubmit:function(i){var a;i.preventDefault(),t.onSubmit(We({event:i,refresh:r,state:n.getState()},o)),n.dispatch("submit",null),null===(a=e.inputElement)||void 0===a||a.blur()},onReset:function(i){var a;i.preventDefault(),t.onReset(We({event:i,refresh:r,state:n.getState()},o)),n.dispatch("reset",null),null===(a=e.inputElement)||void 0===a||a.focus()}},Ze(e,Be))},getLabelProps:function(e){var r=e||{},n=r.sourceIndex,o=Ze(r,Ke);return We({htmlFor:"".concat(i(t.id,n),"-input"),id:"".concat(i(t.id,n),"-label")},o)},getInputProps:function(e){var i;function c(e){(t.openOnFocus||Boolean(n.getState().query))&&Ce(We({event:e,props:t,query:n.getState().completion||n.getState().query,refresh:r,store:n},o)),n.dispatch("focus",null)}var l=e||{},u=(l.inputElement,l.maxLength),s=void 0===u?512:u,f=Ze(l,Ve),m=ge(n.getState()),p=function(e){return Boolean(e&&e.match(Me))}((null===(i=t.environment.navigator)||void 0===i?void 0:i.userAgent)||""),v=null!=m&&m.itemUrl&&!p?"go":"search";return We({"aria-autocomplete":"both","aria-activedescendant":n.getState().isOpen&&null!==n.getState().activeItemId?"".concat(t.id,"-item-").concat(n.getState().activeItemId):void 0,"aria-controls":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label"),value:n.getState().completion||n.getState().query,id:"".concat(t.id,"-input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:v,spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:s,type:"search",onChange:function(e){Ce(We({event:e,props:t,query:e.currentTarget.value.slice(0,s),refresh:r,store:n},o))},onKeyDown:function(e){!function(e){var t=e.event,r=e.props,n=e.refresh,o=e.store,i=Le(e,Ne);if("ArrowUp"===t.key||"ArrowDown"===t.key){var a=function(){var e=r.environment.document.getElementById("".concat(r.id,"-item-").concat(o.getState().activeItemId));e&&(e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded(!1):e.scrollIntoView(!1))},c=function(){var e=ge(o.getState());if(null!==o.getState().activeItemId&&e){var r=e.item,a=e.itemInputValue,c=e.itemUrl,l=e.source;l.onActive(qe({event:t,item:r,itemInputValue:a,itemUrl:c,refresh:n,source:l,state:o.getState()},i))}};t.preventDefault(),!1===o.getState().isOpen&&(r.openOnFocus||Boolean(o.getState().query))?Ce(qe({event:t,props:r,query:o.getState().query,refresh:n,store:o},i)).then((function(){o.dispatch(t.key,{nextActiveItemId:r.defaultActiveItemId}),c(),setTimeout(a,0)})):(o.dispatch(t.key,{}),c(),a())}else if("Escape"===t.key)t.preventDefault(),o.dispatch(t.key,null),o.pendingRequests.cancelAll();else if("Tab"===t.key)o.dispatch("blur",null),o.pendingRequests.cancelAll();else if("Enter"===t.key){if(null===o.getState().activeItemId||o.getState().collections.every((function(e){return 0===e.items.length})))return void(r.debug||o.pendingRequests.cancelAll());t.preventDefault();var l=ge(o.getState()),u=l.item,s=l.itemInputValue,f=l.itemUrl,m=l.source;if(t.metaKey||t.ctrlKey)void 0!==f&&(m.onSelect(qe({event:t,item:u,itemInputValue:s,itemUrl:f,refresh:n,source:m,state:o.getState()},i)),r.navigator.navigateNewTab({itemUrl:f,item:u,state:o.getState()}));else if(t.shiftKey)void 0!==f&&(m.onSelect(qe({event:t,item:u,itemInputValue:s,itemUrl:f,refresh:n,source:m,state:o.getState()},i)),r.navigator.navigateNewWindow({itemUrl:f,item:u,state:o.getState()}));else if(t.altKey);else{if(void 0!==f)return m.onSelect(qe({event:t,item:u,itemInputValue:s,itemUrl:f,refresh:n,source:m,state:o.getState()},i)),void r.navigator.navigate({itemUrl:f,item:u,state:o.getState()});Ce(qe({event:t,nextState:{isOpen:!1},props:r,query:s,refresh:n,store:o},i)).then((function(){m.onSelect(qe({event:t,item:u,itemInputValue:s,itemUrl:f,refresh:n,source:m,state:o.getState()},i))}))}}}(We({event:e,props:t,refresh:r,store:n},o))},onFocus:c,onBlur:a,onClick:function(r){e.inputElement!==t.environment.document.activeElement||n.getState().isOpen||c(r)}},f)},getPanelProps:function(e){return We({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){n.dispatch("mouseleave",null)}},e)},getListProps:function(e){var r=e||{},n=r.sourceIndex,o=Ze(r,$e);return We({role:"listbox","aria-labelledby":"".concat(i(t.id,n),"-label"),id:"".concat(i(t.id,n),"-list")},o)},getItemProps:function(e){var a=e.item,c=e.source,l=e.sourceIndex,u=Ze(e,Je);return We({id:"".concat(i(t.id,l),"-item-").concat(a.__autocomplete_id),role:"option","aria-selected":n.getState().activeItemId===a.__autocomplete_id,onMouseMove:function(e){if(a.__autocomplete_id!==n.getState().activeItemId){n.dispatch("mousemove",a.__autocomplete_id);var t=ge(n.getState());if(null!==n.getState().activeItemId&&t){var i=t.item,c=t.itemInputValue,l=t.itemUrl,u=t.source;u.onActive(We({event:e,item:i,itemInputValue:c,itemUrl:l,refresh:r,source:u,state:n.getState()},o))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var i=c.getItemInputValue({item:a,state:n.getState()}),l=c.getItemUrl({item:a,state:n.getState()});(l?Promise.resolve():Ce(We({event:e,nextState:{isOpen:!1},props:t,query:i,refresh:r,store:n},o))).then((function(){c.onSelect(We({event:e,item:a,itemInputValue:i,itemUrl:l,refresh:r,source:c,state:n.getState()},o))}))}},u)}}}var Xe=[{segment:"autocomplete-core",version:"1.9.3"}];function Ye(e){return Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ye(e)}function et(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t=r?null===n?null:0:o}function at(e){return at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},at(e)}function ct(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lt(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function kt(e){var t=e.translations,r=void 0===t?{}:t,n=At(e,Pt),o=r.noResultsText,i=void 0===o?"No results for":o,a=r.suggestedQueryText,c=void 0===a?"Try searching for":a,l=r.reportMissingResultsText,u=void 0===l?"Believe this query should return results?":l,s=r.reportMissingResultsLinkText,f=void 0===s?"Let us know.":s,m=n.state.context.searchSuggestions;return yt.createElement("div",{className:"DocSearch-NoResults"},yt.createElement("div",{className:"DocSearch-Screen-Icon"},yt.createElement(Et,null)),yt.createElement("p",{className:"DocSearch-Title"},i,' "',yt.createElement("strong",null,n.state.query),'"'),m&&m.length>0&&yt.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},yt.createElement("p",{className:"DocSearch-Help"},c,":"),yt.createElement("ul",null,m.slice(0,3).reduce((function(e,t){return[].concat(It(e),[yt.createElement("li",{key:t},yt.createElement("button",{className:"DocSearch-Prefill",key:t,type:"button",onClick:function(){n.setQuery(t.toLowerCase()+" "),n.refresh(),n.inputRef.current.focus()}},t))])}),[]))),n.getMissingResultsUrl&&yt.createElement("p",{className:"DocSearch-Help"},"".concat(u," "),yt.createElement("a",{href:n.getMissingResultsUrl({query:n.state.query}),target:"_blank",rel:"noopener noreferrer"},f)))}var xt=function(){return yt.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},yt.createElement("path",{d:"M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))};function Ct(e){switch(e.type){case"lvl1":return yt.createElement(xt,null);case"content":return yt.createElement(Nt,null);default:return yt.createElement(_t,null)}}function _t(){return yt.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},yt.createElement("path",{d:"M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function Nt(){return yt.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},yt.createElement("path",{d:"M17 5H3h14zm0 5H3h14zm0 5H3h14z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function Tt(){return yt.createElement("svg",{className:"DocSearch-Hit-Select-Icon",width:"20",height:"20",viewBox:"0 0 20 20"},yt.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},yt.createElement("path",{d:"M18 3v4c0 2-2 4-4 4H2"}),yt.createElement("path",{d:"M8 17l-6-6 6-6"})))}var qt=["hit","attribute","tagName"];function Rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Lt(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Ft(e,t){return t.split(".").reduce((function(e,t){return null!=e&&e[t]?e[t]:null}),e)}function Ut(e){var t=e.hit,r=e.attribute,n=e.tagName,o=void 0===n?"span":n,i=Ht(e,qt);return(0,yt.createElement)(o,Lt(Lt({},i),{},{dangerouslySetInnerHTML:{__html:Ft(t,"_snippetResult.".concat(r,".value"))||Ft(t,r)}}))}function Bt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(l){c=!0,o=l}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r|<\/mark>)/g,Wt=RegExp(zt.source);function Qt(e){var t,r,n=e;if(!n.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;var o=((n.__docsearch_parent?null===(t=n.__docsearch_parent)||void 0===t||null===(t=t._highlightResult)||void 0===t||null===(t=t.hierarchy)||void 0===t?void 0:t.lvl0:null===(r=e._highlightResult)||void 0===r||null===(r=r.hierarchy)||void 0===r?void 0:r.lvl0)||{}).value;return o&&Wt.test(o)?o.replace(zt,""):o}function Zt(){return Zt=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function or(e){var t=e.translations,r=void 0===t?{}:t,n=nr(e,tr),o=r.recentSearchesTitle,i=void 0===o?"Recent":o,a=r.noRecentSearchesText,c=void 0===a?"No recent searches":a,l=r.saveRecentSearchButtonTitle,u=void 0===l?"Save this search":l,s=r.removeRecentSearchButtonTitle,f=void 0===s?"Remove this search from history":s,m=r.favoriteSearchesTitle,p=void 0===m?"Favorite":m,v=r.removeFavoriteSearchButtonTitle,d=void 0===v?"Remove this search from favorites":v;return"idle"===n.state.status&&!1===n.hasCollections?n.disableUserPersonalization?null:yt.createElement("div",{className:"DocSearch-StartScreen"},yt.createElement("p",{className:"DocSearch-Help"},c)):!1===n.hasCollections?null:yt.createElement("div",{className:"DocSearch-Dropdown-Container"},yt.createElement($t,rr({},n,{title:i,collection:n.state.collections[0],renderIcon:function(){return yt.createElement("div",{className:"DocSearch-Hit-icon"},yt.createElement(Xt,null))},renderAction:function(e){var t=e.item,r=e.runFavoriteTransition,o=e.runDeleteTransition;return yt.createElement(yt.Fragment,null,yt.createElement("div",{className:"DocSearch-Hit-action"},yt.createElement("button",{className:"DocSearch-Hit-action-button",title:u,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r((function(){n.favoriteSearches.add(t),n.recentSearches.remove(t),n.refresh()}))}},yt.createElement(Yt,null))),yt.createElement("div",{className:"DocSearch-Hit-action"},yt.createElement("button",{className:"DocSearch-Hit-action-button",title:f,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),o((function(){n.recentSearches.remove(t),n.refresh()}))}},yt.createElement(er,null))))}})),yt.createElement($t,rr({},n,{title:p,collection:n.state.collections[1],renderIcon:function(){return yt.createElement("div",{className:"DocSearch-Hit-icon"},yt.createElement(Yt,null))},renderAction:function(e){var t=e.item,r=e.runDeleteTransition;return yt.createElement("div",{className:"DocSearch-Hit-action"},yt.createElement("button",{className:"DocSearch-Hit-action-button",title:d,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r((function(){n.favoriteSearches.remove(t),n.refresh()}))}},yt.createElement(er,null)))}})))}var ir=["translations"];function ar(){return ar=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var lr=yt.memo((function(e){var t=e.translations,r=void 0===t?{}:t,n=cr(e,ir);if("error"===n.state.status)return yt.createElement(wt,{translations:null==r?void 0:r.errorScreen});var o=n.state.collections.some((function(e){return e.items.length>0}));return n.state.query?!1===o?yt.createElement(kt,ar({},n,{translations:null==r?void 0:r.noResultsScreen})):yt.createElement(Gt,n):yt.createElement(or,ar({},n,{hasCollections:o,translations:null==r?void 0:r.startScreen}))}),(function(e,t){return"loading"===t.state.status||"stalled"===t.state.status}));function ur(){return yt.createElement("svg",{viewBox:"0 0 38 38",stroke:"currentColor",strokeOpacity:".5"},yt.createElement("g",{fill:"none",fillRule:"evenodd"},yt.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},yt.createElement("circle",{strokeOpacity:".3",cx:"18",cy:"18",r:"18"}),yt.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},yt.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}var sr=r(830),fr=["translations"];function mr(){return mr=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function vr(e){var t=e.translations,r=void 0===t?{}:t,n=pr(e,fr),o=r.resetButtonTitle,i=void 0===o?"Clear the query":o,a=r.resetButtonAriaLabel,c=void 0===a?"Clear the query":a,l=r.cancelButtonText,u=void 0===l?"Cancel":l,s=r.cancelButtonAriaLabel,f=void 0===s?"Cancel":s,m=n.getFormProps({inputElement:n.inputRef.current}).onReset;return yt.useEffect((function(){n.autoFocus&&n.inputRef.current&&n.inputRef.current.focus()}),[n.autoFocus,n.inputRef]),yt.useEffect((function(){n.isFromSelection&&n.inputRef.current&&n.inputRef.current.select()}),[n.isFromSelection,n.inputRef]),yt.createElement(yt.Fragment,null,yt.createElement("form",{className:"DocSearch-Form",onSubmit:function(e){e.preventDefault()},onReset:m},yt.createElement("label",mr({className:"DocSearch-MagnifierLabel"},n.getLabelProps()),yt.createElement(sr.W,null)),yt.createElement("div",{className:"DocSearch-LoadingIndicator"},yt.createElement(ur,null)),yt.createElement("input",mr({className:"DocSearch-Input",ref:n.inputRef},n.getInputProps({inputElement:n.inputRef.current,autoFocus:n.autoFocus,maxLength:ht}))),yt.createElement("button",{type:"reset",title:i,className:"DocSearch-Reset","aria-label":c,hidden:!n.state.query},yt.createElement(er,null))),yt.createElement("button",{className:"DocSearch-Cancel",type:"reset","aria-label":f,onClick:n.onClose},u))}var dr=["_highlightResult","_snippetResult"];function yr(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function hr(e){return!1===function(){var e="__TEST_KEY__";try{return localStorage.setItem(e,""),localStorage.removeItem(e),!0}catch(t){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){return window.localStorage.setItem(e,JSON.stringify(t))},getItem:function(){var t=window.localStorage.getItem(e);return t?JSON.parse(t):[]}}}function br(e){var t=e.key,r=e.limit,n=void 0===r?5:r,o=hr(t),i=o.getItem().slice(0,n);return{add:function(e){var t=e,r=(t._highlightResult,t._snippetResult,yr(t,dr)),a=i.findIndex((function(e){return e.objectID===r.objectID}));a>-1&&i.splice(a,1),i.unshift(r),i=i.slice(0,n),o.setItem(i)},remove:function(e){i=i.filter((function(t){return t.objectID!==e.objectID})),o.setItem(i)},getAll:function(){return i}}}function gr(e){const t=`algoliasearch-client-js-${e.key}`;let r;const n=()=>(void 0===r&&(r=e.localStorage||window.localStorage),r),o=()=>JSON.parse(n().getItem(t)||"{}"),i=e=>{n().setItem(t,JSON.stringify(e))};return{get:(t,r,n={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{(()=>{const t=e.timeToLive?1e3*e.timeToLive:null,r=o(),n=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(i(n),!t)return;const a=Object.fromEntries(Object.entries(n).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+tPromise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||n.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve().then((()=>{const i=o();return i[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:r},n().setItem(t,JSON.stringify(i)),r})),delete:e=>Promise.resolve().then((()=>{const r=o();delete r[JSON.stringify(e)],n().setItem(t,JSON.stringify(r))})),clear:()=>Promise.resolve().then((()=>{n().removeItem(t)}))}}function Or(e){const t=[...e.caches],r=t.shift();return void 0===r?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,o={miss:()=>Promise.resolve()})=>r.get(e,n,o).catch((()=>Or({caches:t}).get(e,n,o))),set:(e,n)=>r.set(e,n).catch((()=>Or({caches:t}).set(e,n))),delete:e=>r.delete(e).catch((()=>Or({caches:t}).delete(e))),clear:()=>r.clear().catch((()=>Or({caches:t}).clear()))}}function Sr(e={serializable:!0}){let t={};return{get(r,n,o={miss:()=>Promise.resolve()}){const i=JSON.stringify(r);if(i in t)return Promise.resolve(e.serializable?JSON.parse(t[i]):t[i]);const a=n(),c=o&&o.miss||(()=>Promise.resolve());return a.then((e=>c(e))).then((()=>a))},set:(r,n)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}function jr(e){let t=e.length-1;for(;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function wr(e,t){return t?(Object.keys(t).forEach((r=>{e[r]=t[r](e)})),e):e}function Er(e,...t){let r=0;return e.replace(/%s/g,(()=>encodeURIComponent(t[r++])))}const Pr="4.22.1",Ir={WithinQueryParameters:0,WithinHeaders:1};function Dr(e,t){const r=e||{},n=r.data||{};return Object.keys(r).forEach((e=>{-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}const Ar={Read:1,Write:2,Any:3},kr={Up:1,Down:2,Timeouted:3},xr=12e4;function Cr(e,t=kr.Up){return{...e,status:t,lastUpdate:Date.now()}}function _r(e){return"string"==typeof e?{protocol:"https",url:e,accept:Ar.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||Ar.Any}}const Nr={Delete:"DELETE",Get:"GET",Post:"POST",Put:"PUT"};function Tr(e,t){return Promise.all(t.map((t=>e.get(t,(()=>Promise.resolve(Cr(t))))))).then((e=>{const r=e.filter((e=>function(e){return e.status===kr.Up||Date.now()-e.lastUpdate>xr}(e))),n=e.filter((e=>function(e){return e.status===kr.Timeouted&&Date.now()-e.lastUpdate<=xr}(e))),o=[...r,...n];return{getTimeout:(e,t)=>(0===n.length&&0===e?1:n.length+3+e)*t,statelessHosts:o.length>0?o.map((e=>_r(e))):t}}))}const qr=(e,t)=>(e=>{const t=e.status;return e.isTimedOut||(({isTimedOut:e,status:t})=>!e&&0==~~t)(e)||2!=~~(t/100)&&4!=~~(t/100)})(e)?t.onRetry(e):(({status:e})=>2==~~(e/100))(e)?t.onSuccess(e):t.onFail(e);function Rr(e,t,r,n){const o=[],i=function(e,t){if(e.method===Nr.Get||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(r,n),a=function(e,t){const r={...e.headers,...t.headers},n={};return Object.keys(r).forEach((e=>{const t=r[e];n[e.toLowerCase()]=t})),n}(e,n),c=r.method,l=r.method!==Nr.Get?{}:{...r.data,...n.data},u={"x-algolia-agent":e.userAgent.value,...e.queryParameters,...l,...n.queryParameters};let s=0;const f=(t,l)=>{const m=t.pop();if(void 0===m)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:Fr(o)};const p={data:i,headers:a,method:c,url:Mr(m,r.path,u),connectTimeout:l(s,e.timeouts.connect),responseTimeout:l(s,n.timeout)},v=e=>{const r={request:p,response:e,host:m,triesLeft:t.length};return o.push(r),r},d={onSuccess:e=>function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e),onRetry(r){const n=v(r);return r.isTimedOut&&s++,Promise.all([e.logger.info("Retryable failure",Ur(n)),e.hostsCache.set(m,Cr(m,r.isTimedOut?kr.Timeouted:kr.Down))]).then((()=>f(t,l)))},onFail(e){throw v(e),function({content:e,status:t},r){let n=e;try{n=JSON.parse(e).message}catch(o){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(n,t,r)}(e,Fr(o))}};return e.requester.send(p).then((e=>qr(e,d)))};return Tr(e.hostsCache,t).then((e=>f([...e.statelessHosts].reverse(),e.getTimeout)))}function Lr(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}function Mr(e,t,r){const n=Hr(r);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return n.length&&(o+=`?${n}`),o}function Hr(e){return Object.keys(e).map((t=>{return Er("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function Fr(e){return e.map((e=>Ur(e)))}function Ur(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}const Br=e=>{const t=e.appId,r=function(e,t,r){const n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:()=>e===Ir.WithinHeaders?n:{},queryParameters:()=>e===Ir.WithinQueryParameters?n:{}}}(void 0!==e.authMode?e.authMode:Ir.WithinHeaders,t,e.apiKey),n=function(e){const{hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:i,timeouts:a,userAgent:c,hosts:l,queryParameters:u,headers:s}=e,f={hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:i,timeouts:a,userAgent:c,headers:s,queryParameters:u,hosts:l.map((e=>_r(e))),read(e,t){const r=Dr(t,f.timeouts.read),n=()=>Rr(f,f.hosts.filter((e=>0!=(e.accept&Ar.Read))),e,r);if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();const o={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(o,(()=>f.requestsCache.get(o,(()=>f.requestsCache.set(o,n()).then((e=>Promise.all([f.requestsCache.delete(o),e])),(e=>Promise.all([f.requestsCache.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>f.responsesCache.set(o,e)})},write:(e,t)=>Rr(f,f.hosts.filter((e=>0!=(e.accept&Ar.Write))),e,Dr(t,f.timeouts.write))};return f}({hosts:[{url:`${t}-dsn.algolia.net`,accept:Ar.Read},{url:`${t}.algolia.net`,accept:Ar.Write}].concat(jr([{url:`${t}-1.algolianet.com`},{url:`${t}-2.algolianet.com`},{url:`${t}-3.algolianet.com`}])),...e,headers:{...r.headers(),"content-type":"application/x-www-form-urlencoded",...e.headers},queryParameters:{...r.queryParameters(),...e.queryParameters}}),o={transporter:n,appId:t,addAlgoliaAgent(e,t){n.userAgent.add({segment:e,version:t})},clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then((()=>{}))};return wr(o,e.methods)},Vr=e=>(t,r)=>t.method===Nr.Get?e.transporter.read(t,r):e.transporter.write(t,r),Kr=e=>(t,r={})=>wr({transporter:e.transporter,appId:e.appId,indexName:t},r.methods),$r=e=>(t,r)=>{const n=t.map((e=>({...e,params:Hr(e.params||{})})));return e.transporter.read({method:Nr.Post,path:"1/indexes/*/queries",data:{requests:n},cacheable:!0},r)},Jr=e=>(t,r)=>Promise.all(t.map((t=>{const{facetName:n,facetQuery:o,...i}=t.params;return Kr(e)(t.indexName,{methods:{searchForFacetValues:Qr}}).searchForFacetValues(n,o,{...r,...i})}))),zr=e=>(t,r,n)=>e.transporter.read({method:Nr.Post,path:Er("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n),Wr=e=>(t,r)=>e.transporter.read({method:Nr.Post,path:Er("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r),Qr=e=>(t,r,n)=>e.transporter.read({method:Nr.Post,path:Er("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n),Zr={Debug:1,Info:2,Error:3};function Gr(e,t,r){const n={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:e=>new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const n=(e,n)=>setTimeout((()=>{r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e),o=n(e.connectTimeout,"Connection timeout");let i;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===i&&(clearTimeout(o),i=n(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(i),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(i),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))},logger:(o=Zr.Error,{debug:(e,t)=>(Zr.Debug>=o&&console.debug(e,t),Promise.resolve()),info:(e,t)=>(Zr.Info>=o&&console.info(e,t),Promise.resolve()),error:(e,t)=>(console.error(e,t),Promise.resolve())}),responsesCache:Sr(),requestsCache:Sr({serializable:!1}),hostsCache:Or({caches:[gr({key:`${Pr}-${e}`}),Sr()]}),userAgent:Lr(Pr).add({segment:"Browser",version:"lite"}),authMode:Ir.WithinQueryParameters};var o;return Br({...n,...r,methods:{search:$r,searchForFacetValues:Jr,multipleQueries:$r,multipleSearchForFacetValues:Jr,customRequest:Vr,initIndex:e=>t=>Kr(e)(t,{methods:{search:Wr,searchForFacetValues:Qr,findAnswers:zr}})}})}Gr.version=Pr;const Xr=Gr;var Yr="3.5.2";function en(){}function tn(e){return e}function rn(e){return 1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function nn(e,t,r){return e.reduce((function(e,n){var o=t(n);return e.hasOwnProperty(o)||(e[o]=[]),e[o].length<(r||5)&&e[o].push(n),e}),{})}var on=["footer","searchBox"];function an(){return an=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function pn(e){var t=e.appId,r=e.apiKey,n=e.indexName,o=e.placeholder,i=void 0===o?"Search docs":o,a=e.searchParameters,c=e.maxResultsPerGroup,l=e.onClose,u=void 0===l?en:l,s=e.transformItems,f=void 0===s?tn:s,m=e.hitComponent,p=void 0===m?St:m,v=e.resultsFooterComponent,d=void 0===v?function(){return null}:v,y=e.navigator,h=e.initialScrollY,b=void 0===h?0:h,g=e.transformSearchClient,O=void 0===g?tn:g,S=e.disableUserPersonalization,j=void 0!==S&&S,w=e.initialQuery,E=void 0===w?"":w,P=e.translations,I=void 0===P?{}:P,D=e.getMissingResultsUrl,A=e.insights,k=void 0!==A&&A,x=I.footer,C=I.searchBox,_=mn(I,on),N=sn(yt.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),T=N[0],q=N[1],R=yt.useRef(null),L=yt.useRef(null),M=yt.useRef(null),H=yt.useRef(null),F=yt.useRef(null),U=yt.useRef(10),B=yt.useRef("undefined"!=typeof window?window.getSelection().toString().slice(0,ht):"").current,V=yt.useRef(E||B).current,K=function(e,t,r){return yt.useMemo((function(){var n=Xr(e,t);return n.addAlgoliaAgent("docsearch",Yr),!1===/docsearch.js \(.*\)/.test(n.transporter.userAgent.value)&&n.addAlgoliaAgent("docsearch-react",Yr),r(n)}),[e,t,r])}(t,r,O),$=yt.useRef(br({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(n),limit:10})).current,J=yt.useRef(br({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(n),limit:0===$.getAll().length?7:4})).current,z=yt.useCallback((function(e){if(!j){var t="content"===e.type?e.__docsearch_parent:e;t&&-1===$.getAll().findIndex((function(e){return e.objectID===t.objectID}))&&J.add(t)}}),[$,J,j]),W=yt.useCallback((function(e){if(T.context.algoliaInsightsPlugin&&e.__autocomplete_id){var t=e,r={eventName:"Item Selected",index:t.__autocomplete_indexName,items:[t],positions:[e.__autocomplete_id],queryID:t.__autocomplete_queryID};T.context.algoliaInsightsPlugin.insights.clickedObjectIDsAfterSearch(r)}}),[T.context.algoliaInsightsPlugin]),Q=yt.useMemo((function(){return dt({id:"docsearch",defaultActiveItemId:0,placeholder:i,openOnFocus:!0,initialState:{query:V,context:{searchSuggestions:[]}},insights:k,navigator:y,onStateChange:function(e){q(e.state)},getSources:function(e){var o=e.query,i=e.state,l=e.setContext,s=e.setStatus;if(!o)return j?[]:[{sourceId:"recentSearches",onSelect:function(e){var t=e.item,r=e.event;z(t),rn(r)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return J.getAll()}},{sourceId:"favoriteSearches",onSelect:function(e){var t=e.item,r=e.event;z(t),rn(r)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return $.getAll()}}];var m=Boolean(k);return K.search([{query:o,indexName:n,params:ln({attributesToRetrieve:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:["hierarchy.lvl1:".concat(U.current),"hierarchy.lvl2:".concat(U.current),"hierarchy.lvl3:".concat(U.current),"hierarchy.lvl4:".concat(U.current),"hierarchy.lvl5:".concat(U.current),"hierarchy.lvl6:".concat(U.current),"content:".concat(U.current)],snippetEllipsisText:"\u2026",highlightPreTag:"",highlightPostTag:"",hitsPerPage:20,clickAnalytics:m},a)}]).catch((function(e){throw"RetryError"===e.name&&s("error"),e})).then((function(e){var o=e.results[0],a=o.hits,s=o.nbHits,p=nn(a,(function(e){return Qt(e)}),c);i.context.searchSuggestions.length0&&(X(),F.current&&F.current.focus())}),[V,X]),yt.useEffect((function(){function e(){if(L.current){var e=.01*window.innerHeight;L.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),yt.createElement("div",an({ref:R},G({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===T.status&&"DocSearch-Container--Stalled","error"===T.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(e){e.target===e.currentTarget&&u()}}),yt.createElement("div",{className:"DocSearch-Modal",ref:L},yt.createElement("header",{className:"DocSearch-SearchBar",ref:M},yt.createElement(vr,an({},Q,{state:T,autoFocus:0===V.length,inputRef:F,isFromSelection:Boolean(V)&&V===B,translations:C,onClose:u}))),yt.createElement("div",{className:"DocSearch-Dropdown",ref:H},yt.createElement(lr,an({},Q,{indexName:n,state:T,hitComponent:p,resultsFooterComponent:d,disableUserPersonalization:j,recentSearches:J,favoriteSearches:$,inputRef:F,translations:_,getMissingResultsUrl:D,onItemClick:function(e,t){W(e),z(e),rn(t)||u()}}))),yt.createElement("footer",{className:"DocSearch-Footer"},yt.createElement(Ot,{translations:x}))))}}}]); \ No newline at end of file diff --git a/build/assets/js/4c274390.4a335266.js b/build/assets/js/4c274390.4a335266.js new file mode 100644 index 0000000..d1ba54e --- /dev/null +++ b/build/assets/js/4c274390.4a335266.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[432],{4982:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>h,frontMatter:()=>r,metadata:()=>i,toc:()=>c});var s=t(5893),a=t(1151);const r={id:"streams",title:"Streams"},o=void 0,i={id:"streams",title:"Streams",description:"xoid offers basic support for streams. Streams are generally treated as a whole different concept than atoms. They're actually very close, and there's no need for a completely different library for them. xoid thinks that streams can easily be a a \"bonus feature\" of an atomic state management library.",source:"@site/main/docs/streams.md",sourceDirName:".",slug:"/streams",permalink:"/docs/streams",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/streams.md",tags:[],version:"current",lastUpdatedAt:1696460720,formattedLastUpdatedAt:"Oct 4, 2023",frontMatter:{id:"streams",title:"Streams"},sidebar:"docs",previous:{title:"Performance optimizations",permalink:"/docs/performance-optimizations"},next:{title:"Advanced concepts",permalink:"/docs/advanced-concepts"}},d={},c=[{value:"Using the .map method with true as the second argument",id:"using-the-map-method-with-true-as-the-second-argument",level:3},{value:"Using create with no arguments",id:"using-create-with-no-arguments",level:3}];function l(e){const n={blockquote:"blockquote",code:"code",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"xoid"})," offers basic support for ",(0,s.jsx)(n.strong,{children:"streams"}),". Streams are generally treated as a whole different concept than atoms. They're actually very close, and there's no need for a completely different library for them. ",(0,s.jsx)(n.strong,{children:"xoid"}),' thinks that streams can easily be a a "bonus feature" of an atomic state management library.']}),"\n",(0,s.jsx)(n.p,{children:"Our definition of a stream is the following:"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:["A ",(0,s.jsx)(n.strong,{children:"stream"})," is an ",(0,s.jsx)(n.strong,{children:"atom"})," that ",(0,s.jsx)(n.strong,{children:"may not"})," have an immediate value."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"xoid"})," have a separate ",(0,s.jsx)(n.code,{children:"Stream"})," type along with the ",(0,s.jsx)(n.code,{children:"Atom"}),".\nStreams differ from atoms not only by types, but also in terms of the runtime behaviour."]}),"\n",(0,s.jsxs)(n.p,{children:["There are two ways to produce a stream in ",(0,s.jsx)(n.strong,{children:"xoid"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Using the ",(0,s.jsx)(n.code,{children:".map"})," method with ",(0,s.jsx)(n.code,{children:"true"})," as the second argument"]}),"\n",(0,s.jsxs)(n.li,{children:["Using ",(0,s.jsx)(n.code,{children:"create"})," with no arguments"]}),"\n"]}),"\n",(0,s.jsxs)(n.h3,{id:"using-the-map-method-with-true-as-the-second-argument",children:["Using the ",(0,s.jsx)(n.code,{children:".map"})," method with ",(0,s.jsx)(n.code,{children:"true"})," as the second argument"]}),"\n",(0,s.jsx)(n.p,{children:"Imagine we're setting up a basic counter, and we're deriving another counter that takes only the odd values from the first.\nWe can set this up in the following way:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const $counter = create(0)\nconst $odd = $counter.map((s) => s % 2 ? s : undefined, true) \n// Type of `$odd` would be `Stream`\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"true"}),' in the second argument means "filter out falsy values" here.\nIf we didn\'t use this overload of ',(0,s.jsx)(n.code,{children:".map"}),", we would end up with a ",(0,s.jsx)(n.code,{children:"Atom"}),".\nHowever, we would lose the following benefits:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const $doubleOdd = $odd.map((value) => value * 2)\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Here, the type of ",(0,s.jsx)(n.code,{children:"value"})," is always a ",(0,s.jsx)(n.code,{children:"number"}),". If we were working with a ",(0,s.jsx)(n.code,{children:"Atom"})," instead of a ",(0,s.jsx)(n.code,{children:"Stream"}),", ",(0,s.jsx)(n.code,{children:"value"})," would also be ",(0,s.jsx)(n.code,{children:"number | undefined"})," and our code would be slightly more verbose to cover those cases."]}),"\n",(0,s.jsxs)(n.h3,{id:"using-create-with-no-arguments",children:["Using ",(0,s.jsx)(n.code,{children:"create"})," with no arguments"]}),"\n",(0,s.jsxs)(n.p,{children:["When no arguments are used, ",(0,s.jsx)(n.code,{children:"create"})," function produces a ",(0,s.jsx)(n.code,{children:"Stream"})," instead of an ",(0,s.jsx)(n.code,{children:"Atom"}),". Let's assume we're creating a ",(0,s.jsx)(n.code,{children:"$clickStream"})," and a ",(0,s.jsx)(n.code,{children:"$clickAtom"})," like the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import create from 'xoid'\n\nconst $clickStream = create() // Stream\nconst $clickAtom = create(undefined) // Atom\n\n// Imagine we're going to satisfy the internal value of these atoms later as:\nwindow.addEventListener('click', $clickStream.set)\nwindow.addEventListener('click', $clickAtom.set)\n"})}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:["Note that in JavaScript, calling a function with no arguments can be different than calling it with ",(0,s.jsx)(n.code,{children:"undefined"}),", if the internal implementation of the function makes use of the ",(0,s.jsx)(n.code,{children:"arguments.length"})," builtin. ",(0,s.jsx)(n.strong,{children:"xoid"})," makes use of exactly that."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Let's look at the similarities and differences between ",(0,s.jsx)(n.code,{children:"$clickStream"})," and ",(0,s.jsx)(n.code,{children:"$clickAtom"}),".\nFirst of all, their ",(0,s.jsx)(n.code,{children:".value"})," getter types are the same."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"$clickStream.value // MouseEvent | undefined\n$clickAtom.value // MouseEvent | undefined\n"})}),"\n",(0,s.jsxs)(n.p,{children:["However, there's a difference in ",(0,s.jsx)(n.code,{children:".set"})," method's types. This applies for ",(0,s.jsx)(n.code,{children:".update"})," as well."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"$clickStream.set // (value: MouseEvent) => void\n$clickAtom.set // (value: MouseEvent | undefined) => void\n"})}),"\n",(0,s.jsxs)(n.p,{children:["A stream's key feature is the behavior of its ",(0,s.jsx)(n.code,{children:".map"})," and ",(0,s.jsx)(n.code,{children:".focus"})," methods.\nFirst, let's look at the ",(0,s.jsx)(n.code,{children:".map"})," method's types."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"$clickStream.map((value) => { /* `value` has the `MouseEvent` type */ })\n$clickAtom.map((value) => { /* `value` has the `MouseEvent | undefined` type */ })\n"})}),"\n",(0,s.jsxs)(n.p,{children:["As you can see, even though ",(0,s.jsx)(n.code,{children:"$clickStream"})," starts off ",(0,s.jsx)(n.code,{children:"undefined"})," as its internal value, we do not run into any ",(0,s.jsx)(n.code,{children:"undefined"})," type inside the ",(0,s.jsx)(n.code,{children:".map"})," method callback. This can be beneficial, because now you can chain multiple ",(0,s.jsx)(n.code,{children:".map"})," methods without caring about the ",(0,s.jsx)(n.code,{children:"undefined"})," states."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const double = (value: number) => value * 2\n\nconst $doubleX = clickStream\n .map((event) => event.clientX)\n .map(double)\n"})}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.p,{children:["Lastly, here's the difference of the two, from the ",(0,s.jsx)(n.code,{children:"index.d.ts"})," file of ",(0,s.jsx)(n.strong,{children:"xoid"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"export type Atom = {\n value: T\n set(state: T): void\n update(fn: (state: T) => T): void\n subscribe(fn: (state: T, prevState: T) => unknown): () => void\n watch(fn: (state: T, prevState: T) => unknown): () => void\n focus(fn: (state: T) => U): Atom\n focus(key: U): Atom\n map(fn: (state: T, prevState: T) => U): Atom\n map(fn: (state: T, prevState: T) => U, filterOutFalsyValues: true): Stream>\n}\n\nexport type Stream = {\n value: T | undefined\n set(state: T): void\n update(fn: (state: T | undefined) => T): void\n subscribe(fn: (state: T, prevState: T | undefined) => unknown): () => void\n watch(fn: (state: T | undefined, prevState: T | undefined) => unknown): () => void\n focus(fn: (state: T) => U): Stream\n focus(key: U): Stream\n map(fn: (state: T, prevState: T | undefined) => U): Stream\n map(\n fn: (state: T, prevState: T | undefined) => U,\n filterOutFalsyValues: true\n ): Stream>\n}\n"})}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:["Observe that the few major differences are the ",(0,s.jsx)(n.code,{children:".value"})," getter and bunch of ",(0,s.jsx)(n.code,{children:"prevState"}),"s."]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,a.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>i,a:()=>o});var s=t(7294);const a={},r=s.createContext(a);function o(e){const n=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),s.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/4e47bf6c.6d176e58.js b/build/assets/js/4e47bf6c.6d176e58.js new file mode 100644 index 0000000..eea9342 --- /dev/null +++ b/build/assets/js/4e47bf6c.6d176e58.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[79],{6454:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>p,frontMatter:()=>i,metadata:()=>n,toc:()=>l});var a=s(5893),o=s(1151);const i={id:"persist-localstorage",title:"Persisting data with localStorage"},r=void 0,n={id:"recipes/persist-localstorage",title:"Persisting data with localStorage",description:"If the data is serializable, it's fairly simple.",source:"@site/main/docs/recipes/persist-localstorage.md",sourceDirName:"recipes",slug:"/recipes/persist-localstorage",permalink:"/docs/recipes/persist-localstorage",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes/persist-localstorage.md",tags:[],version:"current",lastUpdatedAt:1667818490,formattedLastUpdatedAt:"Nov 7, 2022",frontMatter:{id:"persist-localstorage",title:"Persisting data with localStorage"},sidebar:"docs",previous:{title:"Finite state machines",permalink:"/docs/recipes/finite-state-machines"}},c={},l=[];function d(e){const t={code:"code",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.p,{children:"If the data is serializable, it's fairly simple."}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-js",children:"const getLocalStorage = (key) => \n JSON.parse(localStorage.getItem(key))\n\nconst setLocalStorage = (key) => (state) => \n localStorage.setItem(key, JSON.stringify(state))\n\n// usage\nconst atom = create(getLocalStorage('foo') || initialState)\natom.subscribe(setLocalStorage('foo'))\n"})})]})}function p(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},1151:(e,t,s)=>{s.d(t,{Z:()=>n,a:()=>r});var a=s(7294);const o={},i=a.createContext(o);function r(e){const t=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function n(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),a.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/538.161cb92f.js b/build/assets/js/538.161cb92f.js new file mode 100644 index 0000000..801e52d --- /dev/null +++ b/build/assets/js/538.161cb92f.js @@ -0,0 +1,2 @@ +/*! For license information please see 538.161cb92f.js.LICENSE.txt */ +(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[538],{2356:()=>{!function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,s=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,r=/(?:\{*\.{3}(?:[^{}]|)*\})/.source;function i(e,t){return e=e.replace(//g,(function(){return n})).replace(//g,(function(){return s})).replace(//g,(function(){return r})),RegExp(e,t)}r=i(r).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=i(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:i(//.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:i(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var a=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(a).join(""):""},o=function(t){for(var n=[],s=0;s0&&n[n.length-1].tagName===a(r.content[0].content[1])&&n.pop():"/>"===r.content[r.content.length-1].content||n.push({tagName:a(r.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===r.type&&"{"===r.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===r.type&&"}"===r.content?n[n.length-1].openedBraces--:i=!0),(i||"string"==typeof r)&&n.length>0&&0===n[n.length-1].openedBraces){var l=a(r);s0&&("string"==typeof t[s-1]||"plain-text"===t[s-1].type)&&(l=a(t[s-1])+l,t.splice(s-1,1),s--),t[s]=new e.Token("plain-text",l,null,l)}r.content&&"string"!=typeof r.content&&o(r.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||o(e.tokens)}))}(Prism)},5660:(e,t,n)=>{var s=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,s={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=p.reach);$+=v.value.length,v=v.next){var A=v.value;if(t.length>e.length)return;if(!(A instanceof i)){var F,S=1;if(x){if(!(F=a(y,$,e,m))||F.index>=e.length)break;var z=F.index,E=F.index+F[0].length,_=$;for(_+=v.value.length;z>=_;)_+=(v=v.next).value.length;if($=_-=v.value.length,v.value instanceof i)continue;for(var T=v;T!==t.tail&&(_p.reach&&(p.reach=L);var I=v.prev;if(j&&(I=c(t,I,j),$+=j.length),u(t,I,S),v=c(t,I,new i(h,k?r.tokenize(R,k):R,b,R)),C&&c(t,v,C),S>1){var P={cause:h+","+d,reach:L};o(e,t,n,v.prev,$,P),p&&P.reach>p.reach&&(p.reach=P.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var s=t.next,r={value:n,prev:t,next:s};return t.next=r,s.prev=r,e.length++,r}function u(e,t,n){for(var s=t.next,r=0;r"+i.content+""},!e.document)return e.addEventListener?(r.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),s=n.language,i=n.code,a=n.immediateClose;e.postMessage(r.highlight(i,r.languages[s],s)),a&&e.close()}),!1),r):r;var p=r.util.currentScript();function h(){r.manual||r.highlightAll()}if(p&&(r.filename=p.src,p.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var g=document.readyState;"loading"===g||"interactive"===g&&p&&p.defer?document.addEventListener("DOMContentLoaded",h):window.requestAnimationFrame?window.requestAnimationFrame(h):window.setTimeout(h,16)}return r}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=s),void 0!==n.g&&(n.g.Prism=s),s.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},s.languages.markup.tag.inside["attr-value"].inside.entity=s.languages.markup.entity,s.languages.markup.doctype.inside["internal-subset"].inside=s.languages.markup,s.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(s.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:s.languages[t]},n.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:s.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},s.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(s.languages.markup.tag,"addAttribute",{value:function(e,t){s.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:s.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),s.languages.html=s.languages.markup,s.languages.mathml=s.languages.markup,s.languages.svg=s.languages.markup,s.languages.xml=s.languages.extend("markup",{}),s.languages.ssml=s.languages.xml,s.languages.atom=s.languages.xml,s.languages.rss=s.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(s),s.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},s.languages.javascript=s.languages.extend("clike",{"class-name":[s.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),s.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,s.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:s.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:s.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:s.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:s.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:s.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),s.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:s.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),s.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),s.languages.markup&&(s.languages.markup.tag.addInlined("script","javascript"),s.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),s.languages.js=s.languages.javascript,function(){if(void 0!==s&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",r="loaded",i="pre[data-src]:not(["+t+'="'+r+'"]):not(['+t+'="'+n+'"])';s.hooks.add("before-highlightall",(function(e){e.selector+=", "+i})),s.hooks.add("before-sanity-check",(function(a){var o=a.element;if(o.matches(i)){a.code="",o.setAttribute(t,n);var l=o.appendChild(document.createElement("CODE"));l.textContent="Loading\u2026";var c=o.getAttribute("data-src"),u=a.language;if("none"===u){var p=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=e[p]||p}s.util.setLanguage(l,u),s.util.setLanguage(o,u);var h=s.plugins.autoloader;h&&h.loadLanguages(u),function(e,t,n){var s=new XMLHttpRequest;s.open("GET",e,!0),s.onreadystatechange=function(){4==s.readyState&&(s.status<400&&s.responseText?t(s.responseText):s.status>=400?n("\u2716 Error "+s.status+" while fetching file: "+s.statusText):n("\u2716 Error: File does not exist or is empty"))},s.send(null)}(c,(function(e){o.setAttribute(t,r);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),s=t[2],r=t[3];return s?r?[n,Number(r)]:[n,void 0]:[n,n]}}(o.getAttribute("data-range"));if(n){var i=e.split(/\r\n?|\n/g),a=n[0],c=null==n[1]?i.length:n[1];a<0&&(a+=i.length),a=Math.max(0,Math.min(a-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(a,c).join("\n"),o.hasAttribute("data-start")||o.setAttribute("data-start",String(a+1))}l.textContent=e,s.highlightElement(l)}),(function(e){o.setAttribute(t,"failed"),l.textContent=e}))}})),s.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(i),r=0;t=n[r++];)s.highlightElement(t)}};var a=!1;s.fileHighlight=function(){a||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),a=!0),s.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},4385:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>M});const s=new Set,r=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,u=new WeakMap,p=new WeakSet;let h,g=0,d=0;const f="__aa_tgt",k="__aa_del",m="__aa_new",x=e=>{const t=function(e){const t=e.reduce(((e,t)=>[...e,...Array.from(t.addedNodes),...Array.from(t.removedNodes)]),[]);return!t.every((e=>"#comment"===e.nodeName))&&e.reduce(((e,t)=>{if(!1===e)return!1;if(t.target instanceof Element){if(F(t.target),!e.has(t.target)){e.add(t.target);for(let n=0;nfunction(e){var t;const n=e.isConnected,s=r.has(e);n&&i.has(e)&&i.delete(e);a.has(e)&&(null===(t=a.get(e))||void 0===t||t.cancel());m in e?I(e):s&&n?function(e){const t=r.get(e),n=z(e);if(!R(e))return r.set(e,n);let s;if(!t)return;const i=_(e);if("function"!=typeof i){const r=t.left-n.left,a=t.top-n.top,[o,l,c,u]=E(e,t,n),p={transform:`translate(${r}px, ${a}px)`},h={transform:"translate(0, 0)"};o!==l&&(p.width=`${o}px`,h.width=`${l}px`),c!==u&&(p.height=`${c}px`,h.height=`${u}px`),s=e.animate([p,h],{duration:i.duration,easing:i.easing})}else{const[r]=C(i(e,"remain",t,n));s=new Animation(r),s.play()}a.set(e,s),r.set(e,n),s.addEventListener("finish",w.bind(null,e))}(e):s&&!n?function(e){var t;if(!i.has(e)||!r.has(e))return;const[n,s]=i.get(e);Object.defineProperty(e,k,{value:!0,configurable:!0});const o=window.scrollX,l=window.scrollY;s&&s.parentNode&&s.parentNode instanceof Element?s.parentNode.insertBefore(e,s):n&&n.parentNode?n.parentNode.appendChild(e):null===(t=T(e))||void 0===t||t.appendChild(e);if(!R(e))return P(e);const[c,u,p,f]=function(e){const t=r.get(e),[n,,s]=E(e,t,z(e));let i=e.parentElement;for(;i&&("static"===getComputedStyle(i).position||i instanceof HTMLBodyElement);)i=i.parentElement;i||(i=document.body);const a=getComputedStyle(i),o=r.get(i)||z(i),l=Math.round(t.top-o.top)-S(a.borderTopWidth),c=Math.round(t.left-o.left)-S(a.borderLeftWidth);return[l,c,n,s]}(e),m=_(e),x=r.get(e);o===g&&l===d||function(e,t,n,s){const r=g-t,i=d-n,a=document.documentElement.style.scrollBehavior;"smooth"===getComputedStyle(h).scrollBehavior&&(document.documentElement.style.scrollBehavior="auto");if(window.scrollTo(window.scrollX+r,window.scrollY+i),!e.parentElement)return;const o=e.parentElement;let l=o.clientHeight,c=o.clientWidth;const u=performance.now();function p(){requestAnimationFrame((()=>{if(!L(s)){const e=l-o.clientHeight,t=c-o.clientWidth;u+s.duration>performance.now()?(window.scrollTo({left:window.scrollX-t,top:window.scrollY-e}),l=o.clientHeight,c=o.clientWidth,p()):document.documentElement.style.scrollBehavior=a}}))}p()}(e,o,l,m);let b,w={position:"absolute",top:`${c}px`,left:`${u}px`,width:`${p}px`,height:`${f}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(L(m)){const[t,n]=C(m(e,"remove",x));!1!==(null==n?void 0:n.styleReset)&&(w=(null==n?void 0:n.styleReset)||w,Object.assign(e.style,w)),b=new Animation(t),b.play()}else Object.assign(e.style,w),b=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:m.duration,easing:"ease-out"});a.set(e,b),b.addEventListener("finish",P.bind(null,e,w))}(e):I(e)}(e)))},b=e=>{e.forEach((e=>{e.target===h&&(clearTimeout(u.get(h)),u.set(h,setTimeout((()=>{s.forEach((e=>j(e,(e=>v((()=>w(e)))))))}),100))),r.has(e.target)&&w(e.target)}))};function w(e){clearTimeout(u.get(e));const t=_(e),n=L(t)?500:t.duration;u.set(e,setTimeout((async()=>{const t=a.get(e);try{await(null==t?void 0:t.finished),r.set(e,z(e)),function(e){const t=o.get(e);null==t||t.disconnect();let n=r.get(e),s=0;n||(n=z(e),r.set(e,n));const{offsetWidth:i,offsetHeight:a}=h,l=[n.top-5,i-(n.left+5+n.width),a-(n.top+5+n.height),n.left-5].map((e=>-1*Math.floor(e)+"px")).join(" "),c=new IntersectionObserver((()=>{++s>1&&w(e)}),{root:h,threshold:1,rootMargin:l});c.observe(e),o.set(e,c)}(e)}catch{}}),n))}function y(e){setTimeout((()=>{l.set(e,setInterval((()=>v(w.bind(null,e))),2e3))}),Math.round(2e3*Math.random()))}function v(e){"function"==typeof requestIdleCallback?requestIdleCallback((()=>e())):requestAnimationFrame((()=>e()))}let $,A;function F(e,t){t||f in e?t&&!(f in t)&&Object.defineProperty(t,f,{value:e}):Object.defineProperty(e,f,{value:e})}function S(e){return Number(e.replace(/[^0-9.\-]/g,""))}function z(e){const t=e.getBoundingClientRect(),{x:n,y:s}=function(e){let t=e.parentElement;for(;t;){if(t.scrollLeft||t.scrollTop)return{x:t.scrollLeft,y:t.scrollTop};t=t.parentElement}return{x:0,y:0}}(e);return{top:t.top+s,left:t.left+n,width:t.width,height:t.height}}function E(e,t,n){let s=t.width,r=t.height,i=n.width,a=n.height;const o=getComputedStyle(e);if("content-box"===o.getPropertyValue("box-sizing")){const e=S(o.paddingTop)+S(o.paddingBottom)+S(o.borderTopWidth)+S(o.borderBottomWidth),t=S(o.paddingLeft)+S(o.paddingRight)+S(o.borderRightWidth)+S(o.borderLeftWidth);s-=t,i-=t,r-=e,a-=e}return[s,i,r,a].map(Math.round)}function _(e){return f in e&&c.has(e[f])?c.get(e[f]):{duration:250,easing:"ease-in-out"}}function T(e){if(f in e)return e[f]}function R(e){const t=T(e);return!!t&&p.has(t)}function j(e,...t){t.forEach((t=>t(e,c.has(e))));for(let n=0;ne(s,c.has(s))))}}function C(e){return Array.isArray(e)?e:[e]}function L(e){return"function"==typeof e}function I(e){m in e&&delete e[m];const t=z(e);r.set(e,t);const n=_(e);if(!R(e))return;let s;if("function"!=typeof n)s=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:1.5*n.duration,easing:"ease-in"});else{const[r]=C(n(e,"add",t));s=new Animation(r),s.play()}a.set(e,s),s.addEventListener("finish",w.bind(null,e))}function P(e,t){var n;e.remove(),r.delete(e),i.delete(e),a.delete(e),null===(n=o.get(e))||void 0===n||n.disconnect(),setTimeout((()=>{if(k in e&&delete e[k],Object.defineProperty(e,m,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const n in t)e.style[n]=""}),0)}function M(e,t={}){if($&&A){window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!L(t)&&!t.disrespectUserMotionPreference||(p.add(e),"static"===getComputedStyle(e).position&&Object.assign(e.style,{position:"relative"}),j(e,w,y,(e=>null==A?void 0:A.observe(e))),L(t)?c.set(e,t):c.set(e,{duration:250,easing:"ease-in-out",...t}),$.observe(e,{childList:!0}),s.add(e))}return Object.freeze({parent:e,enable:()=>{p.add(e)},disable:()=>{p.delete(e)},isEnabled:()=>p.has(e)})}"undefined"!=typeof window&&(h=document.documentElement,$=new MutationObserver(x),A=new ResizeObserver(b),window.addEventListener("scroll",(()=>{d=window.scrollY,g=window.scrollX})),A.observe(h))},7441:(e,t,n)=>{"use strict";function s(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}n.d(t,{TU:()=>pe});let r={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function i(e){r=e}const a=/[&<>"']/,o=new RegExp(a.source,"g"),l=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,c=new RegExp(l.source,"g"),u={"&":"&","<":"<",">":">",'"':""","'":"'"},p=e=>u[e];function h(e,t){if(t){if(a.test(e))return e.replace(o,p)}else if(l.test(e))return e.replace(c,p);return e}const g=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(e){return e.replace(g,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const f=/(^|[^\[])\^/g;function k(e,t){let n="string"==typeof e?e:e.source;t=t||"";const s={replace:(e,t)=>{let r="string"==typeof t?t:t.source;return r=r.replace(f,"$1"),n=n.replace(e,r),s},getRegex:()=>new RegExp(n,t)};return s}function m(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(t){return null}return e}const x={exec:()=>null};function b(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let s=!1,r=t;for(;--r>=0&&"\\"===n[r];)s=!s;return s?"|":" |"})).split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:w(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const s=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=s.length?e.slice(s.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=w(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=w(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),n=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:s,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let a="",o="",l=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let s=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,o=s.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,o=s.slice(u),u+=t[1].length);let p=!1;if(!s&&/^ *$/.test(c)&&(a+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(c=l,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),r.test(c))break;if(i.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=u||!c.trim())o+="\n"+c.slice(u);else{if(p)break;if(s.search(/[^ ]/)>=4)break;if(r.test(s))break;if(i.test(s))break;if(n.test(s))break;o+="\n"+c}p||c.trim()||(p=!0),a+=l+"\n",e=e.substring(l.length+1),s=c.slice(u)}}r.loose||(l?r.loose=!0:/\n *\n *$/.test(a)&&(l=!0));let h,g=null;this.options.gfm&&(g=/^\[[ xX]\] /.exec(o),g&&(h="[ ] "!==g[0],o=o.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:a,task:!!g,checked:h,loose:!1,text:o,tokens:[]}),r.raw+=a}r.items[r.items.length-1].raw=a.trimEnd(),r.items[r.items.length-1].text=o.trimEnd(),r.raw=r.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));r.loose=n}if(r.loose)for(let e=0;e$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=b(t[1]),s=t[2].replace(/^\||\| *$/g,"").split("|"),r=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const e of s)/^ *-+: *$/.test(e)?i.align.push("right"):/^ *:-+: *$/.test(e)?i.align.push("center"):/^ *:-+ *$/.test(e)?i.align.push("left"):i.align.push(null);for(const e of n)i.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of r)i.rows.push(b(e,i.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:h(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=w(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let s=0;s-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],s=e[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),y(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:s?s.replace(this.rules.inline.anyPunctuation,"$1"):s},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return y(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s)return;if(s[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...s[0]].length-1;let r,i,a=n,o=0;const l="*"===s[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(s=l.exec(t));){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(i=[...r].length,s[3]||s[4]){a+=i;continue}if((s[5]||s[6])&&n%3&&!((n+i)%3)){o+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+o);const t=[...s[0]][0].length,l=e.slice(0,n+s.index+t+i);if(Math.min(n,i)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),s=/^ /.test(e)&&/ $/.test(e);return n&&s&&(e=e.substring(1,e.length-1)),e=h(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=h(t[1]),n="mailto:"+e):(e=h(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=h(t[0]),n="mailto:"+e;else{let s;do{s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(s!==t[0]);e=h(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:h(t[0]),{type:"text",raw:t[0],text:e}}}}const $=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,A=/(?:[*+-]|\d{1,9}[.)])/,F=k(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,A).getRegex(),S=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,z=/(?!\s*\])(?:\\.|[^\[\]\\])+/,E=k(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",z).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_=k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,A).getRegex(),T="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",R=/|$)/,j=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",R).replace("tag",T).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),C=k(S).replace("hr",$).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",T).getRegex(),L={blockquote:k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",C).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:E,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:$,html:j,lheading:F,list:_,newline:/^(?: *(?:\n|$))+/,paragraph:C,table:x,text:/^[^\n]+/},I=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",$).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",T).getRegex(),P={...L,table:I,paragraph:k(S).replace("hr",$).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",I).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",T).getRegex()},M={...L,html:k("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",R).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:x,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(S).replace("hr",$).replace("heading"," *#{1,6} *[^\n]").replace("lheading",F).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},B=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,O=/^( {2,}|\\)\n(?!\s*$)/,Z="\\p{P}$+<=>`^|~",q=k(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Z).getRegex(),N=k(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Z).getRegex(),W=k("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Z).getRegex(),D=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Z).getRegex(),H=k(/\\([punct])/,"gu").replace(/punct/g,Z).getRegex(),Q=k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),X=k(R).replace("(?:--\x3e|$)","--\x3e").getRegex(),U=k("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",X).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Y=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,G=k(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Y).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),J=k(/^!?\[(label)\]\[(ref)\]/).replace("label",Y).replace("ref",z).getRegex(),V=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",z).getRegex(),K={_backpedal:x,anyPunctuation:H,autolink:Q,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:O,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:x,emStrongLDelim:N,emStrongRDelimAst:W,emStrongRDelimUnd:D,escape:B,link:G,nolink:V,punctuation:q,reflink:J,reflinkSearch:k("reflink|nolink(?!\\()","g").replace("reflink",J).replace("nolink",V).getRegex(),tag:U,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?t.push(n):(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(s.raw+="\n"+n.raw,s.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startBlock.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r)))s=t[t.length-1],i&&"paragraph"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),i=r.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,s,r,i,a,o,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,i.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(o=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,o))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startInline.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(r))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),a=!0,s=t[t.length-1],s&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class ae{options;constructor(e){this.options=e||r}code(e,t,n){const s=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",s?'
    '+(n?e:h(e,!0))+"
    \n":"
    "+(n?e:h(e,!0))+"
    \n"}blockquote(e){return`
    \n${e}
    \n`}html(e,t){return e}heading(e,t,n){return`${e}\n`}hr(){return"
    \n"}list(e,t,n){const s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e,t,n){return`
  • ${e}
  • \n`}checkbox(e){return"'}paragraph(e){return`

    ${e}

    \n`}table(e,t){return t&&(t=`${t}`),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return`\n${e}\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return"
    "}del(e){return`${e}`}link(e,t,n){const s=m(e);if(null===s)return n;let r='
    ",r}image(e,t,n){const s=m(e);if(null===s)return n;let r=`${n}0&&"paragraph"===t.tokens[0].type?(t.tokens[0].text=e+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=e+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",text:e+" "}):o+=e+" "}o+=this.parse(t.tokens,i),a+=this.renderer.listitem(o,r,!!s)}n+=this.renderer.list(a,t,s);continue}case"html":{const e=r;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=r;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let i=r,a=i.tokens?this.parseInline(i.tokens):i.text;for(;s+1{n=n.concat(this.walkTokens(e[s],t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let s=e.renderer.apply(this,t);return!1===s&&(s=n.apply(this,t)),s}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new ae(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const s=n,r=e.renderer[s],i=t[s];t[s]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new v(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const s=n,r=e.tokenizer[s],i=t[s];t[s]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new ce;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const s=n,r=e.hooks[s],i=t[s];ce.passThroughHooks.has(n)?t[s]=e=>{if(this.defaults.async)return Promise.resolve(r.call(t,e)).then((e=>i.call(t,e)));const n=r.call(t,e);return i.call(t,n)}:t[s]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,s=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(s.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ie.lex(e,t??this.defaults)}parser(e,t){return le.parse(e,t??this.defaults)}#e(e,t){return(n,s)=>{const r={...s},i={...this.defaults,...r};!0===this.defaults.async&&!1===r.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const a=this.#t(!!i.silent,!!i.async);if(null==n)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let s=e(n,i);i.hooks&&(s=i.hooks.processAllTokens(s)),i.walkTokens&&this.walkTokens(s,i.walkTokens);let r=t(s,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(o){return a(o)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+h(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function pe(e,t){return ue.parse(e,t)}pe.options=pe.setOptions=function(e){return ue.setOptions(e),pe.defaults=ue.defaults,i(pe.defaults),pe},pe.getDefaults=s,pe.defaults=r,pe.use=function(...e){return ue.use(...e),pe.defaults=ue.defaults,i(pe.defaults),pe},pe.walkTokens=function(e,t){return ue.walkTokens(e,t)},pe.parseInline=ue.parseInline,pe.Parser=le,pe.parser=le.parse,pe.Renderer=ae,pe.TextRenderer=oe,pe.Lexer=ie,pe.lexer=ie.lex,pe.Tokenizer=v,pe.Hooks=ce,pe.parse=pe;pe.options,pe.setOptions,pe.use,pe.walkTokens,pe.parseInline,le.parse,ie.lex}}]); \ No newline at end of file diff --git a/build/32.b85aa0df.js.LICENSE.txt b/build/assets/js/538.161cb92f.js.LICENSE.txt similarity index 70% rename from build/32.b85aa0df.js.LICENSE.txt rename to build/assets/js/538.161cb92f.js.LICENSE.txt index 553df9d..0285de9 100644 --- a/build/32.b85aa0df.js.LICENSE.txt +++ b/build/assets/js/538.161cb92f.js.LICENSE.txt @@ -1,9 +1,3 @@ -/*! - * github-buttons v2.27.0 - * (c) 2023 なつき - * @license BSD-2-Clause - */ - /** * Prism: Lightweight, robust, elegant syntax highlighting * diff --git a/build/assets/js/58666e07.694728c0.js b/build/assets/js/58666e07.694728c0.js new file mode 100644 index 0000000..fb011c4 --- /dev/null +++ b/build/assets/js/58666e07.694728c0.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[927],{7085:e=>{e.exports=JSON.parse('{"name":"docusaurus-theme-search-algolia","id":"default"}')}}]); \ No newline at end of file diff --git a/build/assets/js/5e95c892.b7f08e84.js b/build/assets/js/5e95c892.b7f08e84.js new file mode 100644 index 0000000..c715883 --- /dev/null +++ b/build/assets/js/5e95c892.b7f08e84.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[661],{1892:(e,s,r)=>{r.r(s),r.d(s,{default:()=>n});r(7294);var t=r(512),u=r(833),a=r(5281),c=r(8790),i=r(5296),d=r(5893);function n(e){return(0,d.jsx)(u.FG,{className:(0,t.Z)(a.k.wrapper.docsPages),children:(0,d.jsx)(i.Z,{children:(0,c.H)(e.route.routes)})})}}}]); \ No newline at end of file diff --git a/build/assets/js/6ffd3f58.ff41dc5c.js b/build/assets/js/6ffd3f58.ff41dc5c.js new file mode 100644 index 0000000..6c2644f --- /dev/null +++ b/build/assets/js/6ffd3f58.ff41dc5c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[885],{8454:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>c,default:()=>u,frontMatter:()=>r,metadata:()=>i,toc:()=>l});var s=n(5893),o=n(1151);const r={id:"use-setup",title:"useSetup"},c=void 0,i={id:"framework-integrations/use-setup",title:"useSetup",description:"import { useSetup } from '@xoid/react'",source:"@site/main/docs/framework-integrations/use-setup.md",sourceDirName:"framework-integrations",slug:"/framework-integrations/use-setup",permalink:"/docs/framework-integrations/use-setup",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/framework-integrations/use-setup.md",tags:[],version:"current",lastUpdatedAt:1696936626,formattedLastUpdatedAt:"Oct 10, 2023",frontMatter:{id:"use-setup",title:"useSetup"},sidebar:"docs",previous:{title:"useAtom",permalink:"/docs/framework-integrations/use-atom"},next:{title:"Using context correctly",permalink:"/docs/recipes-react/using-context-correctly"}},a={},l=[{value:"Basic usage",id:"basic-usage",level:2},{value:"Importance of useSetup for React users",id:"importance-of-usesetup-for-react-users",level:2}];function d(e){const t={a:"a",blockquote:"blockquote",code:"code",em:"em",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.p,{children:(0,s.jsx)(t.code,{children:"import { useSetup } from '@xoid/react'"})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.code,{children:"import { useSetup } from '@xoid/svelte'"})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.code,{children:"import { useSetup } from '@xoid/vue'"})}),"\n",(0,s.jsx)(t.h2,{id:"basic-usage",children:"Basic usage"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"import { create } from 'xoid'\nimport { useSetup } from '@xoid/react'\n\n// inside a component\nconst $num = useSetup(() => create(5))\n"})}),"\n",(0,s.jsxs)(t.p,{children:["When a second argument is provided, it'll be available in the callback argument ",(0,s.jsx)(t.strong,{children:"as a reactive atom"}),"."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"import { subscribe, use } from 'xoid'\nimport { useSetup } from '@xoid/react'\n\nconst App = (props: Props) => {\n useSetup(($props) => {// `$props` has the type: Atom\n $props.focus(s => s.something).subscribe(console.log)\n }, props)\n ...\n}\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"importance-of-usesetup-for-react-users",children:["Importance of ",(0,s.jsx)(t.code,{children:"useSetup"})," for React users"]}),"\n",(0,s.jsx)(t.p,{children:"While Vue and Svelte chooses a static closure as the component mental model, React chooses a render cycle. Although a render cycle might look like a real closure, it's not. Some people may find it more comfortable, but it brings some difficulties to the table:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:'The runtime relies on the call order of hooks. This implies a strict "rules of hooks" to the user.'}),"\n",(0,s.jsxs)(t.li,{children:["The API surface has to increase. There comes hooks like ",(0,s.jsx)(t.code,{children:"useCallback"}),", ",(0,s.jsx)(t.code,{children:"useMemo"}),", ",(0,s.jsx)(t.code,{children:"useRef"})," just to persist variables."]}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["Vue, Svelte, and more other frameworks on the other hand, use a real closure instead of a render cycle. They never need abstractions such as ",(0,s.jsx)(t.code,{children:"useCallback"}),", ",(0,s.jsx)(t.code,{children:"useMemo"}),", ",(0,s.jsx)(t.code,{children:"useRef"}),", nor they need a strict rules of hooks. ",(0,s.jsx)(t.strong,{children:"xoid"})," aims to bring the same to React."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"import { useSetup } from '@xoid/react'\nimport { effect } from 'xoid/setup'\n\nconst App = (props: Props) => {\n useSetup(() => {\n const callback = () => { ... }\n\n effect(() => {\n window.addEventListener('resize', callback)\n window.addEventListener('orientationchange', callback)\n\n return () => {\n window.removeEventListener('resize', callback)\n window.removeEventListener('orientationchange', callback)\n }\n })\n })\n ...\n}\n"})}),"\n",(0,s.jsxs)(t.p,{children:["You can call ",(0,s.jsx)(t.code,{children:"effect"})," multiple times, or conditionally. It'll connect to the same ",(0,s.jsx)(t.code,{children:"useEffect"})," call."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"import { useSetup } from '@xoid/react'\nimport { effect } from 'xoid/setup'\n\nconst App = (props: Props) => {\n useSetup(() => {\n const callback = () => { ... }\n\n effect(() => {\n window.addEventListener('resize', callback)\n return () => window.removeEventListener('resize', callback)\n })\n\n effect(() => {\n window.addEventListener('orientationchange', callback)\n return () => window.removeEventListener('orientationchange', callback)\n })\n })\n ...\n}\n"})}),"\n",(0,s.jsxs)(t.p,{children:["Same applies for ",(0,s.jsx)(t.code,{children:"inject"}),"."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"import { useSetup } from '@xoid/react'\nimport { inject } from 'xoid/setup'\nimport { ThemeSymbol } from './some-module'\n\nconst App = (props: Props) => {\n useSetup(() => {\n const theme = inject(ThemeSymbol)\n // do something with the theme\n })\n ...\n}\n"})}),"\n",(0,s.jsxs)(t.blockquote,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.code,{children:"useSetup"})," is actually more suitable than ",(0,s.jsx)(t.code,{children:"React.useMemo"})," to create values ",(0,s.jsx)(t.strong,{children:"exactly once"}),". According to ",(0,s.jsx)(t.a,{href:"https://reactjs.org/docs/hooks-faq.html#how-to-create-expensive-objects-lazily",children:"React docs"}),', "You may rely on useMemo as a performance optimization, not as a semantic guarantee. In the future, React may choose to \u201cforget\u201d some previously memoized values and recalculate them on next render, e.g. to free memory for offscreen components.". ',(0,s.jsx)(t.code,{children:"useSetup"})," hook is based on ",(0,s.jsx)(t.code,{children:"useRef"}),", thus it's guaranteed to run the callback exactly ",(0,s.jsx)(t.strong,{children:"once"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.blockquote,{children:["\n",(0,s.jsxs)(t.p,{children:["Warning: ",(0,s.jsx)(t.code,{children:"@xoid/react"}),"'s way of implementing ",(0,s.jsx)(t.code,{children:"inject"})," relies on React internals that ",(0,s.jsx)(t.em,{children:"MIGHT"})," change in the future. This works properly since the React version 16 to the latest version 18 as of now, however if you choose to not use it, we would like to assure you that it has no runtime effect when it's not called. You can see the implementation ",(0,s.jsx)(t.a,{href:"https://github.com/xoidlabs/xoid/tree/master/packages/react/src/index.tsx",children:"here"}),". It's known that ",(0,s.jsx)(t.code,{children:"react-relay"})," uses the same internal, and it's even supported by ",(0,s.jsx)(t.code,{children:"preact/compat"}),". So it's likely there to stay, or at least an equivalent mechanism looks like is going to be supported in the next Fiber versions."]}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>i,a:()=>c});var s=n(7294);const o={},r=s.createContext(o);function c(e){const t=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:c(e.components),s.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/735fe611.1a77ef18.js b/build/assets/js/735fe611.1a77ef18.js new file mode 100644 index 0000000..50065e9 --- /dev/null +++ b/build/assets/js/735fe611.1a77ef18.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[271],{2893:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>r,toc:()=>l});var n=s(5893),a=s(1151);const o={id:"quick-tutorial",title:"Quick Tutorial"},i=void 0,r={id:"quick-tutorial",title:"Quick Tutorial",description:"You can skip this part if you've already read the Github README.",source:"@site/main/docs/quick-tutorial.md",sourceDirName:".",slug:"/quick-tutorial",permalink:"/docs/quick-tutorial",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/quick-tutorial.md",tags:[],version:"current",lastUpdatedAt:1696464220,formattedLastUpdatedAt:"Oct 5, 2023",frontMatter:{id:"quick-tutorial",title:"Quick Tutorial"},sidebar:"docs",previous:{title:"Getting Started",permalink:"/docs/getting-started"},next:{title:"Performance optimizations",permalink:"/docs/performance-optimizations"}},c={},l=[{value:"Atom",id:"atom",level:3},{value:"Derived state",id:"derived-state",level:3},{value:"Subscriptions",id:"subscriptions",level:3}];function d(e){const t={blockquote:"blockquote",code:"code",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,a.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsx)(t.p,{children:"You can skip this part if you've already read the Github README."}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"atom",children:"Atom"}),"\n",(0,n.jsx)(t.p,{children:"Atoms are holders of state."}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"import create from 'xoid' // or: import { create } from 'xoid'\n\nconst $count = create(3)\nconsole.log($count.value) // 3\n$count.set(5)\n$count.update((state) => state + 1)\nconsole.log($count.value) // 6\n"})}),"\n",(0,n.jsx)(t.p,{children:"Atoms may have actions."}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"import create from 'xoid'\n\nconst $count = create(5, (atom) => ({\n increment: () => atom.update(s => s + 1),\n decrement: () => atom.value-- // `.value` setter is supported too\n}))\n\n$count.actions.increment()\n"})}),"\n",(0,n.jsxs)(t.p,{children:["There's the ",(0,n.jsx)(t.code,{children:".focus"})," method, which can be used as a selector/lens. ",(0,n.jsx)(t.strong,{children:"xoid"}),' is based on immutable updates, so if you "surgically" set state of a focused branch, changes will propagate to the root.']}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"import create from 'xoid'\n\nconst $atom = create({ deeply: { nested: { alpha: 5 } } })\nconst previousValue = $atom.value\n\n// select `.deeply.nested.alpha`\nconst $alpha = $atom.focus(s => s.deeply.nested.alpha)\n$alpha.set(6)\n\n// root state is replaced with new immutable state\nassert($atom.value !== previousValue) // \u2705\nassert($atom.value.deeply.nested.alpha === 6) // \u2705\n"})}),"\n",(0,n.jsx)(t.h3,{id:"derived-state",children:"Derived state"}),"\n",(0,n.jsxs)(t.p,{children:["State can be derived from other atoms. This API was heavily inspired by ",(0,n.jsx)(t.strong,{children:"Recoil"}),"."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"const $alpha = create(3)\nconst $beta = create(5)\n// derived atom\nconst $sum = create((read) => read($alpha) + read($beta))\n"})}),"\n",(0,n.jsxs)(t.p,{children:["Alternatively, ",(0,n.jsx)(t.code,{children:".map"})," method can be used to quickly derive the state from a single atom."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"const $alpha = create(3)\n// derived atom\nconst $doubleAlpha = $alpha.map((s) => s * 2)\n"})}),"\n",(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsxs)(t.p,{children:["Atoms are lazily evaluated. This means that the callback functions of ",(0,n.jsx)(t.code,{children:"$sum"})," and ",(0,n.jsx)(t.code,{children:"$doubleAlpha"})," in this example won't execute until the first subscription to these atoms. This is a performance optimization."]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"subscriptions",children:"Subscriptions"}),"\n",(0,n.jsxs)(t.p,{children:["For subscriptions, ",(0,n.jsx)(t.code,{children:"subscribe"})," and ",(0,n.jsx)(t.code,{children:"watch"})," are used. They are the same, except ",(0,n.jsx)(t.code,{children:"watch"})," runs the callback immediately, while ",(0,n.jsx)(t.code,{children:"subscribe"})," waits for the first update after subscription."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"const unsub = $atom.subscribe((state, previousState) => {\n console.log(state, previousState)\n})\n\n// later\nunsub()\n"})}),"\n",(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsxs)(t.p,{children:["All methods of a ",(0,n.jsx)(t.strong,{children:"xoid"})," atom are covered up to this point. This concludes the basic usage! \ud83c\udf89"]}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,a.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},1151:(e,t,s)=>{s.d(t,{Z:()=>r,a:()=>i});var n=s(7294);const a={},o=n.createContext(a);function i(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/7668cb98.b39c673b.js b/build/assets/js/7668cb98.b39c673b.js new file mode 100644 index 0000000..6d75956 --- /dev/null +++ b/build/assets/js/7668cb98.b39c673b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[447],{4714:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>i,default:()=>h,frontMatter:()=>r,metadata:()=>o,toc:()=>d});var s=t(5893),c=t(1151);const r={id:"dynamic-functions-with-fixed-references",title:"Dynamic functions with fixed references"},i=void 0,o={id:"recipes-react/dynamic-functions-with-fixed-references",title:"Dynamic functions with fixed references",description:"Inside a React function component, in some cases a function with a fixed reference, but a dynamic content may be needed. While this is not as straightforward with React, it is with xoid*.",source:"@site/main/docs/recipes-react/dynamic-functions-with-fixed-references.md",sourceDirName:"recipes-react",slug:"/recipes-react/dynamic-functions-with-fixed-references",permalink:"/docs/recipes-react/dynamic-functions-with-fixed-references",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes-react/dynamic-functions-with-fixed-references.md",tags:[],version:"current",lastUpdatedAt:1696460720,formattedLastUpdatedAt:"Oct 4, 2023",frontMatter:{id:"dynamic-functions-with-fixed-references",title:"Dynamic functions with fixed references"},sidebar:"docs",previous:{title:"Creating React custom hooks",permalink:"/docs/recipes-react/creating-react-custom-hooks"},next:{title:"Refactoring React classes",permalink:"/docs/recipes-react/refactoring-react-classes"}},a={},d=[{value:"Quick Example",id:"quick-example",level:3},{value:"Another Example",id:"another-example",level:3}];function l(e){const n={blockquote:"blockquote",code:"code",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,c.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["Inside a React function component, in some cases ",(0,s.jsx)(n.strong,{children:"a function with a fixed reference, but a dynamic content"})," may be needed. While this is not as straightforward with React*, it is with ",(0,s.jsx)(n.strong,{children:"xoid"}),"."]}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:["*: Since this recipe was written, ",(0,s.jsx)(n.code,{children:"useEvent"}),' "the missing hook" has been added to React to solve the same problem. However ergonomicity claims of ',(0,s.jsx)(n.strong,{children:"xoid"})," still hold."]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"quick-example",children:"Quick Example"}),"\n",(0,s.jsxs)(n.p,{children:["Let's imagine, we have the following ",(0,s.jsx)(n.code,{children:"React.useEffect"}),". Inside it, an event listener is attached and removed everytime when ",(0,s.jsx)(n.code,{children:"props.number"})," changes."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"useEffect(() => {\n const callback = () => console.log(props.number)\n window.addEventListener('click', callback)\n return () => window.removeEventListener('click', callback)\n}, [props.number])\n"})}),"\n",(0,s.jsx)(n.p,{children:"Let's assume that, due to changed app requirements, we want to attach the listener only once, and remove it once the component is unmounted. This can be achieved in React way as the following:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"// a ref to keep the value\nconst numberRef = useRef(props.number)\n// an effect to update ref's current value when the `props.number` is changed\nuseEffect(() => (numberRef.current = props.number), [props.number])\n\n// This time useEffect is with an empty dependency array, and it references the ref.\nuseEffect(() => {\n const callback = () => console.log(numberRef.current)\n window.addEventListener('click', callback)\n return () => window.removeEventListener('click', callback)\n}, [])\n"})}),"\n",(0,s.jsxs)(n.p,{children:["With ",(0,s.jsx)(n.strong,{children:"xoid"}),", the equivalent optimization is simply the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"useSetup(($props, { effect }) => {\n effect(() => {\n const callback = () => console.log($props.value.number)\n window.addEventListener('click', callback)\n return () => window.removeEventListener('click', callback)\n })\n}, props)\n"})}),"\n",(0,s.jsxs)(n.p,{children:["After getting used to, ",(0,s.jsx)(n.strong,{children:"xoid"})," can feel more intuitive than React hooks in a lot of cases."]}),"\n",(0,s.jsx)(n.h3,{id:"another-example",children:"Another Example"}),"\n",(0,s.jsx)(n.p,{children:"Let's propose another problem, this time let's examine it in a more concrete scenario."}),"\n",(0,s.jsxs)(n.p,{children:["Let's imagine, inside a React component, we're supposed to initialize a class called ",(0,s.jsx)(n.code,{children:"DragDropLibrary"})," ",(0,s.jsx)(n.strong,{children:"only once"})," as ",(0,s.jsx)(n.code,{children:"new DragDropLibrary({ onDrop })"}),". Let's assume we have only one chance to supply ",(0,s.jsx)(n.code,{children:"onDrop"})," to the class instance, and this function cannot be replaced afterwards."]}),"\n",(0,s.jsxs)(n.p,{children:["Imagine that ",(0,s.jsx)(n.code,{children:"props.func"})," is our dynamic function that changes in every render, and we're supposed to feed it to ",(0,s.jsx)(n.code,{children:"onDrop"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["With ",(0,s.jsx)(n.strong,{children:"xoid"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"useSetup(($props) => {\n const onDrop = (...args) => $props.value.func(...args)\n new DragDropLibrary({ onDrop })\n}, props)\n"})}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:["Think of ",(0,s.jsx)(n.code,{children:"useSetup"})," as not a hook, but as something unchanging, some closure that does not ever rerender. ",(0,s.jsx)(n.strong,{children:"@xoid/react"}),", in some sense, is a React without hooks."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Without ",(0,s.jsx)(n.strong,{children:"xoid"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const funcRef = useRef((...args) => props.func(...args))\nuseEffect(() => { funcRef.current = (...args) => props.func(...args) }, [props.func])\nuseMemo(() => {\n new DragDropLibrary({ onDrop: funcRef.current })\n}, [])\n"})})]})}function h(e={}){const{wrapper:n}={...(0,c.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>o,a:()=>i});var s=t(7294);const c={},r=s.createContext(c);function i(e){const n=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:i(e.components),s.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/772.6d489724.js b/build/assets/js/772.6d489724.js new file mode 100644 index 0000000..961d014 --- /dev/null +++ b/build/assets/js/772.6d489724.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[772],{5658:(e,t,i)=>{i.d(t,{Z:()=>a});i(7294);var n=i(512),o=i(5999),s=i(2503),r=i(5893);function a(e){var t=e.className;return(0,r.jsx)("main",{className:(0,n.Z)("container margin-vert--xl",t),children:(0,r.jsx)("div",{className:"row",children:(0,r.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,r.jsx)(s.Z,{as:"h1",className:"hero__title",children:(0,r.jsx)(o.Z,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,r.jsx)("p",{children:(0,r.jsx)(o.Z,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,r.jsx)("p",{children:(0,r.jsx)(o.Z,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}},1772:(e,t,i)=>{i.r(t),i.d(t,{default:()=>d});i(7294);var n=i(5999),o=i(833),s=i(5296),r=i(5658),a=i(5893);function d(){var e=(0,n.I)({id:"theme.NotFound.title",message:"Page Not Found"});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.d,{title:e}),(0,a.jsx)(s.Z,{children:(0,a.jsx)(r.Z,{})})]})}}}]); \ No newline at end of file diff --git a/build/assets/js/826e072b.d603324b.js b/build/assets/js/826e072b.d603324b.js new file mode 100644 index 0000000..c9987cb --- /dev/null +++ b/build/assets/js/826e072b.d603324b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[886],{2122:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>u,default:()=>f,frontMatter:()=>i,metadata:()=>o,toc:()=>d});var a=t(5893),r=t(1151),l=t(4866),s=t(5162);const i={id:"getting-started",title:"Getting Started"},u=void 0,o={id:"getting-started",title:"Getting Started",description:"xoid is a scalable state management library with a small API surface.",source:"@site/main/docs/introduction.md",sourceDirName:".",slug:"/getting-started",permalink:"/docs/getting-started",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/introduction.md",tags:[],version:"current",lastUpdatedAt:1696460720,formattedLastUpdatedAt:"Oct 4, 2023",frontMatter:{id:"getting-started",title:"Getting Started"},sidebar:"docs",next:{title:"Quick Tutorial",permalink:"/docs/quick-tutorial"}},c={},d=[{value:"Installation",id:"installation",level:2},{value:"Resources",id:"resources",level:2}];function h(e){const n={a:"a",blockquote:"blockquote",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.blockquote,{children:["\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"xoid"})," is a scalable state management library with a small API surface.\nWhile learning it takes ~5 minutes, you can still manage great complexity with it."]}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,a.jsxs)(n.p,{children:["The ",(0,a.jsx)(n.strong,{children:"xoid"})," package lives in ",(0,a.jsx)("a",{href:"https://www.npmjs.com/get-npm",target:"_blank",children:"npm"}),". To install, you can run one of the the following commands:"]}),"\n","\n","\n",(0,a.jsxs)(l.Z,{defaultValue:"npm",values:[{label:"npm",value:"npm"},{label:"yarn",value:"yarn"},{label:"deno",value:"deno"}],children:[(0,a.jsx)(s.Z,{value:"npm",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"npm install xoid\n"})})}),(0,a.jsx)(s.Z,{value:"yarn",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"yarn add xoid\n"})})}),(0,a.jsx)(s.Z,{value:"deno",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-js",children:"import { create } from 'https://unpkg.com/xoid/index.js'\n"})})})]}),"\n",(0,a.jsxs)(n.p,{children:["If you're using ",(0,a.jsx)(n.strong,{children:"xoid"})," with one of these frameworks, simply install one of the following packages:"]}),"\n",(0,a.jsxs)(l.Z,{defaultValue:"React",values:[{label:"React",value:"React"},{label:"Vue",value:"Vue"},{label:"Svelte",value:"Svelte"}],children:[(0,a.jsx)(s.Z,{value:"React",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"yarn add @xoid/react\n"})})}),(0,a.jsx)(s.Z,{value:"Vue",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"yarn add @xoid/vue\n"})})}),(0,a.jsx)(s.Z,{value:"Svelte",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"yarn add @xoid/svelte\n"})})})]}),"\n",(0,a.jsx)(n.h2,{id:"resources",children:"Resources"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["If you're new to ",(0,a.jsx)(n.strong,{children:"xoid"}),", we recommend starting with the ",(0,a.jsx)(n.a,{href:"quick-tutorial",children:"quick tutorial in the next section"}),"."]}),"\n",(0,a.jsxs)(n.li,{children:["In ",(0,a.jsx)(n.a,{href:"examples",children:"Examples"})," section, you'll find examples to run on Codesandbox."]}),"\n",(0,a.jsxs)(n.li,{children:["You can refer to ",(0,a.jsx)(n.a,{href:"./recipes-react/using-context-correctly",children:"Recipes"})," section for more."]}),"\n"]})]})}function f(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>s});t(7294);var a=t(512);const r={tabItem:"tabItem_Ymn6"};var l=t(5893);function s(e){var n=e.children,t=e.hidden,s=e.className;return(0,l.jsx)("div",{role:"tabpanel",className:(0,a.Z)(r.tabItem,s),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>w});var a=t(7294),r=t(512),l=t(2466),s=t(6550),i=t(469),u=t(1980),o=t(7392),c=t(12);function d(e){var n,t;return null!=(n=null==(t=a.Children.toArray(e).filter((function(e){return"\n"!==e})).map((function(e){if(!e||(0,a.isValidElement)(e)&&((n=e.props)&&"object"==typeof n&&"value"in n))return e;var n;throw new Error("Docusaurus error: Bad child <"+("string"==typeof e.type?e.type:e.type.name)+'>: all children of the component should be , and every should have a unique "value" prop.')})))?void 0:t.filter(Boolean))?n:[]}function h(e){var n=e.values,t=e.children;return(0,a.useMemo)((function(){var e=null!=n?n:function(e){return d(e).map((function(e){var n=e.props;return{value:n.value,label:n.label,attributes:n.attributes,default:n.default}}))}(t);return function(e){var n=(0,o.l)(e,(function(e,n){return e.value===n.value}));if(n.length>0)throw new Error('Docusaurus error: Duplicate values "'+n.map((function(e){return e.value})).join(", ")+'" found in . Every value needs to be unique.')}(e),e}),[n,t])}function f(e){var n=e.value;return e.tabValues.some((function(e){return e.value===n}))}function m(e){var n=e.queryString,t=void 0!==n&&n,r=e.groupId,l=(0,s.k6)(),i=function(e){var n=e.queryString,t=void 0!==n&&n,a=e.groupId;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!a)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return null!=a?a:null}({queryString:t,groupId:r});return[(0,u._X)(i),(0,a.useCallback)((function(e){if(i){var n=new URLSearchParams(l.location.search);n.set(i,e),l.replace(Object.assign({},l.location,{search:n.toString()}))}}),[i,l])]}function p(e){var n,t,r,l,s=e.defaultValue,u=e.queryString,o=void 0!==u&&u,d=e.groupId,p=h(e),v=(0,a.useState)((function(){return function(e){var n,t=e.defaultValue,a=e.tabValues;if(0===a.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:a}))throw new Error('Docusaurus error: The has a defaultValue "'+t+'" but none of its children has the corresponding value. Available values are: '+a.map((function(e){return e.value})).join(", ")+". If you intend to show no default tab, use defaultValue={null} instead.");return t}var r=null!=(n=a.find((function(e){return e.default})))?n:a[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:s,tabValues:p})})),b=v[0],g=v[1],x=m({queryString:o,groupId:d}),j=x[0],y=x[1],w=(n=function(e){return e?"docusaurus.tab."+e:null}({groupId:d}.groupId),t=(0,c.Nk)(n),r=t[0],l=t[1],[r,(0,a.useCallback)((function(e){n&&l.set(e)}),[n,l])]),k=w[0],I=w[1],V=function(){var e=null!=j?j:k;return f({value:e,tabValues:p})?e:null}();return(0,i.Z)((function(){V&&g(V)}),[V]),{selectedValue:b,selectValue:(0,a.useCallback)((function(e){if(!f({value:e,tabValues:p}))throw new Error("Can't select invalid tab value="+e);g(e),y(e),I(e)}),[y,I,p]),tabValues:p}}var v=t(2389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=t(5893);function x(e){var n=e.className,t=e.block,a=e.selectedValue,s=e.selectValue,i=e.tabValues,u=[],o=(0,l.o5)().blockElementScrollPositionUntilNextRender,c=function(e){var n=e.currentTarget,t=u.indexOf(n),r=i[t].value;r!==a&&(o(n),s(r))},d=function(e){var n,t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":var a,r=u.indexOf(e.currentTarget)+1;t=null!=(a=u[r])?a:u[0];break;case"ArrowLeft":var l,s=u.indexOf(e.currentTarget)-1;t=null!=(l=u[s])?l:u[u.length-1]}null==(n=t)||n.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":t},n),children:i.map((function(e){var n=e.value,t=e.label,l=e.attributes;return(0,g.jsx)("li",Object.assign({role:"tab",tabIndex:a===n?0:-1,"aria-selected":a===n,ref:function(e){return u.push(e)},onKeyDown:d,onClick:c},l,{className:(0,r.Z)("tabs__item",b.tabItem,null==l?void 0:l.className,{"tabs__item--active":a===n}),children:null!=t?t:n}),n)}))})}function j(e){var n=e.lazy,t=e.children,r=e.selectedValue,l=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){var s=l.find((function(e){return e.props.value===r}));return s?(0,a.cloneElement)(s,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map((function(e,n){return(0,a.cloneElement)(e,{key:n,hidden:e.props.value!==r})}))})}function y(e){var n=p(e);return(0,g.jsxs)("div",{className:(0,r.Z)("tabs-container",b.tabList),children:[(0,g.jsx)(x,Object.assign({},e,n)),(0,g.jsx)(j,Object.assign({},e,n))]})}function w(e){var n=(0,v.Z)();return(0,g.jsx)(y,Object.assign({},e,{children:d(e.children)}),String(n))}},1151:(e,n,t)=>{t.d(n,{Z:()=>i,a:()=>s});var a=t(7294);const r={},l=a.createContext(r);function s(e){const n=a.useContext(l);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),a.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/83d722e5.fc1112fd.js b/build/assets/js/83d722e5.fc1112fd.js new file mode 100644 index 0000000..7e3f494 --- /dev/null +++ b/build/assets/js/83d722e5.fc1112fd.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[745],{9334:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>c,default:()=>d,frontMatter:()=>a,metadata:()=>o,toc:()=>p});var s=n(5893),r=n(1151);const a={id:"refactoring-react-classes",title:"Refactoring React classes"},c=void 0,o={id:"recipes-react/refactoring-react-classes",title:"Refactoring React classes",description:"xoid can provide a scaffolding system for refactoring React class components into function components. During refactoring, intermediate version of the component keeps working.",source:"@site/main/docs/recipes-react/refactoring-react-classes.md",sourceDirName:"recipes-react",slug:"/recipes-react/refactoring-react-classes",permalink:"/docs/recipes-react/refactoring-react-classes",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes-react/refactoring-react-classes.md",tags:[],version:"current",lastUpdatedAt:1696460720,formattedLastUpdatedAt:"Oct 4, 2023",frontMatter:{id:"refactoring-react-classes",title:"Refactoring React classes"},sidebar:"docs",previous:{title:"Dynamic functions with fixed references",permalink:"/docs/recipes-react/dynamic-functions-with-fixed-references"},next:{title:"Grabbing refs",permalink:"/docs/recipes-react/grabbing-refs"}},i={},p=[];function l(e){const t={code:"code",p:"p",pre:"pre",strong:"strong",...(0,r.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"xoid"})," can provide a scaffolding system for refactoring React class components into function components. During refactoring, intermediate version of the component keeps working."]}),"\n",(0,s.jsx)(t.p,{children:"Let's imagine that the following class component is going to be refactored:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"class App extends React.Component {\n // state\n state = { alpha: 5 }\n // methods\n incrementAlpha = () => {\n this.setState({ alpha: this.state.alpha + 1 })\n }\n render() {\n // render\n return
    {this.state.alpha}
    \n }\n}\n"})}),"\n",(0,s.jsxs)(t.p,{children:["Here's a basic React-like class component runtime prepared with ",(0,s.jsx)(t.strong,{children:"xoid"}),"."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"import { create, Atom } from 'xoid'\n\nclass Runtime {\n $props: Atom;\n $state!: Atom;\n constructor($props: Atom) {\n this.$props = $props;\n }\n get props() {\n return this.$props.value;\n }\n get state() {\n return this.$state.value;\n }\n setState(partial: Partial) {\n this.$state.update((s) => ({ ...s, ...partial }));\n }\n}\n"})}),"\n",(0,s.jsx)(t.p,{children:"We can then easily evolve into the following, working structure without too much refactor:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"class AppRuntime extends Runtime<{}, { alpha: number }> {\n $state = create({ alpha: 5 });\n incrementAlpha = () => {\n this.setState({ alpha: this.state.alpha + 1 });\n };\n}\n\nconst App = (props: Props) => {\n const self = useSetup(($props) => new AppRuntime($props), props)\n useAtom(self.$state)\n\n return
    {self.state.alpha}
    \n}\n"})}),"\n",(0,s.jsxs)(t.p,{children:["Observe that the only big differece is replacing ",(0,s.jsx)(t.code,{children:"this"})," in the render function with ",(0,s.jsx)(t.code,{children:"self"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["After getting rid of ",(0,s.jsx)(t.code,{children:"this.setState"})," usages, we can get rid of the ",(0,s.jsx)(t.code,{children:"Runtime"})," class too."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const AppSetup = ($props: Atom) => {\n const $state = create({ alpha: 5 })\n const incrementAlpha = () => $state.focus('alpha').update((s) => s + 1)\n return { $state, incrementAlpha }\n}\n\nconst App = (props: Props) => {\n const { $state, incrementAlpha } = useSetup(AppSetup, props)\n const { alpha } = useAtom(self.$state)\n\n return
    {alpha}
    \n}\n"})})]})}function d(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>o,a:()=>c});var s=n(7294);const r={},a=s.createContext(r);function c(e){const t=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),s.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/894.092fcbd6.js b/build/assets/js/894.092fcbd6.js new file mode 100644 index 0000000..22d64c1 --- /dev/null +++ b/build/assets/js/894.092fcbd6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[894],{8894:(e,s,i)=>{i.r(s)}}]); \ No newline at end of file diff --git a/build/assets/js/935f2afb.cda325c8.js b/build/assets/js/935f2afb.cda325c8.js new file mode 100644 index 0000000..5919138 --- /dev/null +++ b/build/assets/js/935f2afb.cda325c8.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[53],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"docs":[{"type":"category","label":"Introduction","items":[{"type":"link","label":"Getting Started","href":"/docs/getting-started","docId":"getting-started","unlisted":false},{"type":"link","label":"Quick Tutorial","href":"/docs/quick-tutorial","docId":"quick-tutorial","unlisted":false},{"type":"link","label":"Performance optimizations","href":"/docs/performance-optimizations","docId":"performance-optimizations","unlisted":false},{"type":"link","label":"Streams","href":"/docs/streams","docId":"streams","unlisted":false},{"type":"link","label":"Advanced concepts","href":"/docs/advanced-concepts","docId":"advanced-concepts","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Framework Integrations","items":[{"type":"link","label":"Introduction","href":"/docs/framework-integrations/introduction","docId":"framework-integrations/introduction","unlisted":false},{"type":"link","label":"useAtom","href":"/docs/framework-integrations/use-atom","docId":"framework-integrations/use-atom","unlisted":false},{"type":"link","label":"useSetup","href":"/docs/framework-integrations/use-setup","docId":"framework-integrations/use-setup","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Recipes (React)","items":[{"type":"link","label":"Using context correctly","href":"/docs/recipes-react/using-context-correctly","docId":"recipes-react/using-context-correctly","unlisted":false},{"type":"link","label":"Creating React custom hooks","href":"/docs/recipes-react/creating-react-custom-hooks","docId":"recipes-react/creating-react-custom-hooks","unlisted":false},{"type":"link","label":"Dynamic functions with fixed references","href":"/docs/recipes-react/dynamic-functions-with-fixed-references","docId":"recipes-react/dynamic-functions-with-fixed-references","unlisted":false},{"type":"link","label":"Refactoring React classes","href":"/docs/recipes-react/refactoring-react-classes","docId":"recipes-react/refactoring-react-classes","unlisted":false},{"type":"link","label":"Grabbing refs","href":"/docs/recipes-react/grabbing-refs","docId":"recipes-react/grabbing-refs","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Recipes","items":[{"type":"link","label":"Working with nested state","href":"/docs/recipes/nested-state","docId":"recipes/nested-state","unlisted":false},{"type":"link","label":"Using immer","href":"/docs/recipes/using-immer","docId":"recipes/using-immer","unlisted":false},{"type":"link","label":"Using reducers","href":"/docs/recipes/using-reducers","docId":"recipes/using-reducers","unlisted":false},{"type":"link","label":"Using in an existing Redux App","href":"/docs/recipes/redux-interop","docId":"recipes/redux-interop","unlisted":false},{"type":"link","label":"Redux Devtools integration","href":"/docs/recipes/redux-devtools-integration","docId":"recipes/redux-devtools-integration","unlisted":false},{"type":"link","label":"Finite state machines","href":"/docs/recipes/finite-state-machines","docId":"recipes/finite-state-machines","unlisted":false},{"type":"link","label":"Persisting data with localStorage","href":"/docs/recipes/persist-localstorage","docId":"recipes/persist-localstorage","unlisted":false}],"collapsed":true,"collapsible":true}]},"docs":{"advanced-concepts":{"id":"advanced-concepts","title":"Advanced concepts","description":"Deriving state from external sources","sidebar":"docs"},"examples":{"id":"examples","title":"Examples","description":"- Counter Open in CodeSandbox"},"framework-integrations/introduction":{"id":"framework-integrations/introduction","title":"Introduction","description":"xoid provides an isomorphic API for React, Vue, and Svelte. If you\'re using xoid with one of these frameworks, simply install one of the following packages:","sidebar":"docs"},"framework-integrations/use-atom":{"id":"framework-integrations/use-atom","title":"useAtom","description":"import { useAtom } from \'@xoid/react\'","sidebar":"docs"},"framework-integrations/use-setup":{"id":"framework-integrations/use-setup","title":"useSetup","description":"import { useSetup } from \'@xoid/react\'","sidebar":"docs"},"getting-started":{"id":"getting-started","title":"Getting Started","description":"xoid is a scalable state management library with a small API surface.","sidebar":"docs"},"performance-optimizations":{"id":"performance-optimizations","title":"Performance optimizations","description":"Lazy evaluation","sidebar":"docs"},"quick-tutorial":{"id":"quick-tutorial","title":"Quick Tutorial","description":"You can skip this part if you\'ve already read the Github README.","sidebar":"docs"},"recipes-react/creating-react-custom-hooks":{"id":"recipes-react/creating-react-custom-hooks","title":"Creating React custom hooks","description":"With the second argument set to true, useAtom returns a 2-item tuple.","sidebar":"docs"},"recipes-react/dynamic-functions-with-fixed-references":{"id":"recipes-react/dynamic-functions-with-fixed-references","title":"Dynamic functions with fixed references","description":"Inside a React function component, in some cases a function with a fixed reference, but a dynamic content may be needed. While this is not as straightforward with React, it is with xoid*.","sidebar":"docs"},"recipes-react/grabbing-refs":{"id":"recipes-react/grabbing-refs","title":"Grabbing refs","description":"A xoid atom can be used to grab element refs (as in React\'s terminology) in a typesafe manner.","sidebar":"docs"},"recipes-react/refactoring-react-classes":{"id":"recipes-react/refactoring-react-classes","title":"Refactoring React classes","description":"xoid can provide a scaffolding system for refactoring React class components into function components. During refactoring, intermediate version of the component keeps working.","sidebar":"docs"},"recipes-react/using-context-correctly":{"id":"recipes-react/using-context-correctly","title":"Using context correctly","description":"Using React context for rarely-occuring changes such as theme providers, or internationalization is harmless. However, when context starts to be used for other things, it can affect performance badly.","sidebar":"docs"},"recipes/finite-state-machines":{"id":"recipes/finite-state-machines","title":"Finite state machines","description":"With xoid, a wide range of finite state machines can be expressed.","sidebar":"docs"},"recipes/nested-state":{"id":"recipes/nested-state","title":"Working with nested state","description":"Before xoid:","sidebar":"docs"},"recipes/persist-localstorage":{"id":"recipes/persist-localstorage","title":"Persisting data with localStorage","description":"If the data is serializable, it\'s fairly simple.","sidebar":"docs"},"recipes/redux-devtools-integration":{"id":"recipes/redux-devtools-integration","title":"Redux Devtools integration","description":"Import @xoid/devtools and set a debugValue to your atom. It will send values to the Redux Devtools Extension.","sidebar":"docs"},"recipes/redux-interop":{"id":"recipes/redux-interop","title":"Using in an existing Redux App","description":"xoid and Redux can coexist in a project without a problem. There\'s no requirement to get rid of Redux when xoid is added. If you\'re planning to gradually move away from Redux however, xoid is a good candidate to do so. For this, one thing you can do is to start managing some part of your Redux state via xoid. You can follow these steps:","sidebar":"docs"},"recipes/using-immer":{"id":"recipes/using-immer","title":"Using immer","description":"While xoid\'s API surface is kept small intentionally, there\'s a way for extensions.","sidebar":"docs"},"recipes/using-reducers":{"id":"recipes/using-reducers","title":"Using reducers","description":"xoid doesn\'t need reducers, but if you prefer to use them, or if you\'re moving away from Redux, but want to reuse your existing reducers, you can easily do that with xoid.","sidebar":"docs"},"streams":{"id":"streams","title":"Streams","description":"xoid offers basic support for streams. Streams are generally treated as a whole different concept than atoms. They\'re actually very close, and there\'s no need for a completely different library for them. xoid thinks that streams can easily be a a \\"bonus feature\\" of an atomic state management library.","sidebar":"docs"}}}')}}]); \ No newline at end of file diff --git a/build/assets/js/945.4604debf.js b/build/assets/js/945.4604debf.js new file mode 100644 index 0000000..fc3dc18 --- /dev/null +++ b/build/assets/js/945.4604debf.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[945],{6945:(e,s,i)=>{i.r(s)}}]); \ No newline at end of file diff --git a/build/assets/js/96f6f7ba.611fae96.js b/build/assets/js/96f6f7ba.611fae96.js new file mode 100644 index 0000000..3261b3c --- /dev/null +++ b/build/assets/js/96f6f7ba.611fae96.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[666],{3769:e=>{e.exports=JSON.parse('{"name":"docusaurus-plugin-content-docs","id":"default"}')}}]); \ No newline at end of file diff --git a/build/assets/js/a7bd4aaa.c564c292.js b/build/assets/js/a7bd4aaa.c564c292.js new file mode 100644 index 0000000..9f4bb48 --- /dev/null +++ b/build/assets/js/a7bd4aaa.c564c292.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[518],{8564:(e,n,s)=>{s.r(n),s.d(n,{default:()=>l});s(7294);var r=s(833),i=s(3320),o=s(4477),t=s(8790),a=s(197),c=s(5893);function u(e){var n=e.version;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a.Z,{version:n.version,tag:(0,i.os)(n.pluginId,n.version)}),(0,c.jsx)(r.d,{children:n.noIndex&&(0,c.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})]})}function d(e){var n=e.version,s=e.route;return(0,c.jsx)(r.FG,{className:n.className,children:(0,c.jsx)(o.q,{version:n,children:(0,t.H)(s.routes)})})}function l(e){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(u,Object.assign({},e)),(0,c.jsx)(d,Object.assign({},e))]})}}}]); \ No newline at end of file diff --git a/build/assets/js/a94703ab.c6440048.js b/build/assets/js/a94703ab.c6440048.js new file mode 100644 index 0000000..3b26c6a --- /dev/null +++ b/build/assets/js/a94703ab.c6440048.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[368],{2674:(e,n,t)=>{t.r(n),t.d(n,{default:()=>fe});var a=t(7294),i=t(512),o=t(833),r=t(5281),s=t(3791),l=t(1116),c=t(5999),d=t(2466),u=t(5936);const m={backToTopButton:"backToTopButton_sjWU",backToTopButtonShow:"backToTopButtonShow_xfvO"};var b=t(5893);function h(){var e=function(e){var n=e.threshold,t=(0,a.useState)(!1),i=t[0],o=t[1],r=(0,a.useRef)(!1),s=(0,d.Ct)(),l=s.startScroll,c=s.cancelScroll;return(0,d.RF)((function(e,t){var a=e.scrollY,i=null==t?void 0:t.scrollY;i&&(r.current?r.current=!1:a>=i?(c(),o(!1)):a{t.d(n,{Z:()=>s});t(7294);var a=t(512),i=t(5999),o=t(2503),r=t(5893);function s(e){var n=e.className;return(0,r.jsx)("main",{className:(0,a.Z)("container margin-vert--xl",n),children:(0,r.jsx)("div",{className:"row",children:(0,r.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,r.jsx)(o.Z,{as:"h1",className:"hero__title",children:(0,r.jsx)(i.Z,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,r.jsx)("p",{children:(0,r.jsx)(i.Z,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,r.jsx)("p",{children:(0,r.jsx)(i.Z,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}}}]); \ No newline at end of file diff --git a/build/assets/js/c4f5d8e4.d65e9d0c.js b/build/assets/js/c4f5d8e4.d65e9d0c.js new file mode 100644 index 0000000..2e3d6e7 --- /dev/null +++ b/build/assets/js/c4f5d8e4.d65e9d0c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[195],{4007:(e,t,n)=>{n.d(t,{Z:()=>d});var s=n(4385),a=n(5660),r=n.n(a),i=n(7294),c=n(5893),o={duration:330,easing:"ease-in-out"},l=function(e){return e.trim().replace(/^(export )?const /,"").substring(0,7)};function d(e){var t=e.lines,n=e.framework,a=(0,i.useMemo)((function(){var e=[],n={},s=0;return t.forEach((function(t){var a=l(t);a?(n[a]&&(a+=++n[a]),e.push(a),n[a]=1):e.push(++s)})),e}),[t]),r=(0,i.useRef)();return(0,i.useEffect)((function(){r.current&&(0,s.ZP)(r.current,o)}),[]),(0,c.jsx)("code",{ref:r,children:t.map((function(e,t){return"---"===e?(0,c.jsx)(u,{framework:n},"---"):(0,c.jsx)(m,{line:e},a[t])}))})}function u(e){return(0,c.jsx)("div",{className:"splitter",children:(0,c.jsxs)("div",{className:"filename",children:["Counter.",e.framework]})})}var m=function(e){var t=e.line,n=t.match(/^\s*/)[0].length,s=t.match("const"),a=13-(t.match("export const")?13:s?6:0);return(0,c.jsx)("div",{style:{marginLeft:n-a+"ch",paddingLeft:a-n+"ch"},className:"line",dangerouslySetInnerHTML:{__html:r().highlight(t||" ",r().languages.jsx,"javascript")}})}},473:(e,t,n)=>{n.d(t,{Z:()=>m});var s=n(7294),a=n(2154),r=(n(4385),n(5660),n(2356),n(4007)),i=n(5893),c={reusability:"medium",setterUpdates:!0,globalState:!0,signals:!1,framework:"react",beau:!1,addExports:!0},o=new Event("build");var l=function(e){return"react"!==c.framework&&"doja"!==c.framework?("svelte"===c.framework&&(e=e.map((function(e){return e.replace(/\$counter/g,"counterAtom")}))),e):((e=e.filter((function(e){return e})).flatMap((function(e){return e.split("\n")}))).length>1&&(e[e.length-1]=e[e.length-1]+"\n"),e)},d=function(){return function(){var e,t=function(e,t){return void 0===t&&(t="+"),c.setterUpdates?"() => "+e+".value"+t+t:"() => "+e+".update((s) => s "+t+" 1)"},n=function(e){return t(e,"-")},s="low"===c.reusability?"":"medium"!==c.reusability?" const { increment, decrement } = $counter.actions":" const increment = "+t("$counter")+"\n const decrement = "+n("$counter"),a="export const NumberModel = (payload) =>\n create(payload, (atom) => ({\n increment: "+t("atom")+",\n decrement: "+n("atom")+",\n }))",r="highest"===c.reusability?"const $counter = NumberModel(0)":"high"===c.reusability?"const $counter = create(0, (atom) => ({\n increment: "+t("atom")+",\n decrement: "+n("atom")+",\n}))":"const $counter = create(0)",i=(e=r,"react"===c.framework?e.replace("r = ","r = useSetup(() => ")+")":e).split("\n").map((function(e){return" "+e})).join("\n"),d={useAtom:!c.signals,useSetup:!c.globalState&&("react"===c.framework||"doja"===c.framework)},u=d.useAtom||d.useSetup?"import { "+Object.keys(d).filter((function(e){return d[e]})).join(", ")+" } from '@xoid/"+c.framework+"'":"",m="low"===c.reusability?t("$counter"):"increment",h="low"===c.reusability?n("$counter"):"decrement",x=c.signals&&"low"===c.reusability&&c.globalState;x?c.beau||setTimeout((function(){c.beau=!0,window.dispatchEvent(o)}),1.5*animationOptions.duration):c.beau=!1;var p=x&&c.beau,f="svelte"===c.framework||"vue"===c.framework?"\n"+["highest"===c.reusability||c.globalState?"":" import create from 'xoid'"," "+u,"highest"!==c.reusability||c.globalState?"":" import { NumberModel } from './models.js'",c.globalState?" import { "+("svelte"===c.framework?"$counter as counterAtom":"$counter")+" } from './models.js'":""].filter((function(e){return e})).join("\n")+"\n":"export const Counter = "+("doja"===c.framework?"Doja(":"")+"() => "+(p?"(":"{"),v="svelte"===c.framework?"<\/script>\n\n{$count}\n\n":"vue"===c.framework?'<\/script>\n\n':p?" <>\n {"+(c.signals?"$counter.value":"count")+"}\n \n \n \n)":" return "+("doja"===c.framework?"() => ":"")+"(\n <>\n {"+(c.signals?"$counter.value":"count")+"}\n \n \n \n )\n}";"doja"===c.framework&&(v+=")");var j,b=["doja"===c.framework?"import Doja, { create } from 'doja'":"react"===c.framework||c.globalState||"highest"===c.reusability?"import create from 'xoid'":"","react"===c.framework?u:""],C=["highest"===c.reusability?a:"",c.globalState?(j=r,c.addExports?j.replace(/const/g,"export const"):j):""],g=("vue"===c.framework||"svelte"===c.framework)&&(c.globalState||"highest"===c.reusability),w=document.querySelector(".code-demo-container");return w&&(g?w.classList.add("split"):w.classList.remove("split")),[b,C,g?["---"]:[],[f].concat(l([c.globalState?"":i,c.signals?"":" const count = useAtom($counter)",s]),[v])].map((function(e){return e.filter((function(e){return e})).join("\n")})).filter((function(e){return e})).join("\n\n")}().split("\n").map((function(e){return e||" "}))};function u(){var e=(0,s.useState)((function(){return d()})),t=e[0],n=e[1];return(0,s.useEffect)((function(){var e=function(){return n((function(){return d()}))};return window.addEventListener("build",e,!1),function(){return window.removeEventListener("build",e,!1)}}),[]),(0,i.jsx)(r.Z,{lines:t,framework:c.framework})}window.addEventListener("build",(function(){var e=document.querySelector(".code-demo-container");e.classList.remove("animate"),setTimeout((function(){return e.classList.add("animate")}))}));const m=function(){var e=(0,s.useState)(c),t=e[0],n=e[1],r=function(e,t){c[e]=t,"react"!==c.framework&&"doja"!==c.framework&&(c.signals=!1),"doja"===c.framework?c.signals=!0:c.signals=!1,n(Object.assign({},c)),window.dispatchEvent(o)};return(0,i.jsx)(a.$,{className:"demo",children:(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"column",children:[(0,i.jsx)("h2",{children:"Quick Look"}),(0,i.jsxs)("p",{children:[(0,i.jsx)("b",{children:"xoid"})," makes it easier to refactor between scopes, frameworks, and different degrees of reusability."]}),(0,i.jsxs)("div",{className:"controls-container",children:[(0,i.jsxs)("fieldset",{children:[(0,i.jsx)("div",{children:"Framework"}),(0,i.jsx)("div",{children:["react","vue","svelte"].map((function(e){return(0,i.jsxs)("label",{onClick:function(){return r("framework",e)},children:[(0,i.jsx)("input",{type:"radio",checked:t.framework===e}),(0,i.jsx)("span",{children:e})]})}))})]}),(0,i.jsxs)("fieldset",{children:[(0,i.jsx)("div",{children:"Scope"}),(0,i.jsx)("div",{children:["local","global"].map((function(e){return(0,i.jsxs)("label",{onClick:function(){return r("globalState","global"===e)},children:[(0,i.jsx)("input",{type:"radio",checked:!(t.globalState^"global"===e)}),(0,i.jsx)("span",{children:e})]})}))})]}),(0,i.jsxs)("fieldset",{children:[(0,i.jsx)("div",{children:"Reuse"}),(0,i.jsx)("div",{children:["low","medium","high","highest"].map((function(e){return(0,i.jsxs)("label",{onClick:function(){return r("reusability",e)},children:[(0,i.jsx)("input",{type:"radio",checked:t.reusability===e}),(0,i.jsx)("span",{children:e})]})}))})]}),(0,i.jsx)("fieldset",{children:(0,i.jsxs)("div",{className:"checkbox",children:[(0,i.jsx)("input",{id:"c1",type:"checkbox",checked:t.setterUpdates,onChange:function(e){return r("setterUpdates",e.target.checked)}}),(0,i.jsx)("label",{for:"c1",children:"Setters"})]})}),(0,i.jsxs)("a",{className:"github-star",target:"_blank",href:"https://github.com/xoidlabs/xoid",children:["Star us on GitHub \ud83e\udd29",(0,i.jsx)("img",{src:"https://img.shields.io/github/stars/xoidlabs/xoid.svg?style=social&label=Star","aria-label":"Star xoidlabs/xoid on GitHub"})]})]})]}),(0,i.jsxs)("div",{className:"code-demo-container",children:[(0,i.jsx)("div",{className:"filename main",children:"models.js"}),(0,i.jsxs)("div",{className:"window-buttons",children:[(0,i.jsx)("div",{className:"btn"}),(0,i.jsx)("div",{className:"btn"}),(0,i.jsx)("div",{className:"btn"})]}),(0,i.jsx)(u,{})]})]})})}},2154:(e,t,n)=>{n.d(t,{$:()=>a,V:()=>r});n(7294);var s=n(5893);function a(e){var t=e.element,n=void 0===t?"section":t,a=e.children,r=e.className,i=e.background,c=void 0===i?"light":i,o=e.style,l=n;return(0,s.jsx)(l,{className:"Section "+r+" "+c,style:o,children:a})}function r(e){var t=e.columnOne,n=e.columnTwo,a=e.reverse,r=e.demo;return(0,s.jsxs)("div",{className:"TwoColumns "+(a?"reverse":""),children:[(0,s.jsx)("div",{className:"column first "+(a?"right":"left"),children:t}),(0,s.jsx)("div",{className:"column last "+(a?"left":"right")+" "+(r?"demo":""),children:n})]})}},5098:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(7294),a=n(2154),r=n(4007),i=n(5893),c={split:{xoid:"import { create } from 'xoid'\n\nconst $alpha = create(9);\nconst $beta = create(16);\nconst $sum = create((get) => get($alpha) + get($beta));","@xoid/reactive":"import { create, computed } from '@xoid/reactive'\n \nconst $alpha = create(9);\nconst $beta = create(16);\nconst $sum = computed(() => $alpha.value + $beta.value);"},joined:{xoid:"import { create } from 'xoid'\n \nconst $state = create({\n alpha: 9,\n beta: 16\n});\n\nconst $sum = create((get) => {\n const $alpha = $state.focus('alpha')\n const $beta = $state.focus('beta')\n return get($alpha) + get($beta)\n});","@xoid/reactive":"import { reactive, computed } from '@xoid/reactive'\n\nconst state = reactive({\n alpha: 9,\n beta: 16\n});\n\nconst $sum = computed(() => state.alpha + state.beta);"}};const o=function(){var e=(0,s.useState)({library:"@xoid/reactive",style:"split"}),t=e[0],n=e[1],o=function(e,t){n((function(n){var s;return Object.assign({},n,((s={})[e]=t,s))}))};return(0,i.jsx)(a.$,{className:"demo",children:(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"column",children:[(0,i.jsx)("h2",{children:"Your Favorite Coding Style"}),(0,i.jsxs)("p",{children:["While ",(0,i.jsx)("b",{children:"xoid"})," is a robust library based on explicit subscriptions, ",(0,i.jsx)("b",{children:"@xoid/reactive"})," is a thin proxy layer around it. They're interoperable."]}),(0,i.jsxs)("div",{className:"controls-container",children:[(0,i.jsxs)("fieldset",{className:"large",children:[(0,i.jsx)("div",{children:"Flavor"}),(0,i.jsx)("div",{children:["xoid","@xoid/reactive"].map((function(e){return(0,i.jsxs)("label",{onClick:function(){return o("library",e)},children:[(0,i.jsx)("input",{type:"radio",checked:t.library===e}),(0,i.jsx)("span",{children:e})]})}))})]}),(0,i.jsxs)("fieldset",{className:"large",children:[(0,i.jsx)("div",{children:"STYLE"}),(0,i.jsx)("div",{children:["split","joined"].map((function(e){return(0,i.jsxs)("label",{onClick:function(){return o("style",e)},children:[(0,i.jsx)("input",{type:"radio",checked:t.style===e}),(0,i.jsx)("span",{children:e})]})}))})]})]})]}),(0,i.jsxs)("div",{className:"code-demo-container",children:[(0,i.jsx)("div",{className:"filename main",children:"models.js"}),(0,i.jsxs)("div",{className:"window-buttons",children:[(0,i.jsx)("div",{className:"btn"}),(0,i.jsx)("div",{className:"btn"}),(0,i.jsx)("div",{className:"btn"})]}),(0,i.jsx)(r.Z,{lines:c[t.style][t.library].split("\n")})]})]})})}},3395:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});n(7294);var s=n(5296),a=n(9286),r=n(5742),i=n(4996),c=n(7441),o=n(5893);const l=function(){return(0,o.jsxs)("div",{role:"tablist",className:"tablist","aria-orientation":"horizontal",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("button",{id:"tab-react",role:"tab","aria-controls":"panel-react",tabIndex:0,"aria-selected":"true",className:"tab-button active",children:[(0,o.jsx)("div",{"aria-label":"React framework",children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"170 0 500 595.3",children:(0,o.jsxs)("g",{fill:"#61DAFB",children:[(0,o.jsx)("path",{d:"M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"}),(0,o.jsx)("circle",{cx:"420.9",cy:"296.5",r:"45.7"}),(0,o.jsx)("path",{d:"M520.5 78.1z"})]})})}),"React"]}),(0,o.jsxs)("button",{id:"tab-vue",role:"tab","aria-controls":"panel-vue",tabIndex:-1,"aria-selected":"false",className:"tab-button",children:[(0,o.jsx)("div",{"aria-label":"Vue framework",children:(0,o.jsxs)("svg",{viewBox:"0 0 261.76 226.69",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M161.096.001l-30.224 52.35L100.647.002H-.005L130.872 226.69 261.749 0z",fill:"#41b883"}),(0,o.jsx)("path",{d:"M161.096.001l-30.224 52.35L100.647.002H52.346l78.526 136.01L209.398.001z",fill:"#34495e"})]})}),"Vue"]})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)("button",{id:"tab-svelte",role:"tab","aria-controls":"panel-svelte",tabIndex:-1,"aria-selected":"false",className:"tab-button",children:[(0,o.jsx)("div",{"aria-label":"Svelte framework",children:(0,o.jsxs)("svg",{viewBox:"-12 0 110.1 118",children:[(0,o.jsx)("path",{d:"M91.8 15.6C80.9-.1 59.2-4.7 43.6 5.2L16.1 22.8C8.6 27.5 3.4 35.2 1.9 43.9c-1.3 7.3-.2 14.8 3.3 21.3-2.4 3.6-4 7.6-4.7 11.8-1.6 8.9.5 18.1 5.7 25.4 11 15.7 32.6 20.3 48.2 10.4l27.5-17.5c7.5-4.7 12.7-12.4 14.2-21.1 1.3-7.3.2-14.8-3.3-21.3 2.4-3.6 4-7.6 4.7-11.8 1.7-9-.4-18.2-5.7-25.5",fill:"#ff3e00"}),(0,o.jsx)("path",{d:"M40.9 103.9c-8.9 2.3-18.2-1.2-23.4-8.7-3.2-4.4-4.4-9.9-3.5-15.3.2-.9.4-1.7.6-2.6l.5-1.6 1.4 1c3.3 2.4 6.9 4.2 10.8 5.4l1 .3-.1 1c-.1 1.4.3 2.9 1.1 4.1 1.6 2.3 4.4 3.4 7.1 2.7.6-.2 1.2-.4 1.7-.7L65.5 72c1.4-.9 2.3-2.2 2.6-3.8.3-1.6-.1-3.3-1-4.6-1.6-2.3-4.4-3.3-7.1-2.6-.6.2-1.2.4-1.7.7l-10.5 6.7c-1.7 1.1-3.6 1.9-5.6 2.4-8.9 2.3-18.2-1.2-23.4-8.7-3.1-4.4-4.4-9.9-3.4-15.3.9-5.2 4.1-9.9 8.6-12.7l27.5-17.5c1.7-1.1 3.6-1.9 5.6-2.5 8.9-2.3 18.2 1.2 23.4 8.7 3.2 4.4 4.4 9.9 3.5 15.3-.2.9-.4 1.7-.7 2.6l-.5 1.6-1.4-1c-3.3-2.4-6.9-4.2-10.8-5.4l-1-.3.1-1c.1-1.4-.3-2.9-1.1-4.1-1.6-2.3-4.4-3.3-7.1-2.6-.6.2-1.2.4-1.7.7L32.4 46.1c-1.4.9-2.3 2.2-2.6 3.8s.1 3.3 1 4.6c1.6 2.3 4.4 3.3 7.1 2.6.6-.2 1.2-.4 1.7-.7l10.5-6.7c1.7-1.1 3.6-1.9 5.6-2.5 8.9-2.3 18.2 1.2 23.4 8.7 3.2 4.4 4.4 9.9 3.5 15.3-.9 5.2-4.1 9.9-8.6 12.7l-27.5 17.5c-1.7 1.1-3.6 1.9-5.6 2.5",fill:"#fff"})]})}),"Svelte"]}),(0,o.jsxs)("button",{id:"tab-javascript",role:"tab","aria-controls":"panel-javascript",tabIndex:-1,"aria-selected":"false",className:"tab-button",children:[(0,o.jsx)("div",{"aria-label":"Plain JavaScript",children:(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 630 630",children:[(0,o.jsx)("rect",{width:630,height:630,fill:"#f7df1e"}),(0,o.jsx)("path",{d:"m423.2 492.19c12.69 20.72 29.2 35.95 58.4 35.95 24.53 0 40.2-12.26 40.2-29.2 0-20.3-16.1-27.49-43.1-39.3l-14.8-6.35c-42.72-18.2-71.1-41-71.1-89.2 0-44.4 33.83-78.2 86.7-78.2 37.64 0 64.7 13.1 84.2 47.4l-46.1 29.6c-10.15-18.2-21.1-25.37-38.1-25.37-17.34 0-28.33 11-28.33 25.37 0 17.76 11 24.95 36.4 35.95l14.8 6.34c50.3 21.57 78.7 43.56 78.7 93 0 53.3-41.87 82.5-98.1 82.5-54.98 0-90.5-26.2-107.88-60.54zm-209.13 5.13c9.3 16.5 17.76 30.45 38.1 30.45 19.45 0 31.72-7.61 31.72-37.2v-201.3h59.2v202.1c0 61.3-35.94 89.2-88.4 89.2-47.4 0-74.85-24.53-88.81-54.075z"})]})}),"Vanilla JS"]})]})]})};var d=n(2154);const u=function(){return(0,o.jsx)(d.$,{children:(0,o.jsxs)("div",{className:"feature-columns",children:[(0,o.jsx)("div",{className:"css-0",children:(0,o.jsxs)("div",{className:"chakra-stack css-1fcydsv",children:[(0,o.jsx)("div",{className:"css-1rtuhur",children:(0,o.jsxs)("svg",{stroke:"currentColor",fill:"none",strokeWidth:2,viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round","data-theme":"dark",focusable:"false",className:"chakra-icon css-s48i3l",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),(0,o.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),(0,o.jsx)("line",{x1:12,y1:"22.08",x2:12,y2:12})]})}),(0,o.jsxs)("div",{className:"css-0",children:[(0,o.jsx)("h2",{className:"chakra-heading css-9dycqs",children:"Small"}),(0,o.jsx)("p",{className:"chakra-text css-s66uvp",children:"It's easy-to-learn, has no external dependencies, and it's only 1.1kB minified and gzipped."})]})]})}),(0,o.jsx)("div",{className:"css-0",children:(0,o.jsxs)("div",{className:"chakra-stack css-1fcydsv",children:[(0,o.jsx)("div",{className:"css-1rtuhur",children:(0,o.jsxs)("svg",{stroke:"currentColor",fill:"none",strokeWidth:2,viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round","data-theme":"dark",focusable:"false",className:"chakra-icon css-s48i3l",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("rect",{x:3,y:11,width:18,height:11,rx:2,ry:2}),(0,o.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}),(0,o.jsxs)("div",{className:"css-0",children:[(0,o.jsx)("h2",{className:"chakra-heading css-9dycqs",children:"Robust"}),(0,o.jsx)("p",{className:"chakra-text css-s66uvp",children:"It's based on immutable updates and explicit subscriptions. This makes it ideal for teams."})]})]})}),(0,o.jsx)("div",{className:"css-0",children:(0,o.jsxs)("div",{className:"chakra-stack css-1fcydsv",children:[(0,o.jsx)("div",{className:"css-1rtuhur",children:(0,o.jsxs)("svg",{stroke:"currentColor",fill:"none",strokeWidth:2,viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round","data-theme":"dark",focusable:"false",className:"chakra-icon css-s48i3l",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("circle",{cx:11,cy:11,r:8}),(0,o.jsx)("line",{x1:21,y1:21,x2:"16.65",y2:"16.65"})]})}),(0,o.jsxs)("div",{className:"css-0",children:[(0,o.jsx)("h2",{className:"chakra-heading css-9dycqs",children:"Well-documented"}),(0,o.jsx)("p",{className:"chakra-text css-s66uvp",children:'Extensively documented, including a rich "Recipes" section and examples.'})]})]})})]})})},m=function(){return(0,o.jsxs)("div",{className:"outer-container",children:[(0,o.jsxs)("div",{className:"mask-container",style:{position:"relative",width:260,height:260},children:[(0,o.jsx)("div",{style:{position:"absolute",top:5,left:38,transform:"rotate(90deg)"},children:(0,o.jsx)("div",{className:"spinner"})}),(0,o.jsx)("div",{style:{position:"absolute",top:"-30px",left:5,transform:"rotate(0deg)"},children:(0,o.jsx)("div",{className:"spinner delay"})})]}),(0,o.jsx)("div",{className:"pencil-container",children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:189,viewBox:"0 0 628 626",version:"1.1",children:(0,o.jsx)("path",{d:"M 134 8.641 C 130.077 9.934, 122.042 17.633, 71.356 68.660 C 29.964 110.330, 12.395 128.679, 10.378 132.347 C 6.329 139.712, 6.373 147.529, 10.505 154.689 C 12.546 158.225, 37.236 183.833, 88 235.066 C 128.975 276.419, 162.823 311.096, 163.218 312.127 C 163.613 313.157, 163.613 314.864, 163.218 315.920 C 162.823 316.976, 129.200 351.424, 88.500 392.472 C 28.015 453.474, 13.906 468.207, 11.250 473.140 L 8 479.175 8 537.909 C 8 605.812, 7.635 602.779, 16.936 612.090 C 26.267 621.431, 23.390 621.091, 90.580 620.774 L 148.500 620.500 153.268 618.152 C 156.867 616.380, 172.322 601.420, 216.286 557.152 C 248.323 524.893, 282.185 490.710, 291.534 481.190 C 306.789 465.655, 308.886 463.869, 311.973 463.782 C 315.239 463.689, 319.230 467.529, 390.956 539.792 C 445.696 594.941, 467.739 616.517, 471 618.138 C 473.931 619.595, 477.417 620.397, 481 620.438 C 492.105 620.564, 491.886 620.751, 554.533 557.282 C 616.025 494.983, 616.258 494.708, 616.277 484.467 C 616.295 474.031, 615.766 473.389, 565.159 422.500 C 483.364 340.248, 461.529 317.958, 460.787 315.954 C 459.225 311.731, 454.208 317.129, 542.551 228 C 589.019 181.118, 591.835 178.071, 595.782 170.396 C 605.265 151.956, 605.507 135.886, 596.569 118.138 C 592.084 109.230, 581.968 98.148, 543.874 60.409 C 516.001 32.795, 512.883 30.017, 506 26.669 C 485.972 16.926, 467.361 18.063, 449.642 30.114 C 444.515 33.601, 424.582 53.144, 379 99.375 C 318.651 160.583, 315.318 163.785, 311.832 163.890 C 308.260 163.997, 306.194 162.012, 233.332 88.474 C 169.052 23.598, 157.667 12.528, 152.590 9.974 C 145.959 6.637, 141.130 6.291, 134 8.641 M 140.333 31.932 C 137.675 32.629, 32.810 138.385, 31.721 141.467 C 31.293 142.679, 31.293 144.593, 31.721 145.721 C 32.150 146.848, 65.468 180.923, 105.762 221.444 C 176.257 292.337, 179.150 295.108, 182.373 294.810 C 185.328 294.536, 192.036 288.127, 239.361 240.358 C 287.550 191.718, 293 185.894, 293 183.046 C 293 180.428, 291.562 178.395, 284.747 171.378 C 272.595 158.865, 274.223 158.368, 250.687 181.772 C 239.151 193.244, 230.446 201.114, 228.858 201.508 C 225.636 202.306, 221.008 200.097, 218.067 196.357 C 215.170 192.676, 214.587 189.667, 216.178 186.629 C 216.919 185.216, 225.731 175.533, 235.762 165.111 C 250.702 149.589, 254 145.647, 254 143.316 C 254 141.008, 251.682 138.158, 241.736 128.235 C 225.889 112.427, 226.937 112.486, 212.982 126.605 C 207.217 132.437, 201.009 137.855, 199.187 138.645 C 196.124 139.971, 195.562 139.906, 191.770 137.790 C 189.278 136.399, 186.892 133.995, 185.692 131.666 C 183.047 126.532, 183.882 124.973, 196.500 111.494 C 202 105.618, 206.850 100.195, 207.279 99.443 C 208.931 96.541, 206.461 92.931, 195.014 81.514 C 184.597 71.124, 182.768 69.702, 179.926 69.783 C 177.111 69.863, 174.210 72.337, 157.595 88.822 C 147.093 99.243, 137.510 108.070, 136.300 108.436 C 133.490 109.288, 129.012 106.991, 125.619 102.959 C 122.821 99.634, 122.318 96.215, 124.107 92.684 C 124.715 91.483, 133.293 82.368, 143.168 72.428 C 165.251 50.203, 164.860 51.427, 153.505 40.005 C 145.411 31.863, 143.969 30.979, 140.333 31.932 M 471.326 44.980 C 464.202 46.499, 460.909 48.852, 447.750 61.828 C 436.156 73.261, 435 74.724, 435 77.963 C 435 81.335, 437.886 84.409, 489.271 135.762 C 531.607 178.071, 544.085 190, 546.008 190 C 547.845 190, 551.821 186.620, 561.594 176.750 C 572.884 165.348, 575.019 162.674, 576.907 157.579 C 579.922 149.439, 579.927 137.586, 576.919 129.421 C 574.911 123.971, 572.462 121.193, 546.137 94.500 C 502.485 50.238, 502.228 49.994, 496.466 47.356 C 490.548 44.647, 478.311 43.490, 471.326 44.980 M 340.525 169.779 C 300.940 209.776, 220.409 291.026, 161.569 350.336 C 102.729 409.645, 53.535 459.595, 52.250 461.336 C 50.620 463.542, 50.095 465.257, 50.516 467 C 50.848 468.375, 55.471 473.887, 60.791 479.250 C 68.815 487.339, 70.982 489, 73.513 489 C 77.025 489, 61.994 503.951, 292.556 271.119 C 425.384 136.983, 438.529 123.421, 438.820 120.207 C 439.118 116.924, 438.452 115.986, 429.339 106.838 C 420.600 98.067, 419.156 97.003, 416.019 97.029 C 412.697 97.057, 408.464 101.136, 340.525 169.779 M 430.939 162.750 C 389.742 204.562, 211.526 384.536, 151.942 444.500 C 120.243 476.400, 93.751 503.554, 93.069 504.843 C 92.388 506.132, 92.075 508.162, 92.374 509.354 C 92.673 510.546, 98.543 517.082, 105.418 523.879 C 116.846 535.177, 118.158 536.180, 120.709 535.564 C 122.483 535.136, 128.997 529.354, 138.587 519.695 C 146.885 511.338, 181.087 476.825, 214.592 443 C 248.096 409.175, 322.689 333.924, 380.354 275.775 C 481.124 174.160, 485.200 169.908, 485.200 166.390 C 485.200 163.052, 484.161 161.689, 473.366 150.865 C 456.656 134.112, 460.108 133.145, 430.939 162.750 M 501.500 185.966 C 500.400 186.428, 486.218 200.237, 469.985 216.653 C 359.705 328.175, 231.013 458.092, 188.684 500.632 C 140.619 548.935, 138.800 550.900, 138.800 554.513 C 138.800 557.923, 139.692 559.158, 148.631 568.132 C 156.753 576.284, 158.987 577.999, 161.481 577.994 C 164.151 577.988, 173.276 569.116, 240.415 501.244 C 282.169 459.035, 340.230 400.425, 369.440 371 C 537.254 201.952, 527 212.508, 527 208.794 C 527 205.784, 525.773 204.173, 516.645 195.190 C 510.950 189.585, 505.662 185.029, 504.895 185.063 C 504.128 185.098, 502.600 185.504, 501.500 185.966 M 384.864 387.119 C 333.249 439.464, 331.500 441.363, 331.500 445.035 C 331.500 448.728, 333.519 450.859, 404.892 522.487 C 468.187 586.008, 478.693 596.153, 481.253 596.226 C 483.877 596.301, 489.412 591.093, 528.861 551.433 C 553.413 526.750, 577.732 502.174, 582.903 496.819 C 595.065 484.228, 595.108 483.624, 584.604 473.120 C 573.154 461.670, 574.318 461.270, 550.675 484.800 C 533.326 502.067, 531.046 504, 528.036 504 C 521.460 504, 514.965 496.295, 516.461 490.269 C 516.894 488.524, 524.034 480.574, 535.774 468.766 C 559.435 444.967, 558.982 447.525, 542.466 430.966 C 526.605 415.064, 527.572 415.078, 511.958 430.500 C 502.473 439.868, 499.776 441.999, 497.407 441.996 C 490.655 441.988, 483.943 434.347, 485.442 428.374 C 485.867 426.680, 490.582 421.049, 497.140 414.402 C 511.939 399.403, 511.984 400.523, 495.919 384.419 C 485.782 374.258, 483.005 372, 480.644 372 C 478.217 372, 474.973 374.868, 460.232 390.050 C 442.617 408.192, 439.186 411, 434.626 411 C 429.298 411, 422.388 402.367, 423.627 397.259 C 424.049 395.517, 431.246 387.476, 443.148 375.446 C 458.981 359.443, 462 355.923, 462 353.466 C 462 351.124, 460.256 348.788, 453.271 341.770 C 445.974 334.439, 444.024 333, 441.385 333 C 438.539 333, 432.976 338.327, 384.864 387.119 M 32.653 489.490 C 31.165 490.978, 31.076 495.814, 31.660 543.312 C 32.105 579.454, 32.640 595.726, 33.401 596.235 C 34.006 596.639, 57.960 596.976, 86.633 596.985 C 138.738 597, 138.767 596.999, 139.315 594.903 C 139.617 593.749, 139.557 591.978, 139.182 590.967 C 138.095 588.036, 38.983 489.034, 36.516 488.415 C 35.155 488.073, 33.651 488.491, 32.653 489.490",stroke:"none",fill:"currentColor",fillRule:"evenodd"})})})]})};var h="\n- Easy to learn\n- Small bundle size\n- Zero configuration\n- Framework-agnostic\n- Computed values\n- Async actions\n- Transient updates\n- Local & global state\n- Finite state machines\n- Extensive Typescript support\n- Devtools\n ",x=[{text:"## Simple primitives\n**xoid** is based on *atoms*. Atoms are holders of state. `create` function is used to create them.\n ",code:"import create from 'xoid'\n\nconst $count = create(3)\n\n$count.set(5)\n$count.update((state) => state + 1)\nconsole.log($count.value) // 6\n"},{text:"## Actions\n\nWith the second argument, you can define actions for your atoms.\n\n",code:"import create from 'xoid'\n\nconst $count = create(3, (atom) => ({\n increment: () => atom.update((s) => s + 1),\n incrementBy: (by) => atom.update((s) => s + by)\n}))\n\n$count.actions.incrementBy(5)\n"},{text:"\n## Computed Values\n\nIt has a **Recoil**-inspired API for derived atoms. Alternatively, the `.map` method can be used.\n",code:"import create from 'xoid'\n\nconst $doubleCount = create((get) => get($count) * 2)\n\nconst $tripleCount = $count.map((state) => state * 3)\n\n"},{text:"\n## Framework Integrations\n\n**xoid** has **React**, **Vue**, and **Svelte** integrations. It can be used without any framework as well.\n",code:"import create from 'xoid'\nimport { useAtom } from '@xoid/react'\n// @xoid/vue and @xoid/svelte packages are used the same way\n\n// in a component\nconst count = useAtom($count)\nconst { increment } = $count.actions\n\n// vanilla JavaScript\nconst unsubscribe = $count.subscribe(console.log)\n"},{text:'\n## No more hand-written reducers!\n\nThere\'s the `.focus` method, which can be used as a selector/lens. \n**xoid** is based on immutable updates, so if you "surgically" set state of a focused branch, changes will propagate to the root.\n',code:"import create from 'xoid'\n\nconst atom = create({ deeply: { nested: { alpha: 5 } } })\nconst previousValue = atom.value\n\n// select `.deeply.nested.alpha`\nconst alpha = atom.focus((s) => s.deeply.nested.alpha)\nalpha.update((s) => s + 1)\n\n// root state is replaced with new immutable state\nassert(atom.value !== previousValue) // \u2705\n"},{text:"\n## No-API Finite State Machines!\nAtoms are potent primitives. No additional syntax is required for expressing finite state machines. \n\n",code:"import create from 'xoid'\n\nconst red = { color: '#f00', onClick: () => machine.set(green) }\nconst green = { color: '#0f0', onClick: () => machine.set(red) }\nconst machine = create(red)\n\n// in a component\nconst { color, onClick } = useAtom(machine)\nreturn
    \n"}];function p(e){var t=e.href,n=e.type,s=void 0===n?"primary":n,a=e.target,r=e.children;return(0,o.jsx)("a",{className:"ActionButton "+s,href:t,target:a,children:r})}function f(e){e.title;var t=e.text,n=e.moreContent;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{dangerouslySetInnerHTML:{__html:t}}),n]})}function v(){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p,{type:"primary",href:(0,i.Z)("docs/getting-started"),target:"_self",children:"Get started"}),(0,o.jsx)(p,{type:"secondary",href:(0,i.Z)("docs/examples"),target:"_self",children:"Examples"})]})}function j(){return(0,o.jsx)(d.$,{background:"none",className:"HeaderHero",style:{paddingTop:100,position:"relative"},children:(0,o.jsxs)("div",{className:"titleContainer",style:{zIndex:1},children:[(0,o.jsxs)("div",{className:"title",children:[(0,o.jsx)("div",{className:"gradient"}),(0,o.jsx)(m,{})]}),(0,o.jsx)("p",{className:"tagline",children:"Framework-agnostic state management library designed for simplicity and scalability"}),(0,o.jsx)(l,{}),(0,o.jsx)("div",{className:"buttons",children:(0,o.jsx)(v,{})})]})})}function b(){return(0,o.jsx)(d.$,{className:"NativeApps",background:"light",children:(0,o.jsx)("div",{className:"FeatureSection",style:{position:"relative"},children:(0,o.jsx)("div",{dangerouslySetInnerHTML:{__html:(0,c.TU)(h)}})})})}function C(e){return(0,o.jsx)(d.$,{className:"NativeCode "+(e.corner?"corner":""),background:e.tint?"tint":"light",children:(0,o.jsx)(d.V,{columnOne:(0,o.jsx)(f,{text:(0,c.TU)(e.content.text)}),columnTwo:(0,o.jsx)(a.Z,{language:"jsx",children:e.content.code})})})}function g(e){var t=e.children,s=e.fallback;return"window"in n.g&&null!=t?(0,o.jsx)(o.Fragment,{children:t()}):s||null}const w=function(){return(0,o.jsxs)(s.Z,{wrapperClassName:"homepage",children:[(0,o.jsxs)(r.Z,{children:[(0,o.jsx)("title",{children:"xoid \xb7 Framework-agnostic state management for JavaScript"}),(0,o.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=0.82"})]}),(0,o.jsx)(j,{}),(0,o.jsx)("div",{children:(0,o.jsx)(g,{children:function(){var e=n(473).Z;return(0,o.jsx)(e,{})}})}),(0,o.jsx)(u,{}),x.map((function(e,t){return(0,o.jsx)(C,{content:e,tint:!(t%2),corner:0})})),(0,o.jsx)("div",{children:(0,o.jsx)(g,{children:function(){var e=n(5098).Z;return(0,o.jsx)(e,{})}})}),(0,o.jsx)(d.$,{background:"none",className:"Embed",style:{display:"flex",justifyContent:"center",padding:25},children:(0,o.jsx)("iframe",{src:"https://codesandbox.io/embed/cool-dream-wp9rn6?fontsize=14&hidenavigation=1&theme=dark",style:{width:"100%",maxWidth:1080,height:400,border:0,borderRadius:4,overflow:"hidden"},title:"competent-carson-j2tfqm",sandbox:"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"})}),(0,o.jsx)(b,{})]})}}}]); \ No newline at end of file diff --git a/build/assets/js/c5beeb90.b943d990.js b/build/assets/js/c5beeb90.b943d990.js new file mode 100644 index 0000000..cb93312 --- /dev/null +++ b/build/assets/js/c5beeb90.b943d990.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[330],{8704:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>o,default:()=>p,frontMatter:()=>c,metadata:()=>i,toc:()=>d});var r=n(5893),s=n(1151);const c={id:"grabbing-refs",title:"Grabbing refs"},o=void 0,i={id:"recipes-react/grabbing-refs",title:"Grabbing refs",description:"A xoid atom can be used to grab element refs (as in React's terminology) in a typesafe manner.",source:"@site/main/docs/recipes-react/grabbing-refs.md",sourceDirName:"recipes-react",slug:"/recipes-react/grabbing-refs",permalink:"/docs/recipes-react/grabbing-refs",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes-react/grabbing-refs.md",tags:[],version:"current",lastUpdatedAt:1696460720,formattedLastUpdatedAt:"Oct 4, 2023",frontMatter:{id:"grabbing-refs",title:"Grabbing refs"},sidebar:"docs",previous:{title:"Refactoring React classes",permalink:"/docs/recipes-react/refactoring-react-classes"},next:{title:"Working with nested state",permalink:"/docs/recipes/nested-state"}},a={},d=[];function l(e){const t={blockquote:"blockquote",code:"code",p:"p",pre:"pre",strong:"strong",...(0,s.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["A ",(0,r.jsx)(t.strong,{children:"xoid"})," atom can be used to grab element refs (as in React's terminology) in a typesafe manner."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",children:"const $ref = create() // Stream\n\n$ref.set(document.body)\n"})}),"\n",(0,r.jsxs)(t.p,{children:["It's completely safe to feed ",(0,r.jsx)(t.code,{children:"atom.set"})," calls as refs to React components as ",(0,r.jsx)(t.code,{children:"ref"})," prop."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",children:"import create from 'xoid'\nimport { useSetup } from '@xoid/react'\n// inside React\nconst { $ref } = useSetup(() => {\n const $ref = create()\n $ref.subscribe((element) => console.log(element))\n return { $ref }\n})\nreturn
    \n"})}),"\n",(0,r.jsxs)(t.blockquote,{children:["\n",(0,r.jsxs)(t.p,{children:["This usage won't result in Typescript complaints. ",(0,r.jsx)(t.strong,{children:"xoid"}),"'s ",(0,r.jsx)(t.code,{children:"set"})," method in this example, would be compatible with ",(0,r.jsx)(t.code,{children:"React.RefCallback"}),"."]}),"\n"]})]})}function p(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>i,a:()=>o});var r=n(7294);const s={},c=r.createContext(s);function o(e){const t=r.useContext(c);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),r.createElement(c.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/cc2ca9c3.61512f5c.js b/build/assets/js/cc2ca9c3.61512f5c.js new file mode 100644 index 0000000..6faeae7 --- /dev/null +++ b/build/assets/js/cc2ca9c3.61512f5c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[48],{6434:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>c,default:()=>u,frontMatter:()=>s,metadata:()=>a,toc:()=>l});var o=n(5893),r=n(1151);const s={id:"using-context-correctly",title:"Using context correctly"},c=void 0,a={id:"recipes-react/using-context-correctly",title:"Using context correctly",description:"Using React context for rarely-occuring changes such as theme providers, or internationalization is harmless. However, when context starts to be used for other things, it can affect performance badly.",source:"@site/main/docs/recipes-react/using-context-correctly.md",sourceDirName:"recipes-react",slug:"/recipes-react/using-context-correctly",permalink:"/docs/recipes-react/using-context-correctly",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes-react/using-context-correctly.md",tags:[],version:"current",lastUpdatedAt:1696460720,formattedLastUpdatedAt:"Oct 4, 2023",frontMatter:{id:"using-context-correctly",title:"Using context correctly"},sidebar:"docs",previous:{title:"useSetup",permalink:"/docs/framework-integrations/use-setup"},next:{title:"Creating React custom hooks",permalink:"/docs/recipes-react/creating-react-custom-hooks"}},i={},l=[];function d(e){const t={a:"a",blockquote:"blockquote",code:"code",p:"p",pre:"pre",strong:"strong",...(0,r.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.p,{children:"Using React context for rarely-occuring changes such as theme providers, or internationalization is harmless. However, when context starts to be used for other things, it can affect performance badly."}),"\n",(0,o.jsxs)(t.p,{children:["A context provider, whenever its state changes, causes its whole subtree to rerender. This can result in noticable slowdowns. Even Redux has used React Context in v6, then reverted it in v7 due to ",(0,o.jsx)(t.a,{href:"https://github.com/reduxjs/react-redux/issues/1164",children:"some recurring complaints"}),". This was also mentioned in ",(0,o.jsx)(t.a,{href:"https://blog.isquaredsoftware.com/2018/11/react-redux-history-implementation/#v7-0",children:"The History and Implementation of React-Redux by Mark Erikson"}),"."]}),"\n",(0,o.jsx)(t.p,{children:"Ideally, a context provider should cause zero rerenders."}),"\n",(0,o.jsxs)(t.p,{children:["There's ",(0,o.jsx)(t.a,{href:"https://medium.com/@mweststrate/how-to-safely-use-react-context-b7e343eff076",children:"an article by Michel Weststrate"})," on this topic. In the article, he summarizes as ",(0,o.jsx)(t.strong,{children:'"we should not store state directly in our context. Instead, we should use context as a dependency injection system"'}),". ",(0,o.jsx)(t.strong,{children:"xoid"})," couldn't agree more, and it can be used to do exactly that."]}),"\n",(0,o.jsxs)(t.p,{children:["Let our state to be shared via context be ",(0,o.jsx)(t.code,{children:"{alpha: number, beta: number}"}),". Instead of feeding it directly as a context value, we can wrap it inside an atom. We can create that atom only once, inside a ",(0,o.jsx)(t.code,{children:"useSetup"})," hook."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",metastring:'title="./App.tsx"',children:"import { create } from 'xoid'\nimport { useSetup } from '@xoid/react'\nimport { MyContext } from './MyContext'\nimport { ConsumerComponent } from './ConsumerComponent'\n\nexport const App = () => {\n const contextValue = useSetup(() => create({ alpha: 3, beta: 5 }))\n\n return (\n \n \n \n )\n}\n"})}),"\n",(0,o.jsxs)(t.blockquote,{children:["\n",(0,o.jsx)(t.p,{children:"useSetup's callback function will run exactly once, and the context's value reference will remain static, however the atom's internal state is dynamic."}),"\n"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",metastring:'title="./MyComponent.tsx"',children:"import { useContext } from 'react'\nimport { use } from 'xoid'\nimport { useAtom } from '@xoid/react'\nimport { MyContext } from './MyContext'\n\nexport const MyComponent = () => {\n const atom = useContext(MyContext)\n const { alpha, beta } = useAtom(atom)\n\n return (\n
    \n alpha: {state.alpha}, beta: {state.beta}\n \n
    \n )\n}\n"})}),"\n",(0,o.jsxs)(t.p,{children:["Only the components that subscribe to the content of ",(0,o.jsx)(t.code,{children:"MyContext"})," explicitly via ",(0,o.jsx)(t.code,{children:"useAtom"})," will rerender. Also note that, any component now has the chance to subscribe to a subtree/leaf of the same context such that: ",(0,o.jsx)(t.code,{children:"useAtom(atom.focus('alpha'))"}),". Context selectors are achieved in a single, expressive API! Voil\xe0!"]})]})}function u(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>c});var o=n(7294);const r={},s=o.createContext(r);function c(e){const t=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),o.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/da0da91b.6b87ea71.js b/build/assets/js/da0da91b.6b87ea71.js new file mode 100644 index 0000000..03c7aed --- /dev/null +++ b/build/assets/js/da0da91b.6b87ea71.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[900],{1188:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>a,toc:()=>m});var n=o(5893),r=o(1151);const s={id:"use-atom",title:"useAtom"},i=void 0,a={id:"framework-integrations/use-atom",title:"useAtom",description:"import { useAtom } from '@xoid/react'",source:"@site/main/docs/framework-integrations/use-atom.md",sourceDirName:"framework-integrations",slug:"/framework-integrations/use-atom",permalink:"/docs/framework-integrations/use-atom",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/framework-integrations/use-atom.md",tags:[],version:"current",lastUpdatedAt:1696464220,formattedLastUpdatedAt:"Oct 5, 2023",frontMatter:{id:"use-atom",title:"useAtom"},sidebar:"docs",previous:{title:"Introduction",permalink:"/docs/framework-integrations/introduction"},next:{title:"useSetup",permalink:"/docs/framework-integrations/use-setup"}},c={},m=[];function d(e){const t={code:"code",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.p,{children:(0,n.jsx)(t.code,{children:"import { useAtom } from '@xoid/react'"})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.code,{children:"import { useAtom } from '@xoid/svelte'"})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.code,{children:"import { useAtom } from '@xoid/vue'"})}),"\n",(0,n.jsx)(t.p,{children:"Used for subscribing a component to an atom."}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"import { create } from 'xoid';\nimport { useAtom } from '@xoid/react'; // or '@xoid/vue' or '@xoid/svelte'\n\nconst $number = create(5);\nconst $person = create({ name: 'John', surname: 'Doe' });\n\n// inside a component\nconst number = useAtom($number);\n\n// inside a component\nconst name = useAtom($person.focus('name'));\n"})})]})}function u(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},1151:(e,t,o)=>{o.d(t,{Z:()=>a,a:()=>i});var n=o(7294);const r={},s=n.createContext(r);function i(e){const t=n.useContext(s);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/db6ef8bb.18f20f1a.js b/build/assets/js/db6ef8bb.18f20f1a.js new file mode 100644 index 0000000..6e6a278 --- /dev/null +++ b/build/assets/js/db6ef8bb.18f20f1a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[353],{1739:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>r});var o=t(5893),a=t(1151);const i={id:"performance-optimizations",title:"Performance optimizations"},s=void 0,l={id:"performance-optimizations",title:"Performance optimizations",description:"Lazy evaluation",source:"@site/main/docs/performance-optimizations.md",sourceDirName:".",slug:"/performance-optimizations",permalink:"/docs/performance-optimizations",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/performance-optimizations.md",tags:[],version:"current",lastUpdatedAt:1696460720,formattedLastUpdatedAt:"Oct 4, 2023",frontMatter:{id:"performance-optimizations",title:"Performance optimizations"},sidebar:"docs",previous:{title:"Quick Tutorial",permalink:"/docs/quick-tutorial"},next:{title:"Streams",permalink:"/docs/streams"}},c={},r=[{value:"Lazy evaluation",id:"lazy-evaluation",level:2},{value:"Lazy evaluation in derived atoms",id:"lazy-evaluation-in-derived-atoms",level:2},{value:"Dependency collection in derived atoms",id:"dependency-collection-in-derived-atoms",level:2},{value:"Lazy evaluation in atoms created with .map method",id:"lazy-evaluation-in-atoms-created-with-map-method",level:2}];function d(e){const n={a:"a",blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,a.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"lazy-evaluation",children:"Lazy evaluation"}),"\n",(0,o.jsxs)(n.p,{children:["Atoms are lazily evaluated. If an atom is created using a ",(0,o.jsx)(n.em,{children:"state initializer function"}),", this function won't run until the ",(0,o.jsx)(n.code,{children:".value"})," getter is read, or the atom is subscribed for the first time."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"const $atom = create(() => {\n console.log('I am lazily evaluated!')\n return expensiveComputation(25)\n})\n// nothing's logged on the console yet\n\nconsole.log($atom.value)\n// Console: \"I am lazily evaluated!\"\n// Console: 25\n\nconsole.log($atom.value)\n// Console: 25\n"})}),"\n",(0,o.jsx)(n.p,{children:"You can make use of this feature to avoid expensive computations where possible."}),"\n",(0,o.jsx)(n.h2,{id:"lazy-evaluation-in-derived-atoms",children:"Lazy evaluation in derived atoms"}),"\n",(0,o.jsx)(n.p,{children:"A derived atom is not much different than a classical atom. Still, its state initializer function will wait for the atom's value to be requested in order to run."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"const $alpha = create(3)\nconst $beta = create(5)\n\nconst $sum = create((read) => {\n console.log('Evaluation occured')\n return read($alpha) + read($beta)\n})\n// nothing's logged on the console yet\n"})}),"\n",(0,o.jsx)(n.p,{children:"Later, when it's consumed for the first time:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'console.log($sum.value)\n// Console: "Evaluation occured"\n// Console: 8\n\nconsole.log($sum.value)\n// Console: 8\n'})}),"\n",(0,o.jsx)(n.h2,{id:"dependency-collection-in-derived-atoms",children:"Dependency collection in derived atoms"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Dependency collection"})," is another performance optimization that makes lazy evaluation much more advanced.\nWhen an atom is evaluated, it collects its latest dependencies. Since the ",(0,o.jsx)(n.code,{children:"$sum"})," is evaluated at least once in our previous example, it's now \"aware\" that it's dependencies are ",(0,o.jsx)(n.code,{children:"$alpha"})," and ",(0,o.jsx)(n.code,{children:"$beta"}),". Let's observe what will happen when those dependencies are updated:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'$alpha.set(30)\n$alpha.update((s) => s + 1)\n$beta.set(1000)\n// nothing\'s logged on the console yet\n\nconsole.log($sum.value)\n// Console: "Evaluation occured"\n// Console: 1031\n\nconsole.log($sum.value)\n// Console: 1031\n'})}),"\n",(0,o.jsxs)(n.p,{children:["Observe that ",(0,o.jsx)(n.code,{children:"$sum"})," knew that it needs to rerun its state initializer when it's ",(0,o.jsx)(n.code,{children:".value"})," is requested after the dependencies are changed. This can happen thanks to ",(0,o.jsx)(n.strong,{children:"dependency collection"}),". ",(0,o.jsx)(n.code,{children:"$sum"})," knows that its internal state is invalid without causing evaluation. It can avoid evaluation until it's essential."]}),"\n",(0,o.jsxs)(n.h2,{id:"lazy-evaluation-in-atoms-created-with-map-method",children:["Lazy evaluation in atoms created with ",(0,o.jsx)(n.code,{children:".map"})," method"]}),"\n",(0,o.jsxs)(n.p,{children:["Same kind of performance optimizations apply to the atoms that are created using the ",(0,o.jsx)(n.code,{children:".map"})," method."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"const $count = create(() => {\n console.log('Ancestor atom evaluated')\n return 100\n})\n\nconst $doubleCount = $count.map((value) => {\n console.log('Evaluation occured')\n return value * 2\n})\n// nothing's logged on the console yet\n\n$count.update(s => s + 1)\n// Console: \"Ancestor atom evaluated\"\n\nconsole.log($doubleCount.value)\n// Console: \"Evaluation occured\"\n// Console: 202\n\nconsole.log($doubleCount.value)\n// Console: 202\n"})}),"\n",(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"xoid"}),' supports special kind of atoms called "stream"s.\nA stream is "an atom that may or may not have an immediate value". Lazy evaluation works slightly different in a "stream". See the ',(0,o.jsx)(n.a,{href:"streams",children:"next section"})," for more."]}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,a.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>l,a:()=>s});var o=t(7294);const a={},i=o.createContext(a);function s(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/dfc43f92.2905f212.js b/build/assets/js/dfc43f92.2905f212.js new file mode 100644 index 0000000..2e6efac --- /dev/null +++ b/build/assets/js/dfc43f92.2905f212.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[253],{9884:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>l,default:()=>m,frontMatter:()=>a,metadata:()=>c,toc:()=>d});var r=t(5893),o=t(1151),i=t(4866),s=t(5162);const a={id:"introduction",title:"Introduction"},l=void 0,c={id:"framework-integrations/introduction",title:"Introduction",description:"xoid provides an isomorphic API for React, Vue, and Svelte. If you're using xoid with one of these frameworks, simply install one of the following packages:",source:"@site/main/docs/framework-integrations/indtroduction.md",sourceDirName:"framework-integrations",slug:"/framework-integrations/introduction",permalink:"/docs/framework-integrations/introduction",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/framework-integrations/indtroduction.md",tags:[],version:"current",lastUpdatedAt:1696936626,formattedLastUpdatedAt:"Oct 10, 2023",frontMatter:{id:"introduction",title:"Introduction"},sidebar:"docs",previous:{title:"Advanced concepts",permalink:"/docs/advanced-concepts"},next:{title:"useAtom",permalink:"/docs/framework-integrations/use-atom"}},u={},d=[{value:"Isomorphic component logic",id:"isomorphic-component-logic",level:2}];function h(e){const n={blockquote:"blockquote",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"xoid"})," provides an isomorphic API for ",(0,r.jsx)(n.strong,{children:"React"}),", ",(0,r.jsx)(n.strong,{children:"Vue"}),", and ",(0,r.jsx)(n.strong,{children:"Svelte"}),". If you're using ",(0,r.jsx)(n.strong,{children:"xoid"})," with one of these frameworks, simply install one of the following packages:"]}),"\n","\n","\n",(0,r.jsxs)(i.Z,{defaultValue:"React",values:[{label:"React",value:"React"},{label:"Vue",value:"Vue"},{label:"Svelte",value:"Svelte"}],children:[(0,r.jsx)(s.Z,{value:"React",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install @xoid/react\n"})})}),(0,r.jsx)(s.Z,{value:"Vue",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install @xoid/vue\n"})})}),(0,r.jsx)(s.Z,{value:"Svelte",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install @xoid/svelte\n"})})})]}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:["All these framework integration packages have ",(0,r.jsx)(n.code,{children:"useAtom"})," and ",(0,r.jsx)(n.code,{children:"useSetup"})," functions that have the same interface."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"isomorphic-component-logic",children:"Isomorphic component logic"}),"\n",(0,r.jsxs)(n.p,{children:["This might be the most unique feature of ",(0,r.jsx)(n.strong,{children:"xoid"}),". With ",(0,r.jsx)(n.strong,{children:"xoid"}),", you can write component logic (including lifecycle) ONCE, and run it across multiple frameworks. This feature is for you especially if:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"You're a design system, or a headless UI library maintainer"}),"\n",(0,r.jsx)(n.li,{children:"You're using multiple frameworks in your project, or refactoring your code from one framework to another"}),"\n",(0,r.jsx)(n.li,{children:"You dislike React's render cycle and want a simpler, real closure for managing complex state"}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:'The following is called a "setup" function:'}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import create, { Atom } from 'xoid'\nimport { effect, inject } from 'xoid/setup'\nimport { ThemeSymbol } from './theme'\n\nexport const CounterSetup = ($props: Atom<{ initialValue: number }>) => {\n const { initialValue } = $props.value\n\n const $counter = create(initialValue)\n const increment = () => $counter.update((s) => s + 1)\n const decrement = () => $counter.update((s) => s - 1)\n\n effect(() => {\n console.log('mounted')\n return () => console.log('unmounted')\n })\n\n const theme = inject(ThemeSymbol)\n console.log(\"theme is obtained using context:\", theme)\n\n return { $counter, increment, decrement }\n}\n"})}),"\n",(0,r.jsxs)(n.p,{children:["All ",(0,r.jsx)(n.code,{children:"@xoid/react"}),", ",(0,r.jsx)(n.code,{children:"@xoid/vue"}),", and ",(0,r.jsx)(n.code,{children:"@xoid/svelte"})," modules have an isomorphic ",(0,r.jsx)(n.code,{children:"useSetup"})," function that can consume functions like this."]}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:["We're aware that not all users need this feature, so we've built it tree-shakable. If ",(0,r.jsx)(n.code,{children:"useAtom"})," is all you need, you may choose to import it from ",(0,r.jsx)(n.code,{children:"'@xoid/[FRAMEWORK]/useAtom'"}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"With this feature, you can effectively replace the following framework-specific APIs:"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{}),(0,r.jsxs)(n.th,{children:[(0,r.jsx)("img",{src:"https://raw.githubusercontent.com/xoidlabs/xoid/master/assets/logo-plain.svg",width:"16"})," xoid"]}),(0,r.jsxs)(n.th,{children:[(0,r.jsx)("img",{src:"https://raw.githubusercontent.com/xoidlabs/xoid/master/assets/integrations/react.ico",width:"16"})," React"]}),(0,r.jsxs)(n.th,{children:[(0,r.jsx)("img",{src:"https://raw.githubusercontent.com/xoidlabs/xoid/master/assets/integrations/vue.png",width:"16"})," Vue"]}),(0,r.jsxs)(n.th,{children:[(0,r.jsx)("img",{src:"https://raw.githubusercontent.com/xoidlabs/xoid/master/assets/integrations/svelte.png",width:"16"})," Svelte"]})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"State"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"create"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"useState"})," / ",(0,r.jsx)(n.code,{children:"useReducer"})]}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"reactive"})," / ",(0,r.jsx)(n.code,{children:"ref"})]}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"readable"})," / ",(0,r.jsx)(n.code,{children:"writable"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Derived state"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"create"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"useMemo"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"computed"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"derived"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Lifecycle"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"effect"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"useEffect"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"onMounted"}),", ",(0,r.jsx)(n.code,{children:"onUnmounted"})]}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"onMount"}),", ",(0,r.jsx)(n.code,{children:"onDestroy"})]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Dependency injection"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"inject"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"useContext"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"inject"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"getContext"})})]})]})]})]})}function m(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},5162:(e,n,t)=>{t.d(n,{Z:()=>s});t(7294);var r=t(512);const o={tabItem:"tabItem_Ymn6"};var i=t(5893);function s(e){var n=e.children,t=e.hidden,s=e.className;return(0,i.jsx)("div",{role:"tabpanel",className:(0,r.Z)(o.tabItem,s),hidden:t,children:n})}},4866:(e,n,t)=>{t.d(n,{Z:()=>y});var r=t(7294),o=t(512),i=t(2466),s=t(6550),a=t(469),l=t(1980),c=t(7392),u=t(12);function d(e){var n,t;return null!=(n=null==(t=r.Children.toArray(e).filter((function(e){return"\n"!==e})).map((function(e){if(!e||(0,r.isValidElement)(e)&&((n=e.props)&&"object"==typeof n&&"value"in n))return e;var n;throw new Error("Docusaurus error: Bad child <"+("string"==typeof e.type?e.type:e.type.name)+'>: all children of the component should be , and every should have a unique "value" prop.')})))?void 0:t.filter(Boolean))?n:[]}function h(e){var n=e.values,t=e.children;return(0,r.useMemo)((function(){var e=null!=n?n:function(e){return d(e).map((function(e){var n=e.props;return{value:n.value,label:n.label,attributes:n.attributes,default:n.default}}))}(t);return function(e){var n=(0,c.l)(e,(function(e,n){return e.value===n.value}));if(n.length>0)throw new Error('Docusaurus error: Duplicate values "'+n.map((function(e){return e.value})).join(", ")+'" found in . Every value needs to be unique.')}(e),e}),[n,t])}function m(e){var n=e.value;return e.tabValues.some((function(e){return e.value===n}))}function x(e){var n=e.queryString,t=void 0!==n&&n,o=e.groupId,i=(0,s.k6)(),a=function(e){var n=e.queryString,t=void 0!==n&&n,r=e.groupId;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return null!=r?r:null}({queryString:t,groupId:o});return[(0,l._X)(a),(0,r.useCallback)((function(e){if(a){var n=new URLSearchParams(i.location.search);n.set(a,e),i.replace(Object.assign({},i.location,{search:n.toString()}))}}),[a,i])]}function f(e){var n,t,o,i,s=e.defaultValue,l=e.queryString,c=void 0!==l&&l,d=e.groupId,f=h(e),p=(0,r.useState)((function(){return function(e){var n,t=e.defaultValue,r=e.tabValues;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:r}))throw new Error('Docusaurus error: The has a defaultValue "'+t+'" but none of its children has the corresponding value. Available values are: '+r.map((function(e){return e.value})).join(", ")+". If you intend to show no default tab, use defaultValue={null} instead.");return t}var o=null!=(n=r.find((function(e){return e.default})))?n:r[0];if(!o)throw new Error("Unexpected error: 0 tabValues");return o.value}({defaultValue:s,tabValues:f})})),j=p[0],v=p[1],b=x({queryString:c,groupId:d}),g=b[0],w=b[1],y=(n=function(e){return e?"docusaurus.tab."+e:null}({groupId:d}.groupId),t=(0,u.Nk)(n),o=t[0],i=t[1],[o,(0,r.useCallback)((function(e){n&&i.set(e)}),[n,i])]),k=y[0],I=y[1],V=function(){var e=null!=g?g:k;return m({value:e,tabValues:f})?e:null}();return(0,a.Z)((function(){V&&v(V)}),[V]),{selectedValue:j,selectValue:(0,r.useCallback)((function(e){if(!m({value:e,tabValues:f}))throw new Error("Can't select invalid tab value="+e);v(e),w(e),I(e)}),[w,I,f]),tabValues:f}}var p=t(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=t(5893);function b(e){var n=e.className,t=e.block,r=e.selectedValue,s=e.selectValue,a=e.tabValues,l=[],c=(0,i.o5)().blockElementScrollPositionUntilNextRender,u=function(e){var n=e.currentTarget,t=l.indexOf(n),o=a[t].value;o!==r&&(c(n),s(o))},d=function(e){var n,t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":var r,o=l.indexOf(e.currentTarget)+1;t=null!=(r=l[o])?r:l[0];break;case"ArrowLeft":var i,s=l.indexOf(e.currentTarget)-1;t=null!=(i=l[s])?i:l[l.length-1]}null==(n=t)||n.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},n),children:a.map((function(e){var n=e.value,t=e.label,i=e.attributes;return(0,v.jsx)("li",Object.assign({role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:function(e){return l.push(e)},onKeyDown:d,onClick:u},i,{className:(0,o.Z)("tabs__item",j.tabItem,null==i?void 0:i.className,{"tabs__item--active":r===n}),children:null!=t?t:n}),n)}))})}function g(e){var n=e.lazy,t=e.children,o=e.selectedValue,i=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){var s=i.find((function(e){return e.props.value===o}));return s?(0,r.cloneElement)(s,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:i.map((function(e,n){return(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==o})}))})}function w(e){var n=f(e);return(0,v.jsxs)("div",{className:(0,o.Z)("tabs-container",j.tabList),children:[(0,v.jsx)(b,Object.assign({},e,n)),(0,v.jsx)(g,Object.assign({},e,n))]})}function y(e){var n=(0,p.Z)();return(0,v.jsx)(w,Object.assign({},e,{children:d(e.children)}),String(n))}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>s});var r=t(7294);const o={},i=r.createContext(o);function s(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/e4308a9d.0896c905.js b/build/assets/js/e4308a9d.0896c905.js new file mode 100644 index 0000000..97cfb1e --- /dev/null +++ b/build/assets/js/e4308a9d.0896c905.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[439],{5745:e=>{e.exports=JSON.parse('{"name":"docusaurus-plugin-content-pages","id":"default"}')}}]); \ No newline at end of file diff --git a/build/assets/js/f518eb7a.3202fc58.js b/build/assets/js/f518eb7a.3202fc58.js new file mode 100644 index 0000000..f8afa4b --- /dev/null +++ b/build/assets/js/f518eb7a.3202fc58.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[736],{784:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>o,default:()=>u,frontMatter:()=>r,metadata:()=>d,toc:()=>l});var n=s(5893),i=s(1151);const r={id:"nested-state",title:"Working with nested state"},o=void 0,d={id:"recipes/nested-state",title:"Working with nested state",description:"Before xoid:",source:"@site/main/docs/recipes/nested-state.md",sourceDirName:"recipes",slug:"/recipes/nested-state",permalink:"/docs/recipes/nested-state",draft:!1,unlisted:!1,editUrl:"https://github.com/xoidlabs/xoid/blob/main/docs/recipes/nested-state.md",tags:[],version:"current",lastUpdatedAt:1696936626,formattedLastUpdatedAt:"Oct 10, 2023",frontMatter:{id:"nested-state",title:"Working with nested state"},sidebar:"docs",previous:{title:"Grabbing refs",permalink:"/docs/recipes-react/grabbing-refs"},next:{title:"Using immer",permalink:"/docs/recipes/using-immer"}},a={},l=[{value:"Related",id:"related",level:3}];function c(e){const t={a:"a",code:"code",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["Before ",(0,n.jsx)(t.strong,{children:"xoid"}),":"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"setState((state) => {\n ...state, \n deeply: {\n ...state.deeply,\n nested: {\n ...state.deeply.nested,\n value: state.deeply.nested.value + 1\n }\n }\n})\n"})}),"\n",(0,n.jsxs)(t.p,{children:["After ",(0,n.jsx)(t.strong,{children:"xoid"}),":"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"atom.focus(s => s.deeply.nested.value).update(s => s + 1)\n"})}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.strong,{children:"xoid"})," makes it easier to work with nested state. Redux and React (and ",(0,n.jsx)(t.strong,{children:"xoid"}),") are based on immutable updates. Immutability is great, however it usually has a bad impact on code readability."]}),"\n",(0,n.jsxs)(t.p,{children:["To overcome this, there are other tools like ",(0,n.jsx)(t.strong,{children:"immutablejs"})," or ",(0,n.jsx)(t.strong,{children:"immer"}),". Even Redux Toolkit comes with ",(0,n.jsx)(t.strong,{children:"immer"})," by default. Note that using Redux toolkit means adding another ~11kB to your bundle size. This number is ~5kB for ",(0,n.jsx)(t.strong,{children:"immer"})," alone. ",(0,n.jsx)(t.strong,{children:"xoid"})," is ~1kB, yet it can be used to overcome the same problem."]}),"\n",(0,n.jsx)(t.h3,{id:"related",children:"Related"}),"\n",(0,n.jsxs)(t.p,{children:["To see how ",(0,n.jsx)(t.strong,{children:"xoid"})," compares to a classical reducer, and a dedicated library that's using ",(0,n.jsx)(t.strong,{children:"immer"})," internally (",(0,n.jsx)(t.code,{children:"use-methods"}),"), you can check the following example:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.a,{href:"https://github.com/xoidlabs/xoid/tree/master/examples/xoid-vs-usereducer-vs-usemethods",children:"xoid vs useReducer vs useMethods"})," ",(0,n.jsx)(t.a,{href:"https://githubbox.com/xoidlabs/xoid/tree/master/examples/xoid-vs-usereducer-vs-usemethods",children:(0,n.jsx)(t.img,{src:"https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat&colorA=4f2eb3&colorB=4f2eb3&logo=codesandbox",alt:"Open in CodeSandbox"})})]}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},1151:(e,t,s)=>{s.d(t,{Z:()=>d,a:()=>o});var n=s(7294);const i={},r=n.createContext(i);function o(e){const t=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),n.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/build/assets/js/main.c461e0b8.js b/build/assets/js/main.c461e0b8.js new file mode 100644 index 0000000..ed92713 --- /dev/null +++ b/build/assets/js/main.c461e0b8.js @@ -0,0 +1,2 @@ +/*! For license information please see main.c461e0b8.js.LICENSE.txt */ +(self.webpackChunkxoid_website=self.webpackChunkxoid_website||[]).push([[179],{830:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var r=n(7294);function a(){return r.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},r.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}},723:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});n(7294);var r=n(8356),a=n.n(r),o=n(6887);const i={"004bd376":[function(){return n.e(554).then(n.bind(n,5812))},"@site/main/docs/advanced-concepts.md",5812],"0414c4f7":[function(){return n.e(995).then(n.bind(n,6161))},"@site/main/docs/recipes/using-reducers.md",6161],17896441:[function(){return Promise.all([n.e(532),n.e(286),n.e(918)]).then(n.bind(n,8835))},"@theme/DocItem",8835],"1a4e3797":[function(){return Promise.all([n.e(532),n.e(920)]).then(n.bind(n,6675))},"@theme/SearchPage",6675],"249cd168":[function(){return n.e(496).then(n.bind(n,1639))},"@site/main/docs/recipes/redux-interop.md",1639],"2e904a15":[function(){return n.e(560).then(n.bind(n,1814))},"@site/main/docs/recipes/finite-state-machines.md",1814],"2ed64405":[function(){return n.e(841).then(n.bind(n,9250))},"@site/main/docs/recipes/redux-devtools-integration.md",9250],"2f347b4a":[function(){return n.e(984).then(n.bind(n,2135))},"@site/main/docs/recipes-react/creating-react-custom-hooks.md",2135],"31ee3e38":[function(){return n.e(75).then(n.bind(n,4680))},"@site/main/docs/examples.md",4680],"37baf4df":[function(){return n.e(893).then(n.bind(n,6671))},"@site/main/docs/recipes/using-immer.md",6671],"4c274390":[function(){return n.e(432).then(n.bind(n,4982))},"@site/main/docs/streams.md",4982],"4e47bf6c":[function(){return n.e(79).then(n.bind(n,6454))},"@site/main/docs/recipes/persist-localstorage.md",6454],"58666e07":[function(){return n.e(927).then(n.t.bind(n,7085,19))},"/Users/onurkerimov/Documents/GitHub/xoid-website/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json",7085],"5e95c892":[function(){return n.e(661).then(n.bind(n,1892))},"@theme/DocsRoot",1892],"5e9f5e1a":[function(){return Promise.resolve().then(n.bind(n,6809))},"@generated/docusaurus.config",6809],"6ffd3f58":[function(){return n.e(885).then(n.bind(n,8454))},"@site/main/docs/framework-integrations/use-setup.md",8454],"735fe611":[function(){return n.e(271).then(n.bind(n,2893))},"@site/main/docs/quick-tutorial.md",2893],"7668cb98":[function(){return n.e(447).then(n.bind(n,4714))},"@site/main/docs/recipes-react/dynamic-functions-with-fixed-references.md",4714],"826e072b":[function(){return Promise.all([n.e(532),n.e(886)]).then(n.bind(n,2122))},"@site/main/docs/introduction.md",2122],"83d722e5":[function(){return n.e(745).then(n.bind(n,9334))},"@site/main/docs/recipes-react/refactoring-react-classes.md",9334],"935f2afb":[function(){return n.e(53).then(n.t.bind(n,1109,19))},"~docs/default/version-current-metadata-prop-751.json",1109],"96f6f7ba":[function(){return n.e(666).then(n.t.bind(n,3769,19))},"/Users/onurkerimov/Documents/GitHub/xoid-website/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",3769],a7bd4aaa:[function(){return n.e(518).then(n.bind(n,8564))},"@theme/DocVersionRoot",8564],a94703ab:[function(){return Promise.all([n.e(532),n.e(368)]).then(n.bind(n,2674))},"@theme/DocRoot",2674],c4f5d8e4:[function(){return Promise.all([n.e(532),n.e(286),n.e(538),n.e(195)]).then(n.bind(n,3395))},"@site/src/pages/index.js",3395],c5beeb90:[function(){return n.e(330).then(n.bind(n,8704))},"@site/main/docs/recipes-react/grabbing-refs.md",8704],cc2ca9c3:[function(){return n.e(48).then(n.bind(n,6434))},"@site/main/docs/recipes-react/using-context-correctly.md",6434],da0da91b:[function(){return n.e(900).then(n.bind(n,1188))},"@site/main/docs/framework-integrations/use-atom.md",1188],db6ef8bb:[function(){return n.e(353).then(n.bind(n,1739))},"@site/main/docs/performance-optimizations.md",1739],dfc43f92:[function(){return Promise.all([n.e(532),n.e(253)]).then(n.bind(n,9884))},"@site/main/docs/framework-integrations/indtroduction.md",9884],e4308a9d:[function(){return n.e(439).then(n.t.bind(n,5745,19))},"/Users/onurkerimov/Documents/GitHub/xoid-website/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",5745],f518eb7a:[function(){return n.e(736).then(n.bind(n,784))},"@site/main/docs/recipes/nested-state.md",784]};var l=n(5893);function s(e){var t=e.error,n=e.retry,r=e.pastDelay;return t?(0,l.jsxs)("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"},children:[(0,l.jsx)("p",{children:String(t)}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{type:"button",onClick:n,children:"Retry"})})]}):r?(0,l.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,l.jsx)("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb",children:(0,l.jsxs)("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2",children:[(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsx)("circle",{cx:"22",cy:"22",r:"8",children:(0,l.jsx)("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"})})]})})}):null}var u=n(9670),c=n(226);function d(e,t){if("*"===e)return a()({loading:s,loader:function(){return n.e(772).then(n.bind(n,1772))},modules:["@theme/NotFound"],webpack:function(){return[1772]},render:function(e,t){var n=e.default;return(0,l.jsx)(c.z,{value:{plugin:{name:"native",id:"default"}},children:(0,l.jsx)(n,Object.assign({},t))})}});var r=o[e+"-"+t],d={},f=[],p=[],m=(0,u.Z)(r);return Object.entries(m).forEach((function(e){var t=e[0],n=e[1],r=i[n];r&&(d[t]=r[0],f.push(r[1]),p.push(r[2]))})),a().Map({loading:s,loader:d,modules:f,webpack:function(){return p},render:function(t,n){var a=JSON.parse(JSON.stringify(r));Object.entries(t).forEach((function(t){var n=t[0],r=t[1],o=r.default;if(!o)throw new Error("The page component at "+e+" doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.");"object"!=typeof o&&"function"!=typeof o||Object.keys(r).filter((function(e){return"default"!==e})).forEach((function(e){o[e]=r[e]}));var i=a,l=n.split(".");l.slice(0,-1).forEach((function(e){i=i[e]})),i[l[l.length-1]]=o}));var o=a.__comp;delete a.__comp;var i=a.__context;return delete a.__context,(0,l.jsx)(c.z,{value:i,children:(0,l.jsx)(o,Object.assign({},a,n))})}})}const f=[{path:"/search",component:d("/search","acc"),exact:!0},{path:"/docs",component:d("/docs","db7"),routes:[{path:"/docs",component:d("/docs","351"),routes:[{path:"/docs",component:d("/docs","a18"),routes:[{path:"/docs/advanced-concepts",component:d("/docs/advanced-concepts","eb4"),exact:!0,sidebar:"docs"},{path:"/docs/examples",component:d("/docs/examples","0d2"),exact:!0},{path:"/docs/framework-integrations/introduction",component:d("/docs/framework-integrations/introduction","9f8"),exact:!0,sidebar:"docs"},{path:"/docs/framework-integrations/use-atom",component:d("/docs/framework-integrations/use-atom","347"),exact:!0,sidebar:"docs"},{path:"/docs/framework-integrations/use-setup",component:d("/docs/framework-integrations/use-setup","35c"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started",component:d("/docs/getting-started","9eb"),exact:!0,sidebar:"docs"},{path:"/docs/performance-optimizations",component:d("/docs/performance-optimizations","097"),exact:!0,sidebar:"docs"},{path:"/docs/quick-tutorial",component:d("/docs/quick-tutorial","136"),exact:!0,sidebar:"docs"},{path:"/docs/recipes-react/creating-react-custom-hooks",component:d("/docs/recipes-react/creating-react-custom-hooks","805"),exact:!0,sidebar:"docs"},{path:"/docs/recipes-react/dynamic-functions-with-fixed-references",component:d("/docs/recipes-react/dynamic-functions-with-fixed-references","f32"),exact:!0,sidebar:"docs"},{path:"/docs/recipes-react/grabbing-refs",component:d("/docs/recipes-react/grabbing-refs","4b1"),exact:!0,sidebar:"docs"},{path:"/docs/recipes-react/refactoring-react-classes",component:d("/docs/recipes-react/refactoring-react-classes","0c1"),exact:!0,sidebar:"docs"},{path:"/docs/recipes-react/using-context-correctly",component:d("/docs/recipes-react/using-context-correctly","9a7"),exact:!0,sidebar:"docs"},{path:"/docs/recipes/finite-state-machines",component:d("/docs/recipes/finite-state-machines","c73"),exact:!0,sidebar:"docs"},{path:"/docs/recipes/nested-state",component:d("/docs/recipes/nested-state","924"),exact:!0,sidebar:"docs"},{path:"/docs/recipes/persist-localstorage",component:d("/docs/recipes/persist-localstorage","866"),exact:!0,sidebar:"docs"},{path:"/docs/recipes/redux-devtools-integration",component:d("/docs/recipes/redux-devtools-integration","b38"),exact:!0,sidebar:"docs"},{path:"/docs/recipes/redux-interop",component:d("/docs/recipes/redux-interop","cff"),exact:!0,sidebar:"docs"},{path:"/docs/recipes/using-immer",component:d("/docs/recipes/using-immer","238"),exact:!0,sidebar:"docs"},{path:"/docs/recipes/using-reducers",component:d("/docs/recipes/using-reducers","327"),exact:!0,sidebar:"docs"},{path:"/docs/streams",component:d("/docs/streams","a96"),exact:!0,sidebar:"docs"}]}]}]},{path:"/",component:d("/","d96"),exact:!0},{path:"*",component:d("*")}]},8934:(e,t,n)=>{"use strict";n.d(t,{_:()=>o,t:()=>i});var r=n(7294),a=n(5893),o=r.createContext(!1);function i(e){var t=e.children,n=(0,r.useState)(!1),i=n[0],l=n[1];return(0,r.useEffect)((function(){l(!0)}),[]),(0,a.jsx)(o.Provider,{value:i,children:t})}},7221:(e,t,n)=>{"use strict";var r=n(7294),a=n(745),o=n(3727),i=n(405),l=n(412);const s=[n(2497),n(3310),n(8320),n(3665),n(6736),n(9555),n(8117),n(1672)];var u=n(723),c=n(6550),d=n(8790),f=n(5893);function p(e){var t=e.children;return(0,f.jsx)(f.Fragment,{children:t})}var m=n(5742),h=n(2263),g=n(4996),v=n(6668),y=n(833),b=n(4711),w=n(9727),k=n(3320),x=n(8780),S=n(197);function E(){var e=(0,h.Z)().i18n,t=e.currentLocale,n=e.defaultLocale,r=e.localeConfigs,a=(0,b.l)(),o=r[t].htmlLang,i=function(e){return e.replace("-","_")};return(0,f.jsxs)(m.Z,{children:[Object.entries(r).map((function(e){var t=e[0],n=e[1].htmlLang;return(0,f.jsx)("link",{rel:"alternate",href:a.createUrl({locale:t,fullyQualified:!0}),hrefLang:n},t)})),(0,f.jsx)("link",{rel:"alternate",href:a.createUrl({locale:n,fullyQualified:!0}),hrefLang:"x-default"}),(0,f.jsx)("meta",{property:"og:locale",content:i(o)}),Object.values(r).filter((function(e){return o!==e.htmlLang})).map((function(e){return(0,f.jsx)("meta",{property:"og:locale:alternate",content:i(e.htmlLang)},"meta-og-"+e.htmlLang)}))]})}function C(e){var t=e.permalink,n=(0,h.Z)().siteConfig.url,r=function(){var e=(0,h.Z)().siteConfig,t=e.url,n=e.baseUrl,r=e.trailingSlash,a=(0,c.TH)().pathname;return t+(0,x.applyTrailingSlash)((0,g.Z)(a),{trailingSlash:r,baseUrl:n})}(),a=t?""+n+t:r;return(0,f.jsxs)(m.Z,{children:[(0,f.jsx)("meta",{property:"og:url",content:a}),(0,f.jsx)("link",{rel:"canonical",href:a})]})}function T(){var e=(0,h.Z)().i18n.currentLocale,t=(0,v.L)(),n=t.metadata,r=t.image;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(m.Z,{children:[(0,f.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,f.jsx)("body",{className:w.h})]}),r&&(0,f.jsx)(y.d,{image:r}),(0,f.jsx)(C,{}),(0,f.jsx)(E,{}),(0,f.jsx)(S.Z,{tag:k.HX,locale:e}),(0,f.jsx)(m.Z,{children:n.map((function(e,t){return(0,f.jsx)("meta",Object.assign({},e),t)}))})]})}var _=new Map;function j(e){if(_.has(e.pathname))return Object.assign({},e,{pathname:_.get(e.pathname)});if((0,d.f)(u.Z,e.pathname).some((function(e){return!0===e.route.exact})))return _.set(e.pathname,e.pathname),e;var t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return _.set(e.pathname,t),Object.assign({},e,{pathname:t})}var A=n(8934),L=n(8940),R=n(4578),O=n(469);function N(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r\n

    Your Docusaurus site did not load properly.

    \n

    A very common reason is a wrong site baseUrl configuration.

    \n

    Current configured baseUrl = '+e+" "+("/"===e?" (default value)":"")+'

    \n

    We suggest trying baseUrl =

    \n
    \n'}(e)).replace(/{"use strict";n.d(t,{_:()=>d,M:()=>f});var r=n(7294),a=n(6809);const o=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs","mainDocId":"getting-started","docs":[{"id":"advanced-concepts","path":"/docs/advanced-concepts","sidebar":"docs"},{"id":"examples","path":"/docs/examples"},{"id":"framework-integrations/introduction","path":"/docs/framework-integrations/introduction","sidebar":"docs"},{"id":"framework-integrations/use-atom","path":"/docs/framework-integrations/use-atom","sidebar":"docs"},{"id":"framework-integrations/use-setup","path":"/docs/framework-integrations/use-setup","sidebar":"docs"},{"id":"getting-started","path":"/docs/getting-started","sidebar":"docs"},{"id":"performance-optimizations","path":"/docs/performance-optimizations","sidebar":"docs"},{"id":"quick-tutorial","path":"/docs/quick-tutorial","sidebar":"docs"},{"id":"recipes-react/creating-react-custom-hooks","path":"/docs/recipes-react/creating-react-custom-hooks","sidebar":"docs"},{"id":"recipes-react/dynamic-functions-with-fixed-references","path":"/docs/recipes-react/dynamic-functions-with-fixed-references","sidebar":"docs"},{"id":"recipes-react/grabbing-refs","path":"/docs/recipes-react/grabbing-refs","sidebar":"docs"},{"id":"recipes-react/refactoring-react-classes","path":"/docs/recipes-react/refactoring-react-classes","sidebar":"docs"},{"id":"recipes-react/using-context-correctly","path":"/docs/recipes-react/using-context-correctly","sidebar":"docs"},{"id":"recipes/finite-state-machines","path":"/docs/recipes/finite-state-machines","sidebar":"docs"},{"id":"recipes/nested-state","path":"/docs/recipes/nested-state","sidebar":"docs"},{"id":"recipes/persist-localstorage","path":"/docs/recipes/persist-localstorage","sidebar":"docs"},{"id":"recipes/redux-devtools-integration","path":"/docs/recipes/redux-devtools-integration","sidebar":"docs"},{"id":"recipes/redux-interop","path":"/docs/recipes/redux-interop","sidebar":"docs"},{"id":"recipes/using-immer","path":"/docs/recipes/using-immer","sidebar":"docs"},{"id":"recipes/using-reducers","path":"/docs/recipes/using-reducers","sidebar":"docs"},{"id":"streams","path":"/docs/streams","sidebar":"docs"}],"draftIds":[],"sidebars":{"docs":{"link":{"path":"/docs/getting-started","label":"getting-started"}}}}],"breadcrumbs":true}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var l=n(7529);const s=JSON.parse('{"docusaurusVersion":"3.1.0","siteVersion":"0.0.1","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"3.1.0"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"3.1.0"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"3.1.0"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"3.1.0"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"3.1.0"},"docusaurus-theme-search-algolia":{"type":"package","name":"@docusaurus/theme-search-algolia","version":"3.1.0"},"docusaurus-plugin-sass":{"type":"package","name":"docusaurus-plugin-sass","version":"0.2.5"},"undefined":{"type":"project"}}}');var u=n(5893),c={siteConfig:a.default,siteMetadata:s,globalData:o,i18n:i,codeTranslations:l},d=r.createContext(c);function f(e){var t=e.children;return(0,u.jsx)(d.Provider,{value:c,children:t})}},4763:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(4578),a=n(7294),o=n(412),i=n(5742),l=n(8780),s=n(5296),u=n(5893);function c(e){var t=e.error,n=e.tryAgain;return(0,u.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"},children:[(0,u.jsx)("h1",{style:{fontSize:"3rem"},children:"This page crashed"}),(0,u.jsx)("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"},children:"Try again"}),(0,u.jsx)(d,{error:t})]})}function d(e){var t=e.error,n=(0,l.getErrorCausalChain)(t).map((function(e){return e.message})).join("\n\nCause:\n");return(0,u.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:n})}function f(e){var t=e.error,n=e.tryAgain;return(0,u.jsxs)(m,{fallback:function(){return(0,u.jsx)(c,{error:t,tryAgain:n})},children:[(0,u.jsx)(i.Z,{children:(0,u.jsx)("title",{children:"Page Error"})}),(0,u.jsx)(s.Z,{children:(0,u.jsx)(c,{error:t,tryAgain:n})})]})}var p=function(e){return(0,u.jsx)(f,Object.assign({},e))},m=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={error:null},n}(0,r.Z)(t,e);var n=t.prototype;return n.componentDidCatch=function(e){o.Z.canUseDOM&&this.setState({error:e})},n.render=function(){var e=this,t=this.props.children,n=this.state.error;if(n){var r,a={error:n,tryAgain:function(){return e.setState({error:null})}};return(null!=(r=this.props.fallback)?r:p)(a)}return null!=t?t:null},t}(a.Component)},412:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document;const a={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},5742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});n(7294);var r=n(405),a=n(5893);function o(e){return(0,a.jsx)(r.ql,Object.assign({},e))}},3692:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(3366),a=n(7294),o=n(3727),i=n(8780),l=n(2263),s=n(3919),u=n(412),c=n(8138),d=n(4996),f=n(5893),p=["isNavLink","to","href","activeClassName","isActive","data-noBrokenLinkCheck","autoAddBaseUrl"];function m(e,t){var n,m,h=e.isNavLink,g=e.to,v=e.href,y=e.activeClassName,b=e.isActive,w=e["data-noBrokenLinkCheck"],k=e.autoAddBaseUrl,x=void 0===k||k,S=(0,r.Z)(e,p),E=(0,l.Z)().siteConfig,C=E.trailingSlash,T=E.baseUrl,_=(0,d.C)().withBaseUrl,j=(0,c.Z)(),A=(0,a.useRef)(null);(0,a.useImperativeHandle)(t,(function(){return A.current}));var L=g||v;var R,O=(0,s.Z)(L),N=null==L?void 0:L.replace("pathname://",""),P=void 0!==N?(R=N,x&&function(e){return e.startsWith("/")}(R)?_(R):R):void 0;P&&O&&(P=(0,i.applyTrailingSlash)(P,{trailingSlash:C,baseUrl:T}));var I=(0,a.useRef)(!1),D=h?o.OL:o.rU,M=u.Z.canUseIntersectionObserver,F=(0,a.useRef)(),B=function(){I.current||null==P||(window.docusaurus.preload(P),I.current=!0)};(0,a.useEffect)((function(){return!M&&O&&null!=P&&window.docusaurus.prefetch(P),function(){M&&F.current&&F.current.disconnect()}}),[F,P,M,O]);var z=null!=(n=null==(m=P)?void 0:m.startsWith("#"))&&n,U=!P||!O||z;return U||w||j.collectLink(P),U?(0,f.jsx)("a",Object.assign({ref:A,href:P},L&&!O&&{target:"_blank",rel:"noopener noreferrer"},S)):(0,f.jsx)(D,Object.assign({},S,{onMouseEnter:B,onTouchStart:B,innerRef:function(e){A.current=e,M&&e&&O&&(F.current=new window.IntersectionObserver((function(t){t.forEach((function(t){e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(F.current.unobserve(e),F.current.disconnect(),null!=P&&window.docusaurus.prefetch(P))}))})),F.current.observe(e))},to:P},h&&{isActive:b,activeClassName:y}))}const h=a.forwardRef(m)},5999:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u,I:()=>s});var r=n(7294),a=n(5893);function o(e,t){var n=e.split(/(\{\w+\})/).map((function(e,n){if(n%2==1){var r=null==t?void 0:t[e.slice(1,-1)];if(void 0!==r)return r}return e}));return n.some((function(e){return(0,r.isValidElement)(e)}))?n.map((function(e,t){return(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e})).filter((function(e){return""!==e})):n.join("")}var i=n(7529);function l(e){var t,n,r=e.id,a=e.message;if(void 0===r&&void 0===a)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return null!=(t=null!=(n=i[null!=r?r:a])?n:a)?t:r}function s(e,t){return o(l({message:e.message,id:e.id}),t)}function u(e){var t=e.children,n=e.id,r=e.values;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");var i=l({message:t,id:n});return(0,a.jsx)(a.Fragment,{children:o(i,r)})}},9935:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});var r="default"},3919:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,{Z:()=>a,b:()=>r})},4996:(e,t,n)=>{"use strict";n.d(t,{C:()=>i,Z:()=>l});var r=n(7294),a=n(2263),o=n(3919);function i(){var e=(0,a.Z)().siteConfig,t=e.baseUrl,n=e.url,i=(0,r.useCallback)((function(e,r){return function(e,t,n,r){var a=void 0===r?{}:r,i=a.forcePrependBaseUrl,l=void 0!==i&&i,s=a.absolute,u=void 0!==s&&s;if(!n||n.startsWith("#")||(0,o.b)(n))return n;if(l)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;var c=n.startsWith(t)?n:t+n.replace(/^\//,"");return u?e+c:c}(n,t,e,r)}),[n,t]);return{withBaseUrl:i}}function l(e,t){return void 0===t&&(t={}),(0,i().withBaseUrl)(e,t)}},8138:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(7294),a=(n(5893),r.createContext({collectAnchor:function(){},collectLink:function(){}})),o=function(){return(0,r.useContext)(a)};function i(){return o()}},2263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(8940);function o(){return(0,r.useContext)(a._)}},2389:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(8934);function o(){return(0,r.useContext)(a._)}},469:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(7294);const a=n(412).Z.canUseDOM?r.useLayoutEffect:r.useEffect},9670:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=function(e){return"object"==typeof e&&!!e&&Object.keys(e).length>0};function a(e){var t={};return function e(n,a){Object.entries(n).forEach((function(n){var o=n[0],i=n[1],l=a?a+"."+o:o;r(i)?e(i,l):t[l]=i}))}(e),t}},226:(e,t,n)=>{"use strict";n.d(t,{_:()=>o,z:()=>i});var r=n(7294),a=n(5893),o=r.createContext(null);function i(e){var t=e.children,n=e.value,i=r.useContext(o),l=(0,r.useMemo)((function(){return function(e){var t=e.parent,n=e.value;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}var r=Object.assign({},t.data,null==n?void 0:n.data);return{plugin:t.plugin,data:r}}({parent:i,value:n})}),[i,n]);return(0,a.jsx)(o.Provider,{value:l,children:t})}},143:(e,t,n)=>{"use strict";n.d(t,{Iw:()=>v,gA:()=>p,WS:()=>m,_r:()=>d,Jo:()=>y,zh:()=>f,yW:()=>g,gB:()=>h});var r=n(6550),a=n(2263),o=n(9935);function i(e,t){void 0===t&&(t={});var n=(0,a.Z)().globalData[e];if(!n&&t.failfast)throw new Error('Docusaurus plugin global data not found for "'+e+'" plugin.');return n}var l=function(e){return e.versions.find((function(e){return e.isLast}))};function s(e,t){var n=l(e);return[].concat(e.versions.filter((function(e){return e!==n})),[n]).find((function(e){return!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})}))}function u(e,t){var n,a,o=s(e,t),i=null==o?void 0:o.docs.find((function(e){return!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})}));return{activeVersion:o,activeDoc:i,alternateDocVersions:i?(n=i.id,a={},e.versions.forEach((function(e){e.docs.forEach((function(t){t.id===n&&(a[e.name]=t)}))})),a):{}}}var c={},d=function(){var e;return null!=(e=i("docusaurus-plugin-content-docs"))?e:c},f=function(e){return function(e,t,n){void 0===t&&(t=o.m),void 0===n&&(n={});var r=i(e),a=null==r?void 0:r[t];if(!a&&n.failfast)throw new Error('Docusaurus plugin global data not found for "'+e+'" plugin with id "'+t+'".');return a}("docusaurus-plugin-content-docs",e,{failfast:!0})};function p(e){return void 0===e&&(e={}),function(e,t,n){void 0===n&&(n={});var a=Object.entries(e).sort((function(e,t){return t[1].path.localeCompare(e[1].path)})).find((function(e){var n=e[1];return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),o=a?{pluginId:a[0],pluginData:a[1]}:void 0;if(!o&&n.failfast)throw new Error("Can't find active docs plugin for \""+t+'" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: '+Object.values(e).map((function(e){return e.path})).join(", "));return o}(d(),(0,r.TH)().pathname,e)}function m(e){void 0===e&&(e={});var t=p(e),n=(0,r.TH)().pathname;if(t)return{activePlugin:t,activeVersion:s(t.pluginData,n)}}function h(e){return f(e).versions}function g(e){var t=f(e);return l(t)}function v(e){return u(f(e),(0,r.TH)().pathname)}function y(e){return function(e,t){var n=l(e);return{latestDocSuggestion:u(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(f(e),(0,r.TH)().pathname)}},8320:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(4865),a=n.n(r);a().configure({showSpinner:!1});const o={onRouteUpdate:function(e){var t=e.location,n=e.previousLocation;if(n&&t.pathname!==n.pathname){var r=window.setTimeout((function(){a().start()}),200);return function(){return window.clearTimeout(r)}}},onRouteDidUpdate:function(){a().done()}}},3310:(e,t,n)=>{"use strict";n.r(t);var r,a,o=n(2573),i=n(6809);r=o.p1,a=i.default.themeConfig.prism.additionalLanguages,globalThis.Prism=r,a.forEach((function(e){"php"===e&&n(6854),n(6726)("./prism-"+e)})),delete globalThis.Prism},2503:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(3366),a=(n(7294),n(512)),o=n(5999),i=n(6668),l=n(3692),s=n(8138);const u={anchorWithStickyNavbar:"anchorWithStickyNavbar_LWe7",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_WYt5"};var c=n(5893),d=["as","id"];function f(e){var t=e.as,n=e.id,f=(0,r.Z)(e,d),p=(0,s.Z)(),m=(0,i.L)().navbar.hideOnScroll;if("h1"===t||!n)return(0,c.jsx)(t,Object.assign({},f,{id:void 0}));p.collectAnchor(n);var h=(0,o.I)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof f.children?f.children:n});return(0,c.jsxs)(t,Object.assign({},f,{className:(0,a.Z)("anchor",m?u.anchorWithHideOnScrollNavbar:u.anchorWithStickyNavbar,f.className),id:n,children:[f.children,(0,c.jsx)(l.Z,{className:"hash-link",to:"#"+n,"aria-label":h,title:h,children:"\u200b"})]}))}},9471:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});n(7294);const r={iconExternalLink:"iconExternalLink_nPIU"};var a=n(5893);function o(e){var t=e.width,n=void 0===t?13.5:t,o=e.height,i=void 0===o?13.5:o;return(0,a.jsx)("svg",{width:n,height:i,"aria-hidden":"true",viewBox:"0 0 24 24",className:r.iconExternalLink,children:(0,a.jsx)("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"})})}},1327:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(3366),a=(n(7294),n(3692)),o=n(4996),i=n(2263),l=n(6668),s=n(9965),u=n(5893),c=["imageClassName","titleClassName"];function d(e){var t=e.logo,n=e.alt,r=e.imageClassName,a={light:(0,o.Z)(t.src),dark:(0,o.Z)(t.srcDark||t.src)},i=(0,u.jsx)(s.Z,{className:t.className,sources:a,height:t.height,width:t.width,alt:n,style:t.style});return r?(0,u.jsx)("div",{className:r,children:i}):i}function f(e){var t,n=(0,i.Z)().siteConfig.title,s=(0,l.L)().navbar,f=s.title,p=s.logo,m=e.imageClassName,h=e.titleClassName,g=(0,r.Z)(e,c),v=(0,o.Z)((null==p?void 0:p.href)||"/"),y=f?"":n,b=null!=(t=null==p?void 0:p.alt)?t:y;return(0,u.jsxs)(a.Z,Object.assign({to:v},g,(null==p?void 0:p.target)&&{target:p.target},{children:[p&&(0,u.jsx)(d,{logo:p,alt:b,imageClassName:m}),null!=f&&(0,u.jsx)("b",{className:h,children:f})]}))}},197:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});n(7294);var r=n(5742),a=n(5893);function o(e){var t=e.locale,n=e.version,o=e.tag,i=t;return(0,a.jsxs)(r.Z,{children:[t&&(0,a.jsx)("meta",{name:"docusaurus_locale",content:t}),n&&(0,a.jsx)("meta",{name:"docusaurus_version",content:n}),o&&(0,a.jsx)("meta",{name:"docusaurus_tag",content:o}),i&&(0,a.jsx)("meta",{name:"docsearch:language",content:i}),n&&(0,a.jsx)("meta",{name:"docsearch:version",content:n}),o&&(0,a.jsx)("meta",{name:"docsearch:docusaurus_tag",content:o})]})}},9965:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(3366),a=n(7294),o=n(512),i=n(2389),l=n(2949);const s={themedComponent:"themedComponent_mlkZ","themedComponent--light":"themedComponent--light_NVdE","themedComponent--dark":"themedComponent--dark_xIcU"};var u=n(5893);function c(e){var t=e.className,n=e.children,r=(0,i.Z)(),c=(0,l.I)().colorMode;return(0,u.jsx)(u.Fragment,{children:(r?"dark"===c?["dark"]:["light"]:["light","dark"]).map((function(e){var r=n({theme:e,className:(0,o.Z)(t,s.themedComponent,s["themedComponent--"+e])});return(0,u.jsx)(a.Fragment,{children:r},e)}))})}var d=["sources","className","alt"];function f(e){var t=e.sources,n=e.className,a=e.alt,o=(0,r.Z)(e,d);return(0,u.jsx)(c,{className:n,children:function(e){var n=e.theme,r=e.className;return(0,u.jsx)("img",Object.assign({src:t[n],alt:a,className:r},o))}})}},6043:(e,t,n)=>{"use strict";n.d(t,{u:()=>f,z:()=>w});var r=n(3366),a=n(7294),o=n(412),i=n(469),l=n(1442),s=n(5893),u=["collapsed"],c=["lazy"],d="ease-in-out";function f(e){var t=e.initialState,n=(0,a.useState)(null!=t&&t),r=n[0],o=n[1],i=(0,a.useCallback)((function(){o((function(e){return!e}))}),[]);return{collapsed:r,setCollapsed:o,toggleCollapsed:i}}var p={display:"none",overflow:"hidden",height:"0px"},m={display:"block",overflow:"visible",height:"auto"};function h(e,t){var n=t?p:m;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function g(e){var t=e.collapsibleRef,n=e.collapsed,r=e.animation,o=(0,a.useRef)(!1);(0,a.useEffect)((function(){var e,a=t.current;function i(){var e,t,n=a.scrollHeight,o=null!=(e=null==r?void 0:r.duration)?e:function(e){if((0,l.n)())return 1;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}(n);return{transition:"height "+o+"ms "+(null!=(t=null==r?void 0:r.easing)?t:d),height:n+"px"}}function s(){var e=i();a.style.transition=e.transition,a.style.height=e.height}if(!o.current)return h(a,n),void(o.current=!0);return a.style.willChange="height",e=requestAnimationFrame((function(){n?(s(),requestAnimationFrame((function(){a.style.height=p.height,a.style.overflow=p.overflow}))):(a.style.display="block",requestAnimationFrame((function(){s()})))})),function(){return cancelAnimationFrame(e)}}),[t,n,r])}function v(e){if(!o.Z.canUseDOM)return e?p:m}function y(e){var t=e.as,n=void 0===t?"div":t,r=e.collapsed,o=e.children,i=e.animation,l=e.onCollapseTransitionEnd,u=e.className,c=e.disableSSRStyle,d=(0,a.useRef)(null);return g({collapsibleRef:d,collapsed:r,animation:i}),(0,s.jsx)(n,{ref:d,style:c?void 0:v(r),onTransitionEnd:function(e){"height"===e.propertyName&&(h(d.current,r),null==l||l(r))},className:u,children:o})}function b(e){var t=e.collapsed,n=(0,r.Z)(e,u),o=(0,a.useState)(!t),l=o[0],c=o[1],d=(0,a.useState)(t),f=d[0],p=d[1];return(0,i.Z)((function(){t||c(!0)}),[t]),(0,i.Z)((function(){l&&p(t)}),[l,t]),l?(0,s.jsx)(y,Object.assign({},n,{collapsed:f})):null}function w(e){var t=e.lazy,n=(0,r.Z)(e,c),a=t?b:y;return(0,s.jsx)(a,Object.assign({},n))}},9689:(e,t,n)=>{"use strict";n.d(t,{nT:()=>h,pl:()=>m});var r=n(7294),a=n(2389),o=n(12),i=n(9688),l=n(6668),s=n(5893),u=(0,o.WA)("docusaurus.announcement.dismiss"),c=(0,o.WA)("docusaurus.announcement.id"),d=function(){return"true"===u.get()},f=function(e){return u.set(String(e))},p=r.createContext(null);function m(e){var t=e.children,n=function(){var e=(0,l.L)().announcementBar,t=(0,a.Z)(),n=(0,r.useState)((function(){return!!t&&d()})),o=n[0],i=n[1];(0,r.useEffect)((function(){i(d())}),[]);var s=(0,r.useCallback)((function(){f(!0),i(!0)}),[]);return(0,r.useEffect)((function(){if(e){var t=e.id,n=c.get();"annoucement-bar"===n&&(n="announcement-bar");var r=t!==n;c.set(t),r&&f(!1),!r&&d()||i(!1)}}),[e]),(0,r.useMemo)((function(){return{isActive:!!e&&!o,close:s}}),[e,o,s])}();return(0,s.jsx)(p.Provider,{value:n,children:t})}function h(){var e=(0,r.useContext)(p);if(!e)throw new i.i6("AnnouncementBarProvider");return e}},2949:(e,t,n)=>{"use strict";n.d(t,{I:()=>v,S:()=>g});var r=n(7294),a=n(412),o=n(9688),i=n(12),l=n(6668),s=n(5893),u=r.createContext(void 0),c="theme",d=(0,i.WA)(c),f={light:"light",dark:"dark"},p=function(e){return e===f.dark?f.dark:f.light},m=function(e){return a.Z.canUseDOM?p(document.documentElement.getAttribute("data-theme")):p(e)},h=function(e){d.set(p(e))};function g(e){var t=e.children,n=function(){var e=(0,l.L)().colorMode,t=e.defaultMode,n=e.disableSwitch,a=e.respectPrefersColorScheme,o=(0,r.useState)(m(t)),i=o[0],s=o[1];(0,r.useEffect)((function(){n&&d.del()}),[n]);var u=(0,r.useCallback)((function(e,n){void 0===n&&(n={});var r=n.persist,o=void 0===r||r;e?(s(e),o&&h(e)):(s(a?window.matchMedia("(prefers-color-scheme: dark)").matches?f.dark:f.light:t),d.del())}),[a,t]);(0,r.useEffect)((function(){document.documentElement.setAttribute("data-theme",p(i))}),[i]),(0,r.useEffect)((function(){if(!n){var e=function(e){if(e.key===c){var t=d.get();null!==t&&u(p(t))}};return window.addEventListener("storage",e),function(){return window.removeEventListener("storage",e)}}}),[n,u]);var g=(0,r.useRef)(!1);return(0,r.useEffect)((function(){if(!n||a){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=function(){window.matchMedia("print").matches||g.current?g.current=window.matchMedia("print").matches:u(null)};return e.addListener(t),function(){return e.removeListener(t)}}}),[u,n,a]),(0,r.useMemo)((function(){return{colorMode:i,setColorMode:u,get isDarkTheme(){return i===f.dark},setLightTheme:function(){u(f.light)},setDarkTheme:function(){u(f.dark)}}}),[i,u])}();return(0,s.jsx)(u.Provider,{value:n,children:t})}function v(){var e=(0,r.useContext)(u);if(null==e)throw new o.i6("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},373:(e,t,n)=>{"use strict";n.d(t,{J:()=>b,L5:()=>v,Oh:()=>w});var r=n(7294),a=n(143),o=n(9935),i=n(6668),l=n(3791),s=n(9688),u=n(12),c=n(5893),d=function(e){return"docs-preferred-version-"+e},f={save:function(e,t,n){(0,u.WA)(d(e),{persistence:t}).set(n)},read:function(e,t){return(0,u.WA)(d(e),{persistence:t}).get()},clear:function(e,t){(0,u.WA)(d(e),{persistence:t}).del()}},p=function(e){return Object.fromEntries(e.map((function(e){return[e,{preferredVersionName:null}]})))};var m=r.createContext(null);function h(){var e=(0,a._r)(),t=(0,i.L)().docs.versionPersistence,n=(0,r.useMemo)((function(){return Object.keys(e)}),[e]),o=(0,r.useState)((function(){return p(n)})),l=o[0],s=o[1];return(0,r.useEffect)((function(){s(function(e){var t=e.pluginIds,n=e.versionPersistence,r=e.allDocsData;return Object.fromEntries(t.map((function(e){return[e,(t=e,a=f.read(t,n),r[t].versions.some((function(e){return e.name===a}))?{preferredVersionName:a}:(f.clear(t,n),{preferredVersionName:null}))];var t,a})))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]),[l,(0,r.useMemo)((function(){return{savePreferredVersion:function(e,n){f.save(e,t,n),s((function(t){var r;return Object.assign({},t,((r={})[e]={preferredVersionName:n},r))}))}}}),[t])]}function g(e){var t=e.children,n=h();return(0,c.jsx)(m.Provider,{value:n,children:t})}function v(e){var t=e.children;return l.cE?(0,c.jsx)(g,{children:t}):(0,c.jsx)(c.Fragment,{children:t})}function y(){var e=(0,r.useContext)(m);if(!e)throw new s.i6("DocsPreferredVersionContextProvider");return e}function b(e){var t;void 0===e&&(e=o.m);var n=(0,a.zh)(e),i=y(),l=i[0],s=i[1],u=l[e].preferredVersionName;return{preferredVersion:null!=(t=n.versions.find((function(e){return e.name===u})))?t:null,savePreferredVersionName:(0,r.useCallback)((function(t){s.savePreferredVersion(e,t)}),[s,e])}}function w(){var e=(0,a._r)(),t=y()[0];var n=Object.keys(e);return Object.fromEntries(n.map((function(n){return[n,(r=n,o=e[r],i=t[r].preferredVersionName,null!=(a=o.versions.find((function(e){return e.name===i})))?a:null)];var r,a,o,i})))}},1116:(e,t,n)=>{"use strict";n.d(t,{V:()=>u,b:()=>s});var r=n(7294),a=n(9688),o=n(5893),i=Symbol("EmptyContext"),l=r.createContext(i);function s(e){var t=e.children,n=e.name,a=e.items,i=(0,r.useMemo)((function(){return n&&a?{name:n,items:a}:null}),[n,a]);return(0,o.jsx)(l.Provider,{value:i,children:t})}function u(){var e=(0,r.useContext)(l);if(e===i)throw new a.i6("DocsSidebarProvider");return e}},4477:(e,t,n)=>{"use strict";n.d(t,{E:()=>s,q:()=>l});var r=n(7294),a=n(9688),o=n(5893),i=r.createContext(null);function l(e){var t=e.children,n=e.version;return(0,o.jsx)(i.Provider,{value:n,children:t})}function s(){var e=(0,r.useContext)(i);if(null===e)throw new a.i6("DocsVersionProvider");return e}},3163:(e,t,n)=>{"use strict";n.d(t,{M:()=>f,e:()=>p});var r=n(7294),a=n(3102),o=n(7524),i=n(1980),l=n(6668),s=n(9688),u=n(5893),c=r.createContext(void 0);function d(){var e,t=(e=(0,a.HY)(),0===(0,l.L)().navbar.items.length&&!e.component),n=(0,o.i)(),s=!t&&"mobile"===n,u=(0,r.useState)(!1),c=u[0],d=u[1];(0,i.Rb)((function(){if(c)return d(!1),!1}));var f=(0,r.useCallback)((function(){d((function(e){return!e}))}),[]);return(0,r.useEffect)((function(){"desktop"===n&&d(!1)}),[n]),(0,r.useMemo)((function(){return{disabled:t,shouldRender:s,toggle:f,shown:c}}),[t,s,f,c])}function f(e){var t=e.children,n=d();return(0,u.jsx)(c.Provider,{value:n,children:t})}function p(){var e=r.useContext(c);if(void 0===e)throw new s.i6("NavbarMobileSidebarProvider");return e}},3102:(e,t,n)=>{"use strict";n.d(t,{HY:()=>s,Zo:()=>u,n2:()=>l});var r=n(7294),a=n(9688),o=n(5893),i=r.createContext(null);function l(e){var t=e.children,n=(0,r.useState)({component:null,props:null});return(0,o.jsx)(i.Provider,{value:n,children:t})}function s(){var e=(0,r.useContext)(i);if(!e)throw new a.i6("NavbarSecondaryMenuContentProvider");return e[0]}function u(e){var t=e.component,n=e.props,o=(0,r.useContext)(i);if(!o)throw new a.i6("NavbarSecondaryMenuContentProvider");var l=o[1],s=(0,a.Ql)(n);return(0,r.useEffect)((function(){l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((function(){return function(){return l({component:null,props:null})}}),[l]),null}},9727:(e,t,n)=>{"use strict";n.d(t,{h:()=>a,t:()=>o});var r=n(7294),a="navigation-with-keyboard";function o(){(0,r.useEffect)((function(){function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(a),"mousedown"===e.type&&document.body.classList.remove(a)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),function(){document.body.classList.remove(a),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},6177:(e,t,n)=>{"use strict";n.d(t,{K:()=>l,M:()=>s});var r=n(7294),a=n(2263),o=n(1980),i="q";function l(){return(0,o.Nc)(i)}function s(){var e=(0,a.Z)().siteConfig,t=e.baseUrl,n=e.themeConfig.algolia.searchPagePath;return(0,r.useCallback)((function(e){return""+t+n+"?"+i+"="+encodeURIComponent(e)}),[t,n])}},7524:(e,t,n)=>{"use strict";n.d(t,{i:()=>l});var r=n(7294),a=n(412),o={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function l(e){var t=(void 0===e?{}:e).desktopBreakpoint,n=void 0===t?i:t,l=(0,r.useState)((function(){return"ssr"})),s=l[0],u=l[1];return(0,r.useEffect)((function(){function e(){u(function(e){if(!a.Z.canUseDOM)throw new Error("getWindowSize() should only be called after React hydration");return window.innerWidth>e?o.desktop:o.mobile}(n))}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[n]),s}},5281:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});var r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",unlistedBanner:"theme-unlisted-banner",admonitionType:function(e){return"theme-admonition-"+e}},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:function(e){return"theme-doc-sidebar-item-category-level-"+e},docSidebarItemLinkLevel:function(e){return"theme-doc-sidebar-item-link-level-"+e}},blog:{}}},1442:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{n:()=>r})},3791:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,{LM:()=>h,_F:()=>y,cE:()=>m,SN:()=>T,lO:()=>S,vY:()=>C,oz:()=>E,s1:()=>x,f:()=>w});var o=n(7294),i=n(6550),l=n(8790),s=n(143),u=n(373),c=n(4477),d=n(1116),f=n(7392),p=n(8596),m=!!s._r;function h(e){return"link"!==e.type||e.unlisted?"category"===e.type?function(e){if(e.href&&!e.linkUnlisted)return e.href;for(var t,n=a(e.items);!(t=n()).done;){var r=h(t.value);if(r)return r}}(e):void 0:e.href}var g=function(e,t){return void 0!==e&&(0,p.Mg)(e,t)},v=function(e,t){return e.some((function(e){return y(e,t)}))};function y(e,t){return"link"===e.type?g(e.href,t):"category"===e.type&&(g(e.href,t)||v(e.items,t))}function b(e,t){switch(e.type){case"category":return y(e,t)||e.items.some((function(e){return b(e,t)}));case"link":return!e.unlisted||y(e,t);default:return!0}}function w(e,t){return(0,o.useMemo)((function(){return e.filter((function(e){return b(e,t)}))}),[e,t])}function k(e){var t=e.sidebarItems,n=e.pathname,r=e.onlyCategories,o=void 0!==r&&r,i=[];return function e(t){for(var r,l=a(t);!(r=l()).done;){var s=r.value;if("category"===s.type&&((0,p.Mg)(s.href,n)||e(s.items))||"link"===s.type&&(0,p.Mg)(s.href,n))return o&&"category"!==s.type||i.unshift(s),!0}return!1}(t),i}function x(){var e,t=(0,d.V)(),n=(0,i.TH)().pathname;return!1!==(null==(e=(0,s.gA)())?void 0:e.pluginData.breadcrumbs)&&t?k({sidebarItems:t.items,pathname:n}):null}function S(e){var t=(0,s.Iw)(e).activeVersion,n=(0,u.J)(e).preferredVersion,r=(0,s.yW)(e);return(0,o.useMemo)((function(){return(0,f.j)([t,n,r].filter(Boolean))}),[t,n,r])}function E(e,t){var n=S(t);return(0,o.useMemo)((function(){var t=n.flatMap((function(e){return e.sidebars?Object.entries(e.sidebars):[]})),r=t.find((function(t){return t[0]===e}));if(!r)throw new Error("Can't find any sidebar with id \""+e+'" in version'+(n.length>1?"s":"")+" "+n.map((function(e){return e.name})).join(", ")+'".\nAvailable sidebar ids are:\n- '+t.map((function(e){return e[0]})).join("\n- "));return r[1]}),[e,n])}function C(e,t){var n=S(t);return(0,o.useMemo)((function(){var t=n.flatMap((function(e){return e.docs})),r=t.find((function(t){return t.id===e}));if(!r){if(n.flatMap((function(e){return e.draftIds})).includes(e))return null;throw new Error("Couldn't find any doc with id \""+e+'" in version'+(n.length>1?"s":"")+' "'+n.map((function(e){return e.name})).join(", ")+'".\nAvailable doc ids are:\n- '+(0,f.j)(t.map((function(e){return e.id}))).join("\n- "))}return r}),[e,n])}function T(e){var t=e.route,n=(0,i.TH)(),r=(0,c.E)(),a=t.routes,o=a.find((function(e){return(0,i.LX)(n.pathname,e)}));if(!o)return null;var s=o.sidebar,u=s?r.docsSidebars[s]:void 0;return{docElement:(0,l.H)(a),sidebarName:s,sidebarItems:u}}},2128:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(2263);function a(e){var t=(0,r.Z)().siteConfig,n=t.title,a=t.titleDelimiter;return null!=e&&e.trim().length?e.trim()+" "+a+" "+n:n}},1980:(e,t,n)=>{"use strict";n.d(t,{Nc:()=>s,Rb:()=>i,_X:()=>l});var r=n(7294),a=n(6550),o=n(9688);function i(e){!function(e){var t=(0,a.k6)(),n=(0,o.zX)(e);(0,r.useEffect)((function(){return t.block((function(e,t){return n(e,t)}))}),[t,n])}((function(t,n){if("POP"===n)return e(t,n)}))}function l(e){return t=function(t){return null===e?null:new URLSearchParams(t.location.search).get(e)},n=(0,a.k6)(),(0,r.useSyncExternalStore)(n.listen,(function(){return t(n)}),(function(){return t(n)}));var t,n}function s(e){var t,n,o=null!=(t=l(e))?t:"",i=(n=(0,a.k6)(),(0,r.useCallback)((function(e,t,r){var a=new URLSearchParams(n.location.search);t?a.set(e,t):a.delete(e),(null!=r&&r.push?n.push:n.replace)({search:a.toString()})}),[n]));return[o,(0,r.useCallback)((function(t,n){i(e,t,n)}),[i,e])]}},7392:(e,t,n)=>{"use strict";function r(e,t){return void 0===t&&(t=function(e,t){return e===t}),e.filter((function(n,r){return e.findIndex((function(e){return t(e,n)}))!==r}))}function a(e){return Array.from(new Set(e))}n.d(t,{j:()=>a,l:()=>r})},833:(e,t,n)=>{"use strict";n.d(t,{FG:()=>p,d:()=>d,VC:()=>m});var r=n(7294),a=n(512),o=n(5742),i=n(226);function l(){var e=r.useContext(i._);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var s=n(4996),u=n(2128),c=n(5893);function d(e){var t=e.title,n=e.description,r=e.keywords,a=e.image,i=e.children,l=(0,u.p)(t),d=(0,s.C)().withBaseUrl,f=a?d(a,{absolute:!0}):void 0;return(0,c.jsxs)(o.Z,{children:[t&&(0,c.jsx)("title",{children:l}),t&&(0,c.jsx)("meta",{property:"og:title",content:l}),n&&(0,c.jsx)("meta",{name:"description",content:n}),n&&(0,c.jsx)("meta",{property:"og:description",content:n}),r&&(0,c.jsx)("meta",{name:"keywords",content:Array.isArray(r)?r.join(","):r}),f&&(0,c.jsx)("meta",{property:"og:image",content:f}),f&&(0,c.jsx)("meta",{name:"twitter:image",content:f}),i]})}var f=r.createContext(void 0);function p(e){var t=e.className,n=e.children,i=r.useContext(f),l=(0,a.Z)(i,t);return(0,c.jsxs)(f.Provider,{value:l,children:[(0,c.jsx)(o.Z,{children:(0,c.jsx)("html",{className:l})}),n]})}function m(e){var t=e.children,n=l(),r="plugin-"+n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,""),o="plugin-id-"+n.plugin.id;return(0,c.jsx)(p,{className:(0,a.Z)(r,o),children:t})}},9688:(e,t,n)=>{"use strict";n.d(t,{i6:()=>m,Qc:()=>g,zX:()=>f,D9:()=>p,Ql:()=>h});var r=n(6528),a=n(4578);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var i=n(9611);function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(l())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&(0,i.Z)(a,n.prototype),a}(e,arguments,o(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(n,e)},s(e)}var u=n(7294),c=n(469),d=n(5893);function f(e){var t=(0,u.useRef)(e);return(0,c.Z)((function(){t.current=e}),[e]),(0,u.useCallback)((function(){return t.current.apply(t,arguments)}),[])}function p(e){var t=(0,u.useRef)();return(0,c.Z)((function(){t.current=e})),t.current}var m=function(e){function t(t,n){var a,o,i;return(i=e.call(this)||this).name="ReactContextError",i.message="Hook "+(null!=(a=null==(o=i.stack)||null==(o=o.split("\n")[1])||null==(o=o.match((0,r.Z)(/at (?:\w+\.)?(\w+)/,{name:1})))?void 0:o.groups.name)?a:"")+" is called outside the <"+t+">. "+(null!=n?n:""),i}return(0,a.Z)(t,e),t}(s(Error));function h(e){var t=Object.entries(e);return t.sort((function(e,t){return e[0].localeCompare(t[0])})),(0,u.useMemo)((function(){return e}),t.flat())}function g(e){return function(t){var n=t.children;return(0,d.jsx)(d.Fragment,{children:e.reduceRight((function(e,t){return(0,d.jsx)(t,{children:e})}),n)})}}},8022:(e,t,n)=>{"use strict";function r(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}n.d(t,{F:()=>r})},8596:(e,t,n)=>{"use strict";n.d(t,{Mg:()=>i,Ns:()=>l});var r=n(7294),a=n(723),o=n(2263);function i(e,t){var n=function(e){var t;return null==(t=!e||e.endsWith("/")?e:e+"/")?void 0:t.toLowerCase()};return n(e)===n(t)}function l(){var e=(0,o.Z)().siteConfig.baseUrl;return(0,r.useMemo)((function(){return function(e){var t=e.baseUrl;function n(e){return e.path===t&&!0===e.exact}function r(e){return e.path===t&&!e.exact}return function e(t){if(0!==t.length)return t.find(n)||e(t.filter(r).flatMap((function(e){var t;return null!=(t=e.routes)?t:[]})))}(e.routes)}({routes:a.Z,baseUrl:e})}),[e])}},2466:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>h,OC:()=>c,RF:()=>p,o5:()=>m});var r=n(7294),a=n(412),o=n(2389),i=n(469),l=n(9688),s=n(5893);var u=r.createContext(void 0);function c(e){var t,n=e.children,a=(t=(0,r.useRef)(!0),(0,r.useMemo)((function(){return{scrollEventsEnabledRef:t,enableScrollEvents:function(){t.current=!0},disableScrollEvents:function(){t.current=!1}}}),[]));return(0,s.jsx)(u.Provider,{value:a,children:n})}function d(){var e=(0,r.useContext)(u);if(null==e)throw new l.i6("ScrollControllerProvider");return e}var f=function(){return a.Z.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null};function p(e,t){void 0===t&&(t=[]);var n=d().scrollEventsEnabledRef,a=(0,r.useRef)(f()),o=(0,l.zX)(e);(0,r.useEffect)((function(){var e=function(){if(n.current){var e=f();o(e,a.current),a.current=e}},t={passive:!0};return e(),window.addEventListener("scroll",e,t),function(){return window.removeEventListener("scroll",e,t)}}),[o,n].concat(t))}function m(){var e,t,n,a=d(),o=(e=(0,r.useRef)({elem:null,top:0}),t=(0,r.useCallback)((function(t){e.current={elem:t,top:t.getBoundingClientRect().top}}),[]),n=(0,r.useCallback)((function(){var t=e.current,n=t.elem,r=t.top;if(!n)return{restored:!1};var a=n.getBoundingClientRect().top-r;return a&&window.scrollBy({left:0,top:a}),e.current={elem:null,top:0},{restored:0!==a}}),[]),(0,r.useMemo)((function(){return{save:t,restore:n}}),[n,t])),l=(0,r.useRef)(void 0),s=(0,r.useCallback)((function(e){o.save(e),a.disableScrollEvents(),l.current=function(){var e=o.restore().restored;if(l.current=void 0,e){window.addEventListener("scroll",(function e(){a.enableScrollEvents(),window.removeEventListener("scroll",e)}))}else a.enableScrollEvents()}}),[a,o]);return(0,i.Z)((function(){queueMicrotask((function(){return null==l.current?void 0:l.current()}))})),{blockElementScrollPositionUntilNextRender:s}}function h(){var e=(0,r.useRef)(null),t=(0,o.Z)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:function(n){e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),function(){}}(n):function(e){var t=null,n=document.documentElement.scrollTop>e;return function r(){var a=document.documentElement.scrollTop;(n&&a>e||!n&&a{"use strict";n.d(t,{HX:()=>i,_q:()=>s,os:()=>l});var r=n(143),a=n(2263),o=n(373),i="default";function l(e,t){return"docs-"+e+"-"+t}function s(){var e=(0,a.Z)().i18n,t=(0,r._r)(),n=(0,r.WS)(),s=(0,o.Oh)();var u=[i].concat(Object.keys(t).map((function(e){var r,a=(null==n?void 0:n.activePlugin.pluginId)===e?n.activeVersion:void 0,o=s[e],i=t[e].versions.find((function(e){return e.isLast}));return l(e,(null!=(r=null!=a?a:o)?r:i).name)})));return{locale:e.currentLocale,tags:u}}},12:(e,t,n)=>{"use strict";n.d(t,{Nk:()=>c,WA:()=>u});var r=n(7294),a="localStorage";function o(e){var t=e.key,n=e.oldValue,r=e.newValue,a=e.storage;if(n!==r){var o=document.createEvent("StorageEvent");o.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,a),window.dispatchEvent(o)}}function i(e){if(void 0===e&&(e=a),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,l||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),l=!0),null}var t}var l=!1;var s={get:function(){return null},set:function(){},del:function(){},listen:function(){return function(){}}};function u(e,t){if("undefined"==typeof window)return function(e){function t(){throw new Error('Illegal storage API usage for storage key "'+e+'".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.')}return{get:t,set:t,del:t,listen:t}}(e);var n=i(null==t?void 0:t.persistence);return null===n?s:{get:function(){try{return n.getItem(e)}catch(t){return console.error("Docusaurus storage error, can't get key="+e,t),null}},set:function(t){try{var r=n.getItem(e);n.setItem(e,t),o({key:e,oldValue:r,newValue:t,storage:n})}catch(a){console.error("Docusaurus storage error, can't set "+e+"="+t,a)}},del:function(){try{var t=n.getItem(e);n.removeItem(e),o({key:e,oldValue:t,newValue:null,storage:n})}catch(r){console.error("Docusaurus storage error, can't delete key="+e,r)}},listen:function(t){try{var r=function(r){r.storageArea===n&&r.key===e&&t(r)};return window.addEventListener("storage",r),function(){return window.removeEventListener("storage",r)}}catch(a){return console.error("Docusaurus storage error, can't listen for changes of key="+e,a),function(){}}}}}function c(e,t){var n=(0,r.useRef)((function(){return null===e?s:u(e,t)})).current(),a=(0,r.useCallback)((function(e){return"undefined"==typeof window?function(){}:n.listen(e)}),[n]);return[(0,r.useSyncExternalStore)(a,(function(){return"undefined"==typeof window?null:n.get()}),(function(){return null})),n]}},4711:(e,t,n)=>{"use strict";n.d(t,{l:()=>i});var r=n(2263),a=n(6550),o=n(8780);function i(){var e=(0,r.Z)(),t=e.siteConfig,n=t.baseUrl,i=t.url,l=t.trailingSlash,s=e.i18n,u=s.defaultLocale,c=s.currentLocale,d=(0,a.TH)().pathname,f=(0,o.applyTrailingSlash)(d,{trailingSlash:l,baseUrl:n}),p=c===u?n:n.replace("/"+c+"/","/"),m=f.replace(n,"");return{createUrl:function(e){var t=e.locale;return""+(e.fullyQualified?i:"")+function(e){return e===u?""+p:""+p+e+"/"}(t)+m}}}},5936:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(7294),a=n(6550),o=n(9688);function i(e){var t=(0,a.TH)(),n=(0,o.D9)(t),i=(0,o.zX)(e);(0,r.useEffect)((function(){n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6668:(e,t,n)=>{"use strict";n.d(t,{L:()=>a});var r=n(2263);function a(){return(0,r.Z)().siteConfig.themeConfig}},6278:(e,t,n)=>{"use strict";n.d(t,{L:()=>a});var r=n(2263);function a(){return(0,r.Z)().siteConfig.themeConfig}},239:(e,t,n)=>{"use strict";n.d(t,{l:()=>l});var r=n(7294),a=n(8022),o=n(4996),i=n(6278);function l(){var e=(0,o.C)().withBaseUrl,t=(0,i.L)().algolia,n=t.externalUrlRegex,l=t.replaceSearchResultPathname;return(0,r.useCallback)((function(t){var r=new URL(t);if((0,a.F)(n,r.href))return t;var o=""+(r.pathname+r.hash);return e(function(e,t){return t?e.replaceAll(new RegExp(t.from,"g"),t.to):e}(o,l))}),[e,n,l])}},8802:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=t.trailingSlash,r=t.baseUrl;if(e.startsWith("#"))return e;if(void 0===n)return e;var a,o=e.split(/[#?]/)[0],i="/"===o||o===r?o:(a=o,n?function(e){return e.endsWith("/")?e:e+"/"}(a):function(e){return e.endsWith("/")?e.slice(0,-1):e}(a));return e.replace(o,i)}},4143:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=void 0,t.getErrorCausalChain=function e(t){return t.cause?[t].concat(e(t.cause)):[t]}},8780:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="__blog-post-container";var a=n(8802);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(a).default}});var o=n(4143);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return o.getErrorCausalChain}})},5296:(e,t,n)=>{"use strict";n.d(t,{Z:()=>en});var r=n(7294),a=n(512),o=n(4763),i=n(833),l=n(6550),s=n(5999),u=n(5936),c=n(5893),d="__docusaurus_skipToContent_fallback";function f(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function p(){var e=(0,r.useRef)(null),t=(0,l.k6)().action,n=(0,r.useCallback)((function(e){e.preventDefault();var t,n=null!=(t=document.querySelector("main:first-of-type"))?t:document.getElementById(d);n&&f(n)}),[]);return(0,u.S)((function(n){var r=n.location;e.current&&!r.hash&&"PUSH"===t&&f(e.current)})),{containerRef:e,onClick:n}}var m=(0,s.I)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function h(e){var t,n=null!=(t=e.children)?t:m,r=p(),a=r.containerRef,o=r.onClick;return(0,c.jsx)("div",{ref:a,role:"region","aria-label":m,children:(0,c.jsx)("a",Object.assign({},e,{href:"#"+d,onClick:o,children:n}))})}var g=n(5281),v=n(9727);const y={skipToContent:"skipToContent_fXgn"};function b(){return(0,c.jsx)(h,{className:y.skipToContent})}var w=n(6668),k=n(9689),x=n(3366),S=["width","height","color","strokeWidth","className"];function E(e){var t=e.width,n=void 0===t?21:t,r=e.height,a=void 0===r?21:r,o=e.color,i=void 0===o?"currentColor":o,l=e.strokeWidth,s=void 0===l?1.2:l,u=(e.className,(0,x.Z)(e,S));return(0,c.jsx)("svg",Object.assign({viewBox:"0 0 15 15",width:n,height:a},u,{children:(0,c.jsx)("g",{stroke:i,strokeWidth:s,children:(0,c.jsx)("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})})}))}const C={closeButton:"closeButton_CVFx"};function T(e){return(0,c.jsx)("button",Object.assign({type:"button","aria-label":(0,s.I)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"})},e,{className:(0,a.Z)("clean-btn close",C.closeButton,e.className),children:(0,c.jsx)(E,{width:14,height:14,strokeWidth:3.1})}))}const _={content:"content_knG7"};function j(e){var t=(0,w.L)().announcementBar.content;return(0,c.jsx)("div",Object.assign({},e,{className:(0,a.Z)(_.content,e.className),dangerouslySetInnerHTML:{__html:t}}))}const A={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function L(){var e=(0,w.L)().announcementBar,t=(0,k.nT)(),n=t.isActive,r=t.close;if(!n)return null;var a=e.backgroundColor,o=e.textColor,i=e.isCloseable;return(0,c.jsxs)("div",{className:A.announcementBar,style:{backgroundColor:a,color:o},role:"banner",children:[i&&(0,c.jsx)("div",{className:A.announcementBarPlaceholder}),(0,c.jsx)(j,{className:A.announcementBarContent}),i&&(0,c.jsx)(T,{onClick:r,className:A.announcementBarClose})]})}var R=n(3163),O=n(2466);var N=n(9688),P=n(3102),I=r.createContext(null);function D(e){var t,n,a,o,i,l,s,u=e.children,d=(t=(0,R.e)(),n=(0,P.HY)(),a=(0,r.useState)(!1),o=a[0],i=a[1],l=null!==n.component,s=(0,N.D9)(l),(0,r.useEffect)((function(){l&&!s&&i(!0)}),[l,s]),(0,r.useEffect)((function(){l?t.shown||i(!0):i(!1)}),[t.shown,l]),(0,r.useMemo)((function(){return[o,i]}),[o]));return(0,c.jsx)(I.Provider,{value:d,children:u})}function M(e){if(e.component){var t=e.component;return(0,c.jsx)(t,Object.assign({},e.props))}}function F(){var e=(0,r.useContext)(I);if(!e)throw new N.i6("NavbarSecondaryMenuDisplayProvider");var t=e[0],n=e[1],a=(0,r.useCallback)((function(){return n(!1)}),[n]),o=(0,P.HY)();return(0,r.useMemo)((function(){return{shown:t,hide:a,content:M(o)}}),[a,o,t])}function B(e){var t=e.header,n=e.primaryMenu,r=e.secondaryMenu,o=F().shown;return(0,c.jsxs)("div",{className:"navbar-sidebar",children:[t,(0,c.jsxs)("div",{className:(0,a.Z)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":o}),children:[(0,c.jsx)("div",{className:"navbar-sidebar__item menu",children:n}),(0,c.jsx)("div",{className:"navbar-sidebar__item menu",children:r})]})]})}var z=n(2949),U=n(2389);function Z(e){return(0,c.jsx)("svg",Object.assign({viewBox:"0 0 24 24",width:24,height:24},e,{children:(0,c.jsx)("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})}))}function $(e){return(0,c.jsx)("svg",Object.assign({viewBox:"0 0 24 24",width:24,height:24},e,{children:(0,c.jsx)("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})}))}const q={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function H(e){var t=e.className,n=e.buttonClassName,r=e.value,o=e.onChange,i=(0,U.Z)(),l=(0,s.I)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===r?(0,s.I)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,s.I)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return(0,c.jsx)("div",{className:(0,a.Z)(q.toggle,t),children:(0,c.jsxs)("button",{className:(0,a.Z)("clean-btn",q.toggleButton,!i&&q.toggleButtonDisabled,n),type:"button",onClick:function(){return o("dark"===r?"light":"dark")},disabled:!i,title:l,"aria-label":l,"aria-live":"polite",children:[(0,c.jsx)(Z,{className:(0,a.Z)(q.toggleIcon,q.lightToggleIcon)}),(0,c.jsx)($,{className:(0,a.Z)(q.toggleIcon,q.darkToggleIcon)})]})})}const G=r.memo(H),V={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_X3D1"};function W(e){var t=e.className,n=(0,w.L)().navbar.style,r=(0,w.L)().colorMode.disableSwitch,a=(0,z.I)(),o=a.colorMode,i=a.setColorMode;return r?null:(0,c.jsx)(G,{className:t,buttonClassName:"dark"===n?V.darkNavbarColorModeToggle:void 0,value:o,onChange:i})}var K=n(1327);function Q(){return(0,c.jsx)(K.Z,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function Y(){var e=(0,R.e)();return(0,c.jsx)("button",{type:"button","aria-label":(0,s.I)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:function(){return e.toggle()},children:(0,c.jsx)(E,{color:"var(--ifm-color-emphasis-600)"})})}function X(){return(0,c.jsxs)("div",{className:"navbar-sidebar__brand",children:[(0,c.jsx)(Q,{}),(0,c.jsx)(W,{className:"margin-right--md"}),(0,c.jsx)(Y,{})]})}var J=n(3692),ee=n(4996),te=n(3919),ne=n(8022),re=n(9471),ae=["activeBasePath","activeBaseRegex","to","href","label","html","isDropdownLink","prependBaseUrlToHref"];function oe(e){var t=e.activeBasePath,n=e.activeBaseRegex,r=e.to,a=e.href,o=e.label,i=e.html,l=e.isDropdownLink,s=e.prependBaseUrlToHref,u=(0,x.Z)(e,ae),d=(0,ee.Z)(r),f=(0,ee.Z)(t),p=(0,ee.Z)(a,{forcePrependBaseUrl:!0}),m=o&&a&&!(0,te.Z)(a),h=i?{dangerouslySetInnerHTML:{__html:i}}:{children:(0,c.jsxs)(c.Fragment,{children:[o,m&&(0,c.jsx)(re.Z,Object.assign({},l&&{width:12,height:12}))]})};return a?(0,c.jsx)(J.Z,Object.assign({href:s?p:a},u,h)):(0,c.jsx)(J.Z,Object.assign({to:d,isNavLink:!0},(t||n)&&{isActive:function(e,t){return n?(0,ne.F)(n,t.pathname):t.pathname.startsWith(f)}},u,h))}var ie=["className","isDropdownItem"],le=["className","isDropdownItem"],se=["mobile","position"];function ue(e){var t=e.className,n=e.isDropdownItem,r=void 0!==n&&n,o=(0,x.Z)(e,ie),i=(0,c.jsx)(oe,Object.assign({className:(0,a.Z)(r?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:r},o));return r?(0,c.jsx)("li",{children:i}):i}function ce(e){var t=e.className,n=(e.isDropdownItem,(0,x.Z)(e,le));return(0,c.jsx)("li",{className:"menu__list-item",children:(0,c.jsx)(oe,Object.assign({className:(0,a.Z)("menu__link",t)},n))})}function de(e){var t,n=e.mobile,r=void 0!==n&&n,a=(e.position,(0,x.Z)(e,se)),o=r?ce:ue;return(0,c.jsx)(o,Object.assign({},a,{activeClassName:null!=(t=a.activeClassName)?t:r?"menu__link--active":"navbar__link--active"}))}var fe=n(6043),pe=n(8596),me=n(2263);const he={dropdownNavbarItemMobile:"dropdownNavbarItemMobile_S0Fm"};var ge=["items","position","className","onClick"],ve=["items","className","position","onClick"],ye=["mobile"];function be(e,t){return e.some((function(e){return function(e,t){return!!(0,pe.Mg)(e.to,t)||!!(0,ne.F)(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)}))}function we(e){var t,n=e.items,o=e.position,i=e.className,l=(e.onClick,(0,x.Z)(e,ge)),s=(0,r.useRef)(null),u=(0,r.useState)(!1),d=u[0],f=u[1];return(0,r.useEffect)((function(){var e=function(e){s.current&&!s.current.contains(e.target)&&f(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),function(){document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[s]),(0,c.jsxs)("div",{ref:s,className:(0,a.Z)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===o,"dropdown--show":d}),children:[(0,c.jsx)(oe,Object.assign({"aria-haspopup":"true","aria-expanded":d,role:"button",href:l.to?void 0:"#",className:(0,a.Z)("navbar__link",i)},l,{onClick:l.to?void 0:function(e){return e.preventDefault()},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),f(!d))},children:null!=(t=l.children)?t:l.label})),(0,c.jsx)("ul",{className:"dropdown__menu",children:n.map((function(e,t){return(0,r.createElement)(lt,Object.assign({isDropdownItem:!0,activeClassName:"dropdown__link--active"},e,{key:t}))}))})]})}function ke(e){var t,n,o=e.items,i=e.className,s=(e.position,e.onClick),u=(0,x.Z)(e,ve),d=(n=(0,me.Z)().siteConfig.baseUrl,(0,l.TH)().pathname.replace(n,"/")),f=be(o,d),p=(0,fe.u)({initialState:function(){return!f}}),m=p.collapsed,h=p.toggleCollapsed,g=p.setCollapsed;return(0,r.useEffect)((function(){f&&g(!f)}),[d,f,g]),(0,c.jsxs)("li",{className:(0,a.Z)("menu__list-item",{"menu__list-item--collapsed":m}),children:[(0,c.jsx)(oe,Object.assign({role:"button",className:(0,a.Z)(he.dropdownNavbarItemMobile,"menu__link menu__link--sublist menu__link--sublist-caret",i)},u,{onClick:function(e){e.preventDefault(),h()},children:null!=(t=u.children)?t:u.label})),(0,c.jsx)(fe.z,{lazy:!0,as:"ul",className:"menu__list",collapsed:m,children:o.map((function(e,t){return(0,r.createElement)(lt,Object.assign({mobile:!0,isDropdownItem:!0,onClick:s,activeClassName:"menu__link--active"},e,{key:t}))}))})]})}function xe(e){var t=e.mobile,n=void 0!==t&&t,r=(0,x.Z)(e,ye),a=n?ke:we;return(0,c.jsx)(a,Object.assign({},r))}var Se=n(4711),Ee=["width","height"];function Ce(e){var t=e.width,n=void 0===t?20:t,r=e.height,a=void 0===r?20:r,o=(0,x.Z)(e,Ee);return(0,c.jsx)("svg",Object.assign({viewBox:"0 0 24 24",width:n,height:a,"aria-hidden":!0},o,{children:(0,c.jsx)("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"})}))}const Te="iconLanguage_nlXk";var _e=["mobile","dropdownItemsBefore","dropdownItemsAfter","queryString"];var je=n(3935);function Ae(){return r.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},r.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}var Le=n(830),Re=["translations"];function Oe(){return Oe=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var De="Ctrl";var Me=r.forwardRef((function(e,t){var n=e.translations,a=void 0===n?{}:n,o=Ie(e,Re),i=a.buttonText,l=void 0===i?"Search":i,s=a.buttonAriaLabel,u=void 0===s?"Search":s,c=Ne((0,r.useState)(null),2),d=c[0],f=c[1];return(0,r.useEffect)((function(){"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?f("\u2318"):f(De))}),[]),r.createElement("button",Oe({type:"button",className:"DocSearch DocSearch-Button","aria-label":u},o,{ref:t}),r.createElement("span",{className:"DocSearch-Button-Container"},r.createElement(Le.W,null),r.createElement("span",{className:"DocSearch-Button-Placeholder"},l)),r.createElement("span",{className:"DocSearch-Button-Keys"},null!==d&&r.createElement(r.Fragment,null,r.createElement("kbd",{className:"DocSearch-Button-Key"},d===De?r.createElement(Ae,null):d),r.createElement("kbd",{className:"DocSearch-Button-Key"},"K"))))})),Fe=n(5742),Be=n(6177),ze=n(239),Ue=n(3320);const Ze={button:{buttonText:(0,s.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),buttonAriaLabel:(0,s.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"})},modal:{searchBox:{resetButtonTitle:(0,s.I)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),resetButtonAriaLabel:(0,s.I)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),cancelButtonText:(0,s.I)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"}),cancelButtonAriaLabel:(0,s.I)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"})},startScreen:{recentSearchesTitle:(0,s.I)({id:"theme.SearchModal.startScreen.recentSearchesTitle",message:"Recent",description:"The title for recent searches"}),noRecentSearchesText:(0,s.I)({id:"theme.SearchModal.startScreen.noRecentSearchesText",message:"No recent searches",description:"The text when no recent searches"}),saveRecentSearchButtonTitle:(0,s.I)({id:"theme.SearchModal.startScreen.saveRecentSearchButtonTitle",message:"Save this search",description:"The label for save recent search button"}),removeRecentSearchButtonTitle:(0,s.I)({id:"theme.SearchModal.startScreen.removeRecentSearchButtonTitle",message:"Remove this search from history",description:"The label for remove recent search button"}),favoriteSearchesTitle:(0,s.I)({id:"theme.SearchModal.startScreen.favoriteSearchesTitle",message:"Favorite",description:"The title for favorite searches"}),removeFavoriteSearchButtonTitle:(0,s.I)({id:"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle",message:"Remove this search from favorites",description:"The label for remove favorite search button"})},errorScreen:{titleText:(0,s.I)({id:"theme.SearchModal.errorScreen.titleText",message:"Unable to fetch results",description:"The title for error screen of search modal"}),helpText:(0,s.I)({id:"theme.SearchModal.errorScreen.helpText",message:"You might want to check your network connection.",description:"The help text for error screen of search modal"})},footer:{selectText:(0,s.I)({id:"theme.SearchModal.footer.selectText",message:"to select",description:"The explanatory text of the action for the enter key"}),selectKeyAriaLabel:(0,s.I)({id:"theme.SearchModal.footer.selectKeyAriaLabel",message:"Enter key",description:"The ARIA label for the Enter key button that makes the selection"}),navigateText:(0,s.I)({id:"theme.SearchModal.footer.navigateText",message:"to navigate",description:"The explanatory text of the action for the Arrow up and Arrow down key"}),navigateUpKeyAriaLabel:(0,s.I)({id:"theme.SearchModal.footer.navigateUpKeyAriaLabel",message:"Arrow up",description:"The ARIA label for the Arrow up key button that makes the navigation"}),navigateDownKeyAriaLabel:(0,s.I)({id:"theme.SearchModal.footer.navigateDownKeyAriaLabel",message:"Arrow down",description:"The ARIA label for the Arrow down key button that makes the navigation"}),closeText:(0,s.I)({id:"theme.SearchModal.footer.closeText",message:"to close",description:"The explanatory text of the action for Escape key"}),closeKeyAriaLabel:(0,s.I)({id:"theme.SearchModal.footer.closeKeyAriaLabel",message:"Escape key",description:"The ARIA label for the Escape key button that close the modal"}),searchByText:(0,s.I)({id:"theme.SearchModal.footer.searchByText",message:"Search by",description:"The text explain that the search is making by Algolia"})},noResultsScreen:{noResultsText:(0,s.I)({id:"theme.SearchModal.noResultsScreen.noResultsText",message:"No results for",description:"The text explains that there are no results for the following search"}),suggestedQueryText:(0,s.I)({id:"theme.SearchModal.noResultsScreen.suggestedQueryText",message:"Try searching for",description:"The text for the suggested query when no results are found for the following search"}),reportMissingResultsText:(0,s.I)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsText",message:"Believe this query should return results?",description:"The text for the question where the user thinks there are missing results"}),reportMissingResultsLinkText:(0,s.I)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText",message:"Let us know.",description:"The text for the link to report missing results"})}},placeholder:(0,s.I)({id:"theme.SearchModal.placeholder",message:"Search docs",description:"The placeholder of the input of the DocSearch pop-up modal"})};var $e=["contextualSearch","externalUrlRegex"],qe=null;function He(e){var t=e.hit,n=e.children;return(0,c.jsx)(J.Z,{to:t.url,children:n})}function Ge(e){var t=e.state,n=e.onClose,r=(0,Be.M)();return(0,c.jsx)(J.Z,{to:r(t.query),onClick:n,children:(0,c.jsx)(s.Z,{id:"theme.SearchBar.seeAll",values:{count:t.context.nbHits},children:"See all {count} results"})})}function Ve(e){var t,a,o,i,s,u=e.contextualSearch,d=e.externalUrlRegex,f=(0,x.Z)(e,$e),p=(0,me.Z)().siteMetadata,m=(0,ze.l)(),h=["language:"+(o=(0,Ue._q)()).locale,o.tags.map((function(e){return"docusaurus_tag:"+e}))],g=null!=(t=null==(a=f.searchParameters)?void 0:a.facetFilters)?t:[],v=u?(i=g,[].concat((s=function(e){return"string"==typeof e?[e]:e})(h),s(i))):g,y=Object.assign({},f.searchParameters,{facetFilters:v}),b=(0,l.k6)(),w=(0,r.useRef)(null),k=(0,r.useRef)(null),S=(0,r.useState)(!1),E=S[0],C=S[1],T=(0,r.useState)(void 0),_=T[0],j=T[1],A=(0,r.useCallback)((function(){return qe?Promise.resolve():Promise.all([n.e(426).then(n.bind(n,1426)),Promise.all([n.e(532),n.e(945)]).then(n.bind(n,6945)),Promise.all([n.e(532),n.e(894)]).then(n.bind(n,8894))]).then((function(e){var t=e[0].DocSearchModal;qe=t}))}),[]),L=(0,r.useCallback)((function(){A().then((function(){w.current=document.createElement("div"),document.body.insertBefore(w.current,document.body.firstChild),C(!0)}))}),[A,C]),R=(0,r.useCallback)((function(){var e;C(!1),null==(e=w.current)||e.remove()}),[C]),O=(0,r.useCallback)((function(e){A().then((function(){C(!0),j(e.key)}))}),[A,C,j]),N=(0,r.useRef)({navigate:function(e){var t=e.itemUrl;(0,ne.F)(d,t)?window.location.href=t:b.push(t)}}).current,P=(0,r.useRef)((function(e){return f.transformItems?f.transformItems(e):e.map((function(e){return Object.assign({},e,{url:m(e.url)})}))})).current,I=(0,r.useMemo)((function(){return function(e){return(0,c.jsx)(Ge,Object.assign({},e,{onClose:R}))}}),[R]),D=(0,r.useCallback)((function(e){return e.addAlgoliaAgent("docusaurus",p.docusaurusVersion),e}),[p.docusaurusVersion]);return function(e){var t=e.isOpen,n=e.onOpen,a=e.onClose,o=e.onInput,i=e.searchButtonRef;r.useEffect((function(){function e(e){var r;(27===e.keyCode&&t||"k"===(null===(r=e.key)||void 0===r?void 0:r.toLowerCase())&&(e.metaKey||e.ctrlKey)||!function(e){var t=e.target,n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&"/"===e.key&&!t)&&(e.preventDefault(),t?a():document.body.classList.contains("DocSearch--active")||document.body.classList.contains("DocSearch--active")||n()),i&&i.current===document.activeElement&&o&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&o(e)}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[t,n,a,o,i])}({isOpen:E,onOpen:L,onClose:R,onInput:O,searchButtonRef:k}),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Fe.Z,{children:(0,c.jsx)("link",{rel:"preconnect",href:"https://"+f.appId+"-dsn.algolia.net",crossOrigin:"anonymous"})}),(0,c.jsx)(Me,{onTouchStart:A,onFocus:A,onMouseOver:A,onClick:L,ref:k,translations:Ze.button}),E&&qe&&w.current&&(0,je.createPortal)((0,c.jsx)(qe,Object.assign({onClose:R,initialScrollY:window.scrollY,initialQuery:_,navigator:N,transformItems:P,hitComponent:He,transformSearchClient:D},f.searchPagePath&&{resultsFooterComponent:I},f,{searchParameters:y,placeholder:Ze.placeholder,translations:Ze.modal})),w.current)]})}function We(){var e=(0,me.Z)().siteConfig;return(0,c.jsx)(Ve,Object.assign({},e.themeConfig.algolia))}const Ke={navbarSearchContainer:"navbarSearchContainer_Bca1"};function Qe(e){var t=e.children,n=e.className;return(0,c.jsx)("div",{className:(0,a.Z)(n,Ke.navbarSearchContainer),children:t})}var Ye=n(143),Xe=n(3791),Je=["docId","label","docsPluginId"];var et=["sidebarId","label","docsPluginId"];var tt=["label","to","docsPluginId"];var nt=n(373),rt=["mobile","docsPluginId","dropdownActiveClassDisabled","dropdownItemsBefore","dropdownItemsAfter"],at=function(e){return e.docs.find((function(t){return t.id===e.mainDocId}))};const ot={default:de,localeDropdown:function(e){var t=e.mobile,n=e.dropdownItemsBefore,r=e.dropdownItemsAfter,a=e.queryString,o=void 0===a?"":a,i=(0,x.Z)(e,_e),u=(0,me.Z)().i18n,d=u.currentLocale,f=u.locales,p=u.localeConfigs,m=(0,Se.l)(),h=(0,l.TH)(),g=h.search,v=h.hash,y=f.map((function(e){var n=""+("pathname://"+m.createUrl({locale:e,fullyQualified:!1}))+g+v+o;return{label:p[e].label,lang:p[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===d?t?"menu__link--active":"dropdown__link--active":""}})),b=[].concat(n,y,r),w=t?(0,s.I)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):p[d].label;return(0,c.jsx)(xe,Object.assign({},i,{mobile:t,label:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ce,{className:Te}),w]}),items:b}))},search:function(e){var t=e.mobile,n=e.className;return t?null:(0,c.jsx)(Qe,{className:n,children:(0,c.jsx)(We,{})})},dropdown:xe,html:function(e){var t=e.value,n=e.className,r=e.mobile,o=void 0!==r&&r,i=e.isDropdownItem,l=void 0!==i&&i,s=l?"li":"div";return(0,c.jsx)(s,{className:(0,a.Z)({navbar__item:!o&&!l,"menu__list-item":o},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){var t=e.docId,n=e.label,r=e.docsPluginId,a=(0,x.Z)(e,Je),o=(0,Ye.Iw)(r).activeDoc,i=(0,Xe.vY)(t,r),l=(null==o?void 0:o.path)===(null==i?void 0:i.path);return null===i||i.unlisted&&!l?null:(0,c.jsx)(de,Object.assign({exact:!0},a,{isActive:function(){return l||!(null==o||!o.sidebar)&&o.sidebar===i.sidebar},label:null!=n?n:i.id,to:i.path}))},docSidebar:function(e){var t=e.sidebarId,n=e.label,r=e.docsPluginId,a=(0,x.Z)(e,et),o=(0,Ye.Iw)(r).activeDoc,i=(0,Xe.oz)(t,r).link;if(!i)throw new Error('DocSidebarNavbarItem: Sidebar with ID "'+t+"\" doesn't have anything to be linked to.");return(0,c.jsx)(de,Object.assign({exact:!0},a,{isActive:function(){return(null==o?void 0:o.sidebar)===t},label:null!=n?n:i.label,to:i.path}))},docsVersion:function(e){var t=e.label,n=e.to,r=e.docsPluginId,a=(0,x.Z)(e,tt),o=(0,Xe.lO)(r)[0],i=null!=t?t:o.label,l=null!=n?n:function(e){return e.docs.find((function(t){return t.id===e.mainDocId}))}(o).path;return(0,c.jsx)(de,Object.assign({},a,{label:i,to:l}))},docsVersionDropdown:function(e){var t=e.mobile,n=e.docsPluginId,r=e.dropdownActiveClassDisabled,a=e.dropdownItemsBefore,o=e.dropdownItemsAfter,i=(0,x.Z)(e,rt),u=(0,l.TH)(),d=u.search,f=u.hash,p=(0,Ye.Iw)(n),m=(0,Ye.gB)(n),h=(0,nt.J)(n).savePreferredVersionName,g=m.map((function(e){var t,n=null!=(t=p.alternateDocVersions[e.name])?t:at(e);return{label:e.label,to:""+n.path+d+f,isActive:function(){return e===p.activeVersion},onClick:function(){return h(e.name)}}})),v=[].concat(a,g,o),y=(0,Xe.lO)(n)[0],b=t&&v.length>1?(0,s.I)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):y.label,w=t&&v.length>1?void 0:at(y).path;return v.length<=1?(0,c.jsx)(de,Object.assign({},i,{mobile:t,label:b,to:w,isActive:r?function(){return!1}:void 0})):(0,c.jsx)(xe,Object.assign({},i,{mobile:t,label:b,to:w,items:v,isActive:r?function(){return!1}:void 0}))}};var it=["type"];function lt(e){var t=e.type,n=(0,x.Z)(e,it),r=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),a=ot[r];if(!a)throw new Error('No NavbarItem component found for type "'+t+'".');return(0,c.jsx)(a,Object.assign({},n))}function st(){var e=(0,R.e)(),t=(0,w.L)().navbar.items;return(0,c.jsx)("ul",{className:"menu__list",children:t.map((function(t,n){return(0,r.createElement)(lt,Object.assign({mobile:!0},t,{onClick:function(){return e.toggle()},key:n}))}))})}function ut(e){return(0,c.jsx)("button",Object.assign({},e,{type:"button",className:"clean-btn navbar-sidebar__back",children:(0,c.jsx)(s.Z,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)",children:"\u2190 Back to main menu"})}))}function ct(){var e=0===(0,w.L)().navbar.items.length,t=F();return(0,c.jsxs)(c.Fragment,{children:[!e&&(0,c.jsx)(ut,{onClick:function(){return t.hide()}}),t.content]})}function dt(){var e,t=(0,R.e)();return void 0===(e=t.shown)&&(e=!0),(0,r.useEffect)((function(){return document.body.style.overflow=e?"hidden":"visible",function(){document.body.style.overflow="visible"}}),[e]),t.shouldRender?(0,c.jsx)(B,{header:(0,c.jsx)(X,{}),primaryMenu:(0,c.jsx)(st,{}),secondaryMenu:(0,c.jsx)(ct,{})}):null}const ft={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function pt(e){return(0,c.jsx)("div",Object.assign({role:"presentation"},e,{className:(0,a.Z)("navbar-sidebar__backdrop",e.className)}))}function mt(e){var t=e.children,n=(0,w.L)().navbar,o=n.hideOnScroll,i=n.style,l=(0,R.e)(),d=function(e){var t=(0,r.useState)(e),n=t[0],a=t[1],o=(0,r.useRef)(!1),i=(0,r.useRef)(0),l=(0,r.useCallback)((function(e){null!==e&&(i.current=e.getBoundingClientRect().height)}),[]);return(0,O.RF)((function(t,n){var r=t.scrollY;if(e)if(r=l?a(!1):r+u0&&(0,c.jsx)(Ft,{links:n}),logo:r&&(0,c.jsx)(Zt,{logo:r}),copyright:t&&(0,c.jsx)($t,{copyright:t})})}const Gt=r.memo(Ht);var Vt=(0,N.Qc)([z.S,k.pl,O.OC,nt.L5,i.VC,function(e){var t=e.children;return(0,c.jsx)(P.n2,{children:(0,c.jsx)(R.M,{children:(0,c.jsx)(D,{children:t})})})}]);function Wt(e){var t=e.children;return(0,c.jsx)(Vt,{children:t})}var Kt=n(2503);function Qt(e){var t=e.error,n=e.tryAgain;return(0,c.jsx)("main",{className:"container margin-vert--xl",children:(0,c.jsx)("div",{className:"row",children:(0,c.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,c.jsx)(Kt.Z,{as:"h1",className:"hero__title",children:(0,c.jsx)(s.Z,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed",children:"This page crashed."})}),(0,c.jsx)("div",{className:"margin-vert--lg",children:(0,c.jsx)(yt,{onClick:n,className:"button button--primary shadow--lw"})}),(0,c.jsx)("hr",{}),(0,c.jsx)("div",{className:"margin-vert--md",children:(0,c.jsx)(bt,{error:t})})]})})})}const Yt="mainWrapper_z2l0";function Xt(e){var t=e.children,n=e.noFooter,r=e.wrapperClassName,l=e.title,s=e.description;return(0,v.t)(),(0,c.jsxs)(Wt,{children:[(0,c.jsx)(i.d,{title:l,description:s}),(0,c.jsx)(b,{}),(0,c.jsx)(L,{}),(0,c.jsx)(At,{}),(0,c.jsx)("div",{id:d,className:(0,a.Z)(g.k.wrapper.main,Yt,r),children:(0,c.jsx)(o.Z,{fallback:function(e){return(0,c.jsx)(Qt,Object.assign({},e))},children:t})}),!n&&(0,c.jsx)(Gt,{})]})}var Jt=function(){var e=(0,l.TH)().pathname;return e.endsWith("/")?(0,c.jsx)(l.l_,{to:e.slice(0,-1)}):e.endsWith(".html")?(0,c.jsx)(l.l_,{to:e.slice(0,-5)}):null};const en=function(e){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Jt,{}),(0,c.jsx)(Xt,Object.assign({},e))]})}},2358:(e,t,n)=>{"use strict";n.d(t,{lX:()=>S,q_:()=>A,ob:()=>h,PP:()=>R,Ep:()=>m,Hp:()=>g});var r=n(7462);function a(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,a=e.length;r=0;f--){var p=i[f];"."===p?o(i,f):".."===p?(o(i,f),d++):d&&(o(i,f),d--)}if(!u)for(;d--;d)i.unshift("..");!u||""===i[0]||i[0]&&a(i[0])||i.unshift("");var m=i.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};function l(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}const s=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=l(t),a=l(n);return r!==t||a!==n?e(r,a):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var u=n(8776);function c(e){return"/"===e.charAt(0)?e:"/"+e}function d(e){return"/"===e.charAt(0)?e.substr(1):e}function f(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function p(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function m(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function h(e,t,n,a){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=(0,r.Z)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(o.key=n),a?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=i(o.pathname,a.pathname)):o.pathname=a.pathname:o.pathname||(o.pathname="/"),o}function g(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&s(e.state,t.state)}function v(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,a):n.push(a),d({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=h(e,t,f(),w.location);c.confirmTransitionTo(a,r,n,(function(e){e&&(w.entries[w.index]=a,d({action:r,location:a}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=w.index+e;return t>=0&&t{"use strict";var r=n(9864),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var a=p(n);a&&a!==m&&e(t,a,r)}var i=c(n);d&&(i=i.concat(d(n)));for(var l=s(t),h=s(n),g=0;g{"use strict";e.exports=function(e,t,n,r,a,o,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,a,o,i,l],c=0;(s=new Error(t.replace(/%s/g,(function(){return u[c++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},5826:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},6736:(e,t,n)=>{"use strict";n.r(t)},8117:(e,t,n)=>{"use strict";n.r(t)},3665:(e,t,n)=>{"use strict";n.r(t)},9555:(e,t,n)=>{"use strict";n.r(t)},1672:(e,t,n)=>{"use strict";n.r(t)},2497:(e,t,n)=>{"use strict";n.r(t)},4865:function(e,t,n){var r,a;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
    '};function a(e,t,n){return en?n:e}function o(e){return 100*(-1+e)}function i(e,t,n){var a;return(a="translate3d"===r.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,a}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=a(e,r.minimum,1),n.status=1===e?null:e;var o=n.render(!t),u=o.querySelector(r.barSelector),c=r.speed,d=r.easing;return o.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(u,i(e,c,d)),1===e?(s(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout((function(){s(o,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),c)}),c)):setTimeout(t,c)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*a(Math.random()*t,.1,.95)),t=a(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var a,i=t.querySelector(r.barSelector),l=e?"-100":o(n.status||0),u=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(a=t.querySelector(r.spinnerSelector))&&p(a),u!=document.body&&c(u,"nprogress-custom-parent"),u.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,a=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);a--;)if((r=e[a]+o)in n)return r;return t}function a(e){return e=n(e),t[e]||(t[e]=r(e))}function o(e,t,n){t=a(t),e.style[t]=n}return function(e,t){var n,r,a=arguments;if(2==a.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&o(e,n,r);else o(e,a[1],a[2])}}();function u(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function c(e,t){var n=f(e),r=n+t;u(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);u(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(a="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=a)},9901:e=>{e.exports&&(e.exports={core:{meta:{path:"components/prism-core.js",option:"mandatory"},core:"Core"},themes:{meta:{path:"themes/{id}.css",link:"index.html?theme={id}",exclusive:!0},prism:{title:"Default",option:"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{title:"Okaidia",owner:"ocodia"},"prism-twilight":{title:"Twilight",owner:"remybach"},"prism-coy":{title:"Coy",owner:"tshedor"},"prism-solarizedlight":{title:"Solarized Light",owner:"hectormatos2011 "},"prism-tomorrow":{title:"Tomorrow Night",owner:"Rosey"}},languages:{meta:{path:"components/prism-{id}",noCSS:!0,examplesPath:"examples/prism-{id}",addCheckAll:!0},markup:{title:"Markup",alias:["html","xml","svg","mathml","ssml","atom","rss"],aliasTitles:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",atom:"Atom",rss:"RSS"},option:"default"},css:{title:"CSS",option:"default",modify:"markup"},clike:{title:"C-like",option:"default"},javascript:{title:"JavaScript",require:"clike",modify:"markup",optional:"regex",alias:"js",option:"default"},abap:{title:"ABAP",owner:"dellagustin"},abnf:{title:"ABNF",owner:"RunDevelopment"},actionscript:{title:"ActionScript",require:"javascript",modify:"markup",owner:"Golmote"},ada:{title:"Ada",owner:"Lucretia"},agda:{title:"Agda",owner:"xy-ren"},al:{title:"AL",owner:"RunDevelopment"},antlr4:{title:"ANTLR4",alias:"g4",owner:"RunDevelopment"},apacheconf:{title:"Apache Configuration",owner:"GuiTeK"},apex:{title:"Apex",require:["clike","sql"],owner:"RunDevelopment"},apl:{title:"APL",owner:"ngn"},applescript:{title:"AppleScript",owner:"Golmote"},aql:{title:"AQL",owner:"RunDevelopment"},arduino:{title:"Arduino",require:"cpp",alias:"ino",owner:"dkern"},arff:{title:"ARFF",owner:"Golmote"},armasm:{title:"ARM Assembly",alias:"arm-asm",owner:"RunDevelopment"},arturo:{title:"Arturo",alias:"art",optional:["bash","css","javascript","markup","markdown","sql"],owner:"drkameleon"},asciidoc:{alias:"adoc",title:"AsciiDoc",owner:"Golmote"},aspnet:{title:"ASP.NET (C#)",require:["markup","csharp"],owner:"nauzilus"},asm6502:{title:"6502 Assembly",owner:"kzurawel"},asmatmel:{title:"Atmel AVR Assembly",owner:"cerkit"},autohotkey:{title:"AutoHotkey",owner:"aviaryan"},autoit:{title:"AutoIt",owner:"Golmote"},avisynth:{title:"AviSynth",alias:"avs",owner:"Zinfidel"},"avro-idl":{title:"Avro IDL",alias:"avdl",owner:"RunDevelopment"},awk:{title:"AWK",alias:"gawk",aliasTitles:{gawk:"GAWK"},owner:"RunDevelopment"},bash:{title:"Bash",alias:["sh","shell"],aliasTitles:{sh:"Shell",shell:"Shell"},owner:"zeitgeist87"},basic:{title:"BASIC",owner:"Golmote"},batch:{title:"Batch",owner:"Golmote"},bbcode:{title:"BBcode",alias:"shortcode",aliasTitles:{shortcode:"Shortcode"},owner:"RunDevelopment"},bbj:{title:"BBj",owner:"hyyan"},bicep:{title:"Bicep",owner:"johnnyreilly"},birb:{title:"Birb",require:"clike",owner:"Calamity210"},bison:{title:"Bison",require:"c",owner:"Golmote"},bnf:{title:"BNF",alias:"rbnf",aliasTitles:{rbnf:"RBNF"},owner:"RunDevelopment"},bqn:{title:"BQN",owner:"yewscion"},brainfuck:{title:"Brainfuck",owner:"Golmote"},brightscript:{title:"BrightScript",owner:"RunDevelopment"},bro:{title:"Bro",owner:"wayward710"},bsl:{title:"BSL (1C:Enterprise)",alias:"oscript",aliasTitles:{oscript:"OneScript"},owner:"Diversus23"},c:{title:"C",require:"clike",owner:"zeitgeist87"},csharp:{title:"C#",require:"clike",alias:["cs","dotnet"],owner:"mvalipour"},cpp:{title:"C++",require:"c",owner:"zeitgeist87"},cfscript:{title:"CFScript",require:"clike",alias:"cfc",owner:"mjclemente"},chaiscript:{title:"ChaiScript",require:["clike","cpp"],owner:"RunDevelopment"},cil:{title:"CIL",owner:"sbrl"},cilkc:{title:"Cilk/C",require:"c",alias:"cilk-c",owner:"OpenCilk"},cilkcpp:{title:"Cilk/C++",require:"cpp",alias:["cilk-cpp","cilk"],owner:"OpenCilk"},clojure:{title:"Clojure",owner:"troglotit"},cmake:{title:"CMake",owner:"mjrogozinski"},cobol:{title:"COBOL",owner:"RunDevelopment"},coffeescript:{title:"CoffeeScript",require:"javascript",alias:"coffee",owner:"R-osey"},concurnas:{title:"Concurnas",alias:"conc",owner:"jasontatton"},csp:{title:"Content-Security-Policy",owner:"ScottHelme"},cooklang:{title:"Cooklang",owner:"ahue"},coq:{title:"Coq",owner:"RunDevelopment"},crystal:{title:"Crystal",require:"ruby",owner:"MakeNowJust"},"css-extras":{title:"CSS Extras",require:"css",modify:"css",owner:"milesj"},csv:{title:"CSV",owner:"RunDevelopment"},cue:{title:"CUE",owner:"RunDevelopment"},cypher:{title:"Cypher",owner:"RunDevelopment"},d:{title:"D",require:"clike",owner:"Golmote"},dart:{title:"Dart",require:"clike",owner:"Golmote"},dataweave:{title:"DataWeave",owner:"machaval"},dax:{title:"DAX",owner:"peterbud"},dhall:{title:"Dhall",owner:"RunDevelopment"},diff:{title:"Diff",owner:"uranusjr"},django:{title:"Django/Jinja2",require:"markup-templating",alias:"jinja2",owner:"romanvm"},"dns-zone-file":{title:"DNS zone file",owner:"RunDevelopment",alias:"dns-zone"},docker:{title:"Docker",alias:"dockerfile",owner:"JustinBeckwith"},dot:{title:"DOT (Graphviz)",alias:"gv",optional:"markup",owner:"RunDevelopment"},ebnf:{title:"EBNF",owner:"RunDevelopment"},editorconfig:{title:"EditorConfig",owner:"osipxd"},eiffel:{title:"Eiffel",owner:"Conaclos"},ejs:{title:"EJS",require:["javascript","markup-templating"],owner:"RunDevelopment",alias:"eta",aliasTitles:{eta:"Eta"}},elixir:{title:"Elixir",owner:"Golmote"},elm:{title:"Elm",owner:"zwilias"},etlua:{title:"Embedded Lua templating",require:["lua","markup-templating"],owner:"RunDevelopment"},erb:{title:"ERB",require:["ruby","markup-templating"],owner:"Golmote"},erlang:{title:"Erlang",owner:"Golmote"},"excel-formula":{title:"Excel Formula",alias:["xlsx","xls"],owner:"RunDevelopment"},fsharp:{title:"F#",require:"clike",owner:"simonreynolds7"},factor:{title:"Factor",owner:"catb0t"},false:{title:"False",owner:"edukisto"},"firestore-security-rules":{title:"Firestore security rules",require:"clike",owner:"RunDevelopment"},flow:{title:"Flow",require:"javascript",owner:"Golmote"},fortran:{title:"Fortran",owner:"Golmote"},ftl:{title:"FreeMarker Template Language",require:"markup-templating",owner:"RunDevelopment"},gml:{title:"GameMaker Language",alias:"gamemakerlanguage",require:"clike",owner:"LiarOnce"},gap:{title:"GAP (CAS)",owner:"RunDevelopment"},gcode:{title:"G-code",owner:"RunDevelopment"},gdscript:{title:"GDScript",owner:"RunDevelopment"},gedcom:{title:"GEDCOM",owner:"Golmote"},gettext:{title:"gettext",alias:"po",owner:"RunDevelopment"},gherkin:{title:"Gherkin",owner:"hason"},git:{title:"Git",owner:"lgiraudel"},glsl:{title:"GLSL",require:"c",owner:"Golmote"},gn:{title:"GN",alias:"gni",owner:"RunDevelopment"},"linker-script":{title:"GNU Linker Script",alias:"ld",owner:"RunDevelopment"},go:{title:"Go",require:"clike",owner:"arnehormann"},"go-module":{title:"Go module",alias:"go-mod",owner:"RunDevelopment"},gradle:{title:"Gradle",require:"clike",owner:"zeabdelkhalek-badido18"},graphql:{title:"GraphQL",optional:"markdown",owner:"Golmote"},groovy:{title:"Groovy",require:"clike",owner:"robfletcher"},haml:{title:"Haml",require:"ruby",optional:["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],owner:"Golmote"},handlebars:{title:"Handlebars",require:"markup-templating",alias:["hbs","mustache"],aliasTitles:{mustache:"Mustache"},owner:"Golmote"},haskell:{title:"Haskell",alias:"hs",owner:"bholst"},haxe:{title:"Haxe",require:"clike",optional:"regex",owner:"Golmote"},hcl:{title:"HCL",owner:"outsideris"},hlsl:{title:"HLSL",require:"c",owner:"RunDevelopment"},hoon:{title:"Hoon",owner:"matildepark"},http:{title:"HTTP",optional:["csp","css","hpkp","hsts","javascript","json","markup","uri"],owner:"danielgtaylor"},hpkp:{title:"HTTP Public-Key-Pins",owner:"ScottHelme"},hsts:{title:"HTTP Strict-Transport-Security",owner:"ScottHelme"},ichigojam:{title:"IchigoJam",owner:"BlueCocoa"},icon:{title:"Icon",owner:"Golmote"},"icu-message-format":{title:"ICU Message Format",owner:"RunDevelopment"},idris:{title:"Idris",alias:"idr",owner:"KeenS",require:"haskell"},ignore:{title:".ignore",owner:"osipxd",alias:["gitignore","hgignore","npmignore"],aliasTitles:{gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore"}},inform7:{title:"Inform 7",owner:"Golmote"},ini:{title:"Ini",owner:"aviaryan"},io:{title:"Io",owner:"AlesTsurko"},j:{title:"J",owner:"Golmote"},java:{title:"Java",require:"clike",owner:"sherblot"},javadoc:{title:"JavaDoc",require:["markup","java","javadoclike"],modify:"java",optional:"scala",owner:"RunDevelopment"},javadoclike:{title:"JavaDoc-like",modify:["java","javascript","php"],owner:"RunDevelopment"},javastacktrace:{title:"Java stack trace",owner:"RunDevelopment"},jexl:{title:"Jexl",owner:"czosel"},jolie:{title:"Jolie",require:"clike",owner:"thesave"},jq:{title:"JQ",owner:"RunDevelopment"},jsdoc:{title:"JSDoc",require:["javascript","javadoclike","typescript"],modify:"javascript",optional:["actionscript","coffeescript"],owner:"RunDevelopment"},"js-extras":{title:"JS Extras",require:"javascript",modify:"javascript",optional:["actionscript","coffeescript","flow","n4js","typescript"],owner:"RunDevelopment"},json:{title:"JSON",alias:"webmanifest",aliasTitles:{webmanifest:"Web App Manifest"},owner:"CupOfTea696"},json5:{title:"JSON5",require:"json",owner:"RunDevelopment"},jsonp:{title:"JSONP",require:"json",owner:"RunDevelopment"},jsstacktrace:{title:"JS stack trace",owner:"sbrl"},"js-templates":{title:"JS Templates",require:"javascript",modify:"javascript",optional:["css","css-extras","graphql","markdown","markup","sql"],owner:"RunDevelopment"},julia:{title:"Julia",owner:"cdagnino"},keepalived:{title:"Keepalived Configure",owner:"dev-itsheng"},keyman:{title:"Keyman",owner:"mcdurdin"},kotlin:{title:"Kotlin",alias:["kt","kts"],aliasTitles:{kts:"Kotlin Script"},require:"clike",owner:"Golmote"},kumir:{title:"KuMir (\u041a\u0443\u041c\u0438\u0440)",alias:"kum",owner:"edukisto"},kusto:{title:"Kusto",owner:"RunDevelopment"},latex:{title:"LaTeX",alias:["tex","context"],aliasTitles:{tex:"TeX",context:"ConTeXt"},owner:"japborst"},latte:{title:"Latte",require:["clike","markup-templating","php"],owner:"nette"},less:{title:"Less",require:"css",optional:"css-extras",owner:"Golmote"},lilypond:{title:"LilyPond",require:"scheme",alias:"ly",owner:"RunDevelopment"},liquid:{title:"Liquid",require:"markup-templating",owner:"cinhtau"},lisp:{title:"Lisp",alias:["emacs","elisp","emacs-lisp"],owner:"JuanCaicedo"},livescript:{title:"LiveScript",owner:"Golmote"},llvm:{title:"LLVM IR",owner:"porglezomp"},log:{title:"Log file",optional:"javastacktrace",owner:"RunDevelopment"},lolcode:{title:"LOLCODE",owner:"Golmote"},lua:{title:"Lua",owner:"Golmote"},magma:{title:"Magma (CAS)",owner:"RunDevelopment"},makefile:{title:"Makefile",owner:"Golmote"},markdown:{title:"Markdown",require:"markup",optional:"yaml",alias:"md",owner:"Golmote"},"markup-templating":{title:"Markup templating",require:"markup",owner:"Golmote"},mata:{title:"Mata",owner:"RunDevelopment"},matlab:{title:"MATLAB",owner:"Golmote"},maxscript:{title:"MAXScript",owner:"RunDevelopment"},mel:{title:"MEL",owner:"Golmote"},mermaid:{title:"Mermaid",owner:"RunDevelopment"},metafont:{title:"METAFONT",owner:"LaeriExNihilo"},mizar:{title:"Mizar",owner:"Golmote"},mongodb:{title:"MongoDB",owner:"airs0urce",require:"javascript"},monkey:{title:"Monkey",owner:"Golmote"},moonscript:{title:"MoonScript",alias:"moon",owner:"RunDevelopment"},n1ql:{title:"N1QL",owner:"TMWilds"},n4js:{title:"N4JS",require:"javascript",optional:"jsdoc",alias:"n4jsd",owner:"bsmith-n4"},"nand2tetris-hdl":{title:"Nand To Tetris HDL",owner:"stephanmax"},naniscript:{title:"Naninovel Script",owner:"Elringus",alias:"nani"},nasm:{title:"NASM",owner:"rbmj"},neon:{title:"NEON",owner:"nette"},nevod:{title:"Nevod",owner:"nezaboodka"},nginx:{title:"nginx",owner:"volado"},nim:{title:"Nim",owner:"Golmote"},nix:{title:"Nix",owner:"Golmote"},nsis:{title:"NSIS",owner:"idleberg"},objectivec:{title:"Objective-C",require:"c",alias:"objc",owner:"uranusjr"},ocaml:{title:"OCaml",owner:"Golmote"},odin:{title:"Odin",owner:"edukisto"},opencl:{title:"OpenCL",require:"c",modify:["c","cpp"],owner:"Milania1"},openqasm:{title:"OpenQasm",alias:"qasm",owner:"RunDevelopment"},oz:{title:"Oz",owner:"Golmote"},parigp:{title:"PARI/GP",owner:"Golmote"},parser:{title:"Parser",require:"markup",owner:"Golmote"},pascal:{title:"Pascal",alias:"objectpascal",aliasTitles:{objectpascal:"Object Pascal"},owner:"Golmote"},pascaligo:{title:"Pascaligo",owner:"DefinitelyNotAGoat"},psl:{title:"PATROL Scripting Language",owner:"bertysentry"},pcaxis:{title:"PC-Axis",alias:"px",owner:"RunDevelopment"},peoplecode:{title:"PeopleCode",alias:"pcode",owner:"RunDevelopment"},perl:{title:"Perl",owner:"Golmote"},php:{title:"PHP",require:"markup-templating",owner:"milesj"},phpdoc:{title:"PHPDoc",require:["php","javadoclike"],modify:"php",owner:"RunDevelopment"},"php-extras":{title:"PHP Extras",require:"php",modify:"php",owner:"milesj"},"plant-uml":{title:"PlantUML",alias:"plantuml",owner:"RunDevelopment"},plsql:{title:"PL/SQL",require:"sql",owner:"Golmote"},powerquery:{title:"PowerQuery",alias:["pq","mscript"],owner:"peterbud"},powershell:{title:"PowerShell",owner:"nauzilus"},processing:{title:"Processing",require:"clike",owner:"Golmote"},prolog:{title:"Prolog",owner:"Golmote"},promql:{title:"PromQL",owner:"arendjr"},properties:{title:".properties",owner:"Golmote"},protobuf:{title:"Protocol Buffers",require:"clike",owner:"just-boris"},pug:{title:"Pug",require:["markup","javascript"],optional:["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],owner:"Golmote"},puppet:{title:"Puppet",owner:"Golmote"},pure:{title:"Pure",optional:["c","cpp","fortran"],owner:"Golmote"},purebasic:{title:"PureBasic",require:"clike",alias:"pbfasm",owner:"HeX0R101"},purescript:{title:"PureScript",require:"haskell",alias:"purs",owner:"sriharshachilakapati"},python:{title:"Python",alias:"py",owner:"multipetros"},qsharp:{title:"Q#",require:"clike",alias:"qs",owner:"fedonman"},q:{title:"Q (kdb+ database)",owner:"Golmote"},qml:{title:"QML",require:"javascript",owner:"RunDevelopment"},qore:{title:"Qore",require:"clike",owner:"temnroegg"},r:{title:"R",owner:"Golmote"},racket:{title:"Racket",require:"scheme",alias:"rkt",owner:"RunDevelopment"},cshtml:{title:"Razor C#",alias:"razor",require:["markup","csharp"],optional:["css","css-extras","javascript","js-extras"],owner:"RunDevelopment"},jsx:{title:"React JSX",require:["markup","javascript"],optional:["jsdoc","js-extras","js-templates"],owner:"vkbansal"},tsx:{title:"React TSX",require:["jsx","typescript"]},reason:{title:"Reason",require:"clike",owner:"Golmote"},regex:{title:"Regex",owner:"RunDevelopment"},rego:{title:"Rego",owner:"JordanSh"},renpy:{title:"Ren'py",alias:"rpy",owner:"HyuchiaDiego"},rescript:{title:"ReScript",alias:"res",owner:"vmarcosp"},rest:{title:"reST (reStructuredText)",owner:"Golmote"},rip:{title:"Rip",owner:"ravinggenius"},roboconf:{title:"Roboconf",owner:"Golmote"},robotframework:{title:"Robot Framework",alias:"robot",owner:"RunDevelopment"},ruby:{title:"Ruby",require:"clike",alias:"rb",owner:"samflores"},rust:{title:"Rust",owner:"Golmote"},sas:{title:"SAS",optional:["groovy","lua","sql"],owner:"Golmote"},sass:{title:"Sass (Sass)",require:"css",optional:"css-extras",owner:"Golmote"},scss:{title:"Sass (SCSS)",require:"css",optional:"css-extras",owner:"MoOx"},scala:{title:"Scala",require:"java",owner:"jozic"},scheme:{title:"Scheme",owner:"bacchus123"},"shell-session":{title:"Shell session",require:"bash",alias:["sh-session","shellsession"],owner:"RunDevelopment"},smali:{title:"Smali",owner:"RunDevelopment"},smalltalk:{title:"Smalltalk",owner:"Golmote"},smarty:{title:"Smarty",require:"markup-templating",optional:"php",owner:"Golmote"},sml:{title:"SML",alias:"smlnj",aliasTitles:{smlnj:"SML/NJ"},owner:"RunDevelopment"},solidity:{title:"Solidity (Ethereum)",alias:"sol",require:"clike",owner:"glachaud"},"solution-file":{title:"Solution file",alias:"sln",owner:"RunDevelopment"},soy:{title:"Soy (Closure Template)",require:"markup-templating",owner:"Golmote"},sparql:{title:"SPARQL",require:"turtle",owner:"Triply-Dev",alias:"rq"},"splunk-spl":{title:"Splunk SPL",owner:"RunDevelopment"},sqf:{title:"SQF: Status Quo Function (Arma 3)",require:"clike",owner:"RunDevelopment"},sql:{title:"SQL",owner:"multipetros"},squirrel:{title:"Squirrel",require:"clike",owner:"RunDevelopment"},stan:{title:"Stan",owner:"RunDevelopment"},stata:{title:"Stata Ado",require:["mata","java","python"],owner:"RunDevelopment"},iecst:{title:"Structured Text (IEC 61131-3)",owner:"serhioromano"},stylus:{title:"Stylus",owner:"vkbansal"},supercollider:{title:"SuperCollider",alias:"sclang",owner:"RunDevelopment"},swift:{title:"Swift",owner:"chrischares"},systemd:{title:"Systemd configuration file",owner:"RunDevelopment"},"t4-templating":{title:"T4 templating",owner:"RunDevelopment"},"t4-cs":{title:"T4 Text Templates (C#)",require:["t4-templating","csharp"],alias:"t4",owner:"RunDevelopment"},"t4-vb":{title:"T4 Text Templates (VB)",require:["t4-templating","vbnet"],owner:"RunDevelopment"},tap:{title:"TAP",owner:"isaacs",require:"yaml"},tcl:{title:"Tcl",owner:"PeterChaplin"},tt2:{title:"Template Toolkit 2",require:["clike","markup-templating"],owner:"gflohr"},textile:{title:"Textile",require:"markup",optional:"css",owner:"Golmote"},toml:{title:"TOML",owner:"RunDevelopment"},tremor:{title:"Tremor",alias:["trickle","troy"],owner:"darach",aliasTitles:{trickle:"trickle",troy:"troy"}},turtle:{title:"Turtle",alias:"trig",aliasTitles:{trig:"TriG"},owner:"jakubklimek"},twig:{title:"Twig",require:"markup-templating",owner:"brandonkelly"},typescript:{title:"TypeScript",require:"javascript",optional:"js-templates",alias:"ts",owner:"vkbansal"},typoscript:{title:"TypoScript",alias:"tsconfig",aliasTitles:{tsconfig:"TSConfig"},owner:"dkern"},unrealscript:{title:"UnrealScript",alias:["uscript","uc"],owner:"RunDevelopment"},uorazor:{title:"UO Razor Script",owner:"jaseowns"},uri:{title:"URI",alias:"url",aliasTitles:{url:"URL"},owner:"RunDevelopment"},v:{title:"V",require:"clike",owner:"taggon"},vala:{title:"Vala",require:"clike",optional:"regex",owner:"TemplarVolk"},vbnet:{title:"VB.Net",require:"basic",owner:"Bigsby"},velocity:{title:"Velocity",require:"markup",owner:"Golmote"},verilog:{title:"Verilog",owner:"a-rey"},vhdl:{title:"VHDL",owner:"a-rey"},vim:{title:"vim",owner:"westonganger"},"visual-basic":{title:"Visual Basic",alias:["vb","vba"],aliasTitles:{vba:"VBA"},owner:"Golmote"},warpscript:{title:"WarpScript",owner:"RunDevelopment"},wasm:{title:"WebAssembly",owner:"Golmote"},"web-idl":{title:"Web IDL",alias:"webidl",owner:"RunDevelopment"},wgsl:{title:"WGSL",owner:"Dr4gonthree"},wiki:{title:"Wiki markup",require:"markup",owner:"Golmote"},wolfram:{title:"Wolfram language",alias:["mathematica","nb","wl"],aliasTitles:{mathematica:"Mathematica",nb:"Mathematica Notebook"},owner:"msollami"},wren:{title:"Wren",owner:"clsource"},xeora:{title:"Xeora",require:"markup",alias:"xeoracube",aliasTitles:{xeoracube:"XeoraCube"},owner:"freakmaxi"},"xml-doc":{title:"XML doc (.net)",require:"markup",modify:["csharp","fsharp","vbnet"],owner:"RunDevelopment"},xojo:{title:"Xojo (REALbasic)",owner:"Golmote"},xquery:{title:"XQuery",require:"markup",owner:"Golmote"},yaml:{title:"YAML",alias:"yml",owner:"hason"},yang:{title:"YANG",owner:"RunDevelopment"},zig:{title:"Zig",owner:"RunDevelopment"}},plugins:{meta:{path:"plugins/{id}/prism-{id}",link:"plugins/{id}/"},"line-highlight":{title:"Line Highlight",description:"Highlights specific lines and/or line ranges."},"line-numbers":{title:"Line Numbers",description:"Line number at the beginning of code lines.",owner:"kuba-kubula"},"show-invisibles":{title:"Show Invisibles",description:"Show hidden characters such as tabs and line breaks.",optional:["autolinker","data-uri-highlight"]},autolinker:{title:"Autolinker",description:"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},wpd:{title:"WebPlatform Docs",description:'Makes tokens link to WebPlatform.org documentation. The links open in a new tab.'},"custom-class":{title:"Custom Class",description:"This plugin allows you to prefix Prism's default classes (.comment can become .namespace--comment) or replace them with your defined ones (like .editor__comment). You can even add new classes.",owner:"dvkndn",noCSS:!0},"file-highlight":{title:"File Highlight",description:"Fetch external files and highlight them with Prism. Used on the Prism website itself.",noCSS:!0},"show-language":{title:"Show Language",description:"Display the highlighted language in code blocks (inline code does not show the label).",owner:"nauzilus",noCSS:!0,require:"toolbar"},"jsonp-highlight":{title:"JSONP Highlight",description:"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",noCSS:!0,owner:"nauzilus"},"highlight-keywords":{title:"Highlight Keywords",description:"Adds special CSS classes for each keyword for fine-grained highlighting.",owner:"vkbansal",noCSS:!0},"remove-initial-line-feed":{title:"Remove initial line feed",description:"Removes the initial line feed in code blocks.",owner:"Golmote",noCSS:!0},"inline-color":{title:"Inline color",description:"Adds a small inline preview for colors in style sheets.",require:"css-extras",owner:"RunDevelopment"},previewers:{title:"Previewers",description:"Previewers for angles, colors, gradients, easing and time.",require:"css-extras",owner:"Golmote"},autoloader:{title:"Autoloader",description:"Automatically loads the needed languages to highlight the code blocks.",owner:"Golmote",noCSS:!0},"keep-markup":{title:"Keep Markup",description:"Prevents custom markup from being dropped out during highlighting.",owner:"Golmote",optional:"normalize-whitespace",noCSS:!0},"command-line":{title:"Command Line",description:"Display a command line with a prompt and, optionally, the output/response from the commands.",owner:"chriswells0"},"unescaped-markup":{title:"Unescaped Markup",description:"Write markup without having to escape anything."},"normalize-whitespace":{title:"Normalize Whitespace",description:"Supports multiple operations to normalize whitespace in code blocks.",owner:"zeitgeist87",optional:"unescaped-markup",noCSS:!0},"data-uri-highlight":{title:"Data-URI Highlight",description:"Highlights data-URI contents.",owner:"Golmote",noCSS:!0},toolbar:{title:"Toolbar",description:"Attach a toolbar for plugins to easily register buttons on the top of a code block.",owner:"mAAdhaTTah"},"copy-to-clipboard":{title:"Copy to Clipboard Button",description:"Add a button that copies the code block to the clipboard when clicked.",owner:"mAAdhaTTah",require:"toolbar",noCSS:!0},"download-button":{title:"Download Button",description:"A button in the toolbar of a code block adding a convenient way to download a code file.",owner:"Golmote",require:"toolbar",noCSS:!0},"match-braces":{title:"Match braces",description:"Highlights matching braces.",owner:"RunDevelopment"},"diff-highlight":{title:"Diff Highlight",description:"Highlights the code inside diff blocks.",owner:"RunDevelopment",require:"diff"},"filter-highlight-all":{title:"Filter highlightAll",description:"Filters the elements the highlightAll and highlightAllUnder methods actually highlight.",owner:"RunDevelopment",noCSS:!0},treeview:{title:"Treeview",description:"A language with special styles to highlight file system tree structures.",owner:"Golmote"}}})},2885:(e,t,n)=>{const r=n(9901),a=n(9642),o=new Set;function i(e){void 0===e?e=Object.keys(r.languages).filter((e=>"meta"!=e)):Array.isArray(e)||(e=[e]);const t=[...o,...Object.keys(Prism.languages)];a(r,e,t).load((e=>{if(!(e in r.languages))return void(i.silent||console.warn("Language does not exist: "+e));const t="./prism-"+e;delete n.c[n(6500).resolve(t)],delete Prism.languages[e],n(6500)(t),o.add(e)}))}i.silent=!1,e.exports=i},6854:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,o){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof o&&!o(e))return e;for(var a,l=i.length;-1!==n.code.indexOf(a=t(r,l));)++l;return i[l]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var a=0,o=Object.keys(n.tokenStack);!function i(l){for(var s=0;s=o.length);s++){var u=l[s];if("string"==typeof u||u.content&&"string"==typeof u.content){var c=o[a],d=n.tokenStack[c],f="string"==typeof u?u:u.content,p=t(r,c),m=f.indexOf(p);if(m>-1){++a;var h=f.substring(0,m),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),v=f.substring(m+p.length),y=[];h&&y.push.apply(y,i([h])),y.push(g),v&&y.push.apply(y,i([v])),"string"==typeof u?l.splice.apply(l,[s,1].concat(y)):u.content=y}}else u.content&&i(u.content)}return l}(n.tokens)}}}})}(Prism)},6726:(e,t,n)=>{var r={"./":2885};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=6726},6500:(e,t,n)=>{var r={"./":2885};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=6500},9642:e=>{"use strict";var t=function(){var e=function(){};function t(e,t){Array.isArray(e)?e.forEach(t):null!=e&&t(e,0)}function n(e){for(var t={},n=0,r=e.length;n "));var l={},s=e[r];if(s){function u(t){if(!(t in e))throw new Error(r+" depends on an unknown component "+t);if(!(t in l))for(var i in a(t,o),l[t]=!0,n[t])l[i]=!0}t(s.require,u),t(s.optional,u),t(s.modify,u)}n[r]=l,o.pop()}}return function(e){var t=n[e];return t||(a(e,r),t=n[e]),t}}function a(e){for(var t in e)return!0;return!1}return function(o,i,l){var s=function(e){var t={};for(var n in e){var r=e[n];for(var a in r)if("meta"!=a){var o=r[a];t[a]="string"==typeof o?{title:o}:o}}return t}(o),u=function(e){var n;return function(r){if(r in e)return r;if(!n)for(var a in n={},e){var o=e[a];t(o&&o.alias,(function(t){if(t in n)throw new Error(t+" cannot be alias for both "+a+" and "+n[t]);if(t in e)throw new Error(t+" cannot be alias of "+a+" because it is a component.");n[t]=a}))}return n[r]||r}}(s);i=i.map(u),l=(l||[]).map(u);var c=n(i),d=n(l);i.forEach((function e(n){var r=s[n];t(r&&r.require,(function(t){t in d||(c[t]=!0,e(t))}))}));for(var f,p=r(s),m=c;a(m);){for(var h in f={},m){var g=s[h];t(g&&g.modify,(function(e){e in d&&(f[e]=!0)}))}for(var v in d)if(!(v in c))for(var y in p(v))if(y in c){f[v]=!0;break}for(var b in m=f)c[b]=!0}var w={getIds:function(){var e=[];return w.load((function(t){e.push(t)})),e},load:function(t,n){return function(t,n,r,a){var o=a?a.series:void 0,i=a?a.parallel:e,l={},s={};function u(e){if(e in l)return l[e];s[e]=!0;var a,c=[];for(var d in t(e))d in n&&c.push(d);if(0===c.length)a=r(e);else{var f=i(c.map((function(e){var t=u(e);return delete s[e],t})));o?a=o(f,(function(){return r(e)})):r(e)}return l[e]=a}for(var c in n)u(c);var d=[];for(var f in s)d.push(l[f]);return i(d)}(p,c,t,n)}};return w}}();e.exports=t},2703:(e,t,n)=>{"use strict";var r=n(414);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4448:(e,t,n)=>{"use strict";var r=n(7294),a=n(3840);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n

    Page Not Found

    We could not find what you were looking for.

    Please contact the owner of the site that linked you to the original URL and let them know their link is broken.