sf-i-events 1.0.824 → 1.0.826

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/sf-i-events.js CHANGED
@@ -3435,21 +3435,22 @@ let SfIEvents = class SfIEvents extends LitElement {
3435
3435
  }
3436
3436
  let flagBulk = false;
3437
3437
  if (this.selectedItemIds.length == 0) {
3438
- await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], comments, approved, event.isnotice != null ? "notices" : "events");
3439
- for (var p = 0; p < this.events[mmdd].length; p++) {
3440
- if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid) {
3441
- this.events[mmdd][p].approved = approved;
3442
- this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
3443
- this.events[mmdd][p].lastupdated = new Date().toString();
3444
- if (approved) {
3445
- this.events[mmdd][p].dateofcompletion = new Date().getTime() + "";
3438
+ if (await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], comments, approved, event.isnotice != null ? "notices" : "events")) {
3439
+ for (var p = 0; p < this.events[mmdd].length; p++) {
3440
+ if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid) {
3441
+ this.events[mmdd][p].approved = approved;
3442
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
3443
+ this.events[mmdd][p].lastupdated = new Date().toString();
3444
+ if (approved) {
3445
+ this.events[mmdd][p].dateofcompletion = new Date().getTime() + "";
3446
+ }
3446
3447
  }
3447
3448
  }
3449
+ if (this.recentlyReported[mmdd] == null) {
3450
+ this.recentlyReported[mmdd] = [];
3451
+ }
3452
+ this.recentlyReported[mmdd].push(event);
3448
3453
  }
3449
- if (this.recentlyReported[mmdd] == null) {
3450
- this.recentlyReported[mmdd] = [];
3451
- }
3452
- this.recentlyReported[mmdd].push(event);
3453
3454
  }
3454
3455
  else {
3455
3456
  let bulkBodyReview = [];
@@ -3538,21 +3539,22 @@ let SfIEvents = class SfIEvents extends LitElement {
3538
3539
  else {
3539
3540
  let flagBulk = false;
3540
3541
  if (this.selectedItemIds.length == 0) {
3541
- await this.uploadAudit(event.entityid, event.locationid, mmddyyyy, event["id"], comments, approved, event.isnotice != null ? "notices" : "events");
3542
- for (var p = 0; p < this.events[mmdd].length; p++) {
3543
- if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid) {
3544
- this.events[mmdd][p].approved = approved;
3545
- this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
3546
- this.events[mmdd][p].lastupdated = new Date().toString();
3547
- if (approved) {
3548
- this.events[mmdd][p].dateofcompletion = new Date().getTime() + "";
3542
+ if (await this.uploadAudit(event.entityid, event.locationid, mmddyyyy, event["id"], comments, approved, event.isnotice != null ? "notices" : "events")) {
3543
+ for (var p = 0; p < this.events[mmdd].length; p++) {
3544
+ if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid) {
3545
+ this.events[mmdd][p].approved = approved;
3546
+ this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
3547
+ this.events[mmdd][p].lastupdated = new Date().toString();
3548
+ if (approved) {
3549
+ this.events[mmdd][p].dateofcompletion = new Date().getTime() + "";
3550
+ }
3549
3551
  }
3550
3552
  }
3553
+ if (this.recentlyReported[mmdd] == null) {
3554
+ this.recentlyReported[mmdd] = [];
3555
+ }
3556
+ this.recentlyReported[mmdd].push(event);
3551
3557
  }
3552
- if (this.recentlyReported[mmdd] == null) {
3553
- this.recentlyReported[mmdd] = [];
3554
- }
3555
- this.recentlyReported[mmdd].push(event);
3556
3558
  }
3557
3559
  else {
3558
3560
  let bulkBodyAudit = [];
@@ -3696,32 +3698,33 @@ let SfIEvents = class SfIEvents extends LitElement {
3696
3698
  else {
3697
3699
  let flagBulk = false;
3698
3700
  if (this.selectedItemIds.length == 0) {
3699
- await this.uploadReport(event.entityid, event.locationid, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage, event.makercheckers);
3700
- console.log('this.events', this.events);
3701
- if (this.mode != "next") {
3702
- for (var p = 0; p < this.events[mmdd].length; p++) {
3703
- if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid) {
3704
- this.events[mmdd][p].documents = docs;
3705
- this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() });
3706
- this.events[mmdd][p].lastupdated = new Date().toString();
3707
- }
3708
- }
3709
- if (event.makercheckers.length > 0) {
3710
- // await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true, event.isnotice != null ? "notices" : "events");
3701
+ if (await this.uploadReport(event.entityid, event.locationid, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage, event.makercheckers)) {
3702
+ console.log('this.events', this.events);
3703
+ if (this.mode != "next") {
3711
3704
  for (var p = 0; p < this.events[mmdd].length; p++) {
3712
3705
  if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid) {
3713
- this.events[mmdd][p].approved = true;
3714
- // this.events[mmdd][p].documents = docs
3715
- this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() });
3706
+ this.events[mmdd][p].documents = docs;
3707
+ this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() });
3716
3708
  this.events[mmdd][p].lastupdated = new Date().toString();
3717
3709
  }
3718
3710
  }
3711
+ if (event.makercheckers.length > 0) {
3712
+ // await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true, event.isnotice != null ? "notices" : "events");
3713
+ for (var p = 0; p < this.events[mmdd].length; p++) {
3714
+ if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid) {
3715
+ this.events[mmdd][p].approved = true;
3716
+ // this.events[mmdd][p].documents = docs
3717
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() });
3718
+ this.events[mmdd][p].lastupdated = new Date().toString();
3719
+ }
3720
+ }
3721
+ }
3722
+ if (this.recentlyReported[mmdd] == null) {
3723
+ this.recentlyReported[mmdd] = [];
3724
+ }
3725
+ this.recentlyReported[mmdd].push(event);
3726
+ console.log('recently reported', this.recentlyReported);
3719
3727
  }
3720
- if (this.recentlyReported[mmdd] == null) {
3721
- this.recentlyReported[mmdd] = [];
3722
- }
3723
- this.recentlyReported[mmdd].push(event);
3724
- console.log('recently reported', this.recentlyReported);
3725
3728
  }
3726
3729
  }
