@rolatech/angular-course 17.3.0 → 17.3.1

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.
@@ -0,0 +1,1958 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, importProvidersFrom, makeEnvironmentProviders, Component, input, effect, inject, output, ViewEncapsulation, model, PLATFORM_ID, ElementRef, Inject, viewChild, booleanAttribute } from '@angular/core';
3
+ import * as i6 from '@angular/forms';
4
+ import { ReactiveFormsModule, FormsModule } from '@angular/forms';
5
+ import { CommonModule, NgClass, DatePipe, isPlatformBrowser, ViewportScroller } from '@angular/common';
6
+ import * as i1$3 from '@angular/router';
7
+ import { RouterModule, RouterLink, ActivatedRoute, Router } from '@angular/router';
8
+ import { BaseService, DialogService } from '@rolatech/angular-services';
9
+ import * as i2 from '@angular/material/icon';
10
+ import { MatIconModule } from '@angular/material/icon';
11
+ import * as i1$2 from '@angular/material/dialog';
12
+ import { MatDialog, MAT_DIALOG_DATA, MatDialogClose } from '@angular/material/dialog';
13
+ import { ImagePreviewDialogComponent, ThumbnailComponent, IconButtonComponent, AngularComponentsModule, ImageComponent, MediaListComponent, MediaListItemComponent, BaseComponent, AppContainerComponent, ListComponent } from '@rolatech/angular-components';
14
+ import * as i3 from '@angular/material/button';
15
+ import { MatButtonModule } from '@angular/material/button';
16
+ import * as i1 from '@angular/material/expansion';
17
+ import { MatExpansionModule } from '@angular/material/expansion';
18
+ import * as i3$2 from '@angular/material/checkbox';
19
+ import { MatCheckboxModule } from '@angular/material/checkbox';
20
+ import { DurationPipe, AngularCommonModule } from '@rolatech/angular-common';
21
+ import * as i5$1 from '@angular/material/divider';
22
+ import { MatDividerModule } from '@angular/material/divider';
23
+ import * as i7$1 from '@angular/material/stepper';
24
+ import { MatStepperModule, MatStepper } from '@angular/material/stepper';
25
+ import { MomentDateAdapter } from '@angular/material-moment-adapter';
26
+ import * as i7 from '@angular/material/core';
27
+ import { DateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS, MatOptionModule } from '@angular/material/core';
28
+ import moment from 'moment';
29
+ import * as i6$1 from '@angular/material/select';
30
+ import { MatSelectModule } from '@angular/material/select';
31
+ import * as i5 from '@angular/material/datepicker';
32
+ import { MatDatepickerModule } from '@angular/material/datepicker';
33
+ import * as i3$1 from '@angular/cdk/text-field';
34
+ import { TextFieldModule } from '@angular/cdk/text-field';
35
+ import * as i2$1 from '@angular/material/input';
36
+ import { MatInputModule } from '@angular/material/input';
37
+ import * as i1$1 from '@angular/material/form-field';
38
+ import { MatFormFieldModule } from '@angular/material/form-field';
39
+ import * as i3$3 from '@angular/material/snack-bar';
40
+ import { MatSnackBar } from '@angular/material/snack-bar';
41
+ import * as i4 from '@angular/material/progress-bar';
42
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
43
+ import { first, remove, findLastIndex } from 'lodash';
44
+ import { AuthService, AuthUserService } from '@rolatech/angular-auth';
45
+ import { CommentsComponent } from '@rolatech/angular-comment';
46
+
47
+ var CourseStatus;
48
+ (function (CourseStatus) {
49
+ CourseStatus[CourseStatus["ACTIVE"] = '已发布'] = "ACTIVE";
50
+ CourseStatus[CourseStatus["ACCEPTED"] = '已通过'] = "ACCEPTED";
51
+ CourseStatus[CourseStatus["AWAITING"] = '审核中'] = "AWAITING";
52
+ CourseStatus[CourseStatus["PENDING"] = '审核中'] = "PENDING";
53
+ CourseStatus[CourseStatus["STARTED"] = '已开始'] = "STARTED";
54
+ CourseStatus[CourseStatus["ENDED"] = '已完成'] = "ENDED";
55
+ CourseStatus[CourseStatus["DELETED"] = '已删除'] = "DELETED";
56
+ CourseStatus[CourseStatus["DRAFT"] = '草稿'] = "DRAFT";
57
+ })(CourseStatus || (CourseStatus = {}));
58
+ var CourseRequestStatus;
59
+ (function (CourseRequestStatus) {
60
+ CourseRequestStatus["AWAITING"] = "\u5BA1\u6838\u4E2D";
61
+ CourseRequestStatus["ACTIVE"] = "\u5DF2\u901A\u8FC7";
62
+ CourseRequestStatus["REJECTED"] = "\u5DF2\u62D2\u7EDD";
63
+ })(CourseRequestStatus || (CourseRequestStatus = {}));
64
+ var CourseReviewStatus;
65
+ (function (CourseReviewStatus) {
66
+ CourseReviewStatus["ACCEPTED"] = "\u5DF2\u901A\u8FC7";
67
+ CourseReviewStatus["REJECTED"] = "\u672A\u901A\u8FC7";
68
+ })(CourseReviewStatus || (CourseReviewStatus = {}));
69
+ var CourseSectionLectureContentType;
70
+ (function (CourseSectionLectureContentType) {
71
+ CourseSectionLectureContentType[CourseSectionLectureContentType["VIDEO"] = '视频'] = "VIDEO";
72
+ CourseSectionLectureContentType[CourseSectionLectureContentType["ARTICLE"] = '文章'] = "ARTICLE";
73
+ })(CourseSectionLectureContentType || (CourseSectionLectureContentType = {}));
74
+ // export const CourseType = [
75
+ // {
76
+ // key: 'ONLINE',
77
+ // value: '线上',
78
+ // },
79
+ // {
80
+ // key: 'OFFLINE',
81
+ // value: '线下',
82
+ // },
83
+ // {
84
+ // key: 'MIXED',
85
+ // value: '混合',
86
+ // },
87
+ // ];
88
+ var CourseType;
89
+ (function (CourseType) {
90
+ CourseType[CourseType["ONLINE"] = '线上'] = "ONLINE";
91
+ CourseType[CourseType["OFFLINE"] = '线下'] = "OFFLINE";
92
+ CourseType[CourseType["MIXED"] = '混合'] = "MIXED";
93
+ })(CourseType || (CourseType = {}));
94
+ const ScheduleDate = [
95
+ '00:00',
96
+ '00:15',
97
+ '00:30',
98
+ '00:45',
99
+ '01:00',
100
+ '01:15',
101
+ '01:30',
102
+ '01:45',
103
+ '02:00',
104
+ '02:15',
105
+ '02:30',
106
+ '02:45',
107
+ '03:00',
108
+ '03:15',
109
+ '03:30',
110
+ '03:45',
111
+ '04:00',
112
+ '04:15',
113
+ '04:30',
114
+ '04:45',
115
+ '05:00',
116
+ '05:15',
117
+ '05:30',
118
+ '05:45',
119
+ '06:00',
120
+ '06:15',
121
+ '06:30',
122
+ '06:45',
123
+ '07:00',
124
+ '07:15',
125
+ '07:30',
126
+ '07:45',
127
+ '08:00',
128
+ '08:15',
129
+ '08:30',
130
+ '08:45',
131
+ '09:00',
132
+ '09:15',
133
+ '09:30',
134
+ '09:45',
135
+ '10:00',
136
+ '10:15',
137
+ '10:30',
138
+ '10:45',
139
+ '11:00',
140
+ '11:15',
141
+ '11:30',
142
+ '11:45',
143
+ '12:00',
144
+ '12:15',
145
+ '12:30',
146
+ '12:45',
147
+ '13:00',
148
+ '13:15',
149
+ '13:30',
150
+ '13:45',
151
+ '14:00',
152
+ '14:15',
153
+ '14:30',
154
+ '14:45',
155
+ '15:00',
156
+ '15:15',
157
+ '15:30',
158
+ '15:45',
159
+ '16:00',
160
+ '16:15',
161
+ '16:30',
162
+ '16:45',
163
+ '17:00',
164
+ '17:15',
165
+ '17:30',
166
+ '17:45',
167
+ '18:00',
168
+ '18:15',
169
+ '18:30',
170
+ '18:45',
171
+ '19:00',
172
+ '19:15',
173
+ '19:30',
174
+ '19:45',
175
+ '20:00',
176
+ '20:15',
177
+ '20:30',
178
+ '20:45',
179
+ '21:00',
180
+ '21:15',
181
+ '21:30',
182
+ '21:45',
183
+ '22:00',
184
+ '22:15',
185
+ '22:30',
186
+ '22:45',
187
+ '23:00',
188
+ '23:15',
189
+ '23:30',
190
+ '23:45',
191
+ ];
192
+
193
+ class CourseService extends BaseService {
194
+ init() {
195
+ this.endpoint = 'courses';
196
+ super.init();
197
+ }
198
+ me(options) {
199
+ return this.http.get(`${this.actionUrl}/me`, {
200
+ params: options,
201
+ withCredentials: true,
202
+ });
203
+ }
204
+ findSchedule(id) {
205
+ return this.http.get(`${this.actionUrl}/${id}/schedule`, {
206
+ withCredentials: true,
207
+ });
208
+ }
209
+ findPricing(id) {
210
+ return this.http.get(`${this.actionUrl}/${id}/pricing`, {
211
+ withCredentials: true,
212
+ });
213
+ }
214
+ addDetail(id, data) {
215
+ return this.http.post(`${this.actionUrl}/${id}/details`, data, {
216
+ withCredentials: true,
217
+ });
218
+ }
219
+ addBatchDetails(id, data) {
220
+ return this.http.post(`${this.actionUrl}/${id}/details/batch`, data, {
221
+ withCredentials: true,
222
+ });
223
+ }
224
+ findDetails(id) {
225
+ return this.http.get(`${this.actionUrl}/${id}/details`, {
226
+ withCredentials: true,
227
+ });
228
+ }
229
+ updateDetail(id, detailId, data) {
230
+ return this.http.put(`${this.actionUrl}/${id}/details/${detailId}`, data, {
231
+ withCredentials: true,
232
+ });
233
+ }
234
+ deleteDetail(id, detailId) {
235
+ return this.http.delete(`${this.actionUrl}/${id}/details/${detailId}`, {
236
+ withCredentials: true,
237
+ });
238
+ }
239
+ uploadDetailMedia(id, detailId, data) {
240
+ return this.http.post(`${this.actionUrl}/${id}/details/${detailId}/media`, data, {
241
+ withCredentials: true,
242
+ });
243
+ }
244
+ deleteDetailMedia(id, detailId, mediaId) {
245
+ return this.http.delete(`${this.actionUrl}/${id}/details/${detailId}/media/${mediaId}`, {
246
+ withCredentials: true,
247
+ });
248
+ }
249
+ review(id) {
250
+ return this.http.post(`${this.actionUrl}/${id}/review`, {}, {
251
+ withCredentials: true,
252
+ });
253
+ }
254
+ start(id) {
255
+ return this.http.post(`${this.actionUrl}/${id}/start`, {}, {
256
+ withCredentials: true,
257
+ });
258
+ }
259
+ finish(id) {
260
+ return this.http.post(`${this.actionUrl}/${id}/finish`, {}, {
261
+ withCredentials: true,
262
+ });
263
+ }
264
+ publish(id) {
265
+ return this.http.post(`${this.actionUrl}/${id}/publish`, {}, {
266
+ withCredentials: true,
267
+ });
268
+ }
269
+ upload(data) {
270
+ return this.http.post(`${this.actionUrl}/upload`, data, {
271
+ withCredentials: true,
272
+ });
273
+ }
274
+ uploadMedia(id, data) {
275
+ return this.http.post(`${this.actionUrl}/${id}/media`, data, {
276
+ withCredentials: true,
277
+ });
278
+ }
279
+ deleteMedia(id, mediaId) {
280
+ return this.http.delete(`${this.actionUrl}/${id}/media/${mediaId}`, {
281
+ withCredentials: true,
282
+ });
283
+ }
284
+ importFromExcel(data) {
285
+ return this.http.post(`${this.actionUrl}/excel`, data, {
286
+ withCredentials: true,
287
+ });
288
+ }
289
+ createFromExcel(data) {
290
+ return this.http.post(`${this.actionUrl}/list`, data, {
291
+ withCredentials: true,
292
+ });
293
+ }
294
+ findAllRequests(options) {
295
+ return this.http.get(`${this.actionUrl}/requests`, {
296
+ params: options,
297
+ withCredentials: true,
298
+ });
299
+ }
300
+ findRequestDetail(id) {
301
+ return this.http.get(`${this.actionUrl}/requests/${id}`, {
302
+ withCredentials: true,
303
+ });
304
+ }
305
+ accept(id) {
306
+ return this.http.post(`${this.actionUrl}/${id}/reviews/accept`, {}, {
307
+ withCredentials: true,
308
+ });
309
+ }
310
+ reject(id, body) {
311
+ return this.http.post(`${this.actionUrl}/${id}/reviews/reject`, body, {
312
+ withCredentials: true,
313
+ });
314
+ }
315
+ acceptRequest(id) {
316
+ return this.http.post(`${this.actionUrl}/requests/${id}/reviews/accept`, {}, {
317
+ withCredentials: true,
318
+ });
319
+ }
320
+ rejectRequest(id, body) {
321
+ return this.http.post(`${this.actionUrl}/requests/${id}/reviews/reject`, body, {
322
+ withCredentials: true,
323
+ });
324
+ }
325
+ addPricing(id, data) {
326
+ return this.http.post(`${this.actionUrl}/${id}/pricing`, data, {
327
+ withCredentials: true,
328
+ });
329
+ }
330
+ updatePricing(id, pricingId, data) {
331
+ return this.http.put(`${this.actionUrl}/${id}/pricing/${pricingId}`, data, {
332
+ withCredentials: true,
333
+ });
334
+ }
335
+ deletePricing(id, pricingId) {
336
+ return this.http.delete(`${this.actionUrl}/${id}/pricing/${pricingId}`, {
337
+ withCredentials: true,
338
+ });
339
+ }
340
+ addSchedule(id, data) {
341
+ return this.http.post(`${this.actionUrl}/${id}/schedule`, data, {
342
+ withCredentials: true,
343
+ });
344
+ }
345
+ updateSchedule(id, scheduleId, data) {
346
+ return this.http.put(`${this.actionUrl}/${id}/schedule/${scheduleId}`, data, {
347
+ withCredentials: true,
348
+ });
349
+ }
350
+ deleteSchedule(id, scheduleId) {
351
+ return this.http.delete(`${this.actionUrl}/${id}/schedule/${scheduleId}`, {
352
+ withCredentials: true,
353
+ });
354
+ }
355
+ findAllReviews(options) {
356
+ return this.http.get(`${this.actionUrl}/reviews`, {
357
+ params: options,
358
+ withCredentials: true,
359
+ });
360
+ }
361
+ getReview(id) {
362
+ return this.http.get(`${this.actionUrl}/reviews/${id}`, {
363
+ withCredentials: true,
364
+ });
365
+ }
366
+ findReviews(options) {
367
+ return this.http.get(`${this.actionUrl}/reviews/me`, {
368
+ params: options,
369
+ withCredentials: true,
370
+ });
371
+ }
372
+ countUsers(options) {
373
+ return this.http.get(`${this.actionUrl}/users/count/by`, {
374
+ params: options,
375
+ withCredentials: true,
376
+ });
377
+ }
378
+ findByIds(ids) {
379
+ return this.http.get(`${this.actionUrl}/by`, {
380
+ params: { ids },
381
+ withCredentials: true,
382
+ });
383
+ }
384
+ findWishlist(options) {
385
+ return this.http.get(`${this.actionUrl}/wishlist`, { params: options, withCredentials: true });
386
+ }
387
+ addToWishlist(courseId) {
388
+ return this.http.post(`${this.actionUrl}/${courseId}/wishlist`, {}, { withCredentials: true });
389
+ }
390
+ removeFromWishlist(courseId) {
391
+ return this.http.delete(`${this.actionUrl}/${courseId}/wishlist`, { withCredentials: true });
392
+ }
393
+ findWishlistBy(courseId) {
394
+ return this.http.get(`${this.actionUrl}/${courseId}/wishlist/by`, { withCredentials: true });
395
+ }
396
+ findMyCourses(options) {
397
+ return this.http.get(`${this.actionUrl}/users`, { params: options, withCredentials: true });
398
+ }
399
+ findPurchasedByCourseId(courseId) {
400
+ return this.http.get(`${this.actionUrl}/users/me/by?courseId=${courseId}`, {
401
+ withCredentials: true,
402
+ });
403
+ }
404
+ deleteFromWishlist(sectionId) {
405
+ return this.http.delete(`${this.actionUrl}/sections/${sectionId}`, { withCredentials: true });
406
+ }
407
+ // Course sections
408
+ findCourseSections(options) {
409
+ return this.http.get(`${this.actionUrl}/sections`, { params: options, withCredentials: false });
410
+ }
411
+ addCourseSection(courseId, data) {
412
+ return this.http.post(`${this.actionUrl}/${courseId}/sections`, data, { withCredentials: true });
413
+ }
414
+ updateCourseSection(sectionId, data) {
415
+ return this.http.put(`${this.actionUrl}/sections/${sectionId}`, data, { withCredentials: true });
416
+ }
417
+ deleteCourseSection(sectionId) {
418
+ return this.http.delete(`${this.actionUrl}/sections/${sectionId}`, { withCredentials: true });
419
+ }
420
+ getCourseSection(courseId) {
421
+ return this.http.get(`${this.actionUrl}/${courseId}/sections`, { withCredentials: false });
422
+ }
423
+ addLecture(sectionId, data) {
424
+ return this.http.post(`${this.actionUrl}/sections/${sectionId}/lectures`, data, { withCredentials: true });
425
+ }
426
+ updateLecture(lectureId, data) {
427
+ return this.http.put(`${this.actionUrl}/sections/lectures/${lectureId}`, data, { withCredentials: true });
428
+ }
429
+ deleteLecture(lectureId) {
430
+ return this.http.delete(`${this.actionUrl}/sections/lectures/${lectureId}`, { withCredentials: true });
431
+ }
432
+ uploadVideoInit(lectureId, data) {
433
+ return this.http.post(`${this.actionUrl}/sections/lectures/${lectureId}/videos/init`, data, {
434
+ withCredentials: true,
435
+ });
436
+ }
437
+ uploadVideoPartsToLecture(lectureId, data) {
438
+ return this.http.post(`${this.actionUrl}/sections/lectures/${lectureId}/videos/parts`, data, {
439
+ withCredentials: true,
440
+ });
441
+ }
442
+ completePartUpload(lectureId, data) {
443
+ return this.http.put(`${this.actionUrl}/sections/lectures/${lectureId}/videos/parts`, data, {
444
+ withCredentials: true,
445
+ });
446
+ }
447
+ uploadVideoToLecture(lectureId, data) {
448
+ return this.http.post(`${this.actionUrl}/sections/lectures/${lectureId}/videos`, data, {
449
+ withCredentials: true,
450
+ });
451
+ }
452
+ deleteLectureVideo(videoId) {
453
+ return this.http.delete(`${this.actionUrl}/sections/lectures/videos/${videoId}`, { withCredentials: true });
454
+ }
455
+ uploadLectureVideoThumbnail(videoId, data) {
456
+ return this.http.post(`${this.actionUrl}/sections/lectures/videos/${videoId}/thumbnail`, data, {
457
+ withCredentials: true,
458
+ });
459
+ }
460
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
461
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseService, providedIn: 'root' }); }
462
+ }
463
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseService, decorators: [{
464
+ type: Injectable,
465
+ args: [{
466
+ providedIn: 'root',
467
+ }]
468
+ }] });
469
+
470
+ class CourseSectionService extends BaseService {
471
+ init() {
472
+ this.endpoint = 'courses';
473
+ super.init();
474
+ }
475
+ findSections(id) {
476
+ return this.http.get(`${this.actionUrl}/${id}/sections`);
477
+ }
478
+ canBePreviewed(videoId, data) {
479
+ return this.http.post(`${this.actionUrl}/sections/lectures/videos/${videoId}/preview`, data, {
480
+ withCredentials: true,
481
+ });
482
+ }
483
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
484
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionService, providedIn: 'root' }); }
485
+ }
486
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionService, decorators: [{
487
+ type: Injectable,
488
+ args: [{
489
+ providedIn: 'root',
490
+ }]
491
+ }] });
492
+
493
+ class CategoryService extends BaseService {
494
+ init() {
495
+ this.endpoint = 'categories';
496
+ super.init();
497
+ }
498
+ uploadMedia(id, data) {
499
+ return this.http.post(`${this.actionUrl}/${id}/media`, data, {
500
+ withCredentials: true,
501
+ });
502
+ }
503
+ deleteMedia(id, mediaId) {
504
+ return this.http.delete(`${this.actionUrl}/${id}/media/${mediaId}`, {
505
+ withCredentials: true,
506
+ });
507
+ }
508
+ importFromExcel(data) {
509
+ return this.http.post(`${this.actionUrl}/excel`, data, {
510
+ withCredentials: true,
511
+ });
512
+ }
513
+ createFromExcel(data) {
514
+ return this.http.post(`${this.actionUrl}/list`, data, {
515
+ withCredentials: true,
516
+ });
517
+ }
518
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CategoryService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
519
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CategoryService, providedIn: 'root' }); }
520
+ }
521
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CategoryService, decorators: [{
522
+ type: Injectable,
523
+ args: [{
524
+ providedIn: 'root',
525
+ }]
526
+ }] });
527
+
528
+ const services = [CourseService, CourseSectionService, CategoryService];
529
+
530
+ function provideAngulaCourse() {
531
+ const providers = [
532
+ ...services,
533
+ importProvidersFrom(CommonModule, ReactiveFormsModule, FormsModule, RouterModule),
534
+ ];
535
+ return makeEnvironmentProviders(providers);
536
+ }
537
+
538
+ class CoursePreviewComponent {
539
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CoursePreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
540
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.1", type: CoursePreviewComponent, isStandalone: true, selector: "rolatech-course-preview", ngImport: i0, template: "<p>course-preview works!</p>\n", styles: [""] }); }
541
+ }
542
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CoursePreviewComponent, decorators: [{
543
+ type: Component,
544
+ args: [{ selector: 'rolatech-course-preview', standalone: true, imports: [], template: "<p>course-preview works!</p>\n" }]
545
+ }] });
546
+
547
+ class CourseInfoComponent {
548
+ constructor() {
549
+ this.course = input.required();
550
+ this.instructor = input();
551
+ this.username = input();
552
+ this.dataToDisplay = effect(() => {
553
+ return this.course();
554
+ });
555
+ }
556
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
557
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseInfoComponent, isStandalone: true, selector: "rolatech-course-info", inputs: { course: { classPropertyName: "course", publicName: "course", isSignal: true, isRequired: true, transformFunction: null }, instructor: { classPropertyName: "instructor", publicName: "instructor", isSignal: true, isRequired: false, transformFunction: null }, username: { classPropertyName: "username", publicName: "username", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div>\n <div>\n <div class=\"text-2xl font-medium\">{{ course().name }}</div>\n @if (course().type && course().type.toString() !== 'ONLINE') {\n <div class=\"flex items-center pt-2\">\n <mat-icon>place</mat-icon>\n <span class=\"text-sm opacity-75\">{{ course().classroom.address }}</span>\n </div>\n }\n <div class=\"py-3 text-black-light flex justify-between\">\n <div>\n <div class=\"mb-1 flex items-center\">\n <span class=\"font-medium\">\u4E3B\u8BB2\u6559\u5E08: </span>\n <a class=\"ml-2 underline text-orange-600 text-[0.9rem]\" [routerLink]=\"['/@' + username()]\">{{\n instructor()\n }}</a>\n </div>\n <span class=\"text-sm opacity-75\">\u6700\u540E\u7F16\u8F91: {{ course().updatedAt }} </span>\n </div>\n </div>\n </div>\n <!-- \u63CF\u8FF0 -->\n <div class=\"mb-3\">\n {{ course().description }}\n </div>\n</div>\n", styles: ["mat-icon{transform:scale(.8)}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: RouterModule }] }); }
558
+ }
559
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseInfoComponent, decorators: [{
560
+ type: Component,
561
+ args: [{ selector: 'rolatech-course-info', standalone: true, imports: [MatIconModule, RouterLink, RouterModule], template: "<div>\n <div>\n <div class=\"text-2xl font-medium\">{{ course().name }}</div>\n @if (course().type && course().type.toString() !== 'ONLINE') {\n <div class=\"flex items-center pt-2\">\n <mat-icon>place</mat-icon>\n <span class=\"text-sm opacity-75\">{{ course().classroom.address }}</span>\n </div>\n }\n <div class=\"py-3 text-black-light flex justify-between\">\n <div>\n <div class=\"mb-1 flex items-center\">\n <span class=\"font-medium\">\u4E3B\u8BB2\u6559\u5E08: </span>\n <a class=\"ml-2 underline text-orange-600 text-[0.9rem]\" [routerLink]=\"['/@' + username()]\">{{\n instructor()\n }}</a>\n </div>\n <span class=\"text-sm opacity-75\">\u6700\u540E\u7F16\u8F91: {{ course().updatedAt }} </span>\n </div>\n </div>\n </div>\n <!-- \u63CF\u8FF0 -->\n <div class=\"mb-3\">\n {{ course().description }}\n </div>\n</div>\n", styles: ["mat-icon{transform:scale(.8)}\n"] }]
562
+ }] });
563
+
564
+ class CourseMediaComponent {
565
+ constructor() {
566
+ this.dialog = inject(MatDialog);
567
+ this.media = input([]);
568
+ this.min = input(false);
569
+ this.mediaIndex = 0;
570
+ }
571
+ onImageClick(i) {
572
+ const dialogRef = this.dialog.open(ImagePreviewDialogComponent, {
573
+ maxWidth: '80vw',
574
+ maxHeight: '80vh',
575
+ height: '80%',
576
+ width: '80%',
577
+ panelClass: 'full-screen-modal',
578
+ data: {
579
+ media: this.media,
580
+ selected: i,
581
+ },
582
+ });
583
+ dialogRef.afterClosed().subscribe((result) => { });
584
+ }
585
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseMediaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
586
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseMediaComponent, isStandalone: true, selector: "rolatech-course-media", inputs: { media: { classPropertyName: "media", publicName: "media", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (media()) {\n @if (min()) {\n <div class=\"md:w-80 object-cover aspect-video bg-gray-200 rounded-lg\">\n @if (media()) {\n <rolatech-thumbnail [src]=\"media()[0].url\" size=\"small\"></rolatech-thumbnail>\n\n <!-- <img class=\"aspect-video object-cover w-full rounded-lg\" [src]=\"media()[0].url\" /> -->\n }\n </div>\n } @else {\n <div>\n <div class=\"object-cover aspect-video bg-gray-200\">\n <rolatech-thumbnail [src]=\"media()[mediaIndex].url\" size=\"small\"></rolatech-thumbnail>\n\n <!-- <img class=\"aspect-video object-cover w-full rounded-md\" [src]=\"media()[mediaIndex].url\" /> -->\n </div>\n @for (item of media(); track $index) {\n <div\n class=\"inline-flex flex-row mt-3 mr-3 cursor-pointer rounded-md\"\n (click)=\"mediaIndex = $index\"\n [ngClass]=\"mediaIndex === $index ? '' : 'opacity-30'\"\n >\n <rolatech-thumbnail [src]=\"item.url\" size=\"small\"></rolatech-thumbnail>\n\n <!-- <img class=\"rounded-md aspect-video object-cover w-32\" [src]=\"item.url\" /> -->\n </div>\n }\n </div>\n }\n}\n", styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ThumbnailComponent, selector: "rolatech-thumbnail", inputs: ["src", "size"] }] }); }
587
+ }
588
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseMediaComponent, decorators: [{
589
+ type: Component,
590
+ args: [{ selector: 'rolatech-course-media', standalone: true, imports: [NgClass, ThumbnailComponent], template: "@if (media()) {\n @if (min()) {\n <div class=\"md:w-80 object-cover aspect-video bg-gray-200 rounded-lg\">\n @if (media()) {\n <rolatech-thumbnail [src]=\"media()[0].url\" size=\"small\"></rolatech-thumbnail>\n\n <!-- <img class=\"aspect-video object-cover w-full rounded-lg\" [src]=\"media()[0].url\" /> -->\n }\n </div>\n } @else {\n <div>\n <div class=\"object-cover aspect-video bg-gray-200\">\n <rolatech-thumbnail [src]=\"media()[mediaIndex].url\" size=\"small\"></rolatech-thumbnail>\n\n <!-- <img class=\"aspect-video object-cover w-full rounded-md\" [src]=\"media()[mediaIndex].url\" /> -->\n </div>\n @for (item of media(); track $index) {\n <div\n class=\"inline-flex flex-row mt-3 mr-3 cursor-pointer rounded-md\"\n (click)=\"mediaIndex = $index\"\n [ngClass]=\"mediaIndex === $index ? '' : 'opacity-30'\"\n >\n <rolatech-thumbnail [src]=\"item.url\" size=\"small\"></rolatech-thumbnail>\n\n <!-- <img class=\"rounded-md aspect-video object-cover w-32\" [src]=\"item.url\" /> -->\n </div>\n }\n </div>\n }\n}\n" }]
591
+ }] });
592
+
593
+ class CoursePricingComponent {
594
+ constructor() {
595
+ this.pricing = input([]);
596
+ }
597
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CoursePricingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
598
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CoursePricingComponent, isStandalone: true, selector: "rolatech-course-pricing", inputs: { pricing: { classPropertyName: "pricing", publicName: "pricing", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (pricing()) {\n <div class=\"py-3\">\n <div class=\"text-lg font-medium py-2\">\u4EF7\u683C</div>\n @for (item of pricing(); track $index) {\n <div>\n <span>{{ item.min }} \u81F3 {{ item.max }}\u4EBA</span>\n <span class=\"ml-3\">{{ item.total / 100 }}\u5143</span>\n </div>\n }\n </div>\n}\n", styles: [""] }); }
599
+ }
600
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CoursePricingComponent, decorators: [{
601
+ type: Component,
602
+ args: [{ selector: 'rolatech-course-pricing', standalone: true, template: "@if (pricing()) {\n <div class=\"py-3\">\n <div class=\"text-lg font-medium py-2\">\u4EF7\u683C</div>\n @for (item of pricing(); track $index) {\n <div>\n <span>{{ item.min }} \u81F3 {{ item.max }}\u4EBA</span>\n <span class=\"ml-3\">{{ item.total / 100 }}\u5143</span>\n </div>\n }\n </div>\n}\n" }]
603
+ }] });
604
+
605
+ class CourseActionComponent {
606
+ constructor() {
607
+ this.course = input.required();
608
+ this.inWishList = input(false);
609
+ this.cart = output();
610
+ this.wish = output();
611
+ this.checkout = output();
612
+ }
613
+ onCart(course) {
614
+ this.cart.emit(course);
615
+ }
616
+ onWish(course) {
617
+ this.wish.emit(course);
618
+ }
619
+ onCheckout(course) {
620
+ this.checkout.emit(course);
621
+ }
622
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
623
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.0.1", type: CourseActionComponent, isStandalone: true, selector: "rolatech-course-action", inputs: { course: { classPropertyName: "course", publicName: "course", isSignal: true, isRequired: true, transformFunction: null }, inWishList: { classPropertyName: "inWishList", publicName: "inWishList", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cart: "cart", wish: "wish", checkout: "checkout" }, ngImport: i0, template: "<div class=\"flex flex-col\">\n <!-- <a class=\"p-3 bg-orange-600 text-white text-center mt-3\" target=\"_blank\" (click)=\"onCart(course)\">\u52A0\u5165\u8D2D\u7269\u8F66</a> -->\n <a mat-flat-button class=\"mt-3 min-h-11\" target=\"_blank\" (click)=\"onCheckout(course())\">\u7ACB\u5373\u8D2D\u4E70</a>\n <a mat-stroked-button class=\"mt-3 min-h-11\" target=\"_blank\" (click)=\"onWish(course())\">{{\n inWishList() ? '\u79FB\u9664\u6536\u85CF' : '\u52A0\u5165\u6536\u85CF'\n }}</a>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", exportAs: ["matButton", "matAnchor"] }] }); }
624
+ }
625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseActionComponent, decorators: [{
626
+ type: Component,
627
+ args: [{ standalone: true, selector: 'rolatech-course-action', imports: [MatButtonModule], template: "<div class=\"flex flex-col\">\n <!-- <a class=\"p-3 bg-orange-600 text-white text-center mt-3\" target=\"_blank\" (click)=\"onCart(course)\">\u52A0\u5165\u8D2D\u7269\u8F66</a> -->\n <a mat-flat-button class=\"mt-3 min-h-11\" target=\"_blank\" (click)=\"onCheckout(course())\">\u7ACB\u5373\u8D2D\u4E70</a>\n <a mat-stroked-button class=\"mt-3 min-h-11\" target=\"_blank\" (click)=\"onWish(course())\">{{\n inWishList() ? '\u79FB\u9664\u6536\u85CF' : '\u52A0\u5165\u6536\u85CF'\n }}</a>\n</div>\n" }]
628
+ }] });
629
+
630
+ class CourseScheduleComponent {
631
+ constructor() {
632
+ this.schedule = input([]);
633
+ }
634
+ ngOnInit() {
635
+ // this.formatSchedule();
636
+ }
637
+ formatSchedule() { }
638
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseScheduleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
639
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseScheduleComponent, isStandalone: true, selector: "rolatech-course-schedule", inputs: { schedule: { classPropertyName: "schedule", publicName: "schedule", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<!-- \u8BFE\u8868 -->\n@if (schedule()) {\n <div class=\"py-3\" id=\"schedule\">\n <div class=\"text-xl font-medium py-2\">\u8BFE\u8868</div>\n @for (item of schedule(); track $index) {\n <mat-expansion-panel #panel [class.mat-elevation-z0]=\"true\" hideToggle [expanded]=\"$index === 0\">\n <mat-expansion-panel-header class=\"bg-red\">\n <mat-panel-title>\n <span class=\"text-[1rem]\">{{ item.title }}</span>\n </mat-panel-title>\n <mat-icon\n class=\"toggle-icon\"\n style=\"transition-duration:.5s;transform: {{ panel.expanded ? 'rotate(180deg)' : 'rotate(0deg)' }};\"\n >expand_more</mat-icon\n >\n </mat-expansion-panel-header>\n <div class=\"bg-white\">\n <div class=\"text-gray-600 font-thin pt-2\">\n <span>{{ item.startAt }} - {{ item.endAt }}</span>\n </div>\n <div class=\"py-3\">\n <div>{{ item.content }}</div>\n </div>\n </div>\n </mat-expansion-panel>\n }\n </div>\n}\n", styles: ["mat-expansion-panel{margin:0!important}.mat-expansion-panel-header{padding:0 16px;background:#f3f4f6!important}.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:#dee0e2}.mat-expansion-panel-header{height:56px!important}.mat-expansion-panel .mat-expansion-panel-header{margin-bottom:8px;height:44px!important;padding:0 12px!important}.mat-expansion-panel-header .mat-expanded{height:56px!important}mat-expansion-panel .mat-expansion-panel-body{padding:0 8px 8px 4px!important}\n"], dependencies: [{ kind: "ngmodule", type: MatExpansionModule }, { kind: "component", type: i1.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i1.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i1.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
640
+ }
641
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseScheduleComponent, decorators: [{
642
+ type: Component,
643
+ args: [{ selector: 'rolatech-course-schedule', standalone: true, imports: [MatExpansionModule, MatIconModule], template: "<!-- \u8BFE\u8868 -->\n@if (schedule()) {\n <div class=\"py-3\" id=\"schedule\">\n <div class=\"text-xl font-medium py-2\">\u8BFE\u8868</div>\n @for (item of schedule(); track $index) {\n <mat-expansion-panel #panel [class.mat-elevation-z0]=\"true\" hideToggle [expanded]=\"$index === 0\">\n <mat-expansion-panel-header class=\"bg-red\">\n <mat-panel-title>\n <span class=\"text-[1rem]\">{{ item.title }}</span>\n </mat-panel-title>\n <mat-icon\n class=\"toggle-icon\"\n style=\"transition-duration:.5s;transform: {{ panel.expanded ? 'rotate(180deg)' : 'rotate(0deg)' }};\"\n >expand_more</mat-icon\n >\n </mat-expansion-panel-header>\n <div class=\"bg-white\">\n <div class=\"text-gray-600 font-thin pt-2\">\n <span>{{ item.startAt }} - {{ item.endAt }}</span>\n </div>\n <div class=\"py-3\">\n <div>{{ item.content }}</div>\n </div>\n </div>\n </mat-expansion-panel>\n }\n </div>\n}\n", styles: ["mat-expansion-panel{margin:0!important}.mat-expansion-panel-header{padding:0 16px;background:#f3f4f6!important}.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:#dee0e2}.mat-expansion-panel-header{height:56px!important}.mat-expansion-panel .mat-expansion-panel-header{margin-bottom:8px;height:44px!important;padding:0 12px!important}.mat-expansion-panel-header .mat-expanded{height:56px!important}mat-expansion-panel .mat-expansion-panel-body{padding:0 8px 8px 4px!important}\n"] }]
644
+ }] });
645
+
646
+ class CourseSectionsComponent {
647
+ constructor() {
648
+ this.purchased = input(false);
649
+ this.sections = input([]);
650
+ this.section = output();
651
+ this.checkout = output();
652
+ this.panelOpenState = false;
653
+ }
654
+ onSection(section, lecture) {
655
+ this.section.emit({ section, lecture });
656
+ }
657
+ onCheckout(section, lecture) {
658
+ this.checkout.emit({ section, lecture });
659
+ }
660
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
661
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseSectionsComponent, isStandalone: true, selector: "rolatech-course-sections", inputs: { purchased: { classPropertyName: "purchased", publicName: "purchased", isSignal: true, isRequired: false, transformFunction: null }, sections: { classPropertyName: "sections", publicName: "sections", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { section: "section", checkout: "checkout" }, ngImport: i0, template: "@if (sections()) {\n <div id=\"sections()\">\n <div class=\"text-2xl font-medium py-3 lg:pt-0\">\u8BFE\u7A0B\u5185\u5BB9</div>\n <mat-accordion multi>\n @for (item of sections(); track $index) {\n <mat-expansion-panel #panel [class.mat-elevation-z0]=\"true\" hideToggle [expanded]=\"$index === 0\">\n <mat-expansion-panel-header class=\"bg-red\">\n <mat-panel-title>\n <span class=\"text-[1rem]\">{{ item.title }}</span>\n </mat-panel-title>\n <mat-icon\n class=\"toggle-icon\"\n style=\"transition-duration:.5s;transform: {{ panel.expanded ? 'rotate(180deg)' : 'rotate(0deg)' }};\"\n >expand_more</mat-icon\n >\n </mat-expansion-panel-header>\n <div class=\"bg-white\">\n @for (lecture of item.lectures; track $index) {\n <div class=\"flex items-center justify-between py-1\">\n @if (lecture.item && lecture.type === 'VIDEO') {\n <div class=\"flex items-center gap-3\">\n <mat-icon>live_tv</mat-icon>\n <span class=\"text-md\"> {{ lecture.title }}</span>\n </div>\n <div>\n @if (purchased()) {\n <a\n class=\"text-sm mr-1 underline underline-offset-2 cursor-pointer text-orange-600\"\n (click)=\"onSection(item, lecture)\"\n >\u64AD\u653E</a\n >\n } @else {\n @if (lecture.item.canBePreviewed) {\n <a\n class=\"text-sm mr-1 underline underline-offset-2 cursor-pointer text-orange-600\"\n (click)=\"onSection(item, lecture)\"\n >\u8BD5\u770B</a\n >\n } @else {\n <a\n class=\"text-sm mr-1 underline underline-offset-2 cursor-pointer text-orange-600\"\n (click)=\"onCheckout(item, lecture)\"\n >\u8D2D\u4E70</a\n >\n }\n }\n\n <a class=\"text-gray-500 inline-block w-[60px] text-right\">{{ lecture.item.duration | duration }}</a>\n </div>\n }\n </div>\n }\n </div>\n </mat-expansion-panel>\n }\n </mat-accordion>\n </div>\n}\n", styles: ["mat-expansion-panel{margin:0!important}.mat-expansion-panel-header{padding:0 16px;background:#f3f4f6!important}.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:#dee0e2}.mat-expansion-panel-header{height:56px!important}.mat-expansion-panel .mat-expansion-panel-header{margin-bottom:8px;height:44px!important;padding:0 12px!important}.mat-expansion-panel-header .mat-expanded{height:56px!important}mat-expansion-panel .mat-expansion-panel-body{padding:0 8px 8px 4px!important}mat-expansion-panel mat-icon{transform:scale(.9)}\n"], dependencies: [{ kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i1.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i1.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i1.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i1.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: DurationPipe, name: "duration" }, { kind: "ngmodule", type: MatCheckboxModule }], encapsulation: i0.ViewEncapsulation.None }); }
662
+ }
663
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionsComponent, decorators: [{
664
+ type: Component,
665
+ args: [{ selector: 'rolatech-course-sections', encapsulation: ViewEncapsulation.None, standalone: true, imports: [MatExpansionModule, MatIconModule, DurationPipe, MatCheckboxModule], template: "@if (sections()) {\n <div id=\"sections()\">\n <div class=\"text-2xl font-medium py-3 lg:pt-0\">\u8BFE\u7A0B\u5185\u5BB9</div>\n <mat-accordion multi>\n @for (item of sections(); track $index) {\n <mat-expansion-panel #panel [class.mat-elevation-z0]=\"true\" hideToggle [expanded]=\"$index === 0\">\n <mat-expansion-panel-header class=\"bg-red\">\n <mat-panel-title>\n <span class=\"text-[1rem]\">{{ item.title }}</span>\n </mat-panel-title>\n <mat-icon\n class=\"toggle-icon\"\n style=\"transition-duration:.5s;transform: {{ panel.expanded ? 'rotate(180deg)' : 'rotate(0deg)' }};\"\n >expand_more</mat-icon\n >\n </mat-expansion-panel-header>\n <div class=\"bg-white\">\n @for (lecture of item.lectures; track $index) {\n <div class=\"flex items-center justify-between py-1\">\n @if (lecture.item && lecture.type === 'VIDEO') {\n <div class=\"flex items-center gap-3\">\n <mat-icon>live_tv</mat-icon>\n <span class=\"text-md\"> {{ lecture.title }}</span>\n </div>\n <div>\n @if (purchased()) {\n <a\n class=\"text-sm mr-1 underline underline-offset-2 cursor-pointer text-orange-600\"\n (click)=\"onSection(item, lecture)\"\n >\u64AD\u653E</a\n >\n } @else {\n @if (lecture.item.canBePreviewed) {\n <a\n class=\"text-sm mr-1 underline underline-offset-2 cursor-pointer text-orange-600\"\n (click)=\"onSection(item, lecture)\"\n >\u8BD5\u770B</a\n >\n } @else {\n <a\n class=\"text-sm mr-1 underline underline-offset-2 cursor-pointer text-orange-600\"\n (click)=\"onCheckout(item, lecture)\"\n >\u8D2D\u4E70</a\n >\n }\n }\n\n <a class=\"text-gray-500 inline-block w-[60px] text-right\">{{ lecture.item.duration | duration }}</a>\n </div>\n }\n </div>\n }\n </div>\n </mat-expansion-panel>\n }\n </mat-accordion>\n </div>\n}\n", styles: ["mat-expansion-panel{margin:0!important}.mat-expansion-panel-header{padding:0 16px;background:#f3f4f6!important}.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:#dee0e2}.mat-expansion-panel-header{height:56px!important}.mat-expansion-panel .mat-expansion-panel-header{margin-bottom:8px;height:44px!important;padding:0 12px!important}.mat-expansion-panel-header .mat-expanded{height:56px!important}mat-expansion-panel .mat-expansion-panel-body{padding:0 8px 8px 4px!important}mat-expansion-panel mat-icon{transform:scale(.9)}\n"] }]
666
+ }] });
667
+
668
+ class CourseSectionItemComponent {
669
+ constructor() {
670
+ this.section = model.required();
671
+ this.actions = model();
672
+ this.hasUnsaved = model();
673
+ this.editId = model();
674
+ this.save = output();
675
+ this.cancel = output();
676
+ this.delete = output();
677
+ this.edit = output();
678
+ this.addLecture = output();
679
+ this.editing = false;
680
+ this.isExpand = false;
681
+ }
682
+ ngOnInit() { }
683
+ onSave(section) {
684
+ this.editing = false;
685
+ this.editId.set(null);
686
+ this.save.emit(section);
687
+ }
688
+ onCancel(section) {
689
+ this.editing = false;
690
+ this.editId.set(null);
691
+ this.cancel.emit(section);
692
+ }
693
+ onDelete(section) {
694
+ this.delete.emit(section);
695
+ }
696
+ onEdit(section) {
697
+ this.editId.set(null);
698
+ this.editing = true;
699
+ this.edit.emit(section);
700
+ }
701
+ onAddLecture(section) {
702
+ this.addLecture.emit(section);
703
+ }
704
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
705
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseSectionItemComponent, isStandalone: true, selector: "rolatech-course-section-item", inputs: { section: { classPropertyName: "section", publicName: "section", isSignal: true, isRequired: true, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, hasUnsaved: { classPropertyName: "hasUnsaved", publicName: "hasUnsaved", isSignal: true, isRequired: false, transformFunction: null }, editId: { classPropertyName: "editId", publicName: "editId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { section: "sectionChange", actions: "actionsChange", hasUnsaved: "hasUnsavedChange", editId: "editIdChange", save: "save", cancel: "cancel", delete: "delete", edit: "edit", addLecture: "addLecture" }, ngImport: i0, template: "<div class=\"flex flex-col grow\">\n @if (section().id !== editId()) {\n <div>\n <div class=\"flex justify-between items-center cursor-pointer\" (click)=\"isExpand = !isExpand\">\n <div class=\"w-full flex items-center gap-3 pl-3\">\n <span>{{ section().title }}</span>\n <button mat-icon-button class=\"max-w-8 max-h-8 !p-1\" (click)=\"onEdit(section())\">\n <mat-icon>edit</mat-icon>\n </button>\n <button mat-icon-button class=\"max-w-8 max-h-8 !p-1\" (click)=\"onDelete(section())\">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n <!-- <rolatech-icon-button (click)=\"isExpand = !isExpand\">{{\n isExpand ? 'expand_less' : 'expand_more'\n }}</rolatech-icon-button> -->\n <button mat-icon-button class=\"max-w-8 max-h-8 !p-1\">\n <mat-icon>{{ isExpand ? 'expand_less' : 'expand_more' }}</mat-icon>\n </button>\n </div>\n @if (isExpand) {\n <div>\n <ng-content></ng-content>\n </div>\n }\n </div>\n } @else {\n <div class=\"flex flex-col justify-between items-center\">\n <input\n type=\"text\"\n class=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-md focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\"\n placeholder=\"\u6807\u9898\"\n [(ngModel)]=\"section().title\"\n />\n <div class=\"w-full flex flex-row justify-end p-4 gap-3\">\n <button mat-button (click)=\"onCancel(section())\">\u53D6\u6D88</button>\n <button mat-flat-button color=\"primary\" (click)=\"onSave(section())\">\u4FDD\u5B58</button>\n </div>\n </div>\n }\n <!-- <mat-form-field appearance=\"fill\">\n <mat-label>\u63CF\u8FF0</mat-label>\n <input matInput placeholder=\"\u63CF\u8FF0\" [(ngModel)]=\"section.description\" />\n </mat-form-field> -->\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] }); }
706
+ }
707
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionItemComponent, decorators: [{
708
+ type: Component,
709
+ args: [{ selector: 'rolatech-course-section-item', standalone: true, imports: [MatIconModule, FormsModule, MatButtonModule, IconButtonComponent], template: "<div class=\"flex flex-col grow\">\n @if (section().id !== editId()) {\n <div>\n <div class=\"flex justify-between items-center cursor-pointer\" (click)=\"isExpand = !isExpand\">\n <div class=\"w-full flex items-center gap-3 pl-3\">\n <span>{{ section().title }}</span>\n <button mat-icon-button class=\"max-w-8 max-h-8 !p-1\" (click)=\"onEdit(section())\">\n <mat-icon>edit</mat-icon>\n </button>\n <button mat-icon-button class=\"max-w-8 max-h-8 !p-1\" (click)=\"onDelete(section())\">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n <!-- <rolatech-icon-button (click)=\"isExpand = !isExpand\">{{\n isExpand ? 'expand_less' : 'expand_more'\n }}</rolatech-icon-button> -->\n <button mat-icon-button class=\"max-w-8 max-h-8 !p-1\">\n <mat-icon>{{ isExpand ? 'expand_less' : 'expand_more' }}</mat-icon>\n </button>\n </div>\n @if (isExpand) {\n <div>\n <ng-content></ng-content>\n </div>\n }\n </div>\n } @else {\n <div class=\"flex flex-col justify-between items-center\">\n <input\n type=\"text\"\n class=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-md focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\"\n placeholder=\"\u6807\u9898\"\n [(ngModel)]=\"section().title\"\n />\n <div class=\"w-full flex flex-row justify-end p-4 gap-3\">\n <button mat-button (click)=\"onCancel(section())\">\u53D6\u6D88</button>\n <button mat-flat-button color=\"primary\" (click)=\"onSave(section())\">\u4FDD\u5B58</button>\n </div>\n </div>\n }\n <!-- <mat-form-field appearance=\"fill\">\n <mat-label>\u63CF\u8FF0</mat-label>\n <input matInput placeholder=\"\u63CF\u8FF0\" [(ngModel)]=\"section.description\" />\n </mat-form-field> -->\n</div>\n" }]
710
+ }] });
711
+
712
+ const MY_FORMATS = {
713
+ parse: {
714
+ dateInput: 'YYYY-MM-DD',
715
+ },
716
+ display: {
717
+ dateInput: 'YYYY-MM-DD',
718
+ monthYearLabel: 'MMM YYYY',
719
+ dateA11yLabel: 'YYYY-MM-DD',
720
+ monthYearA11yLabel: 'MMMM YYYY',
721
+ },
722
+ };
723
+ class ScheduleItemComponent {
724
+ constructor() {
725
+ this.value = input();
726
+ this.actions = input(false);
727
+ this.delete = output();
728
+ this.save = output();
729
+ this.date = ScheduleDate;
730
+ this.schedule = effect(() => {
731
+ this.schedule = this.value();
732
+ this.schedule.startDate = moment(this.schedule.startAt).format('YYYY-MM-DD');
733
+ this.schedule.startTime = moment(this.schedule.startAt).format('HH:mm');
734
+ this.schedule.endDate = moment(this.schedule.endAt).format('YYYY-MM-DD');
735
+ this.schedule.endTime = moment(this.schedule.endAt).format('HH:mm');
736
+ });
737
+ }
738
+ // constructor() {
739
+ // this.schedule = this.value();
740
+ // }
741
+ ngOnInit() {
742
+ // this.schedule = computed(() => {
743
+ // console.log(this.value());
744
+ // return this.value();
745
+ // })();
746
+ // this.schedule = this.value();
747
+ // this.schedule.startDate = moment(this.schedule.startAt).format('YYYY-MM-DD');
748
+ // this.schedule.startTime = moment(this.schedule.startAt).format('HH:mm');
749
+ // this.schedule.endDate = moment(this.schedule.endAt).format('YYYY-MM-DD');
750
+ // this.schedule.endTime = moment(this.schedule.endAt).format('HH:mm');
751
+ }
752
+ ngOnDestroy() {
753
+ const { startAt, endAt, startTime, startDate, endDate, endTime } = this.schedule;
754
+ this.schedule.startAt = this.schedule.startDate + ' ' + this.schedule.startTime;
755
+ this.schedule.endAt = this.schedule.endDate + ' ' + this.schedule.endTime;
756
+ delete this.schedule.startDate;
757
+ delete this.schedule.startTime;
758
+ delete this.schedule.endDate;
759
+ delete this.schedule.endTime;
760
+ }
761
+ startDateChanged(event) { }
762
+ startTimeChanged(event) { }
763
+ endDateChanged(event) { }
764
+ endTimeChanged(event) { }
765
+ onSave(schedule) {
766
+ this.format();
767
+ this.save.emit(schedule);
768
+ }
769
+ onDelete(schedule) {
770
+ this.delete.emit(schedule);
771
+ }
772
+ format() {
773
+ this.schedule.startAt = this.schedule.startDate + ' ' + this.schedule.startTime;
774
+ this.schedule.endAt = this.schedule.endDate + ' ' + this.schedule.endTime;
775
+ }
776
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ScheduleItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
777
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: ScheduleItemComponent, isStandalone: true, selector: "rolatech-schedule-item", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { delete: "delete", save: "save" }, providers: [
778
+ {
779
+ provide: DateAdapter,
780
+ useClass: MomentDateAdapter,
781
+ deps: [MAT_DATE_LOCALE],
782
+ },
783
+ { provide: MAT_DATE_FORMATS, useValue: MY_FORMATS },
784
+ DatePipe,
785
+ ], ngImport: i0, template: "<div class=\"flex flex-col py-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label> \u6807\u9898 </mat-label>\n <input matInput type=\"text\" [(ngModel)]=\"schedule.title\" name=\"title\" required />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label> \u5185\u5BB9 </mat-label>\n <textarea\n matInput\n type=\"text\"\n [(ngModel)]=\"schedule.content\"\n name=\"content\"\n cdkTextareaAutosize\n cdkAutosizeMinRows=\"3\"\n required\n ></textarea>\n </mat-form-field>\n <div class=\"flex flex-row gap-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label>\u5F00\u59CB\u65E5\u671F</mat-label>\n <input\n matInput\n [matDatepicker]=\"picker\"\n (focus)=\"picker.open()\"\n name=\"startAt\"\n [(ngModel)]=\"schedule.startDate\"\n (ngModelChange)=\"startDateChanged($event)\"\n (dateInput)=\"schedule.startDate = $event.value.format('YYYY-MM-DD')\"\n readonly\n required\n />\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label>\u5F00\u59CB\u65F6\u95F4</mat-label>\n <mat-select [(ngModel)]=\"schedule.startTime\" (selectionChange)=\"startTimeChanged($event)\" required readonly>\n @for (d of date; track d) {\n <mat-option [value]=\"d\">\n {{ d }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"flex flex-row gap-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label>\u7ED3\u675F\u65E5\u671F</mat-label>\n <input\n matInput\n [matDatepicker]=\"picker2\"\n name=\"endAt\"\n (focus)=\"picker2.open()\"\n (ngModelChange)=\"endDateChanged($event)\"\n [(ngModel)]=\"schedule.endDate\"\n (dateInput)=\"schedule.endDate = $event.value.format('YYYY-MM-DD')\"\n readonly\n required\n />\n <mat-datepicker-toggle matIconSuffix [for]=\"picker2\"></mat-datepicker-toggle>\n <mat-datepicker #picker2></mat-datepicker>\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label>\u7ED3\u675F\u65F6\u95F4</mat-label>\n <mat-select [(ngModel)]=\"schedule.endTime\" (selectionChange)=\"endTimeChanged($event)\" required readonly>\n @for (d of date; track d) {\n <mat-option [value]=\"d\">\n {{ d }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n</div>\n@if (actions()) {\n <div class=\"flex flex-row justify-end p-4\">\n <button mat-button (click)=\"onDelete(schedule)\">\u5220\u9664</button>\n <button mat-button (click)=\"onSave(schedule)\">\u4FDD\u5B58</button>\n </div>\n}\n<mat-divider></mat-divider>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3$1.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TextFieldModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i5.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i5.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i5.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i6$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i5$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }] }); }
786
+ }
787
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ScheduleItemComponent, decorators: [{
788
+ type: Component,
789
+ args: [{ selector: 'rolatech-schedule-item', providers: [
790
+ {
791
+ provide: DateAdapter,
792
+ useClass: MomentDateAdapter,
793
+ deps: [MAT_DATE_LOCALE],
794
+ },
795
+ { provide: MAT_DATE_FORMATS, useValue: MY_FORMATS },
796
+ DatePipe,
797
+ ], standalone: true, imports: [
798
+ NgClass,
799
+ MatFormFieldModule,
800
+ MatInputModule,
801
+ FormsModule,
802
+ TextFieldModule,
803
+ MatDatepickerModule,
804
+ MatSelectModule,
805
+ MatOptionModule,
806
+ MatButtonModule,
807
+ MatDividerModule,
808
+ ], template: "<div class=\"flex flex-col py-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label> \u6807\u9898 </mat-label>\n <input matInput type=\"text\" [(ngModel)]=\"schedule.title\" name=\"title\" required />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label> \u5185\u5BB9 </mat-label>\n <textarea\n matInput\n type=\"text\"\n [(ngModel)]=\"schedule.content\"\n name=\"content\"\n cdkTextareaAutosize\n cdkAutosizeMinRows=\"3\"\n required\n ></textarea>\n </mat-form-field>\n <div class=\"flex flex-row gap-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label>\u5F00\u59CB\u65E5\u671F</mat-label>\n <input\n matInput\n [matDatepicker]=\"picker\"\n (focus)=\"picker.open()\"\n name=\"startAt\"\n [(ngModel)]=\"schedule.startDate\"\n (ngModelChange)=\"startDateChanged($event)\"\n (dateInput)=\"schedule.startDate = $event.value.format('YYYY-MM-DD')\"\n readonly\n required\n />\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label>\u5F00\u59CB\u65F6\u95F4</mat-label>\n <mat-select [(ngModel)]=\"schedule.startTime\" (selectionChange)=\"startTimeChanged($event)\" required readonly>\n @for (d of date; track d) {\n <mat-option [value]=\"d\">\n {{ d }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"flex flex-row gap-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label>\u7ED3\u675F\u65E5\u671F</mat-label>\n <input\n matInput\n [matDatepicker]=\"picker2\"\n name=\"endAt\"\n (focus)=\"picker2.open()\"\n (ngModelChange)=\"endDateChanged($event)\"\n [(ngModel)]=\"schedule.endDate\"\n (dateInput)=\"schedule.endDate = $event.value.format('YYYY-MM-DD')\"\n readonly\n required\n />\n <mat-datepicker-toggle matIconSuffix [for]=\"picker2\"></mat-datepicker-toggle>\n <mat-datepicker #picker2></mat-datepicker>\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label>\u7ED3\u675F\u65F6\u95F4</mat-label>\n <mat-select [(ngModel)]=\"schedule.endTime\" (selectionChange)=\"endTimeChanged($event)\" required readonly>\n @for (d of date; track d) {\n <mat-option [value]=\"d\">\n {{ d }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n</div>\n@if (actions()) {\n <div class=\"flex flex-row justify-end p-4\">\n <button mat-button (click)=\"onDelete(schedule)\">\u5220\u9664</button>\n <button mat-button (click)=\"onSave(schedule)\">\u4FDD\u5B58</button>\n </div>\n}\n<mat-divider></mat-divider>\n" }]
809
+ }] });
810
+
811
+ class CourseSectionLectureVideoDialogComponent {
812
+ constructor(dialogRef, data) {
813
+ this.dialogRef = dialogRef;
814
+ this.data = data;
815
+ this.thumbnailUpload = output();
816
+ this.courseService = inject(CourseService);
817
+ this.courseSectionService = inject(CourseSectionService);
818
+ this.snackBar = inject(MatSnackBar);
819
+ this.platformId = inject(PLATFORM_ID);
820
+ this.el = inject(ElementRef);
821
+ this.lecture = data.data;
822
+ }
823
+ ngAfterViewInit() {
824
+ this.initPlayer(this.lecture.item.url, this.lecture.item.thumbnail);
825
+ }
826
+ close() {
827
+ this.dialogRef.close();
828
+ }
829
+ initPlayer(url, thumbnail) {
830
+ if (!isPlatformBrowser(this.platformId)) {
831
+ return;
832
+ }
833
+ // 'https://cos-video-1258344699.cos.ap-guangzhou.tencentcos.cn/test.mp4',
834
+ if (!this.player) {
835
+ const playerContainer = this.el.nativeElement.querySelector('#dplayer');
836
+ this.player = new DPlayer({
837
+ container: playerContainer,
838
+ screenshot: true,
839
+ preload: 'metadata',
840
+ video: {
841
+ url: url,
842
+ pic: thumbnail,
843
+ },
844
+ });
845
+ // this.player.on('loadedmetadata', () => {
846
+ // console.log('Video duration:', this.player.video.duration);
847
+ // });
848
+ }
849
+ }
850
+ ngOnInit() { }
851
+ ngOnDestroy() {
852
+ if (this.player) {
853
+ this.player.destroy();
854
+ }
855
+ }
856
+ onThumbnailUpload(event) {
857
+ const file = event.target.files[0];
858
+ if (file) {
859
+ const reader = new FileReader();
860
+ reader.readAsDataURL(file);
861
+ reader.onload = () => {
862
+ this.mediaSrc = reader.result;
863
+ const formData = new FormData();
864
+ formData.append('file', file);
865
+ this.courseService.uploadLectureVideoThumbnail(this.lecture.item.id, formData).subscribe({
866
+ next: (res) => {
867
+ this.lecture.item = res.data;
868
+ this.snackBar.open('上传成功');
869
+ this.player.switchVideo({
870
+ url: this.lecture.item.url,
871
+ pic: res.data.thumbnail,
872
+ });
873
+ },
874
+ });
875
+ };
876
+ reader.onerror = (error) => { };
877
+ }
878
+ }
879
+ onPreviewChange(event) {
880
+ this.courseSectionService.canBePreviewed(this.lecture.item.id, { canBePreviewed: event.checked }).subscribe({
881
+ next: (res) => {
882
+ this.lecture.item.canBePreviewed = res.data.canBePreviewed;
883
+ // this.lecture = res.data;
884
+ },
885
+ });
886
+ }
887
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionLectureVideoDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
888
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseSectionLectureVideoDialogComponent, isStandalone: true, selector: "rolatech-course-section-lecture-video-dialog", outputs: { thumbnailUpload: "thumbnailUpload" }, ngImport: i0, template: "<div class=\"flex flex-col-reverse sm:flex-row justify-between h-full gap-3\">\n <div class=\"w-full sm:w-1/2\">\n <div>\n <div class=\"py-3 flex flex-col\">\n <span class=\"text-lg font-bold\"> \u5C01\u9762 </span>\n <span class=\"text-sm\">\u4E00\u4E2A\u597D\u7684\u5C01\u9762\u53EF\u4EE5\u5F15\u8D77\u66F4\u591A\u7684\u5173\u6CE8</span>\n </div>\n\n <div class=\"flex gap-3\">\n <div\n class=\"p-3 w-36 flex flex-col items-center justify-center outline-dashed outline-1 rounded cursor-pointer\"\n (click)=\"fileInput.click()\"\n >\n <mat-icon>upload</mat-icon>\n <span class=\"text-sm\">\u4E0A\u4F20\u5C01\u9762</span>\n </div>\n <input type=\"file\" accept=\"image/*\" (change)=\"onThumbnailUpload($event)\" #fileInput style=\"display: none\" />\n @if (lecture.item.thumbnail) {\n <div class=\"aspect-video w-32 h-auto bg-black\">\n <img [src]=\"lecture.item.thumbnail\" class=\"aspect-video object-contain\" />\n </div>\n } @else {\n <div class=\"aspect-video w-32 h-auto\">\n <img [src]=\"mediaSrc\" class=\"aspect-video object-contain\" />\n </div>\n }\n </div>\n </div>\n <div class=\"mt-3\">\n <div class=\"py-3 flex flex-col\">\n <span class=\"text-lg font-bold\"> \u8BD5\u770B\u5185\u5BB9 </span>\n <span class=\"text-sm\">\u5C11\u91CF\u7684\u8BD5\u770B\u5185\u5BB9, \u53EF\u4EE5\u589E\u52A0\u8D2D\u4E70\u7387</span>\n </div>\n <mat-checkbox color=\"primary\" (change)=\"onPreviewChange($event)\" [checked]=\"lecture.item.canBePreviewed\"\n >\u5141\u8BB8\u8BD5\u770B</mat-checkbox\n >\n </div>\n </div>\n <div class=\"w-full sm:w-1/2\">\n @if (lecture) {\n <div>\n <div id=\"dplayer\" class=\"w-full h-auto aspect-video sm:rounded-xl\"></div>\n </div>\n }\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: MatStepperModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3$2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }] }); }
889
+ }
890
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionLectureVideoDialogComponent, decorators: [{
891
+ type: Component,
892
+ args: [{ selector: 'rolatech-course-section-lecture-video-dialog', standalone: true, imports: [
893
+ MatIconModule,
894
+ MatDividerModule,
895
+ FormsModule,
896
+ MatStepperModule,
897
+ ScheduleItemComponent,
898
+ MatButtonModule,
899
+ MatDialogClose,
900
+ MatCheckboxModule,
901
+ ], template: "<div class=\"flex flex-col-reverse sm:flex-row justify-between h-full gap-3\">\n <div class=\"w-full sm:w-1/2\">\n <div>\n <div class=\"py-3 flex flex-col\">\n <span class=\"text-lg font-bold\"> \u5C01\u9762 </span>\n <span class=\"text-sm\">\u4E00\u4E2A\u597D\u7684\u5C01\u9762\u53EF\u4EE5\u5F15\u8D77\u66F4\u591A\u7684\u5173\u6CE8</span>\n </div>\n\n <div class=\"flex gap-3\">\n <div\n class=\"p-3 w-36 flex flex-col items-center justify-center outline-dashed outline-1 rounded cursor-pointer\"\n (click)=\"fileInput.click()\"\n >\n <mat-icon>upload</mat-icon>\n <span class=\"text-sm\">\u4E0A\u4F20\u5C01\u9762</span>\n </div>\n <input type=\"file\" accept=\"image/*\" (change)=\"onThumbnailUpload($event)\" #fileInput style=\"display: none\" />\n @if (lecture.item.thumbnail) {\n <div class=\"aspect-video w-32 h-auto bg-black\">\n <img [src]=\"lecture.item.thumbnail\" class=\"aspect-video object-contain\" />\n </div>\n } @else {\n <div class=\"aspect-video w-32 h-auto\">\n <img [src]=\"mediaSrc\" class=\"aspect-video object-contain\" />\n </div>\n }\n </div>\n </div>\n <div class=\"mt-3\">\n <div class=\"py-3 flex flex-col\">\n <span class=\"text-lg font-bold\"> \u8BD5\u770B\u5185\u5BB9 </span>\n <span class=\"text-sm\">\u5C11\u91CF\u7684\u8BD5\u770B\u5185\u5BB9, \u53EF\u4EE5\u589E\u52A0\u8D2D\u4E70\u7387</span>\n </div>\n <mat-checkbox color=\"primary\" (change)=\"onPreviewChange($event)\" [checked]=\"lecture.item.canBePreviewed\"\n >\u5141\u8BB8\u8BD5\u770B</mat-checkbox\n >\n </div>\n </div>\n <div class=\"w-full sm:w-1/2\">\n @if (lecture) {\n <div>\n <div id=\"dplayer\" class=\"w-full h-auto aspect-video sm:rounded-xl\"></div>\n </div>\n }\n </div>\n</div>\n" }]
902
+ }], ctorParameters: () => [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
903
+ type: Inject,
904
+ args: [MAT_DIALOG_DATA]
905
+ }] }] });
906
+
907
+ class CourseSectionLectureItemComponent {
908
+ constructor() {
909
+ this.platformId = inject(PLATFORM_ID);
910
+ this.el = inject(ElementRef);
911
+ this.dialogService = inject(DialogService);
912
+ this.myVideo = viewChild('video');
913
+ this.progress = input(0);
914
+ this.lecture = input.required();
915
+ this.actions = input(true);
916
+ this.hasUnsaved = input(false);
917
+ this.editId = model();
918
+ this.save = output();
919
+ this.cancel = output();
920
+ this.delete = output();
921
+ this.edit = output();
922
+ this.mediaEdit = output();
923
+ this.thumbnailUpload = output();
924
+ this.upload = output();
925
+ this.deleteMedia = output();
926
+ this.editing = false;
927
+ }
928
+ ngOnInit() { }
929
+ onSave(lecture) {
930
+ this.editing = false;
931
+ this.editId.set(null);
932
+ this.save.emit(lecture);
933
+ }
934
+ onCancel(lecture) {
935
+ this.editing = false;
936
+ this.editId.set(null);
937
+ this.cancel.emit(lecture);
938
+ }
939
+ onDelete(lecture) {
940
+ this.delete.emit(lecture);
941
+ }
942
+ onEdit(lecture) {
943
+ this.editId.set(lecture.id);
944
+ this.editing = true;
945
+ this.edit.emit(lecture);
946
+ }
947
+ onMediaEdit(lecture) {
948
+ this.editId.set(lecture.id);
949
+ this.editing = true;
950
+ // this.mediaEdit.emit(lecture);
951
+ const options = {
952
+ title: '编辑视频',
953
+ cancelText: '取消',
954
+ confirmText: '确定',
955
+ data: this.lecture(),
956
+ width: '80vw',
957
+ maxWidth: '80vw',
958
+ height: '100%',
959
+ component: CourseSectionLectureVideoDialogComponent,
960
+ };
961
+ this.dialogService.open(options);
962
+ this.dialogService.confirmed().subscribe({
963
+ next: (res) => {
964
+ if (res) {
965
+ const data = {
966
+ name: res,
967
+ };
968
+ }
969
+ },
970
+ });
971
+ }
972
+ onVideoThumbnailUpload(video) {
973
+ this.thumbnailUpload.emit(video);
974
+ }
975
+ onUpload(id, data) {
976
+ this.lecture().isUploading = true;
977
+ this.upload.emit({ id, data });
978
+ }
979
+ onDeleteMedia(data) {
980
+ this.deleteMedia.emit(data);
981
+ }
982
+ onLoadedMetadata(event) {
983
+ if (this.lecture().item.duration) {
984
+ return;
985
+ }
986
+ const videoElement = event.target;
987
+ this.lecture().item.duration = videoElement.duration;
988
+ // console.log('Video Width:', videoElement.videoWidth);
989
+ // console.log('Video Height:', videoElement.videoHeight);
990
+ }
991
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionLectureItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
992
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseSectionLectureItemComponent, isStandalone: true, selector: "rolatech-course-section-lecture-item", inputs: { progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null }, lecture: { classPropertyName: "lecture", publicName: "lecture", isSignal: true, isRequired: true, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, hasUnsaved: { classPropertyName: "hasUnsaved", publicName: "hasUnsaved", isSignal: true, isRequired: false, transformFunction: null }, editId: { classPropertyName: "editId", publicName: "editId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { editId: "editIdChange", save: "save", cancel: "cancel", delete: "delete", edit: "edit", mediaEdit: "mediaEdit", thumbnailUpload: "thumbnailUpload", upload: "upload", deleteMedia: "deleteMedia" }, viewQueries: [{ propertyName: "myVideo", first: true, predicate: ["video"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex flex-col grow p-2\">\n @if (lecture().id !== editId()) {\n <div class=\"w-full flex gap-3 p-3 items-center\">\n <span>{{ lecture().title }}</span>\n <button mat-icon-button (click)=\"onEdit(lecture())\" class=\"max-w-8 max-h-8 !p-1\">\n <mat-icon>edit</mat-icon>\n </button>\n <button mat-icon-button (click)=\"onDelete(lecture())\" class=\"max-w-8 max-h-8 !p-1\">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n } @else {\n <div class=\"flex flex-col justify-between items-center\">\n <input\n type=\"text\"\n class=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-md focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\"\n placeholder=\"\u6807\u9898\"\n [(ngModel)]=\"lecture().title\"\n />\n <div class=\"w-full flex flex-row justify-end p-4 gap-3\">\n <button mat-button (click)=\"onCancel(lecture())\">\u53D6\u6D88</button>\n <button mat-flat-button color=\"primary\" (click)=\"onSave(lecture())\">\u4FDD\u5B58</button>\n </div>\n </div>\n }\n\n <div>\n @if (lecture().item) {\n <div class=\"flex flex-row p-2 gap-3\">\n <div class=\"bg-black h-fit\">\n <video\n id=\"video\"\n #video\n [src]=\"lecture().item.url\"\n class=\"w-32 aspect-video\"\n (loadedmetadata)=\"onLoadedMetadata($event)\"\n [poster]=\"lecture().item.thumbnail\"\n ></video>\n </div>\n <div class=\"flex flex-col justify-between w-full\">\n <div class=\"flex justify-between items-center w-full\">\n <div class=\"flex justify-between items-center w-full px-2\">\n <span>\u89C6\u9891\u5185\u5BB9</span>\n </div>\n @if (lecture().isUploading) {\n <div>\n <span> {{ lecture().item.progress }}%</span>\n </div>\n }\n </div>\n <div class=\"flex justify-between items-center\">\n <div>\n <button mat-button (click)=\"onMediaEdit(lecture().item)\">\n <mat-icon>edit</mat-icon>\n <span>\u7F16\u8F91</span>\n </button>\n <button mat-button (click)=\"onDeleteMedia(lecture().item)\">\n <mat-icon>delete</mat-icon>\n <span>\u5220\u9664</span>\n </button>\n </div>\n <div>\n <span>{{ lecture().item.duration | duration }}</span>\n </div>\n </div>\n </div>\n </div>\n @if (lecture().isUploading) {\n <div class=\"p-2\">\n <mat-progress-bar color=\"primary\" mode=\"determinate\" [value]=\"lecture().item.progress\"> </mat-progress-bar>\n </div>\n }\n } @else {\n @if (lecture().id !== editId()) {\n <div class=\"px-3\">\n <input\n class=\"ud-sr-only\"\n type=\"file\"\n accept=\".avi,.mpg,.mpeg,.flv,.mov,.m2v,.m4v,.mp4,.rm,.ram,.vob,.ogv,.webm,.wmv\"\n (change)=\"onUpload(lecture().id, $event)\"\n #fileInput\n />\n <div class=\"flex justify-between items-center\">\n <div>\u65E0\u89C6\u9891\u6587\u4EF6</div>\n <button mat-flat-button (click)=\"fileInput.click()\">\u4E0A\u4F20\u89C6\u9891</button>\n </div>\n </div>\n }\n }\n </div>\n @if (!hasUnsaved) {\n <ng-content></ng-content>\n }\n</div>\n", styles: [".ud-sr-only{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: AngularCommonModule }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: i4.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "pipe", type: DurationPipe, name: "duration" }] }); }
993
+ }
994
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionLectureItemComponent, decorators: [{
995
+ type: Component,
996
+ args: [{ selector: 'rolatech-course-section-lecture-item', standalone: true, imports: [
997
+ MatIconModule,
998
+ AngularCommonModule,
999
+ FormsModule,
1000
+ MatButtonModule,
1001
+ MatDividerModule,
1002
+ AngularComponentsModule,
1003
+ DurationPipe,
1004
+ ], template: "<div class=\"flex flex-col grow p-2\">\n @if (lecture().id !== editId()) {\n <div class=\"w-full flex gap-3 p-3 items-center\">\n <span>{{ lecture().title }}</span>\n <button mat-icon-button (click)=\"onEdit(lecture())\" class=\"max-w-8 max-h-8 !p-1\">\n <mat-icon>edit</mat-icon>\n </button>\n <button mat-icon-button (click)=\"onDelete(lecture())\" class=\"max-w-8 max-h-8 !p-1\">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n } @else {\n <div class=\"flex flex-col justify-between items-center\">\n <input\n type=\"text\"\n class=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-md focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\"\n placeholder=\"\u6807\u9898\"\n [(ngModel)]=\"lecture().title\"\n />\n <div class=\"w-full flex flex-row justify-end p-4 gap-3\">\n <button mat-button (click)=\"onCancel(lecture())\">\u53D6\u6D88</button>\n <button mat-flat-button color=\"primary\" (click)=\"onSave(lecture())\">\u4FDD\u5B58</button>\n </div>\n </div>\n }\n\n <div>\n @if (lecture().item) {\n <div class=\"flex flex-row p-2 gap-3\">\n <div class=\"bg-black h-fit\">\n <video\n id=\"video\"\n #video\n [src]=\"lecture().item.url\"\n class=\"w-32 aspect-video\"\n (loadedmetadata)=\"onLoadedMetadata($event)\"\n [poster]=\"lecture().item.thumbnail\"\n ></video>\n </div>\n <div class=\"flex flex-col justify-between w-full\">\n <div class=\"flex justify-between items-center w-full\">\n <div class=\"flex justify-between items-center w-full px-2\">\n <span>\u89C6\u9891\u5185\u5BB9</span>\n </div>\n @if (lecture().isUploading) {\n <div>\n <span> {{ lecture().item.progress }}%</span>\n </div>\n }\n </div>\n <div class=\"flex justify-between items-center\">\n <div>\n <button mat-button (click)=\"onMediaEdit(lecture().item)\">\n <mat-icon>edit</mat-icon>\n <span>\u7F16\u8F91</span>\n </button>\n <button mat-button (click)=\"onDeleteMedia(lecture().item)\">\n <mat-icon>delete</mat-icon>\n <span>\u5220\u9664</span>\n </button>\n </div>\n <div>\n <span>{{ lecture().item.duration | duration }}</span>\n </div>\n </div>\n </div>\n </div>\n @if (lecture().isUploading) {\n <div class=\"p-2\">\n <mat-progress-bar color=\"primary\" mode=\"determinate\" [value]=\"lecture().item.progress\"> </mat-progress-bar>\n </div>\n }\n } @else {\n @if (lecture().id !== editId()) {\n <div class=\"px-3\">\n <input\n class=\"ud-sr-only\"\n type=\"file\"\n accept=\".avi,.mpg,.mpeg,.flv,.mov,.m2v,.m4v,.mp4,.rm,.ram,.vob,.ogv,.webm,.wmv\"\n (change)=\"onUpload(lecture().id, $event)\"\n #fileInput\n />\n <div class=\"flex justify-between items-center\">\n <div>\u65E0\u89C6\u9891\u6587\u4EF6</div>\n <button mat-flat-button (click)=\"fileInput.click()\">\u4E0A\u4F20\u89C6\u9891</button>\n </div>\n </div>\n }\n }\n </div>\n @if (!hasUnsaved) {\n <ng-content></ng-content>\n }\n</div>\n", styles: [".ud-sr-only{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}\n"] }]
1005
+ }] });
1006
+
1007
+ class CourseSectionLectureVideoItemComponent {
1008
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionLectureVideoItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1009
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.1", type: CourseSectionLectureVideoItemComponent, isStandalone: true, selector: "rolatech-course-section-lecture-video-item", ngImport: i0, template: "<p>course-section-lecture-video-item works!</p>\n", styles: [""] }); }
1010
+ }
1011
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionLectureVideoItemComponent, decorators: [{
1012
+ type: Component,
1013
+ args: [{ selector: 'rolatech-course-section-lecture-video-item', standalone: true, template: "<p>course-section-lecture-video-item works!</p>\n" }]
1014
+ }] });
1015
+
1016
+ class CourseItemComponent {
1017
+ constructor() {
1018
+ this.course = input.required();
1019
+ this.row = input(true);
1020
+ this.inset = input(false, { transform: booleanAttribute });
1021
+ }
1022
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1023
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseItemComponent, isStandalone: true, selector: "rolatech-course-item", inputs: { course: { classPropertyName: "course", publicName: "course", isSignal: true, isRequired: true, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: false, transformFunction: null }, inset: { classPropertyName: "inset", publicName: "inset", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (row()) {\n <div class=\"flex w-full flex-row\" [style]=\"inset() ? 'padding: 0 16px' : ''\">\n <div class=\"h-fit w-2/5 md:w-1/4 aspect-video bg-gray-200 rounded-lg\">\n @if (course().media) {\n @defer (on viewport()) {\n <!-- ?imageMogr2/thumbnail/400x -->\n <!-- <rolatech-thumbnail [src]=\"course().media[0].url + '?imageMogr2/thumbnail/400x'\" size=\"medium\">\n </rolatech-thumbnail> -->\n <rolatech-thumbnail [src]=\"course().media[0].url + '!w400'\" size=\"medium\"></rolatech-thumbnail>\n } @placeholder {\n <div class=\"bg-gray-200 h-full w-full object-cover aspect-video rounded-lg\"></div>\n }\n }\n </div>\n <div class=\"w-3/5 md:w-3/4 ml-3 flex flex-col justify-between\">\n <div>\n <div class=\"md:text-xl font-medium break-words line-clamp-1 md:line-clamp-2 whitespace-normal\">\n {{ course().name }}\n </div>\n <div class=\"invisible h-0 md:h-auto md:visible break-words line-clamp-1 whitespace-normal\">\n {{ course().description }}\n </div>\n </div>\n @if (course().pricing) {\n <div class=\"md:text-lg font-medium py-1\">\u00A5{{ course().pricing[0].total / 100 }}</div>\n }\n </div>\n </div>\n} @else {\n <div>\n <div>\n @if (course().media; as media) {\n @defer (on viewport()) {\n <!-- course().media[0].url -->\n <!-- <rolatech-thumbnail [src]=\"course().media[0].url + '?imageMogr2/thumbnail/400x'\" size=\"medium\">\n </rolatech-thumbnail> -->\n <rolatech-thumbnail [src]=\"course().media[0].url + '!w400'\" size=\"medium\"></rolatech-thumbnail>\n } @placeholder {\n <div class=\"bg-gray-200 w-full h-full object-cover aspect-video rounded-lg\"></div>\n }\n }\n </div>\n <div class=\"mt-2\">\n <div class=\"text-md md:text-xl font-medium break-words line-clamp-2\">{{ course().name }}</div>\n @if (course().pricing) {\n <div class=\"text-md md:text-lg font-medium py-1\">\u00A5{{ course().pricing[0].total / 100 }}</div>\n }\n </div>\n </div>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }], deferBlockDependencies: [() => [ThumbnailComponent], () => [ThumbnailComponent]] }); }
1024
+ }
1025
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseItemComponent, decorators: [{
1026
+ type: Component,
1027
+ args: [{ selector: 'rolatech-course-item', standalone: true, imports: [CommonModule, ImageComponent, ThumbnailComponent], template: "@if (row()) {\n <div class=\"flex w-full flex-row\" [style]=\"inset() ? 'padding: 0 16px' : ''\">\n <div class=\"h-fit w-2/5 md:w-1/4 aspect-video bg-gray-200 rounded-lg\">\n @if (course().media) {\n @defer (on viewport()) {\n <!-- ?imageMogr2/thumbnail/400x -->\n <!-- <rolatech-thumbnail [src]=\"course().media[0].url + '?imageMogr2/thumbnail/400x'\" size=\"medium\">\n </rolatech-thumbnail> -->\n <rolatech-thumbnail [src]=\"course().media[0].url + '!w400'\" size=\"medium\"></rolatech-thumbnail>\n } @placeholder {\n <div class=\"bg-gray-200 h-full w-full object-cover aspect-video rounded-lg\"></div>\n }\n }\n </div>\n <div class=\"w-3/5 md:w-3/4 ml-3 flex flex-col justify-between\">\n <div>\n <div class=\"md:text-xl font-medium break-words line-clamp-1 md:line-clamp-2 whitespace-normal\">\n {{ course().name }}\n </div>\n <div class=\"invisible h-0 md:h-auto md:visible break-words line-clamp-1 whitespace-normal\">\n {{ course().description }}\n </div>\n </div>\n @if (course().pricing) {\n <div class=\"md:text-lg font-medium py-1\">\u00A5{{ course().pricing[0].total / 100 }}</div>\n }\n </div>\n </div>\n} @else {\n <div>\n <div>\n @if (course().media; as media) {\n @defer (on viewport()) {\n <!-- course().media[0].url -->\n <!-- <rolatech-thumbnail [src]=\"course().media[0].url + '?imageMogr2/thumbnail/400x'\" size=\"medium\">\n </rolatech-thumbnail> -->\n <rolatech-thumbnail [src]=\"course().media[0].url + '!w400'\" size=\"medium\"></rolatech-thumbnail>\n } @placeholder {\n <div class=\"bg-gray-200 w-full h-full object-cover aspect-video rounded-lg\"></div>\n }\n }\n </div>\n <div class=\"mt-2\">\n <div class=\"text-md md:text-xl font-medium break-words line-clamp-2\">{{ course().name }}</div>\n @if (course().pricing) {\n <div class=\"text-md md:text-lg font-medium py-1\">\u00A5{{ course().pricing[0].total / 100 }}</div>\n }\n </div>\n </div>\n}\n" }]
1028
+ }] });
1029
+
1030
+ var courseItem_component = /*#__PURE__*/Object.freeze({
1031
+ __proto__: null,
1032
+ CourseItemComponent: CourseItemComponent
1033
+ });
1034
+
1035
+ class PricingItemComponent {
1036
+ constructor() {
1037
+ this.actions = input(false);
1038
+ this.pricing = model.required();
1039
+ this.delete = output();
1040
+ this.save = output();
1041
+ }
1042
+ ngOnInit() {
1043
+ this.pricing().total = this.pricing().total / 100;
1044
+ }
1045
+ onSave(pricing) {
1046
+ const finalPricing = {
1047
+ ...pricing,
1048
+ total: pricing.total * 100,
1049
+ };
1050
+ this.save.emit(finalPricing);
1051
+ }
1052
+ onDelete(pricing) {
1053
+ this.delete.emit(pricing);
1054
+ }
1055
+ setTwoNumberDecimal(e) {
1056
+ this.pricing().total = e;
1057
+ }
1058
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: PricingItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1059
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: PricingItemComponent, isStandalone: true, selector: "rolatech-pricing-item", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, pricing: { classPropertyName: "pricing", publicName: "pricing", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { pricing: "pricingChange", delete: "delete", save: "save" }, ngImport: i0, template: "<div class=\"flex flex-col py-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label> \u6700\u5C11\u4EBA\u6570 </mat-label>\n <input matInput type=\"number\" [(ngModel)]=\"pricing().min\" name=\"min\" required />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label> \u6700\u591A\u4EBA\u6570 </mat-label>\n <input matInput type=\"number\" [(ngModel)]=\"pricing().max\" name=\"max\" required />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label> \u4EF7\u683C </mat-label>\n <!-- <input matInput type=\"number\" step=\"0.01\" [ngModel]=\"pricing().total\"\n (ngModelChange)=\"setTwoNumberDecimal($event)\" name=\"total\" required placeholder=\"20.23\" /> -->\n <input matInput rolatechDecimal type=\"text\" [(ngModel)]=\"pricing().total\" name=\"total\" required />\n </mat-form-field>\n</div>\n@if (actions()) {\n <div class=\"flex flex-row justify-end p-3\">\n <button mat-button (click)=\"onDelete(pricing())\">\u5220\u9664</button>\n <button mat-flat-button (click)=\"onSave(pricing())\">\u4FDD\u5B58</button>\n </div>\n}\n<mat-divider></mat-divider>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i5$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }] }); }
1060
+ }
1061
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: PricingItemComponent, decorators: [{
1062
+ type: Component,
1063
+ args: [{ selector: 'rolatech-pricing-item', standalone: true, imports: [NgClass, MatFormFieldModule, MatInputModule, FormsModule, MatButtonModule, MatDividerModule], template: "<div class=\"flex flex-col py-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label> \u6700\u5C11\u4EBA\u6570 </mat-label>\n <input matInput type=\"number\" [(ngModel)]=\"pricing().min\" name=\"min\" required />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label> \u6700\u591A\u4EBA\u6570 </mat-label>\n <input matInput type=\"number\" [(ngModel)]=\"pricing().max\" name=\"max\" required />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label> \u4EF7\u683C </mat-label>\n <!-- <input matInput type=\"number\" step=\"0.01\" [ngModel]=\"pricing().total\"\n (ngModelChange)=\"setTwoNumberDecimal($event)\" name=\"total\" required placeholder=\"20.23\" /> -->\n <input matInput rolatechDecimal type=\"text\" [(ngModel)]=\"pricing().total\" name=\"total\" required />\n </mat-form-field>\n</div>\n@if (actions()) {\n <div class=\"flex flex-row justify-end p-3\">\n <button mat-button (click)=\"onDelete(pricing())\">\u5220\u9664</button>\n <button mat-flat-button (click)=\"onSave(pricing())\">\u4FDD\u5B58</button>\n </div>\n}\n<mat-divider></mat-divider>\n" }]
1064
+ }], ctorParameters: () => [] });
1065
+
1066
+ class CoursePricingAddDialogComponent {
1067
+ constructor(dialogRef, data) {
1068
+ this.dialogRef = dialogRef;
1069
+ this.data = data;
1070
+ this.pricing = {
1071
+ min: 0,
1072
+ max: 0,
1073
+ total: 0,
1074
+ };
1075
+ }
1076
+ close() {
1077
+ this.dialogRef.close();
1078
+ }
1079
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CoursePricingAddDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
1080
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CoursePricingAddDialogComponent, isStandalone: true, selector: "rolatech-course-pricing-add-dialog", ngImport: i0, template: "<div class=\"flex flex-col h-full overflow-hidden\">\n <div class=\"h-16 flex justify-between items-center px-5\">\n @if (data.title) {\n <div class=\"text-xl font-bold\">{{ data.title }}</div>\n }\n <div class=\"cursor-pointer\" (click)=\"close()\">\n <mat-icon fontIcon=\"close\"></mat-icon>\n </div>\n </div>\n <div class=\"flex-1 overflow-hidden p-3 overflow-y-auto max-h-[55vh]\">\n <rolatech-pricing-item [pricing]=\"pricing\"></rolatech-pricing-item>\n </div>\n <div class=\"h-16 flex justify-end items-center px-5 gap-3\">\n <button mat-button mat-dialog-close>\u53D6\u6D88</button>\n <button mat-button [mat-dialog-close]=\"pricing\" cdkFocusInitial>\u4FDD\u5B58</button>\n </div>\n</div>\n", styles: ["mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: PricingItemComponent, selector: "rolatech-pricing-item", inputs: ["actions", "pricing"], outputs: ["pricingChange", "delete", "save"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] }); }
1081
+ }
1082
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CoursePricingAddDialogComponent, decorators: [{
1083
+ type: Component,
1084
+ args: [{ selector: 'rolatech-course-pricing-add-dialog', standalone: true, imports: [MatIconModule, PricingItemComponent, MatButtonModule, MatDialogClose], template: "<div class=\"flex flex-col h-full overflow-hidden\">\n <div class=\"h-16 flex justify-between items-center px-5\">\n @if (data.title) {\n <div class=\"text-xl font-bold\">{{ data.title }}</div>\n }\n <div class=\"cursor-pointer\" (click)=\"close()\">\n <mat-icon fontIcon=\"close\"></mat-icon>\n </div>\n </div>\n <div class=\"flex-1 overflow-hidden p-3 overflow-y-auto max-h-[55vh]\">\n <rolatech-pricing-item [pricing]=\"pricing\"></rolatech-pricing-item>\n </div>\n <div class=\"h-16 flex justify-end items-center px-5 gap-3\">\n <button mat-button mat-dialog-close>\u53D6\u6D88</button>\n <button mat-button [mat-dialog-close]=\"pricing\" cdkFocusInitial>\u4FDD\u5B58</button>\n </div>\n</div>\n", styles: ["mat-form-field{width:100%}\n"] }]
1085
+ }], ctorParameters: () => [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
1086
+ type: Inject,
1087
+ args: [MAT_DIALOG_DATA]
1088
+ }] }] });
1089
+
1090
+ class CourseScheduleAddDialogComponent {
1091
+ constructor(dialogRef, data) {
1092
+ this.dialogRef = dialogRef;
1093
+ this.data = data;
1094
+ this.schedule = {
1095
+ title: '',
1096
+ content: '',
1097
+ startAt: '',
1098
+ endAt: '',
1099
+ };
1100
+ }
1101
+ close() {
1102
+ this.dialogRef.close();
1103
+ }
1104
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseScheduleAddDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
1105
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseScheduleAddDialogComponent, isStandalone: true, selector: "rolatech-course-schedule-add-dialog", ngImport: i0, template: "<div class=\"flex flex-col h-full\">\n <div class=\"h-16 flex justify-between items-center px-5\">\n @if (data.title) {\n <div class=\"text-xl font-bold\">{{ data.title }}</div>\n }\n <div class=\"cursor-pointer\" (click)=\"close()\">\n <mat-icon fontIcon=\"close\"></mat-icon>\n </div>\n </div>\n <div class=\"flex-1 overflow-y-auto max-h-[55vh] px-3\">\n <rolatech-schedule-item [value]=\"schedule\"></rolatech-schedule-item>\n </div>\n <div class=\"h-16 flex justify-end items-center px-5 gap-3\">\n <button mat-button mat-dialog-close>\u53D6\u6D88</button>\n <button mat-button [mat-dialog-close]=\"schedule\" cdkFocusInitial>\u4FDD\u5B58</button>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: ScheduleItemComponent, selector: "rolatech-schedule-item", inputs: ["value", "actions"], outputs: ["delete", "save"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] }); }
1106
+ }
1107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseScheduleAddDialogComponent, decorators: [{
1108
+ type: Component,
1109
+ args: [{ selector: 'rolatech-course-schedule-add-dialog', standalone: true, imports: [MatIconModule, ScheduleItemComponent, MatButtonModule, MatDialogClose], template: "<div class=\"flex flex-col h-full\">\n <div class=\"h-16 flex justify-between items-center px-5\">\n @if (data.title) {\n <div class=\"text-xl font-bold\">{{ data.title }}</div>\n }\n <div class=\"cursor-pointer\" (click)=\"close()\">\n <mat-icon fontIcon=\"close\"></mat-icon>\n </div>\n </div>\n <div class=\"flex-1 overflow-y-auto max-h-[55vh] px-3\">\n <rolatech-schedule-item [value]=\"schedule\"></rolatech-schedule-item>\n </div>\n <div class=\"h-16 flex justify-end items-center px-5 gap-3\">\n <button mat-button mat-dialog-close>\u53D6\u6D88</button>\n <button mat-button [mat-dialog-close]=\"schedule\" cdkFocusInitial>\u4FDD\u5B58</button>\n </div>\n</div>\n" }]
1110
+ }], ctorParameters: () => [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
1111
+ type: Inject,
1112
+ args: [MAT_DIALOG_DATA]
1113
+ }] }] });
1114
+
1115
+ class CoursePricingDialogComponent {
1116
+ constructor(dialogRef, data, courseService, snackBar, dialog) {
1117
+ this.dialogRef = dialogRef;
1118
+ this.data = data;
1119
+ this.courseService = courseService;
1120
+ this.snackBar = snackBar;
1121
+ this.dialog = dialog;
1122
+ this.pricing = [];
1123
+ this.courseId = data.courseId;
1124
+ this.pricing = data.pricing;
1125
+ }
1126
+ close() {
1127
+ this.dialogRef.close();
1128
+ }
1129
+ addPricing() {
1130
+ this.pricing.push({
1131
+ min: 0,
1132
+ max: 0,
1133
+ total: 0,
1134
+ });
1135
+ }
1136
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CoursePricingDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: CourseService }, { token: i3$3.MatSnackBar }, { token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component }); }
1137
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CoursePricingDialogComponent, isStandalone: true, selector: "rolatech-course-pricing-dialog", ngImport: i0, template: "<div class=\"flex flex-col h-full overflow-hidden\">\n <div class=\"h-16 flex justify-between items-center px-5\">\n @if (data.title) {\n <div class=\"text-md font-medium\">{{ data.title }}</div>\n }\n <div class=\"cursor-pointer\" (click)=\"close()\">\n <mat-icon fontIcon=\"close\"></mat-icon>\n </div>\n </div>\n <mat-divider></mat-divider>\n <div class=\"flex-1 overflow-hidden mt-3 overflow-y-auto w-2/3 max-h-[55vh]\">\n <form #detailForm=\"ngForm\" class=\"p-3\">\n <ng-template matStepLabel>\u8BE6\u60C5</ng-template>\n @for (item of pricing; track item) {\n <rolatech-pricing-item [pricing]=\"item\"> </rolatech-pricing-item>\n }\n <div class=\"mb-6\">\n <button mat-button (click)=\"addPricing()\">\n <mat-icon>add</mat-icon>\n <span>\u589E\u52A0\u4EF7\u683C</span>\n </button>\n </div>\n </form>\n </div>\n <mat-divider></mat-divider>\n <div class=\"h-16 flex justify-end items-center px-5\">\n <button mat-button [mat-dialog-close]=\"pricing\" cdkFocusInitial>\u4FDD\u5B58</button>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i5$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatStepperModule }, { kind: "directive", type: i7$1.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: PricingItemComponent, selector: "rolatech-pricing-item", inputs: ["actions", "pricing"], outputs: ["pricingChange", "delete", "save"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] }); }
1138
+ }
1139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CoursePricingDialogComponent, decorators: [{
1140
+ type: Component,
1141
+ args: [{ selector: 'rolatech-course-pricing-dialog', standalone: true, imports: [
1142
+ MatIconModule,
1143
+ MatDividerModule,
1144
+ FormsModule,
1145
+ MatStepperModule,
1146
+ PricingItemComponent,
1147
+ MatButtonModule,
1148
+ MatDialogClose,
1149
+ ], template: "<div class=\"flex flex-col h-full overflow-hidden\">\n <div class=\"h-16 flex justify-between items-center px-5\">\n @if (data.title) {\n <div class=\"text-md font-medium\">{{ data.title }}</div>\n }\n <div class=\"cursor-pointer\" (click)=\"close()\">\n <mat-icon fontIcon=\"close\"></mat-icon>\n </div>\n </div>\n <mat-divider></mat-divider>\n <div class=\"flex-1 overflow-hidden mt-3 overflow-y-auto w-2/3 max-h-[55vh]\">\n <form #detailForm=\"ngForm\" class=\"p-3\">\n <ng-template matStepLabel>\u8BE6\u60C5</ng-template>\n @for (item of pricing; track item) {\n <rolatech-pricing-item [pricing]=\"item\"> </rolatech-pricing-item>\n }\n <div class=\"mb-6\">\n <button mat-button (click)=\"addPricing()\">\n <mat-icon>add</mat-icon>\n <span>\u589E\u52A0\u4EF7\u683C</span>\n </button>\n </div>\n </form>\n </div>\n <mat-divider></mat-divider>\n <div class=\"h-16 flex justify-end items-center px-5\">\n <button mat-button [mat-dialog-close]=\"pricing\" cdkFocusInitial>\u4FDD\u5B58</button>\n </div>\n</div>\n" }]
1150
+ }], ctorParameters: () => [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
1151
+ type: Inject,
1152
+ args: [MAT_DIALOG_DATA]
1153
+ }] }, { type: CourseService }, { type: i3$3.MatSnackBar }, { type: i1$2.MatDialog }] });
1154
+
1155
+ class CourseScheduleDialogComponent {
1156
+ constructor(dialogRef, data, courseService, snackBar, dialog) {
1157
+ this.dialogRef = dialogRef;
1158
+ this.data = data;
1159
+ this.courseService = courseService;
1160
+ this.snackBar = snackBar;
1161
+ this.dialog = dialog;
1162
+ this.schedule = [];
1163
+ this.courseId = data.courseId;
1164
+ this.schedule = data.schedule;
1165
+ }
1166
+ close() {
1167
+ this.dialogRef.close();
1168
+ }
1169
+ addSchedule() {
1170
+ if (!this.schedule) {
1171
+ this.schedule = [];
1172
+ }
1173
+ this.schedule.push({
1174
+ title: '',
1175
+ content: '',
1176
+ startAt: '',
1177
+ endAt: '',
1178
+ });
1179
+ }
1180
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseScheduleDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: CourseService }, { token: i3$3.MatSnackBar }, { token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component }); }
1181
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseScheduleDialogComponent, isStandalone: true, selector: "rolatech-course-schedule-dialog", ngImport: i0, template: "<div class=\"flex flex-col h-full overflow-hidden\">\n <div class=\"h-16 flex justify-between items-center px-5\">\n @if (data.title) {\n <div class=\"text-md font-medium\">{{ data.title }}</div>\n }\n <div class=\"cursor-pointer\" (click)=\"close()\">\n <mat-icon fontIcon=\"close\"></mat-icon>\n </div>\n </div>\n <mat-divider></mat-divider>\n <div class=\"flex-1 overflow-hidden mt-3 overflow-y-auto\">\n <form #detailForm=\"ngForm\" class=\"p-3\">\n <ng-template matStepLabel>\u8BE6\u60C5</ng-template>\n @for (item of schedule; track item) {\n <rolatech-schedule-item [value]=\"item\"></rolatech-schedule-item>\n }\n <div class=\"mb-6\">\n <button mat-button (click)=\"addSchedule()\">\n <mat-icon>add</mat-icon>\n <span>\u589E\u52A0\u8BFE\u8868</span>\n </button>\n </div>\n </form>\n </div>\n <mat-divider></mat-divider>\n <div class=\"h-16 flex justify-end items-center px-5\">\n <button mat-button [mat-dialog-close]=\"schedule\" cdkFocusInitial>\u4FDD\u5B58</button>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i5$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatStepperModule }, { kind: "directive", type: i7$1.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: ScheduleItemComponent, selector: "rolatech-schedule-item", inputs: ["value", "actions"], outputs: ["delete", "save"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] }); }
1182
+ }
1183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseScheduleDialogComponent, decorators: [{
1184
+ type: Component,
1185
+ args: [{ selector: 'rolatech-course-schedule-dialog', standalone: true, imports: [
1186
+ MatIconModule,
1187
+ MatDividerModule,
1188
+ FormsModule,
1189
+ MatStepperModule,
1190
+ ScheduleItemComponent,
1191
+ MatButtonModule,
1192
+ MatDialogClose,
1193
+ ], template: "<div class=\"flex flex-col h-full overflow-hidden\">\n <div class=\"h-16 flex justify-between items-center px-5\">\n @if (data.title) {\n <div class=\"text-md font-medium\">{{ data.title }}</div>\n }\n <div class=\"cursor-pointer\" (click)=\"close()\">\n <mat-icon fontIcon=\"close\"></mat-icon>\n </div>\n </div>\n <mat-divider></mat-divider>\n <div class=\"flex-1 overflow-hidden mt-3 overflow-y-auto\">\n <form #detailForm=\"ngForm\" class=\"p-3\">\n <ng-template matStepLabel>\u8BE6\u60C5</ng-template>\n @for (item of schedule; track item) {\n <rolatech-schedule-item [value]=\"item\"></rolatech-schedule-item>\n }\n <div class=\"mb-6\">\n <button mat-button (click)=\"addSchedule()\">\n <mat-icon>add</mat-icon>\n <span>\u589E\u52A0\u8BFE\u8868</span>\n </button>\n </div>\n </form>\n </div>\n <mat-divider></mat-divider>\n <div class=\"h-16 flex justify-end items-center px-5\">\n <button mat-button [mat-dialog-close]=\"schedule\" cdkFocusInitial>\u4FDD\u5B58</button>\n </div>\n</div>\n" }]
1194
+ }], ctorParameters: () => [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
1195
+ type: Inject,
1196
+ args: [MAT_DIALOG_DATA]
1197
+ }] }, { type: CourseService }, { type: i3$3.MatSnackBar }, { type: i1$2.MatDialog }] });
1198
+
1199
+ class DetailItemComponent {
1200
+ constructor() {
1201
+ this.isUploading = input();
1202
+ this.detail = input.required();
1203
+ this.actions = input(false);
1204
+ this.selectMedia = input();
1205
+ this.upload = output();
1206
+ this.delete = output();
1207
+ this.save = output();
1208
+ this.deleteMedia = output();
1209
+ }
1210
+ ngOnInit() {
1211
+ this.selectedImg = this.detail().media ? this.detail().media[0] : null;
1212
+ }
1213
+ onUpload(id, data) {
1214
+ this.upload.emit({ id, data });
1215
+ }
1216
+ onMediaItemClick(image) {
1217
+ this.selectedImg = image;
1218
+ }
1219
+ select(item) {
1220
+ this.selectedImg = item;
1221
+ }
1222
+ deleteImage() { }
1223
+ onSave(detail) {
1224
+ this.save.emit(detail);
1225
+ }
1226
+ onDelete(detail) {
1227
+ this.delete.emit(detail);
1228
+ }
1229
+ onDeleteMedia(id, media) {
1230
+ this.deleteMedia.emit({ id, media });
1231
+ this.selectedImg = this.detail().media ? first(this.detail().media) : null;
1232
+ }
1233
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: DetailItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1234
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: DetailItemComponent, isStandalone: true, selector: "rolatech-detail-item", inputs: { isUploading: { classPropertyName: "isUploading", publicName: "isUploading", isSignal: true, isRequired: false, transformFunction: null }, detail: { classPropertyName: "detail", publicName: "detail", isSignal: true, isRequired: true, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, selectMedia: { classPropertyName: "selectMedia", publicName: "selectMedia", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { upload: "upload", delete: "delete", save: "save", deleteMedia: "deleteMedia" }, ngImport: i0, template: "<div class=\"mb-8\">\n <div class=\"flex flex-col lg:flex-row\">\n <div class=\"flex flex-col grow\">\n <mat-form-field appearance=\"fill\">\n <mat-label>\u6807\u9898</mat-label>\n <input matInput placeholder=\"\u6807\u9898\" [(ngModel)]=\"detail().title\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\" [hideRequiredMarker]=\"true\">\n <mat-label>\u63CF\u8FF0</mat-label>\n <input matInput placeholder=\"\u63CF\u8FF0\" [(ngModel)]=\"detail().description\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\" [hideRequiredMarker]=\"true\">\n <mat-label>\u5185\u5BB9</mat-label>\n <textarea\n matInput\n cdkTextareaAutosize\n cdkAutosizeMinRows=\"3\"\n placeholder=\"\u5185\u5BB9\"\n [(ngModel)]=\"detail().content\"\n ></textarea>\n </mat-form-field>\n </div>\n <!-- image -->\n <div class=\"lg:basis-1/2 px-3\">\n <div class=\"flex flex-row justify-center pb-4 p-1\">\n @if (selectedImg) {\n <img class=\"object-contain w-80 h-80\" [src]=\"selectedImg.url\" [alt]=\"selectedImg.alt\" />\n }\n @if (selectedImg) {\n <button mat-icon-button (click)=\"onDeleteMedia(detail().id, selectedImg)\">\n <mat-icon>delete</mat-icon>\n </button>\n }\n </div>\n <!-- media -->\n <div>\n <div class=\"flex flex-row flex-wrap cursor-pointer relative box-border\" fxLayout=\"row\">\n <div class=\"progress-bar\">\n @if (detail().isUploading) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </div>\n @for (media of detail().media; track media) {\n <div class=\"media-list-item\">\n <img class=\"tile-media\" (click)=\"onMediaItemClick(media)\" [src]=\"media.url\" [alt]=\"media.alt\" />\n </div>\n }\n <input\n style=\"display: none\"\n type=\"file\"\n accept=\"image/*\"\n (change)=\"onUpload(detail().id, $event)\"\n #fileInput\n />\n <div class=\"add-button\">\n <div (click)=\"fileInput.click()\" class=\"tile-media flex justify-center items-center\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"48px\"\n viewBox=\"0 -960 960 960\"\n width=\"48px\"\n fill=\"#5f6368\"\n >\n <path d=\"M444-444H240v-72h204v-204h72v204h204v72H516v204h-72v-204Z\" />\n </svg>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n@if (actions()) {\n <div class=\"flex flex-row justify-end p-4\">\n <button mat-button (click)=\"onDelete(detail())\">\u5220\u9664</button>\n <button mat-button (click)=\"onSave(detail())\">\u4FDD\u5B58</button>\n </div>\n}\n<mat-divider></mat-divider>\n", styles: [".media-list{flex-wrap:wrap;box-sizing:border-box}.progress-bar{display:block;min-height:6px;width:100%}.media-list-item{cursor:pointer;position:relative;box-sizing:border-box;padding:2px}.tile-media{height:80px;width:80px;object-fit:contain;cursor:pointer;border:1px solid grey;padding:6px;position:relative;box-sizing:border-box}.add-button{cursor:pointer;position:relative;box-sizing:border-box;padding:2px}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3$1.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TextFieldModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i4.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i5$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }] }); }
1235
+ }
1236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: DetailItemComponent, decorators: [{
1237
+ type: Component,
1238
+ args: [{ selector: 'rolatech-detail-item', standalone: true, imports: [
1239
+ NgClass,
1240
+ MatFormFieldModule,
1241
+ MatInputModule,
1242
+ FormsModule,
1243
+ TextFieldModule,
1244
+ MatButtonModule,
1245
+ MatIconModule,
1246
+ MatProgressBarModule,
1247
+ MatDividerModule,
1248
+ ], template: "<div class=\"mb-8\">\n <div class=\"flex flex-col lg:flex-row\">\n <div class=\"flex flex-col grow\">\n <mat-form-field appearance=\"fill\">\n <mat-label>\u6807\u9898</mat-label>\n <input matInput placeholder=\"\u6807\u9898\" [(ngModel)]=\"detail().title\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\" [hideRequiredMarker]=\"true\">\n <mat-label>\u63CF\u8FF0</mat-label>\n <input matInput placeholder=\"\u63CF\u8FF0\" [(ngModel)]=\"detail().description\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\" [hideRequiredMarker]=\"true\">\n <mat-label>\u5185\u5BB9</mat-label>\n <textarea\n matInput\n cdkTextareaAutosize\n cdkAutosizeMinRows=\"3\"\n placeholder=\"\u5185\u5BB9\"\n [(ngModel)]=\"detail().content\"\n ></textarea>\n </mat-form-field>\n </div>\n <!-- image -->\n <div class=\"lg:basis-1/2 px-3\">\n <div class=\"flex flex-row justify-center pb-4 p-1\">\n @if (selectedImg) {\n <img class=\"object-contain w-80 h-80\" [src]=\"selectedImg.url\" [alt]=\"selectedImg.alt\" />\n }\n @if (selectedImg) {\n <button mat-icon-button (click)=\"onDeleteMedia(detail().id, selectedImg)\">\n <mat-icon>delete</mat-icon>\n </button>\n }\n </div>\n <!-- media -->\n <div>\n <div class=\"flex flex-row flex-wrap cursor-pointer relative box-border\" fxLayout=\"row\">\n <div class=\"progress-bar\">\n @if (detail().isUploading) {\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n }\n </div>\n @for (media of detail().media; track media) {\n <div class=\"media-list-item\">\n <img class=\"tile-media\" (click)=\"onMediaItemClick(media)\" [src]=\"media.url\" [alt]=\"media.alt\" />\n </div>\n }\n <input\n style=\"display: none\"\n type=\"file\"\n accept=\"image/*\"\n (change)=\"onUpload(detail().id, $event)\"\n #fileInput\n />\n <div class=\"add-button\">\n <div (click)=\"fileInput.click()\" class=\"tile-media flex justify-center items-center\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"48px\"\n viewBox=\"0 -960 960 960\"\n width=\"48px\"\n fill=\"#5f6368\"\n >\n <path d=\"M444-444H240v-72h204v-204h72v204h204v72H516v204h-72v-204Z\" />\n </svg>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n@if (actions()) {\n <div class=\"flex flex-row justify-end p-4\">\n <button mat-button (click)=\"onDelete(detail())\">\u5220\u9664</button>\n <button mat-button (click)=\"onSave(detail())\">\u4FDD\u5B58</button>\n </div>\n}\n<mat-divider></mat-divider>\n", styles: [".media-list{flex-wrap:wrap;box-sizing:border-box}.progress-bar{display:block;min-height:6px;width:100%}.media-list-item{cursor:pointer;position:relative;box-sizing:border-box;padding:2px}.tile-media{height:80px;width:80px;object-fit:contain;cursor:pointer;border:1px solid grey;padding:6px;position:relative;box-sizing:border-box}.add-button{cursor:pointer;position:relative;box-sizing:border-box;padding:2px}\n"] }]
1249
+ }], ctorParameters: () => [] });
1250
+
1251
+ class CourseDetailsDialogComponent {
1252
+ constructor(dialogRef, data, courseService, snackBar, dialog) {
1253
+ this.dialogRef = dialogRef;
1254
+ this.data = data;
1255
+ this.courseService = courseService;
1256
+ this.snackBar = snackBar;
1257
+ this.dialog = dialog;
1258
+ this.details = [];
1259
+ this.courseId = data.courseId;
1260
+ }
1261
+ close() {
1262
+ this.dialogRef.close();
1263
+ }
1264
+ addDetail() {
1265
+ this.courseService
1266
+ .addDetail(this.courseId, {
1267
+ title: '',
1268
+ description: '',
1269
+ content: '',
1270
+ media: [],
1271
+ })
1272
+ .subscribe({
1273
+ next: (res) => {
1274
+ const detail = res.data;
1275
+ this.details.push({
1276
+ id: detail.id,
1277
+ title: '',
1278
+ description: '',
1279
+ content: '',
1280
+ media: [],
1281
+ });
1282
+ },
1283
+ error: (e) => {
1284
+ this.snackBar.open(e.message);
1285
+ },
1286
+ });
1287
+ }
1288
+ onDetailMediaUpload(event) { }
1289
+ onDetailMediaDelete(event) { }
1290
+ onDetailSave(event) { }
1291
+ onDetailDelete(detail) {
1292
+ this.courseService.deleteDetail(this.courseId, detail.id).subscribe({
1293
+ next: (res) => {
1294
+ this.snackBar.open(res.data);
1295
+ remove(this.details, {
1296
+ id: detail.id,
1297
+ });
1298
+ },
1299
+ error: (e) => {
1300
+ this.snackBar.open(e.message);
1301
+ },
1302
+ });
1303
+ }
1304
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseDetailsDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: CourseService }, { token: i3$3.MatSnackBar }, { token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component }); }
1305
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseDetailsDialogComponent, isStandalone: true, selector: "rolatech-course-details-dialog", ngImport: i0, template: "<div class=\"flex flex-col h-full overflow-hidden\">\n <div class=\"h-16 flex justify-between items-center px-5\">\n @if (data.title) {\n <div class=\"text-md font-medium\">{{ data.title }}</div>\n }\n <div class=\"cursor-pointer\" (click)=\"close()\">\n <mat-icon fontIcon=\"close\"></mat-icon>\n </div>\n </div>\n <mat-divider></mat-divider>\n <div class=\"flex-1 overflow-hidden mt-3 overflow-y-auto\">\n <form #detailForm=\"ngForm\" class=\"p-3\">\n <ng-template matStepLabel>\u8BE6\u60C5</ng-template>\n @for (item of details; track item) {\n <rolatech-detail-item\n [detail]=\"item\"\n (upload)=\"onDetailMediaUpload($event)\"\n (deleteMedia)=\"onDetailMediaDelete($event)\"\n (save)=\"onDetailSave($event)\"\n (delete)=\"onDetailDelete($event)\"\n ></rolatech-detail-item>\n }\n <div class=\"mb-6\">\n <button mat-button (click)=\"addDetail()\">\n <mat-icon>add</mat-icon>\n <span>\u589E\u52A0\u8BE6\u60C5</span>\n </button>\n </div>\n </form>\n </div>\n <mat-divider></mat-divider>\n <div class=\"h-16 flex justify-end items-center px-5\">\n <button mat-button [mat-dialog-close]=\"true\" cdkFocusInitial>\u4FDD\u5B58</button>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i5$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatStepperModule }, { kind: "directive", type: i7$1.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: DetailItemComponent, selector: "rolatech-detail-item", inputs: ["isUploading", "detail", "actions", "selectMedia"], outputs: ["upload", "delete", "save", "deleteMedia"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] }); }
1306
+ }
1307
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseDetailsDialogComponent, decorators: [{
1308
+ type: Component,
1309
+ args: [{ selector: 'rolatech-course-details-dialog', standalone: true, imports: [
1310
+ MatIconModule,
1311
+ MatDividerModule,
1312
+ FormsModule,
1313
+ MatStepperModule,
1314
+ DetailItemComponent,
1315
+ MatButtonModule,
1316
+ MatDialogClose,
1317
+ ], template: "<div class=\"flex flex-col h-full overflow-hidden\">\n <div class=\"h-16 flex justify-between items-center px-5\">\n @if (data.title) {\n <div class=\"text-md font-medium\">{{ data.title }}</div>\n }\n <div class=\"cursor-pointer\" (click)=\"close()\">\n <mat-icon fontIcon=\"close\"></mat-icon>\n </div>\n </div>\n <mat-divider></mat-divider>\n <div class=\"flex-1 overflow-hidden mt-3 overflow-y-auto\">\n <form #detailForm=\"ngForm\" class=\"p-3\">\n <ng-template matStepLabel>\u8BE6\u60C5</ng-template>\n @for (item of details; track item) {\n <rolatech-detail-item\n [detail]=\"item\"\n (upload)=\"onDetailMediaUpload($event)\"\n (deleteMedia)=\"onDetailMediaDelete($event)\"\n (save)=\"onDetailSave($event)\"\n (delete)=\"onDetailDelete($event)\"\n ></rolatech-detail-item>\n }\n <div class=\"mb-6\">\n <button mat-button (click)=\"addDetail()\">\n <mat-icon>add</mat-icon>\n <span>\u589E\u52A0\u8BE6\u60C5</span>\n </button>\n </div>\n </form>\n </div>\n <mat-divider></mat-divider>\n <div class=\"h-16 flex justify-end items-center px-5\">\n <button mat-button [mat-dialog-close]=\"true\" cdkFocusInitial>\u4FDD\u5B58</button>\n </div>\n</div>\n" }]
1318
+ }], ctorParameters: () => [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
1319
+ type: Inject,
1320
+ args: [MAT_DIALOG_DATA]
1321
+ }] }, { type: CourseService }, { type: i3$3.MatSnackBar }, { type: i1$2.MatDialog }] });
1322
+
1323
+ class CourseEditDialogComponent {
1324
+ constructor(dialogRef, data, categoryService, courseService, snackBar, dialog) {
1325
+ this.dialogRef = dialogRef;
1326
+ this.data = data;
1327
+ this.categoryService = categoryService;
1328
+ this.courseService = courseService;
1329
+ this.snackBar = snackBar;
1330
+ this.dialog = dialog;
1331
+ this.isUploading = false;
1332
+ this.courseType = [
1333
+ {
1334
+ key: 'ONLINE',
1335
+ value: '线上',
1336
+ },
1337
+ {
1338
+ key: 'OFFLINE',
1339
+ value: '线下',
1340
+ },
1341
+ {
1342
+ key: 'MIXED',
1343
+ value: '混合',
1344
+ },
1345
+ ];
1346
+ this.date = ScheduleDate;
1347
+ this.lastStepper = false;
1348
+ this.firstStepper = true;
1349
+ this.stepper = viewChild.required(MatStepper);
1350
+ this.course = data.course;
1351
+ this.classrooms = data.classrooms;
1352
+ }
1353
+ ngOnInit() {
1354
+ this.categoryService.find({}).subscribe({
1355
+ next: (res) => {
1356
+ this.categories = res.data;
1357
+ },
1358
+ });
1359
+ }
1360
+ close() {
1361
+ this.dialogRef.close();
1362
+ }
1363
+ compareFn(o1, o2) {
1364
+ return o1.id === o2.id;
1365
+ }
1366
+ addDetail() {
1367
+ if (!this.course.details) {
1368
+ this.course.details = [];
1369
+ }
1370
+ this.courseService
1371
+ .addDetail(this.course.id, {
1372
+ title: '',
1373
+ description: '',
1374
+ content: '',
1375
+ media: [],
1376
+ })
1377
+ .subscribe({
1378
+ next: (res) => {
1379
+ const detail = res.data;
1380
+ this.course.details.push({
1381
+ id: detail.id,
1382
+ title: '',
1383
+ description: '',
1384
+ content: '',
1385
+ media: [],
1386
+ });
1387
+ },
1388
+ error: (e) => {
1389
+ this.snackBar.open(e.message);
1390
+ },
1391
+ });
1392
+ }
1393
+ addSchedule() {
1394
+ if (!this.course.schedule) {
1395
+ this.course.schedule = [];
1396
+ }
1397
+ this.course.schedule.push({
1398
+ title: '',
1399
+ content: '',
1400
+ });
1401
+ }
1402
+ addPricing() {
1403
+ if (!this.course.pricing) {
1404
+ this.course.pricing = [];
1405
+ }
1406
+ this.course.pricing.push({
1407
+ min: 0,
1408
+ max: 0,
1409
+ total: 0,
1410
+ });
1411
+ }
1412
+ onSelectionChange(event) {
1413
+ this.selectedCategoyIds = event.value;
1414
+ }
1415
+ onStepperChange(event) {
1416
+ this.lastStepper = event.selectedIndex === 3;
1417
+ this.firstStepper = event.selectedIndex === 0;
1418
+ }
1419
+ previous() {
1420
+ this.stepper().previous();
1421
+ }
1422
+ next() {
1423
+ this.stepper().next();
1424
+ }
1425
+ onDetailMediaUpload(event) { }
1426
+ onDetailMediaDelete(event) { }
1427
+ onDetailSave(event) { }
1428
+ onDetailDelete(detail) {
1429
+ this.courseService.deleteDetail(this.course.id, detail.id).subscribe({
1430
+ next: (res) => {
1431
+ this.snackBar.open(res.message);
1432
+ remove(this.details, {
1433
+ id: detail.id,
1434
+ });
1435
+ },
1436
+ error: (e) => {
1437
+ this.snackBar.open(e.message);
1438
+ },
1439
+ });
1440
+ }
1441
+ onImageClick(i) {
1442
+ const dialogRef = this.dialog.open(ImagePreviewDialogComponent, {
1443
+ maxWidth: '80vw',
1444
+ maxHeight: '80vh',
1445
+ height: '80%',
1446
+ width: '80%',
1447
+ panelClass: 'full-screen-modal',
1448
+ data: {
1449
+ media: this.course.media,
1450
+ selected: i,
1451
+ },
1452
+ });
1453
+ }
1454
+ onUpload(event) {
1455
+ const file = event.target.files[0];
1456
+ if (file) {
1457
+ const reader = new FileReader();
1458
+ reader.readAsDataURL(file);
1459
+ reader.onload = () => {
1460
+ if (this.course.media) {
1461
+ this.course.media.push({
1462
+ url: reader.result,
1463
+ alt: 'upload image',
1464
+ });
1465
+ }
1466
+ else {
1467
+ this.course.media = [];
1468
+ this.course.media.push({
1469
+ url: reader.result,
1470
+ alt: 'upload image',
1471
+ });
1472
+ }
1473
+ this.isUploading = true;
1474
+ const formData = new FormData();
1475
+ formData.append('file', file);
1476
+ this.courseService.upload(formData).subscribe({
1477
+ next: (res) => {
1478
+ this.isUploading = false;
1479
+ const index = findLastIndex(this.course.media);
1480
+ // Replace item at index using native splice
1481
+ this.course.media.splice(index, 1, res.data);
1482
+ },
1483
+ error: (e) => {
1484
+ this.isUploading = false;
1485
+ this.snackBar.open('上传失败: ' + e.message);
1486
+ },
1487
+ });
1488
+ };
1489
+ reader.onerror = (error) => {
1490
+ this.isUploading = false;
1491
+ };
1492
+ }
1493
+ }
1494
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseEditDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: CategoryService }, { token: CourseService }, { token: i3$3.MatSnackBar }, { token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component }); }
1495
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseEditDialogComponent, isStandalone: true, selector: "rolatech-course-edit-dialog", viewQueries: [{ propertyName: "stepper", first: true, predicate: MatStepper, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex flex-col h-full overflow-hidden\">\n <div class=\"h-16 flex justify-between items-center px-5\">\n @if (data.title) {\n <div class=\"text-md font-medium\">{{ data.title }}</div>\n }\n <div class=\"cursor-pointer\" (click)=\"close()\">\n <mat-icon fontIcon=\"close\"></mat-icon>\n </div>\n </div>\n <mat-divider></mat-divider>\n <div class=\"flex-1 overflow-hidden mt-3 overflow-y-auto\">\n <mat-stepper #stepper (selectionChange)=\"onStepperChange($event)\">\n <mat-step [editable]=\"true\">\n <form #infoForm=\"ngForm\" class=\"py-3\">\n <ng-template matStepLabel>\u57FA\u672C\u4FE1\u606F</ng-template>\n <div class=\"flex flex-col\">\n <mat-form-field appearance=\"fill\">\n <mat-label> \u8BFE\u7A0B\u540D\u79F0 </mat-label>\n <input matInput type=\"text\" [(ngModel)]=\"course.name\" name=\"name\" required />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label> \u8BFE\u7A0B\u63CF\u8FF0 </mat-label>\n <textarea\n matInput\n type=\"text\"\n [(ngModel)]=\"course.description\"\n name=\"description\"\n required\n cdkTextareaAutosize\n cdkAutosizeMinRows=\"3\"\n ></textarea>\n </mat-form-field>\n <mat-form-field appearance=\"fill\" ngModelGroup=\"categories\">\n <mat-label>\u5206\u7C7B</mat-label>\n <mat-select\n multiple\n name=\"id\"\n [compareWith]=\"compareFn\"\n [(ngModel)]=\"course.categories\"\n #select=\"matSelect\"\n (selectionChange)=\"onSelectionChange($event)\"\n >\n @for (item of categories; track item) {\n <mat-option [value]=\"item\">\n {{ item.name }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label>\u7C7B\u578B</mat-label>\n <mat-select name=\"type\" [(ngModel)]=\"course.type\">\n @for (item of courseType; track item) {\n <mat-option [value]=\"item.key\">\n {{ item.value }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n @if (course.type.toString() !== 'ONLINE') {\n <mat-form-field appearance=\"fill\" ngModelGroup=\"classroom\">\n <mat-label>\u6559\u5BA4</mat-label>\n <mat-select [(ngModel)]=\"course.classroom\" name=\"id\">\n @for (classroom of classrooms; track classroom) {\n <mat-option [value]=\"classroom.id\">\n <div class=\"flex gap-3\">\n <span>{{ classroom.name }}</span>\n <span> {{ classroom.address }}</span>\n </div>\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n </div>\n <div>\n <div class=\"py-3\">\n <h2>\u56FE\u7247\u4FE1\u606F</h2>\n </div>\n <rolatech-media-list (upload)=\"onUpload($event)\" [isUploading]=\"isUploading\">\n @for (item of course.media; track item; let i = $index) {\n <rolatech-media-list-item [media]=\"item\" (mediaItemClick)=\"onImageClick(i)\"></rolatech-media-list-item>\n }\n </rolatech-media-list>\n </div>\n </form>\n </mat-step>\n <mat-step [editable]=\"true\">\n <form #detailForm=\"ngForm\" class=\"py-3\">\n <ng-template matStepLabel>\u8BE6\u60C5</ng-template>\n @for (item of course.details; track item) {\n <rolatech-detail-item\n [detail]=\"item\"\n (upload)=\"onDetailMediaUpload($event)\"\n (deleteMedia)=\"onDetailMediaDelete($event)\"\n (save)=\"onDetailSave($event)\"\n (delete)=\"onDetailDelete($event)\"\n ></rolatech-detail-item>\n }\n <div class=\"mb-6\">\n <button mat-button (click)=\"addDetail()\">\n <mat-icon>add</mat-icon>\n <span>\u589E\u52A0\u8BE6\u60C5</span>\n </button>\n </div>\n </form>\n </mat-step>\n <mat-step [editable]=\"true\">\n <form #pricingForm=\"ngForm\" class=\"py-3\">\n <ng-template matStepLabel>\u4EF7\u683C</ng-template>\n <div>\n @for (item of course.pricing; track item) {\n <rolatech-pricing-item [pricing]=\"item\"> </rolatech-pricing-item>\n }\n <div class=\"mb-6\">\n <button mat-button (click)=\"addPricing()\">\n <mat-icon>add</mat-icon>\n <span>\u589E\u52A0\u4EF7\u683C</span>\n </button>\n </div>\n </div>\n </form>\n </mat-step>\n <mat-step>\n <form #scheduleForm=\"ngForm\">\n <ng-template matStepLabel>\u8BFE\u8868</ng-template>\n <div class=\"flex flex-col\">\n @for (item of course.schedule; track item) {\n <rolatech-schedule-item [value]=\"item\"></rolatech-schedule-item>\n }\n <div class=\"mb-6\">\n <button mat-button (click)=\"addSchedule()\">\n <mat-icon>add</mat-icon>\n <span>\u589E\u52A0\u8BFE\u8868</span>\n </button>\n </div>\n </div>\n </form>\n </mat-step>\n </mat-stepper>\n </div>\n <mat-divider></mat-divider>\n <div class=\"h-16 flex justify-end items-center px-5\">\n @if (!firstStepper) {\n <button mat-button mat-button (click)=\"previous()\">\u4E0A\u4E00\u6B65</button>\n }\n @if (!lastStepper) {\n <button mat-button (click)=\"next()\">\u4E0B\u4E00\u6B65</button>\n }\n @if (lastStepper) {\n <button mat-button [mat-dialog-close]=\"course\" cdkFocusInitial>\u4FDD\u5B58</button>\n }\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i5$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: MatStepperModule }, { kind: "component", type: i7$1.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i7$1.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i7$1.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["disableRipple", "color", "labelPosition", "headerPosition", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i6.NgModelGroup, selector: "[ngModelGroup]", inputs: ["ngModelGroup"], exportAs: ["ngModelGroup"] }, { kind: "directive", type: i6.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3$1.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "ngmodule", type: TextFieldModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i6$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "component", type: MediaListComponent, selector: "rolatech-media-list", inputs: ["isUploading", "media", "showAdd"], outputs: ["mediaItemClick", "upload"] }, { kind: "component", type: MediaListItemComponent, selector: "rolatech-media-list-item", inputs: ["media", "uploadProgress"], outputs: ["mediaItemClick", "deleteMedia"] }, { kind: "component", type: DetailItemComponent, selector: "rolatech-detail-item", inputs: ["isUploading", "detail", "actions", "selectMedia"], outputs: ["upload", "delete", "save", "deleteMedia"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: PricingItemComponent, selector: "rolatech-pricing-item", inputs: ["actions", "pricing"], outputs: ["pricingChange", "delete", "save"] }, { kind: "component", type: ScheduleItemComponent, selector: "rolatech-schedule-item", inputs: ["value", "actions"], outputs: ["delete", "save"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] }); }
1496
+ }
1497
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseEditDialogComponent, decorators: [{
1498
+ type: Component,
1499
+ args: [{ selector: 'rolatech-course-edit-dialog', standalone: true, imports: [
1500
+ MatIconModule,
1501
+ MatDividerModule,
1502
+ MatStepperModule,
1503
+ FormsModule,
1504
+ MatFormFieldModule,
1505
+ MatInputModule,
1506
+ TextFieldModule,
1507
+ MatSelectModule,
1508
+ MatOptionModule,
1509
+ MediaListComponent,
1510
+ MediaListItemComponent,
1511
+ DetailItemComponent,
1512
+ MatButtonModule,
1513
+ PricingItemComponent,
1514
+ ScheduleItemComponent,
1515
+ MatDialogClose,
1516
+ ], template: "<div class=\"flex flex-col h-full overflow-hidden\">\n <div class=\"h-16 flex justify-between items-center px-5\">\n @if (data.title) {\n <div class=\"text-md font-medium\">{{ data.title }}</div>\n }\n <div class=\"cursor-pointer\" (click)=\"close()\">\n <mat-icon fontIcon=\"close\"></mat-icon>\n </div>\n </div>\n <mat-divider></mat-divider>\n <div class=\"flex-1 overflow-hidden mt-3 overflow-y-auto\">\n <mat-stepper #stepper (selectionChange)=\"onStepperChange($event)\">\n <mat-step [editable]=\"true\">\n <form #infoForm=\"ngForm\" class=\"py-3\">\n <ng-template matStepLabel>\u57FA\u672C\u4FE1\u606F</ng-template>\n <div class=\"flex flex-col\">\n <mat-form-field appearance=\"fill\">\n <mat-label> \u8BFE\u7A0B\u540D\u79F0 </mat-label>\n <input matInput type=\"text\" [(ngModel)]=\"course.name\" name=\"name\" required />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label> \u8BFE\u7A0B\u63CF\u8FF0 </mat-label>\n <textarea\n matInput\n type=\"text\"\n [(ngModel)]=\"course.description\"\n name=\"description\"\n required\n cdkTextareaAutosize\n cdkAutosizeMinRows=\"3\"\n ></textarea>\n </mat-form-field>\n <mat-form-field appearance=\"fill\" ngModelGroup=\"categories\">\n <mat-label>\u5206\u7C7B</mat-label>\n <mat-select\n multiple\n name=\"id\"\n [compareWith]=\"compareFn\"\n [(ngModel)]=\"course.categories\"\n #select=\"matSelect\"\n (selectionChange)=\"onSelectionChange($event)\"\n >\n @for (item of categories; track item) {\n <mat-option [value]=\"item\">\n {{ item.name }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label>\u7C7B\u578B</mat-label>\n <mat-select name=\"type\" [(ngModel)]=\"course.type\">\n @for (item of courseType; track item) {\n <mat-option [value]=\"item.key\">\n {{ item.value }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n @if (course.type.toString() !== 'ONLINE') {\n <mat-form-field appearance=\"fill\" ngModelGroup=\"classroom\">\n <mat-label>\u6559\u5BA4</mat-label>\n <mat-select [(ngModel)]=\"course.classroom\" name=\"id\">\n @for (classroom of classrooms; track classroom) {\n <mat-option [value]=\"classroom.id\">\n <div class=\"flex gap-3\">\n <span>{{ classroom.name }}</span>\n <span> {{ classroom.address }}</span>\n </div>\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n </div>\n <div>\n <div class=\"py-3\">\n <h2>\u56FE\u7247\u4FE1\u606F</h2>\n </div>\n <rolatech-media-list (upload)=\"onUpload($event)\" [isUploading]=\"isUploading\">\n @for (item of course.media; track item; let i = $index) {\n <rolatech-media-list-item [media]=\"item\" (mediaItemClick)=\"onImageClick(i)\"></rolatech-media-list-item>\n }\n </rolatech-media-list>\n </div>\n </form>\n </mat-step>\n <mat-step [editable]=\"true\">\n <form #detailForm=\"ngForm\" class=\"py-3\">\n <ng-template matStepLabel>\u8BE6\u60C5</ng-template>\n @for (item of course.details; track item) {\n <rolatech-detail-item\n [detail]=\"item\"\n (upload)=\"onDetailMediaUpload($event)\"\n (deleteMedia)=\"onDetailMediaDelete($event)\"\n (save)=\"onDetailSave($event)\"\n (delete)=\"onDetailDelete($event)\"\n ></rolatech-detail-item>\n }\n <div class=\"mb-6\">\n <button mat-button (click)=\"addDetail()\">\n <mat-icon>add</mat-icon>\n <span>\u589E\u52A0\u8BE6\u60C5</span>\n </button>\n </div>\n </form>\n </mat-step>\n <mat-step [editable]=\"true\">\n <form #pricingForm=\"ngForm\" class=\"py-3\">\n <ng-template matStepLabel>\u4EF7\u683C</ng-template>\n <div>\n @for (item of course.pricing; track item) {\n <rolatech-pricing-item [pricing]=\"item\"> </rolatech-pricing-item>\n }\n <div class=\"mb-6\">\n <button mat-button (click)=\"addPricing()\">\n <mat-icon>add</mat-icon>\n <span>\u589E\u52A0\u4EF7\u683C</span>\n </button>\n </div>\n </div>\n </form>\n </mat-step>\n <mat-step>\n <form #scheduleForm=\"ngForm\">\n <ng-template matStepLabel>\u8BFE\u8868</ng-template>\n <div class=\"flex flex-col\">\n @for (item of course.schedule; track item) {\n <rolatech-schedule-item [value]=\"item\"></rolatech-schedule-item>\n }\n <div class=\"mb-6\">\n <button mat-button (click)=\"addSchedule()\">\n <mat-icon>add</mat-icon>\n <span>\u589E\u52A0\u8BFE\u8868</span>\n </button>\n </div>\n </div>\n </form>\n </mat-step>\n </mat-stepper>\n </div>\n <mat-divider></mat-divider>\n <div class=\"h-16 flex justify-end items-center px-5\">\n @if (!firstStepper) {\n <button mat-button mat-button (click)=\"previous()\">\u4E0A\u4E00\u6B65</button>\n }\n @if (!lastStepper) {\n <button mat-button (click)=\"next()\">\u4E0B\u4E00\u6B65</button>\n }\n @if (lastStepper) {\n <button mat-button [mat-dialog-close]=\"course\" cdkFocusInitial>\u4FDD\u5B58</button>\n }\n </div>\n</div>\n" }]
1517
+ }], ctorParameters: () => [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
1518
+ type: Inject,
1519
+ args: [MAT_DIALOG_DATA]
1520
+ }] }, { type: CategoryService }, { type: CourseService }, { type: i3$3.MatSnackBar }, { type: i1$2.MatDialog }] });
1521
+
1522
+ class CourseDetailsComponent {
1523
+ constructor() {
1524
+ this.details = input.required();
1525
+ this.instructor = input();
1526
+ this.username = input();
1527
+ this.el = inject(ElementRef);
1528
+ this.viewportScroller = inject(ViewportScroller);
1529
+ this.platformId = inject(PLATFORM_ID);
1530
+ this.show = false;
1531
+ this.mediaIndex = 0;
1532
+ this.finalSchedule = [];
1533
+ }
1534
+ ngOnInit() { }
1535
+ onClickScroller(id) {
1536
+ this.viewportScroller.scrollToAnchor(id);
1537
+ }
1538
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseDetailsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1539
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseDetailsComponent, isStandalone: true, selector: "rolatech-course-details", inputs: { details: { classPropertyName: "details", publicName: "details", isSignal: true, isRequired: true, transformFunction: null }, instructor: { classPropertyName: "instructor", publicName: "instructor", isSignal: true, isRequired: false, transformFunction: null }, username: { classPropertyName: "username", publicName: "username", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"py-3\" id=\"details\">\n <div class=\"text-xl font-medium py-2\">\u8BE6\u60C5</div>\n @if (details()) {\n @for (detail of details(); track $index) {\n <div>\n @if (detail.title) {\n <div class=\"py-3 flex items-center gap-3\">\n <span class=\"h-4 w-1 bg-orange-500 inline-block\"></span>\n <span class=\"text-lg font-medium py-1\"> {{ detail.title }}</span>\n </div>\n }\n @if (detail.content) {\n <div>\n {{ detail.content }}\n </div>\n }\n @if (detail.media) {\n <div class=\"w-80%\">\n @for (item of detail.media; track item) {\n <div class=\"py-3\">\n <rolatech-thumbnail [src]=\"item.url + '?imageMogr2/format/avif'\" size=\"small\"></rolatech-thumbnail>\n <!-- <img class=\"object-cover\" [src]=\"item.url + '?imageMogr2/format/avif'\" /> -->\n </div>\n }\n </div>\n }\n </div>\n }\n }\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: ThumbnailComponent, selector: "rolatech-thumbnail", inputs: ["src", "size"] }] }); }
1540
+ }
1541
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseDetailsComponent, decorators: [{
1542
+ type: Component,
1543
+ args: [{ selector: 'rolatech-course-details', standalone: true, imports: [ThumbnailComponent], template: "<div class=\"py-3\" id=\"details\">\n <div class=\"text-xl font-medium py-2\">\u8BE6\u60C5</div>\n @if (details()) {\n @for (detail of details(); track $index) {\n <div>\n @if (detail.title) {\n <div class=\"py-3 flex items-center gap-3\">\n <span class=\"h-4 w-1 bg-orange-500 inline-block\"></span>\n <span class=\"text-lg font-medium py-1\"> {{ detail.title }}</span>\n </div>\n }\n @if (detail.content) {\n <div>\n {{ detail.content }}\n </div>\n }\n @if (detail.media) {\n <div class=\"w-80%\">\n @for (item of detail.media; track item) {\n <div class=\"py-3\">\n <rolatech-thumbnail [src]=\"item.url + '?imageMogr2/format/avif'\" size=\"small\"></rolatech-thumbnail>\n <!-- <img class=\"object-cover\" [src]=\"item.url + '?imageMogr2/format/avif'\" /> -->\n </div>\n }\n </div>\n }\n </div>\n }\n }\n</div>\n" }]
1544
+ }] });
1545
+
1546
+ class CourseMediaOwnerRendererComponent {
1547
+ constructor() {
1548
+ this.name = input();
1549
+ this.avatar = input();
1550
+ this.username = input();
1551
+ }
1552
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseMediaOwnerRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1553
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseMediaOwnerRendererComponent, isStandalone: true, selector: "rolatech-course-media-owner-renderer", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, avatar: { classPropertyName: "avatar", publicName: "avatar", isSignal: true, isRequired: false, transformFunction: null }, username: { classPropertyName: "username", publicName: "username", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex flex-row items-center\">\n <div class=\"flex mr-3 gap-2 items-center\">\n @if (avatar()) {\n <div class=\"cursor-pointer\" [routerLink]=\"['/instructors/', '@' + username()]\">\n <img [src]=\"avatar()\" class=\"w-11 h-11 rounded-full\" />\n </div>\n } @else {\n <div class=\"w-11 h-11 rounded-full bg-orange-600\"></div>\n }\n <div class=\"flex items-center text-lg font-bold cursor-pointer\">\n <a [routerLink]=\"['/instructors/', '@' + username()]\">\n <span>{{ name() }}</span>\n </a>\n <mat-icon color=\"primary\">verified</mat-icon>\n </div>\n </div>\n</div>\n", styles: ["mat-icon{transform:scale(.8)}\n"], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "directive", type: i1$3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
1554
+ }
1555
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseMediaOwnerRendererComponent, decorators: [{
1556
+ type: Component,
1557
+ args: [{ selector: 'rolatech-course-media-owner-renderer', standalone: true, imports: [AngularCommonModule, MatIconModule], template: "<div class=\"flex flex-row items-center\">\n <div class=\"flex mr-3 gap-2 items-center\">\n @if (avatar()) {\n <div class=\"cursor-pointer\" [routerLink]=\"['/instructors/', '@' + username()]\">\n <img [src]=\"avatar()\" class=\"w-11 h-11 rounded-full\" />\n </div>\n } @else {\n <div class=\"w-11 h-11 rounded-full bg-orange-600\"></div>\n }\n <div class=\"flex items-center text-lg font-bold cursor-pointer\">\n <a [routerLink]=\"['/instructors/', '@' + username()]\">\n <span>{{ name() }}</span>\n </a>\n <mat-icon color=\"primary\">verified</mat-icon>\n </div>\n </div>\n</div>\n", styles: ["mat-icon{transform:scale(.8)}\n"] }]
1558
+ }] });
1559
+
1560
+ class CourseCategoryComponent extends BaseComponent {
1561
+ constructor() {
1562
+ super(...arguments);
1563
+ this.categoryService = inject(CategoryService);
1564
+ this.courseService = inject(CourseService);
1565
+ this.courses = [];
1566
+ this.categories = [];
1567
+ this.loading = false;
1568
+ }
1569
+ ngOnInit() {
1570
+ this.findAllCategories();
1571
+ this.route.paramMap.subscribe((params) => {
1572
+ const id = params.get('id');
1573
+ this.findCategoryById(id);
1574
+ this.findCoursesByCategoryId(id);
1575
+ });
1576
+ }
1577
+ findAllCategories() {
1578
+ this.categoryService.find({}).subscribe({
1579
+ next: (res) => {
1580
+ this.categories = res.data;
1581
+ },
1582
+ });
1583
+ }
1584
+ findCategoryById(id) {
1585
+ this.categoryService.get(id).subscribe({
1586
+ next: (res) => {
1587
+ this.category = res.data;
1588
+ },
1589
+ });
1590
+ }
1591
+ findAllCourses() {
1592
+ this.courseService.find({}).subscribe({
1593
+ next: (res) => {
1594
+ this.courses = res.data;
1595
+ },
1596
+ });
1597
+ }
1598
+ findCoursesByCategoryId(id) {
1599
+ this.loading = true;
1600
+ const options = {
1601
+ filter: `categories:${id},published:true`,
1602
+ };
1603
+ this.courseService.find(options).subscribe({
1604
+ next: (res) => {
1605
+ this.courses = res.data;
1606
+ this.loading = false;
1607
+ },
1608
+ error: (error) => {
1609
+ this.loading = false;
1610
+ },
1611
+ });
1612
+ }
1613
+ loadCoursesByCategory(item) {
1614
+ // [routerLink] = "['../../', item.id]";
1615
+ this.router.navigate([`../../${item.id}`], {
1616
+ relativeTo: this.route,
1617
+ });
1618
+ }
1619
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseCategoryComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1620
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseCategoryComponent, isStandalone: true, selector: "rolatech-course-category", usesInheritance: true, ngImport: i0, template: "<div>\n @if (category) {\n <div class=\"p-3 hidden md:block text-2xl font-medium\">{{ category.name }}</div>\n } @else {\n <div class=\"flex flex-row animate-pulse w-full\">\n <div class=\"h-4 bg-slate-200 rounded col-span-2\"></div>\n </div>\n }\n @if (loading) {\n @for (number of [0, 1, 2, 3, 4, 5]; track number) {\n <div class=\"flex flex-row animate-pulse mt-3 mr-4 cursor-pointer w-full\">\n <div class=\"h-fit w-2/5 md:w-1/4 aspect-video bg-gray-200 rounded-lg\"></div>\n <div class=\"w-3/5 md:w-3/4 ml-3 py-1 flex flex-col justify-between\">\n <div class=\"space-y-3\">\n <div class=\"h-4 bg-slate-200 rounded col-span-2\"></div>\n <div class=\"h-2 bg-slate-200 rounded col-span-1\"></div>\n <div class=\"h-2 bg-slate-200 rounded col-span-1 py-1\"></div>\n </div>\n <div>\n <div class=\"h-2 bg-slate-200 rounded col-span-2 py-1\"></div>\n </div>\n </div>\n </div>\n }\n } @else {\n @for (item of courses; track item) {\n <div class=\"py-2 cursor-pointer min-w-[80%] md:min-w-[33%] hover:bg-gray-100\" [routerLink]=\"['../../', item.id]\">\n <rolatech-course-item [course]=\"item\"></rolatech-course-item>\n </div>\n }\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "directive", type: i1$3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: CourseItemComponent, selector: "rolatech-course-item", inputs: ["course", "row", "inset"] }] }); }
1621
+ }
1622
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseCategoryComponent, decorators: [{
1623
+ type: Component,
1624
+ args: [{ standalone: true, imports: [AngularCommonModule, AngularComponentsModule, CourseItemComponent], selector: 'rolatech-course-category', template: "<div>\n @if (category) {\n <div class=\"p-3 hidden md:block text-2xl font-medium\">{{ category.name }}</div>\n } @else {\n <div class=\"flex flex-row animate-pulse w-full\">\n <div class=\"h-4 bg-slate-200 rounded col-span-2\"></div>\n </div>\n }\n @if (loading) {\n @for (number of [0, 1, 2, 3, 4, 5]; track number) {\n <div class=\"flex flex-row animate-pulse mt-3 mr-4 cursor-pointer w-full\">\n <div class=\"h-fit w-2/5 md:w-1/4 aspect-video bg-gray-200 rounded-lg\"></div>\n <div class=\"w-3/5 md:w-3/4 ml-3 py-1 flex flex-col justify-between\">\n <div class=\"space-y-3\">\n <div class=\"h-4 bg-slate-200 rounded col-span-2\"></div>\n <div class=\"h-2 bg-slate-200 rounded col-span-1\"></div>\n <div class=\"h-2 bg-slate-200 rounded col-span-1 py-1\"></div>\n </div>\n <div>\n <div class=\"h-2 bg-slate-200 rounded col-span-2 py-1\"></div>\n </div>\n </div>\n </div>\n }\n } @else {\n @for (item of courses; track item) {\n <div class=\"py-2 cursor-pointer min-w-[80%] md:min-w-[33%] hover:bg-gray-100\" [routerLink]=\"['../../', item.id]\">\n <rolatech-course-item [course]=\"item\"></rolatech-course-item>\n </div>\n }\n }\n</div>\n" }]
1625
+ }] });
1626
+
1627
+ class CourseDetailComponent extends BaseComponent {
1628
+ constructor() {
1629
+ super();
1630
+ this.status = CourseStatus;
1631
+ this.authService = inject(AuthService);
1632
+ this.authUserService = inject(AuthUserService);
1633
+ this.courseService = inject(CourseService);
1634
+ this.viewportScroller = inject(ViewportScroller);
1635
+ this.courseSectionService = inject(CourseSectionService);
1636
+ this.authenticated = this.authService.authenticated;
1637
+ this.instructorName = '';
1638
+ this.username = '';
1639
+ this.inWishList = false;
1640
+ this.purchased = false;
1641
+ this.sections = [];
1642
+ this.type = CourseSectionLectureContentType;
1643
+ effect(() => {
1644
+ if (this.authenticated()) {
1645
+ this.findPurchasedByCourseId();
1646
+ this.findWishlistBy();
1647
+ }
1648
+ });
1649
+ }
1650
+ ngOnInit() {
1651
+ this.findOne();
1652
+ this.findSections();
1653
+ }
1654
+ scrollToAnchor(anchorId) {
1655
+ // this.viewportScroller.setOffset([100, 100]);
1656
+ document.getElementById(anchorId)?.scrollIntoView({
1657
+ behavior: 'smooth',
1658
+ block: 'start',
1659
+ inline: 'nearest',
1660
+ });
1661
+ }
1662
+ findOne() {
1663
+ this.courseService.get(this.id).subscribe({
1664
+ next: (res) => {
1665
+ this.course = res.data;
1666
+ this.findUserBaseInfo(this.course.instructorId);
1667
+ this.titleService.setTitle(`${this.course.name} - 拼小课`);
1668
+ },
1669
+ });
1670
+ }
1671
+ findSections() {
1672
+ this.courseSectionService.findSections(this.id).subscribe({
1673
+ next: (res) => {
1674
+ this.sections = res.data;
1675
+ },
1676
+ });
1677
+ }
1678
+ findUserBaseInfo(userId) {
1679
+ this.authUserService.getPublicUserInfo(userId).subscribe({
1680
+ next: (res) => {
1681
+ this.instructorName = res.name;
1682
+ this.username = res.username;
1683
+ },
1684
+ });
1685
+ }
1686
+ onWish(e) {
1687
+ if (this.authenticated()) {
1688
+ if (this.inWishList) {
1689
+ this.removeFromWishlist();
1690
+ }
1691
+ else {
1692
+ this.addToWishlist();
1693
+ }
1694
+ }
1695
+ else {
1696
+ this.snackBarService.open('请先登录');
1697
+ }
1698
+ }
1699
+ checkout(e) {
1700
+ if (this.authenticated()) {
1701
+ this.router.navigateByUrl(`/carts/checkout/express/courses/${this.id}`);
1702
+ }
1703
+ else {
1704
+ this.snackBarService.open('请先登录');
1705
+ }
1706
+ }
1707
+ removeFromWishlist() {
1708
+ this.courseService.removeFromWishlist(this.id).subscribe({
1709
+ next: (res) => {
1710
+ this.inWishList = false;
1711
+ },
1712
+ });
1713
+ }
1714
+ addToWishlist() {
1715
+ this.courseService.addToWishlist(this.id).subscribe({
1716
+ next: (res) => {
1717
+ this.inWishList = true;
1718
+ },
1719
+ });
1720
+ }
1721
+ onSection(event) {
1722
+ const { section, lecture } = event;
1723
+ this.router.navigate(['/courses', this.course.id, 'sections', section.id, 'lectures', lecture.id]);
1724
+ }
1725
+ findWishlistBy() {
1726
+ this.courseService.findWishlistBy(this.id).subscribe({
1727
+ next: (res) => {
1728
+ this.inWishList = res.data;
1729
+ },
1730
+ });
1731
+ }
1732
+ findPurchasedByCourseId() {
1733
+ this.courseService.findPurchasedByCourseId(this.id).subscribe({
1734
+ next: (res) => {
1735
+ this.purchased = res.data ? true : false;
1736
+ },
1737
+ });
1738
+ }
1739
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1740
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseDetailComponent, isStandalone: true, selector: "rolatech-course-detail", usesInheritance: true, ngImport: i0, template: "@if (course) {\n <rolatech-app-container>\n <div class=\"flex flex-col-reverse gap-3 md:flex-row w-full justify-between\">\n <div class=\"md:w-3/4\">\n <rolatech-course-info [course]=\"course\" [instructor]=\"instructorName\" [username]=\"username\"> </rolatech-course-info>\n <rolatech-course-sections\n [sections]=\"sections\"\n (section)=\"onSection($event)\"\n (checkout)=\"checkout($event)\"\n [purchased]=\"purchased\"\n ></rolatech-course-sections>\n <rolatech-course-schedule [schedule]=\"course.schedule\"></rolatech-course-schedule>\n <rolatech-course-details [details]=\"course.details\"></rolatech-course-details>\n <rolatech-comments [itemId]=\"course.id\"></rolatech-comments>\n </div>\n <div class=\"md:px-3\">\n <!-- <rolatech-course-media [min]=\"!purchased\" [media]=\"course.media\" [min]=\"true\"></rolatech-course-media> -->\n <rolatech-course-media [media]=\"course.media\" [min]=\"true\"></rolatech-course-media>\n @if (!purchased) {\n <rolatech-course-pricing [pricing]=\"course.pricing\"></rolatech-course-pricing>\n <rolatech-course-action\n [course]=\"course\"\n (checkout)=\"checkout($event)\"\n (wish)=\"onWish($event)\"\n [inWishList]=\"inWishList\"\n ></rolatech-course-action>\n }\n </div>\n </div>\n </rolatech-app-container>\n}\n", styles: ["mat-expansion-panel mat-icon{transform:scale(.8)}\n"], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: CourseInfoComponent, selector: "rolatech-course-info", inputs: ["course", "instructor", "username"] }, { kind: "component", type: CourseSectionsComponent, selector: "rolatech-course-sections", inputs: ["purchased", "sections"], outputs: ["section", "checkout"] }, { kind: "component", type: CourseScheduleComponent, selector: "rolatech-course-schedule", inputs: ["schedule"] }, { kind: "component", type: CourseDetailsComponent, selector: "rolatech-course-details", inputs: ["details", "instructor", "username"] }, { kind: "component", type: CourseMediaComponent, selector: "rolatech-course-media", inputs: ["media", "min"] }, { kind: "component", type: CoursePricingComponent, selector: "rolatech-course-pricing", inputs: ["pricing"] }, { kind: "component", type: CourseActionComponent, selector: "rolatech-course-action", inputs: ["course", "inWishList"], outputs: ["cart", "wish", "checkout"] }, { kind: "component", type: CommentsComponent, selector: "rolatech-comments", inputs: ["itemId"] }, { kind: "component", type: AppContainerComponent, selector: "rolatech-app-container" }] }); }
1741
+ }
1742
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseDetailComponent, decorators: [{
1743
+ type: Component,
1744
+ args: [{ standalone: true, imports: [
1745
+ AngularCommonModule,
1746
+ AngularComponentsModule,
1747
+ CourseInfoComponent,
1748
+ CourseSectionsComponent,
1749
+ CourseScheduleComponent,
1750
+ CourseDetailsComponent,
1751
+ CourseMediaComponent,
1752
+ CoursePricingComponent,
1753
+ CourseActionComponent,
1754
+ CommentsComponent,
1755
+ AppContainerComponent,
1756
+ ], selector: 'rolatech-course-detail', template: "@if (course) {\n <rolatech-app-container>\n <div class=\"flex flex-col-reverse gap-3 md:flex-row w-full justify-between\">\n <div class=\"md:w-3/4\">\n <rolatech-course-info [course]=\"course\" [instructor]=\"instructorName\" [username]=\"username\"> </rolatech-course-info>\n <rolatech-course-sections\n [sections]=\"sections\"\n (section)=\"onSection($event)\"\n (checkout)=\"checkout($event)\"\n [purchased]=\"purchased\"\n ></rolatech-course-sections>\n <rolatech-course-schedule [schedule]=\"course.schedule\"></rolatech-course-schedule>\n <rolatech-course-details [details]=\"course.details\"></rolatech-course-details>\n <rolatech-comments [itemId]=\"course.id\"></rolatech-comments>\n </div>\n <div class=\"md:px-3\">\n <!-- <rolatech-course-media [min]=\"!purchased\" [media]=\"course.media\" [min]=\"true\"></rolatech-course-media> -->\n <rolatech-course-media [media]=\"course.media\" [min]=\"true\"></rolatech-course-media>\n @if (!purchased) {\n <rolatech-course-pricing [pricing]=\"course.pricing\"></rolatech-course-pricing>\n <rolatech-course-action\n [course]=\"course\"\n (checkout)=\"checkout($event)\"\n (wish)=\"onWish($event)\"\n [inWishList]=\"inWishList\"\n ></rolatech-course-action>\n }\n </div>\n </div>\n </rolatech-app-container>\n}\n", styles: ["mat-expansion-panel mat-icon{transform:scale(.8)}\n"] }]
1757
+ }], ctorParameters: () => [] });
1758
+
1759
+ class CourseLayoutComponent extends BaseComponent {
1760
+ constructor() {
1761
+ super(...arguments);
1762
+ this.categories = [];
1763
+ this.categoryService = inject(CategoryService);
1764
+ this.courseService = inject(CourseService);
1765
+ this.selectIndex = 0;
1766
+ }
1767
+ ngOnInit() {
1768
+ this.findCategories();
1769
+ }
1770
+ findCategories() {
1771
+ this.categoryService.find({}).subscribe({
1772
+ next: (res) => {
1773
+ this.categories = res.data;
1774
+ },
1775
+ });
1776
+ }
1777
+ loadCourseByCategoryIndex(index) {
1778
+ this.selectIndex = index;
1779
+ const id = this.categories[index].id;
1780
+ if (index === 0) {
1781
+ this.router.navigate([`/courses`]);
1782
+ // this.courseService.find({}).subscribe({
1783
+ // next: res => {
1784
+ // }
1785
+ // })
1786
+ }
1787
+ else {
1788
+ this.router.navigate([`../courses/categories/${id}`], {
1789
+ relativeTo: this.route,
1790
+ });
1791
+ }
1792
+ }
1793
+ nextCategory() { }
1794
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseLayoutComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1795
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseLayoutComponent, isStandalone: true, selector: "rolatech-course-layout", usesInheritance: true, ngImport: i0, template: "@if (categories) {\n <rolatech-app-container>\n <div class=\"flex flex-col md:flex-row min-w-[320px] max-w-[1280px] m-auto\">\n <div class=\"h-14 md:h-auto min-w-[240px]\">\n <div class=\"hidden md:block text-2xl font-medium py-3 md:px-1 px-3\">\u5206\u7C7B</div>\n <div\n class=\"flex flex-row md:flex-col md:h-full items-center md:items-start h-14 overflow-x-scroll overflow-y-hidden scrollbar-hide whitespace-pre\"\n >\n <a\n class=\"cursor-pointer h-8 bg-gray-200 md:bg-white rounded-md flex items-center md:mb-1 mr-2 md:mr-0\"\n routerLinkActive=\"course-layout-active\"\n routerLink=\"/courses\"\n [routerLinkActiveOptions]=\"{ exact: true }\"\n >\n <span class=\"md:px-1 px-3 text-md md:text-lg\">\u5168\u90E8</span>\n </a>\n @for (category of categories; track category; let index = $index) {\n <a\n class=\"cursor-pointer h-8 bg-gray-200 md:bg-white rounded-md flex items-center mr-2 md:mr-0 md:mb-1\"\n routerLinkActive=\"course-layout-active\"\n [routerLink]=\"['../courses/categories/', category.id]\"\n [routerLinkActiveOptions]=\"{ exact: true }\"\n >\n <span class=\"md:px-1 px-3 text-md md:text-lg\">{{ category.name }}</span>\n </a>\n }\n </div>\n </div>\n <div class=\"w-full\">\n <router-outlet></router-outlet>\n </div>\n </div>\n <!-- <rolatech-list>\n <router-outlet></router-outlet>\n </rolatech-list> -->\n </rolatech-app-container>\n}\n", styles: [".course-layout-active{border-radius:8px;color:#ff4500}@media (max-width: 768px){.course-layout-active{border-radius:8px;background-color:#000;color:#fff}}.scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}\n"], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "directive", type: i1$3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$3.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: i1$3.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: AppContainerComponent, selector: "rolatech-app-container" }] }); }
1796
+ }
1797
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseLayoutComponent, decorators: [{
1798
+ type: Component,
1799
+ args: [{ standalone: true, imports: [AngularCommonModule, AngularComponentsModule, AppContainerComponent, ListComponent], selector: 'rolatech-course-layout', template: "@if (categories) {\n <rolatech-app-container>\n <div class=\"flex flex-col md:flex-row min-w-[320px] max-w-[1280px] m-auto\">\n <div class=\"h-14 md:h-auto min-w-[240px]\">\n <div class=\"hidden md:block text-2xl font-medium py-3 md:px-1 px-3\">\u5206\u7C7B</div>\n <div\n class=\"flex flex-row md:flex-col md:h-full items-center md:items-start h-14 overflow-x-scroll overflow-y-hidden scrollbar-hide whitespace-pre\"\n >\n <a\n class=\"cursor-pointer h-8 bg-gray-200 md:bg-white rounded-md flex items-center md:mb-1 mr-2 md:mr-0\"\n routerLinkActive=\"course-layout-active\"\n routerLink=\"/courses\"\n [routerLinkActiveOptions]=\"{ exact: true }\"\n >\n <span class=\"md:px-1 px-3 text-md md:text-lg\">\u5168\u90E8</span>\n </a>\n @for (category of categories; track category; let index = $index) {\n <a\n class=\"cursor-pointer h-8 bg-gray-200 md:bg-white rounded-md flex items-center mr-2 md:mr-0 md:mb-1\"\n routerLinkActive=\"course-layout-active\"\n [routerLink]=\"['../courses/categories/', category.id]\"\n [routerLinkActiveOptions]=\"{ exact: true }\"\n >\n <span class=\"md:px-1 px-3 text-md md:text-lg\">{{ category.name }}</span>\n </a>\n }\n </div>\n </div>\n <div class=\"w-full\">\n <router-outlet></router-outlet>\n </div>\n </div>\n <!-- <rolatech-list>\n <router-outlet></router-outlet>\n </rolatech-list> -->\n </rolatech-app-container>\n}\n", styles: [".course-layout-active{border-radius:8px;color:#ff4500}@media (max-width: 768px){.course-layout-active{border-radius:8px;background-color:#000;color:#fff}}.scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}\n"] }]
1800
+ }] });
1801
+
1802
+ class CourseSectionContentComponent {
1803
+ constructor() {
1804
+ this.route = inject(ActivatedRoute);
1805
+ this.router = inject(Router);
1806
+ this.courseSectionService = inject(CourseSectionService);
1807
+ this.courseService = inject(CourseService);
1808
+ this.authService = inject(AuthService);
1809
+ this.authUserService = inject(AuthUserService);
1810
+ this.el = inject(ElementRef);
1811
+ this.platformId = inject(PLATFORM_ID);
1812
+ this.authenticated = this.authService.authenticated;
1813
+ this.sections = [];
1814
+ this.courseId = '';
1815
+ this.sectionId = '';
1816
+ this.lectureId = '';
1817
+ this.videoUrl = '';
1818
+ this.instructorName = '';
1819
+ this.instructorAvatar = '';
1820
+ this.instructorUsername = '';
1821
+ this.purchased = false;
1822
+ effect(() => {
1823
+ if (this.authenticated()) {
1824
+ this.findPurchasedByCourseId();
1825
+ }
1826
+ });
1827
+ }
1828
+ ngOnInit() {
1829
+ this.route.params.subscribe((params) => {
1830
+ this.courseId = params['id'];
1831
+ this.sectionId = params['sectionId'];
1832
+ this.lectureId = params['lectureId'];
1833
+ this.findCourse(this.courseId);
1834
+ this.findSections(this.courseId);
1835
+ });
1836
+ }
1837
+ ngOnDestroy() {
1838
+ if (this.player) {
1839
+ this.player.destroy();
1840
+ }
1841
+ }
1842
+ ngAfterViewInit() { }
1843
+ initPlayer(url, thumbnail) {
1844
+ if (!isPlatformBrowser(this.platformId)) {
1845
+ return;
1846
+ }
1847
+ // 'https://cos-video-1258344699.cos.ap-guangzhou.tencentcos.cn/test.mp4',
1848
+ if (!this.player) {
1849
+ const playerContainer = this.el.nativeElement.querySelector('#dplayer');
1850
+ this.player = new DPlayer({
1851
+ container: playerContainer,
1852
+ screenshot: true,
1853
+ preload: 'metadata',
1854
+ video: {
1855
+ url: url,
1856
+ pic: thumbnail,
1857
+ },
1858
+ });
1859
+ }
1860
+ else {
1861
+ this.player.switchVideo({
1862
+ url: url,
1863
+ pic: thumbnail,
1864
+ });
1865
+ }
1866
+ }
1867
+ findSections(courseId) {
1868
+ this.courseSectionService.findSections(courseId).subscribe({
1869
+ next: (res) => {
1870
+ this.sections = res.data;
1871
+ const section = this.sections.find((item) => item.id === this.sectionId);
1872
+ const letcture = section?.lectures.find((item) => item.id === this.lectureId);
1873
+ this.videoUrl = letcture?.item.url;
1874
+ const thumbnail = letcture?.item.thumbnail;
1875
+ this.initPlayer(this.videoUrl, thumbnail);
1876
+ },
1877
+ });
1878
+ }
1879
+ findCourse(courseId) {
1880
+ this.courseService.get(courseId).subscribe({
1881
+ next: (res) => {
1882
+ this.course = res.data;
1883
+ this.findUserBaseInfo(this.course.instructorId);
1884
+ },
1885
+ });
1886
+ }
1887
+ findUserBaseInfo(userId) {
1888
+ this.authUserService.getPublicUserInfo(userId).subscribe({
1889
+ next: (res) => {
1890
+ this.instructorName = res.name;
1891
+ this.instructorAvatar = res.avatar;
1892
+ this.instructorUsername = res.username;
1893
+ },
1894
+ });
1895
+ }
1896
+ findPurchasedByCourseId() {
1897
+ this.courseService.findPurchasedByCourseId(this.courseId).subscribe({
1898
+ next: (res) => {
1899
+ this.purchased = res.data ? true : false;
1900
+ },
1901
+ });
1902
+ }
1903
+ onSection(event) {
1904
+ const { section, lecture } = event;
1905
+ this.router.navigate(['/courses', this.courseId, 'sections', section.id, 'lectures', lecture.id]);
1906
+ }
1907
+ checkout(e) {
1908
+ this.router.navigateByUrl(`/carts/checkout/express/courses/${this.courseId}`);
1909
+ }
1910
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1911
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.1", type: CourseSectionContentComponent, isStandalone: true, selector: "rolatech-course-section-content", ngImport: i0, template: "<div class=\"flex lg:flex-row flex-col justify-between w-full mt-2 lg:mt-4\">\n <div class=\"lg:w-[70%] flex flex-col items-start justify-center px-4 lg:px-6 h-fit\">\n <div id=\"dplayer\" class=\"w-full h-auto aspect-video rounded-xl\"></div>\n <div class=\"py-3 w-full\">\n @if (course) {\n <div class=\"text-xl font-medium py-3\">\n {{ course.name }}\n </div>\n <div>\n <rolatech-course-media-owner-renderer\n [name]=\"instructorName\"\n [avatar]=\"instructorAvatar\"\n [username]=\"instructorUsername\"\n ></rolatech-course-media-owner-renderer>\n </div>\n <div class=\"hidden lg:block\">\n <rolatech-comments [itemId]=\"lectureId\"></rolatech-comments>\n </div>\n }\n </div>\n </div>\n <div class=\"lg:w-[30%] px-4 lg:px-0 lg:pr-6\">\n <rolatech-course-sections\n [sections]=\"sections\"\n [purchased]=\"purchased\"\n (section)=\"onSection($event)\"\n (checkout)=\"checkout($event)\"\n ></rolatech-course-sections>\n </div>\n <div class=\"lg:hidden block px-4 lg:px-6\">\n <rolatech-comments [itemId]=\"lectureId\"></rolatech-comments>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: CourseSectionsComponent, selector: "rolatech-course-sections", inputs: ["purchased", "sections"], outputs: ["section", "checkout"] }, { kind: "component", type: CourseMediaOwnerRendererComponent, selector: "rolatech-course-media-owner-renderer", inputs: ["name", "avatar", "username"] }, { kind: "component", type: CommentsComponent, selector: "rolatech-comments", inputs: ["itemId"] }] }); }
1912
+ }
1913
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: CourseSectionContentComponent, decorators: [{
1914
+ type: Component,
1915
+ args: [{ standalone: true, imports: [
1916
+ AngularCommonModule,
1917
+ AngularComponentsModule,
1918
+ CourseSectionsComponent,
1919
+ CourseMediaOwnerRendererComponent,
1920
+ CommentsComponent,
1921
+ ], selector: 'rolatech-course-section-content', template: "<div class=\"flex lg:flex-row flex-col justify-between w-full mt-2 lg:mt-4\">\n <div class=\"lg:w-[70%] flex flex-col items-start justify-center px-4 lg:px-6 h-fit\">\n <div id=\"dplayer\" class=\"w-full h-auto aspect-video rounded-xl\"></div>\n <div class=\"py-3 w-full\">\n @if (course) {\n <div class=\"text-xl font-medium py-3\">\n {{ course.name }}\n </div>\n <div>\n <rolatech-course-media-owner-renderer\n [name]=\"instructorName\"\n [avatar]=\"instructorAvatar\"\n [username]=\"instructorUsername\"\n ></rolatech-course-media-owner-renderer>\n </div>\n <div class=\"hidden lg:block\">\n <rolatech-comments [itemId]=\"lectureId\"></rolatech-comments>\n </div>\n }\n </div>\n </div>\n <div class=\"lg:w-[30%] px-4 lg:px-0 lg:pr-6\">\n <rolatech-course-sections\n [sections]=\"sections\"\n [purchased]=\"purchased\"\n (section)=\"onSection($event)\"\n (checkout)=\"checkout($event)\"\n ></rolatech-course-sections>\n </div>\n <div class=\"lg:hidden block px-4 lg:px-6\">\n <rolatech-comments [itemId]=\"lectureId\"></rolatech-comments>\n </div>\n</div>\n" }]
1922
+ }], ctorParameters: () => [] });
1923
+
1924
+ const courseRoutes = [
1925
+ {
1926
+ path: '',
1927
+ component: CourseLayoutComponent,
1928
+ children: [
1929
+ {
1930
+ path: '',
1931
+ loadComponent: () => import('./rolatech-angular-course-course-index.component-Bm6Sg8zH.mjs').then((x) => x.CourseIndexComponent),
1932
+ },
1933
+ {
1934
+ path: 'categories/:id',
1935
+ component: CourseCategoryComponent,
1936
+ },
1937
+ ],
1938
+ },
1939
+ {
1940
+ path: ':id',
1941
+ component: CourseDetailComponent,
1942
+ },
1943
+ {
1944
+ path: ':id/sections/:sectionId/lectures/:lectureId',
1945
+ component: CourseSectionContentComponent,
1946
+ },
1947
+ {
1948
+ path: 'my-courses',
1949
+ component: CourseDetailComponent,
1950
+ },
1951
+ ];
1952
+
1953
+ /**
1954
+ * Generated bundle index. Do not edit.
1955
+ */
1956
+
1957
+ export { CourseMediaOwnerRendererComponent as A, CourseSectionLectureVideoDialogComponent as B, CourseService as C, ScheduleItemComponent as D, DetailItemComponent as E, courseItem_component as F, PricingItemComponent as P, ScheduleDate as S, CategoryService as a, CourseStatus as b, courseRoutes as c, CourseRequestStatus as d, CourseType as e, CourseReviewStatus as f, CourseSectionLectureContentType as g, CoursePreviewComponent as h, CourseInfoComponent as i, CourseMediaComponent as j, CoursePricingComponent as k, CourseActionComponent as l, CourseScheduleComponent as m, CourseSectionsComponent as n, CourseSectionItemComponent as o, provideAngulaCourse as p, CourseSectionLectureItemComponent as q, CourseSectionLectureVideoItemComponent as r, CourseItemComponent as s, CoursePricingAddDialogComponent as t, CourseScheduleAddDialogComponent as u, CoursePricingDialogComponent as v, CourseScheduleDialogComponent as w, CourseDetailsDialogComponent as x, CourseEditDialogComponent as y, CourseDetailsComponent as z };
1958
+ //# sourceMappingURL=rolatech-angular-course-rolatech-angular-course-D-_W2GtF.mjs.map