@dev_ailaw/venus 1.368.0

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,3498 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop2 in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop2))
11
+ __defNormalProp(a, prop2, b[prop2]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop2 of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop2))
15
+ __defNormalProp(a, prop2, b[prop2]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { defineComponent, ref, watch, toRefs, reactive, computed, getCurrentScope, shallowRef } from "vue-demi";
21
+ import { Select, Modal, FormModel, Input, Checkbox, Divider, Button, Popover, Upload, Tag, Icon, Tooltip, Form, Row, Col, Radio, Popconfirm, Table, Badge, Card, message } from "ant-design-vue";
22
+ import { useQuery, useResult, useMutation, useApolloClient } from "@vue/apollo-composable";
23
+ import gql from "graphql-tag";
24
+ import { path, uniqBy, prop, sort, omit } from "ramda";
25
+ import JSZip from "jszip";
26
+ var index$5 = "";
27
+ function __variableDynamicImportRuntime0__$1(path2) {
28
+ switch (path2) {
29
+ case "./icons/attorney.svg":
30
+ return import("./attorney.js");
31
+ case "./icons/company.svg":
32
+ return import("./company.js");
33
+ case "./icons/individual.svg":
34
+ return import("./individual.js");
35
+ default:
36
+ return new Promise(function(resolve, reject) {
37
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path2)));
38
+ });
39
+ }
40
+ }
41
+ var __vue2_script$k = defineComponent({
42
+ props: {
43
+ type: {
44
+ type: String,
45
+ required: true
46
+ }
47
+ },
48
+ setup(props) {
49
+ const iconUrl = ref();
50
+ watch(() => props.type, (value) => {
51
+ let iconName = "";
52
+ switch (value) {
53
+ case "USERPROFILE":
54
+ iconName = "individual";
55
+ break;
56
+ case "CLIENTPROFILE":
57
+ iconName = "company";
58
+ break;
59
+ default:
60
+ iconName = "attorney";
61
+ break;
62
+ }
63
+ __variableDynamicImportRuntime0__$1(`./icons/${iconName}.svg`).then((result) => iconUrl.value = result.default);
64
+ }, { immediate: true });
65
+ return { iconUrl };
66
+ }
67
+ });
68
+ var render$k = function() {
69
+ var _vm = this;
70
+ var _h = _vm.$createElement;
71
+ var _c = _vm._self._c || _h;
72
+ return _c("img", { staticClass: "w-6 h-6", attrs: { "src": _vm.iconUrl, "alt": _vm.type } });
73
+ };
74
+ var staticRenderFns$k = [];
75
+ function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
76
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
77
+ if (render2) {
78
+ options.render = render2;
79
+ options.staticRenderFns = staticRenderFns2;
80
+ options._compiled = true;
81
+ }
82
+ if (functionalTemplate) {
83
+ options.functional = true;
84
+ }
85
+ if (scopeId) {
86
+ options._scopeId = "data-v-" + scopeId;
87
+ }
88
+ var hook;
89
+ if (moduleIdentifier) {
90
+ hook = function(context) {
91
+ context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
92
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
93
+ context = __VUE_SSR_CONTEXT__;
94
+ }
95
+ if (injectStyles) {
96
+ injectStyles.call(this, context);
97
+ }
98
+ if (context && context._registeredComponents) {
99
+ context._registeredComponents.add(moduleIdentifier);
100
+ }
101
+ };
102
+ options._ssrRegister = hook;
103
+ } else if (injectStyles) {
104
+ hook = shadowMode ? function() {
105
+ injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
106
+ } : injectStyles;
107
+ }
108
+ if (hook) {
109
+ if (options.functional) {
110
+ options._injectStyles = hook;
111
+ var originalRender = options.render;
112
+ options.render = function renderWithStyleInjection(h, context) {
113
+ hook.call(context);
114
+ return originalRender(h, context);
115
+ };
116
+ } else {
117
+ var existing = options.beforeCreate;
118
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
119
+ }
120
+ }
121
+ return {
122
+ exports: scriptExports,
123
+ options
124
+ };
125
+ }
126
+ const __cssModules$k = {};
127
+ var __component__$k = /* @__PURE__ */ normalizeComponent(__vue2_script$k, render$k, staticRenderFns$k, false, __vue2_injectStyles$k, null, null, null);
128
+ function __vue2_injectStyles$k(context) {
129
+ for (let o in __cssModules$k) {
130
+ this[o] = __cssModules$k[o];
131
+ }
132
+ }
133
+ var ProfileTypeIcon = /* @__PURE__ */ function() {
134
+ return __component__$k.exports;
135
+ }();
136
+ var __vue2_script$j = defineComponent({
137
+ props: {
138
+ source: {
139
+ type: Object,
140
+ required: true
141
+ }
142
+ },
143
+ components: { ProfileTypeIcon }
144
+ });
145
+ var render$j = function() {
146
+ var _vm = this;
147
+ var _h = _vm.$createElement;
148
+ var _c = _vm._self._c || _h;
149
+ return _c("div", { staticClass: "flex space-x-1 items-center" }, [_c("ProfileTypeIcon", { attrs: { "type": _vm.source.profileType } }), _c("div", { staticClass: "text-secondary" }, [_vm._v(_vm._s(_vm.source.profileName))])], 1);
150
+ };
151
+ var staticRenderFns$j = [];
152
+ const __cssModules$j = {};
153
+ var __component__$j = /* @__PURE__ */ normalizeComponent(__vue2_script$j, render$j, staticRenderFns$j, false, __vue2_injectStyles$j, null, null, null);
154
+ function __vue2_injectStyles$j(context) {
155
+ for (let o in __cssModules$j) {
156
+ this[o] = __cssModules$j[o];
157
+ }
158
+ }
159
+ var ProfileSelectItem = /* @__PURE__ */ function() {
160
+ return __component__$j.exports;
161
+ }();
162
+ const meQuery = gql`
163
+ query Me {
164
+ me {
165
+ id
166
+ lawFirmId
167
+ }
168
+ }
169
+ `;
170
+ function useMe() {
171
+ const { result } = useQuery(meQuery, void 0, {
172
+ fetchPolicy: "cache-first"
173
+ });
174
+ return useResult(result);
175
+ }
176
+ const profilesQuery = gql`
177
+ query ProfileSearch(
178
+ $lawFirmId: Int!
179
+ $keywords: String
180
+ $profileType: String
181
+ $profileTypeInt: [Int!]
182
+ $profileIds: [Int!]
183
+ $isDisabled: Int
184
+ ) {
185
+ profileSearch(
186
+ query: {
187
+ lawFirmId: $lawFirmId
188
+ keywords: $keywords
189
+ profileType: $profileType
190
+ profileTypeInt: $profileTypeInt
191
+ profileId: $profileIds
192
+ isDisabled: $isDisabled
193
+ }
194
+ ) {
195
+ numResult
196
+ profileList(startIndex: 0, endIndex: 99) {
197
+ id
198
+ profileType
199
+ profileName
200
+ accountList {
201
+ id
202
+ email
203
+ }
204
+ }
205
+ }
206
+ }
207
+ `;
208
+ const addProfileUserMutation = gql`
209
+ mutation AddProfileUser(
210
+ $lawFirmId: Int!
211
+ $name: String!
212
+ $profileType: ProfileType
213
+ $email: String!
214
+ $sendEmail: Boolean!
215
+ ) {
216
+ addProfileUser(
217
+ selfLawFirmId: $lawFirmId
218
+ name: $name
219
+ profileType: $profileType
220
+ email: $email
221
+ sendEmail: $sendEmail
222
+ ) {
223
+ profile {
224
+ id
225
+ profileName
226
+ profileType
227
+ accountList {
228
+ id
229
+ email
230
+ }
231
+ }
232
+ }
233
+ }
234
+ `;
235
+ function useCreateProfile() {
236
+ const me = useMe();
237
+ const { mutate, loading } = useMutation(addProfileUserMutation);
238
+ const createProfile = async (variables) => {
239
+ var _a;
240
+ const result = await mutate(__spreadProps(__spreadValues({}, variables), {
241
+ lawFirmId: (_a = me.value) == null ? void 0 : _a.lawFirmId
242
+ }));
243
+ return path(["data", "addProfileUser", "profile"], result);
244
+ };
245
+ return { createProfile, loading };
246
+ }
247
+ const profileTypes = {
248
+ USERPROFILE: "Individual",
249
+ CLIENTPROFILE: "Company",
250
+ PREPARERPROFILE: "Attorney"
251
+ };
252
+ var __vue2_script$i = defineComponent({
253
+ props: {
254
+ value: {
255
+ type: String
256
+ },
257
+ enabledTypes: {
258
+ type: Array,
259
+ default: ["USERPROFILE", "CLIENTPROFILE", "PREPARERPROFILE"]
260
+ }
261
+ },
262
+ components: {
263
+ Select,
264
+ Option: Select.Option,
265
+ ProfileTypeIcon
266
+ },
267
+ setup(_, { emit }) {
268
+ const handleChange = (value) => emit("input", value);
269
+ return { profileTypes, handleChange };
270
+ }
271
+ });
272
+ var render$i = function() {
273
+ var _vm = this;
274
+ var _h = _vm.$createElement;
275
+ var _c = _vm._self._c || _h;
276
+ return _c("Select", { attrs: { "value": _vm.value }, on: { "change": _vm.handleChange } }, _vm._l(_vm.enabledTypes, function(key) {
277
+ return _c("Option", { key, attrs: { "value": key } }, [_c("div", { staticClass: "flex items-center space-x-1" }, [_c("ProfileTypeIcon", { attrs: { "type": key } }), _c("div", { staticClass: "text-secondary" }, [_vm._v(_vm._s(_vm.profileTypes[key]))])], 1)]);
278
+ }), 1);
279
+ };
280
+ var staticRenderFns$i = [];
281
+ const __cssModules$i = {};
282
+ var __component__$i = /* @__PURE__ */ normalizeComponent(__vue2_script$i, render$i, staticRenderFns$i, false, __vue2_injectStyles$i, null, null, null);
283
+ function __vue2_injectStyles$i(context) {
284
+ for (let o in __cssModules$i) {
285
+ this[o] = __cssModules$i[o];
286
+ }
287
+ }
288
+ var ProfileTypeSelect = /* @__PURE__ */ function() {
289
+ return __component__$i.exports;
290
+ }();
291
+ var __vue2_script$h = defineComponent({
292
+ props: {
293
+ enabledTypes: {
294
+ type: Array,
295
+ default: () => ["USERPROFILE", "CLIENTPROFILE"]
296
+ },
297
+ simpleCreate: {
298
+ type: Boolean,
299
+ default: false
300
+ },
301
+ profileType: {
302
+ type: String
303
+ }
304
+ },
305
+ components: {
306
+ Modal,
307
+ Form: FormModel,
308
+ FormItem: FormModel.Item,
309
+ ProfileTypeSelect,
310
+ Input,
311
+ Checkbox
312
+ },
313
+ setup(props, { emit }) {
314
+ const { simpleCreate, profileType } = toRefs(props);
315
+ const value = reactive({
316
+ profileType: simpleCreate.value ? profileType == null ? void 0 : profileType.value : void 0,
317
+ name: "",
318
+ email: "",
319
+ sendEmail: false
320
+ });
321
+ const hasValidationError = ref(false);
322
+ const canSubmit = computed(() => {
323
+ if (simpleCreate.value && value.name)
324
+ return true;
325
+ return !(value.name === "" || value.profileType == null || hasValidationError.value);
326
+ });
327
+ const rules = {
328
+ profileType: { required: true },
329
+ name: { required: true },
330
+ email: { type: "email" }
331
+ };
332
+ const handleValidate = (_, result) => {
333
+ hasValidationError.value = !result;
334
+ };
335
+ const clearValue = () => Object.assign(value, {});
336
+ const { createProfile, loading } = useCreateProfile();
337
+ const hide = () => emit("cancel");
338
+ const handleSubmit = async () => {
339
+ const profile = await createProfile(value);
340
+ hide();
341
+ emit("profile-created", profile);
342
+ };
343
+ return {
344
+ value,
345
+ rules,
346
+ clearValue,
347
+ loading,
348
+ canSubmit,
349
+ handleSubmit,
350
+ handleValidate
351
+ };
352
+ }
353
+ });
354
+ var render$h = function() {
355
+ var _vm = this;
356
+ var _h = _vm.$createElement;
357
+ var _c = _vm._self._c || _h;
358
+ return _c("modal", _vm._g(_vm._b({ attrs: { "closable": false, "ok-text": "Create", "width": 320, "okButtonProps": { props: { disabled: !_vm.canSubmit, loading: _vm.loading } } }, on: { "cancel": _vm.clearValue, "ok": _vm.handleSubmit } }, "modal", _vm.$attrs, false), _vm.$listeners), [_c("Form", { attrs: { "layout": "vertical", "validate-trigger": "blur", "model": _vm.value, "rules": _vm.rules }, on: { "validate": _vm.handleValidate } }, [!_vm.simpleCreate ? _c("form-item", { attrs: { "label": "Profile type", "prop": "profileType" } }, [_c("profile-type-select", { attrs: { "enabledTypes": _vm.enabledTypes }, model: { value: _vm.value.profileType, callback: function($$v) {
359
+ _vm.$set(_vm.value, "profileType", $$v);
360
+ }, expression: "value.profileType" } })], 1) : _vm._e(), _c("form-item", { class: { "mb-0": _vm.simpleCreate }, attrs: { "label": "Name", "prop": "name" } }, [_c("Input", { model: { value: _vm.value.name, callback: function($$v) {
361
+ _vm.$set(_vm.value, "name", $$v);
362
+ }, expression: "value.name" } })], 1), !_vm.simpleCreate ? _c("form-item", { attrs: { "label": "Email", "prop": "email" } }, [_c("Input", { model: { value: _vm.value.email, callback: function($$v) {
363
+ _vm.$set(_vm.value, "email", $$v);
364
+ }, expression: "value.email" } })], 1) : _vm._e(), !_vm.simpleCreate ? _c("form-item", [_c("checkbox", { model: { value: _vm.value.sendEmail, callback: function($$v) {
365
+ _vm.$set(_vm.value, "sendEmail", $$v);
366
+ }, expression: "value.sendEmail" } }, [_vm._v("Send client portal login password (System will email client a login password)")])], 1) : _vm._e()], 1)], 1);
367
+ };
368
+ var staticRenderFns$h = [];
369
+ const __cssModules$h = {};
370
+ var __component__$h = /* @__PURE__ */ normalizeComponent(__vue2_script$h, render$h, staticRenderFns$h, false, __vue2_injectStyles$h, null, null, null);
371
+ function __vue2_injectStyles$h(context) {
372
+ for (let o in __cssModules$h) {
373
+ this[o] = __cssModules$h[o];
374
+ }
375
+ }
376
+ var ProfileCreateModal = /* @__PURE__ */ function() {
377
+ return __component__$h.exports;
378
+ }();
379
+ var __vue2_script$g = defineComponent({
380
+ props: {
381
+ value: {
382
+ type: Object
383
+ },
384
+ source: {
385
+ type: Array,
386
+ required: true
387
+ },
388
+ creatable: {
389
+ type: Boolean,
390
+ default: false
391
+ }
392
+ },
393
+ components: {
394
+ Select,
395
+ Option: Select.Option,
396
+ Divider,
397
+ Button,
398
+ ProfileSelectItem,
399
+ ProfileCreateModal
400
+ },
401
+ setup(props, { emit }) {
402
+ const selectedId = computed(() => {
403
+ var _a;
404
+ return (_a = props.value) == null ? void 0 : _a.id;
405
+ });
406
+ const handleChange = (value) => emit("input", props.source.find((v) => String(v.id) == value));
407
+ const handleProfileCreate = () => emit("create-profile");
408
+ const filterOption = (val, option) => {
409
+ if (!option.data.attrs.name)
410
+ return true;
411
+ return option.data.attrs.name === "create-btn" || option.data.attrs.name.toUpperCase().includes(val.toUpperCase());
412
+ };
413
+ return {
414
+ filterOption,
415
+ selectedId,
416
+ handleChange,
417
+ handleProfileCreate,
418
+ menu: {}
419
+ };
420
+ }
421
+ });
422
+ var render$g = function() {
423
+ var _vm = this;
424
+ var _h = _vm.$createElement;
425
+ var _c = _vm._self._c || _h;
426
+ return _c("Select", _vm._g(_vm._b({ staticClass: "w-72", attrs: { "allowClear": "", "showSearch": "", "optionFilterProp": "name", "value": _vm.selectedId, "filterOption": _vm.filterOption }, on: { "change": _vm.handleChange } }, "Select", _vm.$attrs, false), _vm.$listeners), [_c("Option", { key: "create-btn", attrs: { "value": "create-btn", "disabled": "", "name": "create-btn" } }, [_c("Button", { staticStyle: { "width": "100%" }, on: { "click": _vm.handleProfileCreate } }, [_vm._v(" " + _vm._s(_vm.$t("message.profile_create")) + " ")]), _vm.creatable ? _c("Divider", { staticClass: "btn-divider" }) : _vm._e()], 1), _vm._l(_vm.source, function(v) {
427
+ return _c("Option", { key: v.id, attrs: { "value": v.id, "name": v.profileName } }, [_c("ProfileSelectItem", { attrs: { "source": v } })], 1);
428
+ })], 2);
429
+ };
430
+ var staticRenderFns$g = [];
431
+ var profileSelector_vue_vue_type_style_index_0_scoped_true_lang = "";
432
+ const __cssModules$g = {};
433
+ var __component__$g = /* @__PURE__ */ normalizeComponent(__vue2_script$g, render$g, staticRenderFns$g, false, __vue2_injectStyles$g, "20a86d10", null, null);
434
+ function __vue2_injectStyles$g(context) {
435
+ for (let o in __cssModules$g) {
436
+ this[o] = __cssModules$g[o];
437
+ }
438
+ }
439
+ var ProfileSelector = /* @__PURE__ */ function() {
440
+ return __component__$g.exports;
441
+ }();
442
+ function useProfiles(keywords, onlyRole, roleTypes, profileIds, disabledProfile) {
443
+ const me = useMe();
444
+ const isDisabled = computed(() => {
445
+ if (disabledProfile.value === true) {
446
+ return 1;
447
+ } else if (disabledProfile.value === false) {
448
+ return 0;
449
+ } else {
450
+ return void 0;
451
+ }
452
+ });
453
+ const { result, loading } = useQuery(profilesQuery, () => {
454
+ var _a;
455
+ return {
456
+ lawFirmId: (_a = me.value) == null ? void 0 : _a.lawFirmId,
457
+ keywords: keywords.value,
458
+ profileType: onlyRole.value,
459
+ profileTypeInt: roleTypes.value,
460
+ profileIds: profileIds.value,
461
+ isDisabled: isDisabled.value
462
+ };
463
+ }, () => ({
464
+ enabled: me.value != null
465
+ }));
466
+ const profiles = useResult(result, [], (data) => data.profileSearch.profileList);
467
+ return { profiles, loading };
468
+ }
469
+ var __vue2_script$f = defineComponent({
470
+ components: { ProfileSelector, ProfileCreateModal },
471
+ props: {
472
+ value: {
473
+ type: Object
474
+ },
475
+ creatable: {
476
+ type: Boolean,
477
+ default: false
478
+ },
479
+ onlyRole: {
480
+ type: String
481
+ },
482
+ roleTypes: {
483
+ type: Array,
484
+ required: true
485
+ },
486
+ preLoaded: {
487
+ type: Array,
488
+ default: () => []
489
+ },
490
+ profileIds: {
491
+ type: Array
492
+ },
493
+ simpleCreate: {
494
+ type: Boolean,
495
+ default: false
496
+ },
497
+ disabledProfile: {
498
+ type: Boolean,
499
+ default: void 0
500
+ },
501
+ priorities: {
502
+ type: Array,
503
+ default: () => []
504
+ }
505
+ },
506
+ setup(props, { emit }) {
507
+ const keywords = ref("");
508
+ const handleSearch = (value) => keywords.value = value;
509
+ const { onlyRole, roleTypes, profileIds, disabledProfile, priorities } = toRefs(props);
510
+ const { profiles: rawProfiles } = useProfiles(keywords, onlyRole, roleTypes, profileIds, disabledProfile);
511
+ const createdProfile = ref();
512
+ const profiles = computed(() => {
513
+ var _a;
514
+ const list = [
515
+ ...props.preLoaded,
516
+ ...createdProfile.value ? [createdProfile.value, ...rawProfiles.value] : rawProfiles.value
517
+ ];
518
+ if ((_a = priorities.value) == null ? void 0 : _a.length) {
519
+ const priority = [];
520
+ priorities.value.forEach((pId) => {
521
+ const target = list.find(({ id }) => pId === id);
522
+ if (target) {
523
+ priority.push(target);
524
+ }
525
+ });
526
+ return uniqBy(prop("id"), [
527
+ ...priority,
528
+ ...list.filter(({ id }) => priority.every(({ id: pId }) => id !== pId))
529
+ ]);
530
+ }
531
+ return uniqBy(prop("id"), list);
532
+ });
533
+ const enabledTypes = computed(() => (onlyRole == null ? void 0 : onlyRole.value) ? [onlyRole.value] : void 0);
534
+ const isModalVisible = ref(false);
535
+ const toggleModal = (value) => isModalVisible.value = value;
536
+ const updateValue = (value) => emit("input", value);
537
+ const handleProfileCreated = (profile) => {
538
+ createdProfile.value = profile;
539
+ updateValue(profile);
540
+ };
541
+ return {
542
+ profiles,
543
+ isModalVisible,
544
+ toggleModal,
545
+ enabledTypes,
546
+ updateValue,
547
+ handleProfileCreated,
548
+ keywords,
549
+ handleSearch
550
+ };
551
+ }
552
+ });
553
+ var render$f = function() {
554
+ var _vm = this;
555
+ var _h = _vm.$createElement;
556
+ var _c = _vm._self._c || _h;
557
+ return _c("div", [_c("profile-selector", _vm._g(_vm._b({ attrs: { "source": _vm.profiles, "value": _vm.value, "creatable": _vm.creatable }, on: { "search": _vm.handleSearch, "create-profile": function($event) {
558
+ return _vm.toggleModal(true);
559
+ }, "input": _vm.updateValue } }, "profile-selector", _vm.$attrs, false), _vm.$listeners)), _vm.creatable ? _c("profile-create-modal", { attrs: { "visible": _vm.isModalVisible, "enabledTypes": _vm.enabledTypes, "simpleCreate": _vm.simpleCreate, "profileType": _vm.simpleCreate ? _vm.onlyRole : void 0 }, on: { "cancel": function($event) {
560
+ return _vm.toggleModal(false);
561
+ }, "profile-created": _vm.handleProfileCreated } }) : _vm._e()], 1);
562
+ };
563
+ var staticRenderFns$f = [];
564
+ const __cssModules$f = {};
565
+ var __component__$f = /* @__PURE__ */ normalizeComponent(__vue2_script$f, render$f, staticRenderFns$f, false, __vue2_injectStyles$f, null, null, null);
566
+ function __vue2_injectStyles$f(context) {
567
+ for (let o in __cssModules$f) {
568
+ this[o] = __cssModules$f[o];
569
+ }
570
+ }
571
+ var index$4 = /* @__PURE__ */ function() {
572
+ return __component__$f.exports;
573
+ }();
574
+ const queryAllCaseTemplates = gql`
575
+ query AllCaseTemplates($lawFirmId: Int!) {
576
+ gallery: galleryCaseTemplateList(selfLawFirmId: $lawFirmId) {
577
+ id
578
+ isSmart
579
+ templateName
580
+ displayName
581
+ isCompanyRelated
582
+ isIndividualRelated
583
+ keywords
584
+ }
585
+
586
+ custom: customCaseTemplateList(selfLawFirmId: $lawFirmId) {
587
+ id
588
+ isSmart
589
+ templateName
590
+ displayName
591
+ isCompanyRelated
592
+ isIndividualRelated
593
+ keywords
594
+ }
595
+ }
596
+ `;
597
+ const compare = (a, b) => {
598
+ if (a.templateName === b.templateName) {
599
+ if (a.isSmart && b.isSmart)
600
+ return 0;
601
+ return a.isSmart ? 1 : -1;
602
+ }
603
+ return a.templateName > b.templateName ? 1 : -1;
604
+ };
605
+ function useCaseTemplates() {
606
+ const me = useMe();
607
+ const { result, loading } = useQuery(queryAllCaseTemplates, () => {
608
+ var _a;
609
+ return {
610
+ lawFirmId: (_a = me.value) == null ? void 0 : _a.lawFirmId
611
+ };
612
+ }, () => ({
613
+ enabled: me.value != null
614
+ }));
615
+ const templates = useResult(result, {
616
+ gallery: [],
617
+ custom: []
618
+ }, (data) => ({
619
+ gallery: sort(compare, data.gallery),
620
+ custom: sort(compare, data.custom)
621
+ }));
622
+ return { templates, loading };
623
+ }
624
+ var __vue2_script$e = defineComponent({
625
+ props: {
626
+ isSmart: {
627
+ type: Boolean
628
+ }
629
+ },
630
+ setup() {
631
+ }
632
+ });
633
+ var render$e = function() {
634
+ var _vm = this;
635
+ var _h = _vm.$createElement;
636
+ var _c = _vm._self._c || _h;
637
+ return _c("div", { staticClass: "border border-solid rounded px-2 leading-5", class: {
638
+ "text-smart bg-purple border-light-purple": _vm.isSmart,
639
+ "text-classic bg-blue border-light-blue": !_vm.isSmart
640
+ } }, [_vm._v(" " + _vm._s(_vm.isSmart ? _vm.$t("message.smart") : _vm.$t("message.classic")) + " ")]);
641
+ };
642
+ var staticRenderFns$e = [];
643
+ const __cssModules$e = {};
644
+ var __component__$e = /* @__PURE__ */ normalizeComponent(__vue2_script$e, render$e, staticRenderFns$e, false, __vue2_injectStyles$e, null, null, null);
645
+ function __vue2_injectStyles$e(context) {
646
+ for (let o in __cssModules$e) {
647
+ this[o] = __cssModules$e[o];
648
+ }
649
+ }
650
+ var CaseTemplateTypeBadge = /* @__PURE__ */ function() {
651
+ return __component__$e.exports;
652
+ }();
653
+ var __vue2_script$d = defineComponent({
654
+ props: {
655
+ source: {
656
+ type: Object,
657
+ required: true
658
+ }
659
+ },
660
+ components: { CaseTemplateTypeBadge, Popover }
661
+ });
662
+ var render$d = function() {
663
+ var _vm = this;
664
+ var _h = _vm.$createElement;
665
+ var _c = _vm._self._c || _h;
666
+ return _c("popover", [_c("div", { staticClass: "flex space-x-2 items-center" }, [_c("span", [_vm._v(_vm._s(_vm.source.templateName))]), _c("case-template-type-badge", { attrs: { "isSmart": _vm.source.isSmart } })], 1), _c("div", { attrs: { "slot": "content" }, slot: "content" }, [_c("span", [_vm._v(_vm._s(_vm.source.templateName) + " ")]), _c("b", [_vm._v("(" + _vm._s(_vm.source.isSmart ? "Smart" : "Classic") + ")")])])]);
667
+ };
668
+ var staticRenderFns$d = [];
669
+ var caseTemplateOption_vue_vue_type_style_index_0_scoped_true_lang = "";
670
+ const __cssModules$d = {};
671
+ var __component__$d = /* @__PURE__ */ normalizeComponent(__vue2_script$d, render$d, staticRenderFns$d, false, __vue2_injectStyles$d, "1114aea6", null, null);
672
+ function __vue2_injectStyles$d(context) {
673
+ for (let o in __cssModules$d) {
674
+ this[o] = __cssModules$d[o];
675
+ }
676
+ }
677
+ var CaseTemplateOption = /* @__PURE__ */ function() {
678
+ return __component__$d.exports;
679
+ }();
680
+ const handleString = (str) => {
681
+ const reg = /[-/]/g;
682
+ return str.toLowerCase().replace(reg, "");
683
+ };
684
+ var caseTemplateFilter = (inputKeywords, formsString, label = formsString) => {
685
+ inputKeywords = handleString(inputKeywords);
686
+ formsString = handleString(formsString);
687
+ label = handleString(label);
688
+ if (label.includes(inputKeywords))
689
+ return true;
690
+ if (formsString.includes(inputKeywords))
691
+ return true;
692
+ const inputKW = inputKeywords.split(" ");
693
+ return inputKW.some((v) => formsString.includes(v));
694
+ };
695
+ var __vue2_script$c = defineComponent({
696
+ props: ["value", "blackList", "exemptLawFirmList", "templateType"],
697
+ components: {
698
+ ASelect: Select,
699
+ AOption: Select.Option,
700
+ AOptionGroup: Select.OptGroup,
701
+ CaseTemplateOption
702
+ },
703
+ setup(props, { emit }) {
704
+ const me = useMe();
705
+ const { templates } = useCaseTemplates();
706
+ const customTemplates = computed(() => {
707
+ var _a, _b;
708
+ let value = (_b = (_a = templates.value) == null ? void 0 : _a.custom) != null ? _b : [];
709
+ if (props.templateType === 1) {
710
+ value = value.filter((v) => !v.isSmart);
711
+ } else if (props.templateType === 2) {
712
+ value = value.filter((v) => v.isSmart);
713
+ }
714
+ return value;
715
+ });
716
+ const galleryTemplates = computed(() => {
717
+ var _a, _b, _c, _d;
718
+ let value = (_b = (_a = templates.value) == null ? void 0 : _a.gallery) != null ? _b : [];
719
+ if (props.templateType === 1) {
720
+ value = value.filter((v) => !v.isSmart);
721
+ } else if (props.templateType === 2) {
722
+ value = value.filter((v) => v.isSmart);
723
+ }
724
+ if (props.blackList == null || ((_d = props.exemptLawFirmList) == null ? void 0 : _d.includes((_c = me.value) == null ? void 0 : _c.lawFirmId)))
725
+ return value;
726
+ return value.filter((v) => v.isSmart || !props.blackList.includes(v.id));
727
+ });
728
+ const allTemplates = computed(() => [
729
+ ...customTemplates.value,
730
+ ...galleryTemplates.value
731
+ ]);
732
+ const isMultiple = computed(() => Array.isArray(props.value));
733
+ const innerValue = computed(() => {
734
+ var _a, _b;
735
+ return isMultiple.value ? (_a = props.value) == null ? void 0 : _a.map(prop("id")) : (_b = props.value) == null ? void 0 : _b.id;
736
+ });
737
+ const onChange = (value) => {
738
+ if (Array.isArray(value)) {
739
+ const result2 = allTemplates.value.filter((v) => value.includes(v.id));
740
+ return emit("update:value", result2);
741
+ }
742
+ const result = allTemplates.value.find((v) => v.id === value);
743
+ emit("update:value", result);
744
+ };
745
+ const onFilter = (keywords, node) => {
746
+ var _a, _b, _c, _d;
747
+ return caseTemplateFilter(keywords, ((_b = (_a = node.data) == null ? void 0 : _a.attrs) == null ? void 0 : _b.forms) || "", ((_d = (_c = node.data) == null ? void 0 : _c.attrs) == null ? void 0 : _d.name) || "");
748
+ };
749
+ return {
750
+ customTemplates,
751
+ galleryTemplates,
752
+ isMultiple,
753
+ innerValue,
754
+ onChange,
755
+ onFilter
756
+ };
757
+ }
758
+ });
759
+ var render$c = function() {
760
+ var _vm = this;
761
+ var _h = _vm.$createElement;
762
+ var _c = _vm._self._c || _h;
763
+ return _c("a-select", _vm._b({ staticClass: "min-w-80 case-template-select", attrs: { "allowClear": "", "showSearch": "", "mode": _vm.isMultiple ? "multiple" : "default", "filter-option": _vm.onFilter, "value": _vm.innerValue }, on: { "change": _vm.onChange } }, "a-select", _vm.$attrs, false), [_c("a-option-group", { staticClass: "text-lg font-bold", attrs: { "label": [_vm.$t("message.custom"), _vm.$t("message.templates")].join(" ") } }, _vm._l(_vm.customTemplates, function(v) {
764
+ return _c("a-option", { key: v.id, attrs: { "value": v.id, "name": v.templateName, "forms": v.keywords } }, [_c("CaseTemplateOption", { attrs: { "source": v } })], 1);
765
+ }), 1), _c("a-option-group", { staticClass: "text-lg font-bold", attrs: { "label": [_vm.$t("message.gallery"), _vm.$t("message.templates")].join(" ") } }, _vm._l(_vm.galleryTemplates, function(v) {
766
+ return _c("a-option", { key: v.id, attrs: { "value": v.id, "name": v.templateName, "forms": v.keywords } }, [_c("CaseTemplateOption", { attrs: { "source": v } })], 1);
767
+ }), 1)], 1);
768
+ };
769
+ var staticRenderFns$c = [];
770
+ var index_vue_vue_type_style_index_0_scoped_true_lang$7 = "";
771
+ var index_vue_vue_type_style_index_1_lang = "";
772
+ const __cssModules$c = {};
773
+ var __component__$c = /* @__PURE__ */ normalizeComponent(__vue2_script$c, render$c, staticRenderFns$c, false, __vue2_injectStyles$c, "72ef9bd2", null, null);
774
+ function __vue2_injectStyles$c(context) {
775
+ for (let o in __cssModules$c) {
776
+ this[o] = __cssModules$c[o];
777
+ }
778
+ }
779
+ var index$3 = /* @__PURE__ */ function() {
780
+ return __component__$c.exports;
781
+ }();
782
+ function __variableDynamicImportRuntime0__(path2) {
783
+ switch (path2) {
784
+ case "../languages/ar.ts":
785
+ return import("./ar.js");
786
+ case "../languages/ben.ts":
787
+ return import("./ben.js");
788
+ case "../languages/ch.ts":
789
+ return import("./ch.js");
790
+ case "../languages/en.ts":
791
+ return import("./en.js");
792
+ case "../languages/es.ts":
793
+ return import("./es.js");
794
+ case "../languages/fa.ts":
795
+ return import("./fa.js");
796
+ case "../languages/fr.ts":
797
+ return import("./fr.js");
798
+ case "../languages/hi.ts":
799
+ return import("./hi.js");
800
+ case "../languages/ht.ts":
801
+ return import("./ht.js");
802
+ case "../languages/hy.ts":
803
+ return import("./hy.js");
804
+ case "../languages/jp.ts":
805
+ return import("./jp.js");
806
+ case "../languages/ko.ts":
807
+ return import("./ko.js");
808
+ case "../languages/nep.ts":
809
+ return import("./nep.js");
810
+ case "../languages/pl.ts":
811
+ return import("./pl.js");
812
+ case "../languages/ps.ts":
813
+ return import("./ps.js");
814
+ case "../languages/pt.ts":
815
+ return import("./pt.js");
816
+ case "../languages/ptbr.ts":
817
+ return import("./ptbr.js");
818
+ case "../languages/ro.ts":
819
+ return import("./ro.js");
820
+ case "../languages/ru.ts":
821
+ return import("./ru.js");
822
+ case "../languages/sw.ts":
823
+ return import("./sw.js");
824
+ case "../languages/tr.ts":
825
+ return import("./tr.js");
826
+ case "../languages/vi.ts":
827
+ return import("./vi.js");
828
+ default:
829
+ return new Promise(function(resolve, reject) {
830
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path2)));
831
+ });
832
+ }
833
+ }
834
+ const loaded = new Map();
835
+ async function getLanguageMessage(lang) {
836
+ if (!loaded.has(lang)) {
837
+ const { default: message2 } = await __variableDynamicImportRuntime0__(`../languages/${lang}.ts`);
838
+ loaded.set(lang, message2);
839
+ }
840
+ return loaded.get(lang);
841
+ }
842
+ const selectFolderAndCreateZip = async () => {
843
+ return new Promise((resolve, reject) => {
844
+ window.showDirectoryPicker().then(async (dirHandle) => {
845
+ const zip = new JSZip();
846
+ const folderSet = new Set();
847
+ const traverseHandle = async (handle, path2) => {
848
+ if (handle.kind === "directory") {
849
+ const currentPath = path2 ? `${path2}/${handle.name}` : handle.name;
850
+ folderSet.add(currentPath);
851
+ for await (const entry of handle.entries()) {
852
+ const childHandle = entry[1];
853
+ await traverseHandle(childHandle, currentPath);
854
+ }
855
+ }
856
+ };
857
+ await traverseHandle(dirHandle, "");
858
+ const filteredDirs = Array.from(folderSet).filter((dir) => !dir.includes(".DS_Store"));
859
+ filteredDirs.forEach((dir) => zip.folder(dir + "/"));
860
+ const blob = await zip.generateAsync({ type: "blob" });
861
+ const zipFileName = `${dirHandle.name}_package.zip`;
862
+ return new File([blob], zipFileName, {
863
+ type: "text/plain"
864
+ });
865
+ }).then((result) => resolve(result)).catch((err) => {
866
+ console.log("Directory picker cancelled or failed", err);
867
+ resolve(null);
868
+ });
869
+ });
870
+ };
871
+ const createForm = (form) => form;
872
+ var GlueRoleType;
873
+ (function(GlueRoleType2) {
874
+ GlueRoleType2[GlueRoleType2["USERPROFILE"] = 0] = "USERPROFILE";
875
+ GlueRoleType2[GlueRoleType2["CLIENTPROFILE"] = 1] = "CLIENTPROFILE";
876
+ GlueRoleType2[GlueRoleType2["PREPARERPROFILE"] = 2] = "PREPARERPROFILE";
877
+ })(GlueRoleType || (GlueRoleType = {}));
878
+ var g28Company = createForm({
879
+ displayName: "G-28-Company",
880
+ roles: {
881
+ Petitioner: [GlueRoleType.CLIENTPROFILE],
882
+ Beneficiary: [GlueRoleType.USERPROFILE],
883
+ Preparer: [GlueRoleType.PREPARERPROFILE]
884
+ }
885
+ });
886
+ var g28Person = createForm({
887
+ displayName: "G-28-Person",
888
+ roles: {
889
+ Petitioner: [GlueRoleType.USERPROFILE],
890
+ Beneficiary: [GlueRoleType.USERPROFILE],
891
+ Preparer: [GlueRoleType.PREPARERPROFILE]
892
+ }
893
+ });
894
+ var g325A = createForm({
895
+ displayName: "G-325A",
896
+ roles: {
897
+ Beneficiary: [GlueRoleType.USERPROFILE],
898
+ Preparer: [GlueRoleType.PREPARERPROFILE]
899
+ }
900
+ });
901
+ var g639 = createForm({
902
+ displayName: "G-639",
903
+ roles: {
904
+ Beneficiary: [GlueRoleType.USERPROFILE],
905
+ Preparer: [GlueRoleType.PREPARERPROFILE]
906
+ }
907
+ });
908
+ var g1145 = createForm({
909
+ displayName: "G-1145",
910
+ roles: {
911
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE],
912
+ Beneficiary: [GlueRoleType.USERPROFILE],
913
+ Preparer: [GlueRoleType.PREPARERPROFILE]
914
+ }
915
+ });
916
+ var g1450 = createForm({
917
+ displayName: "G-1450",
918
+ roles: {
919
+ Petitioner: [GlueRoleType.CLIENTPROFILE],
920
+ Beneficiary: [GlueRoleType.USERPROFILE],
921
+ Preparer: [GlueRoleType.PREPARERPROFILE]
922
+ }
923
+ });
924
+ var i129Attachment = createForm({
925
+ displayName: "I-129 Attachment",
926
+ roles: {
927
+ Beneficiary: [GlueRoleType.USERPROFILE]
928
+ }
929
+ });
930
+ var i129E1E2 = createForm({
931
+ displayName: "I-129 with E-1/E-2 Supplement",
932
+ roles: {
933
+ Beneficiary: [GlueRoleType.USERPROFILE],
934
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE],
935
+ Preparer: [GlueRoleType.PREPARERPROFILE]
936
+ }
937
+ });
938
+ var i129TAS = createForm({
939
+ displayName: "I-129 with Trade Agreement Supplement",
940
+ roles: {
941
+ Beneficiary: [GlueRoleType.USERPROFILE],
942
+ Petitioner: [GlueRoleType.CLIENTPROFILE, GlueRoleType.USERPROFILE],
943
+ Preparer: [GlueRoleType.PREPARERPROFILE]
944
+ }
945
+ });
946
+ var i129HS = createForm({
947
+ displayName: "I-129 with H Supplement",
948
+ roles: {
949
+ Petitioner: [GlueRoleType.CLIENTPROFILE],
950
+ Beneficiary: [GlueRoleType.USERPROFILE],
951
+ Preparer: [GlueRoleType.PREPARERPROFILE]
952
+ }
953
+ });
954
+ var i130 = createForm({
955
+ displayName: "I-130",
956
+ roles: {
957
+ Petitioner: [GlueRoleType.USERPROFILE],
958
+ Beneficiary: [GlueRoleType.USERPROFILE],
959
+ Preparer: [GlueRoleType.PREPARERPROFILE]
960
+ }
961
+ });
962
+ var i130A = createForm({
963
+ displayName: "I-130A",
964
+ roles: {
965
+ Beneficiary: [GlueRoleType.USERPROFILE],
966
+ Preparer: [GlueRoleType.PREPARERPROFILE]
967
+ }
968
+ });
969
+ var i131 = createForm({
970
+ displayName: "I-131",
971
+ roles: {
972
+ Beneficiary: [GlueRoleType.USERPROFILE],
973
+ Preparer: [GlueRoleType.PREPARERPROFILE]
974
+ }
975
+ });
976
+ var i134 = createForm({
977
+ displayName: "I-134",
978
+ roles: {
979
+ Beneficiary: [GlueRoleType.USERPROFILE],
980
+ Petitioner: [GlueRoleType.USERPROFILE],
981
+ Preparer: [GlueRoleType.PREPARERPROFILE]
982
+ }
983
+ });
984
+ var i1340626 = createForm({
985
+ displayName: "I-134 Expires 06-26",
986
+ roles: {
987
+ Beneficiary: [GlueRoleType.USERPROFILE],
988
+ Petitioner: [GlueRoleType.USERPROFILE],
989
+ Preparer: [GlueRoleType.PREPARERPROFILE]
990
+ }
991
+ });
992
+ var i192 = createForm({
993
+ displayName: "I-192",
994
+ roles: {
995
+ Beneficiary: [GlueRoleType.USERPROFILE],
996
+ Preparer: [GlueRoleType.PREPARERPROFILE]
997
+ }
998
+ });
999
+ var i360 = createForm({
1000
+ displayName: "I-360",
1001
+ roles: {
1002
+ Beneficiary: [GlueRoleType.USERPROFILE],
1003
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE],
1004
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1005
+ }
1006
+ });
1007
+ var i485 = createForm({
1008
+ displayName: "I-485",
1009
+ roles: {
1010
+ Beneficiary: [GlueRoleType.USERPROFILE],
1011
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1012
+ }
1013
+ });
1014
+ var i485A = createForm({
1015
+ displayName: "I-485A",
1016
+ roles: {
1017
+ Beneficiary: [GlueRoleType.USERPROFILE],
1018
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1019
+ }
1020
+ });
1021
+ var i485J = createForm({
1022
+ displayName: "I-485J",
1023
+ roles: {
1024
+ Beneficiary: [GlueRoleType.USERPROFILE],
1025
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE],
1026
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1027
+ }
1028
+ });
1029
+ var i508 = createForm({
1030
+ displayName: "I-508",
1031
+ roles: {
1032
+ Beneficiary: [GlueRoleType.USERPROFILE],
1033
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1034
+ }
1035
+ });
1036
+ var i526 = createForm({
1037
+ displayName: "I-526",
1038
+ roles: {
1039
+ Beneficiary: [GlueRoleType.USERPROFILE],
1040
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1041
+ }
1042
+ });
1043
+ var i539 = createForm({
1044
+ displayName: "I-539",
1045
+ roles: {
1046
+ Beneficiary: [GlueRoleType.USERPROFILE],
1047
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1048
+ }
1049
+ });
1050
+ var i539A = createForm({
1051
+ displayName: "I-539A",
1052
+ roles: {
1053
+ Beneficiary: [GlueRoleType.USERPROFILE],
1054
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1055
+ }
1056
+ });
1057
+ var i589 = createForm({
1058
+ displayName: "I-589",
1059
+ roles: {
1060
+ Beneficiary: [GlueRoleType.USERPROFILE],
1061
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1062
+ }
1063
+ });
1064
+ var i601 = createForm({
1065
+ displayName: "I-601",
1066
+ roles: {
1067
+ Beneficiary: [GlueRoleType.USERPROFILE],
1068
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1069
+ }
1070
+ });
1071
+ var i601A = createForm({
1072
+ displayName: "I-601A",
1073
+ roles: {
1074
+ Beneficiary: [GlueRoleType.USERPROFILE],
1075
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1076
+ }
1077
+ });
1078
+ var i765 = createForm({
1079
+ displayName: "I-765",
1080
+ roles: {
1081
+ Beneficiary: [GlueRoleType.USERPROFILE],
1082
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1083
+ }
1084
+ });
1085
+ var i821 = createForm({
1086
+ displayName: "I-821",
1087
+ roles: {
1088
+ Beneficiary: [GlueRoleType.USERPROFILE],
1089
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1090
+ }
1091
+ });
1092
+ var i864 = createForm({
1093
+ displayName: "I-864 Concurrent",
1094
+ roles: {
1095
+ Petitioner: [GlueRoleType.USERPROFILE],
1096
+ Beneficiary: [GlueRoleType.USERPROFILE],
1097
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1098
+ }
1099
+ });
1100
+ var i864A = createForm({
1101
+ displayName: "I-864A Concurrent",
1102
+ roles: {
1103
+ Petitioner: [GlueRoleType.USERPROFILE],
1104
+ Beneficiary: [GlueRoleType.USERPROFILE],
1105
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1106
+ }
1107
+ });
1108
+ var i864EZ = createForm({
1109
+ displayName: "I-864EZ",
1110
+ roles: {
1111
+ Petitioner: [GlueRoleType.USERPROFILE],
1112
+ Beneficiary: [GlueRoleType.USERPROFILE],
1113
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1114
+ }
1115
+ });
1116
+ var i864W = createForm({
1117
+ displayName: "I-864W",
1118
+ roles: {
1119
+ Beneficiary: [GlueRoleType.USERPROFILE],
1120
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1121
+ }
1122
+ });
1123
+ var i907 = createForm({
1124
+ displayName: "I-907",
1125
+ roles: {
1126
+ Petitioner: [GlueRoleType.CLIENTPROFILE, GlueRoleType.USERPROFILE],
1127
+ Beneficiary: [GlueRoleType.USERPROFILE],
1128
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1129
+ }
1130
+ });
1131
+ var i918 = createForm({
1132
+ displayName: "I-918",
1133
+ roles: {
1134
+ Beneficiary: [GlueRoleType.USERPROFILE],
1135
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1136
+ }
1137
+ });
1138
+ var i918A = createForm({
1139
+ displayName: "I-918A",
1140
+ roles: {
1141
+ Petitioner: [GlueRoleType.USERPROFILE],
1142
+ Beneficiary: [GlueRoleType.USERPROFILE],
1143
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1144
+ }
1145
+ });
1146
+ var i918B = createForm({
1147
+ displayName: "I-918B",
1148
+ roles: {
1149
+ Beneficiary: [GlueRoleType.USERPROFILE]
1150
+ }
1151
+ });
1152
+ var i765WS = createForm({
1153
+ displayName: "I-765WS",
1154
+ roles: {
1155
+ Beneficiary: [GlueRoleType.USERPROFILE]
1156
+ }
1157
+ });
1158
+ var i129OP = createForm({
1159
+ displayName: "I-129 with O and P Supplement",
1160
+ roles: {
1161
+ Beneficiary: [GlueRoleType.USERPROFILE],
1162
+ Petitioner: [GlueRoleType.CLIENTPROFILE, GlueRoleType.USERPROFILE],
1163
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1164
+ }
1165
+ });
1166
+ var i129R1 = createForm({
1167
+ displayName: "I-129 with R-1 Supplement",
1168
+ roles: {
1169
+ Beneficiary: [GlueRoleType.USERPROFILE],
1170
+ Petitioner: [GlueRoleType.CLIENTPROFILE, GlueRoleType.USERPROFILE],
1171
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1172
+ }
1173
+ });
1174
+ var eoir42b = createForm({
1175
+ displayName: "EOIR-42B",
1176
+ roles: {
1177
+ Beneficiary: [GlueRoleType.USERPROFILE],
1178
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1179
+ }
1180
+ });
1181
+ var eoir42a = createForm({
1182
+ displayName: "EOIR-42A",
1183
+ roles: {
1184
+ Beneficiary: [GlueRoleType.USERPROFILE],
1185
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1186
+ }
1187
+ });
1188
+ var eoir28 = createForm({
1189
+ displayName: "EOIR-28",
1190
+ roles: {
1191
+ Beneficiary: [GlueRoleType.USERPROFILE],
1192
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1193
+ }
1194
+ });
1195
+ var i140 = createForm({
1196
+ displayName: "I-140",
1197
+ roles: {
1198
+ Beneficiary: [GlueRoleType.USERPROFILE],
1199
+ Petitioner: [GlueRoleType.CLIENTPROFILE, GlueRoleType.USERPROFILE],
1200
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1201
+ }
1202
+ });
1203
+ var i129L = createForm({
1204
+ displayName: "I-129 with L Supplement",
1205
+ roles: {
1206
+ Beneficiary: [GlueRoleType.USERPROFILE],
1207
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE],
1208
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1209
+ }
1210
+ });
1211
+ var i129Q = createForm({
1212
+ displayName: "I-129 with Q-1 Supplement",
1213
+ roles: {
1214
+ Beneficiary: [GlueRoleType.USERPROFILE],
1215
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE],
1216
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1217
+ }
1218
+ });
1219
+ var ds156e = createForm({
1220
+ displayName: "DS-156E",
1221
+ roles: {
1222
+ Beneficiary: [GlueRoleType.USERPROFILE],
1223
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE]
1224
+ }
1225
+ });
1226
+ var i290b = createForm({
1227
+ displayName: "I-290B",
1228
+ roles: {
1229
+ Beneficiary: [GlueRoleType.USERPROFILE],
1230
+ Petitioner: [GlueRoleType.CLIENTPROFILE, GlueRoleType.USERPROFILE],
1231
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1232
+ }
1233
+ });
1234
+ var eoir33 = createForm({
1235
+ displayName: "EOIR-33 BIA",
1236
+ roles: {
1237
+ Beneficiary: [GlueRoleType.USERPROFILE],
1238
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1239
+ }
1240
+ });
1241
+ var i821d = createForm({
1242
+ displayName: "I-821D",
1243
+ roles: {
1244
+ Beneficiary: [GlueRoleType.USERPROFILE],
1245
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1246
+ }
1247
+ });
1248
+ var n600k = createForm({
1249
+ displayName: "N-600K",
1250
+ roles: {
1251
+ Petitioner: [GlueRoleType.USERPROFILE],
1252
+ Beneficiary: [GlueRoleType.USERPROFILE],
1253
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1254
+ }
1255
+ });
1256
+ var i602 = createForm({
1257
+ displayName: "I-602",
1258
+ roles: {
1259
+ Beneficiary: [GlueRoleType.USERPROFILE],
1260
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1261
+ }
1262
+ });
1263
+ var eta750b = createForm({
1264
+ displayName: "ETA-750B",
1265
+ roles: {
1266
+ Beneficiary: [GlueRoleType.USERPROFILE],
1267
+ Petitioner: [GlueRoleType.CLIENTPROFILE, GlueRoleType.USERPROFILE],
1268
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1269
+ }
1270
+ });
1271
+ var i129s = createForm({
1272
+ displayName: "I-129S",
1273
+ roles: {
1274
+ Beneficiary: [GlueRoleType.USERPROFILE],
1275
+ Petitioner: [GlueRoleType.CLIENTPROFILE],
1276
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1277
+ }
1278
+ });
1279
+ var i730 = createForm({
1280
+ displayName: "I-730",
1281
+ roles: {
1282
+ Beneficiary: [GlueRoleType.USERPROFILE],
1283
+ Petitioner: [GlueRoleType.USERPROFILE],
1284
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1285
+ }
1286
+ });
1287
+ var i912 = createForm({
1288
+ displayName: "I-912",
1289
+ roles: {
1290
+ Beneficiary: [GlueRoleType.USERPROFILE],
1291
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1292
+ }
1293
+ });
1294
+ var i914 = createForm({
1295
+ displayName: "I-914",
1296
+ roles: {
1297
+ Beneficiary: [GlueRoleType.USERPROFILE],
1298
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1299
+ }
1300
+ });
1301
+ var i129f = createForm({
1302
+ displayName: "I-129F",
1303
+ roles: {
1304
+ Petitioner: [GlueRoleType.USERPROFILE],
1305
+ Beneficiary: [GlueRoleType.USERPROFILE],
1306
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1307
+ }
1308
+ });
1309
+ var i693 = createForm({
1310
+ displayName: "I-693",
1311
+ roles: {
1312
+ Beneficiary: [GlueRoleType.USERPROFILE],
1313
+ Petitioner: [GlueRoleType.USERPROFILE],
1314
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1315
+ }
1316
+ });
1317
+ var eta9089 = createForm({
1318
+ displayName: "ETA-9089",
1319
+ roles: {
1320
+ Beneficiary: [GlueRoleType.USERPROFILE],
1321
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE],
1322
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1323
+ }
1324
+ });
1325
+ var i829 = createForm({
1326
+ displayName: "I-829",
1327
+ roles: {
1328
+ Beneficiary: [GlueRoleType.USERPROFILE],
1329
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1330
+ }
1331
+ });
1332
+ var i526912 = createForm({
1333
+ displayName: "I-526 Expires 9-12-2022",
1334
+ roles: {
1335
+ Beneficiary: [GlueRoleType.USERPROFILE],
1336
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1337
+ }
1338
+ });
1339
+ var i90 = createForm({
1340
+ displayName: "I-90",
1341
+ roles: {
1342
+ Beneficiary: [GlueRoleType.USERPROFILE],
1343
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1344
+ }
1345
+ });
1346
+ var eta9035 = createForm({
1347
+ displayName: "ETA-9035",
1348
+ roles: {
1349
+ Beneficiary: [GlueRoleType.USERPROFILE],
1350
+ Petitioner: [GlueRoleType.CLIENTPROFILE],
1351
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1352
+ }
1353
+ });
1354
+ var i751 = createForm({
1355
+ displayName: "I-751",
1356
+ roles: {
1357
+ Beneficiary: [GlueRoleType.USERPROFILE],
1358
+ Petitioner: [GlueRoleType.USERPROFILE],
1359
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1360
+ }
1361
+ });
1362
+ var i824 = createForm({
1363
+ displayName: "I-824",
1364
+ roles: {
1365
+ Beneficiary: [GlueRoleType.USERPROFILE],
1366
+ Petitioner: [GlueRoleType.CLIENTPROFILE, GlueRoleType.USERPROFILE],
1367
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1368
+ }
1369
+ });
1370
+ var g639Expired = createForm({
1371
+ displayName: "G-639 Expired",
1372
+ roles: {
1373
+ Beneficiary: [GlueRoleType.USERPROFILE],
1374
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1375
+ }
1376
+ });
1377
+ var n565 = createForm({
1378
+ displayName: "N-565",
1379
+ roles: {
1380
+ Beneficiary: [GlueRoleType.USERPROFILE],
1381
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1382
+ }
1383
+ });
1384
+ var i102 = createForm({
1385
+ displayName: "I-102",
1386
+ roles: {
1387
+ Beneficiary: [GlueRoleType.USERPROFILE],
1388
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1389
+ }
1390
+ });
1391
+ var i212 = createForm({
1392
+ displayName: "I-212",
1393
+ roles: {
1394
+ Beneficiary: [GlueRoleType.USERPROFILE],
1395
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1396
+ }
1397
+ });
1398
+ var n400 = createForm({
1399
+ displayName: "N-400",
1400
+ roles: {
1401
+ Beneficiary: [GlueRoleType.USERPROFILE],
1402
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1403
+ }
1404
+ });
1405
+ var n600 = createForm({
1406
+ displayName: "N-600",
1407
+ roles: {
1408
+ Beneficiary: [GlueRoleType.USERPROFILE],
1409
+ Petitioner: [GlueRoleType.USERPROFILE],
1410
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1411
+ }
1412
+ });
1413
+ var eoir27 = createForm({
1414
+ displayName: "EOIR-27",
1415
+ roles: {
1416
+ Beneficiary: [GlueRoleType.USERPROFILE],
1417
+ Petitioner: [GlueRoleType.USERPROFILE],
1418
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1419
+ }
1420
+ });
1421
+ var eoir29 = createForm({
1422
+ displayName: "EOIR-29",
1423
+ roles: {
1424
+ Beneficiary: [GlueRoleType.USERPROFILE],
1425
+ Petitioner: [GlueRoleType.USERPROFILE],
1426
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1427
+ }
1428
+ });
1429
+ var i526e = createForm({
1430
+ displayName: "I-526E",
1431
+ roles: {
1432
+ Beneficiary: [GlueRoleType.USERPROFILE],
1433
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1434
+ }
1435
+ });
1436
+ var i407 = createForm({
1437
+ displayName: "I-407",
1438
+ roles: {
1439
+ Beneficiary: [GlueRoleType.USERPROFILE]
1440
+ }
1441
+ });
1442
+ var eoir26 = createForm({
1443
+ displayName: "EOIR-26",
1444
+ roles: {
1445
+ Beneficiary: [GlueRoleType.USERPROFILE],
1446
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1447
+ }
1448
+ });
1449
+ var i131a = createForm({
1450
+ displayName: "I-131A",
1451
+ roles: {
1452
+ Beneficiary: [GlueRoleType.USERPROFILE],
1453
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1454
+ }
1455
+ });
1456
+ var n336 = createForm({
1457
+ displayName: "N-336",
1458
+ roles: {
1459
+ Beneficiary: [GlueRoleType.USERPROFILE],
1460
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1461
+ }
1462
+ });
1463
+ var i914a = createForm({
1464
+ displayName: "I-914A",
1465
+ roles: {
1466
+ Beneficiary: [GlueRoleType.USERPROFILE],
1467
+ Petitioner: [GlueRoleType.USERPROFILE],
1468
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1469
+ }
1470
+ });
1471
+ var ds3035 = createForm({
1472
+ displayName: "DS-3035",
1473
+ roles: {
1474
+ Beneficiary: [GlueRoleType.USERPROFILE],
1475
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1476
+ }
1477
+ });
1478
+ var i612 = createForm({
1479
+ displayName: "I-612",
1480
+ roles: {
1481
+ Beneficiary: [GlueRoleType.USERPROFILE],
1482
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1483
+ }
1484
+ });
1485
+ var i956k = createForm({
1486
+ displayName: "I-956K",
1487
+ roles: {
1488
+ Beneficiary: [GlueRoleType.USERPROFILE],
1489
+ Petitioner: [GlueRoleType.CLIENTPROFILE, GlueRoleType.USERPROFILE],
1490
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1491
+ }
1492
+ });
1493
+ var i129e3 = createForm({
1494
+ displayName: "I-129 E-3/Main",
1495
+ roles: {
1496
+ Beneficiary: [GlueRoleType.USERPROFILE],
1497
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE],
1498
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1499
+ }
1500
+ });
1501
+ var eta9141 = createForm({
1502
+ displayName: "ETA-9141",
1503
+ roles: {
1504
+ Beneficiary: [GlueRoleType.USERPROFILE],
1505
+ Petitioner: [GlueRoleType.CLIENTPROFILE],
1506
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1507
+ }
1508
+ });
1509
+ var i246 = createForm({
1510
+ displayName: "I-246",
1511
+ roles: {
1512
+ Beneficiary: [GlueRoleType.USERPROFILE],
1513
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1514
+ }
1515
+ });
1516
+ var i129h1 = createForm({
1517
+ displayName: "I-129 for H-1b Petition",
1518
+ roles: {
1519
+ Petitioner: [GlueRoleType.CLIENTPROFILE],
1520
+ Beneficiary: [GlueRoleType.USERPROFILE],
1521
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1522
+ }
1523
+ });
1524
+ var longStatyApplication = createForm({
1525
+ displayName: "Portugal Visa - Long Stay National Visas (Residency Visas)",
1526
+ roles: {
1527
+ Beneficiary: [GlueRoleType.USERPROFILE],
1528
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE],
1529
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1530
+ }
1531
+ });
1532
+ var i566 = createForm({
1533
+ displayName: "I-566",
1534
+ roles: {
1535
+ Beneficiary: [GlueRoleType.USERPROFILE],
1536
+ Petitioner: [GlueRoleType.USERPROFILE],
1537
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1538
+ }
1539
+ });
1540
+ var i864aSponsor = createForm({
1541
+ displayName: "I-864A",
1542
+ roles: {
1543
+ Petitioner: [GlueRoleType.USERPROFILE],
1544
+ Beneficiary: [GlueRoleType.USERPROFILE],
1545
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1546
+ }
1547
+ });
1548
+ var i881 = createForm({
1549
+ displayName: "I-881",
1550
+ roles: {
1551
+ Beneficiary: [GlueRoleType.USERPROFILE],
1552
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1553
+ }
1554
+ });
1555
+ var i864JointSponsor = createForm({
1556
+ displayName: "I-864 for Joint-Sponsor",
1557
+ roles: {
1558
+ Beneficiary: [GlueRoleType.USERPROFILE],
1559
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1560
+ }
1561
+ });
1562
+ var i929 = createForm({
1563
+ displayName: "I-929",
1564
+ roles: {
1565
+ Petitioner: [GlueRoleType.USERPROFILE],
1566
+ Beneficiary: [GlueRoleType.USERPROFILE],
1567
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1568
+ }
1569
+ });
1570
+ var eta9089Niw = createForm({
1571
+ displayName: "ETA-9089 for NIW Petition (ETA-9089 with Supp A, C & Determination)",
1572
+ roles: {
1573
+ Beneficiary: [GlueRoleType.USERPROFILE],
1574
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE],
1575
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1576
+ }
1577
+ });
1578
+ var eoir26a = createForm({
1579
+ displayName: "EOIR-26A",
1580
+ roles: {
1581
+ Beneficiary: [GlueRoleType.USERPROFILE],
1582
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1583
+ }
1584
+ });
1585
+ var i31f = createForm({
1586
+ displayName: "I-131F",
1587
+ roles: {
1588
+ Petitioner: [GlueRoleType.USERPROFILE],
1589
+ Beneficiary: [GlueRoleType.USERPROFILE],
1590
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1591
+ }
1592
+ });
1593
+ var i914b = createForm({
1594
+ displayName: "I-914B",
1595
+ roles: {
1596
+ Beneficiary: [GlueRoleType.USERPROFILE],
1597
+ Petitioner: [GlueRoleType.USERPROFILE],
1598
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1599
+ }
1600
+ });
1601
+ var h1bSingle = createForm({
1602
+ displayName: "H-1B Electronic Registration Single Beneficiary",
1603
+ roles: {
1604
+ Petitioner: [GlueRoleType.CLIENTPROFILE],
1605
+ Beneficiary: [GlueRoleType.USERPROFILE]
1606
+ }
1607
+ });
1608
+ var h1bMultple = createForm({
1609
+ displayName: "H-1B Electronic Registration Multiple Beneficiaries",
1610
+ roles: {
1611
+ Petitioner: [GlueRoleType.CLIENTPROFILE]
1612
+ }
1613
+ });
1614
+ var eoir33ic = createForm({
1615
+ displayName: "EOIR-33/IC",
1616
+ roles: {
1617
+ Beneficiary: [GlueRoleType.USERPROFILE],
1618
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1619
+ }
1620
+ });
1621
+ var g1256 = createForm({
1622
+ displayName: "G-1256",
1623
+ roles: {
1624
+ Beneficiary: [GlueRoleType.USERPROFILE]
1625
+ }
1626
+ });
1627
+ var eoir59 = createForm({
1628
+ displayName: "EOIR-59",
1629
+ roles: {
1630
+ Beneficiary: [GlueRoleType.USERPROFILE],
1631
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1632
+ }
1633
+ });
1634
+ var ar11 = createForm({
1635
+ displayName: "AR-11",
1636
+ roles: {
1637
+ Beneficiary: [GlueRoleType.USERPROFILE]
1638
+ }
1639
+ });
1640
+ var eoir61 = createForm({
1641
+ displayName: "EOIR-61",
1642
+ roles: {
1643
+ Beneficiary: [GlueRoleType.USERPROFILE],
1644
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1645
+ }
1646
+ });
1647
+ var g1650 = createForm({
1648
+ displayName: "G-1650",
1649
+ roles: {
1650
+ Petitioner: [GlueRoleType.USERPROFILE, GlueRoleType.CLIENTPROFILE],
1651
+ Beneficiary: [GlueRoleType.USERPROFILE],
1652
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1653
+ }
1654
+ });
1655
+ var i765v = createForm({
1656
+ displayName: "I-765V",
1657
+ roles: {
1658
+ Beneficiary: [GlueRoleType.USERPROFILE],
1659
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1660
+ }
1661
+ });
1662
+ var g1651 = createForm({
1663
+ displayName: "G-1651",
1664
+ roles: {
1665
+ Beneficiary: [GlueRoleType.USERPROFILE]
1666
+ }
1667
+ });
1668
+ var eoir60 = createForm({
1669
+ displayName: "EOIR-60",
1670
+ roles: {
1671
+ Beneficiary: [GlueRoleType.USERPROFILE],
1672
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1673
+ }
1674
+ });
1675
+ var ds11 = createForm({
1676
+ displayName: "DS-11",
1677
+ roles: {
1678
+ Beneficiary: [GlueRoleType.USERPROFILE],
1679
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1680
+ }
1681
+ });
1682
+ var l1bp = createForm({
1683
+ displayName: "L1-BP Questonnaire",
1684
+ roles: {
1685
+ Petitioner: [GlueRoleType.CLIENTPROFILE],
1686
+ Beneficiary: [GlueRoleType.USERPROFILE]
1687
+ }
1688
+ });
1689
+ var i140g = createForm({
1690
+ displayName: "I-140G for Principal Immigrant",
1691
+ roles: {
1692
+ Beneficiary: [GlueRoleType.USERPROFILE],
1693
+ Petitioner: [GlueRoleType.CLIENTPROFILE, GlueRoleType.USERPROFILE],
1694
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1695
+ }
1696
+ });
1697
+ var i140gSupp = createForm({
1698
+ displayName: "I-140G Supp. for Derivative Immigrants (Spouse/Child)",
1699
+ roles: {
1700
+ Beneficiary: [GlueRoleType.USERPROFILE],
1701
+ Preparer: [GlueRoleType.PREPARERPROFILE]
1702
+ }
1703
+ });
1704
+ const formRecords = {
1705
+ g28Company,
1706
+ g28Person,
1707
+ g325A,
1708
+ g639,
1709
+ g1145,
1710
+ g1450,
1711
+ i129Attachment,
1712
+ i129E1E2,
1713
+ i129L,
1714
+ i129Q,
1715
+ i129T: i129TAS,
1716
+ i129TAS,
1717
+ i129HS,
1718
+ i130,
1719
+ i130A,
1720
+ i131,
1721
+ i134,
1722
+ i1340626,
1723
+ i192,
1724
+ i360,
1725
+ i485,
1726
+ i485A,
1727
+ i485J,
1728
+ i508,
1729
+ i526,
1730
+ i539,
1731
+ i539A,
1732
+ i589,
1733
+ i601,
1734
+ i601A,
1735
+ i765,
1736
+ i821,
1737
+ i864,
1738
+ i864A,
1739
+ i864EZ,
1740
+ i864W,
1741
+ i907,
1742
+ i918,
1743
+ i918A,
1744
+ i918B,
1745
+ i765WS,
1746
+ i129OP,
1747
+ i129R1,
1748
+ eoir42a,
1749
+ eoir42b,
1750
+ i140,
1751
+ eoir28,
1752
+ ds156e,
1753
+ i290b,
1754
+ eoir33,
1755
+ i821d,
1756
+ n600k,
1757
+ i602,
1758
+ eta750b,
1759
+ i129s,
1760
+ i730,
1761
+ i912,
1762
+ i914,
1763
+ i129f,
1764
+ i693,
1765
+ eta9089,
1766
+ i829,
1767
+ i526912,
1768
+ i90,
1769
+ eta9035,
1770
+ i751,
1771
+ i824,
1772
+ g639Expired,
1773
+ n565,
1774
+ i102,
1775
+ i212,
1776
+ n400,
1777
+ n600,
1778
+ eoir27,
1779
+ eoir29,
1780
+ i526e,
1781
+ i407,
1782
+ eoir26,
1783
+ i131a,
1784
+ n336,
1785
+ i914a,
1786
+ ds3035,
1787
+ i612,
1788
+ i956k,
1789
+ i129e3,
1790
+ eta9141,
1791
+ i246,
1792
+ i129h1,
1793
+ longStatyApplication,
1794
+ i566,
1795
+ i864aSponsor,
1796
+ i881,
1797
+ i864JointSponsor,
1798
+ i929,
1799
+ eta9089Niw,
1800
+ eoir26a,
1801
+ i31f,
1802
+ i914b,
1803
+ h1bSingle,
1804
+ h1bMultple,
1805
+ eoir33ic,
1806
+ g1256,
1807
+ eoir59,
1808
+ ar11,
1809
+ eoir61,
1810
+ g1650,
1811
+ i765v,
1812
+ g1651,
1813
+ eoir60,
1814
+ ds11,
1815
+ l1bp,
1816
+ i140g,
1817
+ i140gSupp
1818
+ };
1819
+ var index$2 = Object.values(formRecords);
1820
+ const acceptableFormats = [
1821
+ ".rar",
1822
+ ".zip",
1823
+ ".doc",
1824
+ ".pdf",
1825
+ ".docx",
1826
+ ".jpg",
1827
+ ".jpeg",
1828
+ ".png"
1829
+ ];
1830
+ var __vue2_script$b = defineComponent({
1831
+ name: "aFileUploader",
1832
+ components: {
1833
+ AntUpload: Upload,
1834
+ AntTag: Tag,
1835
+ AntModal: Modal,
1836
+ AntIcon: Icon
1837
+ },
1838
+ props: {
1839
+ value: {
1840
+ type: Array,
1841
+ default: () => []
1842
+ },
1843
+ uploadFilesFunc: {
1844
+ type: Function,
1845
+ required: true
1846
+ },
1847
+ disabled: {
1848
+ type: Boolean
1849
+ },
1850
+ previewMode: {
1851
+ type: Boolean,
1852
+ default: false
1853
+ },
1854
+ multipleLineMode: {
1855
+ type: Boolean,
1856
+ default: false
1857
+ }
1858
+ },
1859
+ setup(props, { emit }) {
1860
+ const me = useMe();
1861
+ const loading = ref(false);
1862
+ const changeVal = (k, v) => {
1863
+ emit("change", __spreadProps(__spreadValues({}, props.value), {
1864
+ [k]: v
1865
+ }));
1866
+ };
1867
+ const remove = (id) => {
1868
+ emit("change", props.value.filter((v) => v.id !== id));
1869
+ };
1870
+ const beforeUpload = (file, files) => {
1871
+ var _a, _b;
1872
+ if (loading.value)
1873
+ return false;
1874
+ loading.value = true;
1875
+ props.uploadFilesFunc(files, {
1876
+ office_id: (_a = me.value) == null ? void 0 : _a.lawFirmId,
1877
+ user_id: (_b = me.value) == null ? void 0 : _b.id
1878
+ }).then((res) => {
1879
+ emit("change", [
1880
+ ...props.value,
1881
+ ...res.map(({ status, value }) => {
1882
+ if (status === "fulfilled") {
1883
+ return value;
1884
+ }
1885
+ }).filter((v) => v)
1886
+ ]);
1887
+ }).finally(() => {
1888
+ loading.value = false;
1889
+ });
1890
+ return false;
1891
+ };
1892
+ const previewImage = ref();
1893
+ const typeOf = (filename) => {
1894
+ if (/\.(gif|jpe?g|png)$/i.test(filename)) {
1895
+ return "img";
1896
+ } else if (/\.docx?$/i.test(filename)) {
1897
+ return "doc";
1898
+ } else if (/\.pdf$/i.test(filename)) {
1899
+ return "pdf";
1900
+ }
1901
+ return "other";
1902
+ };
1903
+ const icons = {
1904
+ img: "picture",
1905
+ pdf: "file-pdf",
1906
+ doc: "file-word",
1907
+ other: "download"
1908
+ };
1909
+ const isImage = (file) => typeOf(file.name) === "img";
1910
+ const iconOf = (fileName) => icons[typeOf(fileName)];
1911
+ const clickItem = (item, event) => {
1912
+ if (!isImage(item)) {
1913
+ return;
1914
+ }
1915
+ event.preventDefault();
1916
+ previewImage.value = item.link;
1917
+ };
1918
+ const handleSelectFolderTree = async () => {
1919
+ var _a, _b;
1920
+ if (loading.value)
1921
+ return;
1922
+ try {
1923
+ loading.value = true;
1924
+ const zipBlob = await selectFolderAndCreateZip();
1925
+ if (!zipBlob) {
1926
+ return;
1927
+ }
1928
+ const uploadResult = await props.uploadFilesFunc([zipBlob], {
1929
+ office_id: (_a = me.value) == null ? void 0 : _a.lawFirmId,
1930
+ user_id: (_b = me.value) == null ? void 0 : _b.id
1931
+ });
1932
+ const newFiles = uploadResult.map(({ status, value }) => {
1933
+ if (status === "fulfilled") {
1934
+ return value;
1935
+ }
1936
+ }).filter((v) => v);
1937
+ emit("change", [...props.value, ...newFiles]);
1938
+ } catch (error) {
1939
+ console.error("\u9009\u62E9\u6587\u4EF6\u5939\u5931\u8D25:", error);
1940
+ } finally {
1941
+ loading.value = false;
1942
+ }
1943
+ };
1944
+ return {
1945
+ iconOf,
1946
+ previewImage,
1947
+ clickItem,
1948
+ changeVal,
1949
+ remove,
1950
+ beforeUpload,
1951
+ loading,
1952
+ acceptableFormats,
1953
+ handleSelectFolderTree
1954
+ };
1955
+ }
1956
+ });
1957
+ var render$b = function() {
1958
+ var _vm = this;
1959
+ var _h = _vm.$createElement;
1960
+ var _c = _vm._self._c || _h;
1961
+ return _c("div", { class: { container: !_vm.previewMode && !_vm.multipleLineMode } }, [_c("ant-modal", { attrs: { "visible": !!_vm.previewImage, "footer": null }, on: { "cancel": function($event) {
1962
+ _vm.previewImage = null;
1963
+ } } }, [_c("img", { staticStyle: { "width": "100%" }, attrs: { "src": _vm.previewImage } })]), _c("ant-upload", { staticStyle: { "display": "inline" }, attrs: { "multiple": "", "before-upload": _vm.beforeUpload, "disabled": _vm.disabled || _vm.loading, "action": "javascript:;", "fileList": [], "accept": _vm.acceptableFormats.join(",") } }, [!_vm.previewMode ? _c("ant-tag", [_vm._v(" " + _vm._s(_vm.$t("message.selectFile")) + " ")]) : _vm._e(), _vm.value.length ? [_vm.multipleLineMode ? _c("div", _vm._l(_vm.value, function(file) {
1964
+ return _c("div", { key: file.id, staticStyle: { "margin-top": "3px" } }, [_c("a", { staticStyle: { "color": "#2d8cf0" }, attrs: { "href": file.link, "target": "_blank" }, on: { "click": function($event) {
1965
+ $event.stopPropagation();
1966
+ return _vm.clickItem(file, $event);
1967
+ } } }, [_vm._v(" " + _vm._s(file.name) + " "), _c("a-icon", { attrs: { "type": _vm.iconOf(file.name) } })], 1), !_vm.disabled ? _c("a-icon", { attrs: { "type": "close" }, on: { "click": function($event) {
1968
+ $event.stopPropagation();
1969
+ return _vm.remove(file.id);
1970
+ } } }) : _vm._e()], 1);
1971
+ }), 0) : _c("div", { staticStyle: { "display": "inline-block" } }, _vm._l(_vm.value, function(file) {
1972
+ return _c("ant-tag", { key: file.id, attrs: { "closable": !_vm.previewMode && !_vm.disabled }, on: { "close": function($event) {
1973
+ return _vm.remove(file.id);
1974
+ } } }, [_c("a", { staticStyle: { "color": "#111" }, attrs: { "href": file.link, "target": "_blank" }, on: { "click": function($event) {
1975
+ $event.stopPropagation();
1976
+ return _vm.clickItem(file, $event);
1977
+ } } }, [_vm._v(" " + _vm._s(file.name) + " ")])]);
1978
+ }), 1)] : !_vm.previewMode ? _c("span", { class: { block: _vm.multipleLineMode }, staticStyle: { "color": "#ccc" } }, [_vm._v(_vm._s(_vm.acceptableFormats.join(" ")))]) : _vm._e()], 2), !_vm.previewMode ? _c("div", { staticStyle: { "margin-top": "6px" } }, [_c("ant-tag", { attrs: { "disabled": _vm.disabled || _vm.loading }, on: { "click": function($event) {
1979
+ $event.stopPropagation();
1980
+ $event.preventDefault();
1981
+ return _vm.handleSelectFolderTree.apply(null, arguments);
1982
+ } } }, [_vm._v(" Upload Folder Sample ")])], 1) : _vm._e()], 1);
1983
+ };
1984
+ var staticRenderFns$b = [];
1985
+ var index_vue_vue_type_style_index_0_scoped_true_lang$6 = "";
1986
+ const __cssModules$b = {};
1987
+ var __component__$b = /* @__PURE__ */ normalizeComponent(__vue2_script$b, render$b, staticRenderFns$b, false, __vue2_injectStyles$b, "4027e57a", null, null);
1988
+ function __vue2_injectStyles$b(context) {
1989
+ for (let o in __cssModules$b) {
1990
+ this[o] = __cssModules$b[o];
1991
+ }
1992
+ }
1993
+ var AFileUploader = /* @__PURE__ */ function() {
1994
+ return __component__$b.exports;
1995
+ }();
1996
+ var AssigneeTypes;
1997
+ (function(AssigneeTypes2) {
1998
+ AssigneeTypes2[AssigneeTypes2["EMPTY_DEFAULT"] = 4] = "EMPTY_DEFAULT";
1999
+ AssigneeTypes2[AssigneeTypes2["BENEFICIARY"] = 1] = "BENEFICIARY";
2000
+ AssigneeTypes2[AssigneeTypes2["PETITIONER"] = 2] = "PETITIONER";
2001
+ AssigneeTypes2[AssigneeTypes2["ATTORNEY"] = 3] = "ATTORNEY";
2002
+ })(AssigneeTypes || (AssigneeTypes = {}));
2003
+ var AssigneeTypesText;
2004
+ (function(AssigneeTypesText2) {
2005
+ AssigneeTypesText2["EMPTY_DEFAULT"] = "message.none";
2006
+ AssigneeTypesText2["BENEFICIARY"] = "message.beneficiary";
2007
+ AssigneeTypesText2["PETITIONER"] = "message.petitioner";
2008
+ AssigneeTypesText2["ATTORNEY"] = "message.attorney";
2009
+ })(AssigneeTypesText || (AssigneeTypesText = {}));
2010
+ var SortOrder;
2011
+ (function(SortOrder2) {
2012
+ SortOrder2["default"] = "DEFAULT";
2013
+ SortOrder2["desc"] = "DESC";
2014
+ SortOrder2["asc"] = "ASC";
2015
+ })(SortOrder || (SortOrder = {}));
2016
+ var ResponseCode;
2017
+ (function(ResponseCode2) {
2018
+ ResponseCode2["success"] = "SUCCESS";
2019
+ ResponseCode2["failed"] = "FAILED";
2020
+ })(ResponseCode || (ResponseCode = {}));
2021
+ var __vue2_script$a = defineComponent({
2022
+ components: {
2023
+ AntTag: Tag
2024
+ },
2025
+ props: {
2026
+ assigneeType: {
2027
+ type: String
2028
+ }
2029
+ },
2030
+ setup() {
2031
+ const tagColor = (key) => ["cyan", "orange", "blue", "purple"][AssigneeTypes[key]];
2032
+ return {
2033
+ AssigneeTypesText,
2034
+ tagColor
2035
+ };
2036
+ }
2037
+ });
2038
+ var render$a = function() {
2039
+ var _vm = this;
2040
+ var _h = _vm.$createElement;
2041
+ var _c = _vm._self._c || _h;
2042
+ return _c("ant-tag", { attrs: { "color": _vm.tagColor(_vm.assigneeType || "EMPTY_DEFAULT") } }, [_vm._v(" " + _vm._s(_vm.$t(_vm.AssigneeTypesText[_vm.assigneeType])) + " ")]);
2043
+ };
2044
+ var staticRenderFns$a = [];
2045
+ var index_vue_vue_type_style_index_0_scoped_true_lang$5 = "";
2046
+ const __cssModules$a = {};
2047
+ var __component__$a = /* @__PURE__ */ normalizeComponent(__vue2_script$a, render$a, staticRenderFns$a, false, __vue2_injectStyles$a, "3f69c61c", null, null);
2048
+ function __vue2_injectStyles$a(context) {
2049
+ for (let o in __cssModules$a) {
2050
+ this[o] = __cssModules$a[o];
2051
+ }
2052
+ }
2053
+ var AssigneeTag = /* @__PURE__ */ function() {
2054
+ return __component__$a.exports;
2055
+ }();
2056
+ var __vue2_script$9 = defineComponent({
2057
+ name: "index",
2058
+ components: {
2059
+ AntTooltip: Tooltip
2060
+ },
2061
+ props: {
2062
+ placement: {
2063
+ type: String,
2064
+ default: "left"
2065
+ },
2066
+ tags: {
2067
+ type: Array
2068
+ },
2069
+ maxWidth: {
2070
+ type: Number,
2071
+ default: 100
2072
+ }
2073
+ }
2074
+ });
2075
+ var render$9 = function() {
2076
+ var _vm = this;
2077
+ var _h = _vm.$createElement;
2078
+ var _c = _vm._self._c || _h;
2079
+ return _c("ant-tooltip", { attrs: { "placement": _vm.placement, "title": _vm.tags ? _vm.tags.join(", ") : "-" } }, [_c("div", { staticClass: "tags-container", style: "max-width:" + _vm.maxWidth + "px" }, [_c("span", [_vm._v(_vm._s(_vm.tags ? _vm.tags.join(", ") : "-"))])])]);
2080
+ };
2081
+ var staticRenderFns$9 = [];
2082
+ var index_vue_vue_type_style_index_0_scoped_true_lang$4 = "";
2083
+ const __cssModules$9 = {};
2084
+ var __component__$9 = /* @__PURE__ */ normalizeComponent(__vue2_script$9, render$9, staticRenderFns$9, false, __vue2_injectStyles$9, "18554545", null, null);
2085
+ function __vue2_injectStyles$9(context) {
2086
+ for (let o in __cssModules$9) {
2087
+ this[o] = __cssModules$9[o];
2088
+ }
2089
+ }
2090
+ var TagsWithTooltip = /* @__PURE__ */ function() {
2091
+ return __component__$9.exports;
2092
+ }();
2093
+ var TaskTypes;
2094
+ (function(TaskTypes2) {
2095
+ TaskTypes2["clientUpload"] = "Client Upload";
2096
+ TaskTypes2["clientReview"] = "For Client Review";
2097
+ TaskTypes2["worksheet"] = "Worksheet";
2098
+ })(TaskTypes || (TaskTypes = {}));
2099
+ var StepType;
2100
+ (function(StepType2) {
2101
+ StepType2["worksheetForEmployeeEmployer"] = "WORKSHEET_FOR_EMPLOYEE_EMPLOYER";
2102
+ StepType2["beneficiary"] = "BENEFICIARY";
2103
+ StepType2["petitioner"] = "PETITIONER";
2104
+ StepType2["billing"] = "BILLING";
2105
+ StepType2["overseas"] = "OVERSEAS";
2106
+ StepType2["supplement"] = "SUPPLEMENT";
2107
+ StepType2["worksheetForAttorney"] = "WORKSHEET_FOR_ATTORNEY";
2108
+ StepType2["counterReviewAndSign"] = "COUNTER_REVIEW_AND_SIGN";
2109
+ StepType2["attorney"] = "ATTORNEY";
2110
+ })(StepType || (StepType = {}));
2111
+ var TaskTemplateSortBy;
2112
+ (function(TaskTemplateSortBy2) {
2113
+ TaskTemplateSortBy2["default"] = "DEFAULT";
2114
+ TaskTemplateSortBy2["id"] = "TASKTEMPLATEID";
2115
+ TaskTemplateSortBy2["name"] = "TASKNAME";
2116
+ TaskTemplateSortBy2["type"] = "TASKTYPE";
2117
+ TaskTemplateSortBy2["isEmployee"] = "ISEMPLOYEE";
2118
+ })(TaskTemplateSortBy || (TaskTemplateSortBy = {}));
2119
+ var useChangeVal = (props, emit) => (k, v) => {
2120
+ console.log(k, v);
2121
+ emit("update:value", __spreadProps(__spreadValues({}, props.value), {
2122
+ [k]: v
2123
+ }));
2124
+ };
2125
+ var refactorParams = (record) => {
2126
+ var _a;
2127
+ return {
2128
+ id: record.id,
2129
+ sampleDocList: ((_a = record.sampleDocs) == null ? void 0 : _a.map(({ id }) => id)) || [],
2130
+ taskName: record.taskName,
2131
+ isEmployee: record.isEmployee || AssigneeTypes[AssigneeTypes.EMPTY_DEFAULT],
2132
+ generalTaskType: record.generalTaskType,
2133
+ descriptions: record.descriptions,
2134
+ tagList: record.tagList
2135
+ };
2136
+ };
2137
+ var BELONGS_TO;
2138
+ (function(BELONGS_TO2) {
2139
+ BELONGS_TO2["None"] = "NONE";
2140
+ BELONGS_TO2["Company_Brochure"] = "COMPANY_BROCHURE";
2141
+ BELONGS_TO2["Company_LetterHead"] = "COMPANY_LETTERHEAD";
2142
+ BELONGS_TO2["Company_FEIN"] = "COMPANY_FEIN";
2143
+ BELONGS_TO2["Company_Financial_Documents"] = "COMPANY_FINANCIAL_DOCUMENTS";
2144
+ BELONGS_TO2["Company_Incorporation_Articles"] = "COMPANY_INCORPORATION_ARTICLES";
2145
+ BELONGS_TO2["Company_Business_License"] = "COMPANY_BUSINESS_LICENSE";
2146
+ BELONGS_TO2["Company_Evidence_Of_Workers_Number"] = "COMPANY_EVIDENCE_OF_WORKERS_NUMBER";
2147
+ BELONGS_TO2["Company_Business_Plan"] = "COMPANY_BUSINESS_PLAN";
2148
+ BELONGS_TO2["Company_Evidence_Of_Working_Space"] = "COMPANY_EVIDENCE_OF_WORKING_SPACE";
2149
+ BELONGS_TO2["Company_Evidence_Of_Employment_Status"] = "COMPANY_EVIDENCE_OF_EMPLOYMENT_STATUS";
2150
+ BELONGS_TO2["Company_Religious_Denomination_Certification"] = "COMPANY_RELIGIOUS_DENOMINATION_CERTIFICATION";
2151
+ BELONGS_TO2["Company_Funding_Documents"] = "COMPANY_FUNDING_DOCUMENTS";
2152
+ BELONGS_TO2["Company_Lists_Of_Investors"] = "COMPANY_LISTS_OF_INVESTORS";
2153
+ BELONGS_TO2["Company_Overseas_Brochure"] = "COMPANY_OVERSEAS_BROCHURE";
2154
+ BELONGS_TO2["Company_Overseas_Articles"] = "COMPANY_OVERSEAS_ARTICLES";
2155
+ BELONGS_TO2["Company_Overseas_Financial_Statements"] = "COMPANY_OVERSEAS_FINANCIAL_STATEMENTS";
2156
+ BELONGS_TO2["Company_Overseas_Business_Activities"] = "COMPANY_OVERSEAS_BUSINESS_ACTIVITIES";
2157
+ BELONGS_TO2["Company_Evidence_Of_Employer_Relationship"] = "COMPANY_EVIDENCE_OF_EMPLOYER_RELATIONSHIP";
2158
+ BELONGS_TO2["Company_Industry_Introduction"] = "COMPANY_INDUSTRY_INTRODUCTION";
2159
+ })(BELONGS_TO || (BELONGS_TO = {}));
2160
+ var belongsTo = [
2161
+ [
2162
+ "None",
2163
+ "NONE"
2164
+ ],
2165
+ [
2166
+ "co:Company Brochure",
2167
+ "COMPANY_BROCHURE"
2168
+ ],
2169
+ [
2170
+ "co:Company Letterhead Template",
2171
+ "COMPANY_LETTERHEAD"
2172
+ ],
2173
+ [
2174
+ "co:US Company EIN Assignment Letter",
2175
+ "COMPANY_FEIN"
2176
+ ],
2177
+ [
2178
+ "co:US Company Federal Income Tax Returns",
2179
+ "COMPANY_FINANCIAL_DOCUMENTS"
2180
+ ],
2181
+ [
2182
+ "co:US Company Articles of Incorporation",
2183
+ "COMPANY_INCORPORATION_ARTICLES"
2184
+ ],
2185
+ [
2186
+ "co:Business License",
2187
+ "COMPANY_BUSINESS_LICENSE"
2188
+ ],
2189
+ [
2190
+ "co:Evidence of the Total Number of Workers",
2191
+ "COMPANY_EVIDENCE_OF_WORKERS_NUMBER"
2192
+ ],
2193
+ [
2194
+ "co:US Company Business Plan",
2195
+ "COMPANY_BUSINESS_PLAN"
2196
+ ],
2197
+ [
2198
+ "co:Evidence of Working Space",
2199
+ "COMPANY_EVIDENCE_OF_WORKING_SPACE"
2200
+ ],
2201
+ [
2202
+ "co:Employment Status of H1B/L-1 Employees",
2203
+ "COMPANY_EVIDENCE_OF_EMPLOYMENT_STATUS"
2204
+ ],
2205
+ [
2206
+ "co:Religious Denomination Certification",
2207
+ "COMPANY_RELIGIOUS_DENOMINATION_CERTIFICATION"
2208
+ ],
2209
+ [
2210
+ "co:Funding Documents of the Software Product",
2211
+ "COMPANY_FUNDING_DOCUMENTS"
2212
+ ],
2213
+ [
2214
+ "co:Lists of Investors with Current Status and Nationality",
2215
+ "COMPANY_LISTS_OF_INVESTORS"
2216
+ ],
2217
+ [
2218
+ "co:Overseas Company Brochure and Product Introduction",
2219
+ "COMPANY_OVERSEAS_BROCHURE"
2220
+ ],
2221
+ [
2222
+ "co:Overseas Company Articles of Organization",
2223
+ "COMPANY_OVERSEAS_ARTICLES"
2224
+ ],
2225
+ [
2226
+ "co:Overseas Company Financial Statements",
2227
+ "COMPANY_OVERSEAS_FINANCIAL_STATEMENTS"
2228
+ ],
2229
+ [
2230
+ "co:Overseas Company Business Activities",
2231
+ "COMPANY_OVERSEAS_BUSINESS_ACTIVITIES"
2232
+ ],
2233
+ [
2234
+ "co:Evidence of U.S. and Foreign Employer Relationship",
2235
+ "COMPANY_EVIDENCE_OF_EMPLOYER_RELATIONSHIP"
2236
+ ],
2237
+ [
2238
+ "co:Industry Introduction",
2239
+ "COMPANY_INDUSTRY_INTRODUCTION"
2240
+ ]
2241
+ ];
2242
+ const roles = [
2243
+ {
2244
+ id: AssigneeTypes.BENEFICIARY,
2245
+ key: "BENEFICIARY",
2246
+ i18nKey: "beneficiary"
2247
+ },
2248
+ {
2249
+ id: AssigneeTypes.PETITIONER,
2250
+ key: "PETITIONER",
2251
+ i18nKey: "petitioner"
2252
+ },
2253
+ {
2254
+ id: AssigneeTypes.ATTORNEY,
2255
+ key: "ATTORNEY",
2256
+ i18nKey: "attorney"
2257
+ },
2258
+ {
2259
+ id: AssigneeTypes.EMPTY_DEFAULT,
2260
+ key: "EMPTY_DEFAULT",
2261
+ i18nKey: "none",
2262
+ hide: true
2263
+ }
2264
+ ];
2265
+ var __vue2_script$8 = defineComponent({
2266
+ name: "index",
2267
+ components: {
2268
+ AntForm: Form,
2269
+ AntFormItem: Form.Item,
2270
+ AntRow: Row,
2271
+ AntCol: Col,
2272
+ AntSelect: Select,
2273
+ AntSelectOption: Select.Option,
2274
+ AntRadioGroup: Radio.Group,
2275
+ AntRadio: Radio,
2276
+ AntTextarea: Input.TextArea,
2277
+ AntInput: Input,
2278
+ AntIcon: Icon,
2279
+ AntPopover: Popover,
2280
+ AFileUploader
2281
+ },
2282
+ props: {
2283
+ value: {
2284
+ type: Object,
2285
+ required: true
2286
+ },
2287
+ uploadFilesFunc: {
2288
+ type: Function,
2289
+ required: true
2290
+ },
2291
+ disabled: {
2292
+ type: Boolean
2293
+ },
2294
+ showAdvancedTypeList: {
2295
+ type: Boolean,
2296
+ default: false
2297
+ },
2298
+ showNotApplicable: {
2299
+ type: Boolean,
2300
+ default: false
2301
+ }
2302
+ },
2303
+ mounted() {
2304
+ var _a, _b, _c;
2305
+ if (!((_a = this.value) == null ? void 0 : _a.id) && !((_b = this.value) == null ? void 0 : _b.assigneeTypeList) && ((_c = this.value) == null ? void 0 : _c.isEmployee)) {
2306
+ this.value.assigneeTypeList = [AssigneeTypes[this.value.isEmployee]];
2307
+ this.changeVal("assigneeTypeList", [AssigneeTypes[this.value.isEmployee]]);
2308
+ }
2309
+ },
2310
+ setup(props, { emit }) {
2311
+ const nameError = ref(false);
2312
+ const typeError = ref(false);
2313
+ const nameErrorContent = ref("message.required");
2314
+ const changeVal = useChangeVal(props, emit);
2315
+ const changeMultiple = (event) => {
2316
+ let toBeEmitted = __spreadProps(__spreadValues({}, props.value), {
2317
+ isEmployee: event
2318
+ });
2319
+ if (event === AssigneeTypes[AssigneeTypes.BENEFICIARY]) {
2320
+ toBeEmitted.assigneeTypeList = [AssigneeTypes.BENEFICIARY];
2321
+ } else if (event === AssigneeTypes[AssigneeTypes.PETITIONER]) {
2322
+ toBeEmitted.assigneeTypeList = [AssigneeTypes.PETITIONER];
2323
+ } else {
2324
+ toBeEmitted.assigneeTypeList = [];
2325
+ }
2326
+ emit("update:value", toBeEmitted);
2327
+ };
2328
+ const validFields = (callback) => {
2329
+ var _a;
2330
+ const data = refactorParams(props.value);
2331
+ if (!data.taskName || !data.taskName.trim()) {
2332
+ nameError.value = true;
2333
+ nameErrorContent.value = "message.required";
2334
+ } else if (((_a = data.taskName) == null ? void 0 : _a.length) > 150) {
2335
+ nameError.value = true;
2336
+ nameErrorContent.value = "message.moreThan150";
2337
+ }
2338
+ typeError.value = !data.generalTaskType;
2339
+ callback(!nameError.value && !typeError.value, data, {
2340
+ nameError,
2341
+ typeError
2342
+ });
2343
+ };
2344
+ watch(() => props.value.taskName, (val) => {
2345
+ nameError.value = !val;
2346
+ });
2347
+ const isAttorneySelected = computed(() => props.value.isEmployee === AssigneeTypes[AssigneeTypes.ATTORNEY]);
2348
+ const defaultActiveKey = computed(() => {
2349
+ var _a, _b;
2350
+ return (((_b = (_a = props.value) == null ? void 0 : _a.assigneeTypeList) == null ? void 0 : _b.length) || 0) > 1 ? "1" : "0";
2351
+ });
2352
+ watch(() => isAttorneySelected.value, (selected) => {
2353
+ if (selected) {
2354
+ if (props.value.generalTaskType !== TaskTypes.worksheet) {
2355
+ changeVal("generalTaskType", TaskTypes.clientUpload);
2356
+ }
2357
+ }
2358
+ });
2359
+ const shouldShowBelongsTo = computed(() => {
2360
+ if (props.value.isEmployee !== AssigneeTypes[AssigneeTypes.PETITIONER])
2361
+ return false;
2362
+ if (props.value.taskSmartType) {
2363
+ return belongsTo.some(([_, v]) => v === props.value.taskSmartType);
2364
+ }
2365
+ return true;
2366
+ });
2367
+ watch(() => shouldShowBelongsTo.value, (shouldShow) => {
2368
+ if (shouldShow && !props.value.taskSmartType || !shouldShow) {
2369
+ changeVal("taskSmartType", BELONGS_TO.None);
2370
+ }
2371
+ }, { immediate: true });
2372
+ return {
2373
+ typeError,
2374
+ nameError,
2375
+ changeVal,
2376
+ changeMultiple,
2377
+ validFields,
2378
+ TaskTypes,
2379
+ roles,
2380
+ isAttorneySelected,
2381
+ defaultActiveKey,
2382
+ nameErrorContent,
2383
+ belongsTo,
2384
+ AssigneeTypes,
2385
+ shouldShowBelongsTo
2386
+ };
2387
+ }
2388
+ });
2389
+ var render$8 = function() {
2390
+ var _vm = this;
2391
+ var _h = _vm.$createElement;
2392
+ var _c = _vm._self._c || _h;
2393
+ return _c("ant-form", { staticClass: "add-edit-task-modal", on: { "submit": function(e) {
2394
+ return e.preventDefault();
2395
+ } } }, [_c("ant-row", { attrs: { "gutter": 20 } }, [_c("ant-col", { attrs: { "span": 12 } }, [_c("ant-form-item", { attrs: { "required": "", "name": "taskName", "label": _vm.$t("message.taskName"), "help": _vm.nameError ? _vm.$t(_vm.nameErrorContent) : void 0, "validate-status": _vm.nameError ? "error" : void 0 } }, [_c("ant-input", { attrs: { "disabled": _vm.disabled, "value": _vm.value.taskName }, on: { "input": function($event) {
2396
+ return _vm.changeVal("taskName", $event.target.value);
2397
+ } } })], 1)], 1), _c("ant-col", { attrs: { "span": 12 } }, [_c("ant-form-item", { attrs: { "label": "" + _vm.$t("message.assignee") + " (" + _vm.$t("message.optional") + ")" } }, [_c("ant-select", { staticStyle: { "min-width": "170px" }, attrs: { "disabled": _vm.disabled, "value": _vm.value.isEmployee, "allowClear": true }, on: { "change": function($event) {
2398
+ return _vm.changeMultiple($event);
2399
+ } } }, _vm._l(_vm.roles, function(role) {
2400
+ return _c("ant-select-option", { key: role.id, attrs: { "value": role.key } }, [_c("span", { staticStyle: { "text-transform": "capitalize" } }, [_vm._v(" " + _vm._s(_vm.$t("message." + role.i18nKey)) + " ")])]);
2401
+ }), 1)], 1)], 1)], 1), _vm.showAdvancedTypeList ? _c("a-collapse", { staticStyle: { "width": "400px" }, attrs: { "default-active-key": _vm.defaultActiveKey, "bordered": false, "expand-icon-position": "right" } }, [_c("a-collapse-panel", { key: "1", staticStyle: { "background": "#fff", "border-radius": "4px", "margin-bottom": "24px", "border": "0", "overflow": "hidden" }, attrs: { "header": _vm.$t("message.advancedSettingForAddAcc") } }, [_c("a-checkbox-group", { on: { "change": function($event) {
2402
+ return _vm.changeVal("assigneeTypeList", $event);
2403
+ } }, model: { value: _vm.value.assigneeTypeList, callback: function($$v) {
2404
+ _vm.$set(_vm.value, "assigneeTypeList", $$v);
2405
+ }, expression: "value.assigneeTypeList" } }, [_c("a-checkbox", { attrs: { "value": 1, "disabled": _vm.value.isEmployee === "BENEFICIARY" } }, [_vm._v(_vm._s(_vm.$t("message.Beneficiary")) + " ")]), _c("a-checkbox", { attrs: { "value": 2, "disabled": _vm.value.isEmployee === "PETITIONER" } }, [_vm._v(_vm._s(_vm.$t("message.petitioner")) + " ")])], 1)], 1)], 1) : _vm._e(), _c("ant-row", { attrs: { "gutter": 40 } }, [_c("ant-col", { attrs: { "span": 12 } }, [_c("ant-form-item", { attrs: { "required": "", "label": _vm.$t("message.type"), "help": _vm.typeError ? _vm.$t("message.required") : void 0, "validate-status": _vm.typeError ? "error" : void 0 } }, [_vm.value.generalTaskType !== _vm.TaskTypes.worksheet ? _c("ant-radio-group", { attrs: { "disabled": _vm.value.presetDocs != null || _vm.disabled, "value": _vm.value.generalTaskType }, on: { "change": function($event) {
2406
+ return _vm.changeVal("generalTaskType", $event.target.value);
2407
+ } } }, [_c("ant-radio", { attrs: { "value": _vm.TaskTypes.clientUpload } }, [_vm._v(" " + _vm._s(_vm.$t("message.clientUpload")) + " ")]), _c("ant-radio", { attrs: { "value": _vm.TaskTypes.clientReview, "disabled": _vm.isAttorneySelected } }, [_vm._v(" " + _vm._s(_vm.$t("message.clientReview")) + " ")])], 1) : _c("div", [_vm._v(_vm._s(_vm.$t("message.worksheet")))])], 1)], 1), _vm.shouldShowBelongsTo ? _c("ant-col", { attrs: { "span": 12 } }, [_c("ant-form-item", { scopedSlots: _vm._u([{ key: "label", fn: function() {
2408
+ return [_vm._v(" " + _vm._s(_vm.$t("message.belongsTo")) + " "), _c("ant-popover", { attrs: { "content": _vm.$t("message.toReuseThisDoc") } }, [_c("ant-icon", { staticClass: "pt-3.5 text-classic cursor-pointer", attrs: { "type": "question-circle" } })], 1)];
2409
+ }, proxy: true }], null, false, 4216407690) }, [_c("ant-select", { on: { "change": function($event) {
2410
+ return _vm.changeVal("taskSmartType", $event);
2411
+ } }, model: { value: _vm.value.taskSmartType, callback: function($$v) {
2412
+ _vm.$set(_vm.value, "taskSmartType", $$v);
2413
+ }, expression: "value.taskSmartType" } }, _vm._l(_vm.belongsTo, function(item) {
2414
+ return _c("ant-select-option", { key: item[0], attrs: { "value": item[1] } }, [_vm._v(" " + _vm._s(item[0]) + " ")]);
2415
+ }), 1)], 1)], 1) : _vm._e()], 1), _c("ant-form-item", { attrs: { "label": "" + _vm.$t("message.descriptions") + " (" + _vm.$t("message.optional") + ")" } }, [_c("ant-textarea", { attrs: { "disabled": _vm.disabled, "value": _vm.value.descriptions }, on: { "input": function($event) {
2416
+ return _vm.changeVal("descriptions", $event.target.value);
2417
+ } } })], 1), _c("ant-form-item", { attrs: { "label": "" + _vm.$t("message.attachment") + " (" + _vm.$t("message.optional") + ")" } }, [_c("a-file-uploader", { attrs: { "disabled": _vm.value.presetDocs != null || _vm.disabled, "value": _vm.value.presetDocs || _vm.value.sampleDocs, "uploadFilesFunc": _vm.uploadFilesFunc }, on: { "change": function($event) {
2418
+ return _vm.changeVal("sampleDocs", $event);
2419
+ } } })], 1), _c("ant-form-item", { attrs: { "label": "" + _vm.$t("message.tags") + " (" + _vm.$t("message.optional") + ")" } }, [_c("ant-select", { attrs: { "disabled": _vm.disabled, "mode": "tags", "value": _vm.value.tagList || [], "options": [] }, on: { "change": function($event) {
2420
+ return _vm.changeVal("tagList", $event);
2421
+ } } })], 1), _c("ant-form-item", [_vm.showNotApplicable ? _c("a-checkbox", { attrs: { "disabled": _vm.disabled, "checked": _vm.value.allowSubmitWithoutFile }, on: { "change": function($event) {
2422
+ return _vm.changeVal("allowSubmitWithoutFile", $event.target.checked);
2423
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.notApplicable")) + " ")]) : _vm._e()], 1)], 1);
2424
+ };
2425
+ var staticRenderFns$8 = [];
2426
+ var index_vue_vue_type_style_index_0_scoped_true_lang$3 = "";
2427
+ const __cssModules$8 = {};
2428
+ var __component__$8 = /* @__PURE__ */ normalizeComponent(__vue2_script$8, render$8, staticRenderFns$8, false, __vue2_injectStyles$8, "0b1cbb47", null, null);
2429
+ function __vue2_injectStyles$8(context) {
2430
+ for (let o in __cssModules$8) {
2431
+ this[o] = __cssModules$8[o];
2432
+ }
2433
+ }
2434
+ var TaskForm = /* @__PURE__ */ function() {
2435
+ return __component__$8.exports;
2436
+ }();
2437
+ var __vue2_script$7 = defineComponent({
2438
+ name: "NewTask",
2439
+ components: {
2440
+ AFileUploader,
2441
+ TaskForm,
2442
+ AntModal: Modal,
2443
+ AntCheckbox: Checkbox,
2444
+ AntButton: Button,
2445
+ AntPopconfirm: Popconfirm
2446
+ },
2447
+ props: {
2448
+ visible: {
2449
+ type: Boolean,
2450
+ default: false
2451
+ },
2452
+ value: {
2453
+ type: Object,
2454
+ required: true
2455
+ },
2456
+ showSendEmail: {
2457
+ type: Boolean,
2458
+ default: false
2459
+ },
2460
+ showAddToList: {
2461
+ type: Boolean,
2462
+ default: false
2463
+ },
2464
+ showAllowSubmit: {
2465
+ type: Boolean,
2466
+ default: false
2467
+ },
2468
+ uploadFilesFunc: {
2469
+ type: Function,
2470
+ required: true
2471
+ },
2472
+ userId: {
2473
+ type: String,
2474
+ required: true
2475
+ },
2476
+ lawFirmId: {
2477
+ type: Number,
2478
+ required: true
2479
+ },
2480
+ loading: {
2481
+ type: Boolean,
2482
+ default: false
2483
+ },
2484
+ hasDoubleConfirm: {
2485
+ type: Boolean,
2486
+ default: true
2487
+ }
2488
+ },
2489
+ setup(props, { emit }) {
2490
+ const taskForm = ref();
2491
+ const changeVisible = (visible) => {
2492
+ emit("update:visible", visible);
2493
+ };
2494
+ const nameError = ref(false);
2495
+ const typeError = ref(false);
2496
+ const changeVal = useChangeVal(props, emit);
2497
+ const submit2 = () => {
2498
+ taskForm.value.validFields((passed, ts) => {
2499
+ var _a;
2500
+ if (passed) {
2501
+ const data = {
2502
+ taskTemplateObj: __spreadProps(__spreadValues({}, omit(["presetDocs"], ts)), {
2503
+ taskName: (_a = ts.taskName) == null ? void 0 : _a.trim(),
2504
+ taskType: props.value.taskTemplateObj.taskType,
2505
+ taskSmartType: props.value.taskTemplateObj.taskSmartType,
2506
+ tagList: ts.tagList || [],
2507
+ descriptions: ts.descriptions || ""
2508
+ }),
2509
+ selfUserId: props.userId,
2510
+ selfLawFirmId: props.lawFirmId,
2511
+ taskTemplateId: ts.id,
2512
+ isAddedToTask: props.value.isAddedToTask || false,
2513
+ isNotified: props.value.isNotified || false,
2514
+ allowSubmitWithoutFile: props.value.allowSubmitWithoutFile
2515
+ };
2516
+ emit("submit", data);
2517
+ }
2518
+ });
2519
+ };
2520
+ const updateFormValue = (record) => {
2521
+ console.log(record);
2522
+ const data = {
2523
+ taskTemplateId: record.id,
2524
+ selfUserId: props.userId,
2525
+ selfLawFirmId: props.lawFirmId,
2526
+ isAddedToTask: props.value.isAddedToTask,
2527
+ isNotified: props.value.isNotified,
2528
+ allowSubmitWithoutFile: props.value.allowSubmitWithoutFile,
2529
+ taskTemplateObj: __spreadProps(__spreadValues({}, record), {
2530
+ isEmployee: record.isEmployee
2531
+ })
2532
+ };
2533
+ emit("update:value", data);
2534
+ };
2535
+ return {
2536
+ submit: submit2,
2537
+ taskForm,
2538
+ changeVisible,
2539
+ changeVal,
2540
+ AFileUploader,
2541
+ TaskTypes,
2542
+ nameError,
2543
+ typeError,
2544
+ updateFormValue
2545
+ };
2546
+ }
2547
+ });
2548
+ var render$7 = function() {
2549
+ var _vm = this;
2550
+ var _h = _vm.$createElement;
2551
+ var _c = _vm._self._c || _h;
2552
+ return _c("ant-modal", { attrs: { "id": "venus-component-new-task", "visible": _vm.visible, "title": _vm.value.taskTemplateObj.id ? _vm.$t("message.editTask") : _vm.$t("message.newTask"), "width": "700px" }, on: { "cancel": function($event) {
2553
+ return _vm.changeVisible(false);
2554
+ } }, scopedSlots: _vm._u([{ key: "footer", fn: function() {
2555
+ return [_c("div", { staticClass: "footer" }, [_vm.showSendEmail ? _c("div", { staticStyle: { "float": "left", "padding-top": "5px", "padding-left": "10px" } }, [_c("ant-checkbox", { attrs: { "checked": _vm.value.isNotified }, on: { "change": function($event) {
2556
+ return _vm.changeVal("isNotified", $event.target.checked);
2557
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.sendTaskEmail")) + " ")])], 1) : _vm._e(), _c("div", [_vm.hasDoubleConfirm ? _c("ant-popconfirm", { attrs: { "title": _vm.$t("message.updateTaskConfirm"), "placement": "top" }, on: { "confirm": _vm.submit } }, [_c("ant-button", { attrs: { "loading": _vm.loading, "type": "primary" } }, [_vm._v(_vm._s(_vm.$t("message.submit")) + " ")])], 1) : _c("ant-button", { attrs: { "loading": _vm.loading, "type": "primary" }, on: { "click": _vm.submit } }, [_vm._v(_vm._s(_vm.$t("message.submit")) + " ")]), _c("ant-button", { on: { "click": function($event) {
2558
+ return _vm.changeVisible(false);
2559
+ } } }, [_vm._v(_vm._s(_vm.$t("message.cancel")) + " ")])], 1)])];
2560
+ }, proxy: true }]) }, [_c("task-form", { ref: "taskForm", attrs: { "upload-files-func": _vm.uploadFilesFunc, "law-firm-id": _vm.lawFirmId, "user-id": _vm.userId, "value": _vm.value.taskTemplateObj }, on: { "update:value": _vm.updateFormValue } }), _vm.showAddToList ? _c("ant-checkbox", { attrs: { "checked": _vm.value.isAddedToTask }, on: { "change": function($event) {
2561
+ return _vm.changeVal("isAddedToTask", $event.target.checked);
2562
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.addToTaskList")) + " ")]) : _vm._e(), _vm.showAllowSubmit ? _c("ant-checkbox", { staticClass: "ml-2", attrs: { "checked": _vm.value.allowSubmitWithoutFile }, on: { "change": function($event) {
2563
+ return _vm.changeVal("allowSubmitWithoutFile", $event.target.checked);
2564
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.allowSubmitWithoutFile")) + " ")]) : _vm._e()], 1);
2565
+ };
2566
+ var staticRenderFns$7 = [];
2567
+ var index_vue_vue_type_style_index_0_scoped_true_lang$2 = "";
2568
+ const __cssModules$7 = {};
2569
+ var __component__$7 = /* @__PURE__ */ normalizeComponent(__vue2_script$7, render$7, staticRenderFns$7, false, __vue2_injectStyles$7, "76e42884", null, null);
2570
+ function __vue2_injectStyles$7(context) {
2571
+ for (let o in __cssModules$7) {
2572
+ this[o] = __cssModules$7[o];
2573
+ }
2574
+ }
2575
+ var NewTask = /* @__PURE__ */ function() {
2576
+ return __component__$7.exports;
2577
+ }();
2578
+ var __vue2_script$6 = defineComponent({
2579
+ name: "taskTemplateFilter",
2580
+ components: {
2581
+ AntInput: Input,
2582
+ AntButton: Button,
2583
+ AntCheckbox: Checkbox,
2584
+ AntCheckboxGroup: Checkbox.Group
2585
+ },
2586
+ props: {
2587
+ conditions: {
2588
+ type: Object,
2589
+ required: true
2590
+ },
2591
+ showTaskSettingLink: {
2592
+ type: Boolean,
2593
+ default: true
2594
+ },
2595
+ inline: {
2596
+ type: Boolean,
2597
+ default: false
2598
+ },
2599
+ width: {
2600
+ type: Number,
2601
+ default: 300
2602
+ },
2603
+ showNewBtn: {
2604
+ type: Boolean,
2605
+ default: true
2606
+ }
2607
+ },
2608
+ setup(props, { emit }) {
2609
+ const changeVal = (key, val) => {
2610
+ const data = __spreadProps(__spreadValues({}, props.conditions), {
2611
+ [key]: val
2612
+ });
2613
+ if (key === "isEmployee" && val.length === 0) {
2614
+ data.isEmployee = [AssigneeTypes.EMPTY_DEFAULT];
2615
+ }
2616
+ emit("update:conditions", data);
2617
+ };
2618
+ return {
2619
+ AssigneeTypes,
2620
+ changeVal
2621
+ };
2622
+ }
2623
+ });
2624
+ var render$6 = function() {
2625
+ var _vm = this;
2626
+ var _h = _vm.$createElement;
2627
+ var _c = _vm._self._c || _h;
2628
+ return _c("div", { staticClass: "filter mb-5" }, [_c("ant-input", { style: "width:" + _vm.width + "px", attrs: { "value": _vm.conditions.keywords, "placeholder": _vm.$t("message.searchTaskPlaceholder") }, on: { "input": function($event) {
2629
+ return _vm.changeVal("keywords", $event.target.value);
2630
+ } }, scopedSlots: _vm._u([{ key: "suffix", fn: function() {
2631
+ return void 0;
2632
+ }, proxy: true }]) }), _vm.showNewBtn ? _c("ant-button", { class: { taskTemplateInline: _vm.inline }, staticStyle: { "margin-left": "20px", "float": "right" }, on: { "click": function($event) {
2633
+ return _vm.$emit("update:newTaskVisible", true);
2634
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.newTask")) + " ")]) : _vm._e(), _vm.showTaskSettingLink ? _c("a", { class: { taskTemplateInline: _vm.inline }, staticStyle: { "float": "right", "margin-top": "5px", "color": "dodgerblue !important" }, attrs: { "href": "/task-templates", "target": "_blank" } }, [_vm._v(" " + _vm._s(_vm.$t("message.taskSetting")) + " ")]) : _vm._e(), _c("div", { class: { taskTemplateInline: _vm.inline }, staticStyle: { "margin-top": "20px" } }, [_c("ant-checkbox-group", { attrs: { "value": _vm.conditions.isEmployee }, on: { "change": function($event) {
2635
+ return _vm.changeVal("isEmployee", $event);
2636
+ } } }, [_c("ant-checkbox", { attrs: { "value": _vm.AssigneeTypes.ATTORNEY } }, [_vm._v(_vm._s(_vm.$t("message.attorney")) + " ")]), _c("ant-checkbox", { attrs: { "value": _vm.AssigneeTypes.BENEFICIARY } }, [_vm._v(_vm._s(_vm.$t("message.beneficiary")) + " ")]), _c("ant-checkbox", { attrs: { "value": _vm.AssigneeTypes.PETITIONER } }, [_vm._v(_vm._s(_vm.$t("message.petitioner")) + " ")]), _c("ant-checkbox", { attrs: { "value": _vm.AssigneeTypes.EMPTY_DEFAULT } }, [_vm._v(_vm._s(_vm.$t("message.none")) + " ")])], 1)], 1)], 1);
2637
+ };
2638
+ var staticRenderFns$6 = [];
2639
+ var index_vue_vue_type_style_index_0_scoped_true_lang$1 = "";
2640
+ const __cssModules$6 = {};
2641
+ var __component__$6 = /* @__PURE__ */ normalizeComponent(__vue2_script$6, render$6, staticRenderFns$6, false, __vue2_injectStyles$6, "c5d917d8", null, null);
2642
+ function __vue2_injectStyles$6(context) {
2643
+ for (let o in __cssModules$6) {
2644
+ this[o] = __cssModules$6[o];
2645
+ }
2646
+ }
2647
+ var TaskTemplateFilter = /* @__PURE__ */ function() {
2648
+ return __component__$6.exports;
2649
+ }();
2650
+ function useVm() {
2651
+ const scope = getCurrentScope();
2652
+ return scope.vm;
2653
+ }
2654
+ function useT() {
2655
+ const vm = useVm();
2656
+ return (key) => vm.$i18n.t(key);
2657
+ }
2658
+ var __vue2_script$5 = defineComponent({
2659
+ name: "TaskTablePure",
2660
+ components: {
2661
+ AntTable: Table,
2662
+ AntButton: Button,
2663
+ AssigneeTag,
2664
+ TagsWithTooltip
2665
+ },
2666
+ props: {
2667
+ addedTasks: {
2668
+ type: Array,
2669
+ required: true
2670
+ },
2671
+ dataSource: {
2672
+ type: Array,
2673
+ required: true
2674
+ },
2675
+ loading: {
2676
+ type: Boolean,
2677
+ default: false
2678
+ },
2679
+ pagination: {
2680
+ type: Object,
2681
+ required: true
2682
+ },
2683
+ noEdit: {
2684
+ type: Boolean,
2685
+ default: false
2686
+ },
2687
+ showEdit: {
2688
+ type: Boolean,
2689
+ default: true
2690
+ }
2691
+ },
2692
+ setup(props) {
2693
+ const { addedTasks } = toRefs(props);
2694
+ const t = useT();
2695
+ const columns = [
2696
+ {
2697
+ title: t("message.taskName"),
2698
+ dataIndex: "taskName",
2699
+ key: "taskName",
2700
+ scopedSlots: { customRender: "taskName" }
2701
+ },
2702
+ {
2703
+ title: t("message.assignee"),
2704
+ dataIndex: "isEmployee",
2705
+ key: "isEmployee",
2706
+ width: 120,
2707
+ scopedSlots: { customRender: "isEmployee" }
2708
+ },
2709
+ {
2710
+ title: t("message.tag"),
2711
+ dataIndex: "tagList",
2712
+ key: "tagList",
2713
+ width: 120,
2714
+ scopedSlots: { customRender: "tagList" }
2715
+ },
2716
+ {
2717
+ title: "Operation",
2718
+ dataIndex: "id",
2719
+ key: "id",
2720
+ width: 210,
2721
+ scopedSlots: { customRender: "operation" }
2722
+ }
2723
+ ];
2724
+ const isTemplateAdded = (record) => addedTasks.value.some((added) => added.id === record.id);
2725
+ return {
2726
+ isTemplateAdded,
2727
+ columns
2728
+ };
2729
+ }
2730
+ });
2731
+ var render$5 = function() {
2732
+ var _vm = this;
2733
+ var _h = _vm.$createElement;
2734
+ var _c = _vm._self._c || _h;
2735
+ return _c("div", [_c("ant-table", { attrs: { "size": "middle", "dataSource": _vm.dataSource, "rowKey": "id", "columns": _vm.columns, "pagination": _vm.pagination, "loading": _vm.loading }, on: { "change": function($event) {
2736
+ return _vm.$emit("changePagination", $event);
2737
+ } }, scopedSlots: _vm._u([{ key: "isEmployee", fn: function(isEmployee) {
2738
+ return _c("span", {}, [_c("assignee-tag", { attrs: { "assignee-type": isEmployee } })], 1);
2739
+ } }, { key: "taskName", fn: function(taskName) {
2740
+ return _c("span", {}, [_c("span", { staticStyle: { "word-break": "break-word" } }, [_vm._v(_vm._s(taskName))])]);
2741
+ } }, { key: "tagList", fn: function(tags) {
2742
+ return [_c("tags-with-tooltip", { attrs: { "tags": tags } })];
2743
+ } }, { key: "operation", fn: function(_, record) {
2744
+ return [_vm.showEdit && record.isGallery ? _c("span", { staticStyle: { "width": "82px", "display": "inline-block", "color": "#999" } }, [_vm._v(" Preset ")]) : _vm.showEdit ? _c("ant-button", { staticClass: "mr-2", attrs: { "disabled": _vm.isTemplateAdded(record), "size": "small" }, on: { "click": function($event) {
2745
+ return _vm.$emit("editTask", record);
2746
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.editTask")) + " ")]) : _vm._e(), _vm.isTemplateAdded(record) ? _c("ant-button", { staticStyle: { "width": "70px" }, attrs: { "size": "small", "type": "danger" }, on: { "click": function($event) {
2747
+ return _vm.$emit("removeTask", record);
2748
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.remove")) + " ")]) : _c("ant-button", { staticStyle: { "width": "70px" }, attrs: { "size": "small", "type": "primary" }, on: { "click": function($event) {
2749
+ return _vm.$emit("addTask", record);
2750
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.add")) + " ")])];
2751
+ } }]) })], 1);
2752
+ };
2753
+ var staticRenderFns$5 = [];
2754
+ var TaskTablePure_vue_vue_type_style_index_0_scoped_true_lang = "";
2755
+ const __cssModules$5 = {};
2756
+ var __component__$5 = /* @__PURE__ */ normalizeComponent(__vue2_script$5, render$5, staticRenderFns$5, false, __vue2_injectStyles$5, "58f5c207", null, null);
2757
+ function __vue2_injectStyles$5(context) {
2758
+ for (let o in __cssModules$5) {
2759
+ this[o] = __cssModules$5[o];
2760
+ }
2761
+ }
2762
+ var TaskTablePure = /* @__PURE__ */ function() {
2763
+ return __component__$5.exports;
2764
+ }();
2765
+ var useSearchTaskTemplates = (pagination, conditions = ref({}), lawFirmId, withGallery = true) => {
2766
+ const startIndex = computed(() => (pagination.value.current - 1) * pagination.value.pageSize);
2767
+ const endIndex = computed(() => startIndex.value + pagination.value.pageSize);
2768
+ watch(() => conditions.value, () => {
2769
+ pagination.value.current = 1;
2770
+ pagination.value.total = 0;
2771
+ });
2772
+ return useQuery(SearchTaskTemplatesQuery, () => ({
2773
+ query: {
2774
+ includeGallery: withGallery,
2775
+ keywords: conditions.value.keywords || "",
2776
+ isEmployee: conditions.value.isEmployee,
2777
+ taskTemplateId: conditions.value.taskTemplateId,
2778
+ sortBy: TaskTemplateSortBy.name,
2779
+ sortOrder: SortOrder.asc
2780
+ },
2781
+ startIndex: startIndex.value,
2782
+ endIndex: endIndex.value,
2783
+ lawFirmId
2784
+ }));
2785
+ };
2786
+ const taskTemplateFragment = gql`
2787
+ fragment taskTemplate on TaskTemplate {
2788
+ id
2789
+ taskName
2790
+ taskSmartType
2791
+ tagList
2792
+ isEmployee
2793
+ assigneeTypeList
2794
+ taskType
2795
+ generalTaskType
2796
+ descriptions
2797
+ sampleDocs {
2798
+ id
2799
+ name
2800
+ link
2801
+ }
2802
+ sampleDocList
2803
+ updatedUser{
2804
+ id
2805
+ name
2806
+ }
2807
+ updatedOn
2808
+ }
2809
+ `;
2810
+ const SearchTaskTemplatesQuery = gql`
2811
+ query taskTemplateSearch(
2812
+ $query: TaskTemplateFilterInput!
2813
+ $startIndex: Int
2814
+ $endIndex: Int
2815
+ $lawFirmId: Int!
2816
+ ) {
2817
+ taskTemplateSearch(query: $query) {
2818
+ numResult
2819
+ taskTemplateList(startIndex: $startIndex, endIndex: $endIndex) {
2820
+ ...taskTemplate
2821
+ isGallery(selfLawFirmId: $lawFirmId)
2822
+ }
2823
+ }
2824
+ }
2825
+ ${taskTemplateFragment}
2826
+ `;
2827
+ var useTaskActions = (addedTasks, emit) => {
2828
+ const addTask = (record) => emit("update:addedTasks", [...addedTasks.value, record]);
2829
+ const editTask = (record) => {
2830
+ const taskToAdd = {
2831
+ taskTemplateObj: record
2832
+ };
2833
+ emit("editTask", taskToAdd);
2834
+ };
2835
+ const removeTask = (record) => emit("update:addedTasks", addedTasks.value.filter(({ id }) => id !== record.id));
2836
+ return {
2837
+ addTask,
2838
+ editTask,
2839
+ removeTask
2840
+ };
2841
+ };
2842
+ var useSearchTaskConditions = () => ref({
2843
+ keywords: "",
2844
+ isEmployee: [
2845
+ AssigneeTypes.ATTORNEY,
2846
+ AssigneeTypes.PETITIONER,
2847
+ AssigneeTypes.BENEFICIARY,
2848
+ AssigneeTypes.EMPTY_DEFAULT
2849
+ ]
2850
+ });
2851
+ var useTaskTemplateTableData = (props, emit) => {
2852
+ const initialPagination = ref({
2853
+ current: 1,
2854
+ pageSize: props.pageSize || 10,
2855
+ total: 0
2856
+ });
2857
+ const { conditions = useSearchTaskConditions(), addedTasks = ref([]) } = toRefs(props);
2858
+ const { result, loading, variables } = useSearchTaskTemplates(initialPagination, conditions, props.lawFirmId, props.withGallery);
2859
+ const dataSource = computed(() => {
2860
+ var _a;
2861
+ return (((_a = result.value) == null ? void 0 : _a.taskTemplateSearch.taskTemplateList) || []).map((item) => __spreadProps(__spreadValues({}, item), {
2862
+ taskSmartType: item.taskSmartType || ""
2863
+ }));
2864
+ });
2865
+ const total = computed(() => {
2866
+ var _a;
2867
+ return ((_a = result.value) == null ? void 0 : _a.taskTemplateSearch.numResult) || 0;
2868
+ });
2869
+ const pagination = computed(() => __spreadProps(__spreadValues({}, initialPagination.value), {
2870
+ total: total.value
2871
+ }));
2872
+ const changePagination = (pagination2) => {
2873
+ initialPagination.value = __spreadValues({}, pagination2);
2874
+ };
2875
+ const { addTask, editTask, removeTask } = useTaskActions(addedTasks, emit);
2876
+ return {
2877
+ addTask,
2878
+ editTask,
2879
+ removeTask,
2880
+ changePagination,
2881
+ pagination,
2882
+ dataSource,
2883
+ result,
2884
+ loading,
2885
+ conditions,
2886
+ addedTasks,
2887
+ variables
2888
+ };
2889
+ };
2890
+ var __vue2_script$4 = defineComponent({
2891
+ name: "TaskTable",
2892
+ components: {
2893
+ TaskTablePure
2894
+ },
2895
+ props: {
2896
+ conditions: {
2897
+ type: Object,
2898
+ required: true
2899
+ },
2900
+ addedTasks: {
2901
+ type: Array,
2902
+ default: () => []
2903
+ },
2904
+ lawFirmId: {
2905
+ type: Number,
2906
+ required: true
2907
+ },
2908
+ pageSize: {
2909
+ type: Number
2910
+ },
2911
+ withGallery: {
2912
+ type: Boolean,
2913
+ default: true
2914
+ }
2915
+ },
2916
+ setup(props, { emit }) {
2917
+ const {
2918
+ loading,
2919
+ dataSource,
2920
+ pagination,
2921
+ variables,
2922
+ changePagination,
2923
+ addTask,
2924
+ editTask,
2925
+ removeTask
2926
+ } = useTaskTemplateTableData(props, emit);
2927
+ return {
2928
+ loading,
2929
+ dataSource,
2930
+ pagination,
2931
+ AssigneeTypesText,
2932
+ changePagination,
2933
+ addTask,
2934
+ editTask,
2935
+ removeTask,
2936
+ variables
2937
+ };
2938
+ }
2939
+ });
2940
+ var render$4 = function() {
2941
+ var _vm = this;
2942
+ var _h = _vm.$createElement;
2943
+ var _c = _vm._self._c || _h;
2944
+ return _c("div", [_vm._t("default", function() {
2945
+ return [_c("task-table-pure", { attrs: { "loading": _vm.loading, "data-source": _vm.dataSource, "pagination": _vm.pagination, "added-tasks": _vm.addedTasks }, on: { "editTask": _vm.editTask, "addTask": _vm.addTask, "removeTask": _vm.removeTask, "changePagination": _vm.changePagination } })];
2946
+ }, { "loading": _vm.loading, "dataSource": _vm.dataSource, "pagination": _vm.pagination, "AssigneeTypesText": _vm.AssigneeTypesText, "changePagination": _vm.changePagination })], 2);
2947
+ };
2948
+ var staticRenderFns$4 = [];
2949
+ var TaskTable_vue_vue_type_style_index_0_scoped_true_lang = "";
2950
+ const __cssModules$4 = {};
2951
+ var __component__$4 = /* @__PURE__ */ normalizeComponent(__vue2_script$4, render$4, staticRenderFns$4, false, __vue2_injectStyles$4, "6662fabb", null, null);
2952
+ function __vue2_injectStyles$4(context) {
2953
+ for (let o in __cssModules$4) {
2954
+ this[o] = __cssModules$4[o];
2955
+ }
2956
+ }
2957
+ var TaskTable = /* @__PURE__ */ function() {
2958
+ return __component__$4.exports;
2959
+ }();
2960
+ var __vue2_script$3 = defineComponent({
2961
+ name: "MainModal",
2962
+ components: {
2963
+ TaskTable,
2964
+ TaskTemplateFilter,
2965
+ AntButton: Button,
2966
+ AntBadge: Badge
2967
+ },
2968
+ props: {
2969
+ visible: {
2970
+ type: Boolean,
2971
+ default: false
2972
+ },
2973
+ addedTasks: {
2974
+ type: Array
2975
+ },
2976
+ lawFirmId: {
2977
+ type: Number,
2978
+ required: true
2979
+ },
2980
+ showTaskSettingLink: {
2981
+ type: Boolean,
2982
+ default: true
2983
+ },
2984
+ showPage: {
2985
+ type: Boolean,
2986
+ default: false
2987
+ },
2988
+ pageSize: {
2989
+ type: Number
2990
+ },
2991
+ openReviewButtonText: {
2992
+ type: String,
2993
+ default: "Review and add to template"
2994
+ },
2995
+ withGallery: {
2996
+ type: Boolean,
2997
+ default: true
2998
+ },
2999
+ showNewBtn: {
3000
+ type: Boolean,
3001
+ default: true
3002
+ }
3003
+ },
3004
+ setup(props, { emit }) {
3005
+ const taskTable = ref();
3006
+ const conditions = useSearchTaskConditions();
3007
+ const currentComponent = shallowRef(props.showPage ? Card : Modal);
3008
+ const editAction = (record) => {
3009
+ emit("editTask", record);
3010
+ };
3011
+ const getVariables = () => taskTable.value.variables;
3012
+ return {
3013
+ editAction,
3014
+ getVariables,
3015
+ taskTable,
3016
+ conditions,
3017
+ AssigneeTypes,
3018
+ currentComponent
3019
+ };
3020
+ }
3021
+ });
3022
+ var render$3 = function() {
3023
+ var _vm = this;
3024
+ var _h = _vm.$createElement;
3025
+ var _c = _vm._self._c || _h;
3026
+ return _c(_vm.currentComponent, { tag: "component", staticClass: "task-cart-main-modal", attrs: { "zIndex": 800, "width": 900, "visible": _vm.visible, "title": _vm.showPage ? _vm.$t("message.tasks") : _vm.$t("message.addTask") }, on: { "cancel": function($event) {
3027
+ return _vm.$emit("update:visible", false);
3028
+ } }, scopedSlots: _vm._u([{ key: "footer", fn: function() {
3029
+ return [_c("ant-button", { staticStyle: { "margin-right": "20px" }, on: { "click": function($event) {
3030
+ return _vm.$emit("update:visible", false);
3031
+ } } }, [_vm._v("Cancel ")]), _c("ant-badge", { attrs: { "count": _vm.addedTasks.length } }, [_c("ant-button", { attrs: { "disabled": _vm.addedTasks.length === 0, "type": "primary" }, on: { "click": function($event) {
3032
+ return _vm.$emit("update:reviewModalVisible", true);
3033
+ } } }, [_vm._v(" " + _vm._s(_vm.openReviewButtonText) + " ")])], 1)];
3034
+ }, proxy: true }]) }, [_c("task-template-filter", { attrs: { "show-task-home-page-link": true, "show-task-setting-link": _vm.showTaskSettingLink, "conditions": _vm.conditions, "inline": !!_vm.showPage, "show-new-btn": _vm.showNewBtn }, on: { "update:conditions": function($event) {
3035
+ _vm.conditions = $event;
3036
+ }, "update:newTaskVisible": function($event) {
3037
+ return _vm.$emit("update:newTaskVisible", true);
3038
+ } } }), _c("task-table", { ref: "taskTable", attrs: { "conditions": _vm.conditions, "added-tasks": _vm.addedTasks, "law-firm-id": _vm.lawFirmId, "page-size": _vm.pageSize, "with-gallery": _vm.withGallery }, on: { "update:addedTasks": function($event) {
3039
+ return _vm.$emit("update:addedTasks", $event);
3040
+ }, "editTask": function($event) {
3041
+ return _vm.$emit("editTask", $event);
3042
+ } }, scopedSlots: _vm._u([{ key: "default", fn: function(ref2) {
3043
+ var loading = ref2.loading;
3044
+ var dataSource = ref2.dataSource;
3045
+ var pagination = ref2.pagination;
3046
+ var changePagination = ref2.changePagination;
3047
+ return [_vm._t("default", null, { "editAction": _vm.editAction, "loading": loading, "dataSource": dataSource, "pagination": pagination, "changePagination": changePagination })];
3048
+ } }], null, true) })], 1);
3049
+ };
3050
+ var staticRenderFns$3 = [];
3051
+ var MainModal_vue_vue_type_style_index_0_scoped_true_lang = "";
3052
+ const __cssModules$3 = {};
3053
+ var __component__$3 = /* @__PURE__ */ normalizeComponent(__vue2_script$3, render$3, staticRenderFns$3, false, __vue2_injectStyles$3, "697d89e6", null, null);
3054
+ function __vue2_injectStyles$3(context) {
3055
+ for (let o in __cssModules$3) {
3056
+ this[o] = __cssModules$3[o];
3057
+ }
3058
+ }
3059
+ var MainModal = /* @__PURE__ */ function() {
3060
+ return __component__$3.exports;
3061
+ }();
3062
+ var __vue2_script$2 = defineComponent({
3063
+ name: "ReviewModal",
3064
+ components: {
3065
+ TaskTablePure,
3066
+ AntModal: Modal,
3067
+ AntCheckbox: Checkbox,
3068
+ AntButton: Button
3069
+ },
3070
+ props: {
3071
+ visible: {
3072
+ type: Boolean,
3073
+ default: false
3074
+ },
3075
+ addedTasks: {
3076
+ type: Array,
3077
+ default: () => []
3078
+ },
3079
+ reviewText: {
3080
+ type: String,
3081
+ required: true
3082
+ },
3083
+ sendEmail: {
3084
+ type: Boolean,
3085
+ default: false
3086
+ },
3087
+ showSendEmail: {
3088
+ type: Boolean,
3089
+ default: false
3090
+ },
3091
+ allowClear: {
3092
+ type: Boolean,
3093
+ default: false
3094
+ },
3095
+ adding: {
3096
+ type: Boolean,
3097
+ default: false
3098
+ }
3099
+ },
3100
+ setup(props, { emit }) {
3101
+ const { addedTasks } = toRefs(props);
3102
+ const pagination = ref({
3103
+ total: addedTasks.value.length,
3104
+ current: 1,
3105
+ pageSize: 10
3106
+ });
3107
+ const changePagination = (newPagination) => {
3108
+ pagination.value = newPagination;
3109
+ };
3110
+ const { addTask, editTask, removeTask } = useTaskActions(addedTasks, emit);
3111
+ return {
3112
+ addTask,
3113
+ editTask,
3114
+ removeTask,
3115
+ pagination,
3116
+ changePagination
3117
+ };
3118
+ }
3119
+ });
3120
+ var render$2 = function() {
3121
+ var _vm = this;
3122
+ var _h = _vm.$createElement;
3123
+ var _c = _vm._self._c || _h;
3124
+ return _c("ant-modal", { attrs: { "zIndex": 900, "width": "900px", "visible": _vm.visible, "title": _vm.$t("message.reviewTasksTitle") }, on: { "cancel": function($event) {
3125
+ return _vm.$emit("update:visible", false);
3126
+ } } }, [_c("task-table-pure", { attrs: { "show-edit": false, "loading": false, "no-edit": true, "data-source": _vm.addedTasks, "pagination": _vm.pagination, "added-tasks": _vm.addedTasks }, on: { "removeTask": _vm.removeTask, "changePagination": _vm.changePagination } }), _c("div", { attrs: { "slot": "footer" }, slot: "footer" }, [_vm.showSendEmail ? _c("ant-checkbox", { staticStyle: { "float": "left" }, attrs: { "checked": _vm.sendEmail }, on: { "change": function($event) {
3127
+ return _vm.$emit("update:sendEmail", $event.target.checked);
3128
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.sendTaskEmail")) + " ")]) : _vm._e(), _c("ant-button", { on: { "click": function($event) {
3129
+ return _vm.$emit("update:visible", false);
3130
+ } } }, [_vm._v(" " + _vm._s(_vm.$t("message.cancel")) + " ")]), _c("ant-button", { attrs: { "loading": _vm.adding, "type": "primary", "disabled": !_vm.addedTasks.length }, on: { "click": function($event) {
3131
+ _vm.$emit("submit", {
3132
+ addedTasks: _vm.addedTasks,
3133
+ addedTaskIds: _vm.addedTasks.map(function(ref2) {
3134
+ var id = ref2.id;
3135
+ return id;
3136
+ }),
3137
+ sendEmail: _vm.sendEmail
3138
+ });
3139
+ } } }, [_vm._v(" " + _vm._s(_vm.reviewText + "(" + _vm.addedTasks.length + ")") + " ")])], 1)], 1);
3140
+ };
3141
+ var staticRenderFns$2 = [];
3142
+ var ReviewModal_vue_vue_type_style_index_0_scoped_true_lang = "";
3143
+ const __cssModules$2 = {};
3144
+ var __component__$2 = /* @__PURE__ */ normalizeComponent(__vue2_script$2, render$2, staticRenderFns$2, false, __vue2_injectStyles$2, "315dcb1d", null, null);
3145
+ function __vue2_injectStyles$2(context) {
3146
+ for (let o in __cssModules$2) {
3147
+ this[o] = __cssModules$2[o];
3148
+ }
3149
+ }
3150
+ var ReviewModal = /* @__PURE__ */ function() {
3151
+ return __component__$2.exports;
3152
+ }();
3153
+ const useMutateTaskTemplate = () => useMutation(UpdateTaskTemplateMutation);
3154
+ const useCreateTaskTemplate = () => useMutation(CreateTaskTemplateMutation);
3155
+ const submit = async (record, updateTemplate, createTemplate) => {
3156
+ var _a, _b, _c, _d;
3157
+ let newRecord = {};
3158
+ let res;
3159
+ let success;
3160
+ const isUpdate = !!record.taskTemplateId;
3161
+ if (isUpdate) {
3162
+ res = await updateTemplate.mutate(record);
3163
+ newRecord = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.updateTaskTemplate.updatedTaskTemplate) || {};
3164
+ success = ((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.updateTaskTemplate.code) === ResponseCode.success;
3165
+ } else {
3166
+ res = await createTemplate.mutate(record);
3167
+ newRecord = ((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.createTaskTemplate.newTaskTemplate) || {};
3168
+ success = ((_d = res == null ? void 0 : res.data) == null ? void 0 : _d.createTaskTemplate.code) === ResponseCode.success;
3169
+ }
3170
+ if (success) {
3171
+ message.success("Success!");
3172
+ } else {
3173
+ message.error("Failed!");
3174
+ }
3175
+ return {
3176
+ isUpdate,
3177
+ newRecord,
3178
+ success
3179
+ };
3180
+ };
3181
+ const UpdateTaskTemplateMutation = gql`
3182
+ mutation updateTaskTemplate(
3183
+ $selfUserId: Int!
3184
+ $selfLawFirmId: Int!
3185
+ $taskTemplateObj: TaskTemplateInput!
3186
+ $taskTemplateId: Int!
3187
+ ) {
3188
+ updateTaskTemplate(
3189
+ selfUserId: $selfUserId
3190
+ selfLawFirmId: $selfLawFirmId
3191
+ taskTemplateObj: $taskTemplateObj
3192
+ taskTemplateId: $taskTemplateId
3193
+ ) {
3194
+ code
3195
+ message
3196
+ updatedTaskTemplate {
3197
+ ...taskTemplate
3198
+ }
3199
+ }
3200
+ }
3201
+ ${taskTemplateFragment}
3202
+ `;
3203
+ const CreateTaskTemplateMutation = gql`
3204
+ mutation createTaskTemplate(
3205
+ $selfUserId: Int!
3206
+ $selfLawFirmId: Int!
3207
+ $taskTemplateObj: TaskTemplateInput!
3208
+ ) {
3209
+ createTaskTemplate(
3210
+ selfUserId: $selfUserId
3211
+ selfLawFirmId: $selfLawFirmId
3212
+ taskTemplateObj: $taskTemplateObj
3213
+ ) {
3214
+ code
3215
+ message
3216
+ newTaskTemplate {
3217
+ ...taskTemplate
3218
+ }
3219
+ }
3220
+ }
3221
+ ${taskTemplateFragment}
3222
+ `;
3223
+ const defaultTaskTemplate = {
3224
+ taskTemplateObj: {
3225
+ generalTaskType: TaskTypes.clientUpload
3226
+ },
3227
+ isAddedToTask: false,
3228
+ isNotified: false
3229
+ };
3230
+ var __vue2_script$1 = defineComponent({
3231
+ name: "index",
3232
+ components: {
3233
+ NewTask,
3234
+ MainModal,
3235
+ ReviewModal
3236
+ },
3237
+ props: {
3238
+ uploadFilesFunc: {
3239
+ type: Function,
3240
+ required: true
3241
+ },
3242
+ visible: {
3243
+ type: Boolean,
3244
+ default: false
3245
+ },
3246
+ value: {
3247
+ type: Array,
3248
+ default: () => []
3249
+ },
3250
+ reviewText: {
3251
+ type: String,
3252
+ default: "Add"
3253
+ },
3254
+ openReviewButtonText: {
3255
+ type: String,
3256
+ default: "Review and add to template"
3257
+ },
3258
+ showSendEmail: {
3259
+ type: Boolean,
3260
+ default: false
3261
+ },
3262
+ sendEmail: {
3263
+ type: Boolean,
3264
+ default: false
3265
+ },
3266
+ showTaskSettingLink: {
3267
+ type: Boolean,
3268
+ default: true
3269
+ },
3270
+ allowClear: {
3271
+ type: Boolean,
3272
+ default: false
3273
+ },
3274
+ pageMode: {
3275
+ type: Boolean,
3276
+ default: false
3277
+ },
3278
+ pageSize: {
3279
+ type: Number
3280
+ },
3281
+ closeAfterAdd: {
3282
+ type: Boolean,
3283
+ default: true
3284
+ },
3285
+ adding: {
3286
+ type: Boolean,
3287
+ default: false
3288
+ },
3289
+ withGallery: {
3290
+ type: Boolean,
3291
+ default: true
3292
+ },
3293
+ showNewBtn: {
3294
+ type: Boolean,
3295
+ default: true
3296
+ }
3297
+ },
3298
+ setup(props, { emit }) {
3299
+ const { client } = useApolloClient();
3300
+ const mainModal = ref();
3301
+ const reviewModal = ref();
3302
+ const newTaskVisible = ref(false);
3303
+ const reviewModalVisible = ref(false);
3304
+ const tempTask = ref(defaultTaskTemplate);
3305
+ const updateTemplate = useMutateTaskTemplate();
3306
+ const createTemplate = useCreateTaskTemplate();
3307
+ const addedTasks = ref([]);
3308
+ const me = useMe();
3309
+ const userId = computed(() => {
3310
+ var _a;
3311
+ return (_a = me.value) == null ? void 0 : _a.id;
3312
+ });
3313
+ const lawFirmId = computed(() => {
3314
+ var _a;
3315
+ return (_a = me.value) == null ? void 0 : _a.lawFirmId;
3316
+ });
3317
+ watch(() => newTaskVisible.value, (visible) => {
3318
+ if (!visible) {
3319
+ tempTask.value = defaultTaskTemplate;
3320
+ }
3321
+ });
3322
+ watch(() => props.visible, (visible) => {
3323
+ if (!visible) {
3324
+ addedTasks.value = [];
3325
+ emit("update:value", []);
3326
+ }
3327
+ });
3328
+ const updateReviewModalContent = (record, newRecord) => {
3329
+ if (addedTasks.value.some(({ id }) => id === newRecord.id)) {
3330
+ const newValue = addedTasks.value.map((originTask) => {
3331
+ if (originTask.id === record.taskTemplateId) {
3332
+ return newRecord;
3333
+ }
3334
+ return originTask;
3335
+ });
3336
+ emit("update:value", newValue.map(({ id }) => id));
3337
+ } else {
3338
+ newRecord.id !== record.taskTemplateId && addedTasks.value.push(newRecord);
3339
+ emit("update:value", [...addedTasks.value.map(({ id }) => id), newRecord.id]);
3340
+ }
3341
+ };
3342
+ const writeQuery = (id, newRecord, isUpdate = true) => {
3343
+ const variables = mainModal.value.getVariables();
3344
+ const existed = client.readQuery({
3345
+ query: SearchTaskTemplatesQuery,
3346
+ variables
3347
+ });
3348
+ const newTasks = isUpdate ? existed.taskTemplateSearch.taskTemplateList.map((record) => {
3349
+ if (record.id === id) {
3350
+ return newRecord && __spreadProps(__spreadValues({}, newRecord), {
3351
+ isGallery: record.isGallery
3352
+ });
3353
+ }
3354
+ return record;
3355
+ }).filter((record) => !!record) : [
3356
+ __spreadProps(__spreadValues({}, newRecord), { isGallery: false }),
3357
+ ...existed.taskTemplateSearch.taskTemplateList
3358
+ ];
3359
+ client.writeQuery({
3360
+ query: SearchTaskTemplatesQuery,
3361
+ data: {
3362
+ taskTemplateSearch: __spreadProps(__spreadValues({}, existed.taskTemplateSearch), {
3363
+ taskTemplateList: newTasks
3364
+ })
3365
+ },
3366
+ variables
3367
+ });
3368
+ };
3369
+ const _submit = async (record) => {
3370
+ const { newRecord, success, isUpdate } = await submit(record, updateTemplate, createTemplate);
3371
+ if (success) {
3372
+ writeQuery(record.taskTemplateId, newRecord, isUpdate);
3373
+ newTaskVisible.value = false;
3374
+ updateReviewModalContent(record, newRecord);
3375
+ emit("task-added", newRecord);
3376
+ }
3377
+ };
3378
+ const submitting = computed(() => updateTemplate.loading.value || createTemplate.loading.value);
3379
+ const endReviewing = (result) => {
3380
+ emit("submit", result);
3381
+ if (props.closeAfterAdd) {
3382
+ reviewModalVisible.value = false;
3383
+ newTaskVisible.value = false;
3384
+ }
3385
+ };
3386
+ const editTask = (record) => {
3387
+ newTaskVisible.value = true;
3388
+ tempTask.value = __spreadValues({}, record);
3389
+ };
3390
+ return {
3391
+ mainModal,
3392
+ reviewModal,
3393
+ newTaskVisible,
3394
+ tempTask,
3395
+ reviewModalVisible,
3396
+ submitting,
3397
+ addedTasks,
3398
+ userId,
3399
+ lawFirmId,
3400
+ writeQuery,
3401
+ editTask,
3402
+ _submit,
3403
+ endReviewing
3404
+ };
3405
+ }
3406
+ });
3407
+ var render$1 = function() {
3408
+ var _vm = this;
3409
+ var _h = _vm.$createElement;
3410
+ var _c = _vm._self._c || _h;
3411
+ return _vm.lawFirmId != null ? _c("div", { attrs: { "id": "venus-component-task-cart" } }, [_c("main-modal", { ref: "mainModal", attrs: { "visible": _vm.visible, "show-page": _vm.pageMode, "page-size": _vm.pageSize, "law-firm-id": _vm.lawFirmId, "tempTask": _vm.tempTask, "show-new-btn": _vm.showNewBtn, "with-gallery": _vm.withGallery, "added-tasks": _vm.addedTasks, "newTaskVisible": _vm.newTaskVisible, "show-task-setting-link": _vm.showTaskSettingLink, "reviewModalVisible": _vm.reviewModalVisible, "open-review-button-text": _vm.openReviewButtonText }, on: { "update:tempTask": function($event) {
3412
+ _vm.tempTask = $event;
3413
+ }, "update:temp-task": function($event) {
3414
+ _vm.tempTask = $event;
3415
+ }, "update:addedTasks": function($event) {
3416
+ _vm.addedTasks = $event;
3417
+ }, "update:added-tasks": function($event) {
3418
+ _vm.addedTasks = $event;
3419
+ }, "update:newTaskVisible": function($event) {
3420
+ _vm.newTaskVisible = $event;
3421
+ }, "update:new-task-visible": function($event) {
3422
+ _vm.newTaskVisible = $event;
3423
+ }, "update:reviewModalVisible": function($event) {
3424
+ _vm.reviewModalVisible = $event;
3425
+ }, "update:review-modal-visible": function($event) {
3426
+ _vm.reviewModalVisible = $event;
3427
+ }, "editTask": _vm.editTask, "update:visible": function($event) {
3428
+ return _vm.$emit("update:visible", $event);
3429
+ } }, scopedSlots: _vm._u([{ key: "default", fn: function(ref2) {
3430
+ var loading = ref2.loading;
3431
+ var dataSource = ref2.dataSource;
3432
+ var pagination = ref2.pagination;
3433
+ var changePagination = ref2.changePagination;
3434
+ return [_vm._t("table", null, { "loading": loading, "dataSource": dataSource, "pagination": pagination, "changePagination": changePagination })];
3435
+ } }], null, true) }), _c("review-modal", { ref: "reviewModal", attrs: { "adding": _vm.adding, "sendEmail": _vm.sendEmail, "allow-clear": _vm.allowClear, "tempTask": _vm.tempTask, "review-text": _vm.reviewText, "added-tasks": _vm.addedTasks, "showSendEmail": _vm.showSendEmail, "visible": _vm.reviewModalVisible, "newTaskVisible": _vm.newTaskVisible }, on: { "update:tempTask": function($event) {
3436
+ _vm.tempTask = $event;
3437
+ }, "update:temp-task": function($event) {
3438
+ _vm.tempTask = $event;
3439
+ }, "update:addedTasks": function($event) {
3440
+ _vm.addedTasks = $event;
3441
+ }, "update:added-tasks": function($event) {
3442
+ _vm.addedTasks = $event;
3443
+ }, "update:visible": function($event) {
3444
+ _vm.reviewModalVisible = $event;
3445
+ }, "update:newTaskVisible": function($event) {
3446
+ _vm.newTaskVisible = $event;
3447
+ }, "update:new-task-visible": function($event) {
3448
+ _vm.newTaskVisible = $event;
3449
+ }, "submit": _vm.endReviewing, "update:sendEmail": function($event) {
3450
+ return _vm.$emit("update:sendEmail", $event);
3451
+ } } }), _c("new-task", { attrs: { "user-id": _vm.userId, "loading": _vm.submitting, "value": _vm.tempTask, "law-firm-id": _vm.lawFirmId, "visible": _vm.newTaskVisible, "upload-files-func": _vm.uploadFilesFunc, "has-double-confirm": !!_vm.tempTask.taskTemplateObj.id }, on: { "update:value": function($event) {
3452
+ _vm.tempTask = $event;
3453
+ }, "update:visible": function($event) {
3454
+ _vm.newTaskVisible = $event;
3455
+ }, "submit": _vm._submit } })], 1) : _vm._e();
3456
+ };
3457
+ var staticRenderFns$1 = [];
3458
+ var index_vue_vue_type_style_index_0_scoped_true_lang = "";
3459
+ const __cssModules$1 = {};
3460
+ var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, render$1, staticRenderFns$1, false, __vue2_injectStyles$1, "466cfa4a", null, null);
3461
+ function __vue2_injectStyles$1(context) {
3462
+ for (let o in __cssModules$1) {
3463
+ this[o] = __cssModules$1[o];
3464
+ }
3465
+ }
3466
+ var index$1 = /* @__PURE__ */ function() {
3467
+ return __component__$1.exports;
3468
+ }();
3469
+ var __vue2_script = defineComponent({
3470
+ setup() {
3471
+ const notBoolean = ref(123);
3472
+ const test = ref(false);
3473
+ const isDisabled = computed(() => test.value);
3474
+ return {
3475
+ isDisabled,
3476
+ notBoolean,
3477
+ test
3478
+ };
3479
+ }
3480
+ });
3481
+ var render = function() {
3482
+ var _vm = this;
3483
+ var _h = _vm.$createElement;
3484
+ var _c = _vm._self._c || _h;
3485
+ return _c("div", [_c("a-radio", { attrs: { "disabled": _vm.isDisabled } }), _c("h1", [_vm._v(_vm._s(_vm.isDisabled))]), _c("h1", [_vm._v(_vm._s(_vm.test))]), _c("h1", [_vm._v(_vm._s(_vm.notBoolean))])], 1);
3486
+ };
3487
+ var staticRenderFns = [];
3488
+ const __cssModules = {};
3489
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
3490
+ function __vue2_injectStyles(context) {
3491
+ for (let o in __cssModules) {
3492
+ this[o] = __cssModules[o];
3493
+ }
3494
+ }
3495
+ var index = /* @__PURE__ */ function() {
3496
+ return __component__.exports;
3497
+ }();
3498
+ export { AFileUploader, AssigneeTag, index$3 as CaseTemplateSelect, CaseTemplateTypeBadge, GlueRoleType, NewTask, index$4 as ProfileSelect, TagsWithTooltip, index$1 as TaskCart, TaskForm, TaskTable, TaskTemplateFilter, index as TestComponent, caseTemplateFilter, formRecords, index$2 as forms, getLanguageMessage, refactorParams as refactorTaskTemplateParams, selectFolderAndCreateZip, submit as submitTaskTemplate, useCreateTaskTemplate, useMutateTaskTemplate, useSearchTaskConditions, useSearchTaskTemplates };