3727
3730
  else {
@@ -8935,6 +8938,10 @@ let SfIEvents = class SfIEvents extends LitElement {
8935
8938
  console.log('jsonRespose notice details', jsonRespose);
8936
8939
  }
8937
8940
  else {
8941
+ if (xhr.status == 401) {
8942
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
8943
+ this.dispatchEvent(changeEvent);
8944
+ }
8938
8945
  if (xhr.status === 404) {
8939
8946
  this.showChosenProject();
8940
8947
  this._SfTitleChosenProject.innerHTML = this._SfProject[0].querySelector('#sf-i-project').selectedTexts()[0];
@@ -9122,18 +9129,19 @@ let SfIEvents = class SfIEvents extends LitElement {
9122
9129
  let flagBulk = false;
9123
9130
  if (this.selectedItemIds.length === 0) {
9124
9131
  console.log('mmddyyyy', mmddyyyy);
9125
- await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.isnotice != null ? "notices" : "events");
9126
- for (var p = 0; p < this.events[mmdd].length; p++) {
9127
- if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
9128
- this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
9129
- this.events[mmdd][p].lastupdated = new Date().toString();
9132
+ if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.isnotice != null ? "notices" : "events")) {
9133
+ for (var p = 0; p < this.events[mmdd].length; p++) {
9134
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
9135
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
9136
+ this.events[mmdd][p].lastupdated = new Date().toString();
9137
+ }
9130
9138
  }
9139
+ if (this.recentlyReported[mmdd] == null) {
9140
+ this.recentlyReported[mmdd] = [];
9141
+ }
9142
+ this.recentlyReported[mmdd].push(listEvent);
9143
+ console.log('review single');
9131
9144
  }
9132
- if (this.recentlyReported[mmdd] == null) {
9133
- this.recentlyReported[mmdd] = [];
9134
- }
9135
- this.recentlyReported[mmdd].push(event);
9136
- console.log('review single');
9137
9145
  }
9138
9146
  else {
9139
9147
  let bulkBodyReview = [];
@@ -9239,18 +9247,19 @@ let SfIEvents = class SfIEvents extends LitElement {
9239
9247
  else {
9240
9248
  let flagBulk = false;
9241
9249
  if (this.selectedItemIds.length === 0) {
9242
- await this.uploadAudit(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.isnotice != null ? "notices" : "events");
9243
- for (var p = 0; p < this.events[mmdd].length; p++) {
9244
- if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
9245
- this.events[mmdd][p].approved = approved;
9246
- this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
9247
- this.events[mmdd][p].lastupdated = new Date().toString();
9250
+ if (await this.uploadAudit(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.isnotice != null ? "notices" : "events")) {
9251
+ for (var p = 0; p < this.events[mmdd].length; p++) {
9252
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
9253
+ this.events[mmdd][p].approved = approved;
9254
+ this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
9255
+ this.events[mmdd][p].lastupdated = new Date().toString();
9256
+ }
9248
9257
  }
9258
+ if (this.recentlyReported[mmdd] == null) {
9259
+ this.recentlyReported[mmdd] = [];
9260
+ }
9261
+ this.recentlyReported[mmdd].push(listEvent);
9249
9262
  }
9250
- if (this.recentlyReported[mmdd] == null) {
9251
- this.recentlyReported[mmdd] = [];
9252
- }
9253
- this.recentlyReported[mmdd].push(event);
9254
9263
  console.log('uploadaudit single');
9255
9264
  }
9256
9265
  else {
@@ -9407,32 +9416,33 @@ let SfIEvents = class SfIEvents extends LitElement {
9407
9416
  this._SfDetailContainer.querySelector('#button-detail-close').dispatchEvent(clickEvent);
9408
9417
  let flagBulk = false;
9409
9418
  if (this.selectedItemIds.length === 0) {
9410
- await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, "notices", percentage, makercheckers);
9411
- console.log('this.events', this.events);
9412
- for (var p = 0; p < this.events[mmdd].length; p++) {
9413
- if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
9414
- this.events[mmdd][p].documents = docs;
9415
- this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() });
9416
- this.events[mmdd][p].lastupdated = new Date().toString();
9417
- }
9418
- }
9419
- console.log('uploadReport single');
9420
- if (makercheckers.length > 0) {
9421
- // await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
9419
+ if (await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, "notices", percentage, makercheckers)) {
9420
+ console.log('this.events', this.events);
9422
9421
  for (var p = 0; p < this.events[mmdd].length; p++) {
9423
9422
  if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
9424
- this.events[mmdd][p].approved = true;
9425
- // this.events[mmdd][p].documents = docs
9426
- this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() });
9423
+ this.events[mmdd][p].documents = docs;
9424
+ this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() });
9427
9425
  this.events[mmdd][p].lastupdated = new Date().toString();
9428
9426
  }
9429
9427
  }
9430
- console.log('upload report auto approve single');
9431
- }
9432
- if (this.recentlyReported[mmdd] == null) {
9433
- this.recentlyReported[mmdd] = [];
9428
+ console.log('uploadReport single');
9429
+ if (makercheckers.length > 0) {
9430
+ // await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
9431
+ for (var p = 0; p < this.events[mmdd].length; p++) {
9432
+ if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
9433
+ this.events[mmdd][p].approved = true;
9434
+ // this.events[mmdd][p].documents = docs
9435
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() });
9436
+ this.events[mmdd][p].lastupdated = new Date().toString();
9437
+ }
9438
+ }
9439
+ console.log('upload report auto approve single');
9440
+ }
9441
+ if (this.recentlyReported[mmdd] == null) {
9442
+ this.recentlyReported[mmdd] = [];
9443
+ }
9444
+ this.recentlyReported[mmdd].push(listEvent);
9434
9445
  }
9435
- this.recentlyReported[mmdd].push(event);
9436
9446
  }
9437
9447
  else {
9438
9448
  let bulkBody = [];
@@ -9665,6 +9675,10 @@ let SfIEvents = class SfIEvents extends LitElement {
9665
9675
  }
9666
9676
  }
9667
9677
  else {
9678
+ if (xhr.status == 401) {
9679
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
9680
+ this.dispatchEvent(changeEvent);
9681
+ }
9668
9682
  if (xhr.status === 404) {
9669
9683
  this.showChosenProject();
9670
9684
  this._SfTitleChosenProject.innerHTML = this._SfProject[0].querySelector('#sf-i-project').selectedTexts()[0];
@@ -10211,17 +10225,18 @@ let SfIEvents = class SfIEvents extends LitElement {
10211
10225
  let flagBulk = false;
10212
10226
  if (this.selectedItemIds.length === 0) {
10213
10227
  // console.log('mmddyyyy', mmddyyyy)
10214
- await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], comments, approved, event.isnotice != null ? "notices" : "events");
10215
- for (var p = 0; p < this.events[mmdd].length; p++) {
10216
- if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
10217
- this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
10218
- this.events[mmdd][p].lastupdated = new Date().toString();
10228
+ if (await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], comments, approved, event.isnotice != null ? "notices" : "events")) {
10229
+ for (var p = 0; p < this.events[mmdd].length; p++) {
10230
+ if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
10231
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
10232
+ this.events[mmdd][p].lastupdated = new Date().toString();
10233
+ }
10219
10234
  }
10235
+ if (this.recentlyReported[mmdd] == null) {
10236
+ this.recentlyReported[mmdd] = [];
10237
+ }
10238
+ this.recentlyReported[mmdd].push(event);
10220
10239
  }
10221
- if (this.recentlyReported[mmdd] == null) {
10222
- this.recentlyReported[mmdd] = [];
10223
- }
10224
- this.recentlyReported[mmdd].push(event);
10225
10240
  }
