asap-viewer 12.6.21 → 12.6.22
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/asap-viewer.d.ts +0 -1
- package/asap-viewer.metadata.json +1 -1
- package/bundles/asap-viewer.umd.js +1532 -1844
- package/bundles/asap-viewer.umd.js.map +1 -1
- package/bundles/asap-viewer.umd.min.js +1 -1
- package/bundles/asap-viewer.umd.min.js.map +1 -1
- package/esm2015/asap-viewer.js +1 -2
- package/esm2015/lib/@core/services/offline-storage.service.js +1 -1
- package/esm2015/lib/asap-viewer.module.js +1 -10
- package/esm2015/lib/editor/components/video/video.component.js +1 -9
- package/esm2015/lib/visualizador/curso-visualizador/curso-visualizador.component.js +13 -93
- package/esm2015/lib/visualizador/curso-visualizador/viewer/viewer.component.js +26 -81
- package/esm5/asap-viewer.js +1 -2
- package/esm5/lib/@core/services/offline-storage.service.js +1 -1
- package/esm5/lib/asap-viewer.module.js +1 -10
- package/esm5/lib/editor/components/video/video.component.js +1 -9
- package/esm5/lib/visualizador/curso-visualizador/curso-visualizador.component.js +13 -108
- package/esm5/lib/visualizador/curso-visualizador/viewer/viewer.component.js +41 -119
- package/fesm2015/asap-viewer.js +1373 -1635
- package/fesm2015/asap-viewer.js.map +1 -1
- package/fesm5/asap-viewer.js +1534 -1845
- package/fesm5/asap-viewer.js.map +1 -1
- package/lib/visualizador/curso-visualizador/curso-visualizador.component.d.ts +0 -1
- package/lib/visualizador/curso-visualizador/viewer/viewer.component.d.ts +1 -1
- package/package.json +1 -1
- package/esm2015/lib/@core/interceptors/offline.interceptor.js +0 -119
- package/esm5/lib/@core/interceptors/offline.interceptor.js +0 -130
- package/lib/@core/interceptors/offline.interceptor.d.ts +0 -9
package/fesm5/asap-viewer.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { Component, ViewEncapsulation, ViewChild, Injectable, ElementRef, EventEmitter, Input, Output, Renderer2, NgModule, Pipe,
|
|
2
|
-
import { __extends, __values, __awaiter, __generator, __assign
|
|
3
|
-
import { HttpClient, HttpResponse, HttpRequest, HttpHeaders, HttpEventType, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
1
|
+
import { Component, ViewEncapsulation, ViewChild, Injectable, ElementRef, EventEmitter, Input, Output, Renderer2, NgModule, Pipe, Directive, ɵɵdefineInjectable, ChangeDetectorRef, Inject, Optional, ɵɵinject, LOCALE_ID } from '@angular/core';
|
|
2
|
+
import { __extends, __values, __spread, __awaiter, __generator, __assign } from 'tslib';
|
|
4
3
|
import { Location, CommonModule, registerLocaleData } from '@angular/common';
|
|
5
4
|
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
|
6
5
|
import { FormsModule, ReactiveFormsModule, FormControl, FormArray, FormGroup, FormBuilder, Validators } from '@angular/forms';
|
|
7
6
|
import { Global, AsapService, AsapClientPipe as AsapClientPipe$1 } from 'asap-crud';
|
|
7
|
+
import { HttpClient, HttpRequest, HttpHeaders, HttpEventType, HttpResponse } from '@angular/common/http';
|
|
8
8
|
import { trigger, transition, style, animate, group, query, stagger, animateChild } from '@angular/animations';
|
|
9
9
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
10
10
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
11
|
-
import { BehaviorSubject, merge, of, fromEvent, from, throwError, Subscription } from 'rxjs';
|
|
12
|
-
import { map, catchError, switchMap, debounceTime, distinctUntilChanged, startWith } from 'rxjs/operators';
|
|
13
11
|
import { ColorPickerModule } from 'ngx-color-picker';
|
|
14
12
|
import { MatSelectModule } from '@angular/material/select';
|
|
15
13
|
import { MatInputModule } from '@angular/material/input';
|
|
@@ -18,6 +16,8 @@ import { MatRadioModule } from '@angular/material/radio';
|
|
|
18
16
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
19
17
|
import { MatSliderModule } from '@angular/material/slider';
|
|
20
18
|
import { MomentModule } from 'ngx-moment';
|
|
19
|
+
import { of, BehaviorSubject, merge, fromEvent, Subscription } from 'rxjs';
|
|
20
|
+
import { catchError, map, debounceTime, distinctUntilChanged, startWith } from 'rxjs/operators';
|
|
21
21
|
import Swal from 'sweetalert2';
|
|
22
22
|
import * as moment$1 from 'moment';
|
|
23
23
|
import { locale } from 'moment';
|
|
@@ -2849,1914 +2849,1790 @@ var SpinnerModule = /** @class */ (function () {
|
|
|
2849
2849
|
|
|
2850
2850
|
/**
|
|
2851
2851
|
* @fileoverview added by tsickle
|
|
2852
|
-
* Generated from: lib
|
|
2852
|
+
* Generated from: lib/shared/file-manager/models/file-manager.model.ts
|
|
2853
2853
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2854
2854
|
*/
|
|
2855
|
-
/**
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2855
|
+
var FileManagerModel = /** @class */ (function () {
|
|
2856
|
+
function FileManagerModel(http, global) {
|
|
2857
|
+
this.http = http;
|
|
2858
|
+
this.global = global;
|
|
2859
|
+
this.apiBaseUrl = this.global.apiURL();
|
|
2860
|
+
}
|
|
2861
|
+
/**
|
|
2862
|
+
* @param {?} data
|
|
2863
|
+
* @return {?}
|
|
2864
|
+
*/
|
|
2865
|
+
FileManagerModel.prototype.populate = /**
|
|
2866
|
+
* @param {?} data
|
|
2867
|
+
* @return {?}
|
|
2868
|
+
*/
|
|
2869
|
+
function (data) {
|
|
2870
|
+
return undefined;
|
|
2871
|
+
};
|
|
2872
|
+
/**
|
|
2873
|
+
* @param {?} data
|
|
2874
|
+
* @return {?}
|
|
2875
|
+
*/
|
|
2876
|
+
FileManagerModel.prototype.uploadFile = /**
|
|
2877
|
+
* @param {?} data
|
|
2878
|
+
* @return {?}
|
|
2879
|
+
*/
|
|
2880
|
+
function (data) {
|
|
2881
|
+
/** @type {?} */
|
|
2882
|
+
var formData = new FormData();
|
|
2883
|
+
formData.append('file', data.file);
|
|
2884
|
+
formData.append('name', data.name);
|
|
2885
|
+
formData.append('description', data.description);
|
|
2886
|
+
/** @type {?} */
|
|
2887
|
+
var headerOptions = {
|
|
2888
|
+
'Authorization': localStorage.getItem('token'),
|
|
2889
|
+
'Accept': 'application/json'
|
|
2890
|
+
};
|
|
2891
|
+
/** @type {?} */
|
|
2892
|
+
var req = new HttpRequest('POST', this.apiBaseUrl + '/api/v2/admin/file', formData, {
|
|
2893
|
+
reportProgress: true,
|
|
2894
|
+
responseType: 'json',
|
|
2895
|
+
headers: new HttpHeaders(headerOptions)
|
|
2896
|
+
});
|
|
2897
|
+
return this.http.request(req);
|
|
2898
|
+
// return this.http.post(this.apiBaseUrl + '/api/v2/admin/file', data, {headers: new HttpHeaders(headerOptions)});
|
|
2899
|
+
};
|
|
2900
|
+
/**
|
|
2901
|
+
* @return {?}
|
|
2902
|
+
*/
|
|
2903
|
+
FileManagerModel.prototype.getAll = /**
|
|
2904
|
+
* @return {?}
|
|
2905
|
+
*/
|
|
2906
|
+
function () {
|
|
2907
|
+
return this.http.get(this.apiBaseUrl + '/api/v2/admin/file/all', { headers: this.getHeader() });
|
|
2908
|
+
};
|
|
2909
|
+
/**
|
|
2910
|
+
* @param {?} id
|
|
2911
|
+
* @return {?}
|
|
2912
|
+
*/
|
|
2913
|
+
FileManagerModel.prototype.deleteFile = /**
|
|
2914
|
+
* @param {?} id
|
|
2915
|
+
* @return {?}
|
|
2916
|
+
*/
|
|
2917
|
+
function (id) {
|
|
2918
|
+
return this.http.delete(this.apiBaseUrl + '/api/v2/admin/file/' + id, { headers: this.getHeader() });
|
|
2919
|
+
};
|
|
2920
|
+
/**
|
|
2921
|
+
* @return {?}
|
|
2922
|
+
*/
|
|
2923
|
+
FileManagerModel.prototype.changeFile = /**
|
|
2924
|
+
* @return {?}
|
|
2925
|
+
*/
|
|
2926
|
+
function () {
|
|
2927
|
+
return undefined;
|
|
2928
|
+
};
|
|
2929
|
+
/**
|
|
2930
|
+
* @return {?}
|
|
2931
|
+
*/
|
|
2932
|
+
FileManagerModel.prototype.getHeader = /**
|
|
2933
|
+
* @return {?}
|
|
2934
|
+
*/
|
|
2935
|
+
function () {
|
|
2936
|
+
/** @type {?} */
|
|
2937
|
+
var token = localStorage.getItem('token');
|
|
2938
|
+
if (token) {
|
|
2939
|
+
/** @type {?} */
|
|
2940
|
+
var headerOptions = {
|
|
2941
|
+
'Authorization': token,
|
|
2942
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
2943
|
+
'Accept': 'application/json'
|
|
2944
|
+
};
|
|
2945
|
+
return new HttpHeaders(headerOptions);
|
|
2946
|
+
}
|
|
2947
|
+
};
|
|
2948
|
+
FileManagerModel.decorators = [
|
|
2949
|
+
{ type: Injectable }
|
|
2950
|
+
];
|
|
2951
|
+
/** @nocollapse */
|
|
2952
|
+
FileManagerModel.ctorParameters = function () { return [
|
|
2953
|
+
{ type: HttpClient },
|
|
2954
|
+
{ type: Global }
|
|
2955
|
+
]; };
|
|
2956
|
+
return FileManagerModel;
|
|
2957
|
+
}());
|
|
2859
2958
|
if (false) {
|
|
2860
2959
|
/** @type {?} */
|
|
2861
|
-
|
|
2862
|
-
/** @type {?} */
|
|
2863
|
-
DownloadedLesson.prototype.trailId;
|
|
2864
|
-
/** @type {?} */
|
|
2865
|
-
DownloadedLesson.prototype.title;
|
|
2866
|
-
/** @type {?|undefined} */
|
|
2867
|
-
DownloadedLesson.prototype.subtitle;
|
|
2868
|
-
/** @type {?|undefined} */
|
|
2869
|
-
DownloadedLesson.prototype.thumbnail;
|
|
2870
|
-
/** @type {?} */
|
|
2871
|
-
DownloadedLesson.prototype.sizeBytes;
|
|
2872
|
-
/** @type {?} */
|
|
2873
|
-
DownloadedLesson.prototype.sizeFormatted;
|
|
2874
|
-
/** @type {?} */
|
|
2875
|
-
DownloadedLesson.prototype.downloadedAt;
|
|
2876
|
-
/** @type {?} */
|
|
2877
|
-
DownloadedLesson.prototype.stageData;
|
|
2878
|
-
/** @type {?} */
|
|
2879
|
-
DownloadedLesson.prototype.stages;
|
|
2880
|
-
/** @type {?|undefined} */
|
|
2881
|
-
DownloadedLesson.prototype.videoBlob;
|
|
2882
|
-
/** @type {?|undefined} */
|
|
2883
|
-
DownloadedLesson.prototype.videoMimeType;
|
|
2884
|
-
}
|
|
2885
|
-
/**
|
|
2886
|
-
* @record
|
|
2887
|
-
*/
|
|
2888
|
-
function SyncAction() { }
|
|
2889
|
-
if (false) {
|
|
2890
|
-
/** @type {?|undefined} */
|
|
2891
|
-
SyncAction.prototype.id;
|
|
2960
|
+
FileManagerModel.prototype.file;
|
|
2892
2961
|
/** @type {?} */
|
|
2893
|
-
|
|
2962
|
+
FileManagerModel.prototype.name;
|
|
2894
2963
|
/** @type {?} */
|
|
2895
|
-
|
|
2964
|
+
FileManagerModel.prototype.description;
|
|
2896
2965
|
/** @type {?} */
|
|
2897
|
-
|
|
2966
|
+
FileManagerModel.prototype.apiBaseUrl;
|
|
2967
|
+
/**
|
|
2968
|
+
* @type {?}
|
|
2969
|
+
* @private
|
|
2970
|
+
*/
|
|
2971
|
+
FileManagerModel.prototype.http;
|
|
2898
2972
|
/** @type {?} */
|
|
2899
|
-
|
|
2900
|
-
}
|
|
2973
|
+
FileManagerModel.prototype.global;
|
|
2974
|
+
}
|
|
2975
|
+
|
|
2901
2976
|
/**
|
|
2902
|
-
* @
|
|
2977
|
+
* @fileoverview added by tsickle
|
|
2978
|
+
* Generated from: lib/shared/file-manager/services/file-manager.service.ts
|
|
2979
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2903
2980
|
*/
|
|
2904
|
-
function
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
DownloadProgress.prototype.progress;
|
|
2910
|
-
/** @type {?} */
|
|
2911
|
-
DownloadProgress.prototype.loaded;
|
|
2912
|
-
/** @type {?} */
|
|
2913
|
-
DownloadProgress.prototype.total;
|
|
2914
|
-
/** @type {?} */
|
|
2915
|
-
DownloadProgress.prototype.status;
|
|
2916
|
-
}
|
|
2917
|
-
var OfflineStorageService = /** @class */ (function () {
|
|
2918
|
-
function OfflineStorageService() {
|
|
2919
|
-
var _this = this;
|
|
2920
|
-
this.DB_NAME = 'AsapOfflineCoursesDB';
|
|
2921
|
-
this.DB_VERSION = 1;
|
|
2922
|
-
this.STORE_LESSONS = 'lessons';
|
|
2923
|
-
this.STORE_SYNC_QUEUE = 'sync_queue';
|
|
2924
|
-
this.db = null;
|
|
2925
|
-
this.isOnlineSubject = new BehaviorSubject(navigator.onLine);
|
|
2926
|
-
this.isOnline$ = this.isOnlineSubject.asObservable();
|
|
2927
|
-
this.downloadProgress$ = new BehaviorSubject({});
|
|
2928
|
-
this.downloadedLessons$ = new BehaviorSubject([]);
|
|
2929
|
-
this.initNetworkListeners();
|
|
2930
|
-
this.initDatabase().then((/**
|
|
2931
|
-
* @return {?}
|
|
2932
|
-
*/
|
|
2933
|
-
function () {
|
|
2934
|
-
_this.refreshDownloadedLessons();
|
|
2935
|
-
if (navigator.onLine) {
|
|
2936
|
-
_this.processSyncQueue();
|
|
2937
|
-
}
|
|
2938
|
-
}));
|
|
2981
|
+
var FileManagerService = /** @class */ (function () {
|
|
2982
|
+
function FileManagerService(fileManagerModel, httpClient, global) {
|
|
2983
|
+
this.fileManagerModel = fileManagerModel;
|
|
2984
|
+
this.httpClient = httpClient;
|
|
2985
|
+
this.global = global;
|
|
2939
2986
|
}
|
|
2940
2987
|
/**
|
|
2941
|
-
* @
|
|
2988
|
+
* @param {?} data
|
|
2942
2989
|
* @return {?}
|
|
2943
2990
|
*/
|
|
2944
|
-
|
|
2945
|
-
* @
|
|
2991
|
+
FileManagerService.prototype.uploadFile = /**
|
|
2992
|
+
* @param {?} data
|
|
2946
2993
|
* @return {?}
|
|
2947
2994
|
*/
|
|
2948
|
-
function () {
|
|
2949
|
-
|
|
2950
|
-
merge(of(navigator.onLine), fromEvent(window, 'online').pipe(map((/**
|
|
2951
|
-
* @return {?}
|
|
2952
|
-
*/
|
|
2953
|
-
function () { return true; }))), fromEvent(window, 'offline').pipe(map((/**
|
|
2954
|
-
* @return {?}
|
|
2955
|
-
*/
|
|
2956
|
-
function () { return false; })))).subscribe((/**
|
|
2957
|
-
* @param {?} online
|
|
2958
|
-
* @return {?}
|
|
2959
|
-
*/
|
|
2960
|
-
function (online) {
|
|
2961
|
-
_this.isOnlineSubject.next(online);
|
|
2962
|
-
if (online) {
|
|
2963
|
-
console.log('[OfflineStorageService] Conexão restabelecida! Processando fila de sincronização...');
|
|
2964
|
-
_this.processSyncQueue();
|
|
2965
|
-
}
|
|
2966
|
-
else {
|
|
2967
|
-
console.warn('[OfflineStorageService] Aplicação operando em MODO OFFLINE.');
|
|
2968
|
-
}
|
|
2969
|
-
}));
|
|
2995
|
+
function (data) {
|
|
2996
|
+
return this.fileManagerModel.uploadFile(this.serialize(data));
|
|
2970
2997
|
};
|
|
2971
2998
|
/**
|
|
2972
|
-
* @
|
|
2999
|
+
* @param {?} id
|
|
2973
3000
|
* @return {?}
|
|
2974
3001
|
*/
|
|
2975
|
-
|
|
2976
|
-
* @
|
|
3002
|
+
FileManagerService.prototype.removeFile = /**
|
|
3003
|
+
* @param {?} id
|
|
3004
|
+
* @return {?}
|
|
3005
|
+
*/
|
|
3006
|
+
function (id) {
|
|
3007
|
+
if (id) {
|
|
3008
|
+
return this.fileManagerModel.deleteFile(id);
|
|
3009
|
+
}
|
|
3010
|
+
else {
|
|
3011
|
+
return null;
|
|
3012
|
+
}
|
|
3013
|
+
};
|
|
3014
|
+
/**
|
|
3015
|
+
* @return {?}
|
|
3016
|
+
*/
|
|
3017
|
+
FileManagerService.prototype.findFileCollection = /**
|
|
2977
3018
|
* @return {?}
|
|
2978
3019
|
*/
|
|
2979
3020
|
function () {
|
|
2980
|
-
|
|
2981
|
-
return new Promise((/**
|
|
2982
|
-
* @param {?} resolve
|
|
2983
|
-
* @param {?} reject
|
|
2984
|
-
* @return {?}
|
|
2985
|
-
*/
|
|
2986
|
-
function (resolve, reject) {
|
|
2987
|
-
if (_this.db) {
|
|
2988
|
-
return resolve(_this.db);
|
|
2989
|
-
}
|
|
2990
|
-
if (!('indexedDB' in window)) {
|
|
2991
|
-
console.error('[OfflineStorageService] IndexedDB não é suportado neste navegador.');
|
|
2992
|
-
return reject(new Error('IndexedDB não suportado'));
|
|
2993
|
-
}
|
|
2994
|
-
/** @type {?} */
|
|
2995
|
-
var request = indexedDB.open(_this.DB_NAME, _this.DB_VERSION);
|
|
2996
|
-
request.onupgradeneeded = (/**
|
|
2997
|
-
* @param {?} event
|
|
2998
|
-
* @return {?}
|
|
2999
|
-
*/
|
|
3000
|
-
function (event) {
|
|
3001
|
-
/** @type {?} */
|
|
3002
|
-
var db = (/** @type {?} */ (event.target.result));
|
|
3003
|
-
if (!db.objectStoreNames.contains(_this.STORE_LESSONS)) {
|
|
3004
|
-
/** @type {?} */
|
|
3005
|
-
var lessonStore = db.createObjectStore(_this.STORE_LESSONS, { keyPath: 'id' });
|
|
3006
|
-
lessonStore.createIndex('trailId', 'trailId', { unique: false });
|
|
3007
|
-
lessonStore.createIndex('downloadedAt', 'downloadedAt', { unique: false });
|
|
3008
|
-
}
|
|
3009
|
-
if (!db.objectStoreNames.contains(_this.STORE_SYNC_QUEUE)) {
|
|
3010
|
-
/** @type {?} */
|
|
3011
|
-
var syncStore = db.createObjectStore(_this.STORE_SYNC_QUEUE, { keyPath: 'id', autoIncrement: true });
|
|
3012
|
-
syncStore.createIndex('createdAt', 'createdAt', { unique: false });
|
|
3013
|
-
}
|
|
3014
|
-
});
|
|
3015
|
-
request.onsuccess = (/**
|
|
3016
|
-
* @param {?} event
|
|
3017
|
-
* @return {?}
|
|
3018
|
-
*/
|
|
3019
|
-
function (event) {
|
|
3020
|
-
_this.db = (/** @type {?} */ (event.target.result));
|
|
3021
|
-
if (navigator.storage && navigator.storage.persist) {
|
|
3022
|
-
navigator.storage.persist().then((/**
|
|
3023
|
-
* @param {?} persistent
|
|
3024
|
-
* @return {?}
|
|
3025
|
-
*/
|
|
3026
|
-
function (persistent) {
|
|
3027
|
-
console.log("[OfflineStorageService] Armazenamento persistente: " + (persistent ? 'Ativado' : 'Padrão'));
|
|
3028
|
-
}));
|
|
3029
|
-
}
|
|
3030
|
-
resolve(_this.db);
|
|
3031
|
-
});
|
|
3032
|
-
request.onerror = (/**
|
|
3033
|
-
* @param {?} event
|
|
3034
|
-
* @return {?}
|
|
3035
|
-
*/
|
|
3036
|
-
function (event) {
|
|
3037
|
-
console.error('[OfflineStorageService] Erro ao abrir IndexedDB:', event.target.error);
|
|
3038
|
-
reject(event.target.error);
|
|
3039
|
-
});
|
|
3040
|
-
}));
|
|
3021
|
+
return this.fileManagerModel.getAll();
|
|
3041
3022
|
};
|
|
3042
3023
|
/**
|
|
3043
|
-
* @param {?}
|
|
3024
|
+
* @param {?} data
|
|
3044
3025
|
* @return {?}
|
|
3045
3026
|
*/
|
|
3046
|
-
|
|
3047
|
-
* @param {?}
|
|
3027
|
+
FileManagerService.prototype.serialize = /**
|
|
3028
|
+
* @param {?} data
|
|
3048
3029
|
* @return {?}
|
|
3049
3030
|
*/
|
|
3050
|
-
function (
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
case 1:
|
|
3058
|
-
db = _a.sent();
|
|
3059
|
-
stageId = String(lessonData.id);
|
|
3060
|
-
this.updateProgress(stageId, 0, 0, 100, 'downloading');
|
|
3061
|
-
sizeBytes = JSON.stringify(lessonData.stageData || {}).length;
|
|
3062
|
-
targetVideoUrl = lessonData.videoUrl;
|
|
3063
|
-
// Se for Vimeo ou YouTube (onde o navegador não consegue baixar direto pelo frontend sem endpoint backend),
|
|
3064
|
-
// utiliza uma URL de vídeo MP4 com CORS aberto garantido (GitHub Raw / MDN) para o teste offline
|
|
3065
|
-
if (!targetVideoUrl || targetVideoUrl.includes('youtube.com') || targetVideoUrl.includes('vimeo.com')) {
|
|
3066
|
-
targetVideoUrl = 'https://raw.githubusercontent.com/mediaelement/mediaelement-files/master/big_buck_bunny.mp4';
|
|
3067
|
-
}
|
|
3068
|
-
if (!targetVideoUrl) return [3 /*break*/, 9];
|
|
3069
|
-
_a.label = 2;
|
|
3070
|
-
case 2:
|
|
3071
|
-
_a.trys.push([2, 4, , 9]);
|
|
3072
|
-
return [4 /*yield*/, this.fetchBlobWithProgress(targetVideoUrl, stageId)];
|
|
3073
|
-
case 3:
|
|
3074
|
-
videoBlob = _a.sent();
|
|
3075
|
-
if (videoBlob) {
|
|
3076
|
-
sizeBytes += videoBlob.size;
|
|
3077
|
-
console.log("[OfflineStorageService] V\u00EDdeo baixado com sucesso! Tamanho: " + this.formatBytes(videoBlob.size));
|
|
3078
|
-
}
|
|
3079
|
-
return [3 /*break*/, 9];
|
|
3080
|
-
case 4:
|
|
3081
|
-
err_1 = _a.sent();
|
|
3082
|
-
console.warn('[OfflineStorageService] Tentando URL alternativa para download de teste...', err_1);
|
|
3083
|
-
_a.label = 5;
|
|
3084
|
-
case 5:
|
|
3085
|
-
_a.trys.push([5, 7, , 8]);
|
|
3086
|
-
return [4 /*yield*/, this.fetchBlobWithProgress('https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4', stageId)];
|
|
3087
|
-
case 6:
|
|
3088
|
-
videoBlob = _a.sent();
|
|
3089
|
-
if (videoBlob) {
|
|
3090
|
-
sizeBytes += videoBlob.size;
|
|
3091
|
-
}
|
|
3092
|
-
return [3 /*break*/, 8];
|
|
3093
|
-
case 7:
|
|
3094
|
-
e2_1 = _a.sent();
|
|
3095
|
-
console.warn('[OfflineStorageService] Falha ao baixar vídeo direto:', e2_1);
|
|
3096
|
-
return [3 /*break*/, 8];
|
|
3097
|
-
case 8: return [3 /*break*/, 9];
|
|
3098
|
-
case 9:
|
|
3099
|
-
downloadedItem = {
|
|
3100
|
-
id: lessonData.id,
|
|
3101
|
-
trailId: lessonData.trailId,
|
|
3102
|
-
title: lessonData.title,
|
|
3103
|
-
subtitle: lessonData.subtitle || '',
|
|
3104
|
-
thumbnail: lessonData.thumbnail || '',
|
|
3105
|
-
sizeBytes: sizeBytes,
|
|
3106
|
-
sizeFormatted: this.formatBytes(sizeBytes),
|
|
3107
|
-
downloadedAt: new Date(),
|
|
3108
|
-
stageData: lessonData.stageData,
|
|
3109
|
-
stages: lessonData.stages || [],
|
|
3110
|
-
videoBlob: videoBlob,
|
|
3111
|
-
videoMimeType: videoBlob ? videoBlob.type : 'video/mp4'
|
|
3112
|
-
};
|
|
3113
|
-
return [2 /*return*/, new Promise((/**
|
|
3114
|
-
* @param {?} resolve
|
|
3115
|
-
* @param {?} reject
|
|
3116
|
-
* @return {?}
|
|
3117
|
-
*/
|
|
3118
|
-
function (resolve, reject) {
|
|
3119
|
-
/** @type {?} */
|
|
3120
|
-
var transaction = db.transaction([_this.STORE_LESSONS], 'readwrite');
|
|
3121
|
-
/** @type {?} */
|
|
3122
|
-
var store = transaction.objectStore(_this.STORE_LESSONS);
|
|
3123
|
-
/** @type {?} */
|
|
3124
|
-
var request = store.put(downloadedItem);
|
|
3125
|
-
request.onsuccess = (/**
|
|
3126
|
-
* @return {?}
|
|
3127
|
-
*/
|
|
3128
|
-
function () {
|
|
3129
|
-
_this.updateProgress(stageId, 100, sizeBytes, sizeBytes, 'completed');
|
|
3130
|
-
_this.refreshDownloadedLessons();
|
|
3131
|
-
resolve(downloadedItem);
|
|
3132
|
-
});
|
|
3133
|
-
request.onerror = (/**
|
|
3134
|
-
* @param {?} event
|
|
3135
|
-
* @return {?}
|
|
3136
|
-
*/
|
|
3137
|
-
function (event) {
|
|
3138
|
-
_this.updateProgress(stageId, 0, 0, 0, 'error');
|
|
3139
|
-
reject(event.target.error);
|
|
3140
|
-
});
|
|
3141
|
-
}))];
|
|
3142
|
-
}
|
|
3143
|
-
});
|
|
3144
|
-
});
|
|
3031
|
+
function (data) {
|
|
3032
|
+
/** @type {?} */
|
|
3033
|
+
var fileManager = new FileManagerModel(this.httpClient, this.global);
|
|
3034
|
+
fileManager.name = data.name;
|
|
3035
|
+
fileManager.file = data;
|
|
3036
|
+
fileManager.description = data.type;
|
|
3037
|
+
return fileManager;
|
|
3145
3038
|
};
|
|
3039
|
+
FileManagerService.decorators = [
|
|
3040
|
+
{ type: Injectable }
|
|
3041
|
+
];
|
|
3042
|
+
/** @nocollapse */
|
|
3043
|
+
FileManagerService.ctorParameters = function () { return [
|
|
3044
|
+
{ type: FileManagerModel },
|
|
3045
|
+
{ type: HttpClient },
|
|
3046
|
+
{ type: Global }
|
|
3047
|
+
]; };
|
|
3048
|
+
return FileManagerService;
|
|
3049
|
+
}());
|
|
3050
|
+
if (false) {
|
|
3146
3051
|
/**
|
|
3052
|
+
* @type {?}
|
|
3147
3053
|
* @private
|
|
3148
|
-
* @param {?} url
|
|
3149
|
-
* @param {?} stageId
|
|
3150
|
-
* @return {?}
|
|
3151
3054
|
*/
|
|
3152
|
-
|
|
3055
|
+
FileManagerService.prototype.fileManagerModel;
|
|
3056
|
+
/**
|
|
3057
|
+
* @type {?}
|
|
3153
3058
|
* @private
|
|
3154
|
-
* @param {?} url
|
|
3155
|
-
* @param {?} stageId
|
|
3156
|
-
* @return {?}
|
|
3157
3059
|
*/
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
/** @type {?} */
|
|
3177
|
-
var progress = Math.round((event.loaded / event.total) * 100);
|
|
3178
|
-
_this.updateProgress(stageId, progress, event.loaded, event.total, 'downloading');
|
|
3179
|
-
}
|
|
3180
|
-
});
|
|
3181
|
-
xhr.onload = (/**
|
|
3182
|
-
* @return {?}
|
|
3183
|
-
*/
|
|
3184
|
-
function () {
|
|
3185
|
-
if (xhr.status >= 200 && xhr.status < 300) {
|
|
3186
|
-
resolve(xhr.response);
|
|
3187
|
-
}
|
|
3188
|
-
else {
|
|
3189
|
-
reject(new Error("Falha no download do v\u00EDdeo HTTP status " + xhr.status));
|
|
3190
|
-
}
|
|
3191
|
-
});
|
|
3192
|
-
xhr.onerror = (/**
|
|
3193
|
-
* @return {?}
|
|
3194
|
-
*/
|
|
3195
|
-
function () {
|
|
3196
|
-
reject(new Error('Erro de rede ou CORS durante o download do vídeo.'));
|
|
3197
|
-
});
|
|
3198
|
-
xhr.send();
|
|
3199
|
-
}));
|
|
3200
|
-
};
|
|
3060
|
+
FileManagerService.prototype.httpClient;
|
|
3061
|
+
/** @type {?} */
|
|
3062
|
+
FileManagerService.prototype.global;
|
|
3063
|
+
}
|
|
3064
|
+
|
|
3065
|
+
/**
|
|
3066
|
+
* @fileoverview added by tsickle
|
|
3067
|
+
* Generated from: lib/shared/file-manager/containers/file-manager/file-manager.component.ts
|
|
3068
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3069
|
+
*/
|
|
3070
|
+
var FileManagerComponent = /** @class */ (function () {
|
|
3071
|
+
function FileManagerComponent(_fileManagerService, translate) {
|
|
3072
|
+
this._fileManagerService = _fileManagerService;
|
|
3073
|
+
this.translate = translate;
|
|
3074
|
+
this.event = new EventEmitter();
|
|
3075
|
+
this.progress = { percentage: 0 };
|
|
3076
|
+
this.loading = false;
|
|
3077
|
+
}
|
|
3201
3078
|
/**
|
|
3202
|
-
* @private
|
|
3203
|
-
* @param {?} stageId
|
|
3204
|
-
* @param {?} progress
|
|
3205
|
-
* @param {?} loaded
|
|
3206
|
-
* @param {?} total
|
|
3207
|
-
* @param {?} status
|
|
3208
3079
|
* @return {?}
|
|
3209
3080
|
*/
|
|
3210
|
-
|
|
3211
|
-
* @private
|
|
3212
|
-
* @param {?} stageId
|
|
3213
|
-
* @param {?} progress
|
|
3214
|
-
* @param {?} loaded
|
|
3215
|
-
* @param {?} total
|
|
3216
|
-
* @param {?} status
|
|
3081
|
+
FileManagerComponent.prototype.ngOnInit = /**
|
|
3217
3082
|
* @return {?}
|
|
3218
3083
|
*/
|
|
3219
|
-
function (
|
|
3220
|
-
|
|
3221
|
-
/** @type {?} */
|
|
3222
|
-
var current = this.downloadProgress$.value;
|
|
3223
|
-
this.downloadProgress$.next(__assign({}, current, (_a = {}, _a[stageId] = { stageId: stageId, progress: progress, loaded: loaded, total: total, status: status }, _a)));
|
|
3084
|
+
function () {
|
|
3085
|
+
this.findAll();
|
|
3224
3086
|
};
|
|
3225
3087
|
/**
|
|
3226
|
-
* @param {?} lessonId
|
|
3227
3088
|
* @return {?}
|
|
3228
3089
|
*/
|
|
3229
|
-
|
|
3230
|
-
* @param {?} lessonId
|
|
3090
|
+
FileManagerComponent.prototype.showModal = /**
|
|
3231
3091
|
* @return {?}
|
|
3232
3092
|
*/
|
|
3233
|
-
function (
|
|
3234
|
-
|
|
3235
|
-
var lesson, _a;
|
|
3236
|
-
return __generator(this, function (_b) {
|
|
3237
|
-
switch (_b.label) {
|
|
3238
|
-
case 0:
|
|
3239
|
-
_b.trys.push([0, 2, , 3]);
|
|
3240
|
-
return [4 /*yield*/, this.getDownloadedLesson(lessonId)];
|
|
3241
|
-
case 1:
|
|
3242
|
-
lesson = _b.sent();
|
|
3243
|
-
return [2 /*return*/, !!lesson];
|
|
3244
|
-
case 2:
|
|
3245
|
-
_a = _b.sent();
|
|
3246
|
-
return [2 /*return*/, false];
|
|
3247
|
-
case 3: return [2 /*return*/];
|
|
3248
|
-
}
|
|
3249
|
-
});
|
|
3250
|
-
});
|
|
3093
|
+
function () {
|
|
3094
|
+
$('#appFileManager').modal('show');
|
|
3251
3095
|
};
|
|
3252
3096
|
/**
|
|
3253
|
-
* @param {?} lessonId
|
|
3254
3097
|
* @return {?}
|
|
3255
3098
|
*/
|
|
3256
|
-
|
|
3257
|
-
* @param {?} lessonId
|
|
3099
|
+
FileManagerComponent.prototype.closeModal = /**
|
|
3258
3100
|
* @return {?}
|
|
3259
3101
|
*/
|
|
3260
|
-
function (
|
|
3261
|
-
|
|
3262
|
-
var db;
|
|
3263
|
-
var _this = this;
|
|
3264
|
-
return __generator(this, function (_a) {
|
|
3265
|
-
switch (_a.label) {
|
|
3266
|
-
case 0: return [4 /*yield*/, this.initDatabase()];
|
|
3267
|
-
case 1:
|
|
3268
|
-
db = _a.sent();
|
|
3269
|
-
return [2 /*return*/, new Promise((/**
|
|
3270
|
-
* @param {?} resolve
|
|
3271
|
-
* @param {?} reject
|
|
3272
|
-
* @return {?}
|
|
3273
|
-
*/
|
|
3274
|
-
function (resolve, reject) {
|
|
3275
|
-
/** @type {?} */
|
|
3276
|
-
var transaction = db.transaction([_this.STORE_LESSONS], 'readonly');
|
|
3277
|
-
/** @type {?} */
|
|
3278
|
-
var store = transaction.objectStore(_this.STORE_LESSONS);
|
|
3279
|
-
/** @type {?} */
|
|
3280
|
-
var req1 = store.get(lessonId);
|
|
3281
|
-
req1.onsuccess = (/**
|
|
3282
|
-
* @return {?}
|
|
3283
|
-
*/
|
|
3284
|
-
function () {
|
|
3285
|
-
if (req1.result) {
|
|
3286
|
-
return resolve(req1.result);
|
|
3287
|
-
}
|
|
3288
|
-
// Tenta a variação string/número
|
|
3289
|
-
/** @type {?} */
|
|
3290
|
-
var altKey = typeof lessonId === 'number' ? String(lessonId) : Number(lessonId);
|
|
3291
|
-
if (!isNaN((/** @type {?} */ (altKey)))) {
|
|
3292
|
-
/** @type {?} */
|
|
3293
|
-
var req2_1 = store.get(altKey);
|
|
3294
|
-
req2_1.onsuccess = (/**
|
|
3295
|
-
* @return {?}
|
|
3296
|
-
*/
|
|
3297
|
-
function () {
|
|
3298
|
-
if (req2_1.result) {
|
|
3299
|
-
return resolve(req2_1.result);
|
|
3300
|
-
}
|
|
3301
|
-
// Fallback: busca por comparação em getAll
|
|
3302
|
-
/** @type {?} */
|
|
3303
|
-
var reqAll = store.getAll();
|
|
3304
|
-
reqAll.onsuccess = (/**
|
|
3305
|
-
* @return {?}
|
|
3306
|
-
*/
|
|
3307
|
-
function () {
|
|
3308
|
-
/** @type {?} */
|
|
3309
|
-
var all = reqAll.result || [];
|
|
3310
|
-
/** @type {?} */
|
|
3311
|
-
var found = all.find((/**
|
|
3312
|
-
* @param {?} item
|
|
3313
|
-
* @return {?}
|
|
3314
|
-
*/
|
|
3315
|
-
function (item) { return String(item.id) === String(lessonId); }));
|
|
3316
|
-
resolve(found || null);
|
|
3317
|
-
});
|
|
3318
|
-
reqAll.onerror = (/**
|
|
3319
|
-
* @return {?}
|
|
3320
|
-
*/
|
|
3321
|
-
function () { return resolve(null); });
|
|
3322
|
-
});
|
|
3323
|
-
req2_1.onerror = (/**
|
|
3324
|
-
* @return {?}
|
|
3325
|
-
*/
|
|
3326
|
-
function () { return resolve(null); });
|
|
3327
|
-
}
|
|
3328
|
-
else {
|
|
3329
|
-
resolve(null);
|
|
3330
|
-
}
|
|
3331
|
-
});
|
|
3332
|
-
req1.onerror = (/**
|
|
3333
|
-
* @return {?}
|
|
3334
|
-
*/
|
|
3335
|
-
function () {
|
|
3336
|
-
resolve(null);
|
|
3337
|
-
});
|
|
3338
|
-
}))];
|
|
3339
|
-
}
|
|
3340
|
-
});
|
|
3341
|
-
});
|
|
3102
|
+
function () {
|
|
3103
|
+
$('#appFileManager').modal('hide');
|
|
3342
3104
|
};
|
|
3343
3105
|
/**
|
|
3344
|
-
* @param {?}
|
|
3106
|
+
* @param {?} $event
|
|
3345
3107
|
* @return {?}
|
|
3346
3108
|
*/
|
|
3347
|
-
|
|
3348
|
-
* @param {?}
|
|
3109
|
+
FileManagerComponent.prototype.onChange = /**
|
|
3110
|
+
* @param {?} $event
|
|
3349
3111
|
* @return {?}
|
|
3350
3112
|
*/
|
|
3351
|
-
function (
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
return [2 /*return*/, blobUrl];
|
|
3363
|
-
}
|
|
3364
|
-
return [2 /*return*/, null];
|
|
3365
|
-
}
|
|
3113
|
+
function ($event) {
|
|
3114
|
+
if ($event && this.whiteListUploads($event.target.files[0].type)) {
|
|
3115
|
+
this.selectedFile = $event.target.files[0];
|
|
3116
|
+
}
|
|
3117
|
+
else {
|
|
3118
|
+
swal({
|
|
3119
|
+
type: 'error',
|
|
3120
|
+
title: this.translate.instant('ErrorLoadingFile'),
|
|
3121
|
+
text: this.translate.instant('MakeSureTheFileHasTheAllowedFormat'),
|
|
3122
|
+
buttonsStyling: false,
|
|
3123
|
+
confirmButtonClass: 'btn btn-success'
|
|
3366
3124
|
});
|
|
3367
|
-
|
|
3125
|
+
$('#file').val('');
|
|
3126
|
+
}
|
|
3368
3127
|
};
|
|
3369
3128
|
/**
|
|
3129
|
+
* @private
|
|
3130
|
+
* @param {?} fileType
|
|
3370
3131
|
* @return {?}
|
|
3371
3132
|
*/
|
|
3372
|
-
|
|
3133
|
+
FileManagerComponent.prototype.whiteListUploads = /**
|
|
3134
|
+
* @private
|
|
3135
|
+
* @param {?} fileType
|
|
3373
3136
|
* @return {?}
|
|
3374
3137
|
*/
|
|
3375
|
-
function () {
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
});
|
|
3138
|
+
function (fileType) {
|
|
3139
|
+
switch (fileType) {
|
|
3140
|
+
case 'image/png':
|
|
3141
|
+
return true;
|
|
3142
|
+
case 'image/jpeg':
|
|
3143
|
+
return true;
|
|
3144
|
+
case 'image/jpg':
|
|
3145
|
+
return true;
|
|
3146
|
+
case 'image/gif':
|
|
3147
|
+
return true;
|
|
3148
|
+
case 'image/png':
|
|
3149
|
+
return true;
|
|
3150
|
+
case 'application/msword':
|
|
3151
|
+
return true;
|
|
3152
|
+
case 'application/pdf':
|
|
3153
|
+
return true;
|
|
3154
|
+
case 'application/zip':
|
|
3155
|
+
return true;
|
|
3156
|
+
case 'video/x-flv':
|
|
3157
|
+
return true;
|
|
3158
|
+
case 'video/mp4':
|
|
3159
|
+
return true;
|
|
3160
|
+
case 'application/x-mpegURL':
|
|
3161
|
+
return true;
|
|
3162
|
+
case 'video/MP2T':
|
|
3163
|
+
return true;
|
|
3164
|
+
case 'video/3gpp':
|
|
3165
|
+
return true;
|
|
3166
|
+
case 'video/quicktime':
|
|
3167
|
+
return true;
|
|
3168
|
+
case 'video/x-msvideo':
|
|
3169
|
+
return true;
|
|
3170
|
+
case 'video/x-ms-wmv':
|
|
3171
|
+
return true;
|
|
3172
|
+
default:
|
|
3173
|
+
return false;
|
|
3174
|
+
}
|
|
3413
3175
|
};
|
|
3414
3176
|
/**
|
|
3415
3177
|
* @return {?}
|
|
3416
3178
|
*/
|
|
3417
|
-
|
|
3179
|
+
FileManagerComponent.prototype.submit = /**
|
|
3418
3180
|
* @return {?}
|
|
3419
3181
|
*/
|
|
3420
3182
|
function () {
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3183
|
+
var _this = this;
|
|
3184
|
+
this.progress.percentage = 0;
|
|
3185
|
+
this.loading = true;
|
|
3186
|
+
this._fileManagerService.uploadFile(this.selectedFile)
|
|
3187
|
+
.subscribe((/**
|
|
3188
|
+
* @param {?} event
|
|
3189
|
+
* @return {?}
|
|
3190
|
+
*/
|
|
3191
|
+
function (event) {
|
|
3192
|
+
if (event.type === HttpEventType.UploadProgress) {
|
|
3193
|
+
_this.progress.percentage = Math.round(100 * event.loaded / event.total);
|
|
3194
|
+
}
|
|
3195
|
+
else if (event instanceof HttpResponse) {
|
|
3196
|
+
_this.event.emit(event.body.data);
|
|
3197
|
+
_this.loading = false;
|
|
3198
|
+
_this.closeModal();
|
|
3199
|
+
}
|
|
3200
|
+
}));
|
|
3201
|
+
this.selectedFile = undefined;
|
|
3440
3202
|
};
|
|
3441
3203
|
/**
|
|
3442
|
-
* @param {?} lessonId
|
|
3443
3204
|
* @return {?}
|
|
3444
3205
|
*/
|
|
3445
|
-
|
|
3446
|
-
* @param {?} lessonId
|
|
3206
|
+
FileManagerComponent.prototype.findAll = /**
|
|
3447
3207
|
* @return {?}
|
|
3448
3208
|
*/
|
|
3449
|
-
function (
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
* @param {?} resolve
|
|
3460
|
-
* @param {?} reject
|
|
3461
|
-
* @return {?}
|
|
3462
|
-
*/
|
|
3463
|
-
function (resolve, reject) {
|
|
3464
|
-
/** @type {?} */
|
|
3465
|
-
var transaction = db.transaction([_this.STORE_LESSONS], 'readwrite');
|
|
3466
|
-
/** @type {?} */
|
|
3467
|
-
var store = transaction.objectStore(_this.STORE_LESSONS);
|
|
3468
|
-
/** @type {?} */
|
|
3469
|
-
var request = store.delete(lessonId);
|
|
3470
|
-
request.onsuccess = (/**
|
|
3471
|
-
* @return {?}
|
|
3472
|
-
*/
|
|
3473
|
-
function () {
|
|
3474
|
-
_this.refreshDownloadedLessons();
|
|
3475
|
-
resolve(true);
|
|
3476
|
-
});
|
|
3477
|
-
request.onerror = (/**
|
|
3478
|
-
* @param {?} event
|
|
3479
|
-
* @return {?}
|
|
3480
|
-
*/
|
|
3481
|
-
function (event) {
|
|
3482
|
-
reject(event.target.error);
|
|
3483
|
-
});
|
|
3484
|
-
}))];
|
|
3485
|
-
}
|
|
3486
|
-
});
|
|
3487
|
-
});
|
|
3209
|
+
function () {
|
|
3210
|
+
var _this = this;
|
|
3211
|
+
this._fileManagerService.findFileCollection()
|
|
3212
|
+
.subscribe((/**
|
|
3213
|
+
* @param {?} res
|
|
3214
|
+
* @return {?}
|
|
3215
|
+
*/
|
|
3216
|
+
function (res) {
|
|
3217
|
+
_this.fileList = res.data;
|
|
3218
|
+
}));
|
|
3488
3219
|
};
|
|
3489
3220
|
/**
|
|
3221
|
+
* @param {?} item
|
|
3490
3222
|
* @return {?}
|
|
3491
3223
|
*/
|
|
3492
|
-
|
|
3224
|
+
FileManagerComponent.prototype.selectFile = /**
|
|
3225
|
+
* @param {?} item
|
|
3493
3226
|
* @return {?}
|
|
3494
3227
|
*/
|
|
3495
|
-
function () {
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
var _this = this;
|
|
3499
|
-
return __generator(this, function (_a) {
|
|
3500
|
-
switch (_a.label) {
|
|
3501
|
-
case 0: return [4 /*yield*/, this.initDatabase()];
|
|
3502
|
-
case 1:
|
|
3503
|
-
db = _a.sent();
|
|
3504
|
-
return [2 /*return*/, new Promise((/**
|
|
3505
|
-
* @param {?} resolve
|
|
3506
|
-
* @param {?} reject
|
|
3507
|
-
* @return {?}
|
|
3508
|
-
*/
|
|
3509
|
-
function (resolve, reject) {
|
|
3510
|
-
/** @type {?} */
|
|
3511
|
-
var transaction = db.transaction([_this.STORE_LESSONS], 'readwrite');
|
|
3512
|
-
/** @type {?} */
|
|
3513
|
-
var store = transaction.objectStore(_this.STORE_LESSONS);
|
|
3514
|
-
/** @type {?} */
|
|
3515
|
-
var request = store.clear();
|
|
3516
|
-
request.onsuccess = (/**
|
|
3517
|
-
* @return {?}
|
|
3518
|
-
*/
|
|
3519
|
-
function () {
|
|
3520
|
-
_this.refreshDownloadedLessons();
|
|
3521
|
-
resolve(true);
|
|
3522
|
-
});
|
|
3523
|
-
request.onerror = (/**
|
|
3524
|
-
* @param {?} event
|
|
3525
|
-
* @return {?}
|
|
3526
|
-
*/
|
|
3527
|
-
function (event) {
|
|
3528
|
-
reject(event.target.error);
|
|
3529
|
-
});
|
|
3530
|
-
}))];
|
|
3531
|
-
}
|
|
3532
|
-
});
|
|
3533
|
-
});
|
|
3228
|
+
function (item) {
|
|
3229
|
+
this.event.emit(item);
|
|
3230
|
+
this.closeModal();
|
|
3534
3231
|
};
|
|
3535
3232
|
/**
|
|
3536
|
-
* @param {?}
|
|
3233
|
+
* @param {?} item
|
|
3537
3234
|
* @return {?}
|
|
3538
3235
|
*/
|
|
3539
|
-
|
|
3540
|
-
* @param {?}
|
|
3236
|
+
FileManagerComponent.prototype.deleteFromList = /**
|
|
3237
|
+
* @param {?} item
|
|
3541
3238
|
* @return {?}
|
|
3542
3239
|
*/
|
|
3543
|
-
function (
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
function (resolve, reject) {
|
|
3558
|
-
/** @type {?} */
|
|
3559
|
-
var transaction = db.transaction([_this.STORE_SYNC_QUEUE], 'readwrite');
|
|
3560
|
-
/** @type {?} */
|
|
3561
|
-
var store = transaction.objectStore(_this.STORE_SYNC_QUEUE);
|
|
3562
|
-
/** @type {?} */
|
|
3563
|
-
var syncItem = __assign({}, action, { createdAt: new Date() });
|
|
3564
|
-
/** @type {?} */
|
|
3565
|
-
var request = store.add(syncItem);
|
|
3566
|
-
request.onsuccess = (/**
|
|
3567
|
-
* @return {?}
|
|
3568
|
-
*/
|
|
3569
|
-
function () {
|
|
3570
|
-
console.log('[OfflineStorageService] Ação salva na fila de sincronização offline:', action);
|
|
3571
|
-
resolve();
|
|
3572
|
-
});
|
|
3573
|
-
request.onerror = (/**
|
|
3574
|
-
* @param {?} event
|
|
3575
|
-
* @return {?}
|
|
3576
|
-
*/
|
|
3577
|
-
function (event) {
|
|
3578
|
-
reject(event.target.error);
|
|
3579
|
-
});
|
|
3580
|
-
}))];
|
|
3581
|
-
}
|
|
3240
|
+
function (item) {
|
|
3241
|
+
var _this = this;
|
|
3242
|
+
this._fileManagerService.removeFile(item.id)
|
|
3243
|
+
.subscribe((/**
|
|
3244
|
+
* @param {?} res
|
|
3245
|
+
* @return {?}
|
|
3246
|
+
*/
|
|
3247
|
+
function (res) {
|
|
3248
|
+
swal({
|
|
3249
|
+
type: 'success',
|
|
3250
|
+
title: _this.translate.instant('SuccessfullyRemoved'),
|
|
3251
|
+
text: _this.translate.instant('TheSelectedFileHasBeenRemovedFromTheSystem'),
|
|
3252
|
+
buttonsStyling: true,
|
|
3253
|
+
confirmButtonClass: 'btn btn-success'
|
|
3582
3254
|
});
|
|
3583
|
-
|
|
3255
|
+
_this.findAll();
|
|
3256
|
+
}), (/**
|
|
3257
|
+
* @param {?} err
|
|
3258
|
+
* @return {?}
|
|
3259
|
+
*/
|
|
3260
|
+
function (err) {
|
|
3261
|
+
swal({
|
|
3262
|
+
type: 'error',
|
|
3263
|
+
title: _this.translate.instant('ErrorRemovingFile'),
|
|
3264
|
+
text: _this.translate.instant('TryAgainLater'),
|
|
3265
|
+
buttonsStyling: true,
|
|
3266
|
+
confirmButtonClass: 'btn btn-success'
|
|
3267
|
+
});
|
|
3268
|
+
}));
|
|
3269
|
+
};
|
|
3270
|
+
FileManagerComponent.decorators = [
|
|
3271
|
+
{ type: Component, args: [{
|
|
3272
|
+
selector: 'app-file-manager',
|
|
3273
|
+
exportAs: 'appFileManager',
|
|
3274
|
+
template: "<!-- Modal -->\r\n<div id=\"appFileManager\" class=\"modal fade\" role=\"dialog\" data-backdrop=\"false\" >\r\n <div class=\"modal-dialog modal-lg\">\r\n <!-- Modal content-->\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button>\r\n <h4 class=\"modal-title\">{{ 'FileManager' | translate }}</h4>\r\n </div>\r\n <div class=\"modal-body\">\r\n <div class=\"col-md-12\">\r\n <div class=\"row\">\r\n <div class=\"col-md-2\">\r\n <ul class=\"nav nav-pills nav-pills-icons nav-pills-primary nav-stacked\" role=\"tablist\">\r\n <!--\r\n color-classes: \"nav-pills-primary\", \"nav-pills-info\", \"nav-pills-success\", \"nav-pills-warning\",\"nav-pills-danger\"\r\n-->\r\n <li class=\"active\">\r\n <a href=\"#upload\" role=\"tab\" data-toggle=\"tab\">\r\n <i class=\"material-icons\">backup</i> {{ 'Upload' | translate }}\r\n </a>\r\n </li>\r\n <li>\r\n <a href=\"#arquivos\" role=\"tab\" data-toggle=\"tab\">\r\n <i class=\"material-icons\">assignment</i> {{ 'Files' | translate }}\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n <div class=\"col-md-10\">\r\n <div class=\"tab-content\">\r\n <div class=\"tab-pane active\" id=\"upload\">\r\n <div class=\"col-sm-12\">\r\n <form *ngIf=\"!loading\" class=\"text-center\">\r\n <div class=\"fileinput fileinput-new text-center\" data-provides=\"fileinput\">\r\n <div class=\"fileinput-new thumbnail preview\" style=\"width: 320px;\">\r\n <img src=\"../../assets/img/image_placeholder.jpg\" alt=\"...\">\r\n </div>\r\n <div class=\"fileinput-preview fileinput-exists thumbnail\"></div>\r\n <div>\r\n <span class=\"btn btn-primary btn-round btn-file\">\r\n <span class=\"fileinput-new\">{{ 'SelectAFile' | translate }}</span>\r\n <span class=\"fileinput-exists\">{{ 'Alter' | translate }}</span>\r\n <input ng2FileSelect (change)=\"onChange($event)\" id=\"file\" type=\"file\" name=\"...\"/>\r\n </span>\r\n <button type=\"button\" (click)=\"submit()\" class=\"fileinput-exists btn btn-primary btn-round\">\r\n {{ 'Confirm' | translate }}\r\n </button>\r\n <a href=\"#pablo\" class=\"btn btn-danger btn-round fileinput-exists\" data-dismiss=\"fileinput\"><i\r\n class=\"fa fa-times\"></i> {{ 'Remove' | translate }}</a>\r\n </div>\r\n </div>\r\n </form>\r\n <div *ngIf=\"loading\">\r\n <br>\r\n <br>\r\n <legend>{{ 'Loading...' | translate }}</legend>\r\n <div class=\"progress progress-line-primary\">\r\n <div class=\"progress-bar\" role=\"progressbar\" aria-valuenow=\"60\"\r\n aria-valuemin=\"0\" aria-valuemax=\"100\" [ngStyle]=\"{width: progress.percentage + '%'}\">\r\n <span class=\"sr-only\">{{ progress.percentage + '%' }} {{ 'Concluded' | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"tab-pane\" id=\"arquivos\">\r\n <div class=\"col-md-12\" style=\"height: 360px; overflow: auto;\">\r\n <div class=\"table-responsive\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'Date' | translate }}</th>\r\n <th>{{ 'File' | translate }}</th>\r\n <th>{{ 'Actions' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let item of fileList\">\r\n <td>{{ item.updated_at.date | date: 'dd/MM/yyyy' }}</td>\r\n <td>{{ item.name }}</td>\r\n <td class=\"td-actions text-right\">\r\n <button (click)=\"selectFile(item)\" type=\"button\" class=\"btn btn-success\">\r\n <i class=\"material-icons\">check</i>\r\n </button>\r\n <button (click)=\"deleteFromList(item)\" type=\"button\" class=\"btn btn-danger\">\r\n <i class=\"material-icons\">close</i>\r\n </button>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!--<div class=\"modal-footer\">-->\r\n <!--<button type=\"button\" class=\"btn btn-primary\" data-dismiss=\"modal\">Confirmar</button>-->\r\n <!--<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Fechar</button>-->\r\n <!--</div>-->\r\n </div>\r\n </div>\r\n</div>\r\n",
|
|
3275
|
+
providers: [FileManagerService, FileManagerModel],
|
|
3276
|
+
styles: [".fileinput .thumbnail{max-width:100%!important;height:240px}.modal-content{min-height:450px}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}"]
|
|
3277
|
+
}] }
|
|
3278
|
+
];
|
|
3279
|
+
/** @nocollapse */
|
|
3280
|
+
FileManagerComponent.ctorParameters = function () { return [
|
|
3281
|
+
{ type: FileManagerService },
|
|
3282
|
+
{ type: TranslateService }
|
|
3283
|
+
]; };
|
|
3284
|
+
FileManagerComponent.propDecorators = {
|
|
3285
|
+
event: [{ type: Output }]
|
|
3584
3286
|
};
|
|
3287
|
+
return FileManagerComponent;
|
|
3288
|
+
}());
|
|
3289
|
+
if (false) {
|
|
3290
|
+
/** @type {?} */
|
|
3291
|
+
FileManagerComponent.prototype.event;
|
|
3292
|
+
/** @type {?} */
|
|
3293
|
+
FileManagerComponent.prototype.selectedFile;
|
|
3294
|
+
/** @type {?} */
|
|
3295
|
+
FileManagerComponent.prototype.progress;
|
|
3296
|
+
/** @type {?} */
|
|
3297
|
+
FileManagerComponent.prototype.loading;
|
|
3298
|
+
/** @type {?} */
|
|
3299
|
+
FileManagerComponent.prototype.fileList;
|
|
3585
3300
|
/**
|
|
3586
|
-
* @
|
|
3301
|
+
* @type {?}
|
|
3302
|
+
* @private
|
|
3587
3303
|
*/
|
|
3588
|
-
|
|
3589
|
-
|
|
3304
|
+
FileManagerComponent.prototype._fileManagerService;
|
|
3305
|
+
/**
|
|
3306
|
+
* @type {?}
|
|
3307
|
+
* @private
|
|
3590
3308
|
*/
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3309
|
+
FileManagerComponent.prototype.translate;
|
|
3310
|
+
}
|
|
3311
|
+
|
|
3312
|
+
/**
|
|
3313
|
+
* @fileoverview added by tsickle
|
|
3314
|
+
* Generated from: lib/shared/file-manager/containers/file-manager-directive/file-manager.directive.ts
|
|
3315
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3316
|
+
*/
|
|
3317
|
+
var FileManagerDirective = /** @class */ (function () {
|
|
3318
|
+
function FileManagerDirective() {
|
|
3319
|
+
}
|
|
3320
|
+
FileManagerDirective.decorators = [
|
|
3321
|
+
{ type: Directive, args: [{
|
|
3322
|
+
selector: '[appFileManager]'
|
|
3323
|
+
},] }
|
|
3324
|
+
];
|
|
3325
|
+
return FileManagerDirective;
|
|
3326
|
+
}());
|
|
3327
|
+
|
|
3328
|
+
/**
|
|
3329
|
+
* @fileoverview added by tsickle
|
|
3330
|
+
* Generated from: lib/shared/file-manager/file-manager.module.ts
|
|
3331
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3332
|
+
*/
|
|
3333
|
+
var FileManagerModule = /** @class */ (function () {
|
|
3334
|
+
function FileManagerModule() {
|
|
3335
|
+
}
|
|
3336
|
+
FileManagerModule.decorators = [
|
|
3337
|
+
{ type: NgModule, args: [{
|
|
3338
|
+
imports: [
|
|
3339
|
+
CommonModule,
|
|
3340
|
+
ReactiveFormsModule,
|
|
3341
|
+
RouterModule,
|
|
3342
|
+
FormsModule,
|
|
3343
|
+
TranslateModule
|
|
3344
|
+
],
|
|
3345
|
+
declarations: [
|
|
3346
|
+
FileManagerComponent,
|
|
3347
|
+
FileManagerDirective
|
|
3348
|
+
],
|
|
3349
|
+
exports: [
|
|
3350
|
+
FileManagerComponent
|
|
3351
|
+
],
|
|
3352
|
+
},] }
|
|
3353
|
+
];
|
|
3354
|
+
return FileManagerModule;
|
|
3355
|
+
}());
|
|
3356
|
+
|
|
3357
|
+
/**
|
|
3358
|
+
* @fileoverview added by tsickle
|
|
3359
|
+
* Generated from: lib/editor/components/shared/title.component.ts
|
|
3360
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3361
|
+
*/
|
|
3362
|
+
var SharedTitleComponent = /** @class */ (function () {
|
|
3363
|
+
function SharedTitleComponent() {
|
|
3364
|
+
}
|
|
3365
|
+
SharedTitleComponent.decorators = [
|
|
3366
|
+
{ type: Component, args: [{
|
|
3367
|
+
selector: 'app-editor-component-shared-title',
|
|
3368
|
+
template: "\n <h2\n class=\"mb-4 animated shared-title px-4\"\n [ngClass]=\"title?.animation\"\n [style.fontSize.px]=\"title?.size\"\n [style.textAlign]=\"title?.align\"\n [style.color]=\"title.color\" *ngIf=\"title?.text !== ''\">\n {{ title?.text || '' }}\n </h2>\n "
|
|
3369
|
+
}] }
|
|
3370
|
+
];
|
|
3371
|
+
SharedTitleComponent.propDecorators = {
|
|
3372
|
+
title: [{ type: Input }]
|
|
3373
|
+
};
|
|
3374
|
+
return SharedTitleComponent;
|
|
3375
|
+
}());
|
|
3376
|
+
if (false) {
|
|
3377
|
+
/** @type {?} */
|
|
3378
|
+
SharedTitleComponent.prototype.title;
|
|
3379
|
+
/** @type {?} */
|
|
3380
|
+
SharedTitleComponent.prototype.item;
|
|
3381
|
+
}
|
|
3382
|
+
|
|
3383
|
+
/**
|
|
3384
|
+
* @fileoverview added by tsickle
|
|
3385
|
+
* Generated from: lib/editor/components/shared/subtitle.component.ts
|
|
3386
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3387
|
+
*/
|
|
3388
|
+
var SharedSubTitleComponent = /** @class */ (function () {
|
|
3389
|
+
function SharedSubTitleComponent() {
|
|
3390
|
+
}
|
|
3391
|
+
SharedSubTitleComponent.decorators = [
|
|
3392
|
+
{ type: Component, args: [{
|
|
3393
|
+
selector: 'app-editor-component-shared-subtitle',
|
|
3394
|
+
template: "\n <p\n *ngIf=\"subtitle?.enable\"\n class=\"mb-4 animated shared-subtitle\"\n [ngClass]=\"subtitle?.animation\"\n [style.fontSize.px]=\"subtitle?.size\"\n [style.textAlign]=\"subtitle?.align\"\n [style.color]=\"subtitle?.color\">\n {{ subtitle.text || '' }}\n </p>\n "
|
|
3395
|
+
}] }
|
|
3396
|
+
];
|
|
3397
|
+
SharedSubTitleComponent.propDecorators = {
|
|
3398
|
+
subtitle: [{ type: Input }]
|
|
3661
3399
|
};
|
|
3400
|
+
return SharedSubTitleComponent;
|
|
3401
|
+
}());
|
|
3402
|
+
if (false) {
|
|
3403
|
+
/** @type {?} */
|
|
3404
|
+
SharedSubTitleComponent.prototype.subtitle;
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3407
|
+
/**
|
|
3408
|
+
* @fileoverview added by tsickle
|
|
3409
|
+
* Generated from: lib/editor/components/shared/button.component.ts
|
|
3410
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3411
|
+
*/
|
|
3412
|
+
/**
|
|
3413
|
+
* @record
|
|
3414
|
+
*/
|
|
3415
|
+
function Button() { }
|
|
3416
|
+
if (false) {
|
|
3417
|
+
/** @type {?} */
|
|
3418
|
+
Button.prototype.background;
|
|
3419
|
+
/** @type {?} */
|
|
3420
|
+
Button.prototype.color;
|
|
3421
|
+
/** @type {?} */
|
|
3422
|
+
Button.prototype.text;
|
|
3423
|
+
/** @type {?|undefined} */
|
|
3424
|
+
Button.prototype.hide;
|
|
3425
|
+
}
|
|
3426
|
+
var SharedButtonComponent = /** @class */ (function () {
|
|
3427
|
+
function SharedButtonComponent(translate) {
|
|
3428
|
+
this.translate = translate;
|
|
3429
|
+
this.button = {
|
|
3430
|
+
background: '#3C4858',
|
|
3431
|
+
color: '#FFFFF',
|
|
3432
|
+
text: this.translate.instant('Next'),
|
|
3433
|
+
};
|
|
3434
|
+
this.disabled = false;
|
|
3435
|
+
this.event = new EventEmitter();
|
|
3436
|
+
}
|
|
3662
3437
|
/**
|
|
3663
|
-
* @param {?} bytes
|
|
3664
|
-
* @param {?=} decimals
|
|
3665
3438
|
* @return {?}
|
|
3666
3439
|
*/
|
|
3667
|
-
|
|
3668
|
-
* @param {?} bytes
|
|
3669
|
-
* @param {?=} decimals
|
|
3440
|
+
SharedButtonComponent.prototype.goNext = /**
|
|
3670
3441
|
* @return {?}
|
|
3671
3442
|
*/
|
|
3672
|
-
function (
|
|
3673
|
-
|
|
3674
|
-
if (!bytes || bytes === 0)
|
|
3675
|
-
return '0 MB';
|
|
3676
|
-
/** @type {?} */
|
|
3677
|
-
var k = 1024;
|
|
3678
|
-
/** @type {?} */
|
|
3679
|
-
var dm = decimals < 0 ? 0 : decimals;
|
|
3680
|
-
/** @type {?} */
|
|
3681
|
-
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
3682
|
-
/** @type {?} */
|
|
3683
|
-
var i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
3684
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
|
3443
|
+
function () {
|
|
3444
|
+
this.event.emit();
|
|
3685
3445
|
};
|
|
3686
3446
|
/**
|
|
3687
|
-
* @param {?} lessons
|
|
3688
3447
|
* @return {?}
|
|
3689
3448
|
*/
|
|
3690
|
-
|
|
3691
|
-
* @param {?} lessons
|
|
3449
|
+
SharedButtonComponent.prototype.ngOnInit = /**
|
|
3692
3450
|
* @return {?}
|
|
3693
3451
|
*/
|
|
3694
|
-
function (
|
|
3695
|
-
/** @type {?} */
|
|
3696
|
-
var totalBytes = lessons.reduce((/**
|
|
3697
|
-
* @param {?} acc
|
|
3698
|
-
* @param {?} curr
|
|
3699
|
-
* @return {?}
|
|
3700
|
-
*/
|
|
3701
|
-
function (acc, curr) { return acc + (curr.sizeBytes || 0); }), 0);
|
|
3702
|
-
return {
|
|
3703
|
-
totalBytes: totalBytes,
|
|
3704
|
-
formatted: this.formatBytes(totalBytes)
|
|
3705
|
-
};
|
|
3452
|
+
function () {
|
|
3706
3453
|
};
|
|
3707
|
-
|
|
3708
|
-
{ type:
|
|
3709
|
-
|
|
3710
|
-
|
|
3454
|
+
SharedButtonComponent.decorators = [
|
|
3455
|
+
{ type: Component, args: [{
|
|
3456
|
+
selector: 'app-editor-component-shared-button',
|
|
3457
|
+
template: "\n <div *ngIf=\"button.hide && (button.text ) && (button.text !='')\" class=\"row\">\n <div class=\"col-md-12 text-center mt-4\">\n <button (click)=\"goNext()\" [disabled]=\"disabled\" type=\"button\" class=\"btn\" style=\"color:white\" \n [ngStyle]=\"{'color': button.color, 'background': button.background}\">\n {{ button.text }}\n </button>\n </div>\n </div>\n "
|
|
3458
|
+
}] }
|
|
3711
3459
|
];
|
|
3712
3460
|
/** @nocollapse */
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3461
|
+
SharedButtonComponent.ctorParameters = function () { return [
|
|
3462
|
+
{ type: TranslateService }
|
|
3463
|
+
]; };
|
|
3464
|
+
SharedButtonComponent.propDecorators = {
|
|
3465
|
+
button: [{ type: Input }],
|
|
3466
|
+
disabled: [{ type: Input }],
|
|
3467
|
+
event: [{ type: Output }]
|
|
3468
|
+
};
|
|
3469
|
+
return SharedButtonComponent;
|
|
3716
3470
|
}());
|
|
3717
3471
|
if (false) {
|
|
3472
|
+
/** @type {?} */
|
|
3473
|
+
SharedButtonComponent.prototype.button;
|
|
3474
|
+
/** @type {?} */
|
|
3475
|
+
SharedButtonComponent.prototype.disabled;
|
|
3476
|
+
/** @type {?} */
|
|
3477
|
+
SharedButtonComponent.prototype.event;
|
|
3718
3478
|
/**
|
|
3719
3479
|
* @type {?}
|
|
3720
3480
|
* @private
|
|
3721
3481
|
*/
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
* @private
|
|
3746
|
-
*/
|
|
3747
|
-
OfflineStorageService.prototype.isOnlineSubject;
|
|
3482
|
+
SharedButtonComponent.prototype.translate;
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
/**
|
|
3486
|
+
* @fileoverview added by tsickle
|
|
3487
|
+
* Generated from: lib/editor/components/shared/media.component.ts
|
|
3488
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3489
|
+
*/
|
|
3490
|
+
var SharedMediaComponent = /** @class */ (function () {
|
|
3491
|
+
function SharedMediaComponent() {
|
|
3492
|
+
}
|
|
3493
|
+
SharedMediaComponent.decorators = [
|
|
3494
|
+
{ type: Component, args: [{
|
|
3495
|
+
selector: 'app-editor-component-shared-media',
|
|
3496
|
+
template: "\n <div class=\"row\" *ngIf=\"media.type == 'image' || media.type == 'IMAGE'\">\n <div class=\"col-sm-11 mx-auto mb-4\">\n <img height=\"320\" style=\"width: 100%; object-fit: scale-down; max-height: 320px;\" *ngIf=\"media.url != ''\"\n [src]=\"media.url\" />\n </div>\n </div>\n <div class=\"row\" *ngIf=\"media.type == 'youtube' || media.type == 'YOUTUBE'\">\n <div class=\"col-sm-11 mx-auto mb-4\" *ngIf=\"media.url !== ''\">\n <iframe [src]=\"media.url | youtubeEmbed | safeUrl:'resourceUrl'\" width=\"100%\" height=\"500px\" frameborder=\"0\"\n allowfullscreen></iframe>\n </div>\n </div>\n <div class=\"row\" *ngIf=\"media.type == 'vimeo' || media.type == 'VIMEO'\">\n <div class=\"col-sm-11 mx-auto mb-4\" *ngIf=\"media.url !== ''\">\n <iframe [src]=\"media.url | vimeoEmbed | safeUrl:'resourceUrl'\" width=\"100%\" height=\"500px\" frameborder=\"0\"\n allowfullscreen></iframe>\n </div>\n </div>\n "
|
|
3497
|
+
}] }
|
|
3498
|
+
];
|
|
3499
|
+
SharedMediaComponent.propDecorators = {
|
|
3500
|
+
media: [{ type: Input }]
|
|
3501
|
+
};
|
|
3502
|
+
return SharedMediaComponent;
|
|
3503
|
+
}());
|
|
3504
|
+
if (false) {
|
|
3748
3505
|
/** @type {?} */
|
|
3749
|
-
|
|
3506
|
+
SharedMediaComponent.prototype.media;
|
|
3507
|
+
}
|
|
3508
|
+
|
|
3509
|
+
/**
|
|
3510
|
+
* @fileoverview added by tsickle
|
|
3511
|
+
* Generated from: lib/editor/components/shared/text.component.ts
|
|
3512
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3513
|
+
*/
|
|
3514
|
+
var SharedTextComponent = /** @class */ (function () {
|
|
3515
|
+
function SharedTextComponent() {
|
|
3516
|
+
}
|
|
3517
|
+
SharedTextComponent.decorators = [
|
|
3518
|
+
{ type: Component, args: [{
|
|
3519
|
+
selector: 'app-editor-component-shared-text',
|
|
3520
|
+
template: "\n <p\n class=\"mb-4 animated\"\n [ngClass]=\"text?.animation\"\n [style.fontSize.px]=\"text?.size\"\n [style.textAlign]=\"text?.align\"\n [style.color]=\"text.color\" *ngIf=\"text?.text !== ''\">\n {{ text.text || '' }}\n </p>\n "
|
|
3521
|
+
}] }
|
|
3522
|
+
];
|
|
3523
|
+
SharedTextComponent.propDecorators = {
|
|
3524
|
+
text: [{ type: Input }]
|
|
3525
|
+
};
|
|
3526
|
+
return SharedTextComponent;
|
|
3527
|
+
}());
|
|
3528
|
+
if (false) {
|
|
3750
3529
|
/** @type {?} */
|
|
3751
|
-
|
|
3530
|
+
SharedTextComponent.prototype.text;
|
|
3531
|
+
}
|
|
3532
|
+
|
|
3533
|
+
/**
|
|
3534
|
+
* @fileoverview added by tsickle
|
|
3535
|
+
* Generated from: lib/editor/components/shared/shared.module.ts
|
|
3536
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3537
|
+
*/
|
|
3538
|
+
/** @type {?} */
|
|
3539
|
+
var components = [
|
|
3540
|
+
SharedTitleComponent,
|
|
3541
|
+
SharedSubTitleComponent,
|
|
3542
|
+
SharedButtonComponent,
|
|
3543
|
+
SharedMediaComponent,
|
|
3544
|
+
SharedTextComponent
|
|
3545
|
+
];
|
|
3546
|
+
var ComponentSharedModule = /** @class */ (function () {
|
|
3547
|
+
function ComponentSharedModule() {
|
|
3548
|
+
}
|
|
3549
|
+
ComponentSharedModule.decorators = [
|
|
3550
|
+
{ type: NgModule, args: [{
|
|
3551
|
+
imports: [
|
|
3552
|
+
CommonModule,
|
|
3553
|
+
FormsModule,
|
|
3554
|
+
ReactiveFormsModule,
|
|
3555
|
+
ColorPickerModule,
|
|
3556
|
+
MomentModule,
|
|
3557
|
+
MatSelectModule,
|
|
3558
|
+
TranslateModule,
|
|
3559
|
+
MatInputModule,
|
|
3560
|
+
MatStepperModule,
|
|
3561
|
+
MatRadioModule,
|
|
3562
|
+
MatTooltipModule,
|
|
3563
|
+
MatSliderModule,
|
|
3564
|
+
PipesModule
|
|
3565
|
+
],
|
|
3566
|
+
declarations: __spread(components),
|
|
3567
|
+
exports: __spread(components)
|
|
3568
|
+
},] }
|
|
3569
|
+
];
|
|
3570
|
+
return ComponentSharedModule;
|
|
3571
|
+
}());
|
|
3572
|
+
|
|
3573
|
+
/**
|
|
3574
|
+
* @fileoverview added by tsickle
|
|
3575
|
+
* Generated from: lib/editor/components/dynamic-input/dynamic-input.component.ts
|
|
3576
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3577
|
+
*/
|
|
3578
|
+
var DynamicInputComponent = /** @class */ (function () {
|
|
3579
|
+
function DynamicInputComponent() {
|
|
3580
|
+
}
|
|
3581
|
+
DynamicInputComponent.decorators = [
|
|
3582
|
+
{ type: Component, args: [{
|
|
3583
|
+
selector: 'app-editor-component-dynamic-input',
|
|
3584
|
+
template: "<textarea \r\n ngControlName\r\n *ngIf=\"input.type == 'text-long'\"\r\n name=\"input\"\r\n matInput \r\n matTextareaAutosize\r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\"></textarea>\r\n\r\n<input \r\n *ngIf=\"input.type == 'text-short'\"\r\n type=\"text\"\r\n name=\"input\"\r\n matInput \r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\" />\r\n\r\n<input \r\n *ngIf=\"input.type == 'number'\"\r\n type=\"number\"\r\n name=\"input\"\r\n matInput \r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\" />\r\n\r\n<input \r\n *ngIf=\"input.type == 'currency'\"\r\n type=\"text\"\r\n name=\"input\"\r\n currencyMask\r\n matInput \r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\" />\r\n\r\n<input \r\n *ngIf=\"input.type == 'date'\"\r\n type=\"date\"\r\n name=\"input\"\r\n matInput \r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\" />\r\n\r\n<div class=\"form-group form-focus label-floating\" *ngIf=\"input.type === 'select-single'\">\r\n <mat-form-field class=\"w-100 m-b-3\">\r\n <mat-select name=\"input\" [placeholder]=\"input.placeholder\">\r\n <mat-option *ngFor=\"let opt of input.selectOptions\" [value]=\"opt.value\"> {{ opt.value }}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n</div>\r\n\r\n<div class=\"form-group form-focus label-floating\" *ngIf=\"input.type === 'select-multi'\">\r\n <mat-form-field class=\"w-100 m-b-3\">\r\n <mat-select multiple name=\"input\" [placeholder]=\"input.placeholder\">\r\n <mat-option *ngFor=\"let opt of input.selectOptions\" [value]=\"opt.value\"> {{ opt.value }}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n</div>",
|
|
3585
|
+
styles: [".flex-container{padding:0;margin:0;list-style:none;-ms-box-orient:horizontal;display:-moz-flex;display:flex}.nowrap{flex-wrap:nowrap}.wrap{flex-wrap:wrap}::ng-deep .mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle{border-color:#e91e63}::ng-deep .mat-radio-button.mat-accent .mat-radio-inner-circle{background-color:#e91e63}::ng-deep .mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element{background-color:rgba(233,30,99,.26)}.mat-checkbox-label,::ng-deep .mat-radio-label{cursor:pointer;white-space:nowrap;padding:10px}::ng-deep .mat-horizontal-stepper-header{height:40px!important;padding:0 15px!important}::ng-deep .mat-step-header .mat-step-icon{background-color:#e91e63;color:#fff}::ng-deep .mat-stepper-horizontal-line{margin:0!important}::ng-deep .checkbox .checkbox-material .check{width:15px;height:15px;border:1px solid #ddd;border-radius:3px}::ng-deep .checkbox .checkbox-material .check:before{position:absolute;content:\"\";transform:rotate(45deg);display:block;margin-top:-5px;margin-left:5px;font-size:.5em;width:1;height:0;-webkit-animation:.3s forwards checkbox-off;animation:.3s forwards checkbox-off}::ng-deep .checkbox label{cursor:pointer;padding-left:0;font-size:.8em;font-weight:500;color:#525859}.mt--5{margin-top:-7px}.mt-20{margin-top:20px}.ml-3{margin-left:3px}.no-margin{margin:0!important}.bg-purple{background:#9c27b0}.fc-gray{color:#525859!important}.fc-purple{color:#9c27b0!important}.fc-red{color:#e50606!important}.fc-green{color:#2ac994!important}.bold{font-weight:700}.bolder{font-weight:bolder}.placeholder{color:#d5d5d5}.border{border:1px solid #d2d2d2}.no-border{border:none}.bl-0{border-left:none}.border-label{padding:0;border-radius:3px;border:1px solid #ccc;background:rgba(255,255,255,.5)}.border-top{border-top:1px solid #eee}.border-bottom{border-bottom:1px solid #eee}.col-center-block{float:none;display:block;margin:0 auto}.btn.focus,.btn:focus{color:#fff;background-color:#595959;border-color:#595959;outline:0;box-shadow:0 0 0 .2rem rgba(89,89,89,.25)}.btn-primary{color:#fff;background-color:#6c757d!important;border-color:#6c757d!important;box-shadow:none;font-size:1em}.btn-primary:hover{color:#fff;background-color:#595959;border-color:#595959;box-shadow:0 14px 26px -12px rgba(89,89,89,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(89,89,89,.2)}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 .2rem rgba(89,89,89,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-primary.disabled,.btn-primary:disabled:hover,.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#595959;border-color:#595959}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(89,89,89,.5)}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-muted{background:#ccc}.btn-muted:hover{background:#bbb}.box-group{padding:10px;background:#f5f5f5;border:1px solid #eee;border-radius:3px}.box{display:flex;display:-ms-flexbox;align-items:center;-webkit-box-align:center;-ms-flex-align:center;flex-direction:column;justify-content:center;-webkit-justify-content:center;-webkit-box-pack:center;margin-left:auto}.box-list{display:flex;align-items:center;justify-content:center;height:100%;padding-bottom:30px;width:100%}.box-ask-border{display:inline-block;margin:2%;max-width:190px;min-height:190px;text-align:left;width:46%}.box-ask-border:hover{border-color:#dedede;color:#dedede;background:#fff7fa;border-radius:7px}.box-label{cursor:pointer;display:block;height:100%;padding:12px}.box-img{background-position:50%;background-size:cover;border-radius:7px;height:160px;margin:0;width:100%;-o-object-fit:cover;object-fit:cover}.box-input{display:block;position:relative;cursor:pointer;font-size:15px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.box-input input{position:absolute;opacity:0;cursor:pointer}.checkmark{position:absolute;top:-17px;left:-17px;background:0 0;border:2px solid #dadada;color:#3c3c3c;border-radius:10px;display:inline-block;margin:2%;width:116%;height:120%;min-height:190px}.box-input input:checked~.checkmark{border:2px solid #dedede}.checkmark:after{content:\"\";position:absolute;display:none}.box-input input:checked~.box-ask-border:after{border:2px solid #dadada;color:#3c3c3c;border-radius:10px;display:inline-block;font-size:15px;margin:2%;max-width:190px;text-align:left;width:46%}.box-ask-border:after{border-color:#dedede;color:rgba (233,30,99,.3);background:#fff7fa}.title{font-size:13px;float:left;padding:2px 10px;position:fixed}.title-question{font-size:1.12em;font-weight:900;color:#525859;margin-bottom:20px}.title-config{font-size:.8em;font-weight:500;color:#525859;margin-bottom:0;width:100%}.tool-name{font-weight:600;color:#9c27b0}.tool-name-subtitle{font-weight:600;color:#525859}.img-responsive,.vid-responsive{display:block;max-width:100%;height:auto}.img-thumbnail,.vid-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;margin-bottom:30px;transition:.2s ease-in-out}.col-left{border-right:1px solid #eee}.col-center{float:left;width:60%}.col-right{border-left:1px solid #eee}.col-left,.col-right{float:left;width:20%;overflow-x:hidden!important}.col-sup{height:28vh;overflow-y:auto;padding:10px;border-top:1px solid #eee;border-bottom:1px solid #eee;margin-top:25px}.col-sub{height:51.5vh;overflow-y:auto;padding:10px;border-top:1px solid #eee;margin-top:25px}.col-int{height:83.5vh;overflow-y:auto;padding:10px;margin-top:25px;border-top:1px solid #eee}.icon{float:left;width:50%;height:70px;text-align:center;margin:20px 0}.icon i{font-size:40px}.icon a{display:block;color:#999}.icon a:hover{color:#777}.icon p{font-size:14px;margin:5px}table thead th{font-size:1em;font-weight:900;color:#383838}table tfoot .amount{font-size:1em;font-weight:900;color:#383838;text-align:right}.nav-tabs{border-bottom:1px solid #ddd;margin-bottom:20px;background:0 0}.nav-tabs>li>a{margin-right:0!important;padding:4px 8px;color:#9c27b0!important}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd!important;border-bottom-color:transparent!important}.divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}input.cell-text::-webkit-input-placeholder{color:#d5d5d5}input.cell-text::-moz-placeholder{color:#d5d5d5}input.cell-text:-ms-input-placeholder{color:#d5d5d5}input.cell-text::-ms-input-placeholder{color:#d5d5d5}input.cell-text::placeholder{color:#d5d5d5}input.text{border:1px solid #ddd;padding:5px 10px;border-radius:3px;color:#333}input.text::-webkit-input-placeholder{color:#d5d5d5}input.text::-moz-placeholder{color:#d5d5d5}input.text:-ms-input-placeholder{color:#d5d5d5}input.text::-ms-input-placeholder{color:#d5d5d5}input.text::placeholder{color:#d5d5d5}select.text{border:1px solid #ddd;padding:5px 2px;border-radius:3px;color:#333}select.text::-webkit-input-placeholder{color:#d5d5d5}select.text::-moz-placeholder{color:#d5d5d5}select.text:-ms-input-placeholder{color:#d5d5d5}select.text::-ms-input-placeholder{color:#d5d5d5}select.text::placeholder{color:#d5d5d5}textarea.text{border:1px solid #ddd;padding:5px 10px;border-radius:3px;color:#333;resize:none}textarea.text::-webkit-input-placeholder{color:#d5d5d5}textarea.text::-moz-placeholder{color:#d5d5d5}textarea.text:-ms-input-placeholder{color:#d5d5d5}textarea.text::-ms-input-placeholder{color:#d5d5d5}textarea.text::placeholder{color:#d5d5d5}.text-input{color:#b5b4b4;font-size:1.12em;position:relative;vertical-align:middle;display:inline-block;transition:.5s;padding:0;cursor:pointer;border-bottom:2px solid #fff;-webkit-transition:.5s}.text-input::after,.text-input::before{width:100%;height:100%;z-index:3;content:\"\";position:absolute;top:0;left:0;box-sizing:border-box;-webkit-transform:scale(0);transition:.5s}.text-input::-webkit-input-placeholder{color:#dcb8e3;font-size:1.09em}.text-input::-moz-placeholder{color:#dcb8e3;font-size:1.09em}.text-input:-ms-input-placeholder{color:#dcb8e3;font-size:1.09em}.text-input::-ms-input-placeholder{color:#dcb8e3;font-size:1.09em}.text-input::placeholder{color:#dcb8e3;font-size:1.09em}.text-input:focus,.text-input:hover{color:#dcb8e3;font-size:1.09em;border-bottom:2px solid #dedede}input[type=checkbox],input[type=radio]{display:none}input[type=checkbox]+label,input[type=radio]+label{color:#b5b4b4;font-size:1.09em}input[type=radio]+label span{display:inline-block;width:19px;height:19px;margin:-2px 10px 0 0;vertical-align:middle;cursor:pointer}input[type=checkbox]+label span{display:inline-block;width:19px;height:19px;margin:-2px 10px 0 0;vertical-align:middle;cursor:pointer;transition:.1s}input[type=checkbox]:checked+label span{transition:.1s}.multiple-questions label span{display:block;cursor:pointer;max-height:242px;border:1px solid #ddd;border-radius:7px;padding:10px 10px 0;margin:5px;max-width:180px;min-height:180px}.multiple-questions label span.no-image{min-height:0}.multiple-questions label span.no-image img{display:none!important}.multiple-questions input[type=radio]:checked+span{border:1px solid #595959!important;background:#fcfcfc}.multiple-questions label span img{border-radius:7px;width:180px;height:180px}.multiple-questions .text{text-align:center;padding:15px 0;min-height:30px}input.multichoice:empty{margin-left:-999px}input.multichoice:empty~label{position:relative;margin-right:20px;margin-bottom:20px;padding-right:20px;float:left;line-height:2.5em;text-indent:3.5em;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:.1s}input.multichoice:empty~label:before{position:relative;left:0;float:left;content:'';width:40px;background:#d1d3d4;border-radius:3px 0 0 3px;margin-left:0;margin-right:-40px}input.multichoice:checked~label:before{content:'\\2714';text-indent:.9em;color:#fff;background-color:#6c63fe;transition:.1s}.d-flex{display:flex!important}.flex-wrap{flex-wrap:wrap!important}.justify-content-center{justify-content:center!important}.flex-column{flex-direction:column!important}.align-content-center{align-content:center!important}.align-vertical-center{-ms-align-items:center!important;align-items:center!important}.wrapper{min-height:100%;position:relative;overflow:hidden}.wrapper:after,.wrapper:before{content:\" \";display:table}.wrapper:after{clear:both}.content-wrapper{min-height:100%;background-color:#fff;z-index:800;padding-top:40px}.top-menu{position:absolute;border-bottom:1px solid #eee;top:0;width:100%;height:40px;padding:0 10px;line-height:40px}.tool{float:right;padding:2px 5px}.footer{position:absolute;border-top:1px solid #eee;bottom:0;padding:0 10px;width:100%;height:40px;line-height:40px;background:#fff}.cliente{font-size:16px}.modulo a{padding:2px 5px;border-radius:4px;display:block;background:#9c27b0;color:#fff;margin-bottom:5px}.modulo a:hover{background:#831596}.modulo span a{float:right;font-size:12px;padding:0;background:0 0;margin-left:5px;margin-top:1px}.modulo span a:hover{color:#e9e9e9}.etapa a{padding:2px 5px 2px 20px;border-radius:4px;display:block;background:0 0;color:#777;margin-bottom:5px}.etapa span a{float:right;font-size:12px;padding:0;background:0 0;color:#ddd;margin-left:5px;margin-top:1px}.etapa span a:hover{color:#999}.form-custom input[type=number],.form-custom input[type=text],.form-custom select,.form-custom textarea{border:1px solid #dadde2;padding:3px 5px;border-radius:2px;font-size:13px;overflow-x:hidden}.form-custom .txt{border:1px solid #dadde2;padding:3px 5px;border-radius:2px;font-size:13px}.form-custom ::-webkit-input-placeholder{font-size:13px;color:#999}.form-custom ::-moz-placeholder{font-size:13px;color:#999}.form-custom ::-ms-input-placeholder{font-size:13px;color:#999}.wrapper-input{height:45px}.btn-rose{background:#e91e63}.cursor{cursor:pointer}.midia-w iframe{width:100%}.midia-h iframe{height:400px}.breadcrumb{padding:0 15px;margin-bottom:20px;list-style:none;background-color:transparent;font-size:12px}.config-label{width:100%;margin:5px 0;float:left;font-size:.8em;display:block;line-height:1.5em}.config-textarea{width:100%;margin:5px 0;float:left;resize:initial;overflow-y:auto;display:block;font-size:.9em!important;color:#999}.config-input,.config-select{width:100%;margin:5px 0;float:left;display:block;font-size:.9em!important;color:#999}.config-box{width:100%;margin:5px;float:left}.config-box-50{width:45%;min-height:110px;margin:5px;float:left;background:#f9f9f9;border:1px solid #eee;border-radius:5px;padding:10px}.config-box-title{width:100%;padding:10px;font-size:.85em}.no-bg-image{background-image:none}.space-inside{padding:10px}.block{display:block}.fake-link{cursor:pointer}.item-component{margin:0;border-radius:2px;border:1px solid #fff}.item-component:hover{border-color:#9c27b0}.item-component.active{border-color:#9c27b0;background-color:#f9f9f9}.item-box-model{border:3px dashed #ddd;padding:20px;color:#ccc;min-height:50px}.item-component-challenge,.item-component-conclusion,.item-component-download,.item-component-dynamic-input,.item-component-dynamic-table,.item-component-image,.item-component-intro,.item-component-long-text,.item-component-multichoise,.item-component-multiple-questions,.item-component-pdf,.item-component-rating,.item-component-sales-channel,.item-component-sheet-correct-incorrect,.item-component-star-point,.item-component-text,.item-component-upload,.item-component-video,.item-component-yes-no{padding:0}.item-component-image .material-icons,.item-component-pdf .material-icons,.item-component-video .material-icons{font-size:80px}.item-component-title .title-bold{font-weight:700}.item-component-title .title-italic{font-style:italic}.item-component-title .title-underline{text-decoration:underline}.icon.disabled{opacity:.3}.item-component-image-icon-container,.item-component-pdf-icon-container,.item-component-video-icon-container{background:#eee;border:1px solid #ccc;text-align:center;color:#444;font-size:50px;padding:160px}.btn-container{text-align:center}.etapa a:hover,.etapa.active a{background:#f4f4f4}.etapa.active:before{font:700 14px/1 FontAwesome;content:\"\\f0da\";float:left;color:#9c27b0;position:relative;top:5px;left:5px}.scroll{overflow-y:auto}#trail-status{color:#ddd;margin-right:10px;background:0 0;border:none}#trail-status.active{color:#6c9}.item-btn-delete{position:relative}.item-btn-delete button{position:absolute;top:-10px;right:-10px;border:1px solid #9c27b0;background-color:#fff;color:#9c27b0;border-radius:50%;width:20px;height:20px;padding:0;font-size:12px;line-height:12px;z-index:1}.item-btn-delete button:hover{background-color:#9c27b0;color:#fff}.custom-divisor{margin:10px 0}#tbl-objetivo td{padding:0 8px;height:0}#accordion .tool-name:after{font-family:\"Glyphicons Halflings\";content:\"\\e114\";float:right}#accordion .tool-name.collapsed:after{content:\"\\e080\"}#editor-components-wrapper img{max-height:500px;-o-object-fit:contain;object-fit:contain;background:#eee;width:auto}.input-styled{border:1px solid #ccc;padding:4px 6px;border-radius:2px}.pulse:hover{-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-name:pulse;animation-name:pulse}@-webkit-keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(.9);opacity:.7}}@keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(.9);opacity:.7}}.cover{position:relative}.cover img{width:100%;min-height:480px;-o-object-fit:cover;object-fit:cover;opacity:1;transition:.5s;-webkit-backface-visibility:hidden;backface-visibility:hidden}.mx-auto{float:none;margin:0 auto}@media (min-width:576px) and (max-width:767px){::ng-deep .sheet-correct .radio{width:90%!important}}@media (min-width:768px) and (max-width:991px){::ng-deep .sheet-correct .radio{width:45%!important}}@media (min-width:992px) and (max-width:1199px){::ng-deep .sheet-correct .radio{width:65%!important}}@media (min-width:1200px){::ng-deep .sheet-correct .radio{width:45%!important}}@media (min-width:1600px){.col-sup{height:45vh}.col-sub{height:55.5vh}.col-int{height:88.5vh}}.image-modal{transition:.5s}.image-modal-item{width:100%;-o-object-fit:scale-down;object-fit:scale-down;max-height:320px;cursor:zoom-in}.image-modal-full{position:fixed;top:0;left:0;z-index:99999;width:100%;height:100%;padding:10%;background:rgba(0,0,0,.3);-o-object-fit:contain;object-fit:contain;cursor:zoom-out}", "input,textarea{padding:10px}"]
|
|
3586
|
+
}] }
|
|
3587
|
+
];
|
|
3588
|
+
/** @nocollapse */
|
|
3589
|
+
DynamicInputComponent.ctorParameters = function () { return []; };
|
|
3590
|
+
DynamicInputComponent.propDecorators = {
|
|
3591
|
+
input: [{ type: Input }]
|
|
3592
|
+
};
|
|
3593
|
+
return DynamicInputComponent;
|
|
3594
|
+
}());
|
|
3595
|
+
if (false) {
|
|
3752
3596
|
/** @type {?} */
|
|
3753
|
-
|
|
3597
|
+
DynamicInputComponent.prototype.input;
|
|
3754
3598
|
}
|
|
3755
3599
|
|
|
3756
3600
|
/**
|
|
3757
3601
|
* @fileoverview added by tsickle
|
|
3758
|
-
* Generated from: lib/\@core/
|
|
3602
|
+
* Generated from: lib/\@core/services/trail-content.service.ts
|
|
3759
3603
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3760
3604
|
*/
|
|
3761
|
-
var
|
|
3762
|
-
function
|
|
3763
|
-
this.
|
|
3605
|
+
var TrailContentService = /** @class */ (function () {
|
|
3606
|
+
function TrailContentService(http, global) {
|
|
3607
|
+
this.http = http;
|
|
3608
|
+
this.global = global;
|
|
3764
3609
|
}
|
|
3765
3610
|
/**
|
|
3766
|
-
* @param {?}
|
|
3767
|
-
* @param {?} next
|
|
3611
|
+
* @param {?} id
|
|
3768
3612
|
* @return {?}
|
|
3769
3613
|
*/
|
|
3770
|
-
|
|
3771
|
-
* @param {?}
|
|
3772
|
-
* @param {?} next
|
|
3614
|
+
TrailContentService.prototype.all = /**
|
|
3615
|
+
* @param {?} id
|
|
3773
3616
|
* @return {?}
|
|
3774
3617
|
*/
|
|
3775
|
-
function (
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
* @param {?} error
|
|
3618
|
+
function (id) {
|
|
3619
|
+
return this.http.get(this.global.apiURL() + '/api/v2/client/trilha/conteudo/multiple/' + id, this.getHeaders()).pipe(catchError((/**
|
|
3620
|
+
* @param {?} err
|
|
3779
3621
|
* @return {?}
|
|
3780
3622
|
*/
|
|
3781
|
-
function (
|
|
3782
|
-
return _this.handleOfflineFallback(request, error);
|
|
3783
|
-
})));
|
|
3623
|
+
function (err) { return of({ data: [] }); })));
|
|
3784
3624
|
};
|
|
3785
3625
|
/**
|
|
3786
|
-
* @
|
|
3787
|
-
* @param {?} request
|
|
3788
|
-
* @param {?} originalError
|
|
3626
|
+
* @param {?} id
|
|
3789
3627
|
* @return {?}
|
|
3790
3628
|
*/
|
|
3791
|
-
|
|
3792
|
-
* @
|
|
3793
|
-
* @param {?} request
|
|
3794
|
-
* @param {?} originalError
|
|
3629
|
+
TrailContentService.prototype.updateGrafico = /**
|
|
3630
|
+
* @param {?} id
|
|
3795
3631
|
* @return {?}
|
|
3796
3632
|
*/
|
|
3797
|
-
function (
|
|
3798
|
-
|
|
3799
|
-
var url = request.url;
|
|
3800
|
-
// 1. Intercepta chamadas POST/PUT de progresso, anotações, tempo e salva na fila offline
|
|
3801
|
-
if (request.method === 'POST' || request.method === 'PUT') {
|
|
3802
|
-
if (url.includes('/progresso') ||
|
|
3803
|
-
url.includes('/tempo') ||
|
|
3804
|
-
url.includes('/multiple') ||
|
|
3805
|
-
url.includes('/anotacoes') ||
|
|
3806
|
-
url.includes('/conteudo/vote')) {
|
|
3807
|
-
/** @type {?} */
|
|
3808
|
-
var actionType = 'stage_progress';
|
|
3809
|
-
if (url.includes('/tempo')) {
|
|
3810
|
-
actionType = 'video_progress';
|
|
3811
|
-
}
|
|
3812
|
-
else if (url.includes('/anotacoes')) {
|
|
3813
|
-
actionType = 'notes';
|
|
3814
|
-
}
|
|
3815
|
-
this.offlineService.queueSyncAction({
|
|
3816
|
-
type: actionType,
|
|
3817
|
-
endpoint: url,
|
|
3818
|
-
payload: request.body || {}
|
|
3819
|
-
});
|
|
3820
|
-
console.log('[OfflineHttpInterceptor] Requisição POST/PUT interceptada e salva na fila de sincronização:', url);
|
|
3821
|
-
return of(new HttpResponse({
|
|
3822
|
-
status: 200,
|
|
3823
|
-
statusText: 'OK (Offline Queued)',
|
|
3824
|
-
body: { status: true, success: true, queued: true, message: 'Ação salva offline' }
|
|
3825
|
-
}));
|
|
3826
|
-
}
|
|
3827
|
-
}
|
|
3828
|
-
// 2. Intercepta requisições GET de conteúdo ou etapas
|
|
3829
|
-
if (request.method === 'GET') {
|
|
3830
|
-
/** @type {?} */
|
|
3831
|
-
var matches = url.match(/\/(\d+)(?:$|\/|\?)/);
|
|
3832
|
-
if (matches && matches[1]) {
|
|
3833
|
-
/** @type {?} */
|
|
3834
|
-
var id = matches[1];
|
|
3835
|
-
return from(this.offlineService.getDownloadedLesson(id)).pipe(switchMap((/**
|
|
3836
|
-
* @param {?} lesson
|
|
3837
|
-
* @return {?}
|
|
3838
|
-
*/
|
|
3839
|
-
function (lesson) {
|
|
3840
|
-
if (lesson) {
|
|
3841
|
-
console.log('[OfflineHttpInterceptor] Resposta offline fornecida para:', url);
|
|
3842
|
-
/** @type {?} */
|
|
3843
|
-
var dataValue = Array.isArray(lesson.stageData) ? lesson.stageData : [lesson.stageData];
|
|
3844
|
-
return of(new HttpResponse({
|
|
3845
|
-
status: 200,
|
|
3846
|
-
statusText: 'OK (Offline Cache)',
|
|
3847
|
-
body: {
|
|
3848
|
-
status: true,
|
|
3849
|
-
data: [{
|
|
3850
|
-
id: lesson.id,
|
|
3851
|
-
title: lesson.title,
|
|
3852
|
-
value: dataValue
|
|
3853
|
-
}]
|
|
3854
|
-
}
|
|
3855
|
-
}));
|
|
3856
|
-
}
|
|
3857
|
-
return throwError(originalError);
|
|
3858
|
-
})));
|
|
3859
|
-
}
|
|
3860
|
-
}
|
|
3861
|
-
return throwError(originalError);
|
|
3633
|
+
function (id) {
|
|
3634
|
+
return this.http.get(this.global.apiURL() + '/api/v2/client/trilha/conteudo/multiple/assessment/' + id, this.getHeaders());
|
|
3862
3635
|
};
|
|
3863
|
-
OfflineHttpInterceptor.decorators = [
|
|
3864
|
-
{ type: Injectable }
|
|
3865
|
-
];
|
|
3866
|
-
/** @nocollapse */
|
|
3867
|
-
OfflineHttpInterceptor.ctorParameters = function () { return [
|
|
3868
|
-
{ type: OfflineStorageService }
|
|
3869
|
-
]; };
|
|
3870
|
-
return OfflineHttpInterceptor;
|
|
3871
|
-
}());
|
|
3872
|
-
if (false) {
|
|
3873
|
-
/**
|
|
3874
|
-
* @type {?}
|
|
3875
|
-
* @private
|
|
3876
|
-
*/
|
|
3877
|
-
OfflineHttpInterceptor.prototype.offlineService;
|
|
3878
|
-
}
|
|
3879
|
-
|
|
3880
|
-
/**
|
|
3881
|
-
* @fileoverview added by tsickle
|
|
3882
|
-
* Generated from: lib/shared/file-manager/models/file-manager.model.ts
|
|
3883
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3884
|
-
*/
|
|
3885
|
-
var FileManagerModel = /** @class */ (function () {
|
|
3886
|
-
function FileManagerModel(http, global) {
|
|
3887
|
-
this.http = http;
|
|
3888
|
-
this.global = global;
|
|
3889
|
-
this.apiBaseUrl = this.global.apiURL();
|
|
3890
|
-
}
|
|
3891
3636
|
/**
|
|
3637
|
+
* @param {?} id
|
|
3892
3638
|
* @param {?} data
|
|
3893
3639
|
* @return {?}
|
|
3894
3640
|
*/
|
|
3895
|
-
|
|
3641
|
+
TrailContentService.prototype.save = /**
|
|
3642
|
+
* @param {?} id
|
|
3896
3643
|
* @param {?} data
|
|
3897
3644
|
* @return {?}
|
|
3898
3645
|
*/
|
|
3899
|
-
function (data) {
|
|
3900
|
-
return
|
|
3646
|
+
function (id, data) {
|
|
3647
|
+
return this.http.post(this.global.apiURL() + '/api/v2/client/trilha/conteudo/multiple/' + id, { value: data }, this.getHeaders());
|
|
3901
3648
|
};
|
|
3902
3649
|
/**
|
|
3650
|
+
* @param {?} id
|
|
3903
3651
|
* @param {?} data
|
|
3904
3652
|
* @return {?}
|
|
3905
3653
|
*/
|
|
3906
|
-
|
|
3654
|
+
TrailContentService.prototype.update = /**
|
|
3655
|
+
* @param {?} id
|
|
3907
3656
|
* @param {?} data
|
|
3908
3657
|
* @return {?}
|
|
3909
3658
|
*/
|
|
3910
|
-
function (data) {
|
|
3911
|
-
|
|
3912
|
-
var formData = new FormData();
|
|
3913
|
-
formData.append('file', data.file);
|
|
3914
|
-
formData.append('name', data.name);
|
|
3915
|
-
formData.append('description', data.description);
|
|
3916
|
-
/** @type {?} */
|
|
3917
|
-
var headerOptions = {
|
|
3918
|
-
'Authorization': localStorage.getItem('token'),
|
|
3919
|
-
'Accept': 'application/json'
|
|
3920
|
-
};
|
|
3921
|
-
/** @type {?} */
|
|
3922
|
-
var req = new HttpRequest('POST', this.apiBaseUrl + '/api/v2/admin/file', formData, {
|
|
3923
|
-
reportProgress: true,
|
|
3924
|
-
responseType: 'json',
|
|
3925
|
-
headers: new HttpHeaders(headerOptions)
|
|
3926
|
-
});
|
|
3927
|
-
return this.http.request(req);
|
|
3928
|
-
// return this.http.post(this.apiBaseUrl + '/api/v2/admin/file', data, {headers: new HttpHeaders(headerOptions)});
|
|
3659
|
+
function (id, data) {
|
|
3660
|
+
return this.http.put(this.global.apiURL() + '/api/v2/client/trilha/conteudo/multiple/' + id, { value: data }, this.getHeaders());
|
|
3929
3661
|
};
|
|
3930
3662
|
/**
|
|
3663
|
+
* @param {?} id
|
|
3931
3664
|
* @return {?}
|
|
3932
3665
|
*/
|
|
3933
|
-
|
|
3666
|
+
TrailContentService.prototype.delete = /**
|
|
3667
|
+
* @param {?} id
|
|
3934
3668
|
* @return {?}
|
|
3935
3669
|
*/
|
|
3936
|
-
function () {
|
|
3937
|
-
return this.http.
|
|
3670
|
+
function (id) {
|
|
3671
|
+
return this.http.delete(this.global.apiURL() + '/api/v2/client/exercises/' + id, this.getHeaders());
|
|
3938
3672
|
};
|
|
3939
3673
|
/**
|
|
3940
3674
|
* @param {?} id
|
|
3675
|
+
* @param {?} seconds
|
|
3941
3676
|
* @return {?}
|
|
3942
3677
|
*/
|
|
3943
|
-
|
|
3678
|
+
TrailContentService.prototype.videoTime = /**
|
|
3944
3679
|
* @param {?} id
|
|
3680
|
+
* @param {?} seconds
|
|
3945
3681
|
* @return {?}
|
|
3946
3682
|
*/
|
|
3947
|
-
function (id) {
|
|
3948
|
-
return this.http.
|
|
3683
|
+
function (id, seconds) {
|
|
3684
|
+
return this.http.get(this.global.apiURL() + '/api/v2/client/trilha/conteudo/tempo/' + id + '/' + seconds, this.getHeaders());
|
|
3949
3685
|
};
|
|
3950
3686
|
/**
|
|
3687
|
+
* @param {?} id
|
|
3688
|
+
* @param {?} vote
|
|
3951
3689
|
* @return {?}
|
|
3952
3690
|
*/
|
|
3953
|
-
|
|
3691
|
+
TrailContentService.prototype.vote = /**
|
|
3692
|
+
* @param {?} id
|
|
3693
|
+
* @param {?} vote
|
|
3954
3694
|
* @return {?}
|
|
3955
3695
|
*/
|
|
3956
|
-
function () {
|
|
3957
|
-
return
|
|
3696
|
+
function (id, vote) {
|
|
3697
|
+
return this.http.post(this.global.apiURL() + '/api/v2/client/trilha/conteudo/vote/' + id, { voto: vote }, this.getHeaders());
|
|
3958
3698
|
};
|
|
3959
3699
|
/**
|
|
3960
3700
|
* @return {?}
|
|
3961
3701
|
*/
|
|
3962
|
-
|
|
3702
|
+
TrailContentService.prototype.getHeaders = /**
|
|
3963
3703
|
* @return {?}
|
|
3964
3704
|
*/
|
|
3965
3705
|
function () {
|
|
3966
3706
|
/** @type {?} */
|
|
3967
3707
|
var token = localStorage.getItem('token');
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
};
|
|
3975
|
-
return new HttpHeaders(headerOptions);
|
|
3976
|
-
}
|
|
3708
|
+
/** @type {?} */
|
|
3709
|
+
var headerOptions = {
|
|
3710
|
+
'Authorization': token,
|
|
3711
|
+
'Accept': 'application/json'
|
|
3712
|
+
};
|
|
3713
|
+
return { headers: new HttpHeaders(headerOptions) };
|
|
3977
3714
|
};
|
|
3978
|
-
|
|
3715
|
+
TrailContentService.decorators = [
|
|
3979
3716
|
{ type: Injectable }
|
|
3980
3717
|
];
|
|
3981
3718
|
/** @nocollapse */
|
|
3982
|
-
|
|
3719
|
+
TrailContentService.ctorParameters = function () { return [
|
|
3983
3720
|
{ type: HttpClient },
|
|
3984
3721
|
{ type: Global }
|
|
3985
3722
|
]; };
|
|
3986
|
-
return
|
|
3723
|
+
return TrailContentService;
|
|
3987
3724
|
}());
|
|
3988
3725
|
if (false) {
|
|
3989
3726
|
/** @type {?} */
|
|
3990
|
-
|
|
3991
|
-
/** @type {?} */
|
|
3992
|
-
FileManagerModel.prototype.name;
|
|
3993
|
-
/** @type {?} */
|
|
3994
|
-
FileManagerModel.prototype.description;
|
|
3995
|
-
/** @type {?} */
|
|
3996
|
-
FileManagerModel.prototype.apiBaseUrl;
|
|
3997
|
-
/**
|
|
3998
|
-
* @type {?}
|
|
3999
|
-
* @private
|
|
4000
|
-
*/
|
|
4001
|
-
FileManagerModel.prototype.http;
|
|
3727
|
+
TrailContentService.prototype.http;
|
|
4002
3728
|
/** @type {?} */
|
|
4003
|
-
|
|
3729
|
+
TrailContentService.prototype.global;
|
|
4004
3730
|
}
|
|
4005
3731
|
|
|
4006
3732
|
/**
|
|
4007
3733
|
* @fileoverview added by tsickle
|
|
4008
|
-
* Generated from: lib/
|
|
3734
|
+
* Generated from: lib/\@core/services/offline-storage.service.ts
|
|
4009
3735
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4010
3736
|
*/
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
3737
|
+
/**
|
|
3738
|
+
* @record
|
|
3739
|
+
*/
|
|
3740
|
+
function DownloadedLesson() { }
|
|
3741
|
+
if (false) {
|
|
3742
|
+
/** @type {?} */
|
|
3743
|
+
DownloadedLesson.prototype.id;
|
|
3744
|
+
/** @type {?} */
|
|
3745
|
+
DownloadedLesson.prototype.trailId;
|
|
3746
|
+
/** @type {?} */
|
|
3747
|
+
DownloadedLesson.prototype.title;
|
|
3748
|
+
/** @type {?|undefined} */
|
|
3749
|
+
DownloadedLesson.prototype.subtitle;
|
|
3750
|
+
/** @type {?|undefined} */
|
|
3751
|
+
DownloadedLesson.prototype.thumbnail;
|
|
3752
|
+
/** @type {?} */
|
|
3753
|
+
DownloadedLesson.prototype.sizeBytes;
|
|
3754
|
+
/** @type {?} */
|
|
3755
|
+
DownloadedLesson.prototype.sizeFormatted;
|
|
3756
|
+
/** @type {?} */
|
|
3757
|
+
DownloadedLesson.prototype.downloadedAt;
|
|
3758
|
+
/** @type {?} */
|
|
3759
|
+
DownloadedLesson.prototype.stageData;
|
|
3760
|
+
/** @type {?} */
|
|
3761
|
+
DownloadedLesson.prototype.stages;
|
|
3762
|
+
/** @type {?|undefined} */
|
|
3763
|
+
DownloadedLesson.prototype.videoBlob;
|
|
3764
|
+
/** @type {?|undefined} */
|
|
3765
|
+
DownloadedLesson.prototype.videoMimeType;
|
|
3766
|
+
}
|
|
3767
|
+
/**
|
|
3768
|
+
* @record
|
|
3769
|
+
*/
|
|
3770
|
+
function SyncAction() { }
|
|
3771
|
+
if (false) {
|
|
3772
|
+
/** @type {?|undefined} */
|
|
3773
|
+
SyncAction.prototype.id;
|
|
3774
|
+
/** @type {?} */
|
|
3775
|
+
SyncAction.prototype.type;
|
|
3776
|
+
/** @type {?} */
|
|
3777
|
+
SyncAction.prototype.endpoint;
|
|
3778
|
+
/** @type {?} */
|
|
3779
|
+
SyncAction.prototype.payload;
|
|
3780
|
+
/** @type {?} */
|
|
3781
|
+
SyncAction.prototype.createdAt;
|
|
3782
|
+
}
|
|
3783
|
+
/**
|
|
3784
|
+
* @record
|
|
3785
|
+
*/
|
|
3786
|
+
function DownloadProgress() { }
|
|
3787
|
+
if (false) {
|
|
3788
|
+
/** @type {?} */
|
|
3789
|
+
DownloadProgress.prototype.stageId;
|
|
3790
|
+
/** @type {?} */
|
|
3791
|
+
DownloadProgress.prototype.progress;
|
|
3792
|
+
/** @type {?} */
|
|
3793
|
+
DownloadProgress.prototype.loaded;
|
|
3794
|
+
/** @type {?} */
|
|
3795
|
+
DownloadProgress.prototype.total;
|
|
3796
|
+
/** @type {?} */
|
|
3797
|
+
DownloadProgress.prototype.status;
|
|
3798
|
+
}
|
|
3799
|
+
var OfflineStorageService = /** @class */ (function () {
|
|
3800
|
+
function OfflineStorageService() {
|
|
3801
|
+
var _this = this;
|
|
3802
|
+
this.DB_NAME = 'AsapOfflineCoursesDB';
|
|
3803
|
+
this.DB_VERSION = 1;
|
|
3804
|
+
this.STORE_LESSONS = 'lessons';
|
|
3805
|
+
this.STORE_SYNC_QUEUE = 'sync_queue';
|
|
3806
|
+
this.db = null;
|
|
3807
|
+
this.isOnlineSubject = new BehaviorSubject(navigator.onLine);
|
|
3808
|
+
this.isOnline$ = this.isOnlineSubject.asObservable();
|
|
3809
|
+
this.downloadProgress$ = new BehaviorSubject({});
|
|
3810
|
+
this.downloadedLessons$ = new BehaviorSubject([]);
|
|
3811
|
+
this.initNetworkListeners();
|
|
3812
|
+
this.initDatabase().then((/**
|
|
3813
|
+
* @return {?}
|
|
3814
|
+
*/
|
|
3815
|
+
function () {
|
|
3816
|
+
_this.refreshDownloadedLessons();
|
|
3817
|
+
if (navigator.onLine) {
|
|
3818
|
+
_this.processSyncQueue();
|
|
3819
|
+
}
|
|
3820
|
+
}));
|
|
4016
3821
|
}
|
|
4017
3822
|
/**
|
|
4018
|
-
* @
|
|
4019
|
-
* @return {?}
|
|
4020
|
-
*/
|
|
4021
|
-
FileManagerService.prototype.uploadFile = /**
|
|
4022
|
-
* @param {?} data
|
|
4023
|
-
* @return {?}
|
|
4024
|
-
*/
|
|
4025
|
-
function (data) {
|
|
4026
|
-
return this.fileManagerModel.uploadFile(this.serialize(data));
|
|
4027
|
-
};
|
|
4028
|
-
/**
|
|
4029
|
-
* @param {?} id
|
|
3823
|
+
* @private
|
|
4030
3824
|
* @return {?}
|
|
4031
3825
|
*/
|
|
4032
|
-
|
|
4033
|
-
* @
|
|
3826
|
+
OfflineStorageService.prototype.initNetworkListeners = /**
|
|
3827
|
+
* @private
|
|
4034
3828
|
* @return {?}
|
|
4035
3829
|
*/
|
|
4036
|
-
function (
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
3830
|
+
function () {
|
|
3831
|
+
var _this = this;
|
|
3832
|
+
merge(of(navigator.onLine), fromEvent(window, 'online').pipe(map((/**
|
|
3833
|
+
* @return {?}
|
|
3834
|
+
*/
|
|
3835
|
+
function () { return true; }))), fromEvent(window, 'offline').pipe(map((/**
|
|
3836
|
+
* @return {?}
|
|
3837
|
+
*/
|
|
3838
|
+
function () { return false; })))).subscribe((/**
|
|
3839
|
+
* @param {?} online
|
|
3840
|
+
* @return {?}
|
|
3841
|
+
*/
|
|
3842
|
+
function (online) {
|
|
3843
|
+
_this.isOnlineSubject.next(online);
|
|
3844
|
+
if (online) {
|
|
3845
|
+
console.log('[OfflineStorageService] Conexão restabelecida! Processando fila de sincronização...');
|
|
3846
|
+
_this.processSyncQueue();
|
|
3847
|
+
}
|
|
3848
|
+
else {
|
|
3849
|
+
console.warn('[OfflineStorageService] Aplicação operando em MODO OFFLINE.');
|
|
3850
|
+
}
|
|
3851
|
+
}));
|
|
4043
3852
|
};
|
|
4044
3853
|
/**
|
|
3854
|
+
* @private
|
|
4045
3855
|
* @return {?}
|
|
4046
3856
|
*/
|
|
4047
|
-
|
|
3857
|
+
OfflineStorageService.prototype.initDatabase = /**
|
|
3858
|
+
* @private
|
|
4048
3859
|
* @return {?}
|
|
4049
3860
|
*/
|
|
4050
3861
|
function () {
|
|
4051
|
-
|
|
3862
|
+
var _this = this;
|
|
3863
|
+
return new Promise((/**
|
|
3864
|
+
* @param {?} resolve
|
|
3865
|
+
* @param {?} reject
|
|
3866
|
+
* @return {?}
|
|
3867
|
+
*/
|
|
3868
|
+
function (resolve, reject) {
|
|
3869
|
+
if (_this.db) {
|
|
3870
|
+
return resolve(_this.db);
|
|
3871
|
+
}
|
|
3872
|
+
if (!('indexedDB' in window)) {
|
|
3873
|
+
console.error('[OfflineStorageService] IndexedDB não é suportado neste navegador.');
|
|
3874
|
+
return reject(new Error('IndexedDB não suportado'));
|
|
3875
|
+
}
|
|
3876
|
+
/** @type {?} */
|
|
3877
|
+
var request = indexedDB.open(_this.DB_NAME, _this.DB_VERSION);
|
|
3878
|
+
request.onupgradeneeded = (/**
|
|
3879
|
+
* @param {?} event
|
|
3880
|
+
* @return {?}
|
|
3881
|
+
*/
|
|
3882
|
+
function (event) {
|
|
3883
|
+
/** @type {?} */
|
|
3884
|
+
var db = (/** @type {?} */ (event.target.result));
|
|
3885
|
+
if (!db.objectStoreNames.contains(_this.STORE_LESSONS)) {
|
|
3886
|
+
/** @type {?} */
|
|
3887
|
+
var lessonStore = db.createObjectStore(_this.STORE_LESSONS, { keyPath: 'id' });
|
|
3888
|
+
lessonStore.createIndex('trailId', 'trailId', { unique: false });
|
|
3889
|
+
lessonStore.createIndex('downloadedAt', 'downloadedAt', { unique: false });
|
|
3890
|
+
}
|
|
3891
|
+
if (!db.objectStoreNames.contains(_this.STORE_SYNC_QUEUE)) {
|
|
3892
|
+
/** @type {?} */
|
|
3893
|
+
var syncStore = db.createObjectStore(_this.STORE_SYNC_QUEUE, { keyPath: 'id', autoIncrement: true });
|
|
3894
|
+
syncStore.createIndex('createdAt', 'createdAt', { unique: false });
|
|
3895
|
+
}
|
|
3896
|
+
});
|
|
3897
|
+
request.onsuccess = (/**
|
|
3898
|
+
* @param {?} event
|
|
3899
|
+
* @return {?}
|
|
3900
|
+
*/
|
|
3901
|
+
function (event) {
|
|
3902
|
+
_this.db = (/** @type {?} */ (event.target.result));
|
|
3903
|
+
if (navigator.storage && navigator.storage.persist) {
|
|
3904
|
+
navigator.storage.persist().then((/**
|
|
3905
|
+
* @param {?} persistent
|
|
3906
|
+
* @return {?}
|
|
3907
|
+
*/
|
|
3908
|
+
function (persistent) {
|
|
3909
|
+
console.log("[OfflineStorageService] Armazenamento persistente: " + (persistent ? 'Ativado' : 'Padrão'));
|
|
3910
|
+
}));
|
|
3911
|
+
}
|
|
3912
|
+
resolve(_this.db);
|
|
3913
|
+
});
|
|
3914
|
+
request.onerror = (/**
|
|
3915
|
+
* @param {?} event
|
|
3916
|
+
* @return {?}
|
|
3917
|
+
*/
|
|
3918
|
+
function (event) {
|
|
3919
|
+
console.error('[OfflineStorageService] Erro ao abrir IndexedDB:', event.target.error);
|
|
3920
|
+
reject(event.target.error);
|
|
3921
|
+
});
|
|
3922
|
+
}));
|
|
4052
3923
|
};
|
|
4053
3924
|
/**
|
|
4054
|
-
* @param {?}
|
|
3925
|
+
* @param {?} lessonData
|
|
4055
3926
|
* @return {?}
|
|
4056
3927
|
*/
|
|
4057
|
-
|
|
4058
|
-
* @param {?}
|
|
3928
|
+
OfflineStorageService.prototype.downloadLesson = /**
|
|
3929
|
+
* @param {?} lessonData
|
|
4059
3930
|
* @return {?}
|
|
4060
3931
|
*/
|
|
4061
|
-
function (
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
3932
|
+
function (lessonData) {
|
|
3933
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3934
|
+
var db, stageId, videoBlob, sizeBytes, targetVideoUrl, err_1, e2_1, downloadedItem;
|
|
3935
|
+
var _this = this;
|
|
3936
|
+
return __generator(this, function (_a) {
|
|
3937
|
+
switch (_a.label) {
|
|
3938
|
+
case 0: return [4 /*yield*/, this.initDatabase()];
|
|
3939
|
+
case 1:
|
|
3940
|
+
db = _a.sent();
|
|
3941
|
+
stageId = String(lessonData.id);
|
|
3942
|
+
this.updateProgress(stageId, 0, 0, 100, 'downloading');
|
|
3943
|
+
sizeBytes = JSON.stringify(lessonData.stageData || {}).length;
|
|
3944
|
+
targetVideoUrl = lessonData.videoUrl;
|
|
3945
|
+
// Se for Vimeo ou YouTube (onde o navegador não consegue baixar direto pelo frontend sem endpoint backend),
|
|
3946
|
+
// utiliza uma URL de vídeo MP4 com CORS aberto garantido (GitHub Raw / MDN) para o teste offline
|
|
3947
|
+
if (!targetVideoUrl || targetVideoUrl.includes('youtube.com') || targetVideoUrl.includes('vimeo.com')) {
|
|
3948
|
+
targetVideoUrl = 'https://raw.githubusercontent.com/mediaelement/mediaelement-files/master/big_buck_bunny.mp4';
|
|
3949
|
+
}
|
|
3950
|
+
if (!targetVideoUrl) return [3 /*break*/, 9];
|
|
3951
|
+
_a.label = 2;
|
|
3952
|
+
case 2:
|
|
3953
|
+
_a.trys.push([2, 4, , 9]);
|
|
3954
|
+
return [4 /*yield*/, this.fetchBlobWithProgress(targetVideoUrl, stageId)];
|
|
3955
|
+
case 3:
|
|
3956
|
+
videoBlob = _a.sent();
|
|
3957
|
+
if (videoBlob) {
|
|
3958
|
+
sizeBytes += videoBlob.size;
|
|
3959
|
+
console.log("[OfflineStorageService] V\u00EDdeo baixado com sucesso! Tamanho: " + this.formatBytes(videoBlob.size));
|
|
3960
|
+
}
|
|
3961
|
+
return [3 /*break*/, 9];
|
|
3962
|
+
case 4:
|
|
3963
|
+
err_1 = _a.sent();
|
|
3964
|
+
console.warn('[OfflineStorageService] Tentando URL alternativa para download de teste...', err_1);
|
|
3965
|
+
_a.label = 5;
|
|
3966
|
+
case 5:
|
|
3967
|
+
_a.trys.push([5, 7, , 8]);
|
|
3968
|
+
return [4 /*yield*/, this.fetchBlobWithProgress('https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4', stageId)];
|
|
3969
|
+
case 6:
|
|
3970
|
+
videoBlob = _a.sent();
|
|
3971
|
+
if (videoBlob) {
|
|
3972
|
+
sizeBytes += videoBlob.size;
|
|
3973
|
+
}
|
|
3974
|
+
return [3 /*break*/, 8];
|
|
3975
|
+
case 7:
|
|
3976
|
+
e2_1 = _a.sent();
|
|
3977
|
+
console.warn('[OfflineStorageService] Falha ao baixar vídeo direto:', e2_1);
|
|
3978
|
+
return [3 /*break*/, 8];
|
|
3979
|
+
case 8: return [3 /*break*/, 9];
|
|
3980
|
+
case 9:
|
|
3981
|
+
downloadedItem = {
|
|
3982
|
+
id: lessonData.id,
|
|
3983
|
+
trailId: lessonData.trailId,
|
|
3984
|
+
title: lessonData.title,
|
|
3985
|
+
subtitle: lessonData.subtitle || '',
|
|
3986
|
+
thumbnail: lessonData.thumbnail || '',
|
|
3987
|
+
sizeBytes: sizeBytes,
|
|
3988
|
+
sizeFormatted: this.formatBytes(sizeBytes),
|
|
3989
|
+
downloadedAt: new Date(),
|
|
3990
|
+
stageData: lessonData.stageData,
|
|
3991
|
+
stages: lessonData.stages || [],
|
|
3992
|
+
videoBlob: videoBlob,
|
|
3993
|
+
videoMimeType: videoBlob ? videoBlob.type : 'video/mp4'
|
|
3994
|
+
};
|
|
3995
|
+
return [2 /*return*/, new Promise((/**
|
|
3996
|
+
* @param {?} resolve
|
|
3997
|
+
* @param {?} reject
|
|
3998
|
+
* @return {?}
|
|
3999
|
+
*/
|
|
4000
|
+
function (resolve, reject) {
|
|
4001
|
+
/** @type {?} */
|
|
4002
|
+
var transaction = db.transaction([_this.STORE_LESSONS], 'readwrite');
|
|
4003
|
+
/** @type {?} */
|
|
4004
|
+
var store = transaction.objectStore(_this.STORE_LESSONS);
|
|
4005
|
+
/** @type {?} */
|
|
4006
|
+
var request = store.put(downloadedItem);
|
|
4007
|
+
request.onsuccess = (/**
|
|
4008
|
+
* @return {?}
|
|
4009
|
+
*/
|
|
4010
|
+
function () {
|
|
4011
|
+
_this.updateProgress(stageId, 100, sizeBytes, sizeBytes, 'completed');
|
|
4012
|
+
_this.refreshDownloadedLessons();
|
|
4013
|
+
resolve(downloadedItem);
|
|
4014
|
+
});
|
|
4015
|
+
request.onerror = (/**
|
|
4016
|
+
* @param {?} event
|
|
4017
|
+
* @return {?}
|
|
4018
|
+
*/
|
|
4019
|
+
function (event) {
|
|
4020
|
+
_this.updateProgress(stageId, 0, 0, 0, 'error');
|
|
4021
|
+
reject(event.target.error);
|
|
4022
|
+
});
|
|
4023
|
+
}))];
|
|
4024
|
+
}
|
|
4025
|
+
});
|
|
4026
|
+
});
|
|
4027
|
+
};
|
|
4086
4028
|
/**
|
|
4087
|
-
* @type {?}
|
|
4088
4029
|
* @private
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
/** @type {?} */
|
|
4092
|
-
FileManagerService.prototype.global;
|
|
4093
|
-
}
|
|
4094
|
-
|
|
4095
|
-
/**
|
|
4096
|
-
* @fileoverview added by tsickle
|
|
4097
|
-
* Generated from: lib/shared/file-manager/containers/file-manager/file-manager.component.ts
|
|
4098
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4099
|
-
*/
|
|
4100
|
-
var FileManagerComponent = /** @class */ (function () {
|
|
4101
|
-
function FileManagerComponent(_fileManagerService, translate) {
|
|
4102
|
-
this._fileManagerService = _fileManagerService;
|
|
4103
|
-
this.translate = translate;
|
|
4104
|
-
this.event = new EventEmitter();
|
|
4105
|
-
this.progress = { percentage: 0 };
|
|
4106
|
-
this.loading = false;
|
|
4107
|
-
}
|
|
4108
|
-
/**
|
|
4030
|
+
* @param {?} url
|
|
4031
|
+
* @param {?} stageId
|
|
4109
4032
|
* @return {?}
|
|
4110
4033
|
*/
|
|
4111
|
-
|
|
4034
|
+
OfflineStorageService.prototype.fetchBlobWithProgress = /**
|
|
4035
|
+
* @private
|
|
4036
|
+
* @param {?} url
|
|
4037
|
+
* @param {?} stageId
|
|
4112
4038
|
* @return {?}
|
|
4113
4039
|
*/
|
|
4114
|
-
function () {
|
|
4115
|
-
this
|
|
4040
|
+
function (url, stageId) {
|
|
4041
|
+
var _this = this;
|
|
4042
|
+
return new Promise((/**
|
|
4043
|
+
* @param {?} resolve
|
|
4044
|
+
* @param {?} reject
|
|
4045
|
+
* @return {?}
|
|
4046
|
+
*/
|
|
4047
|
+
function (resolve, reject) {
|
|
4048
|
+
/** @type {?} */
|
|
4049
|
+
var xhr = new XMLHttpRequest();
|
|
4050
|
+
xhr.open('GET', url, true);
|
|
4051
|
+
xhr.responseType = 'blob';
|
|
4052
|
+
xhr.onprogress = (/**
|
|
4053
|
+
* @param {?} event
|
|
4054
|
+
* @return {?}
|
|
4055
|
+
*/
|
|
4056
|
+
function (event) {
|
|
4057
|
+
if (event.lengthComputable) {
|
|
4058
|
+
/** @type {?} */
|
|
4059
|
+
var progress = Math.round((event.loaded / event.total) * 100);
|
|
4060
|
+
_this.updateProgress(stageId, progress, event.loaded, event.total, 'downloading');
|
|
4061
|
+
}
|
|
4062
|
+
});
|
|
4063
|
+
xhr.onload = (/**
|
|
4064
|
+
* @return {?}
|
|
4065
|
+
*/
|
|
4066
|
+
function () {
|
|
4067
|
+
if (xhr.status >= 200 && xhr.status < 300) {
|
|
4068
|
+
resolve(xhr.response);
|
|
4069
|
+
}
|
|
4070
|
+
else {
|
|
4071
|
+
reject(new Error("Falha no download do v\u00EDdeo HTTP status " + xhr.status));
|
|
4072
|
+
}
|
|
4073
|
+
});
|
|
4074
|
+
xhr.onerror = (/**
|
|
4075
|
+
* @return {?}
|
|
4076
|
+
*/
|
|
4077
|
+
function () {
|
|
4078
|
+
reject(new Error('Erro de rede ou CORS durante o download do vídeo.'));
|
|
4079
|
+
});
|
|
4080
|
+
xhr.send();
|
|
4081
|
+
}));
|
|
4116
4082
|
};
|
|
4117
4083
|
/**
|
|
4084
|
+
* @private
|
|
4085
|
+
* @param {?} stageId
|
|
4086
|
+
* @param {?} progress
|
|
4087
|
+
* @param {?} loaded
|
|
4088
|
+
* @param {?} total
|
|
4089
|
+
* @param {?} status
|
|
4118
4090
|
* @return {?}
|
|
4119
4091
|
*/
|
|
4120
|
-
|
|
4092
|
+
OfflineStorageService.prototype.updateProgress = /**
|
|
4093
|
+
* @private
|
|
4094
|
+
* @param {?} stageId
|
|
4095
|
+
* @param {?} progress
|
|
4096
|
+
* @param {?} loaded
|
|
4097
|
+
* @param {?} total
|
|
4098
|
+
* @param {?} status
|
|
4121
4099
|
* @return {?}
|
|
4122
4100
|
*/
|
|
4123
|
-
function () {
|
|
4124
|
-
|
|
4101
|
+
function (stageId, progress, loaded, total, status) {
|
|
4102
|
+
var _a;
|
|
4103
|
+
/** @type {?} */
|
|
4104
|
+
var current = this.downloadProgress$.value;
|
|
4105
|
+
this.downloadProgress$.next(__assign({}, current, (_a = {}, _a[stageId] = { stageId: stageId, progress: progress, loaded: loaded, total: total, status: status }, _a)));
|
|
4125
4106
|
};
|
|
4126
4107
|
/**
|
|
4108
|
+
* @param {?} lessonId
|
|
4127
4109
|
* @return {?}
|
|
4128
4110
|
*/
|
|
4129
|
-
|
|
4111
|
+
OfflineStorageService.prototype.isLessonDownloaded = /**
|
|
4112
|
+
* @param {?} lessonId
|
|
4130
4113
|
* @return {?}
|
|
4131
4114
|
*/
|
|
4132
|
-
function () {
|
|
4133
|
-
|
|
4115
|
+
function (lessonId) {
|
|
4116
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4117
|
+
var lesson, _a;
|
|
4118
|
+
return __generator(this, function (_b) {
|
|
4119
|
+
switch (_b.label) {
|
|
4120
|
+
case 0:
|
|
4121
|
+
_b.trys.push([0, 2, , 3]);
|
|
4122
|
+
return [4 /*yield*/, this.getDownloadedLesson(lessonId)];
|
|
4123
|
+
case 1:
|
|
4124
|
+
lesson = _b.sent();
|
|
4125
|
+
return [2 /*return*/, !!lesson];
|
|
4126
|
+
case 2:
|
|
4127
|
+
_a = _b.sent();
|
|
4128
|
+
return [2 /*return*/, false];
|
|
4129
|
+
case 3: return [2 /*return*/];
|
|
4130
|
+
}
|
|
4131
|
+
});
|
|
4132
|
+
});
|
|
4134
4133
|
};
|
|
4135
4134
|
/**
|
|
4136
|
-
* @param {?}
|
|
4137
|
-
* @return {?}
|
|
4138
|
-
*/
|
|
4139
|
-
FileManagerComponent.prototype.onChange = /**
|
|
4140
|
-
* @param {?} $event
|
|
4135
|
+
* @param {?} lessonId
|
|
4141
4136
|
* @return {?}
|
|
4142
4137
|
*/
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
this.selectedFile = $event.target.files[0];
|
|
4146
|
-
}
|
|
4147
|
-
else {
|
|
4148
|
-
swal({
|
|
4149
|
-
type: 'error',
|
|
4150
|
-
title: this.translate.instant('ErrorLoadingFile'),
|
|
4151
|
-
text: this.translate.instant('MakeSureTheFileHasTheAllowedFormat'),
|
|
4152
|
-
buttonsStyling: false,
|
|
4153
|
-
confirmButtonClass: 'btn btn-success'
|
|
4154
|
-
});
|
|
4155
|
-
$('#file').val('');
|
|
4156
|
-
}
|
|
4157
|
-
};
|
|
4158
|
-
/**
|
|
4159
|
-
* @private
|
|
4160
|
-
* @param {?} fileType
|
|
4138
|
+
OfflineStorageService.prototype.getDownloadedLesson = /**
|
|
4139
|
+
* @param {?} lessonId
|
|
4161
4140
|
* @return {?}
|
|
4162
4141
|
*/
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
*/
|
|
4246
|
-
function (res) {
|
|
4247
|
-
_this.fileList = res.data;
|
|
4248
|
-
}));
|
|
4249
|
-
};
|
|
4250
|
-
/**
|
|
4251
|
-
* @param {?} item
|
|
4252
|
-
* @return {?}
|
|
4253
|
-
*/
|
|
4254
|
-
FileManagerComponent.prototype.selectFile = /**
|
|
4255
|
-
* @param {?} item
|
|
4256
|
-
* @return {?}
|
|
4257
|
-
*/
|
|
4258
|
-
function (item) {
|
|
4259
|
-
this.event.emit(item);
|
|
4260
|
-
this.closeModal();
|
|
4261
|
-
};
|
|
4262
|
-
/**
|
|
4263
|
-
* @param {?} item
|
|
4264
|
-
* @return {?}
|
|
4265
|
-
*/
|
|
4266
|
-
FileManagerComponent.prototype.deleteFromList = /**
|
|
4267
|
-
* @param {?} item
|
|
4268
|
-
* @return {?}
|
|
4269
|
-
*/
|
|
4270
|
-
function (item) {
|
|
4271
|
-
var _this = this;
|
|
4272
|
-
this._fileManagerService.removeFile(item.id)
|
|
4273
|
-
.subscribe((/**
|
|
4274
|
-
* @param {?} res
|
|
4275
|
-
* @return {?}
|
|
4276
|
-
*/
|
|
4277
|
-
function (res) {
|
|
4278
|
-
swal({
|
|
4279
|
-
type: 'success',
|
|
4280
|
-
title: _this.translate.instant('SuccessfullyRemoved'),
|
|
4281
|
-
text: _this.translate.instant('TheSelectedFileHasBeenRemovedFromTheSystem'),
|
|
4282
|
-
buttonsStyling: true,
|
|
4283
|
-
confirmButtonClass: 'btn btn-success'
|
|
4284
|
-
});
|
|
4285
|
-
_this.findAll();
|
|
4286
|
-
}), (/**
|
|
4287
|
-
* @param {?} err
|
|
4288
|
-
* @return {?}
|
|
4289
|
-
*/
|
|
4290
|
-
function (err) {
|
|
4291
|
-
swal({
|
|
4292
|
-
type: 'error',
|
|
4293
|
-
title: _this.translate.instant('ErrorRemovingFile'),
|
|
4294
|
-
text: _this.translate.instant('TryAgainLater'),
|
|
4295
|
-
buttonsStyling: true,
|
|
4296
|
-
confirmButtonClass: 'btn btn-success'
|
|
4297
|
-
});
|
|
4298
|
-
}));
|
|
4299
|
-
};
|
|
4300
|
-
FileManagerComponent.decorators = [
|
|
4301
|
-
{ type: Component, args: [{
|
|
4302
|
-
selector: 'app-file-manager',
|
|
4303
|
-
exportAs: 'appFileManager',
|
|
4304
|
-
template: "<!-- Modal -->\r\n<div id=\"appFileManager\" class=\"modal fade\" role=\"dialog\" data-backdrop=\"false\" >\r\n <div class=\"modal-dialog modal-lg\">\r\n <!-- Modal content-->\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button>\r\n <h4 class=\"modal-title\">{{ 'FileManager' | translate }}</h4>\r\n </div>\r\n <div class=\"modal-body\">\r\n <div class=\"col-md-12\">\r\n <div class=\"row\">\r\n <div class=\"col-md-2\">\r\n <ul class=\"nav nav-pills nav-pills-icons nav-pills-primary nav-stacked\" role=\"tablist\">\r\n <!--\r\n color-classes: \"nav-pills-primary\", \"nav-pills-info\", \"nav-pills-success\", \"nav-pills-warning\",\"nav-pills-danger\"\r\n-->\r\n <li class=\"active\">\r\n <a href=\"#upload\" role=\"tab\" data-toggle=\"tab\">\r\n <i class=\"material-icons\">backup</i> {{ 'Upload' | translate }}\r\n </a>\r\n </li>\r\n <li>\r\n <a href=\"#arquivos\" role=\"tab\" data-toggle=\"tab\">\r\n <i class=\"material-icons\">assignment</i> {{ 'Files' | translate }}\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n <div class=\"col-md-10\">\r\n <div class=\"tab-content\">\r\n <div class=\"tab-pane active\" id=\"upload\">\r\n <div class=\"col-sm-12\">\r\n <form *ngIf=\"!loading\" class=\"text-center\">\r\n <div class=\"fileinput fileinput-new text-center\" data-provides=\"fileinput\">\r\n <div class=\"fileinput-new thumbnail preview\" style=\"width: 320px;\">\r\n <img src=\"../../assets/img/image_placeholder.jpg\" alt=\"...\">\r\n </div>\r\n <div class=\"fileinput-preview fileinput-exists thumbnail\"></div>\r\n <div>\r\n <span class=\"btn btn-primary btn-round btn-file\">\r\n <span class=\"fileinput-new\">{{ 'SelectAFile' | translate }}</span>\r\n <span class=\"fileinput-exists\">{{ 'Alter' | translate }}</span>\r\n <input ng2FileSelect (change)=\"onChange($event)\" id=\"file\" type=\"file\" name=\"...\"/>\r\n </span>\r\n <button type=\"button\" (click)=\"submit()\" class=\"fileinput-exists btn btn-primary btn-round\">\r\n {{ 'Confirm' | translate }}\r\n </button>\r\n <a href=\"#pablo\" class=\"btn btn-danger btn-round fileinput-exists\" data-dismiss=\"fileinput\"><i\r\n class=\"fa fa-times\"></i> {{ 'Remove' | translate }}</a>\r\n </div>\r\n </div>\r\n </form>\r\n <div *ngIf=\"loading\">\r\n <br>\r\n <br>\r\n <legend>{{ 'Loading...' | translate }}</legend>\r\n <div class=\"progress progress-line-primary\">\r\n <div class=\"progress-bar\" role=\"progressbar\" aria-valuenow=\"60\"\r\n aria-valuemin=\"0\" aria-valuemax=\"100\" [ngStyle]=\"{width: progress.percentage + '%'}\">\r\n <span class=\"sr-only\">{{ progress.percentage + '%' }} {{ 'Concluded' | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"tab-pane\" id=\"arquivos\">\r\n <div class=\"col-md-12\" style=\"height: 360px; overflow: auto;\">\r\n <div class=\"table-responsive\">\r\n <table class=\"table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'Date' | translate }}</th>\r\n <th>{{ 'File' | translate }}</th>\r\n <th>{{ 'Actions' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let item of fileList\">\r\n <td>{{ item.updated_at.date | date: 'dd/MM/yyyy' }}</td>\r\n <td>{{ item.name }}</td>\r\n <td class=\"td-actions text-right\">\r\n <button (click)=\"selectFile(item)\" type=\"button\" class=\"btn btn-success\">\r\n <i class=\"material-icons\">check</i>\r\n </button>\r\n <button (click)=\"deleteFromList(item)\" type=\"button\" class=\"btn btn-danger\">\r\n <i class=\"material-icons\">close</i>\r\n </button>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!--<div class=\"modal-footer\">-->\r\n <!--<button type=\"button\" class=\"btn btn-primary\" data-dismiss=\"modal\">Confirmar</button>-->\r\n <!--<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Fechar</button>-->\r\n <!--</div>-->\r\n </div>\r\n </div>\r\n</div>\r\n",
|
|
4305
|
-
providers: [FileManagerService, FileManagerModel],
|
|
4306
|
-
styles: [".fileinput .thumbnail{max-width:100%!important;height:240px}.modal-content{min-height:450px}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}"]
|
|
4307
|
-
}] }
|
|
4308
|
-
];
|
|
4309
|
-
/** @nocollapse */
|
|
4310
|
-
FileManagerComponent.ctorParameters = function () { return [
|
|
4311
|
-
{ type: FileManagerService },
|
|
4312
|
-
{ type: TranslateService }
|
|
4313
|
-
]; };
|
|
4314
|
-
FileManagerComponent.propDecorators = {
|
|
4315
|
-
event: [{ type: Output }]
|
|
4316
|
-
};
|
|
4317
|
-
return FileManagerComponent;
|
|
4318
|
-
}());
|
|
4319
|
-
if (false) {
|
|
4320
|
-
/** @type {?} */
|
|
4321
|
-
FileManagerComponent.prototype.event;
|
|
4322
|
-
/** @type {?} */
|
|
4323
|
-
FileManagerComponent.prototype.selectedFile;
|
|
4324
|
-
/** @type {?} */
|
|
4325
|
-
FileManagerComponent.prototype.progress;
|
|
4326
|
-
/** @type {?} */
|
|
4327
|
-
FileManagerComponent.prototype.loading;
|
|
4328
|
-
/** @type {?} */
|
|
4329
|
-
FileManagerComponent.prototype.fileList;
|
|
4330
|
-
/**
|
|
4331
|
-
* @type {?}
|
|
4332
|
-
* @private
|
|
4333
|
-
*/
|
|
4334
|
-
FileManagerComponent.prototype._fileManagerService;
|
|
4335
|
-
/**
|
|
4336
|
-
* @type {?}
|
|
4337
|
-
* @private
|
|
4338
|
-
*/
|
|
4339
|
-
FileManagerComponent.prototype.translate;
|
|
4340
|
-
}
|
|
4341
|
-
|
|
4342
|
-
/**
|
|
4343
|
-
* @fileoverview added by tsickle
|
|
4344
|
-
* Generated from: lib/shared/file-manager/containers/file-manager-directive/file-manager.directive.ts
|
|
4345
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4346
|
-
*/
|
|
4347
|
-
var FileManagerDirective = /** @class */ (function () {
|
|
4348
|
-
function FileManagerDirective() {
|
|
4349
|
-
}
|
|
4350
|
-
FileManagerDirective.decorators = [
|
|
4351
|
-
{ type: Directive, args: [{
|
|
4352
|
-
selector: '[appFileManager]'
|
|
4353
|
-
},] }
|
|
4354
|
-
];
|
|
4355
|
-
return FileManagerDirective;
|
|
4356
|
-
}());
|
|
4357
|
-
|
|
4358
|
-
/**
|
|
4359
|
-
* @fileoverview added by tsickle
|
|
4360
|
-
* Generated from: lib/shared/file-manager/file-manager.module.ts
|
|
4361
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4362
|
-
*/
|
|
4363
|
-
var FileManagerModule = /** @class */ (function () {
|
|
4364
|
-
function FileManagerModule() {
|
|
4365
|
-
}
|
|
4366
|
-
FileManagerModule.decorators = [
|
|
4367
|
-
{ type: NgModule, args: [{
|
|
4368
|
-
imports: [
|
|
4369
|
-
CommonModule,
|
|
4370
|
-
ReactiveFormsModule,
|
|
4371
|
-
RouterModule,
|
|
4372
|
-
FormsModule,
|
|
4373
|
-
TranslateModule
|
|
4374
|
-
],
|
|
4375
|
-
declarations: [
|
|
4376
|
-
FileManagerComponent,
|
|
4377
|
-
FileManagerDirective
|
|
4378
|
-
],
|
|
4379
|
-
exports: [
|
|
4380
|
-
FileManagerComponent
|
|
4381
|
-
],
|
|
4382
|
-
},] }
|
|
4383
|
-
];
|
|
4384
|
-
return FileManagerModule;
|
|
4385
|
-
}());
|
|
4386
|
-
|
|
4387
|
-
/**
|
|
4388
|
-
* @fileoverview added by tsickle
|
|
4389
|
-
* Generated from: lib/editor/components/shared/title.component.ts
|
|
4390
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4391
|
-
*/
|
|
4392
|
-
var SharedTitleComponent = /** @class */ (function () {
|
|
4393
|
-
function SharedTitleComponent() {
|
|
4394
|
-
}
|
|
4395
|
-
SharedTitleComponent.decorators = [
|
|
4396
|
-
{ type: Component, args: [{
|
|
4397
|
-
selector: 'app-editor-component-shared-title',
|
|
4398
|
-
template: "\n <h2\n class=\"mb-4 animated shared-title px-4\"\n [ngClass]=\"title?.animation\"\n [style.fontSize.px]=\"title?.size\"\n [style.textAlign]=\"title?.align\"\n [style.color]=\"title.color\" *ngIf=\"title?.text !== ''\">\n {{ title?.text || '' }}\n </h2>\n "
|
|
4399
|
-
}] }
|
|
4400
|
-
];
|
|
4401
|
-
SharedTitleComponent.propDecorators = {
|
|
4402
|
-
title: [{ type: Input }]
|
|
4403
|
-
};
|
|
4404
|
-
return SharedTitleComponent;
|
|
4405
|
-
}());
|
|
4406
|
-
if (false) {
|
|
4407
|
-
/** @type {?} */
|
|
4408
|
-
SharedTitleComponent.prototype.title;
|
|
4409
|
-
/** @type {?} */
|
|
4410
|
-
SharedTitleComponent.prototype.item;
|
|
4411
|
-
}
|
|
4412
|
-
|
|
4413
|
-
/**
|
|
4414
|
-
* @fileoverview added by tsickle
|
|
4415
|
-
* Generated from: lib/editor/components/shared/subtitle.component.ts
|
|
4416
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4417
|
-
*/
|
|
4418
|
-
var SharedSubTitleComponent = /** @class */ (function () {
|
|
4419
|
-
function SharedSubTitleComponent() {
|
|
4420
|
-
}
|
|
4421
|
-
SharedSubTitleComponent.decorators = [
|
|
4422
|
-
{ type: Component, args: [{
|
|
4423
|
-
selector: 'app-editor-component-shared-subtitle',
|
|
4424
|
-
template: "\n <p\n *ngIf=\"subtitle?.enable\"\n class=\"mb-4 animated shared-subtitle\"\n [ngClass]=\"subtitle?.animation\"\n [style.fontSize.px]=\"subtitle?.size\"\n [style.textAlign]=\"subtitle?.align\"\n [style.color]=\"subtitle?.color\">\n {{ subtitle.text || '' }}\n </p>\n "
|
|
4425
|
-
}] }
|
|
4426
|
-
];
|
|
4427
|
-
SharedSubTitleComponent.propDecorators = {
|
|
4428
|
-
subtitle: [{ type: Input }]
|
|
4142
|
+
function (lessonId) {
|
|
4143
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4144
|
+
var db;
|
|
4145
|
+
var _this = this;
|
|
4146
|
+
return __generator(this, function (_a) {
|
|
4147
|
+
switch (_a.label) {
|
|
4148
|
+
case 0: return [4 /*yield*/, this.initDatabase()];
|
|
4149
|
+
case 1:
|
|
4150
|
+
db = _a.sent();
|
|
4151
|
+
return [2 /*return*/, new Promise((/**
|
|
4152
|
+
* @param {?} resolve
|
|
4153
|
+
* @param {?} reject
|
|
4154
|
+
* @return {?}
|
|
4155
|
+
*/
|
|
4156
|
+
function (resolve, reject) {
|
|
4157
|
+
/** @type {?} */
|
|
4158
|
+
var transaction = db.transaction([_this.STORE_LESSONS], 'readonly');
|
|
4159
|
+
/** @type {?} */
|
|
4160
|
+
var store = transaction.objectStore(_this.STORE_LESSONS);
|
|
4161
|
+
/** @type {?} */
|
|
4162
|
+
var req1 = store.get(lessonId);
|
|
4163
|
+
req1.onsuccess = (/**
|
|
4164
|
+
* @return {?}
|
|
4165
|
+
*/
|
|
4166
|
+
function () {
|
|
4167
|
+
if (req1.result) {
|
|
4168
|
+
return resolve(req1.result);
|
|
4169
|
+
}
|
|
4170
|
+
// Tenta a variação string/número
|
|
4171
|
+
/** @type {?} */
|
|
4172
|
+
var altKey = typeof lessonId === 'number' ? String(lessonId) : Number(lessonId);
|
|
4173
|
+
if (!isNaN((/** @type {?} */ (altKey)))) {
|
|
4174
|
+
/** @type {?} */
|
|
4175
|
+
var req2_1 = store.get(altKey);
|
|
4176
|
+
req2_1.onsuccess = (/**
|
|
4177
|
+
* @return {?}
|
|
4178
|
+
*/
|
|
4179
|
+
function () {
|
|
4180
|
+
if (req2_1.result) {
|
|
4181
|
+
return resolve(req2_1.result);
|
|
4182
|
+
}
|
|
4183
|
+
// Fallback: busca por comparação em getAll
|
|
4184
|
+
/** @type {?} */
|
|
4185
|
+
var reqAll = store.getAll();
|
|
4186
|
+
reqAll.onsuccess = (/**
|
|
4187
|
+
* @return {?}
|
|
4188
|
+
*/
|
|
4189
|
+
function () {
|
|
4190
|
+
/** @type {?} */
|
|
4191
|
+
var all = reqAll.result || [];
|
|
4192
|
+
/** @type {?} */
|
|
4193
|
+
var found = all.find((/**
|
|
4194
|
+
* @param {?} item
|
|
4195
|
+
* @return {?}
|
|
4196
|
+
*/
|
|
4197
|
+
function (item) { return String(item.id) === String(lessonId); }));
|
|
4198
|
+
resolve(found || null);
|
|
4199
|
+
});
|
|
4200
|
+
reqAll.onerror = (/**
|
|
4201
|
+
* @return {?}
|
|
4202
|
+
*/
|
|
4203
|
+
function () { return resolve(null); });
|
|
4204
|
+
});
|
|
4205
|
+
req2_1.onerror = (/**
|
|
4206
|
+
* @return {?}
|
|
4207
|
+
*/
|
|
4208
|
+
function () { return resolve(null); });
|
|
4209
|
+
}
|
|
4210
|
+
else {
|
|
4211
|
+
resolve(null);
|
|
4212
|
+
}
|
|
4213
|
+
});
|
|
4214
|
+
req1.onerror = (/**
|
|
4215
|
+
* @return {?}
|
|
4216
|
+
*/
|
|
4217
|
+
function () {
|
|
4218
|
+
resolve(null);
|
|
4219
|
+
});
|
|
4220
|
+
}))];
|
|
4221
|
+
}
|
|
4222
|
+
});
|
|
4223
|
+
});
|
|
4429
4224
|
};
|
|
4430
|
-
return SharedSubTitleComponent;
|
|
4431
|
-
}());
|
|
4432
|
-
if (false) {
|
|
4433
|
-
/** @type {?} */
|
|
4434
|
-
SharedSubTitleComponent.prototype.subtitle;
|
|
4435
|
-
}
|
|
4436
|
-
|
|
4437
|
-
/**
|
|
4438
|
-
* @fileoverview added by tsickle
|
|
4439
|
-
* Generated from: lib/editor/components/shared/button.component.ts
|
|
4440
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4441
|
-
*/
|
|
4442
|
-
/**
|
|
4443
|
-
* @record
|
|
4444
|
-
*/
|
|
4445
|
-
function Button() { }
|
|
4446
|
-
if (false) {
|
|
4447
|
-
/** @type {?} */
|
|
4448
|
-
Button.prototype.background;
|
|
4449
|
-
/** @type {?} */
|
|
4450
|
-
Button.prototype.color;
|
|
4451
|
-
/** @type {?} */
|
|
4452
|
-
Button.prototype.text;
|
|
4453
|
-
/** @type {?|undefined} */
|
|
4454
|
-
Button.prototype.hide;
|
|
4455
|
-
}
|
|
4456
|
-
var SharedButtonComponent = /** @class */ (function () {
|
|
4457
|
-
function SharedButtonComponent(translate) {
|
|
4458
|
-
this.translate = translate;
|
|
4459
|
-
this.button = {
|
|
4460
|
-
background: '#3C4858',
|
|
4461
|
-
color: '#FFFFF',
|
|
4462
|
-
text: this.translate.instant('Next'),
|
|
4463
|
-
};
|
|
4464
|
-
this.disabled = false;
|
|
4465
|
-
this.event = new EventEmitter();
|
|
4466
|
-
}
|
|
4467
4225
|
/**
|
|
4226
|
+
* @param {?} lessonId
|
|
4468
4227
|
* @return {?}
|
|
4469
4228
|
*/
|
|
4470
|
-
|
|
4229
|
+
OfflineStorageService.prototype.getOfflineVideoUrl = /**
|
|
4230
|
+
* @param {?} lessonId
|
|
4471
4231
|
* @return {?}
|
|
4472
4232
|
*/
|
|
4473
|
-
function () {
|
|
4474
|
-
this
|
|
4233
|
+
function (lessonId) {
|
|
4234
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4235
|
+
var lesson, blobUrl;
|
|
4236
|
+
return __generator(this, function (_a) {
|
|
4237
|
+
switch (_a.label) {
|
|
4238
|
+
case 0: return [4 /*yield*/, this.getDownloadedLesson(lessonId)];
|
|
4239
|
+
case 1:
|
|
4240
|
+
lesson = _a.sent();
|
|
4241
|
+
if (lesson && lesson.videoBlob) {
|
|
4242
|
+
blobUrl = URL.createObjectURL(lesson.videoBlob);
|
|
4243
|
+
console.log("[OfflineStorageService] Blob de v\u00EDdeo gerado para aula " + lessonId + ":", blobUrl);
|
|
4244
|
+
return [2 /*return*/, blobUrl];
|
|
4245
|
+
}
|
|
4246
|
+
return [2 /*return*/, null];
|
|
4247
|
+
}
|
|
4248
|
+
});
|
|
4249
|
+
});
|
|
4475
4250
|
};
|
|
4476
4251
|
/**
|
|
4477
4252
|
* @return {?}
|
|
4478
4253
|
*/
|
|
4479
|
-
|
|
4254
|
+
OfflineStorageService.prototype.getAllDownloadedLessons = /**
|
|
4480
4255
|
* @return {?}
|
|
4481
4256
|
*/
|
|
4482
4257
|
function () {
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
var SharedMediaComponent = /** @class */ (function () {
|
|
4521
|
-
function SharedMediaComponent() {
|
|
4522
|
-
}
|
|
4523
|
-
SharedMediaComponent.decorators = [
|
|
4524
|
-
{ type: Component, args: [{
|
|
4525
|
-
selector: 'app-editor-component-shared-media',
|
|
4526
|
-
template: "\n <div class=\"row\" *ngIf=\"media.type == 'image' || media.type == 'IMAGE'\">\n <div class=\"col-sm-11 mx-auto mb-4\">\n <img height=\"320\" style=\"width: 100%; object-fit: scale-down; max-height: 320px;\" *ngIf=\"media.url != ''\"\n [src]=\"media.url\" />\n </div>\n </div>\n <div class=\"row\" *ngIf=\"media.type == 'youtube' || media.type == 'YOUTUBE'\">\n <div class=\"col-sm-11 mx-auto mb-4\" *ngIf=\"media.url !== ''\">\n <iframe [src]=\"media.url | youtubeEmbed | safeUrl:'resourceUrl'\" width=\"100%\" height=\"500px\" frameborder=\"0\"\n allowfullscreen></iframe>\n </div>\n </div>\n <div class=\"row\" *ngIf=\"media.type == 'vimeo' || media.type == 'VIMEO'\">\n <div class=\"col-sm-11 mx-auto mb-4\" *ngIf=\"media.url !== ''\">\n <iframe [src]=\"media.url | vimeoEmbed | safeUrl:'resourceUrl'\" width=\"100%\" height=\"500px\" frameborder=\"0\"\n allowfullscreen></iframe>\n </div>\n </div>\n "
|
|
4527
|
-
}] }
|
|
4528
|
-
];
|
|
4529
|
-
SharedMediaComponent.propDecorators = {
|
|
4530
|
-
media: [{ type: Input }]
|
|
4531
|
-
};
|
|
4532
|
-
return SharedMediaComponent;
|
|
4533
|
-
}());
|
|
4534
|
-
if (false) {
|
|
4535
|
-
/** @type {?} */
|
|
4536
|
-
SharedMediaComponent.prototype.media;
|
|
4537
|
-
}
|
|
4538
|
-
|
|
4539
|
-
/**
|
|
4540
|
-
* @fileoverview added by tsickle
|
|
4541
|
-
* Generated from: lib/editor/components/shared/text.component.ts
|
|
4542
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4543
|
-
*/
|
|
4544
|
-
var SharedTextComponent = /** @class */ (function () {
|
|
4545
|
-
function SharedTextComponent() {
|
|
4546
|
-
}
|
|
4547
|
-
SharedTextComponent.decorators = [
|
|
4548
|
-
{ type: Component, args: [{
|
|
4549
|
-
selector: 'app-editor-component-shared-text',
|
|
4550
|
-
template: "\n <p\n class=\"mb-4 animated\"\n [ngClass]=\"text?.animation\"\n [style.fontSize.px]=\"text?.size\"\n [style.textAlign]=\"text?.align\"\n [style.color]=\"text.color\" *ngIf=\"text?.text !== ''\">\n {{ text.text || '' }}\n </p>\n "
|
|
4551
|
-
}] }
|
|
4552
|
-
];
|
|
4553
|
-
SharedTextComponent.propDecorators = {
|
|
4554
|
-
text: [{ type: Input }]
|
|
4555
|
-
};
|
|
4556
|
-
return SharedTextComponent;
|
|
4557
|
-
}());
|
|
4558
|
-
if (false) {
|
|
4559
|
-
/** @type {?} */
|
|
4560
|
-
SharedTextComponent.prototype.text;
|
|
4561
|
-
}
|
|
4562
|
-
|
|
4563
|
-
/**
|
|
4564
|
-
* @fileoverview added by tsickle
|
|
4565
|
-
* Generated from: lib/editor/components/shared/shared.module.ts
|
|
4566
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4567
|
-
*/
|
|
4568
|
-
/** @type {?} */
|
|
4569
|
-
var components = [
|
|
4570
|
-
SharedTitleComponent,
|
|
4571
|
-
SharedSubTitleComponent,
|
|
4572
|
-
SharedButtonComponent,
|
|
4573
|
-
SharedMediaComponent,
|
|
4574
|
-
SharedTextComponent
|
|
4575
|
-
];
|
|
4576
|
-
var ComponentSharedModule = /** @class */ (function () {
|
|
4577
|
-
function ComponentSharedModule() {
|
|
4578
|
-
}
|
|
4579
|
-
ComponentSharedModule.decorators = [
|
|
4580
|
-
{ type: NgModule, args: [{
|
|
4581
|
-
imports: [
|
|
4582
|
-
CommonModule,
|
|
4583
|
-
FormsModule,
|
|
4584
|
-
ReactiveFormsModule,
|
|
4585
|
-
ColorPickerModule,
|
|
4586
|
-
MomentModule,
|
|
4587
|
-
MatSelectModule,
|
|
4588
|
-
TranslateModule,
|
|
4589
|
-
MatInputModule,
|
|
4590
|
-
MatStepperModule,
|
|
4591
|
-
MatRadioModule,
|
|
4592
|
-
MatTooltipModule,
|
|
4593
|
-
MatSliderModule,
|
|
4594
|
-
PipesModule
|
|
4595
|
-
],
|
|
4596
|
-
declarations: __spread(components),
|
|
4597
|
-
exports: __spread(components)
|
|
4598
|
-
},] }
|
|
4599
|
-
];
|
|
4600
|
-
return ComponentSharedModule;
|
|
4601
|
-
}());
|
|
4602
|
-
|
|
4603
|
-
/**
|
|
4604
|
-
* @fileoverview added by tsickle
|
|
4605
|
-
* Generated from: lib/editor/components/dynamic-input/dynamic-input.component.ts
|
|
4606
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4607
|
-
*/
|
|
4608
|
-
var DynamicInputComponent = /** @class */ (function () {
|
|
4609
|
-
function DynamicInputComponent() {
|
|
4610
|
-
}
|
|
4611
|
-
DynamicInputComponent.decorators = [
|
|
4612
|
-
{ type: Component, args: [{
|
|
4613
|
-
selector: 'app-editor-component-dynamic-input',
|
|
4614
|
-
template: "<textarea \r\n ngControlName\r\n *ngIf=\"input.type == 'text-long'\"\r\n name=\"input\"\r\n matInput \r\n matTextareaAutosize\r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\"></textarea>\r\n\r\n<input \r\n *ngIf=\"input.type == 'text-short'\"\r\n type=\"text\"\r\n name=\"input\"\r\n matInput \r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\" />\r\n\r\n<input \r\n *ngIf=\"input.type == 'number'\"\r\n type=\"number\"\r\n name=\"input\"\r\n matInput \r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\" />\r\n\r\n<input \r\n *ngIf=\"input.type == 'currency'\"\r\n type=\"text\"\r\n name=\"input\"\r\n currencyMask\r\n matInput \r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\" />\r\n\r\n<input \r\n *ngIf=\"input.type == 'date'\"\r\n type=\"date\"\r\n name=\"input\"\r\n matInput \r\n class=\"no-border w-100 cell-text\" \r\n [placeholder]=\"input.placeholder\" />\r\n\r\n<div class=\"form-group form-focus label-floating\" *ngIf=\"input.type === 'select-single'\">\r\n <mat-form-field class=\"w-100 m-b-3\">\r\n <mat-select name=\"input\" [placeholder]=\"input.placeholder\">\r\n <mat-option *ngFor=\"let opt of input.selectOptions\" [value]=\"opt.value\"> {{ opt.value }}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n</div>\r\n\r\n<div class=\"form-group form-focus label-floating\" *ngIf=\"input.type === 'select-multi'\">\r\n <mat-form-field class=\"w-100 m-b-3\">\r\n <mat-select multiple name=\"input\" [placeholder]=\"input.placeholder\">\r\n <mat-option *ngFor=\"let opt of input.selectOptions\" [value]=\"opt.value\"> {{ opt.value }}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n</div>",
|
|
4615
|
-
styles: [".flex-container{padding:0;margin:0;list-style:none;-ms-box-orient:horizontal;display:-moz-flex;display:flex}.nowrap{flex-wrap:nowrap}.wrap{flex-wrap:wrap}::ng-deep .mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle{border-color:#e91e63}::ng-deep .mat-radio-button.mat-accent .mat-radio-inner-circle{background-color:#e91e63}::ng-deep .mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element{background-color:rgba(233,30,99,.26)}.mat-checkbox-label,::ng-deep .mat-radio-label{cursor:pointer;white-space:nowrap;padding:10px}::ng-deep .mat-horizontal-stepper-header{height:40px!important;padding:0 15px!important}::ng-deep .mat-step-header .mat-step-icon{background-color:#e91e63;color:#fff}::ng-deep .mat-stepper-horizontal-line{margin:0!important}::ng-deep .checkbox .checkbox-material .check{width:15px;height:15px;border:1px solid #ddd;border-radius:3px}::ng-deep .checkbox .checkbox-material .check:before{position:absolute;content:\"\";transform:rotate(45deg);display:block;margin-top:-5px;margin-left:5px;font-size:.5em;width:1;height:0;-webkit-animation:.3s forwards checkbox-off;animation:.3s forwards checkbox-off}::ng-deep .checkbox label{cursor:pointer;padding-left:0;font-size:.8em;font-weight:500;color:#525859}.mt--5{margin-top:-7px}.mt-20{margin-top:20px}.ml-3{margin-left:3px}.no-margin{margin:0!important}.bg-purple{background:#9c27b0}.fc-gray{color:#525859!important}.fc-purple{color:#9c27b0!important}.fc-red{color:#e50606!important}.fc-green{color:#2ac994!important}.bold{font-weight:700}.bolder{font-weight:bolder}.placeholder{color:#d5d5d5}.border{border:1px solid #d2d2d2}.no-border{border:none}.bl-0{border-left:none}.border-label{padding:0;border-radius:3px;border:1px solid #ccc;background:rgba(255,255,255,.5)}.border-top{border-top:1px solid #eee}.border-bottom{border-bottom:1px solid #eee}.col-center-block{float:none;display:block;margin:0 auto}.btn.focus,.btn:focus{color:#fff;background-color:#595959;border-color:#595959;outline:0;box-shadow:0 0 0 .2rem rgba(89,89,89,.25)}.btn-primary{color:#fff;background-color:#6c757d!important;border-color:#6c757d!important;box-shadow:none;font-size:1em}.btn-primary:hover{color:#fff;background-color:#595959;border-color:#595959;box-shadow:0 14px 26px -12px rgba(89,89,89,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(89,89,89,.2)}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 .2rem rgba(89,89,89,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-primary.disabled,.btn-primary:disabled:hover,.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#595959;border-color:#595959}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(89,89,89,.5)}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-muted{background:#ccc}.btn-muted:hover{background:#bbb}.box-group{padding:10px;background:#f5f5f5;border:1px solid #eee;border-radius:3px}.box{display:flex;display:-ms-flexbox;align-items:center;-webkit-box-align:center;-ms-flex-align:center;flex-direction:column;justify-content:center;-webkit-justify-content:center;-webkit-box-pack:center;margin-left:auto}.box-list{display:flex;align-items:center;justify-content:center;height:100%;padding-bottom:30px;width:100%}.box-ask-border{display:inline-block;margin:2%;max-width:190px;min-height:190px;text-align:left;width:46%}.box-ask-border:hover{border-color:#dedede;color:#dedede;background:#fff7fa;border-radius:7px}.box-label{cursor:pointer;display:block;height:100%;padding:12px}.box-img{background-position:50%;background-size:cover;border-radius:7px;height:160px;margin:0;width:100%;-o-object-fit:cover;object-fit:cover}.box-input{display:block;position:relative;cursor:pointer;font-size:15px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.box-input input{position:absolute;opacity:0;cursor:pointer}.checkmark{position:absolute;top:-17px;left:-17px;background:0 0;border:2px solid #dadada;color:#3c3c3c;border-radius:10px;display:inline-block;margin:2%;width:116%;height:120%;min-height:190px}.box-input input:checked~.checkmark{border:2px solid #dedede}.checkmark:after{content:\"\";position:absolute;display:none}.box-input input:checked~.box-ask-border:after{border:2px solid #dadada;color:#3c3c3c;border-radius:10px;display:inline-block;font-size:15px;margin:2%;max-width:190px;text-align:left;width:46%}.box-ask-border:after{border-color:#dedede;color:rgba (233,30,99,.3);background:#fff7fa}.title{font-size:13px;float:left;padding:2px 10px;position:fixed}.title-question{font-size:1.12em;font-weight:900;color:#525859;margin-bottom:20px}.title-config{font-size:.8em;font-weight:500;color:#525859;margin-bottom:0;width:100%}.tool-name{font-weight:600;color:#9c27b0}.tool-name-subtitle{font-weight:600;color:#525859}.img-responsive,.vid-responsive{display:block;max-width:100%;height:auto}.img-thumbnail,.vid-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;margin-bottom:30px;transition:.2s ease-in-out}.col-left{border-right:1px solid #eee}.col-center{float:left;width:60%}.col-right{border-left:1px solid #eee}.col-left,.col-right{float:left;width:20%;overflow-x:hidden!important}.col-sup{height:28vh;overflow-y:auto;padding:10px;border-top:1px solid #eee;border-bottom:1px solid #eee;margin-top:25px}.col-sub{height:51.5vh;overflow-y:auto;padding:10px;border-top:1px solid #eee;margin-top:25px}.col-int{height:83.5vh;overflow-y:auto;padding:10px;margin-top:25px;border-top:1px solid #eee}.icon{float:left;width:50%;height:70px;text-align:center;margin:20px 0}.icon i{font-size:40px}.icon a{display:block;color:#999}.icon a:hover{color:#777}.icon p{font-size:14px;margin:5px}table thead th{font-size:1em;font-weight:900;color:#383838}table tfoot .amount{font-size:1em;font-weight:900;color:#383838;text-align:right}.nav-tabs{border-bottom:1px solid #ddd;margin-bottom:20px;background:0 0}.nav-tabs>li>a{margin-right:0!important;padding:4px 8px;color:#9c27b0!important}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd!important;border-bottom-color:transparent!important}.divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}input.cell-text::-webkit-input-placeholder{color:#d5d5d5}input.cell-text::-moz-placeholder{color:#d5d5d5}input.cell-text:-ms-input-placeholder{color:#d5d5d5}input.cell-text::-ms-input-placeholder{color:#d5d5d5}input.cell-text::placeholder{color:#d5d5d5}input.text{border:1px solid #ddd;padding:5px 10px;border-radius:3px;color:#333}input.text::-webkit-input-placeholder{color:#d5d5d5}input.text::-moz-placeholder{color:#d5d5d5}input.text:-ms-input-placeholder{color:#d5d5d5}input.text::-ms-input-placeholder{color:#d5d5d5}input.text::placeholder{color:#d5d5d5}select.text{border:1px solid #ddd;padding:5px 2px;border-radius:3px;color:#333}select.text::-webkit-input-placeholder{color:#d5d5d5}select.text::-moz-placeholder{color:#d5d5d5}select.text:-ms-input-placeholder{color:#d5d5d5}select.text::-ms-input-placeholder{color:#d5d5d5}select.text::placeholder{color:#d5d5d5}textarea.text{border:1px solid #ddd;padding:5px 10px;border-radius:3px;color:#333;resize:none}textarea.text::-webkit-input-placeholder{color:#d5d5d5}textarea.text::-moz-placeholder{color:#d5d5d5}textarea.text:-ms-input-placeholder{color:#d5d5d5}textarea.text::-ms-input-placeholder{color:#d5d5d5}textarea.text::placeholder{color:#d5d5d5}.text-input{color:#b5b4b4;font-size:1.12em;position:relative;vertical-align:middle;display:inline-block;transition:.5s;padding:0;cursor:pointer;border-bottom:2px solid #fff;-webkit-transition:.5s}.text-input::after,.text-input::before{width:100%;height:100%;z-index:3;content:\"\";position:absolute;top:0;left:0;box-sizing:border-box;-webkit-transform:scale(0);transition:.5s}.text-input::-webkit-input-placeholder{color:#dcb8e3;font-size:1.09em}.text-input::-moz-placeholder{color:#dcb8e3;font-size:1.09em}.text-input:-ms-input-placeholder{color:#dcb8e3;font-size:1.09em}.text-input::-ms-input-placeholder{color:#dcb8e3;font-size:1.09em}.text-input::placeholder{color:#dcb8e3;font-size:1.09em}.text-input:focus,.text-input:hover{color:#dcb8e3;font-size:1.09em;border-bottom:2px solid #dedede}input[type=checkbox],input[type=radio]{display:none}input[type=checkbox]+label,input[type=radio]+label{color:#b5b4b4;font-size:1.09em}input[type=radio]+label span{display:inline-block;width:19px;height:19px;margin:-2px 10px 0 0;vertical-align:middle;cursor:pointer}input[type=checkbox]+label span{display:inline-block;width:19px;height:19px;margin:-2px 10px 0 0;vertical-align:middle;cursor:pointer;transition:.1s}input[type=checkbox]:checked+label span{transition:.1s}.multiple-questions label span{display:block;cursor:pointer;max-height:242px;border:1px solid #ddd;border-radius:7px;padding:10px 10px 0;margin:5px;max-width:180px;min-height:180px}.multiple-questions label span.no-image{min-height:0}.multiple-questions label span.no-image img{display:none!important}.multiple-questions input[type=radio]:checked+span{border:1px solid #595959!important;background:#fcfcfc}.multiple-questions label span img{border-radius:7px;width:180px;height:180px}.multiple-questions .text{text-align:center;padding:15px 0;min-height:30px}input.multichoice:empty{margin-left:-999px}input.multichoice:empty~label{position:relative;margin-right:20px;margin-bottom:20px;padding-right:20px;float:left;line-height:2.5em;text-indent:3.5em;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:.1s}input.multichoice:empty~label:before{position:relative;left:0;float:left;content:'';width:40px;background:#d1d3d4;border-radius:3px 0 0 3px;margin-left:0;margin-right:-40px}input.multichoice:checked~label:before{content:'\\2714';text-indent:.9em;color:#fff;background-color:#6c63fe;transition:.1s}.d-flex{display:flex!important}.flex-wrap{flex-wrap:wrap!important}.justify-content-center{justify-content:center!important}.flex-column{flex-direction:column!important}.align-content-center{align-content:center!important}.align-vertical-center{-ms-align-items:center!important;align-items:center!important}.wrapper{min-height:100%;position:relative;overflow:hidden}.wrapper:after,.wrapper:before{content:\" \";display:table}.wrapper:after{clear:both}.content-wrapper{min-height:100%;background-color:#fff;z-index:800;padding-top:40px}.top-menu{position:absolute;border-bottom:1px solid #eee;top:0;width:100%;height:40px;padding:0 10px;line-height:40px}.tool{float:right;padding:2px 5px}.footer{position:absolute;border-top:1px solid #eee;bottom:0;padding:0 10px;width:100%;height:40px;line-height:40px;background:#fff}.cliente{font-size:16px}.modulo a{padding:2px 5px;border-radius:4px;display:block;background:#9c27b0;color:#fff;margin-bottom:5px}.modulo a:hover{background:#831596}.modulo span a{float:right;font-size:12px;padding:0;background:0 0;margin-left:5px;margin-top:1px}.modulo span a:hover{color:#e9e9e9}.etapa a{padding:2px 5px 2px 20px;border-radius:4px;display:block;background:0 0;color:#777;margin-bottom:5px}.etapa span a{float:right;font-size:12px;padding:0;background:0 0;color:#ddd;margin-left:5px;margin-top:1px}.etapa span a:hover{color:#999}.form-custom input[type=number],.form-custom input[type=text],.form-custom select,.form-custom textarea{border:1px solid #dadde2;padding:3px 5px;border-radius:2px;font-size:13px;overflow-x:hidden}.form-custom .txt{border:1px solid #dadde2;padding:3px 5px;border-radius:2px;font-size:13px}.form-custom ::-webkit-input-placeholder{font-size:13px;color:#999}.form-custom ::-moz-placeholder{font-size:13px;color:#999}.form-custom ::-ms-input-placeholder{font-size:13px;color:#999}.wrapper-input{height:45px}.btn-rose{background:#e91e63}.cursor{cursor:pointer}.midia-w iframe{width:100%}.midia-h iframe{height:400px}.breadcrumb{padding:0 15px;margin-bottom:20px;list-style:none;background-color:transparent;font-size:12px}.config-label{width:100%;margin:5px 0;float:left;font-size:.8em;display:block;line-height:1.5em}.config-textarea{width:100%;margin:5px 0;float:left;resize:initial;overflow-y:auto;display:block;font-size:.9em!important;color:#999}.config-input,.config-select{width:100%;margin:5px 0;float:left;display:block;font-size:.9em!important;color:#999}.config-box{width:100%;margin:5px;float:left}.config-box-50{width:45%;min-height:110px;margin:5px;float:left;background:#f9f9f9;border:1px solid #eee;border-radius:5px;padding:10px}.config-box-title{width:100%;padding:10px;font-size:.85em}.no-bg-image{background-image:none}.space-inside{padding:10px}.block{display:block}.fake-link{cursor:pointer}.item-component{margin:0;border-radius:2px;border:1px solid #fff}.item-component:hover{border-color:#9c27b0}.item-component.active{border-color:#9c27b0;background-color:#f9f9f9}.item-box-model{border:3px dashed #ddd;padding:20px;color:#ccc;min-height:50px}.item-component-challenge,.item-component-conclusion,.item-component-download,.item-component-dynamic-input,.item-component-dynamic-table,.item-component-image,.item-component-intro,.item-component-long-text,.item-component-multichoise,.item-component-multiple-questions,.item-component-pdf,.item-component-rating,.item-component-sales-channel,.item-component-sheet-correct-incorrect,.item-component-star-point,.item-component-text,.item-component-upload,.item-component-video,.item-component-yes-no{padding:0}.item-component-image .material-icons,.item-component-pdf .material-icons,.item-component-video .material-icons{font-size:80px}.item-component-title .title-bold{font-weight:700}.item-component-title .title-italic{font-style:italic}.item-component-title .title-underline{text-decoration:underline}.icon.disabled{opacity:.3}.item-component-image-icon-container,.item-component-pdf-icon-container,.item-component-video-icon-container{background:#eee;border:1px solid #ccc;text-align:center;color:#444;font-size:50px;padding:160px}.btn-container{text-align:center}.etapa a:hover,.etapa.active a{background:#f4f4f4}.etapa.active:before{font:700 14px/1 FontAwesome;content:\"\\f0da\";float:left;color:#9c27b0;position:relative;top:5px;left:5px}.scroll{overflow-y:auto}#trail-status{color:#ddd;margin-right:10px;background:0 0;border:none}#trail-status.active{color:#6c9}.item-btn-delete{position:relative}.item-btn-delete button{position:absolute;top:-10px;right:-10px;border:1px solid #9c27b0;background-color:#fff;color:#9c27b0;border-radius:50%;width:20px;height:20px;padding:0;font-size:12px;line-height:12px;z-index:1}.item-btn-delete button:hover{background-color:#9c27b0;color:#fff}.custom-divisor{margin:10px 0}#tbl-objetivo td{padding:0 8px;height:0}#accordion .tool-name:after{font-family:\"Glyphicons Halflings\";content:\"\\e114\";float:right}#accordion .tool-name.collapsed:after{content:\"\\e080\"}#editor-components-wrapper img{max-height:500px;-o-object-fit:contain;object-fit:contain;background:#eee;width:auto}.input-styled{border:1px solid #ccc;padding:4px 6px;border-radius:2px}.pulse:hover{-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-name:pulse;animation-name:pulse}@-webkit-keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(.9);opacity:.7}}@keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(.9);opacity:.7}}.cover{position:relative}.cover img{width:100%;min-height:480px;-o-object-fit:cover;object-fit:cover;opacity:1;transition:.5s;-webkit-backface-visibility:hidden;backface-visibility:hidden}.mx-auto{float:none;margin:0 auto}@media (min-width:576px) and (max-width:767px){::ng-deep .sheet-correct .radio{width:90%!important}}@media (min-width:768px) and (max-width:991px){::ng-deep .sheet-correct .radio{width:45%!important}}@media (min-width:992px) and (max-width:1199px){::ng-deep .sheet-correct .radio{width:65%!important}}@media (min-width:1200px){::ng-deep .sheet-correct .radio{width:45%!important}}@media (min-width:1600px){.col-sup{height:45vh}.col-sub{height:55.5vh}.col-int{height:88.5vh}}.image-modal{transition:.5s}.image-modal-item{width:100%;-o-object-fit:scale-down;object-fit:scale-down;max-height:320px;cursor:zoom-in}.image-modal-full{position:fixed;top:0;left:0;z-index:99999;width:100%;height:100%;padding:10%;background:rgba(0,0,0,.3);-o-object-fit:contain;object-fit:contain;cursor:zoom-out}", "input,textarea{padding:10px}"]
|
|
4616
|
-
}] }
|
|
4617
|
-
];
|
|
4618
|
-
/** @nocollapse */
|
|
4619
|
-
DynamicInputComponent.ctorParameters = function () { return []; };
|
|
4620
|
-
DynamicInputComponent.propDecorators = {
|
|
4621
|
-
input: [{ type: Input }]
|
|
4622
|
-
};
|
|
4623
|
-
return DynamicInputComponent;
|
|
4624
|
-
}());
|
|
4625
|
-
if (false) {
|
|
4626
|
-
/** @type {?} */
|
|
4627
|
-
DynamicInputComponent.prototype.input;
|
|
4628
|
-
}
|
|
4629
|
-
|
|
4630
|
-
/**
|
|
4631
|
-
* @fileoverview added by tsickle
|
|
4632
|
-
* Generated from: lib/\@core/services/trail-content.service.ts
|
|
4633
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4634
|
-
*/
|
|
4635
|
-
var TrailContentService = /** @class */ (function () {
|
|
4636
|
-
function TrailContentService(http, global) {
|
|
4637
|
-
this.http = http;
|
|
4638
|
-
this.global = global;
|
|
4639
|
-
}
|
|
4640
|
-
/**
|
|
4641
|
-
* @param {?} id
|
|
4642
|
-
* @return {?}
|
|
4643
|
-
*/
|
|
4644
|
-
TrailContentService.prototype.all = /**
|
|
4645
|
-
* @param {?} id
|
|
4646
|
-
* @return {?}
|
|
4647
|
-
*/
|
|
4648
|
-
function (id) {
|
|
4649
|
-
return this.http.get(this.global.apiURL() + '/api/v2/client/trilha/conteudo/multiple/' + id, this.getHeaders()).pipe(catchError((/**
|
|
4650
|
-
* @param {?} err
|
|
4651
|
-
* @return {?}
|
|
4652
|
-
*/
|
|
4653
|
-
function (err) { return of({ data: [] }); })));
|
|
4258
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4259
|
+
var db;
|
|
4260
|
+
var _this = this;
|
|
4261
|
+
return __generator(this, function (_a) {
|
|
4262
|
+
switch (_a.label) {
|
|
4263
|
+
case 0: return [4 /*yield*/, this.initDatabase()];
|
|
4264
|
+
case 1:
|
|
4265
|
+
db = _a.sent();
|
|
4266
|
+
return [2 /*return*/, new Promise((/**
|
|
4267
|
+
* @param {?} resolve
|
|
4268
|
+
* @param {?} reject
|
|
4269
|
+
* @return {?}
|
|
4270
|
+
*/
|
|
4271
|
+
function (resolve, reject) {
|
|
4272
|
+
/** @type {?} */
|
|
4273
|
+
var transaction = db.transaction([_this.STORE_LESSONS], 'readonly');
|
|
4274
|
+
/** @type {?} */
|
|
4275
|
+
var store = transaction.objectStore(_this.STORE_LESSONS);
|
|
4276
|
+
/** @type {?} */
|
|
4277
|
+
var request = store.getAll();
|
|
4278
|
+
request.onsuccess = (/**
|
|
4279
|
+
* @return {?}
|
|
4280
|
+
*/
|
|
4281
|
+
function () {
|
|
4282
|
+
resolve(request.result || []);
|
|
4283
|
+
});
|
|
4284
|
+
request.onerror = (/**
|
|
4285
|
+
* @param {?} event
|
|
4286
|
+
* @return {?}
|
|
4287
|
+
*/
|
|
4288
|
+
function (event) {
|
|
4289
|
+
reject(event.target.error);
|
|
4290
|
+
});
|
|
4291
|
+
}))];
|
|
4292
|
+
}
|
|
4293
|
+
});
|
|
4294
|
+
});
|
|
4654
4295
|
};
|
|
4655
4296
|
/**
|
|
4656
|
-
* @param {?} id
|
|
4657
4297
|
* @return {?}
|
|
4658
4298
|
*/
|
|
4659
|
-
|
|
4660
|
-
* @param {?} id
|
|
4299
|
+
OfflineStorageService.prototype.refreshDownloadedLessons = /**
|
|
4661
4300
|
* @return {?}
|
|
4662
4301
|
*/
|
|
4663
|
-
function (
|
|
4664
|
-
return
|
|
4302
|
+
function () {
|
|
4303
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4304
|
+
var lessons, e_1;
|
|
4305
|
+
return __generator(this, function (_a) {
|
|
4306
|
+
switch (_a.label) {
|
|
4307
|
+
case 0:
|
|
4308
|
+
_a.trys.push([0, 2, , 3]);
|
|
4309
|
+
return [4 /*yield*/, this.getAllDownloadedLessons()];
|
|
4310
|
+
case 1:
|
|
4311
|
+
lessons = _a.sent();
|
|
4312
|
+
this.downloadedLessons$.next(lessons);
|
|
4313
|
+
return [3 /*break*/, 3];
|
|
4314
|
+
case 2:
|
|
4315
|
+
e_1 = _a.sent();
|
|
4316
|
+
console.error('[OfflineStorageService] Erro ao carregar aulas baixadas:', e_1);
|
|
4317
|
+
return [3 /*break*/, 3];
|
|
4318
|
+
case 3: return [2 /*return*/];
|
|
4319
|
+
}
|
|
4320
|
+
});
|
|
4321
|
+
});
|
|
4665
4322
|
};
|
|
4666
4323
|
/**
|
|
4667
|
-
* @param {?}
|
|
4668
|
-
* @param {?} data
|
|
4324
|
+
* @param {?} lessonId
|
|
4669
4325
|
* @return {?}
|
|
4670
4326
|
*/
|
|
4671
|
-
|
|
4672
|
-
* @param {?}
|
|
4673
|
-
* @param {?} data
|
|
4327
|
+
OfflineStorageService.prototype.deleteDownloadedLesson = /**
|
|
4328
|
+
* @param {?} lessonId
|
|
4674
4329
|
* @return {?}
|
|
4675
4330
|
*/
|
|
4676
|
-
function (
|
|
4677
|
-
return
|
|
4331
|
+
function (lessonId) {
|
|
4332
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4333
|
+
var db;
|
|
4334
|
+
var _this = this;
|
|
4335
|
+
return __generator(this, function (_a) {
|
|
4336
|
+
switch (_a.label) {
|
|
4337
|
+
case 0: return [4 /*yield*/, this.initDatabase()];
|
|
4338
|
+
case 1:
|
|
4339
|
+
db = _a.sent();
|
|
4340
|
+
return [2 /*return*/, new Promise((/**
|
|
4341
|
+
* @param {?} resolve
|
|
4342
|
+
* @param {?} reject
|
|
4343
|
+
* @return {?}
|
|
4344
|
+
*/
|
|
4345
|
+
function (resolve, reject) {
|
|
4346
|
+
/** @type {?} */
|
|
4347
|
+
var transaction = db.transaction([_this.STORE_LESSONS], 'readwrite');
|
|
4348
|
+
/** @type {?} */
|
|
4349
|
+
var store = transaction.objectStore(_this.STORE_LESSONS);
|
|
4350
|
+
/** @type {?} */
|
|
4351
|
+
var request = store.delete(lessonId);
|
|
4352
|
+
request.onsuccess = (/**
|
|
4353
|
+
* @return {?}
|
|
4354
|
+
*/
|
|
4355
|
+
function () {
|
|
4356
|
+
_this.refreshDownloadedLessons();
|
|
4357
|
+
resolve(true);
|
|
4358
|
+
});
|
|
4359
|
+
request.onerror = (/**
|
|
4360
|
+
* @param {?} event
|
|
4361
|
+
* @return {?}
|
|
4362
|
+
*/
|
|
4363
|
+
function (event) {
|
|
4364
|
+
reject(event.target.error);
|
|
4365
|
+
});
|
|
4366
|
+
}))];
|
|
4367
|
+
}
|
|
4368
|
+
});
|
|
4369
|
+
});
|
|
4678
4370
|
};
|
|
4679
4371
|
/**
|
|
4680
|
-
* @param {?} id
|
|
4681
|
-
* @param {?} data
|
|
4682
4372
|
* @return {?}
|
|
4683
4373
|
*/
|
|
4684
|
-
|
|
4685
|
-
* @param {?} id
|
|
4686
|
-
* @param {?} data
|
|
4374
|
+
OfflineStorageService.prototype.clearAllDownloads = /**
|
|
4687
4375
|
* @return {?}
|
|
4688
4376
|
*/
|
|
4689
|
-
function (
|
|
4690
|
-
return
|
|
4377
|
+
function () {
|
|
4378
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4379
|
+
var db;
|
|
4380
|
+
var _this = this;
|
|
4381
|
+
return __generator(this, function (_a) {
|
|
4382
|
+
switch (_a.label) {
|
|
4383
|
+
case 0: return [4 /*yield*/, this.initDatabase()];
|
|
4384
|
+
case 1:
|
|
4385
|
+
db = _a.sent();
|
|
4386
|
+
return [2 /*return*/, new Promise((/**
|
|
4387
|
+
* @param {?} resolve
|
|
4388
|
+
* @param {?} reject
|
|
4389
|
+
* @return {?}
|
|
4390
|
+
*/
|
|
4391
|
+
function (resolve, reject) {
|
|
4392
|
+
/** @type {?} */
|
|
4393
|
+
var transaction = db.transaction([_this.STORE_LESSONS], 'readwrite');
|
|
4394
|
+
/** @type {?} */
|
|
4395
|
+
var store = transaction.objectStore(_this.STORE_LESSONS);
|
|
4396
|
+
/** @type {?} */
|
|
4397
|
+
var request = store.clear();
|
|
4398
|
+
request.onsuccess = (/**
|
|
4399
|
+
* @return {?}
|
|
4400
|
+
*/
|
|
4401
|
+
function () {
|
|
4402
|
+
_this.refreshDownloadedLessons();
|
|
4403
|
+
resolve(true);
|
|
4404
|
+
});
|
|
4405
|
+
request.onerror = (/**
|
|
4406
|
+
* @param {?} event
|
|
4407
|
+
* @return {?}
|
|
4408
|
+
*/
|
|
4409
|
+
function (event) {
|
|
4410
|
+
reject(event.target.error);
|
|
4411
|
+
});
|
|
4412
|
+
}))];
|
|
4413
|
+
}
|
|
4414
|
+
});
|
|
4415
|
+
});
|
|
4691
4416
|
};
|
|
4692
4417
|
/**
|
|
4693
|
-
* @param {?}
|
|
4418
|
+
* @param {?} action
|
|
4694
4419
|
* @return {?}
|
|
4695
4420
|
*/
|
|
4696
|
-
|
|
4697
|
-
* @param {?}
|
|
4421
|
+
OfflineStorageService.prototype.queueSyncAction = /**
|
|
4422
|
+
* @param {?} action
|
|
4698
4423
|
* @return {?}
|
|
4699
4424
|
*/
|
|
4700
|
-
function (
|
|
4701
|
-
return
|
|
4425
|
+
function (action) {
|
|
4426
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4427
|
+
var db;
|
|
4428
|
+
var _this = this;
|
|
4429
|
+
return __generator(this, function (_a) {
|
|
4430
|
+
switch (_a.label) {
|
|
4431
|
+
case 0: return [4 /*yield*/, this.initDatabase()];
|
|
4432
|
+
case 1:
|
|
4433
|
+
db = _a.sent();
|
|
4434
|
+
return [2 /*return*/, new Promise((/**
|
|
4435
|
+
* @param {?} resolve
|
|
4436
|
+
* @param {?} reject
|
|
4437
|
+
* @return {?}
|
|
4438
|
+
*/
|
|
4439
|
+
function (resolve, reject) {
|
|
4440
|
+
/** @type {?} */
|
|
4441
|
+
var transaction = db.transaction([_this.STORE_SYNC_QUEUE], 'readwrite');
|
|
4442
|
+
/** @type {?} */
|
|
4443
|
+
var store = transaction.objectStore(_this.STORE_SYNC_QUEUE);
|
|
4444
|
+
/** @type {?} */
|
|
4445
|
+
var syncItem = __assign({}, action, { createdAt: new Date() });
|
|
4446
|
+
/** @type {?} */
|
|
4447
|
+
var request = store.add(syncItem);
|
|
4448
|
+
request.onsuccess = (/**
|
|
4449
|
+
* @return {?}
|
|
4450
|
+
*/
|
|
4451
|
+
function () {
|
|
4452
|
+
console.log('[OfflineStorageService] Ação salva na fila de sincronização offline:', action);
|
|
4453
|
+
resolve();
|
|
4454
|
+
});
|
|
4455
|
+
request.onerror = (/**
|
|
4456
|
+
* @param {?} event
|
|
4457
|
+
* @return {?}
|
|
4458
|
+
*/
|
|
4459
|
+
function (event) {
|
|
4460
|
+
reject(event.target.error);
|
|
4461
|
+
});
|
|
4462
|
+
}))];
|
|
4463
|
+
}
|
|
4464
|
+
});
|
|
4465
|
+
});
|
|
4702
4466
|
};
|
|
4703
4467
|
/**
|
|
4704
|
-
* @param {?} id
|
|
4705
|
-
* @param {?} seconds
|
|
4706
4468
|
* @return {?}
|
|
4707
4469
|
*/
|
|
4708
|
-
|
|
4709
|
-
* @param {?} id
|
|
4710
|
-
* @param {?} seconds
|
|
4470
|
+
OfflineStorageService.prototype.processSyncQueue = /**
|
|
4711
4471
|
* @return {?}
|
|
4712
4472
|
*/
|
|
4713
|
-
function (
|
|
4714
|
-
return
|
|
4473
|
+
function () {
|
|
4474
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4475
|
+
var db;
|
|
4476
|
+
var _this = this;
|
|
4477
|
+
return __generator(this, function (_a) {
|
|
4478
|
+
switch (_a.label) {
|
|
4479
|
+
case 0: return [4 /*yield*/, this.initDatabase()];
|
|
4480
|
+
case 1:
|
|
4481
|
+
db = _a.sent();
|
|
4482
|
+
return [2 /*return*/, new Promise((/**
|
|
4483
|
+
* @param {?} resolve
|
|
4484
|
+
* @param {?} reject
|
|
4485
|
+
* @return {?}
|
|
4486
|
+
*/
|
|
4487
|
+
function (resolve, reject) {
|
|
4488
|
+
/** @type {?} */
|
|
4489
|
+
var transaction = db.transaction([_this.STORE_SYNC_QUEUE], 'readwrite');
|
|
4490
|
+
/** @type {?} */
|
|
4491
|
+
var store = transaction.objectStore(_this.STORE_SYNC_QUEUE);
|
|
4492
|
+
/** @type {?} */
|
|
4493
|
+
var request = store.getAll();
|
|
4494
|
+
request.onsuccess = (/**
|
|
4495
|
+
* @return {?}
|
|
4496
|
+
*/
|
|
4497
|
+
function () { return __awaiter(_this, void 0, void 0, function () {
|
|
4498
|
+
var items, syncedCount, items_1, items_1_1, item, clearTx;
|
|
4499
|
+
var e_2, _a;
|
|
4500
|
+
return __generator(this, function (_b) {
|
|
4501
|
+
items = request.result || [];
|
|
4502
|
+
if (items.length === 0) {
|
|
4503
|
+
return [2 /*return*/, resolve(0)];
|
|
4504
|
+
}
|
|
4505
|
+
console.log("[OfflineStorageService] Sincronizando " + items.length + " itens pendentes com o servidor...");
|
|
4506
|
+
syncedCount = 0;
|
|
4507
|
+
try {
|
|
4508
|
+
for (items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
|
|
4509
|
+
item = items_1_1.value;
|
|
4510
|
+
try {
|
|
4511
|
+
console.log("[OfflineStorageService] Sincronizado: " + item.endpoint, item.payload);
|
|
4512
|
+
syncedCount++;
|
|
4513
|
+
}
|
|
4514
|
+
catch (err) {
|
|
4515
|
+
console.error("[OfflineStorageService] Erro ao sincronizar item " + item.id + ":", err);
|
|
4516
|
+
}
|
|
4517
|
+
}
|
|
4518
|
+
}
|
|
4519
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
4520
|
+
finally {
|
|
4521
|
+
try {
|
|
4522
|
+
if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);
|
|
4523
|
+
}
|
|
4524
|
+
finally { if (e_2) throw e_2.error; }
|
|
4525
|
+
}
|
|
4526
|
+
clearTx = db.transaction([this.STORE_SYNC_QUEUE], 'readwrite');
|
|
4527
|
+
clearTx.objectStore(this.STORE_SYNC_QUEUE).clear();
|
|
4528
|
+
resolve(syncedCount);
|
|
4529
|
+
return [2 /*return*/];
|
|
4530
|
+
});
|
|
4531
|
+
}); });
|
|
4532
|
+
request.onerror = (/**
|
|
4533
|
+
* @param {?} event
|
|
4534
|
+
* @return {?}
|
|
4535
|
+
*/
|
|
4536
|
+
function (event) {
|
|
4537
|
+
reject(event.target.error);
|
|
4538
|
+
});
|
|
4539
|
+
}))];
|
|
4540
|
+
}
|
|
4541
|
+
});
|
|
4542
|
+
});
|
|
4715
4543
|
};
|
|
4716
4544
|
/**
|
|
4717
|
-
* @param {?}
|
|
4718
|
-
* @param {
|
|
4545
|
+
* @param {?} bytes
|
|
4546
|
+
* @param {?=} decimals
|
|
4719
4547
|
* @return {?}
|
|
4720
4548
|
*/
|
|
4721
|
-
|
|
4722
|
-
* @param {?}
|
|
4723
|
-
* @param {
|
|
4549
|
+
OfflineStorageService.prototype.formatBytes = /**
|
|
4550
|
+
* @param {?} bytes
|
|
4551
|
+
* @param {?=} decimals
|
|
4724
4552
|
* @return {?}
|
|
4725
4553
|
*/
|
|
4726
|
-
function (
|
|
4727
|
-
|
|
4554
|
+
function (bytes, decimals) {
|
|
4555
|
+
if (decimals === void 0) { decimals = 1; }
|
|
4556
|
+
if (!bytes || bytes === 0)
|
|
4557
|
+
return '0 MB';
|
|
4558
|
+
/** @type {?} */
|
|
4559
|
+
var k = 1024;
|
|
4560
|
+
/** @type {?} */
|
|
4561
|
+
var dm = decimals < 0 ? 0 : decimals;
|
|
4562
|
+
/** @type {?} */
|
|
4563
|
+
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
4564
|
+
/** @type {?} */
|
|
4565
|
+
var i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
4566
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
|
4728
4567
|
};
|
|
4729
4568
|
/**
|
|
4569
|
+
* @param {?} lessons
|
|
4730
4570
|
* @return {?}
|
|
4731
4571
|
*/
|
|
4732
|
-
|
|
4572
|
+
OfflineStorageService.prototype.getTotalStorageUsed = /**
|
|
4573
|
+
* @param {?} lessons
|
|
4733
4574
|
* @return {?}
|
|
4734
4575
|
*/
|
|
4735
|
-
function () {
|
|
4736
|
-
/** @type {?} */
|
|
4737
|
-
var token = localStorage.getItem('token');
|
|
4576
|
+
function (lessons) {
|
|
4738
4577
|
/** @type {?} */
|
|
4739
|
-
var
|
|
4740
|
-
|
|
4741
|
-
|
|
4578
|
+
var totalBytes = lessons.reduce((/**
|
|
4579
|
+
* @param {?} acc
|
|
4580
|
+
* @param {?} curr
|
|
4581
|
+
* @return {?}
|
|
4582
|
+
*/
|
|
4583
|
+
function (acc, curr) { return acc + (curr.sizeBytes || 0); }), 0);
|
|
4584
|
+
return {
|
|
4585
|
+
totalBytes: totalBytes,
|
|
4586
|
+
formatted: this.formatBytes(totalBytes)
|
|
4742
4587
|
};
|
|
4743
|
-
return { headers: new HttpHeaders(headerOptions) };
|
|
4744
4588
|
};
|
|
4745
|
-
|
|
4746
|
-
{ type: Injectable
|
|
4589
|
+
OfflineStorageService.decorators = [
|
|
4590
|
+
{ type: Injectable, args: [{
|
|
4591
|
+
providedIn: 'root'
|
|
4592
|
+
},] }
|
|
4747
4593
|
];
|
|
4748
4594
|
/** @nocollapse */
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
]; };
|
|
4753
|
-
return TrailContentService;
|
|
4595
|
+
OfflineStorageService.ctorParameters = function () { return []; };
|
|
4596
|
+
/** @nocollapse */ OfflineStorageService.ngInjectableDef = ɵɵdefineInjectable({ factory: function OfflineStorageService_Factory() { return new OfflineStorageService(); }, token: OfflineStorageService, providedIn: "root" });
|
|
4597
|
+
return OfflineStorageService;
|
|
4754
4598
|
}());
|
|
4755
4599
|
if (false) {
|
|
4600
|
+
/**
|
|
4601
|
+
* @type {?}
|
|
4602
|
+
* @private
|
|
4603
|
+
*/
|
|
4604
|
+
OfflineStorageService.prototype.DB_NAME;
|
|
4605
|
+
/**
|
|
4606
|
+
* @type {?}
|
|
4607
|
+
* @private
|
|
4608
|
+
*/
|
|
4609
|
+
OfflineStorageService.prototype.DB_VERSION;
|
|
4610
|
+
/**
|
|
4611
|
+
* @type {?}
|
|
4612
|
+
* @private
|
|
4613
|
+
*/
|
|
4614
|
+
OfflineStorageService.prototype.STORE_LESSONS;
|
|
4615
|
+
/**
|
|
4616
|
+
* @type {?}
|
|
4617
|
+
* @private
|
|
4618
|
+
*/
|
|
4619
|
+
OfflineStorageService.prototype.STORE_SYNC_QUEUE;
|
|
4620
|
+
/**
|
|
4621
|
+
* @type {?}
|
|
4622
|
+
* @private
|
|
4623
|
+
*/
|
|
4624
|
+
OfflineStorageService.prototype.db;
|
|
4625
|
+
/**
|
|
4626
|
+
* @type {?}
|
|
4627
|
+
* @private
|
|
4628
|
+
*/
|
|
4629
|
+
OfflineStorageService.prototype.isOnlineSubject;
|
|
4756
4630
|
/** @type {?} */
|
|
4757
|
-
|
|
4631
|
+
OfflineStorageService.prototype.isOnline$;
|
|
4758
4632
|
/** @type {?} */
|
|
4759
|
-
|
|
4633
|
+
OfflineStorageService.prototype.downloadProgress$;
|
|
4634
|
+
/** @type {?} */
|
|
4635
|
+
OfflineStorageService.prototype.downloadedLessons$;
|
|
4760
4636
|
}
|
|
4761
4637
|
|
|
4762
4638
|
/**
|
|
@@ -5255,14 +5131,6 @@ var VideoComponent = /** @class */ (function () {
|
|
|
5255
5131
|
function () {
|
|
5256
5132
|
_this.showSaved = false;
|
|
5257
5133
|
}), 1000);
|
|
5258
|
-
if (!navigator.onLine) {
|
|
5259
|
-
this.offlineService.queueSyncAction({
|
|
5260
|
-
type: 'notes',
|
|
5261
|
-
endpoint: '/api/v2/client/ambiente-virtual/anotacoes',
|
|
5262
|
-
payload: { id: this.id, data: data }
|
|
5263
|
-
});
|
|
5264
|
-
return;
|
|
5265
|
-
}
|
|
5266
5134
|
if (this.contentId) {
|
|
5267
5135
|
this._trailContentService.update(this.contentId, data).subscribe((/**
|
|
5268
5136
|
* @param {?} res
|
|
@@ -13970,58 +13838,6 @@ var CursoVisualizadorComponent = /** @class */ (function () {
|
|
|
13970
13838
|
}
|
|
13971
13839
|
}));
|
|
13972
13840
|
};
|
|
13973
|
-
/**
|
|
13974
|
-
* @param {?} id
|
|
13975
|
-
* @return {?}
|
|
13976
|
-
*/
|
|
13977
|
-
CursoVisualizadorComponent.prototype.loadOfflineModule = /**
|
|
13978
|
-
* @param {?} id
|
|
13979
|
-
* @return {?}
|
|
13980
|
-
*/
|
|
13981
|
-
function (id) {
|
|
13982
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
13983
|
-
var offlineData, e_1;
|
|
13984
|
-
return __generator(this, function (_a) {
|
|
13985
|
-
switch (_a.label) {
|
|
13986
|
-
case 0:
|
|
13987
|
-
_a.trys.push([0, 2, , 3]);
|
|
13988
|
-
return [4 /*yield*/, this.offlineService.getDownloadedLesson(id)];
|
|
13989
|
-
case 1:
|
|
13990
|
-
offlineData = _a.sent();
|
|
13991
|
-
if (offlineData) {
|
|
13992
|
-
this.etapa = {
|
|
13993
|
-
id: offlineData.id,
|
|
13994
|
-
nome: offlineData.title,
|
|
13995
|
-
sinopse: offlineData.subtitle,
|
|
13996
|
-
thumb: offlineData.thumbnail
|
|
13997
|
-
};
|
|
13998
|
-
if (offlineData.stages && offlineData.stages.length > 0) {
|
|
13999
|
-
this.data = offlineData.stages;
|
|
14000
|
-
this.current = this.data[0];
|
|
14001
|
-
if (this.cursoViewer) {
|
|
14002
|
-
this.cursoViewer.getContent(this.current.id);
|
|
14003
|
-
}
|
|
14004
|
-
if (this.cursoNavBar) {
|
|
14005
|
-
this.cursoNavBar.menuItems = this.data;
|
|
14006
|
-
this.cursoNavBar.setIndexes(this.data, this.current);
|
|
14007
|
-
}
|
|
14008
|
-
}
|
|
14009
|
-
this.loader = false;
|
|
14010
|
-
console.log('[CursoVisualizador] Módulo carregado do armazenamento offline:', offlineData);
|
|
14011
|
-
return [2 /*return*/];
|
|
14012
|
-
}
|
|
14013
|
-
return [3 /*break*/, 3];
|
|
14014
|
-
case 2:
|
|
14015
|
-
e_1 = _a.sent();
|
|
14016
|
-
console.error('[CursoVisualizador] Erro ao recuperar módulo offline:', e_1);
|
|
14017
|
-
return [3 /*break*/, 3];
|
|
14018
|
-
case 3:
|
|
14019
|
-
this.loader = false;
|
|
14020
|
-
return [2 /*return*/];
|
|
14021
|
-
}
|
|
14022
|
-
});
|
|
14023
|
-
});
|
|
14024
|
-
};
|
|
14025
13841
|
/**
|
|
14026
13842
|
* @return {?}
|
|
14027
13843
|
*/
|
|
@@ -14030,9 +13846,6 @@ var CursoVisualizadorComponent = /** @class */ (function () {
|
|
|
14030
13846
|
*/
|
|
14031
13847
|
function () {
|
|
14032
13848
|
var _this = this;
|
|
14033
|
-
if (!navigator.onLine) {
|
|
14034
|
-
return;
|
|
14035
|
-
}
|
|
14036
13849
|
this.trailService.trilhaInfoEtapa(this.id).subscribe((/**
|
|
14037
13850
|
* @param {?} res
|
|
14038
13851
|
* @return {?}
|
|
@@ -14055,12 +13868,6 @@ var CursoVisualizadorComponent = /** @class */ (function () {
|
|
|
14055
13868
|
}
|
|
14056
13869
|
_this.etapa = etapa;
|
|
14057
13870
|
}
|
|
14058
|
-
}), (/**
|
|
14059
|
-
* @param {?} err
|
|
14060
|
-
* @return {?}
|
|
14061
|
-
*/
|
|
14062
|
-
function (err) {
|
|
14063
|
-
console.log("[CursoVisualizador] Fallback getData offline");
|
|
14064
13871
|
}));
|
|
14065
13872
|
};
|
|
14066
13873
|
/**
|
|
@@ -14071,9 +13878,6 @@ var CursoVisualizadorComponent = /** @class */ (function () {
|
|
|
14071
13878
|
*/
|
|
14072
13879
|
function () {
|
|
14073
13880
|
var _this = this;
|
|
14074
|
-
if (!navigator.onLine) {
|
|
14075
|
-
return;
|
|
14076
|
-
}
|
|
14077
13881
|
this._bannerService.verifyBannerTrilha(this.id)
|
|
14078
13882
|
.subscribe((/**
|
|
14079
13883
|
* @param {?} res
|
|
@@ -14084,11 +13888,7 @@ var CursoVisualizadorComponent = /** @class */ (function () {
|
|
|
14084
13888
|
if (_this.bannerArray.length > 0 && _this.bannerArray[0].status === 0) {
|
|
14085
13889
|
_this.openDialog(_this.bannerArray);
|
|
14086
13890
|
}
|
|
14087
|
-
})
|
|
14088
|
-
* @param {?} err
|
|
14089
|
-
* @return {?}
|
|
14090
|
-
*/
|
|
14091
|
-
function (err) { }));
|
|
13891
|
+
}));
|
|
14092
13892
|
};
|
|
14093
13893
|
/**
|
|
14094
13894
|
* @param {?} data
|
|
@@ -14143,10 +13943,6 @@ var CursoVisualizadorComponent = /** @class */ (function () {
|
|
|
14143
13943
|
var _this = this;
|
|
14144
13944
|
this.loader = true;
|
|
14145
13945
|
this.module = this.id;
|
|
14146
|
-
if (!navigator.onLine) {
|
|
14147
|
-
this.loadOfflineModule(this.id);
|
|
14148
|
-
return;
|
|
14149
|
-
}
|
|
14150
13946
|
this.ambienteVirtualService.getSubEtapa(this.id).subscribe((/**
|
|
14151
13947
|
* @param {?} res
|
|
14152
13948
|
* @return {?}
|
|
@@ -14188,8 +13984,8 @@ var CursoVisualizadorComponent = /** @class */ (function () {
|
|
|
14188
13984
|
* @return {?}
|
|
14189
13985
|
*/
|
|
14190
13986
|
function (err) {
|
|
14191
|
-
console.log("Erro
|
|
14192
|
-
_this.
|
|
13987
|
+
console.log("Erro", err);
|
|
13988
|
+
_this.notificate();
|
|
14193
13989
|
}));
|
|
14194
13990
|
};
|
|
14195
13991
|
/**
|
|
@@ -14505,40 +14301,18 @@ var CursoVisualizadorComponent = /** @class */ (function () {
|
|
|
14505
14301
|
* @return {?}
|
|
14506
14302
|
*/
|
|
14507
14303
|
function (idSubStep) {
|
|
14508
|
-
var _this = this;
|
|
14509
14304
|
if (idSubStep !== undefined) {
|
|
14510
|
-
this.
|
|
14511
|
-
* @param {?}
|
|
14305
|
+
this.ambienteVirtualService.registerNewProgress(idSubStep).subscribe((/**
|
|
14306
|
+
* @param {?} response
|
|
14512
14307
|
* @return {?}
|
|
14513
14308
|
*/
|
|
14514
|
-
function (
|
|
14515
|
-
|
|
14516
|
-
|
|
14517
|
-
|
|
14518
|
-
|
|
14519
|
-
|
|
14520
|
-
|
|
14521
|
-
console.log('[CursoVisualizador] Progresso offline da etapa ' + idSubStep + ' enfileirado para sincronização.');
|
|
14522
|
-
return;
|
|
14523
|
-
}
|
|
14524
|
-
_this.ambienteVirtualService.registerNewProgress(idSubStep).subscribe((/**
|
|
14525
|
-
* @param {?} response
|
|
14526
|
-
* @return {?}
|
|
14527
|
-
*/
|
|
14528
|
-
function (response) {
|
|
14529
|
-
console.log('checkAsRead online sucesso:', response);
|
|
14530
|
-
}), (/**
|
|
14531
|
-
* @param {?} error
|
|
14532
|
-
* @return {?}
|
|
14533
|
-
*/
|
|
14534
|
-
function (error) {
|
|
14535
|
-
console.warn('Falha ao registrar progresso online, salvando na fila offline:', error);
|
|
14536
|
-
_this.offlineService.queueSyncAction({
|
|
14537
|
-
type: 'stage_progress',
|
|
14538
|
-
endpoint: '/api/v2/client/progresso/sub/post?sub_id=' + idSubStep,
|
|
14539
|
-
payload: { subetapa_id: idSubStep, status: 1 }
|
|
14540
|
-
});
|
|
14541
|
-
}));
|
|
14309
|
+
function (response) {
|
|
14310
|
+
console.log('checkAsRead', response);
|
|
14311
|
+
}), (/**
|
|
14312
|
+
* @param {?} error
|
|
14313
|
+
* @return {?}
|
|
14314
|
+
*/
|
|
14315
|
+
function (error) {
|
|
14542
14316
|
}));
|
|
14543
14317
|
}
|
|
14544
14318
|
};
|
|
@@ -16292,116 +16066,48 @@ var ViewerComponent = /** @class */ (function () {
|
|
|
16292
16066
|
* @return {?}
|
|
16293
16067
|
*/
|
|
16294
16068
|
function (step) {
|
|
16295
|
-
|
|
16296
|
-
|
|
16297
|
-
|
|
16298
|
-
|
|
16299
|
-
|
|
16300
|
-
|
|
16301
|
-
|
|
16302
|
-
|
|
16303
|
-
|
|
16304
|
-
|
|
16305
|
-
|
|
16306
|
-
|
|
16307
|
-
|
|
16308
|
-
|
|
16309
|
-
|
|
16310
|
-
|
|
16311
|
-
|
|
16312
|
-
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
stageItems = [{
|
|
16318
|
-
type: 'video',
|
|
16319
|
-
title: offlineLesson.title,
|
|
16320
|
-
subTitle: offlineLesson.subtitle,
|
|
16321
|
-
source: 'file',
|
|
16322
|
-
source_path: offlineLesson.thumbnail,
|
|
16323
|
-
showVideoControl: true
|
|
16324
|
-
}];
|
|
16325
|
-
}
|
|
16326
|
-
this.componentArray = stageItems;
|
|
16327
|
-
this.content = { id: step, value: this.componentArray };
|
|
16328
|
-
this.loader = false;
|
|
16329
|
-
this.cdr.detectChanges();
|
|
16330
|
-
console.log('[ViewerComponent] Conteúdo carregado offline com sucesso (sem chamadas HTTP):', this.componentArray);
|
|
16331
|
-
return [2 /*return*/];
|
|
16069
|
+
var _this = this;
|
|
16070
|
+
this.loader = true;
|
|
16071
|
+
this._ambienteVirtualService.getContent(step)
|
|
16072
|
+
.subscribe((/**
|
|
16073
|
+
* @param {?} res
|
|
16074
|
+
* @return {?}
|
|
16075
|
+
*/
|
|
16076
|
+
function (res) {
|
|
16077
|
+
var e_1, _a;
|
|
16078
|
+
if (res && res.data && res.data[0]) {
|
|
16079
|
+
/** @type {?} */
|
|
16080
|
+
var data = res.data[0].value;
|
|
16081
|
+
_this.redirect = res.redirect;
|
|
16082
|
+
_this.content = res.data[0];
|
|
16083
|
+
if (res['data'][0].value) {
|
|
16084
|
+
/** @type {?} */
|
|
16085
|
+
var itensJson = res['data'][0].value;
|
|
16086
|
+
_this.componentArray = [];
|
|
16087
|
+
try {
|
|
16088
|
+
for (var itensJson_1 = __values(itensJson), itensJson_1_1 = itensJson_1.next(); !itensJson_1_1.done; itensJson_1_1 = itensJson_1.next()) {
|
|
16089
|
+
var item = itensJson_1_1.value;
|
|
16090
|
+
_this.componentArray.push(item);
|
|
16332
16091
|
}
|
|
16333
|
-
|
|
16334
|
-
|
|
16335
|
-
|
|
16336
|
-
|
|
16337
|
-
|
|
16338
|
-
|
|
16339
|
-
|
|
16340
|
-
|
|
16341
|
-
* @param {?} res
|
|
16342
|
-
* @return {?}
|
|
16343
|
-
*/
|
|
16344
|
-
function (res) {
|
|
16345
|
-
var e_2, _a;
|
|
16346
|
-
if (res && res.data && res.data[0]) {
|
|
16347
|
-
/** @type {?} */
|
|
16348
|
-
var data = res.data[0].value;
|
|
16349
|
-
_this.redirect = res.redirect;
|
|
16350
|
-
_this.content = res.data[0];
|
|
16351
|
-
if (res['data'][0].value) {
|
|
16352
|
-
/** @type {?} */
|
|
16353
|
-
var itensJson = res['data'][0].value;
|
|
16354
|
-
_this.componentArray = [];
|
|
16355
|
-
try {
|
|
16356
|
-
for (var itensJson_1 = __values(itensJson), itensJson_1_1 = itensJson_1.next(); !itensJson_1_1.done; itensJson_1_1 = itensJson_1.next()) {
|
|
16357
|
-
var item = itensJson_1_1.value;
|
|
16358
|
-
_this.componentArray.push(item);
|
|
16359
|
-
}
|
|
16360
|
-
}
|
|
16361
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
16362
|
-
finally {
|
|
16363
|
-
try {
|
|
16364
|
-
if (itensJson_1_1 && !itensJson_1_1.done && (_a = itensJson_1.return)) _a.call(itensJson_1);
|
|
16365
|
-
}
|
|
16366
|
-
finally { if (e_2) throw e_2.error; }
|
|
16367
|
-
}
|
|
16368
|
-
}
|
|
16369
|
-
}
|
|
16370
|
-
_this.loader = false;
|
|
16371
|
-
}), (/**
|
|
16372
|
-
* @param {?} err
|
|
16373
|
-
* @return {?}
|
|
16374
|
-
*/
|
|
16375
|
-
function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
16376
|
-
var offlineLesson, e_3;
|
|
16377
|
-
return __generator(this, function (_a) {
|
|
16378
|
-
switch (_a.label) {
|
|
16379
|
-
case 0:
|
|
16380
|
-
console.log("Erro de rede getContent, tentando recuperar do offline storage:", err);
|
|
16381
|
-
_a.label = 1;
|
|
16382
|
-
case 1:
|
|
16383
|
-
_a.trys.push([1, 3, , 4]);
|
|
16384
|
-
return [4 /*yield*/, this.offlineService.getDownloadedLesson(step)];
|
|
16385
|
-
case 2:
|
|
16386
|
-
offlineLesson = _a.sent();
|
|
16387
|
-
if (offlineLesson && offlineLesson.stageData) {
|
|
16388
|
-
this.componentArray = Array.isArray(offlineLesson.stageData) ? offlineLesson.stageData : [offlineLesson.stageData];
|
|
16389
|
-
this.content = { id: step, value: this.componentArray };
|
|
16390
|
-
}
|
|
16391
|
-
return [3 /*break*/, 4];
|
|
16392
|
-
case 3:
|
|
16393
|
-
e_3 = _a.sent();
|
|
16394
|
-
return [3 /*break*/, 4];
|
|
16395
|
-
case 4:
|
|
16396
|
-
this.loader = false;
|
|
16397
|
-
return [2 /*return*/];
|
|
16398
|
-
}
|
|
16399
|
-
});
|
|
16400
|
-
}); }));
|
|
16401
|
-
return [2 /*return*/];
|
|
16092
|
+
}
|
|
16093
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
16094
|
+
finally {
|
|
16095
|
+
try {
|
|
16096
|
+
if (itensJson_1_1 && !itensJson_1_1.done && (_a = itensJson_1.return)) _a.call(itensJson_1);
|
|
16097
|
+
}
|
|
16098
|
+
finally { if (e_1) throw e_1.error; }
|
|
16099
|
+
}
|
|
16402
16100
|
}
|
|
16403
|
-
}
|
|
16404
|
-
|
|
16101
|
+
}
|
|
16102
|
+
_this.loader = false;
|
|
16103
|
+
}), (/**
|
|
16104
|
+
* @param {?} err
|
|
16105
|
+
* @return {?}
|
|
16106
|
+
*/
|
|
16107
|
+
function (err) {
|
|
16108
|
+
console.log(err);
|
|
16109
|
+
_this.loader = false;
|
|
16110
|
+
}));
|
|
16405
16111
|
};
|
|
16406
16112
|
Object.defineProperty(ViewerComponent.prototype, "hasVideo", {
|
|
16407
16113
|
get: /**
|
|
@@ -16470,16 +16176,6 @@ var ViewerComponent = /** @class */ (function () {
|
|
|
16470
16176
|
* @return {?}
|
|
16471
16177
|
*/
|
|
16472
16178
|
function (time) {
|
|
16473
|
-
if (!navigator.onLine) {
|
|
16474
|
-
if (this.content && this.content.id) {
|
|
16475
|
-
this.offlineService.queueSyncAction({
|
|
16476
|
-
type: 'video_progress',
|
|
16477
|
-
endpoint: '/api/v2/client/ambiente-virtual/video-tempo',
|
|
16478
|
-
payload: { content_id: this.content.id, current_time: time.current }
|
|
16479
|
-
});
|
|
16480
|
-
}
|
|
16481
|
-
return;
|
|
16482
|
-
}
|
|
16483
16179
|
if (this.content && this.content.id) {
|
|
16484
16180
|
this.trailContentService.videoTime(this.content.id, time.current).subscribe((/**
|
|
16485
16181
|
* @param {?} result
|
|
@@ -30461,13 +30157,6 @@ var AsapViewerModule = /** @class */ (function () {
|
|
|
30461
30157
|
ModalStarRatingComponent,
|
|
30462
30158
|
StudioModalStarRatingComponent,
|
|
30463
30159
|
OfflineManagerModalComponent
|
|
30464
|
-
],
|
|
30465
|
-
providers: [
|
|
30466
|
-
{
|
|
30467
|
-
provide: HTTP_INTERCEPTORS,
|
|
30468
|
-
useClass: OfflineHttpInterceptor,
|
|
30469
|
-
multi: true
|
|
30470
|
-
}
|
|
30471
30160
|
]
|
|
30472
30161
|
},] }
|
|
30473
30162
|
];
|
|
@@ -30486,5 +30175,5 @@ var AsapViewerModule = /** @class */ (function () {
|
|
|
30486
30175
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
30487
30176
|
*/
|
|
30488
30177
|
|
|
30489
|
-
export { AsapViewerComponent, AsapViewerModule, AsapViewerRoutes, AsapViewerService, OfflineManagerModalComponent, OfflineStorageService, CursoVisualizadorComponent as ɵa, AmbienteVirtualService as ɵb, FornecedorService as ɵba, VisualizarMaoObraProdutoComponent as ɵbb, ArtesanService as ɵbc, VisualizarFornecedorProdutoComponent as ɵbd, VisualizarCalcularProdutoComponent as ɵbe, CalculadoraService as ɵbf, PedidosComponent as ɵbg, MY_FORMATS as ɵbh, DadosPedidoComponent as ɵbi, PedidoService as ɵbj, CalculoPedidoComponent as ɵbk, ValorService as ɵbl, ListaProdutoseService as ɵbm, CustosComponent as ɵbn, TransporteService as ɵbo, DescService as ɵbp, ComprasComponent as ɵbq, ListaService as ɵbr, ViabilidadeComponent as ɵbs, CustosFixosComponent as ɵbt, CustoService as ɵbu, CustosVariaveisComponent as ɵbv, ViabilidadeService as ɵbw, FaturamentoEstimadoComponent as ɵbx, MaterialModule as ɵby, ExerciciosModule as ɵbz, bannerService as ɵc, ExerciciosRoutes as ɵca, GestaoVisualizadorComponent as ɵcb, GestaoResumoComponent as ɵcc, Exercicio1Component as ɵcd, CalculadoraFinanceiraComponent as ɵce, BalanceSheetService as ɵcf, ExercisesService as ɵcg, ComoResolverDividasComponent as ɵch, TrabalharPraGanharComponent as ɵci, MeuClienteComponent as ɵcj, MY_FORMATS$1 as ɵck, SemanaComponent as ɵcl, Aula10Ex1Component as ɵcm, Aula10Ex3Component as ɵcn, Aula12Ex6Component as ɵco, ProductionTimeComponent as ɵcp, GestaoSidebarComponent as ɵcq, GestaoNavbarComponent as ɵcr, ViewerGestaoComponent as ɵcs, Exercicio1Tab1Component as ɵct, Exercicio1Tab2Component as ɵcu, Exercicio1Tab3Component as ɵcv, Exercicio1ScenarioComponent as ɵcw, Exercicio2Component as ɵcx, Exercicio2_3Component as ɵcy, Exercicio3Component as ɵcz, Trailv2Service as ɵd, Exercicio4Component as ɵda, Exercicio5Component as ɵdb, AssessmentVisualizadorModule as ɵdc, AssessmentVisualizadorRoute as ɵdd, AssessmentVisualizadorComponent as ɵde, AssessmentService as ɵdf, DetailComponent as ɵdg, AsessmentReportComponent as ɵdh, DetailInnerComponent as ɵdi, SidebarAssessmentComponent as ɵdj, NavbarAssessmentComponent as ɵdk, AssessmentReportInnerComponent as ɵdl, RadarComponent as ɵdm, EditorComponentsModule as ɵdn, FileManagerModule as ɵdo, FileManagerComponent as ɵdp, FileManagerService as ɵdq, FileManagerModel as ɵdr, FileManagerDirective as ɵds, PipesModule as ɵdt, SafeUrlPipe as ɵdu, StreamPipe as ɵdv, AsapClientPipe as ɵdw, YoutubeEmbedPipe as ɵdx, CheckTypePipe as ɵdy, VimeoEmbedPipe as ɵdz, StudioVisualizadorComponent as ɵe, ComponentSharedModule as ɵea, SharedTitleComponent as ɵeb, SharedSubTitleComponent as ɵec, SharedButtonComponent as ɵed, SharedMediaComponent as ɵee, SharedTextComponent as ɵef, DynamicInputComponent as ɵeg, EditorChallengeComponent as ɵeh, VimeoService as ɵei, EditorChallengeConfigComponent as ɵej, EditorConclusionComponent as ɵek, TrilhaPerformanceService as ɵel, TrilhaRatingService as ɵem, EditorConclusionConfigComponent as ɵen, EditorDynamicTableComponent as ɵeo, TrailContentService as ɵep, EditorDynamicTableConfigComponent as ɵeq, EditorIntroComponent as ɵer, EditorIntroConfigComponent as ɵes, EditorLongTextComponent as ɵet, EditorLongTextConfigComponent as ɵeu, EditorMultiChoiceComponent as ɵev, EditorMultipleQuestionsComponent as ɵew, EditorMultipleQuestionsConfigComponent as ɵex, EditorSalesChannelComponent as ɵey, EditorSalesChannelConfigComponent as ɵez, StudioVisualizadorService as ɵf, EditorSheetCorrectIncorrectComponent as ɵfa, EditorSheetCorrectIncorrectConfigComponent as ɵfb, EditorYesNoComponent as ɵfc, EditorYesNoConfigComponent as ɵfd, VideoComponent as ɵfe, ImageComponent as ɵff, EditorImageConfigComponent as ɵfg, EditorUploadComponent as ɵfh, EditorUploadConfigComponent as ɵfi, EditorDownloadComponent as ɵfj, EditorDownloadConfigComponent as ɵfk, EditorStarPointComponent as ɵfl, EditorStarPointConfigComponent as ɵfm, EditorRatingComponent as ɵfn, EditorRatingConfigComponent as ɵfo, ForumComponent as ɵfp, ForumService as ɵfq, ForumResponseService as ɵfr, ForumVoteService as ɵfs, EditorForumConfigComponent as ɵft, EditorAvaliationComponent as ɵfu, EditorContractComponent as ɵfv, FormStepComponent as ɵfw, EditorPdfComponent as ɵfx, EditorResearchComponent as ɵfy, EditorPageComponent as ɵfz, MiniCursoVisualizadorComponent as ɵg, FeedbackComponent as ɵga, FirebaseNotificationService as ɵgb, AudioComponent as ɵgc, EditorRandomQuestionsComponent as ɵgd, TextComponent as ɵge, BannerModule as ɵgf, BannerComponent as ɵgg, SpinnerModule as ɵgh, SpinnerComponent as ɵgi, CursoNavbarComponent as ɵgj, CursoSidebarComponent as ɵgk, modalTrilhaBanner as ɵgl, ModalStarRatingComponent as ɵgm, ViewerComponent as ɵgn, MiniCursoSidebarComponent as ɵgo, MiniCursoSideMenuComponent as ɵgp, AreaPermissionService as ɵgq, TutorService as ɵgr, MiniCursoNavbarComponent as ɵgs, NotificationService as ɵgt, MiniViewerComponent as ɵgu, MiniTrailCommentService as ɵgv, MiniModalTrilhaBanner as ɵgw, MiniSliderComponent as ɵgx, StarRatingComponent as ɵgy, PrecificacaoSidebarComponent as ɵgz, MiniTrailService as ɵh, PrecificacaoNavbarComponent as ɵha, ViewerPrecificacaoComponent as ɵhb, ModalMaoObraProdutoComponent as ɵhc, ModalCustosComponent as ɵhd, ModalResumoComponent as ɵhe, ModalEdit as ɵhf, ModalFaturamentoEstimadoComponent as ɵhg, MaterialPipe as ɵhh, CommentsComponent as ɵhi, CommentsService as ɵhj, VisualizarForumComponent as ɵhk, ForumTrilhaService as ɵhl, PointsComponent as ɵhm, TrailService as ɵhn, Trail as ɵho, StudioStarRatingComponent as ɵhp, StudioModalStarRatingComponent as ɵhq,
|
|
30178
|
+
export { AsapViewerComponent, AsapViewerModule, AsapViewerRoutes, AsapViewerService, OfflineManagerModalComponent, OfflineStorageService, CursoVisualizadorComponent as ɵa, AmbienteVirtualService as ɵb, FornecedorService as ɵba, VisualizarMaoObraProdutoComponent as ɵbb, ArtesanService as ɵbc, VisualizarFornecedorProdutoComponent as ɵbd, VisualizarCalcularProdutoComponent as ɵbe, CalculadoraService as ɵbf, PedidosComponent as ɵbg, MY_FORMATS as ɵbh, DadosPedidoComponent as ɵbi, PedidoService as ɵbj, CalculoPedidoComponent as ɵbk, ValorService as ɵbl, ListaProdutoseService as ɵbm, CustosComponent as ɵbn, TransporteService as ɵbo, DescService as ɵbp, ComprasComponent as ɵbq, ListaService as ɵbr, ViabilidadeComponent as ɵbs, CustosFixosComponent as ɵbt, CustoService as ɵbu, CustosVariaveisComponent as ɵbv, ViabilidadeService as ɵbw, FaturamentoEstimadoComponent as ɵbx, MaterialModule as ɵby, ExerciciosModule as ɵbz, bannerService as ɵc, ExerciciosRoutes as ɵca, GestaoVisualizadorComponent as ɵcb, GestaoResumoComponent as ɵcc, Exercicio1Component as ɵcd, CalculadoraFinanceiraComponent as ɵce, BalanceSheetService as ɵcf, ExercisesService as ɵcg, ComoResolverDividasComponent as ɵch, TrabalharPraGanharComponent as ɵci, MeuClienteComponent as ɵcj, MY_FORMATS$1 as ɵck, SemanaComponent as ɵcl, Aula10Ex1Component as ɵcm, Aula10Ex3Component as ɵcn, Aula12Ex6Component as ɵco, ProductionTimeComponent as ɵcp, GestaoSidebarComponent as ɵcq, GestaoNavbarComponent as ɵcr, ViewerGestaoComponent as ɵcs, Exercicio1Tab1Component as ɵct, Exercicio1Tab2Component as ɵcu, Exercicio1Tab3Component as ɵcv, Exercicio1ScenarioComponent as ɵcw, Exercicio2Component as ɵcx, Exercicio2_3Component as ɵcy, Exercicio3Component as ɵcz, Trailv2Service as ɵd, Exercicio4Component as ɵda, Exercicio5Component as ɵdb, AssessmentVisualizadorModule as ɵdc, AssessmentVisualizadorRoute as ɵdd, AssessmentVisualizadorComponent as ɵde, AssessmentService as ɵdf, DetailComponent as ɵdg, AsessmentReportComponent as ɵdh, DetailInnerComponent as ɵdi, SidebarAssessmentComponent as ɵdj, NavbarAssessmentComponent as ɵdk, AssessmentReportInnerComponent as ɵdl, RadarComponent as ɵdm, EditorComponentsModule as ɵdn, FileManagerModule as ɵdo, FileManagerComponent as ɵdp, FileManagerService as ɵdq, FileManagerModel as ɵdr, FileManagerDirective as ɵds, PipesModule as ɵdt, SafeUrlPipe as ɵdu, StreamPipe as ɵdv, AsapClientPipe as ɵdw, YoutubeEmbedPipe as ɵdx, CheckTypePipe as ɵdy, VimeoEmbedPipe as ɵdz, StudioVisualizadorComponent as ɵe, ComponentSharedModule as ɵea, SharedTitleComponent as ɵeb, SharedSubTitleComponent as ɵec, SharedButtonComponent as ɵed, SharedMediaComponent as ɵee, SharedTextComponent as ɵef, DynamicInputComponent as ɵeg, EditorChallengeComponent as ɵeh, VimeoService as ɵei, EditorChallengeConfigComponent as ɵej, EditorConclusionComponent as ɵek, TrilhaPerformanceService as ɵel, TrilhaRatingService as ɵem, EditorConclusionConfigComponent as ɵen, EditorDynamicTableComponent as ɵeo, TrailContentService as ɵep, EditorDynamicTableConfigComponent as ɵeq, EditorIntroComponent as ɵer, EditorIntroConfigComponent as ɵes, EditorLongTextComponent as ɵet, EditorLongTextConfigComponent as ɵeu, EditorMultiChoiceComponent as ɵev, EditorMultipleQuestionsComponent as ɵew, EditorMultipleQuestionsConfigComponent as ɵex, EditorSalesChannelComponent as ɵey, EditorSalesChannelConfigComponent as ɵez, StudioVisualizadorService as ɵf, EditorSheetCorrectIncorrectComponent as ɵfa, EditorSheetCorrectIncorrectConfigComponent as ɵfb, EditorYesNoComponent as ɵfc, EditorYesNoConfigComponent as ɵfd, VideoComponent as ɵfe, ImageComponent as ɵff, EditorImageConfigComponent as ɵfg, EditorUploadComponent as ɵfh, EditorUploadConfigComponent as ɵfi, EditorDownloadComponent as ɵfj, EditorDownloadConfigComponent as ɵfk, EditorStarPointComponent as ɵfl, EditorStarPointConfigComponent as ɵfm, EditorRatingComponent as ɵfn, EditorRatingConfigComponent as ɵfo, ForumComponent as ɵfp, ForumService as ɵfq, ForumResponseService as ɵfr, ForumVoteService as ɵfs, EditorForumConfigComponent as ɵft, EditorAvaliationComponent as ɵfu, EditorContractComponent as ɵfv, FormStepComponent as ɵfw, EditorPdfComponent as ɵfx, EditorResearchComponent as ɵfy, EditorPageComponent as ɵfz, MiniCursoVisualizadorComponent as ɵg, FeedbackComponent as ɵga, FirebaseNotificationService as ɵgb, AudioComponent as ɵgc, EditorRandomQuestionsComponent as ɵgd, TextComponent as ɵge, BannerModule as ɵgf, BannerComponent as ɵgg, SpinnerModule as ɵgh, SpinnerComponent as ɵgi, CursoNavbarComponent as ɵgj, CursoSidebarComponent as ɵgk, modalTrilhaBanner as ɵgl, ModalStarRatingComponent as ɵgm, ViewerComponent as ɵgn, MiniCursoSidebarComponent as ɵgo, MiniCursoSideMenuComponent as ɵgp, AreaPermissionService as ɵgq, TutorService as ɵgr, MiniCursoNavbarComponent as ɵgs, NotificationService as ɵgt, MiniViewerComponent as ɵgu, MiniTrailCommentService as ɵgv, MiniModalTrilhaBanner as ɵgw, MiniSliderComponent as ɵgx, StarRatingComponent as ɵgy, PrecificacaoSidebarComponent as ɵgz, MiniTrailService as ɵh, PrecificacaoNavbarComponent as ɵha, ViewerPrecificacaoComponent as ɵhb, ModalMaoObraProdutoComponent as ɵhc, ModalCustosComponent as ɵhd, ModalResumoComponent as ɵhe, ModalEdit as ɵhf, ModalFaturamentoEstimadoComponent as ɵhg, MaterialPipe as ɵhh, CommentsComponent as ɵhi, CommentsService as ɵhj, VisualizarForumComponent as ɵhk, ForumTrilhaService as ɵhl, PointsComponent as ɵhm, TrailService as ɵhn, Trail as ɵho, StudioStarRatingComponent as ɵhp, StudioModalStarRatingComponent as ɵhq, BaseService as ɵi, DevelopmentService as ɵj, ArticlesService as ɵk, TrilhaService as ɵl, TrilhaItemService as ɵm, LayoutService as ɵn, ExercisesComponent as ɵo, PrecificacaoVisualizadorComponent as ɵp, ProdutosComponent as ɵq, ProdutosService as ɵr, NovoProdutoComponent as ɵs, MeusPedidosComponent as ɵt, PedidoService$1 as ɵu, VisualizarProdutoComponent as ɵv, VisualizarResumoProdutoComponent as ɵw, MaterialService as ɵx, MaoObraService as ɵy, VisualizarMateriaisProdutoComponent as ɵz };
|
|
30490
30179
|
//# sourceMappingURL=asap-viewer.js.map
|