1(self.webpackChunkapp=self.webpackChunkapp||[]).push([["projects_iotize-ionic_src_public-api_ts-_0dfc0","projects_iotize-ionic_src_public-api_ts-_0dfc1"],{28556:(Ce,he,a)=>{a.d(he,{Ts:()=>ce,mw:()=>Re,pr:()=>I,rj:()=>Y});var p=a(78172),P=a(59689),u=a(70282),m=a(40482),w=a(54536),Z=a(15730),ie=a(87435);a(53876),a(60572);class K extends w.CodeError{static invalidErrorResult(N){return new K("Internal error: ble cordova plugin returned an unexpected error object",K.Code.InternalError)}static invalidErrorCode(N){return new K(`Internal error: ble cordova plugin returned an invalid error code ${N.code} with message ${N.message}`,K.Code.InternalError)}static invalidNativeCallResult(N,G){return new K(`Internal error: native call returned an invalid data type. ${G.message}`,K.Code.InternalError)}static isValidErrorCode(N){return N in K.Code}static iotizeBLEMissing(){return new K("iotizeBLE global variable does not exist. Are you sure app is running inside a Cordova application ?",K.Code.InternalError)}}!function(ge){let N;var G;(G=N=ge.Code||(ge.Code={})).InternalError="CordovaBLEErrorInternalError",G.IllegalArgument="CordovaBLEErrorIllegalArgument",G.BLENotAvailable="CordovaBLEErrorBLENotAvailable",G.InvalidMacAddress="InvalidMacAddressInvalidMacAddress",G.ConnectionError="CordovaBLEErrorConnectionError",G.RequestError="CordovaBLEErrorRequestError",G.LocationServiceDisabled="CordovaBLEErrorLocationServiceDisabled",G.DisconnectError="CordovaBLEErrorDisconnectError",G.IllegalAction="CordovaBLEErrorIllegalAction",G.NotConnectedError="CordovaBLEErrorNotConnectedError",G.StatusCodeError="CordovaBLEErrorStatusCodeError"}(K||(K={}));const se=(0,Z.createDebugger)("@iotize/device-com-ble.cordova");function Y(){if("object"!=typeof iotizeBLE)throw K.iotizeBLEMissing();return iotizeBLE}function ce(ge){const N=[];for(let G=0;G<ge.length;G++){let i=ge[G];if(0==i)break;let T=ge[G+1];N.push({type:T,data:ge.slice(G+2,G+i+1)}),G+=i}return N}var A=function(ge,N,G,i){return new(G||(G=Promise))(function(E,h){function k(ae){try{ue(i.next(ae))}catch(_e){h(_e)}}function _(ae){try{ue(i.throw(ae))}catch(_e){h(_e)}}function ue(ae){ae.done?E(ae.value):function T(E){return E instanceof G?E:new G(function(h){h(E)})}(ae.value).then(k,_)}ue((i=i.apply(ge,N||[])).next())})};class I extends P.B{constructor(N,G,i){super(),this.deviceId=N,this.cordovaInterfaceOverwrite=i,G?this.options=G:this.options.connect.timeout=6e4}get pluginInterface(){return this.cordovaInterfaceOverwrite||Y()}_connect(N){return se("_connect",N),this.pluginInterface.connectAndDiscoverTapServices(this.deviceId).pipe((0,m.tap)(G=>{this.setConnectionState(G)}),(0,m.filter)(G=>G===p.K.CONNECTED),(0,m.first)())}_disconnect(N){return se("_disconnect",N),(0,u.defer)(()=>this.pluginInterface.disConnect(this.deviceId))}write(N){return A(this,void 0,void 0,function*(){throw new Error("Method not implemented.")})}read(){return A(this,void 0,void 0,function*(){throw new Error("Method not implemented.")})}send(N,G){return(0,u.defer)(()=>this.pluginInterface.send(this.deviceId,N)).pipe((0,m.catchError)(i=>{var T;return(null===(T=i)||void 0===T?void 0:T.code)===K.Code.NotConnectedError&&this.setConnectionState(p.K.DISCONNECTED),(0,u.throwError)(i)}))}}var Pe=function(ge,N,G,i){return new(G||(G=Promise))(function(E,h){function k(ae){try{ue(i.next(ae))}catch(_e){h(_e)}}function _(ae){try{ue(i.throw(ae))}catch(_e){h(_e)}}function ue(ae){ae.done?E(ae.value):function T(E){return E instanceof G?E:new G(function(h){h(E)})}(ae.value).then(k,_)}ue((i=i.apply(ge,N||[])).next())})};class Re{constructor(N,G){this.cordovaInterfaceOverwrite=N,this.requestDeviceOptions=G,this._results=new u.BehaviorSubject([]),this._scanning$=new u.BehaviorSubject(!1)}get cordovaInterface(){return this.cordovaInterfaceOverwrite||Y()}get scanning(){return this._scanning$.asObservable()}get isScanning(){return this._scanning$.value}get results(){return this._results.asObservable()}start(N){var G;return Pe(this,void 0,void 0,function*(){if(null===(G=this.scanSubscription)||void 0===G||G.unsubscribe(),this.scanSubscription=void 0,this.clearResults(),!(yield this.checkAvailable()))throw ie.lP.bleNotAvailable("BLE is not available. Make sure that BLE is enabled on your device");return se("Start Scanning ..."),this._scanning$.next(!0),new Promise((T,E)=>{this.scanSubscription=this.cordovaInterface.startScan(this.requestDeviceOptions).subscribe(h=>{"Ok"!=h?this.addOrRefreshDevice(h):T()},h=>{se("Start scan failed with error: ",h),this.cordovaInterface.getLastError().then(k=>
1{se("Last BLE error "+k)}).catch(k=>{se("Cannot get last BLE error: ",k)}),E(h),this._scanning$.next(!1)})})})}stop(){var N;return Pe(this,void 0,void 0,function*(){se("Stop Scanning ...");try{return null===(N=this.scanSubscription)||void 0===N||N.unsubscribe(),this.scanSubscription=void 0,yield this.cordovaInterface.stopScan(),void this._scanning$.next(!1)}catch(G){throw this._scanning$.next(!1),G}})}checkAvailable(){return this.cordovaInterface.checkAvailable()}get devices(){return this._results.value}clearResults(){this._results.next([])}addOrRefreshDevice(N){let G=this.devices.findIndex(i=>i.address==N.address);if(G>=0){let i=this.devices[G];(i.name!=N.name||i.rssi!=N.rssi)&&(se(`Updating device at index ${G}, name=${i.name} with rssi=${i.rssi}`),this.devices[G]=N,this._results.next(this.devices))}else se(`Adding new device name=${N.name} with rssi=${N.rssi}`),this.devices.push(N),this._results.next(this.devices)}}},75076:(Ce,he,a)=>{a.d(he,{Bs:()=>se,GJ:()=>L,NZ:()=>fe,UL:()=>W,Uz:()=>Y,hl:()=>ge,oB:()=>ne,rY:()=>V});var ie,i,fe,p=a(67173),u=a(53876),m=a(78172),b=a(59689),w=a(70282),Z=a(15730);(i=ie||(ie={}))[i.IN_RANGE_READY=0]="IN_RANGE_READY",i[i.IN_RANGE_BUT_LEFT_FIELD=1]="IN_RANGE_BUT_LEFT_FIELD",i[i.NOT_IN_RANGE=2]="NOT_IN_RANGE";class W extends Error{constructor(T,E){super(E),this.code=T}static tagLostError(){return new W(W.ErrorCode.TagLostError,"NFC tag lost")}static notConnectedError(){return new W(W.ErrorCode.NotConnectedError,"NFC tag is not connected")}static unknownError(T){throw new W(W.ErrorCode.Unknown,T)}static tagConnectionFailed(){throw new W(W.ErrorCode.NotConnectedError,"Tag connection failed")}static internalError(T){throw new W(W.ErrorCode.InternalError,T)}}!function(i){let T;var E;(E=T=i.ErrorCode||(i.ErrorCode={})).Unknown="NfcUnknownError",E.InternalError="NfcInternalError",E.TagLostError="NfcTagLostError",E.NotConnectedError="NfcNotConnectedError"}(W||(W={})),function(i){i[i.EMPTY=0]="EMPTY",i[i.WELL_KNOWN_TYPE=1]="WELL_KNOWN_TYPE",i[i.MIME_TYPE=2]="MIME_TYPE",i[i.ABSOLUTE_URI=3]="ABSOLUTE_URI",i[i.EXTERNAL=4]="EXTERNAL",i[i.UNKNOWN=5]="UNKNOWN",i[i.UNCHANGED=6]="UNCHANGED",i[i.RFU=7]="RFU"}(fe||(fe={}));const ne={URI:[85],TEXT:[84],SMPART_POSTER:[83,112]};function F(i){return i.length>0&&0===i[0]&&(i=i.slice(1)),(0,u.bufferToAsciiString)(i)}function K(i,T){return i.length===T.length&&i.every((E,h)=>E===T[h])}function se(i){return(i||[]).map(Y)}function Y(i){switch(i.tnf){case fe.ABSOLUTE_URI:return{id:i.id,type:i.type,tnf:"uri",value:F(i.payload)};case fe.WELL_KNOWN_TYPE:return{id:i.id,type:i.type,tnf:"wkt",value:ce(i)};case fe.EMPTY:return{id:i.id,type:i.type,tnf:"empty",value:{type:i.type,payload:i.payload}};case fe.EXTERNAL:return{id:i.id,type:i.type,tnf:"external",value:A(i)};case fe.MIME_TYPE:return{id:i.id,type:i.type,tnf:"mimetype",value:Q(i)};case fe.RFU:return{id:i.id,type:i.type,tnf:"rfu",value:{type:i.type,payload:i.payload}};case fe.UNCHANGED:return{id:i.id,type:i.type,tnf:"unchanged",value:{type:i.type,payload:i.payload}};case fe.UNKNOWN:return{id:i.id,type:i.type,tnf:"unknown",value:{type:i.type,payload:i.payload}};default:return{id:i.id,type:i.type,tnf:i.tnf,value:{type:i.type,payload:i.payload}}}}function ce(i){if(K(i.type.slice(),ne.URI)){const T=i.payload[0];return{type:"uri",value:(I[T]||"")+F(i.payload.slice(1))}}if(K(i.type.slice(),ne.TEXT)){const T=i.payload[0];let E="utf8",h=0;"number"==typeof T&&(E=128&T?"utf16le":"utf8",h=63&T);const k=i.payload.slice(h+1),_=i.payload.slice(8,h+1);return{type:"text",value:p.Buffer.from(k).toString(E),encoding:E,language:p.Buffer.from(_).toString(E)}}return{type:"unknown",value:{type:i.type.slice(),payload:i.payload}}}function A(i){const T=p.Buffer.from(i.payload).toString("utf8");return{domain:p.Buffer.from(i.type).toString("utf8"),value:T}}const I={0:"",1:"http://www.",2:"http://www.",3:"http://",4:"https://",5:"tel:",6:"mailto:",7:"ftp://anonymous:anonymous@",29:"file://",8:"ftp://ftp.",9:"ftps://",10:"sftp://",11:"smb://",12:"nfs://",13:"ftp://",14:"dav://",15:"news:",16:"telnet://",17:"imap:",18:"rtsp://",19:"urn:",20:"pop:",21:"sip:",22:"sips:",23:"tftp:",24:"btspp://",25:"btl2cap://",26:"btgoep://",27:"tcpobex://",28:"irdaobex://",30:"urn:epc:id:",31:"urn:epc:tag:",32:"urn:epc:pat:",33:"urn:epc:raw:",34:"urn:epc:"};function Q(i){return p.Buffer.from(i.payload).toString("utf8")}function ee(i){if("uri"==i.value.type){const T=Object.entries(I);let E=0;for(const[_,ue]of T)if("0x0"!=_&&i.value.value.startsWith(ue)){E=parseInt(_,16);break}const h=I[E].length,k=i.value.value.slice(h);return[E,...(0,u.asciiStringToByteBuffer)(k)]}if("text"===i.value.type){let T="utf16le"==i.value.encoding?128:0;T&=63&i.value.language;return[T,...p.Buffer.from(i.value.language,i.value.encoding),...p.Buffer.from(i.value.value,i.value.encoding)]}return[...i.value.type,...i.value.payload]}function g(i){return Array.from(p.Buffer.from(i.value.value,"utf8"))}function f(i){return Array.from(p.Buffer.from(i.value,"utf8"))}function L(i){return(i||[]).map(Pe)}function Pe(i){switch(i.tnf){case"uri":return{id:i.id,type:i.type,tnf:fe.ABSOLUTE_URI,payload:Array.from((0,u.asciiStringToByteBuffer)(i.value))};case"wkt":return{id:i.id,type:i.type,tnf:fe.WELL_KNOWN_TYPE,payload:ee(i)};case"empty":return{id:i.id,type:i.type,tnf:fe.EMPTY,payload:i.payload};case"external":return{id:i.id,type:i.type,tnf:fe.EXTERNAL,payload:g(i)};case"mimetype":return{id:i.id,type:i.type,tnf:fe.MIME_TYPE,payload:f(i)};case"rfu":return{id:i.id,type:i.type,tnf:fe.RFU,payload:i.payload};case"unchanged":return{id:i.id,type:i.type,tnf:fe.UNCHANGED,payload:i.payload};case"unknown":return{id:i.id,type:i.type,tnf:fe.UNKNOWN,payload:i.payload};default:return{id:i.id,type:i.type,tnf:Number(i.tnf),payload:i.payload}}}const Re=(0,Z.createDebugger)("@iotize/device-com-nfc.cordova");
1var N,Ee=function(i,T,E,h){return new(E||(E=Promise))(function(_,ue){function ae(S){try{Te(h.next(S))}catch(v){ue(v)}}function _e(S){try{Te(h.throw(S))}catch(v){ue(v)}}function Te(S){S.done?_(S.value):function k(_){return _ instanceof E?_:new E(function(ue){ue(_)})}(S.value).then(ae,_e)}Te((h=h.apply(i,T||[])).next())})};class c{constructor(){this.queue=Promise.resolve(!0)}add(T){return new Promise((E,h)=>{this.queue=this.queue.then(T).then(E).catch(h)})}}class V extends b.B{constructor(T={connect:{timeout:2e3},disconnect:{timeout:1e3},send:{timeout:1e3}}){super(),this._sendQueue=new c,this.options=T,null==typeof nfc&&console.warn("NFC plugin has not been setup properly. Global variable NFC does not exist")}static iOSProtocol(){return new V({connect:{timeout:1e4},disconnect:{timeout:1e3},send:{timeout:1e3}})}connect(T){return this.connectionState===m.K.CONNECTED?(0,w.defer)(()=>Ee(this,void 0,void 0,function*(){try{return yield nfc.checkTapConnection(this.options.connect.timeout)}catch(E){throw this.setConnectionState(m.K.DISCONNECTED),E}})).pipe((0,w.switchMap)(E=>{switch(E){case ie.IN_RANGE_READY:return(0,w.of)(void 0);case ie.IN_RANGE_BUT_LEFT_FIELD:return this.setConnectionState(m.K.CONNECTING),super.connect(T);case ie.NOT_IN_RANGE:default:return this.setConnectionState(m.K.DISCONNECTED),(0,w.throwError)(()=>W.tagLostError())}})):super.connect(T)}_connect(T){return(0,w.defer)(()=>Ee(this,void 0,void 0,function*(){Re("_connect",T);try{yield nfc.connect("android.nfc.tech.NfcV",this.options.connect.timeout)}catch(E){throw"string"==typeof E?"Tag connection failed"===E?W.tagConnectionFailed():W.unknownError(E):E}}))}_disconnect(T){return(0,w.defer)(()=>Ee(this,void 0,void 0,function*(){yield nfc.close(),this._sendQueue=new c}))}write(T){return Ee(this,void 0,void 0,function*(){throw new Error("Method not implemented.")})}read(){return Ee(this,void 0,void 0,function*(){throw new Error("Method not implemented.")})}send(T,E){return(0,w.defer)(()=>Ee(this,void 0,void 0,function*(){return yield this._sendQueue.add(()=>Ee(this,void 0,void 0,function*(){try{const h=yield nfc.transceiveTap((0,u.bufferToHexString)(T));if("string"!=typeof h)throw W.internalError("Internal error. Plugin should respond a hexadecimal string");return Re("NFC plugin response: ",h),(0,u.hexStringToBuffer)(h)}catch(h){if("string"==typeof h){const k=function H(i){const T=i.toLowerCase();return T.indexOf("tag was lost")>=0?W.tagLostError():T.indexOf("not connected")>=0?W.notConnectedError():W.unknownError(i)}(h);throw(k.code===W.ErrorCode.NotConnectedError||k.code===W.ErrorCode.TagLostError)&&this._onConnectionLost(k),k}throw h}}))}))}_onConnectionLost(T){this.connectionState!==m.K.DISCONNECTED&&this.setConnectionState(m.K.DISCONNECTED)}}function ge(i){let T={};if(i.length>=1){let E=i[0].payload;T.uri=F(E)}if(i.length>=2&&(T.aar=F(i[1].payload)),i.length>=3){let E=i[2].payload,h=E[0],k=E.slice(1);switch(T.type=h,h){case N.BLE:T.macAddress=function G(i){return i.map(T=>{T<0&&(T+=256);let E="0"+T.toString(16).toUpperCase();return E=E.slice(-2),E}).reverse().join(":")}(k);break;case N.WiFi:T.ssid=F(k)}}return i.length>=4&&(T.name=F(i[3].payload)),T}!function(i){i[i.WiFi=32]="WiFi",i[i.BLE=64]="BLE"}(N||(N={}))},83355:(Ce,he,a)=>{a.r(he),a.d(he,{ApduResponse:()=>P,ResultCode:()=>p,TAP_REQUEST_FRAME_HEADER_LENGTH:()=>m,TapApduRequest:()=>u,TapRequestFrame:()=>z});class p{}var P,u,z;p.OK=0,p.CREATED=65,p.DELETED=66,p.CHANGED=68,p.CONTENT=69,p.BUSY=70,p.BAD_REQUEST=128,p.UNAUTHORIZED=129,p.NOT_FOUND=132,p.METHOD_NOT_ALLOWED=133,p.NOT_ACCEPTABLE=134,p.RESOURCE_LOCKED=135,p.INTERNAL_SERVER_ERROR=160,p.NOT_IMPLEMENTED=161,p.SERVICE_UNAVAILABLE=163,p.NVM_ERROR=164,p.UNABLE_TO_CONNECT_TO_TARGET=165,p.TARGET_POWER_FAILURE=166,p.NVM_FULL=167,p.DEVICE_UNAVAILABLE=168,p.RESPONSE_TOO_LARGE=169,p.TARGET_PROTOCOL_ERROR=176,p.TARGET_PROTOCOL_BUSY=177,p.TARGET_PROTOCOL_REAL=178,p.TARGET_PROTOCOL_WRONG_PARAM=179,p.TARGET_PROTOCOL_FORBIDDEN=180,p.TARGET_PROTOCOL_DATA=181,p.TARGET_PROTOCOL_COM=182,p.TARGET_PROTOCOL_LOST_COM=183,p.TARGET_PROTOCOL_PARAM=184,p.TARGET_PROTOCOL_INT=185,p.TARGET_PROTOCOL_ABORT=186,p.TARGET_PROTOCOL_NOT_IMPLEMENT
1ED=187,function(b){let w;var y;(y=w=b.Status||(b.Status={}))[y.OK=36864]="OK"}(P||(P={})),function(b){let w;var Z;let y;(Z=w=b.MethodType||(b.MethodType={}))[Z.GET=202]="GET",Z[Z.PUT_OR_POST=218]="PUT_OR_POST",function(Z){Z[Z.CLA=162]="CLA"}(y=b.Default||(b.Default={}))}(u||(u={})),function(b){let w;var y;(y=w=b.MethodType||(b.MethodType={}))[y.GET=1]="GET",y[y.POST=2]="POST",y[y.PUT=3]="PUT"}(z||(z={}));const m=7},67333:(Ce,he,a)=>{a.r(he),a.d(he,{ApduRequestConverter:()=>Pe,ApduResponseConverter:()=>Re,ArrayConverter:()=>Ne,BooleanConverter:()=>O,ByteSwapConverter:()=>d,CRC:()=>ee,Checksum:()=>kt,ConverterError:()=>A,CryptedFrameConverter:()=>Be,EnumConverter:()=>B,EnumListConverter:()=>U,FixedSizeEnumConverter:()=>M,FloatConverter:()=>pe,HexStringConverter:()=>de,Ipv4StringConverter:()=>be,MacAddressStringConverter:()=>Le,MultipleMaskConverter:()=>ke,NumberConverter:()=>I,PipeConverter:()=>ze,PipeConverterBuilder:()=>je,ResultCodeTranslation:()=>E,StringConverter:()=>We,StringVersionConverter:()=>Fe,TAP_REQUEST_FRAME_CONVERTER:()=>ae,TAP_RESPONSE_FRAME_CONVERTER:()=>_e,TLVConverter:()=>Qe,TapApduRequestConverter:()=>_,TapApduResponseConverter:()=>ue,TapClient:()=>v,TapClientError:()=>h,TapEncryptedFrameConverter:()=>V,TapRequestEncryptedConverter:()=>Ee,TapRequestFrameBuilder:()=>i,TapRequestFrameConverter:()=>H,TapRequestHelper:()=>T,TapResponseFrameBuilder:()=>q,TapResponseFrameConverter:()=>ge,TapStreamReader:()=>f,TapStreamWriter:()=>L,TlvBundleConverter:()=>it,UniqMaskConverter:()=>me,createApduFromTapRequest:()=>G,createTapEncryptedFrame:()=>Ie,enumKeyOrValueToNumber:()=>g,tapResponseStatusToString:()=>ve});var p=a(53876),u=a(66386),m=a(15730),w=a(54536),Z=a(83355),te=a(70282),W=a(40482),ne=a(67173),K=a(1864);const ce=(0,m.createDebugger)("@iotize/tap/client/impl");class A extends w.CodeError{constructor(r,o,D){super(o,r),this.cause=D}static unexpectedBufferSize(r,o){return new A(A.Code.UnexpectedBufferSizeError,"Expected buffer of "+r+" byte(s) but found only "+o.length+" byte(s)")}static nullBufferError(r){return new A(A.Code.NullBufferError,r)}static valueTooBigError(r,o){return new A(A.Code.ValueTooBigError,`Value ${r} is not acceptable. Maximum authorized value is ${o}.`)}}!function(j){let r;var o;(o=r=j.Code||(j.Code={})).UnexpectedBufferSizeError="UnexpectedBufferSizeError",o.NullBufferError="NullBufferError",o.ValueTooBigError="ConverterErrorValueTooBigError"}(A||(A={}));class I{constructor(r){this.options=r}static uint8(r=!1){return new I({signed:!1,sizeOf:8,leastSignificantBitFirst:r})}static uint16(r=!1){return new I({signed:!1,sizeOf:16,leastSignificantBitFirst:r})}static uint32(r=!1){return new I({signed:!1,sizeOf:32,leastSignificantBitFirst:r})}static int8(r=!1){return new I({signed:!0,sizeOf:8,leastSignificantBitFirst:r})}static int16(r=!1){return new I({signed:!0,sizeOf:16,leastSignificantBitFirst:r})}static int32(r=!1){return new I({signed:!0,sizeOf:32,leastSignificantBitFirst:r})}decode(r){if(8*r.length<this.options.sizeOf)throw A.unexpectedBufferSize(this.options.sizeOf/8,r);return I.fromBytes(r,this.options.sizeOf/8,this.options.signed,this.options.leastSignificantBitFirst)}encode(r){const o=Math.pow(2,this.options.sizeOf)-1;if(r>o)throw A.valueTooBigError(r,o);const D=new Uint8Array(this.options.sizeOf>>3);for(var J=0;J<D.length;J++){const le=8*(D.length-J-1);D[J]=r>>le&255}return this.options.leastSignificantBitFirst&&D.reverse(),D}static toOpaqueMsb(r,o){const D=Math.pow(2,o)-1;if(r>D)throw A.valueTooBigError(r,D);if(8===o)return new Uint8Array([255&r]);if(16===o)return new Uint8Array([r>>8&255,255&r]);if(32===o)return new Uint8Array([r>>24&255,r>>16&255,r>>8&255,255&r]);throw new Error(`Invalid size ${o}. Must be 8, 16 or 32`)}static fromOpaqueMsb(r,o){if(o||(o=8*r.length),8===o)return 255&r[0];if(16===o)return(255&r[1])+((255&r[0])<<8);if(32===o)return(255&r[3])+((255&r[2])<<8)+((255&r[1])<<16)+((255&r[0])<<24);throw new Error(`Invalid size ${o}. Must be 8, 16 or 32`)}static fromBytes(r,o,D,J){J&&(r=r.reverse());for(var Se,le=0,we=0,Ue=0;Ue<o;Ue++){if(Se=8*(o-Ue-1),we>(le+=(255&r[Ue])<<Se>>>0)&&!D)throw new Error("Overflow. Last value: "+we+" but new is "+le);we=le}return D&&!(128&~r[0])&&(le=-(Math.pow(2,8*o)-le)),le}}let Q;class ee{constructor(r){this.polynomial=r}static mpeg2(){return Q||(Q=new ee(ee.POLYNOMIAL_CRC32_MPEG2)),Q}compute(r,o=ee.FIRST_VALUE){return r instanceof Uint32Array?ee.fromWord(r,o,this.polynomial):ee.fromBytes(r,o,this.polynomial)}static fromBytes(r,o=ee.FIRST_VALUE,D=ee.POLYNOMIAL_CRC32_MPEG2){if(r.length%ee.MODULO!=0)throw new Error(`Cannot compute CRC, input size must be a multiple of 4. Length is ${r.length} % ${ee.MODULO} = ${r.length%ee.MODULO}`);const J=new Uint32Array(r.length/4);for(let le=0;le<J.byteLength;le++)J[le]=I.fromOpaqueMsb(r.slice(4*le,4*(le+1)),32);return ee.fromWord(J,o,D)}static fromWord(r,o=ee.FIRST_VALUE,D=ee.POLYNOMIAL_CRC32_MPEG2){if(!r)throw new Error("Buffer is null");if(r.byteLength>16777216)throw new Error("Buffers larger than 16MB");let J;
1for(let le=0;le<r.length;le++)J=r[le],o=ee.appendCrcNumber(o,J,D);return o}static appendCrcNumber(r,o,D){r^=o;for(let J=0;J<32;J++)r=2147483648&r?(r<<1^D)>>>0:r<<1>>>0;return r}}function g(j,r){return"string"==typeof j?r[j]:j}ee.POLYNOMIAL_CRC32_MPEG2=79764919,ee.MODULO=4,ee.FIRST_VALUE=4294967295;class f extends u.KaitaiStreamReader{static fromArray(r){const o=(0,p.typedArrayToBuffer)(r);return new f(o)}static create(r){return r instanceof Uint8Array?f.fromArray(r):r}readStr(r){return String.fromCharCode.apply(null,this.readBytes(r))}readString(r=this.byteLeft){return this.readStr(r)}readStringTerminator(r){let o="";for(;;){const D=this.readU1(),J=String.fromCharCode(D);if(J===r)break;o+=J}return o}readU2(){return this._isBigEndian?this.readU2be():this.readU2le()}readU4(){return this._isBigEndian?this.readU4be():this.readU4le()}readF4(){return this._isBigEndian?this.readF4be():this.readF4le()}subStream(r){return f.fromArray(this.readBytes(r))}}class L extends u.KaitaiStreamWriter{constructor(r=512,o,D=!0){"number"==typeof r&&(r=new ArrayBuffer(r)),super(r,o,D)}static create(r){return new L(new ArrayBuffer(r))}writeFunction(r,o,D,J){switch(r){case"crc32":return this.addCRC(o);case"padding":if(D)return ce("Padding is already set"),this.writeBytes(D);if(null==typeof J)throw new Error(`Padding function expect padding size as a second argument. Args: ${JSON.stringify(arguments)}`);return this.addPadding(J);default:throw new Error(`Invalid writer function type: ${r}`)}}addPadding(r){return this.writeBytes(new Uint8Array(r)),this}addCRC(r){let o=this.toBytes;r&&r.offset&&(o=o.slice(r.offset));const D=ee.fromBytes(o);return this.writeU4(D),this}writeUnsigned(r,o){return this.writeU(r,o),this}writeU4(r){return this.writeU(r,4),this}writeU2(r){return this.writeU(r,2),this}writeU1(r){return this.writeU(r,1),this}writeF4(r){return this.writeF(r,4),this}writeFloat(r,o){return this.writeF(r,o),this}writeSigned(r,o){return this.writeSigned(r,o),this}writeString(r,o=r?.length||0){return this.writeStr(r||"",o)}writeStr(r,o=r.length){let D=1;const J=Math.min(r.length,o);for(;D<=J;D++)this.writeByte(r.charCodeAt(D-1));const le=o-J;return le>0&&this.writeBytes(new Uint8Array(le)),this}writeBitsInt(r,o){return this.writeB(r,o),this}writeBits(r,o){return this.writeB(r,o),this}writeBoolean(r,o){return this.writeBits(r?1:0,o),this}}f.prototype.readApduRequest=function(){const j={};return j.header=this.readApduRequestHeader(),j.data=this.readBytes(j.header.lc),j},f.prototype.readApduRequestHeader=function(){const j={};return j.cla=this.readUnsigned(1),j.ins=this.readUnsigned(1),j.p1=this.readUnsigned(1),j.p2=this.readUnsigned(1),j.lc=this.readUnsigned(1),j},f.prototype.readApduResponse=function(){const j={};return j.data=this.readBytes(this.getStreamSize()-2),j.status=this.readUnsigned(2),j},f.prototype.readTapRequestEncrypted=function(){const j={};return j.header=this.readApduRequestHeader(),j.request=this.readTapRequestFrame(),j},f.prototype.readTapApduRequest=function(){return{}},f.prototype.readTapEncryptedFrame=function(){const j={};return j.id=this.readUnsigned(2),j.len=this.readUnsigned(2),j.payload=this.readBytes(j.len),j.padding=this.readBytes((16-(4+(void 0===j.len?0:j.len)+4)%16)%16),j.crc=this.readUnsigned(4),j},f.prototype.readTapRequestFrame=function(){const j={};return j.header=this.readTapRequestFrameHeader(),j.payload=this.readBytes(),j},f.prototype.readTapRequestFrameHeader=function(){const j={};return j.methodType=this.readUnsigned(1),j.path=this.readTapRequestFramePath(),j},f.prototype.readTapRequestFramePath=function(){const j={};return j.objectId=this.readUnsigned(2),j.objectInstanceId=this.readUnsigned(2),j.resourceId=this.readUnsigned(2),j},f.prototype.readTapResponseFrame=function(){const j={};return j.status=this.readUnsigned(1),j.data=this.readBytes(),j},L.prototype.writeApduRequest=function(j){return this.writeApduRequestHeader(j.header),this.writeBytes(j.data,j.header.lc),this},L.prototype.writeApduRequestHeader=function(j){return this.writeUnsigned(j.cla,1),this.writeUnsigned(j.ins,1),this.writeUnsigned(j.p1,1),this.writeUnsigned(j.p2,1),this.writeUnsigned(j.lc,1),this},L.prototype.writeApduResponse=function(j){return this.writeBytes(j.data,void 0),this.writeUnsigned(j.status,2),this},L.prototype.writeTapRequestEncrypted=function(j){return this.writeApduRequestHeader(j.header),this.writeTapRequestFrame(j.request),this},L.prototype.writeTapApduRequest=function(j){return this},L.prototype.writeTapEncryptedFrame=function(j){return this.writeUnsigned(j.id,2),this.writeUnsigned(j.len,2),this.writeBytes(j.payload,j.len),this.writeFunction("padding",void 0,j.padding,(16-(4+(void 0===j.len?0:j.len)+4)%16)%16),this.writeFunction("crc32",void 0,j.crc,4),this},L.prototype.writeTapRequestFrame=function(j){return this.writeTapRequestFrameHeader(j.header),this.writeBytes(j.payload),this},L.prototype.writeTapRequestFrameHeader=function(j){return this.writeBitsInt(g(j.methodType,Z.TapRequestFrame.MethodT
1ype),8),this.writeTapRequestFramePath(j.path),this},L.prototype.writeTapRequestFramePath=function(j){return this.writeUnsigned(j.objectId,2),this.writeUnsigned(j.objectInstanceId,2),this.writeUnsigned(j.resourceId,2),this},L.prototype.writeTapResponseFrame=function(j){return this.writeUnsigned(j.status,1),this.writeBytes(j.data),this};class Pe{encode(r,o=new L){return o.writeApduRequest(r),o.toBytes}decode(r){return(r instanceof f?r:f.create(r)).readApduRequest()}}class Re{encode(r,o=new L){return o.writeApduResponse(r),o.toBytes}decode(r){return(r instanceof f?r:f.create(r)).readApduResponse()}}class Ee{encode(r,o=new L){return o.writeTapRequestEncrypted(r),o.toBytes}decode(r){return(r instanceof f?r:f.create(r)).readTapRequestEncrypted()}}class V{encode(r,o=new L){return o.writeTapEncryptedFrame(r),o.toBytes}decode(r){return(r instanceof f?r:f.create(r)).readTapEncryptedFrame()}}class H{encode(r,o=new L){return o.writeTapRequestFrame(r),o.toBytes}decode(r){return(r instanceof f?r:f.create(r)).readTapRequestFrame()}}class ge{encode(r,o=new L){return o.writeTapResponseFrame(r),o.toBytes}decode(r){return(r instanceof f?r:f.create(r)).readTapResponseFrame()}}const N=L.prototype.writeApduRequestHeader;function G(j){const r=(new H).encode(j);let o;switch(j.header.methodType){case Z.TapRequestFrame.MethodType.GET:o=Z.TapApduRequest.MethodType.GET;break;case Z.TapRequestFrame.MethodType.PUT:case Z.TapRequestFrame.MethodType.POST:o=Z.TapApduRequest.MethodType.PUT_OR_POST;break;default:throw new Error(`Internal error: request type "${j.header.methodType}" is invalid`)}return{header:{cla:Z.TapApduRequest.Default.CLA,ins:o,p1:0,p2:0,lc:r.length},data:r}}L.prototype.writeApduRequestHeader=function(j){return j.lc>255?(this.writeUnsigned(j.cla,1),this.writeUnsigned(j.ins,1),this.writeUnsigned(j.p1,1),this.writeUnsigned(j.p2,1),this.writeUnsigned(0,1),this.writeUnsigned(j.lc,2),this):N.apply(this,[j])};class i{static parsePath(r){if(!r||0===r.length)throw new Error("Missing LWM2M path, it must not be empty");const o=(r=r.trim()).match(i.PATH_EXPRESSION);if(!o||0===o.length)throw new Error(`Invalid LWM2M path "${r}", it does not match expected format`);const D={objectId:this.validateId(parseInt(o[1])),objectInstanceId:o[2]?parseInt(o[2]):65535,resourceId:parseInt(o[3])};return o[4]&&(D.resourceInstanceId=parseInt(o[4],10)),D}static GET(r,o){return i.create(Z.TapRequestFrame.MethodType.GET,r,o)}static PUT(r,o){return i.create(Z.TapRequestFrame.MethodType.PUT,r,o)}static POST(r,o){return i.create(Z.TapRequestFrame.MethodType.POST,r,o)}static create(r,o,D){return{header:{path:i.parsePath(o),methodType:r},payload:D||new Uint8Array}}static validateId(r){if(r<0||r>i.MAX_ID)throw new Error(`Invalid identifier "${r}". It must be a number between ${r} and ${i.MAX_ID}`);return r}}i.MAX_ID=65535,(i||(i={})).PATH_EXPRESSION=/^\/?([0-9]+)\/([0-9]+)?\/([0-9]+)\/?([0-9]+)?$/;class T{static toString(r,o){let D=`${Z.TapRequestFrame.MethodType[r.header.methodType]} ${T.pathToString(r.header.path,o)}`;return r.payload&&r.payload.length>0&&(D+=` 0x${(0,p.bufferToHexString)(r.payload)}`),D}static pathToString(r,o){const D=r.resourceInstanceId;return"/"+r.objectId+"/"+(r.objectInstanceId===i.MAX_ID?o?.printMaxId?r.objectInstanceId:"":r.objectInstanceId)+"/"+r.resourceId+(D?"/"+D:"")}}const E={0:"The request was successful",65:"Create request was successful",66:"Delete request was successful",68:"Update request was successful",69:"The server has fulfilled the request and sent a response",70:"The server is busy",128:"Bad request. Meaning device cannot understand your request.",129:"Current user is not authorized to access this ressource",132:"The server has not found anything matching the Request",133:"Current user is not authorized to access this ressource",134:"Given parameters are not acceptable",135:"Given resource is not available with the current TAP configuration.",160:"Internal server error",161:"This resource has not been implemented yet",163:"Service is currently unavailable. Try again later.",164:"Writing non volatible memory failed",165:"Tap was not able to connect to the target",166:"Target power failure",167:"Non volatile memory is full",168:"It means we can't access this resource because someone is already connected to this device and he has the priority over us.",169:"Response is bigger than you current protocol limit",176:"Target protocol error",177:"Target protocol is busy",178:"Target protocol error",179:"Target protocol parameters are not valid",180:"Target protocol is forbidden",181:"Target protocol data are not the one expected. For example a CRC error.",182:"Target protocol communication error",183:"Target protocol lost communication",184:"Target protocol invalid parameter",185:"Internal error with target communication",186:"Operation aborted because one of the command did not return the expected result code.",187:"Target protocol is not implemented"};class h extends w.CodeError{constructor(r,o,D){super(o,r),this.cause=D}static illegalArgument(r){return new h(h.Code.IllegalArgumentError,r)}static illegalStateError(r){return new h(h.Code.IllegalStateError,r)}static encodeRequestError(r,o){return new h(h.Code.EncodeRequestError,"Cannot encode this request: "+r+". Cause: "+o,o)}static decodeResponseError(r,o){return new h(h.Code.DecodeResponseError,`Cannot decode response to command ${o instanceof Uint8Array?`0x${(0,p.bufferToHexString)(o)}`:T.toString(o)}. Cause: `+r,r)}static notConnectedError(){return new h(h.Code.NotConnectedError,"Trying to execute command but device is not connected")}static cannotDecodeResponseError(r,o){return new h(h.Code.UnexpectedTapResponse,`Received from device an unexpected response that cannot be decoded (${r.message}). Frame: 0x${(0,p.bufferToHexString)(o)}`)}static unexpectedApduStatusCode(r){return new h(h.Code.UnexpectedApduResponseStatus,`Received from device an unexpected response with an invali
1d APDU status code 0x${r.status.toString(16)}\n but expecting 0x${Z.ApduResponse.Status.OK.toString(16)}`)}static cannotEncodeRequest(r,o){return new h(h.Code.CannotEncodeRequest,`Cannot encode request ${o}: ${r.message}`)}}!function(j){let r;var o;(o=r=j.Code||(j.Code={})).NotConnectedError="TapClientErrorNotConnected",o.EncodeRequestError="TapClientErrorEncodeRequest",o.IllegalArgumentError="TapClientErrorIllegalArgument",o.IllegalStateError="TapClientErrorIllegalState",o.DecodeResponseError="TapClientErrorDecodeResponse",o.UnexpectedTapResponse="TapClientErrorUnexpectedTapResponse",o.UnexpectedApduResponseStatus="TapClientErrorUnexpectedApduResponseStatus",o.CannotEncodeRequest="TapClientErrorCannotEncodeRequest",o.TapClientResponseStatusError="TapClientErrorResponseStatus"}(h||(h={}));class _{encode(r){try{const o=new L(6+r.payload.length+1);return o.writeApduRequest(G(r)),o.toBytes}catch(o){throw o instanceof h?o:h.cannotEncodeRequest(o,r)}}decode(r){const o=r instanceof f?r:f.create(r);o.readApduRequestHeader();return o.readTapRequestFrame()}}class ue{encode(r){const o=new L,D=new L;return D.writeTapResponseFrame(r),o.writeApduResponse({data:D.toBytes,status:Z.ApduResponse.Status.OK}),o.toBytes}decode(r){try{const D=(r instanceof f?r:f.create(r)).readApduResponse();if(D.status!==Z.ApduResponse.Status.OK)throw h.unexpectedApduStatusCode(D);return f.fromArray(D.data).readTapResponseFrame()}catch(o){throw o instanceof h?o:h.cannotDecodeResponseError(o,r instanceof f?r.toBytes:r)}}}const ae=new _,_e=new ue;class Te{constructor(r){this.target=r,this.interceptors=[]}addInterceptor(r){return this.interceptors.push("function"==typeof r?{intercept:r}:r),this}execute(r){const o={index:0,run:D=>o.index<this.interceptors.length?(o.index++,this.interceptors[o.index-1].intercept(D,{handle:J=>o.run(J)})):this.target(D)};return o.run(r)}}const S="Client";class v{constructor(r,o){this._onProtocolChange=new te.Subject,this._commandEncoder=r,this._responseDecoder=o,this.protocols={},this._interceptorChain=new Te(D=>{try{const J=D.request;return this._command(J)}catch(J){return(0,te.throwError)(J)}})}static create(r){const o=new v(ae,_e);return r&&o.addComProtocol(r),o}get interceptorChain(){return this._interceptorChain}addInterceptor(r){return this.interceptorChain.addInterceptor(r),this}isConnected(){return this.hasProtocol(this.currentProtocolId)&&this.getCurrentProtocol().isConnected()}get protocol(){return this.getCurrentProtocol()}get commandEncoder(){return this._commandEncoder}get responseDecoder(){return this._responseDecoder}getCurrentProtocol(){if(!this.currentProtocolId)throw h.illegalStateError("Tap client protocol is required");if(!this.hasProtocol(this.currentProtocolId))throw h.illegalArgument("Protocol "+this.currentProtocolId+" does not exist");return this.protocols[this.currentProtocolId]}addComProtocol(r,o="default"){return this.protocols[o]=r,this.currentProtocolId||(this.currentProtocolId=o),this}switchProtocol(r){if(!this.hasProtocol(r))throw h.illegalArgument("Unkonwn protocol: "+r);const o=this.getCurrentProtocol();return this.currentProtocolId=r,ce(S,`Changing protocol to: ${r}`),this._onProtocolChange.next({newProtocol:this.getCurrentProtocol(),oldProtocol:o}),this}useComProtocol(r){let o;return"string"==typeof r?o=r:(o=r.constructor.name,this.addComProtocol(r,o)),this.switchProtocol(o),this}hasProtocol(r){return r in this.protocols}connect(){try{return this.getCurrentProtocol().connect()}catch(r){return(0,te.throwError)(r)}}disconnect(){try{return this.getCurrentProtocol().disconnect()}catch(r){return(0,te.throwError)(r)}}request(r){return this._interceptorChain.execute({request:r,client:this})}send(r){try{return this.getCurrentProtocol().send(r).pipe((0,W.map)(o=>{try{return this._responseDecoder.decode(o)}catch(D){throw h.decodeResponseError(D,r)}}))}catch(o){return(0,te.throwError)(o)}}onConnectionStateChange(){try{return this.getCurrentProtocol().onConnectionStateChange()}catch(r){return(0,te.throwError)(r)}}onProtocolChange(){try{return this._onProtocolChange.asObservable()}catch(r){return(0,te.throwError)(r)}}_command(r){try{if(!this.isConnected())return(0,te.throwError)(h.notConnectedError());let o;try{o=this._commandEncoder.encode(r)}catch(D){return(0,te.throwError)(h.encodeRequestError(r,D))}return ce(S,`Sending ${T.toString(r)} (${o.length} bytes 0x${(0,p.bufferToHexString)(o)})`),this.getCurrentProtocol().send(o).pipe((0,W.map)(D=>{try{return this._responseDecoder.decode(D)}catch(J){throw h.decodeResponseError(J,r)}}))}catch(o){return(0,te.throwError)(o)}}}class q{static SUCCESS(r){return q.create(Z.ResultCode.OK,r)}static ERROR(r=Z.ResultCode.BAD_REQUEST,o){return q.create(r,o)}static create(r,o){return{status:r,data:o||new Uint8Array}}}function ve(j){return E[j]?E[j]:"Unknown tap response status"}class Ne{constructor(r,o){this._itemConverter=r,this.options=o}get itemConverter(){return this._itemConverter}decode(r){let o=[],D=this.options.sizeOfItem;for(let J=0;J<r.length;
1J+=D){let le=r.subarray(J,J+D),we=this._itemConverter.decode(le);o.push(we)}return o}encode(r){let o=new Uint8Array(this.options.sizeOfItem*r.length),D=0;for(let J of r){let le=this._itemConverter.encode(J);if(le.length>this.options.sizeOfItem)throw new Error(`Encoded item size overflow: ${le.length} (max is ${this.options.sizeOfItem})`);o.set(le,D),D+=this.options.sizeOfItem}return o}}class O{constructor(r=1){this._mask=r}decode(r){var o=I.fromBytes(r,r.length,!1,O.IS_LEAST_SIGNIFICANT_BIT_FIRST);return O.decodeFromNumber(this._mask,o)}encode(r){return Uint8Array.from([r?this._mask:0])}static decodeFromNumber(r,o){return 0==r&&0==o||!!(o&r)}static instanceBit0(){return O._instance||(O._instance=new O(1)),O._instance}}O.IS_LEAST_SIGNIFICANT_BIT_FIRST=!0,O._instance=void 0;const s=/^(B[0-9]+)(_B[0-9]+)*$/;class d{constructor(r){this.order=r}encode(r){return function Oe(j,r){if(!r.match(s))throw new Error(`swatpBytes error, invalid byte order "${r}". Should match regex ${s}`);const o=r.split("_"),D=new Uint8Array(o.length);for(let J=0;J<D.length;J++){const le=parseInt(o[J].substr(1));if(le>=j.length)throw new Error(`swapBytes error, byte index ${le} is out of range (input length is ${j.length} byte(s))`);D[J]=j[j.length-le-1]}return D}(r,this.order)}decode(r){return this.encode(r)}}function Ie(j,r,o){return{id:j,len:r.length,payload:r}}class Be{constructor(r){this.frameIdGenerator=r}encode(r){const o=Ie(this.frameIdGenerator.next(),r);return(new L).writeTapEncryptedFrame(o).toBytes}decode(r){if(!r)throw A.nullBufferError("Illegal data: frame is null");return f.fromArray(r).readTapEncryptedFrame().payload}}class B{constructor(r){this.mapping=r}decode(r){const o=this.decodeToLiteral(r);if(!this.mapping[o])throw new Error(`Unknown litteral value ${o}.`);return o}encode(r){if("number"!=typeof r)throw Error("Illegal argument when encoding enum value. Expecting number but found "+typeof r);return this.encodeToLiteral(r)}}class M extends B{constructor(r,o=1){super(r),this.mapping=r,this.size=o}decodeToLiteral(r){return f.fromArray(r).readU(this.size)}encodeToLiteral(r){return new L(this.size).writeU(r,this.size).toBytes}}class U{constructor(r,o){this.size=r,this.mapping=o}decode(r){const o=this.decodeToLiteral(f.create(r)),D=[],J=Object.keys(this.mapping).filter(le=>!isNaN(Number(this.mapping[le])));for(const le of J){const we=this.mapping[le],Se=parseInt(we);0==Se?0==o&&D.push(we):(o&Se)==Se&&D.push(we)}return D}encode(r){let o=0;for(const J of r){if("number"!=typeof J)throw Error("Illegal argument when encoding enum value. Expecting number but found "+typeof J);o|=J}return new L(this.size).writeU(o,this.size).toBytes}decodeToLiteral(r){return r.readU(this.size)}}class pe{constructor(r){this.options=r}encode(r){return I.toOpaqueMsb(pe.toArray(r),32)}decode(r){return pe.toFloat(r)}static toArray(r){var Ae,Ye,He,Ke,dt,o=(Se=+r)!=Se||Se==-1/0||Se==1/0?Se:0,D=0,J=281,le=new Array(J),we=(Se=0!==o?0:Se)<0,Se=Math.abs(Se),Ue=Math.floor(Se),$e=Se-Ue;if(0!==o){if(Se!=Se)return 2143289344;if(Se===1/0)return 2139095040;if(Se===-1/0)return 4286578688}for(Ae=J;Ae;)le[--Ae]=0;for(Ae=129;Ue&&Ae;)le[--Ae]=Ue%2,Ue=Math.floor(Ue/2);for(Ae=128;$e>0&&Ae;)(le[++Ae]=($e*=2)>=1?1:0)&&--$e;for(Ae=-1;++Ae<J&&!le[Ae];);if(le[(Ye=22+(Ae=(D=128-Ae)>=-126&&D<=127?Ae+1:128-(D=-127)))+1]){if(!(He=le[Ye]))for(Ke=Ye+2;!He&&Ke<J;)He=le[Ke++];for(Ke=Ye+1;He&&--Ke>=0;)(le[Ke]=!le[Ke]-0)&&(He=0)}for(Ae=Ae-2<0?-1:Ae-3;++Ae<J&&!le[Ae];);for((D=128-Ae)>=-126&&D<=127?++Ae:D<-126&&(Ae=255,D=-127),(Ue||0!==o)&&(D=128,Ae=129,o==-1/0?we=!0:o!=o&&(le[Ae]=1)),Se=Math.abs(D+127),dt=0,Ke=0;Ke<8;)dt+=Se%2<<Ke,Se>>=1,Ke++;var ht=0;for(Se=Ae+23;Ae<Se;Ae++)ht=(ht<<1)+le[Ae];return(we?2147483648:0)+(dt<<23)+ht|0}static toFloat(r){return pe.numberToFloat(I.fromOpaqueMsb(r,32))}static numberToFloat(r){var o=1*r,J=(2139095040&o)>>23,le=8388607&o,we=(2147483648&o?-1:1)*(le|=8388608)*Math.pow(2,J-150)*1;return parseFloat(we.toFixed(5))}static instance32(){return pe._instance32||(pe._instance32=new pe),pe._instance32}}pe._instance32=void 0;class de{decode(r){return(0,p.bufferToHexString)(r)}encode(r){if(!r||0==r.length)return new Uint8Array(0);r.length%2>0&&(r="0"+r);for(var o=[],D=0,J=r.length;D<J;D+=2)o.push(parseInt(r.substr(D,2),16));return new Uint8Array(o)}static instance(){return de._instance||(de._instance=new de),de._instance}}de._instance=void 0;class be{decode(r){if(null==r||4!=r.length)throw A.unexpectedBufferSize(4,r);var o="",D=Array.from(r);for(var J of D)o+=J.toString()+".";return o.substr(0,o.length-1)}encode(r){var o=r.split(".");if(4!=o.length)throw new Error("Invalid ip format. Should be x.x.x.x");var D=new Uint8Array(4);return o.map((J,le)=>{D[le]=255&parseInt(J)}),D}static instance(){return be._instance||(be._instance=new be),be._instance}}be._instance=void 0;class Le{decode(r){if(!r||6!==r.length)throw A.unexpectedBufferSize(6,r);let o="";for(var D=r.length-1;D>=0;D--){const J=r.slice(D,D+1);o+=(0,p.bufferToHexString)(J).toUpperCase()+":"}return o.substring(0,o.length-1)}encode(r){const o=r.split(":").map(D=>255&parseInt(D,16)).reverse();if(6!==o.length)throw new Error("Invalid mac address format: "+r);return Uint8Array.from(o)}static instance(){return Le._instance||(Le._instance=new Le),Le._instance}}Le._instance=void 0;class ke{constructor(r){this._mapping=r}decode(r){return ke.decodeAll(r,this._mapping)}encode(r){return ke.encodeAll(r,this._mapping)}static encodeAll(r,o){var D=function qe(j){var r={};for(var o in j)r[j[o]]=o;return r}(o),J=0;for(var le of r)if(le in D){J|=parseInt(D[le])}return Uint8Array.from([255&J])}static decodeAll(r,o){var D=[];for(var J in"number"!=typeof r&&(r=I.fromOpaqueMsb(r,Math.min(8*r.length,32))),o){var le=parseInt(J);(0==le&&0==r||le&r)&&D.push(o[le])}return D}}class je{constructor(r={}){this.aliases=r}pipe(r){return new ze([],this.aliases).pipe(r)}}class ze{constructor(r,o={}){this.converters=r,this.aliases=o}decode(r){let o=r;for(let D of this.converters)o="function"==typeof D?D(o):D.decode(o);return o}encode(r){let o=r;const D=[...this.converters].reverse();for(let J of D)o="function"==typeof J?J(o):J.encode(o);return o}pipe(r){if("string"==typeof r){if(!(r in this.aliases))throw new Error(`Illegal argument, missing converter id: ${r}`);r=this.aliases[r]}return this.converters.push(r),this}static pipe(r){return new ze([r],{})}}class We{constructor(r="ascii",o={stripEndOfStringCharacter:!0,replaceEmptyStringWithEndOfLineChar:!1,addEndOfStringCharacter:!1}){this.encoding=r,this.options=o}encode(r){if("number"==typeof r&&(r=r.toString()),"string"!=typeof r&&(r=""),this.options.addEndOfStringCharacter)r+="\0";else if(!r&&this.options.replaceEmptyStringWithEndOfLineChar)return Uint8Array.from([0]);let o=ne.Buffer.from(r,this.encoding);return Uint8Array.from(o)}decode(r){let o=ne.Buffer.from(r).toString(this.encoding);
1if(this.options.stripEndOfStringCharacter){const D=o.indexOf("\0");D>=0&&(o=o.substring(0,D))}return o}static ascii(){return We._ascii||(We._ascii=new We("ascii",{replaceEmptyStringWithEndOfLineChar:!0,stripEndOfStringCharacter:!0})),We._ascii}}We._ascii=void 0;class Qe{constructor(){this.serializer=new K.TLV.Serializer,this.parser=new K.TLV.Parser}encode(r){return this.serializer.serialize(r)}decode(r){return this.parser.parse(r)}}class it{constructor(r=[],o=new Qe){this.variables=r,this.tlvConverter=o,this.bundleId=0}decode(r,o){r instanceof Uint8Array&&(r=this.tlvConverter.decode(r));const D=this._convertFromTlvTree(r);if(!D||"object"!=typeof D||D instanceof Uint8Array)throw new Error("Invalid TLV frame");return D}encode(r){var o;const D={header:{id:this.bundleId,len:0,type:K.TLV.IdentifierType.MULTIPLE_RESOURCE},children:[]};let J=0;for(const le in r){const we=r[le];let Se,Ue=this.variables.find(Ae=>Ae.name===le);if(Ue||(Ue=this.variables.find(Ae=>Ae.id===parseInt(le,10))),Ue?.converter)Se=null===(o=Ue.converter)||void 0===o?void 0:o.encode(we);else{if(!(we instanceof Uint8Array))throw new Error(`Add converter for variable with identifier "${le}"`);Se=we}D.children||(D.children=[]);const $e=Ue?.id||parseInt(le,10);if(isNaN($e))throw new Error(`Cannot find variable by identifier "${le}"`);D.children.push({header:{id:$e,len:Se.length,type:K.TLV.IdentifierType.RESOURCE_VALUE},payload:Se}),J+=Se.length+2}return D.header.len=J,this.tlvConverter.encode(D)}_convertFromTlvTree(r,o){let D={};if(r.children){D={};for(const J of r.children){const le=this.variables.filter(we=>we.id==J.header.id);0==le.length&&le.push({id:J.header.id});for(const we of le){D[we&&we.name?we.name:J.header.id.toString()]=this._convertFromTlvTree(J,we)}}}else if(r.payload){const J=o?o.converter:void 0;D=J?J.decode(r.payload):Uint8Array.from(r.payload)}return D}}class me{constructor(r){this._mapping=r}decode(r){return me.decodeOne(r,this._mapping)}encode(r){return me.encodeOneAsBuffer(r,this._mapping)}static decodeOneExact(r,o){for(var D in"number"!=typeof r&&(r=I.fromOpaqueMsb(r)),o){var J=parseInt(D);if(r==J)return o[J]}throw new Error(`Cannot decode ${"number"==typeof r?"number "+r:"0x"+(0,p.bufferToHexString)(r)}. Available keys are ${Object.keys(o)}`)}static decodeOne(r,o){var D=ke.decodeAll(r,o);if(0==D.length)throw new Error(`Cannot decode value ${"number"==typeof r?r:"0x"+(0,p.bufferToHexString)(r)}. Available keys are ${Object.keys(o)}`);return D.length>1&&ce("Converter","Multiple result for data : ",D,r,o),D[0]}static encodeOneAsNumber(r,o){let D=me.swapKeyValue(o),J=r.toString();if(!(J in D))throw new Error(`Key ${J} does not exist in mapping. Available keys are ${Object.keys(D)}`);return parseInt(D[J])}static encodeOneAsBuffer(r,o){let D=new Uint8Array(1),J=me.encodeOneAsNumber(r,o);return D[0]=255&J,D}static swapKeyValue(r){var o={};for(var D in r)o[r[D]]=D;return o}}function R(j){const r=parseInt(j);if(isNaN(r))throw X(j);return r}function X(j){return new Error(`Invalid string version format for "${j}". Should be x.x.x. For example: 1.0.3.`)}class Fe{encode(r,o=new L){const D=r.split(".");if(3!==D.length)throw X(r);return o.writeUnsigned(R(D[0]),1),o.writeUnsigned(R(D[1]),1),o.writeUnsigned(R(D[2]),2),o.toBytes}decode(r){const o=r instanceof f?r:f.create(r);return`${o.readUnsigned(1)}.${o.readUnsigned(1)}.${o.readUnsigned(2)}`}}class kt{static compute(r){let o=0;for(let D=0;D<r.length;D++)o+=r[D];return o}}},8872:(Ce,he,a)=>{a.d(he,{A:()=>b});var p=a(49697),u=a(83187);const b=(0,p.defineTapPropertyExtension)("dataLog",y=>function w(y){return new u.DataLogger(y)}(y.tap))},74707:(Ce,he,a)=>{a.d(he,{D:()=>b});var p=a(49697),u=a(14961);const b=(0,p.defineTapPropertyExtension)("data",y=>new u.DataManager(y.tap))},80722:(Ce,he,a)=>{a.d(he,{UI:()=>w});var p=a(49697),u=a(87955),m=function(te,ie,W,fe){return new(W||(W=Promise))(function(F,K){function se(A){try{ce(fe.next(A))}catch(I){K(I)}}function Y(A){try{ce(fe.throw(A))}catch(I){K(I)}}function ce(A){A.done?F(A.value):function ne(F){return F instanceof W?F:new W(function(K){K(F)})}(A.value).then(se,Y)}ce((fe=fe.apply(te,ie||[])).next())})};const w=(0,p.defineTapPropertyExtension)("keepAlive",te=>new u.KeepAliveEngine(te.tap,{period:u.DEFAULT_KEEP_ALIVE_PERIOD_MS}));p.Tap.prototype.getKeepAliveEngine=function y(){return this.keepAlive},p.Tap.prototype.setupKeepAliveFromConfig=function Z(){return m(this,void 0,void 0,function*(){const te=(yield this.service.interface.getHostInactivityPeriod()).body();this.keepAlive.period=1e3*te,this.keepAlive.start()})}},78172:(Ce,he,a)=>{var p,u,P;a.d(he,{K:()=>p,o:()=>P}),(u=p||(p={}))[u.DISCONNECTED=0]="DISCONNECTED",u[u.CONNECTING=1]="CONNECTING",u[u.CONNECTED=2]="CONNECTED",u[u.DISCONNECTING=3]="DISCONNECTING",function(u){class z extends
1Error{constructor(w,y){super(y),this.code=w}static operationCanceled(){return new z(m.OperationCancelled,"Communication protocol operation cancelled")}static notConnected(w){return new z(m.ProtocolNotConnected,"Communication protocol is not connected")}static timeoutError(w){return new z(m.TimeoutError,w.msg||"Communication protocol timeout")}static operationInProgress(w){return new z(m.OperationInProgress,w)}static unknownError(){return new z(m.UnknownError,"Unnown communication protocol error")}}let m;var b;u.Errors=z,(b=m=u.ErrorCode||(u.ErrorCode={})).ProtocolNotConnected="ProtocolNotConnected",b.TimeoutError="TimeoutError",b.UnknownError="UnknownError",b.OperationCancelled="OperationCancelled",b.OperationInProgress="ComProtocolOperationInProgress"}(P||(P={}))},87435:(Ce,he,a)=>{a.d(he,{WI:()=>K,cq:()=>Re,lP:()=>I});var p=a(53876),u=a(93162),m=a(59689),b=a(67333),w=a(15730),Z=a(54536),ie=a(78172),W=a(70282),ne=a(40482);const K={maxPacketLengthWithoutOffset:19,services:{upgrade:{service:"9e5d1e47-5c13-43a0-8635-82ad38a1386f",charac:"347f7608-2e2d-47eb-913b-75d4edc4de3b"},lwm2m:{service:"6c7b16c2-2a5b-8c9f-cf42-d31425470e7b",charac:"cc5c5491-b3be-9287-cb42-f7a6a29a50d5"},fastLwm2m:{service:"7c7b16c2-2a5b-8c9f-cf42-d31425470e7b",charac:"dc5c5491-b3be-9287-cb42-f7a6a29a50d5"},standardClientConfig:{service:"00002902-0000-1000-8000-00805f9b34fb"}}};class se{constructor(c){this.bufferOffset=0,this.dataLength=0,this.data=new Uint8Array(c),this.reset()}append(c){if(c&&!(c.length<2)){if(this.bufferOffset=(255&c[0])-1,this.bufferOffset+c.length>this.data.length)throw new Error(`Buffer size exceeded. Maximum size is ${this.data.length} byte(s).`);for(let V=1;V<c.length;V++)this.data[this.bufferOffset+V]=c[V];this.dataLength+=c.length-1}}reset(){this.dataLength=0,this.bufferOffset=0}hasAllChunks(){return-1===this.bufferOffset}isChecksumValid(){let c=this.getComputedChecksum();return this.getExpectedChecksum()===c}getComputedChecksum(){return 255&b.Checksum.compute(this.data.subarray(0,this.dataLength-1))}getExpectedChecksum(){return this.data[this.dataLength-1]}getData(){return this.data.slice(0,this.dataLength-1)}getBuffer(){return this.data}}class Y{constructor(c,V){if(this.lastPacketSize=0,this.maxPacketSize=0,this.currentPacketIndex=0,V<1)throw new Error("Packet size must be greater than 0");this.data=c,this.maxPacketSize=V,this.currentPacketIndex=this.getTotalNumberOfPacket()-1,this.lastPacketSize=this.getLastPacketSize()}static wrapWithChecksum(c,V){var H=Y.computeChecksum(c),ge=new Uint8Array(c.length+1);return ge.set(c),ge.set([255&H],c.length),new Y(ge,V)}getTotalNumberOfPacket(){return(this.data.length/this.maxPacketSize|0)+(this.data.length%this.maxPacketSize==0?0:1)}getLastPacketSize(){let c=this.data.length%this.maxPacketSize;return 0===c&&(c=this.maxPacketSize),c}getPackets(){let c=[];for(;this.hasNextPacket();)c.push(this.getNextPacket());return c}getNextPacket(){let c,V;this.currentPacketIndex>0?(V=this.lastPacketSize+(this.currentPacketIndex-1)*this.maxPacketSize,c=this.maxPacketSize):(V=0,c=this.lastPacketSize);let H=new Uint8Array(c+1);H[0]=0|V;for(let ge=0;ge<c;ge++)H[ge+1]=this.data[V+ge];return this.currentPacketIndex--,H}hasNextPacket(){return this.currentPacketIndex>=0}static computeChecksum(c){return 255&b.Checksum.compute(c)}getTotalSize(){return this.data.length}}const A=(0,w.createDebugger)("@iotize/tap/protocol/ble");class I extends Z.CodeError{static invalidBleChunkChecksum(c){return Q.create(c)}static writeSizeAboveMTU(c,V){return new I(I.Code.BleWriteSizeAboveMTU,`Cannot write ${c.length} bytes as it's more than the Maximal Transfert Unit (${V})`)}static serviceNotFound(c){return new I(I.Code.BleGattServiceNotFound,`Bluetooth service with id ${c} not found`)}static charcacteristicNotFound(c){return new I(I.Code.BleGattCharacteristicNotFound,`Bluetooth characteristic with id ${c} not found`)}static bleNotAvailable(c="BLE is not available on your device"){return new I(I.Code.NotAvailable,c)}static gattServerNotAvailable(){return new I(I.Code.GATTServerNotAvailable,"Generic Attribute Profile (GATT) server is not available")}static gattServerConnectionFailed(){return new I(I.Code.GATTServerConnectionFailed,"Gatt server connection failed")}constructor(c,V){super(V,c)}}class Q extends I{constructor(c){super(I.Code.InvalidChecksum,"Invalid checksum"),this.packetBuilder=c}static create(c){return new Q(c)}}!function(Ee){let c;var V;(V=c=Ee.Code||(Ee.Code={})).InvalidChecksum="InvalidChecksum",V.BleGattServiceNotFound="BleGattServiceNotFound",V.BleGattCharacteristicNotFound="BleGattCharacteristicNotFound",V.BleWriteSizeAboveMTU="BleWriteSizeAboveMTU",V.GATTServerNotAvailable="BleComErrorGATTServerNotAvailable",V.GATTServerConnectionFailed="BleComErrorGATTServerConnectionFailed",V.NotAvailable="BleComErrorNotAvailable"}(I||(I={}));var ee=function(Ee,c,V,H){return new(V||(V=Promise))(function(N,G){function i(h){try{E(H.next(h))}catch(k){G(k)}}function T(h){try{E(H.throw(h))}catch(k){G(k)}}function E(h){h.done?N(h.value):function ge(N){return N instanceof V?N:new V(function(G){G(N)})}(h.value).then(i,T)}E((H=H.apply(Ee,c||[])).next())})};class g extends m.B{constructor(c={mtu:K.maxPacketLengthWithoutOffset+1}){super(),this.bleOptions=c}onNewLwm2mMessage(c){this._readResolve?(A("onNewLwm2mMessage()",(0,p.bufferToHexString)(c)),this._readResolve(c)):(console.warn(`No listener for new message... 0x${(0,p.bufferToHexString)(c)}`),this._pendingRead=c)}onNewLwm2mMessageError(c){console.error("Error lwm2m response...",c)}onLwm2mDataChunkError(c){this._readReject?this._readReject(c):console.warn("No listener for read message error...",c)}getLwm2mResponsePromise(){if(A("getLwm2mResponsePromise"),this._pendingRead){let c=this._pe
1ndingRead;return this._pendingRead=void 0,Promise.resolve(c)}return this._readPromise||this.createLwm2mResponsePromise(),this._readPromise}createLwm2mResponsePromise(){return A("createLwm2mResponsePromise"),this._readPromise=new Promise((c,V)=>{this._readResolve=c,this._readReject=V}),this._readPromise}read(){if(A("read()..."),this.packetBuilder){if(this.packetBuilder.hasAllChunks()){let c=this.packetBuilder.getData();return this.packetBuilder=void 0,Promise.resolve(c)}console.warn("AbstractBleProtocol::read() There is already a read operation in progress but a new call to ::read has been made.")}return this.getLwm2mResponsePromise().then(c=>(this.packetBuilder=void 0,c)).catch(c=>{throw this.packetBuilder=void 0,c})}write(c){return ee(this,void 0,void 0,function*(){null!=this.packetSplitter&&console.warn("BLEProtocol","write","There are already data being sent but a new call to ::write has been made"),this.packetSplitter=Y.wrapWithChecksum(c,this.bleOptions.mtu-1);let H,V=this.packetSplitter.getPackets();return this._pendingRead=void 0,this.packetBuilder=new se(g.RECEIVED_BUFFER_LENGTH),V.length>0?H=(0,u.promiseSerial)(V,(ge,N)=>this.writeLwm2mPacketChunk(ge).then(G=>(A(`Done sending packet ${N+1}/${V.length}`),G))):(console.warn("BLEProtocol","write","Nothing to write..."),H=Promise.resolve()),H.then(()=>{this.packetSplitter=void 0}).catch(ge=>{throw this.packetSplitter=void 0,ge})})}onNewLwm2mPacket(c){if(this.packetBuilder){if(this.packetBuilder.append(c),this.packetBuilder.hasAllChunks())if(this.packetBuilder.isChecksumValid())this.onNewLwm2mMessage(this.packetBuilder.getData());else{let V=Q.create(this.packetBuilder);this.onLwm2mDataChunkError(V)}}else A(`Ignoring lwm2m packet 0x${(0,p.bufferToHexString)(c)} as not request has been made yet`)}}g.RECEIVED_BUFFER_LENGTH=255;var L=function(Ee,c,V,H){return new(V||(V=Promise))(function(N,G){function i(h){try{E(H.next(h))}catch(k){G(k)}}function T(h){try{E(H.throw(h))}catch(k){G(k)}}function E(h){h.done?N(h.value):function ge(N){return N instanceof V?N:new V(function(G){G(N)})}(h.value).then(i,T)}E((H=H.apply(Ee,c||[])).next())})};const Pe={maximumBufferLength:512,waitForWriteAcknowledge:!0,preferedComServiceType:"large-frame",sanitizeUUID:!1};class Re extends m.B{constructor(c,V={}){super(),this.peripheral=c,this._useSplitter=!0,this._unexpectedBleDisconnection=this.peripheral.stateChange.pipe((0,ne.filter)(H=>{const ge=this.getConnectionState();return H===ie.K.DISCONNECTED&&ge!==ie.K.DISCONNECTING&&ge!==ie.K.DISCONNECTED}),(0,ne.share)()),this.bleOptions=Object.assign(Object.assign({},Pe),V),this.options.connect.timeout=8e3,this.options.send.timeout=4e3,this.options.disconnect.timeout=8e3,this._unexpectedBleDisconnection.subscribe(()=>L(this,void 0,void 0,function*(){A("unexpected BLE disconnection detected. Running proper BLE disconnection process"),yield this.disconnect().toPromise().catch(H=>{A(`Proper BLE disconnection process failed with error: ${H.message}`)})}))}get lwm2mCharc(){if(!this._lwm2mCharc)throw this.setConnectionState(ie.K.DISCONNECTED),ie.o.Errors.notConnected({protocol:this});return this._lwm2mCharc}sanitizeUUID(c){return this.bleOptions.sanitizeUUID?function f(Ee){return Ee.replace(/\-/g,"")}(c):c}_connect(){return(0,W.defer)(()=>L(this,void 0,void 0,function*(){try{yield this.peripheral.connect(),this._lwm2mCharc=yield this.setupLwm2mCharacteristic()}catch(c){try{yield this.peripheral.disconnect()}catch(V){A("Failed to propertly disconnect after connection failed",V.message)}throw c}})).pipe((0,ne.share)())}_disconnect(){return(0,W.defer)(()=>L(this,void 0,void 0,function*(){if(this.peripheral)try{yield this.peripheral.disconnect()}catch(c){console.warn("Failed to properly disconnect from peripheral",c)}this._lwm2mCharc=void 0})).pipe((0,ne.share)())}setupLwm2mCharacteristic(){return L(this,void 0,void 0,function*(){const c=[this.sanitizeUUID(K.services.lwm2m.service)];"large-frame"===this.bleOptions.preferedComServiceType&&c.push(this.sanitizeUUID(K.services.fastLwm2m.service));const V=yield this.peripheral.discoverServices(c);A("Found services ",Object.keys(V).join(", "),"asked for services: ",c.join(", "));const H=yield this._selectLwm2mCharacteristic(V);return yield H.enableNotifications(!0),H})}_selectLwm2mCharacteristic(c){return L(this,void 0,void 0,function*(){const V=this.sanitizeUUID(K.services.fastLwm2m.service),H=this.sanitizeUUID(K.services.lwm2m.service);if("legacy"===this.bleOptions.preferedComServiceType&&c[H])return A("Force usage of legacy lwm2m characteristic UUID: "+H),this._getLegacyLwm2mCharacteristic(c[H]);if(c[V])return A("Found fast lwm2m characteristic UUID: "+V),this._getLargeFrameLwm2mCharacteristic(c[V]);if(c[H])return A("Found legacy lwm2m characteristic UUID: "+H),this._getLegacyLwm2mCharacteristic(c[H]);throw A(`No LwM2M service found. Available services: ${Object.keys(c).join(", ")}`),I.serviceNotFound(H)})}_getLargeFrameLwm2mCharacteristic(c){return L(this,void 0,void 0,function*(){return this._useSplitter=!1,yield c.getCharacteristic(this.sanitizeUUID(K.services.fastLwm2m.charac))})}_getLegacyLwm2mCharacteristic(c){return L(this,void 0,void 0,function*(){return this._useSplitter=!0,yield c.getCharacteristic(this.sanitizeUUID(K.services.lwm2m.charac))})}read(){return L(this,void 0,void 0,function*(){return this._readPromise||(this._readPromise=this._createReadPromise()),this._readPromise})}readUnit(){return L(this,void 0,void 0,function*(){try{return(yield this.lwm2mCharc.data.pipe((0,ne.first)(),(0,ne.map
1)(V=>V.data)).toPromise())||new Uint8Array}catch(c){return Promise.reject(c)}})}write(c){return L(this,void 0,void 0,function*(){if(this._readPromise=this._createReadPromise(),!this.useSplitter)return this.writeUnit(c);{const V=Y.wrapWithChecksum(c,this.chunkSize).getPackets();for(const H of V)yield this.writeUnit(H)}})}get useSplitter(){return this._useSplitter}get chunkSize(){return K.maxPacketLengthWithoutOffset}writeUnit(c){return L(this,void 0,void 0,function*(){try{if(void 0!==this.bleOptions.mtu&&c.length>this.bleOptions.mtu)throw I.writeSizeAboveMTU(c,this.bleOptions.mtu);if(this.bleOptions.waitForWriteAcknowledge)return this.lwm2mCharc.write(c,!0);this.lwm2mCharc.write(c,!0).catch(V=>{console.warn("Write error ignored",V)})}catch(V){return Promise.reject(V)}})}_createReadPromise(){return L(this,void 0,void 0,function*(){if(this.useSplitter){const c=new se(this.bleOptions.maximumBufferLength);for(;!c.hasAllChunks();){const V=yield this.readUnit();c.append(V)}if(c.isChecksumValid())return c.getData();throw I.invalidBleChunkChecksum(c)}return this.readUnit()})}}},59689:(Ce,he,a)=>{a.d(he,{B:()=>Y});var p=a(78172),P=a(70282),z=a(15730),b=a(93162),y=a(832),te=a(40482);const fe=(0,z.createDebugger)("@iotize/tap/protocol/common");class F{constructor(){this.connectionState=p.K.DISCONNECTED,this._options={connect:{timeout:1e3},disconnect:{timeout:1e3},send:{timeout:500}}}get options(){return this._options}set options(A){this._options=A}getConnectionState(){return this.connectionState}isConnected(){return this.connectionState==p.K.CONNECTED}setConnectionState(A){fe("ComProtocol","setConnectionState",p.K[A],"Old: ",p.K[this.connectionState]);let I={newState:A,oldState:this.connectionState};return this.connectionState=A,this._connectionStateChange&&this._connectionStateChange.next(I),this}receiveStream(){throw new Error("Method not implemented.")}onConnectionStateChange(){return this._connectionStateChange||(this._connectionStateChange=new P.Subject),this._connectionStateChange}}var K=function(ce,A,I,Q){return new(I||(I=Promise))(function(g,f){function L(Ee){try{Re(Q.next(Ee))}catch(c){f(c)}}function Pe(Ee){try{Re(Q.throw(Ee))}catch(c){f(c)}}function Re(Ee){Ee.done?g(Ee.value):function ee(g){return g instanceof I?g:new I(function(f){f(g)})}(Ee.value).then(L,Pe)}Re((Q=Q.apply(ce,A||[])).next())})};const se="ComProtocol";class Y extends F{constructor(){super(),this._jobQueue=new y.TaskQueue}_send(A,I){return(0,P.defer)(()=>K(this,void 0,void 0,function*(){if(!this.isConnected())throw p.o.Errors.notConnected({protocol:this});let Q=new Date;yield(0,b.promiseTimeout)(I.timeout,this.write(A),L=>p.o.Errors.timeoutError({msg:`Communication timeout. Send request to device device timeout (${L.timeout}ms).`,protocol:this,timeout:L.timeout,startTime:L.startTime}));let ee=(new Date).getTime()-Q.getTime(),g=I.timeout-ee;return yield(0,b.promiseTimeout)(g,this.read(),L=>p.o.Errors.timeoutError({msg:`Communication timeout. Read response from device timeout (${g}ms).`,protocol:this,timeout:g,startTime:L.startTime}))})).pipe((0,te.share)())}cancel(){fe(se,"Canceling operations"),this._jobQueue.cancelAll(p.o.Errors.operationCanceled())}send(A,I){return A=A.slice(0),this._jobQueue.addExecutor(()=>{let Q=I?I.timeout:this._options.send.timeout;return this._send(A,{timeout:Q})})}connect(A){if(this.connectionState===p.K.CONNECTED)return fe(se,"QueueComProtocol is already connected"),(0,P.of)(null);if(this._connect$)return fe(se,"QueueComProtocol is already connecting..."),this._connect$;if(this._disconnect$)return(0,P.throwError)(p.o.Errors.operationInProgress("Failed to connect as disconnection is in progress"));let I=A?A.timeout:this._options.connect.timeout;return this._connect$=(0,P.defer)(()=>{this.setConnectionState(p.K.CONNECTING);let Q=new Date;return this._connect(A).pipe((0,te.timeoutWith)(I,(0,P.throwError)(p.o.Errors.timeoutError({msg:"Protocol connection timeout",protocol:this,timeout:I,startTime:Q}))))}).pipe((0,te.tap)({complete:()=>{this.setConnectionState(p.K.CONNECTED)},error:()=>{this.setConnectionState(p.K.DISCONNECTED)}}),(0,te.finalize)(()=>{this._connect$=void 0}),(0,te.share)()),this._connect$}disconnect(A){if(this.connectionState===p.K.DISCONNECTED)return fe(se,"QueueComProtocol is already disconnected"),(0,P.of)();if(this._disconnect$)return this._disconnect$;if(this._connect$)return(0,P.throwError)(p.o.Errors.operationInProgress("Failed to disconnect as connection is in progress"));let I=A?A.timeout:this._options.disconnect.timeout;return this._disconnect$=(0,P.defer)(()=>K(this,void 0,void 0,function*(){this.setConnectionState(p.K.DISCONNECTING)})).pipe((0,te.switchMap)(()=>{let Q=new Date;return this._disconnect(A).pipe((0,te.timeoutWith)(I,(0,P.throwError)(p.o.Errors.timeoutError({msg:"Protocol disconnection timeout",protocol:this,timeout:I,startTime:Q}))),(0,te.finalize)(()=>{this.setConnectionState(p.K.DISCONNECTED),this._disconnect$=void 0}))}),(0,te.share)()),this._disconnect$}}},93878:(Ce,he,a)=>{a.d(he,{$e$:()=>it,lhq:()=>pt});var p=a(49697),P=a(83355),u=a(20432),z=Object.freeze({__proto__:null});const m=Object.assign(Object.assign({}
1,u.m),z),b={getAddress:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/ble/address",path:"/1024//22",responseBodyDecoder:m.stringMacaddress}};class w extends p.AbstractService{constructor(){super(...arguments),this.resources=b}getAddress(){return this.serviceCallRunner.execute(this.getAddressCall())}getAddressCall(){return Object.assign({},this.resources.getAddress)}}const y=(0,p.extendServiceContainer)("ble",w);var te=a(53566),ie=a(42561),W=a(67333),fe=a(17819);W.TapStreamReader.prototype.readDataLogOption=function(){const me={};return this.forwardBits(6),me.security=this.readBoolean(1),me.qos=this.readBoolean(1),this.forwardBits(5),me.logOnChange=this.readBoolean(1),me.rollingMode=this.readBoolean(1),me.autorun=this.readBoolean(1),me},W.TapStreamWriter.prototype.writeDataLogOption=function(me){return this.forwardBits(6),this.writeBoolean(me.security,1),this.writeBoolean(me.qos,1),this.forwardBits(5),this.writeBoolean(me.logOnChange,1),this.writeBoolean(me.rollingMode,1),this.writeBoolean(me.autorun,1),this};const F=new class ne{encode(R,X=new W.TapStreamWriter){return X.writeDataLogOption(R),X.toBytes}decode(R){return(R instanceof W.TapStreamReader?R:W.TapStreamReader.create(R)).readDataLogOption()}};var K=Object.freeze({__proto__:null,dataLogOption:F});const se=Object.assign(Object.assign(Object.assign({},u.m),K),fe.iU),Y={getMaxPacketCount:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/data-log/max-packet-count",path:"/1024//23",responseBodyDecoder:se.uint16},isRunning:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/data-log/run",path:"/1031//0",responseBodyDecoder:se.boolean},run:{method:P.TapRequestFrame.MethodType.POST,pathAlias:"/data-log/run",path:"/1031//0"},stop:{method:P.TapRequestFrame.MethodType.POST,pathAlias:"/data-log/stop",path:"/1031//1"},getOptions:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/data-log/options",path:"/1031//2",responseBodyDecoder:se.dataLogOption},putOptions:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/data-log/options",path:"/1031//2",bodyEncoder:se.dataLogOption},putCryptoKey:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/data-log/crypto-key",path:"/1031//3"},flush:{method:P.TapRequestFrame.MethodType.POST,pathAlias:"/data-log/flush",path:"/1031//4"},getPacketCount:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/data-log/packet-count",path:"/1031//10",responseBodyDecoder:se.uint16},dequeueOnePacket:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/data-log/dequeue-packet",path:"/1031//11",responseBodyDecoder:se.singlePacket}};class ce extends p.AbstractService{constructor(){super(...arguments),this.resources=Y}getMaxPacketCount(){return this.serviceCallRunner.execute(this.getMaxPacketCountCall())}getMaxPacketCountCall(){return Object.assign({},this.resources.getMaxPacketCount)}isRunning(){return this.serviceCallRunner.execute(this.isRunningCall())}isRunningCall(){return Object.assign({},this.resources.isRunning)}run(){return this.serviceCallRunner.execute(this.runCall())}runCall(){return Object.assign({},this.resources.run)}stop(){return this.serviceCallRunner.execute(this.stopCall())}stopCall(){return Object.assign({},this.resources.stop)}getOptions(){return this.serviceCallRunner.execute(this.getOptionsCall())}getOptionsCall(){return Object.assign({},this.resources.getOptions)}putOptions(R){return this.serviceCallRunner.execute(this.putOptionsCall(R))}putOptionsCall(R){const X=Object.assign({},this.resources.putOptions);return X.body=R,X}putCryptoKey(R){return this.serviceCallRunner.execute(this.putCryptoKeyCall(R))}putCryptoKeyCall(R){const X=Object.assign({},this.resources.putCryptoKey);return X.body=R,X}flush(){return this.serviceCallRunner.execute(this.flushCall())}flushCall(){return Object.assign({},this.resources.flush)}getPacketCount(){return this.serviceCallRunner.execute(this.getPacketCountCall())}getPacketCountCall(){return Object.assign({},this.resources.getPacketCount)}dequeueOnePacket(){return this.serviceCallRunner.execute(this.dequeueOnePacketCall())}dequeueOnePacketCall(){return Object.assign({},this.resources.dequeueOnePacket)}}const A=(0,p.extendServiceContainer)("dataLog",ce);var Q=a(36184),ee=a(3827),g=Object.freeze({__proto__:null});const f=Object.assign(Object.assign({}
1,u.m),g),L={getName:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/group/{groupId}/name",path:"/1025/{groupId}/0",responseBodyDecoder:f.ascii},putName:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/group/{groupId}/name",path:"/1025/{groupId}/0",bodyEncoder:f.ascii},changePassword:{method:P.TapRequestFrame.MethodType.POST,pathAlias:"/group/{groupId}/password",path:"/1025/{groupId}/2",bodyEncoder:f.ascii},changePasswordKey:{method:P.TapRequestFrame.MethodType.POST,pathAlias:"/group/{groupId}/password-key",path:"/1025/{groupId}/2"},getSessionLifetime:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/group/{groupId}/session-lifetime",path:"/1025/{groupId}/4",responseBodyDecoder:f.uint16},putSessionLifetime:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/group/{groupId}/session-lifetime",path:"/1025/{groupId}/4",bodyEncoder:f.uint16},getAlias:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/group/{groupId}/alias",path:"/1025/{groupId}/5",responseBodyDecoder:f.uint16},putAlias:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/group/{groupId}/alias",path:"/1025/{groupId}/5",bodyEncoder:f.uint16},create:{method:P.TapRequestFrame.MethodType.POST,pathAlias:"/group/{groupId}/create",path:"/1025/{groupId}/65535"}};class Pe extends p.AbstractService{constructor(){super(...arguments),this.resources=L}getName(R){return this.serviceCallRunner.execute(this.getNameCall(R))}getNameCall(R){const X=Object.assign({},this.resources.getName);return X.pathParameters={groupId:R},X}putName(R,X){return this.serviceCallRunner.execute(this.putNameCall(R,X))}putNameCall(R,X){const Fe=Object.assign({},this.resources.putName);return Fe.body=X,Fe.pathParameters={groupId:R},Fe}changePassword(R,X){return this.serviceCallRunner.execute(this.changePasswordCall(R,X))}changePasswordCall(R,X){const Fe=Object.assign({},this.resources.changePassword);return Fe.body=X,Fe.pathParameters={groupId:R},Fe}changePasswordKey(R,X){return this.serviceCallRunner.execute(this.changePasswordKeyCall(R,X))}changePasswordKeyCall(R,X){const Fe=Object.assign({},this.resources.changePasswordKey);return Fe.body=X,Fe.pathParameters={groupId:R},Fe}getSessionLifetime(R){return this.serviceCallRunner.execute(this.getSessionLifetimeCall(R))}getSessionLifetimeCall(R){const X=Object.assign({},this.resources.getSessionLifetime);return X.pathParameters={groupId:R},X}putSessionLifetime(R,X){return this.serviceCallRunner.execute(this.putSessionLifetimeCall(R,X))}putSessionLifetimeCall(R,X){const Fe=Object.assign({},this.resources.putSessionLifetime);return Fe.body=X,Fe.pathParameters={groupId:R},Fe}getAlias(R){return this.serviceCallRunner.execute(this.getAliasCall(R))}getAliasCall(R){const X=Object.assign({},this.resources.getAlias);return X.pathParameters={groupId:R},X}putAlias(R,X){return this.serviceCallRunner.execute(this.putAliasCall(R,X))}putAliasCall(R,X){const Fe=Object.assign({},this.resources.putAlias);return Fe.body=X,Fe.pathParameters={groupId:R},Fe}create(R){return this.serviceCallRunner.execute(this.createCall(R))}createCall(R){const X=Object.assign({},this.resources.create);return X.pathParameters={groupId:R},X}}const Re=(0,p.extendServiceContainer)("group",Pe);var c=a(82367),V=Object.freeze({__proto__:null});const H=Object.assign(Object.assign({},u.m),V),ge={getCodeSize:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/jvm/code-size",path:"/1024//73",responseBodyDecoder:H.uint32},putCodeSize:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/jvm/code-size",path:"/1024//73",bodyEncoder:H.uint32},appendCode:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/jvm/code",append:!0,path:"/1024//74"},clearCode:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/jvm/clear-code",path:"/1024//74"},getProfileId:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/jvm/profile-id",path:"/1024//66",responseBodyDecoder:H.uint16},putProfileId:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/jvm/profile-id",path:"/1024//66",bodyEncoder:H.uint16},getLogAndClear:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/jvm/log-and-clear",path:"/1024//120",responseBodyDecoder:H.ascii}
1,clearLog:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/jvm/log-and-clear",path:"/1024//120"},getLog:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/jvm/log",path:"/1024//121",responseBodyDecoder:H.ascii},putLog:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/jvm/log",path:"/1024//121",bodyEncoder:H.ascii},getErrorCode:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/jvm/error-code",path:"/3//14",responseBodyDecoder:H.uint32},postErrorCode:{method:P.TapRequestFrame.MethodType.POST,pathAlias:"/jvm/error-code",path:"/3//14",bodyEncoder:H.uint32}};class N extends p.AbstractService{constructor(){super(...arguments),this.resources=ge}getCodeSize(){return this.serviceCallRunner.execute(this.getCodeSizeCall())}getCodeSizeCall(){return Object.assign({},this.resources.getCodeSize)}putCodeSize(R){return this.serviceCallRunner.execute(this.putCodeSizeCall(R))}putCodeSizeCall(R){const X=Object.assign({},this.resources.putCodeSize);return X.body=R,X}appendCode(R){return this.serviceCallRunner.execute(this.appendCodeCall(R))}appendCodeAppendCalls(R,X){return this.serviceCallRunner.createAppendCalls(this.appendCodeCall(R),X)}appendCodeCall(R){const X=Object.assign({},this.resources.appendCode);return X.body=R,X}clearCode(){return this.serviceCallRunner.execute(this.clearCodeCall())}clearCodeCall(){return Object.assign({},this.resources.clearCode)}getProfileId(){return this.serviceCallRunner.execute(this.getProfileIdCall())}getProfileIdCall(){return Object.assign({},this.resources.getProfileId)}putProfileId(R){return this.serviceCallRunner.execute(this.putProfileIdCall(R))}putProfileIdCall(R){const X=Object.assign({},this.resources.putProfileId);return X.body=R,X}getLogAndClear(){return this.serviceCallRunner.execute(this.getLogAndClearCall())}getLogAndClearCall(){return Object.assign({},this.resources.getLogAndClear)}clearLog(){return this.serviceCallRunner.execute(this.clearLogCall())}clearLogCall(){return Object.assign({},this.resources.clearLog)}getLog(){return this.serviceCallRunner.execute(this.getLogCall())}getLogCall(){return Object.assign({},this.resources.getLog)}putLog(R){return this.serviceCallRunner.execute(this.putLogCall(R))}putLogCall(R){const X=Object.assign({},this.resources.putLog);return X.body=R,X}getErrorCode(){return this.serviceCallRunner.execute(this.getErrorCodeCall())}getErrorCodeCall(){return Object.assign({},this.resources.getErrorCode)}postErrorCode(R){return this.serviceCallRunner.execute(this.postErrorCodeCall(R))}postErrorCodeCall(R){const X=Object.assign({},this.resources.postErrorCode);return X.body=R,X}}const G=(0,p.extendServiceContainer)("jvm",N);W.TapStreamReader.prototype.readLoraConfig=function(){const me={};return me.classA=this.readBoolean(1),me.classB=this.readBoolean(1),me.classC=this.readBoolean(1),me.dataLoggingEnabled=this.readBoolean(1),me.singlePacketEnabled=this.readBoolean(1),me},W.TapStreamWriter.prototype.writeLoraConfig=function(me){return this.writeBoolean(me.classA,1),this.writeBoolean(me.classB,1),this.writeBoolean(me.classC,1),this.writeBoolean(me.dataLoggingEnabled,1),this.writeBoolean(me.singlePacketEnabled,1),this};const E=new class T{encode(R,X=new W.TapStreamWriter){return X.writeLoraConfig(R),X.toBytes}decode(R){return(R instanceof W.TapStreamReader?R:W.TapStreamReader.create(R)).readLoraConfig()}};var h=Object.freeze({__proto__:null,loraConfig:E});const k=Object.assign(Object.assign({},u.m),h),_={getIds:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/lora/ids",path:"/1024//90"},putIds:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/lora/ids",path:"/1024//90"},getConfig:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/lora/config",path:"/1024//91",responseBodyDecoder:k.loraConfig},putConfig:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/lora/config",path:"/1024//91",bodyEncoder:k.loraConfig}};class ue extends p.AbstractService{constructor(){super(...arguments),this.resources=_}getIds(){return this.serviceCallRunner.execute(this.getIdsCall())}getIdsCall(){return Object.assign({},this.resources.getIds)}putIds(R){return this.serviceCallRunner.execute(this.putIdsCall(R))}putIdsCall(R){const X=Object.assign({},this.resources.putIds);return X.body=R,X}getConfig(){return this.serviceCallRunner.execute(this.getConfigCall())}getConfigCall(){return Object.assign({},this.resources.getConfig)}putConfig(R){return this.serviceCallRunner.execute(this.putConfigCall(R))}putConfigCall(R){const X=Object.assign({},this.resources.putConfig);return X.body=R,X}}const ae=(0,p.extendServiceContainer)("lora",ue);var Te=Object.freeze({__proto__:null});const S=Object.assign(Object.assign({}
1,u.m),Te),v={getClientId:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/mqtt/client-id",path:"/1024//52",responseBodyDecoder:S.ascii},putClientId:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/mqtt/client-id",path:"/1024//52",bodyEncoder:S.ascii},getUsername:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/mqtt/username",path:"/1024//53",responseBodyDecoder:S.ascii},putUsername:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/mqtt/username",path:"/1024//53",bodyEncoder:S.ascii},getBrokerHostname:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/mqtt/broker-hostname",path:"/1024//50",responseBodyDecoder:S.ascii},putBrokerHostname:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/mqtt/broker-hostname",path:"/1024//50",bodyEncoder:S.ascii},getBrokerPort:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/mqtt/broker-port",path:"/1024//51",responseBodyDecoder:S.ascii},putBrokerPort:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/mqtt/broker-port",path:"/1024//51",bodyEncoder:S.ascii},getPassword:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/mqtt/password",path:"/1024//54",responseBodyDecoder:S.ascii},putPassword:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/mqtt/password",path:"/1024//54",bodyEncoder:S.ascii},getRelayNetKey:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/mqtt/relay-net-key",path:"/1024//55",responseBodyDecoder:S.ascii},putRelayNetKey:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/mqtt/relay-net-key",path:"/1024//55",bodyEncoder:S.ascii},putBrokerCertificate:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/mqtt/broker-certificate",append:!0,path:"/1024//57"},getTopicPrefix:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/mqtt/topic-prefix",path:"/1024//58",responseBodyDecoder:S.ascii},putTopicPrefix:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/mqtt/topic-prefix",path:"/1024//58",bodyEncoder:S.ascii},getRequestTopic:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/mqtt/request-topic",path:"/1024//58",responseBodyDecoder:S.ascii},putRequestTopic:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/mqtt/request-topic",path:"/1024//58",bodyEncoder:S.ascii},getResponseTopic:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/mqtt/response-topic",path:"/1024//59",responseBodyDecoder:S.ascii},putResponseTopic:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/mqtt/response-topic",path:"/1024//59",bodyEncoder:S.ascii}};class q extends p.AbstractService{constructor(){super(...arguments),this.resources=v}getClientId(){return this.serviceCallRunner.execute(this.getClientIdCall())}getClientIdCall(){return Object.assign({},this.resources.getClientId)}putClientId(R){return this.serviceCallRunner.execute(this.putClientIdCall(R))}putClientIdCall(R){const X=Object.assign({},this.resources.putClientId);return X.body=R,X}getUsername(){return this.serviceCallRunner.execute(this.getUsernameCall())}getUsernameCall(){return Object.assign({},this.resources.getUsername)}putUsername(R){return this.serviceCallRunner.execute(this.putUsernameCall(R))}putUsernameCall(R){const X=Object.assign({},this.resources.putUsername);return X.body=R,X}getBrokerHostname(){return this.serviceCallRunner.execute(this.getBrokerHostnameCall())}getBrokerHostnameCall(){return Object.assign({},this.resources.getBrokerHostname)}putBrokerHostname(R){return this.serviceCallRunner.execute(this.putBrokerHostnameCall(R))}putBrokerHostnameCall(R){const X=Object.assign({},this.resources.putBrokerHostname);return X.body=R,X}getBrokerPort(){return this.serviceCallRunner.execute(this.getBrokerPortCall())}getBrokerPortCall(){return Object.assign({},this.resources.getBrokerPort)}putBrokerPort(R){return this.serviceCallRunner.execute(this.putBrokerPortCall(R))}putBrokerPortCall(R){const X=Object.assign({},this.resources.putBrokerPort);return X.body=R,X}getPassword(){return this.serviceCallRunner.execute(this.getPasswordCall())}getPasswordCall(){return Object.assign({},this.resources.getPassword)}putPassword(R){return this.serviceCallRunner.execute(this.putPasswordCall(R))}putPasswordCall(R){const X=Object.assign({},this.resources.putPassword);return X.body=R,X}getRelayNetKey(){return this.serviceCallRunner.execute(this.getRelayNetKeyCall())}getRelayNetKeyCall(){return Object.assign({},this.resources.getRelayNetKey)}putRelayNetKey(R){return this.serviceCallRunner.execute(this.putRelayNetKeyCall(R))}putRelayNetKeyCall(R){const X=Object.assign({},this.resources.putRelayNetKey);return X.body=R,X}putBrokerCertificate(R){return this.serviceCallRunner.execute(this.putBrokerCertificateCall(R))}putBrokerCertificateAppendCalls(R,X){return this.serviceCallRunner.createAppendCalls(this.putBrokerCertificateCall(R),X)}putBrokerCertificateCall(R){const X=Object.assign({},this.resources.putBrokerCertificate);return X.body=R,X}getTopicPrefix(){return this.serviceCallRunner.execute(this.getTopicPrefixCall())}getTopicPrefixCall(){return Object.assign({},this.resources.getTopicPrefix)}putTopicPrefix(R){return this.serviceCallRunner.execute(this.putTopicPrefixCall(R))}putTopicPrefixCall(R){const X=Object.assign({},this.resources.putTopicPrefix);return X.body=R,X}getRequestTopic(){return this.serviceCallRunner.execute(this.getRequestTopicCall())}getRequestTopicCall(){return Object.assign({},this.resources.getRequestTopic)}putRequestTopic(R){return this.serviceCallRunner.execute(this.putRequestTopicCall(R))}putRequestTopicCall(R){const X=Object.assign({},this.resources.putRequestTopic);return X.body=R,X}getResponseTopic(){return this.serviceCallRunner.execute(this.getResponseTopicCall())}getResponseTopicCall(){return Object.assign({},this.resources.getResponseTopic)}
1putResponseTopic(R){return this.serviceCallRunner.execute(this.putResponseTopicCall(R))}putResponseTopicCall(R){const X=Object.assign({},this.resources.putResponseTopic);return X.body=R,X}}const ve=(0,p.extendServiceContainer)("mqtt",q);var O=a(36570),s=a(50951),d=a(41886),Oe=a(82382),Ie=a(35431);W.TapStreamReader.prototype.readLocalTime=function(){const me={};return me.seconds=this.readUnsigned(4),me.minutes=this.readUnsigned(4),me.hours=this.readUnsigned(4),me.dayOfMonth=this.readUnsigned(4),me.month=this.readUnsigned(4),me.year=this.readUnsigned(4),me.dayOfWeek=this.readUnsigned(4),me.dayOfYear=this.readUnsigned(4),me.isdst=this.readUnsigned(4),me},W.TapStreamWriter.prototype.writeLocalTime=function(me){return this.writeUnsigned(me.seconds,4),this.writeUnsigned(me.minutes,4),this.writeUnsigned(me.hours,4),this.writeUnsigned(me.dayOfMonth,4),this.writeUnsigned(me.month,4),this.writeUnsigned(me.year,4),this.writeUnsigned(me.dayOfWeek,4),this.writeUnsigned(me.dayOfYear,4),this.writeUnsigned(me.isdst,4),this};const B=new class Be{encode(R,X=new W.TapStreamWriter){return X.writeLocalTime(R),X.toBytes}decode(R){return(R instanceof W.TapStreamReader?R:W.TapStreamReader.create(R)).readLocalTime()}};var M=Object.freeze({__proto__:null,localTime:B});const U=Object.assign(Object.assign({},u.m),M),pe={getNtpServer:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/time/ntp-server",path:"/1024//77",responseBodyDecoder:U.ascii},putNtpServer:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/time/ntp-server",path:"/1024//77",bodyEncoder:U.ascii},getTimeZone:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/time/time-zone",path:"/1024//78",responseBodyDecoder:U.ascii},putTimeZone:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/time/time-zone",path:"/1024//78",bodyEncoder:U.ascii},getLocalTime:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/time/local-time",path:"/1024//79",responseBodyDecoder:U.localTime}};class de extends p.AbstractService{constructor(){super(...arguments),this.resources=pe}getNtpServer(){return this.serviceCallRunner.execute(this.getNtpServerCall())}getNtpServerCall(){return Object.assign({},this.resources.getNtpServer)}putNtpServer(R){return this.serviceCallRunner.execute(this.putNtpServerCall(R))}putNtpServerCall(R){const X=Object.assign({},this.resources.putNtpServer);return X.body=R,X}getTimeZone(){return this.serviceCallRunner.execute(this.getTimeZoneCall())}getTimeZoneCall(){return Object.assign({},this.resources.getTimeZone)}putTimeZone(R){return this.serviceCallRunner.execute(this.putTimeZoneCall(R))}putTimeZoneCall(R){const X=Object.assign({},this.resources.putTimeZone);return X.body=R,X}getLocalTime(){return this.serviceCallRunner.execute(this.getLocalTimeCall())}getLocalTimeCall(){return Object.assign({},this.resources.getLocalTime)}}const be=(0,p.extendServiceContainer)("time",de);var Le=Object.freeze({__proto__:null});const qe=Object.assign(Object.assign({},u.m),Le),ke={getIp:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/ethernet/ip",path:"/1024//85",responseBodyDecoder:qe.stringIpv4},putIp:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/ethernet/ip",path:"/1024//85",bodyEncoder:qe.stringIpv4},getGatewayIp:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/ethernet/gateway-ip",path:"/1024//86",responseBodyDecoder:qe.stringIpv4},putGatewayIp:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/ethernet/gateway-ip",path:"/1024//86",bodyEncoder:qe.stringIpv4},getIpMask:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/ethernet/ip-mask",path:"/1024//87",responseBodyDecoder:qe.stringIpv4mask},putIpMask:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/ethernet/ip-mask",path:"/1024//87",bodyEncoder:qe.stringIpv4mask},getHostname:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/ethernet/hostname",path:"/1024//93",responseBodyDecoder:qe.ascii},getDnsIp:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/ethernet/dns-ip",path:"/1024//124",responseBodyDecoder:qe.stringIpv4},putDnsIp:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/ethernet/dns-ip",path:"/1024//124",bodyEncoder:qe.stringIpv4}
1,getEnabled:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/ethernet/enabled",path:"/1024//130",responseBodyDecoder:qe.boolean},putEnabled:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/ethernet/enabled",path:"/1024//130",bodyEncoder:qe.boolean}};class je extends p.AbstractService{constructor(){super(...arguments),this.resources=ke}getIp(){return this.serviceCallRunner.execute(this.getIpCall())}getIpCall(){return Object.assign({},this.resources.getIp)}putIp(R){return this.serviceCallRunner.execute(this.putIpCall(R))}putIpCall(R){const X=Object.assign({},this.resources.putIp);return X.body=R,X}getGatewayIp(){return this.serviceCallRunner.execute(this.getGatewayIpCall())}getGatewayIpCall(){return Object.assign({},this.resources.getGatewayIp)}putGatewayIp(R){return this.serviceCallRunner.execute(this.putGatewayIpCall(R))}putGatewayIpCall(R){const X=Object.assign({},this.resources.putGatewayIp);return X.body=R,X}getIpMask(){return this.serviceCallRunner.execute(this.getIpMaskCall())}getIpMaskCall(){return Object.assign({},this.resources.getIpMask)}putIpMask(R){return this.serviceCallRunner.execute(this.putIpMaskCall(R))}putIpMaskCall(R){const X=Object.assign({},this.resources.putIpMask);return X.body=R,X}getHostname(){return this.serviceCallRunner.execute(this.getHostnameCall())}getHostnameCall(){return Object.assign({},this.resources.getHostname)}getDnsIp(){return this.serviceCallRunner.execute(this.getDnsIpCall())}getDnsIpCall(){return Object.assign({},this.resources.getDnsIp)}putDnsIp(R){return this.serviceCallRunner.execute(this.putDnsIpCall(R))}putDnsIpCall(R){const X=Object.assign({},this.resources.putDnsIp);return X.body=R,X}getEnabled(){return this.serviceCallRunner.execute(this.getEnabledCall())}getEnabledCall(){return Object.assign({},this.resources.getEnabled)}putEnabled(R){return this.serviceCallRunner.execute(this.putEnabledCall(R))}putEnabledCall(R){const X=Object.assign({},this.resources.putEnabled);return X.body=R,X}}const ze=(0,p.extendServiceContainer)("ethernet",je);var Qe=a(379);const it=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},{}),te.EJ),ie.fg),{"/data-log/options":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/DataLogOption"}}},"/data-log/crypto-key":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/Bytes"}}}}),Q.DeviceResourceMetaData),ee.PH),{"/group/{groupId}/name":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:16}}},"/group/{groupId}/session-lifetime":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"integer",format:"uint16",minimum:1}}},"/group/{groupId}/alias":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}}}),c.InterfaceResourceMetaData),{"/jvm/code-size":{put:{minApiVersion:1.9,configModeRequired:!0,schema:{type:"integer",format:"uint32"}}},"/jvm/code":{put:{minApiVersion:1.9,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/Bytes"}}},"/jvm/clear-code":{put:{minApiVersion:1.9,configModeRequired:!0,schema:void 0}},"/jvm/profile-id":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"integer",format:"uint16"}}},"/jvm/log-and-clear":{put:{minApiVersion:2.11,configModeRequired:!0,schema:void 0}},"/jvm/log":{put:{minApiVersion:2.11,configModeRequired:!0,schema:{type:"string"}}}}),{"/lora/ids":{put:{minApiVersion:1,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/Bytes"}}},"/lora/config":{put:{minApiVersion:1,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/LoraConfig"}}}}),{"/mqtt/client-id":{put:{minApiVersion:1.86,configModeRequired:!1,schema:{type:"string",maxLength:32}}},"/mqtt/username":{put:{minApiVersion:1.86,configModeRequired:!1,schema:{type:"string",maxLength:32}}},"/mqtt/broker-hostname":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:64}}}
1,"/mqtt/broker-port":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:32}}},"/mqtt/password":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:32}}},"/mqtt/relay-net-key":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:32}}},"/mqtt/broker-certificate":{put:{minApiVersion:1.86,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/Bytes"}}},"/mqtt/topic-prefix":{put:{minApiVersion:1.86,configModeRequired:!1,schema:{type:"string",maxLength:100}}},"/mqtt/request-topic":{put:{minApiVersion:1.86,configModeRequired:!1,schema:{type:"string",maxLength:100}}},"/mqtt/response-topic":{put:{minApiVersion:1.107,configModeRequired:!1,schema:{type:"string",maxLength:100}}}}),O.SW),fe.m2),s.xM),d.OW),Oe.KQ),Ie.fr),{"/time/ntp-server":{put:{minApiVersion:1.107,configModeRequired:!1,schema:{type:"string",maxLength:100}}},"/time/time-zone":{put:{minApiVersion:1.107,configModeRequired:!1,schema:{type:"string",maxLength:64}}}}),{"/ethernet/ip":{put:{minApiVersion:2.7,configModeRequired:!1,schema:{type:"string",format:"ipv4",examples:["0.0.0.0","192.168.1.134"]}}},"/ethernet/gateway-ip":{put:{minApiVersion:2.7,configModeRequired:!1,schema:{type:"string",format:"ipv4"}}},"/ethernet/ip-mask":{put:{minApiVersion:2.7,configModeRequired:!1,schema:{type:"string",format:"ipv4mask"}}},"/ethernet/dns-ip":{put:{minApiVersion:2.7,configModeRequired:!1,schema:{type:"string",format:"ipv4"}}},"/ethernet/enabled":{put:{minApiVersion:2.7,configModeRequired:!1,schema:{type:"boolean"}}}}),Qe.ml),pt=[y,te.ZR,ie._A,A,Q._TAP_SERVICE_EXTENSION_DEVICE_,ee.W2,Re,c._TAP_SERVICE_EXTENSION_INTERFACE_,G,ae,ve,O.zf,fe.jU,s.mS,d.j2,Oe.t5,Ie.Kg,be,ze,Qe.vY]},20432:(Ce,he,a)=>{a.d(he,{PU:()=>m,m:()=>L,u:()=>z});var p=a(49697),u=a(67333);function z(Pe,Re){return new u.FixedSizeEnumConverter(Pe,Re)}function m(Pe,Re){return new u.EnumListConverter(Re,Pe)}const b=u.StringConverter.ascii(),w=new u.StringConverter("utf8"),y=u.NumberConverter.uint8(),Z=u.NumberConverter.uint16(),te=u.NumberConverter.uint32(),ie=u.NumberConverter.int8(),W=u.NumberConverter.int16(),fe=u.NumberConverter.int32(),ne=u.FloatConverter.instance32(),F=u.BooleanConverter.instanceBit0(),K=u.Ipv4StringConverter.instance(),se=u.Ipv4StringConverter.instance(),Y=u.MacAddressStringConverter.instance(),ce=z(p.VariableFormat,1),A=z(p.HostProtocol,2),I=m(p.HostProtocol,2),Q=z(p.TargetProtocol,1),ee=m(p.TargetProtocol,1),g=new u.StringVersionConverter,f=z(p.CpuFrequencySpeed,1);var L=Object.freeze({__proto__:null,ascii:b,utf8:w,uint8:y,uint16:Z,uint32:te,int8:ie,int16:W,int32:fe,float:ne,boolean:F,stringIpv4:K,stringIpv4mask:se,stringMacaddress:Y,variableFormat:ce,hostProtocol:A,hostProtocolArray:I,targetProtocol:Q,targetProtocolArray:ee,stringVersion:g,cpuFrequencySpeed:f})},53566:(Ce,he,a)=>{a.d(he,{EJ:()=>fe,ZR:()=>W,ac:()=>y});var p=a(49697),u=a(83355),z=a(67333),m=a(20432);z.TapStreamReader.prototype.readReadWriteRights=function(){const ne={};return ne.header=this.readUnsigned(1),ne.groupId=this.readUnsigned(97==(void 0===ne.header?0:ne.header)?2:1),this.forwardBits(6),ne.write=this.readBoolean(1),ne.read=this.readBoolean(1),ne},z.TapStreamWriter.prototype.writeReadWriteRights=function(ne){return this.writeUnsigned(void 0!==ne.header?ne.header:ne.groupId>255?97:65,1),this.writeUnsigned(ne.groupId,97==(void 0===ne.header?0:ne.header)?2:1),this.forwardBits(6),this.writeBoolean(ne.write,1),this.writeBoolean(ne.read,1),this};const w=new class b{encode(F,K=new z.TapStreamWriter){return K.writeReadWriteRights(F),K.toBytes}decode(F){return(F instanceof z.TapStreamReader?F:z.TapStreamReader.create(F)).readReadWriteRights()}};var y=Object.freeze({__proto__:null,readWriteRights:w});const Z=Object.assign(Object.assign({},m.m),y),te={putAcl:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/bundle/{bundleId}/acl",path:"/1028/{bundleId}/0",bodyEncoder:Z.readWriteRights},getValues:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/bundle/{bundleId}/values",path:"/1028/{bundleId}/1"},getDataLogPeriod:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/bundle/{bundleId}/data-log-period",path:"/1028/{bundleId}/2",responseBodyDecoder:Z.uint32}
1,putDataLogPeriod:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/bundle/{bundleId}/data-log-period",path:"/1028/{bundleId}/2",bodyEncoder:Z.uint32},getDataLogCryptoGroupId:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/bundle/{bundleId}/data-log-crypto-group-id",path:"/1028/{bundleId}/3",responseBodyDecoder:Z.uint16},putDataLogCryptoGroupId:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/bundle/{bundleId}/data-log-crypto-group-id",path:"/1028/{bundleId}/3",bodyEncoder:Z.uint16},create:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/bundle/{bundleId}/create",path:"/1028/{bundleId}/65535"},getName:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/bundle/{bundleId}/name",path:"/1028/{bundleId}/4",responseBodyDecoder:Z.ascii},putName:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/bundle/{bundleId}/name",path:"/1028/{bundleId}/4",bodyEncoder:Z.ascii}};class ie extends p.AbstractService{constructor(){super(...arguments),this.resources=te}putAcl(F,K){return this.serviceCallRunner.execute(this.putAclCall(F,K))}putAclCall(F,K){const se=Object.assign({},this.resources.putAcl);return se.body=K,se.pathParameters={bundleId:F},se}getValues(F){return this.serviceCallRunner.execute(this.getValuesCall(F))}getValuesCall(F){const K=Object.assign({},this.resources.getValues);return K.pathParameters={bundleId:F},K}getDataLogPeriod(F){return this.serviceCallRunner.execute(this.getDataLogPeriodCall(F))}getDataLogPeriodCall(F){const K=Object.assign({},this.resources.getDataLogPeriod);return K.pathParameters={bundleId:F},K}putDataLogPeriod(F,K){return this.serviceCallRunner.execute(this.putDataLogPeriodCall(F,K))}putDataLogPeriodCall(F,K){const se=Object.assign({},this.resources.putDataLogPeriod);return se.body=K,se.pathParameters={bundleId:F},se}getDataLogCryptoGroupId(F){return this.serviceCallRunner.execute(this.getDataLogCryptoGroupIdCall(F))}getDataLogCryptoGroupIdCall(F){const K=Object.assign({},this.resources.getDataLogCryptoGroupId);return K.pathParameters={bundleId:F},K}putDataLogCryptoGroupId(F,K){return this.serviceCallRunner.execute(this.putDataLogCryptoGroupIdCall(F,K))}putDataLogCryptoGroupIdCall(F,K){const se=Object.assign({},this.resources.putDataLogCryptoGroupId);return se.body=K,se.pathParameters={bundleId:F},se}create(F){return this.serviceCallRunner.execute(this.createCall(F))}createCall(F){const K=Object.assign({},this.resources.create);return K.pathParameters={bundleId:F},K}getName(F){return this.serviceCallRunner.execute(this.getNameCall(F))}getNameCall(F){const K=Object.assign({},this.resources.getName);return K.pathParameters={bundleId:F},K}putName(F,K){return this.serviceCallRunner.execute(this.putNameCall(F,K))}putNameCall(F,K){const se=Object.assign({},this.resources.putName);return se.body=K,se.pathParameters={bundleId:F},se}}const W=(0,p.extendServiceContainer)("bundle",ie),fe={"/bundle/{bundleId}/acl":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/ReadWriteRights"}}},"/bundle/{bundleId}/data-log-period":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint32"}}},"/bundle/{bundleId}/data-log-crypto-group-id":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/bundle/{bundleId}/name":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"string",maxLength:16,minLength:1}}}}},42561:(Ce,he,a)=>{a.d(he,{PT:()=>m,_A:()=>W,fg:()=>fe});var m,ne,p=a(49697),u=a(83355),z=a(20432);(ne=m||(m={}))[ne.NO_PLATFORM=0]="NO_PLATFORM",ne[ne.IOTIZE=1]="IOTIZE",ne[ne.IBM_BLUEMIX=2]="IBM_BLUEMIX",ne[ne.AMAZON_AWS=3]="AMAZON_AWS",ne[ne.CUSTOM=4]="CUSTOM";const b=(0,z.u)(m,1),w=(0,z.PU)(m,1);var y=Object.freeze({__proto__:null,cloudPlatform:b,cloudPlatformArray:w});const Z=Object.assign(Object.assign({},z.m),y),te={getPlatform:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/cloud/platform",path:"/1024//26",responseBodyDecoder:Z.cloudPlatform},putPlatform:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/cloud/platform",path:"/1024//26",bodyEncoder:Z.cloudPlatform}
1,getDataLogUploadPeriod:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/cloud/data-log/upload-period",path:"/1024//33",responseBodyDecoder:Z.uint32},putDataLogUploadPeriod:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/cloud/data-log/upload-period",path:"/1024//33",bodyEncoder:Z.uint32},getMqttBrokerPort:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/cloud/mqtt/broker-port",path:"/1024//61",responseBodyDecoder:Z.ascii},putMqttBrokerPort:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/cloud/mqtt/broker-port",path:"/1024//61",bodyEncoder:Z.ascii},getMqttClientId:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/cloud/mqtt/client-id",path:"/1024//27",responseBodyDecoder:Z.ascii},putMqttClientId:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/cloud/mqtt/client-id",path:"/1024//27",bodyEncoder:Z.ascii},getMqttUsername:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/cloud/mqtt/username",path:"/1024//28",responseBodyDecoder:Z.ascii},putMqttUsername:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/cloud/mqtt/username",path:"/1024//28",bodyEncoder:Z.ascii},getMqttPassword:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/cloud/mqtt/password",path:"/1024//29",responseBodyDecoder:Z.ascii},putMqttPassword:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/cloud/mqtt/password",path:"/1024//29",bodyEncoder:Z.ascii},getDataLogPublishTopic:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/cloud/data-log/publish-topic",path:"/1024//68",responseBodyDecoder:Z.ascii},putDataLogPublishTopic:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/cloud/data-log/publish-topic",path:"/1024//68",bodyEncoder:Z.ascii},getDataLogSubscribeTopic:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/cloud/data-log/subscribe-topic",path:"/1024//69",responseBodyDecoder:Z.ascii},putDataLogSubscribeTopic:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/cloud/data-log/subscribe-topic",path:"/1024//69",bodyEncoder:Z.ascii}};class ie extends p.AbstractService{constructor(){super(...arguments),this.resources=te}getPlatform(){return this.serviceCallRunner.execute(this.getPlatformCall())}getPlatformCall(){return Object.assign({},this.resources.getPlatform)}putPlatform(F){return this.serviceCallRunner.execute(this.putPlatformCall(F))}putPlatformCall(F){const K=Object.assign({},this.resources.putPlatform);return K.body=F,K}getDataLogUploadPeriod(){return this.serviceCallRunner.execute(this.getDataLogUploadPeriodCall())}getDataLogUploadPeriodCall(){return Object.assign({},this.resources.getDataLogUploadPeriod)}putDataLogUploadPeriod(F){return this.serviceCallRunner.execute(this.putDataLogUploadPeriodCall(F))}putDataLogUploadPeriodCall(F){const K=Object.assign({},this.resources.putDataLogUploadPeriod);return K.body=F,K}getMqttBrokerPort(){return this.serviceCallRunner.execute(this.getMqttBrokerPortCall())}getMqttBrokerPortCall(){return Object.assign({},this.resources.getMqttBrokerPort)}putMqttBrokerPort(F){return this.serviceCallRunner.execute(this.putMqttBrokerPortCall(F))}putMqttBrokerPortCall(F){const K=Object.assign({},this.resources.putMqttBrokerPort);return K.body=F,K}getMqttClientId(){return this.serviceCallRunner.execute(this.getMqttClientIdCall())}getMqttClientIdCall(){return Object.assign({},this.resources.getMqttClientId)}putMqttClientId(F){return this.serviceCallRunner.execute(this.putMqttClientIdCall(F))}putMqttClientIdCall(F){const K=Object.assign({},this.resources.putMqttClientId);return K.body=F,K}getMqttUsername(){return this.serviceCallRunner.execute(this.getMqttUsernameCall())}getMqttUsernameCall(){return Object.assign({},this.resources.getMqttUsername)}putMqttUsername(F){return this.serviceCallRunner.execute(this.putMqttUsernameCall(F))}putMqttUsernameCall(F){const K=Object.assign({},this.resources.putMqttUsername);return K.body=F,K}getMqttPassword(){return this.serviceCallRunner.execute(this.getMqttPasswordCall())}getMqttPasswordCall(){return Object.assign({},this.resources.getMqttPassword)}putMqttPassword(F){return this.serviceCallRunner.execute(this.putMqttPasswordCall(F))}putMqttPasswordCall(F){const K=Object.assign({},this.resources.putMqttPassword);return K.body=F,K}getDataLogPublishTopic(){return this.serviceCallRunner.execute(this.getDataLogPublishTopicCall())}getDataLogPublishTopicCall(){return Object.assign({},this.resources.getDataLogPublishTopic)}
1putDataLogPublishTopic(F){return this.serviceCallRunner.execute(this.putDataLogPublishTopicCall(F))}putDataLogPublishTopicCall(F){const K=Object.assign({},this.resources.putDataLogPublishTopic);return K.body=F,K}getDataLogSubscribeTopic(){return this.serviceCallRunner.execute(this.getDataLogSubscribeTopicCall())}getDataLogSubscribeTopicCall(){return Object.assign({},this.resources.getDataLogSubscribeTopic)}putDataLogSubscribeTopic(F){return this.serviceCallRunner.execute(this.putDataLogSubscribeTopicCall(F))}putDataLogSubscribeTopicCall(F){const K=Object.assign({},this.resources.putDataLogSubscribeTopic);return K.body=F,K}}const W=(0,p.extendServiceContainer)("cloud",ie),fe={"/cloud/platform":{put:{minApiVersion:1,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/CloudPlatform"}}},"/cloud/data-log/upload-period":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"integer",format:"uint32"}}},"/cloud/mqtt/broker-port":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:32}}},"/cloud/mqtt/client-id":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:32}}},"/cloud/mqtt/username":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:32}}},"/cloud/mqtt/password":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:32}}},"/cloud/data-log/publish-topic":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:32}}},"/cloud/data-log/subscribe-topic":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:128}}}}},36184:(Ce,he,a)=>{a.r(he),a.d(he,{AvailablePowerSource:()=>b,DEVICE_SERVICE_CALLS:()=>fe,DeviceCpuFrequencyOptionsConverter:()=>w,DeviceResourceMetaData:()=>K,DeviceService:()=>ne,_TAP_SERVICE_EXTENSION_DEVICE_:()=>F,deviceConverters:()=>ie});var b,se,p=a(49697),u=a(83355),z=a(20432),m=a(67333);(se=b||(b={}))[se.DC_POWER=1]="DC_POWER",se[se.S3P=16]="S3P",se[se.AC_EXTERNAL_POWER=32]="AC_EXTERNAL_POWER",m.TapStreamReader.prototype.readDeviceCpuFrequencyOptions=function(){const se={};return this.forwardBits(6),se.speed=this.readBits(2),se},m.TapStreamWriter.prototype.writeDeviceCpuFrequencyOptions=function(se){return this.forwardBits(6),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(se.speed,p.CpuFrequencySpeed),2),this};class w{encode(Y,ce=new m.TapStreamWriter){return ce.writeDeviceCpuFrequencyOptions(Y),ce.toBytes}decode(Y){return(Y instanceof m.TapStreamReader?Y:m.TapStreamReader.create(Y)).readDeviceCpuFrequencyOptions()}}const y=(0,z.u)(b,1),Z=(0,z.PU)(b,1),te=new w;var ie=Object.freeze({__proto__:null,availablePowerSource:y,availablePowerSourceArray:Z,deviceCpuFrequencyOptions:te});const W=Object.assign(Object.assign({},z.m),ie),fe={getManufacturer:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/manufacturer",path:"/3//0",responseBodyDecoder:W.ascii},getFirmwareFlavor:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/firmware-flavor",path:"/3//1",responseBodyDecoder:W.ascii},getSerialNumber:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/serial-number",path:"/3//2",responseBodyDecoder:W.ascii},getFirmwareVersion:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/firmware-version",path:"/3//3",responseBodyDecoder:W.ascii},reboot:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/device/reboot",path:"/3//4"},factoryReset:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/device/factory-reset",path:"/3//5"},getAvailablePowerSource:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/available-power-source",path:"/3//6",responseBodyDecoder:W.availablePowerSource},getPowerSourceVoltage:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/power-source-voltage",path:"/3//7",responseBodyDecoder:W.uint32},getMemoryFree:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/memory-free",path:"/3//10",responseBodyDecoder:W.uint32},getLastErrorCode:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/last-error-code",path:"/3//11",responseBodyDecoder:W.uint32},postLastErrorCode:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/device/last-error-code",path:"/3//11",bodyEncoder:W.uint32}
1,resetLastErrorCode:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/device/reset-last-error-code",path:"/3//12"},getCurrentTime:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/current-time",path:"/3//13",responseBodyDecoder:W.uint32},setCurrentTime:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/device/current-time",path:"/3//13",bodyEncoder:W.uint32},putCurrentTime:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/device/current-time",path:"/3//13",bodyEncoder:W.uint32},getJvmErrorCode:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/jvm-error-code",path:"/3//14",responseBodyDecoder:W.uint32},setJvmErrorCode:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/device/jvm-error-code",path:"/3//14",bodyEncoder:W.uint32},getInternalStatus:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/internal-status",path:"/3//15",responseBodyDecoder:W.ascii},getCommunicationUid:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/communication-uid",path:"/3//16"},getTemperature:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/temperature",path:"/3//17",responseBodyDecoder:W.int32},getCpuFrequency:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/device/cpu-frequency",path:"/3//141",responseBodyDecoder:W.deviceCpuFrequencyOptions},setCpuFrequency:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/device/cpu-frequency",path:"/3//141",bodyEncoder:W.deviceCpuFrequencyOptions},activateStopMode:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/device/activate-stop-mode",path:"/3//142",bodyEncoder:W.uint8}};class ne extends p.AbstractService{constructor(){super(...arguments),this.resources=fe}getManufacturer(){return this.serviceCallRunner.execute(this.getManufacturerCall())}getManufacturerCall(){return Object.assign({},this.resources.getManufacturer)}getFirmwareFlavor(){return this.serviceCallRunner.execute(this.getFirmwareFlavorCall())}getFirmwareFlavorCall(){return Object.assign({},this.resources.getFirmwareFlavor)}getSerialNumber(){return this.serviceCallRunner.execute(this.getSerialNumberCall())}getSerialNumberCall(){return Object.assign({},this.resources.getSerialNumber)}getFirmwareVersion(){return this.serviceCallRunner.execute(this.getFirmwareVersionCall())}getFirmwareVersionCall(){return Object.assign({},this.resources.getFirmwareVersion)}reboot(){return this.serviceCallRunner.execute(this.rebootCall())}rebootCall(){return Object.assign({},this.resources.reboot)}factoryReset(){return this.serviceCallRunner.execute(this.factoryResetCall())}factoryResetCall(){return Object.assign({},this.resources.factoryReset)}getAvailablePowerSource(){return this.serviceCallRunner.execute(this.getAvailablePowerSourceCall())}getAvailablePowerSourceCall(){return Object.assign({},this.resources.getAvailablePowerSource)}getPowerSourceVoltage(){return this.serviceCallRunner.execute(this.getPowerSourceVoltageCall())}getPowerSourceVoltageCall(){return Object.assign({},this.resources.getPowerSourceVoltage)}getMemoryFree(){return this.serviceCallRunner.execute(this.getMemoryFreeCall())}getMemoryFreeCall(){return Object.assign({},this.resources.getMemoryFree)}getLastErrorCode(){return this.serviceCallRunner.execute(this.getLastErrorCodeCall())}getLastErrorCodeCall(){return Object.assign({},this.resources.getLastErrorCode)}postLastErrorCode(Y){return this.serviceCallRunner.execute(this.postLastErrorCodeCall(Y))}postLastErrorCodeCall(Y){const ce=Object.assign({},this.resources.postLastErrorCode);return ce.body=Y,ce}resetLastErrorCode(){return this.serviceCallRunner.execute(this.resetLastErrorCodeCall())}resetLastErrorCodeCall(){return Object.assign({},this.resources.resetLastErrorCode)}getCurrentTime(){return this.serviceCallRunner.execute(this.getCurrentTimeCall())}getCurrentTimeCall(){return Object.assign({},this.resources.getCurrentTime)}setCurrentTime(Y){return this.serviceCallRunner.execute(this.setCurrentTimeCall(Y))}setCurrentTimeCall(Y){const ce=Object.assign({},this.resources.setCurrentTime);return ce.body=Y,ce}putCurrentTime(Y){return this.serviceCallRunner.execute(this.putCurrentTimeCall(Y))}putCurrentTimeCall(Y){const ce=Object.assign({},this.resources.putCurrentTime);return ce.body=Y,ce}getJvmErrorCode(){return this.serviceCallRunner.execute(this.getJvmErrorCodeCall())}getJvmErrorCodeCall(){return Object.assign({},this.resources.getJvmErrorCode)}setJvmErrorCode(Y){return this.serviceCallRunner.execute(this.setJvmErrorCodeCall(Y))}setJvmErrorCodeCall(Y){const ce=Object.assign({},this.resources.setJvmErrorCode);return ce.body=Y,ce}getInternalStatus(){return this.serviceCallRunner.execute(this.getInternalStatusCall())}getInternalStatusCall(){return Object.assign({},this.resources.getInternalStatus)}getCommunicationUid(){return this.serviceCallRunner.execute(this.getCommunicationUidCall())}getCommunicationUidCall(){return Object.assign({},this.resources.getCommunicationUid)}getTemperature(){return this.serviceCallRunner.execute(this.getTemperatureCall())}getTemperatureCall(){return Object.assign({},this.resources.getTemperature)}getCpuFrequency(){return this.serviceCallRunner.execute(this.getCpuFrequencyCall())}getCpuFrequencyCall(){return Object.assign({},this.resources.getCpuFrequency)}setCpuFrequency(Y){return this.serviceCallRunner.execute(this.setCpuFrequencyCall(Y))}setCpuFrequencyCall(Y){const ce=Object.assign({},this.resources.setCpuFrequency);return ce.body=Y,ce}
1activateStopMode(Y){return this.serviceCallRunner.execute(this.activateStopModeCall(Y))}activateStopModeCall(Y){const ce=Object.assign({},this.resources.activateStopMode);return ce.body=Y,ce}}const F=(0,p.extendServiceContainer)("device",ne),K={"/device/current-time":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint32"}}}}},3827:(Ce,he,a)=>{a.d(he,{Jy:()=>ne,PH:()=>ce,W2:()=>Y,xk:()=>b});var b,A,w,p=a(49697),u=a(83355),z=a(20432),m=a(67333);(A=b||(b={}))[A.LEGACY=0]="LEGACY",A[A.NORMAL=1]="NORMAL",A[A.UPDATING=2]="UPDATING",A[A.UPDATED=4]="UPDATED",function(A){A[A.DEFAULT_VALUE=0]="DEFAULT_VALUE",A[A.UPDATE_SUCCESSFUL=1]="UPDATE_SUCCESSFUL",A[A.NOT_ENOUGH_MEMORY=2]="NOT_ENOUGH_MEMORY",A[A.OUT_OF_MEMORY=4]="OUT_OF_MEMORY",A[A.CONNECTION_LOST=8]="CONNECTION_LOST",A[A.CRC_CHECK_FAILURE=16]="CRC_CHECK_FAILURE",A[A.UNSUPPORTED_PACKAGE_TYPE=32]="UNSUPPORTED_PACKAGE_TYPE",A[A.INVALID_URI=64]="INVALID_URI"}(w||(w={})),m.TapStreamReader.prototype.readCrcCheckBody=function(){const A={};return A.address=this.readUnsigned(4),A.size=this.readUnsigned(4),A.crc=this.readUnsigned(4),A},m.TapStreamWriter.prototype.writeCrcCheckBody=function(A){return this.writeUnsigned(A.address,4),this.writeUnsigned(A.size,4),this.writeUnsigned(A.crc,4),this};const Z=(0,z.u)(b,1),te=(0,z.PU)(b,1),ie=(0,z.u)(w,1),W=(0,z.PU)(w,1),fe=new class y{encode(I,Q=new m.TapStreamWriter){return Q.writeCrcCheckBody(I),Q.toBytes}decode(I){return(I instanceof m.TapStreamReader?I:m.TapStreamReader.create(I)).readCrcCheckBody()}};var ne=Object.freeze({__proto__:null,firmwareState:Z,firmwareStateArray:te,firmwareUpdateResult:ie,firmwareUpdateResultArray:W,crcCheckBody:fe});const F=Object.assign(Object.assign({},z.m),ne),K={postPackage:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/firmware/package",path:"/5//0"},postUpdate:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/firmware/update",path:"/5//2"},getState:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/firmware/state",path:"/5//3",responseBodyDecoder:F.firmwareState},getUpdateResult:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/firmware/update-result",path:"/5//5",responseBodyDecoder:F.firmwareUpdateResult},postCrcCheck:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/firmware/crc-check",path:"/5//6",bodyEncoder:F.crcCheckBody}};class se extends p.AbstractService{constructor(){super(...arguments),this.resources=K}postPackage(){return this.serviceCallRunner.execute(this.postPackageCall())}postPackageCall(){return Object.assign({},this.resources.postPackage)}postUpdate(){return this.serviceCallRunner.execute(this.postUpdateCall())}postUpdateCall(){return Object.assign({},this.resources.postUpdate)}getState(){return this.serviceCallRunner.execute(this.getStateCall())}getStateCall(){return Object.assign({},this.resources.getState)}getUpdateResult(){return this.serviceCallRunner.execute(this.getUpdateResultCall())}getUpdateResultCall(){return Object.assign({},this.resources.getUpdateResult)}postCrcCheck(I){return this.serviceCallRunner.execute(this.postCrcCheckCall(I))}postCrcCheckCall(I){const Q=Object.assign({},this.resources.postCrcCheck);return Q.body=I,Q}}const Y=(0,p.extendServiceContainer)("firmware",se),ce={}},82367:(Ce,he,a)=>{a.r(he),a.d(he,{CpuFrequencyOptionsConverter:()=>K,CpuFrequencySpeed:()=>u.CpuFrequencySpeed,INTERFACE_SERVICE_CALLS:()=>ue,InterfaceResourceMetaData:()=>Ne,InterfaceService:()=>ae,LoginCredentialConverter:()=>W,LoginCredentialHashedConverter:()=>fe,LowPowerOptimizationLevel:()=>y,MultiRequestFrame:()=>ie,MultiRequestFrameConverter:()=>A,MultiResponseFrameConverter:()=>I,NetworkOptionsConverter:()=>Y,NfcConnectionPriority:()=>te,NfcPairingMode:()=>b,PowerOptimizationOptionsConverter:()=>se,ProtocolMaxFrameSizeConverter:()=>ce,SecurityOptionsConverter:()=>ne,ServiceCode:()=>Z,WirelessPairingOptions:()=>w,WirelessPairingOptionsConverter:()=>F,_TAP_SERVICE_EXTENSION_INTERFACE_:()=>ve,interfaceConverters:()=>k});var b,O,w,y,Z,te,ie,p=a(83355),P=a(20432),u=a(49697),m=a(67333);(O=b||(b={}))[O.NO=0]="NO",O[O.MANDATORY=1]="MANDATORY",O[O.MANDATORY_FOR_LOGIN=2]="MANDATORY_FOR_LOGIN",function(O){let s;var d;(d=s=O.NfcPairingMode||(O.NfcPairingMode={}))[d.NO=0]="NO",d[d.MANDATORY=1]="MANDATORY",d[d.MANDATORY_FOR_LOGIN=2]="MANDATORY_FOR_LOGIN"}(w||(w={})),function(O){O[O.NO=0]="NO",O[O.LOW=1]="LOW",O[O.STANDBY=2]="STANDBY",O[O.SHUTDOWN=3]="SHUTDOWN"}(y||(y={})),function(O){O[O.DATALOG=1]="DATALOG",O[O.JVM=2]="JVM"}(Z||(Z={})),function(O){O[O.NFC_PRIORITY=0]="NFC_PRIORITY",O[O.NFC_NON_PRIORITY=1]="NFC_NON_PRIORITY"}(te||(te={})),function(O){let s;var d;(d=s=O.ExpectedResponseStatus||(O.ExpectedResponseStatus={}))[d.SUCCESS=127]="SUCCESS",d[d.ANYTHING=255]="ANYTHING"}(ie||(ie={})),m.TapStreamReader.prototype.readLoginCredential=function(){const O={};return O.username=this.readString(16),O.password=this.readString(16),O},m.TapStreamReader.prototype.readLoginCredentialHashed=function(){const O={};return O.username=this.readString(16),O.password=this.readBytes(16),O},m.TapStreamReader.prototype.readSecurityOptions=function(){const O={};return this.forwardBits(8),this.forwardBits(2),O.maxWakeUpTimeActivated=this.readBoolean(1),O.scramActivated=this.readBoolean(1),O.hashPassword=this.readBoolean(1),O.disableHardwareFactoryReset=this.readBoolean(1),O.disableLoginWithUID=this.readBoolean(1),O.disableResourceFactoryReset=this.readBoolean(1),O},m.TapStreamReader.prototype.readWirelessPairingOptions=function(){const O={};return this.forwardBits(5),O.blePairing=this.readBoolean(1),O.nfcPairingMode=this.readBits(2),O},m.TapStreamReader.prototype.readCpuFrequencyOptions=function(){const O={};return this.forwardBits(6),O.speed=this.readBits(2),O},m.TapStreamReader.prototype.readPowerOptimizationOptions=function(){const O={};return this.forwardBits(4),O.cpuFrequencySpeed=this.readBits(2),O.lowPowerOptimizationLevel=this.readBits(2),O},m.TapStreamReader.prototype.readNetworkOptions=function(){const O={};return this.forwardBits(3),O.radioMixEnabled=this.readBoolean(1),O.lteEnabled=this.readBoolean(1),O.ethernetEnabled=this.readBoolean(1),O.wifiDisabled=this.readBoolean(1),O.wifiNetworkMode=this.readBoolean(1),O},m.TapStreamReader.prototype.readProtocolMaxFrameSize=function(){const O={};return O.request=this.readUnsigned(2),O.response=this.readUnsigned(2),O},m.TapStreamReader.prototype.readMultiRequestFrame=function(){const O={requests:[]};for(;!this.isEof();)O.requests.push(this.readMultiRequestFrameRequestItem());return O},m.TapStreamReader.prototype.readMultiRequestFrameRequestItem=function(){const O={};return O.requestLen=this.readUnsigned(2),O.request=this.subStream(O.requestLen).readTapRequestFrame(),O.expectedResponseStatus=this.readUnsigned(1),O},m.TapStreamReader.prototype.readMultiResponseFrame=function(){const O={responses:[]};for(;!this.isEof();)O.responses.push(this.readMultiResponseFrameResponseItem());return O},m.TapStreamReader.prototype.readMultiResponseFrameResponseItem=function(){const O={};return O.responseLen=this.readUnsigned(2),O.response=this.subStream(O.responseLen).readTapResponseFrame
1(),O},m.TapStreamWriter.prototype.writeLoginCredential=function(O){return this.writeString(O.username,16),this.writeString(O.password,16),this},m.TapStreamWriter.prototype.writeLoginCredentialHashed=function(O){return this.writeString(O.username,16),this.writeBytes(O.password,16),this},m.TapStreamWriter.prototype.writeSecurityOptions=function(O){return this.forwardBits(8),this.forwardBits(2),this.writeBoolean(O.maxWakeUpTimeActivated,1),this.writeBoolean(O.scramActivated,1),this.writeBoolean(O.hashPassword,1),this.writeBoolean(O.disableHardwareFactoryReset,1),this.writeBoolean(O.disableLoginWithUID,1),this.writeBoolean(O.disableResourceFactoryReset,1),this},m.TapStreamWriter.prototype.writeWirelessPairingOptions=function(O){return this.forwardBits(5),this.writeBoolean(O.blePairing,1),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(O.nfcPairingMode,w.NfcPairingMode),2),this},m.TapStreamWriter.prototype.writeCpuFrequencyOptions=function(O){return this.forwardBits(6),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(O.speed,u.CpuFrequencySpeed),2),this},m.TapStreamWriter.prototype.writePowerOptimizationOptions=function(O){return this.forwardBits(4),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(O.cpuFrequencySpeed,u.CpuFrequencySpeed),2),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(O.lowPowerOptimizationLevel,y),2),this},m.TapStreamWriter.prototype.writeNetworkOptions=function(O){return this.forwardBits(3),this.writeBoolean(void 0!==O.radioMixEnabled?O.radioMixEnabled:0,1),this.writeBoolean(void 0!==O.lteEnabled?O.lteEnabled:0,1),this.writeBoolean(void 0!==O.ethernetEnabled?O.ethernetEnabled:0,1),this.writeBoolean(void 0!==O.wifiDisabled?O.wifiDisabled:0,1),this.writeBoolean(void 0!==O.wifiNetworkMode?O.wifiNetworkMode:0,1),this},m.TapStreamWriter.prototype.writeProtocolMaxFrameSize=function(O){return this.writeUnsigned(O.request,2),this.writeUnsigned(O.response,2),this},m.TapStreamWriter.prototype.writeMultiRequestFrame=function(O){for(let s of O.requests)this.writeMultiRequestFrameRequestItem(s);return this},m.TapStreamWriter.prototype.writeMultiRequestFrameRequestItem=function(O){return this.writeUnsigned(O.requestLen,2),this.writeTapRequestFrame(O.request),this.writeUnsigned(O.expectedResponseStatus,1),this},m.TapStreamWriter.prototype.writeMultiResponseFrame=function(O){for(let s of O.responses)this.writeMultiResponseFrameResponseItem(s);return this},m.TapStreamWriter.prototype.writeMultiResponseFrameResponseItem=function(O){return this.writeUnsigned(O.responseLen,2),this.writeTapResponseFrame(O.response),this};class W{encode(s,d=new m.TapStreamWriter){return d.writeLoginCredential(s),d.toBytes}decode(s){return(s instanceof m.TapStreamReader?s:m.TapStreamReader.create(s)).readLoginCredential()}}class fe{encode(s,d=new m.TapStreamWriter){return d.writeLoginCredentialHashed(s),d.toBytes}decode(s){return(s instanceof m.TapStreamReader?s:m.TapStreamReader.create(s)).readLoginCredentialHashed()}}class ne{encode(s,d=new m.TapStreamWriter){return d.writeSecurityOptions(s),d.toBytes}decode(s){return(s instanceof m.TapStreamReader?s:m.TapStreamReader.create(s)).readSecurityOptions()}}class F{encode(s,d=new m.TapStreamWriter){return d.writeWirelessPairingOptions(s),d.toBytes}decode(s){return(s instanceof m.TapStreamReader?s:m.TapStreamReader.create(s)).readWirelessPairingOptions()}}class K{encode(s,d=new m.TapStreamWriter){return d.writeCpuFrequencyOptions(s),d.toBytes}decode(s){return(s instanceof m.TapStreamReader?s:m.TapStreamReader.create(s)).readCpuFrequencyOptions()}}class se{encode(s,d=new m.TapStreamWriter){return d.writePowerOptimizationOptions(s),d.toBytes}decode(s){return(s instanceof m.TapStreamReader?s:m.TapStreamReader.create(s)).readPowerOptimizationOptions()}}class Y{encode(s,d=new m.TapStreamWriter){return d.writeNetworkOptions(s),d.toBytes}decode(s){return(s instanceof m.TapStreamReader?s:m.TapStreamReader.create(s)).readNetworkOptions()}}class ce{encode(s,d=new m.TapStreamWriter){return d.writeProtocolMaxFrameSize(s),d.toBytes}decode(s){return(s instanceof m.TapStreamReader?s:m.TapStreamReader.create(s)).readProtocolMaxFrameSize()}}class A{encode(s,d=new m.TapStreamWriter){return d.writeMultiRequestFrame(s),d.toBytes}decode(s){return(s instanceof m.TapStreamReader?s:m.TapStreamReader.create(s)).readMultiRequestFrame()}}class I{encode(s,d=new m.TapStreamWriter){return d.writeMultiResponseFrame
1(s),d.toBytes}decode(s){return(s instanceof m.TapStreamReader?s:m.TapStreamReader.create(s)).readMultiResponseFrame()}}const Q=new W,ee=new fe,g=new ne,f=(0,P.u)(b,1),L=(0,P.PU)(b,1),Pe=new F,Re=(0,P.u)(y,1),Ee=(0,P.PU)(y,1),c=new K,V=new se,H=(0,P.u)(Z,1),ge=(0,P.PU)(Z,1),N=new Y,G=(0,P.u)(te,1),i=(0,P.PU)(te,1),T=new ce,E=new A,h=new I;var k=Object.freeze({__proto__:null,loginCredential:Q,loginCredentialHashed:ee,securityOptions:g,nfcPairingMode:f,nfcPairingModeArray:L,wirelessPairingOptions:Pe,lowPowerOptimizationLevel:Re,lowPowerOptimizationLevelArray:Ee,cpuFrequencyOptions:c,powerOptimizationOptions:V,serviceCode:H,serviceCodeArray:ge,networkOptions:N,nfcConnectionPriority:G,nfcConnectionPriorityArray:i,protocolMaxFrameSize:T,multiRequestFrame:E,multiResponseFrame:h});const _=Object.assign(Object.assign({},P.m),k),ue={login:{method:p.TapRequestFrame.MethodType.POST,pathAlias:"/interface/login",path:"/1024//0",bodyEncoder:_.loginCredential},loginWithHash:{method:p.TapRequestFrame.MethodType.POST,pathAlias:"/interface/login-with-hash",path:"/1024//0",bodyEncoder:_.loginCredentialHashed},logout:{method:p.TapRequestFrame.MethodType.POST,pathAlias:"/interface/logout",path:"/1024//1"},getCurrentProfileId:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/current-profile/id",path:"/1024//2",responseBodyDecoder:_.uint16},getCurrentHostProtocol:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/current-host-protocol",path:"/1024//3",responseBodyDecoder:_.hostProtocol},putCurrentHostProtocol:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/current-host-protocol",path:"/1024//3",bodyEncoder:_.hostProtocol},getUID:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/uid",path:"/1024//5"},loginWithUID:{method:p.TapRequestFrame.MethodType.POST,pathAlias:"/interface/uid",path:"/1024//5"},keepAlive:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/keep-alive",path:"/1024//4",responseBodyDecoder:_.uint32},postKeepAlive:{method:p.TapRequestFrame.MethodType.POST,pathAlias:"/interface/keep-alive",path:"/1024//4"},getSecurityOptions:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/security-options",path:"/1024//6",responseBodyDecoder:_.securityOptions},putSecurityOptions:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/security-options",path:"/1024//6",bodyEncoder:_.securityOptions},getCurrentGroupId:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/current-group-id",path:"/1024//7",responseBodyDecoder:_.uint16},getBundleIdSwdDirectAccess:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/bundle-id-swd-direct-access",path:"/1024//100",responseBodyDecoder:_.uint16},putBundleIdSwdDirectAccess:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/bundle-id-swd-direct-access",path:"/1024//100",bodyEncoder:_.uint16},getBundleIdSerialAccess:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/bundle-id-serial-access",path:"/1024//101",responseBodyDecoder:_.uint16},putBundleIdSerialAccess:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/bundle-id-serial-access",path:"/1024//101",bodyEncoder:_.uint16},getBundleIdModbusDirectAccess:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/bundle-id-modbus-direct-access",path:"/1024//102",responseBodyDecoder:_.uint16},putBundleIdModbusDirectAccess:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/bundle-id-modbus-direct-access",path:"/1024//102",bodyEncoder:_.uint16},getBundleIdTapnpassControlAccess:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/bundle-id-tapnpass-control-access",path:"/1024//103",responseBodyDecoder:_.uint16},putBundleIdTapnpassControlAccess:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/bundle-id-tapnpass-control-access",path:"/1024//103",bodyEncoder:_.uint16},getBundleIdFirmwareUpdateAccess:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/bundle-id-firmware-update-access",path:"/1024//104",responseBodyDecoder:_.uint16},putBundleIdFirmwareUpdateAccess:{method:p.TapRequestFrame.MethodT
1ype.PUT,pathAlias:"/interface/bundle-id-firmware-update-access",path:"/1024//104",bodyEncoder:_.uint16},getBundleIdMqttIdsAccess:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/bundle-id-mqtt-ids-access",path:"/1024//105",responseBodyDecoder:_.uint16},putBundleIdMqttIdsAccess:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/bundle-id-mqtt-ids-access",path:"/1024//105",bodyEncoder:_.uint16},getBundleIdVariableConfigAccess:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/bundle-id-variable-config-access",path:"/1024//106",responseBodyDecoder:_.uint16},putBundleIdVariableConfigAccess:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/bundle-id-variable-config-access",path:"/1024//106",bodyEncoder:_.uint16},getBundleIdFileSystemAccess:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/bundle-id-file-system-access",path:"/1024//107",responseBodyDecoder:_.uint16},putBundleIdFileSystemAccess:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/bundle-id-file-system-access",path:"/1024//107",bodyEncoder:_.uint16},getConfigFormatVersion:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/config-format-version",path:"/1024//8",responseBodyDecoder:_.uint16},putConfigFormatVersion:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/config-format-version",path:"/1024//8",bodyEncoder:_.uint16},getAppName:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/app-name",path:"/1024//9",responseBodyDecoder:_.ascii},putAppName:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/app-name",path:"/1024//9",bodyEncoder:_.ascii},getConfigVersion:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/config-version",path:"/1024//10",responseBodyDecoder:_.stringVersion},putConfigVersion:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/config-version",path:"/1024//10",bodyEncoder:_.stringVersion},reloadConfig:{method:p.TapRequestFrame.MethodType.POST,pathAlias:"/interface/config-version",path:"/1024//10"},getAppPath:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/app-path",path:"/1024//11",responseBodyDecoder:_.ascii},putAppPath:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/app-path",path:"/1024//11",bodyEncoder:_.ascii},postAppPath:{method:p.TapRequestFrame.MethodType.POST,pathAlias:"/interface/app-path",path:"/1024//11",bodyEncoder:_.ascii},getNfcPairingMode:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/nfc/pairing-mode",path:"/1024//13",responseBodyDecoder:_.nfcPairingMode},putNfcPairingMode:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/nfc/pairing-mode",path:"/1024//13",bodyEncoder:_.nfcPairingMode},getPairingOptions:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/pairing-options",path:"/1024//13",responseBodyDecoder:_.wirelessPairingOptions},postPairingOptions:{method:p.TapRequestFrame.MethodType.POST,pathAlias:"/interface/pairing-options",path:"/1024//13",bodyEncoder:_.wirelessPairingOptions},putPairingOptions:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/pairing-options",path:"/1024//13",bodyEncoder:_.wirelessPairingOptions},getPowerOptimisationLevel:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/power-optimisation-level",path:"/1024//14",responseBodyDecoder:_.lowPowerOptimizationLevel},putPowerOptimisationLevel:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/power-optimisation-level",path:"/1024//14",bodyEncoder:_.lowPowerOptimizationLevel},getCpuFrequencyOptions:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/cpu-frequency-options",path:"/1024//141",responseBodyDecoder:_.cpuFrequencyOptions},putCpuFrequencyOptions:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/cpu-frequency-options",path:"/1024//141",bodyEncoder:_.cpuFrequencySpeed},getPowerOptimisationOptions:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/power-optimisation-options",path:"/1024//142",responseBodyDecoder:_.powerOptimizationOptions}
1,putPowerOptimisationOptions:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/power-optimisation-options",path:"/1024//142",bodyEncoder:_.powerOptimizationOptions},getMaxLowPowerTime:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/max-low-power-time",path:"/1024//33",responseBodyDecoder:_.uint32},putMaxLowPowerTime:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/max-low-power-time",path:"/1024//33",bodyEncoder:_.uint32},getAutoRebootTimeout:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/auto-reboot-timeout",path:"/1024//123",responseBodyDecoder:_.uint16},putAutoRebootTimeout:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/auto-reboot-timeout",path:"/1024//123",bodyEncoder:_.uint16},getAuthorizedHostProtocol:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/authorized-host-protocol",path:"/1024//17",responseBodyDecoder:_.hostProtocolArray},putAuthorizedHostProtocol:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/authorized-host-protocol",path:"/1024//17",bodyEncoder:_.hostProtocolArray},getConfigFormatFirmwareVersion:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/config-format-firmware-version",path:"/1024//18",responseBodyDecoder:_.uint16},getUniversalLink:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/universal-link",path:"/1024//19",responseBodyDecoder:_.ascii},putUniversalLink:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/universal-link",path:"/1024//19",bodyEncoder:_.ascii},postUniversalLink:{method:p.TapRequestFrame.MethodType.POST,pathAlias:"/interface/universal-link",path:"/1024//19",bodyEncoder:_.ascii},listObjectInstances:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/list-object-instances",path:"/1024//140",bodyEncoder:_.uint16},getAvailableHostProtocols:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/available-host-protocols",path:"/1024//21",responseBodyDecoder:_.hostProtocolArray},getDisabledServices:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/disabled-services",path:"/1024//75",responseBodyDecoder:_.serviceCodeArray},postDisabledServices:{method:p.TapRequestFrame.MethodType.POST,pathAlias:"/interface/disabled-services",path:"/1024//75",bodyEncoder:_.serviceCodeArray},getNetworkOptions:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/network-options",path:"/1024//127",responseBodyDecoder:_.networkOptions},putNetworkOptions:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/network-options",path:"/1024//127",bodyEncoder:_.networkOptions},getRadioMixEnabled:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/radio-mix-enabled",path:"/1024//132",responseBodyDecoder:_.uint8},putRadioMixEnabled:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/radio-mix-enabled",path:"/1024//132",bodyEncoder:_.uint8},getNfcConnectionPriority:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/nfc_connection_priority",path:"/1024//24",responseBodyDecoder:_.nfcConnectionPriority},postNfcConnectionPriority:{method:p.TapRequestFrame.MethodType.POST,pathAlias:"/interface/nfc_connection_priority",path:"/1024//24",bodyEncoder:_.nfcConnectionPriority},putNfcConnectionPriority:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/nfc_connection_priority",path:"/1024//24",bodyEncoder:_.nfcConnectionPriority},getNfcAutologProfileId:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/nfc-autolog-profile-id",path:"/1024//43",responseBodyDecoder:_.uint16},putNfcAutologProfileId:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/nfc-autolog-profile-id",path:"/1024//43",bodyEncoder:_.uint16},getHostInactivityPeriod:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/host-inactivity-period",path:"/1024//34",responseBodyDecoder:_.uint16},putHostInactivityPeriod:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/host-inactivity-period",path:"/1024//34",bodyEncoder:_.uint16},getApplicationData:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/application-data",path:"/1024//36"}
1,putApplicationData:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/application-data",path:"/1024//36"},postApplicationData:{method:p.TapRequestFrame.MethodType.POST,pathAlias:"/interface/application-data",path:"/1024//36"},getProductKey:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/product-key",path:"/1024//60",responseBodyDecoder:_.ascii},getCurrentHostProtocolMaxFrameSize:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/current-host-protocol-max-frame-size",path:"/1024//88",responseBodyDecoder:_.protocolMaxFrameSize},executeMultiRequestFrame:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/multi-request-frame",path:"/1024//89",responseBodyDecoder:_.multiResponseFrame,bodyEncoder:_.multiRequestFrame},putCertificatePublicKey:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/certificate/public-key",append:!0,path:"/1024//37"},putCertificatePrivateKey:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/certificate/private-key",append:!0,path:"/1024//38"},putCertificateRootKey:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/certificate/root-key",append:!0,path:"/1024//39"},getProductCode:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/product-code",path:"/1024//84",responseBodyDecoder:_.ascii},putProductCode:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/product-code",path:"/1024//84",bodyEncoder:_.ascii},getSpecialFeatureProfile:{method:p.TapRequestFrame.MethodType.GET,pathAlias:"/interface/special-feature/{featureId}",path:"/1024//{featureId}",responseBodyDecoder:_.uint16},setSpecialFeatureProfile:{method:p.TapRequestFrame.MethodType.POST,pathAlias:"/interface/special-feature/{featureId}",path:"/1024//{featureId}",bodyEncoder:_.uint16},putSpecialFeatureProfile:{method:p.TapRequestFrame.MethodType.PUT,pathAlias:"/interface/special-feature/{featureId}",path:"/1024//{featureId}",bodyEncoder:_.uint16}};class ae extends u.AbstractService{constructor(){super(...arguments),this.resources=ue}login(s){return this.serviceCallRunner.execute(this.loginCall(s))}loginCall(s){const d=Object.assign({},this.resources.login);return d.body=s,d}loginWithHash(s){return this.serviceCallRunner.execute(this.loginWithHashCall(s))}loginWithHashCall(s){const d=Object.assign({},this.resources.loginWithHash);return d.body=s,d}logout(){return this.serviceCallRunner.execute(this.logoutCall())}logoutCall(){return Object.assign({},this.resources.logout)}getCurrentProfileId(){return this.serviceCallRunner.execute(this.getCurrentProfileIdCall())}getCurrentProfileIdCall(){return Object.assign({},this.resources.getCurrentProfileId)}getCurrentHostProtocol(){return this.serviceCallRunner.execute(this.getCurrentHostProtocolCall())}getCurrentHostProtocolCall(){return Object.assign({},this.resources.getCurrentHostProtocol)}putCurrentHostProtocol(s){return this.serviceCallRunner.execute(this.putCurrentHostProtocolCall(s))}putCurrentHostProtocolCall(s){const d=Object.assign({},this.resources.putCurrentHostProtocol);return d.body=s,d}getUID(){return this.serviceCallRunner.execute(this.getUIDCall())}getUIDCall(){return Object.assign({},this.resources.getUID)}loginWithUID(s){return this.serviceCallRunner.execute(this.loginWithUIDCall(s))}loginWithUIDCall(s){const d=Object.assign({},this.resources.loginWithUID);return d.body=s,d}keepAlive(){return this.serviceCallRunner.execute(this.keepAliveCall())}keepAliveCall(){return Object.assign({},this.resources.keepAlive)}postKeepAlive(){return this.serviceCallRunner.execute(this.postKeepAliveCall())}postKeepAliveCall(){return Object.assign({},this.resources.postKeepAlive)}getSecurityOptions(){return this.serviceCallRunner.execute(this.getSecurityOptionsCall())}getSecurityOptionsCall(){return Object.assign({},this.resources.getSecurityOptions)}putSecurityOptions(s){return this.serviceCallRunner.execute(this.putSecurityOptionsCall(s))}putSecurityOptionsCall(s){const d=Object.assign({},this.resources.putSecurityOptions);return d.body=s,d}getCurrentGroupId(){return this.serviceCallRunner.execute(this.getCurrentGroupIdCall())}getCurrentGroupIdCall(){return Object.assign({},this.resources.getCurrentGroupId)}
1getBundleIdSwdDirectAccess(){return this.serviceCallRunner.execute(this.getBundleIdSwdDirectAccessCall())}getBundleIdSwdDirectAccessCall(){return Object.assign({},this.resources.getBundleIdSwdDirectAccess)}putBundleIdSwdDirectAccess(s){return this.serviceCallRunner.execute(this.putBundleIdSwdDirectAccessCall(s))}putBundleIdSwdDirectAccessCall(s){const d=Object.assign({},this.resources.putBundleIdSwdDirectAccess);return d.body=s,d}getBundleIdSerialAccess(){return this.serviceCallRunner.execute(this.getBundleIdSerialAccessCall())}getBundleIdSerialAccessCall(){return Object.assign({},this.resources.getBundleIdSerialAccess)}putBundleIdSerialAccess(s){return this.serviceCallRunner.execute(this.putBundleIdSerialAccessCall(s))}putBundleIdSerialAccessCall(s){const d=Object.assign({},this.resources.putBundleIdSerialAccess);return d.body=s,d}getBundleIdModbusDirectAccess(){return this.serviceCallRunner.execute(this.getBundleIdModbusDirectAccessCall())}getBundleIdModbusDirectAccessCall(){return Object.assign({},this.resources.getBundleIdModbusDirectAccess)}putBundleIdModbusDirectAccess(s){return this.serviceCallRunner.execute(this.putBundleIdModbusDirectAccessCall(s))}putBundleIdModbusDirectAccessCall(s){const d=Object.assign({},this.resources.putBundleIdModbusDirectAccess);return d.body=s,d}getBundleIdTapnpassControlAccess(){return this.serviceCallRunner.execute(this.getBundleIdTapnpassControlAccessCall())}getBundleIdTapnpassControlAccessCall(){return Object.assign({},this.resources.getBundleIdTapnpassControlAccess)}putBundleIdTapnpassControlAccess(s){return this.serviceCallRunner.execute(this.putBundleIdTapnpassControlAccessCall(s))}putBundleIdTapnpassControlAccessCall(s){const d=Object.assign({},this.resources.putBundleIdTapnpassControlAccess);return d.body=s,d}getBundleIdFirmwareUpdateAccess(){return this.serviceCallRunner.execute(this.getBundleIdFirmwareUpdateAccessCall())}getBundleIdFirmwareUpdateAccessCall(){return Object.assign({},this.resources.getBundleIdFirmwareUpdateAccess)}putBundleIdFirmwareUpdateAccess(s){return this.serviceCallRunner.execute(this.putBundleIdFirmwareUpdateAccessCall(s))}putBundleIdFirmwareUpdateAccessCall(s){const d=Object.assign({},this.resources.putBundleIdFirmwareUpdateAccess);return d.body=s,d}getBundleIdMqttIdsAccess(){return this.serviceCallRunner.execute(this.getBundleIdMqttIdsAccessCall())}getBundleIdMqttIdsAccessCall(){return Object.assign({},this.resources.getBundleIdMqttIdsAccess)}putBundleIdMqttIdsAccess(s){return this.serviceCallRunner.execute(this.putBundleIdMqttIdsAccessCall(s))}putBundleIdMqttIdsAccessCall(s){const d=Object.assign({},this.resources.putBundleIdMqttIdsAccess);return d.body=s,d}getBundleIdVariableConfigAccess(){return this.serviceCallRunner.execute(this.getBundleIdVariableConfigAccessCall())}getBundleIdVariableConfigAccessCall(){return Object.assign({},this.resources.getBundleIdVariableConfigAccess)}putBundleIdVariableConfigAccess(s){return this.serviceCallRunner.execute(this.putBundleIdVariableConfigAccessCall(s))}putBundleIdVariableConfigAccessCall(s){const d=Object.assign({},this.resources.putBundleIdVariableConfigAccess);return d.body=s,d}getBundleIdFileSystemAccess(){return this.serviceCallRunner.execute(this.getBundleIdFileSystemAccessCall())}getBundleIdFileSystemAccessCall(){return Object.assign({},this.resources.getBundleIdFileSystemAccess)}putBundleIdFileSystemAccess(s){return this.serviceCallRunner.execute(this.putBundleIdFileSystemAccessCall(s))}putBundleIdFileSystemAccessCall(s){const d=Object.assign({},this.resources.putBundleIdFileSystemAccess);return d.body=s,d}getConfigFormatVersion(){return this.serviceCallRunner.execute(this.getConfigFormatVersionCall())}getConfigFormatVersionCall(){return Object.assign({},this.resources.getConfigFormatVersion)}putConfigFormatVersion(s){return this.serviceCallRunner.execute(this.putConfigFormatVersionCall(s))}putConfigFormatVersionCall(s){const d=Object.assign({},this.resources.putConfigFormatVersion);return d.body=s,d}getAppName(){return this.serviceCallRunner.execute(this.getAppNameCall())}getAppNameCall(){return Object.assign({},this.resources.getAppName)}putAppName(s){return this.serviceCallRunner.execute(this.putAppNameCall(s))}putAppNameCall(s){const d=Object.assign({},this.resources.putAppName);return d.body=s,d}getConfigVersion(){return this.serviceCallRunner.execute(this.getConfigVersionCall())}getConfigVersionCall(){return Object.assign({},this.resources.getConfigVersion)}putConfigVersion(s){return this.serviceCallRunner.execute(this.putConfigVersionCall(s))}putConfigVersionCall(s){const d=Object.assign({},this.resources.putConfigVersion);return d.body=s,d}reloadConfig(){return this.serviceCallRunner.execute(this.reloadConfigCall())}reloadConfigCall(){return Object.assign({},this.resources.reloadConfig)}
1getAppPath(){return this.serviceCallRunner.execute(this.getAppPathCall())}getAppPathCall(){return Object.assign({},this.resources.getAppPath)}putAppPath(s){return this.serviceCallRunner.execute(this.putAppPathCall(s))}putAppPathCall(s){const d=Object.assign({},this.resources.putAppPath);return d.body=s,d}postAppPath(s){return this.serviceCallRunner.execute(this.postAppPathCall(s))}postAppPathCall(s){const d=Object.assign({},this.resources.postAppPath);return d.body=s,d}getNfcPairingMode(){return this.serviceCallRunner.execute(this.getNfcPairingModeCall())}getNfcPairingModeCall(){return Object.assign({},this.resources.getNfcPairingMode)}putNfcPairingMode(s){return this.serviceCallRunner.execute(this.putNfcPairingModeCall(s))}putNfcPairingModeCall(s){const d=Object.assign({},this.resources.putNfcPairingMode);return d.body=s,d}getPairingOptions(){return this.serviceCallRunner.execute(this.getPairingOptionsCall())}getPairingOptionsCall(){return Object.assign({},this.resources.getPairingOptions)}postPairingOptions(s){return this.serviceCallRunner.execute(this.postPairingOptionsCall(s))}postPairingOptionsCall(s){const d=Object.assign({},this.resources.postPairingOptions);return d.body=s,d}putPairingOptions(s){return this.serviceCallRunner.execute(this.putPairingOptionsCall(s))}putPairingOptionsCall(s){const d=Object.assign({},this.resources.putPairingOptions);return d.body=s,d}getPowerOptimisationLevel(){return this.serviceCallRunner.execute(this.getPowerOptimisationLevelCall())}getPowerOptimisationLevelCall(){return Object.assign({},this.resources.getPowerOptimisationLevel)}putPowerOptimisationLevel(s){return this.serviceCallRunner.execute(this.putPowerOptimisationLevelCall(s))}putPowerOptimisationLevelCall(s){const d=Object.assign({},this.resources.putPowerOptimisationLevel);return d.body=s,d}getCpuFrequencyOptions(){return this.serviceCallRunner.execute(this.getCpuFrequencyOptionsCall())}getCpuFrequencyOptionsCall(){return Object.assign({},this.resources.getCpuFrequencyOptions)}putCpuFrequencyOptions(s){return this.serviceCallRunner.execute(this.putCpuFrequencyOptionsCall(s))}putCpuFrequencyOptionsCall(s){const d=Object.assign({},this.resources.putCpuFrequencyOptions);return d.body=s,d}getPowerOptimisationOptions(){return this.serviceCallRunner.execute(this.getPowerOptimisationOptionsCall())}getPowerOptimisationOptionsCall(){return Object.assign({},this.resources.getPowerOptimisationOptions)}putPowerOptimisationOptions(s){return this.serviceCallRunner.execute(this.putPowerOptimisationOptionsCall(s))}putPowerOptimisationOptionsCall(s){const d=Object.assign({},this.resources.putPowerOptimisationOptions);return d.body=s,d}getMaxLowPowerTime(){return this.serviceCallRunner.execute(this.getMaxLowPowerTimeCall())}getMaxLowPowerTimeCall(){return Object.assign({},this.resources.getMaxLowPowerTime)}putMaxLowPowerTime(s){return this.serviceCallRunner.execute(this.putMaxLowPowerTimeCall(s))}putMaxLowPowerTimeCall(s){const d=Object.assign({},this.resources.putMaxLowPowerTime);return d.body=s,d}getAutoRebootTimeout(){return this.serviceCallRunner.execute(this.getAutoRebootTimeoutCall())}getAutoRebootTimeoutCall(){return Object.assign({},this.resources.getAutoRebootTimeout)}putAutoRebootTimeout(s){return this.serviceCallRunner.execute(this.putAutoRebootTimeoutCall(s))}putAutoRebootTimeoutCall(s){const d=Object.assign({},this.resources.putAutoRebootTimeout);return d.body=s,d}getAuthorizedHostProtocol(){return this.serviceCallRunner.execute(this.getAuthorizedHostProtocolCall())}getAuthorizedHostProtocolCall(){return Object.assign({},this.resources.getAuthorizedHostProtocol)}putAuthorizedHostProtocol(s){return this.serviceCallRunner.execute(this.putAuthorizedHostProtocolCall(s))}putAuthorizedHostProtocolCall(s){const d=Object.assign({},this.resources.putAuthorizedHostProtocol);return d.body=s,d}getConfigFormatFirmwareVersion(){return this.serviceCallRunner.execute(this.getConfigFormatFirmwareVersionCall())}getConfigFormatFirmwareVersionCall(){return Object.assign({},this.resources.getConfigFormatFirmwareVersion)}getUniversalLink(){return this.serviceCallRunner.execute(this.getUniversalLinkCall())}getUniversalLinkCall(){return Object.assign({},this.resources.getUniversalLink)}putUniversalLink(s){return this.serviceCallRunner.execute(this.putUniversalLinkCall(s))}putUniversalLinkCall(s){const d=Object.assign({},this.resources.putUniversalLink);return d.body=s,d}postUniversalLink(s){return this.serviceCallRunner.execute(this.postUniversalLinkCall(s))}postUniversalLinkCall(s){const d=Object.assign({},this.resources.postUniversalLink);return d.body=s,d}listObjectInstances(s){return this.serviceCallRunner.execute(this.listObjectInstancesCall(s))}listObjectInstancesCall(s){const d=Object.assign({},this.resources.listObjectInstances);return d.body=s,d}getAvailableHostProtocols(){return this.serviceCallRunner.execute(this.getAvailableHostProtocolsCall())}getAvailableHostProtocolsCall(){return Object.assign({},this.resources.getAvailableHostProtocols)}getDisabledServices(){return this.serviceCallRunner.execute(this.getDisabledServicesCall())}getDisabledServicesCall(){return Object.assign({},this.resources.getDisabledServices)}postDisabledServices(s){return this.serviceCallRunner.execute(this.postDisabledServicesCall(s))}postDisabledServicesCall(s){const d=Object.assign({},this.resources.postDisabledServices);return d.body=s,d}getNetworkOptions(){return this.serviceCallRunner.execute(this.getNetworkOptionsCall())}getNetworkOptionsCall(){return Object.assign({},this.resources.getNetworkOptions)}putNetworkOptions(s){return this.serviceCallRunner.execute(this.putNetworkOptionsCall(s))}putNetworkOptionsCall(s){const d=Object.assign({},this.resources.putNetworkOptions);return d.body=s,d}getRadioMixEnabled(){return this.serviceCallRunner.execute(this.getRadioMixEnabledCall())}getRadioMixEnabledCall(){return Object.assign({},this.resources.getRadioMixEnabled)}putRadioMixEnabled(s){return this.serviceCallRunner.execute(this.putRadioMixEnabledCall(s))}putRadioMixEnabledCall(s){const d=Object.assign({},this.resources.putRadioMixEnabled);return d.body=s,d}getNfcConnectionPriority(){return this.serviceCallRunner.execute(this.getNfcConnectionPriorityCall())}getNfcConnectionPriorityCall(){return Object.assign({},this.resources.getNfcConnectionPriority)}postNfcConnectionPriority(s){return this.serviceCallRunner.execute(this.postNfcConnectionPriorityCall(s))}postNfcConnectionPriorityCall(s){const d=Object.assign({},this.resources.postNfcConnectionPriority);return d.body=s,d}putNfcConnectionPriority(s){return this.serviceCallRunner.execute(this.putNfcConnectionPriorityCall(s))}putNfcConnectionPriorityCall(s){const d=Object.assign({},this.resources.putNfcConnectionPriority);return d.body=s,d}getNfcAutologProfileId(){return this.serviceCallRunner.execute(this.getNfcAutologProfileIdCall())}getNfcAutologProfileIdCall(){return Object.assign({},this.resources.getNfcAutologProfileId)}putNfcAutologProfileId(s){return this.serviceCallRunner.execute(this.putNfcAutologProfileIdCall(s))}putNfcAutologProfileIdCall(s){const d=Object.assign({},this.resources.putNfcAutologProfileId);return d.body=s,d}getHostInactivityPeriod(){return this.serviceCallRunner.execute(this.getHostInactivityPeriodCall())}getHostInactivityPeriodCall(){return Object.assign({},this.resources.getHostInactivityPeriod)}putHostInactivityPeriod(s){return this.serviceCallRunner.execute(this.putHostInactivityPeriodCall(s))}putHostInactivityPeriodCall(s){const d=Object.assign({},this.resources.putHostInactivityPeriod);return d.body=s,d}getApplicationData(){return this.serviceCallRunner.execute(this.getApplicationDataCall())}getApplicationDataCall(){return Object.assign({},this.resources.getApplicationData)}putApplicationData(s){return this.serviceCallRunner.execute(this.putApplicationDataCall(s))}putApplicationDataCall(s){const d=Object.assign({},this.resources.putApplicationData);return d.body=s,d}postApplicationData(s){return this.serviceCallRunner.execute(this.postApplicationDataCall(s))}postApplicationDataCall(s){const d=Object.assign({},this.resources.postApplicationData);return d.body=s,d}getProductKey(){return this.serviceCallRunner.execute(this.getProductKeyCall())}getProductKeyCall(){return Object.assign({},this.resources.getProductKey)}getCurrentHostProtocolMaxFrameSize(){return this.serviceCallRunner.execute(this.getCurrentHostProtocolMaxFrameSizeCall())}getCurrentHostProtocolMaxFrameSizeCall(){return Object.assign({},this.resources.getCurrentHostProtocolMaxFrameSize)}executeMultiRequestFrame(s){return this.serviceCallRunner.execute(this.executeMultiRequestFrameCall(s))}executeMultiRequestFrameCall(s){const d=Object.assign({},this.resources.executeMultiRequestFrame);return d.body=s,d}putCertificatePublicKey(s){return this.serviceCallRunner.execute(this.putCertificatePublicKeyCall(s))}putCertificatePublicKeyAppendCalls(s,d){return this.serviceCallRunner.createAppendCalls(this.putCertificatePublicKeyCall(s),d)}putCertificatePublicKeyCall(s){const d=Object.assign({},this.resources.putCertificatePublicKey);return d.body=s,d}putCertificatePrivateKey(s){return this.serviceCallRunner.execute(this.putCertificatePrivateKeyCall(s))}putCertificatePrivateKeyAppendCalls(s,d){return this.serviceCallRunner.createAppendCalls(this.putCertificatePrivateKeyCall(s),d)}putCertificatePrivateKeyCall(s){const d=Object.assign({},this.resources.putCertificatePrivateKey);return d.body=s,d}putCertificateRootKey(s){return this.serviceCallRunner.execute(this.putCertificateRootKeyCall(s))}putCertificateRootKeyAppendCalls(s,d){return this.serviceCallRunner.createAppendCalls(this.putCertificateRootKeyCall(s),d)}putCertificateRootKeyCall(s){const d=Object.assign({},this.resources.putCertificateRootKey);return d.body=s,d}getProductCode(){return this.serviceCallRunner.execute(this.getProductCodeCall())}getProductCodeCall(){return Object.assign({},this.resources.getProductCode)}putProductCode(s){return this.serviceCallRunner.execute(this.putProductCodeCall(s))}putProductCodeCall(s){const d=Object.assign({},this.resources.putProductCode);return d.body=s,d}getSpecialFeatureProfile(s){return this.serviceCallRunner.execute(this.getSpecialFeatureProfileCall(s))}getSpecialFeatureProfileCall(s){const d=Object.assign({},this.resources.getSpecialFeatureProfile);return d.pathParameters={featureId:s},d}setSpecialFeatureProfile(s,d){return this.serviceCallRunner.execute(this.setSpecialFeatureProfileCall(s,d))}setSpecialFeatureProfileCall(s,d){const Oe=Object.assign({},this.resources.setSpecialFeatureProfile);return Oe.body=d,Oe.pathParameters={featureId:s},Oe}putSpecialFeatureProfile(s,d){return this.serviceCallRunner.execute(this.putSpecialFeatureProfileCall(s,d))}putSpecialFeatureProfileCall(s,d){const Oe=Object.assign({},this.resources.putSpecialFeatureProfile);return Oe.body=d,Oe.pathParameters={featureId:s},Oe}}var _e=function(O,s,d,Oe){return new(d||(d=Promise))(function(Be,B){function M(de){try{pe(Oe.next(de))}catch(be){B(be)}}function U(de){try{pe(Oe.throw(de))}catch(be){B(be)}}function pe(de){de.done?Be(de.value):function Ie(Be){return Be instanceof d?Be:new d(function(B){B(Be)})}(de.value).then(M,U)}pe((Oe=Oe.apply(O,s||[])).next())})};ae.prototype.getAppUrl=function(){return _e(this,void 0,void 0,function*(){const O=yield this.getAppPath();if(O.isSuccessful()){let s=O.body();if(s.match(/^\$[1-6]\//)){const d=s.substring(0,3),Oe=s.substring(3);switch(d){case"$1/":case"$5/":s=`https://user.cloud.iotize.com/users/${Oe}`;break;case"$2/":s=`http://${Oe}`;break;default:s=""}O.setBody(s)}}return O})},ae.prototype.getAndroidApplicationId=function(){return _e(this,void 0,void 0,function*(){const O=yield this.getAppPath();if(O.isSuccessful()){const s=O.body();s.startsWith("$4/")?O.setBody(s.substring(3)):O.setBody("")}return O})},ae.prototype.putAndroidApplicationId=function(O){return _e(this,void 0,void 0,function*(){return this.putAppPath(`$4/${O}`)})};var Te=function(O,s,d,Oe){return new(d||(d=Promise))(function(Be,B){function M(de){try{pe(Oe.next(de))}catch(be){B(be)}}function U(de){try{pe(Oe.throw(de))}catch(be){B(be)}}function pe(de){de.done?Be(de.value):function Ie(Be){return Be instanceof d?Be:new d(function(B){B(Be)})}(de.value).then(M,U)}pe((Oe=Oe.apply(O,s||[])).next())})};function v(O){return"expectedResponseStatus"in O?O.call:O}ae.prototype.executeMultipleCalls=function(O,s=ie.ExpectedResponseStatus.ANYTHING){return Te(this,void 0,void 0,function*(){const d=O.map(U=>function S(O){return"function"==typeof O?{decode:O}:O}(v(U).responseBodyDecoder)),Oe=function q(O,s=ie.ExpectedResponseStatus.ANYTHING){return O.map(d=>{let Oe,Ie;"expectedResponseStatus"in d?(Oe=d.call,Ie=d.expectedResponseStatus):(Oe=d,Ie=s);const Be=u.ServiceCallRunner.toTapRequest(Oe),B=u.ServiceCallRunner.resolveResponseBodyDecoder(Oe);return{requestItem:{expectedResponseStatus:Ie,request:Be,requestLen:Be.payload.length+p.TAP_REQUEST_FRAME_HEADER_LENGTH},responseBodyDecoder:B}})}(O,s),Ie={requests:Oe.map(U=>U.requestItem)},B=(yield this.executeMultiRequestFrame(Ie)).body();if(B.responses.length!==O.length)throw new Error(`API sent ${O.length} request(s) but tap responded with ${B.responses.length} response(s).`);return B.responses.map((U,pe)=>{const de=new u.TapResponse(U.response),be=d[pe];
1return be&&de.setBodyDecoder(be),de.setRequest(Oe[pe].requestItem.request),de.isSuccessful()||de.setError(u.TapError.reponseStatusError(de,v(O[pe]))),de})})};const ve=(0,u.extendServiceContainer)("interface",ae),Ne={"/interface/current-host-protocol":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/HostProtocol"}}},"/interface/security-options":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/SecurityOptions"}}},"/interface/bundle-id-swd-direct-access":{put:{minApiVersion:1.23,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/interface/bundle-id-serial-access":{put:{minApiVersion:1.23,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/interface/bundle-id-modbus-direct-access":{put:{minApiVersion:1.23,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/interface/bundle-id-tapnpass-control-access":{put:{minApiVersion:1.23,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/interface/bundle-id-firmware-update-access":{put:{minApiVersion:1.35,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/interface/bundle-id-mqtt-ids-access":{put:{minApiVersion:1.35,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/interface/bundle-id-variable-config-access":{put:{minApiVersion:2.11,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/interface/bundle-id-file-system-access":{put:{minApiVersion:2.13,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/interface/config-format-version":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/interface/app-name":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:24}}},"/interface/config-version":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",format:"version",pattern:"^([0-9]+)\\.([0-9]+)\\.([0-9]+)$"}}},"/interface/app-path":{put:{minApiVersion:1,configModeRequired:!1,schema:{maxLength:100,type:"string"}}},"/interface/nfc/pairing-mode":{put:{minApiVersion:1,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/NfcPairingMode"}}},"/interface/pairing-options":{put:{minApiVersion:1,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/WirelessPairingOptions"}}},"/interface/power-optimisation-level":{put:{minApiVersion:1,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/LowPowerOptimizationLevel"}}},"/interface/cpu-frequency-options":{put:{minApiVersion:2.15,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/CpuFrequencySpeed"}}},"/interface/power-optimisation-options":{put:{minApiVersion:2.15,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/PowerOptimizationOptions"}}},"/interface/max-low-power-time":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint32"}}},"/interface/auto-reboot-timeout":{put:{minApiVersion:2.11,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/interface/authorized-host-protocol":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"array",items:{$ref:"./definitions.yaml#/HostProtocol"}}}},"/interface/universal-link":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:100}}},"/interface/network-options":{put:{minApiVersion:2.13,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/NetworkOptions"}}},"/interface/radio-mix-enabled":{put:{minApiVersion:2.13,configModeRequired:!1,schema:{type:"integer",format:"uint8"}}},"/interface/nfc_connection_priority":{put:{minApiVersion:1.85,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/NfcConnectionPriority"}}},"/interface/nfc-autolog-profile-id":{put:{minApiVersion:1.55,configModeRequired:!1,schema:{type:"integer",format:"uint16"}}},"/interface/host-inactivity-period":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"integer",format:"uint16",minimum:0,maximum:255}}},"/interface/application-data":{put:{minApiVersion:1,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/Bytes"}}},"/interface/certificate/public-key":{put:{minApiVersion:1.86,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/Bytes"}}},"/interface/certificate/private-key":{put:{minApiVersion:1.86,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/Bytes"}}},"/interface/certificate/root-key":{put:{minApiVersion:1.86,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/Bytes"}}},"/interface/product-code":{put:{minApiVersion:1.113,configModeRequired:!1,schema:{type:"string",maxLength:32}}},"/interface/special-feature/{featureId}":{put:{minApiVersion:1.23,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}}}},36570:(Ce,he,a)=>{a.d(he,{C2:()=>se,Fl:()=>w,SW:()=>ce,a:()=>ne,mY:()=>b,zf:()=>Y});var p=a(49697),u=a(83355),z=a(67333),m=a(20432);z.TapStreamReader.prototype.readScramLoginParams=function(){const A={};return A.username=this.readString(16),A.clientNonce=this.readUnsigned(4),A},z.TapStreamReader.prototype.readScramLoginResponseBody=function(){const A={};
1return A.serverNonce=this.readUnsigned(4),A.salt=this.readBytes(4),A.iterationNumber=this.readUnsigned(4),A},z.TapStreamReader.prototype.readEncryptedIVRequest=function(){const A={};return A.iv=this.readBytes(16),A.request=this.readBytes(),A},z.TapStreamReader.prototype.readEncryptedIVResponse=function(){const A={};return A.iv=this.readBytes(16),A.response=this.readBytes(),A},z.TapStreamWriter.prototype.writeScramLoginParams=function(A){return this.writeString(A.username,16),this.writeUnsigned(A.clientNonce,4),this},z.TapStreamWriter.prototype.writeScramLoginResponseBody=function(A){return this.writeUnsigned(A.serverNonce,4),this.writeBytes(A.salt,4),this.writeUnsigned(A.iterationNumber,4),this},z.TapStreamWriter.prototype.writeEncryptedIVRequest=function(A){return this.writeBytes(A.iv,16),this.writeBytes(A.request),this},z.TapStreamWriter.prototype.writeEncryptedIVResponse=function(A){return this.writeBytes(A.iv,16),this.writeBytes(A.response),this};class b{encode(I,Q=new z.TapStreamWriter){return Q.writeScramLoginParams(I),Q.toBytes}decode(I){return(I instanceof z.TapStreamReader?I:z.TapStreamReader.create(I)).readScramLoginParams()}}class w{encode(I,Q=new z.TapStreamWriter){return Q.writeScramLoginResponseBody(I),Q.toBytes}decode(I){return(I instanceof z.TapStreamReader?I:z.TapStreamReader.create(I)).readScramLoginResponseBody()}}const te=new b,ie=new w,W=new class y{encode(I,Q=new z.TapStreamWriter){return Q.writeEncryptedIVRequest(I),Q.toBytes}decode(I){return(I instanceof z.TapStreamReader?I:z.TapStreamReader.create(I)).readEncryptedIVRequest()}},fe=new class Z{encode(I,Q=new z.TapStreamWriter){return Q.writeEncryptedIVResponse(I),Q.toBytes}decode(I){return(I instanceof z.TapStreamReader?I:z.TapStreamReader.create(I)).readEncryptedIVResponse()}};var ne=Object.freeze({__proto__:null,scramLoginParams:te,scramLoginResponseBody:ie,encryptedIVRequest:W,encryptedIVResponse:fe});const F=Object.assign(Object.assign({},m.m),ne),K={login:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/scram/login",path:"/1024//40",responseBodyDecoder:F.scramLoginResponseBody,bodyEncoder:F.scramLoginParams},loginProof:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/scram/login-proof",path:"/1024//41"},getHashIteration:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/scram/hash-iteration",path:"/1024//42",responseBodyDecoder:F.uint32},putHashIteration:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/scram/hash-iteration",path:"/1024//42",bodyEncoder:F.uint16},initialize:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/scram/initialize",path:"/1024//47"},stop:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/scram/stop",path:"/1024//46"},send:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/scram/com-send-receive",path:"/1024//48"},setInitializationVector:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/scram/initialization-vector",path:"/1024//45"},sendWithIV:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/scram/send-with-iv",path:"/1024//44",responseBodyDecoder:F.encryptedIVResponse,bodyEncoder:F.encryptedIVRequest}};class se extends p.AbstractService{constructor(){super(...arguments),this.resources=K}login(I){return this.serviceCallRunner.execute(this.loginCall(I))}loginCall(I){const Q=Object.assign({},this.resources.login);return Q.body=I,Q}loginProof(I){return this.serviceCallRunner.execute(this.loginProofCall(I))}loginProofCall(I){const Q=Object.assign({},this.resources.loginProof);return Q.body=I,Q}getHashIteration(){return this.serviceCallRunner.execute(this.getHashIterationCall())}getHashIterationCall(){return Object.assign({},this.resources.getHashIteration)}putHashIteration(I){return this.serviceCallRunner.execute(this.putHashIterationCall(I))}putHashIterationCall(I){const Q=Object.assign({},this.resources.putHashIteration);return Q.body=I,Q}initialize(){return this.serviceCallRunner.execute(this.initializeCall())}initializeCall(){return Object.assign({},this.resources.initialize)}stop(){return this.serviceCallRunner.execute(this.stopCall())}stopCall(){return Object.assign({},this.resources.stop)}send(I){return this.serviceCallRunner.execute(this.sendCall(I))}sendCall(I){const Q=Object.assign({},this.resources.send);return Q.body=I,Q}setInitializationVector(I){return this.serviceCallRunner.execute(this.setInitializationVectorCall(I))}setInitializationVectorCall(I){const Q=Object.assign({},this.resources.setInitializationVector);return Q.body=I,Q}sendWithIV(I){return this.serviceCallRunner.execute(this.sendWithIVCall(I))}sendWithIVCall(I){const Q=Object.assign({},this.resources.sendWithIV);return Q.body=I,Q}}const Y=(0,p.extendServiceContainer)("scram",se),ce={"/scram/hash-iteration":{put:{minApiVersion:1.11,configModeRequired:!0,schema:{type:"integer",format:"uint16",minimum:0,maximum:65535}}}}},17819:(Ce,he,a)=>{a.d(he,{Je:()=>Ie,KP:()=>L,iU:()=>G,jU:()=>h,m2:()=>Be,uR:()=>Re});var L,Pe,Re,p=a(49697),u=a(83355),z=a(67333),m=a(20432),b=a(54536),y=a(53876),te=a(54072),W=a(74813),ne=a(72791),K=a(832),Y=a(60572),A=a(15730),Q=a(54542),g=a(66386);!function(B){let M;var U;(U=M=B.State||(B.State={}))[U.UNAVAILABLE=0]="UNAVAILABLE",U[U.EMPTY=1]="EMPTY",U[U.USED=2]="USED",U[U.FULL=3]="FULL",U[U.ERROR=4]="ERROR"}(L||(L={})),function(B){let M;var U;(U=M=B.PacketType||(B.PacketType={}))[U.DATA_LOG=1]="DATA_LOG",U[U.COMMAND=2]="COMMAND",U[U.CODE_EXEC=3]="CODE_EXEC",U[U.CONF_UPDATE=4]="CONF_UPDATE",U[U.SECURITY_TOKEN=5]="SECURITY_TOKEN",U[U.TARGET_FW_UPDATE=6]="TARGET_FW_UPDATE",U[U.MASK=7]="MASK"}(Pe||(Pe={})),function(B){let M;var U;(U=M=B.Format||(B.Format={}))[U.OFFSET_ON_2_BYTES=0]="OFFSET_ON_2_BYTES",U[U.OFFSET_ON_4_BYTES=8]="OFFSET_ON_4_BYTES"}(Re||(Re={})),z.TapStreamReader.prototype.readSinglePacketStoreInfo=function(){const B={};return this.forwardBits(24),B.state=this.readUnsigned(1),B},z.TapStreamReader.prototype.readSinglePacket=function(){const B={};return B.sendTime=this.readUnsigned(4),B.header=this.readSinglePacketHeader(),B.payload=this.readSinglePacketPayload(),B},z.TapStreamReader.prototype.readSinglePacketHeader=function(){const B={};return B.packetLength=this.readUnsigned(2),B.packetId=this.readUnsigned(2),B.configVersion=this.readUnsigned(4),B.messageType=this.readBits(4),this.forwardBits(1),B.isExtended=this.readBoolean(1),B.encryption=this.readBoolean(1),B.ack=this.readBoolean(1),B.senderId=this.readUnsigned(1),B.salt=this.readUnsigned(2),B},z.TapStreamReader.prototype.readSinglePacketPayload=function(){const B={};return B.logTime=this.readUnsigned(4),B.dataSize=this.readUnsigned(2),B.data=this.readBytes(0==(void 0===B.dataSize?0:B.dataSize)?this.get
1StreamSize()-4:void 0===B.dataSize?0:B.dataSize),B.padding=this.readBytes((4-(B.data.length+10)%4)%4),B.crc=this.readUnsigned(4),B},z.TapStreamReader.prototype.readSinglePacketChunk=function(){const B={};return B.format=this.readBits(4),B.length=this.readBits(12),B.offset=this.readUnsigned(8==B.format?4:2),B.data=this.readBytes(16*(void 0===B.length?0:B.length)),B},z.TapStreamWriter.prototype.writeSinglePacketStoreInfo=function(B){return this.forwardBits(24),this.writeBitsInt((0,z.enumKeyOrValueToNumber)(B.state,L.State),8),this},z.TapStreamWriter.prototype.writeSinglePacket=function(B){return this.writeUnsigned(B.sendTime,4),this.writeSinglePacketHeader(B.header),this.writeSinglePacketPayload(B.payload),this},z.TapStreamWriter.prototype.writeSinglePacketHeader=function(B){return this.writeUnsigned(B.packetLength,2),this.writeUnsigned(B.packetId,2),this.writeUnsigned(B.configVersion,4),this.writeBitsInt((0,z.enumKeyOrValueToNumber)(B.messageType,Pe.PacketType),4),this.forwardBits(1),this.writeBoolean(B.isExtended,1),this.writeBoolean(B.encryption,1),this.writeBoolean(B.ack,1),this.writeUnsigned(B.senderId,1),this.writeUnsigned(B.salt,2),this},z.TapStreamWriter.prototype.writeSinglePacketPayload=function(B){return this.writeUnsigned(B.logTime,4),this.writeUnsigned(void 0!==B.dataSize?B.dataSize:B.data.length>65535?0:B.data.length,2),this.writeBytes(B.data,0==(void 0===B.dataSize?0:B.dataSize)?B.data.length:void 0===B.dataSize?0:B.dataSize),this.writeFunction("padding",void 0,B.padding,(4-(B.data.length+10)%4)%4),this.writeFunction("crc32",{offset:4},B.crc,4),this},z.TapStreamWriter.prototype.writeSinglePacketChunk=function(B){return this.writeBitsInt((0,z.enumKeyOrValueToNumber)(B.format,Re.Format),4),this.writeBits(void 0!==B.length?B.length:B.data.length/16,12),this.writeUnsigned(B.offset,8==B.format?4:2),this.writeBytes(B.data,0==(void 0===B.length?0:B.length)?B.data.length:16*(void 0===B.length?0:B.length)),this};const H=new class Ee{encode(M,U=new z.TapStreamWriter){return U.writeSinglePacketStoreInfo(M),U.toBytes}decode(M){return(M instanceof z.TapStreamReader?M:z.TapStreamReader.create(M)).readSinglePacketStoreInfo()}},ge=new class c{encode(M,U=new z.TapStreamWriter){return U.writeSinglePacket(M),U.toBytes}decode(M){return(M instanceof z.TapStreamReader?M:z.TapStreamReader.create(M)).readSinglePacket()}},N=new class V{encode(M,U=new z.TapStreamWriter){return U.writeSinglePacketChunk(M),U.toBytes}decode(M){return(M instanceof z.TapStreamReader?M:z.TapStreamReader.create(M)).readSinglePacketChunk()}};var G=Object.freeze({__proto__:null,singlePacketStoreInfo:H,singlePacket:ge,singlePacketChunk:N});const i=Object.assign(Object.assign({},m.m),G),T={getInfo:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/single-packet/info",path:"/1024//81",responseBodyDecoder:i.singlePacketStoreInfo},writeAndExecuteBytes:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/single-packet/write-and-execute-bytes",path:"/1024//80"},writeAndExecute:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/single-packet/write-and-execute",path:"/1024//80",bodyEncoder:i.singlePacket},writeChunk:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/single-packet/write-chunk",path:"/1024//82",bodyEncoder:i.singlePacketChunk},executeSinglePacketInStore:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/single-packet/execute-single-packet-in-store",path:"/1024//83",bodyEncoder:i.uint32}};class E extends p.AbstractService{constructor(){super(...arguments),this.resources=T}getInfo(){return this.serviceCallRunner.execute(this.getInfoCall())}getInfoCall(){return Object.assign({},this.resources.getInfo)}writeAndExecuteBytes(M){return this.serviceCallRunner.execute(this.writeAndExecuteBytesCall(M))}writeAndExecuteBytesCall(M){const U=Object.assign({},this.resources.writeAndExecuteBytes);return U.body=M,U}writeAndExecute(M){return this.serviceCallRunner.execute(this.writeAndExecuteCall(M))}writeAndExecuteCall(M){const U=Object.assign({},this.resources.writeAndExecute);return U.body=M,U}writeChunk(M){return this.serviceCallRunner.execute(this.writeChunkCall(M))}writeChunkCall(M){const U=Object.assign({},this.resources.writeChunk);return U.body=M,U}executeSinglePacketInStore(M){return this.serviceCallRunner.execute(this.executeSinglePacketInStoreCall(M))}executeSinglePacketInStoreCall(M){const U=Object.assign({},this.resources.executeSinglePacketInStore);return U.body=M,U}}const h=(0,p.extendServiceContainer)("singlePacket",E);class k extends b.CodeError{constructor(M,U){super(U,M)}static authSessionRequiredToEncryptSinglePacket(){return new k(k.Code.AuthSessionRequiredToEncryptSinglePacket,"A valid authenticated Tap session is required to encrypt single packet")}static credentialsRequiredForEncryptedSinglePacket(){return new k(k.Code.CredentialsRequiredForEncryptedSinglePacket,"Single packet encryption is enabled, you need to provid encryption credentials")}static internalError(M){return new k(k.Code.SinglePacketInternalError,`Single packet related internal error: ${M}`)}static maxSinglePacketPartSizeExceeded(M,U){return new k(k.Code.MaxSinglePacketPartSizeExceeded,`Single packet part size of ${M.data.length} bytes is above single packet maximum size of ${U} bytes`)}static maxSinglePacketSizeExceeded(M,U){return new k(k.Code.MaxSinglePacketSizeExceeded,`Single packet size of ${M} bytes is above single packet maximum size of ${U} bytes`)}}!function(B){let M;var U;(U=M=B.Code||(B.Code={})).SinglePacketInternalError="SinglePacketErrorInternalError",U.AuthSessionRequiredToEncryptSinglePacket="SinglePacketErrorAuthSessionRequiredToEncryptSinglePacket",U.MaxSinglePacketPartSizeExceeded="SinglePacketErrorMaxSinglePacketPartSizeExceeded",U.MaxSinglePacketSizeExceeded="SinglePacketErrorMaxSinglePacketSizeExceeded",U.CredentialsRequiredForEncryptedSinglePacket="SinglePacketErrorCredentialsRequiredForEncryptedSinglePacket"}(k||(k={}));class _{generate(M){const U=new z.TapStreamWriter;if(M.username.length>16)throw new Error(`Invalid username too long: ${M.username}`);if(U.writeStr(M.username),18!==M.serialNumber.length)throw new Error(`Invalid sn: ${M.seri
1alNumber}. Length must be 18`);if(U.writeStr(M.serialNumber,18),12!==M.headerBytes.length)throw new Error(`Invalid header length ${M.headerBytes.length}. Expected 12`);U.writeBytes(M.headerBytes);const pe=U.toBytes;return(0,ne.hmacSHA256)(pe,M.hashKey).slice(0,16)}}z.TapStreamReader.prototype.readSinglePacketPayloadFullData=function(){const B={};return B.logTime=this.readU4(),B.dataSize=this.readU2(),B.data=this.readBytes(-4),B.crc=this.readU4(),B};class ae{static fromBlankKey(M){return{hashKey:new Uint8Array(32),serialNumber:"IoTize_FWUpdate_SP",username:M}}static fromHashKey(M,U){return{hashKey:M,serialNumber:"IoTize_FWUpdate_SP",username:U}}static fromUserCredentials(M,U){const pe=W.ScramAuth.computeBaseKeys(M.password,U);return ae.fromCurrentSessionData({username:M.username,serverKey:pe.serverKey,storedKey:pe.storedKey})}static fromCurrentSessionData(M){const U=z.TapStreamWriter.create(32).writeBytes(M.storedKey).writeBytes(M.serverKey).toBytes;if(32!==U.length)throw new Error("Single packet encryption not available");return{hashKey:U,serialNumber:"IoTize_FWUpdate_SP",username:M.username}}}class _e{constructor(M,U=new te.AesEcb128Converter,pe=new _){this.options=M,this.encryptionAlgo=U,this.keyGenerator=pe}static createWithBlankKey(){return new _e(ae.fromBlankKey("IoTize"))}setEncryptionOptions(M){this.options=Object.assign(Object.assign({},this.options),M)}encode(M){const U=new z.TapStreamWriter;U.writeU4(M.sendTime),U.writeSinglePacketHeader(M.header);const pe=U.pos;if(U.writeSinglePacketPayload(M.payload),M.header.encryption){const de=U.toBytes,be=this._getEncryptionAlgo(M.header);let xe=de.slice(pe);xe=be.encode(xe),U.pos=pe,U.writeBytes(xe)}return U.toBytes}decode(M){const U=z.TapStreamReader.fromArray(M),pe=U.readU4(),de=U.readSinglePacketHeader();let be;if(de.encryption){const Le=U.readBytesFull(),ke=this._getEncryptionAlgo(de).decode(Le);be=z.TapStreamReader.fromArray(ke).readSinglePacketPayloadFullData()}else be=U.readSinglePacketPayload();return{sendTime:pe,header:de,payload:be}}_getEncryptionAlgo(M){const U=this.computeKey(M);return this.encryptionAlgo.setOptions({iv:"00000000000000000000000000000000",key:(0,y.bufferToHexString)(U)}),this.encryptionAlgo}computeKey(M){M instanceof Uint8Array||(M=new z.TapStreamWriter(12).writeSinglePacketHeader(M).toBytes);const U=Object.assign(Object.assign({},this.options),{headerBytes:M});return this.keyGenerator.generate(U)}}const Te=(0,A.createDebugger)("@iotize/tap/single-packet");function S(B,M){return(M-B%M)%M}function q(B){if(B>65535)throw new Error("Invalid user id. Should be between 0 and 65535");if(B>127&&B<65408)throw new Error("Invalid user id. Should be between 0 and 0 and 127 or 65535 and 65408");return 255&B}const O=B=>new Uint8Array(B);class s{constructor(M,U=O){this.paddingGenerator=U,this.model={sendTime:0,header:{ack:!1,configVersion:0,encryption:!1,isExtended:!1,messageType:M,packetId:0,packetLength:0,salt:Math.round(65535*Math.random()),senderId:0},payload:{data:new Uint8Array,dataSize:0,logTime:s.getTimestampInSeconds(),padding:void 0}}}static getTimestampInSeconds(){return Math.round((new Date).getTime()/1e3)}static getLengthMultiplicator(M){return M.header.isExtended?256:M.header.encryption||M.header.messageType===Pe.PacketType.CODE_EXEC?16:1}static create(M,U,pe=O){const de=new s(U,pe);return de.setData(M),de}setLogTime(M){return this.model.payload.logTime=M,this}setPacketId(M){return this.model.header.packetId=M,this}setSalt(M){return this.model.header.salt=M,this}setExtended(M){return this.model.header.isExtended=M,this}setEncryption(M){return this.model.header.encryption=M,this}setSenderId(M){return this.model.header.senderId=M,this}setSendTime(M){return this.model.sendTime=M,this}setConfigVersion(M){return this.model.header.configVersion=M,this}setData(M){return this.model.payload.data=M,this}getLengthMultiplicator(){return s.getLengthMultiplicator(this.model)}build(){this.model.sendTime||(this.model.sendTime=s.getTimestampInSeconds());let M=this.getLengthMultiplicator();this.model.payload.data.length>65535*M&&(this.model.header.isExtended=!0),M=this.getLengthMultiplicator();const U=Math.max(4,M),pe=S(this.model.payload.data.length+s.PACKET_PAYLOAD_HEADER_SIZE,U);this.model.payload.padding=this.paddingGenerator(pe);const de=this.model.payload.data.length+s.PACKET_PAYLOAD_HEADER_SIZE+this.model.payload.padding.length,be=s.PACKET_HEADER_SIZE+this.model.payload.data.length+this.model.payload.padding.length;if(this.model.payload.dataSize=this.model.payload.data.length>65535?void 0:this.model.payload.data.length,de%M!=0)throw k.internalError(`Packet length ${be} must be a multiple of ${M}`);if(be>s.MAX_FULL_SIZE)throw k.maxSinglePacketSizeExceeded(be,s.MAX_FULL_SIZE);return this.model.header.packetLength=de/M,1===M&&(this.model.header.packetLength+=s.PACKET_OUTER_HEADER_SIZE),this.model}}s.MAX_FULL_SIZE=2097152,s.MAX_PART_SIZE=192,s.PACKET_PAYLOAD_HEADER_SIZE=10,s.PACKET_OUTER_HEADER_SIZE=12,s.PACKET_HEADER_SIZE=s.PACKET_OUTER_HEADER_SIZE+s.PACKET_PAYLOAD_HEADER_SIZE,s.PACKET_HEADER_SIZE_WITH_SEND_TIME=s.PACKET_HEADER_SIZE+4,s.MAX_DATA_SIZE=s.MAX_FULL_SIZE-(s.PACKET_HEADER_SIZE_WITH_SEND_TIME+255);class d{constructor(M={}){M.sizeMultiplicator||(M.sizeMultiplicator=d.SIZE_MULTIPLICATOR),M.chunkSize||(M.chunkSize=s.MAX_PART_SIZE),M.format||(M.format=Re.Format.OFFSET_ON_2_BYTES),M.pad||(M.pad=!1),this.options=M,this.checkOptions()}get sizeMultiplicator(){return this.options.sizeMultiplicator}checkOptions(){if(this.options.chunkSize<this.sizeMultiplicator)throw new Error(`Chunk size must be greater than ${this.sizeMultiplicator}. Given: ${this.options.chunkSize}`);
1if(!this.options.pad&&this.options.chunkSize%this.sizeMultiplicator!=0)throw new Error(`Chunk size "${this.options.chunkSize}" is not a multiple of length multiplicator "${this.sizeMultiplicator}"`)}chunk(M){if(this.options.pad){const de=S(M.length,this.sizeMultiplicator);de>0&&(M=g.KaitaiStreamWriter.mergeArrays(M,new Uint8Array(de)))}else if(M.length%this.sizeMultiplicator!=0)throw new Error(`Padding is disabled and data length (${M.length} byte(s)) is not a multiple of length multiplicator ${this.sizeMultiplicator})`);const U=(0,Q.chunkArray)(Array.from(M),this.options.chunkSize).map(de=>Uint8Array.from(de));let pe=0;return U.map(de=>{const be={data:de,length:Math.ceil(de.length/this.sizeMultiplicator),offset:Math.ceil(pe/this.sizeMultiplicator),format:this.options.format};return pe+=de.length,be})}}d.SIZE_MULTIPLICATOR=16;var Oe=function(B,M,U,pe){return new(U||(U=Promise))(function(be,xe){function Le(je){try{ke(pe.next(je))}catch(ze){xe(ze)}}function qe(je){try{ke(pe.throw(je))}catch(ze){xe(ze)}}function ke(je){je.done?be(je.value):function de(be){return be instanceof U?be:new U(function(xe){xe(be)})}(je.value).then(Le,qe)}ke((pe=pe.apply(B,M||[])).next())})};class Ie extends K.StepOperations{constructor(M,U){super(K.StepOperations.createSequentialContainers(M)),this.singlePacketService=U}static createOperationsFromBytes(M,U,pe){const de=pe?.chunkSize||s.MAX_PART_SIZE,be=M.length/de<=65535,Le=new d({chunkSize:de,format:be?Re.Format.OFFSET_ON_2_BYTES:Re.Format.OFFSET_ON_4_BYTES,pad:!pe||!("pad"in pe)||pe.pad}).chunk(M);return Ie.createOperationsFromChunk(Le,U,pe)}static createFromBytes(M,U,pe){const de=Ie.createOperationsFromBytes(M,U,pe);return new Ie(de,U)}static createOperationsFromChunk(M,U,pe,de={expectedCRC:0}){de.expectedCRC=z.CRC.FIRST_VALUE;const be=M.map((xe,Le)=>(qe,ke)=>Oe(this,void 0,void 0,function*(){if(xe.data.length>s.MAX_PART_SIZE)throw k.maxSinglePacketPartSizeExceeded(xe,s.MAX_PART_SIZE);Te("createSinglePacketLoadOperations","sendSinglePacket",`sending packet ${Le+1}/${M.length} offset: ${xe.offset}...${xe.offset+(xe.length||0)}`);let je=0;const ze=pe?.maxRetry||3;for(de.expectedCRC=z.CRC.fromBytes(xe.data,de.expectedCRC);;){je++;const We=yield U.writeChunk(xe);if(!(je<ze)||We.status!==u.ResultCode.SERVICE_UNAVAILABLE&&We.status!==u.ResultCode.NVM_ERROR)return We.successful(),void qe.next({step:Ie.Step.loadPacketChunk,progress:{total:M.length,loaded:Le+1}});Te("createSinglePacketLoadOperations",`Attempt ${je+1}/${ze} failed with error ${p.TapError.reponseStatusError(We).toString()}`),yield(0,Y.sleep)(pe?.retryDelay||500)}}));return pe?.execute&&be.push((xe,Le)=>Oe(this,void 0,void 0,function*(){xe.next({step:Ie.Step.executeSinglePacket,expectedCRC:de.expectedCRC}),(yield U.executeSinglePacketInStore(de.expectedCRC)).successful()})),be}static createFromChunks(M,U,pe){return new Ie(Ie.createOperationsFromChunk(M,U,pe),U)}static computeCRC(M){return M instanceof Uint8Array?z.CRC.mpeg2().compute(M):M.reduce((U,pe)=>z.CRC.mpeg2().compute(pe.data,U),z.CRC.FIRST_VALUE)}}(function(B){let M;var U;(U=M=B.Step||(B.Step={})).loadPacketChunk="loadPacketChunk",U.executeSinglePacket="executeSinglePacket"})(Ie||(Ie={})),E.prototype.createStoreLoader=function(B,M,U){const pe=_e.createWithBlankKey();if(U)pe.setEncryptionOptions(U),B.header.encryption=!0,B.header.senderId=function ve(B){switch(B){case"IoTize":return 253;case"admin":return q(65535);case"anonymous":return q(0);case"supervisor":return q(65534);default:return 0}}(U.username);else if(B.header.encryption)throw k.credentialsRequiredForEncryptedSinglePacket();const de=pe.encode(B);return this.createStoreLoaderFromBytes(de,M)},E.prototype.createStoreLoaderFromBytes=function(B,M){return Ie.createFromBytes(B,this,M)};const Be={}},379:(Ce,he,a)=>{a.d(he,{hE:()=>y,ml:()=>Y,vY:()=>se});var y,p=a(49697),u=a(67333),z=a(41886),m=a(50951),b=a(83355),w=a(20432);(function(ce){let A;var I;(I=A=ce.Channel||(ce.Channel={}))[I.DISABLED=0]="DISABLED",I[I.MODBUS_RTU=1]="MODBUS_RTU",I[I.SPI=2]="SPI",I[I.CAN=3]="CAN",I[I.MODBUS_TCP=4]="MODBUS_TCP"})(y||(y={})),u.TapStreamReader.prototype.readSlaveServerRawConfig=function(){const ce={};return ce.channel=this.readUnsigned(1),ce.length=this.readUnsigned(1),ce.config=this.readBytes(ce.length),ce},u.TapStreamWriter.prototype.writeSlaveServerRawConfig=function(ce){return this.writeBitsInt((0,u.enumKeyOrValueToNumber)(ce.channel,y.Channel),8),this.writeUnsigned(ce.length,1),this.writeBytes(ce.config,ce.length),this};class Z{encode(A,I=new u.TapStreamWriter){return I.writeSlaveServerRawConfig(A),I.toBytes}decode(A){return(A instanceof u.TapStreamReader?A:u.TapStreamReader.create(A)).readSlaveServerRawConfig()}}const ie=new Z;var W=Object.freeze({__proto__:null,slaveServerRawConfig:ie});const fe=Object.assign(Object.assign({},w.m),W),ne={getProtocolConfiguration:{method:b.TapRequestFrame.MethodT
1ype.GET,pathAlias:"/slave-server/protocol-configuration",path:"/1024//92",responseBodyDecoder:fe.slaveServerRawConfig},postProtocolConfiguration:{method:b.TapRequestFrame.MethodType.POST,pathAlias:"/slave-server/protocol-configuration",path:"/1024//92",bodyEncoder:fe.slaveServerRawConfig},putProtocolConfiguration:{method:b.TapRequestFrame.MethodType.PUT,pathAlias:"/slave-server/protocol-configuration",path:"/1024//92",bodyEncoder:fe.slaveServerRawConfig}};class F extends p.AbstractService{constructor(){super(...arguments),this.resources=ne}getProtocolConfiguration(){return this.serviceCallRunner.execute(this.getProtocolConfigurationCall())}getProtocolConfigurationCall(){return Object.assign({},this.resources.getProtocolConfiguration)}postProtocolConfiguration(A){return this.serviceCallRunner.execute(this.postProtocolConfigurationCall(A))}postProtocolConfigurationCall(A){const I=Object.assign({},this.resources.postProtocolConfiguration);return I.body=A,I}putProtocolConfiguration(A){return this.serviceCallRunner.execute(this.putProtocolConfigurationCall(A))}putProtocolConfigurationCall(A){const I=Object.assign({},this.resources.putProtocolConfiguration);return I.body=A,I}}const se=(0,p.extendServiceContainer)("slaveServer",class K extends F{putCanProtocolConfiguration(A){return this.serviceCallRunner.execute(this.putCanProtocolConfigurationCall(A))}putCanProtocolConfigurationCall(A){const I=m.$d.targetCanProtocolConfiguration.encode(A);return this.putProtocolConfigurationCall({channel:y.Channel.CAN,config:I,length:I.length})}putSpiProtocolConfiguration(){return this.serviceCallRunner.execute(this.putSpiProtocolConfigurationCall())}putSpiProtocolConfigurationCall(){return this.putProtocolConfigurationCall({channel:y.Channel.SPI,config:new Uint8Array(0),length:1})}putModbusRtuProtocolConfiguration(A){return this.serviceCallRunner.execute(this.putModbusRtuProtocolConfigurationCall(A))}putModbusRtuProtocolConfigurationCall(A){const I=z.ao.tapnpassProtocolConfiguration.encode(A);return this.putProtocolConfigurationCall({channel:y.Channel.MODBUS_RTU,config:I,length:I.length})}putModbusTcpProtocolConfiguration(A){return this.serviceCallRunner.execute(this.putModbusTcpProtocolConfigurationCall(A))}putModbusTcpProtocolConfigurationCall(A){const I=new u.TapStreamWriter(5).writeU1(A.firstRegisterAddress||0).writeU4(A.port).toBytes;return this.putProtocolConfigurationCall({channel:y.Channel.MODBUS_TCP,config:I,length:I.length})}}),Y={"/slave-server/protocol-configuration":{put:{minApiVersion:2.1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/SlaveServerRawConfig"}}}}},41886:(Ce,he,a)=>{a.d(he,{Fx:()=>ie,OW:()=>Ee,Q3:()=>Pe,ao:()=>ce,j2:()=>Re});var Z,te,p=a(49697),u=a(83355),z=a(50951),m=a(67333),b=a(20432),w=a(66386);!function(c){let V;var H;(H=V=c.Command||(c.Command={}))[H.NONE=0]="NONE",H[H.ZIP=32769]="ZIP",H[H.UNZIP=32770]="UNZIP",H[H.SET_TRANSMISSION_BUFFER_SIZE=32771]="SET_TRANSMISSION_BUFFER_SIZE",H[H.TOTAL_BUFFER_SIZE=32772]="TOTAL_BUFFER_SIZE",H[H.GET_TRANSMISSION_BUFFER_SIZE=32773]="GET_TRANSMISSION_BUFFER_SIZE",H[H.SET_RESPONSE_DELIMITER_LOW=32774]="SET_RESPONSE_DELIMITER_LOW",H[H.SET_RESPONSE_DELIMITER_HIGH=32775]="SET_RESPONSE_DELIMITER_HIGH",H[H.SET_COMMAND_DELIMITER_LOW=32776]="SET_COMMAND_DELIMITER_LOW",H[H.EXEC_COMMANDS=32777]="EXEC_COMMANDS"}(Z||(Z={})),function(c){let V;var H;(H=V=c.ResultCode||(c.ResultCode={}))[H.NONE=0]="NONE",H[H.OK=32768]="OK",H[H.ZIP_TIMEOUT=32769]="ZIP_TIMEOUT",H[H.UNZIP_TIMEOUT=32770]="UNZIP_TIMEOUT",H[H.ZIP_ERROR=32771]="ZIP_ERROR",H[H.UNZIP_ERROR=32772]="UNZIP_ERROR",H[H.UNKNOWN_COMMAND=32773]="UNKNOWN_COMMAND",H[H.INVALID_PARAM=32774]="INVALID_PARAM"}(te||(te={})),m.TapStreamReader.prototype.readTapnpassProtocolConfiguration=function(){const c={};return c.modbus=this.readTapnpassProtocolConfigurationModbus(),c.serial=this.readTapnpassProtocolConfigurationSerial(),c.usb=this.readTapnpassProtocolConfigurationUsb(),c},m.TapStreamReader.prototype.readTapnpassProtocolConfigurationModbus=function(){const c={};return c.slave=this.readUnsigned(1),this.forwardBits(3),c.offsetFirstRegister=this.readBoolean(1),c},m.TapStreamReader.prototype.readTapnpassProtocolConfigurationSerial=function(){const c={};return c.baudRate=this.readBits(20),c.identification=this.readBoolean(1),this.forwardBits(1),c.ledStatus=this.readBoolean(1),this.forwardBits(1),c.physicalPort=this.readBits(4),c.stopBits=this.readBits(2),c.bitParity=this.readBits(4),c.dataBits=this.readBits(2),c.handshakeDelimiter=this.readBits(4),c.hardwareFlowControl
1=this.readBits(4),c.timeout=this.readUnsigned(1),c},m.TapStreamReader.prototype.readTapnpassProtocolConfigurationUsb=function(){const c={aliases:[]};for(;!this.isEof();)c.aliases.push(this.readTapnpassProtocolConfigurationUsbAlias());return c},m.TapStreamReader.prototype.readTapnpassProtocolConfigurationUsbAlias=function(){const c={};return c.pid=this.readUnsigned(2),c.vid=this.readUnsigned(2),c.equ=this.readUnsigned(1),c},m.TapStreamReader.prototype.readAdpStats=function(){const c={};return c.header=this.readAdpStatsHeader(),c.state=this.readAdpStatsState(),c.uart=this.readAdpStatsUart(),c.usb=this.readAdpStatsUsb(),c.current=this.readBytes(4),c.com=this.readAdpStatsCom(),c.battery=this.readBytes(4),c.intern=this.readAdpStatsIntern(),c},m.TapStreamReader.prototype.readAdpStatsHeader=function(){const c={};return this.forwardBits(16),c.version=this.readAdpStatsVersion(),c.errorCode=this.readUnsigned(1),this.forwardBits(16),c},m.TapStreamReader.prototype.readAdpStatsVersion=function(){const c={};return c.major=this.readUnsigned(1),c.minor=this.readUnsigned(1),c.patch=this.readUnsigned(1),c},m.TapStreamReader.prototype.readAdpStatsIntern=function(){const c={};return c.time=this.readBytes(4),c.nbBoots=this.readBytes(4),c.nbShutdown=this.readBytes(2),c.nbAdpFault=this.readBytes(2),c.nbAdpMemFault=this.readBytes(2),c.nbAdpBusFault=this.readBytes(2),c.nbAdpUsageFault=this.readBytes(2),this.forwardBits(16),c.temperature=this.readBytes(4),c},m.TapStreamReader.prototype.readAdpStatsState=function(){const c={};return this.forwardBits(7),c.usbDisconnected=this.readBoolean(1),this.forwardBits(24),c},m.TapStreamReader.prototype.readAdpStatsUart=function(){const c={};return c.nbPartityError=this.readUnsigned(1),c.nbNoiseError=this.readUnsigned(1),c.nbFrameError=this.readUnsigned(1),c.nbDmaError=this.readUnsigned(1),c.nbTxError=this.readUnsigned(1),c.nbRxError=this.readUnsigned(1),c.nbOverRun=this.readUnsigned(1),this.forwardBits(8),c},m.TapStreamReader.prototype.readAdpStatsUsb=function(){const c={};return c.nbFail=this.readUnsigned(1),c.nbTimeout=this.readUnsigned(1),c.nbError=this.readUnsigned(1),c.nbUnknownClass=this.readUnsigned(1),c.nbDisconnect=this.readUnsigned(1),c.nbOff=this.readUnsigned(1),this.forwardBits(16),c},m.TapStreamReader.prototype.readAdpStatsCom=function(){const c={};return c.txBufferOverRun=this.readUnsigned(1),c.rxBufferOverRun=this.readUnsigned(1),c.nbErrorSettings=this.readUnsigned(1),this.forwardBits(8),c.nbComAdp=this.readBytes(4),c},m.TapStreamReader.prototype.readAdpControlIn=function(){const c={};return c.command=this.readUnsigned(2),c.param=this.readUnsigned(2),c},m.TapStreamReader.prototype.readAdpControlOut=function(){const c={};return c.resultCode=this.readUnsigned(2),c.param=this.readUnsigned(2),c},m.TapStreamWriter.prototype.writeTapnpassProtocolConfiguration=function(c){return this.writeTapnpassProtocolConfigurationModbus(c.modbus),this.writeTapnpassProtocolConfigurationSerial(c.serial),this.writeTapnpassProtocolConfigurationUsb(c.usb),this},m.TapStreamWriter.prototype.writeTapnpassProtocolConfigurationModbus=function(c){return this.writeUnsigned(c.slave,1),this.forwardBits(3),this.writeBoolean(c.offsetFirstRegister,1),this},m.TapStreamWriter.prototype.writeTapnpassProtocolConfigurationSerial=function(c){return this.writeBits(c.baudRate,20),this.writeBoolean(c.identification,1),this.forwardBits(1),this.writeBoolean(c.ledStatus,1),this.forwardBits(1),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(c.physicalPort,z.s$.PhysicalPort),4),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(c.stopBits,z.s$.StopBits),2),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(c.bitParity,z.s$.BitParity),4),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(c.dataBits,z.s$.DataBits),2),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(c.handshakeDelimiter,z.s$.HandshakeDelimiter),4),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(c.hardwareFlowControl,z.s$.HardwareFlowControl),4),this.writeUnsigned(c.timeout,1),this},m.TapStreamWriter.prototype.writeTapnpassProtocolConfigurationUsb=function(c){for(let V of c.aliases)this.writeTapnpassProtocolConfigurationUsbAlias(V);return this},m.TapStreamWriter.prototype.writeTapnpassProtocolConfigurationUsbAlias=function(c){return this.writeUnsigned(c.pid,2),this.writeUnsigned(c.vid,2),this.writeUnsigned(c.equ,1),this},m.TapStreamWriter.prototype.writeAdpStats=function(c){return this.writeAdpStatsHeader(c.header),this.writeAdpStatsState(c.state),this.writeAdpStatsUart(c.uart),this.writeAdpStatsUsb(c.usb),this.writeBytes(c.current,4),this.writeAdpStatsCom(c.com),this.writeBytes(c.battery,4),this.writeAdpStatsIntern(c.intern),this},m.TapStreamWriter.prototype.writeAdpStatsHeader=function(c){return this.forwardBits(16),this.writeAdpStatsVersion(c.version),this.writeUnsigned(c.errorCode,1),this.forwardBits(16),this},m.TapStreamWriter.prototype.writeAdpStatsVersion=function(c){return this.writeUnsigned(c.major,1),this.writeUnsigned(c.minor,1),this.writeUnsigned(c.patch,1),this},m.TapStreamWriter.prototype.writeAdpStatsIntern=function(c){return this.writeBytes(c.time,4),this.writeBytes(c.nbBoots,4),this.writeBytes(c.nbShutdown,2),this.writeBytes(c.nbAdpFault,2),this.writeBytes(c.nbAdpMemFault,2),this.writeBytes(c.nbAdpBusFault,2),this.writeBytes(c.nbAdpUsageFault,2),this.forwardBits(16),this.writeBytes(c.temperature,4),this},m.TapStreamWriter.prototype.writeAdpStatsState=function(c){return this.forwardBits(7),this.writeBoolean(c.usbDisconnected,1),this.forwardBits(24),this},m.TapStreamWriter.prototype.writeAdpStatsUart=function(c){return this.writeUnsigned(c.nbPartityError,1),this.writeUnsigned(c.nbNoiseError,1),this.writeUnsigned(c.nbFrameError,1),this.writeUnsigned(c.nbDmaError,1),this.writeUnsigned(c.nbTxError,1),this.writeUnsigned(c.nbRxError,1),this.writeUnsigned(c.nbOverRun,1),this.forwardBits(8),this},m.TapStreamWriter.prototype.writeAdpStatsUsb=function(c){return this.writeUnsigned(c.nbFail,1),this.writeUnsigned(c.nbTimeout,1),this.writeUnsigned(c.nbError,1),this.writeUnsigned(c.nbUnknownClass,1),this.writeUnsigned(c.nbDisconnect,1),this.writeUnsigned(c.nbOff,1),this.forwardBits(16),this},m.TapStreamWriter.prototype.writeAdpStatsCom=function(c){return this.writeUnsigned(c.txBufferOverRun,1),this.writeUnsigned(c.rxBufferOverRun,1),this.writeUnsigned(c.nbErrorSettings,1),this.forwardBits(8),this.writeBytes(c.nbComAdp,4),this},m.TapStreamWriter.prototype.writeAdpControlIn=function(c){return this.writeBitsInt((0,m.enumKeyOrValueToNumber)(c.command,Z.Command),16),this.writeUnsigned(c.param,2),this},m.TapStreamWriter.prototype.writeAdpControlOut=function(c){return this.writeBitsInt((0,m.enumKeyOrValueToNumber)(c.resultCode,te.ResultCode),16),this.writeUnsigned(c.param,2),this};class ie{encode(V,H=new m.TapStreamWriter){return H.writeTapnpassProtocolConfiguration(V),H.toBytes}decode(V){return(V instanceof m.TapStreamReader?V:m.TapStreamReader.create(V)).readTapnpassProtocolConfiguration()}}const F=new ie,K=new class W{encode(V,H=new m.TapStreamWriter){return H.writeAdpStats(V),H.toBytes}decode(V){return(V instanceof m.TapStreamReader?V:m.TapStreamReader.create(V)).readAdpStats()}},se=new class fe{encode(V,H=new m.TapStreamWriter){return H.writeAdpControlIn(V),H.toBytes}decode(V){return(V instanceof m.TapStreamReader?V:m.TapStreamReader.create(V)).readAdpControlIn()}}
1,Y=new class ne{encode(V,H=new m.TapStreamWriter){return H.writeAdpControlOut(V),H.toBytes}decode(V){return(V instanceof m.TapStreamReader?V:m.TapStreamReader.create(V)).readAdpControlOut()}};var ce=Object.freeze({__proto__:null,tapnpassProtocolConfiguration:F,adpStats:K,adpControlIn:se,adpControlOut:Y});const I=Uint8Array.from([0,0,0,0,0]);const ee=new class Q{constructor(){this.converter=new ie}decode(V){return this.converter.decode(this._reorderBytes(V.slice(0,V.length-I.length)))}encode(V){return w.KaitaiStreamWriter.mergeArrays(this._reorderBytes(this.converter.encode(V)),I)}_reorderBytes(V){return w.KaitaiStreamWriter.mergeArrays(V.slice(0,8).reverse(),V.slice(8))}};var g=Object.freeze({__proto__:null,reversedTapnpassProtocolConfiguration:ee});const f=Object.assign(Object.assign(Object.assign({},b.m),ce),g),L={getProtocolConfiguration:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/tapnpass/protocol-configuration",path:"/1027//21",responseBodyDecoder:f.reversedTapnpassProtocolConfiguration},setProtocolConfiguration:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/tapnpass/protocol-configuration",path:"/1027//21",bodyEncoder:f.reversedTapnpassProtocolConfiguration},putProtocolConfiguration:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/tapnpass/protocol-configuration",path:"/1027//21",bodyEncoder:f.reversedTapnpassProtocolConfiguration},getStatus:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/tapnpass/status",path:"/1027//36",responseBodyDecoder:f.adpStats},postAction:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/tapnpass/action",path:"/1027//39"},getControlIn:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/tapnpass/control-in",path:"/1027//41",responseBodyDecoder:f.adpControlIn},setControlIn:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/tapnpass/control-in",path:"/1027//41",bodyEncoder:f.adpControlIn},getControlOut:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/tapnpass/control-out",path:"/1027//42",responseBodyDecoder:f.adpControlOut},setAdpControlOut:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/tapnpass/control-out",path:"/1027//42",responseBodyDecoder:f.adpControlOut,bodyEncoder:f.adpControlOut}};class Pe extends p.AbstractService{constructor(){super(...arguments),this.resources=L}getProtocolConfiguration(){return this.serviceCallRunner.execute(this.getProtocolConfigurationCall())}getProtocolConfigurationCall(){return Object.assign({},this.resources.getProtocolConfiguration)}setProtocolConfiguration(V){return this.serviceCallRunner.execute(this.setProtocolConfigurationCall(V))}setProtocolConfigurationCall(V){const H=Object.assign({},this.resources.setProtocolConfiguration);return H.body=V,H}putProtocolConfiguration(V){return this.serviceCallRunner.execute(this.putProtocolConfigurationCall(V))}putProtocolConfigurationCall(V){const H=Object.assign({},this.resources.putProtocolConfiguration);return H.body=V,H}getStatus(){return this.serviceCallRunner.execute(this.getStatusCall())}getStatusCall(){return Object.assign({},this.resources.getStatus)}postAction(V){return this.serviceCallRunner.execute(this.postActionCall(V))}postActionCall(V){const H=Object.assign({},this.resources.postAction);return H.body=V,H}getControlIn(){return this.serviceCallRunner.execute(this.getControlInCall())}getControlInCall(){return Object.assign({},this.resources.getControlIn)}setControlIn(V){return this.serviceCallRunner.execute(this.setControlInCall(V))}setControlInCall(V){const H=Object.assign({},this.resources.setControlIn);return H.body=V,H}getControlOut(){return this.serviceCallRunner.execute(this.getControlOutCall())}getControlOutCall(){return Object.assign({},this.resources.getControlOut)}setAdpControlOut(V){return this.serviceCallRunner.execute(this.setAdpControlOutCall(V))}setAdpControlOutCall(V){const H=Object.assign({},this.resources.setAdpControlOut);return H.body=V,H}}const Re=(0,p.extendServiceContainer)("tapnpass",Pe),Ee={"/tapnpass/protocol-configuration":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/TapnpassProtocolConfiguration"}}}}},50951:(Ce,he,a)=>{a.d(he,{$d:()=>G,Oe:()=>Z,Oq:()=>te,Yo:()=>h,fi:()=>ie,mS:()=>_e,s$:()=>W,tT:()=>ae,xM:()=>Te});var y,S,Z,te,ie,W,p=a(49697),u=a(83355),z=a(20432),m=a(67333),b=a(66386);(S=y||(y={}))[S.M0_CORTEX=0]="M0_CORTEX",S[S.M1_CORTEX=1]="M1_CORTEX",function(S){let v;var q;(q=v=S.Mode||(S.Mode={}))[q.EMULATION=0]="EMULATION",q[q.INDEXED=1]="INDEXED"}(Z||(Z={})),function(S){let v;var ve;let q;(ve=v=S.Mode||(S.Mode={}))[ve.NORMAL=0]="NORMAL",ve[ve.NO_ACK=1]="NO_ACK",ve[ve.LISTEN=2]="LISTEN",function(ve){ve[ve.DUAL=0]="DUAL",ve[ve.SINGLE=1]="SINGLE"}(q=S.Filter||(S.Filter={}))}(te||(te={})),function(S){let v;var q;(q=v=S.ObjectType||(S.ObjectType={}))[q.DEFAULT=0]="DEFAULT",q[q.COIL=1]="COIL",q[q.DISCRET_INPUT=2]="DISCRET_INPUT",q[q.HOLDING_REGISTER=3]="HOLDING_REGISTER",q[q.INPUT_REGISTER=4]="INPUT_REGISTER"}(ie||(ie={})),function(S){let v;var d;let q,ve,Ne,O,s;(d=v=S.BitParity||(S.BitParity={}))[d.NONE=0]="NONE",d[d.ODD=1]="ODD",d[d.EVEN=2]="EVEN",function(d){d[d.NONE=0]="NONE",d[d.RTS=1]="RTS",d[d.CTS=2]="CTS",d[d.RTS_CTS=3]="RTS_CTS"}
1(q=S.HardwareFlowControl||(S.HardwareFlowControl={})),function(d){d[d.ONE=0]="ONE",d[d.ONE_AND_HALF=1]="ONE_AND_HALF",d[d.TWO=2]="TWO"}(ve=S.StopBits||(S.StopBits={})),function(d){d[d.NONE=0]="NONE",d[d.RS232=1]="RS232",d[d.USB=3]="USB",d[d.RS485_WITH_SIGNAL_DIRECTION=4]="RS485_WITH_SIGNAL_DIRECTION",d[d.AUTO=6]="AUTO",d[d.RS485=10]="RS485"}(Ne=S.PhysicalPort||(S.PhysicalPort={})),function(d){d[d.NONE=0]="NONE",d[d.CR=1]="CR",d[d.LF=2]="LF",d[d.CR_LF=3]="CR_LF"}(O=S.HandshakeDelimiter||(S.HandshakeDelimiter={})),function(d){d[d._7=0]="_7",d[d._8=1]="_8",d[d._9=2]="_9"}(s=S.DataBits||(S.DataBits={}))}(W||(W={})),m.TapStreamReader.prototype.readTargetComStats=function(){const S={};return S.nbFailCom=this.readUnsigned(4),S.nbSuccessfulCom=this.readUnsigned(4),S},m.TapStreamReader.prototype.readTargetSerialModbusProtocolConfiguration=function(){const S={};return S.modbus=this.readTargetSerialModbusProtocolConfigurationModbus(),S.serial=this.readTargetSerialModbusProtocolConfigurationSerial(),S},m.TapStreamReader.prototype.readTargetSerialModbusProtocolConfigurationModbus=function(){const S={};return S.slave=this.readUnsigned(1),this.forwardBits(3),S.offsetFirstRegister=this.readBoolean(1),S},m.TapStreamReader.prototype.readTargetSerialModbusProtocolConfigurationSerial=function(){const S={};return S.baudRate=this.readBits(20),this.forwardBits(1),this.forwardBits(1),this.forwardBits(1),this.forwardBits(1),S.physicalPort=this.readBits(4),S.stopBits=this.readBits(2),S.bitParity=this.readBits(4),S.dataBits=this.readBits(2),S.handshakeDelimiter=this.readBits(4),S.hardwareFlowControl=this.readBits(4),S.timeout=this.readUnsigned(1),S},m.TapStreamReader.prototype.readTargetS3PProtocolConfiguration=function(){const S={};return S.delay=this.readUnsigned(1),S.mode=this.readUnsigned(1),S},m.TapStreamReader.prototype.readTargetModbusTcpProtocolConfiguration=function(){const S={};return S.firstRegisterAddress=this.readUnsigned(1),S.ip=this.readStringTerminator(":"),S.port=this.readStringTerminator(":"),S.timeout=this.readString(),S},m.TapStreamReader.prototype.readTargetCanProtocolConfiguration=function(){const S={};return S.frequency=this.readUnsigned(2),S.mode=this.readUnsigned(1),S.filter=this.readUnsigned(1),S.code=this.readUnsigned(4),S.mask=this.readUnsigned(4),S},m.TapStreamReader.prototype.readModbusWriteOptions=function(){const S={};return S.options=this.readModbusOptions(),S.data=this.readBytes(),S},m.TapStreamReader.prototype.readModbusOptions=function(){const S={};return this.forwardBits(5),S.objectType=this.readBits(3),S.slave=this.readUnsigned(1),S.address=this.readUnsigned(2),S.length=this.readUnsigned(4),S.format=this.readUnsigned(1),S},m.TapStreamReader.prototype.readMemoryInfo=function(){const S={};return S.address=this.readUnsigned(4),S.length=this.readUnsigned(4),S.format=this.readUnsigned(1),S},m.TapStreamReader.prototype.readMemoryWriteInfo=function(){const S={};return S.info=this.readMemoryInfo(),S.data=this.readBytes(),S},m.TapStreamReader.prototype.readSerialSettings=function(){return{}},m.TapStreamWriter.prototype.writeTargetComStats=function(S){return this.writeUnsigned(S.nbFailCom,4),this.writeUnsigned(S.nbSuccessfulCom,4),this},m.TapStreamWriter.prototype.writeTargetSerialModbusProtocolConfiguration=function(S){return this.writeTargetSerialModbusProtocolConfigurationModbus(S.modbus),this.writeTargetSerialModbusProtocolConfigurationSerial(S.serial),this},m.TapStreamWriter.prototype.writeTargetSerialModbusProtocolConfigurationModbus=function(S){return this.writeUnsigned(S.slave,1),this.forwardBits(3),this.writeBoolean(S.offsetFirstRegister,1),this},m.TapStreamWriter.prototype.writeTargetSerialModbusProtocolConfigurationSerial=function(S){return this.writeBits(S.baudRate,20),this.forwardBits(1),this.forwardBits(1),this.forwardBits(1),this.forwardBits(1),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(S.physicalPort,W.PhysicalPort),4),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(S.stopBits,W.StopBits),2),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(S.bitParity,W.BitParity),4),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(S.dataBits,W.DataBits),2),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(S.handshakeDelimiter,W.HandshakeDelimiter),4),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(S.hardwareFlowControl,W.HardwareFlowControl),4),this.writeUnsigned(S.timeout,1),this},m.TapStreamWriter.prototype.writeTargetS3PProtocolConfiguration=function(S){return this.writeUnsigned(S.delay,1),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(S.mode,Z.Mode),8),this},m.TapStreamWriter.prototype.writeTargetModbusTcpProtocolConfiguration=function(S){return this.writeUnsigned(S.firstRegisterAddress,1),this.writeString(S.ip+":"),this.writeString(S.port+":"),this.writeString(S.timeout),this},m.TapStreamWriter.prototype.writeTargetCanProtocolConfiguration=function(S){return this.writeUnsigned(S.frequency,2),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(S.mode,te.Mode),8),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(S.filter,te.Filter),8),this.writeUnsigned(S.code,4),this.writeUnsigned(S.mask,4),this},m.TapStreamWriter.prototype.writeModbusWriteOptions=function(S){return this.writeModbusOptions(S.options),this.writeBytes(S.data),this},m.TapStreamWriter.prototype.writeModbusOptions=function(S){return this.forwardBits(5),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(S.objectType,ie.ObjectType),3),this.writeUnsigned(S.slave,1),this.writeUnsigned(S.address,2),this.writeUnsigned(S.length,4),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(S.format,p.VariableFormat),8),this},m.TapStreamWriter.prototype.writeMemoryInfo=function(S){return this.writeUnsigned(S.address,4),this.writeUnsigned(S.length,4),this.writeBitsInt((0,m.enumKeyOrValueToNumber)(S.format,p.VariableFormat),8),this},m.TapStreamWriter.prototype.writeMemoryWriteInfo=function(S){return this.writeMemoryInfo(S.info),this.writeBytes(S.data),this},m.TapStreamWriter.prototype.writeSerialSettings=function(S){return this};
1class ne{encode(v,q=new m.TapStreamWriter){return q.writeTargetSerialModbusProtocolConfiguration(v),q.toBytes}decode(v){return(v instanceof m.TapStreamReader?v:m.TapStreamReader.create(v)).readTargetSerialModbusProtocolConfiguration()}}const ee=(0,z.u)(y,1),g=(0,z.PU)(y,1),f=new class fe{encode(v,q=new m.TapStreamWriter){return q.writeTargetComStats(v),q.toBytes}decode(v){return(v instanceof m.TapStreamReader?v:m.TapStreamReader.create(v)).readTargetComStats()}},L=new ne,Pe=new class F{encode(v,q=new m.TapStreamWriter){return q.writeTargetS3PProtocolConfiguration(v),q.toBytes}decode(v){return(v instanceof m.TapStreamReader?v:m.TapStreamReader.create(v)).readTargetS3PProtocolConfiguration()}},Re=new class K{encode(v,q=new m.TapStreamWriter){return q.writeTargetModbusTcpProtocolConfiguration(v),q.toBytes}decode(v){return(v instanceof m.TapStreamReader?v:m.TapStreamReader.create(v)).readTargetModbusTcpProtocolConfiguration()}},Ee=new class se{encode(v,q=new m.TapStreamWriter){return q.writeTargetCanProtocolConfiguration(v),q.toBytes}decode(v){return(v instanceof m.TapStreamReader?v:m.TapStreamReader.create(v)).readTargetCanProtocolConfiguration()}},c=new class Y{encode(v,q=new m.TapStreamWriter){return q.writeModbusWriteOptions(v),q.toBytes}decode(v){return(v instanceof m.TapStreamReader?v:m.TapStreamReader.create(v)).readModbusWriteOptions()}},V=new class ce{encode(v,q=new m.TapStreamWriter){return q.writeModbusOptions(v),q.toBytes}decode(v){return(v instanceof m.TapStreamReader?v:m.TapStreamReader.create(v)).readModbusOptions()}},H=new class A{encode(v,q=new m.TapStreamWriter){return q.writeMemoryInfo(v),q.toBytes}decode(v){return(v instanceof m.TapStreamReader?v:m.TapStreamReader.create(v)).readMemoryInfo()}},ge=new class I{encode(v,q=new m.TapStreamWriter){return q.writeMemoryWriteInfo(v),q.toBytes}decode(v){return(v instanceof m.TapStreamReader?v:m.TapStreamReader.create(v)).readMemoryWriteInfo()}},N=new class Q{encode(v,q=new m.TapStreamWriter){return q.writeSerialSettings(v),q.toBytes}decode(v){return(v instanceof m.TapStreamReader?v:m.TapStreamReader.create(v)).readSerialSettings()}};var G=Object.freeze({__proto__:null,targetCoreType:ee,targetCoreTypeArray:g,targetComStats:f,targetSerialModbusProtocolConfiguration:L,targetS3PProtocolConfiguration:Pe,targetModbusTcpProtocolConfiguration:Re,targetCanProtocolConfiguration:Ee,modbusWriteOptions:c,modbusOptions:V,memoryInfo:H,memoryWriteInfo:ge,serialSettings:N});const T=Uint8Array.from([0,0,0,0,0]);const h=new class E{constructor(){this.converter=new ne}decode(v){return this.converter.decode(this._reorderBytes(v.slice(0,v.length-T.length)))}encode(v){return b.KaitaiStreamWriter.mergeArrays(this._reorderBytes(this.converter.encode(v)),T)}_reorderBytes(v){return b.KaitaiStreamWriter.mergeArrays(v.slice(0,8).reverse(),v.slice(8))}};var k=Object.freeze({__proto__:null,reversedTargetSerialModbusConfiguration:h});const _=Object.assign(Object.assign(Object.assign({},z.m),G),k),ue={getProtocol:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/protocol",path:"/1027//1",responseBodyDecoder:_.targetProtocol},setProtocol:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/protocol",path:"/1027//1",bodyEncoder:_.targetProtocol},putProtocol:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/target/protocol",path:"/1027//1",bodyEncoder:_.targetProtocol},getCoreType:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/core-type",path:"/1027//2",responseBodyDecoder:_.targetCoreType},putCoreType:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/target/core-type",path:"/1027//2",bodyEncoder:_.targetCoreType},isConnected:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/connect",path:"/1027//3",responseBodyDecoder:_.boolean},connect:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/connect",path:"/1027//3"},disconnect:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/disconnect",path:"/1027//4"},reset:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/reset",path:"/1027//5"}
1,getFirmwareVersion:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/firmware-version",path:"/1027//6",responseBodyDecoder:_.stringVersion},putFirmwareVersion:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/target/firmware-version",path:"/1027//6",bodyEncoder:_.stringVersion},getVcc:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/vcc",path:"/1027//7",responseBodyDecoder:_.uint16},getMinVoltage:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/min-voltage",path:"/1027//8",responseBodyDecoder:_.uint16},putMinVoltage:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/target/min-voltage",path:"/1027//8",bodyEncoder:_.uint16},getMaxVoltage:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/max-voltage",path:"/1027//9",responseBodyDecoder:_.uint16},putMaxVoltage:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/target/max-voltage",path:"/1027//9",bodyEncoder:_.uint16},getPageSize:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/page-size",path:"/1027//10",responseBodyDecoder:_.uint32},putPageSize:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/target/page-size",path:"/1027//10",bodyEncoder:_.uint32},getComStats:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/com-stats",path:"/1027//11",responseBodyDecoder:_.targetComStats},clearComStats:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/com-stats",path:"/1027//11"},getAvailableProtocols:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/available-protocols",path:"/1027//20",responseBodyDecoder:_.targetProtocolArray},getSerialModbusConfiguration:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/serial-modbus-configuration",path:"/1027//21",responseBodyDecoder:_.reversedTargetSerialModbusConfiguration},setSerialModbusConfiguration:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/serial-modbus-configuration",path:"/1027//21",bodyEncoder:_.reversedTargetSerialModbusConfiguration},putSerialModbusConfiguration:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/target/serial-modbus-configuration",path:"/1027//21",bodyEncoder:_.reversedTargetSerialModbusConfiguration},getModbusDefaultSlaveAddress:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/modbus-default-slave-address",path:"/1027//22",responseBodyDecoder:_.uint32},putModbusDefaultSlaveAddress:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/target/modbus-default-slave-address",path:"/1027//22",bodyEncoder:_.uint32},getS3PConfiguration:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/s3p-configuration",path:"/1027//21",responseBodyDecoder:_.targetS3PProtocolConfiguration},setS3PConfiguration:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/s3p-configuration",path:"/1027//21",bodyEncoder:_.targetS3PProtocolConfiguration},putS3PConfiguration:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/target/s3p-configuration",path:"/1027//21",bodyEncoder:_.targetS3PProtocolConfiguration},getModbusTcpConfiguration:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/modbus-tcp-configuration",path:"/1027//21",responseBodyDecoder:_.targetModbusTcpProtocolConfiguration},setModbusTcpConfiguration:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/modbus-tcp-configuration",path:"/1027//21",bodyEncoder:_.targetModbusTcpProtocolConfiguration},putModbusTcpConfiguration:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/target/modbus-tcp-configuration",path:"/1027//21",bodyEncoder:_.targetModbusTcpProtocolConfiguration},getCanConfiguration:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/can-configuration",path:"/1027//21",responseBodyDecoder:_.targetCanProtocolConfiguration},setCanConfiguration:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/can-configuration",path:"/1027//21",bodyEncoder:_.targetCanProtocolConfiguration},putCanConfiguration:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/target/can-configuration",path:"/1027//21",bodyEncoder:_.targetCanProtocolConfiguration},postResetKeep:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/reset-keep",path:"/1027//30"}
1,readDebug:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/debug-access",path:"/1027//31",bodyEncoder:_.uint32},writeDebug:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/debug-access",path:"/1027//31"},getRegisterAccess:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/register-access",path:"/1027//32"},postRegisterAccess:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/register-access",path:"/1027//32"},sendReceive:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/transparent/send-receive",path:"/1027//34"},send:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/transparent/send",path:"/1027//34"},readBytes:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/transparent/read-bytes",path:"/1027//35"},modbusWrite:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/modbus/write",path:"/1027//37",bodyEncoder:_.modbusWriteOptions},modbusRead:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/modbus/read",path:"/1027//38",bodyEncoder:_.modbusOptions},getSubProtocol:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/sub-protocol",path:"/1027//40",responseBodyDecoder:_.targetProtocol},getReceivedCount:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/received-count",path:"/1027//43",responseBodyDecoder:_.uint16},readAddress:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/target/read-address",path:"/1027//33",bodyEncoder:_.memoryInfo},writeAddress:{method:u.TapRequestFrame.MethodType.POST,pathAlias:"/target/read-address",path:"/1027//33",bodyEncoder:_.memoryWriteInfo}};class ae extends p.AbstractService{constructor(){super(...arguments),this.resources=ue}getProtocol(){return this.serviceCallRunner.execute(this.getProtocolCall())}getProtocolCall(){return Object.assign({},this.resources.getProtocol)}setProtocol(v){return this.serviceCallRunner.execute(this.setProtocolCall(v))}setProtocolCall(v){const q=Object.assign({},this.resources.setProtocol);return q.body=v,q}putProtocol(v){return this.serviceCallRunner.execute(this.putProtocolCall(v))}putProtocolCall(v){const q=Object.assign({},this.resources.putProtocol);return q.body=v,q}getCoreType(){return this.serviceCallRunner.execute(this.getCoreTypeCall())}getCoreTypeCall(){return Object.assign({},this.resources.getCoreType)}putCoreType(v){return this.serviceCallRunner.execute(this.putCoreTypeCall(v))}putCoreTypeCall(v){const q=Object.assign({},this.resources.putCoreType);return q.body=v,q}isConnected(){return this.serviceCallRunner.execute(this.isConnectedCall())}isConnectedCall(){return Object.assign({},this.resources.isConnected)}connect(){return this.serviceCallRunner.execute(this.connectCall())}connectCall(){return Object.assign({},this.resources.connect)}disconnect(){return this.serviceCallRunner.execute(this.disconnectCall())}disconnectCall(){return Object.assign({},this.resources.disconnect)}reset(){return this.serviceCallRunner.execute(this.resetCall())}resetCall(){return Object.assign({},this.resources.reset)}getFirmwareVersion(){return this.serviceCallRunner.execute(this.getFirmwareVersionCall())}getFirmwareVersionCall(){return Object.assign({},this.resources.getFirmwareVersion)}putFirmwareVersion(v){return this.serviceCallRunner.execute(this.putFirmwareVersionCall(v))}putFirmwareVersionCall(v){const q=Object.assign({},this.resources.putFirmwareVersion);return q.body=v,q}getVcc(){return this.serviceCallRunner.execute(this.getVccCall())}getVccCall(){return Object.assign({},this.resources.getVcc)}getMinVoltage(){return this.serviceCallRunner.execute(this.getMinVoltageCall())}getMinVoltageCall(){return Object.assign({},this.resources.getMinVoltage)}putMinVoltage(v){return this.serviceCallRunner.execute(this.putMinVoltageCall(v))}putMinVoltageCall(v){const q=Object.assign({},this.resources.putMinVoltage);return q.body=v,q}getMaxVoltage(){return this.serviceCallRunner.execute(this.getMaxVoltageCall())}getMaxVoltageCall(){return Object.assign({},this.resources.getMaxVoltage)}putMaxVoltage(v){return this.serviceCallRunner.execute(this.putMaxVoltageCall(v))}putMaxVoltageCall(v){const q=Object.assign({},this.resources.putMaxVoltage);return q.body=v,q}getPageSize(){return this.serviceCallRunner.execute(this.getPageSizeCall())}getPageSizeCall(){return Object.assign({},this.resources.getPageSize)}putPageSize(v){return this.serviceCallRunner.execute(this.putPageSizeCall(v))}putPageSizeCall(v){const q=Object.assign({},this.resources.putPageSize);return q.body=v,q}getComStats(){return this.serviceCallRunner.execute(this.getComStatsCall())}getComStatsCall(){return Object.assign({},this.resources.getComStats)}clearComStats(){return this.serviceCallRunner.execute(this.clearCom
1StatsCall())}clearComStatsCall(){return Object.assign({},this.resources.clearComStats)}getAvailableProtocols(){return this.serviceCallRunner.execute(this.getAvailableProtocolsCall())}getAvailableProtocolsCall(){return Object.assign({},this.resources.getAvailableProtocols)}getSerialModbusConfiguration(){return this.serviceCallRunner.execute(this.getSerialModbusConfigurationCall())}getSerialModbusConfigurationCall(){return Object.assign({},this.resources.getSerialModbusConfiguration)}setSerialModbusConfiguration(v){return this.serviceCallRunner.execute(this.setSerialModbusConfigurationCall(v))}setSerialModbusConfigurationCall(v){const q=Object.assign({},this.resources.setSerialModbusConfiguration);return q.body=v,q}putSerialModbusConfiguration(v){return this.serviceCallRunner.execute(this.putSerialModbusConfigurationCall(v))}putSerialModbusConfigurationCall(v){const q=Object.assign({},this.resources.putSerialModbusConfiguration);return q.body=v,q}getModbusDefaultSlaveAddress(){return this.serviceCallRunner.execute(this.getModbusDefaultSlaveAddressCall())}getModbusDefaultSlaveAddressCall(){return Object.assign({},this.resources.getModbusDefaultSlaveAddress)}putModbusDefaultSlaveAddress(v){return this.serviceCallRunner.execute(this.putModbusDefaultSlaveAddressCall(v))}putModbusDefaultSlaveAddressCall(v){const q=Object.assign({},this.resources.putModbusDefaultSlaveAddress);return q.body=v,q}getS3PConfiguration(){return this.serviceCallRunner.execute(this.getS3PConfigurationCall())}getS3PConfigurationCall(){return Object.assign({},this.resources.getS3PConfiguration)}setS3PConfiguration(v){return this.serviceCallRunner.execute(this.setS3PConfigurationCall(v))}setS3PConfigurationCall(v){const q=Object.assign({},this.resources.setS3PConfiguration);return q.body=v,q}putS3PConfiguration(v){return this.serviceCallRunner.execute(this.putS3PConfigurationCall(v))}putS3PConfigurationCall(v){const q=Object.assign({},this.resources.putS3PConfiguration);return q.body=v,q}getModbusTcpConfiguration(){return this.serviceCallRunner.execute(this.getModbusTcpConfigurationCall())}getModbusTcpConfigurationCall(){return Object.assign({},this.resources.getModbusTcpConfiguration)}setModbusTcpConfiguration(v){return this.serviceCallRunner.execute(this.setModbusTcpConfigurationCall(v))}setModbusTcpConfigurationCall(v){const q=Object.assign({},this.resources.setModbusTcpConfiguration);return q.body=v,q}putModbusTcpConfiguration(v){return this.serviceCallRunner.execute(this.putModbusTcpConfigurationCall(v))}putModbusTcpConfigurationCall(v){const q=Object.assign({},this.resources.putModbusTcpConfiguration);return q.body=v,q}getCanConfiguration(){return this.serviceCallRunner.execute(this.getCanConfigurationCall())}getCanConfigurationCall(){return Object.assign({},this.resources.getCanConfiguration)}setCanConfiguration(v){return this.serviceCallRunner.execute(this.setCanConfigurationCall(v))}setCanConfigurationCall(v){const q=Object.assign({},this.resources.setCanConfiguration);return q.body=v,q}putCanConfiguration(v){return this.serviceCallRunner.execute(this.putCanConfigurationCall(v))}putCanConfigurationCall(v){const q=Object.assign({},this.resources.putCanConfiguration);return q.body=v,q}postResetKeep(){return this.serviceCallRunner.execute(this.postResetKeepCall())}postResetKeepCall(){return Object.assign({},this.resources.postResetKeep)}readDebug(v){return this.serviceCallRunner.execute(this.readDebugCall(v))}readDebugCall(v){const q=Object.assign({},this.resources.readDebug);return q.body=v,q}writeDebug(){return this.serviceCallRunner.execute(this.writeDebugCall())}writeDebugCall(){return Object.assign({},this.resources.writeDebug)}getRegisterAccess(){return this.serviceCallRunner.execute(this.getRegisterAccessCall())}getRegisterAccessCall(){return Object.assign({},this.resources.getRegisterAccess)}postRegisterAccess(){return this.serviceCallRunner.execute(this.postRegisterAccessCall())}postRegisterAccessCall(){return Object.assign({},this.resources.postRegisterAccess)}sendReceive(v){return this.serviceCallRunner.execute(this.sendReceiveCall(v))}sendReceiveCall(v){const q=Object.assign({},this.resources.sendReceive);return q.body=v,q}send(v){return this.serviceCallRunner.execute(this.sendCall(v))}sendCall(v){const q=Object.assign({},this.resources.send);return q.body=v,q}readBytes(){return this.serviceCallRunner.execute(this.readBytesCall())}readBytesCall(){return Object.assign({},this.resources.readBytes)}modbusWrite(v){return this.serviceCallRunner.execute(this.modbusWrite
1Call(v))}modbusWriteCall(v){const q=Object.assign({},this.resources.modbusWrite);return q.body=v,q}modbusRead(v){return this.serviceCallRunner.execute(this.modbusReadCall(v))}modbusReadCall(v){const q=Object.assign({},this.resources.modbusRead);return q.body=v,q}getSubProtocol(){return this.serviceCallRunner.execute(this.getSubProtocolCall())}getSubProtocolCall(){return Object.assign({},this.resources.getSubProtocol)}getReceivedCount(){return this.serviceCallRunner.execute(this.getReceivedCountCall())}getReceivedCountCall(){return Object.assign({},this.resources.getReceivedCount)}readAddress(v){return this.serviceCallRunner.execute(this.readAddressCall(v))}readAddressCall(v){const q=Object.assign({},this.resources.readAddress);return q.body=v,q}writeAddress(v){return this.serviceCallRunner.execute(this.writeAddressCall(v))}writeAddressCall(v){const q=Object.assign({},this.resources.writeAddress);return q.body=v,q}}const _e=(0,p.extendServiceContainer)("target",ae),Te={"/target/protocol":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/TargetProtocol"}}},"/target/core-type":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/TargetCoreType"}}},"/target/firmware-version":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"string",format:"version"}}},"/target/min-voltage":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/target/max-voltage":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/target/page-size":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint32"}}},"/target/serial-modbus-configuration":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/TargetSerialModbusProtocolConfiguration"}}},"/target/modbus-default-slave-address":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint32"}}},"/target/s3p-configuration":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/TargetS3PProtocolConfiguration"}}},"/target/modbus-tcp-configuration":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/TargetModbusTcpProtocolConfiguration"}}},"/target/can-configuration":{put:{minApiVersion:2.6,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/TargetCanProtocolConfiguration"}}}}},82382:(Ce,he,a)=>{a.d(he,{Hj:()=>w,KQ:()=>I,_L:()=>ce,t5:()=>A,v:()=>Z});var w,p=a(67333),P=a(83355),u=a(20432),z=a(53566),m=a(49697);(function(ee){let g;var L;let f;(L=g=ee.Data||(ee.Data={}))[L.BOOLEAN=0]="BOOLEAN",L[L.INT8=1]="INT8",L[L.INT16=2]="INT16",L[L.INT32=3]="INT32",L[L.ASCII=8]="ASCII",L[L.FLOAT32=19]="FLOAT32",L[L.UINT8=33]="UINT8",L[L.UINT16=34]="UINT16",L[L.UINT32=35]="UINT32",function(L){L[L.TARGET=0]="TARGET",L[L.GPIO=1]="GPIO",L[L.IN_TAP_STATIC=2]="IN_TAP_STATIC",L[L.IN_TAP_VOLATIL=3]="IN_TAP_VOLATIL"}(f=ee.Domain||(ee.Domain={}))})(w||(w={})),p.TapStreamReader.prototype.readModbusVariableAddress=function(){const ee={};return ee.functionCode=this.readUnsigned(1),ee.slave=this.readUnsigned(1),ee.address=this.readUnsigned(2),ee},p.TapStreamReader.prototype.readVariableType=function(){const ee={};return ee.domain=this.readBits(2),ee.data=this.readBits(6),ee},p.TapStreamReader.prototype.readVariableMeta=function(){const ee={};return ee.name=this.readStringTerminator(":"),ee.unit=this.readString(),ee},p.TapStreamWriter.prototype.writeModbusVariableAddress=function(ee){return this.writeUnsigned(ee.functionCode,1),this.writeUnsigned(ee.slave,1),this.writeUnsigned(ee.address,2),this},p.TapStreamWriter.prototype.writeVariableType=function(ee){return this.writeBitsInt((0,p.enumKeyOrValueToNumber)(ee.domain,w.Domain),2),this.writeBitsInt((0,p.enumKeyOrValueToNumber)(ee.data,w.Data),6),this},p.TapStreamWriter.prototype.writeVariableMeta=function(ee){return this.writeString(ee.name+":"),this.writeString(ee.unit),this};class Z{encode(g,f=new p.TapStreamWriter){return f.writeVariableType(g),f.toBytes}decode(g){return(g instanceof p.TapStreamReader?g:p.TapStreamReader.create(g)).readVariableType()}}const ie=new class y{encode(g,f=new p.TapStreamWriter){return f.writeModbusVariableAddress(g),f.toBytes}decode(g){return(g instanceof p.TapStreamReader?g:p.TapStreamReader.create(g)).readModbusVariableAddress()}},W=new Z,fe=new class te{encode(g,f=new p.TapStreamWriter){return f.writeVariableMeta(g),f.toBytes}decode(g){return(g instanceof p.TapStreamReader?g:p.TapStreamReader.create(g)).readVariableMeta()}};var ne=Object.freeze({__proto__:null,modbusVariableAddress:ie,variableType:W,variableMeta:fe});const F=Object.assign(Object.assign(Object.assign({},u.m),ne),z.ac),K={getVariableAddress:{method:P.TapRequestFrame.MethodT
1ype.GET,pathAlias:"/variable/{variableId}/variable-address",path:"/1029/{variableId}/0",responseBodyDecoder:F.uint32},putVariableAddress:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/variable/{variableId}/variable-address",path:"/1029/{variableId}/0",bodyEncoder:F.uint32},putModbusVariableAddress:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/variable/{variableId}/modbus-variable-address",path:"/1029/{variableId}/0",bodyEncoder:F.modbusVariableAddress},getType:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/variable/{variableId}/type",path:"/1029/{variableId}/1",responseBodyDecoder:F.variableType},putType:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/variable/{variableId}/type",path:"/1029/{variableId}/1",bodyEncoder:F.variableType},getRawMeta:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/variable/{variableId}/raw-meta",path:"/1029/{variableId}/8"},putRawMeta:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/variable/{variableId}/raw-meta",path:"/1029/{variableId}/8"},getMeta:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/variable/{variableId}/meta",path:"/1029/{variableId}/8",responseBodyDecoder:F.variableMeta},putMeta:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/variable/{variableId}/meta",path:"/1029/{variableId}/8",bodyEncoder:F.variableMeta},getUnit:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/variable/{variableId}/unit",path:"/1029/{variableId}/9",responseBodyDecoder:F.ascii},putUnit:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/variable/{variableId}/unit",path:"/1029/{variableId}/9",bodyEncoder:F.ascii},getNumberOfElements:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/variable/{variableId}/number-of-elements",path:"/1029/{variableId}/2",responseBodyDecoder:F.uint8},putNumberOfElements:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/variable/{variableId}/number-of-elements",path:"/1029/{variableId}/2",bodyEncoder:F.uint8},getCurrentAccess:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/variable/{variableId}/current-access",path:"/1029/{variableId}/3",responseBodyDecoder:F.readWriteRights},readProfile:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/variable/read-profile",path:"/1029//4"},getValue:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/variable/{variableId}/value",path:"/1029/{variableId}/4"},setValue:{method:P.TapRequestFrame.MethodType.POST,pathAlias:"/variable/{variableId}/value",path:"/1029/{variableId}/5"},putValue:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/variable/{variableId}/value",path:"/1029/{variableId}/4"},getBundleId:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/variable/{variableId}/bundle/id",path:"/1029/{variableId}/6",responseBodyDecoder:F.uint16},putBundleId:{method:P.TapRequestFrame.MethodType.PUT,pathAlias:"/variable/{variableId}/bundle/id",path:"/1029/{variableId}/6",bodyEncoder:F.uint16},getBundleValues:{method:P.TapRequestFrame.MethodType.GET,pathAlias:"/variable/{variableId}/bundle/values",path:"/1029/{variableId}/7"},create:{method:P.TapRequestFrame.MethodType.POST,pathAlias:"/variable/{variableId}/create",path:"/1029/{variableId}/65535",bodyEncoder:F.uint8}};class se extends m.AbstractService{constructor(){super(...arguments),this.resources=K}getVariableAddress(g){return this.serviceCallRunner.execute(this.getVariableAddressCall(g))}getVariableAddressCall(g){const f=Object.assign({},this.resources.getVariableAddress);return f.pathParameters={variableId:g},f}putVariableAddress(g,f){return this.serviceCallRunner.execute(this.putVariableAddressCall(g,f))}putVariableAddressCall(g,f){const L=Object.assign({},this.resources.putVariableAddress);return L.body=f,L.pathParameters={variableId:g},L}putModbusVariableAddress(g,f){return this.serviceCallRunner.execute(this.putModbusVariableAddressCall(g,f))}putModbusVariableAddressCall(g,f){const L=Object.assign({},this.resources.putModbusVariableAddress);return L.body=f,L.pathParameters={variableId:g},L}getType(g){return this.serviceCallRunner.execute(this.getTypeCall(g))}getTypeCall(g){const f=Object.assign({},this.resources.getType);return f.pathParameters={variableId:g},f}putType(g,f){return this.serviceCallRunner.execute(this.putTypeCall(g,f))}putTypeCall(g,f){const L=Object.assign({},this.resources.putType);return L.body=f,L.pathParameters={variableId:g},L}getRawMeta(g){return this.serviceCallRunner.execute(this.getRawMetaCall(g))}getRawMetaCall(g){const f=Object.assign({},this.resources.getRawMeta);return f.pathParameters={variableId:g},f}putRawMeta(g,f){return this.serviceCallRunner.execute(this.putRawMetaCall(g,f))}putRawMetaCall(g,f){const L=Object.assign({},this.resources.putRawMeta);return L.body=f,L.pathParameters={variableId:g},L}getMeta(g){return this.serviceCallRunner.execute(this.getMetaCall(g))}getMetaCall(g){const f=Object.assign({},this.resources.getMeta);return f.pathParameters={variableId:g},f}putMeta(g,f){return this.serviceCallRunner.execute(this.putMetaCall(g,f))}putMetaCall(g,f){const L=Object.assign({},this.resources.putMeta);return L.body=f,L.pathParameters={variableId:g},L}getUnit(g){return this.serviceCallRunner.execute(this.getUnitCall(g))}getUnitCall(g){const f=Object.assign({},this.resources.getUnit);return f.pathParameters={variableId:g},f}putUnit(g,f){return this.serviceCallRunner.execute(this.putUnitCall(g,f))}putUnitCall(g,f){const L=Object.assign({},this.resources.putUnit);return L.body=f,L.pathParameters={variableId:g},L}getNumberOfElements(g){return this.serviceCallRunner.execute(this.getNumberOfElementsCall(g))}getNumberOfElementsCall(g){const f=Object.assign({},this.resources.getNumberOfElements);return f.pathParameters={variableId:g},f}putNumberOfElements(g,f){return this.serviceCallRunner.execute(this.putNumberOfElementsCall(g,f))}putNumberOfElementsCall(g,f){const L=Object.assign({},this.resources.putNumberOfElements);return L.body=f,L.pathParameters={variableId:g},L}getCurrentAccess(g){return this.serviceCallRunner.execute(this.getCurrentAccessCall(g))}getCurrentAccessCall(g){const f=Object.assign({},this.resources.getCurrentAccess);return f.pathParameters={variableId:g},f}readProfile(){return this.serviceCallRunner.execute(this.readProfileCall())}readProfileCall(){return Object.assign({},this.resources.readProfile)}getValue(g){return this.serviceCallRunner.execute(this.getValueCall(g))}getValueCall(g){const f=Object.assign({},this.resources.getValue);return f.pathParameters={variableId:g},f}setValue(g,f){return this.serviceCallRunner.execute(this.setValueCall(g,f))}setValueCall(g,f){const L=Object.assign({},this.resources.setValue);return L.body=f,L.pathParameters={variableId:g},L}putValue(g,f){return this.serviceCallRunner.execute(this.putValueCall(g,f))}putValueCall(g,f){const L=Object.assign({},this.resources.putValue);return L.body=f,L.pathParameters={variableId:g},L}
1getBundleId(g){return this.serviceCallRunner.execute(this.getBundleIdCall(g))}getBundleIdCall(g){const f=Object.assign({},this.resources.getBundleId);return f.pathParameters={variableId:g},f}putBundleId(g,f){return this.serviceCallRunner.execute(this.putBundleIdCall(g,f))}putBundleIdCall(g,f){const L=Object.assign({},this.resources.putBundleId);return L.body=f,L.pathParameters={variableId:g},L}getBundleValues(g){return this.serviceCallRunner.execute(this.getBundleValuesCall(g))}getBundleValuesCall(g){const f=Object.assign({},this.resources.getBundleValues);return f.pathParameters={variableId:g},f}create(g,f){return this.serviceCallRunner.execute(this.createCall(g,f))}createCall(g,f){const L=Object.assign({},this.resources.create);return L.body=f,L.pathParameters={variableId:g},L}}const Y=new p.StringConverter("utf8");se.prototype.getMeta=function(ee){return this.getRawMeta(ee).then(g=>{const f=g;return f.setBodyDecoder({decode:L=>{const[Pe,...Re]=Y.decode(L).split(":");return{name:Pe,unit:Re.length>0?Re[0]:""}}}),f})},se.prototype.putMeta=function(ee,g){const f=Y.encode(`${g.name}:${g.unit}`);return this.putRawMeta(ee,f)},se.prototype.getAllValues=function(){return this.readProfile().then(ee=>{const g=ee;if(g.isSuccessful()){const f=g.rawBody(),Pe=(new p.TlvBundleConverter).decode(f);g.setBody(Pe)}return g})};class ce{constructor(){this.utf8Converter=new p.StringConverter("utf8")}encode(g){return this.utf8Converter.encode(`${g.name||""}:${g.unit||""}`)}decode(g){const L=this.utf8Converter.decode(g).split(":");return{name:L[0],unit:L.length>=2?L[1]:""}}}const A=(0,m.extendServiceContainer)("variable",se),I={"/variable/{variableId}/variable-address":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint32"}}},"/variable/{variableId}/modbus-variable-address":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/ModbusVariableAddress"}}},"/variable/{variableId}/type":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/VariableType"}}},"/variable/{variableId}/raw-meta":{put:{minApiVersion:1.73,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/Bytes"}}},"/variable/{variableId}/meta":{put:{minApiVersion:1.73,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/VariableMeta"}}},"/variable/{variableId}/unit":{put:{minApiVersion:1.6,configModeRequired:!0,schema:{type:"string"}}},"/variable/{variableId}/number-of-elements":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint8"}}},"/variable/{variableId}/value":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/Bytes"}}},"/variable/{variableId}/bundle/id":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}}},Q=new ce;K.getMeta.responseBodyDecoder=Q,K.putMeta.bodyEncoder=Q},35431:(Ce,he,a)=>{a.d(he,{Kg:()=>I,Zx:()=>w,ag:()=>b,fr:()=>Q,t9:()=>m,v2:()=>y});var m,ee,b,w,y,p=a(49697),u=a(83355),z=a(20432);(ee=m||(m={}))[ee.PEER_TO_PEER=0]="PEER_TO_PEER",ee[ee.NETWORK=1]="NETWORK",function(ee){ee[ee.B=1]="B",ee[ee.G=2]="G",ee[ee.N=4]="N"}(b||(b={})),function(ee){ee[ee.VISIBLE=0]="VISIBLE",ee[ee.HIDDEN_FROM_SCAN=1]="HIDDEN_FROM_SCAN",ee[ee.HIDDEN=2]="HIDDEN"}(w||(w={})),function(ee){ee[ee.VISIBLE=0]="VISIBLE",ee[ee.HIDDEN=1]="HIDDEN"}(y||(y={}));const Z=(0,z.u)(m,1),te=(0,z.PU)(m,1),ie=(0,z.u)(b,1),W=(0,z.PU)(b,1),fe=(0,z.u)(w,1),ne=(0,z.PU)(w,1),F=(0,z.u)(y,1),K=(0,z.PU)(y,1);var se=Object.freeze({__proto__:null,wifiMode:Z,wifiModeArray:te,wifiProtocol:ie,wifiProtocolArray:W,wifiSSIDVisibility:fe,wifiSSIDVisibilityArray:ne,wifiKeyVisibility:F,wifiKeyVisibilityArray:K});const Y=Object.assign(Object.assign({},z.m),se),ce={getMode:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/mode",path:"/1024//15",responseBodyDecoder:Y.wifiMode},putMode:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/mode",path:"/1024//15",bodyEncoder:Y.wifiMode},getKey:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/key",path:"/1024//16",responseBodyDecoder:Y.ascii},putKey:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/key",path:"/1024//16",bodyEncoder:Y.ascii}
1,getHostname:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/hostname",path:"/1024//35",responseBodyDecoder:Y.ascii},getIp:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/ip",path:"/1024//30",responseBodyDecoder:Y.stringIpv4},putIp:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/ip",path:"/1024//30",bodyEncoder:Y.stringIpv4},getGatewayIp:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/gateway-ip",path:"/1024//31",responseBodyDecoder:Y.stringIpv4},putGatewayIp:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/gateway-ip",path:"/1024//31",bodyEncoder:Y.stringIpv4},getIpMask:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/ip-mask",path:"/1024//32",responseBodyDecoder:Y.stringIpv4mask},putIpMask:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/ip-mask",path:"/1024//32",bodyEncoder:Y.stringIpv4mask},getDnsIp:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/dns-ip",path:"/1024//124",responseBodyDecoder:Y.stringIpv4},putDnsIp:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/dns-ip",path:"/1024//124",bodyEncoder:Y.stringIpv4}
1,getSSID:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/ssid",path:"/1024//25",responseBodyDecoder:Y.ascii},putSSID:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/ssid",path:"/1024//25",bodyEncoder:Y.ascii},getCountryCode:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/country-code",path:"/1024//95",responseBodyDecoder:Y.uint16},putCountryCode:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/country-code",path:"/1024//95",bodyEncoder:Y.uint16},getProtocol:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/protocol",path:"/1024//96",responseBodyDecoder:Y.wifiProtocol},putProtocol:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/protocol",path:"/1024//96",bodyEncoder:Y.wifiProtocolArray},getTxPower:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/tx-power",path:"/1024//97",responseBodyDecoder:Y.int8},putTxPower:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/tx-power",path:"/1024//97",bodyEncoder:Y.int8},getSSIDVisibility:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/ssid-visibility",path:"/1024//98",responseBodyDecoder:Y.wifiSSIDVisibility},putSSIDVisibility:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/ssid-visibility",path:"/1024//98",bodyEncoder:Y.wifiSSIDVisibility},getKeyVisibility:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/key-visibility",path:"/1024//99",responseBodyDecoder:Y.wifiKeyVisibility},putKeyVisibility:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/key-visibility",path:"/1024//99",bodyEncoder:Y.wifiKeyVisibility},getNetworkMode:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/network-mode",path:"/1024//128",responseBodyDecoder:Y.wifiMode},putNetworkMode:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/network-mode",path:"/1024//128",bodyEncoder:Y.wifiMode},getDisabled:{method:u.TapRequestFrame.MethodType.GET,pathAlias:"/wifi/disabled",path:"/1024//129",responseBodyDecoder:Y.boolean},putDisabled:{method:u.TapRequestFrame.MethodType.PUT,pathAlias:"/wifi/disabled",path:"/1024//129",bodyEncoder:Y.boolean}};class A extends p.AbstractService{constructor(){super(...arguments),this.resources=ce}getMode(){return this.serviceCallRunner.execute(this.getModeCall())}getModeCall(){return Object.assign({},this.resources.getMode)}putMode(g){return this.serviceCallRunner.execute(this.putModeCall(g))}putModeCall(g){const f=Object.assign({},this.resources.putMode);return f.body=g,f}getKey(){return this.serviceCallRunner.execute(this.getKeyCall())}getKeyCall(){return Object.assign({},this.resources.getKey)}putKey(g){return this.serviceCallRunner.execute(this.putKeyCall(g))}putKeyCall(g){const f=Object.assign({},this.resources.putKey);return f.body=g,f}getHostname(){return this.serviceCallRunner.execute(this.getHostnameCall())}getHostnameCall(){return Object.assign({},this.resources.getHostname)}getIp(){return this.serviceCallRunner.execute(this.getIpCall())}getIpCall(){return Object.assign({},this.resources.getIp)}putIp(g){return this.serviceCallRunner.execute(this.putIpCall(g))}putIpCall(g){const f=Object.assign({},this.resources.putIp);return f.body=g,f}getGatewayIp(){return this.serviceCallRunner.execute(this.getGatewayIpCall())}getGatewayIpCall(){return Object.assign({},this.resources.getGatewayIp)}putGatewayIp(g){return this.serviceCallRunner.execute(this.putGatewayIpCall(g))}putGatewayIpCall(g){const f=Object.assign({},this.resources.putGatewayIp);return f.body=g,f}getIpMask(){return this.serviceCallRunner.execute(this.getIpMaskCall())}getIpMaskCall(){return Object.assign({},this.resources.getIpMask)}putIpMask(g){return this.serviceCallRunner.execute(this.putIpMaskCall(g))}putIpMaskCall(g){const f=Object.assign({},this.resources.putIpMask);return f.body=g,f}getDnsIp(){return this.serviceCallRunner.execute(this.getDnsIpCall())}getDnsIpCall(){return Object.assign({},this.resources.getDnsIp)}putDnsIp(g){return this.serviceCallRunner.execute(this.putDnsIpCall(g))}putDnsIpCall(g){const f=Object.assign({},this.resources.putDnsIp);return f.body=g,f}getSSID(){return this.serviceCallRunner.execute(this.getSSIDCall())}getSSIDCall(){return Object.assign({},this.resources.getSSID)}putSSID(g){return this.serviceCallRunner.execute(this.putSSIDCall(g))}putSSIDCall(g){const f=Object.assign({},this.resources.putSSID);return f.body=g,f}getCountryCode(){return this.serviceCallRunner.execute(this.getCountryCodeCall())}getCountryCodeCall(){return Object.assign({},this.resources.getCountryCode)}putCountryCode(g){return this.serviceCallRunner.execute(this.putCountryCodeCall(g))}putCountryCodeCall(g){const f=Object.assign({},this.resources.putCountryCode);return f.body=g,f}getProtocol(){return this.serviceCallRunner.execute(this.getProtocolCall())}getProtocolCall(){return Object.assign({},this.resources.getProtocol)}putProtocol(g){return this.serviceCallRunner.execute(this.putProtocolCall(g))}putProtocolCall(g){const f=Object.assign({},this.resources.putProtocol);return f.body=g,f}getTxPower(){return this.serviceCallRunner.execute(this.getTxPowerCall())}getTxPowerCall(){return Object.assign({},this.resources.getTxPower)}putTxPower(g){return this.serviceCallRunner.execute(this.putTxPowerCall(g))}putTxPowerCall(g){const f=Object.assign({},this.resources.putTxPower);return f.body=g,f}getSSIDVisibility(){return this.serviceCallRunner.execute(this.getSSIDVisibilityCall())}getSSIDVisibilityCall(){return Object.assign({},this.resources.getSSIDVisibility)}putSSIDVisibility(g){return this.serviceCallRunner.execute(this.putSSIDVisibilityCall(g))}putSSIDVisibilityCall(g){const f=Object.assign({},this.resources.putSSIDVisibility);return f.body=g,f}getKeyVisibility(){return this.serviceCallRunner.execute(this.getKeyVisibilityCall())}
1getKeyVisibilityCall(){return Object.assign({},this.resources.getKeyVisibility)}putKeyVisibility(g){return this.serviceCallRunner.execute(this.putKeyVisibilityCall(g))}putKeyVisibilityCall(g){const f=Object.assign({},this.resources.putKeyVisibility);return f.body=g,f}getNetworkMode(){return this.serviceCallRunner.execute(this.getNetworkModeCall())}getNetworkModeCall(){return Object.assign({},this.resources.getNetworkMode)}putNetworkMode(g){return this.serviceCallRunner.execute(this.putNetworkModeCall(g))}putNetworkModeCall(g){const f=Object.assign({},this.resources.putNetworkMode);return f.body=g,f}getDisabled(){return this.serviceCallRunner.execute(this.getDisabledCall())}getDisabledCall(){return Object.assign({},this.resources.getDisabled)}putDisabled(g){return this.serviceCallRunner.execute(this.putDisabledCall(g))}putDisabledCall(g){const f=Object.assign({},this.resources.putDisabled);return f.body=g,f}}const I=(0,p.extendServiceContainer)("wifi",A),Q={"/wifi/mode":{put:{minApiVersion:1,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/WifiMode"}}},"/wifi/key":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",minLength:8,maxLength:64}}},"/wifi/ip":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",format:"ipv4",pattern:"^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$"}}},"/wifi/gateway-ip":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",format:"ipv4"}}},"/wifi/ip-mask":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",format:"ipv4mask"}}},"/wifi/dns-ip":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",format:"ipv4"}}},"/wifi/ssid":{put:{minApiVersion:1,configModeRequired:!1,schema:{type:"string",maxLength:32,minLength:1,pattern:'^[^ !#;+\\]\\/"\\t][^+\\]\\/"\\t]{0,30}[^ !#;+\\]\\/"\\t]$|^[^ !#;+\\]\\/"\\t]$'}}},"/wifi/country-code":{put:{minApiVersion:1.88,configModeRequired:!1,schema:{type:"integer",format:"uint16"}}},"/wifi/protocol":{put:{minApiVersion:1.88,configModeRequired:!1,schema:{type:"array",items:{$ref:"./definitions.yaml#/WifiProtocol"}}}},"/wifi/tx-power":{put:{minApiVersion:1.88,configModeRequired:!1,schema:{type:"integer",format:"int8"}}},"/wifi/ssid-visibility":{put:{minApiVersion:1.88,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/WifiSSIDVisibility"}}},"/wifi/key-visibility":{put:{minApiVersion:1.88,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/WifiKeyVisibility"}}},"/wifi/network-mode":{put:{minApiVersion:2.13,configModeRequired:!1,schema:{$ref:"./definitions.yaml#/WifiMode"}}},"/wifi/disabled":{put:{minApiVersion:2.13,configModeRequired:!1,schema:{type:"boolean"}}}}},21870:(Ce,he,a)=>{a.r(he),a.d(he,{AutoFocusDirective:()=>le,BleRssiSignalComponent:()=>St,BleService:()=>rr,CONFIGURATION_MODE_VERSION:()=>z,ConfigDefaults:()=>pe,ConnectedTapResolver:()=>M,ConnectionState:()=>ke,CsvConfigConsts:()=>U,CurrentDeviceService:()=>B,DEFAULT_TAP_REQUEST_MAX_SIZE_OPTIONS:()=>Kt,DataHolder:()=>_,DataManagerIonic:()=>ue,DeviceFilterPipe:()=>Nt,DisableControlDirective:()=>we,DisconnectCurrentTapGuard:()=>We,EnumPipe:()=>Se,ExportToCsv:()=>de,ExtractBitsPipe:()=>Ue,FACTORY_RESET_MODE_VERSION:()=>m,GlobalEventsService:()=>Wt,HasCurrentTapGuard:()=>X,InlineEditorComponent:()=>D,InlineEditorModule:()=>zt,IonicDataLogger:()=>me,LONG_RANGE_PROTOCOL_FILTER:()=>Oe,LibCommonModule:()=>He,LibError:()=>ve,MockVariable:()=>Pr,NfcReTapService:()=>Zt,NfcService:()=>gt,PendingCallManager:()=>xt,ProtocolFactoryService:()=>v,RememberValueControlDirective:()=>$e,RssiToSignalStrenghtPipe:()=>Ot,RunnableState:()=>je,TAP_BLE_SCANNER:()=>p,TAP_CONNECTION_OPTIONS_PROVIDER:()=>Jr,TAP_EXECUTE_TAP_ACTION_SERVICE:()=>pt,TAP_INFO_RESOLVER_CONFIG:()=>gr,TAP_MANAGER_APP_ID:()=>An,TAP_NETWORK_SCANNER:()=>u,TAP_WIFI_SCANNER:()=>P,TASK_MANAGER_RESOLUTION_SERVICE:()=>lr,TapAdministrationService:()=>Yt,TapApiExplorerService:()=>yt,TapConnectionService:()=>tr,TapConnectionStoreItemComponent:()=>mt,TapConnectionStoreListComponent:()=>Ct,TapConnectionStoreModule:()=>er,TapConnectionStoreService:()=>at,TapInfo:()=>De,TapInfoCacheService:()=>et,TapInfoConfigService:()=>st,TapInfoDAOService:()=>Tt,TapInfoRequestService:()=>ot,TapNfcInitializationResolver:()=>sr,TapRegisterProtocolsMethod:()=>lt,TapRequestPipe:()=>Ae,TapScanResultsComponent:()=>Et,TapScannerBleComponent:()=>bt,TapScannerBleModule:()=>nr,TapScannerCommonModule:()=>Rt,TapScannerNfcService:()=>ut,TapScannerWebBluetoothComponent:()=>At,TapScannerWebBluetoothModule:()=>ir,TapScannerWifiItemComponent:()=>Pt,TapScannerWifiModule:()=>
1or,TapSelectedGuard:()=>ar,TapServiceError:()=>Be,TapTargetConnectService:()=>cr,TapValueEditorContainerComponent:()=>ft,TapValueEditorContainerModule:()=>Bt,TaskManagerActionCancelDirective:()=>wt,TaskManagerActionComponent:()=>jt,TaskManagerActionExecDirective:()=>It,TaskManagerComponent:()=>Vt,TaskManagerDelayedComponent:()=>qt,TaskManagerModule:()=>Ft,TaskManagerRunningComponent:()=>Lt,TaskManagerService:()=>Ze,TaskManagerUiModule:()=>dr,TrimPipe:()=>Ye,UniqArray:()=>mr,chunkMultiTapRequestCalls:()=>Mr,computeMultiTapRequestCallSize:()=>Gt,computeTapRequestCallSize:()=>Ir,createBleName:()=>Ne,createCacheKey:()=>Je,createMultiTapRequestCallChuncksExecutor:()=>xr,createSingleChunkMultiTapRequestCalls:()=>fr,filterByConnectionTypes:()=>Jt,filterUndefined:()=>vt,getAbstractVariableOrError:()=>s,getFormFieldOrError:()=>O,interfaceServiceGetAppPathResolved:()=>V,isNfcTapRequiredError:()=>Te,isSameTag:()=>_e,isTapResultCodeError:()=>it,isTapUserNotAuthorizedError:()=>Qe,runInZone:()=>q,toTapInfoKeyEquals:()=>Xt,toTapInfoKeyObject:()=>Xe});const p="TAP_BLE_SCANNER",P="TAP_WIFI_SCANNER",u="TAP_NETWORK_SCANNER",z="255.255.65535",m="0.0.0";var b=a(10467),w=a(31635),y=a(66656),Z=a(56219),te=a(54536),ie=a(75076),W=a(49697),fe=a(74813),ne=a(83355),F=a(67333),K=a(74707),se=a(8872),Y=a(3827),ce=function(l,e,t,n){return new(t||(t=Promise))(function(x,$){function re(Me){try{ye(n.next(Me))}catch(Ve){$(Ve)}}function oe(Me){try{ye(n.throw(Me))}catch(Ve){$(Ve)}}function ye(Me){Me.done?x(Me.value):function C(x){return x instanceof t?x:new t(function($){$(x)})}(Me.value).then(re,oe)}ye((n=n.apply(l,e||[])).next())})};function A(){return ce(this,void 0,void 0,function*(){const l=(yield this.service.firmware.getState()).body();if(l!==Y.xk.NORMAL&&l!==Y.xk.LEGACY)throw new Error("Cannot restore factory configuration during firmware update process.");(yield this.service.device.factoryReset()).successful()})}W.Tap.prototype.factoryReset=A;var I=a(80722),Q=a(78172),ee=a(93878),g=a(70282),f=a(40482),L=a(82367),Pe=a(41886),Re=a(50951);function c(){return(c=(0,b.A)(function*(){const l=yield this.getStatus();l.successful();const t=(yield l.rawBody()).slice(2,5);return{major:t[0],minor:t[1],patch:t[2]}})).apply(this,arguments)}function V(){return H.apply(this,arguments)}function H(){return(H=(0,b.A)(function*(){const l=yield this.getAppPath();if(l.isSuccessful()){let e=l.body();if(e.length>=3){const t=e.substring(0,3),n=e.substring(3);switch(t){case W.AppPathType.PRIMER_CLOUD_WEB_APP_URL:e=`https://user.cloud.iotize.com/users/${n}`;break;case W.AppPathType.URL:e=`${n}`;break;case W.AppPathType.PRIMER_CLOUD_CONFIG_URL:e=`https://user.cloud.iotize.com/users/${n}`}}l.setBody(e)}return l})).apply(this,arguments)}function N(){return(N=(0,b.A)(function*(){const l=yield this.getAppPath();if(l.isSuccessful()){let e=l.body();if("$5"===e.substr(0,2))e=`http://user.cloud.iotize.com/users${e.substr(2)}`;else!e.endsWith(".json")&&!e.endsWith(".xml")&&!e.endsWith(".cloud")&&(e="");l.setBody(e)}return l})).apply(this,arguments)}function i(){return(i=(0,b.A)(function*(){const l=yield this.getSubProtocol(),e=W.TapResponse.SUCCESS();return l.isSuccessful()?e.setBody("tapnpass"):e.setBody("tapnlink"),e})).apply(this,arguments)}Pe.Q3.prototype.getAdpVersion=function Ee(){return c.apply(this,arguments)},L.InterfaceService.prototype.getAppPathResolved=V,L.InterfaceService.prototype.getConfigPath=function ge(){return N.apply(this,arguments)},Re.tT.prototype.getAppType=function G(){return i.apply(this,arguments)};var T=a(14961);const h=(0,a(15730).createDebugger)("@iotize/ionic/core"),k="DataManager";class _{constructor(e=[]){this.items=e}item(e){const t=this.items.find(n=>n.id==e);if(!t)throw new Error(`Item with id "${e}" does not exist`);return t}add(e,t){return(t||null==this.items.find(n=>n.id==e.id))&&(h(k,"Added item: ",e),this.items.push(e)),this.item(e.id)}}class ue{constructor(e){this.tap=e,this.sourceControllers={}}get sourceController(){const e=this.switchableStreamController.getCurrentSourceId();return this.sourceControllers[e]}get isMonitoringRunning(){for(const e of Object.values(this.sourceControllers))if(e.state==T.MonitorEngine.State.START)return!0;return!1}listVariables(){return this.tap.data.listVariables()}listBundles(){return this.tap.data.listBundles()}stopAll(){h(k,"Stop monitoring"),this.tap.data.monitoring.stop()}startAll(e){this.tap.data.monitoring.start()}setMonitoringPeriod(e){h(k,"Changing monitoring period to ",e),this.sourceController.period.next(e)}destroy(){this.stopAll()}refresh(){this.sourceController.refresh&&this.sourceController.refresh()}changeDataSource(e){if("datalog"===e)this.useDatalogSource();else this.useLiveSource()}useLiveSource(){this.switchableStreamController.useSource("live")}useDatalogSource(){this.switchableStreamController.useSource("datalog")}}var ae=a(53876);function _e(l,e){return(0,ae.bufferToHexString)(l.id)===(0,ae.bufferToHexString)(e.id)}function Te(l){const e=function S(l){let e=0;for(;l.cause&&e<5;)l=l.cause,e++;return l}(l);return(0,te.isCodeError)(ie.UL.ErrorCode.TagLostError,e)||(0,te.isCodeError)(ie.UL.ErrorCode.NotConnectedError,e)||(0,te.isCodeError)(ie.UL.ErrorCode.Unknown,e)||(0,te.isCodeError)(ie.UL.ErrorCode.InternalError,e)}class v{constructor(){}create(e){throw new Error(`Unsupported protocol type "${e.type}"`)}isValid(e){return!1}}function q(l){return e=>new g.Observable(t=>e.subscribe($=>l.run(()=>t.next($)),$=>l.run(()=>t.error($)),()=>l.run(()=>t.complete())))}class ve{static missingFromField(e){return new Error(`InternalError: form must have a field with name "${e}"`)}static componentArgumentRequired(e,t){return new Error(`InternalError: ${e} requires input "${t}"`)}static abstractVariableRequired(){return new Error("InternalError: AbstractVariable c
1annot be undefined")}}function Ne(l,e){return l+"_"+e.substr(e.length-5)}function O(l,e){const t=l.get(e);if(!t)throw ve.missingFromField(e);return t}function s(l){if(l)return l;throw ve.abstractVariableRequired()}const d="CurrentDeviceService";function Oe(l){return"nfc"!==l.type}function Ie(l){try{return l.getCurrentProtocol()}catch{return}}class Be extends Error{static illegalArgument(e){throw new Error(`Illegal argument: ${e}`)}static illegalStateNoTap(){return new Be("Illegal state: Tap is not set yet")}}let B=class{get sessionStateSnapshot(){return this._sessionStateSnapshot}get sessionState(){return this._sessionState$}get protocolMeta$(){return this._protocolMeta.asObservable()}get availableProtocols$(){return this._availableProtocols.asObservable()}get protocolMeta(){return this._protocolMeta.value}set protocolMeta(e){e&&this.addProtocolMeta(e),h(d,"setting protocol meta",e),this._protocolMeta.next(e)}get connectionLost(){return this._connectionLost$.asObservable()}get availableProtocols(){return this._availableProtocols.value}get tap(){if(!this._tap)throw new Error("Connect to a device first");return this._tap}get tapOrUndefined(){return this._tap}get hasTap(){return void 0!==this._tap}set tapConfig(e){h(d,"Set Tap config",e),this.dataManager=new ue(this.tap),this._tapConfig$.next(e),e&&(e.config?.data?this.tap.data.configureWithDataConfig(e.config.data):this.tap.data.clear())}get tapConfig(){return this._tapConfig$.value}get tapConfig$(){return this._tapConfig$}isSameTag(e){if(this.protocolMeta&&"nfc"===this.protocolMeta.type){const t=this.protocolMeta.info.tag;return(!t.id||0!=t.id?.length)&&_e(t,e)}{const t=this.availableProtocols.find(n=>"nfc"===n.type);if(t)return _e(t.info.tag,e)}return!1}useProtocol(e){var t=this;return(0,b.A)(function*(n,C=!0,x=!0){h(d,"use protocol",n);const $=yield t.protocolFactory.create(n);if(t._tap){if(C)try{yield t.tap.protocol.disconnect().toPromise()}catch(re){console.warn("Cannot disconnect current protocol properly: ",re)}t._tap.useComProtocol($)}else t.tap=W.Tap.fromProtocol($);t.protocolMeta=n,x&&(yield t.connect())}).apply(this,arguments)}executeFactoryReset(){var e=this;return(0,b.A)(function*(){yield e.tap.factoryReset(),e.tap.auth.clearCache(),e.tap.encryption.stop()})()}set tap(e){this.setTap(e,{emit:!0})}constructor(e,t,n,C){var x=this;this.platform=e,this.toastCtrl=t,this.protocolFactory=n,this.ngZone=C,this._loadedTapExtensions=[K.D,se.A,I.UI,ee.lhq,fe._TAP_EXTENSION_AUTH_,A],this._tapOrUndefined=new g.BehaviorSubject(void 0),this._connectionLost$=new g.Subject,this._sessionState$=this._tapOrUndefined.pipe((0,f.switchMap)($=>$?$.auth.sessionState:(0,g.of)(fe.INITIAL_SESSION_STATE))),this.listeners=[],this.keepAlivePeriod=1e4,this.meta={},this._tapConfig$=new g.BehaviorSubject(void 0),this._maxFrameSizeCache={},this.tapOrUndefinedChangedWithLastValue=this._tapOrUndefined.pipe((0,f.distinctUntilChanged)()),this.tapOrUndefinedChanged=this.tapOrUndefinedChangedWithLastValue.pipe((0,f.skip)(1)),this.tapChanged=this.tapOrUndefinedChanged.pipe((0,f.filter)($=>!!$)),this.tapChangedWithLastValue=this.tapOrUndefinedChangedWithLastValue.pipe((0,f.filter)($=>!!$)),this.tapRemoved=new g.Subject,this._protocolMeta=new g.BehaviorSubject(void 0),this._availableProtocols=new g.BehaviorSubject([]),this._isManualDisconnection=!1,this._sessionStateSnapshot=fe.INITIAL_SESSION_STATE,this.connectionStateReplay=this.tapOrUndefinedChangedWithLastValue.pipe((0,f.switchMap)($=>{if(!$)return(0,g.of)({newState:Q.K.DISCONNECTED,oldState:Q.K.DISCONNECTED});const re=Ie($.client);return $.client.onProtocolChange().pipe((0,f.startWith)({newProtocol:re}),(0,f.switchMap)(oe=>oe.newProtocol?oe.newProtocol.onConnectionStateChange().pipe(q(this.ngZone),(0,f.startWith)({newState:oe.newProtocol.getConnectionState(),oldState:Q.K.DISCONNECTED})):(0,g.of)({newState:Q.K.DISCONNECTED,oldState:Q.K.DISCONNECTED})))}),(0,f.shareReplay)(1)),this._connectionState$=this.connectionStateReplay.pipe((0,f.skip)(1)),h(d,"NEW INSTANCE",this._loadedTapExtensions),this.tapChangedWithLastValue.subscribe($=>{$.client.addInterceptor((re,oe)=>oe.handle(re).pipe((0,f.tap)(ye=>{const Me=new W.TapResponse(ye,re.request);Me.status===ne.ResultCode.UNAUTHORIZED&&F.TapRequestHelper.pathToString(re.request.header.path)!==this.tap.service.interface.resources.login.path&&this.listeners.forEac
1h(Ve=>{Ve.onTapRequestUnauthorized&&Ve.onTapRequestUnauthorized({request:re,response:Me})}),Me.isSuccessful()||this.listeners.forEach(Ve=>{Ve.onTapRequestError&&Ve.onTapRequestError({request:re.request,error:new W.TapResponseStatusError(Me),response:Me})})},ye=>{this.listeners.forEach(Me=>{console.warn(`Request ${re.request} errored: ${ye}`),Me.onTapRequestError&&Me.onTapRequestError({request:re.request,error:ye})})})))}),this.sessionState.subscribe($=>{this._sessionStateSnapshot=$}),this.connectionStateReplay.subscribe(function(){var $=(0,b.A)(function*(re){re.newState===Q.K.DISCONNECTED?(x.keepAliveEngine?.stop(),x._isManualDisconnection||x._connectionLost$?.next(re)):re.newState==Q.K.CONNECTED&&x.ngZone.runOutsideAngular(()=>{x.keepAlivePeriod>0?(h(d,"Start keep alive with period",x.keepAlivePeriod),x.keepAliveEngine?.start()):h(d,"NO keep alive")}),x.listeners.forEach(oe=>oe.onTapConnectionStateChange(re))});return function(re){return $.apply(this,arguments)}}())}addProtocolMeta(e){if(e){const t=this.availableProtocols,n=t.findIndex(C=>C.type===e.type);n>=0?(h(d,"Protocol meta",e,"already exists. Replacing infos"),t[n]=e,this._availableProtocols.next(t)):(h(d,"Adding protocol meta",e),t.push(e),this._availableProtocols.next(t))}}registerProtocolsFromTag(e){var t=this;return(0,b.A)(function*(){let n;if(!e.ndefMessage)return;const C=(0,ie.hl)(e.ndefMessage);if(C.macAddress&&"00:00:00:00:00:00"!==C.macAddress)n={type:"ble",info:{mac:C.macAddress,name:C.name}};else if(C.ssid){const x=(yield t.tap.service.wifi.getHostname()).body();n={type:"wifi",info:{ssid:C.ssid,url:`tcp://${x}:2000`}}}return n&&t.addProtocolMeta(n),n})()}getCurrentHostProtocolMaxFrameSizeCacheFirst(){var e=this;return(0,b.A)(function*(){const t=e.protocolMeta?.type;if(!t||!e._maxFrameSizeCache[t]){const n=(yield e.tap.service.interface.getCurrentHostProtocolMaxFrameSize()).body();if(n.request>255&&(n.request-=2),!t)return n;e._maxFrameSizeCache[t]=n}return e._maxFrameSizeCache[t]})()}registerProtocolsFromTap(){var e=this;return(0,b.A)(function*(){const t=[],[n,C,x,$,re]=yield e.tap.service.interface.executeMultipleCalls([e.tap.service.interface.getAppNameCall(),e.tap.service.device.getSerialNumberCall(),e.tap.service.interface.getAuthorizedHostProtocolCall(),e.tap.service.ble.getAddressCall(),e.tap.service.wifi.getIpCall()]),oe=x.body();if("ble"!==e.protocolMeta?.type&&oe.includes(W.HostProtocol.BLE))if(e.platform.is("ios")){const ye=Ne(n.body(),C.body());t.push({type:"ble",info:{name:ye}})}else t.push({type:"ble",info:{mac:$.body()}});if("socket"!==e.protocolMeta?.type&&e.platform.is("mobile")&&oe.includes(W.HostProtocol.WIFI)){const ye=re.body();ye&&"0.0.0.0"!==ye&&t.push({type:"socket",info:{url:"tcp://"+ye+":2000"}})}return t.forEach(ye=>e.addProtocolMeta(ye)),t})()}useProtocolFromMeta(e){var t=this;return(0,b.A)(function*(n,C=!0,x=!0){if(!t.protocolMeta||n.type!==t.protocolMeta.type)return yield t.useProtocol(n,C,x)}).apply(this,arguments)}useLongRangeProtocol(){var e=this;return(0,b.A)(function*(){h(d,"useLongRangeProtocol");const t=e.protocolMeta;if(!e._tap)throw Be.illegalStateNoTap();if(t&&"nfc"===t.type){const n=e.availableProtocols.find(Oe);if(n)return h(d,"Using long range protocol: ",n),yield e.useProtocolFromMeta(n),n;h(d,"NFC tag does not have long range protocol information...")}})()}get connectionState(){return this._connectionState$}isLoggedInAsUserOrProfileName(e){var t=this;return(0,b.A)(function*(){if("string"==typeof e&&(e=[e]),"number"==typeof e&&(console.warn("invalid parameter for CurrentDeviceService.isLoggedInAsUserOrProfileName() username should be a string"),e=[e.toString()]),!t._tap||!t.tap.auth.sessionStateSnapshot)return!1;const n=t.tap.auth.sessionStateSnapshot||(yield t.tap.auth.refreshSessionState());return e.includes(n.profileName)||e.includes(n.name)})()}login(e,t){var n=this;return(0,b.A)(function*(C,x,$=!0){return yield n.tap.auth.login({username:C,password:x},{noRefreshSessionState:!$})}).apply(this,arguments)}logout(){var e=this;return(0,b.A)(function*(t=!1){if(!e._tap)return!1;try{return yield e._tap.auth.logout(),!0}catch(n){if(t)throw n;return e.onError.bind(e),!1}}).apply(this,arguments)}setTap(e,t={emit:!0}){if(!e)throw new Error("Illegal state: cannot set undefined tap");this._tap=e,h(d,"Setting tap..."),this.meta={},this._tap=e,0===this.keepAlivePeriod&&e.keepAlive.stop(),e.keepAlive.period=this.keepAlivePeriod,t.emit&&this.notifyNewTap()}notifyNewTap(){this._tapOrUndefined.next(this._tap)}setTapFromEvent(e,t={emit:!0}){if(!e.protocolMeta)throw new Error("Missing protocol information");this.protocolMeta=e.protocolMeta,this.setTap(e.tap,t),h(d,"setTapFromEvent = >",e)}connect(){var e=this;
1return(0,b.A)(function*(t=!0){try{return yield e.tap.connect(),yield e.refreshSessionState(),!0}catch(n){throw h(d,"Throwing error on connection failed"),n}}).apply(this,arguments)}disconnect(){var e=this;return(0,b.A)(function*(){if(h(d,"disconnect"),e.hasProtocol())return e._isManualDisconnection=!0,h(d,"Setting _isManualDisconnection flag to true"),(e._tap?e._tap.disconnect():Promise.reject(Be.illegalStateNoTap())).then(t=>(setTimeout(()=>{h(d,"Setting _isManualDisconnection flag to false"),e._isManualDisconnection=!1},50),t))})()}remove(){var e=this;return(0,b.A)(function*(t=!0){if(e._tap){const n=e._tap;h(d,"Removing tap"),e.protocolMeta=void 0,e._availableProtocols.next([]),t&&(yield e.disconnect().catch(e.onError.bind(e))),console.log("Stopping old keep alive",n.keepAlive),n.keepAlive.stop(),e._tap=void 0,e._dataManager=void 0,e._maxFrameSizeCache={},e.notifyTapRemoved(n)}else h(d,"No tap to remove")}).apply(this,arguments)}notifyTapRemoved(e){this.tapRemoved.next(e),this.notifyNewTap()}configureClientIfRequired(){var e=this;return(0,b.A)(function*(){e.meta.isClientConfigured||(console.log("Configuring client..."),yield e.configureClient().catch(t=>{e.onError(t)}))})()}loadConfigFromDevice(){var e=this;return(0,b.A)(function*(){h(d,"dynamically load Tap config");const t=yield e.tap.data.synchronizeTapConfig().toPromise();if(e.meta.isClientConfigured=!0,"done"===t?.step){t.bundles;e.tapConfig={meta:{version:"1.0.0",partial:!0},config:{version:1,data:{bundles:[]}}}}})()}set dataManager(e){h(d,"Setting data manager",e),this._dataManager&&this._dataManager.destroy(),this._dataManager=e}get dataManager(){if(this._dataManager)return this._dataManager}configureClient(){var e=this;return(0,b.A)(function*(t=!1){h(d,"configureClient"),t&&(e.tapConfig=void 0),void 0===e.tapConfig&&(yield e.loadConfigFromDevice())}).apply(this,arguments)}getCurrentProtocol(){return Ie(this.tap.client)}get keepAliveEngine(){return this._tap?.keepAlive}hasProtocol(){return void 0!==this.getCurrentProtocol()}registerEventListerner(e){this.listeners.push(e)}unregisterEventListener(e){const t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}onError(e){var t=this;return(0,b.A)(function*(){yield(yield t.toastCtrl.create({message:e.message||"Unknown error",color:"danger",position:"bottom",duration:3e3,buttons:[{text:"Close",role:"cancel",handler:()=>{console.log("Close clicked")}}]})).present()})()}reboot(){var e=this;return(0,b.A)(function*(){let t;try{t=yield e.tap.service.device.reboot()}catch(n){if(!(0,te.isCodeError)(W.TapError.Code.ExecuteRequestError,n))throw n;if(n.cause?.code!==Q.o.ErrorCode.TimeoutError)throw console.warn("Reboot error",n),n}t&&t.successful(),yield e.clearAuth(),e.tap.disconnect().catch(n=>{})})()}clearAuth(){var e=this;return(0,b.A)(function*(){e.tap.auth.clearCache(),e.tap.encryption.stop(),yield e.tap.auth.logout().catch(t=>{})})()}refreshSessionState(){var e=this;return(0,b.A)(function*(){try{return yield e.tap.auth.refreshSessionState()}catch(t){if((0,te.isCodeError)(W.TapError.Code.ScramNotStartedYet,t)||(0,te.isCodeError)(W.TapError.Code.InvalidScramKey,t))return console.warn("SCRAM session ended due to error",t.message),e.tap.encryption.stop(),yield e.tap.auth.refreshSessionState();throw t}})()}static{this.ctorParameters=()=>[{type:Z.Platform},{type:Z.ToastController},{type:v},{type:y.NgZone}]}};B=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[Z.Platform,Z.ToastController,v,y.NgZone])],B);let M=class{constructor(e){this.tapService=e}resolve(e,t){var n=this;return(0,b.A)(function*(){try{yield n.tapService.connect()}catch(C){return n.onError(C)}})()}onError(e){return console.warn("ConnectedTapResolver","error",e),{error:e}}static{this.ctorParameters=()=>[{type:B}]}};M=(0,w.__decorate)([(0,y.Injectable)(),(0,w.__metadata)("design:paramtypes",[B])],M);class U{static{this.EOL="\r\n"}static{this.BOM="\ufeff"}static{this.DEFAULT_FIELD_SEPARATOR=","}static{this.DEFAULT_DECIMAL_SEPARATOR="."}static{this.DEFAULT_QUOTE='"'}static{this.DEFAULT_SHOW_TITLE=!1}static{this.DEFAULT_TITLE="My Report"}static{this.DEFAULT_FILENAME="mycsv.csv"}static{this.DEFAULT_SHOW_LABELS=!1}static{this.DEFAULT_USE_BOM=!0}static{this.DEFAULT_HEADER=[]}static{this.DEFAULT_NO_DOWNLOAD=!1}static{this.DEFAULT_NULL_TO_EMPTY_STRING=!1}}const pe={filename:U.DEFAULT_FILENAME,fieldSeparator:U.DEFAULT_FIELD_SEPARATOR,quoteStrings:U.DEFAULT_QUOTE,decimalseparator:U.DEFAULT_DECIMAL_SEPARATOR,showLabels:U.DEFAULT_SHOW_LABELS,showTitle:U.DEFAULT_SHOW_TITLE,title:U.DEFAULT_TITLE,useBom:U.DEFAULT_USE_BOM,headers:U.DEFAULT_HEADER,noDownload:U.DEFAULT_NO_DOWNLOAD,nullToEmptyString:U.DEFAULT_NULL_TO_EMPTY_STRING};class de{constructor(e,t,n){this.csv="";
1const C=n||{};this.data="string"==typeof e?JSON.parse(JSON.stringify(e)):"object"!=typeof e?JSON.parse(e):e,this._options=function qe(l,...e){let t;const n=function Le(l){if(null==l)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(l)}(l);let C;for(let x=1;x<arguments.length;x++){t=Object(arguments[x]);for(const $ in t)be.call(t,$)&&(n[$]=t[$]);if(Object.getOwnPropertySymbols){C=Object.getOwnPropertySymbols(t);for(let $=0;$<C.length;$++)xe.call(t,C[$])&&(n[C[$]]=t[C[$]])}}return n}({},pe,C),this._options.filename&&(this._options.filename=t)}static isFloat(e){return!(+e!==e||isFinite(e)&&!(e%1))}csvToString(){return this._options.useBom&&(this.csv+=U.BOM),this._options.showTitle&&(this.csv+=this._options.title+"\r\n\n"),this.getHeaders(),this.getBody(),""===this.csv?(console.log("Invalid data"),""):this.csv}getHeaders(){if(this._options.headers.length>0){const{headers:e}=this._options;let t=e.reduce((n,C)=>n+C+this._options.fieldSeparator,"");t=t.slice(0,-1),this.csv+=t+U.EOL}}getBody(){for(let e=0;e<this.data.length;e++){let t="";for(const n in this.data[e])t+=this.formatData(this.data[e][n])+this._options.fieldSeparator;t=t.slice(0,-1),this.csv+=t+U.EOL}}formatData(e){return"locale"===this._options.decimalseparator&&de.isFloat(e)?e.toLocaleString():"."!==this._options.decimalseparator&&de.isFloat(e)?e.toString().replace(".",this._options.decimalseparator):"string"==typeof e?(e=e.replace(/"/g,'""'),(this._options.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=this._options.quoteStrings+e+this._options.quoteStrings),e):this._options.nullToEmptyString?null===e?e="":e:"boolean"==typeof e?e?"TRUE":"FALSE":e}}const be=Object.prototype.hasOwnProperty,xe=Object.prototype.propertyIsEnumerable;var ke,l,je;(l=ke||(ke={})).CONNECTED="CONNECTED",l.DISCONNECTED="DISCONNECTED",l.CONNECTING="CONNECTING",l.DISCONNECTING="DISCONNECTING",function(l){l.RUNNING="RUNNING",l.STOPED="STOPED"}(je||(je={}));var ze=a(46494);let We=class{constructor(e,t){this.tapService=e,this.alertDialog=t}canDeactivate(e,t){var n=this;return(0,b.A)(function*(){return!(t.data.showConfirmExitTapDialog&&!(yield n.confirmExitDevice()))&&(yield n.tapService.remove(),!0)})()}confirmExitDevice(){var e=this;return(0,b.A)(function*(){try{return yield e.alertDialog.confirm({message:"Are you sure you want to disconnect and go back to home page ?",header:"Disconnect device",okText:"Quit",cancelText:"Cancel"})}catch(t){return console.warn("Failed to display confirm exit device dialog",t),!0}})()}static{this.ctorParameters=()=>[{type:B},{type:ze.AlertDialogService}]}};function Qe(l){return it(l,ne.ResultCode.UNAUTHORIZED)}function it(l,e){return!!(0,te.isCodeError)(W.TapError.Code.ResponseStatusError,l)&&l.response.status===e}We=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[B,ze.AlertDialogService])],We);const pt=new y.InjectionToken("TAP_EXECUTE_TAP_ACTION_SERVICE");let me=class{get data(){return this._data$.asObservable()}constructor(e){var t=this;this.service=e,this._data=[],this._data$=new g.Subject,this._packetPerBundles={},this.options={period:1e3},this.controller=new T.MonitoringController({state:T.MonitorEngine.State.PAUSE,dueTime:0,period:this.options.period,refresh:!1}),this.stream=(0,T.createMonitoringTicker)(this.controller).pipe((0,f.switchMap)(function(){var n=(0,b.A)(function*(C){try{return yield t.service.tap.dataLog.dequeue()}catch(x){return void console.warn("Failed to read packet",x)}});return function(C){return n.apply(this,arguments)}}()),(0,f.filter)(n=>(console.log("pass filter",n),void 0!==n)),(0,f.map)(n=>{const C=n;return C.decodedData=n.data,this.storePacket(C),C})).pipe((0,f.share)())}getCacheForBundle(e){return this._packetPerBundles[e]}set period(e){this.controller.setPeriod(e)}get events(){return this.stream}get running(){return this.controller.state===T.MonitorEngine.State.START}storePacket(e){e.meta.bundleId in this._packetPerBundles||(this._packetPerBundles[e.meta.bundleId]={name:e.meta.bundleName||`Bundle ${e.meta.bundleId}`,id:e.meta.bundleId,packets:[]}),this._packetPerBundles[e.meta.bundleId].packets.push(e),this._data.push(e),this._data$.next(this._data)}pause(){this.controller.pause()}stop(){this.controller.stop()}start(){return this.controller.start(),this.events}static{this.ctorParameters=()=>[{type:B}]}};me=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[B])],me);var R=a(12590);let X=class{constructor(e,t){this.tapService=e,this.router=t,this.config={redirectUrl:["/","connect"]}}canActivate(e,t){return!(!this.tapService.hasTap&&!e.queryParams.protocol)||(this.router.navigate(this.config.redirectUrl,{queryParams:{returnUrl:t.url}}),!1)}static{this.ctorParameters=()=>[{type:B},{type:R.Router}]}};X=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[B,R.Router])],X);var kt=a(3925),j=a.n(kt),r=a(28064);let D=class{set editMode(e){this._editMode=e,this.field.setValue(this.currentValue),e&&this.enableEditMode()}set value(e){this.valueSubscription?.unsubscribe(),e&&e instanceof g.Observable?this.valueSubscription=e.subscribe(t=>
1{this.updateValue(t)}):void 0!==e&&this.updateValue(e)}set forceValue(e){this.updateValue(e)}set fieldError(e){e?(h("InlineEditorComponent","Set field error",e),this.field.setErrors({submit:e.message})):this.field.setErrors(null)}constructor(e,t){this.changeDetectorRef=t,this.onSubmit=new y.EventEmitter,this.valueChange=new y.EventEmitter,this.editModeChange=new y.EventEmitter,this.editable=!1,this.inputOptions={type:"text"},this.showLoader=!0,this._editMode=!1,this.destroyed=new g.Subject,this.form=e.group({field:["",r.Validators.required]}),this.field=O(this.form,"field")}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete(),this.valueSubscription&&this.valueSubscription.unsubscribe()}onValueSubmit(){const e=this.field.value;this.field.errors||this.onSubmit.emit(e)}isEdited(){return this.field.value!==this.originalValue}restoreValue(){this.setFieldValue(this.originalValue)}setFieldValue(e){this.field.setValue(e||"")}onValueClick(){var e=this;return(0,b.A)(function*(){e.editable&&(yield e.enableEditMode(),e.editModeChange.next(!0))})()}onCancelEdit(){this._editMode=!1,this.editModeChange.next(!1)}enableEditMode(){var e=this;return(0,b.A)(function*(){e._editMode=!0,yield e.setInputFocus()})()}setInputFocus(){var e=this;return(0,b.A)(function*(){e.changeDetectorRef.detectChanges(),yield e.inputView.setFocus()})()}updateValue(e){this.currentValue=e,!this._editMode&&void 0!==e&&this.field.setValue(e)}onValueChange(e){const t=e.detail.value;this.valueChange.emit(t)}static{this.ctorParameters=()=>[{type:r.FormBuilder},{type:y.ChangeDetectorRef}]}static{this.propDecorators={onSubmit:[{type:y.Output}],valueChange:[{type:y.Output}],editMode:[{type:y.Input}],editModeChange:[{type:y.Output}],editable:[{type:y.Input}],unitValue:[{type:y.Input}],inputOptions:[{type:y.Input}],valueStyle:[{type:y.Input}],value:[{type:y.Input}],forceValue:[{type:y.Input}],showLoader:[{type:y.Input}],fieldError:[{type:y.Input}],inputView:[{type:y.ViewChild,args:["inputView"]}]}}};D=(0,w.__decorate)([(0,y.Component)({selector:"tap-inline-editor",template:'<ng-container [formGroup]="form">\n <ion-label\n (click)="onValueClick()"\n *ngIf="!_editMode"\n [class]="editable ? \'cell editor-value\' : \'editor-value\'"\n >\n <span [ngStyle]="valueStyle">{{\n currentValue | valueOrDefault : \'---\'\n }}</span>\n <span\n *ngIf="unitValue"\n [ngStyle]="valueStyle"\n class="variable-unit ion-margin-start"\n >{{ unitValue }}</span\n >\n </ion-label>\n <ion-input\n #inputView\n (keydown.enter)="onValueSubmit()"\n (ionInput)="onValueChange($event)"\n [class]="editable ? \'cell\' : \'editor-value\'"\n [ngStyle]="valueStyle"\n (keydown.escape)="onCancelEdit()"\n *ngIf="_editMode"\n [max]="inputOptions.max"\n [maxlength]="inputOptions.maxLength"\n [min]="inputOptions.min"\n [minlength]="inputOptions.minLength"\n [pattern]="inputOptions.pattern"\n [placeholder]="inputOptions.placeholder"\n [type]="inputOptions.type"\n appAutoFocus\n class="cellInput"\n [formControlName]="\'field\'"\n ></ion-input>\n</ng-container>\n',styles:[j()]}),(0,w.__metadata)("design:paramtypes",[r.FormBuilder,y.ChangeDetectorRef])],D);var J=a(50842);let le=class{constructor(e){this.elementRef=e,this.appAutoFocus=!0}ngAfterViewInit(){setTimeout(()=>{this.elementRef.nativeElement.setFocus()},100)}static{this.ctorParameters=()=>[{type:y.ElementRef}]}static{this.propDecorators={appAutoFocus:[{type:y.Input}]}}};le=(0,w.__decorate)([(0,y.Directive)({selector:"[appAutofocus]"}),(0,w.__metadata)("design:paramtypes",[y.ElementRef])],le);let we=class{set disableControl(e){this.ngControl.control&&(e?this.ngControl.control.disable():this.ngControl.control.enable())}constructor(e){this.ngControl=e}static{this.ctorParameters=()=>[{type:r.NgControl}]}static{this.propDecorators={disableControl:[{type:y.Input}]}}};we=(0,w.__decorate)([(0,y.Directive)({selector:"[disableControl]"}),(0,w.__metadata)("design:paramtypes",[r.NgControl])],we);let Se=class{transform(e){return Object.values(e).filter(t=>"string"==typeof t).map(t=>({key:e[t],value:t}))}};Se=(0,w.__decorate)([(0,y.Pipe)({name:"enum"})],Se);let Ue=class{transform(e,t){if("number"!=typeof e)return console.warn('Invalid value for "extractBits". Should be a number. Given: '+typeof e,e),0;let n,C;if("string"==typeof t)t.indexOf("-")>=0?[n,C]=t.split("-").map($=>$?parseInt($,10):0):n=C=parseInt(t,10);else{if("number"!=typeof t)return 0;n=t,C=t}return e=(e&(1<<C-n+1)-1<<n)>>n}};Ue=(0,w.__decorate)([(0,y.Pipe)({name:"extractBits"})],Ue);let $e=class{set rememberValueControl(e){this.formControlName&&e&&this.initializeListeners(e,this.formControlName)}constructor(e){this.ngControl=e}ngOnDestroy(){this.valueChangeSub?.unsubscribe()}initializeListeners(e,t){this.valueChangeSub?.unsubscribe();const n=`rembemberValueControl.${e}.${t}`;this.valueChangeSub=this.ngControl.valueChanges?.subscribe(x=>{localStorage.setItem(n,x)});const C=localStorage.getItem(n);C&&this.ngControl.control?.setValue(C)}static{this.ctorParameters=()=>[{type:r.NgControl}]}static{this.propDecorators={formControlName:[{type:y.Input}],rememberValueControl:[{type:y.Input}]}}};$e=(0,w.__decorate)([(0,y.Directive)({selector:"[rememberValueControl]"}),(0,w.__metadata)("design:paramtypes",[r.NgControl])],$e);let Ae=class{transform(e,t){return e.toString()}};Ae=(0,w.__decorate)([(0,y.Pipe)({name:"tapRequest"})],Ae);let Ye=class{transform(e,t=""){return e.replace(RegExp(t,"g"),"")}};Ye=(0,w.__decorate)([(0,y.Pipe)({name:"trim"})],Ye);let He=class{};He=(0,w.__decorate)([(0,y.NgModule)({declarations:[le,we,Se,Ye,Ue,$e,Ae],exports:[J.CommonModule,Z.IonicModule,le,we,Se,Ye,Ue,$e,Ae],imports:[J.CommonModule,Z.IonicModule]})],He);let Ke=class{transform(e,t){return void 0===e?t:e}};Ke=(0,w.__decorate)([(0,y.Pipe)({name:"valueOrDefault"})],Ke);var ht=a(67449),Er=a.n(ht);class xt{static create(e){return new xt(e)}get pendingCall(){return this._pendingCall}constructor(e){this.tapService=e,this.loading=!1,this.pendingCallResult=new g.Subject,this.sessionStateSubscription=this.tapService.sessionState.subscribe(t=>{"anonymous"!==t.name&&this._runPendingCalls()}),this.connectionStateSub=this.tapService.connectionState.subscribe(t=>{t.newState==Q.K.CONNECTED&&this._runPendingCalls()})}
1hasPendingCall(){return!!this._pendingCall}destroy(){this.sessionStateSubscription&&this.sessionStateSubscription.unsubscribe(),this.connectionStateSub&&this.connectionStateSub.unsubscribe(),this.pendingCallResult.complete()}exec(e){var t=this;return(0,b.A)(function*(){if(!t.tapService.tap.isConnected()){t._pendingCall=e;const n=F.TapClientError.notConnectedError();throw n.message="Reconnect Tap to apply changes",n}try{t.loading=!0;const n=yield e();return t._pendingCall=void 0,n}catch(n){throw Qe(n)||(0,te.isCodeError)(F.TapClientError.Code.NotConnectedError,n)||Te(n)?t._pendingCall=e:t._pendingCall=void 0,n}finally{t.loading=!1}})()}cancel(){this._pendingCall=void 0}_runPendingCalls(){var e=this;return(0,b.A)(function*(){if(e._pendingCall){h("PendingCallManager","Running pending call");try{yield e.exec(e._pendingCall),e.pendingCallResult.next(void 0)}catch(t){e.pendingCallResult.next(t)}}})()}}var Sr=a(81573),Rr=a.n(Sr);let Dt=class{set value(e){this.field.setValue(e,{emitEvent:!1})}constructor(e,t){this.modalController=t,this.inputOptions={type:"text"},this.form=e.group({field:["",[r.Validators.required,r.Validators.max(this.inputOptions.max),r.Validators.maxLength(this.inputOptions.maxLength),r.Validators.min(this.inputOptions.min),r.Validators.minLength(this.inputOptions.minLength)]]}),this.field=O(this.form,"field")}ngOnInit(){}onSubmit(){this.form.valid&&(console.log("Result",this.field.value),this.modalController.dismiss({value:this.field.value},"submit"))}cancel(){this.modalController.dismiss()}static{this.ctorParameters=()=>[{type:r.FormBuilder},{type:Z.ModalController}]}static{this.propDecorators={inputOptions:[{type:y.Input}],value:[{type:y.Input}]}}};Dt=(0,w.__decorate)([(0,y.Component)({selector:"tap-value-editor-modal",template:'<ion-header>\n <ion-toolbar color="primary">\n <ion-buttons slot="start">\n <ion-button fill="clear" (click)="cancel()">\n <ion-icon name="arrow-back-outline"></ion-icon>\n </ion-button>\n </ion-buttons>\n <ion-title>Edition</ion-title>\n </ion-toolbar>\n</ion-header>\n<ion-content>\n <ion-grid>\n <ion-row justify-content-center align-items-center>\n <div style="margin: auto">\n <form\n (ngSubmit)="onSubmit()"\n [formGroup]="form"\n (keydown.enter)="onSubmit()"\n >\n <ion-list lines="none">\n <ion-item>\n <ion-input\n [pattern]="inputOptions.pattern"\n [placeholder]="inputOptions.placeholder"\n [type]="inputOptions.type"\n [formControl]="field"\n [value]="value"\n labelPlacement="floating"\n label="Value"\n >\n </ion-input>\n </ion-item>\n <ion-item>\n <ion-buttons slot="end">\n <ion-button\n color="primary"\n type="submit"\n [disabled]="!form.valid"\n (click)="onSubmit()"\n >\n Submit\n </ion-button>\n </ion-buttons>\n </ion-item>\n </ion-list>\n </form>\n </div>\n </ion-row>\n </ion-grid>\n</ion-content>\n',styles:[Rr()]}),(0,w.__metadata)("design:paramtypes",[r.FormBuilder,Z.ModalController])],Dt);let ft=class{set variable(e){this.variableChange.next(e)}set value(e){this.forceValueChange.next(e)}constructor(e,t,n,C,x){this.alertDialog=e,this.tapService=t,this.changeDetectorRef=n,this.ngZone=C,this.modalController=x,this.button=!1,this.inputOptions={type:"text"},this.showRefreshButton=!1,this.showSubmitButton=!1,this.showEditButton=!1,this.editModeChange=new g.BehaviorSubject(!1),this.loadingChange=new g.BehaviorSubject(!1),this.lines="none",this.modalEdition=!1,this.submit=new y.EventEmitter,this.refresh=new y.EventEmitter,this.variableChange=new g.BehaviorSubject(void 0),this.variableValuesStream=this.variableChange.pipe((0,f.filter)($=>!!$),(0,f.switchMap)($=>$.values),(0,f.tap)($=>{this.lastReadValue=$})),this.forceValueChange=new g.Subject,this.valueToDisplay=this.editModeChange.pipe((0,f.switchMap)($=>{if($||void 0!==this.pendingSubmitValue)return(0,g.of)(this.valueToSubmit);{const re=this.variableChange.value?.valueSnapshot;return(0,g.merge)(this.variableValuesStream.pipe((0,f.startWith)(re)),this.forceValueChange)}}),(0,f.shareReplay)(1)),this.destroyed=new g.Subject}ngOnInit(){this.pendingCallManager=xt.create(this.tapService),this.pendingCallManager.pendingCallResult.subscribe(e=>{this.pendingSubmitValue=void 0,this.valueToSubmit=void 0,this.editModeChange.next(!1),this.error=e,this.changeDetectorRef.detectChanges()})}submitValue(){void 0!==this.valueToSubmit?this._submitValue(this.valueToSubmit):console.warn("No value to submit yet")}notifyValueChange(e){var t=this;return(0,b.A)(function*(n,C=!1){(C||t.lastReadValue!==n)&&(yield t._submitValue(n))}).apply(this,arguments)}openErrorDialog(e){var t=this;return(0,b.A)(function*(){yield(yield t.alertDialog.create({header:"Error",message:e.message,buttons:["Ok"]})).present()})()}explainWaitForSubmit(){var e=this;return(0,b.A)(function*(){yield(yield e.alertDialog.create({header:"Value not sent yet",message:"New value will be sent to the device once you are reconnected",buttons:["Ok"]})).present()})()}_submitValue(e){var t=this;return(0,b.A)(function*(){t.submit.emit(e);const n=t.variableChange.value;n?t.pendingCallManager&&(console.log(`[${n.id}]`,"Submit value",e),yield t.startAction(t.pendingCallManager.exec((0,b.A)(function*(){const C=yield n.write(e);return t.editModeChange.next(!1),t.forceValueChange.next(e),t.error=void 0,t.pendingSubmitValue=void 0,C})).catch(C=>{!function Ar(l){return Te(l)||(0,te.isCodeError)(F.TapClientError.Code.NotConnectedError,l)}(C)?(console.warn(`[${n.id}]`,`onSubmit value "${e}" error`,C),t.error=C):(t.pendingSubmitValue=e,t.valueToSubmit=e,t.editModeChange.next(!1))}))):t.error=ve.componentArgumentRequired(t.constructor.name,"variable")})()}refreshValue(){var e=this;return(0,b.A)(function*(){e.refresh.next(void 0);const t=e.variableChange.value;t&&(yield e.startAction(t.read().then(n=>{e.forceValueChange.next(n)}).catch(n=>{console.log(n)})))})()}enableEditMode(){var e=this;return(0,b.A)(function*(){e.modalEdition?e.showEditModal():e.editModeChange.next(!0)})()}showEditModal(){var e=this;return(0,b.A)(function*(){const t=e.variableChange.value?.valueSnapshot,n=yield e.modalController.create({component:Dt,componentProps:{inputOptions:e.inputOptions,value:t}});yield n.present();const C=yield n.onDidDismiss();if(C&&"submit"===C.role){const x=C.data.value;yield e.notifyValueChange(x)}})()}startAction(e){var t=this;return(0,b.A)(function*(){t.ngZone.run((0,b.A)(function*(){t.loadingChange.next(!0);try{return yield e}catch(n){console.warn("action failed",n)}finally{t.loadingChange.next(!1)}}))})()}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete(),this.pendingCallManager?.destroy()}cancelEdit(){this.pendingCallManager?.cancel(),this.error=void 0,this.pendingSubmitValue=void 0,this.valueToSubmit=void 0,this.editModeChange.next(!1)}static{this.ctorParameters=()=>[{type:Z.AlertController},{type:B},{type:y.ChangeDetectorRef},{type:y.NgZone},{type:Z.ModalController}]}static{this.propDecorators={button:[{type:y.Input}],variable:[{type:y.Input}],inputOptions:[{type:y.Input}],showRefreshButton:[{type:y.Input}],showSubmitButton:[{type:y.Input}],showEditButton:[{type:y.Input}],error:[{type:y.Input}],lines:[{type:y.Input}],modalEdition:[{type:y.Input}],value:[{type:y.Input}],submit:[{type:y.Output}],refresh:[{type:y.Output}]}}};ft=(0,w.__decorate)([(0,y.Component)({selector:"tap-value-editor-container",template:'<ion-item\n style="pointer-events: auto"\n [lines]="lines"\n [button]="button"\n [ngClass]="{ \'item-input\': editModeChange.value }"\n>\n <ng-content></ng-content>\n <ion-buttons\n slot="end"\n *ngIf="\n showEditButton ||\n showRefreshButton ||\n error ||\
1n pendingSubmitValue !== undefined\n "\n >\n <ion-button\n (click)="explainWaitForSubmit(); $event.stopPropagation()"\n *ngIf="pendingSubmitValue !== undefined"\n [disabled]="false"\n color="warning"\n >\n <ion-icon name="alert-circle"></ion-icon>\n </ion-button>\n <ion-button\n (click)="enableEditMode(); $event.stopPropagation()"\n class="btn-enable-edit-mode"\n *ngIf="\n pendingSubmitValue === undefined &&\n showEditButton &&\n !editModeChange.value\n "\n >\n <ion-icon name="create"></ion-icon>\n </ion-button>\n <ion-button\n (click)="submitValue(); $event.stopPropagation()"\n *ngIf="\n showSubmitButton &&\n editModeChange.value &&\n pendingSubmitValue === undefined\n "\n [disabled]="loadingChange | async"\n class="btn-submit-value"\n >\n <ion-icon name="send"></ion-icon>\n </ion-button>\n <ion-button\n (click)="cancelEdit(); $event.stopPropagation()"\n *ngIf="editModeChange.value || pendingSubmitValue !== undefined"\n [disabled]="loadingChange | async"\n class="btn-close-edit-mode"\n >\n <ion-icon name="close"></ion-icon>\n </ion-button>\n <ion-button\n *ngIf="showRefreshButton"\n (click)="refreshValue(); $event.stopPropagation()"\n [disabled]="loadingChange | async"\n class="btn-refresh-value"\n >\n <ion-icon name="sync"></ion-icon>\n </ion-button>\n <ion-button\n *ngIf="error"\n (click)="openErrorDialog(error); $event.stopPropagation()"\n class="btn-show-error"\n >\n <ion-icon slot="end" name="alert-circle" color="danger"></ion-icon>\n </ion-button>\n </ion-buttons>\n <ion-spinner *ngIf="loadingChange | async" slot="end"></ion-spinner>\n</ion-item>\n',styles:[Er()]}),(0,w.__metadata)("design:paramtypes",[Z.AlertController,B,y.ChangeDetectorRef,y.NgZone,Z.ModalController])],ft);let Bt=class{};Bt=(0,w.__decorate)([(0,y.NgModule)({declarations:[ft,Dt],exports:[ft],imports:[J.CommonModule,Z.IonicModule,r.ReactiveFormsModule]})],Bt);let zt=class{};zt=(0,w.__decorate)([(0,y.NgModule)({declarations:[D,Ke],exports:[D],imports:[He,r.ReactiveFormsModule,Bt]})],zt);let Wt=class{constructor(){this._channels=[]}subscribe(e,...t){this._channels[e]||(this._channels[e]=[]),t.forEach(n=>{this._channels[e].push(n)})}unsubscribe(e,t){const n=this._channels[e];if(!n)return!1;if(!t)return delete this._channels[e],!0;const C=n.indexOf(t);return!(C<0)&&(n.splice(C,1),n.length||delete this._channels[e],!0)}publish(e,...t){const n=this._channels[e];if(!n)return null;const C=[];return n.forEach(x=>{C.push(x(...t))}),C}};Wt=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"})],Wt);var hr=a(20432);class Pr extends T.TapVariable{constructor(e){var t;super(e,{config:{id:0},converter:hr.m.uint32,variableService:{getValue:(t=(0,b.A)(function*(){return W.TapResponse.create(ne.ResultCode.CONTENT,hr.m.uint32.encode(10))}),function(){return t.apply(this,arguments)}),setValue:function(){var t=(0,b.A)(function*(n,C){return W.TapResponse.SUCCESS()});return function(C,x){return t.apply(this,arguments)}}()}})}}var wr=a(67173);const Kt={maxRequestByteSize:180,maxResponseByteSize:200},Gt=l=>{let e=function Dr(l){if(void 0===l.body)return 0;if(l.body instanceof Uint8Array||l.body instanceof wr.Buffer)return l.body.length;if(!l.bodyEncoder)return console.warn("Found body but no body encoder provider to this Tap request",l),0;try{return("function"==typeof l.bodyEncoder?l.bodyEncoder(l.body):l.bodyEncoder.encode(l.body)).length}catch(e){return console.warn("Filed to encode body to compute body length",l,e),0}}(l);return 2+ne.TAP_REQUEST_FRAME_HEADER_LENGTH+e+1},Ir=Gt;function fr(l,e=0,{maxResponseByteSize:t,maxRequestByteSize:n}=Kt){let C=0,x=0;const $=[];if(e>=l.length)return{calls:[],nextIndex:void 0};for(;e<l.length;e++){const{call:re,responseBodySize:oe}=l[e],ye=Gt(re);if(C+=Br(oe),x+=ye,$.length>0&&(C>t||x>n))return{calls:$,nextIndex:e};$.push(re)}return{nextIndex:void 0,calls:$}}function Mr(l,e=Kt){let t=[],n=0;for(;void 0!==n;){const C=fr(l,n,e);n=C.nextIndex,t.push(C.calls)}return t}function xr(l,e){return new g.Observable(t=>{let n=!1;return(0,b.A)(function*(){try{for(let C=0;C<e.length;C++){if(n)return;const x=e[C];let $;$=1===x.length?[yield l.lwm2m.execute(x[0])]:yield l.service.interface.executeMultipleCalls(x),t.next({index:C,responses:$})}t.complete()}catch(C){t.error(C)}})(),()=>{n=!0}})}function Br(l){return l+2+1}var tt=a(74718);tt.NFC.prototype.addTapDeviceListener=(l,e)=>{try{const t=(0,g.fromEvent)(document,"nfc-tap-device");return cordova.exec(l,e,"NfcPlugin","registerTapDevice"),t}catch(t){return e&&e(t),g.NEVER}};const Nr=function(){var l=(0,b.A)(function*(e){const t=yield nfc.transceiveTap(e);if("string"==typeof t)return(0,ae.hexStringToBuffer)(t);{const n="object"==typeof t&&"error"in t?t.error:"Transceive Tap returned an invali
1d response type "+typeof t;throw new Error(n)}});return function(t){return l.apply(this,arguments)}}();tt.NFC.prototype.transceiveTap=Nr;const Fr=function(){var l=(0,b.A)(function*(e,t){return yield nfc.beginSessionFromTech(e,t)});return function(t,n){return l.apply(this,arguments)}}();tt.NFC.prototype.beginSessionFromTech=Fr;const Lr=function(){var l=(0,b.A)(function*(){return yield nfc.endSession()});return function(){return l.apply(this,arguments)}}();tt.NFC.prototype.closeSession=Lr;const qr=function(){var l=(0,b.A)(function*(e,t){return yield nfc.connectRaw(e,t)});return function(t,n){return l.apply(this,arguments)}}();tt.NFC.prototype.connectRaw=qr;const jr=function(){var l=(0,b.A)(function*(e){return yield nfc.setTapDeviceDiscoveryEnabled(e)});return function(t){return l.apply(this,arguments)}}();tt.NFC.prototype.setTapDeviceDiscoveryEnabled=jr;const $t="NfcService";let gt=class{constructor(e,t){this.nfc=e,this.platform=t,this._tagDiscoveredListener=new g.Subject,this.tagDiscoveredEvents=this._tagDiscoveredListener.pipe((0,f.switchMap)(n=>n),(0,f.share)()),this._ndefDiscoveredListener=new g.ReplaySubject,this.ndefDiscoveredEvents=this._ndefDiscoveredListener.pipe((0,f.switchMap)(n=>n)),this._tapDeviceDiscoveredEvent=new g.ReplaySubject,this.tapDeviceDiscoveredEvent=this._tapDeviceDiscoveredEvent.pipe((0,f.switchMap)(n=>n))}write(e){var t=this;return(0,b.A)(function*(){try{yield t.nfc.write(e)}catch(n){throw"cordova_not_available"===n&&(n=new Error("NFC is not available on this device")),n}})()}transceive(e){var t=this;return(0,b.A)(function*(){const n=yield t.nfc.transceive(e),C=function Vr(l,e){if(!e)return new Uint8Array(0);if("object"==typeof e&&"error"in e){const t="cordova_not_available"===e.error?"NFC is not available":e.error;throw new Error(`Failed to NFC transceive frame 0x${(0,ae.bufferToHexString)(l)} (error: ${t})`)}return"string"==typeof e?(0,ae.hexStringToBuffer)(e):Buffer.from(e)}(e,n);return console.debug(`NFC transceive ${(0,ae.bufferToHexString)(e)} => 0x${(0,ae.bufferToHexString)(C)}`),C})()}isEnabled(){var e=this;return(0,b.A)(function*(){try{return yield e.nfc.enabled()}catch(t){return console.error("NFC enabled error",t),!1}})()}setupTagDiscoveredListenerOnce(){var e=this;return(0,b.A)(function*(){return e._setupTagDiscoveredListenerPromise?yield e._setupTagDiscoveredListenerPromise:yield e.setupTagDiscoveredListener()})()}setupTapDeviceDiscoveredListener(){var e=this;return(0,b.A)(function*(){e._setupTapDeviceDiscoveredListenerPromise=Ht((t,n)=>{const C=e.nfc.addTapDeviceListener(()=>{t()},x=>{n(x)});e._tapDeviceDiscoveredEvent.next(C)},5e3),yield e._setupTapDeviceDiscoveredListenerPromise})()}setupTagDiscoveredListener(){var e=this;return(0,b.A)(function*(){e._setupTagDiscoveredListenerPromise=Ht((t,n)=>{h($t,"Adding TAG discovered listener..."),e._tagDiscoveredListener.next(e.nfc.addTagDiscoveredListener(()=>{h($t,"NFC Tag discovered listener OK!"),t()},C=>{h($t,"NFC Tag discovered listener didn't start",C),n(C)}).pipe((0,f.catchError)(C=>{const x=(0,ze.toError)(C);return console.warn(`NFC Tag listener failed to initialize: ${x.message}`,C),n(x),g.NEVER}),(0,f.filter)(C=>!!C)))},5e3),yield e._setupTagDiscoveredListenerPromise})()}setupNdefListener(){var e=this;return(0,b.A)(function*(){return yield Ht((t,n)=>{e._ndefDiscoveredListener.next(e.nfc.addNdefListener().pipe((0,f.catchError)(C=>{const x=(0,ze.toError)(C);return console.warn(`NDEF listener failed to initialize: ${x.message}`,C),g.NEVER}))),t()},5e3)})()}closeNFC(){var e=this;return(0,b.A)(function*(){yield e.nfc.close()})()}beginSessionFromTech(e,t){var n=this;return(0,b.A)(function*(){if(n.platform.is("ios"))return n.nfc.beginSessionFromTech(e,t)})()}closeSession(){var e=this;return(0,b.A)(function*(){return e.nfc.closeSession()})()}static{this.ctorParameters=()=>[{type:tt.NFC},{type:Z.Platform}]}};function Ht(l,e){return new Promise((t,n)=>{e&&setTimeout(()=>{n(new Error(`Native code did not respond before timeout of ${e}ms`))},e);try{l(t,n)}catch(C){n(C)}})}gt=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[tt.NFC,Z.Platform])],gt);let ut=class{constructor(e){this.nfcService=e,this.platform=(0,y.inject)(Z.Platform),this._iosMockTapEvent=new g.Subject,this.isStartScanAvailable=this.platform.is("ios"),this.tapEvent=(0,g.merge)(this._iosMockTapEvent,this.nfcService.tagDiscoveredEvents.pipe((0,f.filter)(t=>function kr(l){return!(!l||!l.techTypes?.find(t=>t.endsWith("NfcV"))||!l.ndefMessage?.length)}(t.tag)),(0,f.map)(t=>({tag:t.tag,tap:void 0})),(0,f.share)()),this.nfcService.tapDeviceDiscoveredEvent.pipe((0,f.filter)(t=>!(!t.tag||!t.tap)),(0,f.share)()))}listenToNfcTaps(){var e=this;return(0,b.A)(function*(){yield e.nfcService.setupTapDeviceDiscoveredListener(),yield e.nfcService.setupNdefListener()})()}init(){var e=this;return(0,b.A)(function*(){e.platform.is("android")&&(yield e.nfcService.setupTapDeviceDiscoveredListener())})()}start(){this.isStartScanAvailable&&this.nfcService.beginSessionFromTech("NfcV","Bring your phone close to the Tap")}static{this.ctorParameters=()=>[{type:gt}]}};ut=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[gt])],ut);let Zt=class{constructor(){this.nfcTapScanner=(0,y.inject)(ut),this.tapService=(0,y.inject)(B),this.reTapEvent=this.nfcTapScanner.tapEvent.pipe((0,f.filter)(e=>this.tapService.isSameTag(e.tag)),(0,f.tap)(e=>{const t=this.tapService.tapOrUndefined;if(t&&e.tap?.encryption){const{encryption:n,keys:C,frameCounter:x,initializationVectorResetPeriod:$}=e.tap.encryption;t.encryption.setEncryptedFrameCounter(x),t.encryption.setInitializationVectorRefreshPeriod($),t.encryption.setEncryptionKeys(C),n?t.encryption.resume():t.encryption.pause()}}),(0,f.share)())}initialize(){return this._sub||(this._sub=this.reTapEvent.subscribe()),this._sub}tearDown(){this._sub?.unsubscribe()}};Zt=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"})],Zt);
1var De,zr=a(60572),Wr=a(79603);!function(l){l.serialNumber="/device/serial-number",l.CloudUploadPeriod="/cloud/data-log/upload-period",l.modelName="/device/firmware-flavor",l.tapManufacturer="/device/manufacturer",l.HostProtocol="/interface/current-host-protocol",l.appName="/interface/app-name",l.configVersion="/interface/config-version",l.CloudEndpoint="/mqtt/broker-endpoint",l.MqttRequestTopic="/mqtt/request-topic",l.TargetProtocolConfiguration="/target/raw-protocol-configuration",l.MqttResponseTopic="/mqtt/response-topic",l.CloudKey="/mqtt/password",l.MqttBrokerHostname="/mqtt/broker-hostname",l.MqttBrokerPort="/mqtt/broker-port",l.MqttPassword="/mqtt/password",l.MqttRelayNetKey="/mqtt/relay-net-key",l.MqttClientId="/mqtt/client-id",l.MqttUsername="/mqtt/username",l.NFCConnectionPriority="/interface/nfc/connection-priority",l.NFCPairingMode="/interface/nfc/pairing-mode",l.DataLogPacketCount="/data-log/packet-count",l.DataLogMaxPacketCount="/data-log/max-packet-count",l.IsTargetConnected="/target/connected",l.universalLink="/interface/universal-link",l.androidApplicationRecord="/interface/android-application-id",l.useEncryption="/interface/security-options/scram/enabled",l.InterfaceSecurityScramActivated="/interface/security-options/scram/enabled",l.lockFactoryReset="/interface/security-options/hardware-factory-reset/enabled",l.InterfaceSecurityDisableHardwareFactoryReset="/interface/security-options/hardware-factory-reset/disabled",l.InterfaceSecurityDisabledResourceFactoryReset="/interface/security-options/lwm2m-factory-reset/disabled",l.InterfaceSecurityDisabledLoginWithUID="/interface/security-options/admin-login-with-uid/disabled",l.isLoginWithUIDEnabled="/interface/security-options/admin-login-with-uid/enabled",l.isLWM2MFactoryResetEnabled="/interface/security-options/lwm2m-factory-reset/enabled",l.hashPassword="/interface/security-options/hash-password/enabled",l.lockOptions="/interface/security-options",l.appPath="/interface/app-path-resolved",l.ProfileName="/group/{groupId}/name",l.parentGroupId="/group/{groupId}/alias",l.ProfileSessionLifeTime="/group/{groupId}/session-lifetime",l.TargetProtocol="/target/protocol",l.availableHostProtocols="/interface/available-host-protocols",l.authorizedHostProtocols="/interface/authorized-host-protocol",l.BundleDatalogPeriod="/bundle/{bundleId}/data-log-period",l.tapFirmwareVersion="/device/firmware-version",l.DatalogAcquisitionRunning="/data-log/run",l.AdpStats="/tapnpass/status",l.AdpVersion="/tapnpass/version",l.SinglePacketInfo="/single-packet/info",l.protocolHostInactivityPeriod="/interface/host-inactivity-period",l.bleMacAddress="/ble/address",l.WifiHostname="/wifi/hostname",l.WifiSSID="/wifi/ssid",l.WifiSSIDVisibility="/wifi/ssid-visibility",l.WifiKeyVisibility="/wifi/key-visibility",l.WifiTxPower="/wifi/tx-power",l.NetworkInfraIp="/wifi/ip",l.NetworkIpMask="/wifi/ip-mask",l.NetworkGatewayIp="/wifi/gateway-ip",l.NetworkDNSIp="/wifi/dns-ip",l.WifiMode="/wifi/mode",l.isHostProtocolAuthorized="/interface/authorized-host-protocol/{hostProtocol}",l.WifiKey="/wifi/key",l.bundleName="/bundle/{bundleId}/name",l.variableMetaData="/variable/{variableId}/raw-meta",l.profilePassword="/group/{groupId}/change-password",l.ProductKey="/interface/product-key",l.DeviceMemoryFree="/device/memory-free",l.TimeLocalTime="/time/local-time",l.TimeNtpServer="/time/ntp-server",l.TimeTimeZone="/time/time-zone",l.InterfaceProductCode="/interface/product-code",l.DeviceLastErrorCode="/device/last-error-code",l.NFCAutologProfileId="/interface/nfc-autolog-profile-id",l.configPath="",l.scramIterationNumber="/scram/hash-iteration",l.InterfaceSpecialFeatureSWDDirect="/interface/special-feature/swd-direct",l.InterfaceSpecialFeatureSerial="/interface/special-feature/serial",l.InterfaceSpecialFeatureModbusDirect="/interface/special-feature/modbus-direct"}(De||(De={}));const gr=new y.InjectionToken("TAP_INFO_RESOLVER_CONFIG");let st=class{constructor(e){this.items=e}findByKey(e){return this.items.find(t=>t.key===e.key)}static{this.ctorParameters=()=>[{type:Array,decorators:[{type:y.Inject,args:[gr]}]}]}};function Xe(l){return"string"==typeof l?{key:l}:l}function Je(l){const{key:e,params:t}=l;return`${e}${t&&t.length>0?`-${t.join("-")}`:""}`}function Xt(l,e){return Je(l)===Je(e)}st=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[Array])],st);const Ut="TapInfoCacheService";let et=class{constructor(e){this.tapInfoConfigService=e,this._infoChange={}}
1valueChange(e){return this.infoChange(e).pipe((0,f.filter)(t=>!t.error&&void 0!==t.value),(0,f.map)(t=>t.value),(0,f.distinctUntilChanged)())}value(e){return this.valueChange(e).pipe((0,f.first)()).toPromise()}infoChange(e){return this._createInfoObservableIfRequired(Xe(e))}clearKeys(e){e.forEach(t=>{this.clearKey(t)})}getInfoSnapshot(e){return this._infoChange[Je(Xe(e))]?.value}clearKey(e){const t=Xe(e);if(this.isInfoLoaded(t)){const n=Je(t);h(Ut,`clear key "${n}"`),this._infoChange[n]?.next({loadDate:void 0})}}reset(){Object.keys(this._infoChange).forEach(e=>{this.clearKey(e)})}isInfoLoaded(e){const t=Je(Xe(e));return void 0!==this._infoChange[t]?.value.loadDate}isValueLoaded(e){const t=this.getInfoSnapshot(e);if(t)return void 0!==t.value||t.error&&(0,te.isCodeError)(W.TapError.Code.ResponseStatusError,t.error)}setKeyError(e,t){return this.setKeyInfo(e,{error:t,loadDate:new Date})}setKeyValue(e,t){return this.setKeyInfo(e,{value:t,loadDate:new Date})}setKeyFromResponse(e,t){try{this.setKeyValue(e,t.body())}catch(n){this.setKeyError(e,n)}}setKeyInfo(e,t){const n=Je(e=Xe(e));return h(Ut,`setKeyValue "${n}": `,t),t.error?this.notifyKeyError(e,t.error):this.notifyNewValue(e,t.value),t}notifyNewValue(e,t){this._createInfoObservableIfRequired(e).next({value:t,loadDate:new Date})}notifyKeyError(e,t){h(Ut,e,"error with",t),this._createInfoObservableIfRequired(e).next({error:t,loadDate:new Date})}isKeyInCache(e){return this.isInfoLoaded(e)}_createInfoObservableIfRequired(e){const t=Je(e);return this._infoChange[t]||(h(Ut,`create new observable cache key "${t}"`),this._infoChange[t]=new g.BehaviorSubject({loadDate:void 0})),this._infoChange[t]}static{this.ctorParameters=()=>[{type:st}]}};et=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[st])],et);let Yt=class{constructor(){this._deviceService=(0,y.inject)(B),this.tapInfoCacheService=(0,y.inject)(et),this.isLoggedAsAdmin=this._deviceService.sessionState.pipe((0,f.map)(e=>e.name===Wr.ADMIN_USER.username)),this.factoryResetStateChange=this.tapInfoCacheService.valueChange(De.configVersion).pipe((0,f.map)(e=>e===m),(0,f.shareReplay)(1))}factoryReset(){var e=this;return(0,b.A)(function*(){yield e._deviceService.executeFactoryReset(),e.tapInfoCacheService.reset()})()}reboot(){var e=this;return(0,b.A)(function*(){yield e._deviceService.reboot(),e.tapInfoCacheService.reset()})()}rebootAndReconnect(){var e=this;return(0,b.A)(function*(){yield e._deviceService.reboot(),yield(0,zr.sleep)(5e3);try{yield e._deviceService.connect()}catch(t){console.warn("Failed to reconnect after reboot",t)}})()}};Yt=(0,w.__decorate)([(0,y.Injectable)()],Yt);var Gr=a(64007),$r=a.n(Gr),Qt=a(35431);class mr{get length(){return this.items.length}constructor(e=[],t){this.items=e,this.equalsFunction=t}get(e){return this.items[e]}clear(){this.items=[]}push(...e){let t=0;return e.forEach(n=>{this.items.find(C=>this.equalsFunction(n,C))||(this.items.push(n),t++)}),t}remove(...e){let t=[];return e.forEach((n,C)=>{const x=this.items.findIndex($=>this.equalsFunction(n,$));x>=0&&t.push(...this.items.splice(x,1))}),t}}class Hr{constructor(e){this.equalsFunction=e,this._uniqItems=new mr([],this.equalsFunction),this._queue=new g.BehaviorSubject(this._uniqItems.items)}get queueChange(){return this._queue.asObservable()}getSnasphot(){return[...this._queue.value]}reset(){0!==this.getSnasphot().length&&(this._uniqItems.clear(),this._queue.next([]))}add(...e){this._uniqItems.push(...e)>0&&this._queue.next([...this._uniqItems.items])}remove(...e){this._uniqItems.remove(...e).length>0&&this._queue.next([...this._uniqItems.items])}}let ot=class{constructor(e){this.tapInfoCacheService=e,this.queue=new Hr(Xt),this.requestedTapInfoKeysChange=this.queue.queueChange}removeKeys(e){this.queue.remove(...e)}getValue(e){return this.getInfoValue(e)}getValues(e){return this.loadKeysIfNotInCache(e),Promise.all(e.map(t=>this.tapInfoCacheService.value(t)))}reset(){this.queue.reset()}getLoadedKeyInfoChange(e){return this.loadKeyIfNotInCache(e),this.tapInfoCacheService.infoChange(e).pipe((0,f.filter)(t=>void 0!==t.error||void 0!==t.value))}refreshKeys(e){var t=this;return(0,b.A)(function*(){return t._refreshKeys(e,!0)})()}_refreshKeys(e,t){var n=this;return(0,b.A)(function*(){if(t){const C=e.map(x=>Xe(x));n.tapInfoCacheService.clearKeys(C),n.queue.add(...C)}else n.loadKeysIfNotInCache(e);return yield n.waitForKeySync(e)})()}refreshKey(e){var t=this;return(0,b.A)(function*(){let n=Xe(e);const C=t.tapInfoCacheService.infoChange(n).pipe((0,f.filter)(x=>!!x.loadDate),(0,f.first)()).toPromise();return t.queue.add(n),yield C})()}refreshKeysIfNeeded(e){var t=this;return(0,b.A)(function*(){return t._refreshKeys(e,!1)})()}loadKeyIfNotInCache(e){var t=this;return(0,b.A)(function*(){const n=t.tapInfoCacheService.getInfoSnapshot(e);return n?.loadDate?n:t.refreshKey(e)})()}loadKeysIfNotInCache(e){const t=e.map(Xe).filter(n=>!this.tapInfoCacheService.isValueLoaded(n));this.queue.add(...t)}loadKeyInfoChange(e){e=Xe(e);const t=this.tapInfoCacheService.infoChange(e);return this.loadKeyIfNotInCache(e),t}getInfoValue(e){var t=this;return(0,b.A)(function*(){return yield t.loadKeyIfNotInCache(e),t.tapInfoCacheService.value(e)})()}waitForKeySync(e){var t=this;return(0,b.A)(function*(){0!==e.length&&(yield t.queue.queueChange.pipe((0,f.filter)(n=>!n.find(x=>e.find($=>Xt(x,Xe($))))),(0,f.first)()).toPromise())})()}static{this.ctorParameters=()=>[{type:et}]}};ot=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[et])],ot);const Zr=["8883"],rt="TapConnectionStoreService";function Jt(l){return e=>l?e.filter(t=>l.indexOf(t.connection.type)>=0):e}let at=class{constructor(e,t,n){this.tapService=e,this.infoResolver=t,this.platform=n,this.items=[],this.values=new g.ReplaySubject(1),this.config={localStorageKey:"TapConnectionStoreService.items",mqtt:{webSocket:{port:9001},username:void 0,password:void 0}},this.loadFromStorage()}set(e){e||(e=[]),this.items=e,this.values.next(this.items),this.saveToStorage()}remove(e){this.items.splice(this.items.indexOf(e),1),this.set(this.items)}
1storeCurrentTapConnectionInfo(){var e=this;return(0,b.A)(function*(){const t=e.tapService.protocolMeta;if(!t)return h(`${rt} No protocol connection info for this Tap. Cannot store connection info.`),!1;const[n,C,x,$,re]=yield e.infoResolver.getValues([De.serialNumber,De.configVersion,De.appName,De.availableHostProtocols,De.HostProtocol]);if(C===m||C===z)return!1;const oe={serialNumber:n,version:C,appName:x};return e.addOrRefresh({connection:t,config:oe}),(yield e._resolveConnectionProtocols($,re)).forEach(Me=>{e.addOrRefresh({connection:Me,config:oe})}),!0})()}_createMqttProtocolFromTapInfo({brokerHostname:e,clientId:t,password:n,username:C,netkey:x,port:$,serialNumber:re}){let oe,ye;if(t=t||`${re}_${Math.round(1e6*Math.random())}`,C=this.config.mqtt.username||C,n=this.config.mqtt.password||n,this.platform.is("mobileweb")){if(!this.config.mqtt.webSocket?.port)return void h(rt,"MQTT over web socket is not available (no port configured. Skipping...)");oe=this.config.mqtt.webSocket.port.toString()}else oe=$;if(e.match(/^[a-z]+:\/\//i))ye=e,this.platform.is("mobileweb")&&(ye=ye.replace(/^(mqtt)s?:\/\//iu,"ws"));else{let Me=this.platform.is("mobileweb")?"ws":"mqtt";Zr.includes($)&&(Me+="s"),ye=`${Me}://${e}`}return{type:"mqtt",info:{username:C,password:n,serialNumber:re,netkey:x,clientId:t,endpoint:`${ye}:${oe}`}}}_resolveConnectionProtocols(e,t){var n=this;return(0,b.A)(function*(){h(rt,`availableHostProtocols ${e.map(x=>W.HostProtocol[x]).join(", ")}...`);const C=[];for(const x of e)if(x!==W.HostProtocol.NFC&&x!==t)try{const $=yield n._resolveConnectionProtocol(x);$&&C.push($)}catch{console.warn(`Cannot resolve protocol ${W.HostProtocol[x]}`)}return C})()}_resolveConnectionProtocol(e){var t=this;return(0,b.A)(function*(){switch(h(rt,`_resolveConnectionProtocol ${W.HostProtocol[e]}...`),e){case W.HostProtocol.BLE:return{type:"ble",info:{mac:yield t.infoResolver.getValue(De.bleMacAddress)}};case W.HostProtocol.MQTT:let[n,C,x,$,re,oe,ye]=yield t.infoResolver.getValues([De.MqttBrokerHostname,De.serialNumber,De.MqttRelayNetKey,De.MqttUsername,De.MqttPassword,De.MqttBrokerPort,De.MqttClientId]);return t._createMqttProtocolFromTapInfo({brokerHostname:n,serialNumber:C,netkey:x,username:$,password:re,port:oe,clientId:ye});case W.HostProtocol.WIFI:const[Me,Ve,Mt,Pn]=yield t.infoResolver.getValues([De.WifiMode,De.WifiHostname,De.WifiSSID,De.WifiKey]);if(Ve&&"0.0.0.0"!==Ve)switch(h(rt,`resolveConnectionProtocol wifi mode ${Qt.t9[Me]}...`),Me){case Qt.t9.NETWORK:return{type:"socket",info:{url:`tcp://${Ve}:2000`}};case Qt.t9.PEER_TO_PEER:return{type:"wifi",info:{ssid:Mt,url:`tcp://${Ve}:2000`,password:Pn}};default:return}default:return void h(rt,`resolveConnectionProtocol nothing to store for protocol ${W.HostProtocol[e]}`)}})()}addOrRefresh(e){h(`${rt} Adding/updating new stored device ${JSON.stringify(e)}...`);const t=this.items.find(n=>n.config.serialNumber===e.config.serialNumber&&n.connection.type===e.connection.type);t?(t.config=e.config,t.connection=e.connection,t.meta.lastConnection=new Date):this.items.push({connection:e.connection,config:e.config,meta:{state:"online",lastConnection:new Date}}),h(`${rt} Added/updated new stored device ${e.config.serialNumber} ${e.connection.type}`),this.set(this.items)}clear(){this.set([])}saveToStorage(){localStorage.setItem(this.config.localStorageKey,JSON.stringify(this.items))}loadFromStorage(){try{const e=localStorage.getItem(this.config.localStorageKey);e?this.set(JSON.parse(e)):this.set([])}catch(e){console.warn("Cannot load stored connection from local storage",e),this.set([])}}static{this.ctorParameters=()=>[{type:B},{type:ot},{type:Z.Platform}]}};at=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[B,ot,Z.Platform])],at);let mt=class{constructor(e){this.tapConnectionStoreService=e,this.selected=new y.EventEmitter}connect(){this.item&&this.selected.emit(this.item)}remove(){this.item&&this.tapConnectionStoreService.remove(this.item)}static{this.ctorParameters=()=>[{type:at}]}static{this.propDecorators={item:[{type:y.Input}],selected:[{type:y.Output}]}}};mt=(0,w.__decorate)([(0,y.Component)({selector:"tap-connection-store-item",template:'<ion-card *ngIf="item" (click)="connect()" [button]="true">\n <ion-list class="store-list">\n <ion-item style="margin-bottom: 4px">\n
1\n <span class="title">{{ item.config.appName }}</span>\n \n <ion-button slot="end" color="danger" fill="clear" (click)="remove()">\n <ion-icon name="close"></ion-icon>\n </ion-button>\n </ion-item>\n <ion-item class="extra-info" lines="none">\n <ion-icon color="primary" name="hardware-chip"></ion-icon>\n \n {{ item.config.serialNumber }}\n <ion-badge slot="end">\n {{ item.connection.type }}\n </ion-badge>\n </ion-item>\n <ion-item\n *ngIf="item.connection.type === \'mqtt\'"\n class="extra-info"\n lines="none"\n >\n <ion-icon color="primary" name="link"></ion-icon>\n \n <span class="">{{ item.connection.info.endpoint }}</span>\n </ion-item>\n <ion-item\n *ngIf="item.connection.type === \'ble\'"\n class="extra-info"\n lines="none"\n >\n <ion-icon color="primary" name="link"></ion-icon>\n \n <span class="">{{ item.connection.info.mac }}</span>\n </ion-item>\n <ion-item\n *ngIf="\n item.connection.type === \'socket\' ||\n item.connection.type === \'websocket\'\n "\n lines="none"\n class="extra-info"\n >\n \x3c!-- <ion-label>Last connection</ion-label> --\x3e\n <ion-icon color="primary" name="link"></ion-icon>\n \n <span class="">{{ item.connection.info.url }}</span>\n </ion-item>\n <ion-item\n *ngIf="item.connection.type === \'wifi\'"\n class="extra-info"\n lines="none"\n >\n <ion-icon color="primary" name="link"></ion-icon>\n \n <span class="">{{ item.connection.info.ssid }}</span>\n </ion-item>\n </ion-list>\n</ion-card>\n',styles:[$r()]}),(0,w.__metadata)("design:paramtypes",[at])],mt);var Yr=a(22039),Qr=a.n(Yr);let Ct=class{set connectionTypes(e){this.filteredConnectionTypes=e,this.items=Jt(this.filteredConnectionTypes)(this.items||[])}constructor(e){this.storeService=e,this.filteredConnectionTypes=void 0,this.selected=new y.EventEmitter}ngOnInit(){this.items||(this.sub=this.storeService.values.pipe((0,f.map)(Jt(this.filteredConnectionTypes))).subscribe(e=>{this.items=e}))}ngOnDestroy(){this.sub?.unsubscribe()}onItemSelected(e){this.selected.emit(e)}static{this.ctorParameters=()=>[{type:at}]}static{this.propDecorators={items:[{type:y.Input}],connectionTypes:[{type:y.Input}],selected:[{type:y.Output}]}}};Ct=(0,w.__decorate)([(0,y.Component)({selector:"tap-connection-store-list",template:'<ion-grid>\n <ion-row class="center-row">\n <ion-col\n size-xs="12"\n size-sm="12"\n size-md="12"\n size-lg="6"\n size-xl="4"\n *ngFor="let item of items"\n >\n <tap-connection-store-item\n [item]="item"\n (selected)="onItemSelected($event)"\n >\n </tap-connection-store-item>\n </ion-col>\n </ion-row>\n</ion-grid>\n',styles:[Qr()]}),(0,w.__metadata)("design:paramtypes",[at])],Ct);let er=class{};er=(0,w.__decorate)([(0,y.NgModule)({declarations:[mt,Ct],exports:[mt,Ct],imports:[J.CommonModule,Z.IonicModule]})],er);const ct="TapConnectionService",Jr="TapConnectionOptions";var lt;!function(l){l.NDEF_ONLY="NDEF_ONLY",l.NDEF_OR_SERVICE="NDEF_OR_SERVICE",l.SERVICE_ONLY="SERVICE_ONLY"}(lt||(lt={}));let tr=class{constructor(e,t){this.tapService=e,this.protocolFactory=t,this.tapFactory=n=>W.Tap.fromProtocol(n)}connect(e,t){var n=this;return new g.Observable(C=>{const x=this.createConnectionObservable(e,t,C).subscribe({error:($=(0,b.A)(function*(re){console.warn("Tap connection failed with error",re),yield n.tapService.remove(!1).catch(oe=>console.warn("ignored error",oe)),C.error(re)}),function(oe){return $.apply(this,arguments)}),complete:()=>C.complete()});var $;return()=>{x.unsubscribe()}}).pipe((0,f.shareReplay)(1))}createConnectionObservable(e,t,n){var C=this;let x=(0,g.defer)((0,b.A)(function*(){const re=yield C.protocolFactory.create(e),oe=C.tapFactory(re);return n.next({message:`Initialize Tap from ${e.type}...`,tap:oe}),oe}));if(t.encryption){const re=t.encryption;x=x.pipe((0,f.switchMap)(function(){var oe=(0,b.A)(function*(ye){return n.next({message:"Enable encryption...",tap:ye}),re.keys&&(h(ct,"Set encryption keys: ",re.keys),ye.encryption.setEncryptionKeys(re.keys)),re.encryption&&(!ye.encryption.sessionKey&&!ye.isConnected()&&(yield ye.connect()),ye.encryption.resume(),h(ct,"Enable encryption: ",re.encryption)),null!=re.frameCounter&&ye.encryption.setEncryptedFrameCounter(re.frameCounter),ye});return function(ye){return oe.apply(this,arguments)}}()))}x=x.pipe((0,f.switchMap)(function(){var re=(0,b.A)(function*(oe){return C.tapService.hasTap&&(yield C.tapService.remove()),
1C.tapService.setTapFromEvent({protocolMeta:e,tap:oe},{emit:!1}),oe.keepAlive.stop(),oe});return function(oe){return re.apply(this,arguments)}}())),"nfc"===e.type&&t.nfcPairing&&(x=x.pipe((0,f.switchMap)(function(){var re=(0,b.A)(function*(oe){return n.next({message:"NFC pairing...",tap:oe}),h(ct,"nfcPairing"),yield oe.connect(),yield oe.nfcPairing(),oe});return function(oe){return re.apply(this,arguments)}}()))),!1!==t.registerProtocolsMethod&&(x=x.pipe((0,f.switchMap)(function(){var re=(0,b.A)(function*(oe){return oe.isConnected()||(n.next({message:`Connecting with ${e.type}...`,tap:oe}),yield oe.connect()),n.next({message:"Initializing protocols...",tap:oe}),yield C.registerAlternativeProtocols(t.registerProtocolsMethod,e),oe});return function(oe){return re.apply(this,arguments)}}())));const $=t.switchProtocol;return"nfc"===e.type&&(x=x.pipe((0,f.switchMap)(function(){var re=(0,b.A)(function*(oe){if($){const ye=C.tapService.availableProtocols.find(Oe);ye&&(h(ct,"Using long range protocol: ",ye),n.next({message:`Switch to ${ye.type}`,tap:oe}),yield C.tapService.useProtocolFromMeta(ye))}else{h(ct,"keep NFC protocol");const ye=oe.protocol;yield ye._connect().toPromise(),ye.setConnectionState(Q.K.CONNECTED)}return oe});return function(oe){return re.apply(this,arguments)}}()))),t.refreshSessionState&&(x=x.pipe((0,f.switchMap)(function(){var re=(0,b.A)(function*(oe){return oe.isConnected()||(n.next({message:`Connecting with ${e.type}...`,tap:oe}),yield oe.connect()),h(ct,"refreshSessionState"),n.next({message:"Refreshing user session...",tap:oe}),yield oe.auth.refreshSessionState(),oe});return function(oe){return re.apply(this,arguments)}}()))),!1!==t.keepAlive&&0!==t.keepAlive&&(x=x.pipe((0,f.tap)(re=>{"number"==typeof t.keepAlive&&(re.keepAlive.period=t.keepAlive),re.keepAlive.start()}))),x.pipe((0,f.map)(re=>(this.tapService.notifyNewTap(),re)),(0,f.catchError)(re=>(console.warn("Tap connection failed with error",re),(0,g.defer)((0,b.A)(function*(){throw yield C.tapService.remove(!1).catch(oe=>console.warn("ignored error",oe)),re})))))}registerAlternativeProtocols(e,t){var n=this;return(0,b.A)(function*(){if(!1===e)return;e=e||lt.NDEF_OR_SERVICE,h(ct,`Register alternative protocols with method: ${e}`);const C=n.tapService.tap;switch(e){case lt.NDEF_OR_SERVICE:let x;C.isConnected()||(yield C.connect()),"nfc"===t.type?x=yield n.tapService.registerProtocolsFromTag(t.info.tag):yield n.tapService.registerProtocolsFromTap().catch($=>{console.warn("Failed to register protocols from tap",$)});break;case lt.SERVICE_ONLY:C.isConnected()||(yield C.connect()),yield n.tapService.registerProtocolsFromTap().catch($=>{console.warn("Failed to register protocols from tap",$)});break;case lt.NDEF_ONLY:"nfc"===t.type&&(yield n.tapService.registerProtocolsFromTag(t.info.tag))}})()}static{this.ctorParameters=()=>[{type:B},{type:v}]}};tr=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[B,v])],tr);let yt=class{constructor(){}getByMethod(e){return this.listAllPaths().filter(t=>t.method===e)}hasPath(e,t){return void 0!==this.getByUrl(e,t)}getByUrl(e,t){const C=this.listAllPaths().filter(x=>(x.path===t||x.pathAlias===t)&&x.method===e);return C.length>0?C[0]:void 0}listAllPaths(){if(this._allPaths)return this._allPaths;const t=W.Tap.create().service.services().reduce((n,C)=>{const x=Object.values(C.resources);return n.push(...x),n},[]);return this._allPaths=t,this._allPaths}static{this.ctorParameters=()=>[]}};yt=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[])],yt);let Tt=class{constructor(e,t,n,C){this.tapInfoConfigService=e,this.tapInfoCacheService=t,this.tapService=n,this.tapApiExplorerService=C}hasPut(e){return void 0!==this._getPut(e)}_getPut(e){const t=this.tapInfoConfigService.findByKey(e);if(t?.putValue)return t.putValue;{const n=this.tapApiExplorerService.getByUrl(ne.TapRequestFrame.MethodType.PUT,e.key);return n?function(){var C=(0,b.A)(function*(x,$,...re){const oe=re.length>0?Cr(n,re):{...n};return oe.body=$,yield x.lwm2m.execute(oe)});return function(x,$){return C.apply(this,arguments)}}():void 0}}put(e,t){var n=this;return(0,b.A)(function*(){const C=n.tapService.tapOrUndefined,x=n._getPut(e);if(!x)throw new Error(`Tap resource '${e.key}' is not editable`);if(!C)throw new Error("No tap selected");return x(C,t,...e.params||[]).then($=>($.successful(),$))})()}get(e){var t=this;return(0,b.A)(function*(){try{const n=t.tapService.tapOrUndefined;if(h("TapInfoDAOService",`refreshKey "${Je(e)}" start`),!n)throw F.TapClientError.notConnectedError();let C;t.tapInfoCacheService.clearKey(e);const x=t.tapInfoConfigService.findByKey(e);if(x?.getValue)C=x.getValue;else{const oe=t.tapApiExplorerService.getByUrl(ne.TapRequestFrame.MethodT
1ype.GET,e.key);if(!oe)throw new Error(`Unknown Tap Resource 'GET ${e.key}'`);{let ye=oe;e.params&&(ye=Cr(oe,e.params)),C=function(){var Me=(0,b.A)(function*(Ve){return(yield Ve.lwm2m.execute(ye)).body()});return function(Mt){return Me.apply(this,arguments)}}()}}if(!C)return t.tapInfoCacheService.setKeyInfo(e,{loadDate:new Date});if(!n.isConnected())throw F.TapClientError.notConnectedError();const $=yield C(n,...e.params||[]),re="function"==typeof $.body?$.body():$;return t.tapInfoCacheService.setKeyValue(e,re)}catch(n){if(t.tapInfoCacheService.setKeyError(e,n),(0,te.isCodeError)(W.TapError.Code.ResponseStatusError,n))return;throw n}})()}static{this.ctorParameters=()=>[{type:st},{type:et},{type:B},{type:yt}]}};function Cr(l,e){const t=W.PathParameter.extractParams(l.path);if(t.length!==e.length)throw new Error(`${l.pathAlias||l.path} expects ${t.length} path parameters but given ${e.length}`);if(t.length>0){if(1!==t.length)throw new Error(`${l.pathAlias||l.path} more than 1 path parameter is not implemented yet`);l={...l,pathParameters:{[t[0]]:e[0]}}}return l}Tt=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[st,et,B,yt])],Tt);var _t=a(28556);function tn(l,e){const t=l.filter(x=>255===x.type&&x.data.length>=2);if(0===t.length)return!1;t.length>1&&console.warn("Multiple company identifier record found. Only using the first one");const n=t[0],C=yr(n.data);return!!e.find(x=>yr(x.companyIdentifier)===C&&(!x.dataPrefix||function nn(l,e,t){const n=Uint8Array.from(l).subarray(0,e.length);if(t){for(let C=0;C<e.length;C++){const x=l[C],$=e[C],re=t[C];if(re)for(let oe=0;oe<8;oe++){const ye=1<<7-oe;if(re&ye&&(x&ye)!=($&ye))return!1}}return!0}return function sn(l,e){return l.length===e.length&&l.every((t,n)=>t===e[n])}(n,e)}(n.data.subarray(2),x.dataPrefix,x.mask)))}function yr(l){if(l){if("number"==typeof l)return l;{const e=Uint8Array.from(l);return(e[0]<<8)+e[1]}}return 0}var Tr=a(64358);function vt(){return(0,g.pipe)((0,f.filter)(l=>void 0!==l))}let rr=class{constructor(e,t){this.platform=e,this.ngZone=t,this.webBluetoothPeripheralAdapters=new Map,this._results$=new g.ReplaySubject,this.platform.is("cordova")&&(this.plugin=(0,_t.rj)()),this.results=this._results$.pipe(vt(),q(this.ngZone),(0,f.share)()),this.resultsWithRecords=this._results$.pipe(vt(),(0,f.map)(n=>n?.map(C=>{if(!this.platform.is("cordova")&&C.name){let x=this.getDeviceFromPeripheralAdapter(C.name);return null==x&&(x=new Tr.PeripheralAdapter(C),this.webBluetoothPeripheralAdapters.set(C.name,x),this.setWatchAdvertisement(x)),{address:x.id,name:x.name,rssi:x.rssi,txPower:x.txPower,records:(0,_t.Ts)(new Uint8Array(x.scanRecord||[]))}}return{address:C.address,name:C.name,rssi:C.rssi,txPower:C.txPower,records:(0,_t.Ts)(new Uint8Array(C.scanRecord||[]))}})))}createNewScanner(e){if(this.clearPreviousScanner(),this.platform.is("cordova"))null!=e&&null!=e.filters?this.bleScanner=new _t.mw(void 0,{filters:e.filters}):this.bleScanner=new _t.mw(void 0);else{let t={acceptAllDevices:!0};const n=e?.filters?.reduce((C,x)=>{x.services&&0!=x.services.length&&C.push({services:x.services});const $=x.manufacturerData?.reduce((re,oe)=>{if(null!=oe.companyIdentifier){let ye={companyIdentifier:this.companyIdentifierToNumber(oe.companyIdentifier)};oe.dataPrefix&&(ye.dataPrefix=new Uint8Array(oe.dataPrefix)),oe.mask&&(ye.mask=new Uint8Array(oe.mask)),re.push(ye)}return re},[]);return $&&0!=$?.length&&C.push({manufacturerData:$}),C},[]);null!=n&&0!=n.length&&(t={filters:n}),this.bleScanner=new Tr.WebBluetoothScanner({requestDeviceOptions:t})}return this.scannerSubscription=this.bleScanner.results.subscribe(t=>{if(e){const n=e.filters?.reduce((C,x)=>(x.manufacturerData&&C.push(...x.manufacturerData),C),[]);n?.length&&(t=t.filter(C=>{const x=C.scanRecord;if(!x?.length||0===n.length)return!1;const $=function rn(l){const e=[];if(!l?.length)return e;let t=0;const n=Uint8Array.from(l);for(;t<n.length;){const C=n[t++];if(0==C)break;const x=n[t++];if(0==x)break;const $=C-1,re=Uint8Array.from(n.slice(t,t+$));t+=$,e.push({data:re,length:C,type:x})}return e}(x);return tn($,n)}))}this.emitNexResults(t)}),this.bleScanner}emitNexResults(e){this.lastResults=e,this._results$.next(e)}clearPreviousScanner(){this.bleScanner&&(this.scannerSubscription?.unsubscribe(),this.emitNexResults(void 0),this.bleScanner=void 0)}startScan(e){var t=this;return(0,b.A)(function*(){return t.createNewScanner(e).start()})()}stopScan(){var e=this;return(0,b.A)(function*(){if(e.platform.is("cordova")){if(null==e.bleScanner)throw new Error("BLE Scanner not defined");return e.bleScanner.stop()}for(let[t,n]of e.webBluetoothPeripheralAdapters)e.unsetWatchAdvertisement(n);return e.bleScanner?.stop()})()}connectByName(e){var t=this;return this.platform.is("cordova")?null==this.plugin?(0,g.throwError)(()=>new Error("BLE plugin is not available")):this.plugin.connect(e).pipe((0,f.share)()):(0,g.defer)((0,b.A)(function*(){const n=t.getDeviceFromPeripheralAdapter(e);if(n)return n.connect().then(()=>{n._peripheral.watchAdvertisements()}),n.stateChange;(0,g.throwError)(()=>new Error(`ConnectionError, can not find device ${e}`))})).pipe(vt(),(0,f.switchMap)(n=>n))}disconnectByName(e){var t=this;return(0,b.A)(function*(){if(t.platform.is("cordova")){if(null==t.plugin)throw new Error("BLE plugin is not available");return t.plugin.disConnect(e)}{const n=yield t.getDeviceFromPeripheralAdapterOrThrow(e);return t.unsetWatchAdvertisement(n),yield n.disconnect(),"OK"}})()}closeByName(e){var t=this;return(0,b.A)(function*(){if(t.platform.is("cordova")){if(null==t.plugin)throw new Error("BLE plugin is not available");return t.plugin.close(e)}return"OK"})()}readCharacteristic(e,t,n){var C=this;return(0,b.A)(function*(){if(C.platform.is("cordova")){if(null==C.plugin)throw new Error("BLE plugin is not available");return C.plugin.characteristicReadValue(e,t,n)}return(yield C.getCharacteristicFromPeripheralAdapterPromise(e,t,n)).read()})()}writeCharacteristic(e,t,n,C,x){var $=this;return(0,b.A)(function*(){if($.platform.is("cordova")){if(null==$.plugin)throw new Error("BLE plugin is not available");let re;return re=x?$.plugin.characteristicWrite(e,t,n,C):$.plugin.characteristicWriteWithoutResponse(e,t,n,C),re.then(oe=>!0)}return yield(yield $.getCharacteristicFromPeripheralAdapterPromise(e,t,n)).write(C,!!x),!0})()}listenCharacteristicChange(e,t,n){return this.platform.is("cordova")?null==this.plugin?(0,g.throwError)(new Error("BLE plugin is not available")):this.plugin.characteristicChanged(e,t,n).pipe(q(this.ngZone)):this.getCharacteristicFromPeripheralAdapterObservable(e,t,n).pipe((0,f.switchMap)(C=>C.data),(0,f.map)(C=>C.data),q(this.ngZone))}discoverServices(e){var t=this;return(0,b.A)(function*(){if(t.platform.is("cordova")){if(null==t.plugin)throw new Error("BLE plugin is not available");return t.plugin.discoverServices(e)}{const n=yield t.getDeviceFromPeripheralAdapterOrThrow(e);if(!n._peripheral.gatt?.connected)throw new Error(`device ${e} is not connected`);const C=yield n.discoverServices(),x=[];for(let $ in C){const re=C[$];if(re){const oe={uuid:re.uuid},ye=[];for(let Me of yield re.getCharacteristics()){const Ve=yield Me.getDescriptors();ye.push({uuid:Me.uuid,properties:Me.properties,descriptors:Ve.map(Mt=>({uuid:Mt.uuid,value:Mt.value}))})}0!=ye.length&&(oe.characteristics=ye),x.push(oe)}}return x}})()}startNotification(e,t,n){var C=this;return(0,b.A)(function*(){if(C.platform.is("cordova")){if(null==C.plugin)throw new Error("BLE plugin is not available");return C.plugin.characteristicStartNotification(e,t,n)}return yield(yield C.getCharacteristicFromPeripheralAdapterPromise(e,t,n)).enableNotifications(!0),"OK"})()}stopNotification(e,t,n){var C=this;return(0,b.A)(function*(){if(C.platform.is("cordova")){if(null==C.plugin)throw new Error("BLE plugin is not available");return C.plugin.characteristicStopNotification(e,t,n).then(x=>!0)}return yield(yield C.getCharacteristicFromPeripheralAdapterPromise(e,t,n)).enableNotifications(!1),!0})()}getDeviceFromPeripheralAdapter(e){const t=this.webBluetoothPeripheralAdapters.get(e);if(null!=t)return t;for(let[n,C]of this.webBluetoothPeripheralAdapters)if(C.id==e)return C}getDeviceFromPeripheralAdapterOrThrow(e){var t=this;return(0,b.A)(function*(){const n=t.getDeviceFromPeripheralAdapter(e);if(n)return n;throw new Error(`Can not find device ${n}`)})()}getDeviceServiceFromPeripheralAdapter(e,t){var n=this;return(0,b.A)(function*(){const C=yield n.getDeviceFromPeripheralAdapterOrThrow(e),x=yield C.getService(t);if(null==x)throw new Error(`Can not find service ${t} on device ${C}`);return x})()}getCharacteristicFromPeripheralAdapterObservable(e,t,n){return(0,g.defer)(()=>this.getCharacteristicFromPeripheralAdapterPromise(e,t,n)).pipe(vt())}getCharacteristicFromPeripheralAdapterPromise(e,t,n){var C=this;return(0,b.A)(function*(){const x=yield C.getDeviceServiceFromPeripheralAdapter(e,t);if(x)return yield x.getCharacteristic(n);throw new Error(`Can not find characteristic ${n} on service ${t} on device ${e}`)})()}setWatchAdvertisement(e){console.log("setWatchAdvertisement",e.name),e._peripheral.addEventListener("advertisementreceived",t=>{console.log("UPDATE ADVERTISEMENT"),console.log(t),this.updateAdvertisementData(t,e)},!0),e.watchAdvertisementsAbortController=new AbortController,e._peripheral.watchAdvertisements({signal:e.watchAdvertisementsAbortController.signal})}unsetWatchAdvertisement(e){e.watchAdvertisementsAbortController?.abort()}updateAdvertisementData(e,t){if(t.rssi=e.rssi,t.txPower=e.txPower,e.manufacturerData){t.scanRecord=[];for(let[n,C]of e.manufacturerData)t.scanRecord.push(255,(65280&n)>>8,255&n),t.scanRecord.push(...new Uint8Array(C))}this.emitNexResults(this.lastResults)}companyIdentifierToNumber(e){return"number"==typeof e?e:new Array(e).reduce((t,n,C)=>t+=n[C]<<C,0)}static{this.ctorParameters=()=>[{type:Z.Platform},{type:y.NgZone}]}};rr=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[Z.Platform,y.NgZone])],rr);var an=a(71315),cn=a.n(an);let Nt=class{transform(e,t){return e&&t?e.filter(n=>t.test(n.name)):e}};Nt=(0,w.__decorate)([(0,y.Pipe)({name:"deviceFilter",pure:!0})],Nt);let Et=class{set showSignalStrenght(e){this.showSignalStrength=e}set deviceNameRegexFilter(e){try{this._deviceNameRegexFilter=e?function ln(l){if(!l)throw new Error("Empty regex input");if(l.startsWith("/")){let e=l.length-1;for(;e>0&&("/"!==l[e]||"\\"===l[e-1]);)e--;if(e<=0)throw new Error("Invalid regex format");const t=l.slice(1,e),n=l.slice(e+1);return new RegExp(t,n)}return new RegExp(l)}(e):void 0}catch(t){console.warn(`Cannot create regex from string "${e}"`,t),this._deviceNameRegexFilter=void 0}}constructor(){this.onItemClicked=new y.EventEmitter,this.lines="full",this.showMacAddress=!1,this.showSignalStrength=!0,this.devices=[]}
1_onItemClicked(e){this.onItemClicked.emit(e)}static{this.ctorParameters=()=>[]}static{this.propDecorators={onItemClicked:[{type:y.Output}],lines:[{type:y.Input}],showMacAddress:[{type:y.Input}],showSignalStrenght:[{type:y.Input}],showSignalStrength:[{type:y.Input}],devices:[{type:y.Input}],deviceNameRegexFilter:[{type:y.Input}]}}};Et=(0,w.__decorate)([(0,y.Component)({selector:"tap-ble-scan-result",template:'<ion-list [lines]="lines" *ngIf="devices.length > 0">\n <ion-item\n (click)="_onItemClicked(device)"\n class="hover scan-result-item"\n *ngFor="let device of devices | deviceFilter : _deviceNameRegexFilter"\n >\n <ion-label>\n <span class="device-name">{{ device.name }}</span>\n <br *ngIf="showMacAddress" /><span\n *ngIf="showMacAddress"\n class="mac-address"\n >{{ device.address }}</span\n >\n </ion-label>\n <tap-ble-rssi-signal\n *ngIf="showSignalStrength"\n slot="end"\n [bars]="device.rssi | rssiToSignalStrenght"\n ></tap-ble-rssi-signal>\n </ion-item>\n</ion-list>\n',styles:[cn()]}),(0,w.__metadata)("design:paramtypes",[])],Et);var pn=a(10278),dn=a.n(pn);let bt=class{constructor(e,t){this.tapScanner=e,this.ngZone=t,this.showScanButton=!0,this.rssiUpdateThreshold=10,this.showMacAddress=!0,this.showSignalStrength=!0,this.onProtocolSelected=new y.EventEmitter,this.protocolSelected=new y.EventEmitter,this.onError=new y.EventEmitter,this.results=[],this.destroyed=new g.Subject,this.isScanning=!1}ngOnInit(){this.tapScanner.results.pipe((0,f.takeUntil)(this.destroyed)).subscribe(e=>{this.mergeScanResults(e)}),this.tapScanner.scanning.pipe((0,f.takeUntil)(this.destroyed)).subscribe(e=>{e!==this.isScanning&&(this.isScanning=e)})}notifyError(e){console.error("BLEScannerError",e),this.onError.emit(e)}ngOnDestroy(){this.stopScan(),this.destroyed.next(),this.destroyed.complete()}onItemClicked(e){const n={meta:{type:"ble",info:{id:e.address,mac:e.address,name:e.name}}};this.protocolSelected.emit(n),this.onProtocolSelected.emit(n)}startScan(){this.tapScanner.start().catch(e=>{this.notifyError(e)})}stopScan(){this.tapScanner.stop().catch(e=>{this.notifyError(e)})}mergeScanResults(e){this.ngZone.run(()=>{this.results=[...e]})}static{this.ctorParameters=()=>[{type:void 0,decorators:[{type:y.Inject,args:[p]}]},{type:y.NgZone}]}static{this.propDecorators={scanResultsTemplate:[{type:y.Input}],showScanButton:[{type:y.Input}],rssiUpdateThreshold:[{type:y.Input}],showMacAddress:[{type:y.Input}],showSignalStrength:[{type:y.Input}],deviceNameRegexFilter:[{type:y.Input}],onProtocolSelected:[{type:y.Output}],protocolSelected:[{type:y.Output}],onError:[{type:y.Output}]}}};bt=(0,w.__decorate)([(0,y.Component)({selector:"tap-scanner-ble",template:'<ng-container\n *ngTemplateOutlet="scanResultsContainer; context: { $implicit: results }"\n></ng-container>\n\n<ng-template #scanResultsContainer let-devices>\n \x3c!-- <ng-content #scanResultsInner select="[scan-results]"></ng-content> --\x3e\n <ng-template\n *ngTemplateOutlet="scanResultsTemplate; context: { $implicit: results }"\n ></ng-template>\n <tap-ble-scan-result\n *ngIf="!scanResultsTemplate"\n [devices]="devices"\n [showMacAddress]="showMacAddress"\n [showSignalStrength]="showSignalStrength"\n [deviceNameRegexFilter]="deviceNameRegexFilter"\n (onItemClicked)="onItemClicked($event)"\n ></tap-ble-scan-result>\n</ng-template>\n',styles:[dn()]}),(0,w.__metadata)("design:paramtypes",[Object,y.NgZone])],bt);let Ot=class{constructor(){this.config=[-90,-80,-70,-60]}transform(e,t){if("string"==typeof e)try{e=parseInt(e)}catch{}if("number"!=typeof e)return 0;for(let n=0;n<this.config.length;n++)if(e<this.config[n])return n;return this.config.length}};Ot=(0,w.__decorate)([(0,y.Pipe)({name:"rssiToSignalStrenght"})],Ot);var fn=a(68571),gn=a.n(fn);let St=class{set colors(e){this._colorMap=e}constructor(){this.bars=0,this._colorMap=["#E51E25","#FEC212","#FEC212","#0FAF4B","#0FAF4B"]}get color(){const e=Math.max(0,Math.min(this.bars,this._colorMap.length));return this._colorMap[e]}static{this.ctorParameters=()=>[]}static{this.propDecorators={bars:[{type:y.Input}],colors:[{type:y.Input}]}}};St=(0,w.__decorate)([(0,y.Component)({selector:"tap-ble-rssi-signal",template:'<div class="rssi-container">
1\n <svg\n version="1.1"\n viewBox="0 0 512 512"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="chart"\n aria-labelledby="title"\n role="img"\n >\n <svg x="6" class="bar" [attr.color]="color">\n <rect\n height="100"\n x="10"\n y="400"\n width="80"\n rx="30"\n [attr.fill-opacity]="bars >= 1 ? 1 : 0"\n ></rect>\n </svg>\n <svg x="106" class="bar" [attr.color]="color">\n <rect\n height="200"\n x="10"\n y="300"\n width="80"\n rx="30"\n [attr.fill-opacity]="bars >= 2 ? 1 : 0"\n ></rect>\n </svg>\n <svg x="206" class="bar" [attr.color]="color">\n <rect\n height="300"\n x="10"\n y="200"\n width="80"\n rx="30"\n [attr.fill-opacity]="bars >= 3 ? 1 : 0"\n ></rect>\n </svg>\n <svg x="306" class="bar" [attr.color]="color">\n <rect\n height="400"\n x="10"\n y="100"\n width="80"\n rx="30"\n [attr.fill-opacity]="bars >= 4 ? 1 : 0"\n ></rect>\n </svg>\n <svg x="406" class="bar" [attr.color]="color">\n <rect\n height="500"\n x="10"\n width="80"\n rx="30"\n [attr.fill-opacity]="bars >= 5 ? 1 : 0"\n ></rect>\n </svg>\n </svg>\n</div>\n',styles:[gn()]}),(0,w.__metadata)("design:paramtypes",[])],St);let Rt=class{};Rt=(0,w.__decorate)([(0,y.NgModule)({declarations:[Ot,St],exports:[Ot,St],imports:[J.CommonModule]})],Rt);let nr=class{};nr=(0,w.__decorate)([(0,y.NgModule)({declarations:[bt,Et,Nt],exports:[bt,Et],imports:[He,Rt]})],nr);var Cn=a(60842),yn=a.n(Cn);let At=class{constructor(e){this.scanner=e,this.onProtocolSelected=new y.EventEmitter,this.showScanButton=!0,this.isScanning=!1,this.isLoadingDevice=!1}ngOnInit(){var e=this;return(0,b.A)(function*(){var t;e.deviceSubscription=e.scanner.results.subscribe({next:(t=(0,b.A)(function*(n){const C=n[0];e.onProtocolSelected.emit({meta:{type:"ble",info:{webBluetooth:C,id:C.id,name:C.name}}}),e.isScanning=!1}),function(C){return t.apply(this,arguments)}),error:t=>{e.onError(t)},complete:()=>{e.isScanning=!1}})})()}ngOnDestroy(){this.deviceSubscription?.unsubscribe(),this.errorSubscription?.unsubscribe()}startScan(){var e=this;return(0,b.A)(function*(){e.isScanning=!0,e.error=void 0,yield e.scanner.start()})()}onError(e){this.isScanning=!1,console.warn(e),this.error=e}static{this.ctorParameters=()=>[{type:void 0,decorators:[{type:y.Inject,args:[p]}]}]}static{this.propDecorators={onProtocolSelected:[{type:y.Output}],showScanButton:[{type:y.Input}]}}};At=(0,w.__decorate)([(0,y.Component)({selector:"tap-scanner-web-bluetooth",template:'<div class="ion-progress-bar-slot">\n @if (isScanning || isLoadingDevice) {\n <ion-progress-bar type="indeterminate"></ion-progress-bar>\n }\n</div>\n\x3c!-- <ion-grid class="center-form" *ngIf="showScanButton">\n <ion-row>\n <ion-col>\n <form>\n <ion-button\n (click)="startScan()"\n [disabled]="isScanning"\n color="primary"\n expand="block"\n size="large"\n >\n <ion-icon name="bluetooth"></ion-icon>\n Scan\n </ion-button>\n </form>\n </ion-col>\n </ion-row>\n</ion-grid> --\x3e\n',styles:[yn()]}),(0,w.__metadata)("design:paramtypes",[Object])],At);let ir=class{};ir=(0,w.__decorate)([(0,y.NgModule)({declarations:[At],exports:[At],imports:[He]})],ir);let sr=class{constructor(e,t){this.platform=e,this.tapNfcScannerService=t}resolve(e,t){this._initPromise||(this._initPromise=this._initNFC())}_initNFC(){var e=this;return(0,b.A)(function*(){try{yield e.platform.ready(),yield e.tapNfcScannerService.listenToNfcTaps(),console.log("NFC init OK")}catch(t){console.warn("NFC initialization failed",t),e.error=t}})()}static{this.ctorParameters=()=>[{type:Z.Platform},{type:ut}]}};sr=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[Z.Platform,ut])],sr);var _n=a(80843),vn=a.n(_n);let Pt=class{constructor(){this.onItemClicked=new y.EventEmitter,this.lines="full",this.showSignalStrenght=!0,this.devices=[]}
1_onItemClicked(e){this.onItemClicked.emit(e)}static{this.ctorParameters=()=>[]}static{this.propDecorators={onItemClicked:[{type:y.Output}],lines:[{type:y.Input}],showSignalStrenght:[{type:y.Input}],devices:[{type:y.Input}]}}};Pt=(0,w.__decorate)([(0,y.Component)({selector:"tap-scanner-wifi-item",template:'<ion-list [lines]="lines">\n <ion-item\n (click)="_onItemClicked(device)"\n *ngFor="let device of devices"\n class="hover scan-result-item"\n >\n <ng-container *ngIf="device">\n <ion-label>\n <span class="name">{{\n device.name || device.SSID || \'Hidden SSID\'\n }}</span>\n <ng-container *ngIf="device.host">\n <br />\n <span class="ip-address">Host: {{ device.host }} </span>\n </ng-container>\n <span *ngIf="device.port" class="port">\n <br />\n Port: {{ device.port }}\n </span>\n </ion-label>\n <tap-ble-rssi-signal\n *ngIf="showSignalStrenght"\n [bars]="device.rssi || device.level | rssiToSignalStrenght"\n slot="end"\n ></tap-ble-rssi-signal>\n <ion-chip *ngIf="device.type" slot="end" color="primary">\n Network\n </ion-chip>\n </ng-container>\n </ion-item>\n</ion-list>\n',styles:[vn()]}),(0,w.__metadata)("design:paramtypes",[])],Pt);let or=class{};function En(l){if("iframe"===l)return{type:"iframe",info:{}};if("webview"===l)return{type:"webview"};if("mock"===l||"virtual"===l)return{type:"virtual"};if(l.startsWith("tcp://"))return{type:"socket",info:{url:l}};if(l.startsWith("ws://")||l.startsWith("wss://"))return{type:"websocket",info:{url:l}};try{return function bn(l){return JSON.parse(atob(l))}(l)}catch(e){console.warn("NOT A BINARY",e)}}or=(0,w.__decorate)([(0,y.NgModule)({declarations:[Pt],exports:[Pt],imports:[J.CommonModule,Z.IonicModule,Rt]})],or);let ar=class{constructor(e,t,n){this.tapService=e,this.protocolFactory=t,this.navController=n}canActivate(e,t){var n=this;return(0,b.A)(function*(){const C=e.data.noTapRedirectUrl;try{if(n.tapService.hasTap)return!0;const x=e.queryParams.protocol;let $;if(x&&($=En(x),!$))throw new Error(`Invalid protocol parameter value: "${x}"`);if($||($=n.tryRestaureSession()),!$)throw new Error("No device selected");if(!n.protocolFactory.isValid($))throw new Error("Invalid protocol meta");if(!(yield n.protocolFactory.create($)))throw new Error(`Failed to create tap connection from given information: ${JSON.stringify($)}`);return localStorage.setItem("last-protocol",JSON.stringify($)),yield n.tapService.useProtocolFromMeta($,!0,!1),!0}catch(x){return console.warn("failed to resolved selected tap",x),C&&n.navController.navigateRoot(C,{}),!1}})()}tryRestaureSession(){try{const e=localStorage.getItem("last-protocol");if(e){const t=JSON.parse(e);return console.log("ConnectedTapResolver","Restaure session: ",t),t}}catch{localStorage.removeItem("last-protocol")}}static{this.ctorParameters=()=>[{type:B},{type:v},{type:Z.NavController}]}};ar=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[B,v,Z.NavController])],ar);let cr=class{constructor(e,t){this.infoResolver=e,this.tapInfoDAOService=t,this.loading=!1,this.tapInfoCache=(0,y.inject)(et),this.connectedChange=this.tapInfoCache.valueChange(De.IsTargetConnected)}isConnected(){return!0===this.tapInfoCache.getInfoSnapshot(De.IsTargetConnected)?.value}refresh(){var e=this;return(0,b.A)(function*(){const t=yield e.infoResolver.refreshKey(De.IsTargetConnected);if(t.error)throw t.error;return t.value})()}connect(){var e=this;return(0,b.A)(function*(){try{e.loading=!0,yield e.tapInfoDAOService.put({key:De.IsTargetConnected},!0),e.tapInfoCache.setKeyValue(De.IsTargetConnected,!0),e.error=void 0}catch(t){if((0,te.isCodeError)(W.TapError.Code.ResponseStatusError,t)){const n=t.response.codeRet(),C=F.ResultCodeTranslation[n]||`Unknown error (code: ${n})`;it(t,ne.ResultCode.UNABLE_TO_CONNECT_TO_TARGET)?t.message=`${C}. Make sure that target is properly wired to the Tap.`:t.message=C}throw e.error=t,t}finally{e.loading=!1}})()}disconnect(){var e=this;
1return(0,b.A)(function*(){try{return e.loading=!0,yield e.tapInfoDAOService.put({key:De.IsTargetConnected},!1),e.tapInfoCache.setKeyValue(De.IsTargetConnected,!1),!0}catch(t){throw t}finally{e.loading=!1}})()}static{this.ctorParameters=()=>[{type:ot},{type:Tt}]}};cr=(0,w.__decorate)([(0,y.Injectable)({providedIn:"root"}),(0,w.__metadata)("design:paramtypes",[ot,Tt])],cr);const lr="TASK_MANAGER_RESOLUTION_SERVICE",Ge="TaskManager";let Ze=class{get events(){return this._events.asObservable()}get tasks(){return this._tasks.map(e=>e.task)}constructor(e){this.taskErrorResolutionService=e,h(Ge,"new instance!"),this._tasks=[],this._events=new g.Subject}createTask(e,t={}){this.hasTask(e.id)&&this.clearTask(e.id);const n={task:e,meta:{state:"pending"},events:new g.Subject};let C;return void 0!==t.position?(this._tasks[t.position]=n,C=t.position):C=this._tasks.push(n)-1,h(Ge,"createTask",e.id,"position",C),n}removeTask(e){const t=this.getTaskPosition(e);if(t>=0){const[n]=this._tasks.splice(t,1);this._cancel(n),h(Ge,"removed task",n.task.id,"position",t)}}hasTask(e){return-1!==this.getTaskPosition(e)}task(e){const t=this.container(e);if(t)return t.task}container(e){const t=this.getTaskPosition(e);if(t>=0)return this._tasks[t]}cancel(e){const t=this.getTaskPosition(e);t>=0?this._cancel(this._tasks[t]):h(Ge,"task ",e,"does not exist. Cannot cancel")}taskMeta(e){const t=this.container(e);if(t)return t.meta}addTaskContainer(e){this._tasks.push(e)}addTask$(e,t={}){return this.createTask(e,t).events}clearTask(e){const t=this.getTaskPosition(e);if(-1!==t){const n=this._tasks.splice(t,1);if(1!==n.length)throw new Error(`Internal error: clear task removed ${n.length} task(s). Clear task must removed exactly 1 task. It's probably a bug.`);h(Ge,`${n[0].task.id}: cleared`)}else h(Ge,`${e}: does not exist, cannot remove`)}cancelAll(){this._tasks.forEach(e=>{this._cancel(e)})}clearAll(){this._tasks=[]}exec(e,t){const n=this.container(e);return n?(n.meta.context=t,this.execAsObservable(n)):(0,g.throwError)(new Error(`Task with id "${e}" does not exist`))}execAsObservable(e){var t=this;return new g.Observable(n=>{(0,b.A)(function*(){try{yield t._exec(e,n),n.complete()}catch(C){n.error(C)}})()}).pipe((0,f.share)())}retry(e){var t=this;return(0,b.A)(function*(){return(yield t.execAsObservable(e).toPromise()).result})()}execNext(){var e=this;return new g.Observable(t=>{(0,b.A)(function*(){try{e._tasks.length>0&&(yield e._exec(e._tasks[0],t)),t.complete()}catch(n){t.error(n)}})()}).pipe((0,f.share)())}execDelayedTasks(){return this.execTasksByState("delayed")}execPendingTasks(){return this.execTasksByState("pending")}execTasksByState(e){var t=this;return new g.Observable(C=>{let x=!1;return(0,b.A)(function*(){try{const $=t._tasks.filter(re=>re.meta.state===e);h(Ge,`execAll() with ${$.length} task(s) (state == ${e}): ${$.map(re=>re.task.id).join(", ")}`);for(const re of $)x||(yield t._exec(re,C));h(Ge,"execAll() COMPLETED"),C.complete()}catch($){h(Ge,"execAll() ERROR"),C.error($)}})(),()=>{x=!0}}).pipe((0,f.share)())}getTaskPosition(e){return this._tasks.reverse().findIndex(t=>t.task.id===e)}_exec(e,t){var n=this;return(0,b.A)(function*(){const C=e.task;try{h(Ge,`${C.id} _exec() starting`),e.meta.state="running",n._emit({type:"BEFORE_TASK",task:C},[t,e.events]);const x=yield C.exec(e.meta.context);n._emit({type:"AFTER_TASK",task:C,result:x},[t,e.events]),e.meta.result=x,e.meta.state="done",h(Ge,`${C.id} _exec() DONE`)}catch(x){try{yield n._onTaskExecError(e,x)}catch($){const re=$;e.meta.error=re;const oe=n._isDelayError(re),ye=oe?"delayed":"done";throw h(Ge,e.task.id,"_onTaskError newState: ",ye),e.meta.state=ye,e.events.next({type:"ERROR_TASK",error:re,delayed:oe,task:e.task}),$}}})()}_onTaskExecError(e,t){var n=this;return(0,b.A)(function*(){return yield n.taskErrorResolutionService.onTaskError(e,t)})()}_cancel(e){var t=this;return(0,b.A)(function*(){try{h(Ge,"cancel task: ",e.task.id);const n=e.task;n.cancel&&(yield n.cancel(),t._emit({type:"CANCEL_TASK",task:n})),e.meta.state="pending"}catch(n){t._onError(n)}})()}_emit(e,t=[]){this._events.next(e),t.forEach(n=>
1{n.next(e)})}_onError(e){console.warn("Error task",e)}_isDelayError(e){return h(Ge,"_isDelayError",e),!!Qe(e)||((0,te.isCodeError)(F.TapClientError.Code.NotConnectedError,e)||(0,te.isCodeError)("NfcTagLostError",e)||(0,te.isCodeError)("NfcNotConnectedError",e))}static{this.ctorParameters=()=>[{type:void 0,decorators:[{type:y.Inject,args:[lr]}]}]}};var ur;Ze=(0,w.__decorate)([(0,y.Injectable)(),(0,w.__metadata)("design:paramtypes",[Object])],Ze);let pr=class{shouldShowNfcModal(e){return!1}onTaskError(e,t){throw t}};pr=(0,w.__decorate)([(0,y.Injectable)()],pr);let Ft=ur=class{static forRoot(e){return{ngModule:ur,providers:[{provide:lr,useClass:e.taskErrorResolutionService||pr},Ze]}}};Ft=ur=(0,w.__decorate)([(0,y.NgModule)({declarations:[],imports:[J.CommonModule],providers:[]})],Ft);var Sn=a(67956),Rn=a.n(Sn);const nt="TaskManagerComponent";let wt=class{constructor(e){this.elementRef=e,this.onClick=new y.EventEmitter}onClickListener(){h("app-task-manager-action-cancel clicked"),this.onClick.emit()}static{this.ctorParameters=()=>[{type:y.ElementRef}]}static{this.propDecorators={onClick:[{type:y.Output}],onClickListener:[{type:y.HostListener,args:["click"]}]}}};wt=(0,w.__decorate)([(0,y.Directive)({selector:"[app-task-manager-action-cancel]"}),(0,w.__metadata)("design:paramtypes",[y.ElementRef])],wt);let It=class{constructor(){this.onClick=new y.EventEmitter}onClickListener(){this.onClick.emit()}static{this.ctorParameters=()=>[]}static{this.propDecorators={onClick:[{type:y.Output}],onClickListener:[{type:y.HostListener,args:["click"]}]}}};It=(0,w.__decorate)([(0,y.Directive)({selector:"[app-task-manager-action-exec]"}),(0,w.__metadata)("design:paramtypes",[])],It);let Lt=class{constructor(e){this.taskManager=e}static{this.ctorParameters=()=>[{type:Ze}]}static{this.propDecorators={context:[{type:y.Input}]}}};Lt=(0,w.__decorate)([(0,y.Component)({selector:"app-task-manager-running",template:" <ng-content></ng-content> "}),(0,w.__metadata)("design:paramtypes",[Ze])],Lt);let qt=class{constructor(e){this.taskManager=e}cancelTask(){h(nt,"Cancel task click")}static{this.ctorParameters=()=>[{type:Ze}]}static{this.propDecorators={context:[{type:y.Input}]}}};qt=(0,w.__decorate)([(0,y.Component)({selector:"app-task-manager-delayed",template:" <ng-content></ng-content> "}),(0,w.__metadata)("design:paramtypes",[Ze])],qt);let jt=class{constructor(e){this.taskManager=e}performTask(){h(nt,"Perform task click")}static{this.ctorParameters=()=>[{type:Ze}]}static{this.propDecorators={context:[{type:y.Input}]}}};jt=(0,w.__decorate)([(0,y.Component)({selector:"app-task-manager-action",template:" <ng-content></ng-content> "}),(0,w.__metadata)("design:paramtypes",[Ze])],jt);let Vt=class{set task(e){let t;t=e,h(nt,"set task ",t?.task?.id),this.taskContainer=t}get taskId(){return this.taskContainer?.task?.id}constructor(e){this.taskManager=e}get loading(){return!1}get taskState(){return this.taskContainer?.meta?.state}get actionTemplateContext(){const e=this._createContext();return"execTask"in e&&(e.execTask=(...t)=>{this.execTask(t)}),{$implicit:e}}get delayedTemplateContext(){const e=this._createContext();return"execTask"in this&&(e.execTask=()=>{this.taskId&&this.taskManager.hasTask(this.taskId)&&this.taskManager.cancel(this.taskId)}),{$implicit:e}}_createContext(){return this}ngAfterViewInit(){this.cancelDirective?this.cancelDirective.onClick.subscribe(()=>{this.cancelTask()}):h(nt,"cancel button is not set yet"),this.execDirective&&this.execDirective.onClick.subscribe(()=>{this.execTask()})}ngOnDestroy(){h(nt,"Task",this.taskId,"component ngOnDestroy"),this.cancelTask()}cancelTask(){h(nt,"cancelTask clicked!"),this.taskId&&(this.taskManager.hasTask(this.taskId)?this.taskManager.cancel(this.taskId):h(nt,"cannot cancel task ",this.taskId,"it does not exist"))}explainDelayReason(){const e=this.taskContainer?.meta.error;if(e){switch(e.code){case W.TapError.Code.ResponseStatusError:if(e.response.status===ne.ResultCode.UNAUTHORIZED)return"Waiting for user login";break;case W.TapError.Code.ExecuteRequestError:const n=e.cause;if(n)switch(n.code){case F.TapClientError.Code.NotConnectedError:case"NfcTagLostError":case"NfcNotConnectedError":return"Waiting for Tap reconnection"}}return"Unknown reason"}}execTask(e){const t=this.taskContainer;t&&(h(nt,"execTask ",t.task.id),this.taskManager.addTaskContainer(t),this.taskManager.exec(t.task.id,e).subscribe({error:n=>{h(`Task ${t.task.id} error: ${n.message}`),console.warn(n)},complete:()=>{h(`Task ${t.task.id} COMPLETED`)}}))}static{this.ctorParameters=()=>[{type:Ze}]}static{this.propDecorators={task:[{type:y.Input}],cancelDirective:[{type:y.ContentChild,args:[wt,{static:!0}]}],execDirective:[{type:y.ContentChild,args:[It,{static:!0}]}]}}};Vt=(0,w.__decorate)([(0,y.Component)({selector:"app-task-manager",template:'<ng-container [ngSwitch]="taskState">\n <ng-content\n select="app-task-manager-delayed"\n *ngSwitchCase="\'delayed\'"\n ></ng-content>\n <ng-content\n select="app-task-manager-running"\n *ngSwitchCase="\'running\'"\n ></ng-content>\n <ng-content select="app-task-manager-action" *ngSwitchDefault></ng-content>\n</ng-container>\n',styles:[Rn()]}),(0,w.__metadata)("design:paramtypes",[Ze])],Vt);const vr=[Vt,wt,It,qt,jt,Lt];let dr=class{};dr=(0,w.__decorate)([(0,y.NgModule)({declarations:vr,exports:vr,imports:[J.CommonModule,Z.IonicModule,Ft]})],dr);const An="com.iotize.android.communicationapp"},98557:Ce=>{Ce.exports=function(he){var a=[];return a.toString=function(){return this.map(function(P){var u="",z=typeof P[5]<"u";return P[4]&&(u+="@supports (".concat(P[4],") {")),P[2]&&(u+="@media ".concat(P[2]," {")),z&&(u+="@layer".concat(P[5].length>0?" ".concat(P[5]):""," {")),u+=he(P),z&&(u+="}"),P[2]&&(u+="}"),P[4]&&(u+="}"),u}).join("")},a.i=function(P,u,z,m,b){"string"==typeof P&&(P=[[null,P,void 0]]);var w={};if(z)for(var y=0;y<this.length;y++){var Z=this[y][0];null!=Z&&(w[Z]=!0)}for(var te=0;te<P.length;te++){var ie=[].concat(P[te]);z&&w[ie[0]]||(typeof b<"u"&&(typeof ie[5]>"u"||(ie[1]="@layer".concat(ie[5].length>0?" ".concat(ie[5]):""," {").concat(ie[1],"}")),ie[5]=b),u&&(ie[2]&&(ie[1]="@media ".concat(ie[2]," {").concat(ie[1],"}")),ie[2]=u),m&&(ie[4]?(ie[1]="@supports (".concat(ie[4],") {").concat(ie[1],"}"),ie[4]=m):ie[4]="".concat(m)),a.push(ie))}},a}},8564:Ce=>{Ce.exports=function(he){return he[1]}},3925:(Ce,he,a)=>{var p=a(8564),u=a(98557)(p);u.push([Ce.id,".cell {\n width: fit-content;\n}
1\n.cell:hover {\n cursor: pointer;\n}\n\n.cellInput {\n width: fit-content;\n height: 100%;\n}\n\nion-select {\n width: 100%;\n min-width: 150px;\n max-width: unset;\n}\n\n/**\n * On bad quality screen, default opacity when disable result in a invisible content\n * So we increased opacity value to fix this\n */\n:host ::ng-deep .toggle-disabled,\n:host ::ng-deep .select-disabled {\n opacity: 0.7;\n}\n\n.spanToggle {\n vertical-align: top;\n margin: 8px;\n font-weight: 550;\n}\n\n:host ::ng-deep ion-buttons[slot=end] {\n margin-inline-start: 0px;\n}\n\n:host ::ng-deep .native-input.sc-ion-input-md {\n padding-bottom: 0 !important;\n padding-top: 0 !important;\n}\n\nion-label {\n visibility: inherit;\n}",""]),Ce.exports=u.toString()},64007:(Ce,he,a)=>{var p=a(8564),u=a(98557)(p);u.push([Ce.id,".config-version {\n font-size: 0.8em;\n opacity: 0.7;\n}\n\n.extra-info {\n font-size: 0.95em;\n opacity: 0.7;\n padding-top: 0px;\n padding-bottom: 0px;\n --min-height: 16px;\n}\n\n.store-list {\n padding-top: 0px;\n}\n\n.title {\n font-size: 1.1em;\n}\n\nion-card {\n cursor: pointer;\n}",""]),Ce.exports=u.toString()},22039:(Ce,he,a)=>{var p=a(8564),u=a(98557)(p);u.push([Ce.id,".center-row {\n justify-content: center;\n}",""]),Ce.exports=u.toString()},71315:(Ce,he,a)=>{var p=a(8564),u=a(98557)(p);u.push([Ce.id,".scan-result-item {\n cursor: pointer;\n}\n\n.mac-address {\n font-size: 0.7em;\n}\n\n.device-name {\n font-weight: bold;\n}",""]),Ce.exports=u.toString()},10278:(Ce,he,a)=>{var p=a(8564),u=a(98557)(p);u.push([Ce.id,"",""]),Ce.exports=u.toString()},68571:(Ce,he,a)=>{var p=a(8564),u=a(98557)(p);u.push([Ce.id,".rssi-container {\n display: inline-block;\n width: 1em;\n height: 1em;\n contain: strict;\n}\n\n.bar rect {\n fill: currentColor;\n stroke: black;\n stroke-width: 3;\n}",""]),Ce.exports=u.toString()},60842:(Ce,he,a)=>{var p=a(8564),u=a(98557)(p);u.push([Ce.id,"",""]),Ce.exports=u.toString()},80843:(Ce,he,a)=>{var p=a(8564),u=a(98557)(p);u.push([Ce.id,".ip-address,\n.port {\n font-size: 0.8em;\n}\n\n.name {\n font-weight: bold;\n}\n\n.scan-result-item {\n cursor: pointer;\n}",""]),Ce.exports=u.toString()},67449:(Ce,he,a)=>{var p=a(8564),u=a(98557)(p);u.push([Ce.id,"ion-buttons[slot=end] {\n margin-inline-start: 6px;\n}\n\nion-item {\n --ion-item-background: transparent; /*Allow propagation of input background*/\n --color: initial; /*Allow propagation of input color*/\n}",""]),Ce.exports=u.toString()},81573:(Ce,he,a)=>{var p=a(8564),u=a(98557)(p);u.push([Ce.id,"ion-grid {\n height: 100%;\n}\n\nion-grid > ion-row {\n height: 100%;\n}\n\nion-grid > ion-row > div {\n margin: auto;\n}\n\nion-input {\n font-size: 2em;\n}",""]),Ce.exports=u.toString()},67956:(Ce,he,a)=>{var p=a(8564),u=a(98557)(p);u.push([Ce.id,"",""]),Ce.exports=u.toString()},10467:(Ce,he,a)=>{function p(u,z,m,b,w,y,Z){try{var te=u[y](Z),ie=te.value}catch(W){return void m(W)}te.done?z(ie):Promise.resolve(ie).then(b,w)}function P(u){return function(){var z=this,m=arguments;return new Promise(function(b,w){var y=u.apply(z,m);function Z(ie){p(y,b,w,Z,te,"next",ie)}function te(ie){p(y,b,w,Z,te,"throw",ie)}Z(void 0)})}}a.d(he,{A:()=>P})},31635:(Ce,he,a)=>{a.r(he),a.d(he,{__addDisposableResource:()=>H,__assign:()=>u,__asyncDelegator:()=>ee,__asyncGenerator:()=>Q,__asyncValues:()=>g,__await:()=>I,__awaiter:()=>W,__classPrivateFieldGet:()=>Ee,__classPrivateFieldIn:()=>V,__classPrivateFieldSet:()=>c,__createBinding:()=>ne,__decorate:()=>m,__disposeResources:()=>N,__esDecorate:()=>w,__exportStar:()=>F,__extends:()=>P,__generator:()=>fe,__importDefault:()=>Re,__importStar:()=>
1Pe,__makeTemplateObject:()=>f,__metadata:()=>ie,__param:()=>b,__propKey:()=>Z,__read:()=>se,__rest:()=>z,__runInitializers:()=>y,__setFunctionName:()=>te,__spread:()=>Y,__spreadArray:()=>A,__spreadArrays:()=>ce,__values:()=>K,default:()=>G});var p=function(i,T){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,h){E.__proto__=h}||function(E,h){for(var k in h)Object.prototype.hasOwnProperty.call(h,k)&&(E[k]=h[k])})(i,T)};function P(i,T){if("function"!=typeof T&&null!==T)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");function E(){this.constructor=i}p(i,T),i.prototype=null===T?Object.create(T):(E.prototype=T.prototype,new E)}var u=function(){return u=Object.assign||function(T){for(var E,h=1,k=arguments.length;h<k;h++)for(var _ in E=arguments[h])Object.prototype.hasOwnProperty.call(E,_)&&(T[_]=E[_]);return T},u.apply(this,arguments)};function z(i,T){var E={};for(var h in i)Object.prototype.hasOwnProperty.call(i,h)&&T.indexOf(h)<0&&(E[h]=i[h]);if(null!=i&&"function"==typeof Object.getOwnPropertySymbols){var k=0;for(h=Object.getOwnPropertySymbols(i);k<h.length;k++)T.indexOf(h[k])<0&&Object.prototype.propertyIsEnumerable.call(i,h[k])&&(E[h[k]]=i[h[k]])}return E}function m(i,T,E,h){var ue,k=arguments.length,_=k<3?T:null===h?h=Object.getOwnPropertyDescriptor(T,E):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)_=Reflect.decorate(i,T,E,h);else for(var ae=i.length-1;ae>=0;ae--)(ue=i[ae])&&(_=(k<3?ue(_):k>3?ue(T,E,_):ue(T,E))||_);return k>3&&_&&Object.defineProperty(T,E,_),_}function b(i,T){return function(E,h){T(E,h,i)}}function w(i,T,E,h,k,_){function ue(d){if(void 0!==d&&"function"!=typeof d)throw new TypeError("Function expected");return d}for(var v,ae=h.kind,_e="getter"===ae?"get":"setter"===ae?"set":"value",Te=!T&&i?h.static?i:i.prototype:null,S=T||(Te?Object.getOwnPropertyDescriptor(Te,h.name):{}),q=!1,ve=E.length-1;ve>=0;ve--){var Ne={};for(var O in h)Ne[O]="access"===O?{}:h[O];for(var O in h.access)Ne.access[O]=h.access[O];Ne.addInitializer=function(d){if(q)throw new TypeError("Cannot add initializers after decoration has completed");_.push(ue(d||null))};var s=(0,E[ve])("accessor"===ae?{get:S.get,set:S.set}:S[_e],Ne);if("accessor"===ae){if(void 0===s)continue;if(null===s||"object"!=typeof s)throw new TypeError("Object expected");(v=ue(s.get))&&(S.get=v),(v=ue(s.set))&&(S.set=v),(v=ue(s.init))&&k.unshift(v)}else(v=ue(s))&&("field"===ae?k.unshift(v):S[_e]=v)}Te&&Object.defineProperty(Te,h.name,S),q=!0}function y(i,T,E){for(var h=arguments.length>2,k=0;k<T.length;k++)E=h?T[k].call(i,E):T[k].call(i);return h?E:void 0}function Z(i){return"symbol"==typeof i?i:"".concat(i)}function te(i,T,E){return"symbol"==typeof T&&(T=T.description?"[".concat(T.description,"]"):""),Object.defineProperty(i,"name",{configurable:!0,value:E?"".concat(E," ",T):T})}function ie(i,T){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(i,T)}function W(i,T,E,h){return new(E||(E=Promise))(function(_,ue){function ae(S){try{Te(h.next(S))}catch(v){ue(v)}}function _e(S){try{Te(h.throw(S))}catch(v){ue(v)}}function Te(S){S.done?_(S.value):function k(_){return _ instanceof E?_:new E(function(ue){ue(_)})}(S.value).then(ae,_e)}Te((h=h.apply(i,T||[])).next())})}function fe(i,T){var h,k,_,ue,E={label:0,sent:function(){if(1&_[0])throw _[1];return _[1]},trys:[],ops:[]};return ue={next:ae(0),throw:ae(1),return:ae(2)},"function"==typeof Symbol&&(ue[Symbol.iterator]=function(){return this}),ue;function ae(Te){return function(S){return function _e(Te){if(h)throw new TypeError("Generator is already executing.");for(;ue&&(ue=0,Te[0]&&(E=0)),E;)try{if(h=1,k&&(_=2&Te[0]?k.return:Te[0]?k.throw||((_=k.return)&&_.call(k),0):k.next)&&!(_=_.call(k,Te[1])).done)return _;switch(k=0,_&&(Te=[2&Te[0],_.value]),Te[0]){case 0:case 1:_=Te;break;case 4:return E.label++,{value:Te[1],done:!1};case 5:E.label++,k=Te[1],Te=[0];continue;case 7:Te=E.ops.pop(),E.trys.pop();continue;default:if(!(_=(_=E.trys).length>0&&_[_.length-1])&&(6===Te[0]||2===Te[0])){E=0;continue}if(3===Te[0]&&(!_||Te[1]>_[0]&&Te[1]<_[3])){E.label=Te[1];break}if(6===Te[0]&&E.label<_[1]){E.label=_[1],_=Te;break}if(_&&E.label<_[2]){E.label=_[2],E.ops.push(Te);break}_[2]&&E.ops.pop(),E.trys.pop();continue}Te=T.call(i,E)}catch(S){Te=[6,S],k=0}finally{h=_=0}if(5&Te[0])throw Te[1];return{value:Te[0]?Te[1]:void 0,done:!0}}([Te,S])}}}var ne=Object.create?function(i,T,E,h){void 0===h&&(h=E);var k=Object.getOwnPropertyDescriptor(T,E);(!k||("get"in k?!T.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return T[E]}}),Object.defineProperty(i,h,k)}:function(i,T,E,h){void 0===h&&(h=E),i[h]=T[E]};function F(i,T){for(var E in i)"default"!==E&&!Object.prototype.hasOwnProperty.call(T,E)&&ne(T,i,E)}function K(i){var T="function"==typeof Symbol&&Symbol.iterator,E=T&&i[T],h=0;if(E)return E.call(i);if(i&&"number"==typeof i.length)return{next:function(){return i&&h>=i.length&&(i=void 0),{value:i&&i[h++],done:!i}}};throw new TypeError(T?"Object is not iterable.":"Symbol.iterator is not defined.")}function se(i,T){var E="function"==typeof Symbol&&i[Symbol.iterator];if(!E)return i;var k,ue,h=E.call(i),_=[];try{for(;(void 0===T||T-- >0)&&!(k=h.next()).done;)_.push(k.value)}catch(ae){ue={error:ae}}finally{try{k&&!k.done&&(E=h.return)&&E.call(h)}finally{if(ue)throw ue.error}}return _}function Y(){for(var i=[],T=0;T<arguments.length;T++)i=i.concat(se(arguments[T]));return i}function ce(){for(var i=0,T=0,E=arguments.length;T<E;T++)i+=arguments[T].length;var h=Array(i),k=0;for(T=0;T<E;T++)for(var _=arguments[T],ue=0,ae=_.length;ue<ae;ue++,k++)h[k]=_[ue];return h}function A(i,T,E){if(E||2===arguments.length)for(var _,h=0,k=T.length;h<k;h++)(_||!(h in T))&&(_||(_=Array.prototype.slice.call(T,0,h)),_[h]=T[h]);return i.concat(_||Array.prototype.slice.call(T))}function I(i){return this instanceof I?(this.v=i,this):new I(i)}function Q(i,T,E){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var k,h=E.apply(i,T||[]),_=[];return k={},ae("next"),ae("throw"),ae("return",function ue(ve){return function(Ne){return Promise.resolve(Ne).then(ve,v)}}),k[Symbol.asyncIterator]=function(){return this},k;function ae(ve,Ne){h[ve]&&(k[ve]=function(O){return new Promise(function(s,d){_.push([ve,O,s,d])>1||_e(ve,O)})},Ne&&(k[ve]=Ne(k[ve])))}function _e(ve,Ne){try{!function Te(ve){ve.value instanceof I?Promise.resolve(ve.value.v).then(S,v):q(_[0][2],ve)}(h[ve](Ne))}catch(O){q(_[0][3],O)}}function S(ve){_e("next",ve)}function v(ve){_e("throw",ve)}function q(ve,Ne){ve(Ne),_.shift(),_.length&&_e(_[0][0],_[0][1])}}function ee(i){var T,E;return T={},h("next"),h("throw",function(k){throw k}),h("return"),T[Symbol.iterator]=function(){return this},T;function h(k,_){T[k]=i[k]?function(ue){return(E=!E)?{value:I(i[k](ue)),done:!1}:_?_(ue):ue}:_}}function g(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var E,T=i[Symbol.asyncIterator];return T?T.call(i):(i=K(i),E={},h("next"),h("throw"),h("return"),E[Symbol.asyncIterator]=function(){return this},E);function h(_){E[_]=i[_]&&function(ue){return new Promise(function(ae,_e){(function k(_,ue,ae,_e){Promise.resolve(_e).then(function(Te){_({value:Te,done:ae})},ue)})(ae,_e,(ue=i[_](ue)).done,ue.value)})}}}function f(i,T){return Object.defineProperty?Object.defineProperty(i,"raw",{value:T}):i.raw=T,i}var L=Object.create?function(i,T){Object.defineProperty(i,"default",{enumerable:!0,value:T})}:function(i,T){i.default=T};function Pe(i){if(i&&i.__esModule)return i;var T={};if(null!=i)for(var E in i)"default"!==E&&Object.prototype.hasOwnProperty.call(i,E)&&ne(T,i,E);return L(T,i),T}function Re(i){return i&&i.__esModule?i:{default:i}}function Ee(i,T,E,h){if("a"===E&&!h)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof T?i!==T||!h:!T.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===E?h:"a"===E?h.call(i):h?h.value:T.get(i)}function c(i,T,E,h,k){if("m"===h)throw new TypeError("Private method is not writable");if("a"===h&&!k)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof T?i!==T||!k:!T.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===h?k.call(i,E):k?k.value=E:T.set(i,E),E}function V(i,T){if(null===T||"object"!=typeof T&&"function"!=typeof T)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof i?T===i:i.has(T)}function H(i,T,E){if(null!=T){if("object"!=typeof T&&"function"!=typeof T)throw new TypeError("Object expected.");var h,k;if(E){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");h=T[Symbol.asyncDispose]}if(void 0===h){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");h=T[Symbol.dispose],E&&(k=h)}if("function"!=typeof h)throw new TypeError("Object not disposable.");k&&(h=function(){try{k.call(this)}catch(_){return Promise.reject(_)}}),i.stack.push({value:T,dispose:h,async:E})}else E&&i.stack.push({async:!0});return T}var ge="function"==typeof SuppressedError?SuppressedError:function(i,T,E){var h=new Error(E);return h.name="SuppressedError",h.error=i,h.suppressed=T,h};function N(i){function T(h){i.error=i.hasError?new ge(h,i.error,"An error was suppressed during disposal."):h,i.hasError=!0}return function E(){for(;i.stack.length;){var h=i.stack.pop();try{var k=h.dispose&&h.dispose.call(h.value);if(h.async)return Promise.resolve(k).then(E,function(_){return T(_),E()})}catch(_){T(_)}}if(i.hasError)throw i.error}()}const G={__extends:P,__assign:u,__rest:z,__decorate:m,__param:b,__metadata:ie,__awaiter:W,__generator:fe,__createBinding:ne,__exportStar:F,__values:K,__read:se,__spread:Y,__spreadArrays:ce,__spreadArray:A,__await:I,__asyncGenerator:Q,__asyncDelegator:ee,__asyncValues:g,__makeTemplateOb
1ject:f,__importStar:Pe,__importDefault:Re,__classPrivateFieldGet:Ee,__classPrivateFieldSet:c,__classPrivateFieldIn:V,__addDisposableResource:H,__disposeResources:N}}}]);
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.