Files
pyMC_Repeater/repeater/web/html/assets/Setup-CySN3SxS.js
T
2026-05-18 14:50:45 +01:00

1 line
30 KiB
JavaScript

import{B as e,Ct as t,E as n,St as r,V as i,Y as a,c as o,f as s,g as c,j as l,k as u,l as d,m as f,nt as p,o as m,p as h,r as g,s as _,u as v,w as y,x as b,xt as x,y as S}from"./runtime-core.esm-bundler-C5QBTNWE.js";import{n as C}from"./pinia-DP0dFoGY.js";import{t as w}from"./_plugin-vue_export-helper-TcpyXLsZ.js";import{t as T}from"./Spinner-CYvUNW0P.js";import{f as E,g as D,l as O,n as ee,p as k}from"./index-CG181k2K.js";var A=e=>e===``,j=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),M=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),N=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),P=e=>{let t=N(e);return t.charAt(0).toUpperCase()+t.slice(1)},F={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},I=Symbol(`lucide-icons`);function L(){return b(I,{})}var R=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:i,"stroke-width":a,size:o,color:s,...c},{slots:l})=>{let{size:u,color:d,strokeWidth:f=2,absoluteStrokeWidth:p=!1,class:h=``}=L(),g=m(()=>{let e=A(n)||A(r)||n===!0||r===!0||p===!0,t=i||a||f||F[`stroke-width`];return e?Number(t)*24/Number(o??u??F.width):t});return S(`svg`,{...F,...c,width:o??u??F.width,height:o??u??F.height,stroke:s??d??F.stroke,"stroke-width":g.value,class:j(`lucide`,h,...e?[`lucide-${M(P(e))}-icon`,`lucide-${M(e)}`]:[`lucide-icon`])},[...t.map(e=>S(...e)),...l.default?[l.default()]:[]])},z=(e,t)=>(n,{slots:r,attrs:i})=>S(R,{...i,...n,iconNode:t,name:e},r.default?{default:r.default}:void 0),te=z(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),ne=z(`usb`,[[`circle`,{cx:`10`,cy:`7`,r:`1`,key:`dypaad`}],[`circle`,{cx:`4`,cy:`20`,r:`1`,key:`22iqad`}],[`path`,{d:`M4.7 19.3 19 5`,key:`1enqfc`}],[`path`,{d:`m21 3-3 1 2 2Z`,key:`d3ov82`}],[`path`,{d:`M9.26 7.68 5 12l2 5`,key:`1esawj`}],[`path`,{d:`m10 14 5 2 3.5-3.5`,key:`v8oal5`}],[`path`,{d:`m18 12 1-1 1 1-1 1Z`,key:`1bh22v`}]]),re=z(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),B=C(`setup`,()=>{let e=a(1),t=a(6),n=a(`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,`0`)}`),r=a(null),i=a(null),o=a(null),s=a(``),c=a(``),l=a(!1),u=a({frequency:`915.0`,spreading_factor:`7`,bandwidth:`125`,coding_rate:`5`}),d=a([]),f=a([]),p=a(!1),h=a(!1),g=a(null),_=m(()=>{switch(e.value){case 1:return!0;case 2:return n.value.trim().length>0;case 3:return i.value!==null;case 4:return r.value!==null;case 5:return l.value?u.value.frequency&&u.value.spreading_factor&&u.value.bandwidth&&u.value.coding_rate:o.value!==null;case 6:return s.value.length>=6&&s.value===c.value;default:return!1}}),v=m(()=>e.value>1),y=m(()=>e.value===t.value);async function b(){p.value=!0,g.value=null;try{let e=await(await fetch(`/api/hardware_options`)).json();if(e.error)throw Error(e.error);d.value=e.hardware||[]}catch(e){g.value=e instanceof Error?e.message:`Failed to load hardware options`,console.error(`Error fetching hardware options:`,e)}finally{p.value=!1}}let x=e=>({title:String(e.title??``),description:String(e.description??``),frequency:String(e.frequency??``),spreading_factor:String(e.spreading_factor??``),bandwidth:String(e.bandwidth??``),coding_rate:String(e.coding_rate??``)});async function S(){p.value=!0,g.value=null;try{try{let e=new AbortController,t=setTimeout(()=>e.abort(),4e3);try{let t=await fetch(`https://api.meshcore.nz/api/v1/config`,{signal:e.signal});if(t.ok){let e=(await t.json())?.config?.suggested_radio_settings?.entries??[];if(e.length>0){f.value=e.map(e=>x(e));return}}}finally{clearTimeout(t)}}catch{}let e=await(await fetch(`/api/radio_presets`)).json();if(e.error)throw Error(e.error);f.value=(e.presets??[]).map(e=>x(e))}catch(e){g.value=e instanceof Error?e.message:`Failed to load radio presets`,console.error(`Error fetching radio presets:`,e)}finally{p.value=!1}}async function C(){if(!_.value)return{success:!1,error:`Please complete all required fields`};h.value=!0,g.value=null;try{let e=l.value?{title:`Custom Configuration`,description:`Custom radio settings`,frequency:u.value.frequency,spreading_factor:u.value.spreading_factor,bandwidth:u.value.bandwidth,coding_rate:u.value.coding_rate}:o.value,t=await(await fetch(`/api/setup_wizard`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({node_name:n.value.trim(),hardware_key:r.value?.key,radio_preset:e,admin_password:s.value})})).json();if(!t.success)throw Error(t.error||`Setup failed`);return{success:!0,data:t}}catch(e){let t=e instanceof Error?e.message:`Failed to complete setup`;return g.value=t,{success:!1,error:t}}finally{h.value=!1}}function w(){_.value&&e.value<t.value&&e.value++}function T(){v.value&&e.value--}function E(n){n>=1&&n<=t.value&&(e.value=n)}function D(){e.value=1,n.value=`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,`0`)}`,r.value=null,i.value=null,o.value=null,l.value=!1,u.value={frequency:`915.0`,spreading_factor:`7`,bandwidth:`125`,coding_rate:`5`},s.value=``,c.value=``,g.value=null}return{currentStep:e,totalSteps:t,nodeName:n,selectedHardware:r,selectedHardwareConnection:i,selectedRadioPreset:o,useCustomRadio:l,customRadio:u,adminPassword:s,confirmPassword:c,hardwareOptions:d,radioPresets:f,isLoading:p,isSubmitting:h,error:g,canGoNext:_,canGoBack:v,isLastStep:y,fetchHardwareOptions:b,fetchRadioPresets:S,completeSetup:C,nextStep:w,previousStep:T,goToStep:E,reset:D}}),V={class:`min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-center justify-center p-4`},H={class:`absolute top-4 right-4 z-20`},U={class:`w-full max-w-4xl relative z-10`},W={class:`mb-8`},G={class:`flex justify-between mb-2`},K={class:`text-content-secondary dark:text-content-muted text-sm`},q={class:`text-content-secondary dark:text-content-muted text-sm`},J={class:`h-2 bg-stroke-subtle dark:bg-stroke/10 rounded-full overflow-hidden`},Y={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`},X={class:`flex justify-center mb-8`},ie={class:`flex gap-2`},ae={class:`mb-8`},oe={class:`text-2xl sm:text-3xl font-bold text-content-primary dark:text-content-primary mb-2 text-center`},se={key:0,class:`space-y-6 mt-8`},ce={key:1,class:`space-y-6 mt-8`},le={class:`max-w-md mx-auto`},ue={key:2,class:`space-y-6 mt-8`},de={class:`grid grid-cols-1 md:grid-cols-3 gap-4 max-w-5xl mx-auto`},fe=[`onClick`],pe={class:`font-semibold text-lg text-content-primary dark:text-content-primary mb-2`},me={class:`text-sm text-content-secondary dark:text-content-muted`},he={key:3,class:`space-y-6 mt-8`},ge={key:0,class:`text-center text-content-secondary dark:text-content-muted`},_e={key:1,class:`text-center text-content-secondary dark:text-content-muted`},ve={key:2,class:`text-center text-content-secondary dark:text-content-muted`},ye={key:3,class:`grid grid-cols-1 md:grid-cols-2 gap-4 max-w-3xl mx-auto`},be=[`onClick`],xe={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:4,class:`space-y-6 mt-8`},we={key:0,class:`text-center text-content-secondary dark:text-content-muted`},Te={key:1,class:`text-center text-content-secondary dark:text-content-muted`},Ee={key:2,class:`max-w-5xl mx-auto`},De={class:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4`},Oe=[`onClick`],ke={class:`relative z-10`},Ae={class:`font-medium text-content-primary dark:text-content-primary mb-1 flex items-start justify-between gap-2`},je={class:`flex items-center gap-2`},Me={class:`text-2xl`},Ne={key:0,class:`text-primary flex-shrink-0`},Pe={class:`text-xs text-content-secondary dark:text-content-muted mb-3`},Fe={class:`grid grid-cols-2 gap-2 text-xs`},Ie={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Le={class:`text-content-primary dark:text-content-primary/80 font-medium`},Re={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},ze={class:`text-content-primary dark:text-content-primary/80 font-medium`},Be={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Ve={class:`text-content-primary dark:text-content-primary/80 font-medium`},He={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Ue={class:`text-content-primary dark:text-content-primary/80 font-medium`},We={class:`border-t border-stroke-subtle dark:border-stroke/10 pt-6`},Ge={class:`flex items-center justify-between mb-2`},Ke={key:0,class:`text-primary`},qe={key:0,class:`mt-4 grid grid-cols-2 gap-4`},Je={key:5,class:`space-y-6 mt-8`},Ye={class:`max-w-md mx-auto space-y-4`},Xe={key:0,class:`text-red-600 dark:text-red-400 text-sm`},Z={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`},Ze={class:`flex justify-between gap-4`},Qe={key:1},$e=[`disabled`],et={key:1},tt={key:2},nt={key:3},rt={key:4,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},it={class:`text-2xl font-bold text-content-primary dark:text-content-primary text-center mb-4`},at={class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},ot={key:0,class:`fixed inset-0 z-[500] flex items-center justify-center p-4 bg-black/75 backdrop-blur-md`},st={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl max-w-sm w-full p-10 rounded-[24px] border border-stroke-subtle dark:border-white/20 shadow-[0_8px_48px_0_rgba(0,0,0,0.5)] flex flex-col items-center gap-6`},Q=w(c({name:`SetupView`,__name:`Setup`,setup(c){let b=B(),S=a(!1),C=a(``),w=a(``),A=a(`error`),j=a(!1),M=null,N=e=>{let t=e.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`)?`🇻🇳`:`🌍`};n(async()=>{await Promise.all([b.fetchHardwareOptions(),b.fetchRadioPresets()])});let P=m(()=>b.currentStep/b.totalSteps*100),F=[{key:`gpio`,title:`HAT GPIO Based Device`,description:`Direct SPI/GPIO connected HATs and board-integrated radios.`},{key:`usb`,title:`USB Connection`,description:`USB-attached modems including CH341 and pyMC USB modem.`},{key:`network`,title:`Network Wi-Fi Based`,description:`Remote modem reached over LAN/Wi-Fi using pyMC TCP.`}];function I(e){let t=e.key.toLowerCase();if(t===`kiss`)return`usb`;let n=String(e.config?.connection_type||``).toLowerCase();return n===`usb`||n===`network`||n===`gpio`?n:t.includes(`ch341`)||t===`pymc_usb`?`usb`:t===`pymc_tcp`?`network`:`gpio`}let L=m(()=>{let e=b.selectedHardwareConnection;return e?b.hardwareOptions.filter(t=>I(t)===e):[]});function R(e){b.selectedHardwareConnection=e,b.selectedHardware&&!L.value.some(e=>e.key===b.selectedHardware?.key)&&(b.selectedHardware=null)}async function z(){if(b.isLastStep){let e=await b.completeSetup();e.success?(j.value=!0,ct()):(A.value=`error`,C.value=`Setup Failed`,w.value=e.error||`An unknown error occurred`,S.value=!0)}else b.nextStep()}function Q(){b.previousStep()}function $(){S.value=!1}function ct(){let e=0;function t(){e++,fetch(`/api/needs_setup`,{method:`GET`}).then(e=>{e.ok?(M=null,window.location.reload()):n()}).catch(()=>{n()})}function n(){e<90?M=setTimeout(t,1e3):(M=null,window.location.reload())}M=setTimeout(t,3e3)}y(()=>{M&&=(clearTimeout(M),null)});let lt=[`Welcome`,`Repeater Name`,`Connection Type`,`Hardware Selection`,`Radio Configuration`,`Security Setup`];return(n,a)=>(u(),v(`div`,V,[_(`div`,H,[f(ee)]),a[37]||=_(`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),a[38]||=_(`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),a[39]||=_(`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),_(`div`,U,[_(`div`,W,[_(`div`,G,[_(`span`,K,`Step `+t(p(b).currentStep)+` of `+t(p(b).totalSteps),1),_(`span`,q,t(Math.round(P.value))+`% Complete`,1)]),_(`div`,J,[_(`div`,{class:`h-full bg-gradient-to-r from-primary to-primary/80 transition-all duration-500`,style:r({width:`${P.value}%`})},null,4)])]),_(`div`,Y,[_(`div`,X,[_(`div`,ie,[(u(!0),v(g,null,l(p(b).totalSteps,e=>(u(),v(`div`,{key:e,class:x([`w-10 h-10 rounded-full flex items-center justify-center text-sm font-medium transition-all`,e===p(b).currentStep?`bg-primary text-white`:e<p(b).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`])},t(e),3))),128))])]),_(`div`,ae,[_(`h2`,oe,t(lt[p(b).currentStep-1]),1),p(b).currentStep===1?(u(),v(`div`,se,[...a[9]||=[s(`<div class="text-center space-y-4" data-v-5b488fbf><div class="w-20 h-20 mx-auto bg-primary/20 rounded-full flex items-center justify-center mb-6" data-v-5b488fbf><svg class="w-10 h-10 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-5b488fbf><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" data-v-5b488fbf></path></svg></div><p class="text-content-secondary dark:text-content-primary/70 text-lg" data-v-5b488fbf> Welcome to your pyMC Repeater! Let&#39;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-5b488fbf><p class="text-primary text-sm font-medium mb-2" data-v-5b488fbf>You&#39;ll configure:</p><ul class="space-y-2 text-content-secondary dark:text-content-primary/70 text-sm" data-v-5b488fbf><li class="flex items-center gap-2" data-v-5b488fbf><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-5b488fbf><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-5b488fbf></path></svg> Repeater name and identification </li><li class="flex items-center gap-2" data-v-5b488fbf><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-5b488fbf><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-5b488fbf></path></svg> Hardware board selection </li><li class="flex items-center gap-2" data-v-5b488fbf><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-5b488fbf><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-5b488fbf></path></svg> Radio frequency and settings </li><li class="flex items-center gap-2" data-v-5b488fbf><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-5b488fbf><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-5b488fbf></path></svg> Admin password for secure access </li></ul></div></div>`,1)]])):p(b).currentStep===2?(u(),v(`div`,ce,[a[12]||=_(`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),_(`div`,le,[a[10]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Repeater Name`,-1),i(_(`input`,{"onUpdate:modelValue":a[0]||=e=>p(b).nodeName=e,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),[[k,p(b).nodeName]]),a[11]||=_(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-2`},` Use letters, numbers, hyphens, or underscores (3-32 characters) `,-1)])])):p(b).currentStep===3?(u(),v(`div`,ue,[a[13]||=_(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Choose how your radio hardware connects to this repeater. `,-1),_(`div`,de,[(u(),v(g,null,l(F,e=>_(`button`,{key:e.key,onClick:t=>R(e.key),class:x([`p-6 rounded-[16px] border transition-all duration-300 text-left backdrop-blur-sm min-h-[220px] flex flex-col`,p(b).selectedHardwareConnection===e.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`])},[_(`div`,{class:x([`mb-5 w-16 h-16 rounded-2xl flex items-center justify-center border transition-all duration-300`,p(b).selectedHardwareConnection===e.key?`bg-primary/20 border-primary/40 shadow-md shadow-primary/20`:`bg-white/60 dark:bg-white/10 border-stroke-subtle dark:border-stroke/20`])},[e.key===`gpio`?(u(),o(p(te),{key:0,class:`w-9 h-9 text-primary`,"stroke-width":1.8})):e.key===`usb`?(u(),o(p(ne),{key:1,class:`w-9 h-9 text-primary`,"stroke-width":1.8})):(u(),o(p(re),{key:2,class:`w-9 h-9 text-primary`,"stroke-width":1.8}))],2),_(`div`,pe,t(e.title),1),_(`div`,me,t(e.description),1)],10,fe)),64))])])):p(b).currentStep===4?(u(),v(`div`,he,[a[14]||=_(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Select your hardware board type `,-1),p(b).isLoading?(u(),v(`div`,ge,` Loading hardware options... `)):p(b).selectedHardwareConnection?L.value.length===0?(u(),v(`div`,ve,` No hardware options available for this connection type `)):(u(),v(`div`,ye,[(u(!0),v(g,null,l(L.value,e=>(u(),v(`button`,{key:e.key,onClick:t=>p(b).selectedHardware=e,class:x([`p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm`,p(b).selectedHardware?.key===e.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`])},[_(`div`,xe,t(e.name),1),_(`div`,Se,t(e.description||e.key),1)],10,be))),128))])):(u(),v(`div`,_e,` Choose a connection type first `))])):p(b).currentStep===5?(u(),v(`div`,Ce,[a[29]||=_(`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),p(b).isLoading?(u(),v(`div`,we,` Loading radio presets... `)):p(b).radioPresets.length===0?(u(),v(`div`,Te,` No radio presets available `)):(u(),v(`div`,Ee,[_(`div`,De,[(u(!0),v(g,null,l(p(b).radioPresets,e=>(u(),v(`button`,{key:e.title,onClick:t=>{p(b).selectedRadioPreset=e,p(b).useCustomRadio=!1},class:x([`p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm relative overflow-hidden`,!p(b).useCustomRadio&&p(b).selectedRadioPreset?.title===e.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`])},[_(`div`,ke,[_(`div`,Ae,[_(`span`,je,[_(`span`,Me,t(N(e.title)),1),_(`span`,null,t(e.title),1)]),!p(b).useCustomRadio&&p(b).selectedRadioPreset?.title===e.title?(u(),v(`div`,Ne,[...a[15]||=[_(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[_(`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)]])):d(``,!0)]),_(`div`,Pe,t(e.description),1),_(`div`,Fe,[_(`div`,Ie,[a[16]||=_(`div`,{class:`text-content-muted dark:text-content-muted`},`Freq`,-1),_(`div`,Le,t(e.frequency),1)]),_(`div`,Re,[a[17]||=_(`div`,{class:`text-content-muted dark:text-content-muted`},`BW`,-1),_(`div`,ze,t(e.bandwidth),1)]),_(`div`,Be,[a[18]||=_(`div`,{class:`text-content-muted dark:text-content-muted`},`SF`,-1),_(`div`,Ve,t(e.spreading_factor),1)]),_(`div`,He,[a[19]||=_(`div`,{class:`text-content-muted dark:text-content-muted`},`CR`,-1),_(`div`,Ue,t(e.coding_rate),1)])])])],10,Oe))),128))]),_(`div`,We,[_(`button`,{onClick:a[1]||=e=>{p(b).useCustomRadio=!p(b).useCustomRadio,p(b).useCustomRadio&&(p(b).selectedRadioPreset=null)},class:x([`w-full p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm`,p(b).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`])},[_(`div`,Ge,[a[21]||=_(`div`,{class:`font-medium text-content-primary dark:text-content-primary flex items-center gap-2`},[_(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[_(`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`})]),h(` Custom Configuration `)],-1),p(b).useCustomRadio?(u(),v(`div`,Ke,[...a[20]||=[_(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[_(`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)]])):d(``,!0)]),a[22]||=_(`div`,{class:`text-xs text-content-secondary dark:text-content-muted`},` Manually configure frequency, bandwidth, spreading factor, and coding rate `,-1)],2),f(O,{name:`slide`},{default:e(()=>[p(b).useCustomRadio?(u(),v(`div`,qe,[_(`div`,null,[a[23]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Frequency (MHz)`,-1),i(_(`input`,{"onUpdate:modelValue":a[2]||=e=>p(b).customRadio.frequency=e,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),[[k,p(b).customRadio.frequency]])]),_(`div`,null,[a[24]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Bandwidth (kHz)`,-1),i(_(`input`,{"onUpdate:modelValue":a[3]||=e=>p(b).customRadio.bandwidth=e,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),[[k,p(b).customRadio.bandwidth]])]),_(`div`,null,[a[26]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Spreading Factor`,-1),i(_(`select`,{"onUpdate:modelValue":a[4]||=e=>p(b).customRadio.spreading_factor=e,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`},[...a[25]||=[_(`option`,{value:`7`},`7`,-1),_(`option`,{value:`8`},`8`,-1),_(`option`,{value:`9`},`9`,-1),_(`option`,{value:`10`},`10`,-1),_(`option`,{value:`11`},`11`,-1),_(`option`,{value:`12`},`12`,-1)]],512),[[E,p(b).customRadio.spreading_factor]])]),_(`div`,null,[a[28]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Coding Rate`,-1),i(_(`select`,{"onUpdate:modelValue":a[5]||=e=>p(b).customRadio.coding_rate=e,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`},[...a[27]||=[_(`option`,{value:`5`},`4/5`,-1),_(`option`,{value:`6`},`4/6`,-1),_(`option`,{value:`7`},`4/7`,-1),_(`option`,{value:`8`},`4/8`,-1)]],512),[[E,p(b).customRadio.coding_rate]])])])):d(``,!0)]),_:1})])]))])):p(b).currentStep===6?(u(),v(`div`,Je,[a[33]||=_(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Set a secure admin password to protect your repeater `,-1),_(`div`,Ye,[_(`div`,null,[a[30]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Admin Password`,-1),i(_(`input`,{"onUpdate:modelValue":a[6]||=e=>p(b).adminPassword=e,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),[[k,p(b).adminPassword]])]),_(`div`,null,[a[31]||=_(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Confirm Password`,-1),i(_(`input`,{"onUpdate:modelValue":a[7]||=e=>p(b).confirmPassword=e,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),[[k,p(b).confirmPassword]])]),p(b).adminPassword&&p(b).confirmPassword&&p(b).adminPassword!==p(b).confirmPassword?(u(),v(`div`,Xe,` Passwords do not match `)):d(``,!0),a[32]||=_(`div`,{class:`bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3 text-sm text-yellow-800 dark:text-yellow-200`},[_(`strong`,null,`Important:`),h(` Remember this password - you'll need it to access the dashboard. `)],-1)])])):d(``,!0)]),p(b).error?(u(),v(`div`,Z,t(p(b).error),1)):d(``,!0),_(`div`,Ze,[p(b).canGoBack?(u(),v(`button`,{key:0,onClick:Q,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 `)):(u(),v(`div`,Qe)),_(`button`,{onClick:z,disabled:!p(b).canGoNext||p(b).isSubmitting,class:x([`px-8 py-3 rounded-[12px] font-semibold transition-all duration-300 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed`,p(b).canGoNext&&!p(b).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`])},[p(b).isSubmitting?(u(),o(T,{key:0,size:`sm`,color:`white`})):d(``,!0),p(b).isSubmitting?(u(),v(`span`,et,`Setting up...`)):p(b).isLastStep?(u(),v(`span`,tt,`Complete Setup`)):(u(),v(`span`,nt,`Next`)),!p(b).isSubmitting&&!p(b).isLastStep?(u(),v(`svg`,rt,[...a[34]||=[_(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 5l7 7-7 7`},null,-1)]])):d(``,!0)],10,$e)])])]),f(O,{name:`modal`},{default:e(()=>[S.value?(u(),v(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm`,onClick:$},[_(`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:a[8]||=D(()=>{},[`stop`])},[a[35]||=_(`div`,{class:`flex justify-center mb-6`},[_(`div`,{class:`w-16 h-16 rounded-full bg-red-100 dark:bg-red-500/20 flex items-center justify-center`},[_(`svg`,{class:`w-8 h-8 text-red-600 dark:text-red-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[_(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})])])],-1),_(`h3`,it,t(C.value),1),_(`p`,at,t(w.value),1),_(`button`,{onClick:$,class:`w-full px-6 py-3 rounded-lg font-medium transition-colors bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red`},` Close `)])])):d(``,!0)]),_:1}),f(O,{name:`modal`},{default:e(()=>[j.value?(u(),v(`div`,ot,[_(`div`,st,[f(T,{size:`lg`}),a[36]||=_(`div`,{class:`text-center`},[_(`h3`,{class:`text-xl font-bold text-content-primary dark:text-content-primary mb-2`},` Restarting… `),_(`p`,{class:`text-sm text-content-secondary dark:text-content-primary/60`},` Please wait while the service restarts. This may take up to a minute. `)],-1)])])):d(``,!0)]),_:1})]))}}),[[`__scopeId`,`data-v-5b488fbf`]]);export{Q as default};