@jasperoosthoek/react-toolbox 0.9.4 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +455 -155
  2. package/change-log.md +18 -1
  3. package/dist/components/forms/FormField.d.ts +13 -0
  4. package/dist/components/forms/FormModal.d.ts +3 -2
  5. package/dist/components/forms/FormProvider.d.ts +3 -0
  6. package/dist/components/forms/fields/FormInput.d.ts +1 -1
  7. package/dist/components/indicators/FixedLoadingIndicator.d.ts +16 -0
  8. package/dist/components/tables/DataTable.d.ts +2 -2
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.es.js +2235 -0
  11. package/dist/index.es.js.map +1 -0
  12. package/dist/index.umd.js +28 -0
  13. package/dist/index.umd.js.map +1 -0
  14. package/package.json +26 -12
  15. package/src/components/forms/FormField.tsx +6 -2
  16. package/src/components/forms/FormModal.tsx +38 -20
  17. package/src/components/forms/FormProvider.tsx +7 -1
  18. package/src/components/forms/fields/FormBadgesSelection.tsx +20 -9
  19. package/src/components/forms/fields/FormCheckbox.tsx +8 -10
  20. package/src/components/forms/fields/FormDropdown.tsx +4 -5
  21. package/src/components/forms/fields/FormInput.tsx +6 -6
  22. package/src/components/forms/fields/FormSelect.tsx +4 -3
  23. package/src/components/indicators/FixedLoadingIndicator.tsx +49 -0
  24. package/src/components/tables/DataTable.tsx +27 -30
  25. package/src/index.ts +1 -0
  26. package/dist/index.js +0 -3
  27. package/dist/index.js.LICENSE.txt +0 -15
  28. package/src/__tests__/buttons.test.tsx +0 -545
  29. package/src/__tests__/errors.test.tsx +0 -339
  30. package/src/__tests__/forms.test.tsx +0 -3021
  31. package/src/__tests__/hooks.test.tsx +0 -413
  32. package/src/__tests__/indicators.test.tsx +0 -284
  33. package/src/__tests__/localization.test.tsx +0 -462
  34. package/src/__tests__/login.test.tsx +0 -417
  35. package/src/__tests__/setupTests.ts +0 -328
  36. package/src/__tests__/tables.test.tsx +0 -609
  37. package/src/__tests__/timeAndDate.test.tsx +0 -308
  38. package/src/__tests__/utils.test.tsx +0 -422
