import{d as u,u as x,o,a as l,b as r,e as i,h as y,w as _,f as e,q as g,t as n,s as b,v as f,x as v,j as d,F as X}from"./app-bWy6VYs1.js";import{a as k,_ as h}from"./AppLayout.vue_vue_type_script_setup_true_lang-BwuDxc8O.js";import"./index-C32fBP6Q.js";import"./index-CMWG4mbA.js";import"./useForwardExpose-Cx2E44RD.js";import"./VisuallyHidden-0BfmsMPn.js";import"./RovingFocusGroup-D20OvR_w.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./_plugin-vue_export-helper-DmjF0He4.js";const L={class:"p-4"},w={class:"rounded-lg border bg-white p-6 shadow-sm"},V={class:"mb-4"},M={class:"mt-1 text-sm text-gray-600"},S={class:"grid gap-4 md:grid-cols-2"},U={class:"text-sm text-gray-800"},B={class:"text-sm text-gray-800"},C={class:"text-sm text-gray-800"},F={class:"text-sm text-gray-800"},N=["disabled"],D={key:0,class:"mt-1 text-sm text-red-600"},I={class:"flex items-center gap-3"},R=["disabled"],T={key:0},j={key:1},q={key:0,class:"text-sm text-gray-600"},Q=u({__name:"License",props:{license:{},canManageLicense:{type:Boolean}},setup(c){const t=c,a=x({license_key:t.license.license_key??""}),m=()=>{a.post("/administration/license")};return(z,s)=>(o(),l(X,null,[r(i(y),{title:"License"}),r(h,{breadcrumbs:[{title:"Administration",href:i(k).index().url},{title:"License",href:"/administration/license"}]},{default:_(()=>[e("div",L,[s[7]||(s[7]=e("h1",{class:"mb-2 text-2xl font-bold"},"Instance License",-1)),s[8]||(s[8]=e("p",{class:"mb-6 text-sm text-gray-600"}," This instance must have a valid license key linked to this URL before normal usage is allowed. ",-1)),e("div",w,[e("div",V,[s[1]||(s[1]=e("p",{class:"text-sm text-gray-600"},"Status",-1)),e("p",{class:g(t.license.valid?"text-green-700 font-semibold":"text-red-700 font-semibold")},n(t.license.valid?"Valid":"Invalid"),3),e("p",M,n(t.license.validation_message),1)]),e("div",S,[e("div",null,[s[2]||(s[2]=e("p",{class:"text-xs uppercase text-gray-500"},"Licensed URL",-1)),e("p",U,n(t.license.licensed_url||"-"),1)]),e("div",null,[s[3]||(s[3]=e("p",{class:"text-xs uppercase text-gray-500"},"Last Validated",-1)),e("p",B,n(t.license.last_validated_at||"-"),1)]),e("div",null,[s[4]||(s[4]=e("p",{class:"text-xs uppercase text-gray-500"},"Standard Users",-1)),e("p",C,n(t.license.standard_users??"-"),1)]),e("div",null,[s[5]||(s[5]=e("p",{class:"text-xs uppercase text-gray-500"},"Limited Users",-1)),e("p",F,n(t.license.limited_users??"-"),1)])]),e("form",{class:"mt-6 space-y-4",onSubmit:b(m,["prevent"])},[e("div",null,[s[6]||(s[6]=e("label",{for:"license_key",class:"mb-1 block text-sm font-medium text-gray-700"},"License Key",-1)),f(e("input",{id:"license_key","onUpdate:modelValue":s[0]||(s[0]=p=>i(a).license_key=p),type:"text",class:"w-full rounded border border-gray-300 px-3 py-2 focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary",placeholder:"XXXX-XXXX-XXXX-XXXX-XXXX",disabled:!t.canManageLicense||i(a).processing},null,8,N),[[v,i(a).license_key]]),i(a).errors.license_key?(o(),l("p",D,n(i(a).errors.license_key),1)):d("",!0)]),e("div",I,[e("button",{type:"submit",class:"rounded bg-primary px-4 py-2 text-sm font-medium text-white hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",disabled:!t.canManageLicense||i(a).processing},[i(a).processing?(o(),l("span",T,"Validating...")):(o(),l("span",j,"Save & Validate"))],8,R),t.canManageLicense?d("",!0):(o(),l("p",q," Only administrators can update the license key. "))])],32)])])]),_:1},8,["breadcrumbs"])],64))}});export{Q as default};