10226
10241
  else {
10227
10242
  let bulkBodyReview = [];
@@ -10326,18 +10341,19 @@ let SfIEvents = class SfIEvents extends LitElement {
10326
10341
  else {
10327
10342
  let flagBulk = false;
10328
10343
  if (this.selectedItemIds.length === 0) {
10329
- await this.uploadAudit(entityId, locationId, mmddyyyy, event["id"], comments, approved, event.isnotice != null ? "notices" : "events");
10330
- for (var p = 0; p < this.events[mmdd].length; p++) {
10331
- if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
10332
- this.events[mmdd][p].approved = approved;
10333
- this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
10334
- this.events[mmdd][p].lastupdated = new Date().toString();
10344
+ if (await this.uploadAudit(entityId, locationId, mmddyyyy, event["id"], comments, approved, event.isnotice != null ? "notices" : "events")) {
10345
+ for (var p = 0; p < this.events[mmdd].length; p++) {
10346
+ if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
10347
+ this.events[mmdd][p].approved = approved;
10348
+ this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
10349
+ this.events[mmdd][p].lastupdated = new Date().toString();
10350
+ }
10335
10351
  }
10352
+ if (this.recentlyReported[mmdd] == null) {
10353
+ this.recentlyReported[mmdd] = [];
10354
+ }
10355
+ this.recentlyReported[mmdd].push(event);
10336
10356
  }
10337
- if (this.recentlyReported[mmdd] == null) {
10338
- this.recentlyReported[mmdd] = [];
10339
- }
10340
- this.recentlyReported[mmdd].push(event);
10341
10357
  }
10342
10358
  else {
10343
10359
  let bulkBodyAudit = [];
@@ -10495,30 +10511,31 @@ let SfIEvents = class SfIEvents extends LitElement {
10495
10511
  //console.log('makerscheckers', makercheckers, reportercomments);
10496
10512
  // console.log('reportformatvalues', reportformatvalues)
10497
10513
  // console.log('reportformatschema',reportformatschema)
10498
- await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage, makercheckers);
10499
- console.log('this.events', this.events);
10500
- for (var p = 0; p < this.events[mmdd].length; p++) {
10501
- if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
10502
- this.events[mmdd][p].documents = docs;
10503
- this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() });
10504
- this.events[mmdd][p].lastupdated = new Date().toString();
10505
- }
10506
- }
10507
- if (makercheckers.length > 0) {
10508
- // await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true, event.isnotice != null ? "notices" : "events");
10514
+ if (await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage, makercheckers)) {
10515
+ console.log('this.events', this.events);
10509
10516
  for (var p = 0; p < this.events[mmdd].length; p++) {
10510
10517
  if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
10511
- this.events[mmdd][p].approved = true;
10512
- // this.events[mmdd][p].documents = docs
10513
- this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() });
10518
+ this.events[mmdd][p].documents = docs;
10519
+ this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() });
10514
10520
  this.events[mmdd][p].lastupdated = new Date().toString();
10515
10521
  }
10516
10522
  }
10523
+ if (makercheckers.length > 0) {
10524
+ // await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true, event.isnotice != null ? "notices" : "events");
10525
+ for (var p = 0; p < this.events[mmdd].length; p++) {
10526
+ if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
10527
+ this.events[mmdd][p].approved = true;
10528
+ // this.events[mmdd][p].documents = docs
10529
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() });
10530
+ this.events[mmdd][p].lastupdated = new Date().toString();
10531
+ }
10532
+ }
10533
+ }
10534
+ if (this.recentlyReported[mmdd] == null) {
10535
+ this.recentlyReported[mmdd] = [];
10536
+ }
10537
+ this.recentlyReported[mmdd].push(event);
10517
10538
  }
10518
- if (this.recentlyReported[mmdd] == null) {
10519
- this.recentlyReported[mmdd] = [];
10520
- }
10521
- this.recentlyReported[mmdd].push(event);
10522
10539
  }
