PageSourceSearch

https://office.workvine.nl/chunk-5AR6572Q.js

js workvine.nl collected 2026-10-09 01:41:19 UTC 50,355 bytes, 1,136 lines download raw bytes

1import { MatDatepicker, MatDatepickerInput, MatDatepickerModule, MatDatepickerToggle } from "./chunk-DDEKHFCQ.js";
2import { NgxEditorModule } from "./chunk-HMG6THTW.js";
3import { MatSelect, MatSelectModule } from "./chunk-7EAOBTD7.js";
4import { MatOption } from "./chunk-2SDCWOQR.js";
5import { MatIcon, MatIconModule } from "./chunk-BFO5WUGI.js";
6import { CdkTextareaAutosize, DefaultValueAccessor, FormControl, FormControlName, FormGroup, FormGroupDirective, MatError, MatFormField, MatFormFieldModule, MatInput, MatInputModule, MatLabel, MatSuffix, NgControlStatus, NgControlStatusGroup, ReactiveFormsModule, Validators, ɵNgNoValidate } from "./chunk-CULTIHLT.js";
7import { MatButton, MatButtonModule } from "./chunk-L27SLIL4.js";
8import { AuthenticationService, Firestore, Timestamp, addDoc, collection2 as collection, collectionSnapshots, doc, endBefore, getDocs2 as getDocs, limit2 as limit, limitToLast, orderBy, query2 as query, startAfter, updateDoc, where2 as where } from "./chunk-2TSZT3SZ.js";
9import { Component, EventEmitter, Injectable, Input, Output, Subject, __spreadProps, __spreadValues, distinctUntilChanged, from, map, setClassMetadata, switchMap, take, takeUntil, ɵsetClassDebugInfo, ɵɵadvance, ɵɵclassProp, ɵɵconditional, ɵɵconditionalCreate, ɵɵdefineComponent, ɵɵdefineInjectable, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵgetCurrentView, ɵɵi18n, ɵɵinject, ɵɵlistener, ɵɵnextContext, ɵɵproperty, ɵɵreference, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵresetView, ɵɵrestoreView, ɵɵstyleProp, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1 } from "./chunk-ZGC4HH7K.js";
10
11// src/app/_services/action.service.ts
12var ActionService = class _ActionService {
13  constructor(firestore, authService) {
14    this.firestore = firestore;
15    this.authService = authService;
16  }
17  getActionsCount(employeeId) {
18    return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => {
19      const colRef = collection(this.firestore, "organizations", session.orgId, "actions");
20      let q = query(colRef, where("employeeId", "==", employeeId));
21      return getDocs(q);
22    }), map(countSnapshot => {
23      return countSnapshot.docs.length;
24    }));
25  }
26  // Split of the employee's open actions into "on track" and "overdue" buckets. The
27  // status filter runs server-side; the due-date split runs client-side because Firestore
28  // only supports a single range filter per query and the widget needs both counts in one
29  // round-trip. Used by the ehr-overdue-actions-widget pie chart.
30  getOpenActionsBreakdown(employeeId) {
31    return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => {
32      const colRef = collection(this.firestore, "organizations", session.orgId, "actions");
33      const q = query(colRef, where("employeeId", "==", employeeId), where("status", "==", "open"));
34      return from(getDocs(q));
35    }), map(snap => {
36      const nowMs = Timestamp.now().toMillis();
37      let open = 0;
38      let overdue = 0;
39      for (const docSnap of snap.docs) {
40        const data = docSnap.data();
41        const dueMs = data.dueDate?.toMillis() ?? 0;
42        if (dueMs && dueMs < nowMs) overdue++;else open++;
43      }
44      return {
45        open,
46        overdue
47      };
48    }));
49  }
50  // All open actions for an employee, no limit. Used by the personal-dashboard variant of
51  // ehr-actions-widget (showPersonal=true) where we want the complete picture, not the
52  // top-5. Server-side filtered; ordered by dueDate ascending so the most urgent show first.
53  getAllOpenActions(employeeId) {
54    return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => {
55      const colRef = collection(this.firestore, "organizations", session.orgId, "actions");
56      const q = query(colRef, where("employeeId", "==", employeeId), where("status", "==", "open"), orderBy("dueDate", "asc"));
57      return collectionSnapshots(q);
58    }), map(snapshots => snapshots.map(doc2 => __spreadProps(__spreadValues({}, doc2.data()), {
59      id: doc2.id,
60      exists: doc2.exists()
61    }))));
62  }
63  getLatestOpenActions(employeeId) {
64    return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => {
65      const colRef = collection(this.firestore, "organizations", session.orgId, "actions");
66      let q = query(colRef, where("employeeId", "==", employeeId), where("status", "==", "open"), orderBy("dueDate", "asc"), limit(5));
67      return collectionSnapshots(q);
68    }), map(snapshots => snapshots.map(doc2 => {
69      return __spreadProps(__spreadValues({}, doc2.data()), {
70        id: doc2.id,
71        exists: doc2.exists()
72      });
73    })));
74  }
75  updateActions(actionId, action) {
76    return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => {
77      const actionRef = doc(this.firestore, "organizations", session.orgId, "actions", actionId);
78      action.completedAt = Timestamp.now();
79      action.completedBy = session.employeeId;
80      return updateDoc(actionRef, action);
81    }));
82  }
83  createAction(action) {
84    return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => {
85      const colRef = collection(this.firestore, "organizations", session.orgId, "actions");
86      action.createdBy = session.employeeId;
87      action.createdAt = Timestamp.now();
88      return addDoc(colRef, action);
89    }));
90  }
91  // Pagination
92  getActionCountByEmployeeId(employeeId, status) {
93    return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => {
94      const colRef = collection(this.firestore, "organizations", session.orgId, "actions");
95      let q = query(colRef, where("employeeId", "==", employeeId));
96      if (status && status !== "all") {
97        q = query(q, where("status", "==", status));
98      }
99      return getDocs(q);
100    }), map(snapshot => snapshot.docs.length));
101  }
102  getActionsByEmployeeIdFirstPage(employeeId, perPage, orderByField, sortDirection, status) {
103    return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => {
104      const colRef = collection(this.firestore, "organizations", session.orgId, "actions");
105      let q = query(colRef, where("employeeId", "==", employeeId), orderBy(orderByField, sortDirection), orderBy("dueDate", "asc"), limit(perPage));
106      if (status && status !== "all") {
107        q = query(q, where("status", "==", status));
108      }
109      return getDocs(q);
110    }), map(snapshot => {
111      const result = snapshot.docs.map(doc2 => {
112        return __spreadProps(__spreadValues({}, doc2.data()), {
113          id: doc2.id,
114          exists: doc2.exists()
115        });
116      });
117      return {
118        result,
119        lastVisible: snapshot.docs[snapshot.docs.length - 1],
120        firstVisible: snapshot.docs[0]
121      };
122    }));
123  }
124  getActionsByEmployeeIdNextPage(employeeId, fieldValue, perPage, orderByField = "startDateFormat", sortDirection = "desc", status) {
125    return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => {
126      const colRef = collection(this.firestore, "organizations", session.orgId, "actions");
127      let q = query(colRef, where("employeeId", "==", employeeId), orderBy(orderByField, sortDirection), orderBy("dueDate", "asc"), startAfter(fieldValue), limit(perPage));
128      if (status && status !== "all") {
129        q = query(q, where("status", "==", status));
130      }
131      return getDocs(q);
132    }), map(snapshot => {
133      const result = snapshot.docs.map(doc2 => {
134        return __spreadProps(__spreadValues({}, doc2.data()), {
135          id: doc2.id,
136          exists: doc2.exists()
137        });
138      });
139      return {
140        result,
141        lastVisible: snapshot.docs[snapshot.docs.length - 1],
142        firstVisible: snapshot.docs[0]
143      };
144    }));
145  }
146  getActionsByEmployeeIdPrevPage(employeeId, fieldValue, perPage, orderByField = "startDateFormat", sortDirection = "desc", status) {
147    return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => {
148      const colRef = collection(this.firestore, "organizations", session.orgId, "actions");
149      let q = query(colRef, where("employeeId", "==", employeeId), orderBy(orderByField, sortDirection), orderBy("dueDate", "asc"), endBefore(fieldValue), limitToLast(perPage));
150      if (status && status !== "all") {
151        q = query(q, where("status", "==", status));
152      }
153      return getDocs(q);
154    }), map(snapshot => {
155      const result = snapshot.docs.map(doc2 => {
156        return __spreadProps(__spreadValues({}, doc2.data()), {
157          id: doc2.id,
158          exists: doc2.exists()
159        });
160      });
161      return {
162        result,
163        lastVisible: snapshot.docs[snapshot.docs.length - 1],
164        firstVisible: snapshot.docs[0]
165      };
166    }));
167  }
168  getAssociatedActionsCount(associatedId) {
169    return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => {
170      const colRef = collection(this.firestore, "organizations", session.orgId, "actions");
171      let q = query(colRef, where("associatedId", "==", associatedId));
172      return getDocs(q);
173    }), map(countSnapshot => {
174      return countSnapshot.docs.length;
175    }));
176  }
177  getAssociatedActions(associatedId) {
178    return this.authService.getCurrentSession$().pipe(take(1), switchMap(session => {
179      const colRef = collection(this.firestore, "organizations", session.orgId, "actions");
180      let q = query(colRef, where("associatedId", "==", associatedId), orderBy("dueDate", "asc"));
181      return collectionSnapshots(q);
182    }), map(snapshots => snapshots.map(doc2 => {
183      return __spreadProps(__spreadValues({}, doc2.data()), {
184        id: doc2.id,
185        exists: doc2.exists()
186      });
187    }
187)));
188  }
189  static {
190    this.ɵfac = function ActionService_Factory(__ngFactoryType__) {
191      return new (__ngFactoryType__ || _ActionService)(ɵɵinject(Firestore), ɵɵinject(AuthenticationService));
192    };
193  }
194  static {
195    this.ɵprov = /* @__PURE__ */ɵɵdefineInjectable({
196      token: _ActionService,
197      factory: _ActionService.ɵfac,
198      providedIn: "root"
199    });
200  }
201};
202(() => {
203  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ActionService, [{
204    type: Injectable,
205    args: [{
206      providedIn: "root"
207    }]
208  }], () => [{
209    type: Firestore
210  }, {
211    type: AuthenticationService
212  }], null);
213})();
214
215// src/app/_secure/_shared/ehr-action-form/ehr-action-form.component.ts
216function ActionFormComponent_Conditional_4_Template(rf, ctx) {
217  if (rf & 1) {
218    ɵɵelementStart(0, "div", 23);
219    ɵɵtext(1);
220    ɵɵelementEnd();
221  }
222  if (rf & 2) {
223    const ctx_r0 = ɵɵnextContext();
224    ɵɵadvance();
225    ɵɵtextInterpolate(ctx_r0.title);
226  }
227}
228function ActionFormComponent_Conditional_7_Conditional_5_Template(rf, ctx) {
229  if (rf & 1) {
230    ɵɵelementStart(0, "mat-error");
231    ɵɵi18n(1, 6);
232    ɵɵelementEnd();
233  }
234}
235function ActionFormComponent_Conditional_7_Conditional_14_Template(rf, ctx) {
236  if (rf & 1) {
237    ɵɵelementStart(0, "mat-error");
238    ɵɵi18n(1, 7);
239    ɵɵelementEnd();
240  }
241}
242function ActionFormComponent_Conditional_7_Template(rf, ctx) {
243  if (rf & 1) {
244    ɵɵelementStart(0, "div", 32)(1, "mat-form-field", 33)(2, "mat-label");
245    ɵɵi18n(3, 4);
246    ɵɵelementEnd();
247    ɵɵelement(4, "input", 34);
248    ɵɵconditionalCreate(5, ActionFormComponent_Conditional_7_Conditional_5_Template, 2, 0, "mat-error");
249    ɵɵelementEnd()();
250    ɵɵelementStart(6, "div", 35)(7, "mat-form-field", 36)(8, "mat-label");
251    ɵɵi18n(9, 5);
252    ɵɵelementEnd();
253    ɵɵelement(10, "input", 37)(11, "mat-datepicker-toggle", 38)(12, "mat-datepicker", 39, 0);
254    ɵɵconditionalCreate(14, ActionFormComponent_Conditional_7_Conditional_14_Template, 2, 0, "mat-error");
255    ɵɵelementEnd()();
256  }
257  if (rf & 2) {
258    let tmp_2_0;
259    let tmp_7_0;
260    const dueDatePicker_r2 = ɵɵreference(13);
261    const ctx_r0 = ɵɵnextContext();
262    ɵɵadvance(5);
263    ɵɵconditional(((tmp_2_0 = ctx_r0.actionForm.get("title")) == null ? null : tmp_2_0.hasError("required")) ? 5 : -1);
264    ɵɵadvance(2);
265    ɵɵstyleProp("padding-top", 0, "rem");
266    ɵɵadvance(3);
267    ɵɵproperty("matDatepicker", dueDatePicker_r2)("matDatepickerFilter", ctx_r0.startDateFilter);
268    ɵɵadvance();
269    ɵɵproperty("for", dueDatePicker_r2);
270    ɵɵadvance(3);
271    ɵɵconditional(((tmp_7_0 = ctx_r0.actionForm.get("dueDate")) == null ? null : tmp_7_0.hasError("required")) ? 14 : -1);
272  }
273}
274function ActionFormComponent_Conditional_8_For_6_Template(rf, ctx) {
275  if (rf & 1) {
276    ɵɵelementStart(0, "mat-option", 43);
277    ɵɵtext(1);
278    ɵɵelementEnd();
279  }
280  if (rf & 2) {
281    const type_r3 = ctx.$implicit;
282    ɵɵproperty("value", type_r3.value);
283    ɵɵadvance();
284    ɵɵtextInterpolate1(" ", type_r3.label, " ");
285  }
286}
287function ActionFormComponent_Conditional_8_Conditional_7_Template(rf, ctx) {
288  if (rf & 1) {
289    ɵɵelementStart(0, "mat-error");
290    ɵɵi18n(1, 11);
291    ɵɵelementEnd();
292  }
293}
294function ActionFormComponent_Conditional_8_Conditional_16_Template(rf, ctx) {
295  if (rf & 1) {
296    ɵɵelementStart(0, "mat-error");
297    ɵɵi18n(1, 12);
298    ɵɵelementEnd();
299  }
300}
301function ActionFormComponent_Conditional_8_Conditional_17_Conditional_1_For_5_Template(rf, ctx) {
302  if (rf & 1) {
303    ɵɵelementStart(0, "mat-option", 43);
304    ɵɵtext(1);
305    ɵɵelementEnd();
306  }
307  if (rf & 2) {
308    const item_r4 = ctx.$implicit;
309    const ctx_r0 = ɵɵnextContext(4);
310    ɵɵproperty("value", item_r4);
311    ɵɵadvance();
312    ɵɵtextInterpolate1(" ", ctx_r0.getType(item_r4), " ");
313  }
314}
315function ActionFormComponent_Conditional_8_Conditional_17_Conditional_1_Conditional_6_Template(rf, ctx) {
316  if (rf & 1) {
317    ɵɵelementStart(0, "mat-error");
318    ɵɵi18n(1, 14);
319    ɵɵelementEnd();
320  }
321}
322function ActionFormComponent_Conditional_8_Conditional_17_Conditional_1_Template(rf, ctx) {
323  if (rf & 1) {
324    ɵɵelementStart(0, "mat-form-field", 41)(1, "mat-label");
325    ɵɵi18n(2, 13);
326    ɵɵelementEnd();
327    ɵɵelementStart(3, "mat-select", 45);
328    ɵɵrepeaterCreate(4, ActionFormComponent_Conditional_8_Conditional_17_Conditional_1_For_5_Template, 2, 2, "mat-option", 43, ɵɵrepeaterTrackByIdentity);
329    ɵɵelementEnd();
330    ɵɵconditionalCreate(6, ActionFormComponent_Conditional_8_Conditional_17_Conditional_1_Conditional_6_Template, 2, 0, "mat-error");
331    ɵɵelementEnd();
332  }
333  if (rf & 2) {
334    let tmp_5_0;
335    const ctx_r0 = ɵɵnextContext(3);
336    ɵɵadvance(4);
337    ɵɵrepeater(ctx_r0.recordTypes);
338    ɵɵadvance(2);
339    ɵɵconditional(((tmp_5_0 = ctx_r0.actionForm.get("recordType")) == null ? null : tmp_5_0.value) !== null && ((tmp_5_0 = ctx_r0.actionForm.get("recordType")) == null ? null : tmp_5_0.hasError("required")) ? 6 : -1);
340  }
341}
342function ActionFormComponent_Conditional_8_Conditional_17_Conditional_2_Conditional_6_Template(rf, ctx) {
343  if (rf & 1) {
344    ɵɵelementStart(0, "mat-error");
345    ɵɵi18n(1, 16);
346    ɵɵelementEnd();
347  }
348}
349function ActionFormComponent_Conditional_8_Conditional_17_Conditional_2_Template(rf, ctx) {
350  if (rf & 1) {
351    const _r5 = ɵɵgetCurrentView();
352    ɵɵelementStart(0, "mat-form-field", 41)(1, "mat-label");
353    ɵɵi18n(2, 15);
354    ɵɵelementEnd();
355    ɵɵelement(3, "input", 46);
356    ɵɵelementStart(4, "mat-icon", 47);
357    ɵɵlistener("click", function ActionFormComponent_Conditional_8_Conditional_17_Conditional_2_Template_mat_icon_click_4_listener() {
358      let tmp_5_0;
359      ɵɵrestoreView(_r5);
360      const ctx_r0 = ɵɵnextContext(3);
361      return ɵɵresetView((tmp_5_0 = ctx_r0.actionForm.get("recordType")) == null ? null : tmp_5_0.patchValue(null));
362    });
363    ɵɵtext(5, "close ");
364    ɵɵelementEnd();
365    ɵɵconditionalCreate(6, ActionFormComponent_Conditional_8_Conditional_17_Conditional_2_Conditional_6_Template, 2, 0, "mat-error");
366    ɵɵelementEnd();
367  }
368  if (rf & 2) {
369    let tmp_4_0;
370    const ctx_r0 = ɵɵnextContext(3);
371    ɵɵadvance(6);
372    ɵɵconditional(((tmp_4_0 = ctx_r0.actionForm.get("recordType")) == null ? null : tmp_4_0.value) !== null && ((tmp_4_0 = ctx_r0.actionForm.get("recordType")) == null ? null : tmp_4_0.hasError("required")) ? 6 : -1);
373  }
374}
375function ActionFormComponent_Conditional_8_Conditional_17_Template(rf, ctx) {
376  if (rf & 1) {
377    ɵɵelementStart(0, "div", 40);
378    ɵɵconditionalCreate(1, ActionFormComponent_Conditional_8_Conditional_17_Conditional_1_Template, 7, 1, "mat-form-field", 41)(2, ActionFormComponent_Conditional_8_Conditional_17_Conditional_2_Template, 7, 1, "mat-form-field", 41);
379    ɵɵelementEnd();
380  }
381  if (rf & 2) {
382    let tmp_3_0;
383    const ctx_r0 = ɵɵnextContext(2);
384    ɵɵadvance();
385    ɵɵconditional(((tmp_3_0 = ctx_r0.actionForm.get("recordType")) == null ? null : tmp_3_0.value) === "idCard" || ((tmp_3_0 = ctx_r0.actionForm.get("recordType")) == null ? null : tmp_3_0.value) === "residencePermit" || ((tmp_3_0 = ctx_r0.actionForm.get("recordType")) == null ? null : tmp_3_0.value) === "taxRecord" || ((tmp_3_0 = ctx_r0.actionForm.get("recordType")) == null ? null : tmp_3_0.value) === "certificate" || ((tmp_3_0 = ctx_r0.actionForm.get("recordType")) == null ? null : tmp_3_0.value) === "workPermit" || ((tmp_3_0 = ctx_r0.actionForm.get("recordType")) == null ? null : tmp_3_0.value) === "ssn" || ((tmp_3_0 = ctx_r0.actionForm.get("recordType")) == null ? null : tmp_3_0.value) === "passport" || ((tmp_3_0 = ctx_r0.actionForm.get("recordType")) == null ? null : tmp_3_0.value) === null ? 1 : 2);
386  }
387}
388function ActionFormComponent_Conditional_8_Conditional_23_Template(rf, ctx) {
389  if (rf & 1) {
390    ɵɵelementStart(0, "mat-error");
391    ɵɵi18n(1, 17);
392    ɵɵelementEnd();
393  }
394}
395function ActionFormComponent_Conditional_8_Template(rf, ctx) {
396  if (rf & 1) {
397    ɵɵelementStart(0, "div", 40)(1, "mat-form-field", 41)(2, "mat-label");
398    ɵɵi18n(3, 8);
399    ɵɵelementEnd();
400    ɵɵelementStart(4, "mat-select", 42);
401    ɵɵrepeaterCreate(5, ActionFormComponent_Conditional_8_For_6_Template, 2, 2, "mat-option", 43, ɵɵrepeaterTrackByIdentity);
402    ɵɵelementEnd();
403    ɵɵconditionalCreate(7, ActionFormComponent_Conditional_8_Conditional_7_Template, 2, 0, "mat-error");
404    ɵɵelementEnd()();
405    ɵɵelementStart(8, "div", 40)(9, "mat-form-field", 36)(10, "mat-label");
406    ɵɵi18n(11, 9);
407    ɵɵelementEnd();
408    ɵɵelement(12, "input", 37)(13, "mat-datepicker-toggle", 38)(14, "mat-datepicker", 39, 0);
409    ɵɵconditionalCreate(16, ActionFormComponent_Conditional_8_Conditional_16_Template, 2, 0, "mat-error");
410    ɵɵelementEnd()();
411    ɵɵconditionalCreate(17, ActionFormComponent_Conditional_8_Conditional_17_Template, 3, 1, "div", 40);
412    ɵɵelementStart(18, "div", 26)(19, "mat-form-field", 33)(20, "mat-label");
413    ɵɵi18n(21, 10);
414    ɵɵelementEnd();
415    ɵɵelement(22, "input", 44);
416    ɵɵconditionalCreate(23, ActionFormComponent_Conditional_8_Conditional_23_Template, 2, 0, "mat-error");
417    ɵɵelementEnd()();
418  }
419  if (rf & 2) {
420    let tmp_3_0;
421    let tmp_7_0;
422    let tmp_8_0;
423    let tmp_9_0;
424    let tmp_10_0;
425    const dueDatePicker_r6 = ɵɵreference(15);
426    const ctx_r0 = ɵɵnextContext();
427    ɵɵadvance(5);
428    ɵɵrepeater(ctx_r0.actionTypes);
429    ɵɵadvance(2);
430    ɵɵconditional(((tmp_3_0 = ctx_r0.actionForm.get("actionType")) == null ? null : tmp_3_0.hasError("required")) ? 7 : -1);
431    ɵɵadvance(5);
432    ɵɵproperty("matDatepicker", dueDatePicker_r6)("matDatepickerFilter", ctx_r0.startDateFilter);
433    ɵɵadvance();
434    ɵɵproperty("for", dueDatePicker_r6);
435    ɵɵadvance(3);
436    ɵɵconditional(((tmp_7_0 = ctx_r0.actionForm.get("dueDate")) == null ? null : tmp_7_0.hasError("required")) ? 16 : -1);
437    ɵɵadvance();
438    ɵɵconditional(((tmp_8_0 = ctx_r0.actionForm.get("actionType")) == null ? null : tmp_8_0.value) === "identification" ? 17 : -1);
439    ɵɵadvance();
440    ɵɵclassProp("ehr-form-field-wrapper--2-cols", ((tmp_9_0 = ctx_r0.actionForm.get("actionType")) == null ? null : tmp_9_0.value) === "identification");
441    ɵɵadvance(5);
442    ɵɵconditional(((tmp_10_0 = ctx_r0.actionForm.get("title")) == null ? null : tmp_10_0.hasError("required")) ? 23 : -1);
443  }
444}
445function ActionFormComponent_Conditional_14_Template(rf, ctx) {
446  if (rf & 1) {
447    ɵɵelementStart(0, "mat-error");
448    ɵɵi18n(1, 18);
449    ɵɵelementEnd();
450  }
451}
452var ActionFormComponent = class _ActionFormComponent {
453  constructor() {
454    this.canCreateID = false;
455    this.loading = false;
456    this.isMilestone = false;
457    this.submitForm = new EventEmitter();
458    this.cancelForm = new EventEmitter();
459    this.actionForm = new FormGroup({
460      title: new FormControl("", Validators.required),
461      description: new FormControl("", Validators.required),
462      dueDate: new FormControl(/* @__PURE__ */new Date(), Validators.required),
463      actionType: new FormControl("", Validators.required),
464      recordType: new FormControl(null)
465    });
466    this.recordTypes = ["idCard", "passport", "ssn", "certificate", "taxRecord", "workPermit", "residencePermit", "other"];
467    this.actionTypes = [];
468    this.destroy$ = new Subject();
469    this.startDateFilter = date => {
470      const currentDate = /* @__PURE__ */new Date();
471      currentDate.setHours(0, 0, 0, 0);
472      return date && date >= currentDate;
473    };
474  }
475  ngOnInit() {
476    if (this.isMilestone) {
477      const actionTypeControl = this.actionForm.get("actionType");
478      actionTypeControl?.removeValidators(Validators.required);
479      actionTypeControl?.setValue(null, {
480        emitEvent: false
481      });
482      actionTypeControl?.updateValueAndValidity({
483        emitEvent: false
484      });
485    }
486    this.getActionTypes();
487    this.subscribeToValueChanges();
488    this.subscribeToRecordsFormChanges();
489  }
490  onSubmit() {
491    if (this.actionForm.valid) {
492      const formValue = this.actionForm.value;
493      const action = {
494        title: formValue.title,
495        description: formValue.description,
496        actionType: this.isMilestone ? "milestone" : formValue.actionType,
497        completedAt: null,
498        completedBy: null,
499        surveyRunId: null,
500        createdBy: "",
501        employeeId: this.employeeId,
502        associatedId: this.associatedId || null,
503        associatedLabel: this.associatedLabel || null,
504        dueDate: Timestamp.fromDate(formValue.dueDate),
505        recordType: formValue.recordType,
506        period: null,
507        relatedTo: null,
508        status: "open",
509        lastUpdatedAt: Timestamp.now(),
510        createdAt: Timestamp.now()
511      };
512      this.submitForm.emit(action);
513    }
514  }
515  onCancel() {
516    this.cancelForm.emit();
517  }
518  getType(type) {
519    switch (type) {
520      case "passport":
521        return "Paspoort";
522      case "idCard":
523        return "Identiteitskaart";
524      case "ssn":
525        return "Burgerservicenummer (BSN)";
526      case "certificate":
527        return "Certificaat";
528      case "taxRecord":
529        return "Loonbelastingverklaring";
530      case "workPermit":
531        return "Werkvergunning";
532      case "residencePermit":
533        return "Verblijfsvergunning";
534      case "identification":
535        return "ID-bewijs";
536      case "other":
537      default:
538        return "Overige";
539    }
540  }
541  getActionTypes() {
542    if (this.isMilestone) {
543      this.actionTypes = [{
544        value: "milestone",
545        label: "Mijlpaal"
546      }];
547      return;
548    }
549    if (this.associatedId) {
550      this.actionTypes = [{
551        value: "completion",
552        label: "Medewerker actie"
553      }];
554      this.actionForm.get("actionType")?.patchValue("completion");
555    } else {
556      if (this.canCreateID) {
557        this.actionTypes = [{
558          value: "completion",
559          label: "Medewerker actie"
560        }, {
561          value: "verified",
562          label: "Bevestig bericht"
563        }, {
564          value: "informational",
565          label: "Informatief bericht"
566        }, {
567          value: "identification",
568          label: "Verzoek officeel document"
569        }];
570      } else {
571        this.actionTypes = [{
572          value: "completion",
573          label: "Medewerker actie"
574        }, {
575          value: "verified",
576          label: "Bevestig bericht"
577        }, {
578          value: "informational",
579          label: "Informatief bericht"
580        }];
581      }
582    }
583  }
584  subscribeToValueChanges() {
585    this.actionForm.get("actionType")?.valueChanges.pipe(distinctUntilChanged(), takeUntil(this.destroy$)).subscribe({
586      next: actionType => {
587        const recordTypeControl = this.actionForm.get("recordType");
588        if (actionType === "identification") {
589          this.actionForm.patchValue({
590            title: "Document vereist",
591            description: "Upload een geldig document v\xF3\xF3r de vervaldatum om je dossier actueel te houden."
592          });
593          recordTypeControl?.setValidators([Validators.required]);
594          recordTypeControl?.updateValueAndValidity();
595        } else {
596          recordTypeControl?.clearValidators();
597          recordTypeControl?.updateValueAndValidity();
598        }
599      }
600    });
601  }
602  subscribeToRecordsFormChanges() {
603    const typeControl = this.actionForm.get("recordType");
604    typeControl?.valueChanges.pipe(distinctUntilChanged(), takeUntil(this.destroy$)).subscribe({
605      next: type => {
606        if (type === "other") {
607          typeControl.reset("", {
608            emitEvent: false
609          });
610          setTimeout(() => {
611            const el = document.querySelector('[formControlName="recordType"]');
612            el?.focus();
613            typeControl.markAsPristine();
614            typeControl.markAsUntouched();
615            typeControl.updateValueAndValidity();
616          });
617        }
618      }
619    });
620  }
621  ngOnDestroy() {
622    this.destroy$.next();
623    this.destroy$.complete();
624  }
625  static {
626    this.ɵfac = function ActionFormComponent_Factory(__ngFactoryType__) {
627      return new (__ngFactoryType__ || _ActionFormComponent)();
628    };
629  }
630  static {
631    this.ɵcmp = /* @__PURE__ */ɵɵdefineComponent({
632      type: _ActionFormComponent,
633      selectors: [["ehr-action-form"]],
634      inputs: {
635        canCreateID: "canCreateID",
636        associatedId: "associatedId",
637        associatedLabel: "associatedLabel",
638        employeeId: "employeeId",
639        loading: "loading",
640        ownerOptions: "ownerOptions",
641        isMilestone: "isMilestone",
642        title: "title"
643      },
644      outputs: {
645        submitForm: "submitForm",
646        cancelForm: "cancelForm"
647      },
648      decls: 20,
649      vars: 11,
650      consts: () => {
651        let i18n_0;
652        if (false) {
653          const MSG_EXTERNAL_description$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_0 = goog.getMsg(" Description ");
654          i18n_0 = MSG_EXTERNAL_description$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_0;
655        } else {
656          i18n_0 = "Beschrijving";
657        }
658        let i18n_1;
659        if (false) {
660          const MSG_EXTERNAL_cancel$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_1 = goog.getMsg(" Cancel ");
661          i18n_1 = MSG_EXTERNAL_cancel$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_1;
662        } else {
663          i18n_1 = "Annuleren";
664        }
665        let i18n_2;
666        if (false) {
667          const MSG_EXTERNAL_submit_button$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_2 = goog.getMsg(" Submit ");
668          i18n_2 = MSG_EXTERNAL_submit_button$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_2;
669        } else {
670          i18n_2 = "Opslaan";
671        }
672        let i18n_3;
673        if (false) {
674          const MSG_EXTERNAL_1566182261639006300$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_3 = goog.getMsg("Enter title");
675          i18n_3 = MSG_EXTERNAL_1566182261639006300$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_3;
676        } else {
677          i18n_3 = "Titel invoeren";
678        }
679        let i18n_4;
680        if (false) {
681          const MSG_EXTERNAL_title_label$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_4 = goog.getMsg(" Title ");
682          i18n_4 = MSG_EXTERNAL_title_label$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_4;
683        } else {
684          i18n_4 = "Titel";
685        }
686        let i18n_5;
687        if (false) {
688          const MSG_EXTERNAL_due_date$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_5 = goog.getMsg(" Due date ");
689          i18n_5 = MSG_EXTERNAL_due_date$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_5;
690        } else {
691          i18n_5 = "Vervaldatum";
692        }
693        let i18n_6;
694        if (false) {
695          const MSG_EXTERNAL_title_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_6 = goog.getMsg(" Title is required ");
696          i18n_6 = MSG_EXTERNAL_title_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_6;
697        } else {
698          i18n_6 = "Titel is vereist";
699        }
700        let i18n_7;
701        if (false) {
702          const MSG_EXTERNAL_due_date_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_7 = goog.getMsg(" Due date is required ");
703          i18n_7 = MSG_EXTERNAL_due_date_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_7;
704        } else {
705          i18n_7 = "Vervaldatum is vereist";
706        }
707        let i18n_8;
708        if (false) {
709          const MSG_EXTERNAL_1288089282591396218$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_8 = goog.getMsg("Select communication type");
710          i18n_8 = MSG_EXTERNAL_1288089282591396218$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_8;
711        } else {
712          i18n_8 = "Selecteer communicatietype";
713        }
714        let i18n_9;
715        if (false) {
716          const MSG_EXTERNAL_1566182261639006300$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_9 = goog.getMsg("Enter title");
717          i18n_9 = MSG_EXTERNAL_1566182261639006300$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_9;
718        } else {
719          i18n_9 = "Titel invoeren";
720        }
721        let i18n_10;
722        if (false) {
723          const MSG_EXTERNAL_communication_type$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_10 = goog.getMsg("Communication type");
724          i18n_10 = MSG_EXTERNAL_communication_type$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_10;
725        } else {
726          i18n_10 = "Communicatietype";
727        }
728        let i18n_11;
729        if (false) {
730          const MSG_EXTERNAL_due_date$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_11 = goog.getMsg(" Due date ");
731          i18n_11 = MSG_EXTERNAL_due_date$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_11;
732        } else {
733          i18n_11 = "Vervaldatum";
734        }
735        let i18n_12;
736        if (false) {
737          const MSG_EXTERNAL_title_label$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_12 = goog.getMsg(" Title ");
738          i18n_12 = MSG_EXTERNAL_title_label$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_12;
739        } else {
740          i18n_12 = "Titel";
741        }
742        let i18n_13;
743        if (false) {
744          const MSG_EXTERNAL_communication_type_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_13 = goog.getMsg(" Communication type is required ");
745          i18n_13 = MSG_EXTERNAL_communication_type_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_13;
746        } else {
747          i18n_13 = "Communicatietype is verplicht";
748        }
749        let i18n_14;
750        if (false) {
751          const MSG_EXTERNAL_due_date_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_14 = goog.getMsg(" Due date is required ");
752          i18n_14 = MSG_EXTERNAL_due_date_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_14;
753        } else {
754          i18n_14 = "Vervaldatum is vereist";
755        }
756        let i18n_15;
757        if (false) {
758          const MSG_EXTERNAL_document_name$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_15 = goog.getMsg("Document Name");
759          i18n_15 = MSG_EXTERNAL_document_name$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_15;
760        } else {
761          i18n_15 = "Documentnaam";
762        }
763        let i18n_16;
764        if (false) {
765          const MSG_EXTERNAL_document_name_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_16 = goog.getMsg(" Document name is required ");
766          i18n_16 = MSG_EXTERNAL_document_name_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_16;
767        } else {
768          i18n_16 = "Documentnaam is verplicht";
769        }
770        let i18n_17;
771        if (false) {
772          const MSG_EXTERNAL_5078080803252800589$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_17 = goog.getMsg("Enter Type");
773          i18n_17 = MSG_EXTERNAL_5078080803252800589$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_17;
774        } else {
775          i18n_17 = "Voer document naam in";
776        }
777        let i18n_18;
778        if (false) {
779          const MSG_EXTERNAL_document_name$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_18 = goog.getMsg("Document Name");
780          i18n_18 = MSG_EXTERNAL_document_name$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_18;
781        } else {
782          i18n_18 = "Documentnaam";
783        }
784        let i18n_19;
785        if (false) {
786          const MSG_EXTERNAL_document_name_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_19 = goog.getMsg(" Document name is required ");
787          i18n_19 = MSG_EXTERNAL_document_name_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_19;
788        } else {
789          i18n_19 = "Documentnaam is verplicht";
790        }
791        let i18n_20;
792        if (false) {
793          const MSG_EXTERNAL_title_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_20 = goog.getMsg(" Title is required ");
794          i18n_20 = MSG_EXTERNAL_title_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_20;
795        } else {
796          i18n_20 = "Titel is vereist";
797        }
798        let i18n_21;
799        if (false) {
800          const MSG_EXTERNAL_description_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_21 = goog.getMsg(" Description is required ");
801          i18n_21 = MSG_EXTERNAL_description_required$$SRC_APP__SECURE__SHARED_EHR_ACTION_FORM_EHR_ACTION_FORM_COMPONENT_TS_21;
802        } else {
803          i18n_21 = "Beschrijving is vereist";
804        }
805        return [["dueDatePicker", ""], i18n_0, i18n_1, i18n_2, i18n_4, i18n_5, i18n_6, i18n_7, i18n_10, i18n_11, i18n_12, i18n_13, i18n_14, i18n_15, i18n_16, i18n_18, i18n_19, i18n_20, i18n_21, [1, "", 3, "ngSubmit", "formGroup"], [1, "ehr-widget-card--full-width"], [1, "ehr-widget-wrapper"], [1, "ehr-widget-header"], [1, "ehr-widget-title"], [1, "ehr-widget-content--with-header"], [1, "full-width", "flex-row-space-between-start", "flex-wrap-wrap"], [1, "ehr-form-field-wrapper"], ["appearance", "outline", 1, "ehr-textarea-field", "ehr-form-field"], ["matInput", "", "formControlName", "description", "cdkAutosizeMinRows", "4", "cdkAutosizeMaxRows", "10", 3, "cdkTextareaAutosize"], [1, "ehr-dialog-footer"], ["mat-raised-button", "", "type", "button", 1, "ehr-cancel-button", 3, "click", "disabled"], ["mat-raised-button", "", "color", "primary", "type", "submit", 1, "ehr-submit-button", 3, "disabled"], [1, "ehr-form-field-wrapper", "ehr-form-field-wrapper--2-3"], ["floatLabel", "always", "appearance", "outline", 1, "ehr-input", "ehr-form-field"], ["matInput", "", "formControlName", "title", "placeholder", i18n_3], [1, "ehr-form-field-wrapper", "ehr-form-field-wrapper--1-3"], ["floatLabel", "always", "appearance", "outline", 1, "ehr-input", "ehr-date-picker-input", "ehr-form-field"], ["matInput", "", "formControlName", "dueDate", 3, "matDatepicker", "matDatepickerFilter"], ["matSuffix", "", 3, "for"], ["xPosition", "end"], [1, "ehr-form-field-wrapper", "ehr-form-field-wrapper--2-cols"], ["appearance", "outline", 1, "ehr-input", "ehr-form-field"], ["formControlName", "actionType", "placeholder", i18n_8], [3, "value"], ["matInput", "", "formControlName", "title", "placeholder", i18n_9], ["formControlName", "recordType"], ["matInput", "", "formControlName", "recordType", "placeholder", i18n_17], ["matIconSuffix", "", 1, "ehr-icon-close", 3, "click"]];
806      },
807      template: function ActionFormComponent_Template(rf, ctx) {
808        if (rf & 1) {
809          ɵɵelementStart(0, "form", 19);
810          ɵɵlistener("ngSubmit", function ActionFormComponent_Template_form_ngSubmit_0_listener() {
811            return ctx.onSubmit();
812          });
813          ɵɵelementStart(1, "div", 20)(2, "div", 21)(3, "div", 22);
814          ɵɵconditionalCreate(4, ActionFormComponent_Conditional_4_Template, 2, 1, "div", 23);
815          ɵɵelementEnd();
816          ɵɵelementStart(5, "div", 24)(6, "div", 25);
817          ɵɵconditionalCreate(7, ActionFormComponent_Conditional_7_Template, 15, 7)(8, ActionFormComponent_Conditional_8_Template, 24, 9);
818          ɵɵelementStart(9, "div", 26)(10, "mat-form-field", 27)(11, "mat-label");
819          ɵɵi18n(12, 1);
820          ɵɵelementEnd();
821          ɵɵelement(13, "textarea", 28);
822          ɵɵconditionalCreate(14, ActionFormComponent_Conditional_14_Template, 2, 0, "mat-error");
823          ɵɵelementEnd()()()()()();
824          ɵɵelementStart(15, "div", 29)(16, "button", 30);
825          ɵɵlistener("click", function ActionFormComponent_Template_button_click_16_listener() {
826            return ctx.onCancel();
827          });
828          ɵɵi18n(17, 2);
829          ɵɵelementEnd();
830          ɵɵelementStart(18, "button", 31);
831          ɵɵi18n(19, 3);
832          ɵɵelementEnd()()();
833        }
834        if (rf & 2) {
835          let tmp_5_0;
836          ɵɵproperty("formGroup", ctx.actionForm);
837          ɵɵadvance(4);
838          ɵɵconditional(ctx.title ? 4 : -1);
839          ɵɵadvance();
840          ɵɵclassProp("margin-top-1", ctx.title);
841          ɵɵadvance(2);
842          ɵɵconditional(ctx.isMilestone ? 7 : 8);
843          ɵɵadvance(6);
844          ɵɵproperty("cdkTextareaAutosize", true);
845          ɵɵadvance();
846          ɵɵconditional(((tmp_5_0 = ctx.actionForm.get("description")) == null ? null : tmp_5_0.hasError("required")) ? 14 : -1);
847          ɵɵadvance(2);
848          ɵɵproperty("disabled", ctx.loading);
849          ɵɵadvance(2);
850          ɵɵclassProp("spinner", ctx.loading);
851          ɵɵproperty("disabled", ctx.loading || ctx.actionForm.invali
851d);
852        }
853      },
854      dependencies: [ReactiveFormsModule, ɵNgNoValidate, DefaultValueAccessor, NgControlStatus, NgControlStatusGroup, FormGroupDirective, FormControlName, MatButtonModule, MatButton, MatIconModule, MatIcon, MatInputModule, MatInput, MatFormField, MatLabel, MatError, MatSuffix, CdkTextareaAutosize, MatSelectModule, MatSelect, MatOption, MatDatepickerModule, MatDatepicker, MatDatepickerInput, MatDatepickerToggle, MatFormFieldModule, NgxEditorModule],
855      encapsulation: 2
856    });
857  }
858};
859(() => {
860  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ActionFormComponent, [{
861    type: Component,
862    args: [{
863      selector: "ehr-action-form",
864      standalone: true,
865      imports: [ReactiveFormsModule, MatButtonModule, MatIconModule, MatInputModule, MatSelectModule, MatDatepickerModule, MatFormFieldModule, NgxEditorModule],
866      template: `<form [formGroup]="actionForm"\r
867      (ngSubmit)="onSubmit()"\r
868      class="">\r
869  <div class="ehr-widget-card--full-width">\r
870    <div class="ehr-widget-wrapper">\r
871      <div class="ehr-widget-header">\r
872        @if (title) {\r
873          <div class="ehr-widget-title">{{ title }}</div>\r
874        }\r
875      </div>\r
876\r
877      <div class="ehr-widget-content--with-header"\r
878           [class.margin-top-1]="title"\r
879      >\r
880        <div class="full-width flex-row-space-between-start flex-wrap-wrap">\r
881          <!-- Action Type Field -->\r
882          @if (isMilestone) {\r
883            <!-- Title Field -->\r
884            <div class="ehr-form-field-wrapper ehr-form-field-wrapper--2-3">\r
885              <mat-form-field floatLabel="always" appearance="outline" class="ehr-input ehr-form-field">\r
886                <mat-label i18n="@@title-label">\r
887                  Title\r
888                </mat-label>\r
889                <input matInput\r
890                       formControlName="title"\r
891                       i18n-placeholder\r
892                       placeholder="Enter title"/>\r
893\r
894                @if (actionForm.get('title')?.hasError('required')) {\r
895                  <mat-error i18n="@@title-required">\r
896                    Title is required\r
897                  </mat-error>\r
898                }\r
899              </mat-form-field>\r
900            </div>\r
901\r
902            <!-- Due Date Field -->\r
903            <div class="ehr-form-field-wrapper ehr-form-field-wrapper--1-3">\r
904              <mat-form-field floatLabel="always"\r
905                              appearance="outline"\r
906                              class="ehr-input ehr-date-picker-input ehr-form-field"\r
907                              [style.padding-top.rem]="0"\r
908              >\r
909                <mat-label i18n="@@due-date">\r
910                  Due date\r
911                </mat-label>\r
912\r
913                <input matInput\r
914                       formControlName="dueDate"\r
915                       [matDatepicker]="dueDatePicker"\r
916                       [matDatepickerFilter]="startDateFilter"\r
917                />\r
918\r
919                <mat-datepicker-toggle matSuffix [for]="dueDatePicker"></mat-datepicker-toggle>\r
920\r
921                <mat-datepicker xPosition="end" #dueDatePicker></mat-datepicker>\r
922\r
923                @if (actionForm.get('dueDate')?.hasError('required')) {\r
924                  <mat-error i18n="@@due-date-required">\r
925                    Due date is required\r
926                  </mat-error>\r
927                }\r
928              </mat-form-field>\r
929            </div>\r
930          } @else {\r
931            <div class="ehr-form-field-wrapper ehr-form-field-wrapper--2-cols">\r
932              <mat-form-field appearance="outline" class="ehr-input ehr-form-field">\r
933                <mat-label i18n="@@communication-type">Communication type</mat-label>\r
934\r
935                <mat-select formControlName="actionType"\r
936                            i18n-placeholder\r
937                            placeholder="Select communication type"\r
938                >\r
939                  @for (type of actionTypes; track type) {\r
940                    <mat-option [value]="type.value">\r
941                      {{ type.label }}\r
942                    </mat-option>\r
943                  }\r
944                </mat-select>\r
945\r
946                @if (actionForm.get('actionType')?.hasError('required')) {\r
947                  <mat-error i18n="@@communication-type-required">\r
948                    Communication type is required\r
949                  </mat-error>\r
950                }\r
951              </mat-form-field>\r
952            </div>\r
953\r
954            <!-- Due Date Field -->\r
955            <div class="ehr-form-field-wrapper ehr-form-field-wrapper--2-cols">\r
956              <mat-form-field floatLabel="always" appearance="outline"\r
957                              class="ehr-input ehr-date-picker-input ehr-form-field">\r
958                <mat-label i18n="@@due-date">\r
959                  Due date\r
960                </mat-label>\r
961\r
962                <input matInput\r
963                       formControlName="dueDate"\r
964                       [matDatepicker]="dueDatePicker"\r
965                       [matDatepickerFilter]="startDateFilter"\r
966                />\r
967\r
968                <mat-datepicker-toggle matSuffix [for]="dueDatePicker"></mat-datepicker-toggle>\r
969\r
970                <mat-datepicker xPosition="end" #dueDatePicker></mat-datepicker>\r
971\r
972                @if (actionForm.get('dueDate')?.hasError('required')) {\r
973                  <mat-error i18n="@@due-date-required">\r
974                    Due date is required\r
975                  </mat-error>\r
976                }\r
977              </mat-form-field>\r
978            </div>\r
979\r
980            @if (actionForm.get('actionType')?.value === 'identification') {\r
981              <!-- Action Type Field -->\r
982              <div class="ehr-form-field-wrapper ehr-form-field-wrapper--2-cols">\r
983                @if (actionForm.get('recordType')?.value === 'idCard' || actionForm.get('recordType')?.value === 'residencePermit' ||\r
984                actionForm.get('recordType')?.value === 'taxRecord' || actionForm.get('recordType')?.value === 'certificate' ||\r
985                actionForm.get('recordType')?.value === 'workPermit' || actionForm.get('recordType')?.value === 'ssn' ||\r
986                actionForm.get('recordType')?.value === 'passport' || actionForm.get('recordType')?.value === null) {\r
987                  <mat-form-field appearance="outline" class="ehr-input ehr-form-field">\r
988                    <mat-label i18n="@@document-name">Document Name</mat-label>\r
989\r
990                    <mat-select formControlName="recordType">\r
991                      @for (item of recordTypes; track item) {\r
992                        <mat-option [value]="item">\r
993                          {{ getType(item) }}\r
994                        </mat-option>\r
995                      }\r
996                    </mat-select>\r
997\r
998                    @if (actionForm.get('recordType')?.value !== null && actionForm.get('recordType')?.hasError('required')) {\r
999                      <mat-error i18n="@@document-name-required">\r
1000                        Document name is required\r
1001                      </mat-error>\r
1002                    }\r
1003                  </mat-form-field>\r
1004                } @else {\r
1005                  <mat-form-field appearance="outline" class="ehr-input ehr-form-field">\r
1006                    <mat-label i18n="@@document-name">Document Name</mat-label>\r
1007\r
1008                    <input matInput formControlName="recordType" i18n-placeholder placeholder="Enter Type"/>\r
1009\r
1010                    <mat-icon class="ehr-icon-close"\r
1011                              (click)="actionForm.get('recordType')?.patchValue(null)"\r
1012                              matIconSuffix>close\r
1013                    </mat-icon>\r
1014\r
1015                    @if (actionForm.get('recordType')?.value !== null && actionForm.get('recordType')?.hasError('required')) {\r
1016                      <mat-error i18n="@@document-name-required">\r
1017                        Document name is required\r
1018                      </mat-error>\r
1019                    }\r
1020                  </mat-form-field>\r
1021                }\r
1022              </div>\r
1023            }\r
1024\r
1025            <!-- Title Field -->\r
1026            <div class="ehr-form-field-wrapper"\r
1027                 [class.ehr-form-field-wrapper--2-cols]="actionForm.get('actionType')?.value === 'identification'">\r
1028              <mat-form-field floatLabel="always" appearance="outline" class="ehr-input ehr-form-field">\r
1029                <mat-label i18n="@@title-label">\r
1030                  Title\r
1031                </mat-label>\r
1032                <input matInput\r
1033                       formControlName="title"\r
1034                       i18n-placeholder\r
1035                       placeholder="Enter title"/>\r
1036\r
1037                @if (actionForm.get('title')?.hasError('required')) {\r
1038                  <mat-error i18n="@@title-required">\r
1039                    Title is required\r
1040                  </mat-error>\r
1041                }\r
1042              </mat-form-field>\r
1043            </div>\r
1044          }\r
1045          <!-- Description Field -->\r
1046          <div class="ehr-form-field-wrapper">\r
1047            <mat-form-field appearance="outline" class="ehr-textarea-field ehr-form-field">\r
1048              <mat-label i18n="@@description">\r
1049                Description\r
1050              </mat-label>\r
1051\r
1052              <textarea matInput\r
1053                        formControlName="description"\r
1054                        [cdkTextareaAutosize]="true"\r
1055                        cdkAutosizeMinRows="4"\r
1056                        cdkAutosizeMaxRows="10"\r
1057              ></textarea>\r
1058\r
1059              @if (actionForm.get('description')?.hasError('required')) {\r
1060                <mat-error i18n="@@description-required">\r
1061                  Description is required\r
1062                </mat-error>\r
1063              }\r
1064            </mat-form-field>\r
1065          </div>\r
1066        </div>\r
1067      </div>\r
1068    </div>\r
1069  </div>\r
1070\r
1071  <div class="ehr-dialog-footer">\r
1072    <button mat-raised-button\r
1073            class="ehr-cancel-button"\r
1074            [disabled]="loading"\r
1075            (click)="onCancel()"\r
1076            type="button"\r
1077            i18n="@@cancel">\r
1078      Cancel\r
1079    </button>\r
1080\r
1081    <button mat-raised-button\r
1082            class="ehr-submit-button"\r
1083            [disabled]="loading || actionForm.invalid"\r
1084            [class.spinner]="loading"\r
1085            color="primary"\r
1086            type="submit"\r
1087            i18n="@@submit-button">\r
1088      Submit\r
1089    </button>\r
1090  </div>\r
1091</form>\r
1092`
1093    }]
1094  }], null, {
1095    canCreateID: [{
1096      type: Input
1097    }],
1098    associatedId: [{
1099      type: Input
1100    }],
1101    associatedLabel: [{
1102      type: Input
1103    }],
1104    employeeId: [{
1105      type: Input
1106    }],
1107    loading: [{
1108      type: Input
1109    }],
1110    ownerOptions: [{
1111      type: Input
1112    }],
1113    isMilestone: [{
1114      type: Input
1115    }],
1116    title: [{
1117      type: Input
1118    }],
1119    submitForm: [{
1120      type: Output
1121    }],
1122    cancelForm: [{
1123      type: Output
1124    }]
1125  });
1126})();
1127(() => {
1128  (typeof ngDevMode === "undefined" || ngDevMode) && ɵsetClassDebugInfo(ActionFormComponent, {
1129    className: "ActionFormComponent",
1130    filePath: "src/app/_secure/_shared/ehr-action-form/ehr-action-form.component.ts",
1131    lineNumber: 35
1132  });
1133})();
1134export { ActionService, ActionFormComponent };
1135/**i18n:55a58011b6fcf12b70aba021cbe233ce2fe179902ce3502a5c6547ccaba0ed7f*/
1136//# sourceMappingURL=chunk-5AR6572Q.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.