mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-06-28 14:01:59 +02:00
1 line
30 KiB
JavaScript
1 line
30 KiB
JavaScript
import{C as e,D as t,N as n,P as r,T as i,U as a,X as o,_t as s,c,f as ee,gt as te,h as ne,ht as l,j as u,l as d,m as f,o as p,p as m,r as h,s as g,u as _,y as re}from"./runtime-core.esm-bundler-CINEgm0a.js";import{a as v,l as ie,o as y,r as ae,t as b}from"./runtime-dom.esm-bundler-B3VeUO8l.js";import{t as oe}from"./api-DSaJA91r.js";import{t as x}from"./createLucideIcon-D-_sbJKW.js";import{n as se,t as ce}from"./TxPowerNoticeModal-DJj923Jw.js";import{t as le}from"./Spinner-CMJUE3iy.js";import{d as S,i as ue,o as de,r as fe}from"./index-Cijj_ZXo.js";var pe=x(`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`}]]),me=x(`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`}]]),he={class:`min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-center justify-center p-4`},ge={class:`absolute top-4 right-4 z-20`},_e={class:`w-full max-w-4xl relative z-10`},ve={class:`mb-8`},ye={class:`flex justify-between mb-2`},C={class:`text-content-secondary dark:text-content-muted text-sm`},w={class:`text-content-secondary dark:text-content-muted text-sm`},T={class:`h-2 bg-stroke-subtle dark:bg-stroke/10 rounded-full overflow-hidden`},E={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`},D={class:`flex justify-center mb-8`},O={class:`flex gap-2`},k={class:`mb-8`},A={class:`text-2xl sm:text-3xl font-bold text-content-primary dark:text-content-primary mb-2 text-center`},j={key:0,class:`space-y-6 mt-8`},M={key:1,class:`space-y-6 mt-8`},N={class:`max-w-md mx-auto`},P={key:2,class:`space-y-6 mt-8`},be={class:`grid grid-cols-1 md:grid-cols-3 gap-4 max-w-5xl mx-auto`},xe=[`onClick`],Se={class:`font-semibold text-lg text-content-primary dark:text-content-primary mb-2`},Ce={class:`text-sm text-content-secondary dark:text-content-muted`},we={key:3,class:`mt-8`},Te={key:0,class:`text-center text-content-secondary dark:text-content-muted`},Ee={key:1,class:`text-center text-content-secondary dark:text-content-muted`},De={key:2,class:`text-center text-content-secondary dark:text-content-muted`},Oe={key:3,class:`max-w-3xl mx-auto space-y-8`},ke={class:`flex items-center gap-3 mb-4`},Ae={key:0,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},je={key:1},Me={class:`grid grid-cols-1 md:grid-cols-2 gap-3 pl-10`},Ne=[`onClick`],Pe={class:`flex items-start justify-between gap-2`},Fe={class:`font-medium text-content-primary dark:text-content-primary mb-1`},Ie={class:`text-sm text-content-secondary dark:text-content-muted`},Le={key:0,class:`text-primary flex-shrink-0 mt-0.5`},Re={key:0},ze={key:0,class:`pl-10`},Be={class:`bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] p-5 space-y-4`},Ve={class:`space-y-2`},He={class:`flex gap-2`},Ue=[`disabled`],We=[`value`],Ge=[`value`],Ke=[`disabled`],qe={class:`flex items-center gap-2 text-xs text-content-secondary dark:text-content-muted`},Je={key:1,class:`text-xs text-red-600 dark:text-red-400`},Ye={key:1,class:`pl-10`},Xe={class:`bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] p-5 space-y-4`},Ze={class:`grid grid-cols-2 gap-4`},Qe={key:4,class:`space-y-6 mt-8`},$e={key:0,class:`text-center text-content-secondary dark:text-content-muted`},et={key:1,class:`text-center text-content-secondary dark:text-content-muted`},tt={key:2,class:`max-w-5xl mx-auto`},nt={class:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4`},rt=[`onClick`],it={class:`relative z-10`},at={class:`font-medium text-content-primary dark:text-content-primary mb-1 flex items-start justify-between gap-2`},ot={class:`flex items-center gap-2`},st={class:`text-2xl`},ct={key:0,class:`text-primary flex-shrink-0`},lt={class:`text-xs text-content-secondary dark:text-content-muted mb-3`},ut={class:`grid grid-cols-2 gap-2 text-xs`},dt={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},ft={class:`text-content-primary dark:text-content-primary/80 font-medium`},pt={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},mt={class:`text-content-primary dark:text-content-primary/80 font-medium`},ht={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},gt={class:`text-content-primary dark:text-content-primary/80 font-medium`},_t={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},vt={class:`text-content-primary dark:text-content-primary/80 font-medium`},yt={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1 col-span-2`},bt={class:`text-content-primary dark:text-content-primary/80 font-medium`},xt={class:`border-t border-stroke-subtle dark:border-stroke/10 pt-6`},St={class:`flex items-center justify-between mb-2`},Ct={key:0,class:`text-primary`},wt={key:0,class:`mt-4 grid grid-cols-2 gap-4`},Tt={class:`col-span-2 sm:col-span-1`},Et={key:5,class:`space-y-6 mt-8`},Dt={class:`max-w-md mx-auto space-y-4`},Ot={key:0,class:`text-red-600 dark:text-red-400 text-sm`},kt={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`},At={class:`flex justify-between gap-4`},jt={key:1},Mt=[`disabled`],Nt={key:1},Pt={key:2},Ft={key:3},It={key:4,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Lt={class:`text-2xl font-bold text-content-primary dark:text-content-primary text-center mb-4`},Rt={class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},F=S(ne({name:`SetupView`,__name:`Setup`,setup(ne){let x=se(),S=a(!1),F=a(``),I=a(``),zt=a(`error`),L=a(!1),R=a([]),z=a(!1),B=a(``),V=a(!1),H=a(!1),U=a(!1),W=a(!1),G=a(null),K=p(()=>{if(x.useCustomRadio){let e=Number(x.customRadio.tx_power);return Number.isFinite(e)?e:null}let e=Number(x.selectedRadioPreset?.tx_power??14);return Number.isFinite(e)?e:14});function Bt(){return x.selectedHardware?.key?.toLowerCase()??``}function Vt(){let e=Bt();return e===`kiss`||e===`pymc_usb`}async function q(){z.value=!0,B.value=``;try{let e=await oe.getSerialPorts();e.success&&Array.isArray(e.data)?R.value=e.data:(R.value=[],B.value=e.error||`Could not load USB serial devices`)}catch(e){let t=e;R.value=[],B.value=t.message||`Could not load USB serial devices`}finally{z.value=!1}}let Ht=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`)?`🇻🇳`:`🌍`};e(async()=>{await Promise.all([x.fetchHardwareOptions(),x.fetchRadioPresets(),q()])}),u(()=>x.selectedHardware?.key,()=>{Vt()?q():V.value=!1}),u([()=>x.useCustomRadio,()=>x.selectedRadioPreset?.title,()=>x.customRadio.tx_power],()=>{W.value=!1,U.value=!1});let J=p(()=>x.currentStep/x.totalSteps*100),Ut=[{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 Y(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 X=p(()=>{let e=x.selectedHardwareConnection;return e?x.hardwareOptions.filter(t=>Y(t)===e):[]});function Wt(e){x.selectedHardwareConnection=e,x.selectedHardware&&!X.value.some(e=>e.key===x.selectedHardware?.key)&&(x.selectedHardware=null)}function Z(){re(()=>{G.value?.scrollIntoView({behavior:`smooth`,block:`center`})})}async function Q(){if(x.currentStep===5&&x.canGoNext&&!W.value&&K.value!==null){H.value=!0;return}if(x.isLastStep){let e=await x.completeSetup();e.success?L.value=!0:(zt.value=`error`,F.value=`Setup Failed`,I.value=e.error||`An unknown error occurred`,S.value=!0)}else x.nextStep()}function Gt(){H.value=!1,U.value=!1}async function Kt(){U.value&&(W.value=!0,H.value=!1,await Q())}function qt(){x.previousStep()}function $(){S.value=!1}let Jt=[`Welcome`,`Repeater Name`,`Connection Type`,`Hardware & Connection`,`Radio Configuration`,`Security Setup`];return(e,a)=>(i(),_(`div`,he,[g(`div`,ge,[f(ue)]),a[61]||=g(`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[62]||=g(`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[63]||=g(`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),g(`div`,_e,[g(`div`,ve,[g(`div`,ye,[g(`span`,C,`Step `+s(o(x).currentStep)+` of `+s(o(x).totalSteps),1),g(`span`,w,s(Math.round(J.value))+`% Complete`,1)]),g(`div`,T,[g(`div`,{class:`h-full bg-gradient-to-r from-primary to-primary/80 transition-all duration-500`,style:te({width:`${J.value}%`})},null,4)])]),g(`div`,E,[g(`div`,D,[g(`div`,O,[(i(!0),_(h,null,t(o(x).totalSteps,e=>(i(),_(`div`,{key:e,class:l([`w-10 h-10 rounded-full flex items-center justify-center text-sm font-medium transition-all`,e===o(x).currentStep?`bg-primary text-white`:e<o(x).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`])},s(e),3))),128))])]),g(`div`,k,[g(`h2`,A,s(Jt[o(x).currentStep-1]),1),o(x).currentStep===1?(i(),_(`div`,j,[...a[19]||=[ee(`<div class="text-center space-y-4" data-v-ecd1d451><div class="w-20 h-20 mx-auto bg-primary/20 rounded-full flex items-center justify-center mb-6" data-v-ecd1d451><svg class="w-10 h-10 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ecd1d451><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" data-v-ecd1d451></path></svg></div><p class="text-content-secondary dark:text-content-primary/70 text-lg" data-v-ecd1d451> Welcome to your 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-ecd1d451><p class="text-primary text-sm font-medium mb-2" data-v-ecd1d451>You'll configure:</p><ul class="space-y-2 text-content-secondary dark:text-content-primary/70 text-sm" data-v-ecd1d451><li class="flex items-center gap-2" data-v-ecd1d451><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ecd1d451><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-ecd1d451></path></svg> Repeater name and identification </li><li class="flex items-center gap-2" data-v-ecd1d451><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ecd1d451><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-ecd1d451></path></svg> Hardware board selection </li><li class="flex items-center gap-2" data-v-ecd1d451><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ecd1d451><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-ecd1d451></path></svg> Radio frequency and settings </li><li class="flex items-center gap-2" data-v-ecd1d451><svg class="w-4 h-4 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-ecd1d451><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-ecd1d451></path></svg> Admin password for secure access </li></ul></div></div>`,1)]])):o(x).currentStep===2?(i(),_(`div`,M,[a[22]||=g(`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),g(`div`,N,[a[20]||=g(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Repeater Name`,-1),r(g(`input`,{"onUpdate:modelValue":a[0]||=e=>o(x).nodeName=e,type:`text`,class:`modal-input`,placeholder:`e.g., pyRpt0001`,maxlength:`32`},null,512),[[y,o(x).nodeName]]),a[21]||=g(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-2`},` Use letters, numbers, hyphens, or underscores (3-32 characters) `,-1)])])):o(x).currentStep===3?(i(),_(`div`,P,[a[23]||=g(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Choose how your radio hardware connects to this repeater. `,-1),g(`div`,be,[(i(),_(h,null,t(Ut,e=>g(`button`,{key:e.key,onClick:t=>Wt(e.key),class:l([`p-6 rounded-[16px] border transition-all duration-300 text-left backdrop-blur-sm min-h-[220px] flex flex-col`,o(x).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`])},[g(`div`,{class:l([`mb-5 w-16 h-16 rounded-2xl flex items-center justify-center border transition-all duration-300`,o(x).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`?(i(),c(o(de),{key:0,class:`w-9 h-9 text-primary`,"stroke-width":1.8})):e.key===`usb`?(i(),c(o(pe),{key:1,class:`w-9 h-9 text-primary`,"stroke-width":1.8})):(i(),c(o(me),{key:2,class:`w-9 h-9 text-primary`,"stroke-width":1.8}))],2),g(`div`,Se,s(e.title),1),g(`div`,Ce,s(e.description),1)],10,xe)),64))])])):o(x).currentStep===4?(i(),_(`div`,we,[o(x).isLoading?(i(),_(`div`,Te,` Loading hardware options... `)):o(x).selectedHardwareConnection?X.value.length===0?(i(),_(`div`,De,` No hardware options available for this connection type `)):(i(),_(`div`,Oe,[g(`div`,null,[g(`div`,ke,[g(`div`,{class:l([`w-7 h-7 rounded-full flex items-center justify-center text-sm font-semibold flex-shrink-0 transition-all`,(o(x).selectedHardware,`bg-primary text-white`)])},[o(x).selectedHardware?(i(),_(`svg`,Ae,[...a[24]||=[g(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2.5`,d:`M5 13l4 4L19 7`},null,-1)]])):(i(),_(`span`,je,`1`))],2),a[25]||=g(`h3`,{class:`font-semibold text-content-primary dark:text-content-primary`},`Select your hardware board`,-1)]),g(`div`,Me,[(i(!0),_(h,null,t(X.value,e=>(i(),_(`button`,{key:e.key,onClick:t=>{o(x).selectedHardware=e,Z()},class:l([`p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm`,o(x).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`])},[g(`div`,Pe,[g(`div`,null,[g(`div`,Fe,s(e.name),1),g(`div`,Ie,s(e.description||e.key),1)]),o(x).selectedHardware?.key===e.key?(i(),_(`div`,Le,[...a[26]||=[g(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[g(`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)])],10,Ne))),128))])]),f(b,{name:`slide`},{default:n(()=>[o(x).selectedHardware&&(o(x).selectedHardware.key.toLowerCase()===`kiss`||o(x).selectedHardware.key.toLowerCase()===`pymc_usb`||o(x).selectedHardware.key.toLowerCase()===`pymc_tcp`)?(i(),_(`div`,Re,[a[36]||=g(`div`,{class:`flex items-center gap-3 mb-4`},[g(`div`,{class:`w-7 h-7 rounded-full bg-primary text-white flex items-center justify-center text-sm font-semibold flex-shrink-0`},` 2 `),g(`h3`,{class:`font-semibold text-content-primary dark:text-content-primary`},` Configure the connection to your modem `)],-1),o(x).selectedHardware.key.toLowerCase()===`kiss`||o(x).selectedHardware.key.toLowerCase()===`pymc_usb`?(i(),_(`div`,ze,[g(`div`,Be,[g(`div`,null,[a[28]||=g(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-1.5`},` Serial Port `,-1),g(`div`,Ve,[g(`div`,He,[r(g(`select`,{"onUpdate:modelValue":a[1]||=e=>o(x).usbPort=e,class:`modal-select px-4 py-3 font-mono`,disabled:V.value},[o(x).usbPort&&!R.value.some(e=>e.device===o(x).usbPort)?(i(),_(`option`,{key:0,value:o(x).usbPort},s(o(x).usbPort)+` (current) `,9,We)):d(``,!0),(i(!0),_(h,null,t(R.value,e=>(i(),_(`option`,{key:e.device,value:e.device},s(e.description||e.device),9,Ge))),128))],8,Ue),[[v,o(x).usbPort]]),g(`button`,{type:`button`,class:`px-3 py-2 rounded-lg border border-stroke-subtle dark:border-stroke/10 text-sm text-content-primary dark:text-content-primary bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 disabled:opacity-50`,disabled:z.value,onClick:q},s(z.value?`...`:`Refresh`),9,Ke)]),g(`label`,qe,[r(g(`input`,{"onUpdate:modelValue":a[2]||=e=>V.value=e,type:`checkbox`},null,512),[[ae,V.value]]),a[27]||=m(` Enter custom device path `,-1)]),V.value?r((i(),_(`input`,{key:0,"onUpdate:modelValue":a[3]||=e=>o(x).usbPort=e,type:`text`,class:`modal-input px-4 py-3 font-mono`,placeholder:`/dev/ttyACM0`},null,512)),[[y,o(x).usbPort]]):d(``,!0),B.value?(i(),_(`p`,Je,s(B.value),1)):d(``,!0)]),a[29]||=g(`p`,{class:`text-content-muted dark:text-content-muted text-xs mt-2`},[m(` The USB-CDC device path for your modem. If you have the pyMC udev rule installed it may appear as `),g(`span`,{class:`font-mono`},`/dev/lora-modem`),m(`. `)],-1)])])])):o(x).selectedHardware.key.toLowerCase()===`pymc_tcp`?(i(),_(`div`,Ye,[g(`div`,Xe,[g(`div`,null,[a[30]||=g(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-1.5`},[m(` Modem Hostname or IP Address `),g(`span`,{class:`text-red-500`},`*`)],-1),r(g(`input`,{"onUpdate:modelValue":a[4]||=e=>o(x).tcpHost=e,type:`text`,class:`modal-input px-4 py-3 font-mono`,placeholder:`pymc-3e2834.local`},null,512),[[y,o(x).tcpHost]]),a[31]||=g(`p`,{class:`text-content-muted dark:text-content-muted text-xs mt-2`},` mDNS hostname, LAN IP, or domain name of the pyMC Wi-Fi modem. `,-1)]),g(`div`,Ze,[g(`div`,null,[a[32]||=g(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-1.5`},` Port `,-1),r(g(`input`,{"onUpdate:modelValue":a[5]||=e=>o(x).tcpPort=e,type:`number`,min:`1`,max:`65535`,class:`modal-input px-4 py-3`,placeholder:`5055`},null,512),[[y,o(x).tcpPort,void 0,{number:!0}]]),a[33]||=g(`p`,{class:`text-content-muted dark:text-content-muted text-xs mt-2`},`Default is 5055.`,-1)]),g(`div`,null,[a[34]||=g(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-1.5`},[m(` Auth Token `),g(`span`,{class:`font-normal text-content-muted ml-1`},`(optional)`)],-1),r(g(`input`,{"onUpdate:modelValue":a[6]||=e=>o(x).tcpToken=e,type:`password`,class:`modal-input px-4 py-3`,placeholder:`Leave blank if none`},null,512),[[y,o(x).tcpToken]]),a[35]||=g(`p`,{class:`text-content-muted dark:text-content-muted text-xs mt-2`},`Must match the token set in the modem firmware.`,-1)])])])])):d(``,!0)])):d(``,!0)]),_:1})])):(i(),_(`div`,Ee,` Choose a connection type first `))])):o(x).currentStep===5?(i(),_(`div`,Qe,[a[54]||=g(`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(x).isLoading?(i(),_(`div`,$e,` Loading radio presets... `)):o(x).radioPresets.length===0?(i(),_(`div`,et,` No radio presets available `)):(i(),_(`div`,tt,[g(`div`,nt,[(i(!0),_(h,null,t(o(x).radioPresets,e=>(i(),_(`button`,{key:e.title,onClick:t=>{o(x).selectedRadioPreset=e,o(x).useCustomRadio=!1,Z()},class:l([`p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm relative overflow-hidden`,!o(x).useCustomRadio&&o(x).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`])},[g(`div`,it,[g(`div`,at,[g(`span`,ot,[g(`span`,st,s(Ht(e.title)),1),g(`span`,null,s(e.title),1)]),!o(x).useCustomRadio&&o(x).selectedRadioPreset?.title===e.title?(i(),_(`div`,ct,[...a[37]||=[g(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[g(`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)]),g(`div`,lt,s(e.description),1),g(`div`,ut,[g(`div`,dt,[a[38]||=g(`div`,{class:`text-content-muted dark:text-content-muted`},`Freq`,-1),g(`div`,ft,s(e.frequency),1)]),g(`div`,pt,[a[39]||=g(`div`,{class:`text-content-muted dark:text-content-muted`},`BW`,-1),g(`div`,mt,s(e.bandwidth),1)]),g(`div`,ht,[a[40]||=g(`div`,{class:`text-content-muted dark:text-content-muted`},`SF`,-1),g(`div`,gt,s(e.spreading_factor),1)]),g(`div`,_t,[a[41]||=g(`div`,{class:`text-content-muted dark:text-content-muted`},`CR`,-1),g(`div`,vt,s(e.coding_rate),1)]),g(`div`,yt,[a[42]||=g(`div`,{class:`text-content-muted dark:text-content-muted`},`TX Power`,-1),g(`div`,bt,s(o(x).selectedHardware?.config?.tx_power??(e.tx_power||`14`))+` dBm `,1)])])])],10,rt))),128))]),g(`div`,xt,[g(`button`,{onClick:a[7]||=e=>{o(x).useCustomRadio=!o(x).useCustomRadio,o(x).useCustomRadio&&(o(x).selectedRadioPreset=null)},class:l([`w-full p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm`,o(x).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`])},[g(`div`,St,[a[44]||=g(`div`,{class:`font-medium text-content-primary dark:text-content-primary flex items-center gap-2`},[g(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[g(`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`})]),m(` Custom Configuration `)],-1),o(x).useCustomRadio?(i(),_(`div`,Ct,[...a[43]||=[g(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[g(`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[45]||=g(`div`,{class:`text-xs text-content-secondary dark:text-content-muted`},` Manually configure frequency, bandwidth, spreading factor, and coding rate `,-1)],2),f(b,{name:`slide`},{default:n(()=>[o(x).useCustomRadio?(i(),_(`div`,wt,[g(`div`,null,[a[46]||=g(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Frequency (MHz)`,-1),r(g(`input`,{"onUpdate:modelValue":a[8]||=e=>o(x).customRadio.frequency=e,type:`number`,step:`0.1`,class:`modal-input px-4 py-2.5`,placeholder:`915.0`},null,512),[[y,o(x).customRadio.frequency]])]),g(`div`,null,[a[47]||=g(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Bandwidth (kHz)`,-1),r(g(`input`,{"onUpdate:modelValue":a[9]||=e=>o(x).customRadio.bandwidth=e,type:`number`,class:`modal-input px-4 py-2.5`,placeholder:`125`},null,512),[[y,o(x).customRadio.bandwidth]])]),g(`div`,null,[a[49]||=g(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Spreading Factor`,-1),r(g(`select`,{"onUpdate:modelValue":a[10]||=e=>o(x).customRadio.spreading_factor=e,class:`modal-select px-4 py-2.5`},[...a[48]||=[g(`option`,{value:`7`},`7`,-1),g(`option`,{value:`8`},`8`,-1),g(`option`,{value:`9`},`9`,-1),g(`option`,{value:`10`},`10`,-1),g(`option`,{value:`11`},`11`,-1),g(`option`,{value:`12`},`12`,-1)]],512),[[v,o(x).customRadio.spreading_factor]])]),g(`div`,null,[a[51]||=g(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Coding Rate`,-1),r(g(`select`,{"onUpdate:modelValue":a[11]||=e=>o(x).customRadio.coding_rate=e,class:`modal-select px-4 py-2.5`},[...a[50]||=[g(`option`,{value:`5`},`4/5`,-1),g(`option`,{value:`6`},`4/6`,-1),g(`option`,{value:`7`},`4/7`,-1),g(`option`,{value:`8`},`4/8`,-1)]],512),[[v,o(x).customRadio.coding_rate]])]),g(`div`,Tt,[a[52]||=g(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`TX Power (dBm)`,-1),r(g(`input`,{"onUpdate:modelValue":a[12]||=e=>o(x).customRadio.tx_power=e,type:`number`,min:`-9`,max:`22`,class:`modal-input px-4 py-2.5`,placeholder:`14`},null,512),[[y,o(x).customRadio.tx_power]]),a[53]||=g(`p`,{class:`text-content-muted dark:text-content-muted text-xs mt-2`},`SX1262 range: -9 to +22 dBm`,-1)])])):d(``,!0)]),_:1})])]))])):o(x).currentStep===6?(i(),_(`div`,Et,[a[58]||=g(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Set a secure admin password to protect your repeater `,-1),g(`div`,Dt,[g(`div`,null,[a[55]||=g(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Admin Password`,-1),r(g(`input`,{"onUpdate:modelValue":a[13]||=e=>o(x).adminPassword=e,type:`password`,class:`modal-input px-4 py-3`,placeholder:`Enter password (min 6 characters)`,minlength:`6`},null,512),[[y,o(x).adminPassword]])]),g(`div`,null,[a[56]||=g(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Confirm Password`,-1),r(g(`input`,{"onUpdate:modelValue":a[14]||=e=>o(x).confirmPassword=e,type:`password`,class:`modal-input px-4 py-3`,placeholder:`Confirm password`},null,512),[[y,o(x).confirmPassword]])]),o(x).adminPassword&&o(x).confirmPassword&&o(x).adminPassword!==o(x).confirmPassword?(i(),_(`div`,Ot,` Passwords do not match `)):d(``,!0),a[57]||=g(`div`,{class:`bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3 text-sm text-yellow-800 dark:text-yellow-200`},[g(`strong`,null,`Important:`),m(` Remember this password - you'll need it to access the dashboard. `)],-1)])])):d(``,!0)]),o(x).error?(i(),_(`div`,kt,s(o(x).error),1)):d(``,!0),g(`div`,At,[o(x).canGoBack?(i(),_(`button`,{key:0,onClick:qt,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 `)):(i(),_(`div`,jt)),g(`button`,{ref_key:`nextActionButtonRef`,ref:G,onClick:Q,disabled:!o(x).canGoNext||o(x).isSubmitting,class:l([`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(x).canGoNext&&!o(x).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(x).isSubmitting?(i(),c(le,{key:0,size:`sm`,color:`white`})):d(``,!0),o(x).isSubmitting?(i(),_(`span`,Nt,`Setting up...`)):o(x).isLastStep?(i(),_(`span`,Pt,`Complete Setup`)):(i(),_(`span`,Ft,`Next`)),!o(x).isSubmitting&&!o(x).isLastStep?(i(),_(`svg`,It,[...a[59]||=[g(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 5l7 7-7 7`},null,-1)]])):d(``,!0)],10,Mt)])])]),f(ce,{show:H.value,confirmed:U.value,"selected-tx-power":K.value,"action-label":`I Understand, Continue`,"onUpdate:show":a[15]||=e=>e?H.value=!0:Gt(),"onUpdate:confirmed":a[16]||=e=>U.value=e,onConfirm:Kt},null,8,[`show`,`confirmed`,`selected-tx-power`]),f(b,{name:`modal`},{default:n(()=>[S.value?(i(),_(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm`,onClick:$},[g(`div`,{class:`setup-dialog 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`,onClick:a[17]||=ie(()=>{},[`stop`])},[a[60]||=g(`div`,{class:`flex justify-center mb-6`},[g(`div`,{class:`w-16 h-16 rounded-full bg-red-100 dark:bg-red-500/20 flex items-center justify-center`},[g(`svg`,{class:`w-8 h-8 text-red-600 dark:text-red-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[g(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})])])],-1),g(`h3`,Lt,s(F.value),1),g(`p`,Rt,s(I.value),1),g(`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(fe,{modelValue:L.value,"onUpdate:modelValue":a[18]||=e=>L.value=e,"start-immediately":!0,message:`Setup complete. The service is restarting. This may take up to a minute.`},null,8,[`modelValue`])]))}}),[[`__scopeId`,`data-v-ecd1d451`]]);export{F as default}; |