github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/smartcardproviderprivate/bindings/ffi_bindings.ts (about)

     1  import { importModule, Application, heap, Pointer } from "@ffi";
     2  
     3  importModule("plat/js/webext/smartcardproviderprivate", (A: Application) => {
     4    const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser;
     5  
     6    return {
     7      "constof_ConnectionState": (ref: heap.Ref<string>): number => {
     8        const idx = ["ABSENT", "PRESENT", "SWALLOWED", "POWERED", "NEGOTIABLE", "SPECIFIC"].indexOf(A.H.get(ref));
     9        return idx < 0 ? 0 : idx + 1;
    10      },
    11      "constof_Disposition": (ref: heap.Ref<string>): number => {
    12        const idx = ["LEAVE_CARD", "RESET_CARD", "UNPOWER_CARD", "EJECT_CARD"].indexOf(A.H.get(ref));
    13        return idx < 0 ? 0 : idx + 1;
    14      },
    15      "constof_Protocol": (ref: heap.Ref<string>): number => {
    16        const idx = ["UNDEFINED", "T0", "T1", "RAW"].indexOf(A.H.get(ref));
    17        return idx < 0 ? 0 : idx + 1;
    18      },
    19  
    20      "store_Protocols": (ptr: Pointer, ref: heap.Ref<any>) => {
    21        const x = A.H.get<any>(ref);
    22  
    23        if (typeof x === "undefined") {
    24          A.store.Bool(ptr + 6, false);
    25          A.store.Bool(ptr + 3, false);
    26          A.store.Bool(ptr + 0, false);
    27          A.store.Bool(ptr + 4, false);
    28          A.store.Bool(ptr + 1, false);
    29          A.store.Bool(ptr + 5, false);
    30          A.store.Bool(ptr + 2, false);
    31        } else {
    32          A.store.Bool(ptr + 6, true);
    33          A.store.Bool(ptr + 3, "t0" in x ? true : false);
    34          A.store.Bool(ptr + 0, x["t0"] ? true : false);
    35          A.store.Bool(ptr + 4, "t1" in x ? true : false);
    36          A.store.Bool(ptr + 1, x["t1"] ? true : false);
    37          A.store.Bool(ptr + 5, "raw" in x ? true : false);
    38          A.store.Bool(ptr + 2, x["raw"] ? true : false);
    39        }
    40      },
    41      "load_Protocols": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    42        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    43  
    44        if (A.load.Bool(ptr + 3)) {
    45          x["t0"] = A.load.Bool(ptr + 0);
    46        } else {
    47          delete x["t0"];
    48        }
    49        if (A.load.Bool(ptr + 4)) {
    50          x["t1"] = A.load.Bool(ptr + 1);
    51        } else {
    52          delete x["t1"];
    53        }
    54        if (A.load.Bool(ptr + 5)) {
    55          x["raw"] = A.load.Bool(ptr + 2);
    56        } else {
    57          delete x["raw"];
    58        }
    59        return create === A.H.TRUE ? A.H.push(x) : ref;
    60      },
    61  
    62      "store_ReaderStateFlags": (ptr: Pointer, ref: heap.Ref<any>) => {
    63        const x = A.H.get<any>(ref);
    64  
    65        if (typeof x === "undefined") {
    66          A.store.Bool(ptr + 22, false);
    67          A.store.Bool(ptr + 11, false);
    68          A.store.Bool(ptr + 0, false);
    69          A.store.Bool(ptr + 12, false);
    70          A.store.Bool(ptr + 1, false);
    71          A.store.Bool(ptr + 13, false);
    72          A.store.Bool(ptr + 2, false);
    73          A.store.Bool(ptr + 14, false);
    74          A.store.Bool(ptr + 3, false);
    75          A.store.Bool(ptr + 15, false);
    76          A.store.Bool(ptr + 4, false);
    77          A.store.Bool(ptr + 16, false);
    78          A.store.Bool(ptr + 5, false);
    79          A.store.Bool(ptr + 17, false);
    80          A.store.Bool(ptr + 6, false);
    81          A.store.Bool(ptr + 18, false);
    82          A.store.Bool(ptr + 7, false);
    83          A.store.Bool(ptr + 19, false);
    84          A.store.Bool(ptr + 8, false);
    85          A.store.Bool(ptr + 20, false);
    86          A.store.Bool(ptr + 9, false);
    87          A.store.Bool(ptr + 21, false);
    88          A.store.Bool(ptr + 10, false);
    89        } else {
    90          A.store.Bool(ptr + 22, true);
    91          A.store.Bool(ptr + 11, "unaware" in x ? true : false);
    92          A.store.Bool(ptr + 0, x["unaware"] ? true : false);
    93          A.store.Bool(ptr + 12, "ignore" in x ? true : false);
    94          A.store.Bool(ptr + 1, x["ignore"] ? true : false);
    95          A.store.Bool(ptr + 13, "changed" in x ? true : false);
    96          A.store.Bool(ptr + 2, x["changed"] ? true : false);
    97          A.store.Bool(ptr + 14, "unknown" in x ? true : false);
    98          A.store.Bool(ptr + 3, x["unknown"] ? true : false);
    99          A.store.Bool(ptr + 15, "unavailable" in x ? true : false);
   100          A.store.Bool(ptr + 4, x["unavailable"] ? true : false);
   101          A.store.Bool(ptr + 16, "empty" in x ? true : false);
   102          A.store.Bool(ptr + 5, x["empty"] ? true : false);
   103          A.store.Bool(ptr + 17, "present" in x ? true : false);
   104          A.store.Bool(ptr + 6, x["present"] ? true : false);
   105          A.store.Bool(ptr + 18, "exclusive" in x ? true : false);
   106          A.store.Bool(ptr + 7, x["exclusive"] ? true : false);
   107          A.store.Bool(ptr + 19, "inuse" in x ? true : false);
   108          A.store.Bool(ptr + 8, x["inuse"] ? true : false);
   109          A.store.Bool(ptr + 20, "mute" in x ? true : false);
   110          A.store.Bool(ptr + 9, x["mute"] ? true : false);
   111          A.store.Bool(ptr + 21, "unpowered" in x ? true : false);
   112          A.store.Bool(ptr + 10, x["unpowered"] ? true : false);
   113        }
   114      },
   115      "load_ReaderStateFlags": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   116        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   117  
   118        if (A.load.Bool(ptr + 11)) {
   119          x["unaware"] = A.load.Bool(ptr + 0);
   120        } else {
   121          delete x["unaware"];
   122        }
   123        if (A.load.Bool(ptr + 12)) {
   124          x["ignore"] = A.load.Bool(ptr + 1);
   125        } else {
   126          delete x["ignore"];
   127        }
   128        if (A.load.Bool(ptr + 13)) {
   129          x["changed"] = A.load.Bool(ptr + 2);
   130        } else {
   131          delete x["changed"];
   132        }
   133        if (A.load.Bool(ptr + 14)) {
   134          x["unknown"] = A.load.Bool(ptr + 3);
   135        } else {
   136          delete x["unknown"];
   137        }
   138        if (A.load.Bool(ptr + 15)) {
   139          x["unavailable"] = A.load.Bool(ptr + 4);
   140        } else {
   141          delete x["unavailable"];
   142        }
   143        if (A.load.Bool(ptr + 16)) {
   144          x["empty"] = A.load.Bool(ptr + 5);
   145        } else {
   146          delete x["empty"];
   147        }
   148        if (A.load.Bool(ptr + 17)) {
   149          x["present"] = A.load.Bool(ptr + 6);
   150        } else {
   151          delete x["present"];
   152        }
   153        if (A.load.Bool(ptr + 18)) {
   154          x["exclusive"] = A.load.Bool(ptr + 7);
   155        } else {
   156          delete x["exclusive"];
   157        }
   158        if (A.load.Bool(ptr + 19)) {
   159          x["inuse"] = A.load.Bool(ptr + 8);
   160        } else {
   161          delete x["inuse"];
   162        }
   163        if (A.load.Bool(ptr + 20)) {
   164          x["mute"] = A.load.Bool(ptr + 9);
   165        } else {
   166          delete x["mute"];
   167        }
   168        if (A.load.Bool(ptr + 21)) {
   169          x["unpowered"] = A.load.Bool(ptr + 10);
   170        } else {
   171          delete x["unpowered"];
   172        }
   173        return create === A.H.TRUE ? A.H.push(x) : ref;
   174      },
   175  
   176      "store_ReaderStateIn": (ptr: Pointer, ref: heap.Ref<any>) => {
   177        const x = A.H.get<any>(ref);
   178  
   179        if (typeof x === "undefined") {
   180          A.store.Bool(ptr + 33, false);
   181          A.store.Ref(ptr + 0, undefined);
   182  
   183          A.store.Bool(ptr + 4 + 22, false);
   184          A.store.Bool(ptr + 4 + 11, false);
   185          A.store.Bool(ptr + 4 + 0, false);
   186          A.store.Bool(ptr + 4 + 12, false);
   187          A.store.Bool(ptr + 4 + 1, false);
   188          A.store.Bool(ptr + 4 + 13, false);
   189          A.store.Bool(ptr + 4 + 2, false);
   190          A.store.Bool(ptr + 4 + 14, false);
   191          A.store.Bool(ptr + 4 + 3, false);
   192          A.store.Bool(ptr + 4 + 15, false);
   193          A.store.Bool(ptr + 4 + 4, false);
   194          A.store.Bool(ptr + 4 + 16, false);
   195          A.store.Bool(ptr + 4 + 5, false);
   196          A.store.Bool(ptr + 4 + 17, false);
   197          A.store.Bool(ptr + 4 + 6, false);
   198          A.store.Bool(ptr + 4 + 18, false);
   199          A.store.Bool(ptr + 4 + 7, false);
   200          A.store.Bool(ptr + 4 + 19, false);
   201          A.store.Bool(ptr + 4 + 8, false);
   202          A.store.Bool(ptr + 4 + 20, false);
   203          A.store.Bool(ptr + 4 + 9, false);
   204          A.store.Bool(ptr + 4 + 21, false);
   205          A.store.Bool(ptr + 4 + 10, false);
   206          A.store.Bool(ptr + 32, false);
   207          A.store.Int32(ptr + 28, 0);
   208        } else {
   209          A.store.Bool(ptr + 33, true);
   210          A.store.Ref(ptr + 0, x["reader"]);
   211  
   212          if (typeof x["currentState"] === "undefined") {
   213            A.store.Bool(ptr + 4 + 22, false);
   214            A.store.Bool(ptr + 4 + 11, false);
   215            A.store.Bool(ptr + 4 + 0, false);
   216            A.store.Bool(ptr + 4 + 12, false);
   217            A.store.Bool(ptr + 4 + 1, false);
   218            A.store.Bool(ptr + 4 + 13, false);
   219            A.store.Bool(ptr + 4 + 2, false);
   220            A.store.Bool(ptr + 4 + 14, false);
   221            A.store.Bool(ptr + 4 + 3, false);
   222            A.store.Bool(ptr + 4 + 15, false);
   223            A.store.Bool(ptr + 4 + 4, false);
   224            A.store.Bool(ptr + 4 + 16, false);
   225            A.store.Bool(ptr + 4 + 5, false);
   226            A.store.Bool(ptr + 4 + 17, false);
   227            A.store.Bool(ptr + 4 + 6, false);
   228            A.store.Bool(ptr + 4 + 18, false);
   229            A.store.Bool(ptr + 4 + 7, false);
   230            A.store.Bool(ptr + 4 + 19, false);
   231            A.store.Bool(ptr + 4 + 8, false);
   232            A.store.Bool(ptr + 4 + 20, false);
   233            A.store.Bool(ptr + 4 + 9, false);
   234            A.store.Bool(ptr + 4 + 21, false);
   235            A.store.Bool(ptr + 4 + 10, false);
   236          } else {
   237            A.store.Bool(ptr + 4 + 22, true);
   238            A.store.Bool(ptr + 4 + 11, "unaware" in x["currentState"] ? true : false);
   239            A.store.Bool(ptr + 4 + 0, x["currentState"]["unaware"] ? true : false);
   240            A.store.Bool(ptr + 4 + 12, "ignore" in x["currentState"] ? true : false);
   241            A.store.Bool(ptr + 4 + 1, x["currentState"]["ignore"] ? true : false);
   242            A.store.Bool(ptr + 4 + 13, "changed" in x["currentState"] ? true : false);
   243            A.store.Bool(ptr + 4 + 2, x["currentState"]["changed"] ? true : false);
   244            A.store.Bool(ptr + 4 + 14, "unknown" in x["currentState"] ? true : false);
   245            A.store.Bool(ptr + 4 + 3, x["currentState"]["unknown"] ? true : false);
   246            A.store.Bool(ptr + 4 + 15, "unavailable" in x["currentState"] ? true : false);
   247            A.store.Bool(ptr + 4 + 4, x["currentState"]["unavailable"] ? true : false);
   248            A.store.Bool(ptr + 4 + 16, "empty" in x["currentState"] ? true : false);
   249            A.store.Bool(ptr + 4 + 5, x["currentState"]["empty"] ? true : false);
   250            A.store.Bool(ptr + 4 + 17, "present" in x["currentState"] ? true : false);
   251            A.store.Bool(ptr + 4 + 6, x["currentState"]["present"] ? true : false);
   252            A.store.Bool(ptr + 4 + 18, "exclusive" in x["currentState"] ? true : false);
   253            A.store.Bool(ptr + 4 + 7, x["currentState"]["exclusive"] ? true : false);
   254            A.store.Bool(ptr + 4 + 19, "inuse" in x["currentState"] ? true : false);
   255            A.store.Bool(ptr + 4 + 8, x["currentState"]["inuse"] ? true : false);
   256            A.store.Bool(ptr + 4 + 20, "mute" in x["currentState"] ? true : false);
   257            A.store.Bool(ptr + 4 + 9, x["currentState"]["mute"] ? true : false);
   258            A.store.Bool(ptr + 4 + 21, "unpowered" in x["currentState"] ? true : false);
   259            A.store.Bool(ptr + 4 + 10, x["currentState"]["unpowered"] ? true : false);
   260          }
   261          A.store.Bool(ptr + 32, "currentCount" in x ? true : false);
   262          A.store.Int32(ptr + 28, x["currentCount"] === undefined ? 0 : (x["currentCount"] as number));
   263        }
   264      },
   265      "load_ReaderStateIn": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   266        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   267  
   268        x["reader"] = A.load.Ref(ptr + 0, undefined);
   269        if (A.load.Bool(ptr + 4 + 22)) {
   270          x["currentState"] = {};
   271          if (A.load.Bool(ptr + 4 + 11)) {
   272            x["currentState"]["unaware"] = A.load.Bool(ptr + 4 + 0);
   273          } else {
   274            delete x["currentState"]["unaware"];
   275          }
   276          if (A.load.Bool(ptr + 4 + 12)) {
   277            x["currentState"]["ignore"] = A.load.Bool(ptr + 4 + 1);
   278          } else {
   279            delete x["currentState"]["ignore"];
   280          }
   281          if (A.load.Bool(ptr + 4 + 13)) {
   282            x["currentState"]["changed"] = A.load.Bool(ptr + 4 + 2);
   283          } else {
   284            delete x["currentState"]["changed"];
   285          }
   286          if (A.load.Bool(ptr + 4 + 14)) {
   287            x["currentState"]["unknown"] = A.load.Bool(ptr + 4 + 3);
   288          } else {
   289            delete x["currentState"]["unknown"];
   290          }
   291          if (A.load.Bool(ptr + 4 + 15)) {
   292            x["currentState"]["unavailable"] = A.load.Bool(ptr + 4 + 4);
   293          } else {
   294            delete x["currentState"]["unavailable"];
   295          }
   296          if (A.load.Bool(ptr + 4 + 16)) {
   297            x["currentState"]["empty"] = A.load.Bool(ptr + 4 + 5);
   298          } else {
   299            delete x["currentState"]["empty"];
   300          }
   301          if (A.load.Bool(ptr + 4 + 17)) {
   302            x["currentState"]["present"] = A.load.Bool(ptr + 4 + 6);
   303          } else {
   304            delete x["currentState"]["present"];
   305          }
   306          if (A.load.Bool(ptr + 4 + 18)) {
   307            x["currentState"]["exclusive"] = A.load.Bool(ptr + 4 + 7);
   308          } else {
   309            delete x["currentState"]["exclusive"];
   310          }
   311          if (A.load.Bool(ptr + 4 + 19)) {
   312            x["currentState"]["inuse"] = A.load.Bool(ptr + 4 + 8);
   313          } else {
   314            delete x["currentState"]["inuse"];
   315          }
   316          if (A.load.Bool(ptr + 4 + 20)) {
   317            x["currentState"]["mute"] = A.load.Bool(ptr + 4 + 9);
   318          } else {
   319            delete x["currentState"]["mute"];
   320          }
   321          if (A.load.Bool(ptr + 4 + 21)) {
   322            x["currentState"]["unpowered"] = A.load.Bool(ptr + 4 + 10);
   323          } else {
   324            delete x["currentState"]["unpowered"];
   325          }
   326        } else {
   327          delete x["currentState"];
   328        }
   329        if (A.load.Bool(ptr + 32)) {
   330          x["currentCount"] = A.load.Int32(ptr + 28);
   331        } else {
   332          delete x["currentCount"];
   333        }
   334        return create === A.H.TRUE ? A.H.push(x) : ref;
   335      },
   336  
   337      "store_ReaderStateOut": (ptr: Pointer, ref: heap.Ref<any>) => {
   338        const x = A.H.get<any>(ref);
   339  
   340        if (typeof x === "undefined") {
   341          A.store.Bool(ptr + 37, false);
   342          A.store.Ref(ptr + 0, undefined);
   343  
   344          A.store.Bool(ptr + 4 + 22, false);
   345          A.store.Bool(ptr + 4 + 11, false);
   346          A.store.Bool(ptr + 4 + 0, false);
   347          A.store.Bool(ptr + 4 + 12, false);
   348          A.store.Bool(ptr + 4 + 1, false);
   349          A.store.Bool(ptr + 4 + 13, false);
   350          A.store.Bool(ptr + 4 + 2, false);
   351          A.store.Bool(ptr + 4 + 14, false);
   352          A.store.Bool(ptr + 4 + 3, false);
   353          A.store.Bool(ptr + 4 + 15, false);
   354          A.store.Bool(ptr + 4 + 4, false);
   355          A.store.Bool(ptr + 4 + 16, false);
   356          A.store.Bool(ptr + 4 + 5, false);
   357          A.store.Bool(ptr + 4 + 17, false);
   358          A.store.Bool(ptr + 4 + 6, false);
   359          A.store.Bool(ptr + 4 + 18, false);
   360          A.store.Bool(ptr + 4 + 7, false);
   361          A.store.Bool(ptr + 4 + 19, false);
   362          A.store.Bool(ptr + 4 + 8, false);
   363          A.store.Bool(ptr + 4 + 20, false);
   364          A.store.Bool(ptr + 4 + 9, false);
   365          A.store.Bool(ptr + 4 + 21, false);
   366          A.store.Bool(ptr + 4 + 10, false);
   367          A.store.Bool(ptr + 36, false);
   368          A.store.Int32(ptr + 28, 0);
   369          A.store.Ref(ptr + 32, undefined);
   370        } else {
   371          A.store.Bool(ptr + 37, true);
   372          A.store.Ref(ptr + 0, x["reader"]);
   373  
   374          if (typeof x["eventState"] === "undefined") {
   375            A.store.Bool(ptr + 4 + 22, false);
   376            A.store.Bool(ptr + 4 + 11, false);
   377            A.store.Bool(ptr + 4 + 0, false);
   378            A.store.Bool(ptr + 4 + 12, false);
   379            A.store.Bool(ptr + 4 + 1, false);
   380            A.store.Bool(ptr + 4 + 13, false);
   381            A.store.Bool(ptr + 4 + 2, false);
   382            A.store.Bool(ptr + 4 + 14, false);
   383            A.store.Bool(ptr + 4 + 3, false);
   384            A.store.Bool(ptr + 4 + 15, false);
   385            A.store.Bool(ptr + 4 + 4, false);
   386            A.store.Bool(ptr + 4 + 16, false);
   387            A.store.Bool(ptr + 4 + 5, false);
   388            A.store.Bool(ptr + 4 + 17, false);
   389            A.store.Bool(ptr + 4 + 6, false);
   390            A.store.Bool(ptr + 4 + 18, false);
   391            A.store.Bool(ptr + 4 + 7, false);
   392            A.store.Bool(ptr + 4 + 19, false);
   393            A.store.Bool(ptr + 4 + 8, false);
   394            A.store.Bool(ptr + 4 + 20, false);
   395            A.store.Bool(ptr + 4 + 9, false);
   396            A.store.Bool(ptr + 4 + 21, false);
   397            A.store.Bool(ptr + 4 + 10, false);
   398          } else {
   399            A.store.Bool(ptr + 4 + 22, true);
   400            A.store.Bool(ptr + 4 + 11, "unaware" in x["eventState"] ? true : false);
   401            A.store.Bool(ptr + 4 + 0, x["eventState"]["unaware"] ? true : false);
   402            A.store.Bool(ptr + 4 + 12, "ignore" in x["eventState"] ? true : false);
   403            A.store.Bool(ptr + 4 + 1, x["eventState"]["ignore"] ? true : false);
   404            A.store.Bool(ptr + 4 + 13, "changed" in x["eventState"] ? true : false);
   405            A.store.Bool(ptr + 4 + 2, x["eventState"]["changed"] ? true : false);
   406            A.store.Bool(ptr + 4 + 14, "unknown" in x["eventState"] ? true : false);
   407            A.store.Bool(ptr + 4 + 3, x["eventState"]["unknown"] ? true : false);
   408            A.store.Bool(ptr + 4 + 15, "unavailable" in x["eventState"] ? true : false);
   409            A.store.Bool(ptr + 4 + 4, x["eventState"]["unavailable"] ? true : false);
   410            A.store.Bool(ptr + 4 + 16, "empty" in x["eventState"] ? true : false);
   411            A.store.Bool(ptr + 4 + 5, x["eventState"]["empty"] ? true : false);
   412            A.store.Bool(ptr + 4 + 17, "present" in x["eventState"] ? true : false);
   413            A.store.Bool(ptr + 4 + 6, x["eventState"]["present"] ? true : false);
   414            A.store.Bool(ptr + 4 + 18, "exclusive" in x["eventState"] ? true : false);
   415            A.store.Bool(ptr + 4 + 7, x["eventState"]["exclusive"] ? true : false);
   416            A.store.Bool(ptr + 4 + 19, "inuse" in x["eventState"] ? true : false);
   417            A.store.Bool(ptr + 4 + 8, x["eventState"]["inuse"] ? true : false);
   418            A.store.Bool(ptr + 4 + 20, "mute" in x["eventState"] ? true : false);
   419            A.store.Bool(ptr + 4 + 9, x["eventState"]["mute"] ? true : false);
   420            A.store.Bool(ptr + 4 + 21, "unpowered" in x["eventState"] ? true : false);
   421            A.store.Bool(ptr + 4 + 10, x["eventState"]["unpowered"] ? true : false);
   422          }
   423          A.store.Bool(ptr + 36, "eventCount" in x ? true : false);
   424          A.store.Int32(ptr + 28, x["eventCount"] === undefined ? 0 : (x["eventCount"] as number));
   425          A.store.Ref(ptr + 32, x["atr"]);
   426        }
   427      },
   428      "load_ReaderStateOut": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   429        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   430  
   431        x["reader"] = A.load.Ref(ptr + 0, undefined);
   432        if (A.load.Bool(ptr + 4 + 22)) {
   433          x["eventState"] = {};
   434          if (A.load.Bool(ptr + 4 + 11)) {
   435            x["eventState"]["unaware"] = A.load.Bool(ptr + 4 + 0);
   436          } else {
   437            delete x["eventState"]["unaware"];
   438          }
   439          if (A.load.Bool(ptr + 4 + 12)) {
   440            x["eventState"]["ignore"] = A.load.Bool(ptr + 4 + 1);
   441          } else {
   442            delete x["eventState"]["ignore"];
   443          }
   444          if (A.load.Bool(ptr + 4 + 13)) {
   445            x["eventState"]["changed"] = A.load.Bool(ptr + 4 + 2);
   446          } else {
   447            delete x["eventState"]["changed"];
   448          }
   449          if (A.load.Bool(ptr + 4 + 14)) {
   450            x["eventState"]["unknown"] = A.load.Bool(ptr + 4 + 3);
   451          } else {
   452            delete x["eventState"]["unknown"];
   453          }
   454          if (A.load.Bool(ptr + 4 + 15)) {
   455            x["eventState"]["unavailable"] = A.load.Bool(ptr + 4 + 4);
   456          } else {
   457            delete x["eventState"]["unavailable"];
   458          }
   459          if (A.load.Bool(ptr + 4 + 16)) {
   460            x["eventState"]["empty"] = A.load.Bool(ptr + 4 + 5);
   461          } else {
   462            delete x["eventState"]["empty"];
   463          }
   464          if (A.load.Bool(ptr + 4 + 17)) {
   465            x["eventState"]["present"] = A.load.Bool(ptr + 4 + 6);
   466          } else {
   467            delete x["eventState"]["present"];
   468          }
   469          if (A.load.Bool(ptr + 4 + 18)) {
   470            x["eventState"]["exclusive"] = A.load.Bool(ptr + 4 + 7);
   471          } else {
   472            delete x["eventState"]["exclusive"];
   473          }
   474          if (A.load.Bool(ptr + 4 + 19)) {
   475            x["eventState"]["inuse"] = A.load.Bool(ptr + 4 + 8);
   476          } else {
   477            delete x["eventState"]["inuse"];
   478          }
   479          if (A.load.Bool(ptr + 4 + 20)) {
   480            x["eventState"]["mute"] = A.load.Bool(ptr + 4 + 9);
   481          } else {
   482            delete x["eventState"]["mute"];
   483          }
   484          if (A.load.Bool(ptr + 4 + 21)) {
   485            x["eventState"]["unpowered"] = A.load.Bool(ptr + 4 + 10);
   486          } else {
   487            delete x["eventState"]["unpowered"];
   488          }
   489        } else {
   490          delete x["eventState"];
   491        }
   492        if (A.load.Bool(ptr + 36)) {
   493          x["eventCount"] = A.load.Int32(ptr + 28);
   494        } else {
   495          delete x["eventCount"];
   496        }
   497        x["atr"] = A.load.Ref(ptr + 32, undefined);
   498        return create === A.H.TRUE ? A.H.push(x) : ref;
   499      },
   500      "constof_ResultCode": (ref: heap.Ref<string>): number => {
   501        const idx = [
   502          "SUCCESS",
   503          "REMOVED_CARD",
   504          "RESET_CARD",
   505          "UNPOWERED_CARD",
   506          "UNRESPONSIVE_CARD",
   507          "UNSUPPORTED_CARD",
   508          "READER_UNAVAILABLE",
   509          "SHARING_VIOLATION",
   510          "NOT_TRANSACTED",
   511          "NO_SMARTCARD",
   512          "PROTO_MISMATCH",
   513          "SYSTEM_CANCELLED",
   514          "NOT_READY",
   515          "CANCELLED",
   516          "INSUFFICIENT_BUFFER",
   517          "INVALID_HANDLE",
   518          "INVALID_PARAMETER",
   519          "INVALID_VALUE",
   520          "NO_MEMORY",
   521          "TIMEOUT",
   522          "UNKNOWN_READER",
   523          "UNSUPPORTED_FEATURE",
   524          "NO_READERS_AVAILABLE",
   525          "SERVICE_STOPPED",
   526          "NO_SERVICE",
   527          "COMM_ERROR",
   528          "INTERNAL_ERROR",
   529          "UNKNOWN_ERROR",
   530          "SERVER_TOO_BUSY",
   531          "UNEXPECTED",
   532          "SHUTDOWN",
   533          "UNKNOWN",
   534        ].indexOf(A.H.get(ref));
   535        return idx < 0 ? 0 : idx + 1;
   536      },
   537      "constof_ShareMode": (ref: heap.Ref<string>): number => {
   538        const idx = ["SHARED", "EXCLUSIVE", "DIRECT"].indexOf(A.H.get(ref));
   539        return idx < 0 ? 0 : idx + 1;
   540      },
   541  
   542      "store_Timeout": (ptr: Pointer, ref: heap.Ref<any>) => {
   543        const x = A.H.get<any>(ref);
   544  
   545        if (typeof x === "undefined") {
   546          A.store.Bool(ptr + 5, false);
   547          A.store.Bool(ptr + 4, false);
   548          A.store.Int32(ptr + 0, 0);
   549        } else {
   550          A.store.Bool(ptr + 5, true);
   551          A.store.Bool(ptr + 4, "milliseconds" in x ? true : false);
   552          A.store.Int32(ptr + 0, x["milliseconds"] === undefined ? 0 : (x["milliseconds"] as number));
   553        }
   554      },
   555      "load_Timeout": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   556        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   557  
   558        if (A.load.Bool(ptr + 4)) {
   559          x["milliseconds"] = A.load.Int32(ptr + 0);
   560        } else {
   561          delete x["milliseconds"];
   562        }
   563        return create === A.H.TRUE ? A.H.push(x) : ref;
   564      },
   565      "has_OnBeginTransactionRequested": (): heap.Ref<boolean> => {
   566        if (
   567          WEBEXT?.smartCardProviderPrivate?.onBeginTransactionRequested &&
   568          "addListener" in WEBEXT?.smartCardProviderPrivate?.onBeginTransactionRequested
   569        ) {
   570          return A.H.TRUE;
   571        }
   572        return A.H.FALSE;
   573      },
   574      "func_OnBeginTransactionRequested": (fn: Pointer): void => {
   575        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.addListener);
   576      },
   577      "call_OnBeginTransactionRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   578        const _ret = WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.addListener(A.H.get<object>(callback));
   579      },
   580      "try_OnBeginTransactionRequested": (
   581        retPtr: Pointer,
   582        errPtr: Pointer,
   583        callback: heap.Ref<object>
   584      ): heap.Ref<boolean> => {
   585        try {
   586          const _ret = WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.addListener(A.H.get<object>(callback));
   587          return A.H.TRUE;
   588        } catch (err: any) {
   589          A.store.Ref(errPtr, err);
   590          return A.H.FALSE;
   591        }
   592      },
   593      "has_OffBeginTransactionRequested": (): heap.Ref<boolean> => {
   594        if (
   595          WEBEXT?.smartCardProviderPrivate?.onBeginTransactionRequested &&
   596          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onBeginTransactionRequested
   597        ) {
   598          return A.H.TRUE;
   599        }
   600        return A.H.FALSE;
   601      },
   602      "func_OffBeginTransactionRequested": (fn: Pointer): void => {
   603        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.removeListener);
   604      },
   605      "call_OffBeginTransactionRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   606        const _ret = WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.removeListener(
   607          A.H.get<object>(callback)
   608        );
   609      },
   610      "try_OffBeginTransactionRequested": (
   611        retPtr: Pointer,
   612        errPtr: Pointer,
   613        callback: heap.Ref<object>
   614      ): heap.Ref<boolean> => {
   615        try {
   616          const _ret = WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.removeListener(
   617            A.H.get<object>(callback)
   618          );
   619          return A.H.TRUE;
   620        } catch (err: any) {
   621          A.store.Ref(errPtr, err);
   622          return A.H.FALSE;
   623        }
   624      },
   625      "has_HasOnBeginTransactionRequested": (): heap.Ref<boolean> => {
   626        if (
   627          WEBEXT?.smartCardProviderPrivate?.onBeginTransactionRequested &&
   628          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onBeginTransactionRequested
   629        ) {
   630          return A.H.TRUE;
   631        }
   632        return A.H.FALSE;
   633      },
   634      "func_HasOnBeginTransactionRequested": (fn: Pointer): void => {
   635        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.hasListener);
   636      },
   637      "call_HasOnBeginTransactionRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   638        const _ret = WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.hasListener(A.H.get<object>(callback));
   639        A.store.Bool(retPtr, _ret);
   640      },
   641      "try_HasOnBeginTransactionRequested": (
   642        retPtr: Pointer,
   643        errPtr: Pointer,
   644        callback: heap.Ref<object>
   645      ): heap.Ref<boolean> => {
   646        try {
   647          const _ret = WEBEXT.smartCardProviderPrivate.onBeginTransactionRequested.hasListener(A.H.get<object>(callback));
   648          A.store.Bool(retPtr, _ret);
   649          return A.H.TRUE;
   650        } catch (err: any) {
   651          A.store.Ref(errPtr, err);
   652          return A.H.FALSE;
   653        }
   654      },
   655      "has_OnCancelRequested": (): heap.Ref<boolean> => {
   656        if (
   657          WEBEXT?.smartCardProviderPrivate?.onCancelRequested &&
   658          "addListener" in WEBEXT?.smartCardProviderPrivate?.onCancelRequested
   659        ) {
   660          return A.H.TRUE;
   661        }
   662        return A.H.FALSE;
   663      },
   664      "func_OnCancelRequested": (fn: Pointer): void => {
   665        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onCancelRequested.addListener);
   666      },
   667      "call_OnCancelRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   668        const _ret = WEBEXT.smartCardProviderPrivate.onCancelRequested.addListener(A.H.get<object>(callback));
   669      },
   670      "try_OnCancelRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   671        try {
   672          const _ret = WEBEXT.smartCardProviderPrivate.onCancelRequested.addListener(A.H.get<object>(callback));
   673          return A.H.TRUE;
   674        } catch (err: any) {
   675          A.store.Ref(errPtr, err);
   676          return A.H.FALSE;
   677        }
   678      },
   679      "has_OffCancelRequested": (): heap.Ref<boolean> => {
   680        if (
   681          WEBEXT?.smartCardProviderPrivate?.onCancelRequested &&
   682          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onCancelRequested
   683        ) {
   684          return A.H.TRUE;
   685        }
   686        return A.H.FALSE;
   687      },
   688      "func_OffCancelRequested": (fn: Pointer): void => {
   689        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onCancelRequested.removeListener);
   690      },
   691      "call_OffCancelRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   692        const _ret = WEBEXT.smartCardProviderPrivate.onCancelRequested.removeListener(A.H.get<object>(callback));
   693      },
   694      "try_OffCancelRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   695        try {
   696          const _ret = WEBEXT.smartCardProviderPrivate.onCancelRequested.removeListener(A.H.get<object>(callback));
   697          return A.H.TRUE;
   698        } catch (err: any) {
   699          A.store.Ref(errPtr, err);
   700          return A.H.FALSE;
   701        }
   702      },
   703      "has_HasOnCancelRequested": (): heap.Ref<boolean> => {
   704        if (
   705          WEBEXT?.smartCardProviderPrivate?.onCancelRequested &&
   706          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onCancelRequested
   707        ) {
   708          return A.H.TRUE;
   709        }
   710        return A.H.FALSE;
   711      },
   712      "func_HasOnCancelRequested": (fn: Pointer): void => {
   713        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onCancelRequested.hasListener);
   714      },
   715      "call_HasOnCancelRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   716        const _ret = WEBEXT.smartCardProviderPrivate.onCancelRequested.hasListener(A.H.get<object>(callback));
   717        A.store.Bool(retPtr, _ret);
   718      },
   719      "try_HasOnCancelRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   720        try {
   721          const _ret = WEBEXT.smartCardProviderPrivate.onCancelRequested.hasListener(A.H.get<object>(callback));
   722          A.store.Bool(retPtr, _ret);
   723          return A.H.TRUE;
   724        } catch (err: any) {
   725          A.store.Ref(errPtr, err);
   726          return A.H.FALSE;
   727        }
   728      },
   729      "has_OnConnectRequested": (): heap.Ref<boolean> => {
   730        if (
   731          WEBEXT?.smartCardProviderPrivate?.onConnectRequested &&
   732          "addListener" in WEBEXT?.smartCardProviderPrivate?.onConnectRequested
   733        ) {
   734          return A.H.TRUE;
   735        }
   736        return A.H.FALSE;
   737      },
   738      "func_OnConnectRequested": (fn: Pointer): void => {
   739        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onConnectRequested.addListener);
   740      },
   741      "call_OnConnectRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   742        const _ret = WEBEXT.smartCardProviderPrivate.onConnectRequested.addListener(A.H.get<object>(callback));
   743      },
   744      "try_OnConnectRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   745        try {
   746          const _ret = WEBEXT.smartCardProviderPrivate.onConnectRequested.addListener(A.H.get<object>(callback));
   747          return A.H.TRUE;
   748        } catch (err: any) {
   749          A.store.Ref(errPtr, err);
   750          return A.H.FALSE;
   751        }
   752      },
   753      "has_OffConnectRequested": (): heap.Ref<boolean> => {
   754        if (
   755          WEBEXT?.smartCardProviderPrivate?.onConnectRequested &&
   756          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onConnectRequested
   757        ) {
   758          return A.H.TRUE;
   759        }
   760        return A.H.FALSE;
   761      },
   762      "func_OffConnectRequested": (fn: Pointer): void => {
   763        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onConnectRequested.removeListener);
   764      },
   765      "call_OffConnectRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   766        const _ret = WEBEXT.smartCardProviderPrivate.onConnectRequested.removeListener(A.H.get<object>(callback));
   767      },
   768      "try_OffConnectRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   769        try {
   770          const _ret = WEBEXT.smartCardProviderPrivate.onConnectRequested.removeListener(A.H.get<object>(callback));
   771          return A.H.TRUE;
   772        } catch (err: any) {
   773          A.store.Ref(errPtr, err);
   774          return A.H.FALSE;
   775        }
   776      },
   777      "has_HasOnConnectRequested": (): heap.Ref<boolean> => {
   778        if (
   779          WEBEXT?.smartCardProviderPrivate?.onConnectRequested &&
   780          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onConnectRequested
   781        ) {
   782          return A.H.TRUE;
   783        }
   784        return A.H.FALSE;
   785      },
   786      "func_HasOnConnectRequested": (fn: Pointer): void => {
   787        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onConnectRequested.hasListener);
   788      },
   789      "call_HasOnConnectRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   790        const _ret = WEBEXT.smartCardProviderPrivate.onConnectRequested.hasListener(A.H.get<object>(callback));
   791        A.store.Bool(retPtr, _ret);
   792      },
   793      "try_HasOnConnectRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   794        try {
   795          const _ret = WEBEXT.smartCardProviderPrivate.onConnectRequested.hasListener(A.H.get<object>(callback));
   796          A.store.Bool(retPtr, _ret);
   797          return A.H.TRUE;
   798        } catch (err: any) {
   799          A.store.Ref(errPtr, err);
   800          return A.H.FALSE;
   801        }
   802      },
   803      "has_OnControlRequested": (): heap.Ref<boolean> => {
   804        if (
   805          WEBEXT?.smartCardProviderPrivate?.onControlRequested &&
   806          "addListener" in WEBEXT?.smartCardProviderPrivate?.onControlRequested
   807        ) {
   808          return A.H.TRUE;
   809        }
   810        return A.H.FALSE;
   811      },
   812      "func_OnControlRequested": (fn: Pointer): void => {
   813        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onControlRequested.addListener);
   814      },
   815      "call_OnControlRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   816        const _ret = WEBEXT.smartCardProviderPrivate.onControlRequested.addListener(A.H.get<object>(callback));
   817      },
   818      "try_OnControlRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   819        try {
   820          const _ret = WEBEXT.smartCardProviderPrivate.onControlRequested.addListener(A.H.get<object>(callback));
   821          return A.H.TRUE;
   822        } catch (err: any) {
   823          A.store.Ref(errPtr, err);
   824          return A.H.FALSE;
   825        }
   826      },
   827      "has_OffControlRequested": (): heap.Ref<boolean> => {
   828        if (
   829          WEBEXT?.smartCardProviderPrivate?.onControlRequested &&
   830          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onControlRequested
   831        ) {
   832          return A.H.TRUE;
   833        }
   834        return A.H.FALSE;
   835      },
   836      "func_OffControlRequested": (fn: Pointer): void => {
   837        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onControlRequested.removeListener);
   838      },
   839      "call_OffControlRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   840        const _ret = WEBEXT.smartCardProviderPrivate.onControlRequested.removeListener(A.H.get<object>(callback));
   841      },
   842      "try_OffControlRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   843        try {
   844          const _ret = WEBEXT.smartCardProviderPrivate.onControlRequested.removeListener(A.H.get<object>(callback));
   845          return A.H.TRUE;
   846        } catch (err: any) {
   847          A.store.Ref(errPtr, err);
   848          return A.H.FALSE;
   849        }
   850      },
   851      "has_HasOnControlRequested": (): heap.Ref<boolean> => {
   852        if (
   853          WEBEXT?.smartCardProviderPrivate?.onControlRequested &&
   854          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onControlRequested
   855        ) {
   856          return A.H.TRUE;
   857        }
   858        return A.H.FALSE;
   859      },
   860      "func_HasOnControlRequested": (fn: Pointer): void => {
   861        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onControlRequested.hasListener);
   862      },
   863      "call_HasOnControlRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   864        const _ret = WEBEXT.smartCardProviderPrivate.onControlRequested.hasListener(A.H.get<object>(callback));
   865        A.store.Bool(retPtr, _ret);
   866      },
   867      "try_HasOnControlRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   868        try {
   869          const _ret = WEBEXT.smartCardProviderPrivate.onControlRequested.hasListener(A.H.get<object>(callback));
   870          A.store.Bool(retPtr, _ret);
   871          return A.H.TRUE;
   872        } catch (err: any) {
   873          A.store.Ref(errPtr, err);
   874          return A.H.FALSE;
   875        }
   876      },
   877      "has_OnDisconnectRequested": (): heap.Ref<boolean> => {
   878        if (
   879          WEBEXT?.smartCardProviderPrivate?.onDisconnectRequested &&
   880          "addListener" in WEBEXT?.smartCardProviderPrivate?.onDisconnectRequested
   881        ) {
   882          return A.H.TRUE;
   883        }
   884        return A.H.FALSE;
   885      },
   886      "func_OnDisconnectRequested": (fn: Pointer): void => {
   887        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onDisconnectRequested.addListener);
   888      },
   889      "call_OnDisconnectRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   890        const _ret = WEBEXT.smartCardProviderPrivate.onDisconnectRequested.addListener(A.H.get<object>(callback));
   891      },
   892      "try_OnDisconnectRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   893        try {
   894          const _ret = WEBEXT.smartCardProviderPrivate.onDisconnectRequested.addListener(A.H.get<object>(callback));
   895          return A.H.TRUE;
   896        } catch (err: any) {
   897          A.store.Ref(errPtr, err);
   898          return A.H.FALSE;
   899        }
   900      },
   901      "has_OffDisconnectRequested": (): heap.Ref<boolean> => {
   902        if (
   903          WEBEXT?.smartCardProviderPrivate?.onDisconnectRequested &&
   904          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onDisconnectRequested
   905        ) {
   906          return A.H.TRUE;
   907        }
   908        return A.H.FALSE;
   909      },
   910      "func_OffDisconnectRequested": (fn: Pointer): void => {
   911        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onDisconnectRequested.removeListener);
   912      },
   913      "call_OffDisconnectRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   914        const _ret = WEBEXT.smartCardProviderPrivate.onDisconnectRequested.removeListener(A.H.get<object>(callback));
   915      },
   916      "try_OffDisconnectRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   917        try {
   918          const _ret = WEBEXT.smartCardProviderPrivate.onDisconnectRequested.removeListener(A.H.get<object>(callback));
   919          return A.H.TRUE;
   920        } catch (err: any) {
   921          A.store.Ref(errPtr, err);
   922          return A.H.FALSE;
   923        }
   924      },
   925      "has_HasOnDisconnectRequested": (): heap.Ref<boolean> => {
   926        if (
   927          WEBEXT?.smartCardProviderPrivate?.onDisconnectRequested &&
   928          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onDisconnectRequested
   929        ) {
   930          return A.H.TRUE;
   931        }
   932        return A.H.FALSE;
   933      },
   934      "func_HasOnDisconnectRequested": (fn: Pointer): void => {
   935        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onDisconnectRequested.hasListener);
   936      },
   937      "call_HasOnDisconnectRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   938        const _ret = WEBEXT.smartCardProviderPrivate.onDisconnectRequested.hasListener(A.H.get<object>(callback));
   939        A.store.Bool(retPtr, _ret);
   940      },
   941      "try_HasOnDisconnectRequested": (
   942        retPtr: Pointer,
   943        errPtr: Pointer,
   944        callback: heap.Ref<object>
   945      ): heap.Ref<boolean> => {
   946        try {
   947          const _ret = WEBEXT.smartCardProviderPrivate.onDisconnectRequested.hasListener(A.H.get<object>(callback));
   948          A.store.Bool(retPtr, _ret);
   949          return A.H.TRUE;
   950        } catch (err: any) {
   951          A.store.Ref(errPtr, err);
   952          return A.H.FALSE;
   953        }
   954      },
   955      "has_OnEndTransactionRequested": (): heap.Ref<boolean> => {
   956        if (
   957          WEBEXT?.smartCardProviderPrivate?.onEndTransactionRequested &&
   958          "addListener" in WEBEXT?.smartCardProviderPrivate?.onEndTransactionRequested
   959        ) {
   960          return A.H.TRUE;
   961        }
   962        return A.H.FALSE;
   963      },
   964      "func_OnEndTransactionRequested": (fn: Pointer): void => {
   965        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.addListener);
   966      },
   967      "call_OnEndTransactionRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   968        const _ret = WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.addListener(A.H.get<object>(callback));
   969      },
   970      "try_OnEndTransactionRequested": (
   971        retPtr: Pointer,
   972        errPtr: Pointer,
   973        callback: heap.Ref<object>
   974      ): heap.Ref<boolean> => {
   975        try {
   976          const _ret = WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.addListener(A.H.get<object>(callback));
   977          return A.H.TRUE;
   978        } catch (err: any) {
   979          A.store.Ref(errPtr, err);
   980          return A.H.FALSE;
   981        }
   982      },
   983      "has_OffEndTransactionRequested": (): heap.Ref<boolean> => {
   984        if (
   985          WEBEXT?.smartCardProviderPrivate?.onEndTransactionRequested &&
   986          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onEndTransactionRequested
   987        ) {
   988          return A.H.TRUE;
   989        }
   990        return A.H.FALSE;
   991      },
   992      "func_OffEndTransactionRequested": (fn: Pointer): void => {
   993        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.removeListener);
   994      },
   995      "call_OffEndTransactionRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   996        const _ret = WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.removeListener(A.H.get<object>(callback));
   997      },
   998      "try_OffEndTransactionRequested": (
   999        retPtr: Pointer,
  1000        errPtr: Pointer,
  1001        callback: heap.Ref<object>
  1002      ): heap.Ref<boolean> => {
  1003        try {
  1004          const _ret = WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.removeListener(
  1005            A.H.get<object>(callback)
  1006          );
  1007          return A.H.TRUE;
  1008        } catch (err: any) {
  1009          A.store.Ref(errPtr, err);
  1010          return A.H.FALSE;
  1011        }
  1012      },
  1013      "has_HasOnEndTransactionRequested": (): heap.Ref<boolean> => {
  1014        if (
  1015          WEBEXT?.smartCardProviderPrivate?.onEndTransactionRequested &&
  1016          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onEndTransactionRequested
  1017        ) {
  1018          return A.H.TRUE;
  1019        }
  1020        return A.H.FALSE;
  1021      },
  1022      "func_HasOnEndTransactionRequested": (fn: Pointer): void => {
  1023        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.hasListener);
  1024      },
  1025      "call_HasOnEndTransactionRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1026        const _ret = WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.hasListener(A.H.get<object>(callback));
  1027        A.store.Bool(retPtr, _ret);
  1028      },
  1029      "try_HasOnEndTransactionRequested": (
  1030        retPtr: Pointer,
  1031        errPtr: Pointer,
  1032        callback: heap.Ref<object>
  1033      ): heap.Ref<boolean> => {
  1034        try {
  1035          const _ret = WEBEXT.smartCardProviderPrivate.onEndTransactionRequested.hasListener(A.H.get<object>(callback));
  1036          A.store.Bool(retPtr, _ret);
  1037          return A.H.TRUE;
  1038        } catch (err: any) {
  1039          A.store.Ref(errPtr, err);
  1040          return A.H.FALSE;
  1041        }
  1042      },
  1043      "has_OnEstablishContextRequested": (): heap.Ref<boolean> => {
  1044        if (
  1045          WEBEXT?.smartCardProviderPrivate?.onEstablishContextRequested &&
  1046          "addListener" in WEBEXT?.smartCardProviderPrivate?.onEstablishContextRequested
  1047        ) {
  1048          return A.H.TRUE;
  1049        }
  1050        return A.H.FALSE;
  1051      },
  1052      "func_OnEstablishContextRequested": (fn: Pointer): void => {
  1053        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.addListener);
  1054      },
  1055      "call_OnEstablishContextRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1056        const _ret = WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.addListener(A.H.get<object>(callback));
  1057      },
  1058      "try_OnEstablishContextRequested": (
  1059        retPtr: Pointer,
  1060        errPtr: Pointer,
  1061        callback: heap.Ref<object>
  1062      ): heap.Ref<boolean> => {
  1063        try {
  1064          const _ret = WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.addListener(A.H.get<object>(callback));
  1065          return A.H.TRUE;
  1066        } catch (err: any) {
  1067          A.store.Ref(errPtr, err);
  1068          return A.H.FALSE;
  1069        }
  1070      },
  1071      "has_OffEstablishContextRequested": (): heap.Ref<boolean> => {
  1072        if (
  1073          WEBEXT?.smartCardProviderPrivate?.onEstablishContextRequested &&
  1074          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onEstablishContextRequested
  1075        ) {
  1076          return A.H.TRUE;
  1077        }
  1078        return A.H.FALSE;
  1079      },
  1080      "func_OffEstablishContextRequested": (fn: Pointer): void => {
  1081        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.removeListener);
  1082      },
  1083      "call_OffEstablishContextRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1084        const _ret = WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.removeListener(
  1085          A.H.get<object>(callback)
  1086        );
  1087      },
  1088      "try_OffEstablishContextRequested": (
  1089        retPtr: Pointer,
  1090        errPtr: Pointer,
  1091        callback: heap.Ref<object>
  1092      ): heap.Ref<boolean> => {
  1093        try {
  1094          const _ret = WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.removeListener(
  1095            A.H.get<object>(callback)
  1096          );
  1097          return A.H.TRUE;
  1098        } catch (err: any) {
  1099          A.store.Ref(errPtr, err);
  1100          return A.H.FALSE;
  1101        }
  1102      },
  1103      "has_HasOnEstablishContextRequested": (): heap.Ref<boolean> => {
  1104        if (
  1105          WEBEXT?.smartCardProviderPrivate?.onEstablishContextRequested &&
  1106          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onEstablishContextRequested
  1107        ) {
  1108          return A.H.TRUE;
  1109        }
  1110        return A.H.FALSE;
  1111      },
  1112      "func_HasOnEstablishContextRequested": (fn: Pointer): void => {
  1113        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.hasListener);
  1114      },
  1115      "call_HasOnEstablishContextRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1116        const _ret = WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.hasListener(A.H.get<object>(callback));
  1117        A.store.Bool(retPtr, _ret);
  1118      },
  1119      "try_HasOnEstablishContextRequested": (
  1120        retPtr: Pointer,
  1121        errPtr: Pointer,
  1122        callback: heap.Ref<object>
  1123      ): heap.Ref<boolean> => {
  1124        try {
  1125          const _ret = WEBEXT.smartCardProviderPrivate.onEstablishContextRequested.hasListener(A.H.get<object>(callback));
  1126          A.store.Bool(retPtr, _ret);
  1127          return A.H.TRUE;
  1128        } catch (err: any) {
  1129          A.store.Ref(errPtr, err);
  1130          return A.H.FALSE;
  1131        }
  1132      },
  1133      "has_OnGetAttribRequested": (): heap.Ref<boolean> => {
  1134        if (
  1135          WEBEXT?.smartCardProviderPrivate?.onGetAttribRequested &&
  1136          "addListener" in WEBEXT?.smartCardProviderPrivate?.onGetAttribRequested
  1137        ) {
  1138          return A.H.TRUE;
  1139        }
  1140        return A.H.FALSE;
  1141      },
  1142      "func_OnGetAttribRequested": (fn: Pointer): void => {
  1143        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onGetAttribRequested.addListener);
  1144      },
  1145      "call_OnGetAttribRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1146        const _ret = WEBEXT.smartCardProviderPrivate.onGetAttribRequested.addListener(A.H.get<object>(callback));
  1147      },
  1148      "try_OnGetAttribRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1149        try {
  1150          const _ret = WEBEXT.smartCardProviderPrivate.onGetAttribRequested.addListener(A.H.get<object>(callback));
  1151          return A.H.TRUE;
  1152        } catch (err: any) {
  1153          A.store.Ref(errPtr, err);
  1154          return A.H.FALSE;
  1155        }
  1156      },
  1157      "has_OffGetAttribRequested": (): heap.Ref<boolean> => {
  1158        if (
  1159          WEBEXT?.smartCardProviderPrivate?.onGetAttribRequested &&
  1160          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onGetAttribRequested
  1161        ) {
  1162          return A.H.TRUE;
  1163        }
  1164        return A.H.FALSE;
  1165      },
  1166      "func_OffGetAttribRequested": (fn: Pointer): void => {
  1167        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onGetAttribRequested.removeListener);
  1168      },
  1169      "call_OffGetAttribRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1170        const _ret = WEBEXT.smartCardProviderPrivate.onGetAttribRequested.removeListener(A.H.get<object>(callback));
  1171      },
  1172      "try_OffGetAttribRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1173        try {
  1174          const _ret = WEBEXT.smartCardProviderPrivate.onGetAttribRequested.removeListener(A.H.get<object>(callback));
  1175          return A.H.TRUE;
  1176        } catch (err: any) {
  1177          A.store.Ref(errPtr, err);
  1178          return A.H.FALSE;
  1179        }
  1180      },
  1181      "has_HasOnGetAttribRequested": (): heap.Ref<boolean> => {
  1182        if (
  1183          WEBEXT?.smartCardProviderPrivate?.onGetAttribRequested &&
  1184          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onGetAttribRequested
  1185        ) {
  1186          return A.H.TRUE;
  1187        }
  1188        return A.H.FALSE;
  1189      },
  1190      "func_HasOnGetAttribRequested": (fn: Pointer): void => {
  1191        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onGetAttribRequested.hasListener);
  1192      },
  1193      "call_HasOnGetAttribRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1194        const _ret = WEBEXT.smartCardProviderPrivate.onGetAttribRequested.hasListener(A.H.get<object>(callback));
  1195        A.store.Bool(retPtr, _ret);
  1196      },
  1197      "try_HasOnGetAttribRequested": (
  1198        retPtr: Pointer,
  1199        errPtr: Pointer,
  1200        callback: heap.Ref<object>
  1201      ): heap.Ref<boolean> => {
  1202        try {
  1203          const _ret = WEBEXT.smartCardProviderPrivate.onGetAttribRequested.hasListener(A.H.get<object>(callback));
  1204          A.store.Bool(retPtr, _ret);
  1205          return A.H.TRUE;
  1206        } catch (err: any) {
  1207          A.store.Ref(errPtr, err);
  1208          return A.H.FALSE;
  1209        }
  1210      },
  1211      "has_OnGetStatusChangeRequested": (): heap.Ref<boolean> => {
  1212        if (
  1213          WEBEXT?.smartCardProviderPrivate?.onGetStatusChangeRequested &&
  1214          "addListener" in WEBEXT?.smartCardProviderPrivate?.onGetStatusChangeRequested
  1215        ) {
  1216          return A.H.TRUE;
  1217        }
  1218        return A.H.FALSE;
  1219      },
  1220      "func_OnGetStatusChangeRequested": (fn: Pointer): void => {
  1221        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.addListener);
  1222      },
  1223      "call_OnGetStatusChangeRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1224        const _ret = WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.addListener(A.H.get<object>(callback));
  1225      },
  1226      "try_OnGetStatusChangeRequested": (
  1227        retPtr: Pointer,
  1228        errPtr: Pointer,
  1229        callback: heap.Ref<object>
  1230      ): heap.Ref<boolean> => {
  1231        try {
  1232          const _ret = WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.addListener(A.H.get<object>(callback));
  1233          return A.H.TRUE;
  1234        } catch (err: any) {
  1235          A.store.Ref(errPtr, err);
  1236          return A.H.FALSE;
  1237        }
  1238      },
  1239      "has_OffGetStatusChangeRequested": (): heap.Ref<boolean> => {
  1240        if (
  1241          WEBEXT?.smartCardProviderPrivate?.onGetStatusChangeRequested &&
  1242          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onGetStatusChangeRequested
  1243        ) {
  1244          return A.H.TRUE;
  1245        }
  1246        return A.H.FALSE;
  1247      },
  1248      "func_OffGetStatusChangeRequested": (fn: Pointer): void => {
  1249        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.removeListener);
  1250      },
  1251      "call_OffGetStatusChangeRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1252        const _ret = WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.removeListener(A.H.get<object>(callback));
  1253      },
  1254      "try_OffGetStatusChangeRequested": (
  1255        retPtr: Pointer,
  1256        errPtr: Pointer,
  1257        callback: heap.Ref<object>
  1258      ): heap.Ref<boolean> => {
  1259        try {
  1260          const _ret = WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.removeListener(
  1261            A.H.get<object>(callback)
  1262          );
  1263          return A.H.TRUE;
  1264        } catch (err: any) {
  1265          A.store.Ref(errPtr, err);
  1266          return A.H.FALSE;
  1267        }
  1268      },
  1269      "has_HasOnGetStatusChangeRequested": (): heap.Ref<boolean> => {
  1270        if (
  1271          WEBEXT?.smartCardProviderPrivate?.onGetStatusChangeRequested &&
  1272          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onGetStatusChangeRequested
  1273        ) {
  1274          return A.H.TRUE;
  1275        }
  1276        return A.H.FALSE;
  1277      },
  1278      "func_HasOnGetStatusChangeRequested": (fn: Pointer): void => {
  1279        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.hasListener);
  1280      },
  1281      "call_HasOnGetStatusChangeRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1282        const _ret = WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.hasListener(A.H.get<object>(callback));
  1283        A.store.Bool(retPtr, _ret);
  1284      },
  1285      "try_HasOnGetStatusChangeRequested": (
  1286        retPtr: Pointer,
  1287        errPtr: Pointer,
  1288        callback: heap.Ref<object>
  1289      ): heap.Ref<boolean> => {
  1290        try {
  1291          const _ret = WEBEXT.smartCardProviderPrivate.onGetStatusChangeRequested.hasListener(A.H.get<object>(callback));
  1292          A.store.Bool(retPtr, _ret);
  1293          return A.H.TRUE;
  1294        } catch (err: any) {
  1295          A.store.Ref(errPtr, err);
  1296          return A.H.FALSE;
  1297        }
  1298      },
  1299      "has_OnListReadersRequested": (): heap.Ref<boolean> => {
  1300        if (
  1301          WEBEXT?.smartCardProviderPrivate?.onListReadersRequested &&
  1302          "addListener" in WEBEXT?.smartCardProviderPrivate?.onListReadersRequested
  1303        ) {
  1304          return A.H.TRUE;
  1305        }
  1306        return A.H.FALSE;
  1307      },
  1308      "func_OnListReadersRequested": (fn: Pointer): void => {
  1309        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onListReadersRequested.addListener);
  1310      },
  1311      "call_OnListReadersRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1312        const _ret = WEBEXT.smartCardProviderPrivate.onListReadersRequested.addListener(A.H.get<object>(callback));
  1313      },
  1314      "try_OnListReadersRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1315        try {
  1316          const _ret = WEBEXT.smartCardProviderPrivate.onListReadersRequested.addListener(A.H.get<object>(callback));
  1317          return A.H.TRUE;
  1318        } catch (err: any) {
  1319          A.store.Ref(errPtr, err);
  1320          return A.H.FALSE;
  1321        }
  1322      },
  1323      "has_OffListReadersRequested": (): heap.Ref<boolean> => {
  1324        if (
  1325          WEBEXT?.smartCardProviderPrivate?.onListReadersRequested &&
  1326          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onListReadersRequested
  1327        ) {
  1328          return A.H.TRUE;
  1329        }
  1330        return A.H.FALSE;
  1331      },
  1332      "func_OffListReadersRequested": (fn: Pointer): void => {
  1333        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onListReadersRequested.removeListener);
  1334      },
  1335      "call_OffListReadersRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1336        const _ret = WEBEXT.smartCardProviderPrivate.onListReadersRequested.removeListener(A.H.get<object>(callback));
  1337      },
  1338      "try_OffListReadersRequested": (
  1339        retPtr: Pointer,
  1340        errPtr: Pointer,
  1341        callback: heap.Ref<object>
  1342      ): heap.Ref<boolean> => {
  1343        try {
  1344          const _ret = WEBEXT.smartCardProviderPrivate.onListReadersRequested.removeListener(A.H.get<object>(callback));
  1345          return A.H.TRUE;
  1346        } catch (err: any) {
  1347          A.store.Ref(errPtr, err);
  1348          return A.H.FALSE;
  1349        }
  1350      },
  1351      "has_HasOnListReadersRequested": (): heap.Ref<boolean> => {
  1352        if (
  1353          WEBEXT?.smartCardProviderPrivate?.onListReadersRequested &&
  1354          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onListReadersRequested
  1355        ) {
  1356          return A.H.TRUE;
  1357        }
  1358        return A.H.FALSE;
  1359      },
  1360      "func_HasOnListReadersRequested": (fn: Pointer): void => {
  1361        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onListReadersRequested.hasListener);
  1362      },
  1363      "call_HasOnListReadersRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1364        const _ret = WEBEXT.smartCardProviderPrivate.onListReadersRequested.hasListener(A.H.get<object>(callback));
  1365        A.store.Bool(retPtr, _ret);
  1366      },
  1367      "try_HasOnListReadersRequested": (
  1368        retPtr: Pointer,
  1369        errPtr: Pointer,
  1370        callback: heap.Ref<object>
  1371      ): heap.Ref<boolean> => {
  1372        try {
  1373          const _ret = WEBEXT.smartCardProviderPrivate.onListReadersRequested.hasListener(A.H.get<object>(callback));
  1374          A.store.Bool(retPtr, _ret);
  1375          return A.H.TRUE;
  1376        } catch (err: any) {
  1377          A.store.Ref(errPtr, err);
  1378          return A.H.FALSE;
  1379        }
  1380      },
  1381      "has_OnReleaseContextRequested": (): heap.Ref<boolean> => {
  1382        if (
  1383          WEBEXT?.smartCardProviderPrivate?.onReleaseContextRequested &&
  1384          "addListener" in WEBEXT?.smartCardProviderPrivate?.onReleaseContextRequested
  1385        ) {
  1386          return A.H.TRUE;
  1387        }
  1388        return A.H.FALSE;
  1389      },
  1390      "func_OnReleaseContextRequested": (fn: Pointer): void => {
  1391        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.addListener);
  1392      },
  1393      "call_OnReleaseContextRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1394        const _ret = WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.addListener(A.H.get<object>(callback));
  1395      },
  1396      "try_OnReleaseContextRequested": (
  1397        retPtr: Pointer,
  1398        errPtr: Pointer,
  1399        callback: heap.Ref<object>
  1400      ): heap.Ref<boolean> => {
  1401        try {
  1402          const _ret = WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.addListener(A.H.get<object>(callback));
  1403          return A.H.TRUE;
  1404        } catch (err: any) {
  1405          A.store.Ref(errPtr, err);
  1406          return A.H.FALSE;
  1407        }
  1408      },
  1409      "has_OffReleaseContextRequested": (): heap.Ref<boolean> => {
  1410        if (
  1411          WEBEXT?.smartCardProviderPrivate?.onReleaseContextRequested &&
  1412          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onReleaseContextRequested
  1413        ) {
  1414          return A.H.TRUE;
  1415        }
  1416        return A.H.FALSE;
  1417      },
  1418      "func_OffReleaseContextRequested": (fn: Pointer): void => {
  1419        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.removeListener);
  1420      },
  1421      "call_OffReleaseContextRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1422        const _ret = WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.removeListener(A.H.get<object>(callback));
  1423      },
  1424      "try_OffReleaseContextRequested": (
  1425        retPtr: Pointer,
  1426        errPtr: Pointer,
  1427        callback: heap.Ref<object>
  1428      ): heap.Ref<boolean> => {
  1429        try {
  1430          const _ret = WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.removeListener(
  1431            A.H.get<object>(callback)
  1432          );
  1433          return A.H.TRUE;
  1434        } catch (err: any) {
  1435          A.store.Ref(errPtr, err);
  1436          return A.H.FALSE;
  1437        }
  1438      },
  1439      "has_HasOnReleaseContextRequested": (): heap.Ref<boolean> => {
  1440        if (
  1441          WEBEXT?.smartCardProviderPrivate?.onReleaseContextRequested &&
  1442          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onReleaseContextRequested
  1443        ) {
  1444          return A.H.TRUE;
  1445        }
  1446        return A.H.FALSE;
  1447      },
  1448      "func_HasOnReleaseContextRequested": (fn: Pointer): void => {
  1449        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.hasListener);
  1450      },
  1451      "call_HasOnReleaseContextRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1452        const _ret = WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.hasListener(A.H.get<object>(callback));
  1453        A.store.Bool(retPtr, _ret);
  1454      },
  1455      "try_HasOnReleaseContextRequested": (
  1456        retPtr: Pointer,
  1457        errPtr: Pointer,
  1458        callback: heap.Ref<object>
  1459      ): heap.Ref<boolean> => {
  1460        try {
  1461          const _ret = WEBEXT.smartCardProviderPrivate.onReleaseContextRequested.hasListener(A.H.get<object>(callback));
  1462          A.store.Bool(retPtr, _ret);
  1463          return A.H.TRUE;
  1464        } catch (err: any) {
  1465          A.store.Ref(errPtr, err);
  1466          return A.H.FALSE;
  1467        }
  1468      },
  1469      "has_OnSetAttribRequested": (): heap.Ref<boolean> => {
  1470        if (
  1471          WEBEXT?.smartCardProviderPrivate?.onSetAttribRequested &&
  1472          "addListener" in WEBEXT?.smartCardProviderPrivate?.onSetAttribRequested
  1473        ) {
  1474          return A.H.TRUE;
  1475        }
  1476        return A.H.FALSE;
  1477      },
  1478      "func_OnSetAttribRequested": (fn: Pointer): void => {
  1479        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onSetAttribRequested.addListener);
  1480      },
  1481      "call_OnSetAttribRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1482        const _ret = WEBEXT.smartCardProviderPrivate.onSetAttribRequested.addListener(A.H.get<object>(callback));
  1483      },
  1484      "try_OnSetAttribRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1485        try {
  1486          const _ret = WEBEXT.smartCardProviderPrivate.onSetAttribRequested.addListener(A.H.get<object>(callback));
  1487          return A.H.TRUE;
  1488        } catch (err: any) {
  1489          A.store.Ref(errPtr, err);
  1490          return A.H.FALSE;
  1491        }
  1492      },
  1493      "has_OffSetAttribRequested": (): heap.Ref<boolean> => {
  1494        if (
  1495          WEBEXT?.smartCardProviderPrivate?.onSetAttribRequested &&
  1496          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onSetAttribRequested
  1497        ) {
  1498          return A.H.TRUE;
  1499        }
  1500        return A.H.FALSE;
  1501      },
  1502      "func_OffSetAttribRequested": (fn: Pointer): void => {
  1503        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onSetAttribRequested.removeListener);
  1504      },
  1505      "call_OffSetAttribRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1506        const _ret = WEBEXT.smartCardProviderPrivate.onSetAttribRequested.removeListener(A.H.get<object>(callback));
  1507      },
  1508      "try_OffSetAttribRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1509        try {
  1510          const _ret = WEBEXT.smartCardProviderPrivate.onSetAttribRequested.removeListener(A.H.get<object>(callback));
  1511          return A.H.TRUE;
  1512        } catch (err: any) {
  1513          A.store.Ref(errPtr, err);
  1514          return A.H.FALSE;
  1515        }
  1516      },
  1517      "has_HasOnSetAttribRequested": (): heap.Ref<boolean> => {
  1518        if (
  1519          WEBEXT?.smartCardProviderPrivate?.onSetAttribRequested &&
  1520          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onSetAttribRequested
  1521        ) {
  1522          return A.H.TRUE;
  1523        }
  1524        return A.H.FALSE;
  1525      },
  1526      "func_HasOnSetAttribRequested": (fn: Pointer): void => {
  1527        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onSetAttribRequested.hasListener);
  1528      },
  1529      "call_HasOnSetAttribRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1530        const _ret = WEBEXT.smartCardProviderPrivate.onSetAttribRequested.hasListener(A.H.get<object>(callback));
  1531        A.store.Bool(retPtr, _ret);
  1532      },
  1533      "try_HasOnSetAttribRequested": (
  1534        retPtr: Pointer,
  1535        errPtr: Pointer,
  1536        callback: heap.Ref<object>
  1537      ): heap.Ref<boolean> => {
  1538        try {
  1539          const _ret = WEBEXT.smartCardProviderPrivate.onSetAttribRequested.hasListener(A.H.get<object>(callback));
  1540          A.store.Bool(retPtr, _ret);
  1541          return A.H.TRUE;
  1542        } catch (err: any) {
  1543          A.store.Ref(errPtr, err);
  1544          return A.H.FALSE;
  1545        }
  1546      },
  1547      "has_OnStatusRequested": (): heap.Ref<boolean> => {
  1548        if (
  1549          WEBEXT?.smartCardProviderPrivate?.onStatusRequested &&
  1550          "addListener" in WEBEXT?.smartCardProviderPrivate?.onStatusRequested
  1551        ) {
  1552          return A.H.TRUE;
  1553        }
  1554        return A.H.FALSE;
  1555      },
  1556      "func_OnStatusRequested": (fn: Pointer): void => {
  1557        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onStatusRequested.addListener);
  1558      },
  1559      "call_OnStatusRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1560        const _ret = WEBEXT.smartCardProviderPrivate.onStatusRequested.addListener(A.H.get<object>(callback));
  1561      },
  1562      "try_OnStatusRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1563        try {
  1564          const _ret = WEBEXT.smartCardProviderPrivate.onStatusRequested.addListener(A.H.get<object>(callback));
  1565          return A.H.TRUE;
  1566        } catch (err: any) {
  1567          A.store.Ref(errPtr, err);
  1568          return A.H.FALSE;
  1569        }
  1570      },
  1571      "has_OffStatusRequested": (): heap.Ref<boolean> => {
  1572        if (
  1573          WEBEXT?.smartCardProviderPrivate?.onStatusRequested &&
  1574          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onStatusRequested
  1575        ) {
  1576          return A.H.TRUE;
  1577        }
  1578        return A.H.FALSE;
  1579      },
  1580      "func_OffStatusRequested": (fn: Pointer): void => {
  1581        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onStatusRequested.removeListener);
  1582      },
  1583      "call_OffStatusRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1584        const _ret = WEBEXT.smartCardProviderPrivate.onStatusRequested.removeListener(A.H.get<object>(callback));
  1585      },
  1586      "try_OffStatusRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1587        try {
  1588          const _ret = WEBEXT.smartCardProviderPrivate.onStatusRequested.removeListener(A.H.get<object>(callback));
  1589          return A.H.TRUE;
  1590        } catch (err: any) {
  1591          A.store.Ref(errPtr, err);
  1592          return A.H.FALSE;
  1593        }
  1594      },
  1595      "has_HasOnStatusRequested": (): heap.Ref<boolean> => {
  1596        if (
  1597          WEBEXT?.smartCardProviderPrivate?.onStatusRequested &&
  1598          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onStatusRequested
  1599        ) {
  1600          return A.H.TRUE;
  1601        }
  1602        return A.H.FALSE;
  1603      },
  1604      "func_HasOnStatusRequested": (fn: Pointer): void => {
  1605        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onStatusRequested.hasListener);
  1606      },
  1607      "call_HasOnStatusRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1608        const _ret = WEBEXT.smartCardProviderPrivate.onStatusRequested.hasListener(A.H.get<object>(callback));
  1609        A.store.Bool(retPtr, _ret);
  1610      },
  1611      "try_HasOnStatusRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1612        try {
  1613          const _ret = WEBEXT.smartCardProviderPrivate.onStatusRequested.hasListener(A.H.get<object>(callback));
  1614          A.store.Bool(retPtr, _ret);
  1615          return A.H.TRUE;
  1616        } catch (err: any) {
  1617          A.store.Ref(errPtr, err);
  1618          return A.H.FALSE;
  1619        }
  1620      },
  1621      "has_OnTransmitRequested": (): heap.Ref<boolean> => {
  1622        if (
  1623          WEBEXT?.smartCardProviderPrivate?.onTransmitRequested &&
  1624          "addListener" in WEBEXT?.smartCardProviderPrivate?.onTransmitRequested
  1625        ) {
  1626          return A.H.TRUE;
  1627        }
  1628        return A.H.FALSE;
  1629      },
  1630      "func_OnTransmitRequested": (fn: Pointer): void => {
  1631        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onTransmitRequested.addListener);
  1632      },
  1633      "call_OnTransmitRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1634        const _ret = WEBEXT.smartCardProviderPrivate.onTransmitRequested.addListener(A.H.get<object>(callback));
  1635      },
  1636      "try_OnTransmitRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1637        try {
  1638          const _ret = WEBEXT.smartCardProviderPrivate.onTransmitRequested.addListener(A.H.get<object>(callback));
  1639          return A.H.TRUE;
  1640        } catch (err: any) {
  1641          A.store.Ref(errPtr, err);
  1642          return A.H.FALSE;
  1643        }
  1644      },
  1645      "has_OffTransmitRequested": (): heap.Ref<boolean> => {
  1646        if (
  1647          WEBEXT?.smartCardProviderPrivate?.onTransmitRequested &&
  1648          "removeListener" in WEBEXT?.smartCardProviderPrivate?.onTransmitRequested
  1649        ) {
  1650          return A.H.TRUE;
  1651        }
  1652        return A.H.FALSE;
  1653      },
  1654      "func_OffTransmitRequested": (fn: Pointer): void => {
  1655        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onTransmitRequested.removeListener);
  1656      },
  1657      "call_OffTransmitRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1658        const _ret = WEBEXT.smartCardProviderPrivate.onTransmitRequested.removeListener(A.H.get<object>(callback));
  1659      },
  1660      "try_OffTransmitRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1661        try {
  1662          const _ret = WEBEXT.smartCardProviderPrivate.onTransmitRequested.removeListener(A.H.get<object>(callback));
  1663          return A.H.TRUE;
  1664        } catch (err: any) {
  1665          A.store.Ref(errPtr, err);
  1666          return A.H.FALSE;
  1667        }
  1668      },
  1669      "has_HasOnTransmitRequested": (): heap.Ref<boolean> => {
  1670        if (
  1671          WEBEXT?.smartCardProviderPrivate?.onTransmitRequested &&
  1672          "hasListener" in WEBEXT?.smartCardProviderPrivate?.onTransmitRequested
  1673        ) {
  1674          return A.H.TRUE;
  1675        }
  1676        return A.H.FALSE;
  1677      },
  1678      "func_HasOnTransmitRequested": (fn: Pointer): void => {
  1679        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.onTransmitRequested.hasListener);
  1680      },
  1681      "call_HasOnTransmitRequested": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1682        const _ret = WEBEXT.smartCardProviderPrivate.onTransmitRequested.hasListener(A.H.get<object>(callback));
  1683        A.store.Bool(retPtr, _ret);
  1684      },
  1685      "try_HasOnTransmitRequested": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1686        try {
  1687          const _ret = WEBEXT.smartCardProviderPrivate.onTransmitRequested.hasListener(A.H.get<object>(callback));
  1688          A.store.Bool(retPtr, _ret);
  1689          return A.H.TRUE;
  1690        } catch (err: any) {
  1691          A.store.Ref(errPtr, err);
  1692          return A.H.FALSE;
  1693        }
  1694      },
  1695      "has_ReportConnectResult": (): heap.Ref<boolean> => {
  1696        if (WEBEXT?.smartCardProviderPrivate && "reportConnectResult" in WEBEXT?.smartCardProviderPrivate) {
  1697          return A.H.TRUE;
  1698        }
  1699        return A.H.FALSE;
  1700      },
  1701      "func_ReportConnectResult": (fn: Pointer): void => {
  1702        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.reportConnectResult);
  1703      },
  1704      "call_ReportConnectResult": (
  1705        retPtr: Pointer,
  1706        requestId: number,
  1707        scardHandle: number,
  1708        activeProtocol: number,
  1709        resultCode: number
  1710      ): void => {
  1711        const _ret = WEBEXT.smartCardProviderPrivate.reportConnectResult(
  1712          requestId,
  1713          scardHandle,
  1714          activeProtocol > 0 && activeProtocol <= 4 ? ["UNDEFINED", "T0", "T1", "RAW"][activeProtocol - 1] : undefined,
  1715          resultCode > 0 && resultCode <= 32
  1716            ? [
  1717                "SUCCESS",
  1718                "REMOVED_CARD",
  1719                "RESET_CARD",
  1720                "UNPOWERED_CARD",
  1721                "UNRESPONSIVE_CARD",
  1722                "UNSUPPORTED_CARD",
  1723                "READER_UNAVAILABLE",
  1724                "SHARING_VIOLATION",
  1725                "NOT_TRANSACTED",
  1726                "NO_SMARTCARD",
  1727                "PROTO_MISMATCH",
  1728                "SYSTEM_CANCELLED",
  1729                "NOT_READY",
  1730                "CANCELLED",
  1731                "INSUFFICIENT_BUFFER",
  1732                "INVALID_HANDLE",
  1733                "INVALID_PARAMETER",
  1734                "INVALID_VALUE",
  1735                "NO_MEMORY",
  1736                "TIMEOUT",
  1737                "UNKNOWN_READER",
  1738                "UNSUPPORTED_FEATURE",
  1739                "NO_READERS_AVAILABLE",
  1740                "SERVICE_STOPPED",
  1741                "NO_SERVICE",
  1742                "COMM_ERROR",
  1743                "INTERNAL_ERROR",
  1744                "UNKNOWN_ERROR",
  1745                "SERVER_TOO_BUSY",
  1746                "UNEXPECTED",
  1747                "SHUTDOWN",
  1748                "UNKNOWN",
  1749              ][resultCode - 1]
  1750            : undefined
  1751        );
  1752      },
  1753      "try_ReportConnectResult": (
  1754        retPtr: Pointer,
  1755        errPtr: Pointer,
  1756        requestId: number,
  1757        scardHandle: number,
  1758        activeProtocol: number,
  1759        resultCode: number
  1760      ): heap.Ref<boolean> => {
  1761        try {
  1762          const _ret = WEBEXT.smartCardProviderPrivate.reportConnectResult(
  1763            requestId,
  1764            scardHandle,
  1765            activeProtocol > 0 && activeProtocol <= 4 ? ["UNDEFINED", "T0", "T1", "RAW"][activeProtocol - 1] : undefined,
  1766            resultCode > 0 && resultCode <= 32
  1767              ? [
  1768                  "SUCCESS",
  1769                  "REMOVED_CARD",
  1770                  "RESET_CARD",
  1771                  "UNPOWERED_CARD",
  1772                  "UNRESPONSIVE_CARD",
  1773                  "UNSUPPORTED_CARD",
  1774                  "READER_UNAVAILABLE",
  1775                  "SHARING_VIOLATION",
  1776                  "NOT_TRANSACTED",
  1777                  "NO_SMARTCARD",
  1778                  "PROTO_MISMATCH",
  1779                  "SYSTEM_CANCELLED",
  1780                  "NOT_READY",
  1781                  "CANCELLED",
  1782                  "INSUFFICIENT_BUFFER",
  1783                  "INVALID_HANDLE",
  1784                  "INVALID_PARAMETER",
  1785                  "INVALID_VALUE",
  1786                  "NO_MEMORY",
  1787                  "TIMEOUT",
  1788                  "UNKNOWN_READER",
  1789                  "UNSUPPORTED_FEATURE",
  1790                  "NO_READERS_AVAILABLE",
  1791                  "SERVICE_STOPPED",
  1792                  "NO_SERVICE",
  1793                  "COMM_ERROR",
  1794                  "INTERNAL_ERROR",
  1795                  "UNKNOWN_ERROR",
  1796                  "SERVER_TOO_BUSY",
  1797                  "UNEXPECTED",
  1798                  "SHUTDOWN",
  1799                  "UNKNOWN",
  1800                ][resultCode - 1]
  1801              : undefined
  1802          );
  1803          return A.H.TRUE;
  1804        } catch (err: any) {
  1805          A.store.Ref(errPtr, err);
  1806          return A.H.FALSE;
  1807        }
  1808      },
  1809      "has_ReportDataResult": (): heap.Ref<boolean> => {
  1810        if (WEBEXT?.smartCardProviderPrivate && "reportDataResult" in WEBEXT?.smartCardProviderPrivate) {
  1811          return A.H.TRUE;
  1812        }
  1813        return A.H.FALSE;
  1814      },
  1815      "func_ReportDataResult": (fn: Pointer): void => {
  1816        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.reportDataResult);
  1817      },
  1818      "call_ReportDataResult": (retPtr: Pointer, requestId: number, data: heap.Ref<object>, resultCode: number): void => {
  1819        const _ret = WEBEXT.smartCardProviderPrivate.reportDataResult(
  1820          requestId,
  1821          A.H.get<object>(data),
  1822          resultCode > 0 && resultCode <= 32
  1823            ? [
  1824                "SUCCESS",
  1825                "REMOVED_CARD",
  1826                "RESET_CARD",
  1827                "UNPOWERED_CARD",
  1828                "UNRESPONSIVE_CARD",
  1829                "UNSUPPORTED_CARD",
  1830                "READER_UNAVAILABLE",
  1831                "SHARING_VIOLATION",
  1832                "NOT_TRANSACTED",
  1833                "NO_SMARTCARD",
  1834                "PROTO_MISMATCH",
  1835                "SYSTEM_CANCELLED",
  1836                "NOT_READY",
  1837                "CANCELLED",
  1838                "INSUFFICIENT_BUFFER",
  1839                "INVALID_HANDLE",
  1840                "INVALID_PARAMETER",
  1841                "INVALID_VALUE",
  1842                "NO_MEMORY",
  1843                "TIMEOUT",
  1844                "UNKNOWN_READER",
  1845                "UNSUPPORTED_FEATURE",
  1846                "NO_READERS_AVAILABLE",
  1847                "SERVICE_STOPPED",
  1848                "NO_SERVICE",
  1849                "COMM_ERROR",
  1850                "INTERNAL_ERROR",
  1851                "UNKNOWN_ERROR",
  1852                "SERVER_TOO_BUSY",
  1853                "UNEXPECTED",
  1854                "SHUTDOWN",
  1855                "UNKNOWN",
  1856              ][resultCode - 1]
  1857            : undefined
  1858        );
  1859      },
  1860      "try_ReportDataResult": (
  1861        retPtr: Pointer,
  1862        errPtr: Pointer,
  1863        requestId: number,
  1864        data: heap.Ref<object>,
  1865        resultCode: number
  1866      ): heap.Ref<boolean> => {
  1867        try {
  1868          const _ret = WEBEXT.smartCardProviderPrivate.reportDataResult(
  1869            requestId,
  1870            A.H.get<object>(data),
  1871            resultCode > 0 && resultCode <= 32
  1872              ? [
  1873                  "SUCCESS",
  1874                  "REMOVED_CARD",
  1875                  "RESET_CARD",
  1876                  "UNPOWERED_CARD",
  1877                  "UNRESPONSIVE_CARD",
  1878                  "UNSUPPORTED_CARD",
  1879                  "READER_UNAVAILABLE",
  1880                  "SHARING_VIOLATION",
  1881                  "NOT_TRANSACTED",
  1882                  "NO_SMARTCARD",
  1883                  "PROTO_MISMATCH",
  1884                  "SYSTEM_CANCELLED",
  1885                  "NOT_READY",
  1886                  "CANCELLED",
  1887                  "INSUFFICIENT_BUFFER",
  1888                  "INVALID_HANDLE",
  1889                  "INVALID_PARAMETER",
  1890                  "INVALID_VALUE",
  1891                  "NO_MEMORY",
  1892                  "TIMEOUT",
  1893                  "UNKNOWN_READER",
  1894                  "UNSUPPORTED_FEATURE",
  1895                  "NO_READERS_AVAILABLE",
  1896                  "SERVICE_STOPPED",
  1897                  "NO_SERVICE",
  1898                  "COMM_ERROR",
  1899                  "INTERNAL_ERROR",
  1900                  "UNKNOWN_ERROR",
  1901                  "SERVER_TOO_BUSY",
  1902                  "UNEXPECTED",
  1903                  "SHUTDOWN",
  1904                  "UNKNOWN",
  1905                ][resultCode - 1]
  1906              : undefined
  1907          );
  1908          return A.H.TRUE;
  1909        } catch (err: any) {
  1910          A.store.Ref(errPtr, err);
  1911          return A.H.FALSE;
  1912        }
  1913      },
  1914      "has_ReportEstablishContextResult": (): heap.Ref<boolean> => {
  1915        if (WEBEXT?.smartCardProviderPrivate && "reportEstablishContextResult" in WEBEXT?.smartCardProviderPrivate) {
  1916          return A.H.TRUE;
  1917        }
  1918        return A.H.FALSE;
  1919      },
  1920      "func_ReportEstablishContextResult": (fn: Pointer): void => {
  1921        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.reportEstablishContextResult);
  1922      },
  1923      "call_ReportEstablishContextResult": (
  1924        retPtr: Pointer,
  1925        requestId: number,
  1926        scardContext: number,
  1927        resultCode: number
  1928      ): void => {
  1929        const _ret = WEBEXT.smartCardProviderPrivate.reportEstablishContextResult(
  1930          requestId,
  1931          scardContext,
  1932          resultCode > 0 && resultCode <= 32
  1933            ? [
  1934                "SUCCESS",
  1935                "REMOVED_CARD",
  1936                "RESET_CARD",
  1937                "UNPOWERED_CARD",
  1938                "UNRESPONSIVE_CARD",
  1939                "UNSUPPORTED_CARD",
  1940                "READER_UNAVAILABLE",
  1941                "SHARING_VIOLATION",
  1942                "NOT_TRANSACTED",
  1943                "NO_SMARTCARD",
  1944                "PROTO_MISMATCH",
  1945                "SYSTEM_CANCELLED",
  1946                "NOT_READY",
  1947                "CANCELLED",
  1948                "INSUFFICIENT_BUFFER",
  1949                "INVALID_HANDLE",
  1950                "INVALID_PARAMETER",
  1951                "INVALID_VALUE",
  1952                "NO_MEMORY",
  1953                "TIMEOUT",
  1954                "UNKNOWN_READER",
  1955                "UNSUPPORTED_FEATURE",
  1956                "NO_READERS_AVAILABLE",
  1957                "SERVICE_STOPPED",
  1958                "NO_SERVICE",
  1959                "COMM_ERROR",
  1960                "INTERNAL_ERROR",
  1961                "UNKNOWN_ERROR",
  1962                "SERVER_TOO_BUSY",
  1963                "UNEXPECTED",
  1964                "SHUTDOWN",
  1965                "UNKNOWN",
  1966              ][resultCode - 1]
  1967            : undefined
  1968        );
  1969      },
  1970      "try_ReportEstablishContextResult": (
  1971        retPtr: Pointer,
  1972        errPtr: Pointer,
  1973        requestId: number,
  1974        scardContext: number,
  1975        resultCode: number
  1976      ): heap.Ref<boolean> => {
  1977        try {
  1978          const _ret = WEBEXT.smartCardProviderPrivate.reportEstablishContextResult(
  1979            requestId,
  1980            scardContext,
  1981            resultCode > 0 && resultCode <= 32
  1982              ? [
  1983                  "SUCCESS",
  1984                  "REMOVED_CARD",
  1985                  "RESET_CARD",
  1986                  "UNPOWERED_CARD",
  1987                  "UNRESPONSIVE_CARD",
  1988                  "UNSUPPORTED_CARD",
  1989                  "READER_UNAVAILABLE",
  1990                  "SHARING_VIOLATION",
  1991                  "NOT_TRANSACTED",
  1992                  "NO_SMARTCARD",
  1993                  "PROTO_MISMATCH",
  1994                  "SYSTEM_CANCELLED",
  1995                  "NOT_READY",
  1996                  "CANCELLED",
  1997                  "INSUFFICIENT_BUFFER",
  1998                  "INVALID_HANDLE",
  1999                  "INVALID_PARAMETER",
  2000                  "INVALID_VALUE",
  2001                  "NO_MEMORY",
  2002                  "TIMEOUT",
  2003                  "UNKNOWN_READER",
  2004                  "UNSUPPORTED_FEATURE",
  2005                  "NO_READERS_AVAILABLE",
  2006                  "SERVICE_STOPPED",
  2007                  "NO_SERVICE",
  2008                  "COMM_ERROR",
  2009                  "INTERNAL_ERROR",
  2010                  "UNKNOWN_ERROR",
  2011                  "SERVER_TOO_BUSY",
  2012                  "UNEXPECTED",
  2013                  "SHUTDOWN",
  2014                  "UNKNOWN",
  2015                ][resultCode - 1]
  2016              : undefined
  2017          );
  2018          return A.H.TRUE;
  2019        } catch (err: any) {
  2020          A.store.Ref(errPtr, err);
  2021          return A.H.FALSE;
  2022        }
  2023      },
  2024      "has_ReportGetStatusChangeResult": (): heap.Ref<boolean> => {
  2025        if (WEBEXT?.smartCardProviderPrivate && "reportGetStatusChangeResult" in WEBEXT?.smartCardProviderPrivate) {
  2026          return A.H.TRUE;
  2027        }
  2028        return A.H.FALSE;
  2029      },
  2030      "func_ReportGetStatusChangeResult": (fn: Pointer): void => {
  2031        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.reportGetStatusChangeResult);
  2032      },
  2033      "call_ReportGetStatusChangeResult": (
  2034        retPtr: Pointer,
  2035        requestId: number,
  2036        readerStates: heap.Ref<object>,
  2037        resultCode: number
  2038      ): void => {
  2039        const _ret = WEBEXT.smartCardProviderPrivate.reportGetStatusChangeResult(
  2040          requestId,
  2041          A.H.get<object>(readerStates),
  2042          resultCode > 0 && resultCode <= 32
  2043            ? [
  2044                "SUCCESS",
  2045                "REMOVED_CARD",
  2046                "RESET_CARD",
  2047                "UNPOWERED_CARD",
  2048                "UNRESPONSIVE_CARD",
  2049                "UNSUPPORTED_CARD",
  2050                "READER_UNAVAILABLE",
  2051                "SHARING_VIOLATION",
  2052                "NOT_TRANSACTED",
  2053                "NO_SMARTCARD",
  2054                "PROTO_MISMATCH",
  2055                "SYSTEM_CANCELLED",
  2056                "NOT_READY",
  2057                "CANCELLED",
  2058                "INSUFFICIENT_BUFFER",
  2059                "INVALID_HANDLE",
  2060                "INVALID_PARAMETER",
  2061                "INVALID_VALUE",
  2062                "NO_MEMORY",
  2063                "TIMEOUT",
  2064                "UNKNOWN_READER",
  2065                "UNSUPPORTED_FEATURE",
  2066                "NO_READERS_AVAILABLE",
  2067                "SERVICE_STOPPED",
  2068                "NO_SERVICE",
  2069                "COMM_ERROR",
  2070                "INTERNAL_ERROR",
  2071                "UNKNOWN_ERROR",
  2072                "SERVER_TOO_BUSY",
  2073                "UNEXPECTED",
  2074                "SHUTDOWN",
  2075                "UNKNOWN",
  2076              ][resultCode - 1]
  2077            : undefined
  2078        );
  2079      },
  2080      "try_ReportGetStatusChangeResult": (
  2081        retPtr: Pointer,
  2082        errPtr: Pointer,
  2083        requestId: number,
  2084        readerStates: heap.Ref<object>,
  2085        resultCode: number
  2086      ): heap.Ref<boolean> => {
  2087        try {
  2088          const _ret = WEBEXT.smartCardProviderPrivate.reportGetStatusChangeResult(
  2089            requestId,
  2090            A.H.get<object>(readerStates),
  2091            resultCode > 0 && resultCode <= 32
  2092              ? [
  2093                  "SUCCESS",
  2094                  "REMOVED_CARD",
  2095                  "RESET_CARD",
  2096                  "UNPOWERED_CARD",
  2097                  "UNRESPONSIVE_CARD",
  2098                  "UNSUPPORTED_CARD",
  2099                  "READER_UNAVAILABLE",
  2100                  "SHARING_VIOLATION",
  2101                  "NOT_TRANSACTED",
  2102                  "NO_SMARTCARD",
  2103                  "PROTO_MISMATCH",
  2104                  "SYSTEM_CANCELLED",
  2105                  "NOT_READY",
  2106                  "CANCELLED",
  2107                  "INSUFFICIENT_BUFFER",
  2108                  "INVALID_HANDLE",
  2109                  "INVALID_PARAMETER",
  2110                  "INVALID_VALUE",
  2111                  "NO_MEMORY",
  2112                  "TIMEOUT",
  2113                  "UNKNOWN_READER",
  2114                  "UNSUPPORTED_FEATURE",
  2115                  "NO_READERS_AVAILABLE",
  2116                  "SERVICE_STOPPED",
  2117                  "NO_SERVICE",
  2118                  "COMM_ERROR",
  2119                  "INTERNAL_ERROR",
  2120                  "UNKNOWN_ERROR",
  2121                  "SERVER_TOO_BUSY",
  2122                  "UNEXPECTED",
  2123                  "SHUTDOWN",
  2124                  "UNKNOWN",
  2125                ][resultCode - 1]
  2126              : undefined
  2127          );
  2128          return A.H.TRUE;
  2129        } catch (err: any) {
  2130          A.store.Ref(errPtr, err);
  2131          return A.H.FALSE;
  2132        }
  2133      },
  2134      "has_ReportListReadersResult": (): heap.Ref<boolean> => {
  2135        if (WEBEXT?.smartCardProviderPrivate && "reportListReadersResult" in WEBEXT?.smartCardProviderPrivate) {
  2136          return A.H.TRUE;
  2137        }
  2138        return A.H.FALSE;
  2139      },
  2140      "func_ReportListReadersResult": (fn: Pointer): void => {
  2141        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.reportListReadersResult);
  2142      },
  2143      "call_ReportListReadersResult": (
  2144        retPtr: Pointer,
  2145        requestId: number,
  2146        readers: heap.Ref<object>,
  2147        resultCode: number
  2148      ): void => {
  2149        const _ret = WEBEXT.smartCardProviderPrivate.reportListReadersResult(
  2150          requestId,
  2151          A.H.get<object>(readers),
  2152          resultCode > 0 && resultCode <= 32
  2153            ? [
  2154                "SUCCESS",
  2155                "REMOVED_CARD",
  2156                "RESET_CARD",
  2157                "UNPOWERED_CARD",
  2158                "UNRESPONSIVE_CARD",
  2159                "UNSUPPORTED_CARD",
  2160                "READER_UNAVAILABLE",
  2161                "SHARING_VIOLATION",
  2162                "NOT_TRANSACTED",
  2163                "NO_SMARTCARD",
  2164                "PROTO_MISMATCH",
  2165                "SYSTEM_CANCELLED",
  2166                "NOT_READY",
  2167                "CANCELLED",
  2168                "INSUFFICIENT_BUFFER",
  2169                "INVALID_HANDLE",
  2170                "INVALID_PARAMETER",
  2171                "INVALID_VALUE",
  2172                "NO_MEMORY",
  2173                "TIMEOUT",
  2174                "UNKNOWN_READER",
  2175                "UNSUPPORTED_FEATURE",
  2176                "NO_READERS_AVAILABLE",
  2177                "SERVICE_STOPPED",
  2178                "NO_SERVICE",
  2179                "COMM_ERROR",
  2180                "INTERNAL_ERROR",
  2181                "UNKNOWN_ERROR",
  2182                "SERVER_TOO_BUSY",
  2183                "UNEXPECTED",
  2184                "SHUTDOWN",
  2185                "UNKNOWN",
  2186              ][resultCode - 1]
  2187            : undefined
  2188        );
  2189      },
  2190      "try_ReportListReadersResult": (
  2191        retPtr: Pointer,
  2192        errPtr: Pointer,
  2193        requestId: number,
  2194        readers: heap.Ref<object>,
  2195        resultCode: number
  2196      ): heap.Ref<boolean> => {
  2197        try {
  2198          const _ret = WEBEXT.smartCardProviderPrivate.reportListReadersResult(
  2199            requestId,
  2200            A.H.get<object>(readers),
  2201            resultCode > 0 && resultCode <= 32
  2202              ? [
  2203                  "SUCCESS",
  2204                  "REMOVED_CARD",
  2205                  "RESET_CARD",
  2206                  "UNPOWERED_CARD",
  2207                  "UNRESPONSIVE_CARD",
  2208                  "UNSUPPORTED_CARD",
  2209                  "READER_UNAVAILABLE",
  2210                  "SHARING_VIOLATION",
  2211                  "NOT_TRANSACTED",
  2212                  "NO_SMARTCARD",
  2213                  "PROTO_MISMATCH",
  2214                  "SYSTEM_CANCELLED",
  2215                  "NOT_READY",
  2216                  "CANCELLED",
  2217                  "INSUFFICIENT_BUFFER",
  2218                  "INVALID_HANDLE",
  2219                  "INVALID_PARAMETER",
  2220                  "INVALID_VALUE",
  2221                  "NO_MEMORY",
  2222                  "TIMEOUT",
  2223                  "UNKNOWN_READER",
  2224                  "UNSUPPORTED_FEATURE",
  2225                  "NO_READERS_AVAILABLE",
  2226                  "SERVICE_STOPPED",
  2227                  "NO_SERVICE",
  2228                  "COMM_ERROR",
  2229                  "INTERNAL_ERROR",
  2230                  "UNKNOWN_ERROR",
  2231                  "SERVER_TOO_BUSY",
  2232                  "UNEXPECTED",
  2233                  "SHUTDOWN",
  2234                  "UNKNOWN",
  2235                ][resultCode - 1]
  2236              : undefined
  2237          );
  2238          return A.H.TRUE;
  2239        } catch (err: any) {
  2240          A.store.Ref(errPtr, err);
  2241          return A.H.FALSE;
  2242        }
  2243      },
  2244      "has_ReportPlainResult": (): heap.Ref<boolean> => {
  2245        if (WEBEXT?.smartCardProviderPrivate && "reportPlainResult" in WEBEXT?.smartCardProviderPrivate) {
  2246          return A.H.TRUE;
  2247        }
  2248        return A.H.FALSE;
  2249      },
  2250      "func_ReportPlainResult": (fn: Pointer): void => {
  2251        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.reportPlainResult);
  2252      },
  2253      "call_ReportPlainResult": (retPtr: Pointer, requestId: number, resultCode: number): void => {
  2254        const _ret = WEBEXT.smartCardProviderPrivate.reportPlainResult(
  2255          requestId,
  2256          resultCode > 0 && resultCode <= 32
  2257            ? [
  2258                "SUCCESS",
  2259                "REMOVED_CARD",
  2260                "RESET_CARD",
  2261                "UNPOWERED_CARD",
  2262                "UNRESPONSIVE_CARD",
  2263                "UNSUPPORTED_CARD",
  2264                "READER_UNAVAILABLE",
  2265                "SHARING_VIOLATION",
  2266                "NOT_TRANSACTED",
  2267                "NO_SMARTCARD",
  2268                "PROTO_MISMATCH",
  2269                "SYSTEM_CANCELLED",
  2270                "NOT_READY",
  2271                "CANCELLED",
  2272                "INSUFFICIENT_BUFFER",
  2273                "INVALID_HANDLE",
  2274                "INVALID_PARAMETER",
  2275                "INVALID_VALUE",
  2276                "NO_MEMORY",
  2277                "TIMEOUT",
  2278                "UNKNOWN_READER",
  2279                "UNSUPPORTED_FEATURE",
  2280                "NO_READERS_AVAILABLE",
  2281                "SERVICE_STOPPED",
  2282                "NO_SERVICE",
  2283                "COMM_ERROR",
  2284                "INTERNAL_ERROR",
  2285                "UNKNOWN_ERROR",
  2286                "SERVER_TOO_BUSY",
  2287                "UNEXPECTED",
  2288                "SHUTDOWN",
  2289                "UNKNOWN",
  2290              ][resultCode - 1]
  2291            : undefined
  2292        );
  2293      },
  2294      "try_ReportPlainResult": (
  2295        retPtr: Pointer,
  2296        errPtr: Pointer,
  2297        requestId: number,
  2298        resultCode: number
  2299      ): heap.Ref<boolean> => {
  2300        try {
  2301          const _ret = WEBEXT.smartCardProviderPrivate.reportPlainResult(
  2302            requestId,
  2303            resultCode > 0 && resultCode <= 32
  2304              ? [
  2305                  "SUCCESS",
  2306                  "REMOVED_CARD",
  2307                  "RESET_CARD",
  2308                  "UNPOWERED_CARD",
  2309                  "UNRESPONSIVE_CARD",
  2310                  "UNSUPPORTED_CARD",
  2311                  "READER_UNAVAILABLE",
  2312                  "SHARING_VIOLATION",
  2313                  "NOT_TRANSACTED",
  2314                  "NO_SMARTCARD",
  2315                  "PROTO_MISMATCH",
  2316                  "SYSTEM_CANCELLED",
  2317                  "NOT_READY",
  2318                  "CANCELLED",
  2319                  "INSUFFICIENT_BUFFER",
  2320                  "INVALID_HANDLE",
  2321                  "INVALID_PARAMETER",
  2322                  "INVALID_VALUE",
  2323                  "NO_MEMORY",
  2324                  "TIMEOUT",
  2325                  "UNKNOWN_READER",
  2326                  "UNSUPPORTED_FEATURE",
  2327                  "NO_READERS_AVAILABLE",
  2328                  "SERVICE_STOPPED",
  2329                  "NO_SERVICE",
  2330                  "COMM_ERROR",
  2331                  "INTERNAL_ERROR",
  2332                  "UNKNOWN_ERROR",
  2333                  "SERVER_TOO_BUSY",
  2334                  "UNEXPECTED",
  2335                  "SHUTDOWN",
  2336                  "UNKNOWN",
  2337                ][resultCode - 1]
  2338              : undefined
  2339          );
  2340          return A.H.TRUE;
  2341        } catch (err: any) {
  2342          A.store.Ref(errPtr, err);
  2343          return A.H.FALSE;
  2344        }
  2345      },
  2346      "has_ReportReleaseContextResult": (): heap.Ref<boolean> => {
  2347        if (WEBEXT?.smartCardProviderPrivate && "reportReleaseContextResult" in WEBEXT?.smartCardProviderPrivate) {
  2348          return A.H.TRUE;
  2349        }
  2350        return A.H.FALSE;
  2351      },
  2352      "func_ReportReleaseContextResult": (fn: Pointer): void => {
  2353        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.reportReleaseContextResult);
  2354      },
  2355      "call_ReportReleaseContextResult": (retPtr: Pointer, requestId: number, resultCode: number): void => {
  2356        const _ret = WEBEXT.smartCardProviderPrivate.reportReleaseContextResult(
  2357          requestId,
  2358          resultCode > 0 && resultCode <= 32
  2359            ? [
  2360                "SUCCESS",
  2361                "REMOVED_CARD",
  2362                "RESET_CARD",
  2363                "UNPOWERED_CARD",
  2364                "UNRESPONSIVE_CARD",
  2365                "UNSUPPORTED_CARD",
  2366                "READER_UNAVAILABLE",
  2367                "SHARING_VIOLATION",
  2368                "NOT_TRANSACTED",
  2369                "NO_SMARTCARD",
  2370                "PROTO_MISMATCH",
  2371                "SYSTEM_CANCELLED",
  2372                "NOT_READY",
  2373                "CANCELLED",
  2374                "INSUFFICIENT_BUFFER",
  2375                "INVALID_HANDLE",
  2376                "INVALID_PARAMETER",
  2377                "INVALID_VALUE",
  2378                "NO_MEMORY",
  2379                "TIMEOUT",
  2380                "UNKNOWN_READER",
  2381                "UNSUPPORTED_FEATURE",
  2382                "NO_READERS_AVAILABLE",
  2383                "SERVICE_STOPPED",
  2384                "NO_SERVICE",
  2385                "COMM_ERROR",
  2386                "INTERNAL_ERROR",
  2387                "UNKNOWN_ERROR",
  2388                "SERVER_TOO_BUSY",
  2389                "UNEXPECTED",
  2390                "SHUTDOWN",
  2391                "UNKNOWN",
  2392              ][resultCode - 1]
  2393            : undefined
  2394        );
  2395      },
  2396      "try_ReportReleaseContextResult": (
  2397        retPtr: Pointer,
  2398        errPtr: Pointer,
  2399        requestId: number,
  2400        resultCode: number
  2401      ): heap.Ref<boolean> => {
  2402        try {
  2403          const _ret = WEBEXT.smartCardProviderPrivate.reportReleaseContextResult(
  2404            requestId,
  2405            resultCode > 0 && resultCode <= 32
  2406              ? [
  2407                  "SUCCESS",
  2408                  "REMOVED_CARD",
  2409                  "RESET_CARD",
  2410                  "UNPOWERED_CARD",
  2411                  "UNRESPONSIVE_CARD",
  2412                  "UNSUPPORTED_CARD",
  2413                  "READER_UNAVAILABLE",
  2414                  "SHARING_VIOLATION",
  2415                  "NOT_TRANSACTED",
  2416                  "NO_SMARTCARD",
  2417                  "PROTO_MISMATCH",
  2418                  "SYSTEM_CANCELLED",
  2419                  "NOT_READY",
  2420                  "CANCELLED",
  2421                  "INSUFFICIENT_BUFFER",
  2422                  "INVALID_HANDLE",
  2423                  "INVALID_PARAMETER",
  2424                  "INVALID_VALUE",
  2425                  "NO_MEMORY",
  2426                  "TIMEOUT",
  2427                  "UNKNOWN_READER",
  2428                  "UNSUPPORTED_FEATURE",
  2429                  "NO_READERS_AVAILABLE",
  2430                  "SERVICE_STOPPED",
  2431                  "NO_SERVICE",
  2432                  "COMM_ERROR",
  2433                  "INTERNAL_ERROR",
  2434                  "UNKNOWN_ERROR",
  2435                  "SERVER_TOO_BUSY",
  2436                  "UNEXPECTED",
  2437                  "SHUTDOWN",
  2438                  "UNKNOWN",
  2439                ][resultCode - 1]
  2440              : undefined
  2441          );
  2442          return A.H.TRUE;
  2443        } catch (err: any) {
  2444          A.store.Ref(errPtr, err);
  2445          return A.H.FALSE;
  2446        }
  2447      },
  2448      "has_ReportStatusResult": (): heap.Ref<boolean> => {
  2449        if (WEBEXT?.smartCardProviderPrivate && "reportStatusResult" in WEBEXT?.smartCardProviderPrivate) {
  2450          return A.H.TRUE;
  2451        }
  2452        return A.H.FALSE;
  2453      },
  2454      "func_ReportStatusResult": (fn: Pointer): void => {
  2455        A.store.Ref(fn, WEBEXT.smartCardProviderPrivate.reportStatusResult);
  2456      },
  2457      "call_ReportStatusResult": (
  2458        retPtr: Pointer,
  2459        requestId: number,
  2460        readerName: heap.Ref<object>,
  2461        state: number,
  2462        protocol: number,
  2463        atr: heap.Ref<object>,
  2464        resultCode: number
  2465      ): void => {
  2466        const _ret = WEBEXT.smartCardProviderPrivate.reportStatusResult(
  2467          requestId,
  2468          A.H.get<object>(readerName),
  2469          state > 0 && state <= 6
  2470            ? ["ABSENT", "PRESENT", "SWALLOWED", "POWERED", "NEGOTIABLE", "SPECIFIC"][state - 1]
  2471            : undefined,
  2472          protocol > 0 && protocol <= 4 ? ["UNDEFINED", "T0", "T1", "RAW"][protocol - 1] : undefined,
  2473          A.H.get<object>(atr),
  2474          resultCode > 0 && resultCode <= 32
  2475            ? [
  2476                "SUCCESS",
  2477                "REMOVED_CARD",
  2478                "RESET_CARD",
  2479                "UNPOWERED_CARD",
  2480                "UNRESPONSIVE_CARD",
  2481                "UNSUPPORTED_CARD",
  2482                "READER_UNAVAILABLE",
  2483                "SHARING_VIOLATION",
  2484                "NOT_TRANSACTED",
  2485                "NO_SMARTCARD",
  2486                "PROTO_MISMATCH",
  2487                "SYSTEM_CANCELLED",
  2488                "NOT_READY",
  2489                "CANCELLED",
  2490                "INSUFFICIENT_BUFFER",
  2491                "INVALID_HANDLE",
  2492                "INVALID_PARAMETER",
  2493                "INVALID_VALUE",
  2494                "NO_MEMORY",
  2495                "TIMEOUT",
  2496                "UNKNOWN_READER",
  2497                "UNSUPPORTED_FEATURE",
  2498                "NO_READERS_AVAILABLE",
  2499                "SERVICE_STOPPED",
  2500                "NO_SERVICE",
  2501                "COMM_ERROR",
  2502                "INTERNAL_ERROR",
  2503                "UNKNOWN_ERROR",
  2504                "SERVER_TOO_BUSY",
  2505                "UNEXPECTED",
  2506                "SHUTDOWN",
  2507                "UNKNOWN",
  2508              ][resultCode - 1]
  2509            : undefined
  2510        );
  2511      },
  2512      "try_ReportStatusResult": (
  2513        retPtr: Pointer,
  2514        errPtr: Pointer,
  2515        requestId: number,
  2516        readerName: heap.Ref<object>,
  2517        state: number,
  2518        protocol: number,
  2519        atr: heap.Ref<object>,
  2520        resultCode: number
  2521      ): heap.Ref<boolean> => {
  2522        try {
  2523          const _ret = WEBEXT.smartCardProviderPrivate.reportStatusResult(
  2524            requestId,
  2525            A.H.get<object>(readerName),
  2526            state > 0 && state <= 6
  2527              ? ["ABSENT", "PRESENT", "SWALLOWED", "POWERED", "NEGOTIABLE", "SPECIFIC"][state - 1]
  2528              : undefined,
  2529            protocol > 0 && protocol <= 4 ? ["UNDEFINED", "T0", "T1", "RAW"][protocol - 1] : undefined,
  2530            A.H.get<object>(atr),
  2531            resultCode > 0 && resultCode <= 32
  2532              ? [
  2533                  "SUCCESS",
  2534                  "REMOVED_CARD",
  2535                  "RESET_CARD",
  2536                  "UNPOWERED_CARD",
  2537                  "UNRESPONSIVE_CARD",
  2538                  "UNSUPPORTED_CARD",
  2539                  "READER_UNAVAILABLE",
  2540                  "SHARING_VIOLATION",
  2541                  "NOT_TRANSACTED",
  2542                  "NO_SMARTCARD",
  2543                  "PROTO_MISMATCH",
  2544                  "SYSTEM_CANCELLED",
  2545                  "NOT_READY",
  2546                  "CANCELLED",
  2547                  "INSUFFICIENT_BUFFER",
  2548                  "INVALID_HANDLE",
  2549                  "INVALID_PARAMETER",
  2550                  "INVALID_VALUE",
  2551                  "NO_MEMORY",
  2552                  "TIMEOUT",
  2553                  "UNKNOWN_READER",
  2554                  "UNSUPPORTED_FEATURE",
  2555                  "NO_READERS_AVAILABLE",
  2556                  "SERVICE_STOPPED",
  2557                  "NO_SERVICE",
  2558                  "COMM_ERROR",
  2559                  "INTERNAL_ERROR",
  2560                  "UNKNOWN_ERROR",
  2561                  "SERVER_TOO_BUSY",
  2562                  "UNEXPECTED",
  2563                  "SHUTDOWN",
  2564                  "UNKNOWN",
  2565                ][resultCode - 1]
  2566              : undefined
  2567          );
  2568          return A.H.TRUE;
  2569        } catch (err: any) {
  2570          A.store.Ref(errPtr, err);
  2571          return A.H.FALSE;
  2572        }
  2573      },
  2574    };
  2575  });