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