1import{An as ie$1,C as Du,Er as vn,Fn as le$1,Jr as yu,Kr as yr,Kt as Y,Lr as x,N as FR,Nt as UR,Sn as g0,Sr as v0,St as Rw,Vn as mn,Vr as y0,Wr as yI,Xn as p0,_r as tx,br as up,i as $e,kt as TN,ln as bs,lt as Nx,r as $c,rt as Me,un as cI,w as E0,wn as gp,xn as g}from"./chunk-rWOw5BPY.js";import{t as e}from"./chunk-D4abpB0X.js";import"./chunk-Bx1Bq6tZ.js";import"./chunk-rnK5Rhfs.js";import{i as Dt,o as Gn,u as Wn,w as zn,x as qn,y as ln}from"./chunk-CcuzvkLP.js";import{r as U}from"./chunk-ChgIncMG.js";import{m as V,p as Q$1,t as E}from"./main-BAANFH2X.js";import{t as O}from"./chunk-BbE0BJn4.js";import"./chunk-7DABv4q4.js";import"./chunk-BZJ3OeJX.js";import"./chunk-CnZsUeSi.js";import"./chunk-CkvSaYGB.js";import{t as A}from"./chunk-Bzk-2Ew1.js";import{t as D}from"./chunk-CpirlhCq2.js";import{t as w}from"./chunk-750HhT2h.js";var K=(r,e)=>e.Name;var W=(r,e)=>e.Version;var X=(r,e)=>e.Config;function ee(r,e){if(r&1&&($c(0,`option`,9),Nx(1),gp()),r&2){let t=e.$implicit;Rw(`ngValue`,t.Name),TN(),yI(t.Name)}}function te(r,e){if(r&1&&($c(0,`option`,9),Nx(1),gp()),r&2){let t=e.$implicit;Rw(`ngValue`,t.Name),TN(),yI(t.Name)}}function ie(r,e){if(r&1&&($c(0,`option`,9),Nx(1),gp()),r&2){let t=e.$implicit;Rw(`ngValue`,t.Version),TN(),yI(t.Version)}}function re(r,e){if(r&1&&($c(0,`option`,9),Nx(1),gp()),r&2){let t=e.$implicit;Rw(`ngValue`,t),TN(),yI(t)}}function ne(r,e){if(r&1&&($c(0,`tr`,25)(1,`th`,26),Nx(2,`Device ID`),gp(),$c(3,`td`)(4,`strong`),Nx(5),gp()()()),r&2){let t=tx(3);TN(5),yI(t.deviceId())}}function ae(r,e){if(r&1&&($c(0,`tr`)(1,`th`,26),Nx(2,`Peripheral ID`),gp(),$c(3,`td`)(4,`strong`),Nx(5),gp()()()),r&2){let t=tx(3);TN(5),yI(t.peripheralId())}}function oe(r,e){if(r&1&&($c(0,`div`,22)(1,`table`,24)(2,`tbody`),p0(3,ne,6,1,`tr`,25),p0(4,ae,6,1,`tr`),gp()()()),r&2){let t=tx(2);TN(3),g0(t.deviceId()!==null?3:-1),TN(),g0(t.peripheralId()!==null?4:-1)}}function le(r,e){if(r&1&&($c(0,`tr`)(1,`td`),Nx(2),gp(),$c(3,`td`),Nx(4),gp()()),r&2){let t=e.$implicit,i=e.$index;cI(`grey-row`,i%2!==0),TN(2),yI(t.Config),TN(2),yI(t.DefaultValue)}}function se(r,e){if(r&1&&($c(0,`div`,23)(1,`table`,27)(2,`thead`)(3,`tr`)(4,`th`)(5,`strong`),Nx(6,`Setting`),gp()(),$c(7,`th`)(8,`strong`),Nx(9,`Value`),gp()()()(),$c(10,`tbody`),y0(11,le,5,4,`tr`,28,X),gp()()()),r&2){let t=tx(2);TN(11),E0(t.configs())}}function ce(r,e){r&1&&($c(0,`div`,20)(1,`div`,29),yu(2,`app-icon`,30),$c(3,`span`),Nx(4),gp()()()),r&2&&(TN(2),Rw(`custom`,!0)(`ariaHidden`,!0),TN(2),yI(e))}function de(r,e){if(r&1&&($c(0,`div`,19),p0(1,oe,5,2,`div`,22),p0(2,se,13,0,`div`,23)(3,ce,5,3,`div`,20),gp()),r&2){let t,i=tx();TN(),g0(i.deviceId()!==null||i.peripheralId()!==null?1:-1),TN(),g0(i.configs().length>0?2:(t=i.configsNotice())?3:-1,t)}}var Q=class r{seo=g(E);route=g(mn);router=g(vn);firmwareApi=g(D);protocolApi=g(w);logger=g(e);destroyRef=g(Me);allDevices=ie$1([]);devices=ie$1([]);selectedDeviceName=ie$1(``);deviceSearchTerm=ie$1(``);allPeripherals=ie$1([]);peripherals=ie$1([]);selectedPeripheralName=ie$1(``);peripheralSearchTerm=ie$1(``);peripheralDisabled=ie$1(!1);allFirmwares=ie$1([]);firmwares=ie$1([]);selectedFirmware=ie$1(``);firmwareSearchTerm=ie$1(``);allProtocols=ie$1([]);protocols=ie$1([]);selectedProtocol=ie$1(``);protocolSearchTerm=ie$1(``);configs=ie$1([]);deviceId=ie$1(null);peripheralId=ie$1(null);configsStatus=ie$1(`idle`);configsNotice=bs(()=>{if(this.configs().length>0)return``;switch(this.configsStatus()){case`loaded`:return`No default settings are available for ${this.selectedProtocol()} on this device.`;case`error`:return`Default settings for ${this.selectedProtocol()} could not be loaded. Please try again shortly.`;default:return``}});isPrivate=!1;deviceNameParam=null;peripheralNameParam=null;firmwareParam=null;protocolParam=null;ngOnInit(){this.route.queryParamMap.pipe(U(this.destroyRef)).subscribe(t=>{let i=!!t.get(`device`)||!!t.get(`peripheral`)||!!t.get(`version`)||!!t.get(`protocol`);this.seo.setSeo({title:`Device Settings`,description:`Search the ID and default settings of your device or peripheral by selecting the name of your device or peripheral, the firmware version and protocol used.`,robots:i?`none`:`index, follow`})});
1let e=this.route.snapshot.queryParamMap;this.isPrivate=!!e.get(`private`),this.deviceNameParam=e.get(`device`),this.peripheralNameParam=e.get(`peripheral`),this.firmwareParam=e.get(`version`),this.protocolParam=e.get(`protocol`),this.firmwareApi.getDevices(this.isPrivate).subscribe({next:t=>{this.allDevices.set(t),this.devices.set([...t]),this.deviceNameParam&&(this.selectedDeviceName.set(this.deviceNameParam),this.onDeviceChange())},error:t=>this.logger.error(`Failed to load devices`,t,`DeviceSettings`)})}onDeviceChange(){this.loadPeripherals().pipe($e(()=>this.loadFirmwares()),$e(()=>this.loadProtocols()),$e(()=>this.loadConfigs()),yr(e=>(this.logger.error(`Device change pipeline failed`,e,`DeviceSettings`),le$1))).subscribe()}onPeripheralChange(){this.loadFirmwares().pipe($e(()=>this.loadProtocols()),$e(()=>this.loadConfigs()),yr(e=>(this.logger.error(`Peripheral change pipeline failed`,e,`DeviceSettings`),le$1))).subscribe()}onFirmwareChange(){this.loadProtocols().pipe($e(()=>this.loadConfigs()),yr(e=>(this.logger.error(`Firmware change pipeline failed`,e,`DeviceSettings`),le$1))).subscribe()}onProtocolChange(){this.loadConfigs().subscribe()}filterDevices(e){if(this.deviceSearchTerm.set(e),!e)this.devices.set([...this.allDevices()]);else{let t=new RegExp(e,`i`);this.devices.set(this.allDevices().filter(i=>t.test(i.Name)))}this.devices().length===1&&this.selectedDeviceName.set(this.devices()[0].Name)}filterPeripherals(e){if(this.peripheralSearchTerm.set(e),!e)this.peripherals.set([...this.allPeripherals()]);else{let t=new RegExp(e,`i`);this.peripherals.set(this.allPeripherals().filter(i=>t.test(i.Name)))}this.peripherals().length===1&&this.selectedPeripheralName.set(this.peripherals()[0].Name)}filterFirmwares(e){if(this.firmwareSearchTerm.set(e),!e)this.firmwares.set([...this.allFirmwares()]);else{let t=new RegExp(e,`i`);this.firmwares.set(this.allFirmwares().filter(i=>t.test(i.Version)))}this.firmwares().length===1&&this.selectedFirmware.set(this.firmwares()[0].Version)}filterProtocols(e){if(this.protocolSearchTerm.set(e),!e)this.protocols.set([...this.allProtocols()]);else{let t=new RegExp(e,`i`);this.protocols.set(this.allProtocols().filter(i=>t.test(i)))}this.protocols().length===1&&this.selectedProtocol.set(this.protocols()[0])}reset(){this.selectedDeviceName.set(``),this.selectedPeripheralName.set(``),this.selectedFirmware.set(``),this.selectedProtocol.set(``),this.deviceSearchTerm.set(``),this.peripheralSearchTerm.set(``),this.firmwareSearchTerm.set(``),this.protocolSearchTerm.set(``),this.devices.set([...this.allDevices()]),this.allPeripherals.set([]),this.peripherals.set([]),this.allFirmwares.set([]),this.firmwares.set([]),this.allProtocols.set([]),this.protocols.set([]),this.peripheralDisabled.set(!1),this.clearResults(`idle`),this.router.navigate([],{relativeTo:this.route,queryParams:{},replaceUrl:!0})}loadPeripherals(){return this.firmwareApi.getPeripherals(this.isPrivate,this.selectedDeviceName()).pipe(Y(e=>{e.length>0?(this.allPeripherals.set(e),this.peripherals.set([...e]),this.selectedPeripheralName.set(this.peripheralNameParam??e[0].Name),this.peripheralDisabled.set(!1)):(this.allPeripherals.set([]),this.peripherals.set([{Name:`N/A`}]),this.selectedPeripheralName.set(`N/A`),this.peripheralDisabled.set(!0)),this.peripheralNameParam=null}))}loadFirmwares(){return this.firmwareApi.getFirmware(this.isPrivate,this.selectedDeviceName(),this.selectedPeripheralName()).pipe(Y(e=>{this.allFirmwares.set(e),this.firmwares.set([...e]),this.selectedFirmware.set(this.firmwareParam??(e.length>0?e[0].Version:``)),this.firmwareParam=null}))}loadProtocols(){return this.selectedFirmware()?this.protocolApi.getProtocol(this.isPrivate,this.selectedDeviceName(),this.selectedPeripheralName(),this.selectedFirmware()).pipe(Y(e=>{let t=e.map(i=>i.Protocol);this.allProtocols.set(t),this.protocols.set([...t]),this.selectedProtocol.set(this.protocolParam??(t.length>0?t[0]:``)),this.protocolParam=null})):x(void 0)}loadConfigs(){return this.selectedProtocol()?(this.configsStatus.set(`loading`),this.protocolApi.getConfigs(this.isPrivate,this.selectedDeviceName(),this.selectedPeripheralName(),this.selectedFirmware(),this.selectedProtocol()).pipe(Y(e=>{this.deviceId.set(null),this.peripheralId.set(null);let t=e.filter(i=>(i.DeviceId!==void 0&&this.deviceId.set(i.DeviceId),i.PeripheralId!==void 0&&this.peripheralId.set(i.PeripheralId),i.Config!==void 0));this.configs.set(t),this.configsStatus.set(`loaded`),this.updateUrl()}),yr(e=>(this.logger.error(`Failed to load configs`,e,`DeviceSettings`),this.clearResults(`error`),this.updateUrl(),x(void 0))))):(this.clearResults(`idle`),x(void 0))}clearResults(e){this.configs.set([]),this.deviceId.set(null),this.peripheralId.set(null),this.configsStatus.set(e)}updateUrl(){this.router.navigate([],{relativeTo:this.route,queryParams:{private:this.isPrivate?`1`:null,device:this.selectedDeviceName()||null,peripheral:this.selectedPeripheralName()||null,version:this.selectedFirmware()||null,protocol:this.selectedProtocol()||null},replaceUrl:!0})}static ɵfac=function(t){return new(t||r)};
1static ɵcmp=up({type:r,selectors:[[`app-device-settings`]],decls:43,vars:11,consts:[[1,`container-fluid`],[`title`,`Default Settings Lookup`],[1,`subtitle`],[1,`row`,`pt-4`,`selector-row`],[1,`col-md-3`,`col-sm-6`,`col-12`],[`for`,`deviceSearch`],[`ariaLabel`,`Search devices by name`,1,`mb-2`,`d-block`,3,`valueChange`,`value`],[1,`select-wrapper`],[`size`,`15`,`aria-label`,`Select device`,1,`form-control`,3,`ngModelChange`,`click`,`ngModel`],[3,`ngValue`],[`for`,`peripheralSearch`],[`ariaLabel`,`Search peripherals by name`,1,`mb-2`,`d-block`,3,`valueChange`,`value`,`disabled`],[`size`,`15`,`aria-label`,`Select peripheral`,1,`form-control`,3,`ngModelChange`,`change`,`ngModel`,`disabled`],[`for`,`firmwareSearch`],[`ariaLabel`,`Search firmware versions`,1,`mb-2`,`d-block`,3,`valueChange`,`value`],[`size`,`15`,`aria-label`,`Select firmware version`,1,`form-control`,3,`ngModelChange`,`change`,`ngModel`],[`for`,`protocolSearch`],[`ariaLabel`,`Search protocols`,1,`mb-2`,`d-block`,3,`valueChange`,`value`],[`size`,`15`,`aria-label`,`Select protocol`,1,`form-control`,3,`ngModelChange`,`change`,`ngModel`],[1,`row`,`mt-4`],[1,`col-12`],[`type`,`button`,1,`btn`,`btn-zaber`,`float-end`,`px-4`,3,`click`],[1,`col-sm-6`,`table-responsive`,`mb-3`],[1,`col-12`,`table-responsive`],[1,`results-table`],[1,`grey-row`],[`scope`,`row`,1,`w-75`],[`aria-label`,`Device configuration settings`,1,`results-table`],[3,`grey-row`],[`role`,`alert`,1,`alert`,`alert-warning`,`mb-0`,`d-flex`,`align-items-center`,`gap-2`],[`name`,`triangle-exclamation`,`width`,`1rem`,`height`,`1rem`,2,`--icon-path-fill`,`var(--color-orange)`,3,`custom`,`ariaHidden`]],template:function(t,i){t&1&&($c(0,`div`,0),yu(1,`app-page-header`,1),$c(2,`p`,2),Nx(3,`Find the original settings for your Zaber devices.`),gp(),$c(4,`div`,3)(5,`div`,4)(6,`label`,5),Nx(7,`Device Name`),gp(),$c(8,`app-search-input`,6),Du(`valueChange`,function(c){return i.filterDevices(c)}),gp(),$c(9,`div`,7)(10,`select`,8),Du(`ngModelChange`,function(c){return i.selectedDeviceName.set(c)})(`click`,function(){return i.onDeviceChange()}),y0(11,ee,2,2,`option`,9,K),gp(),FR(),gp()(),$c(13,`div`,4)(14,`label`,10),Nx(15,`Peripheral Name`),gp(),$c(16,`app-search-input`,11),Du(`valueChange`,function(c){return i.filterPeripherals(c)}),gp(),$c(17,`div`,7)(18,`select`,12),Du(`ngModelChange`,function(c){return i.selectedPeripheralName.set(c)})(`change`,function(){return i.onPeripheralChange()}),y0(19,te,2,2,`option`,9,K),gp(),FR(),gp()(),$c(21,`div`,4)(22,`label`,13),Nx(23,`Firmware Version`),gp(),$c(24,`app-search-input`,14),Du(`valueChange`,function(c){return i.filterFirmwares(c)}),gp(),$c(25,`div`,7)(26,`select`,15),Du(`ngModelChange`,function(c){return i.selectedFirmware.set(c)})(`change`,function(){return i.onFirmwareChange()}),y0(27,ie,2,2,`option`,9,W),gp(),FR(),gp()(),$c(29,`div`,4)(30,`label`,16),Nx(31,`Protocol`),gp(),$c(32,`app-search-input`,17),Du(`valueChange`,function(c){return i.filterProtocols(c)}),gp(),$c(33,`div`,7)(34,`select`,18),Du(`ngModelChange`,function(c){return i.selectedProtocol.set(c)})(`change`,function(){return i.onProtocolChange()}),y0(35,re,2,2,`option`,9,v0),gp(),FR(),gp()()(),$c(37,`div`,19)(38,`div`,20)(39,`button`,21),Du(`click`,function(){return i.reset()}),Nx(40,`Reset Selections`),gp()()(),p0(41,de,4,2,`div`,19),yu(42,`app-ask-engineer-bar`),gp()),t&2&&(TN(8),Rw(`value`,i.deviceSearchTerm()),TN(2),Rw(`ngModel`,i.selectedDeviceName()),UR(),TN(),E0(i.devices()),TN(5),Rw(`value`,i.peripheralSearchTerm())(`disabled`,i.peripheralDisabled()),TN(2),Rw(`ngModel`,i.selectedPeripheralName())(`disabled`,i.peripheralDisabled()),UR(),TN(),E0(i.peripherals()),TN(5),Rw(`value`,i.firmwareSearchTerm()),TN(2),Rw(`ngModel`,i.selectedFirmware()),UR(),TN(),E0(i.firmwares()),TN(5),Rw(`value`,i.protocolSearchTerm()),TN(2),Rw(`ngModel`,i.selectedProtocol()),UR(),TN(),E0(i.protocols()),TN(6),g0(i.configsStatus()!==`idle`?41:-1))},dependencies:[zn,Wn,qn,Dt,Gn,ln,A,Q$1,O,V],styles:[`[_nghost-%COMP%]{display:block}.subtitle[_ngcontent-%COMP%]{font-size:1.125rem;color:var(--%NS%text-primary)}.selector-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:1rem;margin-bottom:.25rem;margin-left:.25rem;font-weight:var(--%NS%font-weight-bold);color:var(--%NS%text-primary)}.select-wrapper[_ngcontent-%COMP%]{padding:.125rem;border:1px solid var(--%NS%border-color);border-radius:.5rem}.select-wrapper[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{border:none!important;height:21.875rem!important;background-color:var(--%NS%color-off-white);color:var(--%NS%text-primary)}.select-wrapper[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{padding:.125rem 0}.results-table[_ngcontent-%COMP%]{font-size:1rem;color:var(--%NS%text-primary);width:100%}.results-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{background-color:var(--%NS%bg-secondary)}.results-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:50%}.results-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .results-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:.75rem}.results-table[_ngcontent-%COMP%] .grey-row[_ngcontent-%COMP%]{background-color:var(--%NS%bg-secondary)}`],changeDetection:1})};export{Q as DeviceSettingsComponent};
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.