import{V as k,g as y,k as C,W as V,b as m,T as _,h as U,n as p,s as N}from"./ReferenceContentLoader-34zh6S1n.js";import{x as T}from"./ScalarToggle.vue-GokKqjks.js";import{w as $}from"./DeleteSidebarListElement.vue-BOkQGL8v.js";import{d as D,c as i,o as r,a as e,e as t,u as a,F as d,f,t as M,w as h}from"./index-CDPBytck.js";import"./DocumentMobileHeader.vue-CtBquMK3.js";import"./__vite-browser-external-D7Ct-6yo.js";const W={class:"flex h-full w-full flex-col gap-12 px-1.5 pt-8"},B={class:"flex flex-col gap-2"},A={class:"bg-b-2 rounded-lg border text-sm"},I={class:"bg-b-1 flex items-center justify-between gap-4 rounded-t-lg p-3"},L={class:"text-c-1 flex items-center overflow-x-auto border-t py-1.5 whitespace-nowrap"},O={class:"flex items-center"},E=["href"],F={class:"flex flex-col gap-4"},P={class:"flex items-center justify-between rounded-lg border p-3 text-sm"},R=D({__name:"CollectionSettings",setup(S){const{activeCollection:o,activeWorkspace:s,activeWorkspaceCollections:v}=k(),{collectionMutators:u}=y(),{replace:x}=C(),n=V();function g(){o.value&&o.value?.documentUrl&&u.edit(o.value.uid,"watchMode",!o.value?.watchMode)}function w(){if(!o.value||!s.value)return;u.delete(o.value,s.value);const c=v.value[0];c&&x({name:"collection",params:{[p.Workspace]:s.value.uid,[p.Collection]:c.uid}}),n.hide()}return(c,l)=>(r(),i(d,null,[e("div",W,[e("div",B,[l[5]||(l[5]=e("div",{class:"flex h-8 items-center"},[e("h3",{class:"font-bold"},"Features")],-1)),e("div",A,[e("div",I,[l[2]||(l[2]=e("div",null,[e("h4",null,"Watch Mode"),e("p",{class:"text-c-2 mt-1"}," When enabled, the OpenAPI document will be polled for changes. The collection will be updated automatically. ")],-1)),t(a(T),{class:"w-4",disabled:!a(o)?.documentUrl,modelValue:a(o)?.watchMode??!1,"onUpdate:modelValue":g},null,8,["disabled","modelValue"])]),e("div",L,[e("div",O,[a(o)?.documentUrl?(r(),i(d,{key:0},[l[3]||(l[3]=e("span",{class:"bg-b-2 sticky left-0 pr-2 pl-3"},"Source",-1)),e("a",{class:"text-c-2 group rounded pr-3 no-underline hover:underline",href:a(o).documentUrl,target:"_blank"},[f(M(a(o).documentUrl)+" ",1),t(a(m),{class:"ml-1 hidden w-2.5 group-hover:inline",icon:"ExternalLink"})],8,E)],64)):(r(),i(d,{key:1},[t(a(m),{class:"text-c-2 mr-2 ml-3 w-4",icon:"NotAllowed",size:"sm"}),l[4]||(l[4]=e("span",{class:"text-c-2 pr-3"}," No URL configured. Try importing an OpenAPI document from an URL. ",-1))],64))])])])]),e("div",F,[l[8]||(l[8]=e("h3",{class:"font-bold"},"Danger Zone",-1)),e("div",P,[l[7]||(l[7]=e("div",null,[e("h4",null,"Delete Collection"),e("p",{class:"text-c-2 mt-1"}," Be careful, my friend. Once deleted, there is no way to recover the collection. ")],-1)),t(a(_),{class:"custom-scroll h-8 gap-1.5 px-2.5 font-medium whitespace-nowrap shadow-none focus:outline-none",variant:"danger",onClick:l[0]||(l[0]=b=>a(n).show())},{default:h(()=>l[6]||(l[6]=[f(" Delete Collection ")])),_:1,__:[6]})])])]),t(a(U),{size:"xxs",state:a(n),title:`Delete ${a(o)?.info?.title}`},{default:h(()=>[t($,{variableName:a(o)?.info?.title??"",warningMessage:"This action cannot be undone.",onClose:l[1]||(l[1]=b=>a(n).hide()),onDelete:w},null,8,["variableName"])]),_:1},8,["state","title"])],64))}}),J=N(R,[["__scopeId","data-v-5170f3be"]]);export{J as default};
