stargazer-ui 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseTypes.d.ts +15 -0
- package/dist/BaseTypes.js +1 -0
- package/dist/Button/index.d.ts +9 -0
- package/dist/Button/index.js +6 -0
- package/dist/Card/index.d.ts +92 -0
- package/dist/Card/index.js +18 -0
- package/dist/CloseButton/index.d.ts +8 -0
- package/dist/CloseButton/index.js +6 -0
- package/dist/Dropdown/index.d.ts +108 -0
- package/dist/Dropdown/index.js +204 -0
- package/dist/FloatingLabel/index.js +13 -0
- package/dist/Form/index.d.ts +61 -0
- package/dist/Form/index.js +62 -0
- package/dist/InputGroup/index.js +7 -0
- package/dist/Modal/index.js +85 -0
- package/dist/Nav/index.js +14 -0
- package/dist/NavBar/index.js +16 -0
- package/dist/NavDropdown/index.js +850 -0
- package/dist/Overlay/index.js +125 -0
- package/dist/Popout/index.js +85 -0
- package/dist/Tabs/index.js +69 -0
- package/dist/ToggleButton/index.js +11 -0
- package/dist/main.js +30 -0
- package/dist/stylesheets/stargazerui.css +113 -62
- package/dist/stylesheets/stargazerui.css.map +1 -1
- package/dist/vite-env.d.js +1 -0
- package/package.json +22 -12
- package/dist/ui.es.js +0 -1983
- package/dist/ui.umd.js +0 -33
package/dist/ui.umd.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
(function(T,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],c):(T=typeof globalThis<"u"?globalThis:T||self,c(T.ui={},T.React,T.ReactDOM))})(this,function(T,c,tt){"use strict";var $e={exports:{}},ie={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var rt;function Xt(){if(rt)return ie;rt=1;var e=c,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function u(a,f,g){var v,p={},m=null,E=null;g!==void 0&&(m=""+g),f.key!==void 0&&(m=""+f.key),f.ref!==void 0&&(E=f.ref);for(v in f)n.call(f,v)&&!i.hasOwnProperty(v)&&(p[v]=f[v]);if(a&&a.defaultProps)for(v in f=a.defaultProps,f)p[v]===void 0&&(p[v]=f[v]);return{$$typeof:t,type:a,key:m,ref:E,props:p,_owner:s.current}}return ie.Fragment=r,ie.jsx=u,ie.jsxs=u,ie}var ae={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var nt;function Jt(){return nt||(nt=1,process.env.NODE_ENV!=="production"&&function(){var e=c,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),a=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),x=Symbol.iterator,w="@@iterator";function y(o){if(o===null||typeof o!="object")return null;var l=x&&o[x]||o[w];return typeof l=="function"?l:null}var j=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(o){{for(var l=arguments.length,h=new Array(l>1?l-1:0),b=1;b<l;b++)h[b-1]=arguments[b];R("error",o,h)}}function R(o,l,h){{var b=j.ReactDebugCurrentFrame,P=b.getStackAddendum();P!==""&&(l+="%s",h=h.concat([P]));var O=h.map(function(S){return String(S)});O.unshift("Warning: "+l),Function.prototype.apply.call(console[o],console,O)}}var I=!1,z=!1,Q=!1,B=!1,L=!1,V;V=Symbol.for("react.module.reference");function He(o){return!!(typeof o=="string"||typeof o=="function"||o===n||o===i||L||o===s||o===g||o===v||B||o===E||I||z||Q||typeof o=="object"&&o!==null&&(o.$$typeof===m||o.$$typeof===p||o.$$typeof===u||o.$$typeof===a||o.$$typeof===f||o.$$typeof===V||o.getModuleId!==void 0))}function xn(o,l,h){var b=o.displayName;if(b)return b;var P=l.displayName||l.name||"";return P!==""?h+"("+P+")":h}function Pt(o){return o.displayName||"Context"}function U(o){if(o==null)return null;if(typeof o.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case n:return"Fragment";case r:return"Portal";case i:return"Profiler";case s:return"StrictMode";case g:return"Suspense";case v:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case a:var l=o;return Pt(l)+".Consumer";case u:var h=o;return Pt(h._context)+".Provider";case f:return xn(o,o.render,"ForwardRef");case p:var b=o.displayName||null;return b!==null?b:U(o.type)||"Memo";case m:{var P=o,O=P._payload,S=P._init;try{return U(S(O))}catch{return null}}}return null}var ee=Object.assign,pe=0,Ot,Tt,kt,$t,Dt,Ft,It;function At(){}At.__reactDisabledLog=!0;function jn(){{if(pe===0){Ot=console.log,Tt=console.info,kt=console.warn,$t=console.error,Dt=console.group,Ft=console.groupCollapsed,It=console.groupEnd;var o={configurable:!0,enumerable:!0,value:At,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}pe++}}function Sn(){{if(pe--,pe===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ee({},o,{value:Ot}),info:ee({},o,{value:Tt}),warn:ee({},o,{value:kt}),error:ee({},o,{value:$t}),group:ee({},o,{value:Dt}),groupCollapsed:ee({},o,{value:Ft}),groupEnd:ee({},o,{value:It})})}pe<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var qe=j.ReactCurrentDispatcher,Ge;function Se(o,l,h){{if(Ge===void 0)try{throw Error()}catch(P){var b=P.stack.trim().match(/\n( *(at )?)/);Ge=b&&b[1]||""}return`
|
|
18
|
-
`+Ge+o}}var Ke=!1,Pe;{var Pn=typeof WeakMap=="function"?WeakMap:Map;Pe=new Pn}function Nt(o,l){if(!o||Ke)return"";{var h=Pe.get(o);if(h!==void 0)return h}var b;Ke=!0;var P=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var O;O=qe.current,qe.current=null,jn();try{if(l){var S=function(){throw Error()};if(Object.defineProperty(S.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(S,[])}catch(H){b=H}Reflect.construct(o,[],S)}else{try{S.call()}catch(H){b=H}o.call(S.prototype)}}else{try{throw Error()}catch(H){b=H}o()}}catch(H){if(H&&b&&typeof H.stack=="string"){for(var C=H.stack.split(`
|
|
19
|
-
`),D=b.stack.split(`
|
|
20
|
-
`),k=C.length-1,$=D.length-1;k>=1&&$>=0&&C[k]!==D[$];)$--;for(;k>=1&&$>=0;k--,$--)if(C[k]!==D[$]){if(k!==1||$!==1)do if(k--,$--,$<0||C[k]!==D[$]){var M=`
|
|
21
|
-
`+C[k].replace(" at new "," at ");return o.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",o.displayName)),typeof o=="function"&&Pe.set(o,M),M}while(k>=1&&$>=0);break}}}finally{Ke=!1,qe.current=O,Sn(),Error.prepareStackTrace=P}var se=o?o.displayName||o.name:"",Kt=se?Se(se):"";return typeof o=="function"&&Pe.set(o,Kt),Kt}function On(o,l,h){return Nt(o,!1)}function Tn(o){var l=o.prototype;return!!(l&&l.isReactComponent)}function Oe(o,l,h){if(o==null)return"";if(typeof o=="function")return Nt(o,Tn(o));if(typeof o=="string")return Se(o);switch(o){case g:return Se("Suspense");case v:return Se("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case f:return On(o.render);case p:return Oe(o.type,l,h);case m:{var b=o,P=b._payload,O=b._init;try{return Oe(O(P),l,h)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,Rt={},Mt=j.ReactDebugCurrentFrame;function ke(o){if(o){var l=o._owner,h=Oe(o.type,o._source,l?l.type:null);Mt.setExtraStackFrame(h)}else Mt.setExtraStackFrame(null)}function kn(o,l,h,b,P){{var O=Function.call.bind(Te);for(var S in o)if(O(o,S)){var C=void 0;try{if(typeof o[S]!="function"){var D=Error((b||"React class")+": "+h+" type `"+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[S]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D.name="Invariant Violation",D}C=o[S](l,S,b,h,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(k){C=k}C&&!(C instanceof Error)&&(ke(P),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",b||"React class",h,S,typeof C),ke(null)),C instanceof Error&&!(C.message in Rt)&&(Rt[C.message]=!0,ke(P),_("Failed %s type: %s",h,C.message),ke(null))}}}var $n=Array.isArray;function Xe(o){return $n(o)}function Dn(o){{var l=typeof Symbol=="function"&&Symbol.toStringTag,h=l&&o[Symbol.toStringTag]||o.constructor.name||"Object";return h}}function Fn(o){try{return zt(o),!1}catch{return!0}}function zt(o){return""+o}function Bt(o){if(Fn(o))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Dn(o)),zt(o)}var me=j.ReactCurrentOwner,In={key:!0,ref:!0,__self:!0,__source:!0},Wt,Lt,Je;Je={};function An(o){if(Te.call(o,"ref")){var l=Object.getOwnPropertyDescriptor(o,"ref").get;if(l&&l.isReactWarning)return!1}return o.ref!==void 0}function Nn(o){if(Te.call(o,"key")){var l=Object.getOwnPropertyDescriptor(o,"key").get;if(l&&l.isReactWarning)return!1}return o.key!==void 0}function Rn(o,l){if(typeof o.ref=="string"&&me.current&&l&&me.current.stateNode!==l){var h=U(me.current.type);Je[h]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',U(me.current.type),o.ref),Je[h]=!0)}}function Mn(o,l){{var h=function(){Wt||(Wt=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",l))};h.isReactWarning=!0,Object.defineProperty(o,"key",{get:h,configurable:!0})}}function zn(o,l){{var h=function(){Lt||(Lt=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",l))};h.isReactWarning=!0,Object.defineProperty(o,"ref",{get:h,configurable:!0})}}var Bn=function(o,l,h,b,P,O,S){var C={$$typeof:t,type:o,key:l,ref:h,props:S,_owner:O};return C._store={},Object.defineProperty(C._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(C,"_self",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.defineProperty(C,"_source",{configurable:!1,enumerable:!1,writable:!1,value:P}),Object.freeze&&(Object.freeze(C.props),Object.freeze(C)),C};function Wn(o,l,h,b,P){{var O,S={},C=null,D=null;h!==void 0&&(Bt(h),C=""+h),Nn(l)&&(Bt(l.key),C=""+l.key),An(l)&&(D=l.ref,Rn(l,P));for(O in l)Te.call(l,O)&&!In.hasOwnProperty(O)&&(S[O]=l[O]);if(o&&o.defaultProps){var k=o.defaultProps;for(O in k)S[O]===void 0&&(S[O]=k[O])}if(C||D){var $=typeof o=="function"?o.displayName||o.name||"Unknown":o;C&&Mn(S,$),D&&zn(S,$)}return Bn(o,C,D,P,b,me.current,S)}}var Ze=j.ReactCurrentOwner,Yt=j.ReactDebugCurrentFrame;function oe(o){if(o){var l=o._owner,h=Oe(o.type,o._source,l?l.type:null);Yt.setExtraStackFrame(h)}else Yt.setExtraStackFrame(null)}var Qe;Qe=!1;function et(o){return typeof o=="object"&&o!==null&&o.$$typeof===t}function Vt(){{if(Ze.current){var o=U(Ze.current.type);if(o)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+o+"`."}return""}}function Ln(o){{if(o!==void 0){var l=o.fileName.replace(/^.*[\\\/]/,""),h=o.lineNumber;return`
|
|
24
|
-
|
|
25
|
-
Check your code at `+l+":"+h+"."}return""}}var Ut={};function Yn(o){{var l=Vt();if(!l){var h=typeof o=="string"?o:o.displayName||o.name;h&&(l=`
|
|
26
|
-
|
|
27
|
-
Check the top-level render call using <`+h+">.")}return l}}function Ht(o,l){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var h=Yn(l);if(Ut[h])return;Ut[h]=!0;var b="";o&&o._owner&&o._owner!==Ze.current&&(b=" It was passed a child from "+U(o._owner.type)+"."),oe(o),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',h,b),oe(null)}}function qt(o,l){{if(typeof o!="object")return;if(Xe(o))for(var h=0;h<o.length;h++){var b=o[h];et(b)&&Ht(b,l)}else if(et(o))o._store&&(o._store.validated=!0);else if(o){var P=y(o);if(typeof P=="function"&&P!==o.entries)for(var O=P.call(o),S;!(S=O.next()).done;)et(S.value)&&Ht(S.value,l)}}}function Vn(o){{var l=o.type;if(l==null||typeof l=="string")return;var h;if(typeof l=="function")h=l.propTypes;else if(typeof l=="object"&&(l.$$typeof===f||l.$$typeof===p))h=l.propTypes;else return;if(h){var b=U(l);kn(h,o.props,"prop",b,o)}else if(l.PropTypes!==void 0&&!Qe){Qe=!0;var P=U(l);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",P||"Unknown")}typeof l.getDefaultProps=="function"&&!l.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Un(o){{for(var l=Object.keys(o.props),h=0;h<l.length;h++){var b=l[h];if(b!=="children"&&b!=="key"){oe(o),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),oe(null);break}}o.ref!==null&&(oe(o),_("Invalid attribute `ref` supplied to `React.Fragment`."),oe(null))}}function Gt(o,l,h,b,P,O){{var S=He(o);if(!S){var C="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(C+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var D=Ln(P);D?C+=D:C+=Vt();var k;o===null?k="null":Xe(o)?k="array":o!==void 0&&o.$$typeof===t?(k="<"+(U(o.type)||"Unknown")+" />",C=" Did you accidentally export a JSX literal instead of a component?"):k=typeof o,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",k,C)}var $=Wn(o,l,h,P,O);if($==null)return $;if(S){var M=l.children;if(M!==void 0)if(b)if(Xe(M)){for(var se=0;se<M.length;se++)qt(M[se],o);Object.freeze&&Object.freeze(M)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else qt(M,o)}return o===n?Un($):Vn($),$}}function Hn(o,l,h){return Gt(o,l,h,!0)}function qn(o,l,h){return Gt(o,l,h,!1)}var Gn=qn,Kn=Hn;ae.Fragment=n,ae.jsx=Gn,ae.jsxs=Kn}()),ae}process.env.NODE_ENV==="production"?$e.exports=Xt():$e.exports=Jt();var d=$e.exports;const ot=c.forwardRef(({variant:e="primary",children:t,className:r,...n},s)=>d.jsx("button",{ref:s,type:"button",className:`sg-button sg-button-${e}${r==null?"":" "+r}`,...n,children:t})),q=c.forwardRef(({children:e,className:t,...r},n)=>{let s=Object.keys(q),i=[],u=e.length===void 0?e:e.filter(a=>a!=null&&a!="");return s.forEach(a=>{c.Children.forEach(u,f=>f.type.name===a?i.push(f):null)}),i.length===0&&(i=[u]),d.jsx("div",{ref:n,className:"sg-card "+t,...r,children:i.map(a=>a)})}),Zt=c.forwardRef(({as:e,className:t,children:r,...n},s)=>{let u=["div","span","h1","h2","h3","h4","h5","h6"].find(a=>a===e)?e:"div";return d.jsx(u,{ref:s,className:`sg-card-header ${t}`,...n,children:r})});q.Header=Zt;const Qt=({children:e,className:t,...r},n)=>{e=e.length?e.filter(i=>i!=null&&i!=""):e;let s=[];return c.Children.forEach(e,i=>{s.push(i)}),d.jsx("div",{ref:n,className:`sg-card-body ${t}`,...r,children:s.map(i=>i)})};q.Body=c.forwardRef(Qt);const er=c.forwardRef(({as:e,className:t,children:r,...n},s)=>{let u=["h1","h2","h3","h4","h5","h6"].find(a=>a===e)?e:"h5";return d.jsx(u,{ref:s,className:t,...n,children:r})});q.Title=er;const tr=({children:e,className:t,...r},n)=>d.jsx("p",{ref:n,className:`sg-card-text ${t}`,...r,children:e});q.Text=c.forwardRef(tr);const rr=({children:e,className:t,...r},n)=>d.jsx("div",{ref:n,className:`sg-card-footer ${t}`,...r,children:e});q.Footer=c.forwardRef(rr);const st=c.forwardRef(({className:e,variant:t=!1,...r},n)=>d.jsx("button",{ref:n,className:`sg-button-close${t?" sg-button-close-white":""} ${e}`,...r,children:d.jsx("span",{className:"sg-close-visually-hidden-label",children:"Close"})})),nr=(e,t,r=!1)=>{const n=r?"top-end":"top-start",s=r?"top-start":"top-end",i=r?"bottom-end":"bottom-start",u=r?"bottom-start":"bottom-end",a=r?"right-start":"left-start",f=r?"right-end":"left-end",g=r?"left-start":"right-start",v=r?"left-end":"right-end";let p=e?u:i;return t==="up"?p=e?s:n:t==="end"?p=e?v:g:t==="start"?p=e?f:a:t==="down-centered"?p="bottom":t==="up-centered"&&(p="top"),p},it=(e,t="")=>{let r=e.target,n=!0,s=!1;for(;n;)r.id!=t+"-menu"?r=r.parentElement:(s=!0,n=!1),r.id==="root"&&(n=!1,s=!1);return s},he=c.createContext(null),or=({children:e,value:t,...r})=>d.jsx(he.Provider,{value:t,children:e}),W=c.forwardRef(({children:e,className:t,onSelect:r,onToggle:n,controlID:s,drop:i="down",align:u="start",autoClose:a=!0,show:f="default",...g},v)=>{const[p,m]=c.useState(f==="default"?!1:f),[E,x]=c.useState({case:""}),w=c.useCallback(R=>{R.stopPropagation(),m(I=>!I)},[]),j=nr(u==="end",i),_=c.useMemo(()=>({align:u,drop:i,showInternal:f!="default"&&n?f:p,handleToggle:f!="default"&&n?n:w,placement:j,directionClasses:{down:"dropdown","down-centered":"dropdown-center",up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"},controlID:s,activeDescendant:E,setActiveDescendant:x}),[u,i,f,p,n,w,j,s,E,x]);return d.jsx("div",{id:s+"-wrapper",ref:v,className:`sg-dropdown${t?" "+t:""}`,...g,children:d.jsx(or,{value:_,children:e})})}),sr=({children:e,className:t,navDropdown:r=!1,as:n="button",variant:s="primary",...i},u)=>{const{controlID:a,handleToggle:f,setActiveDescendant:g,showInternal:v}=c.useContext(he),p=n,m=y=>{let j=!1;switch(y.key){case"ArrowDown":j=!0,v?g(_=>({case:"next"})):(f(y),g(_=>({case:"first"})));break;case"ArrowUp":j=!0,v?g(_=>({case:"previous"})):(f(y),g(_=>({case:"last"})));break;case"Home":j=!0,v&&g(_=>({case:"first"}));break;case"End":j=!0,v&&g(_=>({case:"last"}));break;case"Escape":j=!0,v&&f(y);break;case"Enter":case" ":if(v){j=!0,document.querySelector(".sg-dropdown-item-visual-focus").click(),f(y);break}else{g(_=>({case:"first"}));break}}j&&(y.stopPropagation(),y.preventDefault())},E=y=>{v&&y.target.id!==a&&(it(y,a)?it(y,a)&&(f(y),document.getElementById(a).focus()):f(y))};c.useEffect(()=>{const y=document.getElementById(a);return y.addEventListener("keydown",m,!0),document.addEventListener("mouseup",E,!0),function(){y.removeEventListener("keydown",m,!0),document.removeEventListener("mouseup",E,!0)}},[m,a]);const x=y=>{f(y),v||g(j=>({case:"first"}))};let w=`sg-button sg-button${s?"-"+s:"-primary"} sg-dropdown-toggle${t?" "+t:""}`;return(p==="a"||r)&&(w=`sg-nav-dropdown-toggle sg-dropdown-toggle${t?" "+t:""}`),d.jsx(p,{tabIndex:"0",type:"button","aria-haspopup":"true","aria-controls":a+"-menu","aria-expanded":v,id:a,ref:u,className:w,onClick:y=>x(y),...i,children:e})};W.Toggle=c.forwardRef(sr);const ir=({children:e,className:t,style:r={},...n},s)=>{const{controlID:i,showInternal:u,activeDescendant:a}=c.useContext(he),[f,g]=c.useState(r);c.useLayoutEffect(()=>{if(u){const p=document.getElementById(i+"-menu");console.log(p);let m={};p.getBoundingClientRect().right>window.innerWidth?m={...m,right:0}:p.getBoundingClientRect().left<0?m={...m,left:0}:p.getBoundingClientRect().top<0?m={...m,top:0}:p.getBoundingClientRect().bottom>window.innerHeight&&(m={...m,bottom:0}),console.log(m),g(E=>({...E,...m}))}},[u]),c.useEffect(()=>{if(u){const p=document.getElementById(i+"-menu"),m=document.getElementById(i+"-menu").children,E=m.length-1,x=document.querySelector(".sg-dropdown-item-visual-focus");let w=0,y=m[0].children[0];if(x!=null){for(let j=0;j<m.length;j++)m[j]===x.parentElement&&(w=j);x.classList.remove("sg-dropdown-item-visual-focus")}switch(a.case){case"first":y=m[0].children[0],w=0;break;case"last":y=m[E].children[0],w=E;break;case"next":w=w===E?0:w+1,y=m[w].children[0];break;case"previous":w=w===0?E:w-1,y=m[w].children[0];break}p.setAttribute("aria-activedescendant",y.id),m[w].children[0].classList.add("sg-dropdown-item-visual-focus")}else document.getElementById(i+"-menu").setAttribute("aria-activedescendant","")},[i,u,a]);const v=p=>{const m=p.target;m.classList.contains("sg-dropdown-item-visual-focus")||(document.querySelector(".sg-dropdown-item-visual-focus").classList.remove("sg-dropdown-item-visual-focus"),m.classList.add("sg-dropdown-item-visual-focus"))};return c.useEffect(()=>{const p=document.getElementById(i+"-menu");for(let m of p.children)m.addEventListener("mouseover",v,!0);return function(){for(let E of p.children)E.removeEventListener("mouseover",v,!0)}},[]),d.jsx("ul",{id:i+"-menu",role:"menu",tabIndex:"-1","aria-labelledby":i,"aria-activedescendant":a,ref:s,className:`sg-dropdown-list${t?" "+t:""}${u?" show":""}`,style:f,...n,children:e})};W.Menu=c.forwardRef(ir);const ar=({children:e,as:t="button",className:r,...n},s)=>{const i=t;return d.jsx("li",{role:"none",children:d.jsx(i,{role:"menuitem",tabIndex:"-1",ref:s,className:`sg-dropdown-item${r?" "+r:""}`,...n,children:e})})};W.Item=c.forwardRef(ar);const ur=({className:e="",...t},r)=>d.jsx("hr",{className:`.sg-dropdown-divider${e}`,...t});W.Divider=c.forwardRef(ur);const ue=c.createContext(!1),cr=({children:e,value:t})=>d.jsx(ue.Provider,{value:t,children:e}),G=c.forwardRef(({children:e,...t},r)=>d.jsx("form",{ref:r,...t,children:e})),lr=({as:e="input",className:t="",plaintext:r=!1,id:n="",type:s="text",autoFocus:i=!1,...u},a)=>{let f=["input","textarea"].find(m=>m===e)?e:"input";const{controlId:g}=c.useContext(ue);let v=g||n,p=(r?"sg-form-control-plaintext":"sg-form-control")+(t!=""?" "+t:"")+(s=="color"?" sg-form-control-color":"");return d.jsx(f,{autoFocus:i,ref:a,id:v,type:s,className:p,...u})};G.Control=c.forwardRef(lr);const fr=({children:e,className:t,id:r,...n},s)=>{const{controlId:i}=c.useContext(ue);let u=i||r;return d.jsx("select",{ref:s,className:`sg-form-select${t?" "+t:""}`,id:u,...n,children:e})};G.Select=c.forwardRef(fr);const dr=({children:e,className:t,controlId:r,...n},s)=>{const i=c.useMemo(()=>({controlId:r}),[r]);return d.jsx("div",{ref:s,className:`sg-from-group${t?" "+t:""}`,...n,children:d.jsx(cr,{value:i,children:e})})};G.Group=c.forwardRef(dr);const pr=({children:e,className:t,htmlFor:r},n)=>{const{controlId:s}=c.useContext(ue);let i=r||s;return d.jsx("label",{ref:n,htmlFor:i,className:`sg-form-label${t?" "+t:""}`,children:e})};G.Label=c.forwardRef(pr);const mr=({classNameContainer:e,containerRef:t,containerId:r,style:n,classNameLabel:s,labelRef:i,label:u,labelId:a,className:f,type:g,id:v,controlId:p,reverse:m=!1,checkStyle:E,...x},w)=>{let y=p||v,j=g==="switch"?"checkbox":g;return d.jsx("div",{ref:t,id:r,style:n,className:`sg-form-check${m?"-reverse":""}${e?" "+e:""}${g==="switch"?" sg-form-switch":""}`,children:m?d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:w,type:j,id:y,className:`sg-form-check-input${f?" "+f:""}`,...x}),d.jsx("label",{ref:i,id:a,htmlFor:y,className:`sg-form-check-label${s?" "+s:""}`,children:u})]}):d.jsxs(d.Fragment,{children:[d.jsx("label",{ref:i,id:a,htmlFor:y,className:`sg-form-check-label${s?" "+s:""}`,children:u}),d.jsx("input",{ref:w,type:j,id:y,className:`sg-form-check-input${f?" "+f:""}`,style:E,...x})]})})};G.Check=c.forwardRef(mr);const hr=({children:e,className:t,...r},n)=>d.jsx("small",{className:`sg-form-text${t?" "+t:""}`,children:e});G.Text=c.forwardRef(hr);const vr=c.forwardRef(({children:e,label:t,controlId:r,...n},s)=>{const i=c.useMemo(()=>({controlId:r}));return d.jsx(ue.Provider,{value:i,children:d.jsxs("div",{className:"sg-form-floating",children:[e,d.jsx("label",{ref:s,htmlFor:i.controlId,className:"sg-form-floating-label",...n,children:t})]})})}),at=c.forwardRef(({children:e,className:t,...r},n)=>d.jsx("div",{ref:n,className:`sg-input-group${t?" "+t:""}`,...r,children:e})),gr=({children:e,className:t,...r},n)=>d.jsx("span",{ref:n,className:`sg-input-group-text${t?" "+t:""}`,...r,children:e});at.Text=c.forwardRef(gr);const ut=c.createContext(!1),yr=({children:e,value:t})=>d.jsx(ut.Provider,{value:t,children:e}),br=()=>c.useContext(ut),Y=c.forwardRef(({children:e,centered:t=!1,size:r="md",show:n,backdrop:s="static",onHide:i="none",className:u,id:a,...f},g)=>{const[v,p]=c.useState(!1);c.useEffect(()=>{p(n)},[n]);const m=c.useRef(null);xr(m);let E=typeof n=="boolean"&&typeof i=="function"?void 0:{show:typeof n=="boolean",onHide:typeof i=="function"};E&&console.error(E.show?null:"The variable 'show' must be used and must be a boolean used to decide when to show the modal!",E.onHide?null:"The variable 'onHide' must be used and must be a function which is used to set 'show' as the modal gets closed!");const x=()=>{i&&i(),p(!1)};c.useEffect(()=>{const y=m.current;y&&(v?y.showModal():y.close())},[v]);let w=`sg-modal-tag sg-modal-${r}`;return u&&(w+=" "+u),(s==="static"||s==="true")&&(w+=" sg-modal-static"),v?tt.createPortal(d.jsx("dialog",{ref:m,className:w,children:d.jsx(yr,{value:i,children:E?d.jsxs(d.Fragment,{children:[d.jsx(Y.Header,{closeButton:!0,children:d.jsx(Y.Title,{children:"An Error ocurred!"})}),d.jsx(Y.Body,{children:d.jsxs("p",{children:[E.show?null:"The variable 'show' must be used and must be a boolean used to decide when to show the modal!",E.onHide?null:"The variable 'onHide' must be used and must be a function which is used to set 'show' as the modal gets closed!"]})}),d.jsx(Y.Footer,{children:d.jsx(ot,{variant:"danger",type:"button",onClick:x,children:"Close"})})]}):e})}),document.body):null}),wr=c.forwardRef(({as:e="",className:t="",children:r,closeButton:n=!1,onClick:s="none",...i},u)=>{let f=["div","span","h1","h2","h3","h4","h5","h6"].find(p=>p===e)?e:"div";const g=br(),v=p=>{s!="none"&&s(p),g!="none"&&g()};return d.jsxs(f,{ref:u,className:`sg-modal-header ${t}`,...i,children:[r,n?d.jsx(st,{variant:!0,onClick:v}):null]})});Y.Header=wr;const _r=({children:e,as:t="h4",className:r,...n},s)=>{let u=["div","span","h1","h2","h3","h4","h5","h6"].find(a=>a===t)?t:"h4";return d.jsx(u,{ref:s,className:`sg-modal-title ${r}`,...n,children:e})};Y.Title=c.forwardRef(_r);const Er=({children:e,className:t,...r},n)=>d.jsx("div",{ref:n,className:`sg-modal-body ${t}`,...r,children:e});Y.Body=c.forwardRef(Er);const Cr=({children:e,className:t,...r},n)=>d.jsx("div",{ref:n,className:`sg-modal-footer ${t}`,...r,children:e});Y.Footer=c.forwardRef(Cr);const xr=function(e){c.useEffect(()=>{const t=r=>{const n='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',s=e.current;if(s){const i=s.querySelectorAll(n)[0],u=s.querySelectorAll(n),a=u[u.length-1];if(!(r.key==="Tab"||r.keyCode===9))return;r.shiftKey?document.activeElement===i&&(a.focus(),r.preventDefault()):document.activeElement===a&&(i.focus(),r.preventDefault())}};return document.addEventListener("keydown",t,!0),function(){document.removeEventListener("keydown",t,!0)}},[e])},ct=c.createContext(null),jr=({children:e,value:t})=>d.jsx(ct.Provider,{value:t,children:e}),De=c.forwardRef(({children:e,className:t,navbarPrefix:r="sg-navbar-",...n},s)=>{const i=c.useMemo(()=>r,[r]);return d.jsx("nav",{ref:s,className:`sg-navbar${t?" "+t:""}`,...n,children:d.jsx(jr,{value:i,children:e})})}),Sr=({children:e,className:t,href:r="#",as:n="a",...s},i)=>{const u=n||(r&&n!="Link"?"a":"span");return d.jsx(u,{ref:i,href:r,className:`sg-navbar-brand${t?" "+t:""}`,...s,children:e})};De.Brand=c.forwardRef(Sr);const Pr=({children:e,className:t,as:r="span",...n},s)=>{const i=r;return d.jsx(i,{ref:s,className:`sg-navbar-text${t?" "+t:""}`,...n,children:e})};De.Text=c.forwardRef(Pr);const Fe=c.forwardRef(({children:e,className:t,fill:r,justify:n,as:s="ul",...i},u)=>{const a=s;let f="";return ct&&(f="sg-navbar-"),d.jsx(a,{role:"menubar",ref:u,className:`${t} ${f}nav`,...i,children:e})}),Or=({children:e,className:t,as:r="li",...n},s)=>{const i=r;return d.jsx(i,{role:"none",ref:s,className:`sg-nav-item${t?" "+t:""}`,...n,children:e})};Fe.Item=c.forwardRef(Or);const Tr=({children:e,className:t,as:r="a",...n},s)=>{const i=r;return d.jsx(i,{role:"menuitem",ref:s,className:`sg-nav-link${t?" "+t:""}`,...n,children:e})};Fe.Link=c.forwardRef(Tr);function kr(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function $r(e){return kr(e)&&"type"in e&&typeof e.type=="string"}var lt=Symbol.for("immer-nothing"),ft=Symbol.for("immer-draftable"),A=Symbol.for("immer-state"),Dr=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function F(e,...t){if(process.env.NODE_ENV!=="production"){const r=Dr[e],n=typeof r=="function"?r.apply(null,t):r;throw new Error(`[Immer] ${n}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var te=Object.getPrototypeOf;function K(e){return!!e&&!!e[A]}function X(e){var t;return e?dt(e)||Array.isArray(e)||!!e[ft]||!!((t=e.constructor)!=null&&t[ft])||ge(e)||ye(e):!1}var Fr=Object.prototype.constructor.toString();function dt(e){if(!e||typeof e!="object")return!1;const t=te(e);if(t===null)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Fr}function ce(e,t){ve(e)===0?Object.entries(e).forEach(([r,n])=>{t(r,n,e)}):e.forEach((r,n)=>t(n,r,e))}function ve(e){const t=e[A];return t?t.type_:Array.isArray(e)?1:ge(e)?2:ye(e)?3:0}function Ie(e,t){return ve(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function pt(e,t,r){const n=ve(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Ir(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ge(e){return e instanceof Map}function ye(e){return e instanceof Set}function J(e){return e.copy_||e.base_}function Ae(e,t){if(ge(e))return new Map(e);if(ye(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&dt(e))return te(e)?{...e}:Object.assign(Object.create(null),e);const r=Object.getOwnPropertyDescriptors(e);delete r[A];let n=Reflect.ownKeys(r);for(let s=0;s<n.length;s++){const i=n[s],u=r[i];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[i]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[i]})}return Object.create(te(e),r)}function Ne(e,t=!1){return be(e)||K(e)||!X(e)||(ve(e)>1&&(e.set=e.add=e.clear=e.delete=Ar),Object.freeze(e),t&&ce(e,(r,n)=>Ne(n,!0))),e}function Ar(){F(2)}function be(e){return Object.isFrozen(e)}var Nr={};function Z(e){const t=Nr[e];return t||F(0,e),t}var le;function mt(){return le}function Rr(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ht(e,t){t&&(Z("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Re(e){Me(e),e.drafts_.forEach(Mr),e.drafts_=null}function Me(e){e===le&&(le=e.parent_)}function vt(e){return le=Rr(le,e)}function Mr(e){const t=e[A];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function gt(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[A].modified_&&(Re(t),F(4)),X(e)&&(e=we(t,e),t.parent_||_e(t,e)),t.patches_&&Z("Patches").generateReplacementPatches_(r[A].base_,e,t.patches_,t.inversePatches_)):e=we(t,r,[]),Re(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==lt?e:void 0}function we(e,t,r){if(be(t))return t;const n=t[A];if(!n)return ce(t,(s,i)=>yt(e,n,t,s,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return _e(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const s=n.copy_;let i=s,u=!1;n.type_===3&&(i=new Set(s),s.clear(),u=!0),ce(i,(a,f)=>yt(e,n,s,a,f,r,u)),_e(e,s,!1),r&&e.patches_&&Z("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function yt(e,t,r,n,s,i,u){if(process.env.NODE_ENV!=="production"&&s===r&&F(5),K(s)){const a=i&&t&&t.type_!==3&&!Ie(t.assigned_,n)?i.concat(n):void 0,f=we(e,s,a);if(pt(r,n,f),K(f))e.canAutoFreeze_=!1;else return}else u&&r.add(s);if(X(s)&&!be(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;we(e,s),(!t||!t.scope_.parent_)&&_e(e,s)}}function _e(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ne(t,r)}function zr(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:mt(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=n,i=ze;r&&(s=[n],i=fe);const{revoke:u,proxy:a}=Proxy.revocable(s,i);return n.draft_=a,n.revoke_=u,a}var ze={get(e,t){if(t===A)return e;const r=J(e);if(!Ie(r,t))return Br(e,r,t);const n=r[t];return e.finalized_||!X(n)?n:n===Be(e.base_,t)?(Le(e),e.copy_[t]=Ye(n,e)):n},has(e,t){return t in J(e)},ownKeys(e){return Reflect.ownKeys(J(e))},set(e,t,r){const n=bt(J(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const s=Be(J(e),t),i=s==null?void 0:s[A];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Ir(r,s)&&(r!==void 0||Ie(e.base_,t)))return!0;Le(e),We(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Be(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Le(e),We(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=J(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){F(11)},getPrototypeOf(e){return te(e.base_)},setPrototypeOf(){F(12)}},fe={};ce(ze,(e,t)=>{fe[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),fe.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&F(13),fe.set.call(this,e,t,void 0)},fe.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&F(14),ze.set.call(this,e[0],t,r,e[0])};function Be(e,t){const r=e[A];return(r?J(r):e)[t]}function Br(e,t,r){var s;const n=bt(t,r);return n?"value"in n?n.value:(s=n.get)==null?void 0:s.call(e.draft_):void 0}function bt(e,t){if(!(t in e))return;let r=te(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=te(r)}}function We(e){e.modified_||(e.modified_=!0,e.parent_&&We(e.parent_))}function Le(e){e.copy_||(e.copy_=Ae(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Wr=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const i=r;r=t;const u=this;return function(f=i,...g){return u.produce(f,v=>r.call(this,v,...g))}}typeof r!="function"&&F(6),n!==void 0&&typeof n!="function"&&F(7);let s;if(X(t)){const i=vt(this),u=Ye(t,void 0);let a=!0;try{s=r(u),a=!1}finally{a?Re(i):Me(i)}return ht(i,n),gt(s,i)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===lt&&(s=void 0),this.autoFreeze_&&Ne(s,!0),n){const i=[],u=[];Z("Patches").generateReplacementPatches_(t,s,i,u),n(i,u)}return s}else F(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(u,...a)=>this.produceWithPatches(u,f=>t(f,...a));let n,s;return[this.produce(t,r,(u,a)=>{n=u,s=a}),n,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){X(e)||F(8),K(e)&&(e=wt(e));const t=vt(this),r=Ye(e,void 0);return r[A].isManual_=!0,Me(t),r}finishDraft(e,t){const r=e&&e[A];(!r||!r.isManual_)&&F(9);const{scope_:n}=r;return ht(n,t),gt(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));const n=Z("Patches").applyPatches_;return K(e)?n(e,t):this.produce(e,s=>n(s,t))}};function Ye(e,t){const r=ge(e)?Z("MapSet").proxyMap_(e,t):ye(e)?Z("MapSet").proxySet_(e,t):zr(e,t);return(t?t.scope_:mt()).drafts_.push(r),r}function wt(e){return K(e)||F(10,e),_t(e)}function _t(e){if(!X(e)||be(e))return e;const t=e[A];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Ae(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Ae(e,!0);return ce(r,(n,s)=>{pt(r,n,_t(s))}),t&&(t.finalized_=!1),r}var N=new Wr;N.produce,N.produceWithPatches.bind(N),N.setAutoFreeze.bind(N),N.setUseStrictShallowCopy.bind(N),N.applyPatches.bind(N),N.createDraft.bind(N),N.finishDraft.bind(N);var Lr=(e,t,r)=>{if(t.length===1&&t[0]===r){let n=!1;try{const s={};e(s)===s&&(n=!0)}catch{}if(n){let s;try{throw new Error}catch(i){({stack:s}=i)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
28
|
-
\`createSelector([state => state.todos], todos => todos)\`
|
|
29
|
-
This could lead to inefficient memoization and unnecessary re-renders.
|
|
30
|
-
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:s})}}},Yr=(e,t,r)=>{const{memoize:n,memoizeOptions:s}=t,{inputSelectorResults:i,inputSelectorResultsCopy:u}=e,a=n(()=>({}),...s);if(!(a.apply(null,i)===a.apply(null,u))){let g;try{throw new Error}catch(v){({stack:g}=v)}console.warn(`An input selector returned a different result when passed same arguments.
|
|
31
|
-
This means your output selector will likely run more frequently than intended.
|
|
32
|
-
Avoid returning a new reference inside your input selector, e.g.
|
|
33
|
-
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:r,firstInputs:i,secondInputs:u,stack:g})}},Vr={inputStabilityCheck:"once",identityFunctionCheck:"once"};function Ur(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Hr(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function qr(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Et=e=>Array.isArray(e)?e:[e];function Gr(e){const t=Array.isArray(e[0])?e[0]:e;return qr(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Ct(e,t){const r=[],{length:n}=e;for(let s=0;s<n;s++)r.push(e[s].apply(null,t));return r}var Kr=(e,t)=>{const{identityFunctionCheck:r,inputStabilityCheck:n}={...Vr,...t};return{identityFunctionCheck:{shouldRun:r==="always"||r==="once"&&e,run:Lr},inputStabilityCheck:{shouldRun:n==="always"||n==="once"&&e,run:Yr}}},Xr=class{constructor(e){this.value=e}deref(){return this.value}},Jr=typeof WeakRef<"u"?WeakRef:Xr,Zr=0,xt=1;function Ee(){return{s:Zr,v:void 0,o:null,p:null}}function Ve(e,t={}){let r=Ee();const{resultEqualityCheck:n}=t;let s,i=0;function u(){var p;let a=r;const{length:f}=arguments;for(let m=0,E=f;m<E;m++){const x=arguments[m];if(typeof x=="function"||typeof x=="object"&&x!==null){let w=a.o;w===null&&(a.o=w=new WeakMap);const y=w.get(x);y===void 0?(a=Ee(),w.set(x,a)):a=y}else{let w=a.p;w===null&&(a.p=w=new Map);const y=w.get(x);y===void 0?(a=Ee(),w.set(x,a)):a=y}}const g=a;let v;if(a.s===xt?v=a.v:(v=e.apply(null,arguments),i++),g.s=xt,n){const m=((p=s==null?void 0:s.deref)==null?void 0:p.call(s))??s;m!=null&&n(m,v)&&(v=m,i!==0&&i--),s=typeof v=="object"&&v!==null||typeof v=="function"?new Jr(v):v}return g.v=v,v}return u.clearCache=()=>{r=Ee(),u.resetResultsCount()},u.resultsCount=()=>i,u.resetResultsCount=()=>{i=0},u}function jt(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...s)=>{let i=0,u=0,a,f={},g=s.pop();typeof g=="object"&&(f=g,g=s.pop()),Ur(g,`createSelector expects an output function after the inputs, but received: [${typeof g}]`);const v={...r,...f},{memoize:p,memoizeOptions:m=[],argsMemoize:E=Ve,argsMemoizeOptions:x=[],devModeChecks:w={}}=v,y=Et(m),j=Et(x),_=Gr(s),R=p(function(){return i++,g.apply(null,arguments)},...y);let I=!0;const z=E(function(){u++;const B=Ct(_,arguments);if(a=R.apply(null,B),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:L,inputStabilityCheck:V}=Kr(I,w);if(L.shouldRun&&L.run(g,B,a),V.shouldRun){const He=Ct(_,arguments);V.run({inputSelectorResults:B,inputSelectorResultsCopy:He},{memoize:p,memoizeOptions:y},arguments)}I&&(I=!1)}return a},...j);return Object.assign(z,{resultFunc:g,memoizedResultFunc:R,dependencies:_,dependencyRecomputations:()=>u,resetDependencyRecomputations:()=>{u=0},lastResult:()=>a,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:p,argsMemoize:E})};return Object.assign(n,{withTypes:()=>n}),n}var Qr=jt(Ve),en=Object.assign((e,t=Qr)=>{Hr(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((u,a,f)=>(u[r[f]]=a,u),{}))},{withTypes:()=>en}),tn=(...e)=>{const t=jt(...e),r=Object.assign((...n)=>{const s=t(...n),i=(u,...a)=>s(K(u)?wt(u):u,...a);return Object.assign(i,s),i},{withTypes:()=>r});return r};tn(Ve);function Ce(e,t){function r(...n){if(t){let s=t(...n);if(!s)throw new Error(process.env.NODE_ENV==="production"?xe(0):"prepareAction did not return an object");return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>$r(n)&&n.type===e,r}process.env.NODE_ENV;var rn="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",St=(e=21)=>{let t="",r=e;for(;r--;)t+=rn[Math.random()*64|0];return t},nn=(e,t)=>{if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?xe(32):`${t} is not a function`)},Ue="listenerMiddleware",on=e=>{let{type:t,actionCreator:r,matcher:n,predicate:s,effect:i}=e;if(t)s=Ce(t).match;else if(r)t=r.type,s=r.match;else if(n)s=n;else if(!s)throw new Error(process.env.NODE_ENV==="production"?xe(21):"Creating or removing a listener requires one of the known fields for matching an action");return nn(i,"options.listener"),{predicate:s,type:t,effect:i}},sn=Object.assign(e=>{const{type:t,predicate:r,effect:n}=on(e);return{id:St(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(process.env.NODE_ENV==="production"?xe(22):"Unsubscribe not initialized")}}},{withTypes:()=>sn}),an=Object.assign(Ce(`${Ue}/add`),{withTypes:()=>an});Ce(`${Ue}/removeAll`);var un=Object.assign(Ce(`${Ue}/remove`),{withTypes:()=>un});function xe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const cn=(e,t,r=!1)=>{const n=r?"top-end":"top-start",s=r?"top-start":"top-end",i=r?"bottom-end":"bottom-start",u=r?"bottom-start":"bottom-end",a=r?"right-start":"left-start",f=r?"right-end":"left-end",g=r?"left-start":"right-start",v=r?"left-end":"right-end";let p=e?u:i;return t==="up"?p=e?s:n:t==="end"?p=e?v:g:t==="start"?p=e?f:a:t==="down-centered"?p="bottom":t==="up-centered"&&(p="top"),p},ln=({children:e,value:t,...r})=>d.jsx(he.Provider,{value:t,...r,children:e}),re=c.forwardRef(({children:e,className:t,onSelect:r,onToggle:n,controlID:s,toggleProps:i,title:u,menuProps:a,drop:f="down",align:g="start",autoClose:v=!0,show:p="default",...m},E)=>{const[x,w]=c.useState(p==="default"?!1:p),[y,j]=c.useState({case:""}),_=c.useCallback(L=>{L.stopPropagation(),w(V=>!V)},[]),I=cn(g==="end",f),z={down:"dropdown","down-centered":"dropdown-center",up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"},Q=s||"nav-dropdown-"+St(),B=c.useMemo(()=>({align:g,drop:f,showInternal:p!="default"&&n?p:x,handleToggle:p!="default"&&n?n:_,placement:I,directionClasses:z,controlID:Q,activeDescendant:y,setActiveDescendant:j}),[g,f,p,x,n,_,I,z,s,y,j]);return d.jsx("div",{test:"true",id:s+"-wrapper",ref:E,className:`sg-dropdown${t?" "+t:""} sg-nav-item`,...m,children:d.jsxs(ln,{value:B,children:[d.jsx(W.Toggle,{navDropdown:!0,...i,children:u}),d.jsx(re.Menu,{...a,children:e})]})})});re.Toggle=W.Toggle,re.Menu=W.Menu,re.Item=W.Item,re.Divider=W.Divider;const fn=(e,t,r,n)=>{const s=n?n.element:document.body;c.useEffect(()=>{if(s)return s.addEventListener(e,t,r),function(){s.removeEventListener(e,t,r)}},[t,s])},ne=c.forwardRef(({children:e,initialPosition:t,id:r,resize:n=!1,move:s=!1,...i},u)=>{const[a,f]=c.useState({offSetTop:0,offSetLeft:0,...t});console.log(a);const g=n?"true":"false",v=s?"true":"false",p=c.useRef(u||null),[m,E]=c.useState(!1),x=c.useRef(m);c.useEffect(()=>{x.current=m},[m]);const w=_=>{if(s&&_.target.className.includes("sg-popout-title")||_.target.className.includes("sg-popout-header")){const{top:R,left:I}=p.current.getBoundingClientRect();f(z=>({...z,offSetTop:_.clientY-R,offSetLeft:_.clientX-I})),p.current.style.setProperty("user-select","none"),p.current.setPointerCapture("moveable-popup-"+r),E(z=>!0)}},y=_=>{s&&(p.current.style.removeProperty("user-select"),E(R=>!1))},j=_=>{if(s&&x.current){const R=_.clientY-a.offSetTop<0,I=window.innerHeight-(_.clientY-a.offSetTop+p.current.offsetHeight)<0,z=_.clientX-a.offSetLeft<0,Q=window.innerWidth-(_.clientX-a.offSetLeft+p.current.offsetWidth)<0;let B=R?0:_.clientY-a.offSetTop;B=I?window.innerHeight-p.current.offsetHeight:B;let L=z?0:_.clientX-a.offSetLeft;L=Q?window.innerWidth-p.current.offsetWidth:L,f(V=>({...V,top:B,left:L}))}};return fn("pointerup",y,!0,{element:document.body}),tt.createPortal(d.jsx("dialog",{"data-resize":g,"data-move":v,ref:p,id:r,className:"moveable-popout",style:{top:a.top,left:a.left,bottom:a.bottom,right:a.right},onMouseDown:w,onMouseMove:j,children:e}),document.body)}),dn=({as:e,className:t,children:r,...n},s)=>{let u=["div","span","h1","h2","h3","h4","h5","h6"].find(a=>a===e)?e:"div";return d.jsx(u,{ref:s,className:`sg-popout-header ${t}`,...n,children:r})};ne.Header=c.forwardRef(dn);const pn=({children:e,className:t,...r},n)=>{e=e.length?e.filter(i=>i!=null&&i!=""):e;let s=[];return c.Children.forEach(e,i=>{s.push(i)}),d.jsx("div",{ref:n,className:`sg-popout-body ${t}`,...r,children:s.map(i=>i)})};ne.Body=c.forwardRef(pn);const mn=({as:e,className:t,children:r,...n},s)=>{let u=["h1","h2","h3","h4","h5","h6"].find(a=>a===e)?e:"h5";return d.jsx(u,{ref:s,className:`sg-popout-title ${t}`,...n,children:r})};ne.Title=c.forwardRef(mn);const hn=({children:e,className:t,...r},n)=>d.jsx("p",{ref:n,className:`sg-popout-text ${t}`,...r,children:e});ne.Text=c.forwardRef(hn);const vn=({children:e,className:t,...r},n)=>d.jsx("div",{ref:n,className:`sg-popout-footer ${t}`,...r,children:e});ne.Footer=c.forwardRef(vn);const gn=(e,t)=>{const r=document.getElementById(t+"-controls").children;for(let n of Object.keys(r))if(r[n]===e.target)return n},je=c.createContext(null),yn=({children:e,value:t})=>d.jsx(je.Provider,{value:t,children:e}),de=c.forwardRef(({children:e,className:t,controlID:r,activeClassName:n,defaultActive:s=0,...i},u)=>{const[a,f]=c.useState(s),[g,v]=c.useState(null);c.useEffect(()=>{let m=n;m||(m="sg-active");const E=document.getElementsByClassName(m)[0],x=document.getElementsByClassName(m)[1];E&&E.classList.remove(m),x&&x.classList.remove(m);const w=document.getElementById(r+"-controls").children,y=document.getElementById(r+"-content").children;w[a].classList.add(m),y[a].classList.add(m)},[a,r,n,v]);const p=c.useMemo(()=>({activeTab:a,setActiveTab:f,controlID:r,pageCount:g,setPageCount:v}),[a,f,r,g,v]);return d.jsx(yn,{value:p,children:d.jsx("div",{ref:u,id:r+"-tabs",className:`sg-tabs${t?" "+t:""}`,...i,children:e})})}),bn=({children:e,className:t,...r},n)=>{const{controlID:s,setPageCount:i}=c.useContext(je);return c.useEffect(()=>{i(e.length)},[e,i]),d.jsx("div",{ref:n,id:s+"-controls",className:`sg-tabs-controls${t?" "+t:""}`,...r,children:e})};de.Controls=c.forwardRef(bn);const wn=({children:e,className:t,onClick:r,...n},s)=>{const{controlID:i,setActiveTab:u}=c.useContext(je),a=f=>{u(gn(f,i)),r&&r(f)};return d.jsx("button",{ref:s,onClick:a,className:`sg-tabs-button${t?" "+t:""}`,...n,children:e})};de.Button=c.forwardRef(wn);const _n=({children:e,className:t,...r},n)=>{const{controlID:s}=c.useContext(je);return d.jsx("div",{ref:n,id:s+"-content",className:`sg-tabs-content${t?" "+t:""}`,...r,children:e})};de.Content=c.forwardRef(_n);const En=({children:e,className:t,...r},n)=>d.jsx("div",{ref:n,className:`sg-tabs-page${t?" "+t:""}`,...r,children:e});de.Page=c.forwardRef(En);const Cn=c.forwardRef(({children:e,toggled:t="false",onClick:r,...n},s)=>{const[i,u]=c.useState(t),a=f=>{u(g=>g==="true"?"false":"true"),r&&r(f)};return d.jsx("button",{onClick:a,toggled:i,...n,children:e})});T.Button=ot,T.Card=q,T.CloseButton=st,T.Dropdown=W,T.FloatingLabel=vr,T.Form=G,T.InputGroup=at,T.Modal=Y,T.Nav=Fe,T.NavDropdown=re,T.Navbar=De,T.Popout=ne,T.Tabs=de,T.ToggleButton=Cn,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|