10523
10540
  else {
10524
10541
  let bulkBody = [];
@@ -16756,6 +16773,10 @@ let SfIEvents = class SfIEvents extends LitElement {
16756
16773
  this._SfLoader.innerHTML = '';
16757
16774
  }
16758
16775
  else {
16776
+ if (xhr.status == 401) {
16777
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
16778
+ this.dispatchEvent(changeEvent);
16779
+ }
16759
16780
  const jsonRespose = JSON.parse(xhr.responseText);
16760
16781
  this.setError(jsonRespose.error);
16761
16782
  setTimeout(() => {
@@ -16792,6 +16813,10 @@ let SfIEvents = class SfIEvents extends LitElement {
16792
16813
  this._SfLoader.innerHTML = '';
16793
16814
  }
16794
16815
  else {
16816
+ if (xhr.status == 401) {
16817
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
16818
+ this.dispatchEvent(changeEvent);
16819
+ }
16795
16820
  const jsonRespose = JSON.parse(xhr.responseText);
16796
16821
  this.setError(jsonRespose.error);
16797
16822
  setTimeout(() => {
@@ -16836,6 +16861,10 @@ let SfIEvents = class SfIEvents extends LitElement {
16836
16861
  this._SfLoader.innerHTML = '';
16837
16862
  }
16838
16863
  else {
16864
+ if (xhr.status == 401) {
16865
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
16866
+ this.dispatchEvent(changeEvent);
16867
+ }
16839
16868
  const jsonRespose = JSON.parse(xhr.responseText);
16840
16869
  this.setError(jsonRespose.error);
16841
16870
  setTimeout(() => {
@@ -16859,6 +16888,10 @@ let SfIEvents = class SfIEvents extends LitElement {
16859
16888
  }, 3000);
16860
16889
  }
16861
16890
  else {
16891
+ if (xhr.status == 401) {
16892
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
16893
+ this.dispatchEvent(changeEvent);
16894
+ }
16862
16895
  const jsonRespose = JSON.parse(xhr.responseText);
16863
16896
  this.setError(jsonRespose.error);
16864
16897
  setTimeout(() => {
@@ -16893,6 +16926,10 @@ let SfIEvents = class SfIEvents extends LitElement {
16893
16926
  }, 5000);
16894
16927
  }
16895
16928
  else {
16929
+ if (xhr.status == 401) {
16930
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
16931
+ this.dispatchEvent(changeEvent);
16932
+ }
16896
16933
  const jsonRespose = JSON.parse(xhr.responseText);
16897
16934
  this.setError(jsonRespose.error);
16898
16935
  setTimeout(() => {
@@ -16919,6 +16956,10 @@ let SfIEvents = class SfIEvents extends LitElement {
16919
16956
  }, 3000);
16920
16957
  }
16921
16958
  else {
16959
+ if (xhr.status == 401) {
16960
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
16961
+ this.dispatchEvent(changeEvent);
16962
+ }
16922
16963
  const jsonRespose = JSON.parse(xhr.responseText);
16923
16964
  this.setError(jsonRespose.error);
16924
16965
  setTimeout(() => {
@@ -16941,6 +16982,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16941
16982
  "username": this.userName,
16942
16983
  "module": module
16943
16984
  };
16985
+ let retValue = true;
16944
16986
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
16945
16987
  const xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
16946
16988
  this._SfLoader.innerHTML = '';
@@ -16960,9 +17002,15 @@ let SfIEvents = class SfIEvents extends LitElement {
16960
17002
  }, 2000);
16961
17003
  }
16962
17004
  else {
17005
+ if (xhr.status == 401) {
17006
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17007
+ this.dispatchEvent(changeEvent);
17008
+ }
16963
17009
  const jsonRespose = JSON.parse(xhr.responseText);
16964
17010
  this.setError(jsonRespose.error);
17011
+ retValue = false;
16965
17012
  }
17013
+ return retValue;
16966
17014
  };
16967
17015
  this.uploadAuditsBulk = async (bulkBody) => {
16968
17016
  let url = "https://" + this.apiId + "/uploadauditsbulk";
@@ -16976,6 +17024,10 @@ let SfIEvents = class SfIEvents extends LitElement {
16976
17024
  }, 10000);
16977
17025
  }
16978
17026
  else {
17027
+ if (xhr.status == 401) {
17028
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17029
+ this.dispatchEvent(changeEvent);
17030
+ }
16979
17031
  const jsonRespose = JSON.parse(xhr.responseText);
16980
17032
  this.setError(jsonRespose.error);
16981
17033
  }
@@ -16995,6 +17047,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16995
17047
  "username": this.userName,
16996
17048
  "module": module
16997
17049
  };
17050
+ let retValue = true;
16998
17051
  //console.log('uploading review', body);
16999
17052
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
17000
17053
  const xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
@@ -17015,12 +17068,18 @@ let SfIEvents = class SfIEvents extends LitElement {
17015
17068
  }, 2000);
17016
17069
  }
17017
17070
  else {
17071
+ if (xhr.status == 401) {
17072
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17073
+ this.dispatchEvent(changeEvent);
17074
+ }
17018
17075
  const jsonRespose = JSON.parse(xhr.responseText);
17019
- this.setError(jsonRespose.message);
17076
+ this.setError(jsonRespose.error);
17020
17077
  setTimeout(() => {
17021
17078
  this.clearMessages();
17022
17079
  }, 3000);
17080
+ retValue = false;
17023
17081
  }
17082
+ return retValue;
17024
17083
  };
17025
17084
  this.uploadReportsReviewsBulk = async (bulkBody) => {
17026
17085
  let url = "https://" + this.apiId + "/uploadreportsreviewsbulk";
@@ -17034,8 +17093,12 @@ let SfIEvents = class SfIEvents extends LitElement {
17034
17093
  }, 10000);
17035
17094
  }
17036
17095
  else {
17096
+ if (xhr.status == 401) {
17097
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17098
+ this.dispatchEvent(changeEvent);
17099
+ }
17037
17100
  const jsonRespose = JSON.parse(xhr.responseText);
17038
- this.setError(jsonRespose.message);
17101
+ this.setError(jsonRespose.error);
17039
17102
  setTimeout(() => {
17040
17103
  this.clearMessages();
17041
17104
  }, 3000);
@@ -17053,15 +17116,19 @@ let SfIEvents = class SfIEvents extends LitElement {
17053
17116
  }, 10000);
17054
17117
  }
17055
17118
  else {
17119
+ if (xhr.status == 401) {
17120
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17121
+ this.dispatchEvent(changeEvent);
17122
+ }
17056
17123
  const jsonRespose = JSON.parse(xhr.responseText);
17057
- this.setError(jsonRespose.message);
17124
+ this.setError(jsonRespose.error);
17058
17125
  setTimeout(() => {
17059
17126
  this.clearMessages();
17060
17127
  }, 3000);
17061
17128
  }
17062
17129
  };
17063
17130
  this.uploadReport = async (entityId, locationId, mmddyyyy, eventid, comments, doc, docs, event, reportformatvalues = "", reportformatschema = "", module = "events", percentage = "100", makercheckers) => {
17064
- let url = "https://" + this.apiId + "/uploadreport1";
17131
+ let url = "https://" + this.apiId + "/uploadreport2";
17065
17132
  let body = {
17066
17133
  "mmddyyyy": mmddyyyy,
17067
17134
  "projectid": this.projectId,
@@ -17084,6 +17151,7 @@ let SfIEvents = class SfIEvents extends LitElement {
17084
17151
  "makercheckers": makercheckers
17085
17152
  };
17086
17153
  //console.log(body);
17154
+ let retValue = true;
17087
17155
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
17088
17156
  const xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
17089
17157
  this._SfLoader.innerHTML = '';
@@ -17103,15 +17171,22 @@ let SfIEvents = class SfIEvents extends LitElement {
17103
17171
  }, 2000);
17104
17172
  }
17105
17173
  else {
17174
+ if (xhr.status == 401) {
17175
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17176
+ this.dispatchEvent(changeEvent);
17177
+ }
17106
17178
  const jsonRespose = JSON.parse(xhr.responseText);
17107
- this.setError(jsonRespose.message);
17179
+ console.log();
17180
+ this.setError(jsonRespose.error);
17108
17181
  setTimeout(() => {
17109
17182
  this.clearMessages();
17110
17183
  }, 3000);
17184
+ retValue = false;
17111
17185
  }
17186
+ return retValue;
17112
17187
  };
17113
17188
  this.uploadReportsBulk = async (bulkBody, showSuccess = true) => {
17114
- let url = "https://" + this.apiId + "/uploadreportsbulk1";
17189
+ let url = "https://" + this.apiId + "/uploadreportsbulk2";
17115
17190
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
17116
17191
  const xhr = (await this.prepareXhr(bulkBody, url, this._SfLoader, authorization));
17117
17192
  if (showSuccess) {
@@ -17126,8 +17201,12 @@ let SfIEvents = class SfIEvents extends LitElement {
17126
17201
  }
17127
17202
  }
17128
17203
  else {
17204
+ if (xhr.status == 401) {
17205
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17206
+ this.dispatchEvent(changeEvent);
17207
+ }
17129
17208
  const jsonRespose = JSON.parse(xhr.responseText);
17130
- this.setError(jsonRespose.message);
17209
+ this.setError(jsonRespose.error);
17131
17210
  setTimeout(() => {
17132
17211
  this.clearMessages();
17133
17212
  }, 3000);
@@ -17161,6 +17240,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17161
17240
  }, 2000);
17162
17241
  }
17163
17242
  else {
17243
+ if (xhr.status == 401) {
17244
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17245
+ this.dispatchEvent(changeEvent);
17246
+ }
17164
17247
  const jsonRespose = JSON.parse(xhr.responseText);
17165
17248
  this.setError(jsonRespose.error);
17166
17249
  }
@@ -17180,6 +17263,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17180
17263
  this.renderMappingTabs(this.TAB_REPORTER);
17181
17264
  }
17182
17265
  else {
17266
+ if (xhr.status == 401) {
17267
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17268
+ this.dispatchEvent(changeEvent);
17269
+ }
17183
17270
  const jsonRespose = JSON.parse(xhr.responseText);
17184
17271
  this.setError(jsonRespose.error);
17185
17272
  }
@@ -17195,6 +17282,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17195
17282
  //console.log('jsonResponse sync', jsonRespose);
17196
17283
  }
17197
17284
  else {
17285
+ if (xhr.status == 401) {
17286
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17287
+ this.dispatchEvent(changeEvent);
17288
+ }
17198
17289
  const jsonRespose = JSON.parse(xhr.responseText);
17199
17290
  this.setError(jsonRespose.error);
17200
17291
  }
@@ -17291,6 +17382,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17291
17382
  return jsonRespose;
17292
17383
  }
17293
17384
  else {
17385
+ if (xhr.status == 401) {
17386
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17387
+ this.dispatchEvent(changeEvent);
17388
+ }
17294
17389
  const jsonRespose = JSON.parse(xhr.responseText);
17295
17390
  this.setError(jsonRespose.error);
17296
17391
  }
