import{l as e,aF as t,dz as i,dA as n,a6 as r,e1 as a,FY as o,vf as s,ve as d,vB as l,FZ as u,dh as c,q as _}from"./c2ee0272b-DPDuX889.js";import{u as p}from"./vendor-query-CRl6sF7K.js";import{r as m}from"./vendor-react-Dp9pL_Wn.js";import{ej as g}from"./index-XoaBlZfC.js";function k({onError:i,organizationUuid:n}){const{activeOrganization:r}=e(),a=n??r?.uuid,{data:o,variables:s,...d}=t(`/api/billing/${a}/ss_enterprise_pricing`,"POST",{enabled:!!a,meta:{noToast:!0},onError:i}),[l,u]=m.useState(),[c,_]=m.useState();return m.useEffect(()=>{o&&(u(o),_(s))},[o,s]),{data:l,variables:c,...d}}const f=i=>{const{activeOrganization:n}=e();return t(`/api/organizations/${n?.uuid}/subscription/ss-enterprise`,"PUT",{enabled:!!n,...i?.noToast?{meta:{noToast:i.noToast}}:{}})};function v({enabled:t=!0}={}){const{activeOrganization:a}=e(),o=a?.uuid,s=i(n.BillingManage);return r(`/api/organizations/${o}/team/upgrade_to_ss_enterprise_eligibility`,{queryKey:["upgrade_to_ss_enterprise_eligibility",o],enabled:t&&!!o&&s,meta:{noToast:!0}})}function b(i={}){const{activeOrganization:n}=e(),r=p(),_=i.organizationUuid??n?.uuid;return t(`/api/organizations/${_}/team/upgrade_to_ss_enterprise`,"PUT",{...i,async onSuccess(e,t,n){!e.idvRequirement||g(e.idvRequirement.status)?(r.setQueriesData({queryKey:[a,_]},e=>{if(e)return{...e,status:"active"}}),r.invalidateQueries({queryKey:[o,_]}),r.invalidateQueries({queryKey:[s,_]}),r.invalidateQueries({queryKey:[d,_]}),r.invalidateQueries({queryKey:[l,_]}),await r.invalidateQueries({queryKey:[u,_]}),await r.invalidateQueries({queryKey:[c]}),await(i.onSuccess?.(e,t,n))):await(i.onSuccess?.(e,t,n))},enabled:!!_})}function y(){return _("claude_code_skills_dashboard_enabled")}function w(){return _("claude_code_skills_tab_live_data")}const h=(t,i,n=!0)=>{const{activeOrganization:a}=e(),o=m.useMemo(()=>{if(!a?.uuid)return null;return`/api/claude_code/skills?${new URLSearchParams({start_date:t,end_date:i,organization_uuid:a.uuid}).toString()}`},[a?.uuid,t,i]);return r(o,{queryKey:["claude_code_skills",a?.uuid,{startDate:t,endDate:i}],staleTime:3e5,enabled:n&&!!a&&!!o})},x=(t,i)=>{const{activeOrganization:n}=e();return m.useMemo(()=>{if(!n?.uuid)return null;return`/api/claude_code/skills/export?${new URLSearchParams({start_date:t,end_date:i,organization_uuid:n.uuid}).toString()}`},[n?.uuid,t,i])},z={summary:{total_skills:8,total_invocations:21900,total_distinct_users:162,good_count:5,warn_count:2,poor_count:1},skills:[{skill_name:"commit",dau:41.2,distinct_users:84,invocations:5200,error_rate:.04,dau_trend:.18,health:"good",avg_invocations_per_user:61.9},{skill_name:"review",dau:33.5,distinct_users:62,invocations:3800,error_rate:.06,dau_trend:.05,health:"good",avg_invocations_per_user:61.3},{skill_name:"test",dau:28.9,distinct_users:55,invocations:3100,error_rate:.09,dau_trend:-.03,health:"good",avg_invocations_per_user:56.4},{skill_name:"fix",dau:19.4,distinct_users:41,invocations:2400,error_rate:.13,dau_trend:.11,health:"warn",avg_invocations_per_user:58.5},{skill_name:"deploy",dau:14.1,distinct_users:32,invocations:1900,error_rate:.07,dau_trend:.42,health:"good",avg_invocations_per_user:59.4},{skill_name:"refactor",dau:11.6,distinct_users:28,invocations:1600,error_rate:.05,dau_trend:-.02,health:"good",avg_invocations_per_user:57.1},{skill_name:"migrate-db",dau:6.8,distinct_users:18,invocations:2100,error_rate:.21,dau_trend:-.28,health:"warn",avg_invocations_per_user:116.7},{skill_name:"release-notes",dau:3.2,distinct_users:9,invocations:1800,error_rate:.34,dau_trend:-.61,health:"poor",avg_invocations_per_user:200}]};
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
var $={comments:{lineComment:"COMMENT"},brackets:[["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:":",close:"."}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`"},{open:'"',close:'"'},{open:"'",close:"'"},{open:":",close:"."}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|COMMENT\\s+)#region"),end:new RegExp("^\\s*(::\\s*|COMMENT\\s+)#endregion")}}};const q=Object.freeze(Object.defineProperty({__proto__:null,conf:$,language:{tokenPostfix:".lexon",ignoreCase:!0,keywords:["lexon","lex","clause","terms","contracts","may","pay","pays","appoints","into","to"],typeKeywords:["amount","person","key","time","date","asset","text"],operators:["less","greater","equal","le","gt","or","and","add","added","subtract","subtracted","multiply","multiplied","times","divide","divided","is","be","certified"],symbols:/[=><!~?:&|+\-*\/\^%]+/,tokenizer:{root:[[/^(\s*)(comment:?(?:\s.*|))$/,["","comment"]],[/"/,{token:"identifier.quote",bracket:"@open",next:"@quoted_identifier"}],["LEX$",{token:"keyword",bracket:"@open",next:"@identifier_until_period"}],["LEXON",{token:"keyword",bracket:"@open",next:"@semver"}],[":",{token:"delimiter",bracket:"@open",next:"@identifier_until_period"}],[/[a-z_$][\w$]*/,{cases:{"@operators":"operator","@typeKeywords":"keyword.type","@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\.\d*\.\d*/,"number.semver"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"]],quoted_identifier:[[/[^\\"]+/,"identifier"],[/"/,{token:"identifier.quote",bracket:"@close",next:"@pop"}]],space_identifier_until_period:[[":","delimiter"],[" ",{token:"white",next:"@identifier_rest"}]],identifier_until_period:[{include:"@whitespace"},[":",{token:"delimiter",next:"@identifier_rest"}],[/[^\\.]+/,"identifier"],[/\./,{token:"delimiter",bracket:"@close",next:"@pop"}]],identifier_rest:[[/[^\\.]+/,"identifier"],[/\./,{token:"delimiter",bracket:"@close",next:"@pop"}]],semver:[{include:"@whitespace"},[":","delimiter"],[/\d*\.\d*\.\d*/,{token:"number.semver",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"]]}}},Symbol.toStringTag,{value:"Module"}));
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/const S=Object.freeze(Object.defineProperty({__proto__:null,conf:{comments:{lineComment:"--",blockComment:["--[[","]]"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},language:{defaultToken:"",tokenPostfix:".lua",keywords:["and","break","do","else","elseif","end","false","for","function","goto","if","in","local","nil","not","or","repeat","return","then","true","until","while"],brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.array",open:"[",close:"]"},{token:"delimiter.parenthesis",open:"(",close:")"}],operators:["+","-","*","/","%","^","#","==","~=","<=",">=","<",">","=",";",":",",",".","..","..."],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/[a-zA-Z_]\w*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/(,)(\s*)([a-zA-Z_]\w*)(\s*)(:)(?!:)/,["delimiter","","key","","delimiter"]],[/({)(\s*)([a-zA-Z_]\w*)(\s*)(:)(?!:)/,["@brackets","","key","","delimiter"]],[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/,"number.hex"],[/\d+?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,""],[/--\[([=]*)\[/,"comment","@comment.$1"],[/--.*$/,"comment"]],comment:[[/[^\]]+/,"comment"],[/\]([=]*)\]/,{cases:{"$1==$S2":{token:"comment",next:"@pop"},"@default":"comment"}}],[/./,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}}},Symbol.toStringTag,{value:"Module"}));export{z as D,w as a,h as b,y as c,f as d,k as e,b as f,x as g,S as h,q as l,v as u};
