mirror of
https://github.com/rightup/pyMC_Repeater.git
synced 2026-03-28 17:43:06 +01:00
2 lines
24 KiB
JavaScript
2 lines
24 KiB
JavaScript
import{d as D,r as l,c as B,a as W,o as I,b as Y,e as a,f as e,g as z,_ as J,t as i,u as o,n as K,h as v,F as V,i as q,j as Q,w as _,v as M,k as R,l as E,m as F,T as H,p as X,q as n,s as U,x as Z,y as ee}from"./index-xzvnOpJo.js";const te=D("setup",()=>{const x=l(1),r=l(5),y=l(`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,"0")}`),p=l(null),h=l(null),f=l(""),k=l(""),u=l(!1),c=l({frequency:"915.0",spreading_factor:"7",bandwidth:"125",coding_rate:"5"}),j=l([]),L=l([]),w=l(!1),S=l(!1),g=l(null),P=B(()=>{switch(x.value){case 1:return!0;case 2:return y.value.trim().length>0;case 3:return p.value!==null;case 4:return u.value?c.value.frequency&&c.value.spreading_factor&&c.value.bandwidth&&c.value.coding_rate:h.value!==null;case 5:return f.value.length>=6&&f.value===k.value;default:return!1}}),m=B(()=>x.value>1),t=B(()=>x.value===r.value);async function s(){w.value=!0,g.value=null;try{const b=await(await fetch("/api/hardware_options")).json();if(b.error)throw new Error(b.error);j.value=b.hardware||[]}catch(d){g.value=d instanceof Error?d.message:"Failed to load hardware options",console.error("Error fetching hardware options:",d)}finally{w.value=!1}}async function C(){w.value=!0,g.value=null;try{const b=await(await fetch("/api/radio_presets")).json();if(b.error)throw new Error(b.error);L.value=b.presets||[]}catch(d){g.value=d instanceof Error?d.message:"Failed to load radio presets",console.error("Error fetching radio presets:",d)}finally{w.value=!1}}async function T(){if(!P.value)return{success:!1,error:"Please complete all required fields"};S.value=!0,g.value=null;try{const d=u.value?{title:"Custom Configuration",description:"Custom radio settings",frequency:c.value.frequency,spreading_factor:c.value.spreading_factor,bandwidth:c.value.bandwidth,coding_rate:c.value.coding_rate}:h.value,N=await(await fetch("/api/setup_wizard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_name:y.value.trim(),hardware_key:p.value?.key,radio_preset:d,admin_password:f.value})})).json();if(!N.success)throw new Error(N.error||"Setup failed");return{success:!0,data:N}}catch(d){const b=d instanceof Error?d.message:"Failed to complete setup";return g.value=b,{success:!1,error:b}}finally{S.value=!1}}function O(){P.value&&x.value<r.value&&x.value++}function $(){m.value&&x.value--}function G(d){d>=1&&d<=r.value&&(x.value=d)}function A(){x.value=1,y.value=`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,"0")}`,p.value=null,h.value=null,u.value=!1,c.value={frequency:"915.0",spreading_factor:"7",bandwidth:"125",coding_rate:"5"},f.value="",k.value="",g.value=null}return{currentStep:x,totalSteps:r,nodeName:y,selectedHardware:p,selectedRadioPreset:h,useCustomRadio:u,customRadio:c,adminPassword:f,confirmPassword:k,hardwareOptions:j,radioPresets:L,isLoading:w,isSubmitting:S,error:g,canGoNext:P,canGoBack:m,isLastStep:t,fetchHardwareOptions:s,fetchRadioPresets:C,completeSetup:T,nextStep:O,previousStep:$,goToStep:G,reset:A}}),re={class:"min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-center justify-center p-4"},oe={class:"absolute top-4 right-4 z-20"},se={class:"w-full max-w-4xl relative z-10"},ae={class:"mb-8"},ne={class:"flex justify-between mb-2"},de={class:"text-content-secondary dark:text-content-muted text-sm"},ie={class:"text-content-secondary dark:text-content-muted text-sm"},le={class:"h-2 bg-stroke-subtle dark:bg-stroke/10 rounded-full overflow-hidden"},ue={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 sm:p-8 md:p-12"},ce={class:"flex justify-center mb-8"},pe={class:"flex gap-2"},me={class:"mb-8"},be={class:"text-2xl sm:text-3xl font-bold text-content-primary dark:text-content-primary mb-2 text-center"},xe={key:0,class:"space-y-6 mt-8"},ke={key:1,class:"space-y-6 mt-8"},ge={class:"max-w-md mx-auto"},fe={key:2,class:"space-y-6 mt-8"},ve={key:0,class:"text-center text-content-secondary dark:text-content-muted"},ye={key:1,class:"text-center text-content-secondary dark:text-content-muted"},he={key:2,class:"grid grid-cols-1 md:grid-cols-2 gap-4 max-w-3xl mx-auto"},we=["onClick"],_e={class:"font-medium text-content-primary dark:text-content-primary mb-1"},Se={class:"text-sm text-content-secondary dark:text-content-muted"},Ce={key:3,class:"space-y-6 mt-8"},Re={key:0,class:"text-center text-content-secondary dark:text-content-muted"},je={key:1,class:"text-center text-content-secondary dark:text-content-muted"},Pe={key:2,class:"max-w-5xl mx-auto"},Me={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4"},Le=["onClick"],Be={class:"relative z-10"},Te={class:"font-medium text-content-primary dark:text-content-primary mb-1 flex items-start justify-between gap-2"},Ne={class:"flex items-center gap-2"},ze={class:"text-2xl"},Ve={key:0,class:"text-primary flex-shrink-0"},qe={class:"text-xs text-content-secondary dark:text-content-muted mb-3"},Ee={class:"grid grid-cols-2 gap-2 text-xs"},Fe={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},He={class:"text-content-primary dark:text-content-primary/80 font-medium"},Ue={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},Oe={class:"text-content-primary dark:text-content-primary/80 font-medium"},$e={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},Ge={class:"text-content-primary dark:text-content-primary/80 font-medium"},Ae={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},De={class:"text-content-primary dark:text-content-primary/80 font-medium"},We={class:"border-t border-stroke-subtle dark:border-stroke/10 pt-6"},Ie={class:"flex items-center justify-between mb-2"},Ye={key:0,class:"text-primary"},Je={key:0,class:"mt-4 grid grid-cols-2 gap-4"},Ke={key:4,class:"space-y-6 mt-8"},Qe={class:"max-w-md mx-auto space-y-4"},Xe={key:0,class:"text-red-600 dark:text-red-400 text-sm"},Ze={key:0,class:"mb-6 bg-red-500/10 border border-red-500/30 rounded-lg p-4 text-red-600 dark:text-red-200"},et={class:"flex justify-between gap-4"},tt={key:1},rt=["disabled"],ot={key:0,class:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"},st={key:1},at={key:2},nt={key:3},dt={key:4,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},it={class:"flex justify-center mb-6"},lt={key:0,class:"w-16 h-16 rounded-full bg-green-100 dark:bg-green-500/20 flex items-center justify-center"},ut={key:1,class:"w-16 h-16 rounded-full bg-red-100 dark:bg-red-500/20 flex items-center justify-center"},ct={class:"text-2xl font-bold text-content-primary dark:text-content-primary text-center mb-4"},pt={class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"},mt=W({name:"SetupView",__name:"Setup",setup(x){const r=te(),y=X(),p=l(!1),h=l(""),f=l(""),k=l("success");let u=null;const c=m=>{const t=m.toLowerCase();return t.includes("australia")?"🇦🇺":t.includes("eu")||t.includes("uk")?"🇪🇺":t.includes("czech")?"🇨🇿":t.includes("new zealand")?"🇳🇿":t.includes("portugal")?"🇵🇹":t.includes("switzerland")?"🇨🇭":t.includes("usa")||t.includes("canada")?"🇺🇸":t.includes("vietnam")?"🇻🇳":"🌍"};I(async()=>{await Promise.all([r.fetchHardwareOptions(),r.fetchRadioPresets()])});const j=B(()=>r.currentStep/r.totalSteps*100);async function L(){if(r.isLastStep){const m=await r.completeSetup();m.success?(k.value="success",h.value="Setup Complete!",f.value="Your repeater has been configured successfully. The service is restarting now...",p.value=!0,g()):(k.value="error",h.value="Setup Failed",f.value=m.error||"An unknown error occurred",p.value=!0)}else r.nextStep()}function w(){r.previousStep()}function S(){p.value=!1,k.value==="success"&&(u||y.push("/login"))}function g(){let m=0;const t=30;function s(){m++,fetch("/api/status",{method:"GET"}).then(T=>{T.ok?(u=null,p.value=!1,y.push("/login")):C()}).catch(()=>{C()})}function C(){m<t?u=setTimeout(s,1e3):(u=null,p.value=!1,y.push("/login"))}u=setTimeout(s,2e3)}Y(()=>{u&&(clearTimeout(u),u=null)});const P=["Welcome","Repeater Name","Hardware Selection","Radio Configuration","Security Setup"];return(m,t)=>(n(),a("div",re,[e("div",oe,[z(J)]),t[36]||(t[36]=e("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slow -top-[79px] left-[575px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),t[37]||(t[37]=e("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-75 animate-pulse-slower -top-[94px] -left-[92px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),t[38]||(t[38]=e("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slowest top-[373px] left-[246px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),e("div",se,[e("div",ae,[e("div",ne,[e("span",de,"Step "+i(o(r).currentStep)+" of "+i(o(r).totalSteps),1),e("span",ie,i(Math.round(j.value))+"% Complete",1)]),e("div",le,[e("div",{class:"h-full bg-gradient-to-r from-primary to-primary/80 transition-all duration-500",style:K({width:`${j.value}%`})},null,4)])]),e("div",ue,[e("div",ce,[e("div",pe,[(n(!0),a(V,null,q(o(r).totalSteps,s=>(n(),a("div",{key:s,class:R(["w-10 h-10 rounded-full flex items-center justify-center text-sm font-medium transition-all",s===o(r).currentStep?"bg-primary text-white":s<o(r).currentStep?"bg-primary/30 text-content-secondary dark:text-content-primary/70":"bg-background-mute dark:bg-stroke/10 text-content-muted dark:text-content-muted"])},i(s),3))),128))])]),e("div",me,[e("h2",be,i(P[o(r).currentStep-1]),1),o(r).currentStep===1?(n(),a("div",xe,t[9]||(t[9]=[Q('<div class="text-center space-y-4" data-v-693a052e><div class="w-20 h-20 mx-auto bg-primary/20 rounded-full flex items-center justify-center mb-6" data-v-693a052e><svg class="w-10 h-10 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-693a052e><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" data-v-693a052e></path></svg></div><p class="text-content-secondary dark:text-content-primary/70 text-lg" data-v-693a052e> Welcome to your pyMC Repeater! Let's get you set up in just a few steps. </p><div class="bg-primary/10 border border-primary/30 rounded-lg p-4 text-left" data-v-693a052e><p class="text-primary text-sm font-medium mb-2" data-v-693a052e>You'll configure:</p><ul class="space-y-2 text-content-secondary dark:text-content-primary/70 text-sm" data-v-693a052e><li class="flex items-center gap-2" data-v-693a052e><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-693a052e><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-693a052e></path></svg> Repeater name and identification </li><li class="flex items-center gap-2" data-v-693a052e><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-693a052e><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-693a052e></path></svg> Hardware board selection </li><li class="flex items-center gap-2" data-v-693a052e><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-693a052e><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-693a052e></path></svg> Radio frequency and settings </li><li class="flex items-center gap-2" data-v-693a052e><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-693a052e><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-693a052e></path></svg> Admin password for secure access </li></ul></div></div>',1)]))):o(r).currentStep===2?(n(),a("div",ke,[t[12]||(t[12]=e("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Choose a unique name for your repeater. This will be used for identification on the mesh network. ",-1)),e("div",ge,[t[10]||(t[10]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Repeater Name",-1)),_(e("input",{"onUpdate:modelValue":t[0]||(t[0]=s=>o(r).nodeName=s),type:"text",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"e.g., pyRpt0001",maxlength:"32"},null,512),[[M,o(r).nodeName]]),t[11]||(t[11]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-2"}," Use letters, numbers, hyphens, or underscores (3-32 characters) ",-1))])])):o(r).currentStep===3?(n(),a("div",fe,[t[13]||(t[13]=e("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Select your hardware board type ",-1)),o(r).isLoading?(n(),a("div",ve," Loading hardware options... ")):o(r).hardwareOptions.length===0?(n(),a("div",ye," No hardware options available ")):(n(),a("div",he,[(n(!0),a(V,null,q(o(r).hardwareOptions,s=>(n(),a("button",{key:s.key,onClick:C=>o(r).selectedHardware=s,class:R(["p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm",o(r).selectedHardware?.key===s.key?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20"])},[e("div",_e,i(s.name),1),e("div",Se,i(s.description||s.key),1)],10,we))),128))]))])):o(r).currentStep===4?(n(),a("div",Ce,[t[28]||(t[28]=e("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Choose a radio configuration preset for your region or create a custom configuration ",-1)),o(r).isLoading?(n(),a("div",Re," Loading radio presets... ")):o(r).radioPresets.length===0?(n(),a("div",je," No radio presets available ")):(n(),a("div",Pe,[e("div",Me,[(n(!0),a(V,null,q(o(r).radioPresets,s=>(n(),a("button",{key:s.title,onClick:C=>{o(r).selectedRadioPreset=s,o(r).useCustomRadio=!1},class:R(["p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm relative overflow-hidden",!o(r).useCustomRadio&&o(r).selectedRadioPreset?.title===s.title?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20"])},[e("div",Be,[e("div",Te,[e("span",Ne,[e("span",ze,i(c(s.title)),1),e("span",null,i(s.title),1)]),!o(r).useCustomRadio&&o(r).selectedRadioPreset?.title===s.title?(n(),a("div",Ve,t[14]||(t[14]=[e("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20"},[e("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)]))):v("",!0)]),e("div",qe,i(s.description),1),e("div",Ee,[e("div",Fe,[t[15]||(t[15]=e("div",{class:"text-content-muted dark:text-content-muted"},"Freq",-1)),e("div",He,i(s.frequency),1)]),e("div",Ue,[t[16]||(t[16]=e("div",{class:"text-content-muted dark:text-content-muted"},"BW",-1)),e("div",Oe,i(s.bandwidth),1)]),e("div",$e,[t[17]||(t[17]=e("div",{class:"text-content-muted dark:text-content-muted"},"SF",-1)),e("div",Ge,i(s.spreading_factor),1)]),e("div",Ae,[t[18]||(t[18]=e("div",{class:"text-content-muted dark:text-content-muted"},"CR",-1)),e("div",De,i(s.coding_rate),1)])])])],10,Le))),128))]),e("div",We,[e("button",{onClick:t[1]||(t[1]=s=>{o(r).useCustomRadio=!o(r).useCustomRadio,o(r).useCustomRadio&&(o(r).selectedRadioPreset=null)}),class:R(["w-full p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm",o(r).useCustomRadio?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20"])},[e("div",Ie,[t[20]||(t[20]=e("div",{class:"font-medium text-content-primary dark:text-content-primary flex items-center gap-2"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"})]),E(" Custom Configuration ")],-1)),o(r).useCustomRadio?(n(),a("div",Ye,t[19]||(t[19]=[e("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20"},[e("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)]))):v("",!0)]),t[21]||(t[21]=e("div",{class:"text-xs text-content-secondary dark:text-content-muted"},"Manually configure frequency, bandwidth, spreading factor, and coding rate",-1))],2),z(H,{name:"slide"},{default:F(()=>[o(r).useCustomRadio?(n(),a("div",Je,[e("div",null,[t[22]||(t[22]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Frequency (MHz)",-1)),_(e("input",{"onUpdate:modelValue":t[2]||(t[2]=s=>o(r).customRadio.frequency=s),type:"number",step:"0.1",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all",placeholder:"915.0"},null,512),[[M,o(r).customRadio.frequency]])]),e("div",null,[t[23]||(t[23]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Bandwidth (kHz)",-1)),_(e("input",{"onUpdate:modelValue":t[3]||(t[3]=s=>o(r).customRadio.bandwidth=s),type:"number",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all",placeholder:"125"},null,512),[[M,o(r).customRadio.bandwidth]])]),e("div",null,[t[25]||(t[25]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Spreading Factor",-1)),_(e("select",{"onUpdate:modelValue":t[4]||(t[4]=s=>o(r).customRadio.spreading_factor=s),class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all"},t[24]||(t[24]=[e("option",{value:"7"},"7",-1),e("option",{value:"8"},"8",-1),e("option",{value:"9"},"9",-1),e("option",{value:"10"},"10",-1),e("option",{value:"11"},"11",-1),e("option",{value:"12"},"12",-1)]),512),[[U,o(r).customRadio.spreading_factor]])]),e("div",null,[t[27]||(t[27]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Coding Rate",-1)),_(e("select",{"onUpdate:modelValue":t[5]||(t[5]=s=>o(r).customRadio.coding_rate=s),class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all"},t[26]||(t[26]=[e("option",{value:"5"},"4/5",-1),e("option",{value:"6"},"4/6",-1),e("option",{value:"7"},"4/7",-1),e("option",{value:"8"},"4/8",-1)]),512),[[U,o(r).customRadio.coding_rate]])])])):v("",!0)]),_:1})])]))])):o(r).currentStep===5?(n(),a("div",Ke,[t[32]||(t[32]=e("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Set a secure admin password to protect your repeater ",-1)),e("div",Qe,[e("div",null,[t[29]||(t[29]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Admin Password",-1)),_(e("input",{"onUpdate:modelValue":t[6]||(t[6]=s=>o(r).adminPassword=s),type:"password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"Enter password (min 6 characters)",minlength:"6"},null,512),[[M,o(r).adminPassword]])]),e("div",null,[t[30]||(t[30]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Confirm Password",-1)),_(e("input",{"onUpdate:modelValue":t[7]||(t[7]=s=>o(r).confirmPassword=s),type:"password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"Confirm password"},null,512),[[M,o(r).confirmPassword]])]),o(r).adminPassword&&o(r).confirmPassword&&o(r).adminPassword!==o(r).confirmPassword?(n(),a("div",Xe," Passwords do not match ")):v("",!0),t[31]||(t[31]=e("div",{class:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3 text-sm text-yellow-800 dark:text-yellow-200"},[e("strong",null,"Important:"),E(" Remember this password - you'll need it to access the dashboard. ")],-1))])])):v("",!0)]),o(r).error?(n(),a("div",Ze,i(o(r).error),1)):v("",!0),e("div",et,[o(r).canGoBack?(n(),a("button",{key:0,onClick:w,class:"px-6 py-3 rounded-[12px] bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 text-content-primary dark:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20 transition-all duration-300 font-medium"}," Back ")):(n(),a("div",tt)),e("button",{onClick:L,disabled:!o(r).canGoNext||o(r).isSubmitting,class:R(["px-8 py-3 rounded-[12px] font-semibold transition-all duration-300 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",o(r).canGoNext&&!o(r).isSubmitting?"bg-primary hover:bg-primary/90 text-white border border-primary hover:border-primary/80":"bg-background-mute dark:bg-stroke/5 text-content-muted dark:text-content-muted border border-stroke-subtle dark:border-stroke/10"])},[o(r).isSubmitting?(n(),a("div",ot)):v("",!0),o(r).isSubmitting?(n(),a("span",st,"Setting up...")):o(r).isLastStep?(n(),a("span",at,"Complete Setup")):(n(),a("span",nt,"Next")),!o(r).isSubmitting&&!o(r).isLastStep?(n(),a("svg",dt,t[33]||(t[33]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]))):v("",!0)],10,rt)])])]),z(H,{name:"modal"},{default:F(()=>[p.value?(n(),a("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",onClick:S},[e("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl max-w-md w-full p-8 rounded-[24px] border border-stroke-subtle dark:border-white/20 shadow-[0_8px_32px_0_rgba(0,0,0,0.37)]",onClick:t[8]||(t[8]=Z(()=>{},["stop"]))},[e("div",it,[k.value==="success"?(n(),a("div",lt,t[34]||(t[34]=[e("svg",{class:"w-8 h-8 text-green-600 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)]))):(n(),a("div",ut,t[35]||(t[35]=[e("svg",{class:"w-8 h-8 text-red-600 dark:text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])))]),e("h3",ct,i(h.value),1),e("p",pt,i(f.value),1),e("button",{onClick:S,class:R(["w-full px-6 py-3 rounded-lg font-medium transition-all",k.value==="success"?"bg-primary hover:bg-primary/90 text-white":"bg-accent-red hover:bg-accent-red/90 text-white"])},i(k.value==="success"?"Continue to Login":"Close"),3)])])):v("",!0)]),_:1})]))}}),xt=ee(mt,[["__scopeId","data-v-693a052e"]]);export{xt as default};
|