text: var g="https://app.launchdarkly.com",k="405BFF",F="3DD6F5",E="A34FDE",u="fig://template?badge=\u{1F511}",m=`fig://template?color=${F}&badge=E`,f=`fig://template?color=${E}&badge=\u2691`,O=`fig://template?color=${k}&badge=P`,j="fig://template?badge=\u{1F3F7}",y="fig://template?badge=\u{1F310}",o=(e,t)=>{let n=R(e,t);return n>-1?e[n+1]:""},R=(e,t)=>{for(let n of t.name){let s=e.indexOf(n);if(s>-1)return s}return-1},b=(e,t)=>n=>{let s=JSON.parse(n),r=[];for(let i in s)for(let d in s[i])d.toLowerCase()===e&&r.push({name:s[i][d],description:i,icon:t});return r},a={projects:{script:e=>{let t=o(e,c);return`curl -s -X GET       ${o(e,p)||g}/api/v2/projects       -H 'Authorization: ${t}'`},postProcess:e=>JSON.parse(e).items.map(n=>({name:n.key,insertValue:n.key,description:n.name,icon:O}))},environments:{script:e=>{let t=o(e,c),n=o(e,l);return`curl -s -X GET       ${o(e,p)||g}/api/v2/projects/${n}       -H 'Authorization: ${t}'`},postProcess:e=>JSON.parse(e).environments.map(n=>({name:n.key,insertValue:n.key,description:n.name,icon:`fig://template?color=${n.color}&badge=E`}))},flags:{script:e=>{let t=o(e,c),n=o(e,l),s=o(e,h)||o(e,v),r=o(e,p)||g,i=s?`env=${s}`:"";return`curl -s -X GET       ${r}/api/v2/flags/${n}?${i}       -H 'Authorization: ${t}'`},postProcess:e=>JSON.parse(e).items.map(n=>({name:n.key,insertValue:n.key,description:`${n.name} - ${n.description}`,icon:f}))}},l={name:["-p","--project-key"],description:"Project key",isRepeatable:!1,isRequired:!0,icon:O,priority:800,args:{name:"string",description:"Project key",debounce:!0,generators:a.projects}},c={name:["-t","--api-token"],description:"LaunchDarkly personal access token with write-level access",isRepeatable:!1,isRequired:!0,icon:u,priority:1e3,args:{name:"string",description:"API access token",generators:{script:"cat ~/.config/ldc.json",postProcess:b("apitoken",u)}}},p={name:["-H","--host"],description:"Hostname override",isRepeatable:!1,icon:y,args:{name:"URI",description:"LaunchDarkly URI",generators:{script:"cat ~/.config/ldc.json",postProcess:b("server",y)}}},h={name:["-s","--source-env"],description:"Source environment",dependsOn:["-p"],isRepeatable:!1,isRequired:!0,icon:m,priority:700,args:{name:"string",description:"Environment key",debounce:!0,generators:a.environments}},v={name:["-d","--destination-env"],description:"Destination environment",dependsOn:["-p"],isRepeatable:!1,isRequired:!0,icon:m,priority:600,args:{name:"string",description:"Environment key",debounce:!0,generators:a.environments}},P={name:"sync-ld-flags",description:"Copy flag settings from one environment to another",options:[{name:["-h","--help"],description:"Show help for sync-ld-flags"},l,h,v,c,{name:["-o","--omit-segments"],description:"Omit segments when syncing",isRepeatable:!1},{name:["-f","--flag"],description:"Sync only the specified flag",isRepeatable:!1,icon:f,exclusiveOn:["-T","--tag"],args:{name:"string",description:"Flag key",debounce:!0,generators:a.flags}},{name:["-T","--tag"],description:"Sync flags with the specified tag(s). Only flags with all tags will sync",icon:j,exclusiveOn:["-f","--flag"],args:{name:"string",description:"Tag name"}},{name:["-n","--dry-run"],description:"Preview changes",isRepeatable:!1},p,{name:["-v","--verbose"],description:"Enable verbose logging",isRepeatable:!1},{name:["-D","--debug"],description:"Enable HTTP debugging",isRepeatable:!1}]},S=P;export{S as default};
  