@ws-ui/roles-editor 1.8.4-rc1 → 1.8.4-rc2

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.
@@ -0,0 +1 @@
1
+ .qodly-roles-editor [data-simplebar]{position:relative;flex-direction:column;flex-wrap:wrap;justify-content:flex-start;align-content:flex-start;align-items:flex-start}.qodly-roles-editor .simplebar-wrapper{overflow:hidden;width:inherit;height:inherit;max-width:inherit;max-height:inherit}.qodly-roles-editor .simplebar-mask{direction:inherit;position:absolute;overflow:hidden;padding:0;margin:0;left:0;top:0;bottom:0;right:0;width:auto!important;height:auto!important;z-index:0}.qodly-roles-editor .simplebar-offset{direction:inherit!important;box-sizing:inherit!important;resize:none!important;position:absolute;top:0;left:0;bottom:0;right:0;padding:0;margin:0;-webkit-overflow-scrolling:touch}.qodly-roles-editor .simplebar-content-wrapper{direction:inherit;box-sizing:border-box!important;position:relative;display:block;height:100%;width:auto;max-width:100%;max-height:100%;scrollbar-width:none;-ms-overflow-style:none}.qodly-roles-editor .simplebar-content-wrapper::-webkit-scrollbar,.qodly-roles-editor .simplebar-hide-scrollbar::-webkit-scrollbar{display:none;width:0;height:0}.qodly-roles-editor .simplebar-content:after,.qodly-roles-editor .simplebar-content:before{content:" ";display:table}.qodly-roles-editor .simplebar-placeholder{max-height:100%;max-width:100%;width:100%;pointer-events:none}.qodly-roles-editor .simplebar-height-auto-observer-wrapper{box-sizing:inherit!important;height:100%;width:100%;max-width:1px;position:relative;float:left;max-height:1px;overflow:hidden;z-index:-1;padding:0;margin:0;pointer-events:none;flex-grow:inherit;flex-shrink:0;flex-basis:0}.qodly-roles-editor .simplebar-height-auto-observer{box-sizing:inherit;display:block;opacity:0;position:absolute;top:0;left:0;height:1000%;width:1000%;min-height:1px;min-width:1px;overflow:hidden;pointer-events:none;z-index:-1}.qodly-roles-editor .simplebar-track{z-index:1;position:absolute;right:0;bottom:0;pointer-events:none;overflow:hidden}.qodly-roles-editor [data-simplebar].simplebar-dragging .simplebar-content{pointer-events:none;-moz-user-select:none;user-select:none;-webkit-user-select:none}.qodly-roles-editor [data-simplebar].simplebar-dragging .simplebar-track{pointer-events:all}.qodly-roles-editor .simplebar-scrollbar{position:absolute;left:0;right:0;min-height:10px}.qodly-roles-editor .simplebar-scrollbar:before{position:absolute;content:"";background:#000;border-radius:7px;left:2px;right:2px;opacity:0;transition:opacity .2s linear}.qodly-roles-editor .simplebar-scrollbar.simplebar-visible:before{opacity:.5;transition:opacity 0s linear}.qodly-roles-editor .simplebar-track.simplebar-vertical{top:0;width:11px}.qodly-roles-editor .simplebar-track.simplebar-vertical .simplebar-scrollbar:before{top:2px;bottom:2px}.qodly-roles-editor .simplebar-track.simplebar-horizontal{left:0;height:11px}.qodly-roles-editor .simplebar-track.simplebar-horizontal .simplebar-scrollbar:before{height:100%;left:2px;right:2px}.qodly-roles-editor .simplebar-track.simplebar-horizontal .simplebar-scrollbar{right:auto;left:0;top:2px;height:7px;min-height:0;min-width:10px;width:auto}.qodly-roles-editor [data-simplebar-direction=rtl] .simplebar-track.simplebar-vertical{right:auto;left:0}.qodly-roles-editor .hs-dummy-scrollbar-size{direction:rtl;position:fixed;opacity:0;visibility:hidden;height:500px;width:500px;overflow-y:hidden;overflow-x:scroll}.qodly-roles-editor .simplebar-hide-scrollbar{position:fixed;left:0;visibility:hidden;overflow-y:scroll;scrollbar-width:none;-ms-overflow-style:none}.qodly-roles-editor .fd-tree-node{display:flex;flex-direction:row;padding-right:8px;padding-left:8px}.qodly-roles-editor .fd-tree-node-content{display:flex;flex-direction:row;flex:1 1 0%}.qodly-roles-editor .carousel .control-arrow,.qodly-roles-editor .carousel.carousel-slider .control-arrow{transition:all .25s ease-in;opacity:.4;filter:alpha(opacity=40);position:absolute;z-index:2;top:20px;background:none;border:0;font-size:32px;cursor:pointer}.qodly-roles-editor .carousel .control-arrow:focus,.qodly-roles-editor .carousel .control-arrow:hover{opacity:1;filter:alpha(opacity=100)}.qodly-roles-editor .carousel .control-arrow:before,.qodly-roles-editor .carousel.carousel-slider .control-arrow:before{margin:0 5px;display:inline-block;border-top:8px solid transparent;border-bottom:8px solid transparent;content:""}.qodly-roles-editor .carousel .control-disabled.control-arrow{opacity:0;filter:alpha(opacity=0);cursor:inherit;display:none}.qodly-roles-editor .carousel .control-prev.control-arrow{left:0}.qodly-roles-editor .carousel .control-prev.control-arrow:before{border-right:8px solid #fff}.qodly-roles-editor .carousel .control-next.control-arrow{right:0}.qodly-roles-editor .carousel .control-next.control-arrow:before{border-left:8px solid #fff}.qodly-roles-editor .carousel-root{outline:none}.qodly-roles-editor .carousel{position:relative;width:100%}.qodly-roles-editor .carousel *{box-sizing:border-box}.qodly-roles-editor .carousel img{width:100%;display:inline-block;pointer-events:none}.qodly-roles-editor .carousel .carousel{position:relative}.qodly-roles-editor .carousel .control-arrow{outline:0;border:0;background:none;top:50%;margin-top:-13px;font-size:18px}.qodly-roles-editor .carousel .thumbs-wrapper{margin:20px;overflow:hidden}.qodly-roles-editor .carousel .thumbs{transition:all .15s ease-in;transform:translateZ(0);position:relative;list-style:none;white-space:nowrap}.qodly-roles-editor .carousel .thumb{transition:border .15s ease-in;display:inline-block;margin-right:6px;white-space:nowrap;overflow:hidden;border:3px solid #fff;padding:2px}.qodly-roles-editor .carousel .thumb:focus{border:3px solid #ccc;outline:none}.qodly-roles-editor .carousel .thumb.selected,.qodly-roles-editor .carousel .thumb:hover{border:3px solid #333}.qodly-roles-editor .carousel .thumb img{vertical-align:top}.qodly-roles-editor .carousel.carousel-slider{position:relative;margin:0;overflow:hidden}.qodly-roles-editor .carousel.carousel-slider .control-arrow{top:0;color:#fff;font-size:26px;bottom:0;margin-top:0;padding:5px}.qodly-roles-editor .carousel.carousel-slider .control-arrow:hover{background:#0003}.qodly-roles-editor .carousel .slider-wrapper{overflow:hidden;margin:auto;width:100%;transition:height .15s ease-in}.qodly-roles-editor .carousel .slider-wrapper.axis-horizontal .slider{-ms-box-orient:horizontal;display:-moz-flex;display:flex}.qodly-roles-editor .carousel .slider-wrapper.axis-horizontal .slider .slide{flex-direction:column;flex-flow:column}.qodly-roles-editor .carousel .slider-wrapper.axis-vertical{-ms-box-orient:horizontal;display:-moz-flex;display:flex}.qodly-roles-editor .carousel .slider-wrapper.axis-vertical .slider{flex-direction:column}.qodly-roles-editor .carousel .slider{margin:0;padding:0;position:relative;list-style:none;width:100%}.qodly-roles-editor .carousel .slider.animated{transition:all .35s ease-in-out}.qodly-roles-editor .carousel .slide{min-width:100%;margin:0;position:relative;text-align:center}.qodly-roles-editor .carousel .slide img{width:100%;vertical-align:top;border:0}.qodly-roles-editor .carousel .slide iframe{display:inline-block;width:calc(100% - 80px);margin:0 40px 40px;border:0}.qodly-roles-editor .carousel .slide .legend{transition:all .5s ease-in-out;position:absolute;bottom:40px;left:50%;margin-left:-45%;width:90%;border-radius:10px;background:#000;color:#fff;padding:10px;font-size:12px;text-align:center;opacity:.25;transition:opacity .35s ease-in-out}.qodly-roles-editor .carousel .control-dots{position:absolute;bottom:0;margin:10px 0;padding:0;text-align:center;width:100%;z-index:1}@media (min-width:960px){.qodly-roles-editor .carousel .control-dots{bottom:0}}.qodly-roles-editor .carousel .control-dots .dot{transition:opacity .25s ease-in;opacity:.3;filter:alpha(opacity=30);box-shadow:1px 1px 2px #000000e6;background:#fff;border-radius:50%;width:8px;height:8px;cursor:pointer;display:inline-block;margin:0 8px}.qodly-roles-editor .carousel .control-dots .dot.selected,.qodly-roles-editor .carousel .control-dots .dot:hover{opacity:1;filter:alpha(opacity=100)}.qodly-roles-editor .carousel .carousel-status{position:absolute;top:0;right:0;padding:5px;font-size:10px;text-shadow:1px 1px 1px rgba(0,0,0,.9);color:#fff}.qodly-roles-editor .carousel:hover .slide .legend{opacity:1}.qodly-roles-editor .shrink-0{flex-shrink:0}.qodly-roles-editor .rounded{border-radius:.25rem}.qodly-roles-editor .border{border-width:1px}.qodly-roles-editor .border-2{border-width:2px}.qodly-roles-editor .border-t{border-top-width:1px}.qodly-roles-editor .bg-purple-200{--tw-bg-opacity:1;background-color:rgb(233 213 255/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-purple-800{background-color:rgb(107 33 168/var(--tw-bg-opacity,1))}.qodly-roles-editor .text-xs{font-size:.75rem;line-height:1rem}.qodly-roles-editor .text-purple-900{color:rgb(88 28 135/var(--tw-text-opacity,1))}.qodly-roles-editor .text-red-400{color:rgb(248 113 113/var(--tw-text-opacity,1))}.qodly-roles-editor .text-red-500{color:rgb(239 68 68/var(--tw-text-opacity,1))}.qodly-roles-editor .hover\:bg-purple-800:hover{background-color:rgb(107 33 168/var(--tw-bg-opacity,1))}.qodly-roles-editor .privileges-container .react-flow__node{background-color:#323232;color:#fff;border-color:#fff}.qodly-roles-editor .privileges-container .react-flow__node.highlighted{background-color:#b174e5;font-weight:700}.qodly-roles-editor .privileges-container .react-flow__handle{opacity:0}.qodly-roles-editor *,.qodly-roles-editor :after,.qodly-roles-editor :before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.qodly-roles-editor ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.qodly-roles-editor .container{width:100%}@media (min-width:640px){.qodly-roles-editor .container{max-width:640px}}@media (min-width:768px){.qodly-roles-editor .container{max-width:768px}}@media (min-width:1024px){.qodly-roles-editor .container{max-width:1024px}}@media (min-width:1280px){.qodly-roles-editor .container{max-width:1280px}}@media (min-width:1536px){.qodly-roles-editor .container{max-width:1536px}}.qodly-roles-editor .prose{color:var(--tw-prose-body);max-width:65ch}.qodly-roles-editor .prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.qodly-roles-editor .prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.qodly-roles-editor .prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.qodly-roles-editor .prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.qodly-roles-editor .prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.qodly-roles-editor .prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.qodly-roles-editor .prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.qodly-roles-editor .prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.qodly-roles-editor .prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.qodly-roles-editor .prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.qodly-roles-editor .prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.qodly-roles-editor .prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.qodly-roles-editor .prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.qodly-roles-editor .prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.qodly-roles-editor .prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.qodly-roles-editor .prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.qodly-roles-editor .prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.qodly-roles-editor .prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.qodly-roles-editor .prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.qodly-roles-editor .prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.qodly-roles-editor .prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.qodly-roles-editor .prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.qodly-roles-editor .prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.qodly-roles-editor .prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.qodly-roles-editor .prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.qodly-roles-editor .prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.qodly-roles-editor .prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.qodly-roles-editor .prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.qodly-roles-editor .prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.qodly-roles-editor .prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.qodly-roles-editor .prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.qodly-roles-editor .prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.qodly-roles-editor .prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.qodly-roles-editor .prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.qodly-roles-editor .prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.qodly-roles-editor .prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.qodly-roles-editor .prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.qodly-roles-editor .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.qodly-roles-editor .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.qodly-roles-editor .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.qodly-roles-editor .prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.qodly-roles-editor .prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.qodly-roles-editor .prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.qodly-roles-editor .prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.qodly-roles-editor .prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.qodly-roles-editor .prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.qodly-roles-editor .prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.qodly-roles-editor .prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.qodly-roles-editor .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.qodly-roles-editor .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.qodly-roles-editor .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.qodly-roles-editor .prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.qodly-roles-editor .prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.qodly-roles-editor .prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.qodly-roles-editor .prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.qodly-roles-editor .prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.qodly-roles-editor .prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.qodly-roles-editor .prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.qodly-roles-editor .prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.qodly-roles-editor .prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.qodly-roles-editor .prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.qodly-roles-editor .prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.qodly-roles-editor .prose{--tw-prose-body:#374151;--tw-prose-headings:#111827;--tw-prose-lead:#4b5563;--tw-prose-links:#111827;--tw-prose-bold:#111827;--tw-prose-counters:#6b7280;--tw-prose-bullets:#d1d5db;--tw-prose-hr:#e5e7eb;--tw-prose-quotes:#111827;--tw-prose-quote-borders:#e5e7eb;--tw-prose-captions:#6b7280;--tw-prose-kbd:#111827;--tw-prose-kbd-shadows:rgba(17,24,39,.1);--tw-prose-code:#111827;--tw-prose-pre-code:#e5e7eb;--tw-prose-pre-bg:#1f2937;--tw-prose-th-borders:#d1d5db;--tw-prose-td-borders:#e5e7eb;--tw-prose-invert-body:#d1d5db;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#9ca3af;--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:#9ca3af;--tw-prose-invert-bullets:#4b5563;--tw-prose-invert-hr:#374151;--tw-prose-invert-quotes:#f3f4f6;--tw-prose-invert-quote-borders:#374151;--tw-prose-invert-captions:#9ca3af;--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:hsla(0,0%,100%,.1);--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#d1d5db;--tw-prose-invert-pre-bg:rgba(0,0,0,.5);--tw-prose-invert-th-borders:#4b5563;--tw-prose-invert-td-borders:#374151;font-size:1rem;line-height:1.75}.qodly-roles-editor .prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.qodly-roles-editor .prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.qodly-roles-editor .prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.qodly-roles-editor .prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.qodly-roles-editor .prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.qodly-roles-editor .prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.qodly-roles-editor .prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.qodly-roles-editor .prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.qodly-roles-editor .prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.qodly-roles-editor .prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.qodly-roles-editor .prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.qodly-roles-editor .prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.qodly-roles-editor .prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.qodly-roles-editor .prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.qodly-roles-editor .prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.qodly-roles-editor .prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.qodly-roles-editor .prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.qodly-roles-editor .prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.qodly-roles-editor .prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.qodly-roles-editor .prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.qodly-roles-editor .prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.qodly-roles-editor .prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.qodly-roles-editor .prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.qodly-roles-editor .prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.qodly-roles-editor .prose-sm{font-size:.875rem;line-height:1.7142857}.qodly-roles-editor .prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.qodly-roles-editor .prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.qodly-roles-editor .prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em;color:#ccc}.qodly-roles-editor .prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2;color:#fff}.qodly-roles-editor .prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4;color:#fff}.qodly-roles-editor .prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-bottom:.4444444em;line-height:1.5555556;color:#fff;margin-top:0}.qodly-roles-editor .prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714;color:#fff}.qodly-roles-editor .prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:5px;margin-bottom:5px}.qodly-roles-editor .prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.qodly-roles-editor .prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.qodly-roles-editor .prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.qodly-roles-editor .prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.qodly-roles-editor .prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.qodly-roles-editor .prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.qodly-roles-editor .prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.qodly-roles-editor .prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.qodly-roles-editor .prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.qodly-roles-editor .prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.qodly-roles-editor .prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.qodly-roles-editor .prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.qodly-roles-editor .prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.qodly-roles-editor .prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.qodly-roles-editor .prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.qodly-roles-editor .prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.qodly-roles-editor .prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.qodly-roles-editor .prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.qodly-roles-editor .prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.qodly-roles-editor .prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.qodly-roles-editor .prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.qodly-roles-editor .prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.qodly-roles-editor .prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.qodly-roles-editor .prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.qodly-roles-editor .prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.qodly-roles-editor .prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.qodly-roles-editor .prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.qodly-roles-editor .prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.qodly-roles-editor .prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.qodly-roles-editor .prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.qodly-roles-editor .prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.qodly-roles-editor .prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.qodly-roles-editor .prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.qodly-roles-editor .prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.qodly-roles-editor .prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.qodly-roles-editor .prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.qodly-roles-editor .prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.qodly-roles-editor .prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.qodly-roles-editor .prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.qodly-roles-editor .prose-sm :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:#ccc}.qodly-roles-editor .prose-sm :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:#bfdbfe}.qodly-roles-editor .pointer-events-none{pointer-events:none}.qodly-roles-editor .invisible{visibility:hidden}.qodly-roles-editor .static{position:static}.qodly-roles-editor .absolute{position:absolute}.qodly-roles-editor .relative{position:relative}.qodly-roles-editor .sticky{position:sticky}.qodly-roles-editor .inset-0{top:0;right:0;bottom:0;left:0}.qodly-roles-editor .inset-x-0{left:0;right:0}.qodly-roles-editor .inset-y-0{top:0;bottom:0}.qodly-roles-editor .-right-full{right:-100%}.qodly-roles-editor .left-0{left:0}.qodly-roles-editor .left-5{left:1.25rem}.qodly-roles-editor .left-full{left:100%}.qodly-roles-editor .right-0{right:0}.qodly-roles-editor .right-1{right:.25rem}.qodly-roles-editor .top-0{top:0}.qodly-roles-editor .top-1{top:.25rem}.qodly-roles-editor .top-1\/2{top:50%}.qodly-roles-editor .top-5{top:1.25rem}.qodly-roles-editor .top-full{top:100%}.qodly-roles-editor .isolate{isolation:isolate}.qodly-roles-editor .z-10{z-index:10}.qodly-roles-editor .z-20{z-index:20}.qodly-roles-editor .z-50{z-index:50}.qodly-roles-editor .z-\[1999\]{z-index:1999}.qodly-roles-editor .m-0\.5{margin:.125rem}.qodly-roles-editor .mx-1{margin-left:.25rem;margin-right:.25rem}.qodly-roles-editor .mx-auto{margin-left:auto;margin-right:auto}.qodly-roles-editor .-ml-1{margin-left:-.25rem}.qodly-roles-editor .-mt-6{margin-top:-1.5rem}.qodly-roles-editor .mb-0{margin-bottom:0}.qodly-roles-editor .mb-1{margin-bottom:.25rem}.qodly-roles-editor .mb-2{margin-bottom:.5rem}.qodly-roles-editor .mb-4{margin-bottom:1rem}.qodly-roles-editor .ml-1{margin-left:.25rem}.qodly-roles-editor .ml-1\.5{margin-left:.375rem}.qodly-roles-editor .ml-2{margin-left:.5rem}.qodly-roles-editor .ml-4{margin-left:1rem}.qodly-roles-editor .ml-\[43px\]{margin-left:43px}.qodly-roles-editor .ml-auto{margin-left:auto}.qodly-roles-editor .mr-0\.5{margin-right:.125rem}.qodly-roles-editor .mr-1{margin-right:.25rem}.qodly-roles-editor .mr-2{margin-right:.5rem}.qodly-roles-editor .mr-3{margin-right:.75rem}.qodly-roles-editor .mr-4{margin-right:1rem}.qodly-roles-editor .mt-0\.5{margin-top:.125rem}.qodly-roles-editor .mt-1{margin-top:.25rem}.qodly-roles-editor .mt-2{margin-top:.5rem}.qodly-roles-editor .mt-4{margin-top:1rem}.qodly-roles-editor .mt-px{margin-top:1px}.qodly-roles-editor .block{display:block}.qodly-roles-editor .inline-block{display:inline-block}.qodly-roles-editor .inline{display:inline}.qodly-roles-editor .flex{display:flex}.qodly-roles-editor .inline-flex{display:inline-flex}.qodly-roles-editor .table{display:table}.qodly-roles-editor .grid{display:grid}.qodly-roles-editor .hidden{display:none}.qodly-roles-editor .h-10{height:2.5rem}.qodly-roles-editor .h-2{height:.5rem}.qodly-roles-editor .h-2\.5{height:.625rem}.qodly-roles-editor .h-20{height:5rem}.qodly-roles-editor .h-3{height:.75rem}.qodly-roles-editor .h-3\.5{height:.875rem}.qodly-roles-editor .h-4{height:1rem}.qodly-roles-editor .h-4\.5{height:1.125rem}.qodly-roles-editor .h-5{height:1.25rem}.qodly-roles-editor .h-6{height:1.5rem}.qodly-roles-editor .h-60{height:15rem}.qodly-roles-editor .h-8{height:2rem}.qodly-roles-editor .h-\[14px\]{height:14px}.qodly-roles-editor .h-auto{height:auto}.qodly-roles-editor .h-full{height:100%}.qodly-roles-editor .h-screen{height:100vh}.qodly-roles-editor .max-h-80{max-height:20rem}.qodly-roles-editor .max-h-\[10rem\]{max-height:10rem}.qodly-roles-editor .min-h-\[10rem\]{min-height:10rem}.qodly-roles-editor .w-0\.5{width:.125rem}.qodly-roles-editor .w-10{width:2.5rem}.qodly-roles-editor .w-16{width:4rem}.qodly-roles-editor .w-2{width:.5rem}.qodly-roles-editor .w-2\.5{width:.625rem}.qodly-roles-editor .w-20{width:5rem}.qodly-roles-editor .w-3{width:.75rem}.qodly-roles-editor .w-3\.5{width:.875rem}.qodly-roles-editor .w-4{width:1rem}.qodly-roles-editor .w-5{width:1.25rem}.qodly-roles-editor .w-56{width:14rem}.qodly-roles-editor .w-6{width:1.5rem}.qodly-roles-editor .w-60{width:15rem}.qodly-roles-editor .w-8{width:2rem}.qodly-roles-editor .w-96{width:24rem}.qodly-roles-editor .w-\[--width\]{width:var(--width)}.qodly-roles-editor .w-\[14px\]{width:14px}.qodly-roles-editor .w-\[356px\]{width:356px}.qodly-roles-editor .w-fit{width:-moz-fit-content;width:fit-content}.qodly-roles-editor .w-full{width:100%}.qodly-roles-editor .w-screen{width:100vw}.qodly-roles-editor .min-w-0{min-width:0}.qodly-roles-editor .min-w-\[110px\]{min-width:110px}.qodly-roles-editor .min-w-\[256px\]{min-width:256px}.qodly-roles-editor .min-w-fit{min-width:-moz-fit-content;min-width:fit-content}.qodly-roles-editor .max-w-\[240px\]{max-width:240px}.qodly-roles-editor .max-w-xs{max-width:20rem}.qodly-roles-editor .flex-1{flex:1 1 0%}.qodly-roles-editor .flex-none{flex:none}.qodly-roles-editor .flex-shrink-0,.qodly-roles-editor .shrink-0{flex-shrink:0}.qodly-roles-editor .grow{flex-grow:1}.qodly-roles-editor .-translate-y-1\/2{--tw-translate-y:-50%}.qodly-roles-editor .-translate-y-1\/2,.qodly-roles-editor .translate-x-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.qodly-roles-editor .translate-x-0{--tw-translate-x:0px}.qodly-roles-editor .translate-x-1{--tw-translate-x:.25rem}.qodly-roles-editor .translate-x-1,.qodly-roles-editor .translate-x-1\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.qodly-roles-editor .translate-x-1\/2{--tw-translate-x:50%}.qodly-roles-editor .translate-x-2\.5{--tw-translate-x:.625rem}.qodly-roles-editor .translate-x-2\.5,.qodly-roles-editor .translate-x-3{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.qodly-roles-editor .translate-x-3{--tw-translate-x:.75rem}.qodly-roles-editor .translate-x-\[0\.85rem\]{--tw-translate-x:.85rem}.qodly-roles-editor .-rotate-90,.qodly-roles-editor .translate-x-\[0\.85rem\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.qodly-roles-editor .-rotate-90{--tw-rotate:-90deg}.qodly-roles-editor .rotate-0{--tw-rotate:0deg}.qodly-roles-editor .rotate-0,.qodly-roles-editor .rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.qodly-roles-editor .rotate-45{--tw-rotate:45deg}.qodly-roles-editor .rotate-90{--tw-rotate:90deg}.qodly-roles-editor .rotate-90,.qodly-roles-editor .scale-100{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.qodly-roles-editor .scale-100{--tw-scale-x:1;--tw-scale-y:1}.qodly-roles-editor .scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.qodly-roles-editor .scale-95,.qodly-roles-editor .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.qodly-roles-editor .cursor-pointer{cursor:pointer}.qodly-roles-editor .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.qodly-roles-editor .list-disc{list-style-type:disc}.qodly-roles-editor .flex-row{flex-direction:row}.qodly-roles-editor .flex-col{flex-direction:column}.qodly-roles-editor .flex-wrap{flex-wrap:wrap}.qodly-roles-editor .place-content-center{place-content:center}.qodly-roles-editor .items-start{align-items:flex-start}.qodly-roles-editor .items-center{align-items:center}.qodly-roles-editor .items-stretch{align-items:stretch}.qodly-roles-editor .justify-start{justify-content:flex-start}.qodly-roles-editor .justify-center{justify-content:center}.qodly-roles-editor .justify-between{justify-content:space-between}.qodly-roles-editor .gap-1{gap:.25rem}.qodly-roles-editor .gap-2{gap:.5rem}.qodly-roles-editor .gap-3{gap:.75rem}.qodly-roles-editor .gap-4{gap:1rem}.qodly-roles-editor .gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.qodly-roles-editor .gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.qodly-roles-editor .gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.qodly-roles-editor .gap-x-5{-moz-column-gap:1.25rem;column-gap:1.25rem}.qodly-roles-editor .gap-y-4{row-gap:1rem}.qodly-roles-editor .space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.25rem*var(--tw-space-x-reverse));margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)))}.qodly-roles-editor .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem*var(--tw-space-x-reverse));margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)))}.qodly-roles-editor .space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1rem*var(--tw-space-x-reverse));margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)))}.qodly-roles-editor .space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem*var(--tw-space-y-reverse))}.qodly-roles-editor .space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem*var(--tw-space-y-reverse))}.qodly-roles-editor .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem*var(--tw-space-y-reverse))}.qodly-roles-editor .self-center{align-self:center}.qodly-roles-editor .overflow-auto{overflow:auto}.qodly-roles-editor .overflow-hidden{overflow:hidden}.qodly-roles-editor .overflow-x-auto{overflow-x:auto}.qodly-roles-editor .overflow-y-auto{overflow-y:auto}.qodly-roles-editor .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qodly-roles-editor .text-ellipsis{text-overflow:ellipsis}.qodly-roles-editor .whitespace-nowrap{white-space:nowrap}.qodly-roles-editor .text-wrap{text-wrap:wrap}.qodly-roles-editor .rounded{border-radius:4px}.qodly-roles-editor .rounded-full{border-radius:9999px}.qodly-roles-editor .rounded-lg{border-radius:.5rem}.qodly-roles-editor .rounded-md{border-radius:.375rem}.qodly-roles-editor .rounded-sm{border-radius:.125rem}.qodly-roles-editor .rounded-l{border-top-left-radius:4px;border-bottom-left-radius:4px}.qodly-roles-editor .rounded-r{border-top-right-radius:4px;border-bottom-right-radius:4px}.qodly-roles-editor .border{border-width:.5px}.qodly-roles-editor .border-2,.qodly-roles-editor .border-\[2px\]{border-width:2px}.qodly-roles-editor .border-b,.qodly-roles-editor .border-b-\[0\.5px\]{border-bottom-width:.5px}.qodly-roles-editor .border-l{border-left-width:.5px}.qodly-roles-editor .border-l-2{border-left-width:2px}.qodly-roles-editor .border-l-\[0\.5px\]{border-left-width:.5px}.qodly-roles-editor .border-r{border-right-width:.5px}.qodly-roles-editor .border-t{border-top-width:.5px}.qodly-roles-editor .border-fd-gray-darker{--tw-border-opacity:1;border-color:rgb(21 21 21/var(--tw-border-opacity,1))}.qodly-roles-editor .border-grey-100{--tw-border-opacity:1;border-color:rgb(204 204 204/var(--tw-border-opacity,1))}.qodly-roles-editor .border-grey-200{--tw-border-opacity:1;border-color:rgb(136 136 136/var(--tw-border-opacity,1))}.qodly-roles-editor .border-grey-300{--tw-border-opacity:1;border-color:rgb(83 83 83/var(--tw-border-opacity,1))}.qodly-roles-editor .border-grey-50{--tw-border-opacity:1;border-color:rgb(241 245 249/var(--tw-border-opacity,1))}.qodly-roles-editor .border-grey-500{--tw-border-opacity:1;border-color:rgb(68 68 68/var(--tw-border-opacity,1))}.qodly-roles-editor .border-grey-900{--tw-border-opacity:1;border-color:rgb(38 38 38/var(--tw-border-opacity,1))}.qodly-roles-editor .border-primary-dark{--tw-border-opacity:1;border-color:rgb(177 116 229/var(--tw-border-opacity,1))}.qodly-roles-editor .border-red-400{--tw-border-opacity:1;border-color:rgb(240 82 82/var(--tw-border-opacity,1))}.qodly-roles-editor .border-transparent{border-color:transparent}.qodly-roles-editor .border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity,1))}.qodly-roles-editor .bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-fd-gray-default{--tw-bg-opacity:1;background-color:rgb(49 49 49/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-green-200{--tw-bg-opacity:1;background-color:rgb(187 247 208/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-grey-200{--tw-bg-opacity:1;background-color:rgb(136 136 136/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-grey-300{--tw-bg-opacity:1;background-color:rgb(83 83 83/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-grey-600{--tw-bg-opacity:1;background-color:rgb(63 63 63/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-grey-800{--tw-bg-opacity:1;background-color:rgb(56 56 56/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-grey-900{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-negative-200{--tw-bg-opacity:1;background-color:rgb(249 186 186/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-primary-dark{--tw-bg-opacity:1;background-color:rgb(177 116 229/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-primary-darker{--tw-bg-opacity:1;background-color:rgb(146 95 190/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-primary-hover{--tw-bg-opacity:1;background-color:rgb(117 73 154/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-primary-light,.qodly-roles-editor .bg-purple-200{--tw-bg-opacity:1;background-color:rgb(232 195 255/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-purple-800{--tw-bg-opacity:1;background-color:rgb(146 95 190/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-red-200{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-red-400{--tw-bg-opacity:1;background-color:rgb(240 82 82/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-red-500{--tw-bg-opacity:1;background-color:rgb(206 81 81/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-transparent{background-color:transparent}.qodly-roles-editor .bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.qodly-roles-editor .bg-opacity-40{--tw-bg-opacity:.4}.qodly-roles-editor .bg-opacity-80{--tw-bg-opacity:.8}.qodly-roles-editor .stroke-current{stroke:currentColor}.qodly-roles-editor .p-0{padding:0}.qodly-roles-editor .p-1{padding:.25rem}.qodly-roles-editor .p-2{padding:.5rem}.qodly-roles-editor .p-4{padding:1rem}.qodly-roles-editor .p-6{padding:1.5rem}.qodly-roles-editor .p-\[15px\]{padding:15px}.qodly-roles-editor .px-1{padding-left:.25rem;padding-right:.25rem}.qodly-roles-editor .px-12{padding-left:3rem;padding-right:3rem}.qodly-roles-editor .px-2{padding-left:.5rem;padding-right:.5rem}.qodly-roles-editor .px-3{padding-left:.75rem;padding-right:.75rem}.qodly-roles-editor .px-3\.5{padding-left:.875rem;padding-right:.875rem}.qodly-roles-editor .px-4{padding-left:1rem;padding-right:1rem}.qodly-roles-editor .px-6{padding-left:1.5rem;padding-right:1.5rem}.qodly-roles-editor .px-8{padding-left:2rem;padding-right:2rem}.qodly-roles-editor .py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.qodly-roles-editor .py-1{padding-top:.25rem;padding-bottom:.25rem}.qodly-roles-editor .py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.qodly-roles-editor .py-2{padding-top:.5rem;padding-bottom:.5rem}.qodly-roles-editor .py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.qodly-roles-editor .py-3{padding-top:.75rem;padding-bottom:.75rem}.qodly-roles-editor .py-4{padding-top:1rem;padding-bottom:1rem}.qodly-roles-editor .py-\[10px\]{padding-top:10px;padding-bottom:10px}.qodly-roles-editor .pb-10{padding-bottom:2.5rem}.qodly-roles-editor .pb-3{padding-bottom:.75rem}.qodly-roles-editor .pb-48{padding-bottom:12rem}.qodly-roles-editor .pb-8{padding-bottom:2rem}.qodly-roles-editor .pl-2{padding-left:.5rem}.qodly-roles-editor .pl-6{padding-left:1.5rem}.qodly-roles-editor .pr-1{padding-right:.25rem}.qodly-roles-editor .pr-5{padding-right:1.25rem}.qodly-roles-editor .pt-0{padding-top:0}.qodly-roles-editor .pt-1{padding-top:.25rem}.qodly-roles-editor .pt-2{padding-top:.5rem}.qodly-roles-editor .text-left{text-align:left}.qodly-roles-editor .text-center{text-align:center}.qodly-roles-editor .align-middle{vertical-align:middle}.qodly-roles-editor .font-poppins{font-family:Twemoji Country Flags,Poppins,sans-serif}.qodly-roles-editor .text-\[11px\]{font-size:11px}.qodly-roles-editor .text-\[12px\]{font-size:12px}.qodly-roles-editor .text-\[13px\]{font-size:13px}.qodly-roles-editor .text-lg{font-size:1.125rem;line-height:1.75rem}.qodly-roles-editor .text-s{font-size:.75rem}.qodly-roles-editor .text-sm{font-size:.875rem;line-height:1.25rem}.qodly-roles-editor .text-xs{font-size:.65rem}.qodly-roles-editor .text-xxs{font-size:.55rem}.qodly-roles-editor .font-bold{font-weight:700}.qodly-roles-editor .font-medium{font-weight:500}.qodly-roles-editor .font-normal{font-weight:400}.qodly-roles-editor .font-semibold{font-weight:600}.qodly-roles-editor .font-thin{font-weight:100}.qodly-roles-editor .capitalize{text-transform:capitalize}.qodly-roles-editor .italic{font-style:italic}.qodly-roles-editor .leading-6{line-height:1.5rem}.qodly-roles-editor .leading-relaxed{line-height:1.625}.qodly-roles-editor .text-\[\#DDE1E6\]{--tw-text-opacity:1;color:rgb(221 225 230/var(--tw-text-opacity,1))}.qodly-roles-editor .text-\[\#F6F6F6\]{--tw-text-opacity:1;color:rgb(246 246 246/var(--tw-text-opacity,1))}.qodly-roles-editor .text-fd-gray-lighter{--tw-text-opacity:1;color:rgb(234 234 234/var(--tw-text-opacity,1))}.qodly-roles-editor .text-fd-gray-mild{--tw-text-opacity:1;color:rgb(179 179 179/var(--tw-text-opacity,1))}.qodly-roles-editor .text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity,1))}.qodly-roles-editor .text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.qodly-roles-editor .text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.qodly-roles-editor .text-grey-100{--tw-text-opacity:1;color:rgb(204 204 204/var(--tw-text-opacity,1))}.qodly-roles-editor .text-grey-200{--tw-text-opacity:1;color:rgb(136 136 136/var(--tw-text-opacity,1))}.qodly-roles-editor .text-grey-50{--tw-text-opacity:1;color:rgb(241 245 249/var(--tw-text-opacity,1))}.qodly-roles-editor .text-negative-400{--tw-text-opacity:1;color:rgb(197 66 66/var(--tw-text-opacity,1))}.qodly-roles-editor .text-primary{--tw-text-opacity:1;color:rgb(187 11 209/var(--tw-text-opacity,1))}.qodly-roles-editor .text-primary-dark{--tw-text-opacity:1;color:rgb(177 116 229/var(--tw-text-opacity,1))}.qodly-roles-editor .text-primary-darker{--tw-text-opacity:1;color:rgb(146 95 190/var(--tw-text-opacity,1))}.qodly-roles-editor .text-purple-900{--tw-text-opacity:1;color:rgb(187 11 209/var(--tw-text-opacity,1))}.qodly-roles-editor .text-red-400{--tw-text-opacity:1;color:rgb(240 82 82/var(--tw-text-opacity,1))}.qodly-roles-editor .text-red-500{--tw-text-opacity:1;color:rgb(206 81 81/var(--tw-text-opacity,1))}.qodly-roles-editor .text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.qodly-roles-editor .text-yellow-300{--tw-text-opacity:1;color:rgb(253 224 71/var(--tw-text-opacity,1))}.qodly-roles-editor .text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.qodly-roles-editor .text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.qodly-roles-editor .opacity-0{opacity:0}.qodly-roles-editor .opacity-100{opacity:1}.qodly-roles-editor .opacity-40{opacity:.4}.qodly-roles-editor .opacity-60{opacity:.6}.qodly-roles-editor .opacity-70{opacity:.7}.qodly-roles-editor .shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}.qodly-roles-editor .shadow-2xl,.qodly-roles-editor .shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.qodly-roles-editor .shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.qodly-roles-editor .shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.qodly-roles-editor .shadow-md,.qodly-roles-editor .shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.qodly-roles-editor .shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.qodly-roles-editor .outline-none{outline:2px solid transparent;outline-offset:2px}.qodly-roles-editor .ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.qodly-roles-editor .filter{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)}.qodly-roles-editor .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.qodly-roles-editor .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.qodly-roles-editor .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.qodly-roles-editor .duration-150{transition-duration:.15s}.qodly-roles-editor .duration-200{transition-duration:.2s}.qodly-roles-editor .duration-300{transition-duration:.3s}.qodly-roles-editor .ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.qodly-roles-editor .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.qodly-roles-editor .ease-linear{transition-timing-function:linear}.qodly-roles-editor .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.qodly-roles-editor .even\:bg-grey-600:nth-child(2n){--tw-bg-opacity:1;background-color:rgb(63 63 63/var(--tw-bg-opacity,1))}.qodly-roles-editor .hover\:border-primary-hover:hover{--tw-border-opacity:1;border-color:rgb(117 73 154/var(--tw-border-opacity,1))}.qodly-roles-editor .hover\:border-white:hover{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity,1))}.qodly-roles-editor .hover\:bg-grey-300:hover{--tw-bg-opacity:1;background-color:rgb(83 83 83/var(--tw-bg-opacity,1))}.qodly-roles-editor .hover\:bg-primary-hover:hover{--tw-bg-opacity:1;background-color:rgb(117 73 154/var(--tw-bg-opacity,1))}.qodly-roles-editor .hover\:bg-purple-800:hover{--tw-bg-opacity:1;background-color:rgb(146 95 190/var(--tw-bg-opacity,1))}.qodly-roles-editor .hover\:bg-white:hover{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.qodly-roles-editor .hover\:bg-opacity-80:hover{--tw-bg-opacity:.8}.qodly-roles-editor .hover\:font-bold:hover{font-weight:700}.qodly-roles-editor .hover\:text-primary-dark:hover{--tw-text-opacity:1;color:rgb(177 116 229/var(--tw-text-opacity,1))}.qodly-roles-editor .hover\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.qodly-roles-editor .hover\:underline:hover{text-decoration-line:underline}.qodly-roles-editor .focus\:rounded-b-none:focus{border-bottom-right-radius:0;border-bottom-left-radius:0}.qodly-roles-editor .focus\:border-primary-dark:focus{--tw-border-opacity:1;border-color:rgb(177 116 229/var(--tw-border-opacity,1))}.qodly-roles-editor .focus\:bg-primary-dark:focus{--tw-bg-opacity:1;background-color:rgb(177 116 229/var(--tw-bg-opacity,1))}.qodly-roles-editor .focus\:text-white:focus{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.qodly-roles-editor .focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.qodly-roles-editor .focus\:ring-1:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.qodly-roles-editor .focus\:ring-inset:focus{--tw-ring-inset:inset}.qodly-roles-editor .focus\:ring-white:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(255 255 255/var(--tw-ring-opacity,1))}.qodly-roles-editor .focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.qodly-roles-editor .focus-visible\:ring-white:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(255 255 255/var(--tw-ring-opacity,1))}.qodly-roles-editor .focus-visible\:ring-opacity-75:focus-visible{--tw-ring-opacity:.75}.qodly-roles-editor .disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.qodly-roles-editor .disabled\:opacity-50:disabled{opacity:.5}.qodly-roles-editor .disabled\:hover\:bg-primary-dark:hover:disabled{--tw-bg-opacity:1;background-color:rgb(177 116 229/var(--tw-bg-opacity,1))}.qodly-roles-editor .group:focus-within .group-focus-within\:rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.qodly-roles-editor .group:focus-within .group-focus-within\:border-t-0{border-top-width:0}.qodly-roles-editor .group:hover .group-hover\:block{display:block}.qodly-roles-editor .group:hover .group-hover\:rounded-l{border-top-left-radius:4px;border-bottom-left-radius:4px}.qodly-roles-editor .group:hover .group-hover\:rounded-r{border-top-right-radius:4px;border-bottom-right-radius:4px}.qodly-roles-editor .group:hover .group-hover\:bg-grey-300{--tw-bg-opacity:1;background-color:rgb(83 83 83/var(--tw-bg-opacity,1))}.qodly-roles-editor .group:hover .group-hover\:opacity-100{opacity:1}.qodly-roles-editor .group:hover .group-hover\:opacity-70{opacity:.7}.qodly-roles-editor div.react-flow__attribution.bottom.left,.qodly-roles-editor div.react-flow__attribution.bottom.right{display:none}
package/dist/index.cjs.js CHANGED
@@ -68,5 +68,5 @@ function print() { __p += __j.call(arguments, '') }
68
68
  `)&&n.flags==="s")}),sb}var ub,mM;function LJ(){if(mM)return ub;mM=1;var e=at(),t=bt(),r=t.RegExp;return ub=e(function(){var n=r("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"}),ub}var cb,yM;function ww(){if(yM)return cb;yM=1;var e=Zt(),t=it(),r=Pi(),n=kk(),i=qJ(),o=lw(),a=cl(),u=No().get,c=kJ(),d=LJ(),f=o("native-string-replace",String.prototype.replace),h=RegExp.prototype.exec,p=h,v=t("".charAt),m=t("".indexOf),y=t("".replace),b=t("".slice),x=(function(){var _=/a/,R=/b*/g;return e(h,_,"a"),e(h,R,"a"),_.lastIndex!==0||R.lastIndex!==0})(),w=i.BROKEN_CARET,S=/()??/.exec("")[1]!==void 0,E=x||S||w||c||d;return E&&(p=function(R){var P=this,N=u(P),j=r(R),L=N.raw,F,k,D,T,B,$,W;if(L)return L.lastIndex=P.lastIndex,F=e(p,L,j),P.lastIndex=L.lastIndex,F;var Y=N.groups,ee=w&&P.sticky,H=e(n,P),Q=P.source,ce=0,se=j;if(ee&&(H=y(H,"y",""),m(H,"g")===-1&&(H+="g"),se=b(j,P.lastIndex),P.lastIndex>0&&(!P.multiline||P.multiline&&v(j,P.lastIndex-1)!==`
69
69
  `)&&(Q="(?: "+Q+")",se=" "+se,ce++),k=new RegExp("^(?:"+Q+")",H)),S&&(k=new RegExp("^"+Q+"$(?!\\s)",H)),x&&(D=P.lastIndex),T=e(h,ee?k:P,se),ee?T?(T.input=b(T.input,ce),T[0]=b(T[0],ce),T.index=P.lastIndex,P.lastIndex+=T[0].length):P.lastIndex=0:x&&T&&(P.lastIndex=P.global?T.index+T[0].length:D),S&&T&&T.length>1&&e(f,T[0],k,function(){for(B=1;B<arguments.length-2;B++)arguments[B]===void 0&&(T[B]=void 0)}),T&&Y)for(T.groups=$=a(null),B=0;B<Y.length;B++)W=Y[B],$[W[0]]=T[W[1]];return T}),cb=p,cb}var bM;function Lk(){if(bM)return hM;bM=1;var e=Kn(),t=ww();return e({target:"RegExp",proto:!0,forced:/./.exec!==t},{exec:t}),hM}Lk();var xM={},lb,wM;function Bk(){if(wM)return lb;wM=1,Lk();var e=Zt(),t=Ri(),r=ww(),n=at(),i=$t(),o=es(),a=i("species"),u=RegExp.prototype;return lb=function(c,d,f,h){var p=i(c),v=!n(function(){var x={};return x[p]=function(){return 7},""[c](x)!==7}),m=v&&!n(function(){var x=!1,w=/a/;return c==="split"&&(w={},w.constructor={},w.constructor[a]=function(){return w},w.flags="",w[p]=/./[p]),w.exec=function(){return x=!0,null},w[p](""),!x});if(!v||!m||f){var y=/./[p],b=d(p,""[c],function(x,w,S,E,_){var R=w.exec;return R===r||R===u.exec?v&&!_?{done:!0,value:e(y,w,S,E)}:{done:!0,value:e(x,S,w,E)}:{done:!1}});t(String.prototype,c,b[0]),t(u,p,b[1])}h&&o(u[p],"sham",!0)},lb}var fb,_M;function Fk(){if(_M)return fb;_M=1;var e=Sk().charAt;return fb=function(t,r,n){return r+(n?e(t,r).length:1)},fb}var db,EM;function BJ(){if(EM)return db;EM=1;var e=bt(),t=at(),r=e.RegExp,n=!t(function(){var i=!0;try{r(".","d")}catch{i=!1}var o={},a="",u=i?"dgimsy":"gimsy",c=function(p,v){Object.defineProperty(o,p,{get:function(){return a+=v,!0}})},d={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};i&&(d.hasIndices="d");for(var f in d)c(f,d[f]);var h=Object.getOwnPropertyDescriptor(r.prototype,"flags").get.call(o);return h!==u||a!==u});return db={correct:n},db}var hb,SM;function $k(){if(SM)return hb;SM=1;var e=Zt(),t=Rr(),r=nl(),n=BJ(),i=kk(),o=RegExp.prototype;return hb=n.correct?function(a){return a.flags}:function(a){return!n.correct&&r(o,a)&&!t(a,"flags")?e(i,a):a.flags},hb}var pb,OM;function zk(){if(OM)return pb;OM=1;var e=Zt(),t=Pr(),r=Et(),n=Gn(),i=ww(),o=TypeError;return pb=function(a,u){var c=a.exec;if(r(c)){var d=e(c,a,u);return d!==null&&t(d),d}if(n(a)==="RegExp")return e(i,a,u);throw new o("RegExp#exec called on incompatible receiver")},pb}var CM;function FJ(){if(CM)return xM;CM=1;var e=Zt(),t=it(),r=Bk(),n=Pr(),i=Tt(),o=vw(),a=Pi(),u=Ci(),c=Qa(),d=Fk(),f=$k(),h=zk(),p=t("".indexOf);return r("match",function(v,m,y){return[function(x){var w=u(this),S=i(x)?c(x,v):void 0;return S?e(S,x,w):new RegExp(x)[v](a(w))},function(b){var x=n(this),w=a(b),S=y(m,x,w);if(S.done)return S.value;var E=a(f(x));if(p(E,"g")===-1)return h(x,w);var _=p(E,"u")!==-1;x.lastIndex=0;for(var R=[],P=0,N;(N=h(x,w))!==null;){var j=a(N[0]);R[P]=j,j===""&&(x.lastIndex=d(w,o(x.lastIndex),_)),P++}return P===0?null:R}]}),xM}FJ();var RM={},vb,PM;function $J(){if(PM)return vb;PM=1;var e=lk(),t=On();return vb=function(r,n,i){return i.get&&e(i.get,n,{getter:!0}),i.set&&e(i.set,n,{setter:!0}),t.f(r,n,i)},vb}var IM;function zJ(){if(IM)return RM;IM=1;var e=zr(),t=hw().EXISTS,r=it(),n=$J(),i=Function.prototype,o=r(i.toString),a=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=r(a.exec),c="name";return e&&!t&&n(i,c,{configurable:!0,get:function(){try{return u(a,o(this))[1]}catch{return""}}}),RM}zJ();var NM={},gb,TM;function HJ(){if(TM)return gb;TM=1;var e=el(),t=Function.prototype,r=t.apply,n=t.call;return gb=typeof Reflect=="object"&&Reflect.apply||(e?n.bind(r):function(){return n.apply(r,arguments)}),gb}var mb,AM;function UJ(){if(AM)return mb;AM=1;var e=it(),t=Io(),r=Math.floor,n=e("".charAt),i=e("".replace),o=e("".slice),a=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;return mb=function(c,d,f,h,p,v){var m=f+c.length,y=h.length,b=u;return p!==void 0&&(p=t(p),b=a),i(v,b,function(x,w){var S;switch(n(w,0)){case"$":return"$";case"&":return c;case"`":return o(d,0,f);case"'":return o(d,m);case"<":S=p[o(w,1,-1)];break;default:var E=+w;if(E===0)return x;if(E>y){var _=r(E/10);return _===0?x:_<=y?h[_-1]===void 0?n(w,1):h[_-1]+n(w,1):x}S=h[E-1]}return S===void 0?"":S})},mb}var MM;function VJ(){if(MM)return NM;MM=1;var e=HJ(),t=Zt(),r=it(),n=Bk(),i=at(),o=Pr(),a=Et(),u=Tt(),c=al(),d=vw(),f=Pi(),h=Ci(),p=Fk(),v=Qa(),m=UJ(),y=$k(),b=zk(),x=$t(),w=x("replace"),S=Math.max,E=Math.min,_=r([].concat),R=r([].push),P=r("".indexOf),N=r("".slice),j=function(D){return D===void 0?D:String(D)},L=(function(){return"a".replace(/./,"$0")==="$0"})(),F=(function(){return/./[w]?/./[w]("a","$0")==="":!1})(),k=!i(function(){var D=/./;return D.exec=function(){var T=[];return T.groups={a:"7"},T},"".replace(D,"$<a>")!=="7"});return n("replace",function(D,T,B){var $=F?"$":"$0";return[function(Y,ee){var H=h(this),Q=u(Y)?v(Y,w):void 0;return Q?t(Q,Y,H,ee):t(T,f(H),Y,ee)},function(W,Y){var ee=o(this),H=f(W);if(typeof Y=="string"&&P(Y,$)===-1&&P(Y,"$<")===-1){var Q=B(T,ee,H,Y);if(Q.done)return Q.value}var ce=a(Y);ce||(Y=f(Y));var se=f(y(ee)),z=P(se,"g")!==-1,G;z&&(G=P(se,"u")!==-1,ee.lastIndex=0);for(var J=[],V;V=b(ee,H),!(V===null||(R(J,V),!z));){var K=f(V[0]);K===""&&(ee.lastIndex=p(H,d(ee.lastIndex),G))}for(var ie="",ne=0,ue=0;ue<J.length;ue++){V=J[ue];for(var de=f(V[0]),we=S(E(c(V.index),H.length),0),Se=[],_e,he=1;he<V.length;he++)R(Se,j(V[he]));var ae=V.groups;if(ce){var Oe=_([de],Se,we,H);ae!==void 0&&R(Oe,ae),_e=f(e(Y,void 0,Oe))}else _e=m(de,H,we,Se,ae,Y);we>=ne&&(ie+=N(H,ne,we)+_e,ne=we+de.length)}return ie+N(H,ne)}]},!k||!L||F),NM}VJ();function kn(e){return!e||!e.ownerDocument||!e.ownerDocument.defaultView?window:e.ownerDocument.defaultView}function Hu(e){return!e||!e.ownerDocument?document:e.ownerDocument}var Ji=null,DM=null;qk&&window.addEventListener("resize",function(){DM!==window.devicePixelRatio&&(DM=window.devicePixelRatio,Ji=null)});function jM(e){if(Ji===null){var t=Hu(e);if(typeof t>"u")return Ji=0,Ji;var r=t.body,n=t.createElement("div");n.classList.add("simplebar-hide-scrollbar"),r.appendChild(n);var i=n.getBoundingClientRect().right;r.removeChild(n),Ji=i}return Ji}var gc=(function(){function e(r,n){var i=this;this.onScroll=function(){var o=kn(i.el);i.scrollXTicking||(o.requestAnimationFrame(i.scrollX),i.scrollXTicking=!0),i.scrollYTicking||(o.requestAnimationFrame(i.scrollY),i.scrollYTicking=!0)},this.scrollX=function(){i.axis.x.isOverflowing&&(i.showScrollbar("x"),i.positionScrollbar("x")),i.scrollXTicking=!1},this.scrollY=function(){i.axis.y.isOverflowing&&(i.showScrollbar("y"),i.positionScrollbar("y")),i.scrollYTicking=!1},this.onMouseEnter=function(){i.showScrollbar("x"),i.showScrollbar("y")},this.onMouseMove=function(o){i.mouseX=o.clientX,i.mouseY=o.clientY,(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseMoveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseMoveForAxis("y")},this.onMouseLeave=function(){i.onMouseMove.cancel(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseLeaveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseLeaveForAxis("y"),i.mouseX=-1,i.mouseY=-1},this.onWindowResize=function(){i.scrollbarWidth=i.getScrollbarWidth(),i.hideNativeScrollbar()},this.hideScrollbars=function(){i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.track.rect)||(i.axis.y.scrollbar.el.classList.remove(i.classNames.visible),i.axis.y.isVisible=!1),i.isWithinBounds(i.axis.x.track.rect)||(i.axis.x.scrollbar.el.classList.remove(i.classNames.visible),i.axis.x.isVisible=!1)},this.onPointerEvent=function(o){var a,u;i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&(a=i.isWithinBounds(i.axis.x.track.rect)),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&(u=i.isWithinBounds(i.axis.y.track.rect)),(a||u)&&(o.preventDefault(),o.stopPropagation(),o.type==="mousedown"&&(a&&(i.axis.x.scrollbar.rect=i.axis.x.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.x.scrollbar.rect)?i.onDragStart(o,"x"):i.onTrackClick(o,"x")),u&&(i.axis.y.scrollbar.rect=i.axis.y.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.scrollbar.rect)?i.onDragStart(o,"y"):i.onTrackClick(o,"y"))))},this.drag=function(o){var a,u=i.axis[i.draggedAxis].track,c=u.rect[i.axis[i.draggedAxis].sizeAttr],d=i.axis[i.draggedAxis].scrollbar,f=i.contentWrapperEl[i.axis[i.draggedAxis].scrollSizeAttr],h=parseInt(i.elStyles[i.axis[i.draggedAxis].sizeAttr],10);o.preventDefault(),o.stopPropagation(),i.draggedAxis==="y"?a=o.pageY:a=o.pageX;var p=a-u.rect[i.axis[i.draggedAxis].offsetAttr]-i.axis[i.draggedAxis].dragOffset,v=p/(c-d.size),m=v*(f-h);i.draggedAxis==="x"&&(m=i.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?m-(c+d.size):m,m=i.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-m:m),i.contentWrapperEl[i.axis[i.draggedAxis].scrollOffsetAttr]=m},this.onEndDrag=function(o){var a=Hu(i.el),u=kn(i.el);o.preventDefault(),o.stopPropagation(),i.el.classList.remove(i.classNames.dragging),a.removeEventListener("mousemove",i.drag,!0),a.removeEventListener("mouseup",i.onEndDrag,!0),i.removePreventClickId=u.setTimeout(function(){a.removeEventListener("click",i.preventClick,!0),a.removeEventListener("dblclick",i.preventClick,!0),i.removePreventClickId=null})},this.preventClick=function(o){o.preventDefault(),o.stopPropagation()},this.el=r,this.minScrollbarWidth=20,this.options=Object.assign({},e.defaultOptions,n),this.classNames=Object.assign({},e.defaultOptions.classNames,this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,!e.instances.has(this.el)&&(this.recalculate=GA(this.recalculate.bind(this),64),this.onMouseMove=GA(this.onMouseMove.bind(this),64),this.hideScrollbars=YA(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=YA(this.onWindowResize.bind(this),64,{leading:!0}),e.getRtlHelpers=sJ(e.getRtlHelpers),this.init())}e.getRtlHelpers=function(){var n=document.createElement("div");n.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var i=n.firstElementChild;document.body.appendChild(i);var o=i.firstElementChild;i.scrollLeft=0;var a=e.getOffset(i),u=e.getOffset(o);i.scrollLeft=999;var c=e.getOffset(o);return{isRtlScrollingInverted:a.left!==u.left&&u.left-c.left!==0,isRtlScrollbarInverted:a.left!==u.left}},e.getOffset=function(n){var i=n.getBoundingClientRect(),o=Hu(n),a=kn(n);return{top:i.top+(a.pageYOffset||o.documentElement.scrollTop),left:i.left+(a.pageXOffset||o.documentElement.scrollLeft)}};var t=e.prototype;return t.init=function(){e.instances.set(this.el,this),qk&&(this.initDOM(),this.setAccessibilityAttributes(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},t.initDOM=function(){var n=this;if(Array.prototype.filter.call(this.el.children,function(a){return a.classList.contains(n.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var i=document.createElement("div"),o=document.createElement("div");i.classList.add(this.classNames.track),o.classList.add(this.classNames.scrollbar),i.appendChild(o),this.axis.x.track.el=i.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=i.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},t.setAccessibilityAttributes=function(){var n=this.options.ariaLabel||"scrollable content";this.contentWrapperEl.setAttribute("tabindex","0"),this.contentWrapperEl.setAttribute("role","region"),this.contentWrapperEl.setAttribute("aria-label",n)},t.initListeners=function(){var n=this,i=kn(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(c){n.el.addEventListener(c,n.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(c){n.el.addEventListener(c,n.onPointerEvent,{capture:!0,passive:!0})}),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),i.addEventListener("resize",this.onWindowResize);var o=!1,a=null,u=i.ResizeObserver||PJ;this.resizeObserver=new u(function(){!o||a!==null||(a=i.requestAnimationFrame(function(){n.recalculate(),a=null}))}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),i.requestAnimationFrame(function(){o=!0}),this.mutationObserver=new i.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},t.recalculate=function(){var n=kn(this.el);this.elStyles=n.getComputedStyle(this.el),this.isRtl=this.elStyles.direction==="rtl";var i=this.heightAutoObserverEl.offsetHeight<=1,o=this.heightAutoObserverEl.offsetWidth<=1,a=this.contentEl.offsetWidth,u=this.contentWrapperEl.offsetWidth,c=this.elStyles.overflowX,d=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var f=this.contentEl.scrollHeight,h=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=i?"auto":"100%",this.placeholderEl.style.width=o?a+"px":"auto",this.placeholderEl.style.height=f+"px";var p=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=h>a,this.axis.y.isOverflowing=f>p,this.axis.x.isOverflowing=c==="hidden"?!1:this.axis.x.isOverflowing,this.axis.y.isOverflowing=d==="hidden"?!1:this.axis.y.isOverflowing,this.axis.x.forceVisible=this.options.forceVisible==="x"||this.options.forceVisible===!0,this.axis.y.forceVisible=this.options.forceVisible==="y"||this.options.forceVisible===!0,this.hideNativeScrollbar();var v=this.axis.x.isOverflowing?this.scrollbarWidth:0,m=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&h>u-m,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&f>p-v,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},t.getScrollbarSize=function(n){if(n===void 0&&(n="y"),!this.axis[n].isOverflowing)return 0;var i=this.contentEl[this.axis[n].scrollSizeAttr],o=this.axis[n].track.el[this.axis[n].offsetSizeAttr],a,u=o/i;return a=Math.max(~~(u*o),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(a=Math.min(a,this.options.scrollbarMaxSize)),a},t.positionScrollbar=function(n){if(n===void 0&&(n="y"),!!this.axis[n].isOverflowing){var i=this.contentWrapperEl[this.axis[n].scrollSizeAttr],o=this.axis[n].track.el[this.axis[n].offsetSizeAttr],a=parseInt(this.elStyles[this.axis[n].sizeAttr],10),u=this.axis[n].scrollbar,c=this.contentWrapperEl[this.axis[n].scrollOffsetAttr];c=n==="x"&&this.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-c:c;var d=c/(i-a),f=~~((o-u.size)*d);f=n==="x"&&this.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?f+(o-u.size):f,u.el.style.transform=n==="x"?"translate3d("+f+"px, 0, 0)":"translate3d(0, "+f+"px, 0)"}},t.toggleTrackVisibility=function(n){n===void 0&&(n="y");var i=this.axis[n].track.el,o=this.axis[n].scrollbar.el;this.axis[n].isOverflowing||this.axis[n].forceVisible?(i.style.visibility="visible",this.contentWrapperEl.style[this.axis[n].overflowAttr]="scroll"):(i.style.visibility="hidden",this.contentWrapperEl.style[this.axis[n].overflowAttr]="hidden"),this.axis[n].isOverflowing?o.style.display="block":o.style.display="none"},t.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},t.onMouseMoveForAxis=function(n){n===void 0&&(n="y"),this.axis[n].track.rect=this.axis[n].track.el.getBoundingClientRect(),this.axis[n].scrollbar.rect=this.axis[n].scrollbar.el.getBoundingClientRect();var i=this.isWithinBounds(this.axis[n].scrollbar.rect);i?this.axis[n].scrollbar.el.classList.add(this.classNames.hover):this.axis[n].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[n].track.rect)?(this.showScrollbar(n),this.axis[n].track.el.classList.add(this.classNames.hover)):this.axis[n].track.el.classList.remove(this.classNames.hover)},t.onMouseLeaveForAxis=function(n){n===void 0&&(n="y"),this.axis[n].track.el.classList.remove(this.classNames.hover),this.axis[n].scrollbar.el.classList.remove(this.classNames.hover)},t.showScrollbar=function(n){n===void 0&&(n="y");var i=this.axis[n].scrollbar.el;this.axis[n].isVisible||(i.classList.add(this.classNames.visible),this.axis[n].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},t.onDragStart=function(n,i){i===void 0&&(i="y");var o=Hu(this.el),a=kn(this.el),u=this.axis[i].scrollbar,c=i==="y"?n.pageY:n.pageX;this.axis[i].dragOffset=c-u.rect[this.axis[i].offsetAttr],this.draggedAxis=i,this.el.classList.add(this.classNames.dragging),o.addEventListener("mousemove",this.drag,!0),o.addEventListener("mouseup",this.onEndDrag,!0),this.removePreventClickId===null?(o.addEventListener("click",this.preventClick,!0),o.addEventListener("dblclick",this.preventClick,!0)):(a.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},t.onTrackClick=function(n,i){var o=this;if(i===void 0&&(i="y"),!!this.options.clickOnTrack){var a=kn(this.el);this.axis[i].scrollbar.rect=this.axis[i].scrollbar.el.getBoundingClientRect();var u=this.axis[i].scrollbar,c=u.rect[this.axis[i].offsetAttr],d=parseInt(this.elStyles[this.axis[i].sizeAttr],10),f=this.contentWrapperEl[this.axis[i].scrollOffsetAttr],h=i==="y"?this.mouseY-c:this.mouseX-c,p=h<0?-1:1,v=p===-1?f-d:f+d,m=function y(){if(p===-1){if(f>v){var b;f-=o.options.clickOnTrackSpeed,o.contentWrapperEl.scrollTo((b={},b[o.axis[i].offsetAttr]=f,b)),a.requestAnimationFrame(y)}}else if(f<v){var x;f+=o.options.clickOnTrackSpeed,o.contentWrapperEl.scrollTo((x={},x[o.axis[i].offsetAttr]=f,x)),a.requestAnimationFrame(y)}};m()}},t.getContentElement=function(){return this.contentEl},t.getScrollElement=function(){return this.contentWrapperEl},t.getScrollbarWidth=function(){try{return getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display==="none"||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:jM(this.el)}catch{return jM(this.el)}},t.removeListeners=function(){var n=this,i=kn(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(o){n.el.removeEventListener(o,n.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(o){n.el.removeEventListener(o,n.onPointerEvent,{capture:!0,passive:!0})}),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),i.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},t.unMount=function(){this.removeListeners(),e.instances.delete(this.el)},t.isWithinBounds=function(n){return this.mouseX>=n.left&&this.mouseX<=n.left+n.width&&this.mouseY>=n.top&&this.mouseY<=n.top+n.height},t.findChild=function(n,i){var o=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;return Array.prototype.filter.call(n.children,function(a){return o.call(a,i)})[0]},e})();gc.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3};gc.instances=new WeakMap;function qM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Au(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qM(Object(r),!0).forEach(function(n){WJ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function WJ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mc(){return mc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mc.apply(this,arguments)}function GJ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function KJ(e,t){if(e==null)return{};var r=GJ(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var YJ=["children","scrollableNodeProps","tag"],XJ=function(t){var r=Array.prototype.reduce.call(t,function(n,i){var o=i.name.match(/data-simplebar-(.+)/);if(o){var a=o[1].replace(/\W+(.)/g,function(u,c){return c.toUpperCase()});switch(i.value){case"true":n[a]=!0;break;case"false":n[a]=!1;break;case void 0:n[a]=!0;break;default:n[a]=i.value}}return n},{});return r},fl=A.forwardRef(function(e,t){var r=e.children,n=e.scrollableNodeProps,i=n===void 0?{}:n,o=e.tag,a=o===void 0?"div":o,u=KJ(e,YJ),c=a,d,f=A.useRef(),h=A.useRef(),p=A.useRef(),v={},m={},y=[];return Object.keys(u).forEach(function(b){Object.prototype.hasOwnProperty.call(gc.defaultOptions,b)?v[b]=u[b]:b.match(/data-simplebar-(.+)/)&&b!=="data-simplebar-direction"?y.push({name:b,value:u[b]}):m[b]=u[b]}),y.length&&console.warn(`simplebar-react: this way of passing options is deprecated. Pass it like normal props instead:
70
70
  'data-simplebar-auto-hide="false"' —> 'autoHide="false"'
71
- `),A.useEffect(function(){return f=i.ref||f,h.current&&(d=new gc(h.current,Au(Au(Au(Au({},XJ(y)),v),f&&{scrollableNode:f.current}),p.current&&{contentNode:p.current})),typeof t=="function"?t(d):t&&(t.current=d)),function(){d.unMount(),d=null,typeof t=="function"&&t(null)}},[]),A.createElement(c,mc({ref:h,"data-simplebar":!0},m),A.createElement("div",{className:"simplebar-wrapper"},A.createElement("div",{className:"simplebar-height-auto-observer-wrapper"},A.createElement("div",{className:"simplebar-height-auto-observer"})),A.createElement("div",{className:"simplebar-mask"},A.createElement("div",{className:"simplebar-offset"},typeof r=="function"?r({scrollableNodeRef:f,contentNodeRef:p}):A.createElement("div",mc({},i,{className:"simplebar-content-wrapper".concat(i.className?" ".concat(i.className):"")}),A.createElement("div",{className:"simplebar-content"},r)))),A.createElement("div",{className:"simplebar-placeholder"})),A.createElement("div",{className:"simplebar-track simplebar-horizontal"},A.createElement("div",{className:"simplebar-scrollbar"})),A.createElement("div",{className:"simplebar-track simplebar-vertical"},A.createElement("div",{className:"simplebar-scrollbar"})))});fl.displayName="SimpleBar";fl.propTypes={children:le.oneOfType([le.node,le.func]),scrollableNodeProps:le.object,tag:le.string};const yc=Hx,bc=Ux,Hk=(e,t)=>{if(e===Z.EPermissionType.METHOD&&t)switch(t){case Z.ESubPermissionType.ENTITY_SEL_METHOD:return C.jsx(ye.FdFunctionSelection,{className:"h-6 w-6"});case Z.ESubPermissionType.ENTITY_METHOD:return C.jsx(ye.FdFunctionEntity,{className:"h-6 w-6"});case Z.ESubPermissionType.DS_METHOD:return C.jsx(ye.FdFunctionDatastore,{className:"h-6 w-6"});case Z.ESubPermissionType.DATACLASS_METHOD:return C.jsx(ye.FdFunctionDataclass,{className:"h-6 w-6"})}switch(e){case Z.EPermissionType.DATACLASS:return C.jsx(ye.FdTableHeader,{className:"h-6 w-6"});case Z.EPermissionType.SINGLETON:return C.jsx(ye.FdSingleton,{className:"h-6 w-6"});case Z.EPermissionType.DATASTORE:return C.jsx(ye.FdModel3,{className:"h-6 w-6"});case Z.EPermissionType.ATTRIBUTE:return C.jsx(ye.FdTableColumn,{className:"h-6 w-6"});case Z.EPermissionType.METHOD:return C.jsx(ye.FdCode,{className:"h-6 w-6"});case Z.EPermissionType.SINGLETON_METHOD:return C.jsx(ye.FdFunctionSingleton,{className:"h-6 w-6"});default:return C.jsx(ye.FdTableHeader,{className:"h-6 w-6"})}},kM=({children:e})=>C.jsx("div",{className:"h-full w-full",children:C.jsx("div",{className:"flex h-full w-full flex-1 items-center justify-center bg-grey-800",children:C.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4 py-4 text-grey-200",children:[C.jsx(ye.FdInfoBold,{className:"h-10 w-10"}),C.jsx("div",{className:"text-center text-sm",children:e})]})})});function ZJ(e){const{isIndeterminate:t,isChecked:r,...n}=e,i=t?"M22.5 12C22.5 17.799 17.799 22.5 12 22.5C6.20101 22.5 1.5 17.799 1.5 12C1.5 6.20101 6.20101 1.5 12 1.5C17.799 1.5 22.5 6.20101 22.5 12Z":"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z";return C.jsx(Ct.Icon,{viewBox:"0 0 24 24",...n,children:C.jsx("path",{fill:t?"transparent":"currentColor",d:i,stroke:t?"currentColor":void 0,strokeWidth:t?3:void 0})})}function JJ(e){return C.jsx(Ct.Checkbox,{colorScheme:"primary",icon:C.jsx(ZJ,{}),...e})}const Xi=({permissions:e,label:t,onToggle:r,onSelect:n,promoted:i,showIncluded:o,privileges:a,exists:u})=>{const c=e.find(d=>d.name===t);return c?C.jsxs("div",{className:"relative mx-auto flex w-fit items-center",children:[c.checked||c.from.length===0||t==="promote"?C.jsx(Ct.Checkbox,{isChecked:c.checked,onChange:()=>r&&r(c),colorScheme:"primary",isInvalid:u===!1}):C.jsx(JJ,{isIndeterminate:o&&c.from.length>0,onChange:()=>r&&r(c),isInvalid:u===!1}),C.jsxs("div",{className:"absolute left-5 top-0 flex cursor-pointer items-center space-x-1",children:[t!=="promote"&&(c.checked&&(c.info||c.from.length>0)||!c.checked&&c.from.length>0)&&C.jsx(C.Fragment,{children:C.jsxs(yc,{openDelay:0,closeDelay:0,children:[C.jsx(bc,{children:C.jsx(ye.FdInfoBold,{className:"h-4 w-4 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsxs("div",{className:"space-y-1 px-2",children:[c.from.length?C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdBulb,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),C.jsx("ul",{children:c.from.map(d=>C.jsx("li",{className:"cursor-pointer list-disc font-bold hover:underline",onClick:()=>n(a[d].id),children:a[d].privilege}))})]})]}):null,c.info&&C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdInfoCircle,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"})," ",c.info]})]})})})]})}),(c.checked||c.from.length>0)&&["execute"].includes(t)&&!!(i!=null&&i.length)&&C.jsxs(yc,{openDelay:0,closeDelay:0,children:[C.jsx(bc,{children:C.jsx(ye.FdCrown,{className:"h-3 w-3 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsx("div",{className:"space-y-1 px-2",children:C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdInfoCircle,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsxs("span",{className:"mr-1",children:["Function is promoted with:"," "]}),i==null?void 0:i.map(d=>C.jsx("li",{className:"cursor-pointer list-disc font-bold hover:underline",onClick:()=>n(a[d].id),children:a[d].privilege}))]})]})})})})]})]})]}):null},QJ=({privilegeId:e,privileges:t})=>{const r=Z.useAppSelector(Z.selectCatalogMethods),n=Z.useAppSelector(Z.selectDataclasses),i=Z.useAppSelector(Z.selectSingletons),o=t[e],a=Z.useAppDispatch(),[u,c]=A.useState([]),[d,f]=A.useState("");A.useEffect(()=>{f("")},[e]);const{isOpen:h,getMenuProps:p,getInputProps:v,getComboboxProps:m,highlightedIndex:y,getItemProps:b,selectedItem:x,openMenu:w}=to({onInputValueChange(){c([])},items:[],itemToString(_){return _?_.applyTo:""},defaultHighlightedIndex:0,stateReducer:(_,R)=>{const{changes:P,type:N}=R;switch(N){case to.stateChangeTypes.InputKeyDownArrowDown:return{...P,isOpen:!0,highlightedIndex:_.highlightedIndex<=u.length?_.highlightedIndex+1:0};case to.stateChangeTypes.InputKeyDownArrowUp:return{...P,isOpen:!0,highlightedIndex:_.highlightedIndex>=0?_.highlightedIndex-1:u.length};case to.stateChangeTypes.InputKeyDownEnter:const j=u[_.highlightedIndex];if(!j)return P;const L=Z.addPermission(e,j,t);return a(Z.updatePrivileges(L)),{...P,isOpen:!0,highlightedIndex:0}}return P}});A.useEffect(()=>{const _=o.resources.map(({resource:P,type:N,subType:j})=>({type:N,applyTo:P,subType:j})),R=Ax(d.toLowerCase(),r,Object.values(n),Object.values(i));c(R.filter(({applyTo:P,type:N,subType:j})=>!Jq.find(_,{applyTo:P,type:N,subType:j})))},[d,o.resources]);const S=p({},{suppressRefError:!0}),E=A.useRef(null);return A.useEffect(()=>{h&&E.current&&E.current.focus()},[h]),C.jsxs("div",{className:"relative w-56 text-white group",...m(),children:[C.jsx("div",{...m(),children:C.jsx("input",{...v(),ref:E,type:"text",className:"block h-6 w-full rounded bg-grey-300 px-1 py-1.5 pl-2 pr-5 text-xs border-grey-500 focus:outline-none focus:ring-1 focus:ring-white focus:rounded-b-none focus:ring-inset",placeholder:"Create a permission",value:d,onChange:({target:{value:_}})=>f(_),onFocus:()=>{w()}})}),C.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center px-1",children:C.jsx(ye.FdDown,{className:"h-4 w-4 cursor-pointer",onMouseDown:_=>{_.preventDefault()},onClick:()=>{w()}})}),h&&C.jsx("ul",{...S,tabIndex:0,className:"absolute max-h-80 inset-x-0 top-full overflow-auto rounded-md border border-grey-50 bg-grey-900 p-0 text-grey-50 shadow-md group-focus-within:rounded-t-none group-focus-within:border-t-0",children:u.map((_,R)=>C.jsxs("li",{className:Ke(x===_&&"font-bold","flex min-w-fit cursor-pointer items-center space-x-2 px-3 py-2 text-xs shadow-sm",{"bg-primary-hover":y===R,"font-bold":x===_}),...b({item:_,index:R}),onClick:()=>{const P=Z.addPermission(e,_,t);a(Z.updatePrivileges(P))},children:[Hk(_.type,_.subType),C.jsx("span",{children:_.applyTo})]},`${_.applyTo}-${R}`))})]})};function eQ(e){const t=["datastore","singleton","dataclass","attribute","dsMethod","dataclassMethod","entityMethod","entityselMethod","singletonMethod"],r=e.reduce((n,i)=>{const[o]=i.resource.split("."),a=n.find(u=>u.prefix===o.toLowerCase());return a?(a.resources.push(i),n):[...n,{prefix:o.toLowerCase(),type:i.type,resources:[i]}]},[]);return r.sort((n,i)=>n.prefix==="ds"?-1:i.prefix==="ds"||n.prefix>i.prefix?1:-1),r.map(n=>({...n,resources:n.resources.sort((i,o)=>{const a=t.indexOf(i.type),u=t.indexOf(o.type);return a!==u?a-u:i.resource.toLowerCase()>o.resource.toLowerCase()?1:-1})})).reduce((n,i)=>[...n,...i.resources],[])}const tQ=({selectedPrivilege:e,onSelect:t,showIncluded:r,privileges:n})=>{const[i,o]=A.useState(null),[a,u]=A.useState(null),{styles:c,attributes:d}=wc(i,a,{modifiers:[{name:"offset",options:{offset:[0,10]}}]}),[f,h]=A.useState([]),[p,v]=A.useState(""),m=Z.useAppDispatch();Z.useAppSelector(Z.selectCatalog);const{id:y}=e,b=A.useMemo(()=>Z.getInheritedResources(y,n),[y,n[y].includes,n[y].resources]),x=A.useMemo(()=>Z.getPromotions(y,n),[n[y]]);function w(k){h(D=>D.some(T=>k.includes(T))?D.filter(T=>!k.includes(T)):[...D,...k])}const S=async k=>{const{confirmed:D}=await m(Z.openModal({title:"Delete Privilege",type:nt.ModalType.CONFIRM,color:nt.ModalColor.DANGER,message:"Are you sure you want to remove this Privilege?",icon:"FdWarningDanger"})).unwrap();if(D){const T=Z.removePermission(e.id,k,n);m(Z.updatePrivileges(T))}},E=async()=>{const{confirmed:k}=await m(Z.openModal({title:"Reset Permissions",type:nt.ModalType.CONFIRM,color:nt.ModalColor.DANGER,message:"Are you sure you want to reset permissions for this Privilege?",icon:"FdWarningDanger"})).unwrap();if(k){const D=Z.resetResources(e.id,n);m(Z.updatePrivileges(D))}},R=b.filter(k=>f.length===0?!0:f.includes(k.type)).filter(({resource:k})=>p?new RegExp(Jq.escapeRegExp(p),"i").test(k):!0),P=eQ(R),N=P.filter(k=>{const D=k.permissions.every(T=>!T.checked)&&k.permissions.some(T=>T.from.length>0);return r||!D}),j=(k,D)=>{const T=Z.togglePermission(e.id,k,D,n);m(Z.updatePrivileges(T))},L=A.useMemo(()=>N.some(k=>k.exists===!1),[N]),F=async()=>{const{confirmed:k}=await m(Z.openModal({title:"Delete Privilege",type:nt.ModalType.CONFIRM,color:nt.ModalColor.DANGER,message:"Are you sure you want to remove these permissions?",views:{tips:[{type:"warning",message:"This action will remove all permissions that don't exist in the catalog for all privileges"}]},icon:"FdWarningDanger"})).unwrap(),D=Object.entries(n).map(([T,B])=>{const $=B.resources.filter(W=>!W.exists);return{[T]:$.map(W=>({applyTo:W.resource,type:W.type}))}}).reduce((T,B)=>({...T,...B}),{});if(k){const T=Z.removeMultiplePermissions(D,n);m(Z.updatePrivileges(T))}};return C.jsxs(fl,{className:"z-20 h-full flex-1 overflow-auto bg-grey-800 p-[15px] pt-0",style:{maxHeight:"calc(100vh - 5.5rem - 85px - 20px)"},children:[C.jsxs("table",{className:"relative h-full w-full",children:[C.jsx("thead",{className:"sticky top-0 z-20 bg-grey-800",children:C.jsxs("tr",{className:"border-b border-grey-100",children:[C.jsx("td",{className:"py-2",children:C.jsxs("div",{className:"flex items-center space-x-2",children:[C.jsxs("div",{className:"relative w-56 text-white",children:[C.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center px-1",children:C.jsx(ye.FdSearch,{className:"h-4 w-4 text-gray-400"})}),C.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center px-2",children:C.jsx(wr.Popover,{className:"flex items-center",children:({open:k})=>C.jsxs(C.Fragment,{children:[C.jsx(wr.Popover.Button,{ref:o,children:C.jsx(ye.FdAdjust,{className:"h-4 w-4"})}),k&&bo.createPortal(C.jsx(C.Fragment,{children:C.jsxs(wr.Popover.Panel,{ref:u,style:c.popper,...d.popper,className:"z-50 rounded-md border border-grey-50 bg-grey-900 px-4 py-2.5 text-xs text-grey-50",static:!0,children:[C.jsx("h5",{className:"mb-2 text-sm",children:"Filter"}),C.jsxs("div",{className:"space-y-2",children:[C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{isChecked:f.includes("datastore"),onChange:()=>{w(["datastore"])},colorScheme:"primary"}),C.jsx("span",{children:"Datastore"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{isChecked:f.includes("dataclass"),onChange:()=>{w(["dataclass"])},colorScheme:"primary"}),C.jsx("span",{children:"Dataclass"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{isChecked:f.includes("singleton"),onChange:()=>{w(["singleton"])},colorScheme:"primary"}),C.jsx("span",{children:"Singleton"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{isChecked:f.some(D=>["method","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"].includes(D)),onChange:()=>{w(["method","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"])},colorScheme:"primary"}),C.jsx("span",{children:"Functions"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{isChecked:f.includes("attribute"),onChange:()=>{w(["attribute"])},colorScheme:"primary"}),C.jsx("span",{children:"Attribute"})]})]})]})}),document.body)]})})}),C.jsx("input",{type:"text",className:"block h-6 w-full rounded bg-grey-300 px-1 py-1.5 pl-6 text-xs focus:outline-none",placeholder:"Search available permissions",value:p,onChange:k=>{v(k.target.value)}})]}),C.jsx(QJ,{privilegeId:y,privileges:n}),C.jsx("div",{children:C.jsxs(yc,{openDelay:0,closeDelay:0,children:[C.jsx(bc,{children:C.jsx("button",{className:"flex h-6 items-center space-x-1 rounded-md px-2 text-sm text-grey-50 hover:bg-primary-hover",onClick:E,children:C.jsx(ye.FdReload,{})})}),C.jsx(jr,{children:C.jsxs(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"mb-1 flex max-w-xs items-center gap-x-1 rounded bg-primary-light px-2 py-2 text-s font-semibold text-primary-darker",children:[C.jsx(ye.FdBulb,{className:"m-0.5 h-4 w-4 flex-shrink-0"}),C.jsx("p",{children:"Resetting the privilege will remove all configured ressources"})]})})]})}),C.jsxs(yc,{openDelay:0,closeDelay:0,children:[C.jsx(bc,{children:C.jsx("button",{className:Ke("flex h-6 items-center space-x-1 rounded-md px-2 text-sm text-grey-50 hover:bg-primary-hover disabled:opacity-50 disabled:hover:bg-primary-dark"),onClick:F,disabled:!L,children:C.jsx(ye.FdClean,{className:"h-4 w-4"})})}),C.jsx(jr,{children:C.jsxs(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"mb-1 flex max-w-xs items-center gap-x-1 rounded bg-primary-light px-2 py-2 text-s font-semibold text-primary-darker",children:[C.jsx(ye.FdBulb,{className:"m-0.5 h-4 w-4 flex-shrink-0"}),C.jsx("p",{children:"Delete all the non existing resources from privileges"})]})})]})]})}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Read"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Create"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Update"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Delete"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Execute"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Promote"})]})}),N.length?C.jsx("tbody",{children:N.map((k,D)=>{const T=k.permissions.some(B=>B.from.length>0);return C.jsxs("tr",{className:Ke("group even:bg-grey-600",{"opacity-60":k.exists===!1}),children:[C.jsxs("td",{className:Ke("group flex items-center gap-3 py-2 text-xs group-hover:rounded-l group-hover:bg-grey-300",k.exists===!1?"text-negative-400":"text-white",{"border-b-[0.5px] border-grey-300":!1}),children:[Hk(k.type,k.subType),k.resource,C.jsx(nt.Tooltip,{placement:"top",label:"Remove Permission",isDisabled:T,children:C.jsx("button",{onClick:()=>{T?nt.toastSubject.next({kind:"info",markdown:!0,message:`<div className="flex gap-x-3"><h3 className="font-bold">Info:</h3><p className="font-normal">Inherited permissions can't be removed</p></div>`,customIcon:ye.FdInfoBold}):S({applyTo:k.resource,type:k.type})},className:Ke("flex flex-shrink-0 items-center justify-center rounded p-1 opacity-0 group-hover:opacity-100",T?"hover:bg-grey-300 group-hover:opacity-70":"hover:bg-primary-hover"),children:C.jsx(ye.FdPlus,{className:"h-4 w-4 rotate-45 transform text-white"})})})]}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:C.jsx(Xi,{permissions:k.permissions,showIncluded:r,label:"read",onToggle:B=>j(k,B),onSelect:t,privileges:n,exists:k.exists})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:C.jsx(Xi,{permissions:k.permissions,showIncluded:r,label:"create",onToggle:B=>j(k,B),onSelect:t,privileges:n,exists:k.exists})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:C.jsx(Xi,{permissions:k.permissions,showIncluded:r,label:"update",onToggle:B=>j(k,B),onSelect:t,privileges:n,exists:k.exists})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:C.jsx(Xi,{permissions:k.permissions,showIncluded:r,label:"drop",onToggle:B=>j(k,B),onSelect:t,privileges:n,exists:k.exists})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:C.jsx(Xi,{promoted:x[k.resource],permissions:k.permissions,showIncluded:r,label:"execute",onToggle:B=>j(k,B),onSelect:t,privileges:n,exists:k.exists})}),C.jsx("td",{className:"py-2 text-center group-hover:rounded-r group-hover:bg-grey-300 ",children:C.jsx(Xi,{permissions:k.permissions,showIncluded:r,label:"promote",onToggle:B=>j(k,B),onSelect:t,privileges:n,exists:k.exists})})]},D)})}):null]}),!P.length&&p?C.jsx(kM,{children:"The Permission you're looking for can't be found "}):null,!P.length&&!p?C.jsxs(kM,{children:["This Privilege has no Permissions configured yet ",C.jsx("br",{}),'Add a new permission by using the "Create a permission" input above']}):null]})},rQ=({onCreate:e})=>{const t=Z.useAppSelector(Z.selectPrivileges),r=Z.useAppDispatch(),[n,i]=A.useState(null),[o,a]=A.useState(null),[u,c]=A.useState(""),[d,f]=A.useState(null),{styles:h,attributes:p}=wc(n,o,{modifiers:[{name:"offset",options:{offset:[-10,10]}}],placement:"right-start"});return A.useEffect(()=>{c(""),f(null)},[o]),C.jsx(wr.Popover,{children:({open:v,close:m})=>C.jsxs(C.Fragment,{children:[C.jsx(wr.Popover.Button,{className:"rounded p-1 hover:bg-primary-hover","data-cy":"New-priv-btn",ref:i,children:C.jsx("span",{children:C.jsx(ye.FdPlus,{className:"h-4 w-4 text-white"})})}),v&&bo.createPortal(C.jsx(C.Fragment,{children:C.jsxs(wr.Popover.Panel,{ref:a,style:h.popper,...p.popper,"data-cy":"New-priv-pop-up",className:"z-50 min-w-[256px] rounded border border-grey-50 bg-grey-900 px-4 py-2 text-xs text-grey-50 shadow-md",static:!0,children:[C.jsx("h5",{className:"mb-2 text-xs font-semibold",children:"Create New Privilege"}),C.jsxs("div",{className:"mt-2",children:[C.jsxs("label",{className:"flex items-center space-x-4",children:[C.jsx("span",{className:"text-grey-100",children:"Name"}),C.jsx("input",{autoFocus:!0,value:u,onChange:y=>c(y.target.value),onKeyDown:y=>{if(y.key==="Enter"){f(null);try{const b=Z.create(u,t),x=r(Z.updatePrivileges(b)),w=Object.values(x.payload).find(S=>S.privilege===u);w&&(e(w),m())}catch(b){f(b.message)}}},type:"text",className:Ke("w-full rounded border bg-grey-300 p-1 focus:outline-none",{"border-grey-100":!d,"border-red-400":d})})]}),d&&C.jsx("p",{className:"mt-1 text-xs text-red-400",children:d})]}),C.jsxs("div",{className:"mt-4 flex items-center justify-center space-x-2",children:[C.jsx("button",{className:"rounded border border-primary-dark bg-primary-dark px-4 py-1 hover:border-primary-hover hover:bg-primary-hover",onClick:()=>{f(null);try{const y=Z.create(u,t),b=r(Z.updatePrivileges(y)),x=Object.values(b.payload).find(w=>w.privilege===u);x&&e(x),m()}catch(y){f(y.message)}},children:"Create"}),C.jsx("button",{className:"rounded border border-grey-100 px-4 py-1 text-grey-100 hover:bg-white hover:text-primary-dark",onClick:()=>m(),children:"Cancel"})]})]})}),document.body)]})})},nQ=()=>{const e=Z.useAppSelector(Z.selectCatalog),t=Z.useAppSelector(Z.selectPrivileges),r=A.useMemo(()=>{if(e===null)return t;const c=T2(t,Object.values((e==null?void 0:e.dataClasses)??{}));return A2(c,e)},[t,e]),[n,i]=A.useState(null),o=A.useMemo(()=>Object.keys(r),[r]);A.useEffect(()=>{n&&r[n.id]||!o.length||i(r[o[0]])},[r]),A.useEffect(()=>{o.length<2&&u(!0)},[o.length]);const[a,u]=A.useState(!0);return C.jsxs("div",{className:"flex flex-1 h-full",children:[C.jsxs("div",{className:"flex h-full w-[356px] flex-col bg-grey-800",children:[C.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between bg-grey-800 px-3.5 py-[10px]",children:[C.jsxs("div",{className:"flex items-center space-x-1 text-[#DDE1E6]",children:[C.jsx("span",{children:C.jsx(ye.FdGroup,{className:"h-[14px] w-[14px]"})}),C.jsx("span",{className:"text-[11px] font-semibold",children:"Privileges"})]}),C.jsx(rQ,{onCreate:c=>{i(c)}})]}),C.jsx(xX,{privileges:r,selectedPrivilege:n,selectPrivilege:c=>{i(c)}})]}),n&&r[n.id]?C.jsxs("div",{className:"privileges-container relative flex flex-1 flex-col overflow-x-auto border-l-[0.5px] border-grey-900 bg-grey-800",children:[C.jsxs("div",{className:"mb-1 flex h-full w-full flex-col items-stretch",children:[n.privilege!=="guest"?C.jsx(m9,{privileges:r,selectedPrivilege:n,onSelect:c=>i(t[c]),setShowIncluded:u,showIncluded:a}):null,C.jsx(tQ,{privileges:r,selectedPrivilege:n,onSelect:c=>i(t[c]),showIncluded:a})]}),C.jsx(iQ,{privileges:r,selectedPrivilege:n,setSelectedPrivilege:i})]}):C.jsx(gD,{tab:"Privilege"})]})},iQ=({privileges:e,selectedPrivilege:t,setSelectedPrivilege:r})=>{const[n,i]=A.useState(!1);return C.jsx(nt.Panel,{path:nt.ROLES_TAB_PATH,isOpen:n,onOpen:()=>i(!0),onClose:()=>i(!1),children:C.jsx("div",{className:"h-full w-full px-3 pb-3",children:C.jsx("div",{className:"h-full w-full rounded bg-grey-900",children:C.jsx(p9,{dict:e,data:Z.getGraphData(t.id,e),onSelect:o=>r(e[o])})})})})};var yb={},oa={},Mu={},LM;function Uk(){if(LM)return Mu;LM=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.default=r;let e;const t=new Uint8Array(16);function r(){if(!e&&(e=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!e))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(t)}return Mu}var Zi={},aa={},sa={},BM;function oQ(){if(BM)return sa;BM=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.default=void 0;var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return sa.default=e,sa}var FM;function dl(){if(FM)return aa;FM=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.default=void 0;var e=t(oQ());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){return typeof i=="string"&&e.default.test(i)}var n=r;return aa.default=n,aa}var $M;function hl(){if($M)return Zi;$M=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.default=void 0,Zi.unsafeStringify=n;var e=t(dl());function t(a){return a&&a.__esModule?a:{default:a}}const r=[];for(let a=0;a<256;++a)r.push((a+256).toString(16).slice(1));function n(a,u=0){return r[a[u+0]]+r[a[u+1]]+r[a[u+2]]+r[a[u+3]]+"-"+r[a[u+4]]+r[a[u+5]]+"-"+r[a[u+6]]+r[a[u+7]]+"-"+r[a[u+8]]+r[a[u+9]]+"-"+r[a[u+10]]+r[a[u+11]]+r[a[u+12]]+r[a[u+13]]+r[a[u+14]]+r[a[u+15]]}function i(a,u=0){const c=n(a,u);if(!(0,e.default)(c))throw TypeError("Stringified UUID is invalid");return c}var o=i;return Zi.default=o,Zi}var zM;function aQ(){if(zM)return oa;zM=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.default=void 0;var e=r(Uk()),t=hl();function r(d){return d&&d.__esModule?d:{default:d}}let n,i,o=0,a=0;function u(d,f,h){let p=f&&h||0;const v=f||new Array(16);d=d||{};let m=d.node||n,y=d.clockseq!==void 0?d.clockseq:i;if(m==null||y==null){const _=d.random||(d.rng||e.default)();m==null&&(m=n=[_[0]|1,_[1],_[2],_[3],_[4],_[5]]),y==null&&(y=i=(_[6]<<8|_[7])&16383)}let b=d.msecs!==void 0?d.msecs:Date.now(),x=d.nsecs!==void 0?d.nsecs:a+1;const w=b-o+(x-a)/1e4;if(w<0&&d.clockseq===void 0&&(y=y+1&16383),(w<0||b>o)&&d.nsecs===void 0&&(x=0),x>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");o=b,a=x,i=y,b+=122192928e5;const S=((b&268435455)*1e4+x)%4294967296;v[p++]=S>>>24&255,v[p++]=S>>>16&255,v[p++]=S>>>8&255,v[p++]=S&255;const E=b/4294967296*1e4&268435455;v[p++]=E>>>8&255,v[p++]=E&255,v[p++]=E>>>24&15|16,v[p++]=E>>>16&255,v[p++]=y>>>8|128,v[p++]=y&255;for(let _=0;_<6;++_)v[p+_]=m[_];return f||(0,t.unsafeStringify)(v)}var c=u;return oa.default=c,oa}var ua={},Ln={},ca={},HM;function Vk(){if(HM)return ca;HM=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.default=void 0;var e=t(dl());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){if(!(0,e.default)(i))throw TypeError("Invalid UUID");let o;const a=new Uint8Array(16);return a[0]=(o=parseInt(i.slice(0,8),16))>>>24,a[1]=o>>>16&255,a[2]=o>>>8&255,a[3]=o&255,a[4]=(o=parseInt(i.slice(9,13),16))>>>8,a[5]=o&255,a[6]=(o=parseInt(i.slice(14,18),16))>>>8,a[7]=o&255,a[8]=(o=parseInt(i.slice(19,23),16))>>>8,a[9]=o&255,a[10]=(o=parseInt(i.slice(24,36),16))/1099511627776&255,a[11]=o/4294967296&255,a[12]=o>>>24&255,a[13]=o>>>16&255,a[14]=o>>>8&255,a[15]=o&255,a}var n=r;return ca.default=n,ca}var UM;function Wk(){if(UM)return Ln;UM=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.URL=Ln.DNS=void 0,Ln.default=a;var e=hl(),t=r(Vk());function r(u){return u&&u.__esModule?u:{default:u}}function n(u){u=unescape(encodeURIComponent(u));const c=[];for(let d=0;d<u.length;++d)c.push(u.charCodeAt(d));return c}const i="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Ln.DNS=i;const o="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Ln.URL=o;function a(u,c,d){function f(h,p,v,m){var y;if(typeof h=="string"&&(h=n(h)),typeof p=="string"&&(p=(0,t.default)(p)),((y=p)===null||y===void 0?void 0:y.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let b=new Uint8Array(16+h.length);if(b.set(p),b.set(h,p.length),b=d(b),b[6]=b[6]&15|c,b[8]=b[8]&63|128,v){m=m||0;for(let x=0;x<16;++x)v[m+x]=b[x];return v}return(0,e.unsafeStringify)(b)}try{f.name=u}catch{}return f.DNS=i,f.URL=o,f}return Ln}var la={},VM;function sQ(){if(VM)return la;VM=1,Object.defineProperty(la,"__esModule",{value:!0}),la.default=void 0;function e(v){if(typeof v=="string"){const m=unescape(encodeURIComponent(v));v=new Uint8Array(m.length);for(let y=0;y<m.length;++y)v[y]=m.charCodeAt(y)}return t(n(i(v),v.length*8))}function t(v){const m=[],y=v.length*32,b="0123456789abcdef";for(let x=0;x<y;x+=8){const w=v[x>>5]>>>x%32&255,S=parseInt(b.charAt(w>>>4&15)+b.charAt(w&15),16);m.push(S)}return m}function r(v){return(v+64>>>9<<4)+14+1}function n(v,m){v[m>>5]|=128<<m%32,v[r(m)-1]=m;let y=1732584193,b=-271733879,x=-1732584194,w=271733878;for(let S=0;S<v.length;S+=16){const E=y,_=b,R=x,P=w;y=c(y,b,x,w,v[S],7,-680876936),w=c(w,y,b,x,v[S+1],12,-389564586),x=c(x,w,y,b,v[S+2],17,606105819),b=c(b,x,w,y,v[S+3],22,-1044525330),y=c(y,b,x,w,v[S+4],7,-176418897),w=c(w,y,b,x,v[S+5],12,1200080426),x=c(x,w,y,b,v[S+6],17,-1473231341),b=c(b,x,w,y,v[S+7],22,-45705983),y=c(y,b,x,w,v[S+8],7,1770035416),w=c(w,y,b,x,v[S+9],12,-1958414417),x=c(x,w,y,b,v[S+10],17,-42063),b=c(b,x,w,y,v[S+11],22,-1990404162),y=c(y,b,x,w,v[S+12],7,1804603682),w=c(w,y,b,x,v[S+13],12,-40341101),x=c(x,w,y,b,v[S+14],17,-1502002290),b=c(b,x,w,y,v[S+15],22,1236535329),y=d(y,b,x,w,v[S+1],5,-165796510),w=d(w,y,b,x,v[S+6],9,-1069501632),x=d(x,w,y,b,v[S+11],14,643717713),b=d(b,x,w,y,v[S],20,-373897302),y=d(y,b,x,w,v[S+5],5,-701558691),w=d(w,y,b,x,v[S+10],9,38016083),x=d(x,w,y,b,v[S+15],14,-660478335),b=d(b,x,w,y,v[S+4],20,-405537848),y=d(y,b,x,w,v[S+9],5,568446438),w=d(w,y,b,x,v[S+14],9,-1019803690),x=d(x,w,y,b,v[S+3],14,-187363961),b=d(b,x,w,y,v[S+8],20,1163531501),y=d(y,b,x,w,v[S+13],5,-1444681467),w=d(w,y,b,x,v[S+2],9,-51403784),x=d(x,w,y,b,v[S+7],14,1735328473),b=d(b,x,w,y,v[S+12],20,-1926607734),y=f(y,b,x,w,v[S+5],4,-378558),w=f(w,y,b,x,v[S+8],11,-2022574463),x=f(x,w,y,b,v[S+11],16,1839030562),b=f(b,x,w,y,v[S+14],23,-35309556),y=f(y,b,x,w,v[S+1],4,-1530992060),w=f(w,y,b,x,v[S+4],11,1272893353),x=f(x,w,y,b,v[S+7],16,-155497632),b=f(b,x,w,y,v[S+10],23,-1094730640),y=f(y,b,x,w,v[S+13],4,681279174),w=f(w,y,b,x,v[S],11,-358537222),x=f(x,w,y,b,v[S+3],16,-722521979),b=f(b,x,w,y,v[S+6],23,76029189),y=f(y,b,x,w,v[S+9],4,-640364487),w=f(w,y,b,x,v[S+12],11,-421815835),x=f(x,w,y,b,v[S+15],16,530742520),b=f(b,x,w,y,v[S+2],23,-995338651),y=h(y,b,x,w,v[S],6,-198630844),w=h(w,y,b,x,v[S+7],10,1126891415),x=h(x,w,y,b,v[S+14],15,-1416354905),b=h(b,x,w,y,v[S+5],21,-57434055),y=h(y,b,x,w,v[S+12],6,1700485571),w=h(w,y,b,x,v[S+3],10,-1894986606),x=h(x,w,y,b,v[S+10],15,-1051523),b=h(b,x,w,y,v[S+1],21,-2054922799),y=h(y,b,x,w,v[S+8],6,1873313359),w=h(w,y,b,x,v[S+15],10,-30611744),x=h(x,w,y,b,v[S+6],15,-1560198380),b=h(b,x,w,y,v[S+13],21,1309151649),y=h(y,b,x,w,v[S+4],6,-145523070),w=h(w,y,b,x,v[S+11],10,-1120210379),x=h(x,w,y,b,v[S+2],15,718787259),b=h(b,x,w,y,v[S+9],21,-343485551),y=o(y,E),b=o(b,_),x=o(x,R),w=o(w,P)}return[y,b,x,w]}function i(v){if(v.length===0)return[];const m=v.length*8,y=new Uint32Array(r(m));for(let b=0;b<m;b+=8)y[b>>5]|=(v[b/8]&255)<<b%32;return y}function o(v,m){const y=(v&65535)+(m&65535);return(v>>16)+(m>>16)+(y>>16)<<16|y&65535}function a(v,m){return v<<m|v>>>32-m}function u(v,m,y,b,x,w){return o(a(o(o(m,v),o(b,w)),x),y)}function c(v,m,y,b,x,w,S){return u(m&y|~m&b,v,m,x,w,S)}function d(v,m,y,b,x,w,S){return u(m&b|y&~b,v,m,x,w,S)}function f(v,m,y,b,x,w,S){return u(m^y^b,v,m,x,w,S)}function h(v,m,y,b,x,w,S){return u(y^(m|~b),v,m,x,w,S)}var p=e;return la.default=p,la}var WM;function uQ(){if(WM)return ua;WM=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.default=void 0;var e=r(Wk()),t=r(sQ());function r(o){return o&&o.__esModule?o:{default:o}}var i=(0,e.default)("v3",48,t.default);return ua.default=i,ua}var fa={},da={},GM;function cQ(){if(GM)return da;GM=1,Object.defineProperty(da,"__esModule",{value:!0}),da.default=void 0;var t={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};return da.default=t,da}var KM;function lQ(){if(KM)return fa;KM=1,Object.defineProperty(fa,"__esModule",{value:!0}),fa.default=void 0;var e=n(cQ()),t=n(Uk()),r=hl();function n(a){return a&&a.__esModule?a:{default:a}}function i(a,u,c){if(e.default.randomUUID&&!u&&!a)return e.default.randomUUID();a=a||{};const d=a.random||(a.rng||t.default)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,u){c=c||0;for(let f=0;f<16;++f)u[c+f]=d[f];return u}return(0,r.unsafeStringify)(d)}var o=i;return fa.default=o,fa}var ha={},pa={},YM;function fQ(){if(YM)return pa;YM=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.default=void 0;function e(i,o,a,u){switch(i){case 0:return o&a^~o&u;case 1:return o^a^u;case 2:return o&a^o&u^a&u;case 3:return o^a^u}}function t(i,o){return i<<o|i>>>32-o}function r(i){const o=[1518500249,1859775393,2400959708,3395469782],a=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof i=="string"){const f=unescape(encodeURIComponent(i));i=[];for(let h=0;h<f.length;++h)i.push(f.charCodeAt(h))}else Array.isArray(i)||(i=Array.prototype.slice.call(i));i.push(128);const u=i.length/4+2,c=Math.ceil(u/16),d=new Array(c);for(let f=0;f<c;++f){const h=new Uint32Array(16);for(let p=0;p<16;++p)h[p]=i[f*64+p*4]<<24|i[f*64+p*4+1]<<16|i[f*64+p*4+2]<<8|i[f*64+p*4+3];d[f]=h}d[c-1][14]=(i.length-1)*8/Math.pow(2,32),d[c-1][14]=Math.floor(d[c-1][14]),d[c-1][15]=(i.length-1)*8&4294967295;for(let f=0;f<c;++f){const h=new Uint32Array(80);for(let x=0;x<16;++x)h[x]=d[f][x];for(let x=16;x<80;++x)h[x]=t(h[x-3]^h[x-8]^h[x-14]^h[x-16],1);let p=a[0],v=a[1],m=a[2],y=a[3],b=a[4];for(let x=0;x<80;++x){const w=Math.floor(x/20),S=t(p,5)+e(w,v,m,y)+b+o[w]+h[x]>>>0;b=y,y=m,m=t(v,30)>>>0,v=p,p=S}a[0]=a[0]+p>>>0,a[1]=a[1]+v>>>0,a[2]=a[2]+m>>>0,a[3]=a[3]+y>>>0,a[4]=a[4]+b>>>0}return[a[0]>>24&255,a[0]>>16&255,a[0]>>8&255,a[0]&255,a[1]>>24&255,a[1]>>16&255,a[1]>>8&255,a[1]&255,a[2]>>24&255,a[2]>>16&255,a[2]>>8&255,a[2]&255,a[3]>>24&255,a[3]>>16&255,a[3]>>8&255,a[3]&255,a[4]>>24&255,a[4]>>16&255,a[4]>>8&255,a[4]&255]}var n=r;return pa.default=n,pa}var XM;function dQ(){if(XM)return ha;XM=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.default=void 0;var e=r(Wk()),t=r(fQ());function r(o){return o&&o.__esModule?o:{default:o}}var i=(0,e.default)("v5",80,t.default);return ha.default=i,ha}var va={},ZM;function hQ(){if(ZM)return va;ZM=1,Object.defineProperty(va,"__esModule",{value:!0}),va.default=void 0;var e="00000000-0000-0000-0000-000000000000";return va.default=e,va}var ga={},JM;function pQ(){if(JM)return ga;JM=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.default=void 0;var e=t(dl());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){if(!(0,e.default)(i))throw TypeError("Invalid UUID");return parseInt(i.slice(14,15),16)}var n=r;return ga.default=n,ga}var QM;function vQ(){return QM||(QM=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return a.default}});var t=f(aQ()),r=f(uQ()),n=f(lQ()),i=f(dQ()),o=f(hQ()),a=f(pQ()),u=f(dl()),c=f(hl()),d=f(Vk());function f(h){return h&&h.__esModule?h:{default:h}}})(yb)),yb}var bb,eD;function gQ(){if(eD)return bb;eD=1;function e(t,r){if(!t||!r||!t.length||!r.length)throw new Error("Bad alphabet");this.srcAlphabet=t,this.dstAlphabet=r}return e.prototype.convert=function(t){var r,n,i,o={},a=this.srcAlphabet.length,u=this.dstAlphabet.length,c=t.length,d=typeof t=="string"?"":[];if(!this.isValid(t))throw new Error('Number "'+t+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return t;for(r=0;r<c;r++)o[r]=this.srcAlphabet.indexOf(t[r]);do{for(n=0,i=0,r=0;r<c;r++)n=n*a+o[r],n>=u?(o[i++]=parseInt(n/u,10),n=n%u):i>0&&(o[i++]=0);c=i,d=this.dstAlphabet.slice(n,n+1).concat(d)}while(i!==0);return d},e.prototype.isValid=function(t){for(var r=0;r<t.length;++r)if(this.srcAlphabet.indexOf(t[r])===-1)return!1;return!0},bb=e,bb}var xb,tD;function mQ(){if(tD)return xb;tD=1;var e=gQ();function t(r,n){var i=new e(r,n);return function(o){return i.convert(o)}}return t.BIN="01",t.OCT="01234567",t.DEC="0123456789",t.HEX="0123456789abcdef",xb=t,xb}var wb,rD;function yQ(){if(rD)return wb;rD=1;const{v4:e,validate:t}=vQ(),r=mQ(),n={cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",flickrBase58:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",uuid25Base36:"0123456789abcdefghijklmnopqrstuvwxyz"},i={consistentLength:!0};let o;const a=(d,f,h)=>{const p=f(d.toLowerCase().replace(/-/g,""));return!h||!h.consistentLength?p:p.padStart(h.shortIdLength,h.paddingChar)},u=(d,f)=>{const p=f(d).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[p[1],p[2],p[3],p[4],p[5]].join("-")},c=d=>Math.ceil(Math.log(2**128)/Math.log(d));return wb=(()=>{const d=(f,h)=>{const p=f||n.flickrBase58,v={...i,...h};if([...new Set(Array.from(p))].length!==p.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const m=c(p.length),y={shortIdLength:m,consistentLength:v.consistentLength,paddingChar:p[0]},b=r(r.HEX,p),x=r(p,r.HEX),w=()=>a(e(),b,y),E={alphabet:p,fromUUID:_=>a(_,b,y),maxLength:m,generate:w,new:w,toUUID:_=>u(_,x),uuid:e,validate:(_,R=!1)=>{if(!_||typeof _!="string")return!1;const P=v.consistentLength?_.length===m:_.length<=m,N=_.split("").every(j=>p.includes(j));return R===!1?P&&N:P&&N&&t(u(_,x))}};return Object.freeze(E),E};return d.constants=n,d.uuid=e,d.generate=()=>(o||(o=d(n.flickrBase58).generate),o()),d})(),wb}var bQ=yQ();const xQ=({role:e})=>{var R;const[t,r]=A.useState(e),[n,i]=A.useState(e.role),[o,a]=A.useState(null),u=Z.useAppSelector(Z.selectPrivileges),c=((R=t.privileges)==null?void 0:R.filter(P=>u[P]&&u[P].privilege!=="guest").length)||0,d=Z.useAppSelector(Z.selectRoles),f=Z.useAppDispatch(),{selectedRole:h,selectRole:p}=Yb(),[v,m]=A.useState(!1),y=nt.useOutsideClick(()=>{v&&x()});A.useEffect(()=>{e.role||m(!0)},[]),A.useEffect(()=>{r(e)},[e]);const b=()=>{a(""),m(!0)},x=()=>{a(null),e.role&&e.role===n&&m(!1);try{const P=Z.saveRole({...t,role:n},d);f(Z.updateRoles(P)),m(!1)}catch(P){a(P.message)}},w=Z.useAppDispatch(),S=async P=>{P.stopPropagation();const{confirmed:N}=await w(Z.openModal({title:"Delete Role",type:nt.ModalType.CONFIRM,color:nt.ModalColor.DANGER,message:"Are you sure you want to remove this Role?",icon:"FdWarningDanger"})).unwrap();N&&E()},E=()=>{const P=Z.removeRole(t.id,d),N=Object.keys(P),j=N.length>=1,L=N[N.length-1];p(L&&j?L:null),f(Z.updateRoles(P))},_=(P=null)=>{if(P&&P.stopPropagation(),!e.role){E();return}m(!1),i(e.role)};return C.jsx(C.Fragment,{children:C.jsxs("div",{className:Ke("rounded border bg-grey-300 p-2",{"border-grey-100":h!==t.id,"border-primary-dark":h===t.id}),role:"button","data-cy":"privilegeCard",onClick:()=>{p(t.id)},ref:y,children:[C.jsx("div",{className:"flex items-center justify-between",children:C.jsxs("div",{className:"flex flex-1 items-center text-white",children:[C.jsx("span",{className:"mr-4",children:C.jsx(ye.FdGroup,{className:"h-6 w-6"})}),v?C.jsxs("div",{className:"relative h-6 flex-1",children:[C.jsx("input",{type:"text",value:n,onChange:({target:{value:P}})=>{i(P)},onKeyDown:P=>{P.key==="Enter"&&x(),P.key==="Escape"&&_()},className:Ke("absolute inset-0 mr-2 h-6 min-w-0 rounded border border-grey-200 bg-grey-300 p-1 text-xs focus:border-primary-dark focus:outline-none",{"border-b border-red-400":o}),placeholder:"role",autoComplete:"off",autoFocus:!0}),o&&C.jsx("p",{className:"absolute top-5 mt-1 rounded bg-red-400 p-1 text-xs text-white shadow-md",children:o})]}):C.jsx("span",{className:"inline-block grow overflow-hidden truncate whitespace-nowrap text-xs font-bold",title:n,children:t.role}),C.jsx("div",{className:Ke("justify-betwee ml-auto flex w-fit items-center gap-x-2"),children:v?C.jsxs(C.Fragment,{children:[C.jsx("button",{onClick:x,className:"rounded p-1 hover:bg-primary-hover hover:text-white",children:C.jsx(ye.FdSave,{className:"h-4 w-4 text-grey-50"})}),C.jsx("button",{onClick:_,className:"rounded p-1 hover:bg-primary-hover hover:text-white",children:C.jsx(ye.FdClose,{className:"h-4 w-4 text-grey-50"})})]}):C.jsxs(C.Fragment,{children:[C.jsx("button",{onClick:b,className:"rounded p-1 hover:bg-primary-hover hover:text-white",children:C.jsx(ye.FdPen,{className:"h-4 w-4 text-grey-50"})}),C.jsx("button",{onClick:P=>S(P),className:"rounded p-1 hover:bg-primary-hover hover:text-white",children:C.jsx(ye.FdTrash,{className:"h-4 w-4 text-grey-50"})})]})})]})}),C.jsxs("span",{className:Ke("ml-[43px] py-1 text-xs text-white"),children:[c," Privilege",c>1?"s":""]})]})})},Gk=(e,t)=>e?t[e]:null,nD=(e,t,r)=>{const n=Gk(e,r);return n?Object.values(r).reduce((i,o)=>o.id===e?n.privileges.includes(t)?{...i,[n.id]:{...n,privileges:n.privileges.filter(a=>a!==t)}}:{...i,[n.id]:{...n,privileges:[...n.privileges,t]}}:{...i,[o.id]:o},{}):r},wQ=()=>{const e=Z.useAppSelector(Z.selectPrivileges),t=Z.useAppSelector(Z.selectRoles),r=Z.useAppDispatch(),{selectedRole:n}=Yb(),i=Gk(n,t),o=(a,u)=>u&&u.privileges.includes(a.id);return C.jsxs("div",{className:"w-full border-b border-grey-900 p-4 ",children:[C.jsx("div",{className:"mb-4 flex items-center gap-x-5 text-white",children:C.jsx("h4",{className:"text-[13px] font-semibold ",children:"Privileges"})}),C.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[C.jsx("div",{"data-cy":"item=>Permisions",className:Ke("inline-flex items-center gap-1 space-x-1 rounded bg-primary-darker px-2 py-0.5 text-xs font-semibold italic text-white"),children:"guest"}),Object.values(e).filter(a=>o(a,i)&&a.privilege!=="guest").map((a,u)=>C.jsxs("div",{"data-cy":"item=>Permisions",className:Ke("inline-flex cursor-pointer items-center gap-1 space-x-1 rounded px-2 py-0.5",{"bg-primary-dark text-white":o(a,i),"bg-grey-300 text-grey-100":!o(a,i)}),onClick:()=>{const c=nD(i.id,a.id,t);r(Z.updateRoles(c))},children:[C.jsx("span",{className:"text-xs",children:a.privilege}),C.jsx("button",{className:"focus:outline-none",children:o(a,i)?C.jsx(ye.FdMinus,{className:"h-[14px] w-[14px]"}):C.jsx(ye.FdPlus,{className:"h-[14px] w-[14px]"})})]},u)),Object.values(e).filter(a=>!o(a,i)&&a.privilege!=="guest").map((a,u)=>C.jsxs("div",{"data-cy":"item=>Permisions",className:Ke("inline-flex cursor-pointer items-center gap-1 space-x-1 rounded px-2 py-0.5",{"bg-primary-dark text-white":o(a,i),"bg-grey-300 text-grey-100":!o(a,i)}),onClick:()=>{const c=nD(i.id,a.id,t);r(Z.updateRoles(c))},children:[C.jsx("span",{className:"text-xs",children:a.privilege}),C.jsx("button",{className:"text-white focus:outline-none",children:o(a,i)?C.jsx(ye.FdMinus,{className:"h-[14px] w-[14px]"}):C.jsx(ye.FdPlus,{className:"h-[14px] w-[14px]"})})]},u))]})]})},_Q=({children:e})=>C.jsx("div",{className:"h-full w-full",children:C.jsx("div",{className:"flex h-full w-full flex-1 items-center justify-center bg-grey-800",children:C.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4 py-4 text-grey-200",children:[C.jsx(ye.FdInfoBold,{className:"absolute -right-full h-10 w-10 translate-x-1"}),C.jsx("div",{className:"text-center text-sm",children:e})]})})}),Gb=(e,t,r,n=!1)=>{const i=e.applyTo,o=e.type===Z.EPermissionType.DATACLASS?"ds":i.split(".")[0],a={...t,...r},u=()=>({value:!n,inherited:!1,from:[],explicitly:!1}),c={read:u(),create:u(),update:u(),drop:u(),execute:u(),promote:u()},d=h=>{h.forEach(p=>{a[p]&&(a[p].resources.forEach(v=>{if(v.resource===i||v.resource===o){const m=Gb(e,t,{[p]:a[p]},n);Object.values(v.permissions).forEach(y=>{c[y.name].explicitly||(!c[y.name].from.includes(a[p].privilege)&&y.checked&&c[y.name].from.push(a[p].privilege),c[y.name].inherited=c[y.name].inherited||m[y.name].value||m[y.name].inherited)})}}),a[p].includes.length>0&&d(a[p].includes))})};if(Object.values(r).forEach(h=>{h.resources.forEach(p=>{p.resource===i&&Object.values(p.permissions).forEach(v=>{v.checked&&(c[v.name].explicitly=!0,n&&(c[v.name].value=!0))})}),(h.includes.length>0||h.privilege==="guest")&&d(h.includes)}),Object.values(t).forEach(h=>{h.resources.forEach(p=>{p.resource===i&&(h.privilege==="guest"?Object.values(p.permissions).forEach(v=>{v.checked&&(c[v.name].explicitly=!0,n&&(c[v.name].value=!0))}):Object.values(p.permissions).forEach(v=>{!c[v.name].explicitly&&v.checked&&(n?c[v.name].value=!0:c[v.name].value=!1)}))})}),(n?Object.entries(c).some(([h,p])=>h!=="promote"&&!p.value&&!p.explicitly):Object.entries(c).some(([h,p])=>h!=="promote"&&p.value&&!p.explicitly))&&![Z.EPermissionType.DATASTORE,Z.EPermissionType.SINGLETON].includes(e.type)){const h={applyTo:o,type:e.type===Z.EPermissionType.DATACLASS?Z.EPermissionType.DATASTORE:e.type===Z.EPermissionType.SINGLETON_METHOD?Z.EPermissionType.SINGLETON:Z.EPermissionType.DATACLASS},p=Gb(h,t,r,n),v=m=>{let y=c[m].value;return n?!c[m].value&&!c[m].explicitly&&(y=p[m].value):c[m].value&&!c[m].explicitly&&(y=p[m].value),{value:y,inherited:c[m].inherited||p[m].inherited,from:c[m].from.length>0?c[m].from:p[m].from,explicitly:c[m].explicitly}};return{read:v("read"),create:v("create"),update:v("update"),drop:v("drop"),execute:v("execute"),promote:v("promote")}}return{read:c.read,create:c.create,update:c.update,drop:c.drop,execute:c.execute,promote:c.promote}},EQ=e=>{switch(e){case"dataclass":return C.jsx(ye.FdTableHeader,{className:"h-6 w-6"});case"singleton":return C.jsx(ye.FdSingleton,{className:"h-6 w-6"});case"datastore":return C.jsx(ye.FdModel3,{className:"h-6 w-6"});case"attribute":return C.jsx(ye.FdTableColumn,{className:"h-6 w-6"});case"method":return C.jsx(ye.FdCode,{className:"h-6 w-6"});case"singletonMethod":return C.jsx(ye.FdFunctionSingleton,{className:"h-6 w-6"});case"entityselMethod":return C.jsx(ye.FdFunctionSelection,{className:"h-6 w-6"});case"entityMethod":return C.jsx(ye.FdFunctionEntity,{className:"h-6 w-6"});case"dsMethod":return C.jsx(ye.FdFunctionDatastore,{className:"h-6 w-6"});case"dataclassMethod":return C.jsx(ye.FdFunctionDataclass,{className:"h-6 w-6"});default:return C.jsx(ye.FdTableHeader,{className:"h-6 w-6"})}},ma=Hx,ya=Ux,co=({privileges:e,permission:t,hasChild:r,depth:n,isChild:i=!1,className:o,inSearch:a,toggleCollapse:u,collapsed:c,isRestrictedByDefault:d,toastMessageCallback:f})=>{const[h,p]=t.applyTo.split("."),v=A.useMemo(()=>Gb(t,e.otherPrivs,e.rolePrivs,d),[e,t,d]);return C.jsxs("tr",{className:Ke("group even:bg-grey-600",o),children:[C.jsxs("td",{className:Ke("flex h-full w-full items-center gap-3 p-0 text-xs group-hover:rounded-l group-hover:bg-grey-300",{"px-1":a}),children:[Array(n).fill("").map((m,y)=>C.jsx("div",{className:Ke("ml-1.5 mr-1 h-full w-0.5 border-l-2 border-grey-100",{"mr-0.5":i})},y)),r&&C.jsx("button",{onClick:u,className:"w-3",children:c?C.jsx(ye.FdRight,{className:"inline h-4 w-4"}):C.jsx(ye.FdDown,{className:"inline h-4 w-4"})}),EQ(t.type),a?t.applyTo:p||h]}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:[Z.EPermissionType.ATTRIBUTE,Z.EPermissionType.DATASTORE,Z.EPermissionType.DATACLASS].includes(t.type)&&C.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",children:[C.jsx("div",{className:Ke("h-4 w-4 rounded border-[2px] p-2",{"grid place-content-center border-grey-200 bg-grey-200":v.read.value||v.read.inherited}),onClick:f,children:(v.read.value||v.read.inherited)&&C.jsx(ye.FdCheckNaked,{className:"text-grey-50"})}),C.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!v.read.value&&v.read.inherited?C.jsxs(ma,{openDelay:0,closeDelay:0,children:[C.jsx(ya,{children:C.jsx(ye.FdInfoBold,{className:"h-4 w-4 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsx("div",{className:"space-y-1 px-2",children:v.read.from.length?C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdBulb,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),C.jsx("ul",{children:v.read.from.map((m,y)=>C.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},y))})]})]}):null})})})]}):""})]})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:[Z.EPermissionType.ATTRIBUTE,Z.EPermissionType.DATASTORE,Z.EPermissionType.DATACLASS].includes(t.type)&&C.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",children:[C.jsx("div",{className:Ke("h-4 w-4 rounded border-[2px] p-2",{"grid place-content-center border-grey-200 bg-grey-200":v.create.value||v.create.inherited}),onClick:f,children:(v.create.value||v.create.inherited)&&C.jsx(ye.FdCheckNaked,{className:"text-grey-50"})}),C.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!v.create.value&&v.create.inherited?C.jsxs(ma,{openDelay:0,closeDelay:0,children:[C.jsx(ya,{children:C.jsx(ye.FdInfoBold,{className:"h-4 w-4 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsx("div",{className:"space-y-1 px-2",children:v.create.from.length?C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdBulb,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),C.jsx("ul",{children:v.create.from.map((m,y)=>C.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},y))})]})]}):null})})})]}):""})]})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:[Z.EPermissionType.ATTRIBUTE,Z.EPermissionType.DATASTORE,Z.EPermissionType.DATACLASS].includes(t.type)&&C.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",children:[C.jsx("div",{className:Ke("h-4 w-4 rounded border-[2px] p-2",{"grid place-content-center border-grey-200 bg-grey-200":v.update.value||v.update.inherited}),onClick:f,children:(v.update.value||v.update.inherited)&&C.jsx(ye.FdCheckNaked,{className:"text-grey-50"})}),C.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!v.update.value&&v.update.inherited?C.jsxs(ma,{openDelay:0,closeDelay:0,children:[C.jsx(ya,{children:C.jsx(ye.FdInfoBold,{className:"h-4 w-4 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsx("div",{className:"space-y-1 px-2",children:v.update.from.length?C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdBulb,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),C.jsx("ul",{children:v.update.from.map((m,y)=>C.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},y))})]})]}):null})})})]}):""})]})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:[Z.EPermissionType.ATTRIBUTE,Z.EPermissionType.DATASTORE,Z.EPermissionType.DATACLASS].includes(t.type)&&C.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",children:[C.jsx("div",{className:Ke("h-4 w-4 rounded border-[2px] p-2",{"grid place-content-center border-grey-200 bg-grey-200":v.drop.value||v.drop.inherited}),onClick:f,children:(v.drop.value||v.drop.inherited)&&C.jsx(ye.FdCheckNaked,{className:"text-grey-50"})}),C.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!v.drop.value&&v.drop.inherited?C.jsxs(ma,{openDelay:0,closeDelay:0,children:[C.jsx(ya,{children:C.jsx(ye.FdInfoBold,{className:"h-4 w-4 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsx("div",{className:"space-y-1 px-2",children:v.drop.from.length?C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdBulb,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),C.jsx("ul",{children:v.drop.from.map((m,y)=>C.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},y))})]})]}):null})})})]}):""})]})}),C.jsx("td",{className:"py-2 text-center group-hover:rounded-r group-hover:bg-grey-300",children:t.type!=="attribute"&&C.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",children:[C.jsx("div",{className:Ke("h-4 w-4 rounded border-[2px] p-2",{"grid place-content-center border-grey-200 bg-grey-200":v.execute.value||v.execute.inherited}),onClick:f,children:(v.execute.value||v.execute.inherited)&&C.jsx(ye.FdCheckNaked,{className:"text-grey-50"})}),C.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!v.execute.value&&v.execute.inherited?C.jsxs(ma,{openDelay:0,closeDelay:0,children:[C.jsx(ya,{children:C.jsx(ye.FdInfoBold,{className:"h-4 w-4 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsx("div",{className:"space-y-1 px-2",children:v.execute.from.length?C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdBulb,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),C.jsx("ul",{children:v.execute.from.map((m,y)=>C.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},y))})]})]}):null})})})]}):""})]})})]})},iD=({depth:e,permission:t,privileges:r,childCollapsed:n,didChildCollapsed:i,toastMessageCallback:o})=>{const[a,u]=A.useState(n),c=Z.useAppSelector(Z.selectRestrictedByDefault),d=Z.useAppSelector(Z.selectPrivileges);return A.useEffect(()=>{n===!0&&u(!0)},[n]),C.jsxs(C.Fragment,{children:[C.jsx(co,{privileges:r,permission:t,isChild:!0,depth:e,hasChild:!0,toggleCollapse:()=>{const f=!a;u(f),i==null||i(f)},isRestrictedByDefault:c,allPrivileges:d,collapsed:a,toastMessageCallback:o}),!a&&C.jsxs(C.Fragment,{children:[t.attributes.map((f,h)=>C.jsx(co,{privileges:r,permission:f,depth:e+1,isRestrictedByDefault:c,allPrivileges:d,toastMessageCallback:o},`${f.type}-${h}`)),t.methods.map((f,h)=>C.jsx(co,{privileges:r,permission:f,depth:e+1,isRestrictedByDefault:c,allPrivileges:d,toastMessageCallback:o},`${f.type}-${h}`))]})]})},SQ=({selectedRole:e})=>{const[t,r]=A.useState(null),[n,i]=A.useState(null),{styles:o,attributes:a}=wc(t,n,{modifiers:[{name:"offset",options:{offset:[0,10]}}]}),u=Z.useAppSelector(Z.selectRestrictedByDefault),c=Z.useAppSelector(Z.selectPrivileges),[d,f]=A.useState([]),[h,p]=A.useState(""),v=Z.useAppSelector(Z.selectCatalogMethods),m=Z.useAppSelector(Z.selectDataclasses),y=Z.useAppSelector(Z.selectSingletons),[b,x]=A.useState({}),[w,S]=A.useState([]);A.useEffect(()=>{const B=g9(v,Object.values(m),Object.values(y));x(B)},[e]);function E(B){const $=["datastore","singleton","dataclass","attribute","dsMethod","dataclassMethod","entityMethod","entityselMethod","singletonMethod"];return B.sort((W,Y)=>{const ee=$.indexOf(W.type),H=$.indexOf(Y.type);return ee!==H?ee-H:W.applyTo.toLowerCase()>Y.applyTo.toLowerCase()?1:-1})}A.useEffect(()=>{S(E(Ax(h,v,Object.values(m),Object.values(y)).filter(B=>d.length?d.includes(B.type):!0)))},[d,h]);const[_,R]=A.useState(!1),P=B=>{f($=>$.some(W=>B.includes(W))?$.filter(W=>!B.includes(W)):[...$,...B])},N=Z.useAppSelector(Z.selectRoles),j={toggleAllCollapsed:B=>{B.allCollapsed=!B.allCollapsed},toggleChildCollapsed:B=>{B.childCollapsed=!B.childCollapsed},setAllCollapsed:(B,$)=>{B.allCollapsed=$},setChildCollapsed:(B,$)=>{B.childCollapsed=$}},L=A.useMemo(()=>{const B=Object.values(c).find(H=>H.privilege==="guest"),$=N[e],W=$?Object.fromEntries($.privileges.map(H=>[H,c[H]]).filter(([,H])=>!!H)):{};if(u)return{rolePrivs:W,otherPrivs:B?{[B.id]:B}:{}};const Y=B?{[B.id]:{...B,active:!0}}:{},ee=Object.fromEntries(Object.entries(c).filter(([H])=>H!==(B==null?void 0:B.id)&&!($!=null&&$.privileges.includes(H))).map(([H,Q])=>[H,{...Q,active:!1}]));return{rolePrivs:W,otherPrivs:{...Y,...ee}}},[c,N,e,u]),{state:{allCollapsed:F,childCollapsed:k},dispatch:D}=nt.useEnhancedState({allCollapsed:!1,childCollapsed:!1},j,"Table Collapse Store"),T=()=>{nt.toastSubject.next({kind:"info",markdown:!0,message:'<div className="flex gap-x-1 items-center"><h3 className="font-bold mr-1">Info:</h3><p className="font-normal">You can add or modify permissions only in the Privilege section.</p></div>',customIcon:ye.FdInfoCircle})};return C.jsxs(fl,{className:"z-20 h-full flex-1 overflow-auto bg-grey-800 p-[15px] pt-0",style:{maxHeight:"calc(100vh - 5.5rem - 85px - 20px)"},children:[C.jsxs("table",{className:"relative h-full w-full",children:[C.jsx("thead",{className:"sticky top-0 z-20 bg-grey-800",children:C.jsxs("tr",{className:"border-b border-grey-100",children:[C.jsx("td",{className:"py-2",children:C.jsxs("div",{className:"flex items-center space-x-2",children:[C.jsx(nt.FloatingTooltip,{message:"Collapse All",side:"top",children:C.jsx("button",{onClick:()=>{k?(D.setAllCollapsed(!0),R(!0)):D.setChildCollapsed(!0)},className:Ke("cursor-pointer rounded-md p-1 hover:bg-primary-hover focus:outline-none",{"pointer-events-none text-grey-200":F,"text-white":!F}),children:C.jsx(ye.FdCollapseAll,{className:"h-4 w-4"})})}),C.jsxs("div",{className:"relative w-56 text-white",children:[C.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center px-1",children:C.jsx(ye.FdSearch,{className:"h-4 w-4 text-gray-400"})}),C.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center px-2",children:C.jsx(wr.Popover,{className:"flex items-center",children:({open:B})=>C.jsxs(C.Fragment,{children:[C.jsx(wr.Popover.Button,{ref:r,children:C.jsx(ye.FdAdjust,{className:"h-4 w-4"})}),B&&bo.createPortal(C.jsx(C.Fragment,{children:C.jsxs(wr.Popover.Panel,{ref:i,style:o.popper,...a.popper,className:"z-50 rounded-md border border-grey-50 bg-grey-900 px-4 py-2.5 text-xs text-grey-50",static:!0,children:[C.jsx("h5",{className:"mb-2 text-sm",children:"Filter"}),C.jsxs("div",{className:"space-y-2",children:[C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{colorScheme:"primary",isChecked:d.includes("datastore"),onChange:()=>{P(["datastore"])}}),C.jsx("span",{children:"Datastore"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{colorScheme:"primary",isChecked:d.includes("dataclass"),onChange:()=>{P(["dataclass"])}}),C.jsx("span",{children:"Dataclass"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{colorScheme:"primary",isChecked:d.includes("singleton"),onChange:()=>{P(["singleton"])}}),C.jsx("span",{children:"Singleton"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{isChecked:d.some($=>["method","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"].includes($)),onChange:()=>{P(["method","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"])},colorScheme:"primary"}),C.jsx("span",{children:"Functions"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{colorScheme:"primary",isChecked:d.includes("attribute"),onChange:()=>{P(["attribute"])}}),C.jsx("span",{children:"Attribute"})]})]})]})}),document.body)]})})}),C.jsx("input",{type:"text",className:"block h-6 w-full rounded bg-grey-300 px-1 py-1.5 pl-6 text-xs focus:outline-none",placeholder:"Search",value:h,onChange:B=>{p(B.target.value)}})]})]})}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"read"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Create"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Update"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Delete"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Execute"})]})}),C.jsx("tbody",{className:"relative bg-grey-800 text-white",children:d.length||h?w.map((B,$)=>C.jsx(co,{privileges:L,permission:B,depth:0,inSearch:!0,isRestrictedByDefault:u,allPrivileges:c,toastMessageCallback:T},`${B.type}-${$}`)):Object.values(b).map((B,$)=>C.jsxs(A.Fragment,{children:[C.jsx(co,{privileges:L,permission:B,isRestrictedByDefault:u,allPrivileges:c,hasChild:!0,depth:0,toggleCollapse:()=>{const W=!_;R(W),D.setAllCollapsed(!W&&F?!1:F)},collapsed:_,toastMessageCallback:T}),B.type==="datastore"&&!_?C.jsxs(C.Fragment,{children:[B.methods.map((W,Y)=>C.jsx(co,{privileges:L,isRestrictedByDefault:u,allPrivileges:c,permission:W,depth:1,collapsed:F||!1,toastMessageCallback:T},`${W.type}-${Y}`)),B.dataClasses.map((W,Y)=>C.jsx(iD,{depth:1,privileges:L,permission:W,childCollapsed:k,didChildCollapsed:ee=>{D.setChildCollapsed(ee?k:!1)},toastMessageCallback:T},`${W.type}-${Y}`))]}):null,B.singletons.map((W,Y)=>C.jsx(iD,{depth:0,privileges:L,permission:W,childCollapsed:F,didChildCollapsed:ee=>{D.setAllCollapsed(ee?F:!1)},toastMessageCallback:T},`${W.type}-${Y}`))]},`${B.type}-${$}`))})]}),(h||d.length)&&!w.length?C.jsx(_Q,{children:"The Permission you're looking for can't be found "}):null]})},OQ=()=>{const e=Z.useAppSelector(Z.selectRoles),t=Z.useAppDispatch(),[r,n]=A.useState(null),[i,o]=A.useState(null),[a,u]=A.useState(""),[c,d]=A.useState(null),{styles:f,attributes:h}=wc(r,i,{modifiers:[{name:"offset",options:{offset:[-10,10]}}],placement:"right-start"});A.useEffect(()=>{u(""),d(null)},[i]);const p=()=>{if(!a)throw new Error("Please enter a valid name");if(Object.values(e).find(b=>b.role===a))throw new Error(`A role with the name ${a} already exists`);const m=bQ.generate(),y=Z.createRole(m,a,e);t(Z.updateRoles(y))};return C.jsx(wr.Popover,{children:({open:v,close:m})=>{const y=()=>{d(null);try{p(),m()}catch(b){d(b.message)}};return C.jsxs(C.Fragment,{children:[C.jsx(wr.Popover.Button,{className:"rounded p-1 hover:bg-primary-hover","data-cy":"New-priv-btn",ref:n,children:C.jsx("span",{children:C.jsx(ye.FdPlus,{className:"h-4 w-4 text-white"})})}),v&&bo.createPortal(C.jsx(C.Fragment,{children:C.jsxs(wr.Popover.Panel,{ref:o,style:f.popper,...h.popper,"data-cy":"New-priv-pop-up",className:"z-50 min-w-[256px] rounded border border-grey-50 bg-grey-900 px-4 py-2 text-xs text-grey-50 shadow-md",static:!0,children:[C.jsx("h5",{className:"mb-2 text-xs font-semibold",children:"Create New Role"}),C.jsxs("div",{className:"mt-2",children:[C.jsxs("label",{className:"flex items-center space-x-4",children:[C.jsx("span",{className:"text-grey-100",children:"Name"}),C.jsx("input",{autoFocus:!0,value:a,onChange:b=>u(b.target.value),onKeyDown:b=>{b.key==="Enter"&&y()},type:"text",className:Ke("w-full rounded border bg-grey-300 p-1 focus:outline-none",{"border-grey-100":!c,"border-red-400":c})})]}),c&&C.jsx("p",{className:"mt-1 text-xs text-red-400",children:c})]}),C.jsxs("div",{className:"mt-4 flex items-center justify-center space-x-2",children:[C.jsx("button",{className:"rounded border border-primary-dark bg-primary-dark px-4 py-1 hover:border-primary-hover hover:bg-primary-hover",onClick:()=>{y()},children:"Create"}),C.jsx("button",{className:"rounded border border-grey-100 px-4 py-1 text-grey-100 hover:bg-white hover:text-primary-dark",onClick:()=>m(),children:"Cancel"})]})]})}),document.body)]})}})},CQ=()=>{const e=Z.useAppSelector(Z.selectRoles),{selectedRole:t}=Yb();return C.jsxs("div",{className:"flex flex-1 h-full",children:[C.jsxs("div",{className:"flex h-full w-[356px] flex-col bg-grey-800",children:[C.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between bg-grey-800 px-3.5 py-[10px]",children:[C.jsxs("div",{className:"flex items-center space-x-1 text-[#DDE1E6]",children:[C.jsx("span",{children:C.jsx(ye.FdGroup,{className:"h-[14px] w-[14px]"})}),C.jsx("span",{className:"text-[11px] font-semibold",children:"Roles"})]}),C.jsx(OQ,{})]}),C.jsx("div",{className:"flex-1 space-y-4 overflow-auto p-4 pb-10 pt-1",children:Object.values(e).map((r,n)=>C.jsx(xQ,{role:r},n))})]}),C.jsx("div",{className:"relative flex h-full w-full flex-1 flex-col items-stretch overflow-x-auto border-l-[0.5px] border-grey-900 bg-grey-800",children:C.jsx("div",{className:"flex h-full w-full select-none flex-col bg-grey-800",children:t?C.jsxs(C.Fragment,{children:[C.jsx(wQ,{}),C.jsx(SQ,{selectedRole:t})]}):C.jsx(gD,{tab:"Role"})})})]})};function Kk(){const e=Z.useAppSelector(Z.selectRolesFlags),t=Z.useAppDispatch();A.useEffect(()=>{t(Z.setTabFlags({path:nt.ROLES_TAB_PATH,flags:e}))},[e])}const Yk=()=>{const e=Z.useAppSelector(Z.selectQodly),t=Z.useAppSelector(Z.selectSelectedTab),r=Z.useAppSelector(Z.selectForceLogin),n=Z.useAppSelector(Z.selectRestrictedByDefault),i=A.useRef(),o=Z.useAppDispatch();return Kk(),C.jsx(Ct.ChakraProvider,{theme:Kz,children:C.jsx("div",{className:"absolute inset-0 flex flex-1 overflow-hidden",children:C.jsx("div",{className:"relative flex flex-1 overflow-x-auto bg-grey-900","data-cy":"Roles&Privileges-editor-cy",ref:a=>i.current=a,children:C.jsxs("div",{className:"flex w-full flex-col",children:[C.jsx(Zz,{activeTab:t,forceLogin:r,restrictedByDefault:n,onTabChange:a=>{o(Z.toggleTab(a))},onForceLoginChange:a=>{o(Z.toggleForceLogin(a))},onRestrictedByDefaultChange:a=>{o(Z.toggleRestrictedByDefault(a))},qodly:e}),t==="roles"?C.jsx(Jz,{children:C.jsx(CQ,{})}):C.jsx(nQ,{})]})})})})},RQ=()=>{const e=Z.useAppSelector(Z.selectModals),t=Z.useAppDispatch();return C.jsx(C.Fragment,{children:e.map((r,n)=>C.jsx(nt.Modal,{hasOverlay:n===0,...r,onClose:i=>t(Z.closeModal(i)),onEdit:i=>t(Z.editModal(i))},r.id))})},PQ=()=>C.jsxs(Z.ReduxProvider,{store:Z.getStore(),children:[C.jsx(nt.TipsProvider,{children:C.jsx("div",{className:"relative z-10 overflow-hidden",style:{height:"100vh"},children:C.jsx(Yk,{})})}),C.jsx(RQ,{})]});exports.Roles=Yk;exports.Standalone=PQ;exports.useRolesFlagsSync=Kk;
71
+ `),A.useEffect(function(){return f=i.ref||f,h.current&&(d=new gc(h.current,Au(Au(Au(Au({},XJ(y)),v),f&&{scrollableNode:f.current}),p.current&&{contentNode:p.current})),typeof t=="function"?t(d):t&&(t.current=d)),function(){d.unMount(),d=null,typeof t=="function"&&t(null)}},[]),A.createElement(c,mc({ref:h,"data-simplebar":!0},m),A.createElement("div",{className:"simplebar-wrapper"},A.createElement("div",{className:"simplebar-height-auto-observer-wrapper"},A.createElement("div",{className:"simplebar-height-auto-observer"})),A.createElement("div",{className:"simplebar-mask"},A.createElement("div",{className:"simplebar-offset"},typeof r=="function"?r({scrollableNodeRef:f,contentNodeRef:p}):A.createElement("div",mc({},i,{className:"simplebar-content-wrapper".concat(i.className?" ".concat(i.className):"")}),A.createElement("div",{className:"simplebar-content"},r)))),A.createElement("div",{className:"simplebar-placeholder"})),A.createElement("div",{className:"simplebar-track simplebar-horizontal"},A.createElement("div",{className:"simplebar-scrollbar"})),A.createElement("div",{className:"simplebar-track simplebar-vertical"},A.createElement("div",{className:"simplebar-scrollbar"})))});fl.displayName="SimpleBar";fl.propTypes={children:le.oneOfType([le.node,le.func]),scrollableNodeProps:le.object,tag:le.string};const yc=Hx,bc=Ux,Hk=(e,t)=>{if(e===Z.EPermissionType.METHOD&&t)switch(t){case Z.ESubPermissionType.ENTITY_SEL_METHOD:return C.jsx(ye.FdFunctionSelection,{className:"h-6 w-6"});case Z.ESubPermissionType.ENTITY_METHOD:return C.jsx(ye.FdFunctionEntity,{className:"h-6 w-6"});case Z.ESubPermissionType.DS_METHOD:return C.jsx(ye.FdFunctionDatastore,{className:"h-6 w-6"});case Z.ESubPermissionType.DATACLASS_METHOD:return C.jsx(ye.FdFunctionDataclass,{className:"h-6 w-6"})}switch(e){case Z.EPermissionType.DATACLASS:return C.jsx(ye.FdTableHeader,{className:"h-6 w-6"});case Z.EPermissionType.SINGLETON:return C.jsx(ye.FdSingleton,{className:"h-6 w-6"});case Z.EPermissionType.DATASTORE:return C.jsx(ye.FdModel3,{className:"h-6 w-6"});case Z.EPermissionType.ATTRIBUTE:return C.jsx(ye.FdTableColumn,{className:"h-6 w-6"});case Z.EPermissionType.METHOD:return C.jsx(ye.FdCode,{className:"h-6 w-6"});case Z.EPermissionType.SINGLETON_METHOD:return C.jsx(ye.FdFunctionSingleton,{className:"h-6 w-6"});default:return C.jsx(ye.FdTableHeader,{className:"h-6 w-6"})}},kM=({children:e})=>C.jsx("div",{className:"h-full w-full",children:C.jsx("div",{className:"flex h-full w-full flex-1 items-center justify-center bg-grey-800",children:C.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4 py-4 text-grey-200",children:[C.jsx(ye.FdInfoBold,{className:"h-10 w-10"}),C.jsx("div",{className:"text-center text-sm",children:e})]})})});function ZJ(e){const{isIndeterminate:t,isChecked:r,...n}=e,i=t?"M22.5 12C22.5 17.799 17.799 22.5 12 22.5C6.20101 22.5 1.5 17.799 1.5 12C1.5 6.20101 6.20101 1.5 12 1.5C17.799 1.5 22.5 6.20101 22.5 12Z":"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z";return C.jsx(Ct.Icon,{viewBox:"0 0 24 24",...n,children:C.jsx("path",{fill:t?"transparent":"currentColor",d:i,stroke:t?"currentColor":void 0,strokeWidth:t?3:void 0})})}function JJ(e){return C.jsx(Ct.Checkbox,{colorScheme:"primary",icon:C.jsx(ZJ,{}),...e})}const Xi=({permissions:e,label:t,onToggle:r,onSelect:n,promoted:i,showIncluded:o,privileges:a,exists:u})=>{const c=e.find(d=>d.name===t);return c?C.jsxs("div",{className:"relative mx-auto flex w-fit items-center",children:[c.checked||c.from.length===0||t==="promote"?C.jsx(Ct.Checkbox,{isChecked:c.checked,onChange:()=>r&&r(c),colorScheme:"primary",isInvalid:u===!1}):C.jsx(JJ,{isIndeterminate:o&&c.from.length>0,onChange:()=>r&&r(c),isInvalid:u===!1}),C.jsxs("div",{className:"absolute left-5 top-0 flex cursor-pointer items-center space-x-1",children:[t!=="promote"&&(c.checked&&(c.info||c.from.length>0)||!c.checked&&c.from.length>0)&&C.jsx(C.Fragment,{children:C.jsxs(yc,{openDelay:0,closeDelay:0,children:[C.jsx(bc,{children:C.jsx(ye.FdInfoBold,{className:"h-4 w-4 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsxs("div",{className:"space-y-1 px-2",children:[c.from.length?C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdBulb,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),C.jsx("ul",{children:c.from.map(d=>C.jsx("li",{className:"cursor-pointer list-disc font-bold hover:underline",onClick:()=>n(a[d].id),children:a[d].privilege}))})]})]}):null,c.info&&C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdInfoCircle,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"})," ",c.info]})]})})})]})}),(c.checked||c.from.length>0)&&["execute"].includes(t)&&!!(i!=null&&i.length)&&C.jsxs(yc,{openDelay:0,closeDelay:0,children:[C.jsx(bc,{children:C.jsx(ye.FdCrown,{className:"h-3 w-3 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsx("div",{className:"space-y-1 px-2",children:C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdInfoCircle,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsxs("span",{className:"mr-1",children:["Function is promoted with:"," "]}),i==null?void 0:i.map(d=>C.jsx("li",{className:"cursor-pointer list-disc font-bold hover:underline",onClick:()=>n(a[d].id),children:a[d].privilege}))]})]})})})})]})]})]}):null},QJ=({privilegeId:e,privileges:t})=>{const r=Z.useAppSelector(Z.selectCatalogMethods),n=Z.useAppSelector(Z.selectDataclasses),i=Z.useAppSelector(Z.selectSingletons),o=t[e],a=Z.useAppDispatch(),[u,c]=A.useState([]),[d,f]=A.useState("");A.useEffect(()=>{f("")},[e]);const{isOpen:h,getMenuProps:p,getInputProps:v,getComboboxProps:m,highlightedIndex:y,getItemProps:b,selectedItem:x,openMenu:w}=to({onInputValueChange(){c([])},items:[],itemToString(_){return _?_.applyTo:""},defaultHighlightedIndex:0,stateReducer:(_,R)=>{const{changes:P,type:N}=R;switch(N){case to.stateChangeTypes.InputKeyDownArrowDown:return{...P,isOpen:!0,highlightedIndex:_.highlightedIndex<=u.length?_.highlightedIndex+1:0};case to.stateChangeTypes.InputKeyDownArrowUp:return{...P,isOpen:!0,highlightedIndex:_.highlightedIndex>=0?_.highlightedIndex-1:u.length};case to.stateChangeTypes.InputKeyDownEnter:const j=u[_.highlightedIndex];if(!j)return P;const L=Z.addPermission(e,j,t);return a(Z.updatePrivileges(L)),{...P,isOpen:!0,highlightedIndex:0}}return P}});A.useEffect(()=>{const _=o.resources.map(({resource:P,type:N,subType:j})=>({type:N,applyTo:P,subType:j})),R=Ax(d.toLowerCase(),r,Object.values(n),Object.values(i));c(R.filter(({applyTo:P,type:N,subType:j})=>!Jq.find(_,{applyTo:P,type:N,subType:j})))},[d,o.resources]);const S=p({},{suppressRefError:!0}),E=A.useRef(null);return A.useEffect(()=>{h&&E.current&&E.current.focus()},[h]),C.jsxs("div",{className:"relative w-56 text-white group",...m(),children:[C.jsx("div",{...m(),children:C.jsx("input",{...v(),ref:E,type:"text",className:"block h-6 w-full rounded bg-grey-300 px-1 py-1.5 pl-2 pr-5 text-xs border-grey-500 focus:outline-none focus:ring-1 focus:ring-white focus:rounded-b-none focus:ring-inset",placeholder:"Create a permission",value:d,onChange:({target:{value:_}})=>f(_),onFocus:()=>{w()}})}),C.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center px-1",children:C.jsx(ye.FdDown,{className:"h-4 w-4 cursor-pointer",onMouseDown:_=>{_.preventDefault()},onClick:()=>{w()}})}),h&&C.jsx("ul",{...S,tabIndex:0,className:"absolute max-h-80 inset-x-0 top-full overflow-auto rounded-md border border-grey-50 bg-grey-900 p-0 text-grey-50 shadow-md group-focus-within:rounded-t-none group-focus-within:border-t-0",children:u.map((_,R)=>C.jsxs("li",{className:Ke(x===_&&"font-bold","flex min-w-fit cursor-pointer items-center space-x-2 px-3 py-2 text-xs shadow-sm",{"bg-primary-hover":y===R,"font-bold":x===_}),...b({item:_,index:R}),onClick:()=>{const P=Z.addPermission(e,_,t);a(Z.updatePrivileges(P))},children:[Hk(_.type,_.subType),C.jsx("span",{children:_.applyTo})]},`${_.applyTo}-${R}`))})]})};function eQ(e){const t=["datastore","singleton","dataclass","attribute","dsMethod","dataclassMethod","entityMethod","entityselMethod","singletonMethod"],r=e.reduce((n,i)=>{const[o]=i.resource.split("."),a=n.find(u=>u.prefix===o.toLowerCase());return a?(a.resources.push(i),n):[...n,{prefix:o.toLowerCase(),type:i.type,resources:[i]}]},[]);return r.sort((n,i)=>n.prefix==="ds"?-1:i.prefix==="ds"||n.prefix>i.prefix?1:-1),r.map(n=>({...n,resources:n.resources.sort((i,o)=>{const a=t.indexOf(i.type),u=t.indexOf(o.type);return a!==u?a-u:i.resource.toLowerCase()>o.resource.toLowerCase()?1:-1})})).reduce((n,i)=>[...n,...i.resources],[])}const tQ=({selectedPrivilege:e,onSelect:t,showIncluded:r,privileges:n})=>{const[i,o]=A.useState(null),[a,u]=A.useState(null),{styles:c,attributes:d}=wc(i,a,{modifiers:[{name:"offset",options:{offset:[0,10]}}]}),[f,h]=A.useState([]),[p,v]=A.useState(""),m=Z.useAppDispatch();Z.useAppSelector(Z.selectCatalog);const{id:y}=e,b=A.useMemo(()=>Z.getInheritedResources(y,n),[y,n[y].includes,n[y].resources]),x=A.useMemo(()=>Z.getPromotions(y,n),[n[y]]);function w(k){h(D=>D.some(T=>k.includes(T))?D.filter(T=>!k.includes(T)):[...D,...k])}const S=async k=>{const{confirmed:D}=await m(Z.openModal({title:"Delete Privilege",type:nt.ModalType.CONFIRM,color:nt.ModalColor.DANGER,message:"Are you sure you want to remove this Privilege?",icon:"FdWarningDanger"})).unwrap();if(D){const T=Z.removePermission(e.id,k,n);m(Z.updatePrivileges(T))}},E=async()=>{const{confirmed:k}=await m(Z.openModal({title:"Reset Permissions",type:nt.ModalType.CONFIRM,color:nt.ModalColor.DANGER,message:"Are you sure you want to reset permissions for this Privilege?",icon:"FdWarningDanger"})).unwrap();if(k){const D=Z.resetResources(e.id,n);m(Z.updatePrivileges(D))}},R=b.filter(k=>f.length===0?!0:f.includes(k.type)).filter(({resource:k})=>p?new RegExp(Jq.escapeRegExp(p),"i").test(k):!0),P=eQ(R),N=P.filter(k=>{const D=k.permissions.every(T=>!T.checked)&&k.permissions.some(T=>T.from.length>0);return r||!D}),j=(k,D)=>{const T=Z.togglePermission(e.id,k,D,n);m(Z.updatePrivileges(T))},L=A.useMemo(()=>N.some(k=>k.exists===!1),[N]),F=async()=>{const{confirmed:k}=await m(Z.openModal({title:"Delete Privilege",type:nt.ModalType.CONFIRM,color:nt.ModalColor.DANGER,message:"Are you sure you want to remove these permissions?",views:{tips:[{type:"warning",message:"This action will remove all permissions that don't exist in the catalog for all privileges"}]},icon:"FdWarningDanger"})).unwrap(),D=Object.entries(n).map(([T,B])=>{const $=B.resources.filter(W=>!W.exists);return{[T]:$.map(W=>({applyTo:W.resource,type:W.type}))}}).reduce((T,B)=>({...T,...B}),{});if(k){const T=Z.removeMultiplePermissions(D,n);m(Z.updatePrivileges(T))}};return C.jsxs(fl,{className:"z-20 h-full flex-1 overflow-auto bg-grey-800 p-[15px] pt-0",style:{maxHeight:"calc(100vh - 5.5rem - 85px - 20px)"},children:[C.jsxs("table",{className:"relative h-full w-full",children:[C.jsx("thead",{className:"sticky top-0 z-20 bg-grey-800",children:C.jsxs("tr",{className:"border-b border-grey-100",children:[C.jsx("td",{className:"py-2",children:C.jsxs("div",{className:"flex items-center space-x-2",children:[C.jsxs("div",{className:"relative w-56 text-white",children:[C.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center px-1",children:C.jsx(ye.FdSearch,{className:"h-4 w-4 text-gray-400"})}),C.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center px-2",children:C.jsx(wr.Popover,{className:"flex items-center",children:({open:k})=>C.jsxs(C.Fragment,{children:[C.jsx(wr.Popover.Button,{ref:o,children:C.jsx(ye.FdAdjust,{className:"h-4 w-4"})}),k&&bo.createPortal(C.jsx(C.Fragment,{children:C.jsxs(wr.Popover.Panel,{ref:u,style:c.popper,...d.popper,className:"z-50 rounded-md border border-grey-50 bg-grey-900 px-4 py-2.5 text-xs text-grey-50",static:!0,children:[C.jsx("h5",{className:"mb-2 text-sm",children:"Filter"}),C.jsxs("div",{className:"space-y-2",children:[C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{isChecked:f.includes("datastore"),onChange:()=>{w(["datastore"])},colorScheme:"primary"}),C.jsx("span",{children:"Datastore"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{isChecked:f.includes("dataclass"),onChange:()=>{w(["dataclass"])},colorScheme:"primary"}),C.jsx("span",{children:"Dataclass"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{isChecked:f.includes("singleton"),onChange:()=>{w(["singleton"])},colorScheme:"primary"}),C.jsx("span",{children:"Singleton"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{isChecked:f.some(D=>["method","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"].includes(D)),onChange:()=>{w(["method","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"])},colorScheme:"primary"}),C.jsx("span",{children:"Functions"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{isChecked:f.includes("attribute"),onChange:()=>{w(["attribute"])},colorScheme:"primary"}),C.jsx("span",{children:"Attribute"})]})]})]})}),document.body)]})})}),C.jsx("input",{type:"text",className:"block h-6 w-full rounded bg-grey-300 px-1 py-1.5 pl-6 text-xs focus:outline-none",placeholder:"Search available permissions",value:p,onChange:k=>{v(k.target.value)}})]}),C.jsx(QJ,{privilegeId:y,privileges:n}),C.jsx("div",{children:C.jsxs(yc,{openDelay:0,closeDelay:0,children:[C.jsx(bc,{children:C.jsx("button",{className:"flex h-6 items-center space-x-1 rounded-md px-2 text-sm text-grey-50 hover:bg-primary-hover",onClick:E,children:C.jsx(ye.FdReload,{})})}),C.jsx(jr,{children:C.jsxs(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"mb-1 flex max-w-xs items-center gap-x-1 rounded bg-primary-light px-2 py-2 text-s font-semibold text-primary-darker",children:[C.jsx(ye.FdBulb,{className:"m-0.5 h-4 w-4 flex-shrink-0"}),C.jsx("p",{children:"Resetting the privilege will remove all configured ressources"})]})})]})}),C.jsxs(yc,{openDelay:0,closeDelay:0,children:[C.jsx(bc,{children:C.jsx("button",{className:Ke("flex h-6 items-center space-x-1 rounded-md px-2 text-sm text-grey-50 hover:bg-primary-hover disabled:opacity-50 disabled:hover:bg-primary-dark"),onClick:F,disabled:!L,children:C.jsx(ye.FdClean,{className:"h-4 w-4"})})}),C.jsx(jr,{children:C.jsxs(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"mb-1 flex max-w-xs items-center gap-x-1 rounded bg-primary-light px-2 py-2 text-s font-semibold text-primary-darker",children:[C.jsx(ye.FdBulb,{className:"m-0.5 h-4 w-4 flex-shrink-0"}),C.jsx("p",{children:"Delete all the non existing resources from privileges"})]})})]})]})}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Read"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Create"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Update"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Delete"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Execute"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Promote"})]})}),N.length?C.jsx("tbody",{children:N.map((k,D)=>{const T=k.permissions.some(B=>B.from.length>0);return C.jsxs("tr",{className:Ke("group even:bg-grey-600",{"opacity-60":k.exists===!1}),children:[C.jsxs("td",{className:Ke("group flex items-center gap-3 py-2 text-xs group-hover:rounded-l group-hover:bg-grey-300",k.exists===!1?"text-negative-400":"text-white",{"border-b-[0.5px] border-grey-300":!1}),children:[Hk(k.type,k.subType),k.resource,C.jsx(nt.Tooltip,{placement:"top",label:"Remove Permission",isDisabled:T,children:C.jsx("button",{onClick:()=>{T?nt.toastSubject.next({kind:"info",markdown:!0,message:`<div className="flex gap-x-3"><h3 className="font-bold">Info:</h3><p className="font-normal">Inherited permissions can't be removed</p></div>`,customIcon:ye.FdInfoBold}):S({applyTo:k.resource,type:k.type})},className:Ke("flex flex-shrink-0 items-center justify-center rounded p-1 opacity-0 group-hover:opacity-100",T?"hover:bg-grey-300 group-hover:opacity-70":"hover:bg-primary-hover"),children:C.jsx(ye.FdPlus,{className:"h-4 w-4 rotate-45 transform text-white"})})})]}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:C.jsx(Xi,{permissions:k.permissions,showIncluded:r,label:"read",onToggle:B=>j(k,B),onSelect:t,privileges:n,exists:k.exists})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:C.jsx(Xi,{permissions:k.permissions,showIncluded:r,label:"create",onToggle:B=>j(k,B),onSelect:t,privileges:n,exists:k.exists})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:C.jsx(Xi,{permissions:k.permissions,showIncluded:r,label:"update",onToggle:B=>j(k,B),onSelect:t,privileges:n,exists:k.exists})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:C.jsx(Xi,{permissions:k.permissions,showIncluded:r,label:"drop",onToggle:B=>j(k,B),onSelect:t,privileges:n,exists:k.exists})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:C.jsx(Xi,{promoted:x[k.resource],permissions:k.permissions,showIncluded:r,label:"execute",onToggle:B=>j(k,B),onSelect:t,privileges:n,exists:k.exists})}),C.jsx("td",{className:"py-2 text-center group-hover:rounded-r group-hover:bg-grey-300 ",children:C.jsx(Xi,{permissions:k.permissions,showIncluded:r,label:"promote",onToggle:B=>j(k,B),onSelect:t,privileges:n,exists:k.exists})})]},D)})}):null]}),!P.length&&p?C.jsx(kM,{children:"The Permission you're looking for can't be found "}):null,!P.length&&!p?C.jsxs(kM,{children:["This Privilege has no Permissions configured yet ",C.jsx("br",{}),'Add a new permission by using the "Create a permission" input above']}):null]})},rQ=({onCreate:e})=>{const t=Z.useAppSelector(Z.selectPrivileges),r=Z.useAppDispatch(),[n,i]=A.useState(null),[o,a]=A.useState(null),[u,c]=A.useState(""),[d,f]=A.useState(null),{styles:h,attributes:p}=wc(n,o,{modifiers:[{name:"offset",options:{offset:[-10,10]}}],placement:"right-start"});return A.useEffect(()=>{c(""),f(null)},[o]),C.jsx(wr.Popover,{children:({open:v,close:m})=>C.jsxs(C.Fragment,{children:[C.jsx(wr.Popover.Button,{className:"rounded p-1 hover:bg-primary-hover","data-cy":"New-priv-btn",ref:i,children:C.jsx("span",{children:C.jsx(ye.FdPlus,{className:"h-4 w-4 text-white"})})}),v&&bo.createPortal(C.jsx(C.Fragment,{children:C.jsxs(wr.Popover.Panel,{ref:a,style:h.popper,...p.popper,"data-cy":"New-priv-pop-up",className:"z-50 min-w-[256px] rounded border border-grey-50 bg-grey-900 px-4 py-2 text-xs text-grey-50 shadow-md",static:!0,children:[C.jsx("h5",{className:"mb-2 text-xs font-semibold",children:"Create New Privilege"}),C.jsxs("div",{className:"mt-2",children:[C.jsxs("label",{className:"flex items-center space-x-4",children:[C.jsx("span",{className:"text-grey-100",children:"Name"}),C.jsx("input",{autoFocus:!0,value:u,onChange:y=>c(y.target.value),onKeyDown:y=>{if(y.key==="Enter"){f(null);try{const b=Z.create(u,t),x=r(Z.updatePrivileges(b)),w=Object.values(x.payload).find(S=>S.privilege===u);w&&(e(w),m())}catch(b){f(b.message)}}},type:"text",className:Ke("w-full rounded border bg-grey-300 p-1 focus:outline-none",{"border-grey-100":!d,"border-red-400":d})})]}),d&&C.jsx("p",{className:"mt-1 text-xs text-red-400",children:d})]}),C.jsxs("div",{className:"mt-4 flex items-center justify-center space-x-2",children:[C.jsx("button",{className:"rounded border border-primary-dark bg-primary-dark px-4 py-1 hover:border-primary-hover hover:bg-primary-hover",onClick:()=>{f(null);try{const y=Z.create(u,t),b=r(Z.updatePrivileges(y)),x=Object.values(b.payload).find(w=>w.privilege===u);x&&e(x),m()}catch(y){f(y.message)}},children:"Create"}),C.jsx("button",{className:"rounded border border-grey-100 px-4 py-1 text-grey-100 hover:bg-white hover:text-primary-dark",onClick:()=>m(),children:"Cancel"})]})]})}),document.body)]})})},nQ=()=>{const e=Z.useAppSelector(Z.selectCatalog),t=Z.useAppSelector(Z.selectPrivileges),r=A.useMemo(()=>{if(e===null)return t;const c=T2(t,Object.values((e==null?void 0:e.dataClasses)??{}));return A2(c,e)},[t,e]),[n,i]=A.useState(null),o=A.useMemo(()=>Object.keys(r),[r]);A.useEffect(()=>{n&&r[n.id]||!o.length||i(r[o[0]])},[r]),A.useEffect(()=>{o.length<2&&u(!0)},[o.length]);const[a,u]=A.useState(!0);return C.jsxs("div",{className:"flex flex-1 h-full",children:[C.jsxs("div",{className:"flex h-full w-[356px] flex-col bg-grey-800",children:[C.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between bg-grey-800 px-3.5 py-[10px]",children:[C.jsxs("div",{className:"flex items-center space-x-1 text-[#DDE1E6]",children:[C.jsx("span",{children:C.jsx(ye.FdGroup,{className:"h-[14px] w-[14px]"})}),C.jsx("span",{className:"text-[11px] font-semibold",children:"Privileges"})]}),C.jsx(rQ,{onCreate:c=>{i(c)}})]}),C.jsx(xX,{privileges:r,selectedPrivilege:n,selectPrivilege:c=>{i(c)}})]}),n&&r[n.id]?C.jsxs("div",{className:"privileges-container relative flex flex-1 flex-col overflow-x-auto border-l-[0.5px] border-grey-900 bg-grey-800",children:[C.jsxs("div",{className:"mb-1 flex h-full w-full flex-col items-stretch",children:[n.privilege!=="guest"?C.jsx(m9,{privileges:r,selectedPrivilege:n,onSelect:c=>i(t[c]),setShowIncluded:u,showIncluded:a}):null,C.jsx(tQ,{privileges:r,selectedPrivilege:n,onSelect:c=>i(t[c]),showIncluded:a})]}),C.jsx(iQ,{privileges:r,selectedPrivilege:n,setSelectedPrivilege:i})]}):C.jsx(gD,{tab:"Privilege"})]})},iQ=({privileges:e,selectedPrivilege:t,setSelectedPrivilege:r})=>{const[n,i]=A.useState(!1);return C.jsx(nt.Panel,{path:nt.ROLES_TAB_PATH,isOpen:n,onOpen:()=>i(!0),onClose:()=>i(!1),children:C.jsx("div",{className:"h-full w-full px-3 pb-3",children:C.jsx("div",{className:"h-full w-full rounded bg-grey-900",children:C.jsx(p9,{dict:e,data:Z.getGraphData(t.id,e),onSelect:o=>r(e[o])})})})})};var yb={},oa={},Mu={},LM;function Uk(){if(LM)return Mu;LM=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.default=r;let e;const t=new Uint8Array(16);function r(){if(!e&&(e=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!e))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(t)}return Mu}var Zi={},aa={},sa={},BM;function oQ(){if(BM)return sa;BM=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.default=void 0;var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return sa.default=e,sa}var FM;function dl(){if(FM)return aa;FM=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.default=void 0;var e=t(oQ());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){return typeof i=="string"&&e.default.test(i)}var n=r;return aa.default=n,aa}var $M;function hl(){if($M)return Zi;$M=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.default=void 0,Zi.unsafeStringify=n;var e=t(dl());function t(a){return a&&a.__esModule?a:{default:a}}const r=[];for(let a=0;a<256;++a)r.push((a+256).toString(16).slice(1));function n(a,u=0){return r[a[u+0]]+r[a[u+1]]+r[a[u+2]]+r[a[u+3]]+"-"+r[a[u+4]]+r[a[u+5]]+"-"+r[a[u+6]]+r[a[u+7]]+"-"+r[a[u+8]]+r[a[u+9]]+"-"+r[a[u+10]]+r[a[u+11]]+r[a[u+12]]+r[a[u+13]]+r[a[u+14]]+r[a[u+15]]}function i(a,u=0){const c=n(a,u);if(!(0,e.default)(c))throw TypeError("Stringified UUID is invalid");return c}var o=i;return Zi.default=o,Zi}var zM;function aQ(){if(zM)return oa;zM=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.default=void 0;var e=r(Uk()),t=hl();function r(d){return d&&d.__esModule?d:{default:d}}let n,i,o=0,a=0;function u(d,f,h){let p=f&&h||0;const v=f||new Array(16);d=d||{};let m=d.node||n,y=d.clockseq!==void 0?d.clockseq:i;if(m==null||y==null){const _=d.random||(d.rng||e.default)();m==null&&(m=n=[_[0]|1,_[1],_[2],_[3],_[4],_[5]]),y==null&&(y=i=(_[6]<<8|_[7])&16383)}let b=d.msecs!==void 0?d.msecs:Date.now(),x=d.nsecs!==void 0?d.nsecs:a+1;const w=b-o+(x-a)/1e4;if(w<0&&d.clockseq===void 0&&(y=y+1&16383),(w<0||b>o)&&d.nsecs===void 0&&(x=0),x>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");o=b,a=x,i=y,b+=122192928e5;const S=((b&268435455)*1e4+x)%4294967296;v[p++]=S>>>24&255,v[p++]=S>>>16&255,v[p++]=S>>>8&255,v[p++]=S&255;const E=b/4294967296*1e4&268435455;v[p++]=E>>>8&255,v[p++]=E&255,v[p++]=E>>>24&15|16,v[p++]=E>>>16&255,v[p++]=y>>>8|128,v[p++]=y&255;for(let _=0;_<6;++_)v[p+_]=m[_];return f||(0,t.unsafeStringify)(v)}var c=u;return oa.default=c,oa}var ua={},Ln={},ca={},HM;function Vk(){if(HM)return ca;HM=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.default=void 0;var e=t(dl());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){if(!(0,e.default)(i))throw TypeError("Invalid UUID");let o;const a=new Uint8Array(16);return a[0]=(o=parseInt(i.slice(0,8),16))>>>24,a[1]=o>>>16&255,a[2]=o>>>8&255,a[3]=o&255,a[4]=(o=parseInt(i.slice(9,13),16))>>>8,a[5]=o&255,a[6]=(o=parseInt(i.slice(14,18),16))>>>8,a[7]=o&255,a[8]=(o=parseInt(i.slice(19,23),16))>>>8,a[9]=o&255,a[10]=(o=parseInt(i.slice(24,36),16))/1099511627776&255,a[11]=o/4294967296&255,a[12]=o>>>24&255,a[13]=o>>>16&255,a[14]=o>>>8&255,a[15]=o&255,a}var n=r;return ca.default=n,ca}var UM;function Wk(){if(UM)return Ln;UM=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.URL=Ln.DNS=void 0,Ln.default=a;var e=hl(),t=r(Vk());function r(u){return u&&u.__esModule?u:{default:u}}function n(u){u=unescape(encodeURIComponent(u));const c=[];for(let d=0;d<u.length;++d)c.push(u.charCodeAt(d));return c}const i="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Ln.DNS=i;const o="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Ln.URL=o;function a(u,c,d){function f(h,p,v,m){var y;if(typeof h=="string"&&(h=n(h)),typeof p=="string"&&(p=(0,t.default)(p)),((y=p)===null||y===void 0?void 0:y.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let b=new Uint8Array(16+h.length);if(b.set(p),b.set(h,p.length),b=d(b),b[6]=b[6]&15|c,b[8]=b[8]&63|128,v){m=m||0;for(let x=0;x<16;++x)v[m+x]=b[x];return v}return(0,e.unsafeStringify)(b)}try{f.name=u}catch{}return f.DNS=i,f.URL=o,f}return Ln}var la={},VM;function sQ(){if(VM)return la;VM=1,Object.defineProperty(la,"__esModule",{value:!0}),la.default=void 0;function e(v){if(typeof v=="string"){const m=unescape(encodeURIComponent(v));v=new Uint8Array(m.length);for(let y=0;y<m.length;++y)v[y]=m.charCodeAt(y)}return t(n(i(v),v.length*8))}function t(v){const m=[],y=v.length*32,b="0123456789abcdef";for(let x=0;x<y;x+=8){const w=v[x>>5]>>>x%32&255,S=parseInt(b.charAt(w>>>4&15)+b.charAt(w&15),16);m.push(S)}return m}function r(v){return(v+64>>>9<<4)+14+1}function n(v,m){v[m>>5]|=128<<m%32,v[r(m)-1]=m;let y=1732584193,b=-271733879,x=-1732584194,w=271733878;for(let S=0;S<v.length;S+=16){const E=y,_=b,R=x,P=w;y=c(y,b,x,w,v[S],7,-680876936),w=c(w,y,b,x,v[S+1],12,-389564586),x=c(x,w,y,b,v[S+2],17,606105819),b=c(b,x,w,y,v[S+3],22,-1044525330),y=c(y,b,x,w,v[S+4],7,-176418897),w=c(w,y,b,x,v[S+5],12,1200080426),x=c(x,w,y,b,v[S+6],17,-1473231341),b=c(b,x,w,y,v[S+7],22,-45705983),y=c(y,b,x,w,v[S+8],7,1770035416),w=c(w,y,b,x,v[S+9],12,-1958414417),x=c(x,w,y,b,v[S+10],17,-42063),b=c(b,x,w,y,v[S+11],22,-1990404162),y=c(y,b,x,w,v[S+12],7,1804603682),w=c(w,y,b,x,v[S+13],12,-40341101),x=c(x,w,y,b,v[S+14],17,-1502002290),b=c(b,x,w,y,v[S+15],22,1236535329),y=d(y,b,x,w,v[S+1],5,-165796510),w=d(w,y,b,x,v[S+6],9,-1069501632),x=d(x,w,y,b,v[S+11],14,643717713),b=d(b,x,w,y,v[S],20,-373897302),y=d(y,b,x,w,v[S+5],5,-701558691),w=d(w,y,b,x,v[S+10],9,38016083),x=d(x,w,y,b,v[S+15],14,-660478335),b=d(b,x,w,y,v[S+4],20,-405537848),y=d(y,b,x,w,v[S+9],5,568446438),w=d(w,y,b,x,v[S+14],9,-1019803690),x=d(x,w,y,b,v[S+3],14,-187363961),b=d(b,x,w,y,v[S+8],20,1163531501),y=d(y,b,x,w,v[S+13],5,-1444681467),w=d(w,y,b,x,v[S+2],9,-51403784),x=d(x,w,y,b,v[S+7],14,1735328473),b=d(b,x,w,y,v[S+12],20,-1926607734),y=f(y,b,x,w,v[S+5],4,-378558),w=f(w,y,b,x,v[S+8],11,-2022574463),x=f(x,w,y,b,v[S+11],16,1839030562),b=f(b,x,w,y,v[S+14],23,-35309556),y=f(y,b,x,w,v[S+1],4,-1530992060),w=f(w,y,b,x,v[S+4],11,1272893353),x=f(x,w,y,b,v[S+7],16,-155497632),b=f(b,x,w,y,v[S+10],23,-1094730640),y=f(y,b,x,w,v[S+13],4,681279174),w=f(w,y,b,x,v[S],11,-358537222),x=f(x,w,y,b,v[S+3],16,-722521979),b=f(b,x,w,y,v[S+6],23,76029189),y=f(y,b,x,w,v[S+9],4,-640364487),w=f(w,y,b,x,v[S+12],11,-421815835),x=f(x,w,y,b,v[S+15],16,530742520),b=f(b,x,w,y,v[S+2],23,-995338651),y=h(y,b,x,w,v[S],6,-198630844),w=h(w,y,b,x,v[S+7],10,1126891415),x=h(x,w,y,b,v[S+14],15,-1416354905),b=h(b,x,w,y,v[S+5],21,-57434055),y=h(y,b,x,w,v[S+12],6,1700485571),w=h(w,y,b,x,v[S+3],10,-1894986606),x=h(x,w,y,b,v[S+10],15,-1051523),b=h(b,x,w,y,v[S+1],21,-2054922799),y=h(y,b,x,w,v[S+8],6,1873313359),w=h(w,y,b,x,v[S+15],10,-30611744),x=h(x,w,y,b,v[S+6],15,-1560198380),b=h(b,x,w,y,v[S+13],21,1309151649),y=h(y,b,x,w,v[S+4],6,-145523070),w=h(w,y,b,x,v[S+11],10,-1120210379),x=h(x,w,y,b,v[S+2],15,718787259),b=h(b,x,w,y,v[S+9],21,-343485551),y=o(y,E),b=o(b,_),x=o(x,R),w=o(w,P)}return[y,b,x,w]}function i(v){if(v.length===0)return[];const m=v.length*8,y=new Uint32Array(r(m));for(let b=0;b<m;b+=8)y[b>>5]|=(v[b/8]&255)<<b%32;return y}function o(v,m){const y=(v&65535)+(m&65535);return(v>>16)+(m>>16)+(y>>16)<<16|y&65535}function a(v,m){return v<<m|v>>>32-m}function u(v,m,y,b,x,w){return o(a(o(o(m,v),o(b,w)),x),y)}function c(v,m,y,b,x,w,S){return u(m&y|~m&b,v,m,x,w,S)}function d(v,m,y,b,x,w,S){return u(m&b|y&~b,v,m,x,w,S)}function f(v,m,y,b,x,w,S){return u(m^y^b,v,m,x,w,S)}function h(v,m,y,b,x,w,S){return u(y^(m|~b),v,m,x,w,S)}var p=e;return la.default=p,la}var WM;function uQ(){if(WM)return ua;WM=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.default=void 0;var e=r(Wk()),t=r(sQ());function r(o){return o&&o.__esModule?o:{default:o}}var i=(0,e.default)("v3",48,t.default);return ua.default=i,ua}var fa={},da={},GM;function cQ(){if(GM)return da;GM=1,Object.defineProperty(da,"__esModule",{value:!0}),da.default=void 0;var t={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};return da.default=t,da}var KM;function lQ(){if(KM)return fa;KM=1,Object.defineProperty(fa,"__esModule",{value:!0}),fa.default=void 0;var e=n(cQ()),t=n(Uk()),r=hl();function n(a){return a&&a.__esModule?a:{default:a}}function i(a,u,c){if(e.default.randomUUID&&!u&&!a)return e.default.randomUUID();a=a||{};const d=a.random||(a.rng||t.default)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,u){c=c||0;for(let f=0;f<16;++f)u[c+f]=d[f];return u}return(0,r.unsafeStringify)(d)}var o=i;return fa.default=o,fa}var ha={},pa={},YM;function fQ(){if(YM)return pa;YM=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.default=void 0;function e(i,o,a,u){switch(i){case 0:return o&a^~o&u;case 1:return o^a^u;case 2:return o&a^o&u^a&u;case 3:return o^a^u}}function t(i,o){return i<<o|i>>>32-o}function r(i){const o=[1518500249,1859775393,2400959708,3395469782],a=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof i=="string"){const f=unescape(encodeURIComponent(i));i=[];for(let h=0;h<f.length;++h)i.push(f.charCodeAt(h))}else Array.isArray(i)||(i=Array.prototype.slice.call(i));i.push(128);const u=i.length/4+2,c=Math.ceil(u/16),d=new Array(c);for(let f=0;f<c;++f){const h=new Uint32Array(16);for(let p=0;p<16;++p)h[p]=i[f*64+p*4]<<24|i[f*64+p*4+1]<<16|i[f*64+p*4+2]<<8|i[f*64+p*4+3];d[f]=h}d[c-1][14]=(i.length-1)*8/Math.pow(2,32),d[c-1][14]=Math.floor(d[c-1][14]),d[c-1][15]=(i.length-1)*8&4294967295;for(let f=0;f<c;++f){const h=new Uint32Array(80);for(let x=0;x<16;++x)h[x]=d[f][x];for(let x=16;x<80;++x)h[x]=t(h[x-3]^h[x-8]^h[x-14]^h[x-16],1);let p=a[0],v=a[1],m=a[2],y=a[3],b=a[4];for(let x=0;x<80;++x){const w=Math.floor(x/20),S=t(p,5)+e(w,v,m,y)+b+o[w]+h[x]>>>0;b=y,y=m,m=t(v,30)>>>0,v=p,p=S}a[0]=a[0]+p>>>0,a[1]=a[1]+v>>>0,a[2]=a[2]+m>>>0,a[3]=a[3]+y>>>0,a[4]=a[4]+b>>>0}return[a[0]>>24&255,a[0]>>16&255,a[0]>>8&255,a[0]&255,a[1]>>24&255,a[1]>>16&255,a[1]>>8&255,a[1]&255,a[2]>>24&255,a[2]>>16&255,a[2]>>8&255,a[2]&255,a[3]>>24&255,a[3]>>16&255,a[3]>>8&255,a[3]&255,a[4]>>24&255,a[4]>>16&255,a[4]>>8&255,a[4]&255]}var n=r;return pa.default=n,pa}var XM;function dQ(){if(XM)return ha;XM=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.default=void 0;var e=r(Wk()),t=r(fQ());function r(o){return o&&o.__esModule?o:{default:o}}var i=(0,e.default)("v5",80,t.default);return ha.default=i,ha}var va={},ZM;function hQ(){if(ZM)return va;ZM=1,Object.defineProperty(va,"__esModule",{value:!0}),va.default=void 0;var e="00000000-0000-0000-0000-000000000000";return va.default=e,va}var ga={},JM;function pQ(){if(JM)return ga;JM=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.default=void 0;var e=t(dl());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){if(!(0,e.default)(i))throw TypeError("Invalid UUID");return parseInt(i.slice(14,15),16)}var n=r;return ga.default=n,ga}var QM;function vQ(){return QM||(QM=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return a.default}});var t=f(aQ()),r=f(uQ()),n=f(lQ()),i=f(dQ()),o=f(hQ()),a=f(pQ()),u=f(dl()),c=f(hl()),d=f(Vk());function f(h){return h&&h.__esModule?h:{default:h}}})(yb)),yb}var bb,eD;function gQ(){if(eD)return bb;eD=1;function e(t,r){if(!t||!r||!t.length||!r.length)throw new Error("Bad alphabet");this.srcAlphabet=t,this.dstAlphabet=r}return e.prototype.convert=function(t){var r,n,i,o={},a=this.srcAlphabet.length,u=this.dstAlphabet.length,c=t.length,d=typeof t=="string"?"":[];if(!this.isValid(t))throw new Error('Number "'+t+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return t;for(r=0;r<c;r++)o[r]=this.srcAlphabet.indexOf(t[r]);do{for(n=0,i=0,r=0;r<c;r++)n=n*a+o[r],n>=u?(o[i++]=parseInt(n/u,10),n=n%u):i>0&&(o[i++]=0);c=i,d=this.dstAlphabet.slice(n,n+1).concat(d)}while(i!==0);return d},e.prototype.isValid=function(t){for(var r=0;r<t.length;++r)if(this.srcAlphabet.indexOf(t[r])===-1)return!1;return!0},bb=e,bb}var xb,tD;function mQ(){if(tD)return xb;tD=1;var e=gQ();function t(r,n){var i=new e(r,n);return function(o){return i.convert(o)}}return t.BIN="01",t.OCT="01234567",t.DEC="0123456789",t.HEX="0123456789abcdef",xb=t,xb}var wb,rD;function yQ(){if(rD)return wb;rD=1;const{v4:e,validate:t}=vQ(),r=mQ(),n={cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",flickrBase58:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",uuid25Base36:"0123456789abcdefghijklmnopqrstuvwxyz"},i={consistentLength:!0};let o;const a=(d,f,h)=>{const p=f(d.toLowerCase().replace(/-/g,""));return!h||!h.consistentLength?p:p.padStart(h.shortIdLength,h.paddingChar)},u=(d,f)=>{const p=f(d).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[p[1],p[2],p[3],p[4],p[5]].join("-")},c=d=>Math.ceil(Math.log(2**128)/Math.log(d));return wb=(()=>{const d=(f,h)=>{const p=f||n.flickrBase58,v={...i,...h};if([...new Set(Array.from(p))].length!==p.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const m=c(p.length),y={shortIdLength:m,consistentLength:v.consistentLength,paddingChar:p[0]},b=r(r.HEX,p),x=r(p,r.HEX),w=()=>a(e(),b,y),E={alphabet:p,fromUUID:_=>a(_,b,y),maxLength:m,generate:w,new:w,toUUID:_=>u(_,x),uuid:e,validate:(_,R=!1)=>{if(!_||typeof _!="string")return!1;const P=v.consistentLength?_.length===m:_.length<=m,N=_.split("").every(j=>p.includes(j));return R===!1?P&&N:P&&N&&t(u(_,x))}};return Object.freeze(E),E};return d.constants=n,d.uuid=e,d.generate=()=>(o||(o=d(n.flickrBase58).generate),o()),d})(),wb}var bQ=yQ();const xQ=({role:e})=>{var R;const[t,r]=A.useState(e),[n,i]=A.useState(e.role),[o,a]=A.useState(null),u=Z.useAppSelector(Z.selectPrivileges),c=((R=t.privileges)==null?void 0:R.filter(P=>u[P]&&u[P].privilege!=="guest").length)||0,d=Z.useAppSelector(Z.selectRoles),f=Z.useAppDispatch(),{selectedRole:h,selectRole:p}=Yb(),[v,m]=A.useState(!1),y=nt.useOutsideClick(()=>{v&&x()});A.useEffect(()=>{e.role||m(!0)},[]),A.useEffect(()=>{r(e)},[e]);const b=()=>{a(""),m(!0)},x=()=>{a(null),e.role&&e.role===n&&m(!1);try{const P=Z.saveRole({...t,role:n},d);f(Z.updateRoles(P)),m(!1)}catch(P){a(P.message)}},w=Z.useAppDispatch(),S=async P=>{P.stopPropagation();const{confirmed:N}=await w(Z.openModal({title:"Delete Role",type:nt.ModalType.CONFIRM,color:nt.ModalColor.DANGER,message:"Are you sure you want to remove this Role?",icon:"FdWarningDanger"})).unwrap();N&&E()},E=()=>{const P=Z.removeRole(t.id,d),N=Object.keys(P),j=N.length>=1,L=N[N.length-1];p(L&&j?L:null),f(Z.updateRoles(P))},_=(P=null)=>{if(P&&P.stopPropagation(),!e.role){E();return}m(!1),i(e.role)};return C.jsx(C.Fragment,{children:C.jsxs("div",{className:Ke("rounded border bg-grey-300 p-2",{"border-grey-100":h!==t.id,"border-primary-dark":h===t.id}),role:"button","data-cy":"privilegeCard",onClick:()=>{p(t.id)},ref:y,children:[C.jsx("div",{className:"flex items-center justify-between",children:C.jsxs("div",{className:"flex flex-1 items-center text-white",children:[C.jsx("span",{className:"mr-4",children:C.jsx(ye.FdGroup,{className:"h-6 w-6"})}),v?C.jsxs("div",{className:"relative h-6 flex-1",children:[C.jsx("input",{type:"text",value:n,onChange:({target:{value:P}})=>{i(P)},onKeyDown:P=>{P.key==="Enter"&&x(),P.key==="Escape"&&_()},className:Ke("absolute inset-0 mr-2 h-6 min-w-0 rounded border border-grey-200 bg-grey-300 p-1 text-xs focus:border-primary-dark focus:outline-none",{"border-b border-red-400":o}),placeholder:"role",autoComplete:"off",autoFocus:!0}),o&&C.jsx("p",{className:"absolute top-5 mt-1 rounded bg-red-400 p-1 text-xs text-white shadow-md",children:o})]}):C.jsx("span",{className:"inline-block grow overflow-hidden truncate whitespace-nowrap text-xs font-bold",title:n,children:t.role}),C.jsx("div",{className:Ke("justify-betwee ml-auto flex w-fit items-center gap-x-2"),children:v?C.jsxs(C.Fragment,{children:[C.jsx("button",{onClick:x,className:"rounded p-1 hover:bg-primary-hover hover:text-white",children:C.jsx(ye.FdSave,{className:"h-4 w-4 text-grey-50"})}),C.jsx("button",{onClick:_,className:"rounded p-1 hover:bg-primary-hover hover:text-white",children:C.jsx(ye.FdClose,{className:"h-4 w-4 text-grey-50"})})]}):C.jsxs(C.Fragment,{children:[C.jsx("button",{onClick:b,className:"rounded p-1 hover:bg-primary-hover hover:text-white",children:C.jsx(ye.FdPen,{className:"h-4 w-4 text-grey-50"})}),C.jsx("button",{onClick:P=>S(P),className:"rounded p-1 hover:bg-primary-hover hover:text-white",children:C.jsx(ye.FdTrash,{className:"h-4 w-4 text-grey-50"})})]})})]})}),C.jsxs("span",{className:Ke("ml-[43px] py-1 text-xs text-white"),children:[c," Privilege",c>1?"s":""]})]})})},Gk=(e,t)=>e?t[e]:null,nD=(e,t,r)=>{const n=Gk(e,r);return n?Object.values(r).reduce((i,o)=>o.id===e?n.privileges.includes(t)?{...i,[n.id]:{...n,privileges:n.privileges.filter(a=>a!==t)}}:{...i,[n.id]:{...n,privileges:[...n.privileges,t]}}:{...i,[o.id]:o},{}):r},wQ=()=>{const e=Z.useAppSelector(Z.selectPrivileges),t=Z.useAppSelector(Z.selectRoles),r=Z.useAppDispatch(),{selectedRole:n}=Yb(),i=Gk(n,t),o=(a,u)=>u&&u.privileges.includes(a.id);return C.jsxs("div",{className:"w-full border-b border-grey-900 p-4 ",children:[C.jsx("div",{className:"mb-4 flex items-center gap-x-5 text-white",children:C.jsx("h4",{className:"text-[13px] font-semibold ",children:"Privileges"})}),C.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[C.jsx("div",{"data-cy":"item=>Permisions",className:Ke("inline-flex items-center gap-1 space-x-1 rounded bg-primary-darker px-2 py-0.5 text-xs font-semibold italic text-white"),children:"guest"}),Object.values(e).filter(a=>o(a,i)&&a.privilege!=="guest").map((a,u)=>C.jsxs("div",{"data-cy":"item=>Permisions",className:Ke("inline-flex cursor-pointer items-center gap-1 space-x-1 rounded px-2 py-0.5",{"bg-primary-dark text-white":o(a,i),"bg-grey-300 text-grey-100":!o(a,i)}),onClick:()=>{const c=nD(i.id,a.id,t);r(Z.updateRoles(c))},children:[C.jsx("span",{className:"text-xs",children:a.privilege}),C.jsx("button",{className:"focus:outline-none",children:o(a,i)?C.jsx(ye.FdMinus,{className:"h-[14px] w-[14px]"}):C.jsx(ye.FdPlus,{className:"h-[14px] w-[14px]"})})]},u)),Object.values(e).filter(a=>!o(a,i)&&a.privilege!=="guest").map((a,u)=>C.jsxs("div",{"data-cy":"item=>Permisions",className:Ke("inline-flex cursor-pointer items-center gap-1 space-x-1 rounded px-2 py-0.5",{"bg-primary-dark text-white":o(a,i),"bg-grey-300 text-grey-100":!o(a,i)}),onClick:()=>{const c=nD(i.id,a.id,t);r(Z.updateRoles(c))},children:[C.jsx("span",{className:"text-xs",children:a.privilege}),C.jsx("button",{className:"text-white focus:outline-none",children:o(a,i)?C.jsx(ye.FdMinus,{className:"h-[14px] w-[14px]"}):C.jsx(ye.FdPlus,{className:"h-[14px] w-[14px]"})})]},u))]})]})},_Q=({children:e})=>C.jsx("div",{className:"h-full w-full",children:C.jsx("div",{className:"flex h-full w-full flex-1 items-center justify-center bg-grey-800",children:C.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4 py-4 text-grey-200",children:[C.jsx(ye.FdInfoBold,{className:"absolute -right-full h-10 w-10 translate-x-1"}),C.jsx("div",{className:"text-center text-sm",children:e})]})})}),Gb=(e,t,r,n=!1)=>{const i=e.applyTo,o=e.type===Z.EPermissionType.DATACLASS?"ds":i.split(".")[0],a={...t,...r},u=()=>({value:!n,inherited:!1,from:[],explicitly:!1}),c={read:u(),create:u(),update:u(),drop:u(),execute:u(),promote:u()},d=h=>{h.forEach(p=>{a[p]&&(a[p].resources.forEach(v=>{if(v.resource===i||v.resource===o){const m=Gb(e,t,{[p]:a[p]},n);Object.values(v.permissions).forEach(y=>{c[y.name].explicitly||(!c[y.name].from.includes(a[p].privilege)&&y.checked&&c[y.name].from.push(a[p].privilege),c[y.name].inherited=c[y.name].inherited||m[y.name].value||m[y.name].inherited)})}}),a[p].includes.length>0&&d(a[p].includes))})};if(Object.values(r).forEach(h=>{h.resources.forEach(p=>{p.resource===i&&Object.values(p.permissions).forEach(v=>{v.checked&&(c[v.name].explicitly=!0,n&&(c[v.name].value=!0))})}),(h.includes.length>0||h.privilege==="guest")&&d(h.includes)}),Object.values(t).forEach(h=>{h.resources.forEach(p=>{p.resource===i&&(h.privilege==="guest"?Object.values(p.permissions).forEach(v=>{v.checked&&(c[v.name].explicitly=!0,n&&(c[v.name].value=!0))}):Object.values(p.permissions).forEach(v=>{!c[v.name].explicitly&&v.checked&&(n?c[v.name].value=!0:c[v.name].value=!1)}))})}),(n?Object.entries(c).some(([h,p])=>h!=="promote"&&!p.value&&!p.explicitly):Object.entries(c).some(([h,p])=>h!=="promote"&&p.value&&!p.explicitly))&&![Z.EPermissionType.DATASTORE,Z.EPermissionType.SINGLETON].includes(e.type)){const h={applyTo:o,type:e.type===Z.EPermissionType.DATACLASS?Z.EPermissionType.DATASTORE:e.type===Z.EPermissionType.SINGLETON_METHOD?Z.EPermissionType.SINGLETON:Z.EPermissionType.DATACLASS},p=Gb(h,t,r,n),v=m=>{let y=c[m].value;return n?!c[m].value&&!c[m].explicitly&&(y=p[m].value):c[m].value&&!c[m].explicitly&&(y=p[m].value),{value:y,inherited:c[m].inherited||p[m].inherited,from:c[m].from.length>0?c[m].from:p[m].from,explicitly:c[m].explicitly}};return{read:v("read"),create:v("create"),update:v("update"),drop:v("drop"),execute:v("execute"),promote:v("promote")}}return{read:c.read,create:c.create,update:c.update,drop:c.drop,execute:c.execute,promote:c.promote}},EQ=e=>{switch(e){case"dataclass":return C.jsx(ye.FdTableHeader,{className:"h-6 w-6"});case"singleton":return C.jsx(ye.FdSingleton,{className:"h-6 w-6"});case"datastore":return C.jsx(ye.FdModel3,{className:"h-6 w-6"});case"attribute":return C.jsx(ye.FdTableColumn,{className:"h-6 w-6"});case"method":return C.jsx(ye.FdCode,{className:"h-6 w-6"});case"singletonMethod":return C.jsx(ye.FdFunctionSingleton,{className:"h-6 w-6"});case"entityselMethod":return C.jsx(ye.FdFunctionSelection,{className:"h-6 w-6"});case"entityMethod":return C.jsx(ye.FdFunctionEntity,{className:"h-6 w-6"});case"dsMethod":return C.jsx(ye.FdFunctionDatastore,{className:"h-6 w-6"});case"dataclassMethod":return C.jsx(ye.FdFunctionDataclass,{className:"h-6 w-6"});default:return C.jsx(ye.FdTableHeader,{className:"h-6 w-6"})}},ma=Hx,ya=Ux,co=({privileges:e,permission:t,hasChild:r,depth:n,isChild:i=!1,className:o,inSearch:a,toggleCollapse:u,collapsed:c,isRestrictedByDefault:d,toastMessageCallback:f})=>{const[h,p]=t.applyTo.split("."),v=A.useMemo(()=>Gb(t,e.otherPrivs,e.rolePrivs,d),[e,t,d]);return C.jsxs("tr",{className:Ke("group even:bg-grey-600",o),children:[C.jsxs("td",{className:Ke("flex h-full w-full items-center gap-3 p-0 text-xs group-hover:rounded-l group-hover:bg-grey-300",{"px-1":a}),children:[Array(n).fill("").map((m,y)=>C.jsx("div",{className:Ke("ml-1.5 mr-1 h-full w-0.5 border-l-2 border-grey-100",{"mr-0.5":i})},y)),r&&C.jsx("button",{onClick:u,className:"w-3",children:c?C.jsx(ye.FdRight,{className:"inline h-4 w-4"}):C.jsx(ye.FdDown,{className:"inline h-4 w-4"})}),EQ(t.type),a?t.applyTo:p||h]}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:[Z.EPermissionType.ATTRIBUTE,Z.EPermissionType.DATASTORE,Z.EPermissionType.DATACLASS].includes(t.type)&&C.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",children:[C.jsx("div",{className:Ke("h-4 w-4 rounded border-[2px] p-2",{"grid place-content-center border-grey-200 bg-grey-200":v.read.value||v.read.inherited}),onClick:f,children:(v.read.value||v.read.inherited)&&C.jsx(ye.FdCheckNaked,{className:"text-grey-50"})}),C.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!v.read.value&&v.read.inherited?C.jsxs(ma,{openDelay:0,closeDelay:0,children:[C.jsx(ya,{children:C.jsx(ye.FdInfoBold,{className:"h-4 w-4 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsx("div",{className:"space-y-1 px-2",children:v.read.from.length?C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdBulb,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),C.jsx("ul",{children:v.read.from.map((m,y)=>C.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},y))})]})]}):null})})})]}):""})]})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:[Z.EPermissionType.ATTRIBUTE,Z.EPermissionType.DATASTORE,Z.EPermissionType.DATACLASS].includes(t.type)&&C.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",children:[C.jsx("div",{className:Ke("h-4 w-4 rounded border-[2px] p-2",{"grid place-content-center border-grey-200 bg-grey-200":v.create.value||v.create.inherited}),onClick:f,children:(v.create.value||v.create.inherited)&&C.jsx(ye.FdCheckNaked,{className:"text-grey-50"})}),C.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!v.create.value&&v.create.inherited?C.jsxs(ma,{openDelay:0,closeDelay:0,children:[C.jsx(ya,{children:C.jsx(ye.FdInfoBold,{className:"h-4 w-4 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsx("div",{className:"space-y-1 px-2",children:v.create.from.length?C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdBulb,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),C.jsx("ul",{children:v.create.from.map((m,y)=>C.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},y))})]})]}):null})})})]}):""})]})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:[Z.EPermissionType.ATTRIBUTE,Z.EPermissionType.DATASTORE,Z.EPermissionType.DATACLASS].includes(t.type)&&C.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",children:[C.jsx("div",{className:Ke("h-4 w-4 rounded border-[2px] p-2",{"grid place-content-center border-grey-200 bg-grey-200":v.update.value||v.update.inherited}),onClick:f,children:(v.update.value||v.update.inherited)&&C.jsx(ye.FdCheckNaked,{className:"text-grey-50"})}),C.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!v.update.value&&v.update.inherited?C.jsxs(ma,{openDelay:0,closeDelay:0,children:[C.jsx(ya,{children:C.jsx(ye.FdInfoBold,{className:"h-4 w-4 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsx("div",{className:"space-y-1 px-2",children:v.update.from.length?C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdBulb,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),C.jsx("ul",{children:v.update.from.map((m,y)=>C.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},y))})]})]}):null})})})]}):""})]})}),C.jsx("td",{className:"py-2 text-center group-hover:bg-grey-300",children:[Z.EPermissionType.ATTRIBUTE,Z.EPermissionType.DATASTORE,Z.EPermissionType.DATACLASS].includes(t.type)&&C.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",children:[C.jsx("div",{className:Ke("h-4 w-4 rounded border-[2px] p-2",{"grid place-content-center border-grey-200 bg-grey-200":v.drop.value||v.drop.inherited}),onClick:f,children:(v.drop.value||v.drop.inherited)&&C.jsx(ye.FdCheckNaked,{className:"text-grey-50"})}),C.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!v.drop.value&&v.drop.inherited?C.jsxs(ma,{openDelay:0,closeDelay:0,children:[C.jsx(ya,{children:C.jsx(ye.FdInfoBold,{className:"h-4 w-4 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsx("div",{className:"space-y-1 px-2",children:v.drop.from.length?C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdBulb,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),C.jsx("ul",{children:v.drop.from.map((m,y)=>C.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},y))})]})]}):null})})})]}):""})]})}),C.jsx("td",{className:"py-2 text-center group-hover:rounded-r group-hover:bg-grey-300",children:t.type!=="attribute"&&C.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",children:[C.jsx("div",{className:Ke("h-4 w-4 rounded border-[2px] p-2",{"grid place-content-center border-grey-200 bg-grey-200":v.execute.value||v.execute.inherited}),onClick:f,children:(v.execute.value||v.execute.inherited)&&C.jsx(ye.FdCheckNaked,{className:"text-grey-50"})}),C.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!v.execute.value&&v.execute.inherited?C.jsxs(ma,{openDelay:0,closeDelay:0,children:[C.jsx(ya,{children:C.jsx(ye.FdInfoBold,{className:"h-4 w-4 text-white"})}),C.jsx(jr,{children:C.jsx(qr,{style:{zIndex:50},avoidCollisions:!0,side:"top",className:"max-w-xs rounded bg-primary-light py-2 text-sm font-semibold text-primary",children:C.jsx("div",{className:"space-y-1 px-2",children:v.execute.from.length?C.jsxs("div",{className:"flex items-start text-s",children:[C.jsx(ye.FdBulb,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),C.jsxs("p",{children:[C.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),C.jsx("ul",{children:v.execute.from.map((m,y)=>C.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},y))})]})]}):null})})})]}):""})]})})]})},iD=({depth:e,permission:t,privileges:r,childCollapsed:n,didChildCollapsed:i,toastMessageCallback:o})=>{const[a,u]=A.useState(n),c=Z.useAppSelector(Z.selectRestrictedByDefault),d=Z.useAppSelector(Z.selectPrivileges);return A.useEffect(()=>{n===!0&&u(!0)},[n]),C.jsxs(C.Fragment,{children:[C.jsx(co,{privileges:r,permission:t,isChild:!0,depth:e,hasChild:!0,toggleCollapse:()=>{const f=!a;u(f),i==null||i(f)},isRestrictedByDefault:c,allPrivileges:d,collapsed:a,toastMessageCallback:o}),!a&&C.jsxs(C.Fragment,{children:[t.attributes.map((f,h)=>C.jsx(co,{privileges:r,permission:f,depth:e+1,isRestrictedByDefault:c,allPrivileges:d,toastMessageCallback:o},`${f.type}-${h}`)),t.methods.map((f,h)=>C.jsx(co,{privileges:r,permission:f,depth:e+1,isRestrictedByDefault:c,allPrivileges:d,toastMessageCallback:o},`${f.type}-${h}`))]})]})},SQ=({selectedRole:e})=>{const[t,r]=A.useState(null),[n,i]=A.useState(null),{styles:o,attributes:a}=wc(t,n,{modifiers:[{name:"offset",options:{offset:[0,10]}}]}),u=Z.useAppSelector(Z.selectRestrictedByDefault),c=Z.useAppSelector(Z.selectPrivileges),[d,f]=A.useState([]),[h,p]=A.useState(""),v=Z.useAppSelector(Z.selectCatalogMethods),m=Z.useAppSelector(Z.selectDataclasses),y=Z.useAppSelector(Z.selectSingletons),[b,x]=A.useState({}),[w,S]=A.useState([]);A.useEffect(()=>{const B=g9(v,Object.values(m),Object.values(y));x(B)},[e]);function E(B){const $=["datastore","singleton","dataclass","attribute","dsMethod","dataclassMethod","entityMethod","entityselMethod","singletonMethod"];return B.sort((W,Y)=>{const ee=$.indexOf(W.type),H=$.indexOf(Y.type);return ee!==H?ee-H:W.applyTo.toLowerCase()>Y.applyTo.toLowerCase()?1:-1})}A.useEffect(()=>{S(E(Ax(h,v,Object.values(m),Object.values(y)).filter(B=>d.length?d.includes(B.type):!0)))},[d,h]);const[_,R]=A.useState(!1),P=B=>{f($=>$.some(W=>B.includes(W))?$.filter(W=>!B.includes(W)):[...$,...B])},N=Z.useAppSelector(Z.selectRoles),j={toggleAllCollapsed:B=>{B.allCollapsed=!B.allCollapsed},toggleChildCollapsed:B=>{B.childCollapsed=!B.childCollapsed},setAllCollapsed:(B,$)=>{B.allCollapsed=$},setChildCollapsed:(B,$)=>{B.childCollapsed=$}},L=A.useMemo(()=>{const B=Object.values(c).find(H=>H.privilege==="guest"),$=N[e],W=$?Object.fromEntries($.privileges.map(H=>[H,c[H]]).filter(([,H])=>!!H)):{};if(u)return{rolePrivs:W,otherPrivs:B?{[B.id]:B}:{}};const Y=B?{[B.id]:{...B,active:!0}}:{},ee=Object.fromEntries(Object.entries(c).filter(([H])=>H!==(B==null?void 0:B.id)&&!($!=null&&$.privileges.includes(H))).map(([H,Q])=>[H,{...Q,active:!1}]));return{rolePrivs:W,otherPrivs:{...Y,...ee}}},[c,N,e,u]),{state:{allCollapsed:F,childCollapsed:k},dispatch:D}=nt.useEnhancedState({allCollapsed:!1,childCollapsed:!1},j,"Table Collapse Store"),T=()=>{nt.toastSubject.next({kind:"info",markdown:!0,message:'<div className="flex gap-x-1 items-center"><h3 className="font-bold mr-1">Info:</h3><p className="font-normal">You can add or modify permissions only in the Privilege section.</p></div>',customIcon:ye.FdInfoCircle})};return C.jsxs(fl,{className:"z-20 h-full flex-1 overflow-auto bg-grey-800 p-[15px] pt-0",style:{maxHeight:"calc(100vh - 5.5rem - 85px - 20px)"},children:[C.jsxs("table",{className:"relative h-full w-full",children:[C.jsx("thead",{className:"sticky top-0 z-20 bg-grey-800",children:C.jsxs("tr",{className:"border-b border-grey-100",children:[C.jsx("td",{className:"py-2",children:C.jsxs("div",{className:"flex items-center space-x-2",children:[C.jsx(nt.FloatingTooltip,{message:"Collapse All",side:"top",children:C.jsx("button",{onClick:()=>{k?(D.setAllCollapsed(!0),R(!0)):D.setChildCollapsed(!0)},className:Ke("cursor-pointer rounded-md p-1 hover:bg-primary-hover focus:outline-none",{"pointer-events-none text-grey-200":F,"text-white":!F}),children:C.jsx(ye.FdCollapseAll,{className:"h-4 w-4"})})}),C.jsxs("div",{className:"relative w-56 text-white",children:[C.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center px-1",children:C.jsx(ye.FdSearch,{className:"h-4 w-4 text-gray-400"})}),C.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center px-2",children:C.jsx(wr.Popover,{className:"flex items-center",children:({open:B})=>C.jsxs(C.Fragment,{children:[C.jsx(wr.Popover.Button,{ref:r,children:C.jsx(ye.FdAdjust,{className:"h-4 w-4"})}),B&&bo.createPortal(C.jsx(C.Fragment,{children:C.jsxs(wr.Popover.Panel,{ref:i,style:o.popper,...a.popper,className:"z-50 rounded-md border border-grey-50 bg-grey-900 px-4 py-2.5 text-xs text-grey-50",static:!0,children:[C.jsx("h5",{className:"mb-2 text-sm",children:"Filter"}),C.jsxs("div",{className:"space-y-2",children:[C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{colorScheme:"primary",isChecked:d.includes("datastore"),onChange:()=>{P(["datastore"])}}),C.jsx("span",{children:"Datastore"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{colorScheme:"primary",isChecked:d.includes("dataclass"),onChange:()=>{P(["dataclass"])}}),C.jsx("span",{children:"Dataclass"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{colorScheme:"primary",isChecked:d.includes("singleton"),onChange:()=>{P(["singleton"])}}),C.jsx("span",{children:"Singleton"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{isChecked:d.some($=>["method","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"].includes($)),onChange:()=>{P(["method","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"])},colorScheme:"primary"}),C.jsx("span",{children:"Functions"})]}),C.jsxs("label",{className:"flex items-center space-x-2",children:[C.jsx(Ct.Checkbox,{colorScheme:"primary",isChecked:d.includes("attribute"),onChange:()=>{P(["attribute"])}}),C.jsx("span",{children:"Attribute"})]})]})]})}),document.body)]})})}),C.jsx("input",{type:"text",className:"block h-6 w-full rounded bg-grey-300 px-1 py-1.5 pl-6 text-xs focus:outline-none",placeholder:"Search",value:h,onChange:B=>{p(B.target.value)}})]})]})}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"read"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Create"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Update"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Delete"}),C.jsx("td",{className:"bg-grey-800 px-4 py-2 text-center text-[12px] text-white",children:"Execute"})]})}),C.jsx("tbody",{className:"relative bg-grey-800 text-white",children:d.length||h?w.map((B,$)=>C.jsx(co,{privileges:L,permission:B,depth:0,inSearch:!0,isRestrictedByDefault:u,allPrivileges:c,toastMessageCallback:T},`${B.type}-${$}`)):Object.values(b).map((B,$)=>C.jsxs(A.Fragment,{children:[C.jsx(co,{privileges:L,permission:B,isRestrictedByDefault:u,allPrivileges:c,hasChild:!0,depth:0,toggleCollapse:()=>{const W=!_;R(W),D.setAllCollapsed(!W&&F?!1:F)},collapsed:_,toastMessageCallback:T}),B.type==="datastore"&&!_?C.jsxs(C.Fragment,{children:[B.methods.map((W,Y)=>C.jsx(co,{privileges:L,isRestrictedByDefault:u,allPrivileges:c,permission:W,depth:1,collapsed:F||!1,toastMessageCallback:T},`${W.type}-${Y}`)),B.dataClasses.map((W,Y)=>C.jsx(iD,{depth:1,privileges:L,permission:W,childCollapsed:k,didChildCollapsed:ee=>{D.setChildCollapsed(ee?k:!1)},toastMessageCallback:T},`${W.type}-${Y}`))]}):null,B.singletons.map((W,Y)=>C.jsx(iD,{depth:0,privileges:L,permission:W,childCollapsed:F,didChildCollapsed:ee=>{D.setAllCollapsed(ee?F:!1)},toastMessageCallback:T},`${W.type}-${Y}`))]},`${B.type}-${$}`))})]}),(h||d.length)&&!w.length?C.jsx(_Q,{children:"The Permission you're looking for can't be found "}):null]})},OQ=()=>{const e=Z.useAppSelector(Z.selectRoles),t=Z.useAppDispatch(),[r,n]=A.useState(null),[i,o]=A.useState(null),[a,u]=A.useState(""),[c,d]=A.useState(null),{styles:f,attributes:h}=wc(r,i,{modifiers:[{name:"offset",options:{offset:[-10,10]}}],placement:"right-start"});A.useEffect(()=>{u(""),d(null)},[i]);const p=()=>{if(!a)throw new Error("Please enter a valid name");if(Object.values(e).find(b=>b.role===a))throw new Error(`A role with the name ${a} already exists`);const m=bQ.generate(),y=Z.createRole(m,a,e);t(Z.updateRoles(y))};return C.jsx(wr.Popover,{children:({open:v,close:m})=>{const y=()=>{d(null);try{p(),m()}catch(b){d(b.message)}};return C.jsxs(C.Fragment,{children:[C.jsx(wr.Popover.Button,{className:"rounded p-1 hover:bg-primary-hover","data-cy":"New-priv-btn",ref:n,children:C.jsx("span",{children:C.jsx(ye.FdPlus,{className:"h-4 w-4 text-white"})})}),v&&bo.createPortal(C.jsx(C.Fragment,{children:C.jsxs(wr.Popover.Panel,{ref:o,style:f.popper,...h.popper,"data-cy":"New-priv-pop-up",className:"z-50 min-w-[256px] rounded border border-grey-50 bg-grey-900 px-4 py-2 text-xs text-grey-50 shadow-md",static:!0,children:[C.jsx("h5",{className:"mb-2 text-xs font-semibold",children:"Create New Role"}),C.jsxs("div",{className:"mt-2",children:[C.jsxs("label",{className:"flex items-center space-x-4",children:[C.jsx("span",{className:"text-grey-100",children:"Name"}),C.jsx("input",{autoFocus:!0,value:a,onChange:b=>u(b.target.value),onKeyDown:b=>{b.key==="Enter"&&y()},type:"text",className:Ke("w-full rounded border bg-grey-300 p-1 focus:outline-none",{"border-grey-100":!c,"border-red-400":c})})]}),c&&C.jsx("p",{className:"mt-1 text-xs text-red-400",children:c})]}),C.jsxs("div",{className:"mt-4 flex items-center justify-center space-x-2",children:[C.jsx("button",{className:"rounded border border-primary-dark bg-primary-dark px-4 py-1 hover:border-primary-hover hover:bg-primary-hover",onClick:()=>{y()},children:"Create"}),C.jsx("button",{className:"rounded border border-grey-100 px-4 py-1 text-grey-100 hover:bg-white hover:text-primary-dark",onClick:()=>m(),children:"Cancel"})]})]})}),document.body)]})}})},CQ=()=>{const e=Z.useAppSelector(Z.selectRoles),{selectedRole:t}=Yb();return C.jsxs("div",{className:"flex flex-1 h-full",children:[C.jsxs("div",{className:"flex h-full w-[356px] flex-col bg-grey-800",children:[C.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between bg-grey-800 px-3.5 py-[10px]",children:[C.jsxs("div",{className:"flex items-center space-x-1 text-[#DDE1E6]",children:[C.jsx("span",{children:C.jsx(ye.FdGroup,{className:"h-[14px] w-[14px]"})}),C.jsx("span",{className:"text-[11px] font-semibold",children:"Roles"})]}),C.jsx(OQ,{})]}),C.jsx("div",{className:"flex-1 space-y-4 overflow-auto p-4 pb-10 pt-1",children:Object.values(e).map((r,n)=>C.jsx(xQ,{role:r},n))})]}),C.jsx("div",{className:"relative flex h-full w-full flex-1 flex-col items-stretch overflow-x-auto border-l-[0.5px] border-grey-900 bg-grey-800",children:C.jsx("div",{className:"flex h-full w-full select-none flex-col bg-grey-800",children:t?C.jsxs(C.Fragment,{children:[C.jsx(wQ,{}),C.jsx(SQ,{selectedRole:t})]}):C.jsx(gD,{tab:"Role"})})})]})};function Kk(){const e=Z.useAppSelector(Z.selectRolesFlags),t=Z.useAppDispatch();A.useEffect(()=>{t(Z.setTabFlags({path:nt.ROLES_TAB_PATH,flags:e}))},[e])}const Yk=()=>{const e=Z.useAppSelector(Z.selectQodly),t=Z.useAppSelector(Z.selectSelectedTab),r=Z.useAppSelector(Z.selectForceLogin),n=Z.useAppSelector(Z.selectRestrictedByDefault),i=A.useRef(),o=Z.useAppDispatch();return Kk(),C.jsx(Ct.ChakraProvider,{theme:Kz,children:C.jsx("div",{className:"absolute inset-0 flex flex-1 overflow-hidden",children:C.jsx("div",{className:"relative flex flex-1 overflow-x-auto bg-grey-900","data-cy":"Roles&Privileges-editor-cy",ref:a=>i.current=a,children:C.jsxs("div",{className:"flex w-full flex-col",children:[C.jsx(Zz,{activeTab:t,forceLogin:r,restrictedByDefault:n,onTabChange:a=>{o(Z.toggleTab(a))},onForceLoginChange:a=>{o(Z.toggleForceLogin(a))},onRestrictedByDefaultChange:a=>{o(Z.toggleRestrictedByDefault(a))},qodly:e}),t==="roles"?C.jsx(Jz,{children:C.jsx(CQ,{})}):C.jsx(nQ,{})]})})})})},RQ=()=>{const e=Z.useAppSelector(Z.selectModals),t=Z.useAppDispatch();return C.jsx(C.Fragment,{children:e.map((r,n)=>C.jsx(nt.Modal,{hasOverlay:n===0,...r,onClose:i=>t(Z.closeModal(i)),onEdit:i=>t(Z.editModal(i))},r.id))})},PQ=()=>C.jsxs(Z.ReduxProvider,{store:Z.getStore(),children:[C.jsx(nt.TipsProvider,{children:C.jsx("div",{className:"qodly-roles-editor",children:C.jsx("div",{className:"relative z-10 overflow-hidden",style:{height:"100vh"},children:C.jsx(Yk,{})})})}),C.jsx(RQ,{})]});exports.Roles=Yk;exports.Standalone=PQ;exports.useRolesFlagsSync=Kk;
72
72
  //# sourceMappingURL=index.cjs.js.map