@@ -17306,6 +17401,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17306
17401
  return jsonRespose;
17307
17402
  }
17308
17403
  else {
17404
+ if (xhr.status == 401) {
17405
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17406
+ this.dispatchEvent(changeEvent);
17407
+ }
17309
17408
  const jsonRespose = JSON.parse(xhr.responseText);
17310
17409
  this.setError(jsonRespose.error);
17311
17410
  }
@@ -17321,6 +17420,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17321
17420
  return jsonRespose;
17322
17421
  }
17323
17422
  else {
17423
+ if (xhr.status == 401) {
17424
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17425
+ this.dispatchEvent(changeEvent);
17426
+ }
17324
17427
  const jsonRespose = JSON.parse(xhr.responseText);
17325
17428
  this.setError(jsonRespose.error);
17326
17429
  }
@@ -17357,6 +17460,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17357
17460
  return jsonRespose;
17358
17461
  }
17359
17462
  else {
17463
+ if (xhr.status == 401) {
17464
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17465
+ this.dispatchEvent(changeEvent);
17466
+ }
17360
17467
  const jsonRespose = JSON.parse(xhr.responseText);
17361
17468
  this.setError(jsonRespose.error);
17362
17469
  }
@@ -17372,6 +17479,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17372
17479
  return jsonRespose;
17373
17480
  }
17374
17481
  else {
17482
+ if (xhr.status == 401) {
17483
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17484
+ this.dispatchEvent(changeEvent);
17485
+ }
17375
17486
  const jsonRespose = JSON.parse(xhr.responseText);
17376
17487
  this.setError(jsonRespose.error);
17377
17488
  }
@@ -17387,6 +17498,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17387
17498
  return jsonRespose;
17388
17499
  }
17389
17500
  else {
17501
+ if (xhr.status == 401) {
17502
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17503
+ this.dispatchEvent(changeEvent);
17504
+ }
17390
17505
  const jsonRespose = JSON.parse(xhr.responseText);
17391
17506
  this.setError(jsonRespose.error);
17392
17507
  }
@@ -17460,6 +17575,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17460
17575
  return jsonRespose;
17461
17576
  }
17462
17577
  else {
17578
+ if (xhr.status == 401) {
17579
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17580
+ this.dispatchEvent(changeEvent);
17581
+ }
17463
17582
  const jsonRespose = JSON.parse(xhr.responseText);
17464
17583
  this.setError(jsonRespose.error);
17465
17584
  }
@@ -17535,6 +17654,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17535
17654
  return jsonRespose;
17536
17655
  }
17537
17656
  else {
17657
+ if (xhr.status == 401) {
17658
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17659
+ this.dispatchEvent(changeEvent);
17660
+ }
17538
17661
  const jsonRespose = JSON.parse(xhr.responseText);
17539
17662
  this.setError(jsonRespose.error);
17540
17663
  }
@@ -17573,6 +17696,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17573
17696
  return jsonRespose;
17574
17697
  }
17575
17698
  else {
17699
+ if (xhr.status == 401) {
17700
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17701
+ this.dispatchEvent(changeEvent);
17702
+ }
17576
17703
  const jsonRespose = JSON.parse(xhr.responseText);
17577
17704
  this.setError(jsonRespose.error);
17578
17705
  }
@@ -17609,6 +17736,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17609
17736
  return jsonRespose;
17610
17737
  }
17611
17738
  else {
17739
+ if (xhr.status == 401) {
17740
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17741
+ this.dispatchEvent(changeEvent);
17742
+ }
17612
17743
  const jsonRespose = JSON.parse(xhr.responseText);
17613
17744
  this.setError(jsonRespose.error);
17614
17745
  }
@@ -17624,6 +17755,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17624
17755
  return jsonRespose;
17625
17756
  }
17626
17757
  else {
17758
+ if (xhr.status == 401) {
17759
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17760
+ this.dispatchEvent(changeEvent);
17761
+ }
17627
17762
  const jsonRespose = JSON.parse(xhr.responseText);
17628
17763
  this.setError(jsonRespose.error);
17629
17764
  }
@@ -17639,6 +17774,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17639
17774
  return jsonRespose;
17640
17775
  }
17641
17776
  else {
17777
+ if (xhr.status == 401) {
17778
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17779
+ this.dispatchEvent(changeEvent);
17780
+ }
17642
17781
  const jsonRespose = JSON.parse(xhr.responseText);
17643
17782
  this.setError(jsonRespose.error);
17644
17783
  }
@@ -17654,6 +17793,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17654
17793
  return jsonRespose;
17655
17794
  }
17656
17795
  else {
17796
+ if (xhr.status == 401) {
17797
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17798
+ this.dispatchEvent(changeEvent);
17799
+ }
17657
17800
  const jsonRespose = JSON.parse(xhr.responseText);
17658
17801
  this.setError(jsonRespose.error);
17659
17802
  }
@@ -17669,6 +17812,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17669
17812
  return jsonRespose;
17670
17813
  }
17671
17814
  else {
17815
+ if (xhr.status == 401) {
17816
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17817
+ this.dispatchEvent(changeEvent);
17818
+ }
17672
17819
  const jsonRespose = JSON.parse(xhr.responseText);
17673
17820
  this.setError(jsonRespose.error);
17674
17821
  }
@@ -17691,6 +17838,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17691
17838
  // return jsonRespose;
17692
17839
  }
17693
17840
  else {
17841
+ if (xhr.status == 401) {
17842
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17843
+ this.dispatchEvent(changeEvent);
17844
+ }
17694
17845
  const jsonRespose = JSON.parse(xhr.responseText);
17695
17846
  this.setError(jsonRespose.error);
17696
17847
  }
@@ -17815,6 +17966,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17815
17966
  // }
17816
17967
  }
17817
17968
  else {
17969
+ if (xhr.status == 401) {
17970
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
17971
+ this.dispatchEvent(changeEvent);
17972
+ }
17818
17973
  const jsonRespose = JSON.parse(xhr.responseText);
17819
17974
  this.setError(jsonRespose.error);
17820
17975
  }
@@ -17847,6 +18002,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17847
18002
  }
17848
18003
  }
17849
18004
  else {
18005
+ if (xhr.status == 401) {
18006
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18007
+ this.dispatchEvent(changeEvent);
18008
+ }
17850
18009
  const jsonRespose = JSON.parse(xhr.responseText);
17851
18010
  this.setError(jsonRespose.error);
17852
18011
  }
@@ -17933,6 +18092,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17933
18092
  return resultPresigned;
17934
18093
  }
17935
18094
  else {
18095
+ if (xhr.status == 401) {
18096
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18097
+ this.dispatchEvent(changeEvent);
18098
+ }
17936
18099
  const jsonRespose = JSON.parse(xhr.responseText);
17937
18100
  this.setError(jsonRespose.error);
17938
18101
  }
@@ -17948,6 +18111,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17948
18111
  return jsonRespose;
17949
18112
  }
