react-tailwind-table 1.1.2 → 1.2.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.
package/README.md CHANGED
@@ -16,6 +16,7 @@ A few features that comes with this table include
16
16
  - 5) Bulk Item Action
17
17
  - 6) Customizable table data display
18
18
  - 7) Full custom styling
19
+ - 8) Translatable texts and RTL support
19
20
 
20
21
 
21
22
  > Contents
@@ -45,6 +46,8 @@ A few features that comes with this table include
45
46
  - [Striped Table](#striped-table)
46
47
  - [Hover Indicator](#hover-indicator)
47
48
  - [Table With and Without Borders](#table-with-and-without-borders)
49
+ - [Translation](#translation)
50
+ - [RTL Support](#rtl-support)
48
51
  - [Customization and Custom Styling](#customization-and-custom-styling)
49
52
  - [Using In Your Component](#using-in-your-component)
50
53
  - [Looks and Feel](#looks-and-feel)
@@ -115,6 +118,11 @@ interface Iprop {
115
118
  export_modify?: (row: Irow, col: Icolumn, display_value: string) => string,
116
119
  on_bulk_action?: (selected_option: string, selected: Irow[]) => void,
117
120
 
121
+ search_placeholder?: string,
122
+ bulk_select_placeholder?: string,
123
+ pagination_info?: (info: { from: number, to: number, total: number }) => React.ReactNode,
124
+ dir?: 'ltr' | 'rtl' | 'auto',
125
+
118
126
  //This will be discussed properly in the course of the documentation
119
127
  styling ?: ItableStyle
120
128
  }
@@ -372,6 +380,55 @@ A `bg-gray-50` color can be applied on a row when the mouse hovered over it. Con
372
380
  The borders of a the table can be controlled with the `bordered` prop.
373
381
 
374
382
 
383
+ ### Translation
384
+
385
+ Every text shown by the table can be changed, so the table can be used in any language.
386
+
387
+ | Prop | Default | Where it shows |
388
+ | --- | --- | --- |
389
+ | `search_placeholder` | `SEARCH` | Placeholder of the search input |
390
+ | `bulk_select_placeholder` | `Select ...` | First option of the bulk action dropdown |
391
+ | `bulk_select_button_text` | `Apply` | Bulk action button |
392
+ | `export_text` | `Export` | CSV export button |
393
+ | `no_content_text` | `No Data Availaible` | Shown when there are no rows |
394
+ | `pagination_info` | `Showing {from} to {to} of {total} entries` | Footer statistics |
395
+
396
+ `pagination_info` is a function, because word order differs between languages. It receives the numbers of the current page and returns what should be displayed (a string or any React node):
397
+
398
+ ```jsx
399
+ <Table
400
+ columns={columns}
401
+ rows={rows}
402
+ search_placeholder="Rechercher"
403
+ bulk_select_placeholder="Choisir ..."
404
+ bulk_select_button_text="Appliquer"
405
+ export_text="Exporter"
406
+ no_content_text="Aucune donnée"
407
+ pagination_info={({ from, to, total }) => <>Affichage de <b>{from}</b> à <b>{to}</b> sur <b>{total}</b> entrées</>}
408
+ />
409
+ ```
410
+
411
+ When `pagination_info` is used, the `styling.footer.statistics.bold_numbers` classes are not applied, since you control the markup.
412
+
413
+
414
+ ### RTL Support
415
+
416
+ The table supports right-to-left languages such as Arabic and Hebrew. The layout (columns, padding, search icon, pagination arrows, etc.) follows the text direction:
417
+
418
+ - If your page already sets the direction, e.g. `<html dir="rtl">`, the table follows it automatically.
419
+ - To set the direction of a single table, use the `dir` prop: `'ltr'`, `'rtl'` or `'auto'`.
420
+
421
+ ```jsx
422
+ <Table
423
+ dir="rtl"
424
+ columns={columns}
425
+ rows={rows}
426
+ search_placeholder="חיפוש"
427
+ pagination_info={({ from, to, total }) => `מציג ${from} עד ${to} מתוך ${total} רשומות`}
428
+ />
429
+ ```
430
+
431
+
375
432
 
376
433
  ## Customization and Custom Styling
377
434
 
package/dist/index.css CHANGED
@@ -560,6 +560,40 @@ video {
560
560
  border-color:rgba(229, 231, 235, var(--tw-border-opacity));
561
561
  }
562
562
 
563
+ .container{
564
+ width:100%;
565
+ }
566
+
567
+ @media (min-width: 640px){
568
+ .container{
569
+ max-width:640px;
570
+ }
571
+ }
572
+
573
+ @media (min-width: 768px){
574
+ .container{
575
+ max-width:768px;
576
+ }
577
+ }
578
+
579
+ @media (min-width: 1024px){
580
+ .container{
581
+ max-width:1024px;
582
+ }
583
+ }
584
+
585
+ @media (min-width: 1280px){
586
+ .container{
587
+ max-width:1280px;
588
+ }
589
+ }
590
+
591
+ @media (min-width: 1536px){
592
+ .container{
593
+ max-width:1536px;
594
+ }
595
+ }
596
+
563
597
  .pointer-events-none{
564
598
  pointer-events:none;
565
599
  }
@@ -581,10 +615,6 @@ video {
581
615
  bottom:0px;
582
616
  }
583
617
 
584
- .right-0{
585
- right:0px;
586
- }
587
-
588
618
  .order-first{
589
619
  order:-9999;
590
620
  }
@@ -605,10 +635,6 @@ video {
605
635
  margin-top:1.5rem;
606
636
  }
607
637
 
608
- .mr-2{
609
- margin-right:0.5rem;
610
- }
611
-
612
638
  .mb-1{
613
639
  margin-bottom:0.25rem;
614
640
  }
@@ -617,14 +643,6 @@ video {
617
643
  margin-bottom:0.5rem;
618
644
  }
619
645
 
620
- .ml-1{
621
- margin-left:0.25rem;
622
- }
623
-
624
- .ml-2{
625
- margin-left:0.5rem;
626
- }
627
-
628
646
  .block{
629
647
  display:block;
630
648
  }
@@ -717,21 +735,6 @@ video {
717
735
  border-collapse:collapse;
718
736
  }
719
737
 
720
- .transform{
721
- --tw-translate-x:0;
722
- --tw-translate-y:0;
723
- --tw-rotate:0;
724
- --tw-skew-x:0;
725
- --tw-skew-y:0;
726
- --tw-scale-x:1;
727
- --tw-scale-y:1;
728
- transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
729
- }
730
-
731
- .rotate-180{
732
- --tw-rotate:180deg;
733
- }
734
-
735
738
  @-webkit-keyframes spin{
736
739
  to{
737
740
  transform:rotate(360deg);
@@ -852,10 +855,6 @@ video {
852
855
  border-width:1px;
853
856
  }
854
857
 
855
- .border-r{
856
- border-right-width:1px;
857
- }
858
-
859
858
  .border-b{
860
859
  border-bottom-width:1px;
861
860
  }
@@ -954,30 +953,10 @@ video {
954
953
  padding-bottom:0.875rem;
955
954
  }
956
955
 
957
- .pr-4{
958
- padding-right:1rem;
959
- }
960
-
961
- .pr-8{
962
- padding-right:2rem;
963
- }
964
-
965
956
  .pb-5{
966
957
  padding-bottom:1.25rem;
967
958
  }
968
959
 
969
- .pl-4{
970
- padding-left:1rem;
971
- }
972
-
973
- .pl-6{
974
- padding-left:1.5rem;
975
- }
976
-
977
- .text-left{
978
- text-align:left;
979
- }
980
-
981
960
  .text-center{
982
961
  text-align:center;
983
962
  }
@@ -1098,6 +1077,69 @@ video {
1098
1077
  filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
1099
1078
  }
1100
1079
 
1080
+ .text-start{
1081
+ text-align:start
1082
+ }
1083
+
1084
+ .ps-4{
1085
+ -webkit-padding-start:1rem;
1086
+ padding-inline-start:1rem
1087
+ }
1088
+
1089
+ .ps-6{
1090
+ -webkit-padding-start:1.5rem;
1091
+ padding-inline-start:1.5rem
1092
+ }
1093
+
1094
+ .pe-4{
1095
+ -webkit-padding-end:1rem;
1096
+ padding-inline-end:1rem
1097
+ }
1098
+
1099
+ .pe-8{
1100
+ -webkit-padding-end:2rem;
1101
+ padding-inline-end:2rem
1102
+ }
1103
+
1104
+ .ms-1{
1105
+ -webkit-margin-start:.25rem;
1106
+ margin-inline-start:.25rem
1107
+ }
1108
+
1109
+ .ms-2{
1110
+ -webkit-margin-start:.5rem;
1111
+ margin-inline-start:.5rem
1112
+ }
1113
+
1114
+ .me-2{
1115
+ -webkit-margin-end:.5rem;
1116
+ margin-inline-end:.5rem
1117
+ }
1118
+
1119
+ .end-0{
1120
+ inset-inline-end:0
1121
+ }
1122
+
1123
+ .border-e{
1124
+ border-inline-end-width:1px
1125
+ }
1126
+
1127
+ :where(.rtt-head-row>th){
1128
+ text-align:inherit
1129
+ }
1130
+
1131
+ .rtt-arrow-back{
1132
+ transform:scaleX(-1)
1133
+ }
1134
+
1135
+ .rtt-arrow-back:dir(rtl){
1136
+ transform:none
1137
+ }
1138
+
1139
+ .rtt-arrow-next:dir(rtl){
1140
+ transform:scaleX(-1)
1141
+ }
1142
+
1101
1143
  @media (min-width: 640px){
1102
1144
  }
1103
1145
 
package/dist/index.js CHANGED
@@ -6,5 +6,5 @@ var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e;
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */}var i="function"==typeof Symbol&&Symbol.for,l=i?Symbol.for("react.element"):60103,c=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,u=i?Symbol.for("react.strict_mode"):60108,p=i?Symbol.for("react.profiler"):60114,f=i?Symbol.for("react.provider"):60109,m=i?Symbol.for("react.context"):60110,d=i?Symbol.for("react.async_mode"):60111,b=i?Symbol.for("react.concurrent_mode"):60111,_=i?Symbol.for("react.forward_ref"):60112,g=i?Symbol.for("react.suspense"):60113,y=i?Symbol.for("react.suspense_list"):60120,v=i?Symbol.for("react.memo"):60115,h=i?Symbol.for("react.lazy"):60116,w=i?Symbol.for("react.block"):60121,x=i?Symbol.for("react.fundamental"):60117,E=i?Symbol.for("react.responder"):60118,k=i?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case l:switch(e=e.type){case d:case b:case s:case p:case u:case g:return e;default:switch(e=e&&e.$$typeof){case m:case _:case h:case v:case f:return e;default:return t}}case c:return t}}}function S(e){return C(e)===b}var O={AsyncMode:d,ConcurrentMode:b,ContextConsumer:m,ContextProvider:f,Element:l,ForwardRef:_,Fragment:s,Lazy:h,Memo:v,Portal:c,Profiler:p,StrictMode:u,Suspense:g,isAsyncMode:function(e){return S(e)||C(e)===d},isConcurrentMode:S,isContextConsumer:function(e){return C(e)===m},isContextProvider:function(e){return C(e)===f},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===l},isForwardRef:function(e){return C(e)===_},isFragment:function(e){return C(e)===s},isLazy:function(e){return C(e)===h},isMemo:function(e){return C(e)===v},isPortal:function(e){return C(e)===c},isProfiler:function(e){return C(e)===p},isStrictMode:function(e){return C(e)===u},isSuspense:function(e){return C(e)===g},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===s||e===b||e===p||e===u||e===g||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===v||e.$$typeof===f||e.$$typeof===m||e.$$typeof===_||e.$$typeof===x||e.$$typeof===E||e.$$typeof===k||e.$$typeof===w)},typeOf:C},j=a(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,_=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function h(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var m=e.type;switch(m){case s:case u:case o:case i:case a:case f:return m;default:var _=m&&m.$$typeof;switch(_){case c:case p:case b:case d:case l:return _;default:return t}}case r:return t}}}var w=u,x=c,E=l,k=n,C=p,S=o,O=b,j=d,N=r,P=i,$=a,R=f,T=!1;function A(e){return h(e)===u}t.AsyncMode=s,t.ConcurrentMode=w,t.ContextConsumer=x,t.ContextProvider=E,t.Element=k,t.ForwardRef=C,t.Fragment=S,t.Lazy=O,t.Memo=j,t.Portal=N,t.Profiler=P,t.StrictMode=$,t.Suspense=R,t.isAsyncMode=function(e){return T||(T=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),A(e)||h(e)===s},t.isConcurrentMode=A,t.isContextConsumer=function(e){return h(e)===c},t.isContextProvider=function(e){return h(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return h(e)===p},t.isFragment=function(e){return h(e)===o},t.isLazy=function(e){return h(e)===b},t.isMemo=function(e){return h(e)===d},t.isPortal=function(e){return h(e)===r},t.isProfiler=function(e){return h(e)===i},t.isStrictMode=function(e){return h(e)===a},t.isSuspense=function(e){return h(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===u||e===i||e===a||e===f||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===d||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===g||e.$$typeof===y||e.$$typeof===v||e.$$typeof===_)},t.typeOf=h}()}),N=a(function(e){e.exports="production"===process.env.NODE_ENV?O:j}),P=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;function T(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var A=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,o=T(e),a=1;a<arguments.length;a++){for(var i in n=Object(arguments[a]))$.call(n,i)&&(o[i]=n[i]);if(P){r=P(n);for(var l=0;l<r.length;l++)R.call(n,r[l])&&(o[r[l]]=n[r[l]])}}return o},M="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",V=function(){};if("production"!==process.env.NODE_ENV){var F=M,L={},I=Function.call.bind(Object.prototype.hasOwnProperty);V=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function z(e,t,n,r,o){if("production"!==process.env.NODE_ENV)for(var a in e)if(I(e,a)){var i;try{if("function"!=typeof e[a]){var l=Error((r||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.");throw l.name="Invariant Violation",l}i=e[a](t,a,r,n,null,F)}catch(e){i=e}if(!i||i instanceof Error||V((r||"React class")+": type specification of "+n+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in L)){L[i.message]=!0;var c=o?o():"";V("Failed "+n+" type: "+i.message+(null!=c?c:""))}}}z.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(L={})};var B=z,D=Function.call.bind(Object.prototype.hasOwnProperty),q=function(){};function H(){return null}function U(){}function W(){}"production"!==process.env.NODE_ENV&&(q=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),W.resetWarningCache=U;var Z=a(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={array:l("array"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:i(H),arrayOf:function(e){return i(function(t,n,r,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var l=t[n];if(!Array.isArray(l))return new a("Invalid "+o+" `"+i+"` of type `"+s(l)+"` supplied to `"+r+"`, expected an array.");for(var c=0;c<l.length;c++){var u=e(l,c,r,o,i+"["+c+"]",M);if(u instanceof Error)return u}return null})},element:i(function(t,n,r,o,i){var l=t[n];return e(l)?null:new a("Invalid "+o+" `"+i+"` of type `"+s(l)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:i(function(e,t,n,r,o){var i=e[t];return N.isValidElementType(i)?null:new a("Invalid "+r+" `"+o+"` of type `"+s(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return i(function(t,n,r,o,i){var l;return t[n]instanceof e?null:new a("Invalid "+o+" `"+i+"` of type `"+((l=t[n]).constructor&&l.constructor.name?l.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:i(function(e,t,n,r,o){return c(e[t])?null:new a("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return i(function(t,n,r,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var l=t[n],c=s(l);if("object"!==c)return new a("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+r+"`, expected an object.");for(var u in l)if(D(l,u)){var p=e(l,u,r,o,i+"."+u,M);if(p instanceof Error)return p}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&q(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),H;function t(t,n,r,i,l){for(var c=t[n],s=0;s<e.length;s++)if(o(c,e[s]))return null;var p=JSON.stringify(e,function(e,t){return"symbol"===u(t)?String(t):t});return new a("Invalid "+i+" `"+l+"` of value `"+String(c)+"` supplied to `"+r+"`, expected one of "+p+".")}return i(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&q("Invalid argument supplied to oneOfType, expected an instance of array."),H;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return q("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(n)+" at index "+t+"."),H}return i(function(t,n,r,o,i){for(var l=0;l<e.length;l++)if(null==(0,e[l])(t,n,r,o,i,M))return null;return new a("Invalid "+o+" `"+i+"` supplied to `"+r+"`.")})},shape:function(e){return i(function(t,n,r,o,i){var l=t[n],c=s(l);if("object"!==c)return new a("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");for(var u in e){var p=e[u];if(p){var f=p(l,u,r,o,i+"."+u,M);if(f)return f}}return null})},exact:function(e){return i(function(t,n,r,o,i){var l=t[n],c=s(l);if("object"!==c)return new a("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var u=A({},t[n],e);for(var p in u){var f=e[p];if(!f)return new a("Invalid "+o+" `"+i+"` key `"+p+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=f(l,p,r,o,i+"."+p,M);if(m)return m}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function a(e){this.message=e,this.stack=""}function i(e){function t(t,n,r,o,i,l,c){if(o=o||"<<anonymous>>",l=l||r,c!==M){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}return null==n[r]?t?new a(null===n[r]?"The "+i+" `"+l+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+i+" `"+l+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,r,o,i,l)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function l(e){return i(function(t,n,r,o,i,l){var c=t[n];return s(c)!==e?new a("Invalid "+o+" `"+i+"` of type `"+u(c)+"` supplied to `"+r+"`, expected `"+e+"`."):null})}function c(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(c);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,a=r.call(t);if(r!==t.entries){for(;!(o=a.next()).done;)if(!c(o.value))return!1}else for(;!(o=a.next()).done;){var i=o.value;if(i&&!c(i[1]))return!1}return!0;default:return!1}}function s(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function u(e){if(null==e)return""+e;var t=s(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function p(e){var t=u(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return a.prototype=Error.prototype,r.checkPropTypes=B,r.resetWarningCache=B.resetWarningCache,r.PropTypes=r,r}(N.isElement):function(){function e(e,t,n,r,o,a){if(a!==M){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:W,resetWarningCache:U};return n.PropTypes=n,n}()}),J=function(){function e(){}return e.ltrim=function(t,n,r,o,a){return void 0===o&&(o=!1),void 0===a&&(a=!1),e.trim(t,n,r,o,"l",a)},e.isInteger=function(e){return(Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e})(e)},e.rtrim=function(t,n,r,o,a){return void 0===o&&(o=!1),void 0===a&&(a=!1),e.trim(t,n,r,o,"r",a)},e.trim=function(t,n,r,o,a,i){void 0===o&&(o=!1),void 0===i&&(i=!1),!i&&e.regex_special.includes(n)&&(n="\\"+n);var l,c=o&&n?"*":"?";return l="r"===a?new RegExp("["+n+"]"+c+"$"):new RegExp("^["+n+"]"+c),t.replace(l,r)},e.isObjectEqual=function(t,n){var r=Object.prototype.toString.call(t);if(r!==Object.prototype.toString.call(n))return!1;if(["[object Array]","[object Object]"].indexOf(r)<0)return!1;var o="[object Array]"===r?t.length:Object.keys(t).length;if(o!==("[object Array]"===r?n.length:Object.keys(n).length))return!1;if(t===n)return!0;if("[object Array]"===r){for(var a=0;a<o;a++)if(!1===e.compare(t[a],n[a]))return!1}else for(var i in t)if(t.hasOwnProperty(i)&&!1===e.compare(t[i],n[i]))return!1;return!0},e.compare=function(t,n){var r=Object.prototype.toString.call(t);if("[object Array]"===r&&!e.isObjectEqual(t,n))return!1;if("[object Object]"===r){if(!e.isObjectEqual(t,n))return!1}else{if(r!==Object.prototype.toString.call(n))return!1;if("[object Function]"===r){if(t.toString()!==n.toString())return!1}else if(t!==n)return!1}return!0},e.isEven=function(e){return 0==(1&e)},e.limit=function(e,t,n){var r;function o(o){var a=this,i=arguments,l=function(){r=void 0,e.apply(a,i)};n&&window.clearTimeout(r),!n&&r||(r=window.setTimeout(l,t))}return o.clear=function(){return window.clearTimeout(r)},o},e.unwindObject=function(e,t){var n=t.split("."),o=n.length;if(o<=1)return e[t];for(var a=r({},e),i=0;i<o;)a=a[n[i]],i++;return a},e.generateCSV=function(t,n,r){var o=[],a="";return t.forEach(function(e){var t;!1!==e.use_in_export&&o.push(null!=(t=e.use)?t:e.field)}),a=o.join(",")+"\n",new Promise(function(o){n.forEach(function(n){var o=[];t.forEach(function(t){if(!1!==t.use_in_export){var a=e.unwindObject(n,t.field);r&&(a=r(n,t,a)),o.push('"'+a+'"')}}),o.length>0&&(a=a+o.join(",")+"\n")}),o(new Blob([a],{type:"octet/stream"}))})},e.stringifyObjectValues=function(t){return null==t?"":t instanceof Object&&!(t instanceof Date)?Object.keys(t).sort().filter(function(e){return null!=e}).map(function(n){return e.stringifyObjectValues(t[n])}).join(" "):String(t)},e.sanitizeRow=function(t,n){for(var r={},o=0,a=n.length;o<a;++o)!1!==n[o].use_in_search&&(r[n[o].field]=e.unwindObject(t,n[o].field));return r},e.stringifyRowValues=function(t,n){return"object"==typeof t&&null!==t?e.stringifyObjectValues(e.sanitizeRow(t,n)):""},e.filterFunction=function(t,n){return function(r){return e.stringtoRegEx(t).test(e.stringifyRowValues(r,n))}},e.stringtoRegEx=function(t){return t=e.matchMultipleSpace(e.escapeRegExp(t)),new RegExp(".*"+t+".*","i")},e.matchMultipleSpace=function(t){return t.replace(e.RX_SPACES$1,"\\s+")},e.escapeRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},e.TableNumberLinks=function(e,t,n){if(void 0===t&&(t=2),t<1)throw Error("The rows per page must be greater than or equal to one(1)");for(var r,o,a=t,i=e.length,l=Math.ceil(i/a),c=0,s=0,u=[],p={},f=e.length,m=0;m<l;++m){o=i-(r=a*++s),u.push(s);var d=e.slice(c,r);p[s]={page_row_array:d,back_button_clickable:1!==s,forward_button_clickable:!1,is_active:n?n.active_number===s:1===s,from_index:c,checked_set:n&&n.page_map?n.page_map[s].checked_set:new Set},o>0&&(p[s].forward_button_clickable=!0),d=null,c=r}return{page_map:p,page_number_list:u,total_data_count:f}},e}();function X(e){var t=e.uppercase,r=e.px,o=e.py,a=e.bg_color,i=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,["uppercase","className","text","px","py","children","bg_color"]),l=(t?"uppercase ":" ")+" "+(r||"px-5")+" "+(r||"px-5")+" "+(o||"py-2")+"\n\t\t\t\t "+a+" \n\t\t\t\t appearance-none text-white rounded";return e.className&&(l=l+" "+e.className),n.createElement("button",Object.assign({className:l},i),e.children?e.children:e.text)}function Y(e){return n.createElement("svg",Object.assign({viewBox:"0 0 512 512"},e,{xmlns:"http://www.w3.org/2000/svg"}),n.createElement("path",{d:"m452 512h-392c-33.085938 0-60-26.914062-60-60v-392c0-33.085938 26.914062-60 60-60h392c33.085938 0 60 26.914062 60 60v392c0 33.085938-26.914062 60-60 60zm-392-472c-11.027344 0-20 8.972656-20 20v392c0 11.027344 8.972656 20 20 20h392c11.027344 0 20-8.972656 20-20v-392c0-11.027344-8.972656-20-20-20zm370.898438 111.34375-29.800782-26.6875-184.964844 206.566406-107.351562-102.046875-27.558594 28.988281 137.21875 130.445313zm0 0"}))}function G(e){return n.createElement("svg",Object.assign({},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 15.381 15.381"}),n.createElement("path",{d:"M12.016 15.381h-8.65A2.83 2.83 0 01.54 12.556v-9.73A2.83 2.83 0 013.366 0h8.65a2.829 2.829 0 012.825 2.826v9.73a2.828 2.828 0 01-2.825 2.825zM3.366 1.305c-.839 0-1.521.683-1.521 1.521v9.73c0 .838.683 1.521 1.521 1.521h8.65c.839 0 1.521-.684 1.521-1.521v-9.73c0-.839-.683-1.521-1.521-1.521h-8.65z"}))}function K(e){return n.createElement("svg",Object.assign({},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"}),n.createElement("path",{d:"M160.48 0h32v32h-32zM224.48 0h32v32h-32z"}),n.createElement("path",{d:"M432 0H288.464v32H432c26.51 0 48 21.49 48 48v352c0 26.51-21.49 48-48 48H80c-26.51 0-48-21.49-48-48V80c0-26.51 21.49-48 48-48h48.464V0H80C35.839.053.053 35.839 0 80v352c.053 44.161 35.839 79.947 80 80h352c44.161-.053 79.947-35.839 80-80V80c-.053-44.161-35.839-79.947-80-80z"}),n.createElement("path",{d:"M128 240h256v32H128z"}))}function Q(e){return n.createElement("svg",Object.assign({},e,{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),n.createElement("path",{d:"M13.6027 6.82763C13.55 6.8274 13.4977 6.83845 13.449 6.86013C13.4002 6.88182 13.3559 6.91371 13.3186 6.95396C13.2813 6.99422 13.2518 7.04204 13.2317 7.09468C13.2116 7.14732 13.2013 7.20373 13.2016 7.26066V11.1988C13.2009 11.7132 13.0113 12.2063 12.6744 12.57C12.3374 12.9337 11.8806 13.1383 11.4041 13.139H2.59988C2.12334 13.1383 1.66651 12.9337 1.32955 12.57C0.992586 12.2063 0.803007 11.7132 0.802382 11.1988V7.19614C0.802382 7.08129 0.760114 6.97115 0.684876 6.88993C0.609638 6.80872 0.507594 6.76309 0.401191 6.76309C0.294789 6.76309 0.192744 6.80872 0.117506 6.88993C0.0422682 6.97115 0 7.08129 0 7.19614V11.198C0.00166179 11.9406 0.275696 12.6522 0.76217 13.1773C1.24864 13.7024 1.90797 13.9982 2.59594 14H11.4041C12.092 13.9982 12.7514 13.7024 13.2378 13.1773C13.7243 12.6522 13.9983 11.9406 14 11.198V7.25982C13.9998 7.14585 13.958 7.03656 13.8836 6.95565C13.8092 6.87474 13.7083 6.82874 13.6027 6.82763Z"}),n.createElement("path",{d:"M7.28669 0.128207C7.21182 0.04706 7.11037 0.000998497 7.00428 -8.58307e-06C6.95166 -0.000116348 6.89955 0.0111771 6.85104 0.0332003C6.80253 0.0552235 6.7586 0.0875301 6.72187 0.128207L4.17234 2.88015C4.10036 2.96203 4.06085 3.07102 4.06222 3.18389C4.0636 3.29676 4.10575 3.40459 4.1797 3.48441C4.25365 3.56423 4.35355 3.60973 4.45812 3.61121C4.56268 3.61269 4.66366 3.57004 4.73952 3.49235L6.60308 1.48252L6.60308 10.2622C6.60308 10.3771 6.64536 10.4872 6.7206 10.5684C6.79584 10.6497 6.89788 10.6953 7.00428 10.6953C7.11069 10.6953 7.21273 10.6497 7.28797 10.5684C7.36321 10.4872 7.40547 10.3771 7.40547 10.2622L7.40547 1.48252L9.26825 3.49235C9.34412 3.57004 9.44509 3.61269 9.54966 3.61121C9.65423 3.60973 9.75413 3.56423 9.82808 3.48441C9.90202 3.40459 9.94418 3.29676 9.94555 3.18389C9.94693 3.07102 9.90741 2.96203 9.83543 2.88015L7.28669 0.128207Z"}))}function ee(e){return n.createElement("svg",Object.assign({},e,{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),n.createElement("path",{opacity:"0.5",fillRule:"evenodd",clipRule:"evenodd",d:"M12.764 11.6423L10.0844 8.99884C10.8382 8.05293 11.2918 6.86284 11.2918 5.56947C11.2918 2.4985 8.75914 0 5.64628 0C2.53269 0 0 2.4985 0 5.56947C0 8.63976 2.53269 11.1383 5.64628 11.1383C6.86596 11.1383 7.99377 10.7498 8.9183 10.0986L11.6232 12.7675C11.7809 12.9227 11.987 13 12.1939 13C12.4001 13 12.6063 12.9227 12.764 12.7675C13.0787 12.4569 13.0787 11.9535 12.764 11.6423ZM1.6127 5.56943C1.6127 3.37597 3.42269 1.59152 5.64648 1.59152C7.87027 1.59152 9.67881 3.37597 9.67881 5.56943C9.67881 7.76288 7.87027 9.54664 5.64648 9.54664C3.42269 9.54664 1.6127 7.76288 1.6127 5.56943Z",fill:"#626262"}))}function te(e){return n.createElement("tr",{className:(e.is_hovered?"hover:bg-gray-50 ":"")+" \n\t\t\t\t\t\t"+(e.is_bordered?"border-b border-gray-200 ":"")+" \n\t\t\t\t\t\t"+(J.isEven(e.index+1)&&e.is_striped?"bg-gray-50 ":"")+e.row_style},e.use_bulk_action&&n.createElement("td",{className:"px-2 py-4 pl-4 text-base "+e.data_style},n.createElement("input",{className:"w-4 h-4",type:"checkbox",checked:e.checked_set.has(e.index),onChange:function(t){return e.setCheck(e.active_page_number,e.index,t.target.checked)}})),e.columns.map(function(t,r){return n.createElement(ne,{key:r.toString(),col:t,row:e.row,render:e.render,style:e.data_style})}))}function ne(e){var t=J.unwindObject(e.row,e.col.field);return n.createElement("td",{className:"px-2 py-4 text-sm "+e.style},e.render&&e.render(e.row,e.col,t)||t)}function re(e){var t,r,o=e.active_page_number,a=0,i=0,l=!1,c=!1,s=!1;e.use_bulk_action&&(l=(a=null===(t=e.page_data)||void 0===t?void 0:t.page_row_array.length)===(i=null===(r=e.page_data)||void 0===r?void 0:r.checked_set.size)&&0!==a,c=i>0&&!l,s=0===i);var u=e.columns.filter(function(e){return!1!==e.use_in_display});return n.createElement("tr",{className:"bg-yellow-50 text-left "+e.row_style},e.use_bulk_action&&n.createElement("th",{className:"text-base font-semibold text-gray-700 py-3.5 px-2 pl-4 "+e.data_style},l&&n.createElement(Y,{onClick:function(){return e.mass_checking(o,"uncheck-all")},className:"bulk-checkbox fill-current w-5 h-5 cursor-pointer"}),c&&n.createElement(K,{onClick:function(){return e.mass_checking(o,"check-all")},className:"bulk-checkbox indeterminate fill-current w-5 h-5 cursor-pointer"}),s&&n.createElement(G,{onClick:function(){return e.mass_checking(o,"check-all")},className:"bulk-checkbox fill-current w-5 h-5 cursor-pointer"})),u.map(function(t,r){return n.createElement("th",{key:r.toString(),className:"text-base font-semibold text-black py-3.5 px-2 \n\t\t\t \t\t\t\t\t"+(e.use_bulk_action||0!==r?"":"pl-4 ")+"\n\t\t\t \t\t\t\t\t"+(r===u.length-1?"pr-4 ":"")+" "+e.data_style},t.use?t.use:t.field)}))}function oe(e){return n.createElement("div",{className:"flex mt-4 px-4 mb-1 text-base font-semibold tracking-wide leading-7 text-gray-700 "+e.style},n.createElement("h4",{className:" ml-1 react-table-top-caption"},e.text))}function ae(e){return n.createElement("div",{className:"relative flex items-center mt-3 md:mt-0 table-top-search"},n.createElement("input",{type:"text",name:"search",className:"text-xs py-2 h-10 px-4 pl-6 w-52 md:w-auto focus:outline-none leading-9 tracking-wide \n\t\t\ttext-gray-700 border border-gray-300 bg-gray-100 rounded-lg "+e.style,placeholder:"SEARCH",onChange:function(t){return e.onSearch(t.target.value)}}),n.createElement(ee,{className:"absolute w-2.5 h-2.5 ml-2",style:{top:"0.9rem"}}))}function ie(e){return n.createElement("div",{className:"export-btn flex items-center "+e.text_color+" cursor-pointer order-first md:order-none self-end md:self-auto "+e.style,onClick:function(){return function(e,t,n,r){try{var o,a=[];for(o in n+=".csv",e)a=a.concat(e[o].page_row_array);return Promise.resolve(J.generateCSV(t,a,r)).then(function(e){var t=window.URL.createObjectURL(e);if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(e,n);else{var r=document.createElement("a");r.setAttribute("href",t),r.setAttribute("download",n),document.body.appendChild(r),r.click(),setTimeout(function(){window.URL.revokeObjectURL(t),document.body.removeChild(r),a=null},0)}})}catch(e){return Promise.reject(e)}}(e.paginated_data,e.cols,e.file_name,e.processFunc)},id:"export-it"},n.createElement(Q,{className:"fill-current w-3 h-3 mr-2 "}),n.createElement("p",{className:"font-normal text-base"},e.export_text))}function le(e){return n.createElement(t.Fragment,null,e.children&&n.createElement("div",{className:"flex flex-col md:flex-row md:items-center py-2 justify-between px-4 mt-4 mb-2 react-table-top "+e.style},e.children))}function ce(e){var r=t.useState("nothing"),o=r[0],a=r[1],i="nothing"===o;return n.createElement("div",{className:"flex items-center mt-3 md:mt-0 bulk-select-dropdown"},n.createElement("div",{className:"w-52 md:w-48 relative mr-2 flex "},n.createElement("select",{onChange:function(e){a(e.target.value)},value:o,className:"leading-tight block appearance-none w-full bg-white flex-shrink \n\t\t\t\t\t\t\t\t border border-gray-200 px-3 py-2 pr-8 rounded "+e.dropdown_style},n.createElement("option",{value:"nothing"},"Select ..."),e.action_options.map(function(e,t){return n.createElement("option",{key:t.toString(),value:e},e)})),n.createElement("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-300"},n.createElement("svg",{className:"fill-current h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},n.createElement("path",{d:"M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"})))),n.createElement(X,{bg_color:e.bg_color,px:"px-4",className:"bulk-action-button "+(i?"opacity-50":"")+" leading-4 "+e.button_style,disabled:i,uppercase:!1,onClick:function(){i||e.eventSelected(o)}},e.button_text))}function se(e){var t=e.active_page,r=e.page_number_list,o=e.paginated_map,a=e.statistics_number_style,i=e.number_box_Style,l=e.page_number_list.length;function c(t){e.onPageChange(t)}function s(n){"nxt"===n&&o[t].forward_button_clickable?e.onPageChange(t+1):"bck"===n&&o[t].back_button_clickable&&e.onPageChange(t-1)}return l>0?n.createElement("div",{className:"flex flex-col md:flex-row justify-between mt-6 items-center px-2 w-full md:w-auto "+e.main_style},n.createElement("div",null,n.createElement("p",{className:"text-sm "+e.statistics_main_style},"Showing",n.createElement("span",{className:"font-bold "+a}," ",o[t].from_index+1," "),"to",n.createElement("span",{className:"font-bold "+a}," ",o[t].from_index+o[t].page_row_array.length," "),"of",n.createElement("span",{className:"font-bold "+a}," ",e.total_pages," "),"entries")),n.createElement("div",{className:"flex rounded overflow-hidden border mt-2 md:mt-0 w-full md:w-auto"},n.createElement("div",{className:"back-button text-sm w-7 h-7 md:w-8 md:h-8 flex items-center justify-around border-r \n\t\t\t\t\t\t\t "+(o[t].back_button_clickable?" cursor-pointer ":" cursor-not-allowed ")+" \n\t\t\t\t\t\t\t "+(o[t].back_button_clickable?"text-gray-700":"text-gray-400")+" \n\t\t\t\t\t\t\t "+i,onClick:function(){return s("bck")}},n.createElement("p",null,n.createElement("svg",{className:"transform rotate-180 fill-current",width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M0.772277 9.90938L0.837937 9.85312L5.73111 5.60312C5.89682 5.45937 6 5.24375 6 5.00313C6 4.7625 5.89369 4.54688 5.73111 4.40312L0.847317 0.15625L0.766024 0.0843749C0.687858 0.0312499 0.59406 0 0.494007 0C0.221991 0 0 0.23125 0 0.51875V9.48125C0 9.76875 0.221991 10 0.494007 10C0.597186 10 0.694111 9.96562 0.772277 9.90938Z"})))),r.length<=7?r.map(function(r){return n.createElement(de,{key:r,is_active_page:r===t,page_number:r,pageClick:c,bg_color:e.bg_color,style:i})}):n.createElement(t>=1&&t<=6?ue:t>=l-5&&t<=l?fe:pe,{pageClick:c,page_number_list:r,active_page:t,bg_color:e.bg_color,style:i}),n.createElement("div",{className:"next-button text-sm w-7 h-7 md:w-8 md:h-8 flex items-center justify-around border-r \n\t\t\t\t\t\t\t "+(o[t].forward_button_clickable?" cursor-pointer ":" cursor-not-allowed ")+" \n\t\t\t\t\t\t\t "+(o[t].forward_button_clickable?"text-gray-700":"text-gray-400")+" \n\t\t\t\t\t\t\t "+i,onClick:function(){return s("nxt")}},n.createElement("p",null,n.createElement("svg",{className:"fill-current",width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M0.772277 9.90938L0.837937 9.85312L5.73111 5.60312C5.89682 5.45937 6 5.24375 6 5.00313C6 4.7625 5.89369 4.54688 5.73111 4.40312L0.847317 0.15625L0.766024 0.0843749C0.687858 0.0312499 0.59406 0 0.494007 0C0.221991 0 0 0.23125 0 0.51875V9.48125C0 9.76875 0.221991 10 0.494007 10C0.597186 10 0.694111 9.96562 0.772277 9.90938Z"})))))):null}function ue(e){var r=e.page_number_list[e.page_number_list.length-1];return n.createElement(t.Fragment,null,e.page_number_list.slice(0,7).map(function(t){return n.createElement(de,{key:t,is_active_page:t===e.active_page,style:e.style,page_number:t,pageClick:e.pageClick,bg_color:e.bg_color})}),n.createElement(me,null),n.createElement(de,{page_number:r,is_active_page:!1,style:e.style,pageClick:e.pageClick,bg_color:e.bg_color}))}function pe(e){var r=e.page_number_list[e.page_number_list.length-1];return n.createElement(t.Fragment,null,n.createElement(de,{page_number:e.page_number_list[0],is_active_page:!1,style:e.style,pageClick:e.pageClick,bg_color:e.bg_color}),n.createElement(me,null),e.page_number_list.slice(e.active_page-4,e.active_page+3).map(function(t){return n.createElement(de,{key:t,is_active_page:t===e.active_page,style:e.style,page_number:t,pageClick:e.pageClick,bg_color:e.bg_color})}),n.createElement(me,null),n.createElement(de,{page_number:r,is_active_page:!1,style:e.style,pageClick:e.pageClick,bg_color:e.bg_color}))}function fe(e){var r=e.page_number_list.length;return n.createElement(t.Fragment,null,n.createElement(de,{page_number:e.page_number_list[0],is_active_page:!1,style:e.style,pageClick:e.pageClick,bg_color:e.bg_color}),n.createElement(me,null),e.page_number_list.slice(r-7,r).map(function(t){return n.createElement(de,{key:t,is_active_page:t===e.active_page,style:e.style,page_number:t,pageClick:e.pageClick,bg_color:e.bg_color})}))}function me(){return n.createElement("div",{className:"w-7 h-7 md:w-8 md:h-8 flex flex-grow items-center justify-around border-r "},n.createElement("p",{className:"text-sm text-gray-700 "},n.createElement("span",{className:"hidden md:flex"}," . . . "),n.createElement("span",{className:"flex md:hidden"}," ... ")))}function de(e){return n.createElement("div",{className:"text-sm w-7 h-7 md:w-8 md:h-8 flex items-center flex-grow flex-shrink \n\t\t\t\t\t\t\tmd:flex-shrink-0 justify-around border-r cursor-pointer \n\t\t\t\t\t\t\t"+(e.is_active_page?e.bg_color:"")+"\n\t\t\t\t\t\t\t"+(e.is_active_page?" text-white ":"")+e.style,onClick:function(){return e.pageClick(e.page_number)}},n.createElement("p",null,e.page_number))}J.regex_special=["ˆ","$","*","+","?","[","]","(",")","{","}","\\",".","\\t","\\n","\\r","\\f","\\v","\\s","\\w","\\d","\\D","\\b","\\W","\\B","\\0","\\xxx","\\xdd","\\uxxxx","\\cxxx"],J.throttle=function(e,t){return J.limit(e,t,!1)},J.debounce=function(e,t){return J.limit(e,t,!0)},J.RX_SPACES$1=/[\s\uFEFF\xA0]+/g,X.defaultProps={uppercase:!0};var be=function(e){var t,a;function i(t){var n;return(n=e.call(this,t)||this).props=t,n.bulkActClick=function(e){if(n.props.on_bulk_action){var t=n.state.paginated_map[n.state.active_page_number].checked_set,r=n.state.active_rows.filter(function(e,n){return t.has(n)});n.props.on_bulk_action(e,r)}},n.onSearch=function(e){var t,r=J.ltrim(e," ","",!0);(r=J.rtrim(r," ","",!0))?(n.processFilterdebounce||(n.processFilterdebounce=J.debounce(n.processFilter,n.props.debounce_search)),n.processFilterdebounce(J.filterFunction(e,n.props.columns),e)):(null===(t=n.processFilterdebounce)||void 0===t||t.clear(),new Promise(function(e,t){n.setState(n.initialPaginateSetup(n.props.rows,n.props.per_page)),e(!0)}))},n.processFilter=function(e,t){new Promise(function(t){var r=n.props.rows.filter(e);n.setState(n.initialPaginateSetup(r,n.props.per_page)),t(r)}).then(function(e){n.props.on_search&&n.props.on_search(t,e)})},n.massChecking=function(e,t){var o=r({},n.state),a=o.paginated_map[e];a.page_row_array.forEach(function(e,n){"check-all"===t?a.checked_set.add(n):"uncheck-all"===t&&a.checked_set.delete(n)}),n.setState(o),o=null,a=null},n.checkBoxCheck=function(e,t,o){var a=r({},n.state),i=a.paginated_map[e].checked_set;o?i.add(t):i.delete(t),n.setState(a),a=null},n.onPageChange=function(e){var t=r({},n.state);t.paginated_map[t.active_page_number].is_active=!1,t.active_page_number=e,t.paginated_map[e].is_active=!0,t.active_rows=t.paginated_map[e].page_row_array,n.setState(t),t=null},n.state=n.initialPaginateSetup(n.props.rows,n.props.per_page),n}a=e,(t=i).prototype=Object.create(a.prototype),t.prototype.constructor=t,o(t,a);var l=i.prototype;return l.componentDidUpdate=function(e,t,n){var r=this;t===this.state&&new Promise(function(t,n){r.setState(r.props.rows.length!==e.rows.length||r.props.per_page!==e.per_page?r.initialPaginateSetup(r.props.rows,r.props.per_page):r.initialPaginateSetup(r.props.rows,r.props.per_page,{active_number:r.state.active_page_number,page_map:r.state.paginated_map})),t(!0)})},l.getTotalPages=function(){return this.state.total_rows_count},l.initialPaginateSetup=function(e,t,n){var r=J.TableNumberLinks(e,t,n),o=n?n.active_number:1;return{active_rows:r.page_number_list.length>0?r.page_map[o].page_row_array:[],page_number_list:r.page_number_list,paginated_map:r.page_map,active_page_number:o,total_rows_count:r.total_data_count}},l.isBulkSelected=function(){var e,t=null===(e=this.state.paginated_map[this.state.active_page_number])||void 0===e?void 0:e.checked_set;return!!t&&t.size>0},l.getStylingProps=function(){var e,t,n=this.props.styling;return n?(n.base_bg_color=null!=(e=n.base_bg_color)?e:ge,n.base_text_color=null!=(t=n.base_text_color)?t:ye):n={base_bg_color:ge,base_text_color:ye},n},l.render=function(){var e,t,r,o,a,i,l,c,s,u,p,f,m,d,b,_,g,y,v,h,w,x,E,k,C,S,O,j,N,P,$,R,T,A,M,V,F=this,L=this.getStylingProps(),I=this.props.columns.filter(function(e){return!1!==e.use_in_display}),z=!(this.state.page_number_list.length<1)&&this.props.bulk_select_options.length>0;return n.createElement("div",{className:"bg-white w-full flex flex-col pb-5 "+(null!=(e=L.main)?e:""),style:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.04)"}},this.props.table_header&&n.createElement(oe,{text:this.props.table_header,style:null!=(t=null==L||null===(r=L.top)||void 0===r?void 0:r.title)?t:""}),n.createElement(le,{style:null!=(o=null==L||null===(a=L.top)||void 0===a||null===(i=a.elements)||void 0===i?void 0:i.main)?o:""},this.props.show_search&&n.createElement(ae,{onSearch:this.onSearch,style:null!=(l=null==L||null===(c=L.top)||void 0===c||null===(s=c.elements)||void 0===s?void 0:s.search)?l:""}),z&&this.isBulkSelected()?n.createElement(ce,{action_options:this.props.bulk_select_options,eventSelected:this.bulkActClick,button_text:this.props.bulk_select_button_text,bg_color:L.base_bg_color,dropdown_style:null!=(u=null==L||null===(p=L.top)||void 0===p||null===(f=p.elements)||void 0===f||null===(m=f.bulk_select)||void 0===m?void 0:m.main)?u:"",button_style:null!=(d=null==L||null===(b=L.top)||void 0===b||null===(_=b.elements)||void 0===_||null===(g=_.bulk_select)||void 0===g?void 0:g.button)?d:""}):null,this.props.should_export&&n.createElement(ie,{export_text:this.props.export_text,paginated_data:this.state.paginated_map,cols:this.props.columns,file_name:this.props.export_csv_file,processFunc:this.props.export_modify,text_color:L.base_text_color,style:null!=(y=null==L||null===(v=L.top)||void 0===v||null===(h=v.elements)||void 0===h?void 0:h.export)?y:""})),n.createElement("div",{className:"overflow-x-auto"},n.createElement("table",{className:"table-auto border-collapse w-full"},n.createElement("thead",null,n.createElement(re,{columns:I,use_bulk_action:z,active_page_number:this.state.active_page_number,page_data:this.state.paginated_map[this.state.active_page_number],mass_checking:this.massChecking,row_style:null!=(w=null==L||null===(x=L.table_head)||void 0===x?void 0:x.table_row)?w:"",data_style:null!=(E=null==L||null===(k=L.table_head)||void 0===k?void 0:k.table_data)?E:""})),n.createElement("tbody",{className:null!=(C="text-sm font-normal text-gray-700 "+(null==L||null===(S=L.table_body)||void 0===S?void 0:S.main))?C:""},this.state.active_rows.length>0&&this.state.active_rows.map(function(e,t){var r,o,a,i;return n.createElement(te,{key:t.toString(),row:e,columns:I,use_bulk_action:z,render:F.props.row_render,index:t,active_page_number:F.state.active_page_number,checked_set:F.state.paginated_map[F.state.active_page_number].checked_set,setCheck:F.checkBoxCheck,is_striped:F.props.striped,is_bordered:F.props.bordered,is_hovered:F.props.hovered,row_style:null!=(r=null==L||null===(o=L.table_body)||void 0===o?void 0:o.table_row)?r:"",data_style:null!=(a=null==L||null===(i=L.table_body)||void 0===i?void 0:i.table_data)?a:""})})||n.createElement("tr",{className:"hover:bg-table-col bg-table-col border-b border-gray-200 "},n.createElement("td",{className:"px-4 py-4 text-center",colSpan:I.length},this.props.no_content_text))))),n.createElement(se,{page_number_list:this.state.page_number_list,paginated_map:this.state.paginated_map,active_page:this.state.active_page_number,total_pages:this.getTotalPages(),onPageChange:this.onPageChange,bg_color:L.base_bg_color,main_style:null!=(O=null==L||null===(j=L.footer)||void 0===j?void 0:j.main)?O:"",statistics_main_style:null!=(N=null==L||null===(P=L.footer)||void 0===P||null===($=P.statistics)||void 0===$?void 0:$.main)?N:"",statistics_number_style:null!=(R=null==L||null===(T=L.footer)||void 0===T||null===(A=T.statistics)||void 0===A?void 0:A.bold_numbers)?R:"",number_box_Style:null!=(M=null==L||null===(V=L.footer)||void 0===V?void 0:V.page_numbers)?M:""}))},i}(n.Component),_e=Z.shape({title:Z.string,elements:Z.shape({main:Z.string,search:Z.string,bulk_select:Z.shape({main:Z.string,button:Z.string}),export:Z.string})});be.propTypes={show_search:Z.bool,should_export:Z.bool,debounce_search:Z.number,total_page_count:Z.number,per_page:Z.number,rows:Z.array.isRequired,columns:Z.array.isRequired,row_render:Z.func,export_modify:Z.func,on_search:Z.func,on_bulk_action:Z.func,no_content_text:Z.node,table_header:Z.string,export_text:Z.string,bulk_select_options:Z.arrayOf(Z.string),striped:Z.bool,bordered:Z.bool,styling:Z.shape({base_bg_color:Z.string,base_text_color:Z.string,main:Z.string,top:_e,table_head:Z.shape({table_row:Z.string,table_data:Z.string}),table_body:Z.shape({main:Z.string,table_row:Z.string,table_data:Z.string}),footer:Z.shape({main:Z.string,statistics:Z.shape({main:Z.string,bold_numbers:Z.string}),page_numbers:Z.string})})},be.defaultProps={no_content_text:"No Data Availaible",per_page:10,debounce_search:300,show_search:!0,should_export:!0,bulk_select_options:[],export_text:"Export",export_csv_file:"download",bulk_select_button_text:"Apply",striped:!0,bordered:!0,hovered:!0};var ge="bg-pink-700",ye="text-pink-700";module.exports=be;
9
+ */}var i="function"==typeof Symbol&&Symbol.for,l=i?Symbol.for("react.element"):60103,c=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,u=i?Symbol.for("react.strict_mode"):60108,p=i?Symbol.for("react.profiler"):60114,f=i?Symbol.for("react.provider"):60109,m=i?Symbol.for("react.context"):60110,d=i?Symbol.for("react.async_mode"):60111,b=i?Symbol.for("react.concurrent_mode"):60111,_=i?Symbol.for("react.forward_ref"):60112,g=i?Symbol.for("react.suspense"):60113,y=i?Symbol.for("react.suspense_list"):60120,h=i?Symbol.for("react.memo"):60115,v=i?Symbol.for("react.lazy"):60116,w=i?Symbol.for("react.block"):60121,x=i?Symbol.for("react.fundamental"):60117,E=i?Symbol.for("react.responder"):60118,k=i?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case l:switch(e=e.type){case d:case b:case s:case p:case u:case g:return e;default:switch(e=e&&e.$$typeof){case m:case _:case v:case h:case f:return e;default:return t}}case c:return t}}}function S(e){return C(e)===b}var O={AsyncMode:d,ConcurrentMode:b,ContextConsumer:m,ContextProvider:f,Element:l,ForwardRef:_,Fragment:s,Lazy:v,Memo:h,Portal:c,Profiler:p,StrictMode:u,Suspense:g,isAsyncMode:function(e){return S(e)||C(e)===d},isConcurrentMode:S,isContextConsumer:function(e){return C(e)===m},isContextProvider:function(e){return C(e)===f},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===l},isForwardRef:function(e){return C(e)===_},isFragment:function(e){return C(e)===s},isLazy:function(e){return C(e)===v},isMemo:function(e){return C(e)===h},isPortal:function(e){return C(e)===c},isProfiler:function(e){return C(e)===p},isStrictMode:function(e){return C(e)===u},isSuspense:function(e){return C(e)===g},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===s||e===b||e===p||e===u||e===g||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===h||e.$$typeof===f||e.$$typeof===m||e.$$typeof===_||e.$$typeof===x||e.$$typeof===E||e.$$typeof===k||e.$$typeof===w)},typeOf:C},j=a(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,_=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var m=e.type;switch(m){case s:case u:case o:case i:case a:case f:return m;default:var _=m&&m.$$typeof;switch(_){case c:case p:case b:case d:case l:return _;default:return t}}case r:return t}}}var w=u,x=c,E=l,k=n,C=p,S=o,O=b,j=d,N=r,P=i,$=a,R=f,T=!1;function A(e){return v(e)===u}t.AsyncMode=s,t.ConcurrentMode=w,t.ContextConsumer=x,t.ContextProvider=E,t.Element=k,t.ForwardRef=C,t.Fragment=S,t.Lazy=O,t.Memo=j,t.Portal=N,t.Profiler=P,t.StrictMode=$,t.Suspense=R,t.isAsyncMode=function(e){return T||(T=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),A(e)||v(e)===s},t.isConcurrentMode=A,t.isContextConsumer=function(e){return v(e)===c},t.isContextProvider=function(e){return v(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return v(e)===p},t.isFragment=function(e){return v(e)===o},t.isLazy=function(e){return v(e)===b},t.isMemo=function(e){return v(e)===d},t.isPortal=function(e){return v(e)===r},t.isProfiler=function(e){return v(e)===i},t.isStrictMode=function(e){return v(e)===a},t.isSuspense=function(e){return v(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===u||e===i||e===a||e===f||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===d||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===g||e.$$typeof===y||e.$$typeof===h||e.$$typeof===_)},t.typeOf=v}()}),N=a(function(e){e.exports="production"===process.env.NODE_ENV?O:j}),P=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;function T(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var A=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,o=T(e),a=1;a<arguments.length;a++){for(var i in n=Object(arguments[a]))$.call(n,i)&&(o[i]=n[i]);if(P){r=P(n);for(var l=0;l<r.length;l++)R.call(n,r[l])&&(o[r[l]]=n[r[l]])}}return o},M="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",V=function(){};if("production"!==process.env.NODE_ENV){var F=M,L={},I=Function.call.bind(Object.prototype.hasOwnProperty);V=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function z(e,t,n,r,o){if("production"!==process.env.NODE_ENV)for(var a in e)if(I(e,a)){var i;try{if("function"!=typeof e[a]){var l=Error((r||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.");throw l.name="Invariant Violation",l}i=e[a](t,a,r,n,null,F)}catch(e){i=e}if(!i||i instanceof Error||V((r||"React class")+": type specification of "+n+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in L)){L[i.message]=!0;var c=o?o():"";V("Failed "+n+" type: "+i.message+(null!=c?c:""))}}}z.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(L={})};var B=z,D=Function.call.bind(Object.prototype.hasOwnProperty),q=function(){};function H(){return null}function U(){}function W(){}"production"!==process.env.NODE_ENV&&(q=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),W.resetWarningCache=U;var Z=a(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={array:l("array"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:i(H),arrayOf:function(e){return i(function(t,n,r,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var l=t[n];if(!Array.isArray(l))return new a("Invalid "+o+" `"+i+"` of type `"+s(l)+"` supplied to `"+r+"`, expected an array.");for(var c=0;c<l.length;c++){var u=e(l,c,r,o,i+"["+c+"]",M);if(u instanceof Error)return u}return null})},element:i(function(t,n,r,o,i){var l=t[n];return e(l)?null:new a("Invalid "+o+" `"+i+"` of type `"+s(l)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:i(function(e,t,n,r,o){var i=e[t];return N.isValidElementType(i)?null:new a("Invalid "+r+" `"+o+"` of type `"+s(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return i(function(t,n,r,o,i){var l;return t[n]instanceof e?null:new a("Invalid "+o+" `"+i+"` of type `"+((l=t[n]).constructor&&l.constructor.name?l.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:i(function(e,t,n,r,o){return c(e[t])?null:new a("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return i(function(t,n,r,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var l=t[n],c=s(l);if("object"!==c)return new a("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+r+"`, expected an object.");for(var u in l)if(D(l,u)){var p=e(l,u,r,o,i+"."+u,M);if(p instanceof Error)return p}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&q(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),H;function t(t,n,r,i,l){for(var c=t[n],s=0;s<e.length;s++)if(o(c,e[s]))return null;var p=JSON.stringify(e,function(e,t){return"symbol"===u(t)?String(t):t});return new a("Invalid "+i+" `"+l+"` of value `"+String(c)+"` supplied to `"+r+"`, expected one of "+p+".")}return i(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&q("Invalid argument supplied to oneOfType, expected an instance of array."),H;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return q("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(n)+" at index "+t+"."),H}return i(function(t,n,r,o,i){for(var l=0;l<e.length;l++)if(null==(0,e[l])(t,n,r,o,i,M))return null;return new a("Invalid "+o+" `"+i+"` supplied to `"+r+"`.")})},shape:function(e){return i(function(t,n,r,o,i){var l=t[n],c=s(l);if("object"!==c)return new a("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");for(var u in e){var p=e[u];if(p){var f=p(l,u,r,o,i+"."+u,M);if(f)return f}}return null})},exact:function(e){return i(function(t,n,r,o,i){var l=t[n],c=s(l);if("object"!==c)return new a("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var u=A({},t[n],e);for(var p in u){var f=e[p];if(!f)return new a("Invalid "+o+" `"+i+"` key `"+p+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=f(l,p,r,o,i+"."+p,M);if(m)return m}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function a(e){this.message=e,this.stack=""}function i(e){function t(t,n,r,o,i,l,c){if(o=o||"<<anonymous>>",l=l||r,c!==M){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}return null==n[r]?t?new a(null===n[r]?"The "+i+" `"+l+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+i+" `"+l+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,r,o,i,l)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function l(e){return i(function(t,n,r,o,i,l){var c=t[n];return s(c)!==e?new a("Invalid "+o+" `"+i+"` of type `"+u(c)+"` supplied to `"+r+"`, expected `"+e+"`."):null})}function c(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(c);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,a=r.call(t);if(r!==t.entries){for(;!(o=a.next()).done;)if(!c(o.value))return!1}else for(;!(o=a.next()).done;){var i=o.value;if(i&&!c(i[1]))return!1}return!0;default:return!1}}function s(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function u(e){if(null==e)return""+e;var t=s(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function p(e){var t=u(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return a.prototype=Error.prototype,r.checkPropTypes=B,r.resetWarningCache=B.resetWarningCache,r.PropTypes=r,r}(N.isElement):function(){function e(e,t,n,r,o,a){if(a!==M){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:W,resetWarningCache:U};return n.PropTypes=n,n}()}),J=function(){function e(){}return e.ltrim=function(t,n,r,o,a){return void 0===o&&(o=!1),void 0===a&&(a=!1),e.trim(t,n,r,o,"l",a)},e.isInteger=function(e){return(Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e})(e)},e.rtrim=function(t,n,r,o,a){return void 0===o&&(o=!1),void 0===a&&(a=!1),e.trim(t,n,r,o,"r",a)},e.trim=function(t,n,r,o,a,i){void 0===o&&(o=!1),void 0===i&&(i=!1),!i&&e.regex_special.includes(n)&&(n="\\"+n);var l,c=o&&n?"*":"?";return l="r"===a?new RegExp("["+n+"]"+c+"$"):new RegExp("^["+n+"]"+c),t.replace(l,r)},e.isObjectEqual=function(t,n){var r=Object.prototype.toString.call(t);if(r!==Object.prototype.toString.call(n))return!1;if(["[object Array]","[object Object]"].indexOf(r)<0)return!1;var o="[object Array]"===r?t.length:Object.keys(t).length;if(o!==("[object Array]"===r?n.length:Object.keys(n).length))return!1;if(t===n)return!0;if("[object Array]"===r){for(var a=0;a<o;a++)if(!1===e.compare(t[a],n[a]))return!1}else for(var i in t)if(t.hasOwnProperty(i)&&!1===e.compare(t[i],n[i]))return!1;return!0},e.compare=function(t,n){var r=Object.prototype.toString.call(t);if("[object Array]"===r&&!e.isObjectEqual(t,n))return!1;if("[object Object]"===r){if(!e.isObjectEqual(t,n))return!1}else{if(r!==Object.prototype.toString.call(n))return!1;if("[object Function]"===r){if(t.toString()!==n.toString())return!1}else if(t!==n)return!1}return!0},e.isEven=function(e){return 0==(1&e)},e.limit=function(e,t,n){var r;function o(o){var a=this,i=arguments,l=function(){r=void 0,e.apply(a,i)};n&&window.clearTimeout(r),!n&&r||(r=window.setTimeout(l,t))}return o.clear=function(){return window.clearTimeout(r)},o},e.unwindObject=function(e,t){var n=t.split("."),o=n.length;if(o<=1)return e[t];for(var a=r({},e),i=0;i<o;)a=a[n[i]],i++;return a},e.generateCSV=function(t,n,r){var o=[],a="";return t.forEach(function(e){var t;!1!==e.use_in_export&&o.push(null!=(t=e.use)?t:e.field)}),a=o.join(",")+"\n",new Promise(function(o){n.forEach(function(n){var o=[];t.forEach(function(t){if(!1!==t.use_in_export){var a=e.unwindObject(n,t.field);r&&(a=r(n,t,a)),o.push('"'+a+'"')}}),o.length>0&&(a=a+o.join(",")+"\n")}),o(new Blob([a],{type:"octet/stream"}))})},e.stringifyObjectValues=function(t){return null==t?"":t instanceof Object&&!(t instanceof Date)?Object.keys(t).sort().filter(function(e){return null!=e}).map(function(n){return e.stringifyObjectValues(t[n])}).join(" "):String(t)},e.sanitizeRow=function(t,n){for(var r={},o=0,a=n.length;o<a;++o)!1!==n[o].use_in_search&&(r[n[o].field]=e.unwindObject(t,n[o].field));return r},e.stringifyRowValues=function(t,n){return"object"==typeof t&&null!==t?e.stringifyObjectValues(e.sanitizeRow(t,n)):""},e.filterFunction=function(t,n){return function(r){return e.stringtoRegEx(t).test(e.stringifyRowValues(r,n))}},e.stringtoRegEx=function(t){return t=e.matchMultipleSpace(e.escapeRegExp(t)),new RegExp(".*"+t+".*","i")},e.matchMultipleSpace=function(t){return t.replace(e.RX_SPACES$1,"\\s+")},e.escapeRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},e.TableNumberLinks=function(e,t,n){if(void 0===t&&(t=2),t<1)throw Error("The rows per page must be greater than or equal to one(1)");for(var r,o,a=t,i=e.length,l=Math.ceil(i/a),c=0,s=0,u=[],p={},f=e.length,m=0;m<l;++m){o=i-(r=a*++s),u.push(s);var d=e.slice(c,r);p[s]={page_row_array:d,back_button_clickable:1!==s,forward_button_clickable:!1,is_active:n?n.active_number===s:1===s,from_index:c,checked_set:n&&n.page_map?n.page_map[s].checked_set:new Set},o>0&&(p[s].forward_button_clickable=!0),d=null,c=r}return{page_map:p,page_number_list:u,total_data_count:f}},e}();function X(e){var t=e.uppercase,r=e.px,o=e.py,a=e.bg_color,i=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,["uppercase","className","text","px","py","children","bg_color"]),l=(t?"uppercase ":" ")+" "+(r||"px-5")+" "+(r||"px-5")+" "+(o||"py-2")+"\n\t\t\t\t "+a+" \n\t\t\t\t appearance-none text-white rounded";return e.className&&(l=l+" "+e.className),n.createElement("button",Object.assign({className:l},i),e.children?e.children:e.text)}function Y(e){return n.createElement("svg",Object.assign({viewBox:"0 0 512 512"},e,{xmlns:"http://www.w3.org/2000/svg"}),n.createElement("path",{d:"m452 512h-392c-33.085938 0-60-26.914062-60-60v-392c0-33.085938 26.914062-60 60-60h392c33.085938 0 60 26.914062 60 60v392c0 33.085938-26.914062 60-60 60zm-392-472c-11.027344 0-20 8.972656-20 20v392c0 11.027344 8.972656 20 20 20h392c11.027344 0 20-8.972656 20-20v-392c0-11.027344-8.972656-20-20-20zm370.898438 111.34375-29.800782-26.6875-184.964844 206.566406-107.351562-102.046875-27.558594 28.988281 137.21875 130.445313zm0 0"}))}function G(e){return n.createElement("svg",Object.assign({},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 15.381 15.381"}),n.createElement("path",{d:"M12.016 15.381h-8.65A2.83 2.83 0 01.54 12.556v-9.73A2.83 2.83 0 013.366 0h8.65a2.829 2.829 0 012.825 2.826v9.73a2.828 2.828 0 01-2.825 2.825zM3.366 1.305c-.839 0-1.521.683-1.521 1.521v9.73c0 .838.683 1.521 1.521 1.521h8.65c.839 0 1.521-.684 1.521-1.521v-9.73c0-.839-.683-1.521-1.521-1.521h-8.65z"}))}function K(e){return n.createElement("svg",Object.assign({},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"}),n.createElement("path",{d:"M160.48 0h32v32h-32zM224.48 0h32v32h-32z"}),n.createElement("path",{d:"M432 0H288.464v32H432c26.51 0 48 21.49 48 48v352c0 26.51-21.49 48-48 48H80c-26.51 0-48-21.49-48-48V80c0-26.51 21.49-48 48-48h48.464V0H80C35.839.053.053 35.839 0 80v352c.053 44.161 35.839 79.947 80 80h352c44.161-.053 79.947-35.839 80-80V80c-.053-44.161-35.839-79.947-80-80z"}),n.createElement("path",{d:"M128 240h256v32H128z"}))}function Q(e){return n.createElement("svg",Object.assign({},e,{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),n.createElement("path",{d:"M13.6027 6.82763C13.55 6.8274 13.4977 6.83845 13.449 6.86013C13.4002 6.88182 13.3559 6.91371 13.3186 6.95396C13.2813 6.99422 13.2518 7.04204 13.2317 7.09468C13.2116 7.14732 13.2013 7.20373 13.2016 7.26066V11.1988C13.2009 11.7132 13.0113 12.2063 12.6744 12.57C12.3374 12.9337 11.8806 13.1383 11.4041 13.139H2.59988C2.12334 13.1383 1.66651 12.9337 1.32955 12.57C0.992586 12.2063 0.803007 11.7132 0.802382 11.1988V7.19614C0.802382 7.08129 0.760114 6.97115 0.684876 6.88993C0.609638 6.80872 0.507594 6.76309 0.401191 6.76309C0.294789 6.76309 0.192744 6.80872 0.117506 6.88993C0.0422682 6.97115 0 7.08129 0 7.19614V11.198C0.00166179 11.9406 0.275696 12.6522 0.76217 13.1773C1.24864 13.7024 1.90797 13.9982 2.59594 14H11.4041C12.092 13.9982 12.7514 13.7024 13.2378 13.1773C13.7243 12.6522 13.9983 11.9406 14 11.198V7.25982C13.9998 7.14585 13.958 7.03656 13.8836 6.95565C13.8092 6.87474 13.7083 6.82874 13.6027 6.82763Z"}),n.createElement("path",{d:"M7.28669 0.128207C7.21182 0.04706 7.11037 0.000998497 7.00428 -8.58307e-06C6.95166 -0.000116348 6.89955 0.0111771 6.85104 0.0332003C6.80253 0.0552235 6.7586 0.0875301 6.72187 0.128207L4.17234 2.88015C4.10036 2.96203 4.06085 3.07102 4.06222 3.18389C4.0636 3.29676 4.10575 3.40459 4.1797 3.48441C4.25365 3.56423 4.35355 3.60973 4.45812 3.61121C4.56268 3.61269 4.66366 3.57004 4.73952 3.49235L6.60308 1.48252L6.60308 10.2622C6.60308 10.3771 6.64536 10.4872 6.7206 10.5684C6.79584 10.6497 6.89788 10.6953 7.00428 10.6953C7.11069 10.6953 7.21273 10.6497 7.28797 10.5684C7.36321 10.4872 7.40547 10.3771 7.40547 10.2622L7.40547 1.48252L9.26825 3.49235C9.34412 3.57004 9.44509 3.61269 9.54966 3.61121C9.65423 3.60973 9.75413 3.56423 9.82808 3.48441C9.90202 3.40459 9.94418 3.29676 9.94555 3.18389C9.94693 3.07102 9.90741 2.96203 9.83543 2.88015L7.28669 0.128207Z"}))}function ee(e){return n.createElement("svg",Object.assign({},e,{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),n.createElement("path",{opacity:"0.5",fillRule:"evenodd",clipRule:"evenodd",d:"M12.764 11.6423L10.0844 8.99884C10.8382 8.05293 11.2918 6.86284 11.2918 5.56947C11.2918 2.4985 8.75914 0 5.64628 0C2.53269 0 0 2.4985 0 5.56947C0 8.63976 2.53269 11.1383 5.64628 11.1383C6.86596 11.1383 7.99377 10.7498 8.9183 10.0986L11.6232 12.7675C11.7809 12.9227 11.987 13 12.1939 13C12.4001 13 12.6063 12.9227 12.764 12.7675C13.0787 12.4569 13.0787 11.9535 12.764 11.6423ZM1.6127 5.56943C1.6127 3.37597 3.42269 1.59152 5.64648 1.59152C7.87027 1.59152 9.67881 3.37597 9.67881 5.56943C9.67881 7.76288 7.87027 9.54664 5.64648 9.54664C3.42269 9.54664 1.6127 7.76288 1.6127 5.56943Z",fill:"#626262"}))}function te(e){return n.createElement("tr",{className:(e.is_hovered?"hover:bg-gray-50 ":"")+" \n\t\t\t\t\t\t"+(e.is_bordered?"border-b border-gray-200 ":"")+" \n\t\t\t\t\t\t"+(J.isEven(e.index+1)&&e.is_striped?"bg-gray-50 ":"")+e.row_style},e.use_bulk_action&&n.createElement("td",{className:"px-2 py-4 ps-4 text-base "+e.data_style},n.createElement("input",{className:"w-4 h-4",type:"checkbox",checked:e.checked_set.has(e.index),onChange:function(t){return e.setCheck(e.active_page_number,e.index,t.target.checked)}})),e.columns.map(function(t,r){return n.createElement(ne,{key:r.toString(),col:t,row:e.row,render:e.render,style:e.data_style})}))}function ne(e){var t=J.unwindObject(e.row,e.col.field);return n.createElement("td",{className:"px-2 py-4 text-sm "+e.style},e.render&&e.render(e.row,e.col,t)||t)}function re(e){var t,r,o=e.active_page_number,a=0,i=0,l=!1,c=!1,s=!1;e.use_bulk_action&&(l=(a=null===(t=e.page_data)||void 0===t?void 0:t.page_row_array.length)===(i=null===(r=e.page_data)||void 0===r?void 0:r.checked_set.size)&&0!==a,c=i>0&&!l,s=0===i);var u=e.columns.filter(function(e){return!1!==e.use_in_display});return n.createElement("tr",{className:"rtt-head-row bg-yellow-50 text-start "+e.row_style},e.use_bulk_action&&n.createElement("th",{className:"text-base font-semibold text-gray-700 py-3.5 px-2 ps-4 "+e.data_style},l&&n.createElement(Y,{onClick:function(){return e.mass_checking(o,"uncheck-all")},className:"bulk-checkbox fill-current w-5 h-5 cursor-pointer"}),c&&n.createElement(K,{onClick:function(){return e.mass_checking(o,"check-all")},className:"bulk-checkbox indeterminate fill-current w-5 h-5 cursor-pointer"}),s&&n.createElement(G,{onClick:function(){return e.mass_checking(o,"check-all")},className:"bulk-checkbox fill-current w-5 h-5 cursor-pointer"})),u.map(function(t,r){return n.createElement("th",{key:r.toString(),className:"text-base font-semibold text-black py-3.5 px-2 \n\t\t\t \t\t\t\t\t"+(e.use_bulk_action||0!==r?"":"ps-4 ")+"\n\t\t\t \t\t\t\t\t"+(r===u.length-1?"pe-4 ":"")+" "+e.data_style},t.use?t.use:t.field)}))}function oe(e){return n.createElement("div",{className:"flex mt-4 px-4 mb-1 text-base font-semibold tracking-wide leading-7 text-gray-700 "+e.style},n.createElement("h4",{className:" ms-1 react-table-top-caption"},e.text))}function ae(e){return n.createElement("div",{className:"relative flex items-center mt-3 md:mt-0 table-top-search"},n.createElement("input",{type:"text",name:"search",className:"text-xs py-2 h-10 px-4 ps-6 w-52 md:w-auto focus:outline-none leading-9 tracking-wide \n\t\t\ttext-gray-700 border border-gray-300 bg-gray-100 rounded-lg "+e.style,placeholder:e.placeholder,onChange:function(t){return e.onSearch(t.target.value)}}),n.createElement(ee,{className:"absolute w-2.5 h-2.5 ms-2",style:{top:"0.9rem"}}))}function ie(e){return n.createElement("div",{className:"export-btn flex items-center "+e.text_color+" cursor-pointer order-first md:order-none self-end md:self-auto "+e.style,onClick:function(){return function(e,t,n,r){try{var o,a=[];for(o in n+=".csv",e)a=a.concat(e[o].page_row_array);return Promise.resolve(J.generateCSV(t,a,r)).then(function(e){var t=window.URL.createObjectURL(e);if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(e,n);else{var r=document.createElement("a");r.setAttribute("href",t),r.setAttribute("download",n),document.body.appendChild(r),r.click(),setTimeout(function(){window.URL.revokeObjectURL(t),document.body.removeChild(r),a=null},0)}})}catch(e){return Promise.reject(e)}}(e.paginated_data,e.cols,e.file_name,e.processFunc).catch(function(e){return console.error("react-tailwind-table: CSV export failed.",e)})},id:"export-it"},n.createElement(Q,{className:"fill-current w-3 h-3 me-2 "}),n.createElement("p",{className:"font-normal text-base"},e.export_text))}function le(e){return n.createElement(t.Fragment,null,e.children&&n.createElement("div",{className:"flex flex-col md:flex-row md:items-center py-2 justify-between px-4 mt-4 mb-2 react-table-top "+e.style},e.children))}function ce(e){var r=t.useState("nothing"),o=r[0],a=r[1],i="nothing"===o;return n.createElement("div",{className:"flex items-center mt-3 md:mt-0 bulk-select-dropdown"},n.createElement("div",{className:"w-52 md:w-48 relative me-2 flex "},n.createElement("select",{onChange:function(e){a(e.target.value)},value:o,className:"leading-tight block appearance-none w-full bg-white flex-shrink \n\t\t\t\t\t\t\t\t border border-gray-200 px-3 py-2 pe-8 rounded "+e.dropdown_style},n.createElement("option",{value:"nothing"},e.placeholder),e.action_options.map(function(e,t){return n.createElement("option",{key:t.toString(),value:e},e)})),n.createElement("div",{className:"pointer-events-none absolute inset-y-0 end-0 flex items-center px-2 text-gray-300"},n.createElement("svg",{className:"fill-current h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},n.createElement("path",{d:"M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"})))),n.createElement(X,{bg_color:e.bg_color,px:"px-4",className:"bulk-action-button "+(i?"opacity-50":"")+" leading-4 "+e.button_style,disabled:i,uppercase:!1,onClick:function(){i||e.eventSelected(o)}},e.button_text))}function se(e){var r=e.active_page,o=e.page_number_list,a=e.paginated_map,i=e.statistics_number_style,l=e.number_box_Style,c=e.page_number_list.length,s=c>0?{from:a[r].from_index+1,to:a[r].from_index+a[r].page_row_array.length,total:e.total_pages}:{from:0,to:0,total:0};function u(t){e.onPageChange(t)}function p(t){"nxt"===t&&a[r].forward_button_clickable?e.onPageChange(r+1):"bck"===t&&a[r].back_button_clickable&&e.onPageChange(r-1)}return c>0?n.createElement("div",{className:"flex flex-col md:flex-row justify-between mt-6 items-center px-2 w-full md:w-auto "+e.main_style},n.createElement("div",null,n.createElement("p",{className:"text-sm "+e.statistics_main_style},e.pagination_info?e.pagination_info(s):n.createElement(t.Fragment,null,"Showing",n.createElement("span",{className:"font-bold "+i}," ",s.from," "),"to",n.createElement("span",{className:"font-bold "+i}," ",s.to," "),"of",n.createElement("span",{className:"font-bold "+i}," ",s.total," "),"entries"))),n.createElement("div",{className:"flex rounded overflow-hidden border mt-2 md:mt-0 w-full md:w-auto"},n.createElement("div",{className:"back-button text-sm w-7 h-7 md:w-8 md:h-8 flex items-center justify-around border-e \n\t\t\t\t\t\t\t "+(a[r].back_button_clickable?" cursor-pointer ":" cursor-not-allowed ")+" \n\t\t\t\t\t\t\t "+(a[r].back_button_clickable?"text-gray-700":"text-gray-400")+" \n\t\t\t\t\t\t\t "+l,onClick:function(){return p("bck")}},n.createElement("p",null,n.createElement("svg",{className:"rtt-arrow-back fill-current",width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M0.772277 9.90938L0.837937 9.85312L5.73111 5.60312C5.89682 5.45937 6 5.24375 6 5.00313C6 4.7625 5.89369 4.54688 5.73111 4.40312L0.847317 0.15625L0.766024 0.0843749C0.687858 0.0312499 0.59406 0 0.494007 0C0.221991 0 0 0.23125 0 0.51875V9.48125C0 9.76875 0.221991 10 0.494007 10C0.597186 10 0.694111 9.96562 0.772277 9.90938Z"})))),o.length<=7?o.map(function(t){return n.createElement(de,{key:t,is_active_page:t===r,page_number:t,pageClick:u,bg_color:e.bg_color,style:l})}):n.createElement(r>=1&&r<=6?ue:r>=c-5&&r<=c?fe:pe,{pageClick:u,page_number_list:o,active_page:r,bg_color:e.bg_color,style:l}),n.createElement("div",{className:"next-button text-sm w-7 h-7 md:w-8 md:h-8 flex items-center justify-around border-e \n\t\t\t\t\t\t\t "+(a[r].forward_button_clickable?" cursor-pointer ":" cursor-not-allowed ")+" \n\t\t\t\t\t\t\t "+(a[r].forward_button_clickable?"text-gray-700":"text-gray-400")+" \n\t\t\t\t\t\t\t "+l,onClick:function(){return p("nxt")}},n.createElement("p",null,n.createElement("svg",{className:"rtt-arrow-next fill-current",width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M0.772277 9.90938L0.837937 9.85312L5.73111 5.60312C5.89682 5.45937 6 5.24375 6 5.00313C6 4.7625 5.89369 4.54688 5.73111 4.40312L0.847317 0.15625L0.766024 0.0843749C0.687858 0.0312499 0.59406 0 0.494007 0C0.221991 0 0 0.23125 0 0.51875V9.48125C0 9.76875 0.221991 10 0.494007 10C0.597186 10 0.694111 9.96562 0.772277 9.90938Z"})))))):null}function ue(e){var r=e.page_number_list[e.page_number_list.length-1];return n.createElement(t.Fragment,null,e.page_number_list.slice(0,7).map(function(t){return n.createElement(de,{key:t,is_active_page:t===e.active_page,style:e.style,page_number:t,pageClick:e.pageClick,bg_color:e.bg_color})}),n.createElement(me,null),n.createElement(de,{page_number:r,is_active_page:!1,style:e.style,pageClick:e.pageClick,bg_color:e.bg_color}))}function pe(e){var r=e.page_number_list[e.page_number_list.length-1];return n.createElement(t.Fragment,null,n.createElement(de,{page_number:e.page_number_list[0],is_active_page:!1,style:e.style,pageClick:e.pageClick,bg_color:e.bg_color}),n.createElement(me,null),e.page_number_list.slice(e.active_page-4,e.active_page+3).map(function(t){return n.createElement(de,{key:t,is_active_page:t===e.active_page,style:e.style,page_number:t,pageClick:e.pageClick,bg_color:e.bg_color})}),n.createElement(me,null),n.createElement(de,{page_number:r,is_active_page:!1,style:e.style,pageClick:e.pageClick,bg_color:e.bg_color}))}function fe(e){var r=e.page_number_list.length;return n.createElement(t.Fragment,null,n.createElement(de,{page_number:e.page_number_list[0],is_active_page:!1,style:e.style,pageClick:e.pageClick,bg_color:e.bg_color}),n.createElement(me,null),e.page_number_list.slice(r-7,r).map(function(t){return n.createElement(de,{key:t,is_active_page:t===e.active_page,style:e.style,page_number:t,pageClick:e.pageClick,bg_color:e.bg_color})}))}function me(){return n.createElement("div",{className:"w-7 h-7 md:w-8 md:h-8 flex flex-grow items-center justify-around border-e "},n.createElement("p",{className:"text-sm text-gray-700 "},n.createElement("span",{className:"hidden md:flex"}," . . . "),n.createElement("span",{className:"flex md:hidden"}," ... ")))}function de(e){return n.createElement("div",{className:"text-sm w-7 h-7 md:w-8 md:h-8 flex items-center flex-grow flex-shrink \n\t\t\t\t\t\t\tmd:flex-shrink-0 justify-around border-e cursor-pointer \n\t\t\t\t\t\t\t"+(e.is_active_page?e.bg_color:"")+"\n\t\t\t\t\t\t\t"+(e.is_active_page?" text-white ":"")+e.style,onClick:function(){return e.pageClick(e.page_number)}},n.createElement("p",null,e.page_number))}J.regex_special=["ˆ","$","*","+","?","[","]","(",")","{","}","\\",".","\\t","\\n","\\r","\\f","\\v","\\s","\\w","\\d","\\D","\\b","\\W","\\B","\\0","\\xxx","\\xdd","\\uxxxx","\\cxxx"],J.throttle=function(e,t){return J.limit(e,t,!1)},J.debounce=function(e,t){return J.limit(e,t,!0)},J.RX_SPACES$1=/[\s\uFEFF\xA0]+/g,X.defaultProps={uppercase:!0};var be=function(e){var t,a;function i(t){var n;return(n=e.call(this,t)||this).props=t,n.bulkActClick=function(e){if(n.props.on_bulk_action){var t=n.state.paginated_map[n.state.active_page_number].checked_set,r=n.state.active_rows.filter(function(e,n){return t.has(n)});n.props.on_bulk_action(e,r)}},n.onSearch=function(e){var t,r=J.ltrim(e," ","",!0);(r=J.rtrim(r," ","",!0))?(n.processFilterdebounce||(n.processFilterdebounce=J.debounce(n.processFilter,n.props.debounce_search)),n.processFilterdebounce(J.filterFunction(e,n.props.columns),e)):(null===(t=n.processFilterdebounce)||void 0===t||t.clear(),new Promise(function(e,t){n.setState(n.initialPaginateSetup(n.props.rows,n.props.per_page)),e(!0)}))},n.processFilter=function(e,t){new Promise(function(t){var r=n.props.rows.filter(e);n.setState(n.initialPaginateSetup(r,n.props.per_page)),t(r)}).then(function(e){n.props.on_search&&n.props.on_search(t,e)})},n.massChecking=function(e,t){var o=r({},n.state),a=o.paginated_map[e];a.page_row_array.forEach(function(e,n){"check-all"===t?a.checked_set.add(n):"uncheck-all"===t&&a.checked_set.delete(n)}),n.setState(o),o=null,a=null},n.checkBoxCheck=function(e,t,o){var a=r({},n.state),i=a.paginated_map[e].checked_set;o?i.add(t):i.delete(t),n.setState(a),a=null},n.onPageChange=function(e){var t=r({},n.state);t.paginated_map[t.active_page_number].is_active=!1,t.active_page_number=e,t.paginated_map[e].is_active=!0,t.active_rows=t.paginated_map[e].page_row_array,n.setState(t),t=null},n.state=n.initialPaginateSetup(n.props.rows,n.props.per_page),n}a=e,(t=i).prototype=Object.create(a.prototype),t.prototype.constructor=t,o(t,a);var l=i.prototype;return l.componentDidUpdate=function(e,t,n){var r=this;t===this.state&&new Promise(function(t,n){r.setState(r.props.rows.length!==e.rows.length||r.props.per_page!==e.per_page?r.initialPaginateSetup(r.props.rows,r.props.per_page):r.initialPaginateSetup(r.props.rows,r.props.per_page,{active_number:r.state.active_page_number,page_map:r.state.paginated_map})),t(!0)})},l.getTotalPages=function(){return this.state.total_rows_count},l.initialPaginateSetup=function(e,t,n){var r=J.TableNumberLinks(e,t,n),o=n?n.active_number:1;return{active_rows:r.page_number_list.length>0?r.page_map[o].page_row_array:[],page_number_list:r.page_number_list,paginated_map:r.page_map,active_page_number:o,total_rows_count:r.total_data_count}},l.isBulkSelected=function(){var e,t=null===(e=this.state.paginated_map[this.state.active_page_number])||void 0===e?void 0:e.checked_set;return!!t&&t.size>0},l.getStylingProps=function(){var e,t,n=this.props.styling;return n?(n.base_bg_color=null!=(e=n.base_bg_color)?e:ge,n.base_text_color=null!=(t=n.base_text_color)?t:ye):n={base_bg_color:ge,base_text_color:ye},n},l.render=function(){var e,t,r,o,a,i,l,c,s,u,p,f,m,d,b,_,g,y,h,v,w,x,E,k,C,S,O,j,N,P,$,R,T,A,M,V,F=this,L=this.getStylingProps(),I=this.props.columns.filter(function(e){return!1!==e.use_in_display}),z=!(this.state.page_number_list.length<1)&&this.props.bulk_select_options.length>0;return n.createElement("div",{dir:this.props.dir,className:"bg-white w-full flex flex-col pb-5 "+(null!=(e=L.main)?e:""),style:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.04)"}},this.props.table_header&&n.createElement(oe,{text:this.props.table_header,style:null!=(t=null==L||null===(r=L.top)||void 0===r?void 0:r.title)?t:""}),n.createElement(le,{style:null!=(o=null==L||null===(a=L.top)||void 0===a||null===(i=a.elements)||void 0===i?void 0:i.main)?o:""},this.props.show_search&&n.createElement(ae,{onSearch:this.onSearch,placeholder:this.props.search_placeholder,style:null!=(l=null==L||null===(c=L.top)||void 0===c||null===(s=c.elements)||void 0===s?void 0:s.search)?l:""}),z&&this.isBulkSelected()?n.createElement(ce,{action_options:this.props.bulk_select_options,eventSelected:this.bulkActClick,button_text:this.props.bulk_select_button_text,placeholder:this.props.bulk_select_placeholder,bg_color:L.base_bg_color,dropdown_style:null!=(u=null==L||null===(p=L.top)||void 0===p||null===(f=p.elements)||void 0===f||null===(m=f.bulk_select)||void 0===m?void 0:m.main)?u:"",button_style:null!=(d=null==L||null===(b=L.top)||void 0===b||null===(_=b.elements)||void 0===_||null===(g=_.bulk_select)||void 0===g?void 0:g.button)?d:""}):null,this.props.should_export&&n.createElement(ie,{export_text:this.props.export_text,paginated_data:this.state.paginated_map,cols:this.props.columns,file_name:this.props.export_csv_file,processFunc:this.props.export_modify,text_color:L.base_text_color,style:null!=(y=null==L||null===(h=L.top)||void 0===h||null===(v=h.elements)||void 0===v?void 0:v.export)?y:""})),n.createElement("div",{className:"overflow-x-auto"},n.createElement("table",{className:"table-auto border-collapse w-full"},n.createElement("thead",null,n.createElement(re,{columns:I,use_bulk_action:z,active_page_number:this.state.active_page_number,page_data:this.state.paginated_map[this.state.active_page_number],mass_checking:this.massChecking,row_style:null!=(w=null==L||null===(x=L.table_head)||void 0===x?void 0:x.table_row)?w:"",data_style:null!=(E=null==L||null===(k=L.table_head)||void 0===k?void 0:k.table_data)?E:""})),n.createElement("tbody",{className:"text-sm font-normal text-gray-700 "+(null!=(C=null==L||null===(S=L.table_body)||void 0===S?void 0:S.main)?C:"")},this.state.active_rows.length>0&&this.state.active_rows.map(function(e,t){var r,o,a,i;return n.createElement(te,{key:t.toString(),row:e,columns:I,use_bulk_action:z,render:F.props.row_render,index:t,active_page_number:F.state.active_page_number,checked_set:F.state.paginated_map[F.state.active_page_number].checked_set,setCheck:F.checkBoxCheck,is_striped:F.props.striped,is_bordered:F.props.bordered,is_hovered:F.props.hovered,row_style:null!=(r=null==L||null===(o=L.table_body)||void 0===o?void 0:o.table_row)?r:"",data_style:null!=(a=null==L||null===(i=L.table_body)||void 0===i?void 0:i.table_data)?a:""})})||n.createElement("tr",{className:"hover:bg-table-col bg-table-col border-b border-gray-200 "},n.createElement("td",{className:"px-4 py-4 text-center",colSpan:I.length},this.props.no_content_text))))),n.createElement(se,{page_number_list:this.state.page_number_list,paginated_map:this.state.paginated_map,active_page:this.state.active_page_number,total_pages:this.getTotalPages(),pagination_info:this.props.pagination_info,onPageChange:this.onPageChange,bg_color:L.base_bg_color,main_style:null!=(O=null==L||null===(j=L.footer)||void 0===j?void 0:j.main)?O:"",statistics_main_style:null!=(N=null==L||null===(P=L.footer)||void 0===P||null===($=P.statistics)||void 0===$?void 0:$.main)?N:"",statistics_number_style:null!=(R=null==L||null===(T=L.footer)||void 0===T||null===(A=T.statistics)||void 0===A?void 0:A.bold_numbers)?R:"",number_box_Style:null!=(M=null==L||null===(V=L.footer)||void 0===V?void 0:V.page_numbers)?M:""}))},i}(n.Component),_e=Z.shape({title:Z.string,elements:Z.shape({main:Z.string,search:Z.string,bulk_select:Z.shape({main:Z.string,button:Z.string}),export:Z.string})});be.propTypes={show_search:Z.bool,should_export:Z.bool,debounce_search:Z.number,total_page_count:Z.number,per_page:Z.number,rows:Z.array.isRequired,columns:Z.array.isRequired,row_render:Z.func,export_modify:Z.func,on_search:Z.func,on_bulk_action:Z.func,pagination_info:Z.func,no_content_text:Z.node,table_header:Z.string,export_text:Z.string,search_placeholder:Z.string,bulk_select_placeholder:Z.string,dir:Z.oneOf(["ltr","rtl","auto"]),bulk_select_options:Z.arrayOf(Z.string),striped:Z.bool,bordered:Z.bool,styling:Z.shape({base_bg_color:Z.string,base_text_color:Z.string,main:Z.string,top:_e,table_head:Z.shape({table_row:Z.string,table_data:Z.string}),table_body:Z.shape({main:Z.string,table_row:Z.string,table_data:Z.string}),footer:Z.shape({main:Z.string,statistics:Z.shape({main:Z.string,bold_numbers:Z.string}),page_numbers:Z.string})})},be.defaultProps={no_content_text:"No Data Availaible",per_page:10,debounce_search:300,show_search:!0,should_export:!0,bulk_select_options:[],export_text:"Export",export_csv_file:"download",bulk_select_button_text:"Apply",search_placeholder:"SEARCH",bulk_select_placeholder:"Select ...",striped:!0,bordered:!0,hovered:!0};var ge="bg-pink-700",ye="text-pink-700";module.exports=be;
10
10
  //# sourceMappingURL=index.js.map