@@ -0,0 +1,28 @@
1
+ (function(a,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-bootstrap"),require("react-localization"),require("react-dnd"),require("date-fns"),require("date-fns-tz")):typeof define=="function"&&define.amd?define(["exports","react","react-bootstrap","react-localization","react-dnd","date-fns","date-fns-tz"],m):(a=typeof globalThis<"u"?globalThis:a||self,m(a["@jasperoosthoek/react-toolbox"]={},a.React,a.ReactBootstrap,a.ReactLocalization,a.ReactDnd,a.DateFns,a.DateFnsTz))})(this,function(a,m,u,xe,we,U,de){"use strict";var he={exports:{}},ee={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and 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 Se;function nt(){if(Se)return ee;Se=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(n,i,l){var h=null;if(l!==void 0&&(h=""+l),i.key!==void 0&&(h=""+i.key),"key"in i){l={};for(var d in i)d!=="key"&&(l[d]=i[d])}else l=i;return i=l.ref,{$$typeof:e,type:n,key:h,ref:i!==void 0?i:null,props:l}}return ee.Fragment=t,ee.jsx=o,ee.jsxs=o,ee}var te={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and 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 Fe;function ot(){return Fe||(Fe=1,process.env.NODE_ENV!=="production"&&function(){function e(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===B?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case v:return"Fragment";case p:return"Profiler";case k:return"StrictMode";case P:return"Suspense";case L:return"SuspenseList";case ue:return"Activity"}if(typeof s=="object")switch(typeof s.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),s.$$typeof){case S:return"Portal";case O:return(s.displayName||"Context")+".Provider";case T:return(s._context.displayName||"Context")+".Consumer";case H:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case A:return c=s.displayName||null,c!==null?c:e(s.type)||"Memo";case N:c=s._payload,s=s._init;try{return e(s(c))}catch{}}return null}function t(s){return""+s}function o(s){try{t(s);var c=!1}catch{c=!0}if(c){c=console;var b=c.error,j=typeof Symbol=="function"&&Symbol.toStringTag&&s[Symbol.toStringTag]||s.constructor.name||"Object";return b.call(c,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",j),t(s)}}function n(s){if(s===v)return"<>";if(typeof s=="object"&&s!==null&&s.$$typeof===N)return"<...>";try{var c=e(s);return c?"<"+c+">":"<...>"}catch{return"<...>"}}function i(){var s=M.A;return s===null?null:s.getOwner()}function l(){return Error("react-stack-top-frame")}function h(s){if(_.call(s,"key")){var c=Object.getOwnPropertyDescriptor(s,"key").get;if(c&&c.isReactWarning)return!1}return s.key!==void 0}function d(s,c){function b(){Z||(Z=!0,console.error("%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://react.dev/link/special-props)",c))}b.isReactWarning=!0,Object.defineProperty(s,"key",{get:b,configurable:!0})}function f(){var s=e(this.type);return J[s]||(J[s]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),s=this.props.ref,s!==void 0?s:null}function g(s,c,b,j,V,D,R,X){return b=D.ref,s={$$typeof:w,type:s,key:c,props:D,_owner:V},(b!==void 0?b:null)!==null?Object.defineProperty(s,"ref",{enumerable:!1,get:f}):Object.defineProperty(s,"ref",{enumerable:!1,value:null}),s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(s,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(s,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:R}),Object.defineProperty(s,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}function C(s,c,b,j,V,D,R,X){var I=c.children;if(I!==void 0)if(j)if(z(I)){for(j=0;j<I.length;j++)y(I[j]);Object.freeze&&Object.freeze(I)}else console.error("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 y(I);if(_.call(c,"key")){I=e(s);var Q=Object.keys(c).filter(function(hn){return hn!=="key"});j=0<Q.length?"{key: someKey, "+Q.join(": ..., ")+": ...}":"{key: someKey}",K[I+j]||(Q=0<Q.length?"{"+Q.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ let props = %s;
19
+ <%s {...props} />
20
+ React keys must be passed directly to JSX without using spread:
21
+ let props = %s;
22
+ <%s key={someKey} {...props} />`,j,I,Q,I),K[I+j]=!0)}if(I=null,b!==void 0&&(o(b),I=""+b),h(c)&&(o(c.key),I=""+c.key),"key"in c){b={};for(var pe in c)pe!=="key"&&(b[pe]=c[pe])}else b=c;return I&&d(b,typeof s=="function"?s.displayName||s.name||"Unknown":s),g(s,I,D,V,i(),b,R,X)}function y(s){typeof s=="object"&&s!==null&&s.$$typeof===w&&s._store&&(s._store.validated=1)}var x=m,w=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),O=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),B=Symbol.for("react.client.reference"),M=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=Object.prototype.hasOwnProperty,z=Array.isArray,$=console.createTask?console.createTask:function(){return null};x={"react-stack-bottom-frame":function(s){return s()}};var Z,J={},ae=x["react-stack-bottom-frame"].bind(x,l)(),W=$(n(l)),K={};te.Fragment=v,te.jsx=function(s,c,b,j,V){var D=1e4>M.recentlyCreatedOwnerStacks++;return C(s,c,b,!1,j,V,D?Error("react-stack-top-frame"):ae,D?$(n(s)):W)},te.jsxs=function(s,c,b,j,V){var D=1e4>M.recentlyCreatedOwnerStacks++;return C(s,c,b,!0,j,V,D?Error("react-stack-top-frame"):ae,D?$(n(s)):W)}}()),te}process.env.NODE_ENV==="production"?he.exports=nt():he.exports=ot();var r=he.exports,Ee={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Le=m.createContext&&m.createContext(Ee),it=["attr","size","title"];function at(e,t){if(e==null)return{};var o=lt(e,t),n,i;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)n=l[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function lt(e,t){if(e==null)return{};var o={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;o[n]=e[n]}return o}function le(){return le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},le.apply(this,arguments)}function _e(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,n)}return o}function se(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?_e(Object(o),!0).forEach(function(n){st(e,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):_e(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}function st(e,t,o){return t=ct(t),t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function ct(e){var t=ut(e,"string");return typeof t=="symbol"?t:t+""}function ut(e,t){if(typeof e!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var n=o.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Me(e){return e&&e.map((t,o)=>m.createElement(t.tag,se({key:o},t.attr),Me(t.child)))}function F(e){return t=>m.createElement(dt,le({attr:se({},e.attr)},t),Me(e.child))}function dt(e){var t=o=>{var{attr:n,size:i,title:l}=e,h=at(e,it),d=i||o.size||"1em",f;return o.className&&(f=o.className),e.className&&(f=(f?f+" ":"")+e.className),m.createElement("svg",le({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},o.attr,n,h,{className:f,style:se(se({color:e.color||o.color},o.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),l&&m.createElement("title",null,l),e.children)};return Le!==void 0?m.createElement(Le.Consumer,null,o=>t(o)):t(Ee)}function ht(e){return F({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"},child:[]}]})(e)}function mt(e){return F({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"},child:[]}]})(e)}function ft(e){return F({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32zm-622.3-84c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 0 0 0-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 0 0 9.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9z"},child:[]}]})(e)}function gt(e){return F({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 0 0 0-48.4z"},child:[]}]})(e)}function Pe(e){return F({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"},child:[]}]})(e)}function Oe(e){return F({attr:{viewBox:"0 0 1024 1024",fill:"currentColor",fillRule:"evenodd"},child:[{tag:"path",attr:{d:"M799.855 166.312c.023.007.043.018.084.059l57.69 57.69c.041.041.052.06.059.084a.118.118 0 0 1 0 .069c-.007.023-.018.042-.059.083L569.926 512l287.703 287.703c.041.04.052.06.059.083a.118.118 0 0 1 0 .07c-.007.022-.018.042-.059.083l-57.69 57.69c-.041.041-.06.052-.084.059a.118.118 0 0 1-.069 0c-.023-.007-.042-.018-.083-.059L512 569.926 224.297 857.629c-.04.041-.06.052-.083.059a.118.118 0 0 1-.07 0c-.022-.007-.042-.018-.083-.059l-57.69-57.69c-.041-.041-.052-.06-.059-.084a.118.118 0 0 1 0-.069c.007-.023.018-.042.059-.083L454.073 512 166.371 224.297c-.041-.04-.052-.06-.059-.083a.118.118 0 0 1 0-.07c.007-.022.018-.042.059-.083l57.69-57.69c.041-.041.06-.052.084-.059a.118.118 0 0 1 .069 0c.023.007.042.018.083.059L512 454.073l287.703-287.702c.04-.041.06-.052.083-.059a.118.118 0 0 1 .07 0Z"},child:[]}]})(e)}function vt(e){return F({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"},child:[]}]})(e)}function Ct(e){return F({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM544 472c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v108H372c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h108v108c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h108c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V472z"},child:[]}]})(e)}function bt(e){return F({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M484 443.1V528h-84.5c-4.1 0-7.5 3.1-7.5 7v42c0 3.8 3.4 7 7.5 7H484v84.9c0 3.9 3.2 7.1 7 7.1h42c3.9 0 7-3.2 7-7.1V584h84.5c4.1 0 7.5-3.2 7.5-7v-42c0-3.9-3.4-7-7.5-7H540v-84.9c0-3.9-3.1-7.1-7-7.1h-42c-3.8 0-7 3.2-7 7.1zm396-144.7H521L403.7 186.2a8.15 8.15 0 0 0-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"},child:[]}]})(e)}function jt(e){return F({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z"},child:[]},{tag:"path",attr:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z"},child:[]}]})(e)}function yt(e){return F({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"},child:[]}]})(e)}function pt(e){return F({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"},child:[]}]})(e)}function xt(e){return F({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M832 464H332V240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v68c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-68c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zm-40 376H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 1 0-56 0z"},child:[]}]})(e)}function wt(e){return F({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 0 0-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"},child:[]}]})(e)}function St(e){return F({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"},child:[]}]})(e)}function ke(e){return F({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41z"},child:[]}]})(e)}function Te(e){return F({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M279 224H41c-21.4 0-32.1-25.9-17-41L143 64c9.4-9.4 24.6-9.4 33.9 0l119 119c15.2 15.1 4.5 41-16.9 41z"},child:[]}]})(e)}function ze(e){return F({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41zm255-105L177 64c-9.4-9.4-24.6-9.4-33.9 0L24 183c-15.1 15.1-4.4 41 17 41h238c21.4 0 32.1-25.9 17-41z"},child:[]}]})(e)}function Ft(e){return F({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z"},child:[]}]})(e)}function Et(e){return F({attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function Lt(e){return F({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M336.174 80c-49.132 0-93.305-32-161.913-32-31.301 0-58.303 6.482-80.721 15.168a48.04 48.04 0 0 0 2.142-20.727C93.067 19.575 74.167 1.594 51.201.104 23.242-1.71 0 20.431 0 48c0 17.764 9.657 33.262 24 41.562V496c0 8.837 7.163 16 16 16h16c8.837 0 16-7.163 16-16v-83.443C109.869 395.28 143.259 384 199.826 384c49.132 0 93.305 32 161.913 32 58.479 0 101.972-22.617 128.548-39.981C503.846 367.161 512 352.051 512 335.855V95.937c0-34.459-35.264-57.768-66.904-44.117C409.193 67.309 371.641 80 336.174 80zM464 336c-21.783 15.412-60.824 32-102.261 32-59.945 0-102.002-32-161.913-32-43.361 0-96.379 9.403-127.826 24V128c21.784-15.412 60.824-32 102.261-32 59.945 0 102.002 32 161.913 32 43.271 0 96.32-17.366 127.826-32v240z"},child:[]}]})(e)}function _t(e){return F({attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M6 6C6 5.44772 6.44772 5 7 5H17C17.5523 5 18 5.44772 18 6C18 6.55228 17.5523 7 17 7H7C6.44771 7 6 6.55228 6 6Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M6 10C6 9.44771 6.44772 9 7 9H17C17.5523 9 18 9.44771 18 10C18 10.5523 17.5523 11 17 11H7C6.44771 11 6 10.5523 6 10Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M7 13C6.44772 13 6 13.4477 6 14C6 14.5523 6.44771 15 7 15H17C17.5523 15 18 14.5523 18 14C18 13.4477 17.5523 13 17 13H7Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M6 18C6 17.4477 6.44772 17 7 17H11C11.5523 17 12 17.4477 12 18C12 18.5523 11.5523 19 11 19H7C6.44772 19 6 18.5523 6 18Z",fill:"currentColor"},child:[]},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M2 4C2 2.34315 3.34315 1 5 1H19C20.6569 1 22 2.34315 22 4V20C22 21.6569 20.6569 23 19 23H5C3.34315 23 2 21.6569 2 20V4ZM5 3H19C19.5523 3 20 3.44771 20 4V20C20 20.5523 19.5523 21 19 21H5C4.44772 21 4 20.5523 4 20V4C4 3.44772 4.44771 3 5 3Z",fill:"currentColor"},child:[]}]})(e)}function Mt(e){return F({attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{opacity:"0.2",fillRule:"evenodd",clipRule:"evenodd",d:"M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M2 12C2 6.47715 6.47715 2 12 2V5C8.13401 5 5 8.13401 5 12H2Z",fill:"currentColor"},child:[]}]})(e)}function Pt(e){return F({attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M17 5V4C17 2.89543 16.1046 2 15 2H9C7.89543 2 7 2.89543 7 4V5H4C3.44772 5 3 5.44772 3 6C3 6.55228 3.44772 7 4 7H5V18C5 19.6569 6.34315 21 8 21H16C17.6569 21 19 19.6569 19 18V7H20C20.5523 7 21 6.55228 21 6C21 5.44772 20.5523 5 20 5H17ZM15 4H9V5H15V4ZM17 7H7V18C7 18.5523 7.44772 19 8 19H16C16.5523 19 17 18.5523 17 18V7Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M9 9H11V17H9V9Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M13 9H15V17H13V9Z",fill:"currentColor"},child:[]}]})(e)}function Ot(e){return F({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M7.646.146a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1-.708.708L8.5 1.707V5.5a.5.5 0 0 1-1 0V1.707L6.354 2.854a.5.5 0 1 1-.708-.708zM8 10a.5.5 0 0 1 .5.5v3.793l1.146-1.147a.5.5 0 0 1 .708.708l-2 2a.5.5 0 0 1-.708 0l-2-2a.5.5 0 0 1 .708-.708L7.5 14.293V10.5A.5.5 0 0 1 8 10M.146 8.354a.5.5 0 0 1 0-.708l2-2a.5.5 0 1 1 .708.708L1.707 7.5H5.5a.5.5 0 0 1 0 1H1.707l1.147 1.146a.5.5 0 0 1-.708.708zM10 8a.5.5 0 0 1 .5-.5h3.793l-1.147-1.146a.5.5 0 0 1 .708-.708l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L14.293 8.5H10.5A.5.5 0 0 1 10 8"},child:[]}]})(e)}function kt(e){return F({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2z"},child:[]},{tag:"path",attr:{d:"M5 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 5 8m0-2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m0 5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-1-5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0M4 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0m0 2.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0"},child:[]}]})(e)}function Tt(e){return F({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325"},child:[]}]})(e)}function zt(e){return F({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function Vt(e){return F({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5.536 21.886a1.004 1.004 0 0 0 1.033-.064l13-9a1 1 0 0 0 0-1.644l-13-9A.998.998 0 0 0 5 3v18a1 1 0 0 0 .536.886zM7 4.909 17.243 12 7 19.091V4.909z"},child:[]}]})(e)}function Dt(e){return F({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 9a3.02 3.02 0 0 0-3 3c0 1.642 1.358 3 3 3 1.641 0 3-1.358 3-3 0-1.641-1.359-3-3-3z"},child:[]},{tag:"path",attr:{d:"M12 5c-7.633 0-9.927 6.617-9.948 6.684L1.946 12l.105.316C2.073 12.383 4.367 19 12 19s9.927-6.617 9.948-6.684l.106-.316-.105-.316C21.927 11.617 19.633 5 12 5zm0 12c-5.351 0-7.424-3.846-7.926-5C4.578 10.842 6.652 7 12 7c5.351 0 7.424 3.846 7.926 5-.504 1.158-2.578 5-7.926 5z"},child:[]}]})(e)}function At(e){return F({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zm-1 16H5V5h14v14z"},child:[]}]})(e)}function Ht(e){return F({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"},child:[]},{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},child:[]}]})(e)}function Nt(e){return F({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"},child:[]}]})(e)}function It(e){return F({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M16 5H0V4h16v1zm0 8H0v-1h16v1zm0-4.008H0V8h16v.992z"},child:[]}]})(e)}function Bt(e){return F({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M5.76282 17H20V5H4V18.3851L5.76282 17ZM6.45455 19L2 22.5V4C2 3.44772 2.44772 3 3 3H21C21.5523 3 22 3.44772 22 4V18C22 18.5523 21.5523 19 21 19H6.45455ZM11 14H13V16H11V14ZM8.56731 8.81346C8.88637 7.20919 10.302 6 12 6C13.933 6 15.5 7.567 15.5 9.5C15.5 11.433 13.933 13 12 13H11V11H12C12.8284 11 13.5 10.3284 13.5 9.5C13.5 8.67157 12.8284 8 12 8C11.2723 8 10.6656 8.51823 10.5288 9.20577L8.56731 8.81346Z"},child:[]}]})(e)}function $t(e){return F({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4 5V19H13V21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21C21.5523 3 22 3.44772 22 4V9H20V5H4ZM19.7071 11.2929L19 10.5858L18.2929 11.2929L15.2929 14.2929L16.7071 15.7071L19 13.4142L21.2929 15.7071L22.7071 14.2929L19.7071 11.2929ZM16.7071 17.2929L19 19.5858L21.2929 17.2929L22.7071 18.7071L19.7071 21.7071L19 22.4142L18.2929 21.7071L15.2929 18.7071L16.7071 17.2929Z"},child:[]}]})(e)}function Rt(e){return F({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M22 12C22 17.5228 17.5229 22 12 22C6.4772 22 2 17.5228 2 12C2 6.47715 6.4772 2 12 2V4C7.5817 4 4 7.58172 4 12C4 16.4183 7.5817 20 12 20C16.4183 20 20 16.4183 20 12C20 9.25022 18.6127 6.82447 16.4998 5.38451L16.5 8H14.5V2L20.5 2V4L18.0008 3.99989C20.4293 5.82434 22 8.72873 22 12Z"},child:[]}]})(e)}function Ut(e){return F({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z"},child:[]},{tag:"path",attr:{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10"},child:[]},{tag:"path",attr:{d:"m17 10 4 4-4 4"},child:[]}]})(e)}const Ve=({onClick:e,loading:t,icon:o,iconSize:n,children:i,size:l="sm",className:h,...d})=>r.jsxs(u.Button,{variant:"light",size:l,className:`icon-button ${h||""}`,onClick:f=>{f.stopPropagation(),f.preventDefault(),e&&e(f)},...d,children:[t&&r.jsx(Mt,{style:{animation:"spinner-border .75s linear infinite"}}),!t&&o&&typeof o=="function"&&r.jsx(o,{size:n}),i&&r.jsx(r.Fragment,{children:" "}),i]}),E=e=>t=>r.jsx(Ve,{...t,icon:e}),qt=E(Pe),Zt=E(St),Yt=E(Ut),De=E(Et),Gt=E(Ht),Ae=E(jt),Wt=E(bt),Jt=E(gt),Kt=E(Ct),He=E(Pt),Xt=E(ht),Qt=E(vt),Ne=E(ft),er=E(Lt),tr=E(zt),rr=E(Nt),nr=E(kt),or=E(It),ir=E(Ot),ar=E(_t),lr=E(Tt),sr=E(Vt),cr=E(yt),Ie=E(pt),ur=E(Dt),dr=E(ze),hr=E(Te),mr=E(ke),fr=E(At),gr=E(Ft),Be=E(Oe),vr=E(xt),Cr=E(mt),$e=E(wt),br=E(Bt),jr=E($t),yr=E(Rt),pr=({accept:e,onLoadFile:t,...o})=>{const n=m.useRef(null);return r.jsxs(r.Fragment,{children:[r.jsx($e,{...o,onClick:()=>{var i;return(i=n==null?void 0:n.current)==null?void 0:i.click()}}),r.jsx(u.Form.Control,{type:"file",accept:e,ref:n,style:{display:"none"},onChange:i=>{var d;i.preventDefault();const l=new FileReader;l.onload=f=>{var g;(g=f==null?void 0:f.target)!=null&&g.result&&t(f.target.result),n.current&&(n.current.value="")};const h=(d=i==null?void 0:i.target)==null?void 0:d.files;h&&l.readAsText(h[0])}})]})},Re={en:"English",fr:"Français",nl:"Nederlands"},me={en:{select:"Select",search:"Search",no_information_to_display:"No information to display",information_is_being_loaded:"The information is being loaded...",delete:"Delete",are_you_sure:"Are you sure?",close:"Close",save:"Save",cancel:"Cancel",ok:"OK",your_email:"Your email",enter_email:"Enter email address",your_password:"Your password",enter_password:"Enter password",login:"Login",logout:"Logout",forgot_password:"Forgot password?",reset_password:"Reset password",required_field:"required",choose_one:"Choose one",everything:"Everything",number_of_rows:"Number of rows",modal_create:"New",modal_edit:"Edit"},fr:{select:"Sélectionner",search:"Recherche",no_information_to_display:"Aucune information à afficher",information_is_being_loaded:"L'information est en cours de téléchargement...",delete:"Supprimer",are_you_sure:"Êtes-vous sûr?",close:"Fermer",save:"Sauvegarder",cancel:"Annuler",ok:"D'accord'",your_email:"Votre adresse e-mail",enter_email:"Entrez l'adresse e-mail",your_password:"Votre mot de passe",enter_password:"Entrez votre mot de passe",login:"Connexion",logout:"Se déconnecter",forgot_password:"Mot de passe oublié?",reset_password:"Réinitialiser le mot de passe",required_field:"requis",choose_one:"Choisissez-en un",everything:"Tout",number_of_rows:"Nombre de rangées",modal_create:"Nouveau",modal_edit:"Éditer"},nl:{select:"Selecteer",search:"Zoeken",no_information_to_display:"Geen informatie om weer te geven.",information_is_being_loaded:"De gegevens worden geladen...",delete:"Verwijderen",are_you_sure:"Weet u het zeker?",close:"Sluiten",save:"Opslaan",cancel:"Annuleren",ok:"OK",your_email:"Uw e-mail",enter_email:"Voer e-mailadres in",your_password:"Uw wachtwoord",enter_password:"Voer wachtwoord in",login:"Inloggen",logout:"Uitloggen",forgot_password:"Wachtwoord vergeten?",reset_password:"Wachtwoord resetten",required_field:"verplicht",choose_one:"Maak een keuze",everything:"Alles",number_of_rows:"Aantal rijen",modal_create:"Nieuw",modal_edit:"Bewerken"}},ce="This function should only be used in a child of LocalizationProvider.",Ue=(...e)=>{if(e.length===0)return{};const t=e.filter(n=>n&&Object.keys(n).length>0);return t.length===0?{}:[...new Set(t.flatMap(Object.keys))].reduce((n,i)=>({...n,[i]:t.reduce((l,h)=>({...l,...h[i]||{}}),{})}),{})},re=m.createContext({lang:"en",languages:Object.keys(Re),setLanguage:e=>console.error(ce),text:(e,...t)=>(console.error(ce),e[0]),textByLang:e=>(t,...o)=>(console.error(ce),t[0]),strings:new xe({en:{}}),localizationStrings:{},setLocalization:e=>console.error(ce)}),xr=({lang:e="en",localization:t={},languages:o,children:n,...i})=>{const[l,h]=m.useState(t),[d,f]=m.useState(e),g=Array.from(new Set([...o||Object.keys(me),...Object.keys(l)])),C=m.useMemo(()=>g.reduce((S,v)=>({...S,[v]:{...me[v]||{},...l[v]||{}}}),{}),[g,l]),y=m.useMemo(()=>{const S=new xe(C);return S.setLanguage(d),S},[C,d]),x=S=>{h(v=>Ue(v,S))},w=S=>(v,...k)=>{const p=y.getString(v[0],S);if(p){if(typeof p=="function")return p.length!==k.length?(console.error(`Language function "${v[0]}" expects exactly ${p.length} argument${p.length===1?"":"s"}. `+(p.length>0?` Use text\`${v[0]}\${arg1}\${arg2}\``:` Use text\`${v[0]}\``)),p.length>0?`${v[0]}\${arg1}\${arg2}`:v[0]):p(...k)}else return console.error(`Language string not found: "${v[0]}"`),v[0];return p};return r.jsx(re.Provider,{value:{lang:d,languages:g,setLanguage:S=>{if(!g.includes(S)){console.error(`Language ${S} not available`);return}f(S)},strings:y,text:w(d),textByLang:w,localizationStrings:C,setLocalization:x,...i},children:n})},q=()=>m.useContext(re),wr=({style:e={}})=>{const{strings:t}=q();return r.jsx(u.Container,{children:r.jsx(u.Row,{className:"error-page",children:r.jsx(u.Col,{children:r.jsxs("div",{style:{padding:"2rem 1rem",marginBottom:"2rem",backgroundColor:"#e9ecef",borderRadius:".3rem"},children:[r.jsx(u.Spinner,{animation:"border",role:"status",style:{marginRight:"20px",...e}}),t.getString("information_is_being_loaded")]})})})})},fe=({style:e={},component:t=u.Button,className:o})=>t?r.jsx(t,{...o?{className:o}:{},variant:"link",disabled:!0,size:"sm",style:e,children:r.jsx(u.Spinner,{animation:"border",role:"status",size:"sm"})}):r.jsx(u.Spinner,{...o?{className:o}:{},animation:"border",role:"status",size:"sm"}),Sr=()=>r.jsx(u.Spinner,{animation:"border",role:"status"}),qe=({modalTitle:e,modalBody:t,confirmText:o,cancelText:n,onConfirm:i,buttonComponent:l,loading:h,closeUsingCallback:d,...f})=>{const[g,C]=m.useState(!1),{strings:y}=m.useContext(re);return r.jsxs(r.Fragment,{children:[r.jsx(l,{...f,onClick:()=>C(!0)}),g&&r.jsxs(u.Modal,{show:!0,onHide:()=>C(!1),onClick:x=>x.stopPropagation(),centered:!0,children:[r.jsx(u.Modal.Header,{closeButton:!0,children:r.jsx(u.Modal.Title,{children:e})}),r.jsx(u.Modal.Body,{children:t||y.getString("are_you_sure")}),r.jsxs(u.Modal.Footer,{children:[h&&r.jsx(fe,{}),r.jsx(u.Button,{variant:"secondary",onClick:()=>C(!1),children:n||y.getString("cancel")}),r.jsx(u.Button,{variant:"primary",onClick:async()=>{await i(()=>C(!1)),d||C(!1)},children:o||y.getString("ok")})]})]})]})},Fr=({modalTitle:e,modalBody:t,confirmText:o,onDelete:n,...i})=>{const{strings:l}=m.useContext(re);return r.jsx(qe,{...i,modalTitle:e||l.getString("delete"),modalBody:t||l.getString("are_you_sure"),confirmText:o||l.getString("delete"),onConfirm:n,buttonComponent:He})},ge=e=>{const t=m.useRef(void 0);return m.useEffect(()=>{t.current=e}),t.current},Er=(e,t,o)=>{m.useEffect(()=>{const n=setTimeout(()=>e(),o);return()=>clearTimeout(n)},[...t||[],o])},Ze=()=>{const[,e]=m.useState(null);return m.useCallback(()=>e({}),[])},ve=e=>{const[t,o]=m.useState(e),n=m.useCallback((i,l)=>{o(h=>({...h,...i})),l&&Promise.resolve().then(l)},[]);return[t,n]},Lr=(e,t)=>m.useEffect(()=>{if(typeof e!="function")throw"First argument of useInterval should be a function";if(typeof t!="number"||!isFinite(t)||t<=0)throw"Second argument of useInterval should be a positive number";const o=setInterval(e,t);return()=>clearInterval(o)},[]),_r=(e,t)=>{const[o,n]=m.useState(()=>{try{const l=localStorage.getItem(e);return l===null?(localStorage.setItem(e,JSON.stringify(t)),t):JSON.parse(l)}catch(l){return console.error("Error reading from localStorage:",l),t}});m.useEffect(()=>{const l=h=>{if(h.key===e&&h.newValue)try{n(JSON.parse(h.newValue))}catch(d){console.error("Error parsing localStorage value:",d)}};return window.addEventListener("storage",l),()=>window.removeEventListener("storage",l)},[e]);const i=m.useCallback(l=>{try{n(l),localStorage.setItem(e,JSON.stringify(l)),window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:JSON.stringify(l),oldValue:localStorage.getItem(e)}))}catch(h){console.error("Error writing to localStorage:",h)}},[e]);return[o,i]},Ce=e=>e==null||e===!1||typeof e=="object"&&Object.keys(e).length===0||typeof e=="string"&&e.trim().length===0,Mr=e=>e.replace(/([-_])(.)/g,(t,o,n)=>n.toUpperCase()),Pr=e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/([a-zA-Z])([0-9])/g,"$1_$2").replace(/([0-9])([a-zA-Z])/g,"$1_$2").toUpperCase(),Or=e=>{if(e.slice(-1)!=="s"&&e.slice(-1)!=="S")return e;if(e.slice(-3).toLowerCase()==="ies"){const t=e.slice(0,-3),o=e.slice(-3,-2);return`${t}${o===o.toUpperCase()?"Y":"y"}`}else return e.slice(0,-1)},kr=(e,t)=>Object.fromEntries(e.map(o=>[o[t],o])),Tr=(e,t)=>parseFloat(`${e}`).toFixed(t||0),zr=(e,t)=>parseFloat(parseFloat(`${e}`).toFixed(t||0)),Vr=async(e,t,o={})=>{try{const i=await(o.fetchFn||fetch)(e,{method:"GET",headers:o.headers||{}});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const l=await i.blob(),h=window.URL.createObjectURL(l),d=document.createElement("a");d.href=h,d.setAttribute("download",t),document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(h)}catch(n){throw console.error("Download failed:",n),n}},Dr={formFields:{},formId:"",formData:null,initialFormData:null,pristine:!0,validated:!1,validationErrors:{},loading:!1,getValue:()=>"",setValue:()=>console.error("setValue should only be used within a FormProvider"),setFormData:()=>console.error("setFormData should only be used within a FormProvider"),resetForm:()=>console.error("resetForm should only be used within a FormProvider"),submit:()=>console.error("submit should only be used within a FormProvider"),setPristine:()=>console.error("setPristine should only be used within a FormProvider"),setLoading:()=>console.error("setLoading should only be used within a FormProvider"),hasProvider:!1},Ye=m.createContext(Dr),ne=()=>m.useContext(Ye),be=({formFields:e,initialState:t={},onSubmit:o,validate:n,loading:i=!1,children:l,resetTrigger:h})=>{const{strings:d}=q(),f=m.useId();if(!e)return console.error("Property formFields cannot be empty."),null;const g=()=>({...Object.entries(e).reduce((M,[_,{initialValue:z}])=>({...M,[_]:z||""}),{}),...t||{}}),[C,y]=m.useState(g()),[{pristine:x,formData:w,internalLoading:S},v]=ve({pristine:!0,formData:C,internalLoading:!1}),k=ge(h);m.useEffect(()=>{if(h!==void 0&&k!==h){const M=g();y(M),v({pristine:!0,formData:M})}},[h,k]);const p=M=>{const _=w[M];return _??((e[M]||{}).type==="number"?"0":"")},T=(M,_)=>{var Z;const z=(Z=e[M])==null?void 0:Z.onChange,$=typeof z=="function"?{...w,...z(_,w)}:{...w,[M]:_};v({formData:$})},O=M=>{v({formData:{...w,...M}})},H=()=>{const M=g();y(M),v({pristine:!0,formData:M})},P={...n?Object.entries(n(w)||{}).reduce((M,[_,z])=>Ce(z)?M:{...M,[_]:z},{}):{},...Object.keys(w).reduce((M,_)=>!e[_]||!e[_].required||!Ce(p(_))?M:{...M,[_]:d.getString("required_field")},{})},L=Object.values(P).length===0,B={formFields:e,formId:f,formData:w,initialFormData:C,pristine:x,validated:L,validationErrors:P,loading:i||S,getValue:p,setValue:T,setFormData:O,resetForm:H,submit:()=>{v({pristine:!1}),L&&(v({internalLoading:!0}),o(w,()=>v({internalLoading:!1})))},setPristine:M=>{v({pristine:M})},setLoading:M=>{v({internalLoading:M})},hasProvider:!0};return r.jsx(Ye.Provider,{value:B,children:l})},Ar=({children:e,...t})=>{const{formFields:o,hasProvider:n}=ne();return!n||!o?(console.error("FormField must be used within a FormProvider"),null):o[t.name]?e?r.jsx("div",{className:"form-group",children:e}):r.jsx(G,{...t}):(console.error(`FormField: No field configuration found for "${t.name}"`),null)},Y=e=>{const{name:t,label:o,required:n,className:i,...l}=e,{getValue:h,setValue:d,formFields:f,formId:g,validationErrors:C,pristine:y,validated:x,submit:w,hasProvider:S}=ne();if(!S)return console.error("useFormField must be used within a FormProvider"),{value:"",onChange:()=>{},isInvalid:!1,error:null,label:void 0,required:!1,mergedProps:{},submit:()=>{},formId:""};const v=f[t];v||console.error(`useFormField: No field configuration found for "${t}"`);const k=!y&&!x&&!!C[t],p=k?C[t]:null,T=o!==void 0?o:v==null?void 0:v.label,O=n!==void 0?n:v==null?void 0:v.required,H={...v==null?void 0:v.formProps,...l};return{value:h(t),onChange:P=>d(t,P),isInvalid:k,error:p,label:T,required:O,mergedProps:H,submit:w,formId:g,className:i}},G=e=>{const{value:t,onChange:o,isInvalid:n,error:i,label:l,required:h,mergedProps:d,submit:f,formId:g,className:C}=Y(e),y=n&&i?`${g}-${e.name}-error`:void 0,x=`${g}-${e.name}`;return r.jsxs(u.Form.Group,{controlId:x,className:C,children:[l&&r.jsxs(u.Form.Label,{children:[l,h&&" *"]}),n&&i&&r.jsx(u.Form.Text,{id:y,className:"text-danger",children:i}),r.jsx(u.Form.Control,{autoComplete:"off",...d,value:t||"",isInvalid:n,"aria-describedby":y,onChange:w=>{o(w.target.value)},onKeyDown:w=>{w.key==="Enter"&&d.as!=="textarea"&&(w.preventDefault(),f())}})]})},Hr=({rows:e=3,...t})=>r.jsx(G,{as:"textarea",rows:e,...t}),Nr=e=>r.jsx(G,{type:"date",...e}),Ir=({value:e,onChange:t,timezone:o,...n})=>{const i=h=>{if(!h)return"";try{const d=typeof h=="string"?new Date(h):h;if(isNaN(d.getTime()))return"";const f=d.getFullYear(),g=String(d.getMonth()+1).padStart(2,"0"),C=String(d.getDate()).padStart(2,"0"),y=String(d.getHours()).padStart(2,"0"),x=String(d.getMinutes()).padStart(2,"0");return`${f}-${g}-${C}T${y}:${x}`}catch{return""}},l=h=>{if(t){if(!h){t("");return}try{const d=new Date(h);if(isNaN(d.getTime())){t("");return}t(d.toISOString())}catch{t("")}}};return r.jsx(G,{type:"datetime-local",value:i(e),onChange:l,...n})},Ge=e=>{const{value:t,onChange:o,isInvalid:n,error:i,label:l,required:h,mergedProps:d,formId:f,className:g}=Y(e),{options:C=[],placeholder:y="Choose..."}=e,x=`${f}-${e.name}`;return r.jsxs(u.Form.Group,{controlId:x,className:g,children:[l&&r.jsxs(u.Form.Label,{children:[l,h&&" *"]}),n&&i&&r.jsx(u.Form.Text,{className:"text-danger",children:i}),r.jsxs(u.Form.Select,{...d,value:t||"",isInvalid:n,onChange:w=>{o(w.target.value)},children:[r.jsx("option",{value:"",disabled:!0,children:y}),C.map((w,S)=>r.jsx("option",{value:w.value,disabled:w.disabled,children:w.label},S))]})]})},We=e=>{const{value:t,onChange:o,isInvalid:n,error:i,label:l,required:h,mergedProps:d,formId:f,className:g}=Y(e),C=n&&i?`${f}-${e.name}-error`:void 0,y=`${f}-${e.name}`;return r.jsxs(u.Form.Group,{controlId:y,className:`mt-2 mb-2${g?` ${g}`:""}`,children:[n&&i&&r.jsx(u.Form.Text,{id:C,className:"text-danger",children:i}),r.jsx(u.Form.Check,{type:"checkbox",...d,checked:!!t,isInvalid:n,"aria-describedby":C,onChange:x=>{o(x.target.checked)},label:l?r.jsxs("span",{children:[l,h&&" *"]}):void 0})]})},Br=e=>{const{value:t,onChange:o,isInvalid:n,error:i,label:l,required:h,mergedProps:d,formId:f,className:g}=Y(e),C=n&&i?`${f}-${e.name}-error`:void 0,y=`${f}-${e.name}`;return r.jsxs(u.Form.Group,{controlId:y,className:g,children:[n&&i&&r.jsx(u.Form.Text,{id:C,className:"text-danger",children:i}),r.jsx(u.Form.Check,{type:"switch",...d,checked:!!t,isInvalid:n,"aria-describedby":C,onChange:x=>{o(x.target.checked)},label:l?r.jsxs("span",{children:[l,h&&" *"]}):void 0})]})},Je=e=>{const{list:t,options:o,idKey:n="value",nameKey:i="label",disabled:l,...h}=e,{value:d,onChange:f,isInvalid:g,error:C,label:y,required:x,mergedProps:w,submit:S,formId:v,className:k}=Y(h),p=o||t,[T,O]=m.useMemo(()=>{if(!p||!Array.isArray(p))return[null,null];if(p.length>0&&typeof p[0]=="string")return[p.map(L=>({value:L,label:L})),null];if(p.length>0&&typeof p[0]=="object"){const P=p==null?void 0:p.find(L=>!["number","string"].includes(typeof L[n])||!["number","string"].includes(typeof L[i]));if(P)return[null,P]}return[p,null]},[p,n,i]);if(!T)return console.error(`FormDropdown Error:
23
+ - Each item in 'list' must include a valid 'idKey' (${String(n)}) and 'nameKey' (${String(i)}).
24
+ - Both keys must exist on every item and be of type 'string' or 'number'.
25
+ - One or more items failed this check.
26
+
27
+ Received list:`,p,...O?["First mismatch:",O]:[]),null;T.find(P=>P[n]===d);const H=`${v}-${e.name}`;return r.jsxs(u.Form.Group,{controlId:H,className:k,children:[y&&r.jsxs(u.Form.Label,{children:[y,x&&" *"]}),g&&C&&r.jsx(u.Form.Text,{className:"text-danger",children:C}),r.jsx(u.Form.Select,{value:d||"",isInvalid:g,onChange:P=>f(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),S())},...w,children:T.map((P,L)=>r.jsx("option",{value:P[n],disabled:typeof l=="function"?l({list:T,value:P[n],state:{},initialState:{},initialValue:""}):l,children:P[i]},L))})]})},Ke=({selected:e=!0,disabled:t,cursor:o,onClick:n,style:i,bg:l,...h})=>r.jsx(u.Badge,{bg:l||(e?"primary":"secondary"),style:{userSelect:"none",...o?{cursor:o}:{},...i||{}},className:"mx-1",...t?{}:{onClick:n},...h}),$r=e=>{const{list:t,idKey:o="value",multiple:n,integer:i,disabled:l,className:h,...d}=e,{value:f,onChange:g,isInvalid:C,error:y,label:x,required:w,mergedProps:S,formId:v}=Y(d),k=n||n===!1?n:f instanceof Array,p=O=>i?parseInt(`${O}`):`${O}`,T=`${v}-${e.name}`;return t||console.error("Missing required list property in FormBadgesSelection"),r.jsxs(u.Form.Group,{controlId:T,className:h,children:[x&&r.jsxs(u.Form.Label,{children:[x,w&&" *"]}),C&&y&&r.jsx(u.Form.Text,{className:"text-danger",children:y}),r.jsx("div",{className:`form-control ${C?"is-invalid":""}`,children:t.map((O,H)=>{const P=k?!!f&&Array.isArray(f)&&f.includes(O[o]):f===O[o];return r.jsx(Ke,{disabled:typeof l=="function"?l({list:t,value:O[o],state:{},initialState:{},initialValue:""}):l,selected:P,cursor:"pointer",onClick:()=>{Array.isArray(f)?g(P?f.filter(L=>p(L)!==p(O[o])):[...f,i?parseInt(O[o]):`${O[o]}`]):g(O[o])},...S,children:O.label},H)})})]})},je=({show:e=!0,onHide:t,modalTitle:o="",dialogClassName:n="",width:i,submitText:l,cancelText:h,children:d})=>{const{formData:f,loading:g,submit:C,hasProvider:y}=ne(),{strings:x}=q();return y?f?r.jsxs(u.Modal,{show:e,onHide:t,onClick:w=>w.stopPropagation(),centered:!0,dialogClassName:`${n} ${i?`mw-100 w-${i}`:""}`,children:[o&&r.jsx(u.Modal.Header,{closeButton:!0,children:r.jsx(u.Modal.Title,{children:o})}),r.jsx(u.Modal.Body,{children:d||r.jsx(Xe,{})}),r.jsxs(u.Modal.Footer,{children:[g&&r.jsx(fe,{}),r.jsx(u.Button,{variant:"secondary",onClick:t,disabled:g,children:h||x.getString("close")}),r.jsx(u.Button,{variant:"primary",onClick:C,disabled:g,children:l||x.getString("save")})]})]}):null:(console.error("FormModal must be used within a FormProvider"),null)},Xe=()=>{const{formFields:e,hasProvider:t}=ne();return!t||!e?null:r.jsx(u.Form,{children:Object.entries(e).map(([o,n])=>{const i={name:o,label:n.label,placeholder:n.placeholder,required:n.required,...n.formProps};if(n.component){const l=n.component;return m.createElement(l,{...i,key:o})}return n.type==="select"&&n.options?m.createElement(Ge,{...i,options:n.options||[],key:o}):n.type==="dropdown"&&n.list?m.createElement(Je,{...i,list:n.list||[],idKey:n.idKey,nameKey:n.nameKey,key:o}):n.type==="checkbox"||n.type==="boolean"?m.createElement(We,{...i,key:o}):n.type==="textarea"?m.createElement(G,{...i,as:"textarea",rows:n.rows||3,key:o}):m.createElement(G,{...i,type:n.type==="number"?"number":"text",key:o})})})},Rr=({value:e})=>r.jsx(u.Form.Control,{as:"input",disabled:!0,value:e||""}),Ur={showCreateModal:()=>{console.error("The showCreateModal function should only be used in a child of the FormModalProvider component.")},showEditModal:e=>{console.error("The showEditModal function should only be used in a child of the FormModalProvider component.")},hasProvider:!1},oe=m.createContext(Ur),Qe=()=>m.useContext(oe),qr=({onClick:e,...t})=>{const o=m.useContext(oe);return r.jsx(Ae,{...t,onClick:n=>{if(e&&e(n),!o||!o.hasProvider){console.error("The showCreateModal function should only be used in a child of the FormModalProvider component.");return}o.showCreateModal()}})},Zr=({state:e,onClick:t,...o})=>{const n=m.useContext(oe);return r.jsx(Ne,{...o,onClick:i=>{if(t&&t(i),!n||!n.hasProvider){console.error("The showEditModal function should only be used in a child of the FormModalProvider component.");return}n.showEditModal(e)}})},Yr=({createModalTitle:e,editModalTitle:t,formFields:o,initialState:n,includeData:i,validate:l,loading:h=!1,onCreate:d,onUpdate:f,onSave:g,dialogClassName:C,width:y,children:x})=>{const[w,S]=m.useState(!1),[v,k]=m.useState(null),{strings:p}=q(),T=i||{},O=(L,A)=>{const N=d||g;N?N({...L,...T},()=>{S(!1),A&&A()}):(S(!1),A&&A())},H=(L,A)=>{const N=f||g;N?N({...L,...T},()=>{k(null),A&&A()}):(k(null),A&&A())},P=L=>L||n;return r.jsxs(oe.Provider,{value:{showCreateModal:L=>S(typeof L>"u"?!0:L),showEditModal:L=>k(L),hasProvider:!0},children:[x,w&&(d||g)&&r.jsx(be,{formFields:o,initialState:n||{},onSubmit:O,validate:l,loading:h,resetTrigger:w,children:r.jsx(je,{show:w,modalTitle:e||p.getString("modal_create"),onHide:()=>S(!1),dialogClassName:C,width:y})}),v&&(f||g)&&r.jsx(be,{formFields:o,initialState:P(v),onSubmit:H,validate:l,loading:h,resetTrigger:v,children:r.jsx(je,{show:!!v,modalTitle:t||p.getString("modal_edit"),onHide:()=>k(null),dialogClassName:C,width:y})})]})},Gr=({checked:e,className:t})=>r.jsx("h5",{...t?{className:t}:{},children:r.jsx(u.Badge,{bg:e?"success":"danger",children:e?r.jsx(Pe,{}):r.jsx(Oe,{})})}),Wr=({show:e,message:t,variant:o="info",position:n={top:"20px",right:"20px"},className:i="",style:l={}})=>{if(!e)return null;const h={position:"fixed",zIndex:1050,minWidth:"250px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",...n,...l};return r.jsx("div",{className:`alert alert-${o} ${i}`,style:h,children:r.jsxs("div",{className:"d-flex align-items-center",children:[r.jsx("div",{className:"spinner-border spinner-border-sm me-2",role:"status","aria-hidden":"true"}),t]})})},et={OBJECT:"object"},Jr=({droppedIndex:e,setDroppedIndex:t,onDrop:o,reset:n,index:i,movedIndex:l,moveNext:h,component:d,componentProps:f})=>{const g=m.useRef(null),[{handlerId:C},y]=we.useDrop({accept:et.OBJECT,collect(v){return{handlerId:v.getHandlerId()}},hover(v,k){var A;if(!g.current)return;const p=v.index,T=i;if(p===T)return;const O=(A=g.current)==null?void 0:A.getBoundingClientRect();if(!O)return;const H=(O.bottom-O.top)/2,P=k.getClientOffset();if(!P)return;const L=P.y-O.top;p<T&&L<H||p>T&&L>H||(h(p,T),v.index=T)},drop:(v,k)=>{t(l),o(l,i,n)}}),[{isDragging:x},w]=we.useDrag({type:et.OBJECT,item:()=>({componentProps:f,index:i}),collect:v=>({isDragging:v.isDragging()}),end:(v,k)=>{k.didDrop()||n()}}),S=x?0:1;return d?(w(y(g)),r.jsx(r.Fragment,{children:r.jsx(d,{onClick:()=>{},...f,ref:g,dropped:e===l,style:{...f.style||{},cursor:"move",opacity:S},"data-handler-id":C})})):null},tt=({onDrop:e,propsArray:t,component:o})=>{const[n,i]=m.useState(null),[l,h]=m.useState(null),d=ge(t),f=m.useCallback(()=>i(t.map((y,x)=>x)),[t]),g=Ze();m.useEffect(()=>{JSON.stringify(d)!==JSON.stringify(t)?f():g()},[d,t]);const C=m.useCallback((y,x)=>{n&&i(n.map((w,S)=>n[S===y?x:S===x?y:S]))},[n]);return o?r.jsx(r.Fragment,{children:n&&n.map((y,x)=>t[y]&&r.jsx(Jr,{movedIndex:y,index:x,moveNext:C,onDrop:e,reset:()=>f(),component:o,componentProps:t[y],droppedIndex:l,setDroppedIndex:h},y))}):null},ie=e=>r.jsx(u.Button,{variant:"outline-secondary",size:"sm",...e}),Kr=({data:e,columns:t,rowsPerPage:o=10,rowsPerPageOptions:n=[10,25,50,100,null],orderByDefault:i,orderByDefaultDirection:l="asc",onMove:h,moveId:d="id",moveIsLoading:f,showHeader:g=!0,onClickRow:C,showEditModalOnClickRow:y,textOnEmpty:x,className:w,rowClassName:S,style:v,showSum:k,...p})=>{const{showEditModal:T,hasProvider:O}=Qe();Object.keys(p).length!==0&&console.error("Unrecognised props:",p);const[H,P]=m.useState(""),[L,A]=m.useState(null),[N,ue]=m.useState(o),[B,M]=m.useState(0);let _=e&&Object.values(e).filter(c=>{if(!H)return!0;const b=new RegExp(H,"i");for(const{search:j}of t){if(!j)continue;let V="";if(typeof j=="function"?V=j(c):c[j]!==void 0&&(V=c[j]),V&&b.test(String(V)))return!0}return!1});const z=_&&N&&Math.ceil(_.length/N);m.useEffect(()=>{z&&B>=z&&M(z-1)},[M,z,B]);const{strings:$}=q(),Z=!L&&!!h;if(!_||!t)return null;if(L){const{column:c}=L;typeof c=="function"?_.sort((b,j)=>c(b)>c(j)!=(L.order==="asc")?-1:1):_.sort((b,j)=>b[c]>j[c]!=(L.order==="asc")?-1:1)}else if(i){const c=l==="asc"?1:-1;typeof i=="function"?_.sort((b,j)=>i(b)>i(j)?c:-c):_.sort((b,j)=>b[i]>j[i]?c:-c)}z&&(_=_.slice(B*N,(B+1)*N));const J=m.forwardRef(({row:c},b)=>r.jsx("tr",{ref:b,...typeof S=="string"?{className:S}:typeof S=="function"?{className:S(c)}:{},...typeof C=="function"||T?{onClick:()=>{C&&C(c),O&&y&&T(c)}}:{},children:t.map(({selector:j,className:V,onClick:D},R)=>r.jsx("td",{className:V,...typeof D=="function"?{onClick:()=>{D&&D(c)}}:{},children:typeof j=="function"?j(c):c[j]},R))})),ae=m.useMemo(()=>t.map(({value:c})=>c&&_.reduce((b,j)=>b+(typeof c=="function"?c(j):j[c]),0)),[t,_]);if(!J)return null;const W=g&&g.customHeader,K=W?4:6,s=W?3:4;return r.jsxs("div",{style:v,className:w,children:[g&&r.jsxs(u.Row,{className:"mb-4",children:[(g===!0||g.search)&&r.jsx(u.Col,{xs:12,lg:s,className:"d-flex flex-col justify-content-end align-items-end",children:r.jsxs(u.InputGroup,{children:[r.jsx(u.Form.Control,{type:"text",name:"table-filter",value:H,placeholder:$.getString("search"),onChange:c=>P(c.target.value)}),r.jsx(De,{variant:"outline-secondary",size:"sm",onClick:()=>P("")})]})}),(g===!0||g.numberOfRows)&&r.jsx(u.Col,{xs:12,sm:K,lg:s,className:"d-flex flex-col justify-content-lg-center align-items-center justify-content-sm-start mb-2 mb-sm-0",children:r.jsxs(u.Form.Group,{children:[r.jsx(u.Form.Label,{children:$.getString("number_of_rows")}),r.jsx(u.Form.Select,{name:"table-pagination-options",value:N===null?"everything":`${N}`,as:"select",onChange:c=>ue(c.target.value==="everything"?null:parseInt(c.target.value)),children:n.map((c,b)=>r.jsx("option",{value:c===null?"everything":c,children:c===null?$.getString("everything"):c},b))})]})}),(g===!0||g.pagination)&&r.jsx(u.Col,{xs:12,sm:K,lg:s,className:"d-flex flex-col justify-content-end align-items-end",children:r.jsxs(u.ButtonGroup,{children:[r.jsx(ie,{disabled:!z||B===0,onClick:()=>M(0),children:"<<"}),r.jsx(ie,{disabled:!z||B===0,onClick:()=>M(B-1),children:"<"}),r.jsx(ie,{children:z?B+1:1}),r.jsx(ie,{disabled:!z||B>=z-1,onClick:()=>M(B+1),children:">"}),r.jsx(ie,{disabled:!z||B>=z-1,onClick:()=>M(typeof z=="number"?z-1:0),children:">>"})]})}),W&&r.jsx(u.Col,{xs:12,sm:K,lg:s,className:"d-flex flex-col justify-content-end align-items-end",children:W})]}),r.jsxs(u.Table,{striped:_.length!==0,bordered:!0,hover:!0,responsive:!0,children:[r.jsx("thead",{children:r.jsx("tr",{children:t.map(({name:c,orderBy:b,optionsDropdown:j,className:V},D)=>j?r.jsx("th",{className:V,style:{cursor:"pointer"},children:r.jsxs(u.Dropdown,{children:[r.jsx(u.Dropdown.Toggle,{as:"span",children:j.selected?j.options[j.selected]:c}),r.jsx(u.Dropdown.Menu,{children:Object.entries(j.options).map(([R,X])=>r.jsx(u.Dropdown.Item,{eventKey:R,onClick:()=>j.onSelect(j.selected!==R?R:null),active:R===j.selected,children:X===null?$.getString("everything"):X},R))})]})},D):b?!L||L.column!==b?r.jsxs("th",{className:V,style:{cursor:"pointer"},onClick:()=>A({order:"asc",column:b}),children:[c,r.jsx(ze,{})]},D):L.order==="asc"?r.jsxs("th",{className:V,style:{cursor:"pointer"},onClick:()=>A({order:"desc",column:b}),children:[c,r.jsx(Te,{})]},D):r.jsxs("th",{className:V,style:{cursor:"pointer"},onClick:()=>A(null),children:[c,r.jsx(ke,{})]},D):r.jsx("th",{className:V,children:c},D))})}),r.jsxs("tbody",{...Z?{style:{cursor:"move"}}:{},children:[_.length===0&&r.jsx("tr",{children:r.jsx("td",{colSpan:t.length,style:{textAlign:"center",margin:"15px"},children:r.jsx("i",{children:x||$.getString("no_information_to_display")})})}),Z?r.jsx(tt,{component:J,propsArray:_&&_.map(c=>({row:c,onClick:()=>{}}))||[],onDrop:(c,b,j)=>{const V=_[c],D=_[b];V[d]===D[d]||f||h({item:V,target:D,reset:j})}}):_.map((c,b)=>r.jsx(J,{row:c},b))]}),k&&r.jsx("tfoot",{children:r.jsx("tr",{children:t.map(({value:c,formatSum:b},j)=>r.jsx("td",{children:c?typeof b=="function"?b(ae[j]):ae[j]:b},j))})})]})]})},Xr=({className:e="",value:t,onChange:o,onClear:n,onSearch:i,label:l,placeholder:h})=>{const{strings:d}=q();return r.jsxs(u.Form.Group,{children:[l&&r.jsx(u.Form.Label,{children:l}),r.jsxs(u.InputGroup,{...e?{className:e}:{},children:[r.jsx(u.Form.Control,{value:t,placeholder:h!==!1?h||d.getString("search"):void 0,onChange:f=>o(f.target.value)}),n&&r.jsx(Be,{variant:"outline-secondary",onClick:()=>n()}),i&&r.jsx(Ie,{variant:"outline-secondary",onClick:()=>i()})]})]})},Qr=({children:e})=>r.jsx(u.Container,{children:r.jsx(u.Row,{className:"error-page",children:r.jsx(u.Col,{children:r.jsx("div",{style:{padding:"2rem 1rem",marginBottom:"2rem",backgroundColor:"#e9ecef",borderRadius:".3rem"},children:e})})})}),en=e=>{const t=new CustomEvent("customError",{detail:e});window.dispatchEvent(t)},rt="The useError hook should only be used in a child of the ErrorBoundary component.",tn={error:rt,clearError:()=>console.error(rt)},ye=m.createContext(tn),rn=()=>m.useContext(ye),nn=({children:e})=>{const[t,o]=m.useState(null);return m.useEffect(()=>{const n=i=>{const h=i.detail;o(h)};return window.addEventListener("customError",n),()=>window.removeEventListener("customError",n)},[]),r.jsx(ye.Provider,{value:{error:t,clearError:()=>o(null)},children:e})},on=({onSubmit:e,isAuthenticated:t,label:o,onResetPassword:n,callback:i})=>{const[l,h]=ve({email:"",password:""}),{strings:d}=q(),f=!l.email||!l.password,g=()=>{f||e(l,i)};return t?null:r.jsx(u.Container,{children:r.jsxs(u.Row,{className:"login",children:[r.jsx(u.Col,{md:2}),r.jsxs(u.Col,{md:8,children:[o||r.jsx("h1",{children:d.getString("login")}),r.jsxs(u.Form,{children:[r.jsxs(u.Form.Group,{className:"mb-3",children:[r.jsx(u.Form.Label,{children:d.getString("your_email")}),r.jsx(u.Form.Control,{name:"email",value:l.email,onChange:C=>h({email:C.target.value}),placeholder:d.getString("enter_email"),onKeyDown:C=>C.key==="Enter"&&g()})]}),r.jsxs(u.Form.Group,{className:"mb-3",children:[r.jsx(u.Form.Label,{children:d.getString("your_password")}),r.jsx(u.Form.Control,{type:"password",name:"password",value:l.password,onChange:C=>h({password:C.target.value}),placeholder:d.getString("enter_password"),onKeyDown:C=>C.key==="Enter"&&g()})]})]}),r.jsx(u.Button,{onClick:g,disabled:f,children:d.getString("login")}),r.jsxs("p",{className:"mt-2",children:[d.getString("forgot_password")," ",typeof n=="string"?r.jsx("a",{href:n,children:d.getString("reset_password")}):r.jsx("span",{onClick:n,className:"reset-password",children:d.getString("reset_password")})]})]}),r.jsx(u.Col,{md:2})]})})},an=()=>Math.round(new Date().getTime()/1e3),ln=()=>{const e=new Date,t=de.toZonedTime(e,"UTC");return U.startOfDay(t)},sn=(e,t="yyyy-MM-dd")=>{const o=typeof e=="string"?U.parseISO(e):e;return U.isValid(o)?U.format(o,t):""},cn=(e,t="yyyy-MM-dd HH:mm")=>{const o=typeof e=="string"?U.parseISO(e):e;return U.isValid(o)?U.format(o,t):""},un=(e,t)=>{const o=typeof e=="string"?U.parseISO(e):e;return t?de.fromZonedTime(o,t):o},dn=(e,t)=>{const o=typeof e=="string"?U.parseISO(e):e;return de.toZonedTime(o,t)};a.BadgeSelection=Ke,a.BigSpinner=Sr,a.CheckButton=qt,a.CheckIndicator=Gr,a.CloseButton=De,a.CogButton=Gt,a.ConfirmButton=qe,a.CopyButton=Zt,a.CreateButton=Ae,a.CreateFileButton=Kt,a.CreateFolderButton=Wt,a.CreateSubFolderButton=Jt,a.DataTable=Kr,a.DeleteButton=He,a.DeleteConfirmButton=Fr,a.DisabledFormField=Rr,a.DownButton=Xt,a.DownloadButton=Qt,a.DragAndDropList=tt,a.DropdownButton=jr,a.EditButton=Ne,a.ErrorBoundary=nn,a.ErrorContext=ye,a.ErrorPage=Qr,a.FixedLoadingIndicator=Wr,a.FlagButton=er,a.FormBadgesSelection=$r,a.FormCheckbox=We,a.FormCreateModalButton=qr,a.FormDate=Nr,a.FormDateTime=Ir,a.FormDropdown=Je,a.FormEditModalButton=Zr,a.FormField=Ar,a.FormFieldsRenderer=Xe,a.FormInput=G,a.FormModal=je,a.FormModalContext=oe,a.FormModalProvider=Yr,a.FormProvider=be,a.FormSelect=Ge,a.FormSwitch=Br,a.FormTextarea=Hr,a.HideButton=tr,a.IconButton=Ve,a.LinkButton=rr,a.ListButton=nr,a.LoadingIndicator=wr,a.LocalizationContext=re,a.LocalizationProvider=xr,a.LoginPage=on,a.MenuButton=or,a.MoveButton=ir,a.NotesButton=ar,a.PasteButton=Yt,a.PencilButton=lr,a.PlayButton=sr,a.QuestionnaireButton=br,a.ResetButton=yr,a.SaveButton=cr,a.SearchBox=Xr,a.SearchButton=Ie,a.ShowButton=ur,a.SmallSpinner=fe,a.SortButton=dr,a.SortDownButton=mr,a.SortUpButton=hr,a.StopButton=fr,a.SyncButton=gr,a.UnCheckButton=Be,a.UnlockButton=vr,a.UpButton=Cr,a.UploadButton=$e,a.UploadTextButton=pr,a.arrayToObject=kr,a.camelToSnakeCase=Pr,a.combineLocalization=Ue,a.defaultLanguages=Re,a.defaultLocalization=me,a.dispatchError=en,a.downloadFile=Vr,a.formatDate=sn,a.formatDateTime=cn,a.fromUtc=dn,a.getTimestamp=an,a.getToday=ln,a.isEmpty=Ce,a.makeIconButton=E,a.pluralToSingle=Or,a.round=zr,a.roundFixed=Tr,a.snakeToCamelCase=Mr,a.toUtc=un,a.useDebouncedEffect=Er,a.useError=rn,a.useForceUpdate=Ze,a.useForm=ne,a.useFormField=Y,a.useFormModal=Qe,a.useInterval=Lr,a.useLocalStorage=_r,a.useLocalization=q,a.usePrevious=ge,a.useSetState=ve,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
28
+ //# sourceMappingURL=index.umd.js.map