17950
18113
  else {
18114
+ if (xhr.status == 401) {
18115
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18116
+ this.dispatchEvent(changeEvent);
18117
+ }
17951
18118
  const jsonRespose = JSON.parse(xhr.responseText);
17952
18119
  this.setError(jsonRespose.error);
17953
18120
  }
@@ -17963,6 +18130,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17963
18130
  return jsonRespose;
17964
18131
  }
17965
18132
  else {
18133
+ if (xhr.status == 401) {
18134
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18135
+ this.dispatchEvent(changeEvent);
18136
+ }
17966
18137
  const jsonRespose = JSON.parse(xhr.responseText);
17967
18138
  this.setError(jsonRespose.error);
17968
18139
  }
@@ -17983,6 +18154,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17983
18154
  return jsonRespose;
17984
18155
  }
17985
18156
  else {
18157
+ if (xhr.status == 401) {
18158
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18159
+ this.dispatchEvent(changeEvent);
18160
+ }
17986
18161
  const jsonRespose = JSON.parse(xhr.responseText);
17987
18162
  this.setError(jsonRespose.error);
17988
18163
  }
@@ -17998,6 +18173,10 @@ let SfIEvents = class SfIEvents extends LitElement {
17998
18173
  return jsonRespose;
17999
18174
  }
18000
18175
  else {
18176
+ if (xhr.status == 401) {
18177
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18178
+ this.dispatchEvent(changeEvent);
18179
+ }
18001
18180
  const jsonRespose = JSON.parse(xhr.responseText);
18002
18181
  this.setError(jsonRespose.error);
18003
18182
  }
@@ -18013,234 +18192,14 @@ let SfIEvents = class SfIEvents extends LitElement {
18013
18192
  return jsonRespose;
18014
18193
  }
18015
18194
  else {
18195
+ if (xhr.status == 401) {
18196
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18197
+ this.dispatchEvent(changeEvent);
18198
+ }
18016
18199
  const jsonRespose = JSON.parse(xhr.responseText);
18017
18200
  this.setError(jsonRespose.error);
18018
18201
  }
18019
18202
  };
18020
- // fetchInternalControlsJobs = async () => {
18021
- // let url = "https://"+this.apiId+"/getinternalcontrolsjobs";
18022
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18023
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18024
- // this._SfLoader.innerHTML = '';
18025
- // if(xhr.status == 200) {
18026
- // const jsonRespose = JSON.parse(xhr.responseText);
18027
- // //console.log(jsonRespose);
18028
- // return jsonRespose;
18029
- // } else {
18030
- // const jsonRespose = JSON.parse(xhr.responseText);
18031
- // this.setError(jsonRespose.error);
18032
- // }
18033
- // }
18034
- // fetchExtensionsJobs = async () => {
18035
- // let url = "https://"+this.apiId+"/getalertschedulesjobs";
18036
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18037
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18038
- // this._SfLoader.innerHTML = '';
18039
- // if(xhr.status == 200) {
18040
- // const jsonRespose = JSON.parse(xhr.responseText);
18041
- // //console.log(jsonRespose);
18042
- // return jsonRespose;
18043
- // } else {
18044
- // const jsonRespose = JSON.parse(xhr.responseText);
18045
- // this.setError(jsonRespose.error);
18046
- // }
18047
- // }
18048
- // fetchAlertSchedulesJobs = async () => {
18049
- // let url = "https://"+this.apiId+"/getalertschedulesjobs";
18050
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18051
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18052
- // this._SfLoader.innerHTML = '';
18053
- // if(xhr.status == 200) {
18054
- // const jsonRespose = JSON.parse(xhr.responseText);
18055
- // //console.log(jsonRespose);
18056
- // return jsonRespose;
18057
- // } else {
18058
- // const jsonRespose = JSON.parse(xhr.responseText);
18059
- // this.setError(jsonRespose.error);
18060
- // }
18061
- // }
18062
- // fetchDueDatesJobs = async () => {
18063
- // let url = "https://"+this.apiId+"/getduedatesjobs";
18064
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18065
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18066
- // this._SfLoader.innerHTML = '';
18067
- // if(xhr.status == 200) {
18068
- // const jsonRespose = JSON.parse(xhr.responseText);
18069
- // //console.log(jsonRespose);
18070
- // return jsonRespose;
18071
- // } else {
18072
- // const jsonRespose = JSON.parse(xhr.responseText);
18073
- // this.setError(jsonRespose.error);
18074
- // }
18075
- // }
18076
- // fetchApproversJobs = async () => {
18077
- // let url = "https://"+this.apiId+"/getapproversjobs";
18078
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18079
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18080
- // this._SfLoader.innerHTML = '';
18081
- // if(xhr.status == 200) {
18082
- // const jsonRespose = JSON.parse(xhr.responseText);
18083
- // //console.log(jsonRespose);
18084
- // return jsonRespose;
18085
- // } else {
18086
- // const jsonRespose = JSON.parse(xhr.responseText);
18087
- // this.setError(jsonRespose.error);
18088
- // }
18089
- // }
18090
- // fetchFunctionHeadsJobs = async () => {
18091
- // let url = "https://"+this.apiId+"/getfunctionheadsjobs";
18092
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18093
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18094
- // this._SfLoader.innerHTML = '';
18095
- // if(xhr.status == 200) {
18096
- // const jsonRespose = JSON.parse(xhr.responseText);
18097
- // //console.log(jsonRespose);
18098
- // return jsonRespose;
18099
- // } else {
18100
- // const jsonRespose = JSON.parse(xhr.responseText);
18101
- // this.setError(jsonRespose.error);
18102
- // }
18103
- // }
18104
- // fetchMakerCheckersJobs = async () => {
18105
- // let url = "https://"+this.apiId+"/getmakercheckersjobs";
18106
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18107
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18108
- // this._SfLoader.innerHTML = '';
18109
- // if(xhr.status == 200) {
18110
- // const jsonRespose = JSON.parse(xhr.responseText);
18111
- // //console.log(jsonRespose);
18112
- // return jsonRespose;
18113
- // } else {
18114
- // const jsonRespose = JSON.parse(xhr.responseText);
18115
- // this.setError(jsonRespose.error);
18116
- // }
18117
- // }
18118
- // fetchDocsJobs = async () => {
18119
- // let url = "https://"+this.apiId+"/getdocsjobs";
18120
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18121
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18122
- // this._SfLoader.innerHTML = '';
18123
- // if(xhr.status == 200) {
18124
- // const jsonRespose = JSON.parse(xhr.responseText);
18125
- // //console.log(jsonRespose);
18126
- // return jsonRespose;
18127
- // } else {
18128
- // const jsonRespose = JSON.parse(xhr.responseText);
18129
- // this.setError(jsonRespose.error);
18130
- // }
18131
- // }
18132
- // fetchAuditorsJobs = async () => {
18133
- // let url = "https://"+this.apiId+"/getauditorsjobs";
18134
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18135
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18136
- // this._SfLoader.innerHTML = '';
18137
- // if(xhr.status == 200) {
18138
- // const jsonRespose = JSON.parse(xhr.responseText);
18139
- // //console.log(jsonRespose);
18140
- // return jsonRespose;
18141
- // } else {
18142
- // const jsonRespose = JSON.parse(xhr.responseText);
18143
- // this.setError(jsonRespose.error);
18144
- // }
18145
- // }
18146
- // fetchViewersJobs = async () => {
18147
- // let url = "https://"+this.apiId+"/getviewersjobs";
18148
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18149
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18150
- // this._SfLoader.innerHTML = '';
18151
- // if(xhr.status == 200) {
18152
- // const jsonRespose = JSON.parse(xhr.responseText);
18153
- // //console.log(jsonRespose);
18154
- // return jsonRespose;
18155
- // } else {
18156
- // const jsonRespose = JSON.parse(xhr.responseText);
18157
- // this.setError(jsonRespose.error);
18158
- // }
18159
- // }
18160
- // fetchReportersJobs = async () => {
18161
- // let url = "https://"+this.apiId+"/getreportersjobs";
18162
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18163
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18164
- // this._SfLoader.innerHTML = '';
18165
- // if(xhr.status == 200) {
18166
- // const jsonRespose = JSON.parse(xhr.responseText);
18167
- // //console.log(jsonRespose);
18168
- // return jsonRespose;
18169
- // } else {
18170
- // const jsonRespose = JSON.parse(xhr.responseText);
18171
- // this.setError(jsonRespose.error);
18172
- // }
18173
- // }
18174
- // fetchTagsJobs = async () => {
18175
- // let url = "https://"+this.apiId+"/gettagsjobs";
18176
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18177
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18178
- // this._SfLoader.innerHTML = '';
18179
- // if(xhr.status == 200) {
18180
- // const jsonRespose = JSON.parse(xhr.responseText);
18181
- // //console.log(jsonRespose);
18182
- // return jsonRespose;
18183
- // } else {
18184
- // const jsonRespose = JSON.parse(xhr.responseText);
18185
- // this.setError(jsonRespose.error);
18186
- // }
18187
- // }
18188
- // fetchLocationsJobs = async () => {
18189
- // let url = "https://"+this.apiId+"/getlocationsjobs";
18190
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18191
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18192
- // this._SfLoader.innerHTML = '';
18193
- // if(xhr.status == 200) {
18194
- // const jsonRespose = JSON.parse(xhr.responseText);
18195
- // //console.log(jsonRespose);
18196
- // return jsonRespose;
18197
- // } else {
18198
- // const jsonRespose = JSON.parse(xhr.responseText);
18199
- // this.setError(jsonRespose.error);
18200
- // }
18201
- // }
18202
- // fetchCountriesJobs = async () => {
18203
- // let url = "https://"+this.apiId+"/getcountriesjobs";
18204
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18205
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18206
- // this._SfLoader.innerHTML = '';
18207
- // if(xhr.status == 200) {
18208
- // const jsonRespose = JSON.parse(xhr.responseText);
18209
- // //console.log(jsonRespose);
18210
- // return jsonRespose;
18211
- // } else {
18212
- // const jsonRespose = JSON.parse(xhr.responseText);
18213
- // this.setError(jsonRespose.error);
18214
- // }
18215
- // }
18216
- // fetchEntitiesJobs = async () => {
18217
- // let url = "https://"+this.apiId+"/getentitiesjobs";
18218
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18219
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18220
- // this._SfLoader.innerHTML = '';
18221
- // if(xhr.status == 200) {
18222
- // const jsonRespose = JSON.parse(xhr.responseText);
18223
- // //console.log(jsonRespose);
18224
- // return jsonRespose;
18225
- // } else {
18226
- // const jsonRespose = JSON.parse(xhr.responseText);
18227
- // this.setError(jsonRespose.error);
18228
- // }
18229
- // }
18230
- // fetchFunctionJobs = async () => {
18231
- // let url = "https://"+this.apiId+"/getfunctionsjobs";
18232
- // const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18233
- // const xhr : any = (await this.prepareXhr({"projectid": this.projectId}, url, this._SfLoader, authorization)) as any;
18234
- // this._SfLoader.innerHTML = '';
18235
- // if(xhr.status == 200) {
18236
- // const jsonRespose = JSON.parse(xhr.responseText);
18237
- // //console.log(jsonRespose);
18238
- // return jsonRespose;
18239
- // } else {
18240
- // const jsonRespose = JSON.parse(xhr.responseText);
18241
- // this.setError(jsonRespose.error);
18242
- // }
18243
- // }
18244
18203
  this.fetchCalendarJobs = async () => {
18245
18204
  let url = "https://" + this.apiId + "/getcalendarjobs";
18246
18205
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
@@ -18252,6 +18211,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18252
18211
  return jsonRespose;
18253
18212
  }
