import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{L_ as l,bi as a}from"./shared-0-C4kdVF7Y.js";import{Mi as s}from"./vendor-frame-CwiylG4Y.js";import{Mm as t}from"./shared-1-3-6x7RKF.js";import{rn as i}from"./vendor-all-2-BJdkbLSj.js";import{Ia as r,Va as o}from"./shared-4-6CEyRAHb.js";import{Kr as n}from"./shared-7-VxUxSmVa.js";import{Lt as d}from"./shared-10-DEXHYEQf.js";var c=e(s());function k({skill:e,onReplace:l}){const s=d(),{mutate:t}=o(),{track:i}=a(),[n,k]=(0,c.useState)(!1),[p,m]=(0,c.useState)(!1),[u,h]=(0,c.useState)(!1);return{dropdownOpen:n,setDropdownOpen:k,showDetailsModal:u,setShowDetailsModal:h,showDeleteModal:p,setShowDeleteModal:m,handleViewDetails:(0,c.useCallback)(()=>{i({event_key:"claudeai.skills.preview_modal.opened",skill_id:e.skillId,creator_type:e.creatorType,scope:e.partitionBy}),k(!1),h(!0)},[e,i]),handleDeleteClick:(0,c.useCallback)(()=>{k(!1),m(!0)},[]),handleDeleteFromModal:(0,c.useCallback)(()=>{h(!1),m(!0)},[]),handleTryInChat:(0,c.useCallback)(()=>{i({event_key:"claudeai.skills.skill.try_in_chat_clicked",skill_id:e.skillId,creator_type:e.creatorType,scope:e.partitionBy});const l=new URLSearchParams(r(e)?{q:`/${e.skillName}`}:{q:'Hey Claude\u2014can you make something amazing with my "{skill-name}" skill?',"skill-name":e.skillName});s.push("/new?"+l.toString()),k(!1),h(!1)},[e,s,i]),handleEditWithClaude:(0,c.useCallback)(()=>{i({event_key:"claudeai.skills.skill.edit_with_claude_clicked",skill_id:e.skillId,creator_type:e.creatorType,scope:e.partitionBy});const l=new URLSearchParams({q:'Help me edit the "{skill-name}" skill using skill-creator.',"skill-name":e.skillName});s.push("/new?"+l.toString()),k(!1),h(!1)},[e,s,i]),handleDownload:(0,c.useCallback)(()=>{i({event_key:"claudeai.skills.skill.downloaded",skill_id:e.skillId,creator_type:e.creatorType,scope:e.partitionBy}),t({skillId:e.skillId}),k(!1)},[t,e,i]),handleReplace:(0,c.useCallback)(()=>{i({event_key:"claudeai.skills.skill.replace_started",skill_id:e.skillId,creator_type:e.creatorType,scope:e.partitionBy}),l?.(e.skillName),k(!1)},[l,e,i])}}var p=()=>l("__gb__888349763");function m(e){const l=p(),a=i();return l&&t(a.messages,e)}function u(e){const l=p()&&false;return(0,c.useMemo)(()=>!l&&function(e){if(!e)return!1;if(e.files.length>1)return!0;const l=e.files.find(e=>"SKILL.md"===e.path||e.path.endsWith("/SKILL.md"));return"string"!=typeof l?.content||n(l.content).hasExtraFrontmatterFields}(e),[l,e])}export{k as i,m as n,p as r,u as t};