zeed-dynamic-table
Version:
A flexible and dynamic table component for React and Next.js applications without Tailwind dependencies
3 lines (2 loc) • 42.7 kB
JavaScript
;var e=require("react/jsx-runtime"),r=require("react");function o(e){var r,t,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(r=0;r<e.length;r++)e[r]&&(t=o(e[r]))&&(n&&(n+=" "),n+=t);else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function t(){for(var e,r,o=0,t="";o<arguments.length;)(e=arguments[o++])&&(r=n(e))&&(t&&(t+=" "),t+=r);return t}function n(e){if("string"==typeof e)return e;for(var r,o="",t=0;t<e.length;t++)e[t]&&(r=n(e[t]))&&(o&&(o+=" "),o+=r);return o}function s(e){var r=function(e){var r=e.theme,o=e.prefix,t={nextPart:new Map,validators:[]},n=function(e,r){if(!r)return e;return e.map((function(e){return[e[0],e[1].map((function(e){return"string"==typeof e?r+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((function(e){var o=e[0],t=e[1];return[r+o,t]}))):e}))]}))}(Object.entries(e.classGroups),o);return n.forEach((function(e){var o=e[0];l(e[1],t,o,r)})),t}(e),o=e.conflictingClassGroups,t=e.conflictingClassGroupModifiers,n=void 0===t?{}:t;return{getClassGroupId:function(e){var o=e.split("-");return""===o[0]&&1!==o.length&&o.shift(),a(o,r)||function(e){if(i.test(e)){var r=i.exec(e)[1],o=r?.substring(0,r.indexOf(":"));if(o)return"arbitrary.."+o}}(e)},getConflictingClassGroupIds:function(e,r){var t=o[e]||[];return r&&n[e]?[].concat(t,n[e]):t}}}function a(e,r){if(0===e.length)return r.classGroupId;var o=e[0],t=r.nextPart.get(o),n=t?a(e.slice(1),t):void 0;if(n)return n;if(0!==r.validators.length){var s=e.join("-");return r.validators.find((function(e){return(0,e.validator)(s)}))?.classGroupId}}var i=/^\[(.+)\]$/;function l(e,r,o,t){e.forEach((function(e){if("string"!=typeof e){if("function"==typeof e)return e.isThemeGetter?void l(e(t),r,o,t):void r.validators.push({validator:e,classGroupId:o});Object.entries(e).forEach((function(e){var n=e[0];l(e[1],c(r,n),o,t)}))}else{(""===e?r:c(r,e)).classGroupId=o}}))}function c(e,r){var o=e;return r.split("-").forEach((function(e){o.nextPart.has(e)||o.nextPart.set(e,{nextPart:new Map,validators:[]}),o=o.nextPart.get(e)})),o}function d(e){if(e<1)return{get:function(){},set:function(){}};var r=0,o=new Map,t=new Map;function n(n,s){o.set(n,s),++r>e&&(r=0,t=o,o=new Map)}return{get:function(e){var r=o.get(e);return void 0!==r?r:void 0!==(r=t.get(e))?(n(e,r),r):void 0},set:function(e,r){o.has(e)?o.set(e,r):n(e,r)}}}function u(e){var r=e.separator||":",o=1===r.length,t=r[0],n=r.length;return function(e){for(var s,a=[],i=0,l=0,c=0;c<e.length;c++){var d=e[c];if(0===i){if(d===t&&(o||e.slice(c,c+n)===r)){a.push(e.slice(l,c)),l=c+n;continue}if("/"===d){s=c;continue}}"["===d?i++:"]"===d&&i--}var u=0===a.length?e:e.substring(l),p=u.startsWith("!");return{modifiers:a,hasImportantModifier:p,baseClassName:p?u.substring(1):u,maybePostfixModifierPosition:s&&s>l?s-l:void 0}}}var p=/\s+/;function m(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var n,a,i,l=function(e){var o=r[0],t=r.slice(1).reduce((function(e,r){return r(e)}),o());return n=function(e){return{cache:d(e.cacheSize),splitModifiers:u(e),...s(e)}}(t),a=n.cache.get,i=n.cache.set,l=c,c(e)};function c(e){var r=a(e);if(r)return r;var o=function(e,r){var o=r.splitModifiers,t=r.getClassGroupId,n=r.getConflictingClassGroupIds,s=new Set;return e.trim().split(p).map((function(e){var r=o(e),n=r.modifiers,s=r.hasImportantModifier,a=r.baseClassName,i=r.maybePostfixModifierPosition,l=t(i?a.substring(0,i):a),c=Boolean(i);if(!l){if(!i)return{isTailwindClass:!1,originalClassName:e};if(!(l=t(a)))return{isTailwindClass:!1,originalClassName:e};c=!1}var d=function(e){if(e.length<=1)return e;var r=[],o=[];return e.forEach((function(e){"["===e[0]?(r.push.apply(r,o.sort().concat([e])),o=[]):o.push(e)})),r.push.apply(r,o.sort()),r}(n).join(":");return{isTailwindClass:!0,modifierId:s?d+"!":d,classGroupId:l,originalClassName:e,hasPostfixModifier:c}})).reverse().filter((function(e){if(!e.isTailwindClass)return!0;var r=e.modifierId,o=e.classGroupId,t=e.hasPostfixModifier,a=r+o;return!s.has(a)&&(s.add(a),n(o,t).forEach((function(e){return s.add(r+e)})),!0)})).reverse().map((function(e){return e.originalClassName})).join(" ")}(e,n);return i(e,o),o}return function(){return l(t.apply(null,arguments))}}function f(e){var r=function(r){return r[e]||[]};return r.isThemeGetter=!0,r}var g=/^\[(?:([a-z-]+):)?(.+)\]$/i,h=/^\d+\/\d+$/,b=new Set(["px","full","screen"]),x=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,y=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,v=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function w(e){return E(e)||b.has(e)||h.test(e)||k(e)}function k(e){return A(e,"length",M)}function j(e){return A(e,"size",T)}function C(e){return A(e,"position",T)}function N(e){return A(e,"url",D)}function P(e){return A(e,"number",E)}function E(e){return!Number.isNaN(Number(e))}function B(e){return e.endsWith("%")&&E(e.slice(0,-1))}function F(e){return S(e)||A(e,"number",S)}function I(e){return g.test(e)}function z(){return!0}function $(e){return x.test(e)}function O(e){return A(e,"",L)}function A(e,r,o){var t=g.exec(e);return!!t&&(t[1]?t[1]===r:o(t[2]))}function M(e){return y.test(e)}function T(){return!1}function D(e){return e.startsWith("url(")}function S(e){return Number.isInteger(Number(e))}function L(e){return v.test(e)}function G(){var e=f("colors"),r=f("spacing"),o=f("blur"),t=f("brightness"),n=f("borderColor"),s=f("borderRadius"),a=f("borderSpacing"),i=f("borderWidth"),l=f("contrast"),c=f("grayscale"),d=f("hueRotate"),u=f("invert"),p=f("gap"),m=f("gradientColorStops"),g=f("gradientColorStopPositions"),h=f("inset"),b=f("margin"),x=f("opacity"),y=f("padding"),v=f("saturate"),A=f("scale"),M=f("sepia"),T=f("skew"),D=f("space"),S=f("translate"),L=function(){return["auto",I,r]},G=function(){return[I,r]},R=function(){return["",w]},W=function(){return["auto",E,I]},U=function(){return["","0",I]},_=function(){return[E,P]},H=function(){return[E,I]};return{cacheSize:500,theme:{colors:[z],spacing:[w],blur:["none","",$,I],brightness:_(),borderColor:[e],borderRadius:["none","","full",$,I],borderSpacing:G(),borderWidth:R(),contrast:_(),grayscale:U(),hueRotate:H(),invert:U(),gap:G(),gradientColorStops:[e],gradientColorStopPositions:[B,k],inset:L(),margin:L(),opacity:_(),padding:G(),saturate:_(),scale:_(),sepia:U(),skew:H(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",I]}],container:["container"],columns:[{columns:[$]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],[I])}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",F]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",I]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",F]}],"grid-cols":[{"grid-cols":[z]}],"col-start-end":[{col:["auto",{span:["full",F]},I]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[z]}],"row-start-end":[{row:["auto",{span:[F]},I]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",I]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",I]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal"].concat(["start","end","center","between","around","evenly","stretch"])}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal"].concat(["start","end","center","between","around","evenly","stretch"],["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(["start","end","center","between","around","evenly","stretch"],["baseline"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",I,r]}],"min-w":[{"min-w":["min","max","fit",I,w]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[$]},$,I]}],h:[{h:[I,r,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",I,w]}],"max-h":[{"max-h":[I,r,"min","max","fit"]}],"font-size":[{text:["base",$,k]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",P]}],"font-family":[{font:[z]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",I]}],"line-clamp":[{"line-clamp":["none",E,P]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",I,w]}],"list-image":[{"list-image":["none",I]}],"list-style-type":[{list:["none","disc","decimal",I]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(["solid","dashed","dotted","double","none"],["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",w]}],"underline-offset":[{"underline-offset":["auto",I,w]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",I]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",I]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],[C])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",j]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},N]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[].concat(["solid","dashed","dotted","double","none"],["hidden"])}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:[""].concat(["solid","dashed","dotted","double","none"])}],"outline-offset":[{"outline-offset":[I,w]}],"outline-w":[{outline:[w]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[w]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$,O]}],"shadow-color":[{shadow:[z]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[t]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",$,I]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[v]}],sepia:[{sepia:[M]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[t]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[M]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",I]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",I]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",I]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[F,I]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",I]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",I]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",I]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[w,P]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}var R=m(G);function W(...e){return R(function(){for(var e,r,t=0,n="";t<arguments.length;)(e=arguments[t++])&&(r=o(e))&&(n&&(n+=" "),n+=r);return n}(e))}function U(...e){return e.filter(Boolean).join(" ")}const _={white:"#FFFFFF",black:"#000000",primary:"#3B82F6",primaryHover:"#2563EB",primaryLight:"#93C5FD",primaryDark:"#1D4ED8",gray50:"#F9FAFB",gray100:"#F3F4F6",gray200:"#E5E7EB",gray300:"#D1D5DB",gray400:"#9CA3AF",gray500:"#6B7280",gray600:"#4B5563",gray700:"#374151",gray800:"#1F2937",gray900:"#111827",success:"#10B981",successLight:"#A7F3D0",successDark:"#047857",danger:"#EF4444",dangerLight:"#FCA5A5",dangerDark:"#B91C1C",warning:"#F59E0B",warningLight:"#FCD34D",warningDark:"#B45309",info:"#3B82F6",infoLight:"#93C5FD",infoDark:"#1D4ED8"},H=({children:r,baseProps:o})=>e.jsx("div",{...o,className:W("flex flex-col md:flex-row justify-between items-start md:items-center space-y-3 md:space-y-0 p-4 bg-white dark:bg-gray-900 border-t border-gray-200 dark:border-gray-700 transition-colors",o?.className),children:r}),q=({children:r,leftBaseProps:o})=>e.jsx("div",{...o,className:W("flex items-center gap-x-3",o?.className),children:r}),J=({children:r,rightBaseProps:o})=>e.jsx("ul",{...o,className:W("inline-flex items-stretch -space-x-px",o?.className),children:r}),V=({pagination:r})=>{const o=r?.page||1,t=r?.totalPages||0,n="flex items-center justify-center h-full py-1.5 px-3 cursor-pointer transition-colors",s="bg-gray-300 dark:bg-gray-700 text-gray-800 dark:text-white",a="text-gray-500 dark:text-gray-400 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-700",i="disabled:cursor-not-allowed disabled:bg-gray-200 dark:disabled:bg-gray-900 disabled:text-gray-400 dark:disabled:text-gray-600";return e.jsxs(H,{baseProps:r?.baseProps,children:[e.jsxs(q,{leftBaseProps:r?.leftBaseProps,children:[e.jsxs("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:["Showing",e.jsx("span",{className:"font-semibold text-gray-900 dark:text-white mx-1",children:o}),"of",e.jsx("span",{className:"font-semibold text-gray-900 dark:text-white ml-1",children:t})]}),r.per_pageComponent]}),e.jsxs(J,{rightBaseProps:r?.rightBaseProps,children:[e.jsx("li",{children:e.jsxs("button",{onClick:()=>{o>1&&r.handlePageChange(o-1)},disabled:o<=1,className:W(n,a,i,"rounded-l-lg"),"aria-label":"Previous page",children:[e.jsx("span",{className:"sr-only",children:"Previous"}),e.jsx("svg",{className:"w-5 h-5","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"})})]})}),t<=5?Array.from({length:t},((t,i)=>e.jsx("li",{onClick:()=>{r.handlePageChange(i+1)},className:"cursor-pointer",children:e.jsx("span",{className:W(n,i+1===o?s:a),children:i+1})},`page-${i+1}`))):e.jsxs(e.Fragment,{children:[e.jsx("li",{onClick:()=>{r.handlePageChange(1)},className:"cursor-pointer",children:e.jsx("span",{className:W(n,1===o?s:a),children:"1"})}),o>3&&e.jsx("li",{className:"cursor-pointer",children:e.jsx("span",{className:W(n,a),children:"..."})}),Array.from({length:3},((i,l)=>{const c=o-1+l;return c>1&&c<t?e.jsx("li",{onClick:()=>{r.handlePageChange(c)},className:"cursor-pointer",children:e.jsx("span",{className:W(n,o===c?s:a),children:c})},`page-${c}`):null})),o<t-2&&e.jsx("li",{className:"cursor-pointer",children:e.jsx("span",{className:W(n,a),children:"..."})}),e.jsx("li",{onClick:()=>{r.handlePageChange(t)},className:"cursor-pointer",children:e.jsx("span",{className:W(n,o===t?s:a),children:t})})]}),e.jsx("li",{children:e.jsxs("button",{onClick:()=>{o<t&&r.handlePageChange(o+1)},disabled:o>=t,className:W(n,a,i,"rounded-r-lg"),"aria-label":"Next page",children:[e.jsx("span",{className:"sr-only",children:"Next"}),e.jsx("svg",{className:"w-5 h-5","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})]})})]})]})},X=({className:o,item:t,color:n="primary",size:s="md",style:a})=>{const i=r.useMemo((()=>{const e={sm:{width:6,height:6},md:{width:10,height:10},lg:{width:12,height:12}};if("number"==typeof s)return{width:`${s}px`,height:`${s}px`};const r=e[s]||e.md;return{width:`${r.width}px`,height:`${r.height}px`}}),[s]),l=r.useMemo((()=>{try{return"function"==typeof o?o(t):o||""}catch(e){return console.error("Error resolving className in Chip:",e),""}}),[o,t]),c=r.useMemo((()=>{try{const e="function"==typeof n?n(t):n;return"string"==typeof e&&e in _?_[e]:e}catch(e){return console.error("Error resolving color in Chip:",e),_.primary}}),[n,t]),d=r.useMemo((()=>{try{return"function"==typeof a?a(t):a||{}}catch(e){return console.error("Error resolving style in Chip:",e),{}}}),[a,t]),u=r.useMemo((()=>({...{display:"inline-flex",borderRadius:"9999px",...i,backgroundColor:c},...d})),[i,c,d]);return e.jsx("span",{className:l,style:u})};function K(e,r){if(r)try{const o=r.split(".");let t=e;for(const e of o){if(null==t)return;t=t[e]}return"number"==typeof t?Number(t):void 0!==t?t:""}catch(e){return console.error(`Error getting nested value for path ${r}:`,e),""}}function Q(e,r){if(!e||"object"!=typeof e)return{};try{const o={};for(const[t,n]of Object.entries(e))if("function"!=typeof n)if("string"!=typeof n)o[t]=n;else try{let e=n.replace(/\[([^\]]+)\]/g,((e,o)=>{const t=K(r,o);return void 0!==t?String(t):""}));o[t]=e}catch(e){console.error(`Error processing string value for ${t}:`,e),o[t]=n}else try{o[t]=n(r)}catch(e){console.error(`Error evaluating function for ${t}:`,e),o[t]="style"===t?{}:""}return o}catch(e){return console.error("Error in handlePropsDynamic:",e),{}}}function Y(e,r){if(!e.join||!Array.isArray(e.join))return"";try{return e.join.map((e=>{try{const o=K(r,e);return null!=o?String(o):""}catch(r){return console.error(`Error getting joined value for path ${e}:`,r),""}})).filter(Boolean).join(" ")}catch(e){return console.error("Error in handleJoined:",e),""}}const Z=({children:r,baseProps:o})=>e.jsx("div",{...o,className:W("flex flex-col md:flex-row items-center justify-between gap-3 py-3 px-4 bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700 transition-colors",o?.className),children:r}),ee=({children:r,leftBaseProps:o})=>e.jsx("div",{...o,className:W("w-full md:w-2/3 mb-2 md:mb-0",o?.className),children:r}),re=({children:r,moreComponentBaseProps:o})=>e.jsx("div",{...o,className:W("flex items-center space-x-3 w-full md:w-auto",o?.className),children:r}),oe=({children:r,rightBaseProps:o})=>e.jsx("div",{...o,className:W("w-full md:w-auto flex flex-row items-center justify-end space-x-2 h-10",o?.className),children:r}),te=({searchInput:r,addButton:o,moreComponents:t,baseProps:n,leftBaseProps:s,rightBaseProps:a,moreComponentBaseProps:i})=>e.jsxs(Z,{baseProps:n,children:[e.jsx(ee,{leftBaseProps:s,children:e.jsxs("form",{className:"flex items-center w-full",onSubmit:e=>e.preventDefault(),children:[e.jsx("label",{htmlFor:"table-search-input",className:"sr-only",children:"Search Input For The Table"}),e.jsxs("div",{className:"relative w-full",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:e.jsx("svg",{"aria-hidden":"true",className:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})})}),e.jsx("input",{id:"table-search-input",type:"text",placeholder:"Search",...r,className:W("bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-700 text-gray-900 dark:text-gray-200 text-sm rounded-lg block w-full pl-10 p-2.5 focus:ring-blue-500 focus:border-blue-500 dark:focus:ring-blue-500 dark:focus:border-blue-500 transition-colors",r?.className)})]})]})}),e.jsxs(oe,{rightBaseProps:a,children:[o&&e.jsxs("button",{type:"button",...o,className:W("flex items-center justify-center text-white bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 transition-colors",o?.className),children:[o?.startContent,o?.title||"Add",o?.endContent]}),t&&e.jsx(re,{moreComponentBaseProps:i,children:t})]})]}),ne=({column:e,item:o,colIndex:t,children:n})=>{const s=e?.normalProps?.td?Q(e.normalProps.td,o):{},a={...s,...e?.normalProps?.td};return r.createElement("td",{...a,className:W("px-2 py-4 capitalize font-medium text-gray-900 dark:text-gray-200 whitespace-nowrap transition-colors",s?.className,e?.normalProps?.td?.className),key:t,scope:"row"},n)},se={display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"0.5rem",fontWeight:500,color:_.gray900,whiteSpace:"nowrap",transition:"colors 0.2s ease-in-out"},ae={...se,color:_.gray200},ie=({column:r,item:o,colIndex:t,children:n,onClick:s,adJustClass:a})=>{const i=r?.normalProps?.td?Q(r.normalProps.td,o):{},l=i?.style||{},c=r?.normalProps?.td?.style||{},d={...fe()?ae:se,...c,...l},u=U("dynamic-table-action-td",a,i?.className,r?.normalProps?.td?.className),{className:p,onClick:m,style:f,...g}=i;return e.jsx("td",{onClick:e=>{s&&(e.preventDefault(),s()),i?.onClick&&"function"==typeof i.onClick&&i.onClick(e)},className:u,style:d,...r?.normalProps?.td||{},...g,children:n},t)},le=({item:o,href:t,children:n,className:s,target:a,rel:i,onClick:l})=>{const c=function(e,r){if(!e)return"#";try{return e.replace(/\[([^\]]+)\]/g,((e,o)=>{try{const e=K(r,o);return null!=e?String(e):""}catch(e){return console.error(`Error generating dynamic link for [${o}]:`,e),""}}))}catch(e){return console.error("Error in generateDynamicLink:",e),"#"}}(t,o),[d,u]=r.useState(null),[p,m]=r.useState(!1);r.useEffect((()=>{const e=(()=>{try{if("undefined"!=typeof window&&void 0!==window&&void 0!==window.__NEXT_DATA__)return!0;try{return require.resolve("next/link"),!0}catch(e){return!1}}catch(e){return console.warn("Error detecting Next.js environment:",e),!1}})();m(e),e&&import("next/link").then((e=>{u((()=>e.default))})).catch((e=>{console.warn("Failed to import Next.js Link, falling back to <a> tag:",e)}))}),[]);const f={className:s,target:a,rel:i||("_blank"===a?"noopener noreferrer":void 0),onClick:e=>{l&&l(e)}};return p&&d?e.jsx(d,{href:c,...f,children:n}):e.jsx("a",{href:c,...f,children:n})};function ce(e){if(null==e)return"-";try{const r=new Date(e);if(isNaN(r.getTime()))return String(e);const o={year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"};return new Intl.DateTimeFormat("en-US",o).format(r)}catch(r){return console.error("Error rendering date value:",r),String(e)}}function de(r,o){try{if(r.join&&Array.isArray(r.join))return r.useChip?e.jsxs(e.Fragment,{children:[e.jsx(X,{className:r?.chipOptions?.className||"",item:o,color:r?.chipOptions?.color})," ",Y(r,o)]}):Y(r,o);{const t=r.accessor?K(o,r.accessor):"";return void 0!==r.static?r.useChip?e.jsxs(e.Fragment,{children:[e.jsx(X,{className:r?.chipOptions?.className||"",item:o,color:r?.chipOptions?.color})," ",r.static]}):r.static:r.useDate?r.useChip?e.jsxs(e.Fragment,{children:[e.jsx(X,{className:r?.chipOptions?.className||"",item:o,color:r?.chipOptions?.color})," ",ce(t)]}):ce(t):r.useChip?e.jsxs(e.Fragment,{children:[e.jsx(X,{className:r?.chipOptions?.className||"",item:o,color:r?.chipOptions?.color})," ",t]}):t}}catch(e){return console.error("Error in renderValue:",e),"Error displaying value"}}const ue={display:"block",width:"100%",padding:"0.5rem",fontSize:"0.875rem",border:`1px solid ${_.gray300}`,borderRadius:"0.375rem",backgroundColor:_.white,color:_.gray900},pe={...ue,backgroundColor:_.gray800,color:_.white,borderColor:_.gray700};function me(r,o,t,n){try{const s=n||`cell-${o}-${Date.now()}`;return r.useOption?e.jsx(ne,{column:r,item:t,colIndex:o,children:r?.optionOptions?.component?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[r.useChip&&e.jsx(X,{item:t,className:r?.chipOptions?.className||"",color:r?.chipOptions?.color}),r.optionOptions.component(t)]}):r?.optionOptions?.apiLink?e.jsx("select",{onChange:e=>{r?.optionOptions?.apiLink&&async function(e,r,o,t,n){if(r)try{const s={item:n,value:e},a={"Content-Type":"application/json"},i=new AbortController,l=setTimeout((()=>i.abort()),15e3);try{const e=await fetch(r,{method:"POST",headers:a,body:JSON.stringify(s),signal:i.signal});if(clearTimeout(l),!e.ok)throw new Error(`API returned status ${e.status}`);try{const r=await e.json();o&&"function"==typeof o&&o(r)}catch(e){o&&"function"==typeof o&&o(null)}}catch(e){console.error("Fetch error in handleOptionChnage:",e),t&&"function"==typeof t&&t(e)}}catch(e){console.error("Error in handleOptionChnage:",e),t&&"function"==typeof t&&t(e)}else console.warn("API link not provided for option change")}(e.target.value,r.optionOptions.apiLink,r?.optionOptions?.onRes,r?.optionOptions?.onCatch,t)},style:fe()?pe:ue,children:Array.isArray(r?.optionOptions?.data)&&r.optionOptions.data.map(((r,o)=>e.jsx("option",{value:r,children:r},`option-${o}-${r}`)))}):e.jsx("select",{onChange:e=>{r?.optionOptions?.onChange&&r.optionOptions.onChange(e.target.value)},style:fe()?pe:ue,children:Array.isArray(r?.optionOptions?.data)&&r?.optionOptions?.data?.map(((r,o)=>e.jsx("option",{value:r,children:r},`option-${o}-${r}`)))})},s):r.useLink?e.jsx(ne,{column:r,item:t,colIndex:o,children:e.jsx(le,{href:r?.linkOptions?.href||"#",item:t,className:r?.linkOptions?.className||"dynamic-table-link",children:de(r,t)})},s):r.useAction?function(r,o,t){try{return e.jsx(ie,{column:r,item:t,colIndex:o,children:r?.actionOptions?.components?r?.actionOptions?.components(t):null})}catch(n){return console.error("Error in handleAction:",n),e.jsx(ie,{column:r,item:t,colIndex:o,children:e.jsx("span",{style:{color:_.danger},children:"Error"})})}}(r,o,t):e.jsx(ne,{column:r,item:t,colIndex:o,children:de(r,t)},s)}catch(n){return console.error("Error in celValue:",n),e.jsx(ne,{column:r,item:t,colIndex:o,children:e.jsx("span",{style:{color:_.danger},children:"Error"})},`error-${o}`)}}function fe(){if("undefined"==typeof window)return!1;return!!document.documentElement.classList.contains("dark")||!(!window.matchMedia||!window.matchMedia("(prefers-color-scheme: dark)").matches)}const ge=({tHeadProps:r,children:o})=>e.jsx("thead",{...r,className:W("text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-800 dark:text-gray-300 transition-colors",r?.className),children:o}),he=({tHeadTrProps:r,children:o})=>e.jsx("tr",{...r,className:W("border-b dark:border-gray-700",r?.className),children:o}),be=({tBodyTrProps:r,children:o})=>{const t="undefined"!=typeof self&&self.crypto?.randomUUID?self.crypto.randomUUID():`row-${Math.random().toString(36).substring(2,9)}`;return e.jsx("tr",{...r,className:W("odd:bg-white even:bg-gray-50 dark:odd:bg-gray-900 dark:even:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 dark:text-white border-b dark:border-gray-700 transition-colors",r?.className),children:o},t)},xe=({tBodyProps:r,children:o})=>e.jsx("tbody",{...r,className:W("divide-y divide-gray-200 dark:divide-gray-700 transition-colors",r?.className),children:o}),ye={boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",overflowX:"auto",padding:"0.5rem 1.25rem",zIndex:0,backgroundColor:_.white,transition:"background-color 0.2s ease-in-out",borderRadius:"0.375rem"},ve={...ye,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.18)",backgroundColor:_.gray900},we=({children:r,baseProps:o,id:t})=>{const{style:n,...s}=o||{},a={...fe()?ve:ye,...n};return e.jsx("div",{id:t,...s,className:U("dynamic-table-base",o?.className),style:a,children:r})},ke=({children:r,tableBaseProps:o})=>e.jsx("div",{...o,className:W("overflow-x-auto max-h-[70vh] h-fit bg-white dark:bg-gray-900 rounded-lg transition-colors",o?.className),children:r}),je=({children:r,tableProps:o})=>e.jsx("table",{...o,className:W("w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 transition-colors",o?.className),children:r}),Ce=({column:e,colIndex:o,children:t})=>{const n=!0===e.useAction;return r.createElement("th",{...e.normalProps?.th,className:W("px-2 py-3 text-xs font-medium uppercase tracking-wider text-gray-700 dark:text-gray-300 transition-colors",n&&"text-end",e.normalProps?.th?.className),key:o,scope:"col"},t)};function Ne(){const e=function(){const[e,o]=r.useState(!1);return r.useEffect((()=>{o(!0)}),[]),e}(),[o,t]=r.useState(!1);return r.useEffect((()=>{if(!e)return;const r=()=>{const e=document.documentElement.classList.contains("dark"),r=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return e||r};t(r());const o=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>t(r());o.addEventListener?o.addEventListener("change",n):o.addListener(n);const s=new MutationObserver((e=>{e.forEach((e=>{"class"===e.attributeName&&e.target===document.documentElement&&t(r())}))}));return s.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{o.removeEventListener?o.removeEventListener("change",n):o.removeListener(n),s.disconnect()}}),[e]),o}var Pe=r.memo((({items:o=[],columns:t=[],topContent:n,topContentOptions:s,usePagination:a=!1,pagination:i,emptyContent:l,isLoading:c=!1,loadingContent:d,tableName:u="Data",tBodyTrProps:p,tHeadTrProps:m,tBodyProps:f,tHeadProps:g,baseProps:h,tableBaseProps:b,tableProps:x,id:y})=>{const v=Ne(),w=r.useMemo((()=>y||`dynamic-table-${Math.random().toString(36).substring(2,9)}`),[y]),k=r.useMemo((()=>t.map(((r,o)=>{try{return void 0===r?.showIf||!0===r.showIf?e.jsx(Ce,{colIndex:o,column:r,children:r?.rename||r?.columnName||""},`th-${o}-${r?.columnName||o}`):null}catch(e){return console.error(`Error rendering table header at index ${o}:`,e),null}})).filter(Boolean)),[t]),j=r.useCallback(((e,r)=>"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():`row-${r}-${Math.random().toString(36).substring(2,9)}`),[]),C=r.useCallback(((e,r,o,t)=>{try{if(!1===e?.showIf)return null;if(e.useCondition&&e.condtions){const n=function(e,r){if(!e?.condtions||!Array.isArray(e.condtions))return null;try{return e.condtions.find((e=>{try{if("boolean"==typeof e.condtion)return!0===e.condtion;if(e.condtion&&Array.isArray(e.condtion.compare)&&e.condtion.compare.length>=1){const[o,t]=e.condtion.compare;let n=o;if("string"==typeof o&&o?.startsWith("[")&&o?.endsWith("]")){const e=o.slice(1,-1);n=K(r,e)}if(1===e.condtion.compare.length)return null!=n&&""!==n&&"undefined"!==n;let s=t;if("string"==typeof t&&t?.startsWith("[")&&t?.endsWith("]")){const e=t.slice(1,-1);s=K(r,e)}return String(n).toLowerCase()===String(s).toLowerCase()}return!1}catch(e){return console.error("Error evaluating condition:",e),!1}}))}catch(e){return console.error("Error in findTrueContion:",e),null}}(e,o);return n?.redner?me(n.redner,r,o,`cell-${t}-${r}`):null}return me(e,r,o,`cell-${t}-${r}`)}catch(e){return console.error(`Error rendering cell at row ${t}, column ${r}:`,e),null}}),[]),N=r.useMemo((()=>o&&Array.isArray(o)&&0!==o.length?o.map(((r,o)=>{try{const n=j(r,o),s=()=>t.map(((e,t)=>C(e,t,r,o))).filter(Boolean);return e.jsx(be,{tBodyTrProps:p,children:s()},n)}catch(e){return console.error(`Error rendering row at index ${o}:`,e),null}})).filter(Boolean):null),[o,t,p,j,C]),P=r.useMemo((()=>{try{return function(r,o){try{return void 0===r?e.jsx(te,{addButton:o?.addButton,searchInput:o?.searchInput,moreComponents:o?.moreComponents,baseProps:o?.baseProps,leftBaseProps:o?.leftBaseProps,rightBaseProps:o?.rightBaseProps,moreComponentBaseProps:o?.moreComponentBaseProps}):r}catch(r){return console.error("Error rendering top content:",r),e.jsx("div",{style:{padding:"0.75rem",backgroundColor:_.white,borderBottom:`1px solid ${_.gray200}`},children:"Error rendering top content"})}}(n,s)}catch(e){return console.error("Error rendering top content:",e),null}}),[n,s]),E=r.useCallback((()=>{try{return c?e.jsx("div",{style:{width:"100%",height:"10rem",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:v?"#E5E7EB":"#6B7280",backgroundColor:v?"#111827":"#FFFFFF",transition:"colors 0.2s ease-in-out"},children:d||"Loading..."}):o&&o.length?null:e.jsx("div",{style:{width:"100%",height:"10rem",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:v?"#E5E7EB":"#6B7280",backgroundColor:v?"#111827":"#FFFFFF",transition:"colors 0.2s ease-in-out"},children:l||`No ${u} Available`})}catch(r){return console.error("Error rendering empty or loading state:",r),e.jsx("div",{style:{width:"100%",height:"10rem",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:v?"#E5E7EB":"#6B7280",backgroundColor:v?"#111827":"#FFFFFF"},children:"No data available"})}}),[c,o,d,l,u,v]);return e.jsxs(we,{baseProps:h,id:w,children:[P,e.jsxs(ke,{tableBaseProps:b,children:[(Array.isArray(o)&&o.length>0||c)&&e.jsxs(je,{tableProps:x,children:[e.jsx(ge,{tHeadProps:g,children:e.jsx(he,{tHeadTrProps:m,children:k})}),!c&&e.jsx(xe,{tBodyProps:f,children:N})]}),E()]}),a&&i&&e.jsx(V,{pagination:i})]})}));exports.ActionTd=ie,exports.Base=we,exports.Chip=X,exports.DynamicTable=Pe,exports.Li=({children:r,onClick:o,props:t,className:n})=>e.jsx("li",{...t,onClick:t?.onClick||o,className:W(n,t?.className),children:r}),exports.Link=le,exports.PaginationController=V,exports.Table=je,exports.TableBase=ke,exports.TableTopContent=te,exports.Tbody=xe,exports.TbodyTr=be,exports.Td=ne,exports.Th=Ce,exports.Thead=ge,exports.TheadTr=he,exports.cn=W;
//# sourceMappingURL=index.js.map