18254
18213
  else {
18214
+ if (xhr.status == 401) {
18215
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18216
+ this.dispatchEvent(changeEvent);
18217
+ }
18255
18218
  const jsonRespose = JSON.parse(xhr.responseText);
18256
18219
  this.setError(jsonRespose.error);
18257
18220
  }
@@ -18272,6 +18235,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18272
18235
  this.processEvent(jsonRespose.data.value);
18273
18236
  }
18274
18237
  else {
18238
+ if (xhr.status == 401) {
18239
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18240
+ this.dispatchEvent(changeEvent);
18241
+ }
18275
18242
  const jsonRespose = JSON.parse(xhr.responseText);
18276
18243
  this.setError(jsonRespose.error);
18277
18244
  }
@@ -18291,6 +18258,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18291
18258
  return jsonRespose;
18292
18259
  }
18293
18260
  else {
18261
+ if (xhr.status == 401) {
18262
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18263
+ this.dispatchEvent(changeEvent);
18264
+ }
18294
18265
  const jsonRespose = JSON.parse(xhr.responseText);
18295
18266
  return jsonRespose;
18296
18267
  }
@@ -18347,6 +18318,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18347
18318
  //console.log(jsonRespose);
18348
18319
  return registers;
18349
18320
  }
18321
+ else if (xhr.status == 401) {
18322
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18323
+ this.dispatchEvent(changeEvent);
18324
+ }
18350
18325
  };
18351
18326
  this.renderWithFeatures = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00") => {
18352
18327
  this.events = [];
@@ -18449,6 +18424,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18449
18424
  // } while(1)
18450
18425
  }
18451
18426
  else {
18427
+ if (xhr.status == 401) {
18428
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18429
+ this.dispatchEvent(changeEvent);
18430
+ }
18452
18431
  if (xhr.status === 404) {
18453
18432
  this.showChosenProject();
18454
18433
  this._SfTitleChosenProject.innerHTML = this._SfProject[0].querySelector('#sf-i-project').selectedTexts()[0];
@@ -18514,6 +18493,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18514
18493
  console.log('notices', notices, tempEvents);
18515
18494
  }
18516
18495
  else {
18496
+ if (xhr.status == 401) {
18497
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18498
+ this.dispatchEvent(changeEvent);
18499
+ }
18517
18500
  if (xhr.status === 404) {
18518
18501
  this.showChosenProject();
18519
18502
  this._SfTitleChosenProject.innerHTML = this._SfProject[0].querySelector('#sf-i-project').selectedTexts()[0];
@@ -18586,6 +18569,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18586
18569
  return jsonRespose.meta;
18587
18570
  }
18588
18571
  else {
18572
+ if (xhr.status == 401) {
18573
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18574
+ this.dispatchEvent(changeEvent);
18575
+ }
18589
18576
  const jsonRespose = JSON.parse(xhr.responseText);
18590
18577
  this.setError(jsonRespose.error);
18591
18578
  }
@@ -18644,6 +18631,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18644
18631
  }
18645
18632
  }
