try{!function(){var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="c7b99b52-655c-4658-a77b-d3c1468db038",e._sentryDebugIdIdentifier="sentry-dbid-c7b99b52-655c-4658-a77b-d3c1468db038")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3291],{24965:(e,s,t)=>{t.d(s,{Z:()=>c,d:()=>d});var r=t(95155),a=t(12115),n=t(80139),o=t(34319);let i=(0,a.createContext)(void 0),l={permissionErrors:[],permissionChecks:[],isPanelOpen:!1,unreadErrorCount:0,reportPermissionCheck:()=>{},togglePanel:()=>{},openPanel:()=>{},closePanel:()=>{},markErrorsAsRead:()=>{},clearErrors:()=>{},clearChecks:()=>{}};function c({children:e,userFeatures:s}){let[t,l]=(0,a.useState)([]),[c,d]=(0,a.useState)([]),[u,x]=(0,a.useState)(!1),[f,m]=(0,a.useState)(0),p=(0,a.useRef)(0),b=function(e){if(!e)return!1;let s=(0,o.H7)()?n.Gv.BO.RBAC_DEBUG_MONITOR:n.Gv.FG.RBAC_DEBUG_MONITOR;return(0,n.jI)(e,s)}(s);(0,a.useEffect)(()=>{if(!b)return;let e=e=>{let s={id:`error-${++p.current}`,timestamp:Date.now(),url:e.detail.url,errorMessage:e.detail.errorMessage,requiredPermission:e.detail.requiredPermission};l(e=>[s,...e].slice(0,50)),m(e=>e+1)};return window.addEventListener("permission-error",e),()=>window.removeEventListener("permission-error",e)},[b]);let y=(0,a.useCallback)(e=>{if(!b)return;let s={...e,id:`check-${++p.current}`,timestamp:Date.now()};d(e=>[s,...e].slice(0,100))},[b]),h=(0,a.useCallback)(()=>{x(e=>!e)},[]),N=(0,a.useCallback)(()=>{x(!0),m(0)},[]),g=(0,a.useCallback)(()=>{x(!1)},[]),T=(0,a.useCallback)(()=>{m(0)},[]),S=(0,a.useCallback)(()=>{l([]),m(0)},[]),E=(0,a.useCallback)(()=>{d([])},[]);return(0,r.jsx)(i.Provider,{value:{permissionErrors:t,permissionChecks:c,isPanelOpen:u,unreadErrorCount:f,reportPermissionCheck:y,togglePanel:h,openPanel:N,closePanel:g,markErrorsAsRead:T,clearErrors:S,clearChecks:E},children:e})}function d(){return(0,a.useContext)(i)??l}},42400:(e,s,t)=>{t.d(s,{Ck:()=>n,P0:()=>o});var r,a=t(66609),n=((r={}).Success="success",r.Error="error",r.Warning="warning",r.Info="info",r.Loading="loading",r);function o(e,s="info"){switch(s){case"success":return a.oR.success(e);case"error":return a.oR.error(e);case"warning":return a.oR.warning(e);case"loading":return a.oR.loading(e);default:return a.oR.info(e)}}},48319:(e,s,t)=>{t.d(s,{y:()=>v});var r=t(95155),a=t(62791),n=t(52484),o=t(68459),i=t(439),l=t(33210),c=t(41585),d=t(12115),u=t(80139),x=t(59319),f=t(92281),m=t(96488),p=t(92093),b=t(34319),y=t(24965);function h({active:e,onClick:s,children:t}){return(0,r.jsx)("button",{onClick:s,className:(0,p.cn)("px-3 py-2 text-xs font-medium transition-colors",e?"border-b-2 border-sys-border-brand-primary text-sys-text-brand-primary":"text-sys-text-default-secondary hover:text-sys-text-default-primary"),children:t})}function N({error:e}){let s=new Date(e.timestamp).toLocaleTimeString();return(0,r.jsxs)("div",{className:"border-b border-sys-border-default-secondary p-2 last:border-b-0",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(a.A,{className:"h-3.5 w-3.5 shrink-0 text-sys-text-negative-primary"}),(0,r.jsx)("span",{className:"text-xs font-medium text-sys-text-negative-primary",children:"403"})]}),(0,r.jsx)("span",{className:"text-xs text-sys-text-default-tertiary",children:s})]}),(0,r.jsxs)("div",{className:"mt-1 space-y-1 text-xs",children:[e.requiredPermission&&(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-sys-text-default-secondary",children:"Permission: "}),(0,r.jsx)("code",{className:"rounded bg-sys-bg-muted-default px-1 font-mono text-sys-text-warning-primary",children:e.requiredPermission})]}),e.errorMessage&&(0,r.jsx)("div",{className:"text-sys-text-default-secondary",children:e.errorMessage}),(0,r.jsx)("div",{className:"truncate text-sys-text-default-tertiary",title:e.url,children:e.url})]})]})}function g({check:e}){let s=new Date(e.timestamp).toLocaleTimeString();return(0,r.jsxs)("div",{className:"border-b border-sys-border-default-secondary p-2 last:border-b-0",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[e.result?(0,r.jsx)(n.A,{className:"h-3.5 w-3.5 shrink-0 text-sys-text-positive-primary"}):(0,r.jsx)(a.A,{className:"h-3.5 w-3.5 shrink-0 text-sys-text-negative-primary"}),(0,r.jsx)("span",{className:"text-xs font-medium text-sys-text-default-primary",children:e.componentName})]}),(0,r.jsx)("span",{className:"text-xs text-sys-text-default-tertiary",children:s})]}),(0,r.jsxs)("div",{className:"mt-1 space-y-1 text-xs",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-sys-text-default-secondary",children:"Mode: "}),(0,r.jsx)(f.E,{variant:"label",className:"h-4 px-1 text-[10px]",children:e.mode.toUpperCase()})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:e.permissions.map(s=>(0,r.jsx)("code",{className:(0,p.cn)("rounded px-1 font-mono text-[10px]",e.result?"bg-sys-bg-positive-subtle text-sys-text-positive-primary":"bg-sys-bg-negative-subtle text-sys-text-negative-primary"),children:s},s))})]})]})}function T({permissions:e}){let[s,t]=(0,d.useState)(""),a=e.filter(e=>e.toLowerCase().includes(s.toLowerCase()));return(0,r.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,r.jsx)("div",{className:"border-b border-sys-border-default-secondary p-2",children:(0,r.jsx)("input",{type:"text",placeholder:"Filter permissions...",value:s,onChange:e=>t(e.target.value),className:"w-full rounded border border-sys-border-default-secondary bg-sys-bg-surface-default px-2 py-1 text-xs focus:border-sys-border-brand-primary focus:outline-none"})}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:0===a.length?(0,r.jsx)("div",{className:"py-4 text-center text-xs text-sys-text-default-tertiary",children:0===e.length?"No permissions found":"No matching permissions"}):(0,r.jsx)("div",{className:"space-y-1",children:a.map(e=>(0,r.jsx)("code",{className:"block rounded bg-sys-bg-muted-default px-2 py-1 font-mono text-xs text-sys-text-default-secondary",children:e},e))})}),(0,r.jsxs)("div",{className:"border-t border-sys-border-default-secondary p-2 text-xs text-sys-text-default-tertiary",children:[a.length," of ",e.length," permissions"]})]})}function S({features:e}){let[s,t]=(0,d.useState)(""),a=e.includes("*"),o=e.filter(e=>e.toLowerCase().includes(s.toLowerCase()));return(0,r.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,r.jsx)("div",{className:"border-b border-sys-border-default-secondary p-2",children:(0,r.jsx)("input",{type:"text",placeholder:"Filter features...",value:s,onChange:e=>t(e.target.value),className:"w-full rounded border border-sys-border-default-secondary bg-sys-bg-surface-default px-2 py-1 text-xs focus:border-sys-border-brand-primary focus:outline-none"})}),a&&(0,r.jsx)("div",{className:"border-b border-sys-border-default-secondary bg-sys-bg-positive-subtle p-2",children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-sys-text-positive-primary",children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{className:"font-medium",children:"Admin - All features enabled (*)"})]})}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:0===o.length?(0,r.jsx)("div",{className:"py-4 text-center text-xs text-sys-text-default-tertiary",children:0===e.length?"No features found":"No matching features"}):(0,r.jsx)("div",{className:"space-y-1",children:o.map(e=>(0,r.jsx)("code",{className:(0,p.cn)("block rounded px-2 py-1 font-mono text-xs","*"===e?"bg-sys-bg-positive-subtle text-sys-text-positive-primary":"bg-sys-bg-muted-default text-sys-text-default-secondary"),children:e},e))})}),(0,r.jsxs)("div",{className:"border-t border-sys-border-default-secondary p-2 text-xs text-sys-text-default-tertiary",children:[o.length," of ",e.length," features",a&&" (admin has all)"]})]})}function E({errors:e,onClear:s}){return 0===e.length?(0,r.jsxs)("div",{className:"flex h-full flex-col items-center justify-center p-8 text-center",children:[(0,r.jsx)(n.A,{className:"mb-2 h-8 w-8 text-sys-text-positive-primary"}),(0,r.jsx)("p",{className:"text-sm text-sys-text-default-secondary",children:"No permission errors"}),(0,r.jsx)("p",{className:"text-xs text-sys-text-default-tertiary",children:"403 errors from API calls will appear here"})]}):(0,r.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,r.jsx)("div",{className:"flex justify-end border-b border-sys-border-default-secondary p-1",children:(0,r.jsxs)(m.$,{variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:s,children:[(0,r.jsx)(o.A,{className:"mr-1 h-3 w-3"}),"Clear"]})}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.map(e=>(0,r.jsx)(N,{error:e},e.id))})]})}function _({checks:e,onClear:s}){return 0===e.length?(0,r.jsxs)("div",{className:"flex h-full flex-col items-center justify-center p-8 text-center",children:[(0,r.jsx)(i.A,{className:"mb-2 h-8 w-8 text-sys-text-default-tertiary"}),(0,r.jsx)("p",{className:"text-sm text-sys-text-default-secondary",children:"No permission checks"}),(0,r.jsx)("p",{className:"text-xs text-sys-text-default-tertiary",children:"Component permission checks will appear here"})]}):(0,r.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,r.jsx)("div",{className:"flex justify-end border-b border-sys-border-default-secondary p-1",children:(0,r.jsxs)(m.$,{variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:s,children:[(0,r.jsx)(o.A,{className:"mr-1 h-3 w-3"}),"Clear"]})}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.map(e=>(0,r.jsx)(g,{check:e},e.id))})]})}function v(){var e;let s,{user:t}=(0,x.A)(),{permissionErrors:a,permissionChecks:n,isPanelOpen:o,togglePanel:N,closePanel:g,unreadErrorCount:v,markErrorsAsRead:A,clearErrors:R,clearChecks:j}=(0,y.d)(),[I,C]=(0,d.useState)("errors");return(e=t?.features,s=(0,b.H7)()?u.Gv.BO.RBAC_DEBUG_MONITOR:u.Gv.FG.RBAC_DEBUG_MONITOR,(0,u.jI)(e,s))?o?(0,r.jsxs)("div",{className:"fixed bottom-16 left-4 z-50 flex h-[450px] w-[400px] flex-col overflow-hidden rounded-lg border border-sys-border-default-secondary bg-zinc-900 shadow-xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-sys-border-default-secondary bg-zinc-800 px-4 py-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(i.A,{className:"h-4 w-4 text-sys-text-warning-primary"}),(0,r.jsx)("span",{className:"text-sm font-semibold",children:"RBAC Debug Panel"}),(0,r.jsx)(f.E,{variant:"label",className:"h-4 px-1 text-[10px]",children:"Feature"})]}),(0,r.jsx)(m.$,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:g,children:(0,r.jsx)(l.A,{className:"h-4 w-4"})})]}),(0,r.jsxs)("div",{className:"flex border-b border-sys-border-default-secondary",children:[(0,r.jsx)(h,{active:"errors"===I,onClick:()=>C("errors"),children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(c.A,{className:"h-3 w-3"}),"Errors (",a.length,")"]})}),(0,r.jsxs)(h,{active:"checks"===I,onClick:()=>C("checks"),children:["Checks (",n.length,")"]}),(0,r.jsxs)(h,{active:"user"===I,onClick:()=>C("user"),children:["Perms (",t?.permissions?.length||0,")"]}),(0,r.jsxs)(h,{active:"features"===I,onClick:()=>C("features"),children:["Features (",t?.features?.length||0,")"]})]}),(0,r.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:["errors"===I&&(0,r.jsx)(E,{errors:a,onClear:R}),"checks"===I&&(0,r.jsx)(_,{checks:n,onClear:j}),"user"===I&&(0,r.jsx)(T,{permissions:t?.permissions||[]}),"features"===I&&(0,r.jsx)(S,{features:t?.features||[]})]})]}):(0,r.jsxs)("button",{onClick:function(){N(),o||A()},className:(0,p.cn)("fixed bottom-16 left-4 z-50 flex items-center gap-2 rounded-full border px-3 py-2 shadow-lg transition-colors","border-sys-border-default-secondary bg-sys-bg-surface-default hover:bg-sys-bg-muted-default",v>0&&"ring-2 ring-sys-border-negative-primary"),title:"RBAC Debug Panel (Dev Only)",children:[(0,r.jsx)(i.A,{className:"h-4 w-4 text-sys-text-warning-primary"}),(0,r.jsx)("span",{className:"text-xs font-medium",children:"RBAC"}),v>0&&(0,r.jsx)(f.E,{className:"ml-1 h-5 min-w-5 bg-sys-bg-negative-primary px-1.5 text-white",children:v})]}):null}},65148:(e,s,t)=>{t.d(s,{y:()=>n});var r=t(37780);class a extends r.W{async listReports(){return this.typedGet("/reports",{},"Failed to list reports")}async getReportSchema(e){return this.typedGet(`/reports/${encodeURIComponent(e)}/schema`,{},`Failed to get schema for report: ${e}`)}async queryReport(e){return this.typedPost("/reports/query",e,`Failed to query report: ${e.report}`,{timeout:6e4})}async exportReport(e){return this.typedPost("/reports/export",e,`Failed to export report: ${e.report}`,{timeout:12e4})}async getExportStatus(e){return this.typedGet(`/reports/export-status/${encodeURIComponent(e)}`,{},`Failed to get export status: ${e}`)}async executeReport(e,s,t){return this.queryReport({report:e,filters:s,options:t})}}let n=new a},80139:(e,s,t)=>{t.d(s,{Gv:()=>r,WA:()=>a,fD:()=>i,jI:()=>n,rE:()=>o});let r={BO:{USER_MANAGEMENT:"feature.bo.user_management",DATA_CENTER:"feature.bo.data_center",MANAGER_ASSIGNMENTS:"feature.bo.manager_assignments",CONTRACTS:"feature.bo.contracts",PAYMENTS:"feature.bo.payments",ACTIVITY_MANAGEMENT:"feature.bo.activity_management",ACCOUNTING:"feature.bo.accounting",AUDIT_LOG:"feature.bo.audit_log",AUDIT_LOG_AUTH_EVENTS:"feature.bo.audit_log.auth_events",SETTINGS:"feature.bo.settings",ORG_DASHBOARD:"feature.bo.org.dashboard",ORG_OVERVIEW:"feature.bo.org.overview",ORG_LINKS:"feature.bo.org.links",ORG_CONTRACTS:"feature.bo.org.contracts",ORG_ACTIVITIES:"feature.bo.org.activities",ORG_BANNERS:"feature.bo.org.banners",ORG_VERIFICATION:"feature.bo.org.verification",ORG_NOTES:"feature.bo.org.notes",DATA_CENTER_OVERVIEW:"feature.bo.data_center.overview",DATA_CENTER_PERFORMANCE:"feature.bo.data_center.performance",DATA_CENTER_REPORTS:"feature.bo.data_center.reports",PAYMENTS_PENDING:"feature.bo.payments.pending",PAYMENTS_APPROVED:"feature.bo.payments.approved",PAYMENTS_HISTORY:"feature.bo.payments.history",SETTINGS_COUNTRIES:"feature.bo.settings.countries",SETTINGS_BRANDS:"feature.bo.settings.brands",SETTINGS_PAYMENTS:"feature.bo.settings.payments",SETTINGS_APPROVALS:"feature.bo.settings.approvals",SETTINGS_TESTIMONIALS:"feature.bo.settings.testimonials",SETTINGS_TIMERS:"feature.bo.settings.timers",SETTINGS_TRACKERS:"feature.bo.settings.trackers",SETTINGS_RBAC:"feature.bo.settings.rbac",SETTINGS_PORTALS:"feature.bo.settings.portals",SETTINGS_CORS:"feature.bo.settings.cors",SETTINGS_VERIFICATION:"feature.bo.settings.verification",SETTINGS_AUTH:"feature.bo.settings.auth",SETTINGS_AUTH_CONFIG:"feature.bo.settings.auth.config",SETTINGS_AUTH_TEMPLATES:"feature.bo.settings.auth.templates",SETTINGS_RBAC_USERS:"feature.bo.settings.rbac.users",SETTINGS_RBAC_GROUPS:"feature.bo.settings.rbac.groups",SETTINGS_RBAC_POLICIES:"feature.bo.settings.rbac.policies",SETTINGS_RBAC_PERMISSIONS:"feature.bo.settings.rbac.permissions",SETTINGS_NOTE_CATEGORIES:"feature.bo.settings.note_categories",SETTINGS_EXPORT:"feature.bo.settings.export",SETTINGS_API_KEYS:"feature.bo.settings.api_keys",SETTINGS_APP_TRANSLATION:"feature.bo.settings.app_translation",SETTINGS_PAYMENTS_METHODS:"feature.bo.settings.payments.methods",SETTINGS_PAYMENTS_BANKS:"feature.bo.settings.payments.banks",SETTINGS_PAYMENTS_CRYPTO:"feature.bo.settings.payments.crypto",SETTINGS_PAYMENTS_APPS:"feature.bo.settings.payments.apps",SETTINGS_PAYMENTS_PROCESSORS:"feature.bo.settings.payments.processors",SETTINGS_PAYMENTS_COUNTRIES:"feature.bo.settings.payments.countries",SETTINGS_PAYMENTS_CURRENCIES:"feature.bo.settings.payments.currencies",SETTINGS_PAYMENTS_LIMITS:"feature.bo.settings.payments.limits",SETTINGS_PAYMENTS_VALIDATION:"feature.bo.settings.payments.validation",RBAC_DEBUG_MONITOR:"feature.bo.rbac_debug_monitor",SUPPORT:"feature.bo.support",SUPPORT_DASHBOARD:"feature.bo.support.dashboard",SUPPORT_TICKETS:"feature.bo.support.tickets",SUPPORT_QUEUE:"feature.bo.support.queue",SUPPORT_KB:"feature.bo.support.knowledge_base",SUPPORT_SETTINGS:"feature.bo.support.settings",SUPPORT_FLOWS:"feature.bo.support.flows",SUPPORT_AGENTS:"feature.bo.support.agents",SUPPORT_BOT_PERSONAS:"feature.bo.support.bot_personas",ORG_SUPPORT:"feature.bo.org.support",AI_HELPERS:"feature.bo.ai_helpers"},FG:{DASHBOARD:"feature.fg.dashboard",DATA_CENTER:"feature.fg.data_center",INVITED_PLAYERS:"feature.fg.invited_players",REFERRALS:"feature.fg.referrals",PAYMENTS:"feature.fg.payments",ACTIVITIES:"feature.fg.activities",RBAC_DEBUG_MONITOR:"feature.fg.rbac_debug_monitor",SUPPORT_CHAT:"feature.fg.support_chat"}};function a(e,s){return!e||0===e.length||e.includes(s)}function n(e,s,t){return!!e&&0!==e.length&&!!a(t,s)&&(!!e.includes("*")||e.includes(s))}function o(e,s,t){if(!e||0===e.length)return!1;let r=s.filter(e=>a(t,e));return 0!==r.length&&(!!e.includes("*")||r.some(s=>e.includes(s)))}function i(e,s,t){return!!e&&0!==e.length&&!!s.every(e=>a(t,e))&&(!!e.includes("*")||s.every(s=>e.includes(s)))}}}]);