import{_ as p}from"./PageHeader-8c638686.js";import{_ as h}from"./AdminLayout-bd13ff9d.js";import{T as f,m as v,A as b,c as s,a as y,b as e,t as c,k as r,e as d,g as x,o}from"./app-13978987.js";import"./dropdown-45d66330.js";const w={class:"container p-4 sm:p-6"},k={class:"mx-auto max-w-7xl py-6 sm:px-6 lg:px-8"},g={class:"px-4 py-6 sm:px-0"},j={class:"card card-body mb-6"},C={class:"mb-4 flex items-center justify-between"},U={class:"text-xl font-semibold"},V={class:"mb-4"},N=e("label",{class:"label mb-1",for:"purchase_key"}," Purchase Key ",-1),z=["value"],B=["disabled"],D={key:0},M={key:1,class:"inline-flex items-center"},S=e("svg",{class:"-ml-1 mr-3 h-5 w-5 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),A=e("div",{class:"alert alert-info mb-6",role:"alert"},[e("p",{class:"font-bold"},"Note"),e("p",null," If you have customized the script from codebase, do not use this option. You will lose your customization. ")],-1),O={key:0,class:"card card-body"},P=e("div",{class:"mb-4 flex items-center justify-between text-lg font-semibold"},[e("p",null,"Version"),e("p",null,"Update")],-1),E={class:"flex items-center justify-between"},H={class:"text-lg text-green-600"},T=["disabled"],$={key:0},I={key:1,class:"inline-flex items-center"},K=e("svg",{class:"-ml-1 mr-3 h-5 w-5 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),L={key:0,class:"alert alert-info mt-4"},Y=x({layout:h}),R=Object.assign(Y,{__name:"ModuleUpdate",props:{module_json:Object,updateData:Object},setup(a){const l=a,i=f({}),t=v(!1),u=()=>{i.post(route("admin.module-settings-check-update",l.module_json.modules_core_name))},m=()=>{t.value=!0,i.put(route("admin.module-developer-settings.update",l.module_json.modules_core_name),{preserveState:!0,preserveScroll:!0,onSuccess:()=>{t.value=!1},onError:_=>{t.value=!1}})},n=b(()=>l.updateData[l.module_json.modules_core_name]);return(_,q)=>(o(),s("main",w,[y(p),e("div",k,[e("div",g,[e("div",j,[e("div",C,[e("h2",U,"Modules Update - "+c(a.module_json.name),1),e("p",null,"Current Version: "+c(a.module_json.version),1)]),e("div",V,[N,e("input",{id:"purchase_key",type:"text",value:a.module_json.module_key,readonly:"",class:"input"},null,8,z)]),e("button",{onClick:u,disabled:t.value,class:"btn btn-primary"},[t.value?(o(),s("span",M,[S,r(" Please wait... ")])):(o(),s("span",D,"Check New Update"))],8,B)]),A,a.updateData&&n.value?(o(),s("div",O,[P,e("div",E,[e("p",H,"v"+c(n.value.version),1),e("button",{onClick:m,disabled:t.value,class:"btn btn-primary"},[t.value?(o(),s("span",I,[K,r(" Please wait... ")])):(o(),s("span",$,"Update now"))],8,T)]),n.value.message?(o(),s("p",L," Note: "+c(n.value.message),1)):d("",!0)])):d("",!0)])])]))}});export{R as default};