18646
18633
  }
18634
+ else if (xhr.status == 401) {
18635
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18636
+ this.dispatchEvent(changeEvent);
18637
+ }
18647
18638
  };
18648
18639
  this.fetchUserCalendar = async () => {
18649
18640
  let url = "https://" + this.apiId + "/getuserevents";
@@ -18662,6 +18653,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18662
18653
  // this.renderChosenProject(events);
18663
18654
  }
18664
18655
  else {
18656
+ if (xhr.status == 401) {
18657
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18658
+ this.dispatchEvent(changeEvent);
18659
+ }
18665
18660
  if (xhr.status === 404) {
18666
18661
  this.showChosenProject();
18667
18662
  this._SfTitleChosenProject.innerHTML = this._SfProject[0].querySelector('#sf-i-project').selectedTexts()[0];
@@ -18692,6 +18687,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18692
18687
  // this.renderChosenProject(events);
18693
18688
  }
18694
18689
  else {
18690
+ if (xhr.status == 401) {
18691
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18692
+ this.dispatchEvent(changeEvent);
18693
+ }
18695
18694
  if (xhr.status === 404) {
18696
18695
  this.showChosenProject();
18697
18696
  this._SfTitleChosenProject.innerHTML = this._SfProject[0].querySelector('#sf-i-project').selectedTexts()[0];
@@ -18713,6 +18712,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18713
18712
  //console.log(jsonRespose);
18714
18713
  }
18715
18714
  else {
18715
+ if (xhr.status == 401) {
18716
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18717
+ this.dispatchEvent(changeEvent);
18718
+ }
18716
18719
  const jsonRespose = JSON.parse(xhr.responseText);
18717
18720
  this.setError(jsonRespose.error);
18718
18721
  this.fetchList();
@@ -18747,6 +18750,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18747
18750
  return jsonRespose;
18748
18751
  }
18749
18752
  else {
18753
+ if (xhr.status == 401) {
18754
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18755
+ this.dispatchEvent(changeEvent);
18756
+ }
18750
18757
  const jsonRespose = JSON.parse(xhr.responseText);
18751
18758
  this.setError(jsonRespose.error);
18752
18759
  this.fetchList();
@@ -18780,6 +18787,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18780
18787
  }
18781
18788
  }
18782
18789
  else {
18790
+ if (xhr.status == 401) {
18791
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18792
+ this.dispatchEvent(changeEvent);
18793
+ }
18783
18794
  const jsonRespose = JSON.parse(xhr.responseText);
18784
18795
  this.setError(jsonRespose.error);
18785
18796
  this.fetchList();
@@ -18814,6 +18825,10 @@ let SfIEvents = class SfIEvents extends LitElement {
18814
18825
  //await this.fetchAdhoc(true);
18815
18826
  }
18816
18827
  else {
18828
+ if (xhr.status == 401) {
18829
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
18830
+ this.dispatchEvent(changeEvent);
18831
+ }
18817
18832
  const jsonRespose = JSON.parse(xhr.responseText);
18818
18833
  this.setError(jsonRespose.error);
18819
18834
  }
@@ -19028,6 +19043,10 @@ let SfIEvents = class SfIEvents extends LitElement {
19028
19043
  }, 2000);
19029
19044
  }
19030
19045
  else {
19046
+ if (xhr.status == 401) {
19047
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
19048
+ this.dispatchEvent(changeEvent);
19049
+ }
19031
19050
  const jsonRespose = JSON.parse(xhr.responseText);
19032
19051
  this.setError(jsonRespose.error);
19033
19052
  setTimeout(() => {
@@ -19073,6 +19092,10 @@ let SfIEvents = class SfIEvents extends LitElement {
19073
19092
  this.renderNextEvents(jsonRespose.data, page, role);
19074
19093
  }
19075
19094
  else {
19095
+ if (xhr.status == 401) {
19096
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
19097
+ this.dispatchEvent(changeEvent);
19098
+ }
19076
19099
  if (xhr.status === 404) {
19077
19100
  const jsonRespose = JSON.parse(xhr.responseText);
19078
19101
  this.setError(jsonRespose.error);
@@ -19490,6 +19513,10 @@ let SfIEvents = class SfIEvents extends LitElement {
19490
19513
  this.renderReports(arrReports);
19491
19514
  }
19492
19515
  else {
19516
+ if (xhr.status == 401) {
19517
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
19518
+ this.dispatchEvent(changeEvent);
19519
+ }
19493
19520
  if (xhr.status === 404) {
19494
19521
  const jsonRespose = JSON.parse(xhr.responseText);
19495
19522
  this.setError(jsonRespose.error);
@@ -19642,6 +19669,10 @@ let SfIEvents = class SfIEvents extends LitElement {
19642
19669
  // this.renderReportsComplainces(arrCompliances, sortid);
19643
19670
  }
19644
19671
  else {
19672
+ if (xhr.status == 401) {
19673
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
19674
+ this.dispatchEvent(changeEvent);
19675
+ }
19645
19676
  if (xhr.status === 404) {
19646
19677
  this.showChosenProject();
19647
19678
  this._SfTitleChosenProject.innerHTML = this._SfProject[0].querySelector('#sf-i-project').selectedTexts()[0];
@@ -19718,6 +19749,10 @@ let SfIEvents = class SfIEvents extends LitElement {
19718
19749
  this.renderReportsComplainces(arrCompliances, sortid);
19719
19750
  }
19720
19751
  else {
19752
+ if (xhr.status == 401) {
19753
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
19754
+ this.dispatchEvent(changeEvent);
19755
+ }
19721
19756
  if (xhr.status === 404) {
19722
19757
  this.showChosenProject();
19723
19758
  this._SfTitleChosenProject.innerHTML = this._SfProject[0].querySelector('#sf-i-project').selectedTexts()[0];
@@ -19851,6 +19886,10 @@ let SfIEvents = class SfIEvents extends LitElement {
19851
19886
  }, 3000);
19852
19887
  }
19853
19888
  else {
19889
+ if (xhr.status == 401) {
19890
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
19891
+ this.dispatchEvent(changeEvent);
19892
+ }
19854
19893
  if (xhr.status === 404) {
19855
19894
  const jsonRespose = JSON.parse(xhr.responseText);
19856
19895
  this.setError(jsonRespose.error);
@@ -20276,7 +20315,7 @@ let SfIEvents = class SfIEvents extends LitElement {
20276
20315
  `;
20277
20316
  }
20278
20317
  else if (this.mode == "downloader") {
20279
- //disable
20318
+ /* eslint-disable lit/no-unknown-attribute */
20280
20319
  return html `
20281
20320
 
20282
20321
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
@@ -20326,6 +20365,7 @@ let SfIEvents = class SfIEvents extends LitElement {
20326
20365
  </div>
20327
20366
 
20328
20367
  `;
20368
+ /* eslint-disable lit/no-unknown-attribute */
20329
20369
  }
20330
20370
  else if (this.mode == "next") {
20331
20371
  return html `