1import{a as Bt}from"./chunk-Z42HM3N4.js";import{a as St}from"./chunk-WT5H66P7.js";import{a as Rt,d as yt}from"./chunk-WP742JQ7.js";import"./chunk-ZQ2CJXMC.js";import"./chunk-NWFF56ZO.js";import{D as u,g as v,h as W,i as D,k as P,l as M,m as H,n as V,o as Tt,p as Nt,q as It}from"./chunk-Q5DOKN3P.js";import"./chunk-WO3GYRB7.js";import"./chunk-BZ26RTLG.js";import"./chunk-QA27LE3P.js";import"./chunk-Y4ZGSY2R.js";import{a as Q}from"./chunk-2FGQMKT5.js";import{db as bt,o as Ot}from"./chunk-N6RRKPMH.js";import"./chunk-FJFH4XCE.js";import"./chunk-RWQTLYTV.js";import"./chunk-L7WATY32.js";import"./chunk-2RDPNIM6.js";import"./chunk-XPR5ELEW.js";import"./chunk-GGY6QDTV.js";import"./chunk-5IJU7MQ2.js";import"./chunk-LM6BYTWK.js";import"./chunk-ZWZG7L3J.js";import"./chunk-UXZT3DCY.js";import{o as ft}from"./chunk-ECXCM7JU.js";import"./chunk-7DHSGR33.js";import{c as xt,f as Et,i as ut,k as gt,y as ht}from"./chunk-QO327RTO.js";import"./chunk-4MYWE7CD.js";import"./chunk-RS4X3CMD.js";import{i as _t}from"./chunk-EWPP756Y.js";import"./chunk-I5EQON52.js";import{b as mt,c as wt,d as Ct}from"./chunk-G6PWMA7J.js";import{$a as et,Ac as j,Bc as z,Bd as ct,Cc as J,Cd as pt,Jc as F,Jd as dt,Kc as S,Lc as rt,Qb as p,Qc as s,Rb as r,Rc as c,Sb as o,Sc as B,Tb as E,Wc as q,X as G,Xb as b,Yb as T,Zb as Y,ac as N,cc as h,db as i,e as Z,ec as _,fd as ot,mb as y,oa as O,oc as K,pa as x,pc as nt,q as A,qa as g,r as tt,ra as k,sb as it,sc as d,tc as f,uc as m,vd as at,wd as st,xd as lt,yb as w}from"./chunk-IQ6SK2BU.js";import"./chunk-AMJ4GB2S.js";import"./chunk-WGJEEJGF.js";import"./chunk-6ACFICIG.js";import"./chunk-K7BHMZHH.js";import"./chunk-FE7444LI.js";import"./chunk-OXDKANHF.js";import"./chunk-XUHYVR5R.js";var At=/scantool|obdeleven|bluedriv|codereader3a|car ble|grommie|ap-caphk8v08000|9t8p20201313/i;function vt(e,a){return At.test(e)?"incompatible_family":a===!1?"unlikely_obd":null}function Dt(e,a,t){switch(e){case"no_elm":return a==="wifi"?{titleKey:"V2.OBD.CONNECT_ERROR.NO_ELM_WIFI_TITLE",bodyKey:"V2.OBD.CONNECT_ERROR.NO_ELM_WIFI_BODY",stepKeys:["V2.OBD.CONNECT_ERROR.NO_ELM_WIFI_STEP_1","V2.OBD.CONNECT_ERROR.NO_ELM_WIFI_STEP_2"],offersClassicSwitch:!1}:a==="classic"?{titleKey:"V2.OBD.CONNECT_ERROR.NO_ELM_CLASSIC_DEVICE_TITLE",bodyKey:"V2.OBD.CONNECT_ERROR.NO_ELM_CLASSIC_DEVICE_BODY",stepKeys:["V2.OBD.CONNECT_ERROR.NO_ELM_CLASSIC_DEVICE_STEP_1","V2.OBD.CONNECT_ERROR.NO_ELM_CLASSIC_DEVICE_STEP_2"],offersClassicSwitch:!1}:t?{titleKey:"V2.OBD.CONNECT_ERROR.NO_ELM_CLASSIC_TITLE",bodyKey:"V2.OBD.CONNECT_ERROR.NO_ELM_CLASSIC_BODY",stepKeys:["V2.OBD.CONNECT_ERROR.NO_ELM_CLASSIC_STEP_1","V2.OBD.CONNECT_ERROR.NO_ELM_CLASSIC_STEP_2"],offersClassicSwitch:!0}:{titleKey:"V2.OBD.CONNECT_ERROR.NO_ELM_GENERIC_TITLE",bodyKey:"V2.OBD.CONNECT_ERROR.NO_ELM_GENERIC_BODY",stepKeys:[],offersClassicSwitch:!1};case"wifi_no_network":return{titleKey:"V2.OBD.CONNECT_ERROR.WIFI_NO_NETWORK_TITLE",bodyKey:"V2.OBD.CONNECT_ERROR.WIFI_NO_NETWORK_BODY",stepKeys:["V2.OBD.CONNECT_ERROR.WIFI_NO_NETWORK_STEP_1","V2.OBD.CONNECT_ERROR.WIFI_NO_NETWORK_STEP_2","V2.OBD.CONNECT_ERROR.WIFI_NO_NETWORK_STEP_3"],offersClassicSwitch:!1};case"wifi_unreachable":return{titleKey:"V2.OBD.CONNECT_ERROR.WIFI_UNREACHABLE_TITLE",bodyKey:"V2.OBD.CONNECT_ERROR.WIFI_UNREACHABLE_BODY",stepKeys:["V2.OBD.CONNECT_ERROR.WIFI_UNREACHABLE_STEP_1","V2.OBD.CONNECT_ERROR.WIFI_UNREACHABLE_STEP_2","V2.OBD.CONNECT_ERROR.WIFI_UNREACHABLE_STEP_3"],offersClassicSwitch:!1};case"handshake_timeout":case"bus_error":return{titleKey:"V2.OBD.CONNECT_ERROR.HANDSHAKE_TIMEOUT_TITLE",bodyKey:"V2.OBD.CONNECT_ERROR.HANDSHAKE_TIMEOUT_BODY",stepKeys:["V2.OBD.CONNECT_ERROR.HANDSHAKE_TIMEOUT_STEP_1","V2.OBD.CONNECT_ERROR.HANDSHAKE_TIMEOUT_STEP_2"],offersClassicSwitch:!1};case"timeout":return{titleKey:"V2.OBD.CONNECT_ERROR.TIMEOUT_TITLE",bodyKey:"V2.OBD.CONNECT_ERROR.TIMEOUT_BODY",stepKeys:["V2.OBD.CONNECT_ERROR.TIMEOUT_STEP_1","V2.OBD.CONNECT_ERROR.TIMEOUT_STEP_2"],offersClassicSwitch:!1};case"wifi_error":case"classic_error":case"ble_error":{let n=e==="wifi_error"?"wifi":e==="classic_error"?"classic":a;return n==="wifi"?{titleKey:"V2.OBD.CONNECT_ERROR.WIFI_ERROR_TITLE",bodyKey:"V2.OBD.CONNECT_ERROR.WIFI_ERROR_BODY",stepKeys:["V2.OBD.CONNECT_ERROR.WIFI_ERROR_STEP_1","V2.OBD.CONNECT_ERROR.WIFI_ERROR_STEP_2","V2.OBD.CONNECT_ERROR.WIFI_ERROR_STEP_3"],offersClassicSwitch:!1}:n==="classic"?{titleKey:"V2.OBD.CONNECT_ERROR.CLASSIC_ERROR_TITLE",bodyKey:"V2.OBD.CONNECT_ERROR.CLASSIC_ERROR_BODY",stepKeys:["V2.OBD.CONNECT_ERROR.CLASSIC_ERROR_STEP_1","V2.OBD.CONNECT_ERROR.CLASSIC_ERROR_STEP_2","V2.OBD.CONNECT_ERROR.CLASSIC_ERROR_STEP_3"],offersClassicSwitch:!1}:{titleKey:"V2.OBD.CONNECT_ERROR.BLE_ERROR_TITLE",bodyKey:"V2.OBD.CONNECT_ERROR.BLE_ERROR_BODY",stepKeys:["V2.OBD.CONNECT_ERROR.BLE_ERROR_STEP_1","V2.OBD.CONNECT_ERROR.BLE_ERROR_STEP_2","V2.OBD.CONNECT_ERROR.BLE_ERROR_STEP_3"],offersClassicSwitch:!1}}}}var kt=(e,a)=>({host:e,port:a}),Vt=()=>[],Kt=e=>({name:e}),Ft=e=>({$implicit:e,obd:!0}),Lt=e=>({classicLabel:e}),Wt=e=>({$implicit:e,obd:!1}),Pt=()=>[1,2,3];function Mt(e,a){if(e&1){let t=N();r(0,"button",10),h("click",function(){let l=O(t).$implicit,C=_(2);return x(C.selectKind(l))}),d(1),s(2,"translate"),o()}if(e&2){let t=a.$implicit,n=_(2);p("ngClass",t===n.selectedKind?"tw-bg-mech-surface tw-text-mech-text tw-shadow-card":"tw-bg-transparent tw-text-mech-text-muted hover:tw-text-mech-text")("disabled",n.busy),i(),m(" ",c(2,3,n.adapter
1LabelKey(t))," ")}}function Ht(e,a){if(e&1&&(r(0,"div",8),w(1,Mt,3,5,"button",9),o()),e&2){let t=_();i(),p("ngForOf",t.adapterKinds)}}function $t(e,a){e&1&&(r(0,"div",11)(1,"h2",12),d(2),s(3,"translate"),o(),r(4,"p",13),d(5),s(6,"translate"),o()()),e&2&&(i(2),f(c(3,2,"V2.OBD.CONNECT.CLASSIC_TITLE")),i(3),f(c(6,4,"V2.OBD.CONNECT.CLASSIC_HINT")))}function Ut(e,a){e&1&&(r(0,"p",32),g(),r(1,"svg",33),E(2,"path",34)(3,"line",35)(4,"line",36),o(),d(5),s(6,"translate"),o()),e&2&&(i(5),m(" ",c(6,1,"V2.OBD.CONNECT.WIFI_NOT_ON_WIFI")," "))}function Gt(e,a){if(e&1){let t=N();r(0,"button",37),h("click",function(){O(t);let l=_(2);return x(l.useDefaultWifiEndpoint())}),d(1),s(2,"translate"),o()}if(e&2){let t=_(2);p("disabled",t.busy),i(),m(" ",B(2,2,"V2.OBD.CONNECT.WIFI_USE_DEFAULT",rt(5,kt,t.defaultWifiHost,t.defaultWifiPort))," ")}}function Yt(e,a){e&1&&(r(0,"p",38),d(1),s(2,"translate"),o()),e&2&&(i(),m(" ",c(2,1,"V2.OBD.CONNECT.WIFI_INVALID_ADDRESS")," "))}function jt(e,a){e&1&&(g(),r(0,"svg",39),E(1,"path",40),o())}function zt(e,a){if(e&1){let t=N();b(0),r(1,"div",11)(2,"h2",12),d(3),s(4,"translate"),o(),r(5,"div",14)(6,"span",15),d(7," 1 "),o(),r(8,"div",16)(9,"p",17),d(10),s(11,"translate"),o(),r(12,"p",18),d(13),s(14,"translate"),o(),w(15,Ut,7,3,"p",19),o()(),r(16,"div",20)(17,"span",15),d(18," 2 "),o(),r(19,"div",16)(20,"p",21),d(21),s(22,"translate"),o(),r(23,"div",22)(24,"label",23)(25,"span",24),d(26),s(27,"translate"),o(),r(28,"input",25),J("ngModelChange",function(l){O(t);let C=_();return z(C.wifiHost,l)||(C.wifiHost=l),x(l)}),o()(),r(29,"label",26)(30,"span",24),d(31),s(32,"translate"),o(),r(33,"input",27),J("ngModelChange",function(l){O(t);let C=_();return z(C.wifiPort,l)||(C.wifiPort=l),x(l)}),o()()(),w(34,Gt,3,8,"button",28)(35,Yt,3,3,"p",29),r(36,"button",30),h("click",function(){O(t);let l=_();return x(l.onWifiConnect())}),w(37,jt,2,0,"svg",31),d(38),s(39,"translate"),o()()()(),T()}if(e&2){let t=_();i(3),f(c(4,15,"V2.OBD.CONNECT.WIFI_TITLE")),i(7),m(" ",c(11,17,"V2.OBD.CONNECT.WIFI_STEP_JOIN_TITLE")," "),i(3),m(" ",c(14,19,"V2.OBD.CONNECT.WIFI_STEP_JOIN_BODY")," "),i(2),p("ngIf",t.notOnWifi),i(6),m(" ",c(22,21,"V2.OBD.CONNECT.WIFI_STEP_ADDRESS_TITLE")," "),i(5),f(c(27,23,"V2.OBD.CONNECT.WIFI_HOST")),i(2),p("placeholder",t.defaultWifiHost),j("ngModel",t.wifiHost),i(3),f(c(32,25,"V2.OBD.CONNECT.WIFI_PORT")),i(2),j("ngModel",t.wifiPort),i(),p("ngIf",!t.isDefaultWifiEndpoint),i(),p("ngIf",t.wifiHost&&!t.isWifiEndpointValid),i(),p("disabled",t.busy||!t.isWifiEndpointValid),i(),p("ngIf",t.busy),i(),m(" ",c(39,27,t.busy?"V2.OBD.STATUS.CONNECTING":"V2.OBD.CONNECT.CONNECT_BUTTON")," ")}}function Jt(e,a){if(e&1){let t=N();b(0),r(1,"button",46),h("click",function(){let l=O(t).ngIf,C=_(2);return x(C.onReconnect(l))}),r(2,"span",47),g(),r(3,"svg",48),E(4,"polyline",49)(5,"path",50),o()(),k(),r(6,"span",51)(7,"span",24),d(8),s(9,"translate"),o(),r(10,"span",52),d(11),s(12,"translate"),s(13,"translate"),s(14,"translate"),o()()(),T()}if(e&2){let t=a.ngIf,n=_(2);i(),p("disabled",n.busy),i(7),f(c(9,3,"V2.OBD.CONNECT.LAST_USED")),i(3),m(" ",n.connectingId===t.id?c(12,5,"V2.OBD.STATUS.CONNECTING"):B(14,9,"V2.OBD.CONNECT.RECONNECT",S(12,Kt,t.name||c(13,7,"V2.OBD.CONNECT.YOUR_READER")))," ")}}function qt(e,a){if(e&1&&(r(0,"li",20)(1,"span",53),d(2),o(),r(3,"span",54),d(4),s(5,"translate"),o()()),e&2){let t=a.$implicit,n=a.index;i(2),m(" ",n+1," "),i(2),f(c(5,2,t))}}function Qt(e,a){e&1&&(g(),r(0,"svg",39),E(1,"path",40),o())}function Xt(e,a){e&1&&(r(0,"h2",41),d(1),s(2,"translate"),o()),e&2&&(i(),m(" ",c(2,1,"V2.OBD.CONNECT.OBD_READERS")," "))}function Zt(e,a){e&1&&Y(0)}function te(e,a){if(e&1&&(r(0,"li"),w(1,Zt,1,0,"ng-container",59),o()),e&2){let t=a.$implicit;_(4);let n=K(13);i(),p("ngTemplateOutlet",n)("ngTemplateOutletContext",S(2,Ft,t))}}function ee(e,a){if(e&1&&(r(0,"ul",57),w(1,te,2,4,"li",58),o()),e&2){let t=_().ngIf;i(),p("ngForOf",t)}}function ie(e,a){if(e&1&&(r(0,"p",70),d(1),s(2,"translate"),s(3,"translate"),o()),e&2){let t=_(4);i(),m(" ",B(3,3,t.hasClassicAdapterOption?"V2.OBD.CONNECT.BLE_HINT_CLASSIC":"V2.OBD.CONNECT.BLE_HINT_IOS",S(6,Lt,c(2,1,t.adapterLabelKey("classic"))))," ")}}function ne(e,a){if(e&1){let t=N();b(0),w(1,ie,4,8,"p",60),r(2,"p",61),d(3),s(4,"translate"),o(),r(5,"div",62)(6,"p",63),d(7),s(8,"translate"),o(),r(9,"p",64),d(10),s(11,"translate"),o(),r(12,"a",65),h("click",function(){O(t);let l=_(3);return x(l.onDongleClick())}),g(),r(13,"svg",66),E(14,"circle",67)(15,"circle",68)(16,"path",69),o(),d(17),s(18,"translate"),o()(),T()}if(e&2){let t=_(3);i(),p("ngIf",t.selectedKind==="ble"),i(2),m(" ",c(4,6,"V2.OBD.CONNECT.EMPTY")," "),i(4),m(" ",c(8,8,"V2.OBD.TEASER.DONGLE_TITLE")," "),i(3),f(c(11,10,"V2.OBD.TEASER.DONGLE_BODY")),i(2),p("href",t.dongleUrl,et),i(5),m(" ",c(18,12,"V2.OBD.TEASER.DONGLE_CTA")," ")}}function re(e,a){if(e&1&&(b(0),w(1,Xt,3,3,"h2",55)(2,ee,2,1,"ul",56)(3,ne,19,14,"ng-container",6),s(4,"async"),T()),e&2){let t=a.ngIf,n=_(2);i(),p("ngIf",t.length>0),i(),p("ngIf",t.length>
10),i(),p("ngIf",t.length===0&&c(4,3,n.isLoading$)===!1)}}function oe(e,a){e&1&&Y(0)}function ae(e,a){if(e&1&&(r(0,"li"),w(1,oe,1,0,"ng-container",59),o()),e&2){let t=a.$implicit;_(4);let n=K(13);i(),p("ngTemplateOutlet",n)("ngTemplateOutletContext",S(2,Wt,t))}}function se(e,a){if(e&1&&(b(0),r(1,"h2",71),d(2),s(3,"translate"),o(),r(4,"p",72),d(5),s(6,"translate"),o(),r(7,"ul",57),w(8,ae,2,4,"li",58),o(),T()),e&2){let t=_().ngIf;i(2),f(c(3,3,"V2.OBD.CONNECT.OTHER_DEVICES")),i(3),m(" ",c(6,5,"V2.OBD.CONNECT.OTHER_DEVICES_HINT")," "),i(3),p("ngForOf",t)}}function le(e,a){if(e&1&&(b(0),w(1,se,9,7,"ng-container",6),T()),e&2){let t=a.ngIf;i(),p("ngIf",t.length>0)}}function ce(e,a){if(e&1){let t=N();b(0),w(1,Jt,15,14,"ng-container",6),s(2,"async"),r(3,"div",11)(4,"h2",41),d(5),s(6,"translate"),o(),r(7,"ol",42),w(8,qt,6,4,"li",43),o()(),r(9,"button",44),s(10,"async"),h("click",function(){O(t);let l=_();return x(l.onScan())}),w(11,Qt,2,0,"svg",31),s(12,"async"),d(13),s(14,"async"),s(15,"translate"),o(),w(16,re,5,5,"ng-container",6),s(17,"async"),w(18,le,2,1,"ng-container",6),s(19,"async"),r(20,"button",45),h("click",function(){O(t);let l=_();return x(l.toggleShowAll())}),d(21),s(22,"translate"),o(),T()}if(e&2){let t=_();i(),p("ngIf",c(2,9,t.lastDongle$)),i(4),f(c(6,11,"V2.OBD.CONNECT.INSTRUCTIONS_TITLE")),i(3),p("ngForOf",t.steps),i(),p("disabled",t.busy||c(10,13,t.isLoading$)),i(2),p("ngIf",c(12,15,t.isLoading$)),i(2),m(" ",c(15,19,c(14,17,t.isLoading$)?"V2.OBD.CONNECT.SCANNING":"V2.OBD.CONNECT.SCAN_BUTTON")," "),i(3),p("ngIf",c(17,21,t.obdReaders$)??F(27,Vt)),i(2),p("ngIf",t.showAll&&(c(19,23,t.otherDevices$)??F(28,Vt))),i(3),m(" ",c(22,25,t.showAll?"V2.OBD.CONNECT.SHOW_OBD_ONLY":"V2.OBD.CONNECT.SHOW_ALL")," ")}}function pe(e,a){if(e&1&&(r(0,"li",54),d(1),s(2,"translate"),s(3,"translate"),o()),e&2){let t=a.$implicit,n=_(4);i(),m(" ",B(3,3,t,S(6,Lt,c(2,1,n.adapterLabelKey("classic"))))," ")}}function de(e,a){if(e&1&&(r(0,"ol",83),w(1,pe,4,8,"li",84),o()),e&2){let t=_().ngIf;i(),p("ngForOf",t.stepKeys)}}function _e(e,a){if(e&1){let t=N();r(0,"button",85),h("click",function(){O(t);let l=_(3);return x(l.selectKind("classic"))}),d(1),s(2,"translate"),o()}e&2&&(i(),m(" ",c(2,1,"V2.OBD.CONNECT_ERROR.SWITCH_TO_CLASSIC")," "))}function me(e,a){if(e&1&&(b(0),r(1,"div",20)(2,"span",75),g(),r(3,"svg",76),E(4,"path",34)(5,"line",35)(6,"line",36),o()(),k(),r(7,"div",16)(8,"h3",63),d(9),s(10,"translate"),o(),r(11,"p",77),d(12),s(13,"translate"),o(),w(14,de,2,1,"ol",78)(15,_e,3,3,"button",79),r(16,"details",80)(17,"summary",81),d(18),s(19,"translate"),o(),r(20,"p",82),d(21),o()()()(),T()),e&2){let t=a.ngIf,n=_().ngIf;i(9),m(" ",c(10,6,t.titleKey)," "),i(3),f(c(13,8,t.bodyKey)),i(2),p("ngIf",t.stepKeys.length>0),i(),p("ngIf",t.offersClassicSwitch),i(3),m(" ",c(19,10,"V2.OBD.CONNECT_ERROR.DETAILS_TOGGLE")," "),i(3),f(n)}}function we(e,a){if(e&1&&(r(0,"p",86),d(1),o()),e&2){let t=_().ngIf;i(),f(t)}}function Ce(e,a){if(e&1&&(r(0,"div",73),w(1,me,22,12,"ng-container",74),s(2,"async"),w(3,we,2,1,"ng-template",null,1,q),o()),e&2){let t=K(4),n=_();i(),p("ngIf",c(2,2,n.remediation$))("ngIfElse",t)}}function fe(e,a){e&1&&(r(0,"span",24),d(1),s(2,"translate"),o()),e&2&&(i(),m(" ",c(2,1,"V2.OBD.CONNECT.PAIRED")," "))}function Oe(e,a){if(e&1&&E(0,"span",98),e&2){let t=a.$implicit,n=_(2).$implicit,l=_();nt("height",t*3+2,"px"),p("ngClass",t<=l.signalBars(n.rssi)?"tw-bg-mech-primary":"tw-bg-mech-border-strong")}}function xe(e,a){if(e&1&&(r(0,"span",95)(1,"span",96),w(2,Oe,1,3,"span",97),o(),d(3),s(4,"translate"),o()),e&2){let t=_().$implicit,n=_();i(2),p("ngForOf",F(4,Pt)),i(),m(" ",c(4,2,n.signalLabel(t.rssi))," ")}}function Ee(e,a){if(e&1&&(r(0,"span",99),g(),r(1,"svg",100),E(2,"path",34)(3,"line",35)(4,"line",36),o(),d(5),s(6,"translate"),o()),e&2){let t=a.ngIf;i(5),m(" ",c(6,1,t==="incompatible_family"?"V2.OBD.INCOMPATIBLE.ROW_WARNING":"V2.OBD.INCOMPATIBLE.UNLIKELY_ROW_WARNING")," ")}}function ue(e,a){e&1&&(g(),r(0,"svg",39),E(1,"path",40),o())}function ge(e,a){if(e&1){let t=N();r(0,"div",87)(1,"div",88)(2,"span",89),g(),r(3,"svg",48),E(4,"path",90),o()(),k(),r(5,"div",51)(6,"span",52),d(7),o(),w(8,fe,3,3,"span",91)(9,xe,5,5,"span",92)(10,Ee,7,3,"span",93),o()(),r(11,"button",94),h("click",function(){let l=O(t).$implicit,C=_();return x(C.onConnect(l))}),w(12,ue,2,0,"svg",31),d(13),s(14,"translate"),o()()}if(e&2){let t=a.$implicit,n=a.obd,l=_();
1i(2),p("ngClass",n?"tw-bg-mech-primary/15 tw-text-mech-primary":"tw-bg-mech-surface-2 tw-text-mech-text-faint"),i(5),f(t.name),i(),p("ngIf",l.selectedKind==="classic"),i(),p("ngIf",l.selectedKind!=="classic"),i(),p("ngIf",l.deviceCompat(t)),i(),p("disabled",l.busy),i(),p("ngIf",l.connectingId===t.id),i(),m(" ",c(14,8,l.connectingId===t.id?"V2.OBD.STATUS.CONNECTING":"V2.OBD.CONNECT.CONNECT_BUTTON")," ")}}var Ge=(()=>{class e{constructor(t,n,l,C,$,L){this.store=t,this.router=n,this.cdr=l,this.analytics=C,this.dialog=$,this.translate=L,this.steps=["V2.OBD.CONNECT.STEP_1","V2.OBD.CONNECT.STEP_2","V2.OBD.CONNECT.STEP_3"],this.dongleUrl="https://www.amazon.com/s?k=ELM327+Bluetooth+OBD2+scanner&tag=mechai1-20",this.showAll=!1,this.connectingId=null,this.adapterKinds=yt(),this.selectedKind=this.adapterKinds[0]??"ble",this.wifiHost="",this.wifiPort=D,this.connectionType=null,this.networkListener=null,this.destroyed$=new Z,this.defaultWifiHost=W,this.defaultWifiPort=D,this.dongles$=this.store.select(u.discoveredDongles),this.obdReaders$=this.dongles$.pipe(A(I=>I.filter(R=>R.isLikelyObd!==!1&&v(R.id)===this.selectedKind))),this.otherDevices$=this.dongles$.pipe(A(I=>I.filter(R=>R.isLikelyObd===!1&&v(R.id)===this.selectedKind))),this.isLoading$=this.store.select(u.isLoading),this.error$=this.store.select(u.error);let U=this.store.select(u.errorCategory),X=this.store.select(u.errorTransportKind);this.remediation$=tt([U,X]).pipe(A(([I,R])=>I?Dt(I,R,this.hasClassicAdapterOption):null)),this.status$=this.store.select(u.status),this.dongleName$=this.store.select(u.currentDongleName),this.lastDongle$=this.store.select(u.lastDongle)}get busy(){return this.connectingId!==null}ngOnInit(){if(this.store.selectSnapshot(u.status)==="connected"){this.router.navigate(["/v2/obd/scan"],{replaceUrl:!0});return}this.store.dispatch(new Nt),this.seedWifiEndpointFromLastSuccess(),this.watchConnectionType(),this.store.dispatch(new V(this.showAll))}onScan(){this.store.dispatch(new V(this.showAll))}onDongleClick(){this.analytics.logObdDongleAffiliateClick("obd_no_adapter")}get showAdapterPicker(){return this.adapterKinds.length>1}get hasClassicAdapterOption(){return this.adapterKinds.includes("classic")}adapterLabelKey(t){return Rt[t].labelKey}selectKind(t){this.busy||t===this.selectedKind||(this.selectedKind=t,this.connectingId=null,this.store.dispatch(new H(this.adapterChoice())),t!=="wifi"&&this.store.dispatch(new V(this.showAll)))}get isWifiEndpointValid(){return P(this.wifiHost)&&M(Number(this.wifiPort))}get isDefaultWifiEndpoint(){return this.wifiHost.trim()===W&&Number(this.wifiPort)===D}useDefaultWifiEndpoint(){this.wifiHost=W,this.wifiPort=D}get notOnWifi(){return this.connectionType==="cellular"||this.connectionType==="none"}onWifiConnect(){if(!this.isWifiEndpointValid)return;let t=this.wifiHost.trim(),n=Number(this.wifiPort);this.wifiHost=t,this.store.dispatch(new H(this.adapterChoice())),this.connect(`wifi:${t}:${n}`,`WiFi adapter (${t}:${n})`)}adapterChoice(){return this.selectedKind==="wifi"?{kind:"wifi",host:this.wifiHost.trim(),port:Number(this.wifiPort)}:{kind:this.selectedKind}}seedWifiEndpointFromLastSuccess(){if(this.wifiHost)return;let t=this.store.selectSnapshot(u.lastDongle);if(typeof t?.id!="string"||v(t.id)!=="wifi")return;let[,n,l]=t.id.split(":");P(n)&&(this.wifiHost=n,M(Number(l))&&(this.wifiPort=Number(l)))}async watchConnectionType(){try{let t=await Q.getStatus();this.connectionType=t.connectionType,this.cdr.markForCheck()}catch{}try{this.networkListener=await Q.addListener("networkStatusChange",t=>{this.connectionType=t.connectionType,this.cdr.markForCheck()})}catch{}}toggleShowAll(){this.showAll=!this.showAll,this.store.dispatch(new V(this.showAll))}onConnect(t){let n=this.deviceCompat(t);if(n){this.confirmIncompatibleDevice(n,t);return}this.connect(t.id)}deviceCompat(t){return this.selectedKind!=="ble"?null:vt(t.name,t.isLikelyObd)}confirmIncompatibleDevice(t,n){let l=t==="incompatible_family",C=l?"V2.OBD.INCOMPATIBLE.DIALOG_TITLE":"V2.OBD.INCOMPATIBLE.UNLIKELY_DIALOG_TITLE",$=l?this.hasClassicAdapterOption?"V2.OBD.INCOMPATIBLE.DIALOG_BODY_CLASSIC":"V2.OBD.INCOMPATIBLE.DIALOG_BODY":"V2.OBD.INCOMPATIBLE.UNLIKELY_DIALOG_BODY",L={name:n.name,classicLabel:this.translate.instant(this.adapter
1LabelKey("classic"))},U={title:this.translate.instant(C,L),message:this.translate.instant($,L),confirmLabel:this.translate.instant("V2.OBD.INCOMPATIBLE.CONFIRM"),cancelLabel:this.translate.instant("V2.OBD.INCOMPATIBLE.CANCEL")};this.dialog.open(St,{data:U,autoFocus:!1}).afterClosed().pipe(G(this.destroyed$)).subscribe(I=>{I&&this.connect(n.id)})}onReconnect(t){let n=v(t.id);n!==this.selectedKind&&this.adapterKinds.includes(n)&&(this.selectedKind=n,this.store.dispatch(new H(this.reconnectChoice(n,t.id)))),this.connect(t.id)}reconnectChoice(t,n){if(t==="wifi"){let[,l,C]=n.split(":");return P(l)&&(this.wifiHost=l),M(Number(C))&&(this.wifiPort=Number(C)),{kind:t,host:this.wifiHost,port:this.wifiPort}}return{kind:t}}connect(t,n){this.busy||(this.connectingId=t,this.cdr.markForCheck(),this.store.dispatch(new It(t,n)).pipe(G(this.destroyed$)).subscribe(()=>{this.store.selectSnapshot(u.status)==="connected"?this.router.navigate(["/v2/obd/scan"],{replaceUrl:!0}):(this.connectingId=null,this.cdr.markForCheck())}))}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete(),this.networkListener?.remove(),this.networkListener=null,this.store.dispatch(new Tt)}signalBars(t){return t==null?0:t>=-60?3:t>=-75?2:t>=-90?1:0}signalLabel(t){let n=this.signalBars(t);return n>=3?"V2.OBD.COMMON.SIGNAL_STRONG":n===2?"V2.OBD.COMMON.SIGNAL_GOOD":"V2.OBD.COMMON.SIGNAL_WEAK"}static{this.\u0275fac=function(n){return new(n||e)(y(ft),y(_t),y(ot),y(bt),y(Ot),y(mt))}}static{this.\u0275cmp=it({type:e,selectors:[["app-obd-connect"]],decls:14,vars:20,consts:[["deviceRow",""],["genericError",""],[1,"tw-p-6","sm:tw-p-8","tw-max-w-2xl","tw-mx-auto","tw-w-full"],[3,"title","subtitle","showStatus","status","dongleName"],["class","tw-inline-flex tw-w-full sm:tw-w-auto tw-p-1 tw-gap-1 tw-rounded-full tw-bg-mech-surface-2 tw-border tw-border-mech-border tw-mb-5",4,"ngIf"],["class","tw-p-4 tw-mb-5 tw-rounded-2xl tw-bg-mech-surface tw-border tw-border-mech-border",4,"ngIf"],[4,"ngIf"],["class","tw-mt-4 tw-p-4 tw-rounded-2xl tw-border tw-bg-[rgb(var(--color-danger-rgb)/0.06)] tw-border-[rgb(var(--color-danger-rgb)/0.24)]",4,"ngIf"],[1,"tw-inline-flex","tw-w-full","sm:tw-w-auto","tw-p-1","tw-gap-1","tw-rounded-full","tw-bg-mech-surface-2","tw-border","tw-border-mech-border","tw-mb-5"],["type","button","class","tw-flex-1 sm:tw-flex-none tw-px-4 tw-py-1.5 tw-rounded-full tw-text-sm tw-font-semibold tw-transition-colors tw-cursor-pointer tw-border-0 disabled:tw-opacity-50",3,"ngClass","disabled","click",4,"ngFor","ngForOf"],["type","button",1,"tw-flex-1","sm:tw-flex-none","tw-px-4","tw-py-1.5","tw-rounded-full","tw-text-sm","tw-font-semibold","tw-transition-colors","tw-cursor-pointer","tw-border-0","disabled:tw-opacity-50",3,"click","ngClass","disabled"],[1,"tw-p-4","tw-mb-5","tw-rounded-2xl","tw-bg-mech-surface","tw-border","tw-border-mech-border"],[1,"mech-label","tw-mb-2"],[1,"tw-text-sm","tw-text-mech-text-secondary","tw-m-0"],[1,"tw-flex","tw-items-start","tw-gap-3","tw-mb-4"],[1,"tw-grid","tw-place-items-center","tw-w-6","tw-h-6","tw-rounded-full","tw-shrink-0","tw-text-xs","tw-font-bold","tw-bg-mech-primary/15","tw-text-mech-primary"],[1,"tw-min-w-0","tw-flex-1"],[1,"tw-text-sm","tw-font-semibold","tw-text-mech-text","tw-m-0"],[1,"tw-text-sm","tw-text-mech-text-secondary","tw-m-0","tw-mt-0.5"],["class","tw-flex tw-items-start tw-gap-1.5 tw-text-sm tw-text-[var(--color-warning)] tw-m-0 tw-mt-2",4,"ngIf"],[1,"tw-flex","tw-items-start","tw-gap-3"],[1,"tw-text-sm","tw-font-semibold","tw-text-mech-text","tw-m-0","tw-mb-2"],[1,"tw-flex","tw-gap-3","tw-mb-2"],[1,"tw-flex","tw-flex-1","tw-flex-col","tw-gap-1"],[1,"tw-text-xs","tw-text-mech-text-muted"],["type","text","inputmode","decimal","autocomplete","off","spellcheck","false",1,"tw-w-full","tw-px-3","tw-py-2","tw-rounded-xl","tw-bg-mech-surface-2","tw-border","tw-border-mech-border","tw-text-sm","tw-text-mech-text",3,"ngModelChange","placeholder","ngModel"],[1,"tw-flex","tw-w-28","tw-flex-col","tw-gap-1"],["type","number",1,"tw-w-full","tw-px-3","tw-py-2","tw-rounded-xl","tw-bg-mech-surface-2","tw-border","tw-border-mech-border","t
1w-text-sm","tw-text-mech-text",3,"ngModelChange","ngModel"],["type","button","class","tw-mb-3 tw-px-3 tw-py-1.5 tw-rounded-full tw-text-xs tw-font-semibold tw-cursor-pointer tw-bg-mech-surface-2 tw-border tw-border-mech-border tw-text-mech-text-secondary hover:tw-text-mech-text tw-transition-colors disabled:tw-opacity-50",3,"disabled","click",4,"ngIf"],["class","tw-text-xs tw-text-[var(--color-danger)] tw-m-0 tw-mb-2",4,"ngIf"],["type","button",1,"mech-btn-primary","tw-w-full","tw-flex","tw-items-center","tw-justify-center","tw-gap-2",3,"click","disabled"],["aria-hidden","true","class","tw-w-4 tw-h-4 tw-animate-spin","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round",4,"ngIf"],[1,"tw-flex","tw-items-start","tw-gap-1.5","tw-text-sm","tw-text-[var(--color-warning)]","tw-m-0","tw-mt-2"],["aria-hidden","true","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"tw-w-4","tw-h-4","tw-shrink-0","tw-mt-0.5"],["d","M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"],["x1","12","y1","9","x2","12","y2","13"],["x1","12","y1","17","x2","12.01","y2","17"],["type","button",1,"tw-mb-3","tw-px-3","tw-py-1.5","tw-rounded-full","tw-text-xs","tw-font-semibold","tw-cursor-pointer","tw-bg-mech-surface-2","tw-border","tw-border-mech-border","tw-text-mech-text-secondary","hover:tw-text-mech-text","tw-transition-colors","disabled:tw-opacity-50",3,"click","disabled"],[1,"tw-text-xs","tw-text-[var(--color-danger)]","tw-m-0","tw-mb-2"],["aria-hidden","true","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round",1,"tw-w-4","tw-h-4","tw-animate-spin"],["d","M21 12a9 9 0 1 1-6.219-8.56"],[1,"mech-label","tw-mb-3"],[1,"tw-list-none","tw-p-0","tw-m-0","tw-flex","tw-flex-col","tw-gap-2.5"],["class","tw-flex tw-items-start tw-gap-3",4,"ngFor","ngForOf"],["type","button",1,"mech-btn-primary","tw-w-full","tw-mb-5","tw-flex","tw-items-center","tw-justify-center","tw-gap-2",3,"click","disabled"],["type","button",1,"tw-bg-transparent","tw-border-none","tw-p-0","tw-text-sm","tw-text-mech-primary","tw-font-semibold","tw-cursor-pointer","hover:tw-underline",3,"click"],["type","button",1,"tw-w-full","tw-flex","tw-items-center","tw-gap-3","tw-p-4","tw-mb-5","tw-rounded-2xl","tw-bg-mech-primary-50","tw-border","tw-border-mech-primary/30","tw-text-left","hover:tw-bg-mech-primary-100","tw-transition-colors","tw-cursor-pointer","disabled:tw-opacity-50",3,"click","disabled"],[1,"tw-grid","tw-place-items-center","tw-w-10","tw-h-10","tw-rounded-full","tw-bg-mech-primary/15","tw-text-mech-primary","tw-shrink-0"],["aria-hidden","true","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"tw-w-5","tw-h-5"],["points","23 4 23 10 17 10"],["d","M20.49 15a9 9 0 1 1-2.12-9.36L23 10"],[1,"tw-flex","tw-flex-col","tw-min-w-0"],[1,"tw-font-semibold","tw-text-mech-text","tw-truncate"],[1,"tw-grid","tw-place-items-center","tw-w-5","tw-h-5","tw-rounded-full","tw-bg-mech-primary/15","tw-text-mech-primary","tw-text-xs","tw-font-bold","tw-shrink-0","tw-mt-0.5"],[1,"tw-text-sm","tw-text-mech-text-secondary"],["class","mech-label tw-mb-3",4,"ngIf"],["class","tw-list-none tw-p-0 tw-m-0 tw-flex tw-flex-col tw-gap-3 tw-mb-5",4,"ngIf"],[1,"tw-list-none","tw-p-0","tw-m-0","tw-flex","tw-flex-col","tw-gap-3","tw-mb-5"],[4,"ngFor","ngForOf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["class","tw-text-xs tw-text-mech-text-faint tw-mb-4",4,"ngIf"],[1,"tw-text-sm","tw-text-mech-text-muted","tw-mb-4"],[1,"tw-rounded-2xl","tw-border","tw-border-mech-border","tw-bg-mech-surface","tw-p-5","tw-mb-5"],[1,"tw-text-sm","tw-font-bold","tw-text-mech-text","tw-m-0","tw-mb-1"],[1,"tw-text-xs","tw-text-mech-text-muted","tw-m-0","tw-mb-4"],["target","_blank","rel","noopener noreferrer sponsored",1,"mech-btn-primary","tw-inline-flex","tw-items-center","tw-justify-center","tw-gap-2","tw-text-sm","tw-no-underline",2,"min-height","44px",3,"click","href"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true",1,"tw-w-4","tw-h-4"],["cx","9","cy","21","r","1"],["cx","20","cy","21","r","1"],["d","M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"],[1,"tw-text-xs","tw-text-mech-text-faint","tw-mb-4"],[1,"mech-label","tw-mb-1"],[1,"tw-text-xs","tw-text-mech-text-faint","tw-mb-3","tw-mt-0"],[1,"tw-mt-4","tw-p-4","tw-rounded-2xl","tw-border","t
1w-bg-[rgb(var(--color-danger-rgb)/0.06)]","tw-border-[rgb(var(--color-danger-rgb)/0.24)]"],[4,"ngIf","ngIfElse"],[1,"tw-grid","tw-place-items-center","tw-w-8","tw-h-8","tw-rounded-full","tw-shrink-0","tw-bg-[rgb(var(--color-danger-rgb)/0.14)]","tw-text-[var(--color-danger)]"],["aria-hidden","true","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"tw-w-4","tw-h-4"],[1,"tw-text-sm","tw-text-mech-text-secondary","tw-m-0","tw-mb-2"],["class","tw-list-decimal tw-pl-4 tw-m-0 tw-mb-2 tw-flex tw-flex-col tw-gap-1",4,"ngIf"],["type","button","class","mech-btn-primary tw-text-sm tw-mb-2",3,"click",4,"ngIf"],["open","",1,"tw-mt-1"],[1,"tw-text-xs","tw-text-mech-text-faint","tw-cursor-pointer","hover:tw-underline"],[1,"tw-text-xs","tw-text-mech-text-faint","tw-mt-1","tw-mb-0","tw-break-words"],[1,"tw-list-decimal","tw-pl-4","tw-m-0","tw-mb-2","tw-flex","tw-flex-col","tw-gap-1"],["class","tw-text-sm tw-text-mech-text-secondary",4,"ngFor","ngForOf"],["type","button",1,"mech-btn-primary","tw-text-sm","tw-mb-2",3,"click"],[1,"tw-text-sm","tw-text-[var(--color-danger)]","tw-m-0"],[1,"tw-flex","tw-items-center","tw-justify-between","tw-gap-3","tw-p-4","tw-bg-mech-surface","tw-rounded-2xl","tw-border","tw-border-mech-border"],[1,"tw-flex","tw-items-center","tw-gap-3","tw-min-w-0"],[1,"tw-grid","tw-place-items-center","tw-w-10","tw-h-10","tw-rounded-full","tw-shrink-0",3,"ngClass"],["d","m7 7 10 10-5 5V2l5 5L7 17"],["class","tw-text-xs tw-text-mech-text-muted",4,"ngIf"],["class","tw-flex tw-items-center tw-gap-1.5 tw-text-xs tw-text-mech-text-muted",4,"ngIf"],["class","tw-flex tw-items-center tw-gap-1 tw-mt-0.5 tw-text-xs tw-text-[var(--color-warning)]",4,"ngIf"],["type","button",1,"mech-btn-primary","tw-shrink-0","tw-flex","tw-items-center","tw-gap-2",3,"click","disabled"],[1,"tw-flex","tw-items-center","tw-gap-1.5","tw-text-xs","tw-text-mech-text-muted"],[1,"tw-flex","tw-items-end","tw-gap-0.5"],["class","tw-w-1 tw-rounded-sm",3,"height","ngClass",4,"ngFor","ngForOf"],[1,"tw-w-1","tw-rounded-sm",3,"ngClass"],[1,"tw-flex","tw-items-center","tw-gap-1","tw-mt-0.5","tw-text-xs","tw-text-[var(--color-warning)]"],["aria-hidden","true","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"tw-w-3.5","tw-h-3.5","tw-shrink-0"]],template:function(n,l){n&1&&(r(0,"div",2),E(1,"app-obd-page-header",3),s(2,"translate"),s(3,"translate"),s(4,"async"),s(5,"async"),w(6,Ht,2,1,"div",4)(7,$t,7,6,"div",5)(8,zt,40,29,"ng-container",6)(9,ce,23,29,"ng-container",6)(10,Ce,5,4,"div",7),s(11,"async"),o(),w(12,ge,15,10,"ng-template",null,0,q)),n&2&&(i(),p("title",c(2,10,"V2.OBD.CONNECT.TITLE"))("subtitle",c(3,12,"V2.OBD.CONNECT.SUBTITLE"))("showStatus",!0)("status",c(4,14,l.status$)??"disconnected")("dongleName",c(5,16,l.dongleName$)),i(5),p("ngIf",l.showAdapterPicker),i(),p("ngIf",l.selectedKind==="classic"),i(),p("ngIf",l.selectedKind==="wifi"),i(),p("ngIf",l.selectedKind!=="wifi"),i(),p("ngIf",c(11,18,l.error$)))},dependencies:[dt,at,st,lt,ct,ht,xt,gt,Et,ut,Ct,Bt,pt,wt],encapsulation:2,changeDetection:0})}}return e})();export{Ge as ObdConnectComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.