@e-llm-studio/instant-learning 0.1.1-alpha.54 → 0.1.1-alpha.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/cjs/features/LearningManagement/LearningManagement.js +1 -1
  2. package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js +1 -1
  3. package/dist/cjs/features/LearningManagement/RBAC/AccessManagementPanel.js +2 -0
  4. package/dist/cjs/features/LearningManagement/RBAC/AccessManagementPanel.js.map +1 -0
  5. package/dist/cjs/features/LearningManagement/RBAC/AccessPanel.js +1 -1
  6. package/dist/cjs/features/LearningManagement/RBAC/AccessPanel.module.css.js +1 -1
  7. package/dist/cjs/features/LearningManagement/RuleContent/AddScopeModal.js +1 -1
  8. package/dist/cjs/features/LearningManagement/RuleContent/ApprovalLearningDialog.js +1 -1
  9. package/dist/cjs/features/LearningManagement/RuleContent/RuleContent.js +1 -1
  10. package/dist/cjs/features/LearningManagement/RuleContent/VariantCard.js +1 -1
  11. package/dist/cjs/features/LearningManagement/apis/apiConfig.js +1 -1
  12. package/dist/cjs/features/LearningManagement/apis/scopeApis.js +1 -1
  13. package/dist/cjs/features/LearningManagement/assets/Search-result(add new).svg.js +2 -0
  14. package/dist/cjs/features/LearningManagement/assets/Search-result(add new).svg.js.map +1 -0
  15. package/dist/cjs/features/LearningManagement/components/CreateLearningSetModal.js +1 -1
  16. package/dist/cjs/features/LearningManagement/components/EmptyLearningState.js +1 -1
  17. package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js +1 -1
  18. package/dist/cjs/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js +2 -0
  19. package/dist/cjs/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js.map +1 -0
  20. package/dist/cjs/features/LearningManagement/queries/useApprovalQueries.js +1 -1
  21. package/dist/cjs/features/LearningManagement/store/usePermissionsStore.js +1 -1
  22. package/dist/cjs/features/LearningManagement/styles/EmptyRuleState.module.css.js +1 -1
  23. package/dist/features/LearningManagement/LearningManagement.js +1 -1
  24. package/dist/features/LearningManagement/LearningTemplateLayout.js +1 -1
  25. package/dist/features/LearningManagement/RBAC/AccessManagementPanel.js +2 -0
  26. package/dist/features/LearningManagement/RBAC/AccessManagementPanel.js.map +1 -0
  27. package/dist/features/LearningManagement/RBAC/AccessPanel.js +1 -1
  28. package/dist/features/LearningManagement/RBAC/AccessPanel.module.css.js +1 -1
  29. package/dist/features/LearningManagement/RuleContent/AddScopeModal.js +1 -1
  30. package/dist/features/LearningManagement/RuleContent/ApprovalLearningDialog.js +1 -1
  31. package/dist/features/LearningManagement/RuleContent/RuleContent.js +1 -1
  32. package/dist/features/LearningManagement/RuleContent/VariantCard.js +1 -1
  33. package/dist/features/LearningManagement/apis/apiConfig.js +1 -1
  34. package/dist/features/LearningManagement/apis/scopeApis.js +1 -1
  35. package/dist/features/LearningManagement/assets/Search-result(add new).svg.js +2 -0
  36. package/dist/features/LearningManagement/assets/Search-result(add new).svg.js.map +1 -0
  37. package/dist/features/LearningManagement/components/CreateLearningSetModal.js +1 -1
  38. package/dist/features/LearningManagement/components/EmptyLearningState.js +1 -1
  39. package/dist/features/LearningManagement/components/InstantLearningModal.js +1 -1
  40. package/dist/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js +2 -0
  41. package/dist/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js.map +1 -0
  42. package/dist/features/LearningManagement/queries/useApprovalQueries.js +1 -1
  43. package/dist/features/LearningManagement/store/usePermissionsStore.js +1 -1
  44. package/dist/features/LearningManagement/styles/EmptyRuleState.module.css.js +1 -1
  45. package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
  46. package/dist/types/src/features/LearningManagement/LearningManagementTest.d.ts.map +1 -1
  47. package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts.map +1 -1
  48. package/dist/types/src/features/LearningManagement/RBAC/AccessManagementPanel.d.ts +8 -0
  49. package/dist/types/src/features/LearningManagement/RBAC/AccessManagementPanel.d.ts.map +1 -0
  50. package/dist/types/src/features/LearningManagement/RBAC/AccessPanel.d.ts +4 -0
  51. package/dist/types/src/features/LearningManagement/RBAC/AccessPanel.d.ts.map +1 -1
  52. package/dist/types/src/features/LearningManagement/RBAC/index.d.ts +2 -1
  53. package/dist/types/src/features/LearningManagement/RBAC/index.d.ts.map +1 -1
  54. package/dist/types/src/features/LearningManagement/RuleContent/AddScopeModal.d.ts.map +1 -1
  55. package/dist/types/src/features/LearningManagement/RuleContent/ApprovalLearningDialog.d.ts.map +1 -1
  56. package/dist/types/src/features/LearningManagement/RuleContent/RuleContent.d.ts.map +1 -1
  57. package/dist/types/src/features/LearningManagement/RuleContent/VariantCard.d.ts.map +1 -1
  58. package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts +2 -4
  59. package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts.map +1 -1
  60. package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts +5 -3
  61. package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts.map +1 -1
  62. package/dist/types/src/features/LearningManagement/components/EmptyLearningState.d.ts +8 -0
  63. package/dist/types/src/features/LearningManagement/components/EmptyLearningState.d.ts.map +1 -1
  64. package/dist/types/src/features/LearningManagement/components/InstantLearningModal.d.ts.map +1 -1
  65. package/dist/types/src/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.d.ts +12 -0
  66. package/dist/types/src/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.d.ts.map +1 -0
  67. package/dist/types/src/features/LearningManagement/queries/useApprovalQueries.d.ts +4 -3
  68. package/dist/types/src/features/LearningManagement/queries/useApprovalQueries.d.ts.map +1 -1
  69. package/dist/types/src/features/LearningManagement/store/useEnvStore.d.ts +2 -0
  70. package/dist/types/src/features/LearningManagement/store/useEnvStore.d.ts.map +1 -1
  71. package/dist/types/src/features/LearningManagement/store/usePermissionsStore.d.ts +2 -1
  72. package/dist/types/src/features/LearningManagement/store/usePermissionsStore.d.ts.map +1 -1
  73. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),r=require("@mui/material"),o=require("lucide-react"),i=require("primereact/toast"),s=require("uuid"),a=require("../../assets/Search-result(add new).svg.js"),l=require("../../store/useAuthStore.js"),u=require("../../config.js"),c=require("../../apis/scopeApis.js"),d=require("./InputField.js"),p=require("./StationAutocomplete.js"),f=require("../CardSkeleton.js"),g=require("./OnboardingLoader.js"),x=require("./TemplateCard.js"),_=[{label:"5am to 7pm",value:"05:00 AM - 7:00 PM"},{label:"6am to 7pm",value:"06:00 AM - 7:00 PM"}],m=[{label:"Low Sellout",value:"Low Sellout"},{label:"High Sellout",value:"High Sellout"},{label:"None",value:""}],h=[{label:"None",value:"None"},{label:"Distribute spots evenly across all breaks in the hour",value:"Distribute spots evenly across all breaks in the hour"}];exports.default=function(v){var S,y=v.isOpen,b=v.onClose,j=v.onBoardStation,w=v.app_integration_id,C=v.token,T=v.stationNameParam,O=t.useState(null),F=O[0],N=O[1],B=t.useState([]),A=B[0],E=B[1],M=t.useState(0),D=M[0],q=M[1],I=t.useState(!0),k=I[0],P=I[1],R=t.useState(!1),z=R[0],L=R[1],W=t.useState([]),G=W[0],U=W[1],Y=t.useState(""),H=Y[0],K=Y[1],X=t.useState(""),J=X[0],Q=X[1],V=t.useState(!1),Z=V[0],$=V[1],ee=t.useState(!1),ne=ee[0],te=ee[1],re=t.useState(null),oe=re[0],ie=re[1],se=t.useState(!1),ae=se[0],le=se[1],ue=t.useState(0),ce=ue[0],de=ue[1],pe=t.useState(""),fe=pe[0],ge=pe[1],xe=l.default().user,_e=t.useRef(null),me=t.useRef(null),he=t.useRef(null),ve=t.useRef(null),Se=t.useState({region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""}),ye=Se[0],be=Se[1],je=function(e,n){return e.find(function(e){return e.value===n})||null},we=t.useMemo(function(){return A.map(function(e){return{label:e.scope_name,value:e.scope_name}})},[A]),Ce=t.useMemo(function(){var e,n,t;if(!ye.genre)return null;var r=A.find(function(e){return e.scope_name===ye.genre});return r?{id:r.id,title:r.scope_name||"Unnamed Template",description:(null===(e=r.description)||void 0===e?void 0:e.trim())||"No description available.",inheritedText:(null===(n=r.inheritance)||void 0===n?void 0:n[0])||void 0,rulesCount:r.rules_count||0,tiersCount:r.tier_count||0,isCopy:null!==(t=r.is_copy)&&void 0!==t&&t}:null},[ye.genre,A]);t.useEffect(function(){return function(){he.current&&clearTimeout(he.current)}},[]);var Te=function(n){return e.__awaiter(void 0,void 0,void 0,function(){var t,r,o;return e.__generator(this,function(i){switch(i.label){case 0:if(z)return[2];L(!0),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,c.retrieveGenreScopes({limit:"20",offset:String(n)})];case 2:return"success"===(null==(t=i.sent())?void 0:t.status)&&Array.isArray(null==t?void 0:t.data)?(r=t.data,E(function(t){if(0===n)return r;var o=new Set(t.map(function(e){return e.id})),i=r.filter(function(e){return!o.has(e.id)});return e.__spreadArray(e.__spreadArray([],t,!0),i,!0)}),r.length<20?P(!1):P(!0),q(n+20)):P(!1),[3,5];case 3:return o=i.sent(),console.error("[StationOnboard] Failed to fetch genre scopes:",o),P(!1),[3,5];case 4:return L(!1),[7];case 5:return[2]}})})};t.useEffect(function(){if(y&&(E([]),q(0),P(!0),Te(0),T)){ge(T);e.__awaiter(void 0,void 0,void 0,function(){var n,t,r;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,c.fetchStationsByKeyword(T,!0)];case 1:return!0===(null==(n=e.sent())?void 0:n.success)&&Array.isArray(null==n?void 0:n.data)&&(t=n.data.find(function(e){var n;return(null===(n=e.station_name)||void 0===n?void 0:n.toLowerCase())===T.toLowerCase()&&!e.ruleset_id}),t&&N(t)),[3,3];case 2:return r=e.sent(),console.error("[StationOnboard] Error auto-selecting station:",r),[3,3];case 3:return[2]}})})}},[y,T]);t.useEffect(function(){be(F?function(n){var t;return e.__assign(e.__assign({},n),{region:null!==(t=F.market)&&void 0!==t?t:""})}:{region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""})},[F]),t.useEffect(function(){var e=setTimeout(function(){Q(H)},500);return function(){return clearTimeout(e)}},[H]),t.useEffect(function(){e.__awaiter(void 0,void 0,void 0,function(){var n,t,r;return e.__generator(this,function(e){switch(e.label){case 0:if(!J.trim())return U([]),[2];$(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,c.searchScopes({search_string:J})];case 2:return"success"===(null==(n=e.sent())?void 0:n.status)&&Array.isArray(null==n?void 0:n.data)?(t=n.data.map(function(e){var n,t,r;return{id:e.id,title:e.scope_name||"Unnamed Template",description:(null===(n=e.description)||void 0===n?void 0:n.trim())||"No description available.",inheritedText:(null===(t=e.inheritance)||void 0===t?void 0:t[0])||void 0,rulesCount:e.rules_count||0,tiersCount:e.tier_count||0,isCopy:null!==(r=e.is_copy)&&void 0!==r&&r}}),U(t)):U([]),[3,5];case 3:return r=e.sent(),console.error("[StationOnboard] Error searching scopes:",r),U([]),[3,5];case 4:return $(!1),[7];case 5:return[2]}})})},[J]),t.useEffect(function(){!J.trim()&&Ce&&ie(Ce.id)},[J,Ce]);var Oe=function(){setTimeout(function(){ve.current&&ve.current.scrollTo({top:ve.current.scrollHeight,behavior:"smooth"})},100)},Fe=function(){ge(""),N(null),be({region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""}),U([]),K(""),ie(null),b()},Ne=function(n,t){var r;if("primeTime"!==n){var o=null!==(r=null==t?void 0:t.value)&&void 0!==r?r:"";be(function(t){var r;return e.__assign(e.__assign({},t),((r={})[n]=String(o),r))}),"genre"===n&&(te(!0),he.current&&clearTimeout(he.current),he.current=setTimeout(function(){var e=A.find(function(e){return e.scope_name===o});ie(e?e.id:null),te(!1)},800))}else{var i=(null==t?void 0:t.value)?String(t.value):"";be(function(n){return e.__assign(e.__assign({},n),{primeTime:i?[i]:[]})})}},Be=Boolean(F&&ye.region&&ye.primeTime.length>0&&ye.genre);return n.jsxs(r.Dialog,e.__assign({open:y,onClose:Fe,maxWidth:!1,disableEscapeKeyDown:!0,PaperProps:{sx:{width:"90vw",height:"90vh",borderRadius:"12px",display:"flex",flexDirection:"column",overflow:"hidden"}}},{children:[n.jsx(i.Toast,{ref:_e}),n.jsxs(r.Box,e.__assign({sx:{p:"20px 20px 20px 27px",borderBottom:"1px solid #F0F2F5",display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"#fff"}},{children:[n.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"18px",fontWeight:600,color:"#19213D"}},{children:"Onboard a Station"})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:400,color:"#666F8D"}},{children:"Onboard a station to start configuring learnings."}))]})),n.jsx(r.IconButton,e.__assign({onClick:Fe,disabled:ae,sx:{color:"#19213D"}},{children:n.jsx(o.X,{size:24})}))]})),n.jsxs(r.DialogContent,e.__assign({sx:{p:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"row",overflow:"hidden",position:"relative"}},{children:[n.jsx(g.default,{isLoading:ae,currentStep:ce,onComplete:function(){le(!1);var e=me.current;Fe(),j(e||void 0),me.current=null}}),n.jsxs(r.Box,e.__assign({sx:{display:"flex",flex:1,paddingY:"14px",paddingX:"20px",gap:3,overflowY:"hidden"}},{children:[n.jsxs(r.Box,e.__assign({ref:ve,sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"16px",border:"1px solid #F0F2F5",height:"100%",overflowY:"auto"}},{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Basic Details"})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Set up basic station details to unlock AI recommended scopes."})),n.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[n.jsxs(r.Box,e.__assign({className:"space-y-1.5"},{children:[n.jsxs("label",e.__assign({className:"text-sm font-medium text-[#19213D]"},{children:[n.jsx("span",e.__assign({className:"mr-0.5 text-xs font-semibold text-[#8F2C23]"},{children:"*"})),"Station Name/Call Letters"]})),n.jsx(p.default,{value:fe,onChange:ge,onStationSelect:function(e){return N(e)}})]})),n.jsx(d.default,{required:!0,disabled:!0,label:"Region",placeholder:"Select Region",value:ye.region||void 0,isSearchable:!1}),n.jsx(d.default,{required:!0,label:"Prime Time Window",placeholder:"Select Prime Time",options:_,value:je(_,(null===(S=ye.primeTime)||void 0===S?void 0:S[0])||""),onOptionChange:function(e){return Ne("primeTime",e)},isSearchable:!1}),n.jsx(r.Box,e.__assign({onClick:Oe,sx:{width:"100%"}},{children:n.jsx(d.default,{required:!0,label:"Genre",placeholder:"Select Genre",options:we,value:je(we,ye.genre),onOptionChange:function(e){return Ne("genre",e)},isSearchable:!1,onMenuScrollToBottom:function(){!z&&k&&Te(D)},isLoadingOptions:z,hasMoreOptions:k})})),n.jsx(r.Box,e.__assign({onClick:Oe,sx:{width:"100%"}},{children:n.jsx(d.default,{label:"Station Type",placeholder:"None",options:m,value:je(m,ye.type),onOptionChange:function(n){Ne("type",n),"Low Sellout"!==(null==n?void 0:n.value)&&be(function(n){return e.__assign(e.__assign({},n),{lowSelloutConfig:""})})},isSearchable:!1})})),"Low Sellout"===ye.type&&n.jsx(r.Box,e.__assign({onClick:Oe,sx:{width:"100%"}},{children:n.jsx(d.default,{label:"Low Sell Out Configurations",placeholder:"Select Configuration",options:h,value:je(h,ye.lowSelloutConfig),onOptionChange:function(e){return Ne("lowSelloutConfig",e)},isSearchable:!1})}))]}))]})),n.jsx(r.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"12px",border:"1px solid #F0F2F5",display:"flex",flexDirection:"column",height:"100%",overflowY:"auto"}},{children:ye.genre?n.jsxs(n.Fragment,{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Matching scope for your station"})),n.jsx(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:2,mb:4}},{children:ne?n.jsx(f.default,{}):Ce?n.jsx(x.default,e.__assign({},Ce,{isSelected:oe===Ce.id,onSelect:ie}),Ce.id):null})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Other available stations"})),n.jsxs("div",e.__assign({className:"relative mb-4 w-full"},{children:[n.jsx("input",{type:"text",value:H,onChange:function(e){return K(e.target.value)},placeholder:"Search for station...",className:"w-full rounded-lg border border-[#E2E8F0] px-10 py-[7px] text-[12px] outline-none transition-all placeholder:text-[#BAC0CC] focus:border-blue-500 focus:ring-1 focus:ring-blue-500"}),n.jsx(o.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",size:16})]})),n.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:2}},{children:[Z&&n.jsx(f.default,{}),!Z&&0===G.length&&J.trim()&&n.jsxs(r.Typography,e.__assign({sx:{fontSize:"0.875rem",color:"#64748B",textAlign:"center",py:4}},{children:['No scopes found matching "',J,'".']})),!Z&&G.map(function(t){return n.jsx(x.default,e.__assign({},t,{isSelected:oe===t.id,onSelect:ie}),t.id)})]}))]}):n.jsxs(n.Fragment,{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Fill in the station details to load AI recommended scopes"})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:3}},{children:"AI will recommend the most relevant scope for this station."})),n.jsx(r.Box,e.__assign({sx:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:.5,py:10}},{children:n.jsx("img",{src:a.default,alt:"Empty Result"})}))]})}))]}))]})),n.jsxs(r.Box,e.__assign({sx:{p:"12px 20px",borderTop:"1px solid #F0F2F5",display:"flex",justifyContent:"flex-end",gap:2,bgcolor:"#fff"}},{children:[n.jsx("button",e.__assign({onClick:Fe,disabled:ae,style:{padding:"7px 10px",borderRadius:"6px",color:"#64748B",border:"1px solid #E2E8F0",backgroundColor:"#fff",cursor:"pointer",fontSize:"14px",fontWeight:500}},{children:"Cancel"})),n.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,t,r,o,i,a,l,d,p,f,g,x,_,m,h,v,S,y;return e.__generator(this,function(b){switch(b.label){case 0:if(!F||!oe)return console.error("[StationOnboard] Missing required data for onboarding"),[2];n=Ce?e.__spreadArray([Ce],G,!0):G,t=n.find(function(e){return e.id===oe}),r=null!==(_=null==t?void 0:t.isCopy)&&void 0!==_&&_,le(!0),de(0),o=null,b.label=1;case 1:return b.trys.push([1,3,,4]),i={topic:"customRuleSet",customScopeGroupName:(null===u.IL_CONFIG_CONSTANTS||void 0===u.IL_CONFIG_CONSTANTS?void 0:u.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME)||"Audacy-Traffic-Manager",scopeDescription:F.station_name||"New Station",parentScopeId:null,customScopeName:F.station_name||"New Station",customScopeId:s.v4(),createByName:(null==xe?void 0:xe.firstname)||"System",createdBy:(null==xe?void 0:xe.email)||"system@audacy.com",applicationMappingId:w},console.log("[StationOnboard] Step 1: Creating rule set with payload:",i),[4,c.createRuleSet(i,C)];case 2:if(a=b.sent(),!(o=null===(m=null==a?void 0:a.data)||void 0===m?void 0:m.scopeId))throw new Error("Failed to create scope - no scopeId returned");return de(1),[3,4];case 3:return l=b.sent(),console.error("[StationOnboard] Error creating rule set:",l),null===(h=_e.current)||void 0===h||h.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to create rule set. Please try again."}),le(!1),de(0),[2];case 4:return b.trys.push([4,6,,11]),d={market:F.market,region:F.region,primetime_windows:ye.primeTime,genre:ye.genre,station_type:""===ye.type?null:ye.type,low_sellout_configurations:"Low Sellout"===ye.type?ye.lowSelloutConfig:null,ruleset_id:o,station_guid:F.station_guid,station_name:F.station_name||"New Station"},console.log("[StationOnboard] Step 2: Updating station with payload:",d),[4,c.updateStation(d)];case 5:return b.sent(),de(2),[3,11];case 6:p=b.sent(),console.error("[StationOnboard] Error updating station, rolling back rule set:",p),409===p.status?(null===(v=_e.current)||void 0===v||v.show({severity:"error",life:2500,summary:"Error updating station",detail:"Station already Onboarded."}),N(null),ie(null),ge(""),be(function(n){return e.__assign(e.__assign({},n),{region:""})})):null===(S=_e.current)||void 0===S||S.show({severity:"error",life:2500,summary:"Error updating station",detail:"Please try again."}),b.label=7;case 7:return b.trys.push([7,9,,10]),[4,c.deleteRuleSet(o,C)];case 8:return b.sent(),[3,10];case 9:return f=b.sent(),console.error("[StationOnboard] Failed to rollback rule set deletion:",f),[3,10];case 10:return le(!1),de(0),[2];case 11:return b.trys.push([11,13,,14]),g={source_scope_id:oe,target_scope_id:o,is_copy_parent_variant_id:r},console.log("[StationOnboard] Step 3: Inheriting scope with payload:",g),[4,c.inheritScope(g)];case 12:return b.sent(),de(3),[3,14];case 13:return x=b.sent(),console.error("[StationOnboard] Error inheriting scope (no rollback):",x),null===(y=_e.current)||void 0===y||y.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to apply rule template. Please try again."}),le(!1),de(0),[2];case 14:return me.current=o,[2]}})})},disabled:!Be||ae,style:{padding:"7px 10px",borderRadius:"6px",border:"none",backgroundColor:Be?"#2563EB":"#BFDBFE",color:"#fff",cursor:Be&&!ae?"pointer":"not-allowed",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"7px"}},{children:ae?n.jsxs(n.Fragment,{children:[n.jsx(r.CircularProgress,{size:16,color:"inherit"}),n.jsx("span",{children:"Onboarding..."})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"Onboard Station"}),n.jsx(o.ArrowRight,{size:16})]})}))]}))]}))};
2
+ //# sourceMappingURL=BackwardStationOnboardModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BackwardStationOnboardModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("@tanstack/react-query"),t=require("../apis/scopeApis.js"),n=require("../store/useEnvStore.js");exports.useApproveOrRejectVariantsMutation=function(){return r.useMutation({mutationFn:function(e){var r=e.variantIds,n=e.status,u=e.feedback,a=e.scopeId;return t.ApproveOrRejectVariants({variant_ids:r,status:n,feedback:u,scopeId:a})}})},exports.useApproverSearchQuery=function(n){var u=this;return r.useQuery({queryKey:["approver-search",n],queryFn:function(){return e.__awaiter(u,void 0,void 0,function(){var r;return e.__generator(this,function(e){switch(e.label){case 0:return[4,t.appsecGetUsersByQueryLite(n)];case 1:return[2,(null==(r=e.sent())?void 0:r.data)||[]]}})})},enabled:!!n.trim(),staleTime:3e4})},exports.useGetAppSecRolesQuery=function(n,u){var a=this;return void 0===u&&(u=!0),r.useQuery({queryKey:["appsec-roles",n],queryFn:function(){return e.__awaiter(a,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return[4,t.GetAppsecRoles(n)];case 1:return[2,e.sent().data]}})})},enabled:u&&!!n,staleTime:1e5})},exports.useGroupSearchQuery=function(u){var a=this,s=n.default(function(e){var r;return null===(r=e.rbacConfig)||void 0===r?void 0:r.applicationId});return r.useQuery({queryKey:["group-search",s,u],queryFn:function(){return e.__awaiter(a,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return[4,t.appsecGetUserGroups({appId:s,name:u})];case 1:return[2,e.sent().data]}})})},enabled:!!s,staleTime:3e4})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("@tanstack/react-query"),t=require("../apis/scopeApis.js"),n=require("../store/useEnvStore.js");exports.useApproveOrRejectVariantsMutation=function(){return r.useMutation({mutationFn:function(e){var r=e.variantIds,n=e.status,u=e.feedback,a=e.scopeId,s=e.is_deleted;return t.ApproveOrRejectVariants({variant_ids:r,status:n,feedback:u,scopeId:a,is_deleted:s})}})},exports.useApproverSearchQuery=function(n){var u=this;return r.useQuery({queryKey:["approver-search",n],queryFn:function(){return e.__awaiter(u,void 0,void 0,function(){var r;return e.__generator(this,function(e){switch(e.label){case 0:return[4,t.appsecGetUsersByQueryLite(n)];case 1:return[2,(null==(r=e.sent())?void 0:r.data)||[]]}})})},enabled:!!n.trim(),staleTime:3e4})},exports.useGetAppSecRolesQuery=function(n,u){var a=this;return void 0===u&&(u=!0),r.useQuery({queryKey:["appsec-roles",n],queryFn:function(){return e.__awaiter(a,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return[4,t.GetAppsecRoles(n)];case 1:return[2,e.sent().data]}})})},enabled:u&&!!n,staleTime:1e5})},exports.useGroupSearchQuery=function(u){var a=this,s=n.default(function(e){var r;return null===(r=e.rbacConfig)||void 0===r?void 0:r.applicationId});return r.useQuery({queryKey:["group-search",s,u],queryFn:function(){return e.__awaiter(a,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return[4,t.appsecGetUserGroups({appId:s,name:u})];case 1:return[2,e.sent().data]}})})},enabled:!!s,staleTime:3e4})};
2
2
  //# sourceMappingURL=useApprovalQueries.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("zustand"),i=require("../apis/scopeApis.js"),n=require("./useLearningTemplateStore.js"),t=r.create(function(r,t){return{accessData:[],isLoading:!1,error:null,fetchPermissions:function(n,t){return e.__awaiter(void 0,void 0,void 0,function(){var s,o,a;return e.__generator(this,function(e){switch(e.label){case 0:if(!n)return[2];r({isLoading:!0,error:null}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.appsecApi.get("/users/me",{params:{appId:n,resourceId:t}})];case 2:return s=e.sent(),r({accessData:(null===(a=s.data)||void 0===a?void 0:a.data)||[],isLoading:!1}),[3,4];case 3:return o=e.sent(),console.error("Failed to fetch permissions:",o),r({error:o.message||"Failed to fetch permissions",isLoading:!1}),[3,4];case 4:return[2]}})})},hasPermission:function(e,r){var i,s,o;if(!n.useLearningTemplateStore.getState().backwardCompatibility)return!0;var a=t().accessData.find(function(e){return function(e,r){return!!r&&function(e){return e?"string"==typeof e?[e]:[e._id,e.id,e.resourceId,e.resource_id].filter(function(e){return"string"==typeof e&&e.length>0}):[]}(e).includes(r)}(e.resourceId,r)});return!!a&&(null!==(o=null===(s=null===(i=a.role)||void 0===i?void 0:i.permissions)||void 0===s?void 0:s.some(function(r){return r.name===e}))&&void 0!==o&&o)},hasGlobalPermission:function(e){return!n.useLearningTemplateStore.getState().backwardCompatibility||t().accessData.some(function(r){var i,n;return null===(n=null===(i=r.role)||void 0===i?void 0:i.permissions)||void 0===n?void 0:n.some(function(r){return r.name===e})})},reset:function(){return r({accessData:[],isLoading:!1,error:null})}}});exports.usePermissionsStore=t;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("zustand"),s=require("../apis/scopeApis.js"),n=require("./useEnvStore.js"),i="ilotj.scope.access.application.user.add",o=function(e,r){return!!r&&function(e){return e?"string"==typeof e?[e]:[e._id,e.id,e.resourceId,e.resource_id].filter(function(e){return"string"==typeof e&&e.length>0}):[]}(e).includes(r)},t=r.create(function(r,t){return{accessData:[],isLoading:!1,error:null,fetchPermissions:function(n,i){return e.__awaiter(void 0,void 0,void 0,function(){var o,t,a;return e.__generator(this,function(e){switch(e.label){case 0:if(!n)return[2];r({isLoading:!0,error:null}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,s.appsecApi.get("/users/me",{params:{appId:n,resourceId:i}})];case 2:return o=e.sent(),r({accessData:(null===(a=o.data)||void 0===a?void 0:a.data)||[],isLoading:!1}),[3,4];case 3:return t=e.sent(),console.error("Failed to fetch permissions:",t),r({error:t.message||"Failed to fetch permissions",isLoading:!1}),[3,4];case 4:return[2]}})})},hasPermission:function(e,r){var s,a=t().accessData,u=null===(s=n.default.getState().rbacConfig)||void 0===s?void 0:s.applicationResourceId,c=function(e,r){return a.some(function(s){var n,i,t;return o(s.resourceId,r)&&null!==(t=null===(i=null===(n=s.role)||void 0===n?void 0:n.permissions)||void 0===i?void 0:i.some(function(r){return r.name===e}))&&void 0!==t&&t})};return!(!u||e===i||!c(i,u))||c(e,r)},hasGlobalPermission:function(e,r){return!!r&&(t().hasApplicationAccess(r)||t().hasPermission(e,r))},hasApplicationAccess:function(e){return!!e&&t().accessData.some(function(r){var s,n,t;return o(r.resourceId,e)&&null!==(t=null===(n=null===(s=r.role)||void 0===s?void 0:s.permissions)||void 0===n?void 0:n.some(function(e){return e.name===i}))&&void 0!==t&&t})},reset:function(){return r({accessData:[],isLoading:!1,error:null})}}});exports.usePermissionsStore=t;
2
2
  //# sourceMappingURL=usePermissionsStore.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});require("../../../node_modules/style-inject/dist/style-inject.es.js").default(".EmptyRuleState-module_container__DD8ZC{align-items:center;display:flex;flex:1;flex-direction:column;justify-content:center;padding:2.5rem}.EmptyRuleState-module_card__2-kb8{align-items:center;background-color:#fff;border:1px solid #f3f4f6;border-radius:1rem;box-shadow:0 4px 30px #00000008;display:flex;flex-direction:column;max-width:600px;padding:4rem 2.5rem;text-align:center;width:100%}.EmptyRuleState-module_iconContainer__2Mep-{align-items:center;background-color:#f9fafb;border-radius:9999px;display:flex;height:5rem;justify-content:center;margin-bottom:1.5rem;position:relative;width:5rem}.EmptyRuleState-module_iconLines__-G9Us{display:flex;flex-direction:column;gap:.375rem;opacity:.2;transform:scale(1.1)}.EmptyRuleState-module_iconLine__v1Xs7{background-color:#60a5fa;border-radius:9999px;height:.375rem}.EmptyRuleState-module_iconLineLong__7I0wU{width:2.5rem}.EmptyRuleState-module_iconLineShort__R3ArP{width:1.75rem}.EmptyRuleState-module_iconBadge__YY28J{background-color:#fff;border:1px solid #f9fafb;border-radius:9999px;bottom:-.25rem;box-shadow:0 1px 2px 0 #0000000d;padding:.375rem;position:absolute;right:-.25rem}.EmptyRuleState-module_iconBadge__YY28J svg{color:#d1d5db}.EmptyRuleState-module_title__qk36r{color:#111827;font-size:1.125rem;font-weight:700;margin-bottom:.5rem}.EmptyRuleState-module_description__XButJ{color:#6b7280;font-size:.875rem;margin-bottom:2rem}.EmptyRuleState-module_createButton__GM3ug{align-items:center;background-color:#2563eb;border:none;border-radius:.375rem;box-shadow:0 1px 2px 0 #0000000d;color:#fff;cursor:pointer;display:flex;font-size:.875rem;font-weight:500;gap:.5rem;padding:.625rem 1.5rem;transition:background-color .2s,box-shadow .2s}.EmptyRuleState-module_createButton__GM3ug:hover{background-color:#1d4ed8;box-shadow:0 4px 6px -1px #0000001a}"),exports.default={container:"EmptyRuleState-module_container__DD8ZC",card:"EmptyRuleState-module_card__2-kb8",iconContainer:"EmptyRuleState-module_iconContainer__2Mep-",iconLines:"EmptyRuleState-module_iconLines__-G9Us",iconLine:"EmptyRuleState-module_iconLine__v1Xs7",iconLineLong:"EmptyRuleState-module_iconLineLong__7I0wU",iconLineShort:"EmptyRuleState-module_iconLineShort__R3ArP",iconBadge:"EmptyRuleState-module_iconBadge__YY28J",title:"EmptyRuleState-module_title__qk36r",description:"EmptyRuleState-module_description__XButJ",createButton:"EmptyRuleState-module_createButton__GM3ug"};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});require("../../../node_modules/style-inject/dist/style-inject.es.js").default(".EmptyRuleState-module_container__DD8ZC{align-items:center;display:flex;flex:1;flex-direction:column;justify-content:center;padding:2.5rem}.EmptyRuleState-module_card__2-kb8{align-items:center;background-color:#fff;border:1px solid #f3f4f6;border-radius:1rem;box-shadow:0 4px 30px #00000008;display:flex;flex-direction:column;max-width:600px;padding:4rem 2.5rem;text-align:center;width:100%}.EmptyRuleState-module_iconContainer__2Mep-{align-items:center;background-color:#f9fafb;border-radius:9999px;display:flex;height:5rem;justify-content:center;margin-bottom:1.5rem;position:relative;width:5rem}.EmptyRuleState-module_iconLines__-G9Us{display:flex;flex-direction:column;gap:.375rem;opacity:.2;transform:scale(1.1)}.EmptyRuleState-module_iconLine__v1Xs7{background-color:#60a5fa;border-radius:9999px;height:.375rem}.EmptyRuleState-module_iconLineLong__7I0wU{width:2.5rem}.EmptyRuleState-module_iconLineShort__R3ArP{width:1.75rem}.EmptyRuleState-module_iconBadge__YY28J{background-color:#fff;border:1px solid #f9fafb;border-radius:9999px;bottom:-.25rem;box-shadow:0 1px 2px 0 #0000000d;padding:.375rem;position:absolute;right:-.25rem}.EmptyRuleState-module_iconBadge__YY28J svg{color:#d1d5db}.EmptyRuleState-module_title__qk36r{color:#111827;font-size:1.125rem;font-weight:700;margin-bottom:.5rem}.EmptyRuleState-module_description__XButJ{color:#6b7280;font-size:.875rem;margin-bottom:2rem}.EmptyRuleState-module_createButton__GM3ug{align-items:center;background-color:#2563eb;border:none;border-radius:.375rem;box-shadow:0 1px 2px 0 #0000000d;color:#fff;cursor:pointer;display:flex;font-size:.875rem;font-weight:500;gap:.5rem;padding:.625rem 1.5rem;transition:background-color .2s,box-shadow .2s}.EmptyRuleState-module_createButton__GM3ug:hover{background-color:#1d4ed8;box-shadow:0 4px 6px -1px #0000001a}.EmptyRuleState-module_createButton__GM3ug:disabled{background-color:#9ca3af;box-shadow:none;cursor:not-allowed}"),exports.default={container:"EmptyRuleState-module_container__DD8ZC",card:"EmptyRuleState-module_card__2-kb8",iconContainer:"EmptyRuleState-module_iconContainer__2Mep-",iconLines:"EmptyRuleState-module_iconLines__-G9Us",iconLine:"EmptyRuleState-module_iconLine__v1Xs7",iconLineLong:"EmptyRuleState-module_iconLineLong__7I0wU",iconLineShort:"EmptyRuleState-module_iconLineShort__R3ArP",iconBadge:"EmptyRuleState-module_iconBadge__YY28J",title:"EmptyRuleState-module_title__qk36r",description:"EmptyRuleState-module_description__XButJ",createButton:"EmptyRuleState-module_createButton__GM3ug"};
2
2
  //# sourceMappingURL=EmptyRuleState.module.css.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as n,__generator as t}from"tslib";import{jsx as r,jsxs as o,Fragment as i}from"react/jsx-runtime";import{useState as a,useRef as s,useEffect as l}from"react";import{BookOpen as c,Users as u}from"lucide-react";import{useLearningTemplateStore as d}from"./store/useLearningTemplateStore.js";import{Toast as p}from"primereact/toast";import m from"./styles/LearningTemplateManagement.module.css.js";import f from"./LearningTemplateLayout.js";import g from"./components/EmptyLearningState.js";import v from"./store/useAuthStore.js";import{fetchTiers as h,fetchScopes as S,inheritScope as y,inheritScopeBackwardCompatible as b,createRuleSet as C,renameScope as T,updateStation as L,deleteRuleSet as O}from"./apis/scopeApis.js";import w from"./components/ConfirmationModal.js";import E from"./components/LearningTemplateManagementSkeleton.js";import{findNodePathById as I}from"./utils/treeUtils.js";import A from"./store/useEnvStore.js";import{useConfigStore as _}from"./store/useConfigStore.js";import{TooltipProvider as j}from"./components/ToolTip.js";import R from"./components/CreateRuleSetLegacyModal.js";import{usePermissionsStore as D}from"./store/usePermissionsStore.js";import{useAppSecRolesStore as k}from"./store/useAppSecRolesStore.js";import{useGetAppSecRolesQuery as N}from"./queries/useApprovalQueries.js";import P from"./RuleContent/AddScopeModal.js";import{useLocation as B}from"react-router-dom";var U=[{id:"learnings",label:"Learnings",icon:c,badgeKey:"learningsCount"},{id:"access",label:"Access",icon:u}],G=[{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},{type:"SCOPE",label:"Scope",addChildLabel:"Add Subscope",addChildType:"SUBSCOPE"},{type:"SUBSCOPE",label:"Subscope"}];function M(c){var u,M=this,F=c.userDetails,x=c.llmStudioUrl,q=c.audacyBackendUrl,H=c.ilLabels,K=c.config,Q=c.rbacConfig,V=c.app_integration_id,W=c.backwardCompatibility,z=void 0!==W&&W,J=d(function(e){return e.selectedRuleSetId}),X=d(function(e){return e.setSelectedRuleSetId}),Y=d(function(e){return e.error}),Z=d(function(e){return e.setError}),$=d(function(e){return e.setStations}),ee=d(function(e){return e.scopeTreeData}),ne=d(function(e){return e.setScopeTreeData}),te=a({isOpen:!1,type:"GLOBAL"}),re=te[0],oe=te[1],ie=a(!1),ae=ie[0],se=ie[1],le=a(!1),ce=le[0],ue=le[1],de=a("learnings"),pe=de[0],me=de[1],fe=a(null),ge=fe[0],ve=fe[1],he=s(null),Se=s(null),ye=s(null),be=v();be.user;var Ce=be.setUser,Te=_(),Le=Te.setConfig,Oe=Te.setIlLabels,we=function(){try{return B()}catch(e){return{search:""}}}();l(function(){var e=new URLSearchParams(window.location.search).get("rulesetid");(null==e?void 0:e.length)&&X&&me&&(X(e),me("learnings"))},[null==we?void 0:we.search,me,X]);var Ee=D(function(e){return e.fetchPermissions}),Ie=D(function(e){return e.hasPermission}),Ae=k(function(e){return e.setRoles}),_e=A(function(e){return e.appsecRbacUrl})===Q.appsecRbacUrl,je=N(Q.applicationId,_e).data;l(function(){je&&Ae(je.map(function(e){return{_id:e._id,name:e.name}}))},[je,Ae]),l(function(){var e;console.log("userDetails",F),Ce(F),console.log("llmStudioUrl",x),console.log("audacyBackendUrl",q),A.getState().setLlmStudioUrl(x),A.getState().setAudacyBackendUrl(q),A.getState().setRbacConfig(Q),Le(K),Oe(H),d.getState().setAppIntegrationId(null!=V?V:null),d.getState().setBackwardCompatibility(z),d.getState().setToken(null!==(e=F.accessToken)&&void 0!==e?e:null)},[F,Ce,x,q,Q,K,Le,H,Oe,V,z]),l(function(){(null==F?void 0:F.accessToken)&&x&&h()},[V,null==F?void 0:F.accessToken,x]);var Re=function(r){return void 0===r&&(r=!0),n(M,void 0,void 0,function(){var n,o,i,a,s;return t(this,function(t){switch(t.label){case 0:r&&se(!0),Z(null),t.label=1;case 1:return t.trys.push([1,4,5,6]),[4,Ee(Q.applicationId)];case 2:return t.sent(),n=function(t){if(!D.getState().hasPermission("ilotj.scope.view",t.id))return null;var r=t.children?t.children.map(function(e){return n(e)}).filter(function(e){return null!==e}):[];return e(e({},t),{children:r})},[4,S(V,F.accessToken)];case 3:return(o=t.sent())&&o.data&&o.data.data&&(i=o.data.data,Array.isArray(i)&&(i=i.length>0?i[0]:null),i&&(a=n(i))?(ne({data:a}),Se.current?(X(Se.current),me("learnings"),Se.current=null):d.getState().selectedRuleSetId||X(a.id)):ne(null)),[3,6];case 4:return s=t.sent(),console.error("Failed to fetch rule sets or permissions",s),Z("Failed to load data. Please try again later."),[3,6];case 5:return se(!1),[7];case 6:return[2]}})})};l(function(){var e;(null===(e=null==F?void 0:F.accessToken)||void 0===e?void 0:e.length)&&_e?Re(!0):console.warn("Error: Trying to fetch rules without access token",F)},[null==F?void 0:F.accessToken,Z,$,Q.applicationId,_e]);var De=function(r,o,i){return n(M,void 0,void 0,function(){var n,a,s,l,c,u,p,m,f;return t(this,function(t){switch(t.label){case 0:ue(!0),t.label=1;case 1:return t.trys.push([1,8,9,10]),[4,O(r,F.accessToken)];case 2:if(t.sent(),d.getState().selectedRuleSetId===r&&(n=d.getState().scopeTreeData,(a=I((null==n?void 0:n.data)||null,r))&&a.length>1&&(s=a[a.length-2],X(s),me("learnings"))),!i||!o)return[3,6];t.label=3;case 3:return t.trys.push([3,5,,6]),[4,L({station_name:o,ruleset_id:""})];case 4:return t.sent(),[3,6];case 5:return l=t.sent(),console.error("Error unlinking station on subscope delete:",l),[3,6];case 6:return[4,Re(!0)];case 7:return t.sent(),oe(function(n){return e(e({},n),{isOpen:!1})}),null===(u=ye.current)||void 0===u||u.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,10];case 8:return c=t.sent(),console.error("An error occurred during scope deletion.",c),null===(p=ye.current)||void 0===p||p.show({severity:"error",summary:"Delete Failed",detail:(null===(f=null===(m=null==c?void 0:c.response)||void 0===m?void 0:m.data)||void 0===f?void 0:f.message)||"There was an error deleting the scope. Please try again."}),[3,10];case 9:return ue(!1),[7];case 10:return[2]}})})},ke=ee,Ne=ge?{data:{id:ge.stationId,name:ge.stationName,type:"STATION",metrics:{learningsCount:ge.learningsCount,stationsCount:0},children:[]}}:ke,Pe=!!(null==Ne?void 0:Ne.data);null===(u=null==Ne?void 0:Ne.data)||void 0===u||u.type;var Be=D(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create"),Ue=ge?U.filter(function(e){return"stations"!==e.id}):U;return r(j,{children:o("div",e({className:m.learningManagementContainer},{children:[r("div",e({className:m.mainWrapper},{children:ae?r(E,{}):Y?o("div",e({className:m.errorContainer},{children:[r("div",e({className:m.errorTitle},{children:"Error Loading Data"})),r("p",e({className:m.errorDesc},{children:Y})),r("button",e({onClick:function(){return Re(!0)},className:m.tryAgainBtn},{children:"Try Again"}))]})):Pe?r(f,{onOpenCreateModal:function(){return oe({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,n,t){return oe({isOpen:!0,type:n,parentId:e,parentName:t})},onRenameChild:function(e,n){return oe({isOpen:!0,type:"RENAME",scopeId:e,initialName:n})},onDeleteChild:function(e,r,o){return n(M,void 0,void 0,function(){var n,i,a;return t(this,function(t){switch(t.label){case 0:return n=d.getState().scopeTreeData,i=I((null==n?void 0:n.data)||null,e),a=!!i&&3===i.length,0!==o?[3,2]:[4,De(e,r,a)];case 1:return t.sent(),[3,3];case 2:oe({isOpen:!0,type:"DELETE",scopeId:e,initialName:r,isSubscope:a}),t.label=3;case 3:return[2]}})})},canDeleteScope:function(e){return Ie("ilotj.scope.delete",e)},canEditScope:function(e){return Ie("ilotj.scope.edit",e)},canCreateScope:function(e){return Ie("ilotj.scope.create",e)},onSectionSelect:function(e,n){console.log("Section Selected:",{scopeId:e,sectionId:n}),me(n),X(e)},activeSectionId:pe,scopeTreeData:Ne,sectionsConfig:Ue,onViewStation:function(e){he.current=J,ve(e),me("learnings"),X(e.stationId)},onRefreshRuleSets:function(e,n){void 0===e&&(e=!0),n&&(Se.current=n),Re(e)},nodeTypesConfig:G,app_integration_id:V,token:F.accessToken}):r(g,{onCreate:function(){return oe({isOpen:!0,type:"GLOBAL"})},title:"No Global Scope has been added!",desc:"Start by creating a Global scope to define base learnings that apply across all stations.",button:"Create Global Scope",canCreateRule:Be})})),r(p,{ref:ye}),z&&re.isOpen&&"DELETE"!==re.type&&"RENAME"!==re.type?r(R,{isOpen:!0,onClose:function(){return oe(e(e({},re),{isOpen:!1}))},onSubmit:function(r){return n(M,void 0,void 0,function(){var n,o,i,a,s,l,c,u,p,m,f,g,v,h,S,T,L,O,w,E;return t(this,function(t){switch(t.label){case 0:ue(!0),n=d.getState().backwardCompatibility,t.label=1;case 1:return t.trys.push([1,12,13,14]),o=void 0,n&&"object"==typeof r?o=r:(i=r,a="SCOPE"===re.type&&re.parentId,s=a?"genreRuleSet":re.type,o={topic:s,scope_reference_id:null,scopeDescription:"demo",parentScopeId:re.parentId||null,scopeName:i,scopeReferenceMetadata:{},applicationMappingId:V}),[4,C(o,F.accessToken)];case 2:if(l=t.sent(),!(c=null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.scopeId))return[3,10];if(Se.current=c,u=n&&(null===(S=o.topic)||void 0===S?void 0:S.toLowerCase().includes("genre")),p=!n&&"GLOBAL"!==re.type&&re.parentId,!u&&!p)return[3,10];if(!(m=n?null===(L=null===(T=d.getState().scopeTreeData)||void 0===T?void 0:T.data)||void 0===L?void 0:L.id:re.parentId))return[3,10];if(!z)return[3,7];t.label=3;case 3:return t.trys.push([3,5,,6]),[4,b({source_scope_id:m,target_scope_id:c})];case 4:return t.sent(),[3,6];case 5:return f=t.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,6];case 6:return[3,10];case 7:return t.trys.push([7,9,,10]),[4,y({source_scope_id:m,target_scope_id:c,application_mapping_id:V||"",is_copy_parent_variant_id:!1})];case 8:return t.sent(),[3,10];case 9:return g=t.sent(),console.error("Failed to inherit rules for the new scope:",g),[3,10];case 10:return[4,Re(!0)];case 11:return t.sent(),oe(function(n){return e(e({},n),{isOpen:!1})}),[3,14];case 12:throw v=t.sent(),console.error("An error occurred during scope creation.",v),null===(O=ye.current)||void 0===O||O.show({severity:"error",summary:"Creation Failed",detail:(null===(E=null===(w=null==v?void 0:v.response)||void 0===w?void 0:w.data)||void 0===E?void 0:E.message)||"There was an error creating the scope. Please try again."}),v;case 13:return ue(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:Pe}):r(P,{isOpen:re.isOpen&&"DELETE"!==re.type,onClose:function(){return oe(e(e({},re),{isOpen:!1}))},onCreate:function(r){return o=null!=r?r:"",n(M,void 0,void 0,function(){var n,r,i,a;return t(this,function(t){switch(t.label){case 0:ue(!0),t.label=1;case 1:return t.trys.push([1,4,5,6]),re.scopeId?[4,T({scope_id:re.scopeId,scope_name:o})]:[2];case 2:return t.sent(),[4,Re(!0)];case 3:return t.sent(),oe(function(n){return e(e({},n),{isOpen:!1})}),[3,6];case 4:throw n=t.sent(),console.error("An error occurred during scope rename.",n),null===(r=ye.current)||void 0===r||r.show({severity:"error",summary:"Rename Failed",detail:(null===(a=null===(i=null==n?void 0:n.response)||void 0===i?void 0:i.data)||void 0===a?void 0:a.message)||"There was an error renaming the scope. Please try again."}),n;case 5:return ue(!1),[7];case 6:return[2]}})});var o},hasGlobalRuleSet:Pe}),r(w,{isOpen:re.isOpen&&"DELETE"===re.type,onCancel:function(){return oe(e(e({},re),{isOpen:!1}))},onConfirm:function(){return De(re.scopeId,re.initialName,re.isSubscope)},title:"Delete Scope",description:o(i,{children:["Deleting ",r("span",e({className:m.highlight},{children:re.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:ce})]}))})}export{M as default};
1
+ import{__assign as e,__awaiter as t,__generator as n}from"tslib";import{jsx as r,jsxs as o,Fragment as s}from"react/jsx-runtime";import{useState as a,useRef as i,useEffect as l}from"react";import{BookOpen as c,Users as u}from"lucide-react";import{useLearningTemplateStore as d}from"./store/useLearningTemplateStore.js";import{Toast as p}from"primereact/toast";import m from"./styles/LearningTemplateManagement.module.css.js";import f from"./LearningTemplateLayout.js";import v from"./components/EmptyLearningState.js";import h from"./store/useAuthStore.js";import{fetchTiers as g,fetchScopes as y,inheritScope as S,inheritScopeBackwardCompatible as b,createRuleSet as C,renameScope as T,updateStation as w,deleteRuleSet as A,requestAccess as L}from"./apis/scopeApis.js";import E from"./components/ConfirmationModal.js";import I from"./components/LearningTemplateManagementSkeleton.js";import{findNodePathById as O}from"./utils/treeUtils.js";import j from"./store/useEnvStore.js";import{useConfigStore as R}from"./store/useConfigStore.js";import{TooltipProvider as _}from"./components/ToolTip.js";import k from"./components/CreateRuleSetLegacyModal.js";import{usePermissionsStore as D}from"./store/usePermissionsStore.js";import{useAppSecRolesStore as N}from"./store/useAppSecRolesStore.js";import{useGetAppSecRolesQuery as P}from"./queries/useApprovalQueries.js";import G from"./RuleContent/AddScopeModal.js";import{useLocation as U}from"react-router-dom";import B from"./shared/SuccessToastContent.js";import M from"./shared/ErrorToastContent.js";var F=[{id:"learnings",label:"Learnings",icon:c,badgeKey:"learningsCount"},{id:"access",label:"Access",icon:u}],q=[{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},{type:"SCOPE",label:"Scope",addChildLabel:"Add Subscope",addChildType:"SUBSCOPE"},{type:"SUBSCOPE",label:"Subscope"}];function x(c){var u,x=this,H=c.userDetails,K=c.llmStudioUrl,Q=c.audacyBackendUrl,V=c.ilLabels,W=c.config,Y=c.rbacConfig,z=c.app_integration_id,J=c.backwardCompatibility,X=void 0!==J&&J,Z=d(function(e){return e.selectedRuleSetId}),$=d(function(e){return e.setSelectedRuleSetId}),ee=d(function(e){return e.error}),te=d(function(e){return e.setError}),ne=d(function(e){return e.setStations}),re=d(function(e){return e.scopeTreeData}),oe=d(function(e){return e.setScopeTreeData}),se=a({isOpen:!1,type:"GLOBAL"}),ae=se[0],ie=se[1],le=a(!1),ce=le[0],ue=le[1],de=a(!1),pe=de[0],me=de[1],fe=a("learnings"),ve=fe[0],he=fe[1],ge=a(null),ye=ge[0],Se=ge[1],be=a(null),Ce=be[0],Te=be[1],we=i(null),Ae=i(null),Le=i(null),Ee=h();Ee.user;var Ie=Ee.setUser,Oe=R(),je=Oe.setConfig,Re=Oe.setIlLabels,_e=function(){try{return U()}catch(e){return{search:""}}}();l(function(){var e=new URLSearchParams(window.location.search).get("rulesetid");(null==e?void 0:e.length)&&$&&he&&($(e),he("learnings"))},[null==_e?void 0:_e.search,he,$]);var ke=D(function(e){return e.fetchPermissions}),De=D(function(e){return e.hasPermission}),Ne=N(function(e){return e.setRoles}),Pe=j(function(e){return e.appsecRbacUrl})===Y.appsecRbacUrl,Ge=P(Y.applicationId,Pe).data;l(function(){Ge&&Ne(Ge.map(function(e){return{_id:e._id,name:e.name}}))},[Ge,Ne]),l(function(){var e;console.log("userDetails",H),Ie(H),console.log("llmStudioUrl",K),console.log("audacyBackendUrl",Q),j.getState().setLlmStudioUrl(K),j.getState().setAudacyBackendUrl(Q),j.getState().setRbacConfig(Y),je(W),Re(V),d.getState().setAppIntegrationId(null!=z?z:null),d.getState().setBackwardCompatibility(X),d.getState().setToken(null!==(e=H.accessToken)&&void 0!==e?e:null)},[H,Ie,K,Q,Y,W,je,V,Re,z,X]),l(function(){(null==H?void 0:H.accessToken)&&K&&g()},[z,null==H?void 0:H.accessToken,K]);var Ue=function(r){return void 0===r&&(r=!0),t(x,void 0,void 0,function(){var t,o,s,a,i,l;return n(this,function(n){switch(n.label){case 0:r&&ue(!0),te(null),n.label=1;case 1:return n.trys.push([1,4,5,6]),[4,ke(Y.applicationId)];case 2:return n.sent(),t=function(n){if(!D.getState().hasPermission("ilotj.scope.view",n.id))return null;var r=n.children?n.children.map(function(e){return t(e)}).filter(function(e){return null!==e}):[];return e(e({},n),{children:r})},[4,y(z,H.accessToken)];case 3:return(o=n.sent())&&o.data&&o.data.data&&(s=o.data.data,Array.isArray(s)&&(s=s.length>0?s[0]:null),s?(a=t(s))?(Se(null),oe({data:a}),Ae.current?($(Ae.current),he("learnings"),Ae.current=null):d.getState().selectedRuleSetId||$(a.id)):(Se(null!==(l=s.id)&&void 0!==l?l:null),oe(null)):(Se(null),oe(null))),[3,6];case 4:return i=n.sent(),console.error("Failed to fetch rule sets or permissions",i),te("Failed to load data. Please try again later."),[3,6];case 5:return ue(!1),[7];case 6:return[2]}})})};l(function(){var e;(null===(e=null==H?void 0:H.accessToken)||void 0===e?void 0:e.length)&&Pe?Ue(!0):console.warn("Error: Trying to fetch rules without access token",H)},[null==H?void 0:H.accessToken,te,ne,Y.applicationId,Pe]);var Be=function(r,o,s){return t(x,void 0,void 0,function(){var t,a,i,l,c,u,p,m,f;return n(this,function(n){switch(n.label){case 0:me(!0),n.label=1;case 1:return n.trys.push([1,8,9,10]),[4,A(r,H.accessToken)];case 2:if(n.sent(),d.getState().selectedRuleSetId===r&&(t=d.getState().scopeTreeData,(a=O((null==t?void 0:t.data)||null,r))&&a.length>1&&(i=a[a.length-2],$(i),he("learnings"))),!s||!o)return[3,6];n.label=3;case 3:return n.trys.push([3,5,,6]),[4,w({station_name:o,ruleset_id:""})];case 4:return n.sent(),[3,6];case 5:return l=n.sent(),console.error("Error unlinking station on subscope delete:",l),[3,6];case 6:return[4,Ue(!0)];case 7:return n.sent(),ie(function(t){return e(e({},t),{isOpen:!1})}),null===(u=Le.current)||void 0===u||u.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,10];case 8:return c=n.sent(),console.error("An error occurred during scope deletion.",c),null===(p=Le.current)||void 0===p||p.show({severity:"error",summary:"Delete Failed",detail:(null===(f=null===(m=null==c?void 0:c.response)||void 0===m?void 0:m.data)||void 0===f?void 0:f.message)||"There was an error deleting the scope. Please try again."}),[3,10];case 9:return me(!1),[7];case 10:return[2]}})})},Me=re,Fe=Ce?{data:{id:Ce.stationId,name:Ce.stationName,type:"STATION",metrics:{learningsCount:Ce.learningsCount,stationsCount:0},children:[]}}:Me,qe=!!(null==Fe?void 0:Fe.data);null===(u=null==Fe?void 0:Fe.data)||void 0===u||u.type;var xe=D(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",Y.applicationResourceId||""),He=Ce?F.filter(function(e){return"stations"!==e.id}):F;return r(_,{children:o("div",e({className:m.learningManagementContainer},{children:[r("div",e({className:m.mainWrapper},{children:ce?r(I,{}):ee?o("div",e({className:m.errorContainer},{children:[r("div",e({className:m.errorTitle},{children:"Error Loading Data"})),r("p",e({className:m.errorDesc},{children:ee})),r("button",e({onClick:function(){return Ue(!0)},className:m.tryAgainBtn},{children:"Try Again"}))]})):qe?r(f,{onOpenCreateModal:function(){return ie({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return ie({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return ie({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(e,r,o){return t(x,void 0,void 0,function(){var t,s,a;return n(this,function(n){switch(n.label){case 0:return t=d.getState().scopeTreeData,s=O((null==t?void 0:t.data)||null,e),a=!!s&&3===s.length,0!==o?[3,2]:[4,Be(e,r,a)];case 1:return n.sent(),[3,3];case 2:ie({isOpen:!0,type:"DELETE",scopeId:e,initialName:r,isSubscope:a}),n.label=3;case 3:return[2]}})})},canDeleteScope:function(e){return De("ilotj.scope.delete",e)},canEditScope:function(e){return De("ilotj.scope.edit",e)},canCreateScope:function(e){return De("ilotj.scope.create",e)},onSectionSelect:function(e,t){console.log("Section Selected:",{scopeId:e,sectionId:t}),he(t),$(e)},activeSectionId:ve,scopeTreeData:Fe,sectionsConfig:He,onViewStation:function(e){we.current=Z,Te(e),he("learnings"),$(e.stationId)},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(Ae.current=t),Ue(e)},nodeTypesConfig:q,app_integration_id:z,token:H.accessToken}):r(v,{onCreate:function(){return ie({isOpen:!0,type:"GLOBAL"})},title:"No Global Scope has been added!",desc:"Start by creating a Global scope to define base learnings that apply across all stations.",button:"Create Global Scope",canCreateRule:xe,noAccessTitle:"Access Restricted",noAccessDesc:"You do not have access to create a Global scope for this application.",onRequestAccess:function(){return t(x,void 0,void 0,function(){var e,t,o,s,a,i,l,c,u;return n(this,function(n){switch(n.label){case 0:if(!(e=(null===(s=null===(o=d.getState().scopeTreeData)||void 0===o?void 0:o.data)||void 0===s?void 0:s.id)||ye))return null===(a=Le.current)||void 0===a||a.show({severity:"error",sticky:!1,className:m.errorToast,content:r(M,{message:"Unable to identify the global scope for this access request."})}),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,L(e)];case 2:return n.sent(),null===(i=Le.current)||void 0===i||i.show({severity:"success",sticky:!1,life:3e3,className:m.successToast,content:r(B,{message:"Access request submitted successfully!"})}),[3,4];case 3:return t=n.sent(),null===(l=Le.current)||void 0===l||l.show({severity:"error",sticky:!1,className:m.errorToast,content:r(M,{message:(null===(u=null===(c=null==t?void 0:t.response)||void 0===c?void 0:c.data)||void 0===u?void 0:u.detail)||"Failed to request access. Please try again."})}),[3,4];case 4:return[2]}})})}})})),r(p,{ref:Le}),X&&ae.isOpen&&"DELETE"!==ae.type&&"RENAME"!==ae.type?r(k,{isOpen:!0,onClose:function(){return ie(e(e({},ae),{isOpen:!1}))},onSubmit:function(r){return t(x,void 0,void 0,function(){var t,o,s,a,i,l,c,u,p,m,f,v,h,g,y,T,w,A,L,E;return n(this,function(n){switch(n.label){case 0:me(!0),t=d.getState().backwardCompatibility,n.label=1;case 1:return n.trys.push([1,12,13,14]),o=void 0,t&&"object"==typeof r?o=r:(s=r,a="SCOPE"===ae.type&&ae.parentId,i=a?"genreRuleSet":ae.type,o={topic:i,scope_reference_id:null,scopeDescription:"demo",parentScopeId:ae.parentId||null,scopeName:s,scopeReferenceMetadata:{},applicationMappingId:z}),[4,C(o,H.accessToken)];case 2:if(l=n.sent(),!(c=null===(g=null==l?void 0:l.data)||void 0===g?void 0:g.scopeId))return[3,10];if(Ae.current=c,u=t&&(null===(y=o.topic)||void 0===y?void 0:y.toLowerCase().includes("genre")),p=!t&&"GLOBAL"!==ae.type&&ae.parentId,!u&&!p)return[3,10];if(!(m=t?null===(w=null===(T=d.getState().scopeTreeData)||void 0===T?void 0:T.data)||void 0===w?void 0:w.id:ae.parentId))return[3,10];if(!X)return[3,7];n.label=3;case 3:return n.trys.push([3,5,,6]),[4,b({source_scope_id:m,target_scope_id:c})];case 4:return n.sent(),[3,6];case 5:return f=n.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,6];case 6:return[3,10];case 7:return n.trys.push([7,9,,10]),[4,S({source_scope_id:m,target_scope_id:c,application_mapping_id:z||"",is_copy_parent_variant_id:!1})];case 8:return n.sent(),[3,10];case 9:return v=n.sent(),console.error("Failed to inherit rules for the new scope:",v),[3,10];case 10:return[4,Ue(!0)];case 11:return n.sent(),ie(function(t){return e(e({},t),{isOpen:!1})}),[3,14];case 12:throw h=n.sent(),console.error("An error occurred during scope creation.",h),null===(A=Le.current)||void 0===A||A.show({severity:"error",summary:"Creation Failed",detail:(null===(E=null===(L=null==h?void 0:h.response)||void 0===L?void 0:L.data)||void 0===E?void 0:E.message)||"There was an error creating the scope. Please try again."}),h;case 13:return me(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:qe,canCreateGlobal:xe}):r(G,{isOpen:ae.isOpen&&"DELETE"!==ae.type,onClose:function(){return ie(e(e({},ae),{isOpen:!1}))},onCreate:function(r){return o=null!=r?r:"",t(x,void 0,void 0,function(){var t,r,s,a;return n(this,function(n){switch(n.label){case 0:me(!0),n.label=1;case 1:return n.trys.push([1,4,5,6]),ae.scopeId?[4,T({scope_id:ae.scopeId,scope_name:o})]:[2];case 2:return n.sent(),[4,Ue(!0)];case 3:return n.sent(),ie(function(t){return e(e({},t),{isOpen:!1})}),[3,6];case 4:throw t=n.sent(),console.error("An error occurred during scope rename.",t),null===(r=Le.current)||void 0===r||r.show({severity:"error",summary:"Rename Failed",detail:(null===(a=null===(s=null==t?void 0:t.response)||void 0===s?void 0:s.data)||void 0===a?void 0:a.message)||"There was an error renaming the scope. Please try again."}),t;case 5:return me(!1),[7];case 6:return[2]}})});var o},hasGlobalRuleSet:qe}),r(E,{isOpen:ae.isOpen&&"DELETE"===ae.type,onCancel:function(){return ie(e(e({},ae),{isOpen:!1}))},onConfirm:function(){return Be(ae.scopeId,ae.initialName,ae.isSubscope)},title:"Delete Scope",description:o(s,{children:["Deleting ",r("span",e({className:m.highlight},{children:ae.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:pe})]}))})}export{x as default};
2
2
  //# sourceMappingURL=LearningManagement.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import t from"./RuleContent/RuleContent.js";import i from"./StationsContent/StationsContent.js";import a from"./RBAC/AccessPanel.js";import r from"./styles/LearningTemplateLayout.module.css.js";import{findNodeById as s}from"./utils/treeUtils.js";import l from"./SidebarWrapper.js";import{useLearningTemplateStore as c}from"./store/useLearningTemplateStore.js";import d from"./components/StationOnboarding/StationOnboardModal.js";var p=function(p){var m,u=p.onOpenCreateModal,S=p.onRefreshRuleSets,f=p.scopeTreeData,C=p.onAddChild,v=p.onRenameChild,h=p.onDeleteChild,R=p.canDeleteScope,g=p.canEditScope,j=p.canCreateScope,O=p.onSectionSelect,D=p.onViewStation,T=p.activeSectionId,_=void 0===T?"learnings":T,y=p.sectionsConfig,I=p.nodeTypesConfig,M=p.app_integration_id,b=p.token,k=c(function(e){return e.isStationModalOpen}),w=c(function(e){return e.setStationModalOpen}),A=c(function(e){return e.selectedRuleSetId}),x=A?s((null==f?void 0:f.data)||null,A):null;return n("div",e({className:r.container},{children:[o(l,{onOpenCreateModal:u,onRefreshRuleSets:S,scopeTreeData:f,onAddChild:C,onRenameChild:v,onDeleteChild:h,canDeleteScope:R,canEditScope:g,canCreateScope:j,onSectionSelect:O,activeSectionId:_,sectionsConfig:y,nodeTypesConfig:I}),o("div",e({id:"rule-template-layout-content",className:"".concat(r.content," relative flex-1 overflow-hidden")},{children:"stations"===_?o(i,{scopeId:A||"",scopeName:(null==x?void 0:x.name)||"Unknown Scope",stationsCount:null===(m=null==x?void 0:x.metrics)||void 0===m?void 0:m.stationsCount,onViewStation:D}):"access"===_?o(a,{ruleSetId:A}):o(t,{onRefreshRuleSets:S,app_integration_id:M,token:b})})),o(d,{isOpen:k,onClose:function(){w(!1)},onBoardStation:function(e){S(!0,e)},app_integration_id:M,token:b})]}))};export{p as default};
1
+ import{__assign as e}from"tslib";import{jsxs as o,jsx as t}from"react/jsx-runtime";import n from"./RuleContent/RuleContent.js";import i from"./StationsContent/StationsContent.js";import a from"./RBAC/AccessManagementPanel.js";import"appsec-ui";import"./store/useAuthStore.js";import"./store/usePermissionsStore.js";import"./store/useEnvStore.js";import r from"./styles/LearningTemplateLayout.module.css.js";import{findNodeById as s}from"./utils/treeUtils.js";import l from"./SidebarWrapper.js";import{useLearningTemplateStore as c}from"./store/useLearningTemplateStore.js";import d from"./components/StationOnboarding/StationOnboardModal.js";var p=function(p){var u,m,S=p.onOpenCreateModal,f=p.onRefreshRuleSets,C=p.scopeTreeData,v=p.onAddChild,h=p.onRenameChild,R=p.onDeleteChild,g=p.canDeleteScope,j=p.canEditScope,A=p.canCreateScope,M=p.onSectionSelect,O=p.onViewStation,D=p.activeSectionId,T=void 0===D?"learnings":D,_=p.sectionsConfig,y=p.nodeTypesConfig,I=p.app_integration_id,b=p.token,k=c(function(e){return e.isStationModalOpen}),w=c(function(e){return e.setStationModalOpen}),x=c(function(e){return e.selectedRuleSetId}),B=x?s((null==C?void 0:C.data)||null,x):null,E=Boolean((null===(u=null==C?void 0:C.data)||void 0===u?void 0:u.id)&&x===C.data.id);return o("div",e({className:r.container},{children:[t(l,{onOpenCreateModal:S,onRefreshRuleSets:f,scopeTreeData:C,onAddChild:v,onRenameChild:h,onDeleteChild:R,canDeleteScope:g,canEditScope:j,canCreateScope:A,onSectionSelect:M,activeSectionId:T,sectionsConfig:_,nodeTypesConfig:y}),t("div",e({id:"rule-template-layout-content",className:"".concat(r.content," relative flex-1 overflow-hidden")},{children:"stations"===T?t(i,{scopeId:x||"",scopeName:(null==B?void 0:B.name)||"Unknown Scope",stationsCount:null===(m=null==B?void 0:B.metrics)||void 0===m?void 0:m.stationsCount,onViewStation:O}):"access"===T?t(a,{selectedRuleSetId:x,useApplicationModuleForScopeAccess:E}):t(n,{onRefreshRuleSets:f,app_integration_id:I,token:b})})),t(d,{isOpen:k,onClose:function(){w(!1)},onBoardStation:function(e){f(!0,e)},app_integration_id:I,token:b})]}))};export{p as default};
2
2
  //# sourceMappingURL=LearningTemplateLayout.js.map
@@ -0,0 +1,2 @@
1
+ import{__assign as e}from"tslib";import{jsxs as c,jsx as o}from"react/jsx-runtime";import{useState as s}from"react";import a from"./AccessPanel.js";import t from"../store/useEnvStore.js";import{usePermissionsStore as i}from"../store/usePermissionsStore.js";import l from"./AccessPanel.module.css.js";var n=function(n){var r=n.selectedRuleSetId,p=n.useApplicationModuleForScopeAccess,d=void 0!==p&&p,u=s("scope"),m=u[0],v=u[1],b=t(function(e){return e.rbacConfig}),f=i(function(e){return e.hasPermission}),A=null==b?void 0:b.applicationResourceId,I=(null==b?void 0:b.applicationModuleId)||(null==b?void 0:b.moduleId),h=d?I:null==b?void 0:b.moduleId,j=Boolean(A&&f("ilotj.scope.access.application.view",A));return c("div",e({className:l.accessManagement},{children:[c("div",e({className:l.accessTabs,role:"tablist","aria-label":"Access level"},{children:[o("button",e({type:"button",role:"tab","aria-selected":"scope"===m,className:"".concat(l.accessTab," ").concat("scope"===m?l.accessTabActive:""),onClick:function(){return v("scope")}},{children:"Scope Access"})),o("button",e({type:"button",role:"tab","aria-selected":"application"===m,className:"".concat(l.accessTab," ").concat("application"===m?l.accessTabActive:""),onClick:function(){return v("application")},disabled:!j,title:j?"":"You don't have permission to view application access"},{children:"Application Access"}))]})),o("div",e({className:l.accessTabPanel,role:"tabpanel"},{children:o(a,"application"===m?{resourceId:A,moduleId:I,accessLevel:"application"}:{ruleSetId:r,moduleId:h,accessLevel:"scope"})}))]}))};export{n as default};
2
+ //# sourceMappingURL=AccessManagementPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessManagementPanel.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as o}from"react/jsx-runtime";import{RbacQueryProvider as r,AppsecProvider as s,AccessListPanel as c}from"appsec-ui";import t from"../store/useAuthStore.js";import{usePermissionsStore as n}from"../store/usePermissionsStore.js";import a from"./AccessPanel.module.css.js";import i from"../store/useEnvStore.js";var u=function(u){var l=u.ruleSetId,d=u.moduleId,p=u.mode,m=void 0===p?"both":p,f=t(function(e){return e.user}),j=i(function(e){return e.rbacConfig}),h=i(function(e){return e.appsecRbacUrl}),g=i(function(e){return e.appsecBaseUrl}),v=null==f?void 0:f.accessToken,U=n(function(e){return e.hasPermission}),I=l||void 0,b=Boolean(I),A=b&&U("ilotj.scope.access.user.add",I),S=b&&U("ilotj.scope.access.user.edit",I),P=b&&U("ilotj.scope.access.user.remove",I),E=b&&U("ilotj.scope.access.group.add",I),G=b&&U("ilotj.scope.access.group.role.change",I),N=b&&U("ilotj.scope.access.group.remove",I);return o("div",e({className:a.accessPanel},I&&j&&h&&g?{children:o(r,{children:o(s,e({appId:j.applicationName,baseUrl:h,appsecUrl:g,mode:"manage",getAuthToken:function(){return null!=v?v:""}},{children:o(c,{resourceId:I,moduleId:d||j.moduleId,mode:m,canAddUser:A,canEditUser:S,canDeleteUser:P,canAddGroup:E,canEditGroup:G,canDeleteGroup:N})}))})}:{children:o("p",e({className:a.emptyState},{children:"Waiting for access configuration..."}))}))};export{u as default};
1
+ import{__assign as e}from"tslib";import{jsx as o}from"react/jsx-runtime";import{RbacQueryProvider as r,AppsecProvider as c,AccessListPanel as a}from"appsec-ui";import n from"../store/useAuthStore.js";import{usePermissionsStore as s}from"../store/usePermissionsStore.js";import t from"./AccessPanel.module.css.js";import i from"../store/useEnvStore.js";var u=function(u){var d=u.ruleSetId,l=u.resourceId,p=u.moduleId,m=u.accessLevel,f=void 0===m?"scope":m,v=u.mode,g=void 0===v?"both":v;u.canManageAppAccess;var h=n(function(e){return e.user}),I=i(function(e){return e.rbacConfig}),j=i(function(e){return e.appsecRbacUrl}),A=i(function(e){return e.appsecBaseUrl}),U=null==h?void 0:h.accessToken,b=s(function(e){return e.hasPermission}),P=l||d||void 0,S=Boolean(P),N="application"===f,E=N?"ilotj.scope.access.application":"ilotj.scope.access",G=S&&b("".concat(E,".user.add"),P),k=S&&b("".concat(E,".user.edit"),P),x=S&&b("".concat(E,".user.remove"),P),B=S&&b("".concat(E,".group.add"),P),D=S&&b("".concat(E,".group.role.change"),P),M=S&&b("".concat(E,".group.remove"),P);if(!(P&&I&&j&&A))return o("div",e({className:t.accessPanel},{children:o("p",e({className:t.emptyState},{children:"Waiting for access configuration..."}))}));var T=N?I.applicationModuleId||p||I.moduleId:p||I.moduleId;return o("div",e({className:t.accessPanel},{children:o(r,{children:o(c,e({appId:I.applicationName,baseUrl:j,appsecUrl:A,mode:"manage",getAuthToken:function(){return null!=U?U:""}},{children:o(a,{resourceId:P,moduleId:T,mode:g,canAddUser:G,canEditUser:k,canDeleteUser:x,canAddGroup:B,canEditGroup:D,canDeleteGroup:M})}))})}))};export{u as default};
2
2
  //# sourceMappingURL=AccessPanel.js.map
@@ -1,2 +1,2 @@
1
- import e from"../../../node_modules/style-inject/dist/style-inject.es.js";var s={accessPanel:"AccessPanel-module_accessPanel__RXDzY",emptyState:"AccessPanel-module_emptyState__EAuao"};e(".AccessPanel-module_accessPanel__RXDzY{--appsec-bg:#fff;--appsec-surface:#f9fafb;--appsec-surface-alt:#f2f4f7;--appsec-border:#d0d5dd;--appsec-text:#101828;--appsec-text-secondary:#475467;--appsec-text-tertiary:#667085;--appsec-primary:#2563eb;--appsec-primary-light:#eff6ff;--appsec-danger:#dc2626;--appsec-danger-light:#fef2f2;--appsec-success:#16a34a;--appsec-success-light:#f0fdf4;--appsec-warning:#d97706;--appsec-warning-light:#fffbeb;box-sizing:border-box;color:#101828;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:14px;height:100%;overflow:auto;padding:16px;width:100%}.AccessPanel-module_emptyState__EAuao{color:#667085;font-size:14px;margin:0}.AccessPanel-module_accessPanel__RXDzY *{box-sizing:border-box}.AccessPanel-module_accessPanel__RXDzY button,.AccessPanel-module_accessPanel__RXDzY input,.AccessPanel-module_accessPanel__RXDzY select,.AccessPanel-module_accessPanel__RXDzY textarea{font:inherit}.AccessPanel-module_accessPanel__RXDzY button{background:#0000;border:0;cursor:pointer}.AccessPanel-module_accessPanel__RXDzY p{margin:0}.AccessPanel-module_accessPanel__RXDzY .fixed{position:fixed}.AccessPanel-module_accessPanel__RXDzY .inset-0{inset:0}.AccessPanel-module_accessPanel__RXDzY .top-0{top:0}.AccessPanel-module_accessPanel__RXDzY .right-0{right:0}.AccessPanel-module_accessPanel__RXDzY .bottom-0{bottom:0}.AccessPanel-module_accessPanel__RXDzY .left-0{left:0}.AccessPanel-module_accessPanel__RXDzY .top-2{top:8px}.AccessPanel-module_accessPanel__RXDzY .top-4{top:16px}.AccessPanel-module_accessPanel__RXDzY .right-2{right:8px}.AccessPanel-module_accessPanel__RXDzY .right-4{right:16px}.AccessPanel-module_accessPanel__RXDzY .left-3{left:12px}.AccessPanel-module_accessPanel__RXDzY .right-2\\.5{right:10px}.AccessPanel-module_accessPanel__RXDzY .top-1\\.5{top:6px}.AccessPanel-module_accessPanel__RXDzY .top-2\\.5{top:10px}.AccessPanel-module_accessPanel__RXDzY .top-1\\/2{top:50%}.AccessPanel-module_accessPanel__RXDzY .left-1\\/2{left:50%}.AccessPanel-module_accessPanel__RXDzY .-translate-x-1\\/2{transform:translateX(-50%)}.AccessPanel-module_accessPanel__RXDzY .-translate-y-1\\/2{transform:translateY(-50%)}.AccessPanel-module_accessPanel__RXDzY .bg-black\\/40{background-color:#0006}.AccessPanel-module_accessPanel__RXDzY .bg-black\\/50{background-color:#00000080}.AccessPanel-module_accessPanel__RXDzY .flex{display:flex}.AccessPanel-module_accessPanel__RXDzY .inline-flex{display:inline-flex}.AccessPanel-module_accessPanel__RXDzY .block{display:block}.AccessPanel-module_accessPanel__RXDzY .inline-block{display:inline-block}.AccessPanel-module_accessPanel__RXDzY .hidden{display:none}.AccessPanel-module_accessPanel__RXDzY .grid{display:grid}.AccessPanel-module_accessPanel__RXDzY .flex-col{flex-direction:column}.AccessPanel-module_accessPanel__RXDzY .flex-row{flex-direction:row}.AccessPanel-module_accessPanel__RXDzY .flex-wrap{flex-wrap:wrap}.AccessPanel-module_accessPanel__RXDzY .flex-nowrap{flex-wrap:nowrap}.AccessPanel-module_accessPanel__RXDzY .flex-1{flex:1 1 0%}.AccessPanel-module_accessPanel__RXDzY .flex-auto{flex:1 1 auto}.AccessPanel-module_accessPanel__RXDzY .flex-none{flex:none}.AccessPanel-module_accessPanel__RXDzY .shrink-0{flex-shrink:0}.AccessPanel-module_accessPanel__RXDzY .grow{flex-grow:1}.AccessPanel-module_accessPanel__RXDzY .items-center{align-items:center}.AccessPanel-module_accessPanel__RXDzY .items-start{align-items:flex-start}.AccessPanel-module_accessPanel__RXDzY .items-end{align-items:flex-end}.AccessPanel-module_accessPanel__RXDzY .items-stretch{align-items:stretch}.AccessPanel-module_accessPanel__RXDzY .justify-center{justify-content:center}.AccessPanel-module_accessPanel__RXDzY .justify-between{justify-content:space-between}.AccessPanel-module_accessPanel__RXDzY .justify-end{justify-content:flex-end}.AccessPanel-module_accessPanel__RXDzY .justify-start{justify-content:flex-start}.AccessPanel-module_accessPanel__RXDzY .self-center{align-self:center}.AccessPanel-module_accessPanel__RXDzY .self-start{align-self:flex-start}.AccessPanel-module_accessPanel__RXDzY .self-end{align-self:flex-end}.AccessPanel-module_accessPanel__RXDzY .gap-0{gap:0}.AccessPanel-module_accessPanel__RXDzY .gap-0\\.5{gap:2px}.AccessPanel-module_accessPanel__RXDzY .gap-1{gap:4px}.AccessPanel-module_accessPanel__RXDzY .gap-1\\.5{gap:6px}.AccessPanel-module_accessPanel__RXDzY .gap-2{gap:8px}.AccessPanel-module_accessPanel__RXDzY .gap-2\\.5{gap:10px}.AccessPanel-module_accessPanel__RXDzY .gap-3{gap:12px}.AccessPanel-module_accessPanel__RXDzY .gap-4{gap:16px}.AccessPanel-module_accessPanel__RXDzY .gap-5{gap:20px}.AccessPanel-module_accessPanel__RXDzY .gap-6{gap:24px}.AccessPanel-module_accessPanel__RXDzY .gap-x-2{column-gap:8px}.AccessPanel-module_accessPanel__RXDzY .gap-x-3{column-gap:12px}.AccessPanel-module_accessPanel__RXDzY .gap-y-2{row-gap:8px}.AccessPanel-module_accessPanel__RXDzY .gap-y-3{row-gap:12px}.AccessPanel-module_accessPanel__RXDzY .space-y-1>:not([hidden])~:not([hidden]){margin-top:4px}.AccessPanel-module_accessPanel__RXDzY .space-y-2>:not([hidden])~:not([hidden]){margin-top:8px}.AccessPanel-module_accessPanel__RXDzY .space-y-3>:not([hidden])~:not([hidden]){margin-top:12px}.AccessPanel-module_accessPanel__RXDzY .space-y-4>:not([hidden])~:not([hidden]){margin-top:16px}.AccessPanel-module_accessPanel__RXDzY .space-x-2>:not([hidden])~:not([hidden]){margin-left:8px}.AccessPanel-module_accessPanel__RXDzY .space-x-3>:not([hidden])~:not([hidden]){margin-left:12px}.AccessPanel-module_accessPanel__RXDzY .relative{position:relative}.AccessPanel-module_accessPanel__RXDzY .absolute{position:absolute}.AccessPanel-module_accessPanel__RXDzY .sticky{position:sticky}.AccessPanel-module_accessPanel__RXDzY .z-10{z-index:10}.AccessPanel-module_accessPanel__RXDzY .z-20{z-index:20}.AccessPanel-module_accessPanel__RXDzY .z-50{z-index:50}.AccessPanel-module_accessPanel__RXDzY .z-100{z-index:100}.AccessPanel-module_accessPanel__RXDzY .pointer-events-none{pointer-events:none}.AccessPanel-module_accessPanel__RXDzY .pointer-events-auto{pointer-events:auto}.AccessPanel-module_accessPanel__RXDzY .w-full{width:100%}.AccessPanel-module_accessPanel__RXDzY .h-full{height:100%}.AccessPanel-module_accessPanel__RXDzY .w-auto{width:auto}.AccessPanel-module_accessPanel__RXDzY .h-auto{height:auto}.AccessPanel-module_accessPanel__RXDzY .w-fit{width:fit-content}.AccessPanel-module_accessPanel__RXDzY .w-3{width:12px}.AccessPanel-module_accessPanel__RXDzY .h-3{height:12px}.AccessPanel-module_accessPanel__RXDzY .w-3\\.5{width:14px}.AccessPanel-module_accessPanel__RXDzY .h-3\\.5{height:14px}.AccessPanel-module_accessPanel__RXDzY .w-4{width:16px}.AccessPanel-module_accessPanel__RXDzY .h-4{height:16px}.AccessPanel-module_accessPanel__RXDzY .w-5{width:20px}.AccessPanel-module_accessPanel__RXDzY .h-5{height:20px}.AccessPanel-module_accessPanel__RXDzY .w-6{width:24px}.AccessPanel-module_accessPanel__RXDzY .h-6{height:24px}.AccessPanel-module_accessPanel__RXDzY .w-7{width:28px}.AccessPanel-module_accessPanel__RXDzY .h-7{height:28px}.AccessPanel-module_accessPanel__RXDzY .w-8{width:32px}.AccessPanel-module_accessPanel__RXDzY .h-8{height:32px}.AccessPanel-module_accessPanel__RXDzY .w-9{width:36px}.AccessPanel-module_accessPanel__RXDzY .h-9{height:36px}.AccessPanel-module_accessPanel__RXDzY .w-10{width:40px}.AccessPanel-module_accessPanel__RXDzY .h-10{height:40px}.AccessPanel-module_accessPanel__RXDzY .w-12{width:48px}.AccessPanel-module_accessPanel__RXDzY .h-12{height:48px}.AccessPanel-module_accessPanel__RXDzY .w-14{width:56px}.AccessPanel-module_accessPanel__RXDzY .w-16{width:64px}.AccessPanel-module_accessPanel__RXDzY .w-20{width:80px}.AccessPanel-module_accessPanel__RXDzY .w-24{width:96px}.AccessPanel-module_accessPanel__RXDzY .w-28{width:112px}.AccessPanel-module_accessPanel__RXDzY .w-32{width:128px}.AccessPanel-module_accessPanel__RXDzY .w-40{width:160px}.AccessPanel-module_accessPanel__RXDzY .w-48{width:192px}.AccessPanel-module_accessPanel__RXDzY .w-64{width:256px}.AccessPanel-module_accessPanel__RXDzY .w-80{width:320px}.AccessPanel-module_accessPanel__RXDzY .min-w-0{min-width:0}.AccessPanel-module_accessPanel__RXDzY .min-w-32{min-width:128px}.AccessPanel-module_accessPanel__RXDzY .min-w-40{min-width:160px}.AccessPanel-module_accessPanel__RXDzY .min-w-48{min-width:192px}.AccessPanel-module_accessPanel__RXDzY .max-w-xs{max-width:320px}.AccessPanel-module_accessPanel__RXDzY .max-w-sm{max-width:384px}.AccessPanel-module_accessPanel__RXDzY .max-w-md{max-width:448px}.AccessPanel-module_accessPanel__RXDzY .max-w-lg{max-width:512px}.AccessPanel-module_accessPanel__RXDzY .max-w-full{max-width:100%}.AccessPanel-module_accessPanel__RXDzY .max-h-60{max-height:240px}.AccessPanel-module_accessPanel__RXDzY .max-h-72{max-height:288px}.AccessPanel-module_accessPanel__RXDzY .max-h-96{max-height:384px}.AccessPanel-module_accessPanel__RXDzY .min-h-0{min-height:0}.AccessPanel-module_accessPanel__RXDzY .rounded-none{border-radius:0}.AccessPanel-module_accessPanel__RXDzY .rounded-sm{border-radius:2px}.AccessPanel-module_accessPanel__RXDzY .rounded{border-radius:4px}.AccessPanel-module_accessPanel__RXDzY .rounded-md{border-radius:6px}.AccessPanel-module_accessPanel__RXDzY .rounded-lg{border-radius:8px}.AccessPanel-module_accessPanel__RXDzY .rounded-xl{border-radius:12px}.AccessPanel-module_accessPanel__RXDzY .rounded-2xl{border-radius:16px}.AccessPanel-module_accessPanel__RXDzY .rounded-full{border-radius:9999px}.AccessPanel-module_accessPanel__RXDzY .rounded-appsec{border-radius:8px}.AccessPanel-module_accessPanel__RXDzY .rounded-t-lg{border-top-left-radius:8px;border-top-right-radius:8px}.AccessPanel-module_accessPanel__RXDzY .rounded-b-lg{border-bottom-left-radius:8px;border-bottom-right-radius:8px}.AccessPanel-module_accessPanel__RXDzY .rounded-l-lg{border-bottom-left-radius:8px;border-top-left-radius:8px}.AccessPanel-module_accessPanel__RXDzY .rounded-r-lg{border-bottom-right-radius:8px;border-top-right-radius:8px}.AccessPanel-module_accessPanel__RXDzY .rounded-t-md{border-top-left-radius:6px;border-top-right-radius:6px}.AccessPanel-module_accessPanel__RXDzY .rounded-b-md{border-bottom-left-radius:6px;border-bottom-right-radius:6px}.AccessPanel-module_accessPanel__RXDzY .rounded-t-xl{border-top-left-radius:12px;border-top-right-radius:12px}.AccessPanel-module_accessPanel__RXDzY .rounded-b-xl{border-bottom-left-radius:12px;border-bottom-right-radius:12px}.AccessPanel-module_accessPanel__RXDzY .border{border:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-0{border:0}.AccessPanel-module_accessPanel__RXDzY .border-2{border:2px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-t{border-top:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-b{border-bottom:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-l{border-left:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-r{border-right:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-t-0{border-top:0}.AccessPanel-module_accessPanel__RXDzY .border-b-0{border-bottom:0}.AccessPanel-module_accessPanel__RXDzY .border-appsec-border{border-color:var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-appsec-primary{border-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .border-appsec-danger{border-color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .border-transparent{border-color:#0000}.AccessPanel-module_accessPanel__RXDzY .border-gray-200{border-color:#eaecf0}.AccessPanel-module_accessPanel__RXDzY .border-blue-200{border-color:#bfdbfe}.AccessPanel-module_accessPanel__RXDzY .divide-y>:not([hidden])~:not([hidden]){border-top:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .divide-x>:not([hidden])~:not([hidden]){border-left:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY [role=tablist]{background:var(--appsec-surface);border:1px solid var(--appsec-border);border-radius:8px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.AccessPanel-module_accessPanel__RXDzY [role=tab]{background:#0000;border:none;border-radius:0;color:var(--appsec-text-secondary);cursor:pointer;font-size:13px;font-weight:400;padding:8px 12px;text-align:center;transition:background .12s,color .12s;white-space:nowrap}.AccessPanel-module_accessPanel__RXDzY [role=tab].active,.AccessPanel-module_accessPanel__RXDzY [role=tab][aria-selected=true],.AccessPanel-module_accessPanel__RXDzY [role=tab][data-state=active]{background:var(--appsec-primary);color:#fff;font-weight:500}.AccessPanel-module_accessPanel__RXDzY [role=tab]:not([aria-selected=true]):not([data-state=active]):not(.active):hover{background:var(--appsec-surface-alt);color:var(--appsec-text)}.AccessPanel-module_accessPanel__RXDzY .overflow-hidden{overflow:hidden}.AccessPanel-module_accessPanel__RXDzY .overflow-auto{overflow:auto}.AccessPanel-module_accessPanel__RXDzY .overflow-y-auto{overflow-y:auto}.AccessPanel-module_accessPanel__RXDzY .overflow-x-auto{overflow-x:auto}.AccessPanel-module_accessPanel__RXDzY .overflow-visible{overflow:visible}.AccessPanel-module_accessPanel__RXDzY .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AccessPanel-module_accessPanel__RXDzY .whitespace-nowrap{white-space:nowrap}.AccessPanel-module_accessPanel__RXDzY .whitespace-normal{white-space:normal}.AccessPanel-module_accessPanel__RXDzY .break-words{overflow-wrap:break-word}.AccessPanel-module_accessPanel__RXDzY .break-all{word-break:break-all}.AccessPanel-module_accessPanel__RXDzY .text-left{text-align:left}.AccessPanel-module_accessPanel__RXDzY .text-center{text-align:center}.AccessPanel-module_accessPanel__RXDzY .text-right{text-align:right}.AccessPanel-module_accessPanel__RXDzY .text-xs{font-size:12px;line-height:16px}.AccessPanel-module_accessPanel__RXDzY .text-sm{font-size:14px;line-height:20px}.AccessPanel-module_accessPanel__RXDzY .text-base{font-size:16px;line-height:24px}.AccessPanel-module_accessPanel__RXDzY .text-lg{font-size:18px;line-height:28px}.AccessPanel-module_accessPanel__RXDzY .text-xl{font-size:20px;line-height:28px}.AccessPanel-module_accessPanel__RXDzY .text-2xl{font-size:24px;line-height:32px}.AccessPanel-module_accessPanel__RXDzY .text-\\[10px\\]{font-size:10px;line-height:14px}.AccessPanel-module_accessPanel__RXDzY .text-\\[11px\\]{font-size:11px;line-height:16px}.AccessPanel-module_accessPanel__RXDzY .text-\\[13px\\]{font-size:13px;line-height:18px}.AccessPanel-module_accessPanel__RXDzY .font-normal{font-weight:400}.AccessPanel-module_accessPanel__RXDzY .font-medium{font-weight:500}.AccessPanel-module_accessPanel__RXDzY .font-semibold{font-weight:600}.AccessPanel-module_accessPanel__RXDzY .font-bold{font-weight:700}.AccessPanel-module_accessPanel__RXDzY .italic{font-style:italic}.AccessPanel-module_accessPanel__RXDzY .not-italic{font-style:normal}.AccessPanel-module_accessPanel__RXDzY .uppercase{text-transform:uppercase}.AccessPanel-module_accessPanel__RXDzY .lowercase{text-transform:lowercase}.AccessPanel-module_accessPanel__RXDzY .capitalize{text-transform:capitalize}.AccessPanel-module_accessPanel__RXDzY .normal-case{text-transform:none}.AccessPanel-module_accessPanel__RXDzY .underline{text-decoration:underline}.AccessPanel-module_accessPanel__RXDzY .no-underline{text-decoration:none}.AccessPanel-module_accessPanel__RXDzY .line-through{text-decoration:line-through}.AccessPanel-module_accessPanel__RXDzY .leading-none{line-height:1}.AccessPanel-module_accessPanel__RXDzY .leading-tight{line-height:1.25}.AccessPanel-module_accessPanel__RXDzY .leading-snug{line-height:1.375}.AccessPanel-module_accessPanel__RXDzY .leading-normal{line-height:1.5}.AccessPanel-module_accessPanel__RXDzY .leading-relaxed{line-height:1.625}.AccessPanel-module_accessPanel__RXDzY .text-white{color:#fff}.AccessPanel-module_accessPanel__RXDzY .text-black{color:#000}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text{color:var(--appsec-text)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text-secondary{color:var(--appsec-text-secondary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text-tertiary{color:var(--appsec-text-tertiary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-primary{color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-danger{color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-success{color:var(--appsec-success)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-warning{color:var(--appsec-warning)}.AccessPanel-module_accessPanel__RXDzY .text-gray-400{color:#98a2b3}.AccessPanel-module_accessPanel__RXDzY .text-gray-500{color:#667085}.AccessPanel-module_accessPanel__RXDzY .text-gray-600{color:#475467}.AccessPanel-module_accessPanel__RXDzY .text-gray-700{color:#344054}.AccessPanel-module_accessPanel__RXDzY .text-gray-900{color:#101828}.AccessPanel-module_accessPanel__RXDzY .text-blue-600{color:#2563eb}.AccessPanel-module_accessPanel__RXDzY .text-blue-700{color:#1d4ed8}.AccessPanel-module_accessPanel__RXDzY .text-red-600{color:#dc2626}.AccessPanel-module_accessPanel__RXDzY .text-red-700{color:#b91c1c}.AccessPanel-module_accessPanel__RXDzY .text-green-600{color:#16a34a}.AccessPanel-module_accessPanel__RXDzY .text-green-700{color:#15803d}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-bg{background-color:var(--appsec-bg)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-surface{background-color:var(--appsec-surface)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-surface-alt{background-color:var(--appsec-surface-alt)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-primary{background-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-primary-light{background-color:var(--appsec-primary-light)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-danger{background-color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-danger-light{background-color:var(--appsec-danger-light)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-success-light{background-color:var(--appsec-success-light)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-warning-light{background-color:var(--appsec-warning-light)}.AccessPanel-module_accessPanel__RXDzY .bg-transparent{background-color:initial}.AccessPanel-module_accessPanel__RXDzY .bg-white{background-color:#fff}.AccessPanel-module_accessPanel__RXDzY .bg-gray-50{background-color:#f9fafb}.AccessPanel-module_accessPanel__RXDzY .bg-gray-100{background-color:#f2f4f7}.AccessPanel-module_accessPanel__RXDzY .bg-gray-200{background-color:#eaecf0}.AccessPanel-module_accessPanel__RXDzY .bg-blue-50{background-color:#eff6ff}.AccessPanel-module_accessPanel__RXDzY .bg-blue-600{background-color:#2563eb}.AccessPanel-module_accessPanel__RXDzY .bg-red-50{background-color:#fef2f2}.AccessPanel-module_accessPanel__RXDzY .bg-red-600{background-color:#dc2626}.AccessPanel-module_accessPanel__RXDzY .bg-green-50{background-color:#f0fdf4}.AccessPanel-module_accessPanel__RXDzY .bg-yellow-50{background-color:#fffbeb}.AccessPanel-module_accessPanel__RXDzY .bg-blue-500{background-color:#3b82f6}.AccessPanel-module_accessPanel__RXDzY .bg-purple-500{background-color:#a855f7}.AccessPanel-module_accessPanel__RXDzY .bg-green-600{background-color:#16a34a}.AccessPanel-module_accessPanel__RXDzY .bg-orange-500{background-color:#f97316}.AccessPanel-module_accessPanel__RXDzY .bg-pink-500{background-color:#ec4899}.AccessPanel-module_accessPanel__RXDzY .bg-teal-500{background-color:#14b8a6}.AccessPanel-module_accessPanel__RXDzY .bg-indigo-500{background-color:#6366f1}.AccessPanel-module_accessPanel__RXDzY .bg-rose-500{background-color:#f43f5e}.AccessPanel-module_accessPanel__RXDzY .p-0{padding:0}.AccessPanel-module_accessPanel__RXDzY .p-0\\.5{padding:2px}.AccessPanel-module_accessPanel__RXDzY .p-1{padding:4px}.AccessPanel-module_accessPanel__RXDzY .p-1\\.5{padding:6px}.AccessPanel-module_accessPanel__RXDzY .p-2{padding:8px}.AccessPanel-module_accessPanel__RXDzY .p-2\\.5{padding:10px}.AccessPanel-module_accessPanel__RXDzY .p-3{padding:12px}.AccessPanel-module_accessPanel__RXDzY .p-4{padding:16px}.AccessPanel-module_accessPanel__RXDzY .p-5{padding:20px}.AccessPanel-module_accessPanel__RXDzY .p-6{padding:24px}.AccessPanel-module_accessPanel__RXDzY .px-1{padding-left:4px;padding-right:4px}.AccessPanel-module_accessPanel__RXDzY .px-2{padding-left:8px;padding-right:8px}.AccessPanel-module_accessPanel__RXDzY .px-2\\.5{padding-left:10px;padding-right:10px}.AccessPanel-module_accessPanel__RXDzY .px-3{padding-left:12px;padding-right:12px}.AccessPanel-module_accessPanel__RXDzY .px-4{padding-left:16px;padding-right:16px}.AccessPanel-module_accessPanel__RXDzY .px-5{padding-left:20px;padding-right:20px}.AccessPanel-module_accessPanel__RXDzY .px-6{padding-left:24px;padding-right:24px}.AccessPanel-module_accessPanel__RXDzY .py-0\\.5{padding-bottom:2px;padding-top:2px}.AccessPanel-module_accessPanel__RXDzY .py-1{padding-bottom:4px;padding-top:4px}.AccessPanel-module_accessPanel__RXDzY .py-1\\.5{padding-bottom:6px;padding-top:6px}.AccessPanel-module_accessPanel__RXDzY .py-2{padding-bottom:8px;padding-top:8px}.AccessPanel-module_accessPanel__RXDzY .py-2\\.5{padding-bottom:10px;padding-top:10px}.AccessPanel-module_accessPanel__RXDzY .py-3{padding-bottom:12px;padding-top:12px}.AccessPanel-module_accessPanel__RXDzY .py-4{padding-bottom:16px;padding-top:16px}.AccessPanel-module_accessPanel__RXDzY .py-5{padding-bottom:20px;padding-top:20px}.AccessPanel-module_accessPanel__RXDzY .py-6{padding-bottom:24px;padding-top:24px}.AccessPanel-module_accessPanel__RXDzY .py-8{padding-bottom:32px;padding-top:32px}.AccessPanel-module_accessPanel__RXDzY .pt-0{padding-top:0}.AccessPanel-module_accessPanel__RXDzY .pt-1{padding-top:4px}.AccessPanel-module_accessPanel__RXDzY .pt-2{padding-top:8px}.AccessPanel-module_accessPanel__RXDzY .pt-3{padding-top:12px}.AccessPanel-module_accessPanel__RXDzY .pt-4{padding-top:16px}.AccessPanel-module_accessPanel__RXDzY .pb-0{padding-bottom:0}.AccessPanel-module_accessPanel__RXDzY .pb-1{padding-bottom:4px}.AccessPanel-module_accessPanel__RXDzY .pb-2{padding-bottom:8px}.AccessPanel-module_accessPanel__RXDzY .pb-3{padding-bottom:12px}.AccessPanel-module_accessPanel__RXDzY .pb-4{padding-bottom:16px}.AccessPanel-module_accessPanel__RXDzY .pl-0{padding-left:0}.AccessPanel-module_accessPanel__RXDzY .pl-2{padding-left:8px}.AccessPanel-module_accessPanel__RXDzY .pl-3{padding-left:12px}.AccessPanel-module_accessPanel__RXDzY .pl-4{padding-left:16px}.AccessPanel-module_accessPanel__RXDzY .pl-9{padding-left:36px}.AccessPanel-module_accessPanel__RXDzY .pr-0{padding-right:0}.AccessPanel-module_accessPanel__RXDzY .pr-2{padding-right:8px}.AccessPanel-module_accessPanel__RXDzY .pr-3{padding-right:12px}.AccessPanel-module_accessPanel__RXDzY .pr-4{padding-right:16px}.AccessPanel-module_accessPanel__RXDzY .pr-6{padding-right:24px}.AccessPanel-module_accessPanel__RXDzY .pr-8{padding-right:32px}.AccessPanel-module_accessPanel__RXDzY .pr-10{padding-right:40px}.AccessPanel-module_accessPanel__RXDzY .m-0{margin:0}.AccessPanel-module_accessPanel__RXDzY .m-1{margin:4px}.AccessPanel-module_accessPanel__RXDzY .m-2{margin:8px}.AccessPanel-module_accessPanel__RXDzY .m-auto{margin:auto}.AccessPanel-module_accessPanel__RXDzY .mx-auto{margin-left:auto;margin-right:auto}.AccessPanel-module_accessPanel__RXDzY .ml-auto{margin-left:auto}.AccessPanel-module_accessPanel__RXDzY .mr-auto{margin-right:auto}.AccessPanel-module_accessPanel__RXDzY .mt-0{margin-top:0}.AccessPanel-module_accessPanel__RXDzY .mt-1{margin-top:4px}.AccessPanel-module_accessPanel__RXDzY .mt-2{margin-top:8px}.AccessPanel-module_accessPanel__RXDzY .mt-3{margin-top:12px}.AccessPanel-module_accessPanel__RXDzY .mt-4{margin-top:16px}.AccessPanel-module_accessPanel__RXDzY .mt-6{margin-top:24px}.AccessPanel-module_accessPanel__RXDzY .mb-0{margin-bottom:0}.AccessPanel-module_accessPanel__RXDzY .mb-1{margin-bottom:4px}.AccessPanel-module_accessPanel__RXDzY .mb-2{margin-bottom:8px}.AccessPanel-module_accessPanel__RXDzY .mb-3{margin-bottom:12px}.AccessPanel-module_accessPanel__RXDzY .mb-4{margin-bottom:16px}.AccessPanel-module_accessPanel__RXDzY .ml-0{margin-left:0}.AccessPanel-module_accessPanel__RXDzY .ml-1{margin-left:4px}.AccessPanel-module_accessPanel__RXDzY .ml-2{margin-left:8px}.AccessPanel-module_accessPanel__RXDzY .ml-3{margin-left:12px}.AccessPanel-module_accessPanel__RXDzY .mr-0{margin-right:0}.AccessPanel-module_accessPanel__RXDzY .mr-1{margin-right:4px}.AccessPanel-module_accessPanel__RXDzY .mr-2{margin-right:8px}.AccessPanel-module_accessPanel__RXDzY .-mt-px{margin-top:-1px}.AccessPanel-module_accessPanel__RXDzY .shadow-none{box-shadow:none}.AccessPanel-module_accessPanel__RXDzY .shadow-sm{box-shadow:0 1px 2px #1018280f}.AccessPanel-module_accessPanel__RXDzY .shadow{box-shadow:0 1px 3px #1018281a,0 1px 2px #1018280f}.AccessPanel-module_accessPanel__RXDzY .shadow-md{box-shadow:0 4px 8px #10182814,0 2px 4px #1018280a}.AccessPanel-module_accessPanel__RXDzY .shadow-lg{box-shadow:0 12px 24px #1018281f}.AccessPanel-module_accessPanel__RXDzY .shadow-xl{box-shadow:0 20px 40px #10182829}.AccessPanel-module_accessPanel__RXDzY :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea,select){background-color:var(--appsec-bg);border:1px solid var(--appsec-border);border-radius:8px;color:var(--appsec-text);height:36px;outline:none;padding:0 12px;transition:border-color .12s,box-shadow .12s;width:100%}.AccessPanel-module_accessPanel__RXDzY :where(textarea){height:auto;padding:8px 12px;resize:vertical}.AccessPanel-module_accessPanel__RXDzY :where(input[type=text]:focus,input[type=email]:focus,input[type=search]:focus,input[type=password]:focus,textarea:focus,select:focus){border-color:var(--appsec-primary);box-shadow:0 0 0 3px var(--appsec-primary-light)}.AccessPanel-module_accessPanel__RXDzY :where(input::placeholder,textarea::placeholder){color:var(--appsec-text-tertiary)}.AccessPanel-module_accessPanel__RXDzY :where(input[type=checkbox]){accent-color:var(--appsec-primary);height:16px;width:16px}.AccessPanel-module_accessPanel__RXDzY .appearance-none{appearance:none}.AccessPanel-module_accessPanel__RXDzY .outline-none{outline:0}.AccessPanel-module_accessPanel__RXDzY .focus\\:border-appsec-primary:focus{border-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .focus\\:ring-2:focus{box-shadow:0 0 0 3px var(--appsec-primary-light)}.AccessPanel-module_accessPanel__RXDzY .focus\\:outline-none:focus{outline:0}.AccessPanel-module_accessPanel__RXDzY button:hover:not(:disabled){opacity:.92}.AccessPanel-module_accessPanel__RXDzY .disabled\\:opacity-30:disabled,.AccessPanel-module_accessPanel__RXDzY button:disabled{opacity:.3}.AccessPanel-module_accessPanel__RXDzY .disabled\\:opacity-50:disabled{opacity:.5}.AccessPanel-module_accessPanel__RXDzY .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.AccessPanel-module_accessPanel__RXDzY .cursor-pointer{cursor:pointer}.AccessPanel-module_accessPanel__RXDzY .cursor-not-allowed{cursor:not-allowed}.AccessPanel-module_accessPanel__RXDzY .cursor-default{cursor:default}.AccessPanel-module_accessPanel__RXDzY .select-none{user-select:none}.AccessPanel-module_accessPanel__RXDzY .select-text{user-select:text}.AccessPanel-module_accessPanel__RXDzY .opacity-0{opacity:0}.AccessPanel-module_accessPanel__RXDzY .opacity-30{opacity:.3}.AccessPanel-module_accessPanel__RXDzY .opacity-50{opacity:.5}.AccessPanel-module_accessPanel__RXDzY .opacity-75{opacity:.75}.AccessPanel-module_accessPanel__RXDzY .opacity-100{opacity:1}.AccessPanel-module_accessPanel__RXDzY .transition-all{transition:all .15s ease}.AccessPanel-module_accessPanel__RXDzY .transition-colors{transition:color .15s ease,background-color .15s ease,border-color .15s ease}.AccessPanel-module_accessPanel__RXDzY .transition-opacity{transition:opacity .15s ease}.AccessPanel-module_accessPanel__RXDzY .transition-transform{transition:transform .15s ease}.AccessPanel-module_accessPanel__RXDzY .duration-150{transition-duration:.15s}.AccessPanel-module_accessPanel__RXDzY .duration-200{transition-duration:.2s}.AccessPanel-module_accessPanel__RXDzY .duration-300{transition-duration:.3s}.AccessPanel-module_accessPanel__RXDzY .ease-in-out{transition-timing-function:ease-in-out}.AccessPanel-module_accessPanel__RXDzY .rotate-90{transform:rotate(90deg)}.AccessPanel-module_accessPanel__RXDzY .rotate-180{transform:rotate(180deg)}.AccessPanel-module_accessPanel__RXDzY .-rotate-90{transform:rotate(-90deg)}.AccessPanel-module_accessPanel__RXDzY .scale-95{transform:scale(.95)}.AccessPanel-module_accessPanel__RXDzY .scale-100{transform:scale(1)}.AccessPanel-module_accessPanel__RXDzY .list-none{list-style:none}.AccessPanel-module_accessPanel__RXDzY .list-disc{list-style:disc}.AccessPanel-module_accessPanel__RXDzY .object-cover{object-fit:cover}.AccessPanel-module_accessPanel__RXDzY .object-contain{object-fit:contain}.AccessPanel-module_accessPanel__RXDzY .sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.AccessPanel-module_accessPanel__RXDzY .hover\\:bg-appsec-surface:hover{background-color:var(--appsec-surface)}.AccessPanel-module_accessPanel__RXDzY .hover\\:bg-appsec-surface-alt:hover{background-color:var(--appsec-surface-alt)}.AccessPanel-module_accessPanel__RXDzY .hover\\:bg-appsec-danger-light:hover{background-color:var(--appsec-danger-light)}.AccessPanel-module_accessPanel__RXDzY .hover\\:bg-gray-50:hover{background-color:#f9fafb}.AccessPanel-module_accessPanel__RXDzY .hover\\:bg-gray-100:hover{background-color:#f2f4f7}.AccessPanel-module_accessPanel__RXDzY .hover\\:text-appsec-text:hover{color:var(--appsec-text)}.AccessPanel-module_accessPanel__RXDzY .hover\\:text-appsec-danger:hover{color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .hover\\:text-appsec-primary:hover{color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .hover\\:border-appsec-primary:hover{border-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .hover\\:underline:hover{text-decoration:underline}.AccessPanel-module_accessPanel__RXDzY .hover\\:opacity-80:hover{opacity:.8}.AccessPanel-module_accessPanel__RXDzY .hover\\:shadow-md:hover{box-shadow:0 4px 8px #10182814,0 2px 4px #1018280a}.AccessPanel-module_accessPanel__RXDzY .group:hover .group-hover\\:opacity-100{opacity:1}.AccessPanel-module_accessPanel__RXDzY .group-hover\\:opacity-100{opacity:0;transition:opacity .15s}");export{s as default};
1
+ import e from"../../../node_modules/style-inject/dist/style-inject.es.js";var s={accessPanel:"AccessPanel-module_accessPanel__RXDzY",emptyState:"AccessPanel-module_emptyState__EAuao",accessManagement:"AccessPanel-module_accessManagement__3XAwK",accessTabs:"AccessPanel-module_accessTabs__G6baq",accessTab:"AccessPanel-module_accessTab__gUfj-",accessTabActive:"AccessPanel-module_accessTabActive__6ZZzE",accessTabPanel:"AccessPanel-module_accessTabPanel__h458u"};e(".AccessPanel-module_accessPanel__RXDzY{--appsec-bg:#fff;--appsec-surface:#f9fafb;--appsec-surface-alt:#f2f4f7;--appsec-border:#d0d5dd;--appsec-text:#101828;--appsec-text-secondary:#475467;--appsec-text-tertiary:#667085;--appsec-primary:#2563eb;--appsec-primary-light:#eff6ff;--appsec-danger:#dc2626;--appsec-danger-light:#fef2f2;--appsec-success:#16a34a;--appsec-success-light:#f0fdf4;--appsec-warning:#d97706;--appsec-warning-light:#fffbeb;box-sizing:border-box;color:#101828;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:14px;height:100%;overflow:auto;padding:16px;width:100%}.AccessPanel-module_emptyState__EAuao{color:#667085;font-size:14px;margin:0}.AccessPanel-module_accessManagement__3XAwK{background:#fff;display:flex;flex-direction:column;height:100%;min-height:0}.AccessPanel-module_accessTabs__G6baq{align-items:center;border-bottom:1px solid #e4e7ec;display:flex;gap:4px;padding:12px 16px 0}.AccessPanel-module_accessTab__gUfj-{background:#0000;border:0;border-bottom:2px solid #0000;color:#667085;cursor:pointer;font-size:14px;font-weight:600;padding:10px 12px}.AccessPanel-module_accessTab__gUfj-:hover:not(:disabled){color:#101828}.AccessPanel-module_accessTab__gUfj-:disabled{color:#98a2b3;cursor:not-allowed}.AccessPanel-module_accessTabActive__6ZZzE{border-bottom-color:#2563eb;color:#101828}.AccessPanel-module_accessTabPanel__h458u{flex:1;min-height:0;overflow:hidden}.AccessPanel-module_accessPanel__RXDzY *{box-sizing:border-box}.AccessPanel-module_accessPanel__RXDzY button,.AccessPanel-module_accessPanel__RXDzY input,.AccessPanel-module_accessPanel__RXDzY select,.AccessPanel-module_accessPanel__RXDzY textarea{font:inherit}.AccessPanel-module_accessPanel__RXDzY button{background:#0000;border:0;cursor:pointer}.AccessPanel-module_accessPanel__RXDzY p{margin:0}.AccessPanel-module_accessPanel__RXDzY .fixed{position:fixed}.AccessPanel-module_accessPanel__RXDzY .inset-0{inset:0}.AccessPanel-module_accessPanel__RXDzY .top-0{top:0}.AccessPanel-module_accessPanel__RXDzY .right-0{right:0}.AccessPanel-module_accessPanel__RXDzY .bottom-0{bottom:0}.AccessPanel-module_accessPanel__RXDzY .left-0{left:0}.AccessPanel-module_accessPanel__RXDzY .top-2{top:8px}.AccessPanel-module_accessPanel__RXDzY .top-4{top:16px}.AccessPanel-module_accessPanel__RXDzY .right-2{right:8px}.AccessPanel-module_accessPanel__RXDzY .right-4{right:16px}.AccessPanel-module_accessPanel__RXDzY .left-3{left:12px}.AccessPanel-module_accessPanel__RXDzY .right-2\\.5{right:10px}.AccessPanel-module_accessPanel__RXDzY .top-1\\.5{top:6px}.AccessPanel-module_accessPanel__RXDzY .top-2\\.5{top:10px}.AccessPanel-module_accessPanel__RXDzY .top-1\\/2{top:50%}.AccessPanel-module_accessPanel__RXDzY .left-1\\/2{left:50%}.AccessPanel-module_accessPanel__RXDzY .-translate-x-1\\/2{transform:translateX(-50%)}.AccessPanel-module_accessPanel__RXDzY .-translate-y-1\\/2{transform:translateY(-50%)}.AccessPanel-module_accessPanel__RXDzY .bg-black\\/40{background-color:#0006}.AccessPanel-module_accessPanel__RXDzY .bg-black\\/50{background-color:#00000080}.AccessPanel-module_accessPanel__RXDzY .flex{display:flex}.AccessPanel-module_accessPanel__RXDzY .inline-flex{display:inline-flex}.AccessPanel-module_accessPanel__RXDzY .block{display:block}.AccessPanel-module_accessPanel__RXDzY .inline-block{display:inline-block}.AccessPanel-module_accessPanel__RXDzY .hidden{display:none}.AccessPanel-module_accessPanel__RXDzY .grid{display:grid}.AccessPanel-module_accessPanel__RXDzY .flex-col{flex-direction:column}.AccessPanel-module_accessPanel__RXDzY .flex-row{flex-direction:row}.AccessPanel-module_accessPanel__RXDzY .flex-wrap{flex-wrap:wrap}.AccessPanel-module_accessPanel__RXDzY .flex-nowrap{flex-wrap:nowrap}.AccessPanel-module_accessPanel__RXDzY .flex-1{flex:1 1 0%}.AccessPanel-module_accessPanel__RXDzY .flex-auto{flex:1 1 auto}.AccessPanel-module_accessPanel__RXDzY .flex-none{flex:none}.AccessPanel-module_accessPanel__RXDzY .shrink-0{flex-shrink:0}.AccessPanel-module_accessPanel__RXDzY .grow{flex-grow:1}.AccessPanel-module_accessPanel__RXDzY .items-center{align-items:center}.AccessPanel-module_accessPanel__RXDzY .items-start{align-items:flex-start}.AccessPanel-module_accessPanel__RXDzY .items-end{align-items:flex-end}.AccessPanel-module_accessPanel__RXDzY .items-stretch{align-items:stretch}.AccessPanel-module_accessPanel__RXDzY .justify-center{justify-content:center}.AccessPanel-module_accessPanel__RXDzY .justify-between{justify-content:space-between}.AccessPanel-module_accessPanel__RXDzY .justify-end{justify-content:flex-end}.AccessPanel-module_accessPanel__RXDzY .justify-start{justify-content:flex-start}.AccessPanel-module_accessPanel__RXDzY .self-center{align-self:center}.AccessPanel-module_accessPanel__RXDzY .self-start{align-self:flex-start}.AccessPanel-module_accessPanel__RXDzY .self-end{align-self:flex-end}.AccessPanel-module_accessPanel__RXDzY .gap-0{gap:0}.AccessPanel-module_accessPanel__RXDzY .gap-0\\.5{gap:2px}.AccessPanel-module_accessPanel__RXDzY .gap-1{gap:4px}.AccessPanel-module_accessPanel__RXDzY .gap-1\\.5{gap:6px}.AccessPanel-module_accessPanel__RXDzY .gap-2{gap:8px}.AccessPanel-module_accessPanel__RXDzY .gap-2\\.5{gap:10px}.AccessPanel-module_accessPanel__RXDzY .gap-3{gap:12px}.AccessPanel-module_accessPanel__RXDzY .gap-4{gap:16px}.AccessPanel-module_accessPanel__RXDzY .gap-5{gap:20px}.AccessPanel-module_accessPanel__RXDzY .gap-6{gap:24px}.AccessPanel-module_accessPanel__RXDzY .gap-x-2{column-gap:8px}.AccessPanel-module_accessPanel__RXDzY .gap-x-3{column-gap:12px}.AccessPanel-module_accessPanel__RXDzY .gap-y-2{row-gap:8px}.AccessPanel-module_accessPanel__RXDzY .gap-y-3{row-gap:12px}.AccessPanel-module_accessPanel__RXDzY .space-y-1>:not([hidden])~:not([hidden]){margin-top:4px}.AccessPanel-module_accessPanel__RXDzY .space-y-2>:not([hidden])~:not([hidden]){margin-top:8px}.AccessPanel-module_accessPanel__RXDzY .space-y-3>:not([hidden])~:not([hidden]){margin-top:12px}.AccessPanel-module_accessPanel__RXDzY .space-y-4>:not([hidden])~:not([hidden]){margin-top:16px}.AccessPanel-module_accessPanel__RXDzY .space-x-2>:not([hidden])~:not([hidden]){margin-left:8px}.AccessPanel-module_accessPanel__RXDzY .space-x-3>:not([hidden])~:not([hidden]){margin-left:12px}.AccessPanel-module_accessPanel__RXDzY .relative{position:relative}.AccessPanel-module_accessPanel__RXDzY .absolute{position:absolute}.AccessPanel-module_accessPanel__RXDzY .sticky{position:sticky}.AccessPanel-module_accessPanel__RXDzY .z-10{z-index:10}.AccessPanel-module_accessPanel__RXDzY .z-20{z-index:20}.AccessPanel-module_accessPanel__RXDzY .z-50{z-index:50}.AccessPanel-module_accessPanel__RXDzY .z-100{z-index:100}.AccessPanel-module_accessPanel__RXDzY .pointer-events-none{pointer-events:none}.AccessPanel-module_accessPanel__RXDzY .pointer-events-auto{pointer-events:auto}.AccessPanel-module_accessPanel__RXDzY .w-full{width:100%}.AccessPanel-module_accessPanel__RXDzY .h-full{height:100%}.AccessPanel-module_accessPanel__RXDzY .w-auto{width:auto}.AccessPanel-module_accessPanel__RXDzY .h-auto{height:auto}.AccessPanel-module_accessPanel__RXDzY .w-fit{width:fit-content}.AccessPanel-module_accessPanel__RXDzY .w-3{width:12px}.AccessPanel-module_accessPanel__RXDzY .h-3{height:12px}.AccessPanel-module_accessPanel__RXDzY .w-3\\.5{width:14px}.AccessPanel-module_accessPanel__RXDzY .h-3\\.5{height:14px}.AccessPanel-module_accessPanel__RXDzY .w-4{width:16px}.AccessPanel-module_accessPanel__RXDzY .h-4{height:16px}.AccessPanel-module_accessPanel__RXDzY .w-5{width:20px}.AccessPanel-module_accessPanel__RXDzY .h-5{height:20px}.AccessPanel-module_accessPanel__RXDzY .w-6{width:24px}.AccessPanel-module_accessPanel__RXDzY .h-6{height:24px}.AccessPanel-module_accessPanel__RXDzY .w-7{width:28px}.AccessPanel-module_accessPanel__RXDzY .h-7{height:28px}.AccessPanel-module_accessPanel__RXDzY .w-8{width:32px}.AccessPanel-module_accessPanel__RXDzY .h-8{height:32px}.AccessPanel-module_accessPanel__RXDzY .w-9{width:36px}.AccessPanel-module_accessPanel__RXDzY .h-9{height:36px}.AccessPanel-module_accessPanel__RXDzY .w-10{width:40px}.AccessPanel-module_accessPanel__RXDzY .h-10{height:40px}.AccessPanel-module_accessPanel__RXDzY .w-12{width:48px}.AccessPanel-module_accessPanel__RXDzY .h-12{height:48px}.AccessPanel-module_accessPanel__RXDzY .w-14{width:56px}.AccessPanel-module_accessPanel__RXDzY .w-16{width:64px}.AccessPanel-module_accessPanel__RXDzY .w-20{width:80px}.AccessPanel-module_accessPanel__RXDzY .w-24{width:96px}.AccessPanel-module_accessPanel__RXDzY .w-28{width:112px}.AccessPanel-module_accessPanel__RXDzY .w-32{width:128px}.AccessPanel-module_accessPanel__RXDzY .w-40{width:160px}.AccessPanel-module_accessPanel__RXDzY .w-48{width:192px}.AccessPanel-module_accessPanel__RXDzY .w-64{width:256px}.AccessPanel-module_accessPanel__RXDzY .w-80{width:320px}.AccessPanel-module_accessPanel__RXDzY .min-w-0{min-width:0}.AccessPanel-module_accessPanel__RXDzY .min-w-32{min-width:128px}.AccessPanel-module_accessPanel__RXDzY .min-w-40{min-width:160px}.AccessPanel-module_accessPanel__RXDzY .min-w-48{min-width:192px}.AccessPanel-module_accessPanel__RXDzY .max-w-xs{max-width:320px}.AccessPanel-module_accessPanel__RXDzY .max-w-sm{max-width:384px}.AccessPanel-module_accessPanel__RXDzY .max-w-md{max-width:448px}.AccessPanel-module_accessPanel__RXDzY .max-w-lg{max-width:512px}.AccessPanel-module_accessPanel__RXDzY .max-w-full{max-width:100%}.AccessPanel-module_accessPanel__RXDzY .max-h-60{max-height:240px}.AccessPanel-module_accessPanel__RXDzY .max-h-72{max-height:288px}.AccessPanel-module_accessPanel__RXDzY .max-h-96{max-height:384px}.AccessPanel-module_accessPanel__RXDzY .min-h-0{min-height:0}.AccessPanel-module_accessPanel__RXDzY .rounded-none{border-radius:0}.AccessPanel-module_accessPanel__RXDzY .rounded-sm{border-radius:2px}.AccessPanel-module_accessPanel__RXDzY .rounded{border-radius:4px}.AccessPanel-module_accessPanel__RXDzY .rounded-md{border-radius:6px}.AccessPanel-module_accessPanel__RXDzY .rounded-lg{border-radius:8px}.AccessPanel-module_accessPanel__RXDzY .rounded-xl{border-radius:12px}.AccessPanel-module_accessPanel__RXDzY .rounded-2xl{border-radius:16px}.AccessPanel-module_accessPanel__RXDzY .rounded-full{border-radius:9999px}.AccessPanel-module_accessPanel__RXDzY .rounded-appsec{border-radius:8px}.AccessPanel-module_accessPanel__RXDzY .rounded-t-lg{border-top-left-radius:8px;border-top-right-radius:8px}.AccessPanel-module_accessPanel__RXDzY .rounded-b-lg{border-bottom-left-radius:8px;border-bottom-right-radius:8px}.AccessPanel-module_accessPanel__RXDzY .rounded-l-lg{border-bottom-left-radius:8px;border-top-left-radius:8px}.AccessPanel-module_accessPanel__RXDzY .rounded-r-lg{border-bottom-right-radius:8px;border-top-right-radius:8px}.AccessPanel-module_accessPanel__RXDzY .rounded-t-md{border-top-left-radius:6px;border-top-right-radius:6px}.AccessPanel-module_accessPanel__RXDzY .rounded-b-md{border-bottom-left-radius:6px;border-bottom-right-radius:6px}.AccessPanel-module_accessPanel__RXDzY .rounded-t-xl{border-top-left-radius:12px;border-top-right-radius:12px}.AccessPanel-module_accessPanel__RXDzY .rounded-b-xl{border-bottom-left-radius:12px;border-bottom-right-radius:12px}.AccessPanel-module_accessPanel__RXDzY .border{border:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-0{border:0}.AccessPanel-module_accessPanel__RXDzY .border-2{border:2px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-t{border-top:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-b{border-bottom:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-l{border-left:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-r{border-right:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-t-0{border-top:0}.AccessPanel-module_accessPanel__RXDzY .border-b-0{border-bottom:0}.AccessPanel-module_accessPanel__RXDzY .border-appsec-border{border-color:var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-appsec-primary{border-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .border-appsec-danger{border-color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .border-transparent{border-color:#0000}.AccessPanel-module_accessPanel__RXDzY .border-gray-200{border-color:#eaecf0}.AccessPanel-module_accessPanel__RXDzY .border-blue-200{border-color:#bfdbfe}.AccessPanel-module_accessPanel__RXDzY .divide-y>:not([hidden])~:not([hidden]){border-top:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .divide-x>:not([hidden])~:not([hidden]){border-left:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY [role=tablist]{background:var(--appsec-surface);border:1px solid var(--appsec-border);border-radius:8px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.AccessPanel-module_accessPanel__RXDzY [role=tab]{background:#0000;border:none;border-radius:0;color:var(--appsec-text-secondary);cursor:pointer;font-size:13px;font-weight:400;padding:8px 12px;text-align:center;transition:background .12s,color .12s;white-space:nowrap}.AccessPanel-module_accessPanel__RXDzY [role=tab].active,.AccessPanel-module_accessPanel__RXDzY [role=tab][aria-selected=true],.AccessPanel-module_accessPanel__RXDzY [role=tab][data-state=active]{background:var(--appsec-primary);color:#fff;font-weight:500}.AccessPanel-module_accessPanel__RXDzY [role=tab]:not([aria-selected=true]):not([data-state=active]):not(.active):hover{background:var(--appsec-surface-alt);color:var(--appsec-text)}.AccessPanel-module_accessPanel__RXDzY .overflow-hidden{overflow:hidden}.AccessPanel-module_accessPanel__RXDzY .overflow-auto{overflow:auto}.AccessPanel-module_accessPanel__RXDzY .overflow-y-auto{overflow-y:auto}.AccessPanel-module_accessPanel__RXDzY .overflow-x-auto{overflow-x:auto}.AccessPanel-module_accessPanel__RXDzY .overflow-visible{overflow:visible}.AccessPanel-module_accessPanel__RXDzY .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AccessPanel-module_accessPanel__RXDzY .whitespace-nowrap{white-space:nowrap}.AccessPanel-module_accessPanel__RXDzY .whitespace-normal{white-space:normal}.AccessPanel-module_accessPanel__RXDzY .break-words{overflow-wrap:break-word}.AccessPanel-module_accessPanel__RXDzY .break-all{word-break:break-all}.AccessPanel-module_accessPanel__RXDzY .text-left{text-align:left}.AccessPanel-module_accessPanel__RXDzY .text-center{text-align:center}.AccessPanel-module_accessPanel__RXDzY .text-right{text-align:right}.AccessPanel-module_accessPanel__RXDzY .text-xs{font-size:12px;line-height:16px}.AccessPanel-module_accessPanel__RXDzY .text-sm{font-size:14px;line-height:20px}.AccessPanel-module_accessPanel__RXDzY .text-base{font-size:16px;line-height:24px}.AccessPanel-module_accessPanel__RXDzY .text-lg{font-size:18px;line-height:28px}.AccessPanel-module_accessPanel__RXDzY .text-xl{font-size:20px;line-height:28px}.AccessPanel-module_accessPanel__RXDzY .text-2xl{font-size:24px;line-height:32px}.AccessPanel-module_accessPanel__RXDzY .text-\\[10px\\]{font-size:10px;line-height:14px}.AccessPanel-module_accessPanel__RXDzY .text-\\[11px\\]{font-size:11px;line-height:16px}.AccessPanel-module_accessPanel__RXDzY .text-\\[13px\\]{font-size:13px;line-height:18px}.AccessPanel-module_accessPanel__RXDzY .font-normal{font-weight:400}.AccessPanel-module_accessPanel__RXDzY .font-medium{font-weight:500}.AccessPanel-module_accessPanel__RXDzY .font-semibold{font-weight:600}.AccessPanel-module_accessPanel__RXDzY .font-bold{font-weight:700}.AccessPanel-module_accessPanel__RXDzY .italic{font-style:italic}.AccessPanel-module_accessPanel__RXDzY .not-italic{font-style:normal}.AccessPanel-module_accessPanel__RXDzY .uppercase{text-transform:uppercase}.AccessPanel-module_accessPanel__RXDzY .lowercase{text-transform:lowercase}.AccessPanel-module_accessPanel__RXDzY .capitalize{text-transform:capitalize}.AccessPanel-module_accessPanel__RXDzY .normal-case{text-transform:none}.AccessPanel-module_accessPanel__RXDzY .underline{text-decoration:underline}.AccessPanel-module_accessPanel__RXDzY .no-underline{text-decoration:none}.AccessPanel-module_accessPanel__RXDzY .line-through{text-decoration:line-through}.AccessPanel-module_accessPanel__RXDzY .leading-none{line-height:1}.AccessPanel-module_accessPanel__RXDzY .leading-tight{line-height:1.25}.AccessPanel-module_accessPanel__RXDzY .leading-snug{line-height:1.375}.AccessPanel-module_accessPanel__RXDzY .leading-normal{line-height:1.5}.AccessPanel-module_accessPanel__RXDzY .leading-relaxed{line-height:1.625}.AccessPanel-module_accessPanel__RXDzY .text-white{color:#fff}.AccessPanel-module_accessPanel__RXDzY .text-black{color:#000}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text{color:var(--appsec-text)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text-secondary{color:var(--appsec-text-secondary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text-tertiary{color:var(--appsec-text-tertiary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-primary{color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-danger{color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-success{color:var(--appsec-success)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-warning{color:var(--appsec-warning)}.AccessPanel-module_accessPanel__RXDzY .text-gray-400{color:#98a2b3}.AccessPanel-module_accessPanel__RXDzY .text-gray-500{color:#667085}.AccessPanel-module_accessPanel__RXDzY .text-gray-600{color:#475467}.AccessPanel-module_accessPanel__RXDzY .text-gray-700{color:#344054}.AccessPanel-module_accessPanel__RXDzY .text-gray-900{color:#101828}.AccessPanel-module_accessPanel__RXDzY .text-blue-600{color:#2563eb}.AccessPanel-module_accessPanel__RXDzY .text-blue-700{color:#1d4ed8}.AccessPanel-module_accessPanel__RXDzY .text-red-600{color:#dc2626}.AccessPanel-module_accessPanel__RXDzY .text-red-700{color:#b91c1c}.AccessPanel-module_accessPanel__RXDzY .text-green-600{color:#16a34a}.AccessPanel-module_accessPanel__RXDzY .text-green-700{color:#15803d}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-bg{background-color:var(--appsec-bg)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-surface{background-color:var(--appsec-surface)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-surface-alt{background-color:var(--appsec-surface-alt)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-primary{background-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-primary-light{background-color:var(--appsec-primary-light)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-danger{background-color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-danger-light{background-color:var(--appsec-danger-light)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-success-light{background-color:var(--appsec-success-light)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-warning-light{background-color:var(--appsec-warning-light)}.AccessPanel-module_accessPanel__RXDzY .bg-transparent{background-color:initial}.AccessPanel-module_accessPanel__RXDzY .bg-white{background-color:#fff}.AccessPanel-module_accessPanel__RXDzY .bg-gray-50{background-color:#f9fafb}.AccessPanel-module_accessPanel__RXDzY .bg-gray-100{background-color:#f2f4f7}.AccessPanel-module_accessPanel__RXDzY .bg-gray-200{background-color:#eaecf0}.AccessPanel-module_accessPanel__RXDzY .bg-blue-50{background-color:#eff6ff}.AccessPanel-module_accessPanel__RXDzY .bg-blue-600{background-color:#2563eb}.AccessPanel-module_accessPanel__RXDzY .bg-red-50{background-color:#fef2f2}.AccessPanel-module_accessPanel__RXDzY .bg-red-600{background-color:#dc2626}.AccessPanel-module_accessPanel__RXDzY .bg-green-50{background-color:#f0fdf4}.AccessPanel-module_accessPanel__RXDzY .bg-yellow-50{background-color:#fffbeb}.AccessPanel-module_accessPanel__RXDzY .bg-blue-500{background-color:#3b82f6}.AccessPanel-module_accessPanel__RXDzY .bg-purple-500{background-color:#a855f7}.AccessPanel-module_accessPanel__RXDzY .bg-green-600{background-color:#16a34a}.AccessPanel-module_accessPanel__RXDzY .bg-orange-500{background-color:#f97316}.AccessPanel-module_accessPanel__RXDzY .bg-pink-500{background-color:#ec4899}.AccessPanel-module_accessPanel__RXDzY .bg-teal-500{background-color:#14b8a6}.AccessPanel-module_accessPanel__RXDzY .bg-indigo-500{background-color:#6366f1}.AccessPanel-module_accessPanel__RXDzY .bg-rose-500{background-color:#f43f5e}.AccessPanel-module_accessPanel__RXDzY .p-0{padding:0}.AccessPanel-module_accessPanel__RXDzY .p-0\\.5{padding:2px}.AccessPanel-module_accessPanel__RXDzY .p-1{padding:4px}.AccessPanel-module_accessPanel__RXDzY .p-1\\.5{padding:6px}.AccessPanel-module_accessPanel__RXDzY .p-2{padding:8px}.AccessPanel-module_accessPanel__RXDzY .p-2\\.5{padding:10px}.AccessPanel-module_accessPanel__RXDzY .p-3{padding:12px}.AccessPanel-module_accessPanel__RXDzY .p-4{padding:16px}.AccessPanel-module_accessPanel__RXDzY .p-5{padding:20px}.AccessPanel-module_accessPanel__RXDzY .p-6{padding:24px}.AccessPanel-module_accessPanel__RXDzY .px-1{padding-left:4px;padding-right:4px}.AccessPanel-module_accessPanel__RXDzY .px-2{padding-left:8px;padding-right:8px}.AccessPanel-module_accessPanel__RXDzY .px-2\\.5{padding-left:10px;padding-right:10px}.AccessPanel-module_accessPanel__RXDzY .px-3{padding-left:12px;padding-right:12px}.AccessPanel-module_accessPanel__RXDzY .px-4{padding-left:16px;padding-right:16px}.AccessPanel-module_accessPanel__RXDzY .px-5{padding-left:20px;padding-right:20px}.AccessPanel-module_accessPanel__RXDzY .px-6{padding-left:24px;padding-right:24px}.AccessPanel-module_accessPanel__RXDzY .py-0\\.5{padding-bottom:2px;padding-top:2px}.AccessPanel-module_accessPanel__RXDzY .py-1{padding-bottom:4px;padding-top:4px}.AccessPanel-module_accessPanel__RXDzY .py-1\\.5{padding-bottom:6px;padding-top:6px}.AccessPanel-module_accessPanel__RXDzY .py-2{padding-bottom:8px;padding-top:8px}.AccessPanel-module_accessPanel__RXDzY .py-2\\.5{padding-bottom:10px;padding-top:10px}.AccessPanel-module_accessPanel__RXDzY .py-3{padding-bottom:12px;padding-top:12px}.AccessPanel-module_accessPanel__RXDzY .py-4{padding-bottom:16px;padding-top:16px}.AccessPanel-module_accessPanel__RXDzY .py-5{padding-bottom:20px;padding-top:20px}.AccessPanel-module_accessPanel__RXDzY .py-6{padding-bottom:24px;padding-top:24px}.AccessPanel-module_accessPanel__RXDzY .py-8{padding-bottom:32px;padding-top:32px}.AccessPanel-module_accessPanel__RXDzY .pt-0{padding-top:0}.AccessPanel-module_accessPanel__RXDzY .pt-1{padding-top:4px}.AccessPanel-module_accessPanel__RXDzY .pt-2{padding-top:8px}.AccessPanel-module_accessPanel__RXDzY .pt-3{padding-top:12px}.AccessPanel-module_accessPanel__RXDzY .pt-4{padding-top:16px}.AccessPanel-module_accessPanel__RXDzY .pb-0{padding-bottom:0}.AccessPanel-module_accessPanel__RXDzY .pb-1{padding-bottom:4px}.AccessPanel-module_accessPanel__RXDzY .pb-2{padding-bottom:8px}.AccessPanel-module_accessPanel__RXDzY .pb-3{padding-bottom:12px}.AccessPanel-module_accessPanel__RXDzY .pb-4{padding-bottom:16px}.AccessPanel-module_accessPanel__RXDzY .pl-0{padding-left:0}.AccessPanel-module_accessPanel__RXDzY .pl-2{padding-left:8px}.AccessPanel-module_accessPanel__RXDzY .pl-3{padding-left:12px}.AccessPanel-module_accessPanel__RXDzY .pl-4{padding-left:16px}.AccessPanel-module_accessPanel__RXDzY .pl-9{padding-left:36px}.AccessPanel-module_accessPanel__RXDzY .pr-0{padding-right:0}.AccessPanel-module_accessPanel__RXDzY .pr-2{padding-right:8px}.AccessPanel-module_accessPanel__RXDzY .pr-3{padding-right:12px}.AccessPanel-module_accessPanel__RXDzY .pr-4{padding-right:16px}.AccessPanel-module_accessPanel__RXDzY .pr-6{padding-right:24px}.AccessPanel-module_accessPanel__RXDzY .pr-8{padding-right:32px}.AccessPanel-module_accessPanel__RXDzY .pr-10{padding-right:40px}.AccessPanel-module_accessPanel__RXDzY .m-0{margin:0}.AccessPanel-module_accessPanel__RXDzY .m-1{margin:4px}.AccessPanel-module_accessPanel__RXDzY .m-2{margin:8px}.AccessPanel-module_accessPanel__RXDzY .m-auto{margin:auto}.AccessPanel-module_accessPanel__RXDzY .mx-auto{margin-left:auto;margin-right:auto}.AccessPanel-module_accessPanel__RXDzY .ml-auto{margin-left:auto}.AccessPanel-module_accessPanel__RXDzY .mr-auto{margin-right:auto}.AccessPanel-module_accessPanel__RXDzY .mt-0{margin-top:0}.AccessPanel-module_accessPanel__RXDzY .mt-1{margin-top:4px}.AccessPanel-module_accessPanel__RXDzY .mt-2{margin-top:8px}.AccessPanel-module_accessPanel__RXDzY .mt-3{margin-top:12px}.AccessPanel-module_accessPanel__RXDzY .mt-4{margin-top:16px}.AccessPanel-module_accessPanel__RXDzY .mt-6{margin-top:24px}.AccessPanel-module_accessPanel__RXDzY .mb-0{margin-bottom:0}.AccessPanel-module_accessPanel__RXDzY .mb-1{margin-bottom:4px}.AccessPanel-module_accessPanel__RXDzY .mb-2{margin-bottom:8px}.AccessPanel-module_accessPanel__RXDzY .mb-3{margin-bottom:12px}.AccessPanel-module_accessPanel__RXDzY .mb-4{margin-bottom:16px}.AccessPanel-module_accessPanel__RXDzY .ml-0{margin-left:0}.AccessPanel-module_accessPanel__RXDzY .ml-1{margin-left:4px}.AccessPanel-module_accessPanel__RXDzY .ml-2{margin-left:8px}.AccessPanel-module_accessPanel__RXDzY .ml-3{margin-left:12px}.AccessPanel-module_accessPanel__RXDzY .mr-0{margin-right:0}.AccessPanel-module_accessPanel__RXDzY .mr-1{margin-right:4px}.AccessPanel-module_accessPanel__RXDzY .mr-2{margin-right:8px}.AccessPanel-module_accessPanel__RXDzY .-mt-px{margin-top:-1px}.AccessPanel-module_accessPanel__RXDzY .shadow-none{box-shadow:none}.AccessPanel-module_accessPanel__RXDzY .shadow-sm{box-shadow:0 1px 2px #1018280f}.AccessPanel-module_accessPanel__RXDzY .shadow{box-shadow:0 1px 3px #1018281a,0 1px 2px #1018280f}.AccessPanel-module_accessPanel__RXDzY .shadow-md{box-shadow:0 4px 8px #10182814,0 2px 4px #1018280a}.AccessPanel-module_accessPanel__RXDzY .shadow-lg{box-shadow:0 12px 24px #1018281f}.AccessPanel-module_accessPanel__RXDzY .shadow-xl{box-shadow:0 20px 40px #10182829}.AccessPanel-module_accessPanel__RXDzY :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea,select){background-color:var(--appsec-bg);border:1px solid var(--appsec-border);border-radius:8px;color:var(--appsec-text);height:36px;outline:none;padding:0 12px;transition:border-color .12s,box-shadow .12s;width:100%}.AccessPanel-module_accessPanel__RXDzY :where(textarea){height:auto;padding:8px 12px;resize:vertical}.AccessPanel-module_accessPanel__RXDzY :where(input[type=text]:focus,input[type=email]:focus,input[type=search]:focus,input[type=password]:focus,textarea:focus,select:focus){border-color:var(--appsec-primary);box-shadow:0 0 0 3px var(--appsec-primary-light)}.AccessPanel-module_accessPanel__RXDzY :where(input::placeholder,textarea::placeholder){color:var(--appsec-text-tertiary)}.AccessPanel-module_accessPanel__RXDzY :where(input[type=checkbox]){accent-color:var(--appsec-primary);height:16px;width:16px}.AccessPanel-module_accessPanel__RXDzY .appearance-none{appearance:none}.AccessPanel-module_accessPanel__RXDzY .outline-none{outline:0}.AccessPanel-module_accessPanel__RXDzY .focus\\:border-appsec-primary:focus{border-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .focus\\:ring-2:focus{box-shadow:0 0 0 3px var(--appsec-primary-light)}.AccessPanel-module_accessPanel__RXDzY .focus\\:outline-none:focus{outline:0}.AccessPanel-module_accessPanel__RXDzY button:hover:not(:disabled){opacity:.92}.AccessPanel-module_accessPanel__RXDzY .disabled\\:opacity-30:disabled,.AccessPanel-module_accessPanel__RXDzY button:disabled{opacity:.3}.AccessPanel-module_accessPanel__RXDzY .disabled\\:opacity-50:disabled{opacity:.5}.AccessPanel-module_accessPanel__RXDzY .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.AccessPanel-module_accessPanel__RXDzY .cursor-pointer{cursor:pointer}.AccessPanel-module_accessPanel__RXDzY .cursor-not-allowed{cursor:not-allowed}.AccessPanel-module_accessPanel__RXDzY .cursor-default{cursor:default}.AccessPanel-module_accessPanel__RXDzY .select-none{user-select:none}.AccessPanel-module_accessPanel__RXDzY .select-text{user-select:text}.AccessPanel-module_accessPanel__RXDzY .opacity-0{opacity:0}.AccessPanel-module_accessPanel__RXDzY .opacity-30{opacity:.3}.AccessPanel-module_accessPanel__RXDzY .opacity-50{opacity:.5}.AccessPanel-module_accessPanel__RXDzY .opacity-75{opacity:.75}.AccessPanel-module_accessPanel__RXDzY .opacity-100{opacity:1}.AccessPanel-module_accessPanel__RXDzY .transition-all{transition:all .15s ease}.AccessPanel-module_accessPanel__RXDzY .transition-colors{transition:color .15s ease,background-color .15s ease,border-color .15s ease}.AccessPanel-module_accessPanel__RXDzY .transition-opacity{transition:opacity .15s ease}.AccessPanel-module_accessPanel__RXDzY .transition-transform{transition:transform .15s ease}.AccessPanel-module_accessPanel__RXDzY .duration-150{transition-duration:.15s}.AccessPanel-module_accessPanel__RXDzY .duration-200{transition-duration:.2s}.AccessPanel-module_accessPanel__RXDzY .duration-300{transition-duration:.3s}.AccessPanel-module_accessPanel__RXDzY .ease-in-out{transition-timing-function:ease-in-out}.AccessPanel-module_accessPanel__RXDzY .rotate-90{transform:rotate(90deg)}.AccessPanel-module_accessPanel__RXDzY .rotate-180{transform:rotate(180deg)}.AccessPanel-module_accessPanel__RXDzY .-rotate-90{transform:rotate(-90deg)}.AccessPanel-module_accessPanel__RXDzY .scale-95{transform:scale(.95)}.AccessPanel-module_accessPanel__RXDzY .scale-100{transform:scale(1)}.AccessPanel-module_accessPanel__RXDzY .list-none{list-style:none}.AccessPanel-module_accessPanel__RXDzY .list-disc{list-style:disc}.AccessPanel-module_accessPanel__RXDzY .object-cover{object-fit:cover}.AccessPanel-module_accessPanel__RXDzY .object-contain{object-fit:contain}.AccessPanel-module_accessPanel__RXDzY .sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.AccessPanel-module_accessPanel__RXDzY .hover\\:bg-appsec-surface:hover{background-color:var(--appsec-surface)}.AccessPanel-module_accessPanel__RXDzY .hover\\:bg-appsec-surface-alt:hover{background-color:var(--appsec-surface-alt)}.AccessPanel-module_accessPanel__RXDzY .hover\\:bg-appsec-danger-light:hover{background-color:var(--appsec-danger-light)}.AccessPanel-module_accessPanel__RXDzY .hover\\:bg-gray-50:hover{background-color:#f9fafb}.AccessPanel-module_accessPanel__RXDzY .hover\\:bg-gray-100:hover{background-color:#f2f4f7}.AccessPanel-module_accessPanel__RXDzY .hover\\:text-appsec-text:hover{color:var(--appsec-text)}.AccessPanel-module_accessPanel__RXDzY .hover\\:text-appsec-danger:hover{color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .hover\\:text-appsec-primary:hover{color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .hover\\:border-appsec-primary:hover{border-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .hover\\:underline:hover{text-decoration:underline}.AccessPanel-module_accessPanel__RXDzY .hover\\:opacity-80:hover{opacity:.8}.AccessPanel-module_accessPanel__RXDzY .hover\\:shadow-md:hover{box-shadow:0 4px 8px #10182814,0 2px 4px #1018280a}.AccessPanel-module_accessPanel__RXDzY .group:hover .group-hover\\:opacity-100{opacity:1}.AccessPanel-module_accessPanel__RXDzY .group-hover\\:opacity-100{opacity:0;transition:opacity .15s}");export{s as default};
2
2
  //# sourceMappingURL=AccessPanel.module.css.js.map
@@ -1,2 +1,2 @@
1
- import{__awaiter as e,__generator as o,__assign as r,__spreadArray as i}from"tslib";import{jsx as n,jsxs as t,Fragment as l}from"react/jsx-runtime";import{useState as a,useRef as d,useEffect as c}from"react";import{useMutation as s}from"@tanstack/react-query";import{X as p,Loader2 as u}from"lucide-react";import{Toast as m}from"primereact/toast";import{v4 as f}from"uuid";import h from"../components/StationOnboarding/StationAutocomplete.js";import g from"./AddScopeApprovalSearchComponent.js";import v from"../components/ScopeSkeletonLoader.js";import{Input as y}from"@mui/material";import b from"../store/useAuthStore.js";import{useAppSecRolesStore as S}from"../store/useAppSecRolesStore.js";import C from"../store/useEnvStore.js";import{createRuleSet as x}from"../apis/scopeApis.js";import{useLearningTemplateStore as w}from"../store/useLearningTemplateStore.js";import{IL_CONFIG_CONSTANTS as _}from"../config.js";var k=function(k){var A=k.isOpen,R=k.onClose,D=k.onCreate,I=k.hasGlobalRuleSet,q=a(""),z=q[0],F=q[1],j=a(""),E=j[0],L=j[1],B=a({}),N=B[0],W=B[1],G=d(null),P=b().user,O=S(function(e){return e.roles}),T=C(function(e){return e.rbacConfig}),M=a(null),K=M[0],U=M[1],H=a("approval_required"),J=H[0],Q=H[1],V=a([]),X=V[0],Y=V[1],Z=a([]),$=Z[0],ee=Z[1],oe=a(""),re=oe[0],ie=oe[1],ne=s({mutationFn:function(r){return e(void 0,void 0,void 0,function(){var e;return o(this,function(o){switch(o.label){case 0:return[4,x(r,null!==(e=null==P?void 0:P.accessToken)&&void 0!==e?e:"")];case 1:return[2,o.sent()]}})})},onSuccess:function(r){return e(void 0,void 0,void 0,function(){return o(this,function(e){return console.log("Rule Set Created Successfully",r),[2]})})}}),te=ne.data,le=ne.isPending,ae=ne.mutateAsync;return c(function(){A&&(F(""),L(""),W({}),U(null),Q("approval_required"),Y([]),ee([]),ie(""))},[A]),A?le?n(v,{isLoading:le}):t("div",r({style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.3)"}},{children:[n(m,{ref:G}),t("div",r({style:{position:"relative",width:600,borderRadius:12,backgroundColor:"white",padding:24,boxShadow:"0 25px 50px -12px rgba(0,0,0,0.25)"}},{children:[t("div",r({style:{marginBottom:24,display:"flex",alignItems:"flex-start",justifyContent:"space-between"}},{children:[t("div",{children:[n("h2",r({style:{margin:0,fontSize:18,fontWeight:500,color:"#19213D"}},{children:"Add Scope"})),n("p",r({style:{margin:"4px 0 0 0",fontSize:14,fontWeight:400,color:"#666F8D"}},{children:"This scope will be created under Global and will inherit its Learnings by default."}))]}),n("button",r({onClick:R,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"#9CA3AF"}},{children:n(p,{size:24})}))]})),t("div",r({style:{display:"flex",flexDirection:"column",gap:20}},{children:[t("div",r({style:{position:"relative",display:"flex",flexDirection:"column",gap:6}},{children:[t("label",r({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:[n("span",r({style:{marginRight:4,fontSize:16,fontWeight:600,color:"#8F2C23"}},{children:"*"})),"Scope Name"]})),"Custom"===z?n(h,{value:E,onChange:function(e){if(e.length>50)return L(e.slice(0,50)),void W(function(e){return r(r({},e),{name:"Scope Name must be 50 characters or fewer"})});L(e),W(function(e){return r(r({},e),{name:void 0})})},onStationSelect:function(e){U(e)},style:{border:N.name?"1px solid #8F2C23":void 0}}):n(y,{value:E,onChange:function(e){var o=e.target.value;if(o.length>50)return L(o.slice(0,50)),void W(function(e){return r(r({},e),{name:"Scope Name must be 50 characters or fewer"})});L(o),W(function(e){return r(r({},e),{name:void 0})})},style:{border:"1px solid ".concat(N.name?"#8F2C23":"#F0F2F5")},placeholder:"e.g. Global Learnings"}),N.name&&n("p",r({style:{margin:"4px 0 0 0",fontSize:12,color:"#8F2C23"}},{children:N.name}))]})),t("div",r({style:{display:"flex",flexDirection:"column",gap:12}},{children:[t("label",r({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:[n("span",r({style:{marginRight:4,fontSize:16,fontWeight:600,color:"#8F2C23"}},{children:"*"})),"Learning Approval Settings"]})),t("div",r({role:"radio","aria-checked":"approval_required"===J,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:4},onClick:function(){return Q("approval_required")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||Q("approval_required")}},{children:[t("div",r({style:{display:"flex",alignItems:"center",gap:8}},{children:[n("div",r({style:{display:"flex",height:16,width:16,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("approval_required"===J?"#2563EB":"#CBD5E1")}},{children:"approval_required"===J&&n("div",{style:{height:8,width:8,borderRadius:"50%",backgroundColor:"#2563EB"}})})),n("span",r({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:"Approval Required Before Publishing"}))]})),n("p",r({style:{margin:0,marginLeft:24,fontSize:12,color:"#666F8D"}},{children:"Learnings require approval before publishing."}))]})),"approval_required"===J&&n(g,{selectedApprovers:X,selectedGroupOfApprovers:$,onApproversChange:Y,onGroupsChange:ee}),re&&n("p",r({style:{margin:0,marginLeft:24,fontSize:12,color:"#8F2C23"}},{children:re})),t("div",r({role:"radio","aria-checked":"publish_without"===J,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:4},onClick:function(){Q("publish_without"),ie("")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(Q("publish_without"),ie(""))}},{children:[t("div",r({style:{display:"flex",alignItems:"center",gap:8}},{children:[n("div",r({style:{display:"flex",height:16,width:16,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("publish_without"===J?"#2563EB":"#CBD5E1")}},{children:"publish_without"===J&&n("div",{style:{height:8,width:8,borderRadius:"50%",backgroundColor:"#2563EB"}})})),n("span",r({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:"Publish Without Approval"}))]})),n("p",r({style:{margin:0,marginLeft:24,fontSize:12,color:"#666F8D"}},{children:"Learnings can be published directly."}))]}))]})),t("div",r({style:{marginTop:32,display:"flex",justifyContent:"flex-end",gap:12}},{children:[n("button",r({onClick:R,style:{borderRadius:6,border:"1px solid #E2E8F0",padding:"8px 16px",fontSize:14,fontWeight:500,color:"#64748B",backgroundColor:"white",cursor:"pointer",opacity:le?.5:1},disabled:le},{children:"Cancel"})),n("button",r({onClick:function(){return e(void 0,void 0,void 0,function(){var e,r,n,t,l,a,d,c,s,p,u,m;return o(this,function(o){if(e={},E.trim()?E.length>50&&(e.name="Scope Name must be 50 characters or fewer"):e.name="Scope Name is required","approval_required"===J&&0===X.length&&0===$.length&&ie("Please select at least one approver or approver group."),e.name)return W(e),[2];if("approval_required"===J&&0===X.length&&0===$.length)return[2];ie("");try{r="approval_required"===J,n=w.getState().backwardCompatibility,t=n?{topic:I?"genreRuleSet":"globalRuleSet",customScopeGroupName:_.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:E,parentScopeId:null,customScopeName:E,customScopeId:f(),createByName:(null==P?void 0:P.firstname)||"System",createdBy:(null==P?void 0:P.email)||"system@audacy.com",approvalRequired:r,appsecData:{application:null==T?void 0:T.applicationId,module:null==T?void 0:T.moduleId,roles:i(i([],r?[{users:X.map(function(e){return e.email}),groups:$.map(function(e){return e._id}),role:null!==(a=null===(l=O.find(function(e){return"Learning Manager"===e.name}))||void 0===l?void 0:l._id)&&void 0!==a?a:""}]:[],!0),[{users:[null==P?void 0:P.email],groups:[],role:null!==(c=null===(d=O.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===d?void 0:d._id)&&void 0!==c?c:""}],!1)}}:{topic:I?"genreRuleSet":"globalRuleSet",scope_reference_id:null,scopeDescription:E,parentScopeId:null,scopeName:E,scopeReferenceMetadata:{},applicationMappingId:w.getState().app_integration_id},console.log("Add Scope payload:",t),ae(t),D(null===(s=null==te?void 0:te.data)||void 0===s?void 0:s.scopeId),R()}catch(e){console.error("An error occurred during scope creation.",e),null===(p=G.current)||void 0===p||p.show({severity:"error",summary:"Adding Scope Failed",detail:(null===(m=null===(u=null==e?void 0:e.response)||void 0===u?void 0:u.data)||void 0===m?void 0:m.message)||"There was an error creating the scope. Please try again."})}return[2]})})},style:{display:"flex",alignItems:"center",borderRadius:6,backgroundColor:"#2563EB",padding:"8px 16px",fontSize:14,fontWeight:500,color:"white",border:"none",cursor:"pointer",opacity:le||"Custom"===z&&!K?.5:1},disabled:le||"Custom"===z&&!K},{children:le?t(l,{children:[n(u,{className:"animate-spin",style:{marginRight:8,height:16,width:16,color:"white"}}),"Creating..."]}):"Create Scope"}))]}))]}))]}))]})):null};export{k as default};
1
+ import{__awaiter as e,__generator as o,__assign as r,__spreadArray as i}from"tslib";import{jsx as n,jsxs as t,Fragment as l}from"react/jsx-runtime";import{useState as a,useRef as d,useEffect as s}from"react";import{useMutation as c}from"@tanstack/react-query";import{X as u,Loader2 as p}from"lucide-react";import{Toast as f}from"primereact/toast";import{v4 as h}from"uuid";import m from"../components/StationOnboarding/StationAutocomplete.js";import g from"./AddScopeApprovalSearchComponent.js";import v from"../components/ScopeSkeletonLoader.js";import{Input as y}from"@mui/material";import b from"../store/useAuthStore.js";import{useAppSecRolesStore as S}from"../store/useAppSecRolesStore.js";import x from"../store/useEnvStore.js";import{createRuleSet as C}from"../apis/scopeApis.js";var w=function(w){var k=w.isOpen,A=w.onClose,D=w.onCreate,_=w.hasGlobalRuleSet,R=a(""),z=R[0],F=R[1],q=a(""),I=q[0],j=q[1],B=a({}),E=B[0],L=B[1],W=d(null),G=b().user,P=S(function(e){return e.roles}),N=x(function(e){return e.rbacConfig}),T=a(null),O=T[0],K=T[1],M=a("approval_required"),H=M[0],J=M[1],Q=a([]),U=Q[0],V=Q[1],X=a([]),Y=X[0],Z=X[1],$=a(""),ee=$[0],oe=$[1],re=c({mutationFn:function(r){return e(void 0,void 0,void 0,function(){var e;return o(this,function(o){switch(o.label){case 0:return[4,C(r,null!==(e=null==G?void 0:G.accessToken)&&void 0!==e?e:"")];case 1:return[2,o.sent()]}})})},onSuccess:function(r){return e(void 0,void 0,void 0,function(){return o(this,function(e){return console.log("Rule Set Created Successfully",r),[2]})})}}),ie=re.data,ne=re.isPending,te=re.mutateAsync;return s(function(){k&&(F(""),j(""),L({}),K(null),J("approval_required"),V([]),Z([]),oe(""))},[k]),k?ne?n(v,{isLoading:ne}):t("div",r({style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.3)"}},{children:[n(f,{ref:W}),t("div",r({style:{position:"relative",width:600,borderRadius:12,backgroundColor:"white",padding:24,boxShadow:"0 25px 50px -12px rgba(0,0,0,0.25)"}},{children:[t("div",r({style:{marginBottom:24,display:"flex",alignItems:"flex-start",justifyContent:"space-between"}},{children:[t("div",{children:[n("h2",r({style:{margin:0,fontSize:18,fontWeight:500,color:"#19213D"}},{children:"Add Scope"})),n("p",r({style:{margin:"4px 0 0 0",fontSize:14,fontWeight:400,color:"#666F8D"}},{children:"This scope will be created under Global and will inherit its Learnings by default."}))]}),n("button",r({onClick:A,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"#9CA3AF"}},{children:n(u,{size:24})}))]})),t("div",r({style:{display:"flex",flexDirection:"column",gap:20}},{children:[t("div",r({style:{position:"relative",display:"flex",flexDirection:"column",gap:6}},{children:[t("label",r({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:[n("span",r({style:{marginRight:4,fontSize:16,fontWeight:600,color:"#8F2C23"}},{children:"*"})),"Scope Name"]})),"Custom"===z?n(m,{value:I,onChange:function(e){j(e),E.name&&L(function(e){return r(r({},e),{name:void 0})})},onStationSelect:function(e){K(e)},style:{border:E.name?"1px solid #8F2C23":void 0}}):n(y,{value:I,onChange:function(e){j(e.target.value),E.name&&L(function(e){return r(r({},e),{name:void 0})})},style:{border:"1px solid ".concat(E.name?"#8F2C23":"#F0F2F5")},placeholder:"e.g. Global Learnings"}),E.name&&n("p",r({style:{margin:"4px 0 0 0",fontSize:12,color:"#8F2C23"}},{children:E.name}))]})),t("div",r({style:{display:"flex",flexDirection:"column",gap:12}},{children:[t("label",r({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:[n("span",r({style:{marginRight:4,fontSize:16,fontWeight:600,color:"#8F2C23"}},{children:"*"})),"Learning Approval Settings"]})),t("div",r({role:"radio","aria-checked":"approval_required"===H,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:4},onClick:function(){return J("approval_required")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||J("approval_required")}},{children:[t("div",r({style:{display:"flex",alignItems:"center",gap:8}},{children:[n("div",r({style:{display:"flex",height:16,width:16,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("approval_required"===H?"#2563EB":"#CBD5E1")}},{children:"approval_required"===H&&n("div",{style:{height:8,width:8,borderRadius:"50%",backgroundColor:"#2563EB"}})})),n("span",r({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:"Approval Required Before Publishing"}))]})),n("p",r({style:{margin:0,marginLeft:24,fontSize:12,color:"#666F8D"}},{children:"Learnings require approval before publishing."}))]})),"approval_required"===H&&n(g,{selectedApprovers:U,selectedGroupOfApprovers:Y,onApproversChange:V,onGroupsChange:Z}),ee&&n("p",r({style:{margin:0,marginLeft:24,fontSize:12,color:"#8F2C23"}},{children:ee})),t("div",r({role:"radio","aria-checked":"publish_without"===H,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:4},onClick:function(){J("publish_without"),oe("")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(J("publish_without"),oe(""))}},{children:[t("div",r({style:{display:"flex",alignItems:"center",gap:8}},{children:[n("div",r({style:{display:"flex",height:16,width:16,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("publish_without"===H?"#2563EB":"#CBD5E1")}},{children:"publish_without"===H&&n("div",{style:{height:8,width:8,borderRadius:"50%",backgroundColor:"#2563EB"}})})),n("span",r({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:"Publish Without Approval"}))]})),n("p",r({style:{margin:0,marginLeft:24,fontSize:12,color:"#666F8D"}},{children:"Learnings can be published directly."}))]}))]})),t("div",r({style:{marginTop:32,display:"flex",justifyContent:"flex-end",gap:12}},{children:[n("button",r({onClick:A,style:{borderRadius:6,border:"1px solid #E2E8F0",padding:"8px 16px",fontSize:14,fontWeight:500,color:"#64748B",backgroundColor:"white",cursor:"pointer",opacity:ne?.5:1},disabled:ne},{children:"Cancel"})),n("button",r({onClick:function(){return e(void 0,void 0,void 0,function(){var e,n,t,l,a,d,s,c,u,p;return o(this,function(o){if(!I.trim())return L(function(e){return r(r({},e),{name:"Scope name is required."})}),[2];if("approval_required"===H&&0===U.length&&0===Y.length)return oe("Please select at least one approver or approver group."),[2];oe("");try{e="approval_required"===H,n={topic:_?"genreRuleSet":"globalRuleSet",customScopeName:I,customScopeId:h(),createByName:null==G?void 0:G.firstname,createdBy:null==G?void 0:G.email,approvalRequired:e,appsecData:{application:null==N?void 0:N.applicationId,module:null==N?void 0:N.moduleId,roles:i(i([],e?[{users:U.map(function(e){return e.email}),groups:Y.map(function(e){return e._id}),role:null!==(l=null===(t=P.find(function(e){return"Learning Manager"===e.name}))||void 0===t?void 0:t._id)&&void 0!==l?l:""}]:[],!0),[{users:[null==G?void 0:G.email],groups:[],role:null!==(d=null===(a=P.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===a?void 0:a._id)&&void 0!==d?d:""}],!1)}},console.log("Add Scope payload:",n),te(n),D(null===(s=null==ie?void 0:ie.data)||void 0===s?void 0:s.scopeId),A()}catch(e){console.error("An error occurred during scope creation.",e),null===(c=W.current)||void 0===c||c.show({severity:"error",summary:"Adding Scope Failed",detail:(null===(p=null===(u=null==e?void 0:e.response)||void 0===u?void 0:u.data)||void 0===p?void 0:p.message)||"There was an error creating the scope. Please try again."})}return[2]})})},style:{display:"flex",alignItems:"center",borderRadius:6,backgroundColor:"#2563EB",padding:"8px 16px",fontSize:14,fontWeight:500,color:"white",border:"none",cursor:"pointer",opacity:ne||"Custom"===z&&!O?.5:1},disabled:ne||"Custom"===z&&!O},{children:ne?t(l,{children:[n(p,{className:"animate-spin",style:{marginRight:8,height:16,width:16,color:"white"}}),"Creating..."]}):"Create Scope"}))]}))]}))]}))]})):null};export{w as default};
2
2
  //# sourceMappingURL=AddScopeModal.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useState as r}from"react";import{Dialog as t,DialogContent as i,DialogContentText as a,DialogActions as c}from"@mui/material";import l from"@mui/icons-material/Check";import d from"@mui/icons-material/CloseRounded";import{X as s,Loader2 as p}from"lucide-react";var u={header:{padding:"16px 16px 0",display:"flex",justifyContent:"space-between",alignItems:"center"},title:{color:"#334155",fontSize:"1rem"},closeButton:{border:"none",background:"transparent",padding:0,color:"#9CA3AF",cursor:"pointer",outline:"none",transition:"color 150ms ease-in-out"},dialogContent:{padding:"8px 16px"},description:{color:"#475569",fontSize:"0.875rem",lineHeight:1.625},descriptionStrong:{fontWeight:700,color:"#1E293B"},secondaryDescription:{color:"#475569",fontSize:"0.875rem",marginTop:"8px"},rejectSection:{marginTop:"20px"},feedbackLabel:{display:"block",fontSize:"0.875rem",fontWeight:600,color:"#334155",marginBottom:"6px"},textarea:{width:"100%",fontSize:"0.875rem",color:"#1E293B",padding:"10px",border:"1px solid #E2E8F0",borderRadius:"0.5rem",outline:"none",resize:"none",transition:"border-color 150ms ease-in-out, box-shadow 150ms ease-in-out",boxSizing:"border-box",fontFamily:"inherit"},checkboxLabel:{display:"flex",justifyContent:"flex-end",gap:"12px",cursor:"pointer",userSelect:"none",marginTop:"16px"},checkbox:{marginTop:"4px",height:"1rem",width:"1rem",borderRadius:"0.25rem",border:"1px solid #CBD5E1",accentColor:"#DC2626",cursor:"pointer"},checkboxTextWrap:{display:"flex",flexDirection:"column"},checkboxText:{fontSize:"0.875rem",fontWeight:500,color:"#1E293B",transition:"color 150ms ease-in-out"},actions:{padding:"24px",gap:"8px"},secondaryButton:{padding:"8px 20px",fontSize:"0.875rem",fontWeight:500,color:"#475569",border:"1px solid #E2E8F0",borderRadius:"0.5rem",backgroundColor:"#FFFFFF",transition:"background-color 150ms ease-in-out, border-color 150ms ease-in-out",cursor:"pointer"},primaryButton:{display:"inline-flex",alignItems:"center",gap:"0.375rem",padding:"8px 20px",fontSize:"0.875rem",fontWeight:500,color:"#FFFFFF",border:"none",borderRadius:"0.5rem",transition:"background-color 150ms ease-in-out",boxShadow:"none",cursor:"pointer"},actionIcon:{width:"1rem",height:"1rem",fontSize:"1rem"},variantCard:{backgroundColor:"#f9fafb",border:"1px solid #e5e7eb",borderRadius:"10px",padding:"16px 20px",marginTop:"12px"},variantCardTitle:{fontSize:"0.9375rem",fontWeight:700,color:"#111111",marginBottom:"4px"},variantCardDescription:{fontSize:"0.8125rem",color:"#374151",marginBottom:"12px",lineHeight:1.5},variantCardMono:{fontSize:"0.75rem",color:"#4b5563",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",lineHeight:1.6}},m=function(m){var h=m.open,b=m.mode,f=m.onClose,g=m.onSubmit,x=m.variantInformation,y=m.ruleTitle,C=m.pendingVariants,v=void 0===C?[]:C,k=m.isPending,F=void 0!==k&&k,E=r(""),S=E[0],w=E[1],B=r(!1),A=B[0],T=B[1],z=r(!1),M=z[0],L=z[1],W=r(!1),j=W[0],D=W[1],R=r(!1),I=R[0],H=R[1],N=r(!1),V=N[0],P=N[1],Y=r(!1),q=Y[0],G=Y[1],J="undefined"!=typeof document?document.getElementById("rule-template-layout-content"):null,K="reject"===b,O=function(){g(K?{feedback:S,deleteLearning:A}:{}),w(""),T(!1)},Q=function(){w(""),T(!1),f()};return o(t,e({open:h,onClose:Q,container:J,maxWidth:!1,fullWidth:!0,sx:{position:"absolute",inset:0,zIndex:999,"& .MuiBackdrop-root":{position:"absolute"},"& .MuiDialog-container":{alignItems:"center",justifyContent:"center",padding:"24px 16px"},"& .MuiDialog-paper":{width:"100%",maxWidth:"640px",margin:0,borderRadius:"16px"}}},{children:[o("div",e({style:u.header},{children:[n("div",e({style:u.title},{children:K?"Reject Learning":"Approve Learning"})),n("button",e({onClick:f,onMouseEnter:function(){return L(!0)},onMouseLeave:function(){return L(!1)},style:e(e({},u.closeButton),{color:M?"#4B5563":"#9CA3AF"})},{children:n(s,{size:24})}))]})),o(i,e({sx:u.dialogContent},{children:[o(a,e({sx:u.description},{children:[n("span",e({style:u.descriptionStrong},{children:x}))," ",K?"will not be published or applied within the selected scope. You can provide feedback before rejecting.":"will be published and become active within the selected scope after approval."]})),v.length>0&&n("div",{children:v.map(function(r,t){return o("div",e({style:u.variantCard},{children:[o("div",e({style:u.variantCardTitle},{children:[y,v.length>1?" — Variant ".concat(t+1):""]})),r.description&&n("div",e({style:u.variantCardDescription},{children:r.description})),o("div",e({style:u.variantCardMono},{children:[r.whenToApply&&o("div",{children:["WTA — ",r.whenToApply]}),r.whenNotToApply&&o("div",{children:["WNTA — ",r.whenNotToApply]})]}))]}),r.variantId)})}),n(a,e({sx:u.secondaryDescription},{children:K?"":"Take a moment to check the configuration before moving forward."})),K&&o("div",e({style:u.rejectSection},{children:[o("div",{children:[n("label",e({htmlFor:"feedback",style:u.feedbackLabel},{children:"Feedback"})),n("textarea",{id:"feedback",rows:4,value:S,onChange:function(e){return w(e.target.value)},onFocus:function(){return D(!0)},onBlur:function(){return D(!1)},placeholder:"Add feedback or reason for rejection",style:e(e({},u.textarea),{borderColor:j?"#EF4444":"#E2E8F0",boxShadow:j?"0 0 0 2px rgba(239, 68, 68, 0.2)":"none"})})]}),o("label",e({style:u.checkboxLabel,onMouseEnter:function(){return H(!0)},onMouseLeave:function(){return H(!1)}},{children:[n("input",{type:"checkbox",checked:!0,disabled:!0,onChange:function(e){return T(e.target.checked)},style:u.checkbox}),n("div",e({style:u.checkboxTextWrap},{children:n("span",e({style:e(e({},u.checkboxText),{color:I?"#0F172A":"#1E293B"})},{children:"Also delete this learning"}))}))]}))]}))]})),o(c,e({sx:u.actions},{children:[n("button",e({onClick:Q,type:"button",disabled:F,onMouseEnter:function(){return P(!0)},onMouseLeave:function(){return P(!1)},style:e(e({},u.secondaryButton),{backgroundColor:V&&!F?"#F8FAFC":"#FFFFFF",borderColor:V&&!F?"#CBD5E1":"#E2E8F0",opacity:F?.5:1,cursor:F?"not-allowed":"pointer"})},{children:"Cancel"})),o("button",K?e({onClick:O,type:"button",disabled:F,onMouseEnter:function(){return G(!0)},onMouseLeave:function(){return G(!1)},style:e(e({},u.primaryButton),{backgroundColor:F?"#EF4444":q?"#DC2626":"#EF4444",opacity:F?.7:1,cursor:F?"not-allowed":"pointer"})},{children:[F?n(p,{size:16,style:{animation:"spin 1s linear infinite"}}):n(d,{sx:u.actionIcon}),F?"Rejecting…":"Reject Learning"]}):e({onClick:O,type:"button",disabled:F,onMouseEnter:function(){return G(!0)},onMouseLeave:function(){return G(!1)},style:e(e({},u.primaryButton),{backgroundColor:F?"#22C55E":q?"#16A34A":"#22C55E",opacity:F?.7:1,cursor:F?"not-allowed":"pointer"})},{children:[F?n(p,{size:16,style:{animation:"spin 1s linear infinite"}}):n(l,{sx:u.actionIcon}),F?"Approving…":"Approve Learning"]}))]})),n("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}))};export{m as default};
1
+ import{__assign as e}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useState as r}from"react";import{Dialog as t,DialogContent as i,DialogContentText as a,DialogActions as c}from"@mui/material";import l from"@mui/icons-material/Check";import d from"@mui/icons-material/CloseRounded";import{X as s,Loader2 as p}from"lucide-react";var u={header:{padding:"16px 16px 0",display:"flex",justifyContent:"space-between",alignItems:"center"},title:{color:"#334155",fontSize:"1rem"},closeButton:{border:"none",background:"transparent",padding:0,color:"#9CA3AF",cursor:"pointer",outline:"none",transition:"color 150ms ease-in-out"},dialogContent:{padding:"8px 16px"},description:{color:"#475569",fontSize:"0.875rem",lineHeight:1.625},descriptionStrong:{fontWeight:700,color:"#1E293B"},secondaryDescription:{color:"#475569",fontSize:"0.875rem",marginTop:"8px"},rejectSection:{marginTop:"20px"},feedbackLabel:{display:"block",fontSize:"0.875rem",fontWeight:600,color:"#334155",marginBottom:"6px"},textarea:{width:"100%",fontSize:"0.875rem",color:"#1E293B",padding:"10px",border:"1px solid #E2E8F0",borderRadius:"0.5rem",outline:"none",resize:"none",transition:"border-color 150ms ease-in-out, box-shadow 150ms ease-in-out",boxSizing:"border-box",fontFamily:"inherit"},checkboxLabel:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px",cursor:"pointer",userSelect:"none",marginTop:"16px"},checkbox:{margin:0,height:"1.125rem",width:"1.125rem",borderRadius:"0.25rem",border:"1px solid #CBD5E1",accentColor:"#DC2626",cursor:"pointer"},checkboxTextWrap:{display:"flex",alignItems:"center"},checkboxText:{fontSize:"0.875rem",fontWeight:500,color:"#1E293B",transition:"color 150ms ease-in-out"},actions:{padding:"24px",gap:"8px"},secondaryButton:{padding:"8px 20px",fontSize:"0.875rem",fontWeight:500,color:"#475569",border:"1px solid #E2E8F0",borderRadius:"0.5rem",backgroundColor:"#FFFFFF",transition:"background-color 150ms ease-in-out, border-color 150ms ease-in-out",cursor:"pointer"},primaryButton:{display:"inline-flex",alignItems:"center",gap:"0.375rem",padding:"8px 20px",fontSize:"0.875rem",fontWeight:500,color:"#FFFFFF",border:"none",borderRadius:"0.5rem",transition:"background-color 150ms ease-in-out",boxShadow:"none",cursor:"pointer"},actionIcon:{width:"1rem",height:"1rem",fontSize:"1rem"},variantCard:{backgroundColor:"#f9fafb",border:"1px solid #e5e7eb",borderRadius:"10px",padding:"16px 20px",marginTop:"12px"},variantCardTitle:{fontSize:"0.9375rem",fontWeight:700,color:"#111111",marginBottom:"4px"},variantCardDescription:{fontSize:"0.8125rem",color:"#374151",marginBottom:"12px",lineHeight:1.5},variantCardMono:{fontSize:"0.75rem",color:"#4b5563",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",lineHeight:1.6}},m=function(m){var h=m.open,b=m.mode,f=m.onClose,g=m.onSubmit,x=m.variantInformation,y=m.ruleTitle,C=m.pendingVariants,v=void 0===C?[]:C,k=m.isPending,F=void 0!==k&&k,E=r(""),S=E[0],w=E[1],B=r(!0),A=B[0],z=B[1],M=r(!1),T=M[0],L=M[1],W=r(!1),j=W[0],I=W[1],R=r(!1),D=R[0],H=R[1],N=r(!1),V=N[0],P=N[1],Y=r(!1),q=Y[0],G=Y[1],J="undefined"!=typeof document?document.getElementById("rule-template-layout-content"):null,K="reject"===b,O=function(){g(K?{feedback:S,deleteLearning:A}:{}),w(""),z(!1)},Q=function(){w(""),z(!1),f()};return o(t,e({open:h,onClose:Q,container:J,maxWidth:!1,fullWidth:!0,sx:{position:"absolute",inset:0,zIndex:999,"& .MuiBackdrop-root":{position:"absolute"},"& .MuiDialog-container":{alignItems:"center",justifyContent:"center",padding:"24px 16px"},"& .MuiDialog-paper":{width:"100%",maxWidth:"640px",margin:0,borderRadius:"16px"}}},{children:[o("div",e({style:u.header},{children:[n("div",e({style:u.title},{children:K?"Reject Learning":"Approve Learning"})),n("button",e({onClick:f,onMouseEnter:function(){return L(!0)},onMouseLeave:function(){return L(!1)},style:e(e({},u.closeButton),{color:T?"#4B5563":"#9CA3AF"})},{children:n(s,{size:24})}))]})),o(i,e({sx:u.dialogContent},{children:[o(a,e({sx:u.description},{children:[n("span",e({style:u.descriptionStrong},{children:x}))," ",K?"will not be published or applied within the selected scope. You can provide feedback before rejecting.":"will be published and become active within the selected scope after approval."]})),v.length>0&&n("div",{children:v.map(function(r,t){return o("div",e({style:u.variantCard},{children:[o("div",e({style:u.variantCardTitle},{children:[y,v.length>1?" — Variant ".concat(t+1):""]})),r.description&&n("div",e({style:u.variantCardDescription},{children:r.description})),o("div",e({style:u.variantCardMono},{children:[r.whenToApply&&o("div",{children:["WTA — ",r.whenToApply]}),r.whenNotToApply&&o("div",{children:["WNTA — ",r.whenNotToApply]})]}))]}),r.variantId)})}),n(a,e({sx:u.secondaryDescription},{children:K?"":"Take a moment to check the configuration before moving forward."})),K&&o("div",e({style:u.rejectSection},{children:[o("div",{children:[n("label",e({htmlFor:"feedback",style:u.feedbackLabel},{children:"Feedback"})),n("textarea",{id:"feedback",rows:4,value:S,onChange:function(e){return w(e.target.value)},onFocus:function(){return I(!0)},onBlur:function(){return I(!1)},placeholder:"Add feedback or reason for rejection",style:e(e({},u.textarea),{borderColor:j?"#EF4444":"#E2E8F0",boxShadow:j?"0 0 0 2px rgba(239, 68, 68, 0.2)":"none"})})]}),o("label",e({style:u.checkboxLabel,onMouseEnter:function(){return H(!0)},onMouseLeave:function(){return H(!1)}},{children:[n("input",{type:"checkbox",checked:A,disabled:!1,onChange:function(e){return z(e.target.checked)},style:u.checkbox}),n("div",e({style:u.checkboxTextWrap},{children:n("span",e({style:e(e({},u.checkboxText),{color:D?"#0F172A":"#1E293B"})},{children:"Also delete this learning"}))}))]}))]}))]})),o(c,e({sx:u.actions},{children:[n("button",e({onClick:Q,type:"button",disabled:F,onMouseEnter:function(){return P(!0)},onMouseLeave:function(){return P(!1)},style:e(e({},u.secondaryButton),{backgroundColor:V&&!F?"#F8FAFC":"#FFFFFF",borderColor:V&&!F?"#CBD5E1":"#E2E8F0",opacity:F?.5:1,cursor:F?"not-allowed":"pointer"})},{children:"Cancel"})),o("button",K?e({onClick:O,type:"button",disabled:F,onMouseEnter:function(){return G(!0)},onMouseLeave:function(){return G(!1)},style:e(e({},u.primaryButton),{backgroundColor:F?"#EF4444":q?"#DC2626":"#EF4444",opacity:F?.7:1,cursor:F?"not-allowed":"pointer"})},{children:[F?n(p,{size:16,style:{animation:"spin 1s linear infinite"}}):n(d,{sx:u.actionIcon}),F?"Rejecting…":"Reject Learning"]}):e({onClick:O,type:"button",disabled:F,onMouseEnter:function(){return G(!0)},onMouseLeave:function(){return G(!1)},style:e(e({},u.primaryButton),{backgroundColor:F?"#22C55E":q?"#16A34A":"#22C55E",opacity:F?.7:1,cursor:F?"not-allowed":"pointer"})},{children:[F?n(p,{size:16,style:{animation:"spin 1s linear infinite"}}):n(l,{sx:u.actionIcon}),F?"Approving…":"Approve Learning"]}))]})),n("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}))};export{m as default};
2
2
  //# sourceMappingURL=ApprovalLearningDialog.js.map
@@ -1,2 +1,2 @@
1
- import{__awaiter as e,__generator as t,__assign as n}from"tslib";import{jsxs as r,Fragment as o,jsx as i}from"react/jsx-runtime";import{useRef as l,useState as a,useEffect as s}from"react";import{useLearningTemplateStore as u}from"../store/useLearningTemplateStore.js";import c from"../components/EmptyLearningState.js";import{getRulesInRuleSetById as d,exportRuleSet as p,deleteRule as m,deleteQuestion as f,alterQuestionPriority as v}from"../apis/scopeApis.js";import g from"../components/RuleContentSkeleton.js";import{Toast as h}from"primereact/toast";import y from"./ContentLogic.js";import T from"../components/ErrorStateDisplay.js";import w from"../shared/SuccessToastContent.js";import S from"../shared/ErrorToastContent.js";import{findNodeById as b}from"../utils/treeUtils.js";import C from"../styles/LearningContent.module.css.js";import j from"../components/ConfirmationModal.js";import"../../IL-OTJ/_components/atoms/Textarea/Textarea.js";import"lucide-react";import"../../IL-OTJ/_components/InputDataReasoningCard.js";import"../../IL-OTJ/_components/TooltipComponent.js";import"../../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js";import{CitationProvider as I}from"../../IL-OTJ/store/CitationsContext.js";import"@mui/material";import"uuid";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import"axios";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"../../IL-OTJ/_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"../../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js";import"../../IL-OTJ/_components/CitationLink.js";import"@e-llm-studio/citation";import"@viswa-test/test-citation";import R from"../../IL-OTJ/ValueTypeWrappers/TeachMePlugin.js";import"../store/usePermissionsStore.js";import"appsec-ui";import"../store/useAuthStore.js";import"../store/useEnvStore.js";import"@radix-ui/react-tooltip";import"../components/StationOnboarding/InputField.js";import"../store/useConfigStore.js";import"../config.js";import"../components/ToolTip.js";import"@tanstack/react-query";import"../store/useAppSecRolesStore.js";import"react-router-dom";var _=function(_){var k,O=_.noRulesTitle,L=void 0===O?"No rules have been added !":O,D=_.noRulesDesc,x=void 0===D?"Start by adding rules that should apply across all stations.":D,M=_.noRulesButtonText,N=void 0===M?"Create New Rule":M,E=_.deleteRuleSuccessMessage,A=void 0===E?"Rule deleted successfully!":E,F=_.deleteVariantSuccessMessage,V=void 0===F?"Variant deleted successfully!":F,P=_.deleteRuleErrorMessage,J=void 0===P?"Failed to delete rule. Please try again.":P,U=_.deleteVariantErrorMessage,B=void 0===U?"Failed to delete variant. Please try again.":U,W=_.deleteModalTitle,q=void 0===W?"Delete":W,G=_.deleteRuleModalWarning,H=void 0===G?"This will permanently delete the rule configuration.":G,$=_.deleteVariantModalWarning,z=void 0===$?"This will permanently delete the variant configuration.":$,K=_.deleteConfirmText,Q=void 0===K?"Delete":K,X=_.onRefreshRuleSets,Y=_.app_integration_id,Z=_.token,ee=u(function(e){return e.selectedRuleSetId}),te=u(function(e){return e.scopeTreeData}),ne=u(function(e){return e.sidebarTab}),re=u(function(e){return e.setInitialRules}),oe=u(function(e){return e.currentRules});u(function(e){return e.createdVariantInfo});var ie=u(function(e){return e.resetCreatedVariantInfo}),le=u(function(e){return e.isILModalTriggered}),ae=u(function(e){return e.setIsILModalTriggered}),se=l(null),ue=a(!1),ce=ue[0],de=ue[1],pe=a(null),me=pe[0],fe=pe[1],ve=a(null),ge=ve[0],he=ve[1],ye=a(null),Te=ye[0],we=ye[1],Se=a(null),be=Se[0],Ce=Se[1],je=a(!1),Ie=je[0],Re=je[1],_e=a(null),ke=_e[0],Oe=_e[1],Le=a(!1),De=Le[0],xe=Le[1],Me=a(""),Ne=Me[0],Ee=Me[1],Ae=a(null),Fe=Ae[0],Ve=Ae[1],Pe=a(!1),Je=Pe[0],Ue=Pe[1],Be=a(!1),We=Be[0],qe=Be[1],Ge=a("ruleDeletion"),He=Ge[0],$e=Ge[1],ze=a(null),Ke=ze[0],Qe=ze[1],Xe=a(!1),Ye=Xe[0],Ze=Xe[1],et=a(!1),tt=et[0],nt=et[1],rt=u.getState().tiers,ot=a(null),it=ot[0],lt=ot[1],at=a(null),st=at[0],ut=at[1],ct=a(null),dt=ct[0],pt=ct[1],mt=function(){fe(null),he(null),de(!0),Ce(0)},ft=function(){de(!1),ae(!1),fe(null),he(null),we(null),Ce(null),qe(!1),nt(!1),vt(),lt(null),ut(null),pt(null),X&&X(!1,ee||void 0)};s(function(){vt()},[ee,re]),s(function(){le&&de(!0)},[le]);var vt=function(r){return void 0===r&&(r=!1),e(void 0,void 0,void 0,function(){var e,o,i,l,a,s,c,p,m,f,v,g,h,y,T,w,S,b,C;return t(this,function(t){switch(t.label){case 0:if(!ee)return re([]),[2];r||Re(!0),Oe(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,d(ee,Z)];case 2:return e=t.sent(),console.log("response==",e),(null==e?void 0:e.data)&&0!==Object.keys(e.data).length?(o=e.data,console.log("rulesData==",o),i=new Set(["ruleSetName","ruleSetDesc","created_at","updated_at","created_by","updated_by"]),l=Object.entries(o).filter(function(e){var t=e[0],n=e[1];return!i.has(t)&&Array.isArray(n)}),a=l.map(function(e){var t=e[1];return new Set(t.flatMap(function(e){var t,n;return null!==(n=null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return e.link_id}).filter(Boolean))&&void 0!==n?n:[]}))}),s=a.flatMap(function(e){return Array.from(e)}),c=s.reduce(function(e,t){var n;return e[t]=(null!==(n=e[t])&&void 0!==n?n:0)+1,e},{}),p=new Set(Object.entries(c).filter(function(e){return e[1]>1}).map(function(e){return e[0]})),m=function(e){return e.map(function(e){var t;return n(n({},e),{variants:null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return n(n({},e),{isLinked:!!e.link_id&&p.has(e.link_id)})})})})},f=l.map(function(e,t){var n,r=e[0],o=e[1],i=rt.find(function(e){return e.tier_name===r}),l=r.replace(/tier(\d+)/i,"tier_$1");return{id:null!==(n=null==i?void 0:i.tier_id)&&void 0!==n?n:String(t+1),name:l.replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}),ruleCount:o.length,description:0===t?"These are the system-wide learnings applied across all stations.":"These learnings apply after higher-priority tiers and may refine or relax default behavior.",isOpen:0===t,rules:m(o)}}),(v=u.getState().createdVariantInfo)&&v.length>0?(g=Object.fromEntries(l.map(function(e,t){return[e[0],String(t+1)]})),h=new Set(v.map(function(e){return g[e.tierName]}).filter(Boolean)),y=f.map(function(e){return n(n({},e),{isOpen:e.isOpen||h.has(e.id)})}),re(y),(T=null===(C=null===(b=null===(S=v[0])||void 0===S?void 0:S.variants)||void 0===b?void 0:b[0])||void 0===C?void 0:C.id)?setTimeout(function(){var e=document.querySelector('[data-variant-id="'.concat(T,'"]'));e&&e.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(function(){return ie()},1e4)},500):ie()):re(f),[3,5]):(re([]),[2]);case 3:return w=t.sent(),console.error("Failed to fetch rule details",w),404!==(null==w?void 0:w.status)&&Oe((null==w?void 0:w.message)||"Failed to load rules. Please try again."),re([]),[3,5];case 4:return r||Re(!1),[7];case 5:return[2]}})})},gt=ee?b((null==te?void 0:te.data)||null,ee):null,ht=gt?{ruleSetId:gt.id,ruleSetName:gt.name,ruleSetDesc:"",ruleCount:null===(k=null==gt?void 0:gt.metrics)||void 0===k?void 0:k.learningsCount}:void 0,yt=function(){if("stations"===ne)return"custom";if(!gt)return"global";switch(gt.type){case"GLOBAL":default:return"global";case"SCOPE":return"genre";case"SUBSCOPE":case"Custom":return"custom"}},Tt=function(e){if(!e)return i("p",{children:"Are you sure you want to delete this rule? This action cannot be undone."});var t=null==oe?void 0:oe.flatMap(function(e){var t;return null!==(t=e.rules)&&void 0!==t?t:[]}).find(function(t){return t.ruleId===e});return r("p",{children:["Are you sure you want to delete"," ",i("span",n({className:C.semibold},{children:null==t?void 0:t.ruleTitle}))," rule? This action cannot be undone."]})},wt={editingRule:me,editingTier:ge,editingVariants:Te,focusedVariantIndex:be,setFocusedVariantIndex:Ce,triggerAddVariant:We,triggerFixGaps:tt,copiedRule:it,copiedSourceTier:st,copiedTargetTier:dt,initialDraftMessage:Ne,app_integration_id:Y,modeId:"019dde79-0494-78d7-ba5b-54a35d20f0fc"};return r(o,ht?{children:[i(h,{ref:se}),i("div",n({className:C.container},{children:Ie?i(g,{}):ke?i(T,{errorMessage:ke,onRetry:vt}):i(y,{onAddRule:mt,onDeleteRule:function(e){Ve(e)},onEditRule:function(e,t){fe(e),he(t||null),we(e.variants||null),Ce(null),qe(!0),de(!0)},onEditVariant:function(e,t,n,r){var o,i,l,a,s=null!==(l=null===(i=null===(o=null==oe?void 0:oe.find(function(e){return e.name===n}))||void 0===o?void 0:o.rules)||void 0===i?void 0:i.find(function(e){return e.ruleId===t}))&&void 0!==l?l:null==oe?void 0:oe.flatMap(function(e){return e.rules}).find(function(e){return e.ruleId===t});if(s){var u=null===(a=s.variants)||void 0===a?void 0:a.findIndex(function(t){return t.variantId===e.variantId}),c=void 0!==u&&-1!==u?u:0;fe(s),he(n||null),we(s.variants||null),Ce(c),de(!0),"resolve_gaps"===r&&nt(!0)}},onDeleteVariant:function(e,t){Qe({variantId:e,ruleId:t})},onExportRule:function(){return e(void 0,void 0,void 0,function(){var e,n,r,o,l,a,s;return t(this,function(t){switch(t.label){case 0:if(!ee)return[2];xe(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,p(ee)];case 2:return e=t.sent(),n=window.URL.createObjectURL(e),(r=document.createElement("a")).href=n,o=(null==ht?void 0:ht.ruleSetName)?"".concat(ht.ruleSetName.replace(/\s+/g,"_"),"_rules.csv"):"ruleset_".concat(ee,".csv"),r.download=o,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n),null===(a=se.current)||void 0===a||a.show({severity:"success",sticky:!1,life:3e3,className:C.successToast,content:i(w,{message:"Ruleset exported successfully!"})}),[3,5];case 3:return l=t.sent(),console.error("Export error:",l),null===(s=se.current)||void 0===s||s.show({severity:"error",sticky:!1,className:C.errorToast,content:i(S,{message:l.message||"Failed to export ruleset. Please try again."})}),[3,5];case 4:return xe(!1),[7];case 5:return[2]}})})},isExporting:De,onToggleSuccess:function(){return vt(!0)},onReorderRules:function(n,r,o,l,a){return e(void 0,void 0,void 0,function(){var e,s,u;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,v(n,r,o,l,a)];case 1:return t.sent(),vt(!0),null===(s=se.current)||void 0===s||s.show({severity:"success",sticky:!1,life:3e3,className:C.successToast,content:i(w,{message:"Rule order changed successfully. Future rule applications will follow the updated order."})}),[3,3];case 2:return e=t.sent(),console.error("Failed to reorder rules:",e),vt(!0),null===(u=se.current)||void 0===u||u.show({severity:"error",sticky:!1,className:C.errorToast,content:i(S,{message:"Failed to update rule order. Please try again."})}),[3,3];case 3:return[2]}})})},onRefreshRuleSets:X,setDeleteConfirmationUsedFor:$e,onCopyToTier:function(e,t,n,r,o){var i,l,a=null===(l=null===(i=null==oe?void 0:oe.find(function(e){return e.name===r}))||void 0===i?void 0:i.rules)||void 0===l?void 0:l.find(function(e){return e.ruleId===t});if(a){var s=["Add a new learning with the following details:","- Rule Title: ".concat(n),"- Description: ".concat(e.description),"- When to apply: ".concat(e.whenToApply),"- When NOT to apply: ".concat(e.whenNotToApply),"- Tier information: ".concat(o)].join("\n");Ee(s),lt(a),ut(r),pt(o),fe(null),he(null),we(null),Ce(null),de(!0)}}})})),ce&&i(I,{children:i(R,{isOpen:ce,onClose:ft,app_integration_id:Y,token:Z,mode:"ADD",pluginPayload:n(n({},wt),{initialScope:yt(),ruleSet:ht})})}),i(j,{isOpen:!!Fe,title:q,description:Tt(Fe),warning:H,confirmText:Q,confirmBgColor:"#EF4444",onConfirm:function(){return e(void 0,void 0,void 0,function(){var e,n,r,o,l;return t(this,function(t){switch(t.label){case 0:if(!Fe)return[2];Ue(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,m(Fe)];case 2:return t.sent(),Ve(null),null===(n=se.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:C.successToast,content:i(w,{message:A})}),vt(),X&&X(!1,ee||void 0),[3,5];case 3:return e=t.sent(),console.error("Failed to delete rule",e),null===(r=se.current)||void 0===r||r.show({severity:"error",sticky:!1,className:C.errorToast,content:i(S,{message:(null===(l=null===(o=null==e?void 0:e.response)||void 0===o?void 0:o.data)||void 0===l?void 0:l.detail)||J})}),[3,5];case 4:return Ue(!1),[7];case 5:return[2]}})})},onCancel:function(){return Ve(null)},isLoading:Je}),i(j,{isOpen:!!Ke,title:q,description:"variantDeletion"===He?i("span",{children:"Are you sure you want to delete this variant? This action cannot be undone."}):Tt((null==Ke?void 0:Ke.ruleId)||null),warning:"ruleDeletion"===He?H:z,confirmText:Q,confirmBgColor:"#EF4444",onConfirm:function(){return e(void 0,void 0,void 0,function(){var e,n,r,o,l;return t(this,function(t){switch(t.label){case 0:if(!Ke)return[2];Ze(!0),t.label=1;case 1:return t.trys.push([1,6,7,8]),"ruleDeletion"!==He?[3,3]:[4,f(Ke.ruleId)];case 2:return t.sent(),[3,5];case 3:return[4,m(Ke.variantId)];case 4:t.sent(),t.label=5;case 5:return Qe(null),null===(n=se.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:C.successToast,content:i(w,{message:"ruleDeletion"===He?A:V})}),vt(),X&&X(!1,ee||void 0),[3,8];case 6:return e=t.sent(),console.error("Failed to delete variant",e),null===(r=se.current)||void 0===r||r.show({severity:"error",sticky:!1,className:C.errorToast,content:i(S,{message:(null===(l=null===(o=null==e?void 0:e.response)||void 0===o?void 0:o.data)||void 0===l?void 0:l.detail)||("ruleDeletion"===He?J:B)})}),[3,8];case 7:return Ze(!1),[7];case 8:return[2]}})})},onCancel:function(){return Qe(null)},isLoading:Ye})]}:{children:[i(c,{onCreate:mt,title:L,desc:x,button:N}),ce&&i(I,{children:i(R,{isOpen:ce,onClose:ft,app_integration_id:Y,token:Z,mode:"ADD",pluginPayload:n(n({},wt),{initialScope:yt(),ruleSet:ht})})})]})};export{_ as default};
1
+ import{__awaiter as e,__generator as t,__assign as n}from"tslib";import{jsxs as r,Fragment as o,jsx as i}from"react/jsx-runtime";import{useRef as l,useState as a,useEffect as s}from"react";import{useLearningTemplateStore as u}from"../store/useLearningTemplateStore.js";import c from"../components/EmptyLearningState.js";import{getRulesInRuleSetById as d,exportRuleSet as p,deleteRule as m,deleteQuestion as f,alterQuestionPriority as v}from"../apis/scopeApis.js";import g from"../components/RuleContentSkeleton.js";import{Toast as h}from"primereact/toast";import y from"./ContentLogic.js";import T from"../components/ErrorStateDisplay.js";import w from"../shared/SuccessToastContent.js";import S from"../shared/ErrorToastContent.js";import{findNodeById as b}from"../utils/treeUtils.js";import C from"../styles/LearningContent.module.css.js";import j from"../components/ConfirmationModal.js";import"../../IL-OTJ/_components/atoms/Textarea/Textarea.js";import"lucide-react";import"../../IL-OTJ/_components/InputDataReasoningCard.js";import"../../IL-OTJ/_components/TooltipComponent.js";import"../../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js";import{CitationProvider as I}from"../../IL-OTJ/store/CitationsContext.js";import"@mui/material";import"uuid";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import"axios";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"../../IL-OTJ/_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"../../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js";import"../../IL-OTJ/_components/CitationLink.js";import"@e-llm-studio/citation";import"@viswa-test/test-citation";import R from"../../IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js";import _ from"../../IL-OTJ/ValueTypeWrappers/TeachMePlugin.js";import"../store/usePermissionsStore.js";import"appsec-ui";import"../store/useAuthStore.js";import"../store/useEnvStore.js";import"@radix-ui/react-tooltip";import"../components/StationOnboarding/InputField.js";import"../store/useConfigStore.js";import"../config.js";import"../components/ToolTip.js";import"@tanstack/react-query";import"../store/useAppSecRolesStore.js";import"react-router-dom";var O=function(O){var k,L=O.noRulesTitle,D=void 0===L?"No rules have been added !":L,M=O.noRulesDesc,x=void 0===M?"Start by adding rules that should apply across all stations.":M,N=O.noRulesButtonText,E=void 0===N?"Create New Rule":N,A=O.deleteRuleSuccessMessage,F=void 0===A?"Rule deleted successfully!":A,V=O.deleteVariantSuccessMessage,P=void 0===V?"Variant deleted successfully!":V,J=O.deleteRuleErrorMessage,U=void 0===J?"Failed to delete rule. Please try again.":J,B=O.deleteVariantErrorMessage,W=void 0===B?"Failed to delete variant. Please try again.":B,q=O.deleteModalTitle,G=void 0===q?"Delete":q,H=O.deleteRuleModalWarning,$=void 0===H?"This will permanently delete the rule configuration.":H,z=O.deleteVariantModalWarning,K=void 0===z?"This will permanently delete the variant configuration.":z,Q=O.deleteConfirmText,X=void 0===Q?"Delete":Q,Y=O.onRefreshRuleSets,Z=O.app_integration_id,ee=O.token,te=u(function(e){return e.selectedRuleSetId}),ne=u(function(e){return e.scopeTreeData}),re=u(function(e){return e.sidebarTab}),oe=u(function(e){return e.setInitialRules}),ie=u(function(e){return e.currentRules});u(function(e){return e.createdVariantInfo});var le=u(function(e){return e.resetCreatedVariantInfo}),ae=u(function(e){return e.isILModalTriggered}),se=u(function(e){return e.setIsILModalTriggered}),ue=l(null),ce=a(!1),de=ce[0],pe=ce[1],me=a(null),fe=me[0],ve=me[1],ge=a(null),he=ge[0],ye=ge[1],Te=a(null),we=Te[0],Se=Te[1],be=a(null),Ce=be[0],je=be[1],Ie=a(!1),Re=Ie[0],_e=Ie[1],Oe=a(null),ke=Oe[0],Le=Oe[1],De=a(!1),Me=De[0],xe=De[1],Ne=a(""),Ee=Ne[0],Ae=Ne[1],Fe=a(null),Ve=Fe[0],Pe=Fe[1],Je=a(!1),Ue=Je[0],Be=Je[1],We=a(!1),qe=We[0],Ge=We[1],He=a("ruleDeletion"),$e=He[0],ze=He[1],Ke=a(null),Qe=Ke[0],Xe=Ke[1],Ye=a(!1),Ze=Ye[0],et=Ye[1],tt=a(!1),nt=tt[0],rt=tt[1],ot=u.getState().tiers,it=a(null),lt=it[0],at=it[1],st=a(null),ut=st[0],ct=st[1],dt=a(null),pt=dt[0],mt=dt[1],ft=function(){ve(null),ye(null),pe(!0),je(0)},vt=function(){pe(!1),se(!1),ve(null),ye(null),Se(null),je(null),Ge(!1),rt(!1),gt(),at(null),ct(null),mt(null),Y&&Y(!1,te||void 0)};s(function(){gt()},[te,oe]),s(function(){ae&&pe(!0)},[ae]);var gt=function(r){return void 0===r&&(r=!1),e(void 0,void 0,void 0,function(){var e,o,i,l,a,s,c,p,m,f,v,g,h,y,T,w,S,b,C;return t(this,function(t){switch(t.label){case 0:if(!te)return oe([]),[2];r||_e(!0),Le(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,d(te,ee)];case 2:return e=t.sent(),console.log("response==",e),(null==e?void 0:e.data)&&0!==Object.keys(e.data).length?(o=e.data,console.log("rulesData==",o),i=new Set(["ruleSetName","ruleSetDesc","created_at","updated_at","created_by","updated_by"]),l=Object.entries(o).filter(function(e){var t=e[0],n=e[1];return!i.has(t)&&Array.isArray(n)}),a=l.map(function(e){var t=e[1];return new Set(t.flatMap(function(e){var t,n;return null!==(n=null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return e.link_id}).filter(Boolean))&&void 0!==n?n:[]}))}),s=a.flatMap(function(e){return Array.from(e)}),c=s.reduce(function(e,t){var n;return e[t]=(null!==(n=e[t])&&void 0!==n?n:0)+1,e},{}),p=new Set(Object.entries(c).filter(function(e){return e[1]>1}).map(function(e){return e[0]})),m=function(e){return e.map(function(e){var t;return n(n({},e),{variants:null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return n(n({},e),{isLinked:!!e.link_id&&p.has(e.link_id)})})})})},f=l.map(function(e,t){var n,r=e[0],o=e[1],i=ot.find(function(e){return e.tier_name===r}),l=r.replace(/tier(\d+)/i,"tier_$1");return{id:null!==(n=null==i?void 0:i.tier_id)&&void 0!==n?n:String(t+1),name:l.replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}),ruleCount:o.length,description:0===t?"These are the system-wide learnings applied across all stations.":"These learnings apply after higher-priority tiers and may refine or relax default behavior.",isOpen:0===t,rules:m(o)}}),(v=u.getState().createdVariantInfo)&&v.length>0?(g=Object.fromEntries(l.map(function(e,t){return[e[0],String(t+1)]})),h=new Set(v.map(function(e){return g[e.tierName]}).filter(Boolean)),y=f.map(function(e){return n(n({},e),{isOpen:e.isOpen||h.has(e.id)})}),oe(y),(T=null===(C=null===(b=null===(S=v[0])||void 0===S?void 0:S.variants)||void 0===b?void 0:b[0])||void 0===C?void 0:C.id)?setTimeout(function(){var e=document.querySelector('[data-variant-id="'.concat(T,'"]'));e&&e.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(function(){return le()},1e4)},500):le()):oe(f),[3,5]):(oe([]),[2]);case 3:return w=t.sent(),console.error("Failed to fetch rule details",w),404!==(null==w?void 0:w.status)&&Le((null==w?void 0:w.message)||"Failed to load rules. Please try again."),oe([]),[3,5];case 4:return r||_e(!1),[7];case 5:return[2]}})})},ht=te?b((null==ne?void 0:ne.data)||null,te):null,yt=ht?{ruleSetId:ht.id,ruleSetName:ht.name,ruleSetDesc:"",ruleCount:null===(k=null==ht?void 0:ht.metrics)||void 0===k?void 0:k.learningsCount}:void 0,Tt=function(){if("stations"===re)return"custom";if(!ht)return"global";switch(ht.type){case"GLOBAL":default:return"global";case"SCOPE":return"genre";case"SUBSCOPE":case"Custom":return"custom"}},wt=function(e){if(!e)return i("p",{children:"Are you sure you want to delete this rule? This action cannot be undone."});var t=null==ie?void 0:ie.flatMap(function(e){var t;return null!==(t=e.rules)&&void 0!==t?t:[]}).find(function(t){return t.ruleId===e});return r("p",{children:["Are you sure you want to delete"," ",i("span",n({className:C.semibold},{children:null==t?void 0:t.ruleTitle}))," rule? This action cannot be undone."]})},St={editingRule:fe,editingTier:he,editingVariants:we,focusedVariantIndex:Ce,setFocusedVariantIndex:je,triggerAddVariant:qe,triggerFixGaps:nt,copiedRule:lt,copiedSourceTier:ut,copiedTargetTier:pt,initialDraftMessage:Ee,app_integration_id:Z,modeId:"019dde79-0494-78d7-ba5b-54a35d20f0fc"};return r(o,yt?{children:[i(h,{ref:ue}),i("div",n({className:C.container},{children:Re?i(g,{}):ke?i(T,{errorMessage:ke,onRetry:gt}):i(y,{onAddRule:ft,onDeleteRule:function(e){Pe(e)},onEditRule:function(e,t){ve(e),ye(t||null),Se(e.variants||null),je(null),Ge(!0),pe(!0)},onEditVariant:function(e,t,n,r){var o,i,l,a,s=null!==(l=null===(i=null===(o=null==ie?void 0:ie.find(function(e){return e.name===n}))||void 0===o?void 0:o.rules)||void 0===i?void 0:i.find(function(e){return e.ruleId===t}))&&void 0!==l?l:null==ie?void 0:ie.flatMap(function(e){return e.rules}).find(function(e){return e.ruleId===t});if(s){var u=null===(a=s.variants)||void 0===a?void 0:a.findIndex(function(t){return t.variantId===e.variantId}),c=void 0!==u&&-1!==u?u:0;ve(s),ye(n||null),Se(s.variants||null),je(c),pe(!0),"resolve_gaps"===r&&rt(!0)}},onDeleteVariant:function(e,t){Xe({variantId:e,ruleId:t})},onExportRule:function(){return e(void 0,void 0,void 0,function(){var e,n,r,o,l,a,s;return t(this,function(t){switch(t.label){case 0:if(!te)return[2];xe(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,p(te)];case 2:return e=t.sent(),n=window.URL.createObjectURL(e),(r=document.createElement("a")).href=n,o=(null==yt?void 0:yt.ruleSetName)?"".concat(yt.ruleSetName.replace(/\s+/g,"_"),"_rules.csv"):"ruleset_".concat(te,".csv"),r.download=o,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n),null===(a=ue.current)||void 0===a||a.show({severity:"success",sticky:!1,life:3e3,className:C.successToast,content:i(w,{message:"Ruleset exported successfully!"})}),[3,5];case 3:return l=t.sent(),console.error("Export error:",l),null===(s=ue.current)||void 0===s||s.show({severity:"error",sticky:!1,className:C.errorToast,content:i(S,{message:l.message||"Failed to export ruleset. Please try again."})}),[3,5];case 4:return xe(!1),[7];case 5:return[2]}})})},isExporting:Me,onToggleSuccess:function(){return gt(!0)},onReorderRules:function(n,r,o,l,a){return e(void 0,void 0,void 0,function(){var e,s,u;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,v(n,r,o,l,a)];case 1:return t.sent(),gt(!0),null===(s=ue.current)||void 0===s||s.show({severity:"success",sticky:!1,life:3e3,className:C.successToast,content:i(w,{message:"Rule order changed successfully. Future rule applications will follow the updated order."})}),[3,3];case 2:return e=t.sent(),console.error("Failed to reorder rules:",e),gt(!0),null===(u=ue.current)||void 0===u||u.show({severity:"error",sticky:!1,className:C.errorToast,content:i(S,{message:"Failed to update rule order. Please try again."})}),[3,3];case 3:return[2]}})})},onRefreshRuleSets:Y,setDeleteConfirmationUsedFor:ze,onCopyToTier:function(e,t,n,r,o){var i,l,a=null===(l=null===(i=null==ie?void 0:ie.find(function(e){return e.name===r}))||void 0===i?void 0:i.rules)||void 0===l?void 0:l.find(function(e){return e.ruleId===t});if(a){var s=["Add a new learning with the following details:","- Rule Title: ".concat(n),"- Description: ".concat(e.description),"- When to apply: ".concat(e.whenToApply),"- When NOT to apply: ".concat(e.whenNotToApply),"- Tier information: ".concat(o)].join("\n");Ae(s),at(a),ct(r),mt(o),ve(null),ye(null),Se(null),je(null),pe(!0)}}})})),de&&i(I,{children:i(_,{isOpen:de,onClose:vt,app_integration_id:Z,token:ee,mode:"ADD",pluginPayload:n(n({},St),{initialScope:Tt(),ruleSet:yt})})}),i(j,{isOpen:!!Ve,title:G,description:wt(Ve),warning:$,confirmText:X,confirmBgColor:"#EF4444",onConfirm:function(){return e(void 0,void 0,void 0,function(){var e,n,r,o,l;return t(this,function(t){switch(t.label){case 0:if(!Ve)return[2];Be(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,m(Ve)];case 2:return t.sent(),Pe(null),null===(n=ue.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:C.successToast,content:i(w,{message:F})}),gt(),Y&&Y(!1,te||void 0),[3,5];case 3:return e=t.sent(),console.error("Failed to delete rule",e),null===(r=ue.current)||void 0===r||r.show({severity:"error",sticky:!1,className:C.errorToast,content:i(S,{message:(null===(l=null===(o=null==e?void 0:e.response)||void 0===o?void 0:o.data)||void 0===l?void 0:l.detail)||U})}),[3,5];case 4:return Be(!1),[7];case 5:return[2]}})})},onCancel:function(){return Pe(null)},isLoading:Ue}),i(j,{isOpen:!!Qe,title:G,description:"variantDeletion"===$e?i("span",{children:"Are you sure you want to delete this variant? This action cannot be undone."}):wt((null==Qe?void 0:Qe.ruleId)||null),warning:"ruleDeletion"===$e?$:K,confirmText:X,confirmBgColor:"#EF4444",onConfirm:function(){return e(void 0,void 0,void 0,function(){var e,n,r,o,l;return t(this,function(t){switch(t.label){case 0:if(!Qe)return[2];et(!0),t.label=1;case 1:return t.trys.push([1,6,7,8]),"ruleDeletion"!==$e?[3,3]:[4,f(Qe.ruleId)];case 2:return t.sent(),[3,5];case 3:return[4,m(Qe.variantId)];case 4:t.sent(),t.label=5;case 5:return Xe(null),null===(n=ue.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:C.successToast,content:i(w,{message:"ruleDeletion"===$e?F:P})}),gt(),Y&&Y(!1,te||void 0),[3,8];case 6:return e=t.sent(),console.error("Failed to delete variant",e),null===(r=ue.current)||void 0===r||r.show({severity:"error",sticky:!1,className:C.errorToast,content:i(S,{message:(null===(l=null===(o=null==e?void 0:e.response)||void 0===o?void 0:o.data)||void 0===l?void 0:l.detail)||("ruleDeletion"===$e?U:W)})}),[3,8];case 7:return et(!1),[7];case 8:return[2]}})})},onCancel:function(){return Xe(null)},isLoading:Ze})]}:{children:[i(c,{onCreate:ft,title:D,desc:x,button:E}),de&&i(I,{children:i(R,{isOpen:de,onClose:vt,initialScope:Tt(),ruleSet:yt,app_integration_id:Z,pluginPayload:St,token:ee})})]})};export{O as default};
2
2
  //# sourceMappingURL=RuleContent.js.map