@neutron.co.id/operasional-interfaces 1.2.0-beta.1 → 1.3.0-beta.2

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.
Files changed (27) hide show
  1. package/build/index.cjs +2662 -1051
  2. package/build/index.mjs +2682 -1071
  3. package/build/style.css +138 -0
  4. package/build/types/components/checkIn/checkIn.types.d.ts +2 -0
  5. package/build/types/components/checkIn/index.d.ts +2 -0
  6. package/build/types/components/checkIn/sheets/CheckInAccess.vue.d.ts +6 -0
  7. package/build/types/components/checkIn/sheets/CheckInCollection.vue.d.ts +2 -0
  8. package/build/types/components/checkIn/sheets/CheckInPresenceCollection.vue.d.ts +2 -0
  9. package/build/types/components/checkIn/sheets/CheckInScanError.vue.d.ts +2 -0
  10. package/build/types/components/checkIn/sheets/CheckInScanSuccess.vue.d.ts +6 -0
  11. package/build/types/components/checkIn/sheets/CheckInScanner.vue.d.ts +7 -0
  12. package/build/types/components/checkIn/sheets/CheckInSingle.vue.d.ts +2 -0
  13. package/build/types/components/checkIn/sheets/index.d.ts +7 -0
  14. package/build/types/components/index.d.ts +1 -0
  15. package/build/types/components/situation/situation.types.d.ts +1 -1
  16. package/build/types/components/staff/staff.types.d.ts +1 -1
  17. package/build/types/components/task/task.types.d.ts +1 -1
  18. package/build/types/index.d.ts +1 -0
  19. package/build/types/providers/index.d.ts +1 -0
  20. package/build/types/providers/operasional/attendance.store.d.ts +15 -0
  21. package/build/types/providers/operasional/bus.d.ts +7 -0
  22. package/build/types/providers/operasional/index.d.ts +6 -0
  23. package/build/types/providers/operasional/operasional.store.d.ts +2 -0
  24. package/build/types/providers/operasional/operasional.types.d.ts +11 -0
  25. package/build/types/providers/operasional/useOperasional.d.ts +7 -0
  26. package/build/types/providers/operasional/withOperasional.d.ts +2 -0
  27. package/package.json +6 -4
package/build/index.mjs CHANGED
@@ -1,14 +1,20 @@
1
- import { ComponentUtil } from "@neon.id/utils/client";
2
- import { defineComponent, openBlock, createElementBlock, createVNode, unref, createBlock, withCtx, createElementVNode, mergeProps, createCommentVNode, isRef, onBeforeUnmount, onMounted, getCurrentInstance, inject, reactive, ref, watchEffect } from "vue";
3
- import { NeonButton } from "@neon.id/interfaces";
4
- import { models } from "@neutron.co.id/personalia-models";
5
- import { useCollection, NeonCollection, useSingle, NeonSingle } from "@neon.id/context";
6
- import { OfficeCollectionTable, OfficeTabs, OfficeTab, OfficeRelation } from "@neon.id/office";
1
+ import { ComponentUtil as ComponentUtil$1 } from "@neon.id/utils/client";
2
+ import { defineComponent, openBlock, createElementBlock, createVNode, unref, onBeforeUnmount, onMounted, getCurrentInstance, inject, reactive, ref, isRef, watchEffect, provide, computed, resolveComponent, withCtx, createElementVNode, createTextVNode, createBlock, createCommentVNode, pushScopeId, popScopeId, mergeProps, normalizeClass, withModifiers, toDisplayString, watch, Fragment } from "vue";
3
+ import { NeonButton, useToastStore, NeonSlider, NeonSlide, NeonStat, NeonModal, NeonSheet, NeonInfo } from "@neon.id/interfaces";
4
+ import { models } from "@neutron.co.id/tempat-models";
5
+ import { GraphUtil, NeonCollectionContext, useSingle, NeonSingle, useCollection, NeonCollection } from "@neon.id/context";
6
+ import { useEventBus, useIntervalFn, useThrottleFn } from "@vueuse/core";
7
+ import { OfficeContent, OfficeCollectionQuery, OfficeCollectionOperation, OfficeTabs, OfficeTab, OfficeRelation, OfficeCollectionTable } from "@neon.id/office";
8
+ import { Query } from "@neon.id/query";
9
+ import { defineStore, storeToRefs } from "pinia";
10
+ import { ComponentUtil } from "@neon.id/utils/component";
7
11
  import { NeonForm, NeonField, NeonFields } from "@neon.id/form";
8
- const _hoisted_1$1 = { class: "xxx-button" };
9
- const __default__$6 = defineComponent({ name: "XxxButton" });
10
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
11
- ...__default__$6,
12
+ import { models as models$1 } from "@neutron.co.id/personalia-models";
13
+ import { useAuthStore } from "@neon.id/identitas-interfaces";
14
+ const _hoisted_1$8 = { class: "xxx-button" };
15
+ const __default__$8 = defineComponent({ name: "XxxButton" });
16
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
17
+ ...__default__$8,
12
18
  props: {
13
19
  color: {
14
20
  type: String,
@@ -17,974 +23,287 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
17
23
  },
18
24
  setup(__props) {
19
25
  return (_ctx, _cache) => {
20
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
26
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [
21
27
  createVNode(unref(NeonButton), { label: "XXX" })
22
28
  ]);
23
29
  };
24
30
  }
25
31
  });
26
- const StaffModel = models.StaffModel;
27
- const __default__$5 = defineComponent({
28
- name: "StaffCollection"
29
- });
30
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
31
- ...__default__$5,
32
- setup(__props) {
33
- useCollection();
34
- return (_ctx, _cache) => {
35
- return openBlock(), createBlock(unref(NeonCollection), { class: "neu-staff-collection" }, {
36
- default: withCtx(() => [
37
- createVNode(unref(OfficeCollectionTable))
38
- ]),
39
- _: 1
40
- /* STABLE */
41
- });
42
- };
32
+ const CheckInModel = models.CheckInModel;
33
+ function devAssert(condition, message) {
34
+ const booleanCondition = Boolean(condition);
35
+ if (!booleanCondition) {
36
+ throw new Error(message);
43
37
  }
44
- });
45
- const _hoisted_1 = { class: "grid gap-4 sm:grid-cols-[3fr_1fr]" };
46
- const _hoisted_2 = { class: "grid gap-4 sm:grid-cols-2" };
47
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
48
- __name: "StaffSingle",
49
- setup(__props) {
50
- const {
51
- fields,
52
- id,
53
- initialValues,
54
- values,
55
- isLoading,
56
- isChanged,
57
- isReady,
58
- isMain,
59
- isNew,
60
- saveOne,
61
- discardChanges
62
- } = useSingle();
63
- return (_ctx, _cache) => {
64
- return openBlock(), createBlock(unref(NeonSingle), { class: "neu-staff-single" }, {
65
- default: withCtx(() => [
66
- createVNode(unref(OfficeTabs), { "use-url": unref(isMain) }, {
67
- default: withCtx(() => [
68
- createVNode(unref(OfficeTab), {
69
- handle: "info",
70
- icon: "circle-info",
71
- title: "Info"
72
- }, {
73
- default: withCtx(() => [
74
- createVNode(unref(NeonForm), {
75
- handle: "info",
76
- "initial-values": unref(initialValues),
77
- "is-loading": unref(isLoading),
78
- "is-changed": unref(isChanged),
79
- "use-unsaved": "",
80
- onCancel: unref(discardChanges),
81
- onSubmit: unref(saveOne)
82
- }, {
83
- default: withCtx(() => [
84
- createElementVNode("div", _hoisted_1, [
85
- createVNode(unref(NeonField), mergeProps({
86
- modelValue: unref(values).name,
87
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(values).name = $event)
88
- }, unref(fields).name), null, 16, ["modelValue"]),
89
- createVNode(unref(NeonField), mergeProps({
90
- modelValue: unref(values).nik,
91
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(values).nik = $event)
92
- }, unref(fields).nik), null, 16, ["modelValue"])
93
- ]),
94
- createElementVNode("div", _hoisted_2, [
95
- createVNode(unref(NeonField), mergeProps({
96
- modelValue: unref(values).birthPlace,
97
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(values).birthPlace = $event)
98
- }, unref(fields).birthPlace), null, 16, ["modelValue"]),
99
- createVNode(unref(NeonField), mergeProps({
100
- modelValue: unref(values).birthDate,
101
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(values).birthDate = $event)
102
- }, unref(fields).birthDate), null, 16, ["modelValue"])
103
- ]),
104
- createVNode(unref(NeonField), mergeProps({
105
- modelValue: unref(values).image,
106
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(values).image = $event)
107
- }, unref(fields).image), null, 16, ["modelValue"]),
108
- createVNode(unref(NeonField), mergeProps({
109
- modelValue: unref(values).note,
110
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(values).note = $event)
111
- }, unref(fields).note), null, 16, ["modelValue"])
112
- ]),
113
- _: 1
114
- /* STABLE */
115
- }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
116
- ]),
117
- _: 1
118
- /* STABLE */
119
- }),
120
- createCommentVNode(' IDENTITAS\n <OfficeTab handle="identity" icon="circle-info" title="Identity">\n </OfficeTab> '),
121
- createCommentVNode(" CABANG "),
122
- createVNode(unref(OfficeTab), {
123
- handle: "branch",
124
- icon: "circle-info",
125
- title: "Cabang"
126
- }, {
127
- default: withCtx(() => [
128
- createVNode(unref(NeonForm), {
129
- handle: "branch",
130
- "initial-values": unref(initialValues),
131
- "is-loading": unref(isLoading),
132
- "is-changed": unref(isChanged),
133
- "use-unsaved": "",
134
- onCancel: unref(discardChanges),
135
- onSubmit: unref(saveOne)
136
- }, {
137
- default: withCtx(() => [
138
- createVNode(unref(OfficeRelation), {
139
- modelValue: unref(values),
140
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => isRef(values) ? values.value = $event : null),
141
- field: unref(fields).branch
142
- }, null, 8, ["modelValue", "field"]),
143
- createVNode(unref(OfficeRelation), {
144
- modelValue: unref(values),
145
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => isRef(values) ? values.value = $event : null),
146
- field: unref(fields).branches
147
- }, null, 8, ["modelValue", "field"])
148
- ]),
149
- _: 1
150
- /* STABLE */
151
- }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
152
- ]),
153
- _: 1
154
- /* STABLE */
155
- }),
156
- createCommentVNode(" KELUAR MASUK "),
157
- createVNode(unref(OfficeTab), {
158
- handle: "checkIn",
159
- icon: "person-to-door",
160
- title: "Keluar Masuk"
161
- }, {
162
- default: withCtx(() => [
163
- createCommentVNode(` <OfficeCollectionRelated
164
- definition="neu:tempat:checkIn"
165
- title="Keluar Masuk"
166
- description="Keluar masuk."
167
- :query="
168
- Query.define({
169
- filter: {
170
- handle: 'staffId',
171
- operator: 'eq',
172
- value: id,
173
- },
174
- })
175
- "
176
- /> `)
177
- ]),
178
- _: 1
179
- /* STABLE */
180
- })
181
- ]),
182
- _: 1
183
- /* STABLE */
184
- }, 8, ["use-url"])
185
- ]),
186
- _: 1
187
- /* STABLE */
188
- });
189
- };
38
+ }
39
+ function isObjectLike(value) {
40
+ return typeof value == "object" && value !== null;
41
+ }
42
+ function invariant(condition, message) {
43
+ const booleanCondition = Boolean(condition);
44
+ if (!booleanCondition) {
45
+ throw new Error(
46
+ message != null ? message : "Unexpected invariant triggered."
47
+ );
190
48
  }
191
- });
192
- const StaffSingle_vue_vue_type_style_index_0_scoped_dbeb1998_lang = "";
193
- const _export_sfc = (sfc, props) => {
194
- const target = sfc.__vccOpts || sfc;
195
- for (const [key, val] of props) {
196
- target[key] = val;
49
+ }
50
+ const LineRegExp = /\r\n|[\n\r]/g;
51
+ function getLocation(source, position) {
52
+ let lastLineStart = 0;
53
+ let line = 1;
54
+ for (const match of source.body.matchAll(LineRegExp)) {
55
+ typeof match.index === "number" || invariant(false);
56
+ if (match.index >= position) {
57
+ break;
58
+ }
59
+ lastLineStart = match.index + match[0].length;
60
+ line += 1;
197
61
  }
198
- return target;
199
- };
200
- const StaffSingle = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-dbeb1998"]]);
201
- const SituationModel = models.SituationModel;
202
- const __default__$4 = defineComponent({ name: "SituationCollection" });
203
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
204
- ...__default__$4,
205
- setup(__props) {
206
- useCollection();
207
- return (_ctx, _cache) => {
208
- return openBlock(), createBlock(unref(NeonCollection), { class: "neu-situation-collection" }, {
209
- default: withCtx(() => [
210
- createVNode(unref(OfficeCollectionTable))
211
- ]),
212
- _: 1
213
- /* STABLE */
214
- });
215
- };
62
+ return {
63
+ line,
64
+ column: position + 1 - lastLineStart
65
+ };
66
+ }
67
+ function printLocation(location) {
68
+ return printSourceLocation(
69
+ location.source,
70
+ getLocation(location.source, location.start)
71
+ );
72
+ }
73
+ function printSourceLocation(source, sourceLocation) {
74
+ const firstLineColumnOffset = source.locationOffset.column - 1;
75
+ const body = "".padStart(firstLineColumnOffset) + source.body;
76
+ const lineIndex = sourceLocation.line - 1;
77
+ const lineOffset = source.locationOffset.line - 1;
78
+ const lineNum = sourceLocation.line + lineOffset;
79
+ const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;
80
+ const columnNum = sourceLocation.column + columnOffset;
81
+ const locationStr = `${source.name}:${lineNum}:${columnNum}
82
+ `;
83
+ const lines = body.split(/\r\n|[\n\r]/g);
84
+ const locationLine = lines[lineIndex];
85
+ if (locationLine.length > 120) {
86
+ const subLineIndex = Math.floor(columnNum / 80);
87
+ const subLineColumnNum = columnNum % 80;
88
+ const subLines = [];
89
+ for (let i2 = 0; i2 < locationLine.length; i2 += 80) {
90
+ subLines.push(locationLine.slice(i2, i2 + 80));
91
+ }
92
+ return locationStr + printPrefixedLines([
93
+ [`${lineNum} |`, subLines[0]],
94
+ ...subLines.slice(1, subLineIndex + 1).map((subLine) => ["|", subLine]),
95
+ ["|", "^".padStart(subLineColumnNum)],
96
+ ["|", subLines[subLineIndex + 1]]
97
+ ]);
216
98
  }
217
- });
218
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
219
- __name: "SituationSingle",
220
- setup(__props) {
221
- const {
222
- fields,
223
- id,
224
- initialValues,
225
- values,
226
- isNew,
227
- isLoading,
228
- isChanged,
229
- isReady,
230
- isMain,
231
- saveOne,
232
- discardChanges
233
- } = useSingle();
234
- return (_ctx, _cache) => {
235
- return openBlock(), createBlock(unref(NeonSingle), { class: "neu-situation-single" }, {
236
- default: withCtx(() => [
237
- createVNode(unref(OfficeTabs), { "use-url": unref(isMain) }, {
238
- default: withCtx(() => [
239
- createVNode(unref(OfficeTab), {
240
- handle: "info",
241
- icon: "circle-info",
242
- title: "Info"
243
- }, {
244
- default: withCtx(() => [
245
- createVNode(unref(NeonForm), {
246
- handle: "info",
247
- "initial-values": unref(initialValues),
248
- "is-loading": unref(isLoading),
249
- "is-changed": unref(isChanged),
250
- "use-unsaved": "",
251
- onCancel: unref(discardChanges),
252
- onSubmit: unref(saveOne)
253
- }, {
254
- default: withCtx(() => [
255
- createVNode(unref(NeonFields), {
256
- md: "grid-cols-4",
257
- title: "Situasi"
258
- }, {
259
- default: withCtx(() => [
260
- createVNode(unref(NeonField), mergeProps({
261
- modelValue: unref(values).situationStatus,
262
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(values).situationStatus = $event)
263
- }, unref(fields).situationStatus), null, 16, ["modelValue"])
264
- ]),
265
- _: 1
266
- /* STABLE */
267
- }),
268
- createVNode(unref(OfficeRelation), {
269
- modelValue: unref(values),
270
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(values) ? values.value = $event : null),
271
- field: unref(fields).branches
272
- }, null, 8, ["modelValue", "field"]),
273
- createVNode(unref(OfficeRelation), {
274
- modelValue: unref(values),
275
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(values) ? values.value = $event : null),
276
- field: unref(fields).situationType
277
- }, null, 8, ["modelValue", "field"]),
278
- createVNode(unref(OfficeRelation), {
279
- modelValue: unref(values),
280
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(values) ? values.value = $event : null),
281
- field: unref(fields).situationReportedBy
282
- }, null, 8, ["modelValue", "field"]),
283
- createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
284
- default: withCtx(() => [
285
- createVNode(unref(NeonField), mergeProps({
286
- modelValue: unref(values).situationDescription,
287
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(values).situationDescription = $event)
288
- }, unref(fields).situationDescription), null, 16, ["modelValue"])
289
- ]),
290
- _: 1
291
- /* STABLE */
292
- }),
293
- createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
294
- default: withCtx(() => [
295
- createVNode(unref(NeonField), mergeProps({
296
- modelValue: unref(values).urgentSituationDate,
297
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(values).urgentSituationDate = $event)
298
- }, unref(fields).urgentSituationDate), null, 16, ["modelValue"])
299
- ]),
300
- _: 1
301
- /* STABLE */
302
- }),
303
- createVNode(unref(OfficeRelation), {
304
- modelValue: unref(values),
305
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => isRef(values) ? values.value = $event : null),
306
- field: unref(fields).situationRelatedBy
307
- }, null, 8, ["modelValue", "field"]),
308
- createVNode(unref(NeonFields), {
309
- md: "grid-cols-4",
310
- title: "Suportif"
311
- }, {
312
- default: withCtx(() => [
313
- createVNode(unref(NeonField), mergeProps({
314
- modelValue: unref(values).supportiveStatus,
315
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(values).supportiveStatus = $event)
316
- }, unref(fields).supportiveStatus), null, 16, ["modelValue"])
317
- ]),
318
- _: 1
319
- /* STABLE */
320
- }),
321
- createVNode(unref(OfficeRelation), {
322
- modelValue: unref(values),
323
- "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => isRef(values) ? values.value = $event : null),
324
- field: unref(fields).situationSupportedBy
325
- }, null, 8, ["modelValue", "field"]),
326
- createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
327
- default: withCtx(() => [
328
- createVNode(unref(NeonField), mergeProps({
329
- modelValue: unref(values).situationResponse,
330
- "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => unref(values).situationResponse = $event)
331
- }, unref(fields).situationResponse), null, 16, ["modelValue"])
332
- ]),
333
- _: 1
334
- /* STABLE */
335
- })
336
- ]),
337
- _: 1
338
- /* STABLE */
339
- }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
340
- ]),
341
- _: 1
342
- /* STABLE */
343
- })
344
- ]),
345
- _: 1
346
- /* STABLE */
347
- }, 8, ["use-url"])
348
- ]),
349
- _: 1
350
- /* STABLE */
351
- });
99
+ return locationStr + printPrefixedLines([
100
+ // Lines specified like this: ["prefix", "string"],
101
+ [`${lineNum - 1} |`, lines[lineIndex - 1]],
102
+ [`${lineNum} |`, locationLine],
103
+ ["|", "^".padStart(columnNum)],
104
+ [`${lineNum + 1} |`, lines[lineIndex + 1]]
105
+ ]);
106
+ }
107
+ function printPrefixedLines(lines) {
108
+ const existingLines = lines.filter(([_, line]) => line !== void 0);
109
+ const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));
110
+ return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? " " + line : "")).join("\n");
111
+ }
112
+ function toNormalizedOptions(args) {
113
+ const firstArg = args[0];
114
+ if (firstArg == null || "kind" in firstArg || "length" in firstArg) {
115
+ return {
116
+ nodes: firstArg,
117
+ source: args[1],
118
+ positions: args[2],
119
+ path: args[3],
120
+ originalError: args[4],
121
+ extensions: args[5]
352
122
  };
353
123
  }
354
- });
355
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
356
- __name: "SituationWork",
357
- setup(__props) {
358
- const {
359
- fields,
360
- id,
361
- initialValues,
362
- values,
363
- isNew,
364
- isLoading,
365
- isChanged,
366
- isReady,
367
- isMain,
368
- saveOne,
369
- discardChanges
370
- } = useSingle();
371
- return (_ctx, _cache) => {
372
- return openBlock(), createBlock(unref(NeonSingle), { class: "neu-situation-single" }, {
373
- default: withCtx(() => [
374
- createVNode(unref(OfficeTabs), { "use-url": unref(isMain) }, {
375
- default: withCtx(() => [
376
- createVNode(unref(OfficeTab), {
377
- handle: "info",
378
- icon: "circle-info",
379
- title: "Info"
380
- }, {
381
- default: withCtx(() => [
382
- createVNode(unref(NeonForm), {
383
- handle: "info",
384
- "initial-values": unref(initialValues),
385
- "is-loading": unref(isLoading),
386
- "is-changed": unref(isChanged),
387
- "use-unsaved": "",
388
- onCancel: unref(discardChanges),
389
- onSubmit: unref(saveOne)
390
- }, {
391
- default: withCtx(() => [
392
- createVNode(unref(NeonFields), {
393
- md: "grid-cols-4",
394
- title: "Situasi"
395
- }, {
396
- default: withCtx(() => [
397
- createVNode(unref(NeonField), mergeProps({
398
- modelValue: unref(values).situationStatus,
399
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(values).situationStatus = $event)
400
- }, unref(fields).situationStatus, { "is-disabled": "" }), null, 16, ["modelValue"])
401
- ]),
402
- _: 1
403
- /* STABLE */
404
- }),
405
- createVNode(unref(OfficeRelation), {
406
- modelValue: unref(values),
407
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(values) ? values.value = $event : null),
408
- field: unref(fields).branches
409
- }, null, 8, ["modelValue", "field"]),
410
- createVNode(unref(OfficeRelation), {
411
- modelValue: unref(values),
412
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(values) ? values.value = $event : null),
413
- field: unref(fields).situationType
414
- }, null, 8, ["modelValue", "field"]),
415
- createVNode(unref(OfficeRelation), {
416
- modelValue: unref(values),
417
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(values) ? values.value = $event : null),
418
- field: unref(fields).situationReportedBy,
419
- "is-disabled": ""
420
- }, null, 8, ["modelValue", "field"]),
421
- createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
422
- default: withCtx(() => [
423
- createVNode(unref(NeonField), mergeProps({
424
- modelValue: unref(values).situationDescription,
425
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(values).situationDescription = $event)
426
- }, unref(fields).situationDescription), null, 16, ["modelValue"])
427
- ]),
428
- _: 1
429
- /* STABLE */
430
- }),
431
- createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
432
- default: withCtx(() => [
433
- createVNode(unref(NeonField), mergeProps({
434
- modelValue: unref(values).urgentSituationDate,
435
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(values).urgentSituationDate = $event)
436
- }, unref(fields).urgentSituationDate), null, 16, ["modelValue"])
437
- ]),
438
- _: 1
439
- /* STABLE */
440
- }),
441
- createVNode(unref(OfficeRelation), {
442
- modelValue: unref(values),
443
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => isRef(values) ? values.value = $event : null),
444
- field: unref(fields).situationRelatedBy
445
- }, null, 8, ["modelValue", "field"]),
446
- createVNode(unref(NeonFields), {
447
- md: "grid-cols-4",
448
- title: "Suportif"
449
- }, {
450
- default: withCtx(() => [
451
- createVNode(unref(NeonField), mergeProps({
452
- modelValue: unref(values).supportiveStatus,
453
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(values).supportiveStatus = $event)
454
- }, unref(fields).supportiveStatus), null, 16, ["modelValue"])
455
- ]),
456
- _: 1
457
- /* STABLE */
458
- }),
459
- createVNode(unref(OfficeRelation), {
460
- modelValue: unref(values),
461
- "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => isRef(values) ? values.value = $event : null),
462
- field: unref(fields).situationSupportedBy
463
- }, null, 8, ["modelValue", "field"]),
464
- createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
465
- default: withCtx(() => [
466
- createVNode(unref(NeonField), mergeProps({
467
- modelValue: unref(values).situationResponse,
468
- "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => unref(values).situationResponse = $event)
469
- }, unref(fields).situationResponse), null, 16, ["modelValue"])
470
- ]),
471
- _: 1
472
- /* STABLE */
473
- })
474
- ]),
475
- _: 1
476
- /* STABLE */
477
- }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
478
- ]),
479
- _: 1
480
- /* STABLE */
481
- })
482
- ]),
483
- _: 1
484
- /* STABLE */
485
- }, 8, ["use-url"])
486
- ]),
487
- _: 1
488
- /* STABLE */
124
+ return firstArg;
125
+ }
126
+ class GraphQLError extends Error {
127
+ /**
128
+ * An array of `{ line, column }` locations within the source GraphQL document
129
+ * which correspond to this error.
130
+ *
131
+ * Errors during validation often contain multiple locations, for example to
132
+ * point out two things with the same name. Errors during execution include a
133
+ * single location, the field which produced the error.
134
+ *
135
+ * Enumerable, and appears in the result of JSON.stringify().
136
+ */
137
+ /**
138
+ * An array describing the JSON-path into the execution response which
139
+ * corresponds to this error. Only included for errors during execution.
140
+ *
141
+ * Enumerable, and appears in the result of JSON.stringify().
142
+ */
143
+ /**
144
+ * An array of GraphQL AST Nodes corresponding to this error.
145
+ */
146
+ /**
147
+ * The source GraphQL document for the first location of this error.
148
+ *
149
+ * Note that if this Error represents more than one node, the source may not
150
+ * represent nodes after the first node.
151
+ */
152
+ /**
153
+ * An array of character offsets within the source GraphQL document
154
+ * which correspond to this error.
155
+ */
156
+ /**
157
+ * The original error thrown from a field resolver during execution.
158
+ */
159
+ /**
160
+ * Extension fields to add to the formatted error.
161
+ */
162
+ /**
163
+ * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
164
+ */
165
+ constructor(message, ...rawArgs) {
166
+ var _this$nodes, _nodeLocations$, _ref;
167
+ const { nodes, source, positions, path, originalError, extensions } = toNormalizedOptions(rawArgs);
168
+ super(message);
169
+ this.name = "GraphQLError";
170
+ this.path = path !== null && path !== void 0 ? path : void 0;
171
+ this.originalError = originalError !== null && originalError !== void 0 ? originalError : void 0;
172
+ this.nodes = undefinedIfEmpty(
173
+ Array.isArray(nodes) ? nodes : nodes ? [nodes] : void 0
174
+ );
175
+ const nodeLocations = undefinedIfEmpty(
176
+ (_this$nodes = this.nodes) === null || _this$nodes === void 0 ? void 0 : _this$nodes.map((node) => node.loc).filter((loc) => loc != null)
177
+ );
178
+ this.source = source !== null && source !== void 0 ? source : nodeLocations === null || nodeLocations === void 0 ? void 0 : (_nodeLocations$ = nodeLocations[0]) === null || _nodeLocations$ === void 0 ? void 0 : _nodeLocations$.source;
179
+ this.positions = positions !== null && positions !== void 0 ? positions : nodeLocations === null || nodeLocations === void 0 ? void 0 : nodeLocations.map((loc) => loc.start);
180
+ this.locations = positions && source ? positions.map((pos) => getLocation(source, pos)) : nodeLocations === null || nodeLocations === void 0 ? void 0 : nodeLocations.map((loc) => getLocation(loc.source, loc.start));
181
+ const originalExtensions = isObjectLike(
182
+ originalError === null || originalError === void 0 ? void 0 : originalError.extensions
183
+ ) ? originalError === null || originalError === void 0 ? void 0 : originalError.extensions : void 0;
184
+ this.extensions = (_ref = extensions !== null && extensions !== void 0 ? extensions : originalExtensions) !== null && _ref !== void 0 ? _ref : /* @__PURE__ */ Object.create(null);
185
+ Object.defineProperties(this, {
186
+ message: {
187
+ writable: true,
188
+ enumerable: true
189
+ },
190
+ name: {
191
+ enumerable: false
192
+ },
193
+ nodes: {
194
+ enumerable: false
195
+ },
196
+ source: {
197
+ enumerable: false
198
+ },
199
+ positions: {
200
+ enumerable: false
201
+ },
202
+ originalError: {
203
+ enumerable: false
204
+ }
205
+ });
206
+ if (originalError !== null && originalError !== void 0 && originalError.stack) {
207
+ Object.defineProperty(this, "stack", {
208
+ value: originalError.stack,
209
+ writable: true,
210
+ configurable: true
489
211
  });
490
- };
491
- }
492
- });
493
- const __default__$3 = defineComponent({ name: "SituationSupportive" });
494
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
495
- ...__default__$3,
496
- setup(__props) {
497
- const {
498
- fields,
499
- id,
500
- initialValues,
501
- values,
502
- isNew,
503
- isLoading,
504
- isChanged,
505
- isReady,
506
- isMain,
507
- saveOne,
508
- discardChanges
509
- } = useSingle();
510
- return (_ctx, _cache) => {
511
- return openBlock(), createBlock(unref(NeonSingle), { class: "neu-situation-single" }, {
512
- default: withCtx(() => [
513
- createVNode(unref(OfficeTabs), { "use-url": unref(isMain) }, {
514
- default: withCtx(() => [
515
- createVNode(unref(OfficeTab), {
516
- handle: "info",
517
- icon: "circle-info",
518
- title: "Info"
519
- }, {
520
- default: withCtx(() => [
521
- createVNode(unref(NeonForm), {
522
- handle: "info",
523
- "initial-values": unref(initialValues),
524
- "is-loading": unref(isLoading),
525
- "is-changed": unref(isChanged),
526
- "use-unsaved": "",
527
- onCancel: unref(discardChanges),
528
- onSubmit: unref(saveOne)
529
- }, {
530
- default: withCtx(() => [
531
- createVNode(unref(NeonFields), {
532
- md: "grid-cols-4",
533
- title: "Suportif"
534
- }, {
535
- default: withCtx(() => [
536
- createVNode(unref(NeonField), mergeProps({
537
- modelValue: unref(values).situationStatus,
538
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(values).situationStatus = $event)
539
- }, unref(fields).situationStatus, { "is-disabled": "" }), null, 16, ["modelValue"])
540
- ]),
541
- _: 1
542
- /* STABLE */
543
- }),
544
- createVNode(unref(OfficeRelation), {
545
- modelValue: unref(values),
546
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(values) ? values.value = $event : null),
547
- field: unref(fields).situationSupportedBy
548
- }, null, 8, ["modelValue", "field"]),
549
- createVNode(unref(NeonFields), {
550
- md: "grid-cols-4",
551
- title: "Situasi"
552
- }, {
553
- default: withCtx(() => [
554
- createVNode(unref(NeonField), mergeProps({
555
- modelValue: unref(values).situationResponse,
556
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(values).situationResponse = $event)
557
- }, unref(fields).situationResponse), null, 16, ["modelValue"])
558
- ]),
559
- _: 1
560
- /* STABLE */
561
- }),
562
- createVNode(unref(OfficeRelation), {
563
- modelValue: unref(values),
564
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(values) ? values.value = $event : null),
565
- field: unref(fields).branches,
566
- "is-disabled": ""
567
- }, null, 8, ["modelValue", "field"]),
568
- createVNode(unref(OfficeRelation), {
569
- modelValue: unref(values),
570
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(values) ? values.value = $event : null),
571
- field: unref(fields).situationType,
572
- "is-disabled": ""
573
- }, null, 8, ["modelValue", "field"]),
574
- createVNode(unref(OfficeRelation), {
575
- modelValue: unref(values),
576
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => isRef(values) ? values.value = $event : null),
577
- field: unref(fields).situationReportedBy,
578
- "is-disabled": ""
579
- }, null, 8, ["modelValue", "field"]),
580
- createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
581
- default: withCtx(() => [
582
- createVNode(unref(NeonField), mergeProps({
583
- modelValue: unref(values).situationDescription,
584
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => unref(values).situationDescription = $event)
585
- }, unref(fields).situationDescription, { "is-disabled": "" }), null, 16, ["modelValue"])
586
- ]),
587
- _: 1
588
- /* STABLE */
589
- }),
590
- createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
591
- default: withCtx(() => [
592
- createVNode(unref(NeonField), mergeProps({
593
- modelValue: unref(values).urgentSituationDate,
594
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(values).urgentSituationDate = $event)
595
- }, unref(fields).urgentSituationDate, { "is-disabled": "" }), null, 16, ["modelValue"])
596
- ]),
597
- _: 1
598
- /* STABLE */
599
- }),
600
- createVNode(unref(OfficeRelation), {
601
- modelValue: unref(values),
602
- "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => isRef(values) ? values.value = $event : null),
603
- field: unref(fields).situationRelatedBy,
604
- "is-disabled": ""
605
- }, null, 8, ["modelValue", "field"])
606
- ]),
607
- _: 1
608
- /* STABLE */
609
- }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
610
- ]),
611
- _: 1
612
- /* STABLE */
613
- })
614
- ]),
615
- _: 1
616
- /* STABLE */
617
- }, 8, ["use-url"])
618
- ]),
619
- _: 1
620
- /* STABLE */
212
+ } else if (Error.captureStackTrace) {
213
+ Error.captureStackTrace(this, GraphQLError);
214
+ } else {
215
+ Object.defineProperty(this, "stack", {
216
+ value: Error().stack,
217
+ writable: true,
218
+ configurable: true
621
219
  });
622
- };
220
+ }
623
221
  }
624
- });
625
- const SituationTypeModel = models.SituationTypeModel;
626
- const __default__$2 = defineComponent({ name: "SituationTypeCollection" });
627
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
628
- ...__default__$2,
629
- setup(__props) {
630
- useCollection();
631
- return (_ctx, _cache) => {
632
- return openBlock(), createBlock(unref(NeonCollection), { class: "neu-situationType-collection" }, {
633
- default: withCtx(() => [
634
- createVNode(unref(OfficeCollectionTable))
635
- ]),
636
- _: 1
637
- /* STABLE */
638
- });
639
- };
640
- }
641
- });
642
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
643
- __name: "SituationTypeSingle",
644
- setup(__props) {
645
- const {
646
- fields,
647
- id,
648
- initialValues,
649
- values,
650
- isNew,
651
- isLoading,
652
- isChanged,
653
- isReady,
654
- isMain,
655
- saveOne,
656
- discardChanges
657
- } = useSingle();
658
- return (_ctx, _cache) => {
659
- return openBlock(), createBlock(unref(NeonSingle), { class: "neu-situation-type-single" }, {
660
- default: withCtx(() => [
661
- createVNode(unref(OfficeTabs), { "use-url": unref(isMain) }, {
662
- default: withCtx(() => [
663
- createVNode(unref(OfficeTab), {
664
- handle: "info",
665
- icon: "circle-info",
666
- title: "Info"
667
- }, {
668
- default: withCtx(() => [
669
- createVNode(unref(NeonForm), {
670
- handle: "info",
671
- "initial-values": unref(initialValues),
672
- "is-loading": unref(isLoading),
673
- "is-changed": unref(isChanged),
674
- "use-unsaved": "",
675
- onCancel: unref(discardChanges),
676
- onSubmit: unref(saveOne)
677
- }, {
678
- default: withCtx(() => [
679
- createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
680
- default: withCtx(() => [
681
- createVNode(unref(NeonField), mergeProps({
682
- modelValue: unref(values).situationTypeName,
683
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(values).situationTypeName = $event)
684
- }, unref(fields).situationTypeName), null, 16, ["modelValue"])
685
- ]),
686
- _: 1
687
- /* STABLE */
688
- }),
689
- createVNode(unref(OfficeRelation), {
690
- modelValue: unref(values),
691
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(values) ? values.value = $event : null),
692
- field: unref(fields).branches
693
- }, null, 8, ["modelValue", "field"])
694
- ]),
695
- _: 1
696
- /* STABLE */
697
- }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
698
- ]),
699
- _: 1
700
- /* STABLE */
701
- })
702
- ]),
703
- _: 1
704
- /* STABLE */
705
- }, 8, ["use-url"])
706
- ]),
707
- _: 1
708
- /* STABLE */
709
- });
710
- };
711
- }
712
- });
713
- const TaskModel = models.TaskModel;
714
- function devAssert(condition, message) {
715
- const booleanCondition = Boolean(condition);
716
- if (!booleanCondition) {
717
- throw new Error(message);
718
- }
719
- }
720
- function isObjectLike(value) {
721
- return typeof value == "object" && value !== null;
722
- }
723
- function invariant(condition, message) {
724
- const booleanCondition = Boolean(condition);
725
- if (!booleanCondition) {
726
- throw new Error(
727
- message != null ? message : "Unexpected invariant triggered."
728
- );
222
+ get [Symbol.toStringTag]() {
223
+ return "GraphQLError";
729
224
  }
730
- }
731
- const LineRegExp = /\r\n|[\n\r]/g;
732
- function getLocation(source, position) {
733
- let lastLineStart = 0;
734
- let line = 1;
735
- for (const match of source.body.matchAll(LineRegExp)) {
736
- typeof match.index === "number" || invariant(false);
737
- if (match.index >= position) {
738
- break;
225
+ toString() {
226
+ let output = this.message;
227
+ if (this.nodes) {
228
+ for (const node of this.nodes) {
229
+ if (node.loc) {
230
+ output += "\n\n" + printLocation(node.loc);
231
+ }
232
+ }
233
+ } else if (this.source && this.locations) {
234
+ for (const location of this.locations) {
235
+ output += "\n\n" + printSourceLocation(this.source, location);
236
+ }
739
237
  }
740
- lastLineStart = match.index + match[0].length;
741
- line += 1;
238
+ return output;
742
239
  }
743
- return {
744
- line,
745
- column: position + 1 - lastLineStart
746
- };
747
- }
748
- function printLocation(location) {
749
- return printSourceLocation(
750
- location.source,
751
- getLocation(location.source, location.start)
752
- );
753
- }
754
- function printSourceLocation(source, sourceLocation) {
755
- const firstLineColumnOffset = source.locationOffset.column - 1;
756
- const body = "".padStart(firstLineColumnOffset) + source.body;
757
- const lineIndex = sourceLocation.line - 1;
758
- const lineOffset = source.locationOffset.line - 1;
759
- const lineNum = sourceLocation.line + lineOffset;
760
- const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;
761
- const columnNum = sourceLocation.column + columnOffset;
762
- const locationStr = `${source.name}:${lineNum}:${columnNum}
763
- `;
764
- const lines = body.split(/\r\n|[\n\r]/g);
765
- const locationLine = lines[lineIndex];
766
- if (locationLine.length > 120) {
767
- const subLineIndex = Math.floor(columnNum / 80);
768
- const subLineColumnNum = columnNum % 80;
769
- const subLines = [];
770
- for (let i2 = 0; i2 < locationLine.length; i2 += 80) {
771
- subLines.push(locationLine.slice(i2, i2 + 80));
240
+ toJSON() {
241
+ const formattedError = {
242
+ message: this.message
243
+ };
244
+ if (this.locations != null) {
245
+ formattedError.locations = this.locations;
772
246
  }
773
- return locationStr + printPrefixedLines([
774
- [`${lineNum} |`, subLines[0]],
775
- ...subLines.slice(1, subLineIndex + 1).map((subLine) => ["|", subLine]),
776
- ["|", "^".padStart(subLineColumnNum)],
777
- ["|", subLines[subLineIndex + 1]]
778
- ]);
247
+ if (this.path != null) {
248
+ formattedError.path = this.path;
249
+ }
250
+ if (this.extensions != null && Object.keys(this.extensions).length > 0) {
251
+ formattedError.extensions = this.extensions;
252
+ }
253
+ return formattedError;
779
254
  }
780
- return locationStr + printPrefixedLines([
781
- // Lines specified like this: ["prefix", "string"],
782
- [`${lineNum - 1} |`, lines[lineIndex - 1]],
783
- [`${lineNum} |`, locationLine],
784
- ["|", "^".padStart(columnNum)],
785
- [`${lineNum + 1} |`, lines[lineIndex + 1]]
786
- ]);
787
255
  }
788
- function printPrefixedLines(lines) {
789
- const existingLines = lines.filter(([_, line]) => line !== void 0);
790
- const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));
791
- return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? " " + line : "")).join("\n");
256
+ function undefinedIfEmpty(array) {
257
+ return array === void 0 || array.length === 0 ? void 0 : array;
792
258
  }
793
- function toNormalizedOptions(args) {
794
- const firstArg = args[0];
795
- if (firstArg == null || "kind" in firstArg || "length" in firstArg) {
796
- return {
797
- nodes: firstArg,
798
- source: args[1],
799
- positions: args[2],
800
- path: args[3],
801
- originalError: args[4],
802
- extensions: args[5]
803
- };
804
- }
805
- return firstArg;
259
+ function syntaxError(source, position, description) {
260
+ return new GraphQLError(`Syntax Error: ${description}`, {
261
+ source,
262
+ positions: [position]
263
+ });
806
264
  }
807
- class GraphQLError extends Error {
265
+ class Location {
808
266
  /**
809
- * An array of `{ line, column }` locations within the source GraphQL document
810
- * which correspond to this error.
811
- *
812
- * Errors during validation often contain multiple locations, for example to
813
- * point out two things with the same name. Errors during execution include a
814
- * single location, the field which produced the error.
815
- *
816
- * Enumerable, and appears in the result of JSON.stringify().
267
+ * The character offset at which this Node begins.
817
268
  */
818
269
  /**
819
- * An array describing the JSON-path into the execution response which
820
- * corresponds to this error. Only included for errors during execution.
821
- *
822
- * Enumerable, and appears in the result of JSON.stringify().
270
+ * The character offset at which this Node ends.
823
271
  */
824
272
  /**
825
- * An array of GraphQL AST Nodes corresponding to this error.
273
+ * The Token at which this Node begins.
826
274
  */
827
275
  /**
828
- * The source GraphQL document for the first location of this error.
829
- *
830
- * Note that if this Error represents more than one node, the source may not
831
- * represent nodes after the first node.
276
+ * The Token at which this Node ends.
832
277
  */
833
278
  /**
834
- * An array of character offsets within the source GraphQL document
835
- * which correspond to this error.
279
+ * The Source document the AST represents.
836
280
  */
281
+ constructor(startToken, endToken, source) {
282
+ this.start = startToken.start;
283
+ this.end = endToken.end;
284
+ this.startToken = startToken;
285
+ this.endToken = endToken;
286
+ this.source = source;
287
+ }
288
+ get [Symbol.toStringTag]() {
289
+ return "Location";
290
+ }
291
+ toJSON() {
292
+ return {
293
+ start: this.start,
294
+ end: this.end
295
+ };
296
+ }
297
+ }
298
+ class Token {
837
299
  /**
838
- * The original error thrown from a field resolver during execution.
300
+ * The kind of Token.
839
301
  */
840
302
  /**
841
- * Extension fields to add to the formatted error.
303
+ * The character offset at which this Node begins.
842
304
  */
843
305
  /**
844
- * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
845
- */
846
- constructor(message, ...rawArgs) {
847
- var _this$nodes, _nodeLocations$, _ref;
848
- const { nodes, source, positions, path, originalError, extensions } = toNormalizedOptions(rawArgs);
849
- super(message);
850
- this.name = "GraphQLError";
851
- this.path = path !== null && path !== void 0 ? path : void 0;
852
- this.originalError = originalError !== null && originalError !== void 0 ? originalError : void 0;
853
- this.nodes = undefinedIfEmpty(
854
- Array.isArray(nodes) ? nodes : nodes ? [nodes] : void 0
855
- );
856
- const nodeLocations = undefinedIfEmpty(
857
- (_this$nodes = this.nodes) === null || _this$nodes === void 0 ? void 0 : _this$nodes.map((node) => node.loc).filter((loc) => loc != null)
858
- );
859
- this.source = source !== null && source !== void 0 ? source : nodeLocations === null || nodeLocations === void 0 ? void 0 : (_nodeLocations$ = nodeLocations[0]) === null || _nodeLocations$ === void 0 ? void 0 : _nodeLocations$.source;
860
- this.positions = positions !== null && positions !== void 0 ? positions : nodeLocations === null || nodeLocations === void 0 ? void 0 : nodeLocations.map((loc) => loc.start);
861
- this.locations = positions && source ? positions.map((pos) => getLocation(source, pos)) : nodeLocations === null || nodeLocations === void 0 ? void 0 : nodeLocations.map((loc) => getLocation(loc.source, loc.start));
862
- const originalExtensions = isObjectLike(
863
- originalError === null || originalError === void 0 ? void 0 : originalError.extensions
864
- ) ? originalError === null || originalError === void 0 ? void 0 : originalError.extensions : void 0;
865
- this.extensions = (_ref = extensions !== null && extensions !== void 0 ? extensions : originalExtensions) !== null && _ref !== void 0 ? _ref : /* @__PURE__ */ Object.create(null);
866
- Object.defineProperties(this, {
867
- message: {
868
- writable: true,
869
- enumerable: true
870
- },
871
- name: {
872
- enumerable: false
873
- },
874
- nodes: {
875
- enumerable: false
876
- },
877
- source: {
878
- enumerable: false
879
- },
880
- positions: {
881
- enumerable: false
882
- },
883
- originalError: {
884
- enumerable: false
885
- }
886
- });
887
- if (originalError !== null && originalError !== void 0 && originalError.stack) {
888
- Object.defineProperty(this, "stack", {
889
- value: originalError.stack,
890
- writable: true,
891
- configurable: true
892
- });
893
- } else if (Error.captureStackTrace) {
894
- Error.captureStackTrace(this, GraphQLError);
895
- } else {
896
- Object.defineProperty(this, "stack", {
897
- value: Error().stack,
898
- writable: true,
899
- configurable: true
900
- });
901
- }
902
- }
903
- get [Symbol.toStringTag]() {
904
- return "GraphQLError";
905
- }
906
- toString() {
907
- let output = this.message;
908
- if (this.nodes) {
909
- for (const node of this.nodes) {
910
- if (node.loc) {
911
- output += "\n\n" + printLocation(node.loc);
912
- }
913
- }
914
- } else if (this.source && this.locations) {
915
- for (const location of this.locations) {
916
- output += "\n\n" + printSourceLocation(this.source, location);
917
- }
918
- }
919
- return output;
920
- }
921
- toJSON() {
922
- const formattedError = {
923
- message: this.message
924
- };
925
- if (this.locations != null) {
926
- formattedError.locations = this.locations;
927
- }
928
- if (this.path != null) {
929
- formattedError.path = this.path;
930
- }
931
- if (this.extensions != null && Object.keys(this.extensions).length > 0) {
932
- formattedError.extensions = this.extensions;
933
- }
934
- return formattedError;
935
- }
936
- }
937
- function undefinedIfEmpty(array) {
938
- return array === void 0 || array.length === 0 ? void 0 : array;
939
- }
940
- function syntaxError(source, position, description) {
941
- return new GraphQLError(`Syntax Error: ${description}`, {
942
- source,
943
- positions: [position]
944
- });
945
- }
946
- class Location {
947
- /**
948
- * The character offset at which this Node begins.
949
- */
950
- /**
951
- * The character offset at which this Node ends.
952
- */
953
- /**
954
- * The Token at which this Node begins.
955
- */
956
- /**
957
- * The Token at which this Node ends.
958
- */
959
- /**
960
- * The Source document the AST represents.
961
- */
962
- constructor(startToken, endToken, source) {
963
- this.start = startToken.start;
964
- this.end = endToken.end;
965
- this.startToken = startToken;
966
- this.endToken = endToken;
967
- this.source = source;
968
- }
969
- get [Symbol.toStringTag]() {
970
- return "Location";
971
- }
972
- toJSON() {
973
- return {
974
- start: this.start,
975
- end: this.end
976
- };
977
- }
978
- }
979
- class Token {
980
- /**
981
- * The kind of Token.
982
- */
983
- /**
984
- * The character offset at which this Node begins.
985
- */
986
- /**
987
- * The character offset at which this Node ends.
306
+ * The character offset at which this Node ends.
988
307
  */
989
308
  /**
990
309
  * The 1-indexed line number on which this Token appears.
@@ -3704,11 +3023,11 @@ function hasMultilineItems(maybeArray) {
3704
3023
  var _maybeArray$some;
3705
3024
  return (_maybeArray$some = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.some((str) => str.includes("\n"))) !== null && _maybeArray$some !== void 0 ? _maybeArray$some : false;
3706
3025
  }
3707
- var e;
3026
+ var e$1;
3708
3027
  !function(e2) {
3709
3028
  e2[e2.Pull = 0] = "Pull";
3710
3029
  e2[e2.Close = 1] = "Close";
3711
- }(e || (e = {}));
3030
+ }(e$1 || (e$1 = {}));
3712
3031
  var r;
3713
3032
  !function(e2) {
3714
3033
  e2[e2.Start = 0] = "Start";
@@ -3736,9 +3055,9 @@ function onEnd(t2) {
3736
3055
  } else if (l3.tag === r.Start) {
3737
3056
  var i2 = l3[0];
3738
3057
  n(start((r2) => {
3739
- if (r2 === e.Close) {
3058
+ if (r2 === e$1.Close) {
3740
3059
  a = true;
3741
- i2(e.Close);
3060
+ i2(e$1.Close);
3742
3061
  t2();
3743
3062
  } else {
3744
3063
  i2(r2);
@@ -3765,7 +3084,7 @@ function take(l2) {
3765
3084
  if (l2 <= 0) {
3766
3085
  s2 = true;
3767
3086
  a(r.End);
3768
- t2[0](e.Close);
3087
+ t2[0](e$1.Close);
3769
3088
  } else {
3770
3089
  i2 = t2[0];
3771
3090
  }
@@ -3774,18 +3093,18 @@ function take(l2) {
3774
3093
  if (!s2 && f2 >= l2) {
3775
3094
  s2 = true;
3776
3095
  a(r.End);
3777
- i2(e.Close);
3096
+ i2(e$1.Close);
3778
3097
  }
3779
3098
  } else {
3780
3099
  a(t2);
3781
3100
  }
3782
3101
  });
3783
3102
  a(start((r2) => {
3784
- if (r2 === e.Close && !s2) {
3103
+ if (r2 === e$1.Close && !s2) {
3785
3104
  s2 = true;
3786
- i2(e.Close);
3787
- } else if (r2 === e.Pull && !s2 && f2 < l2) {
3788
- i2(e.Pull);
3105
+ i2(e$1.Close);
3106
+ } else if (r2 === e$1.Pull && !s2 && f2 < l2) {
3107
+ i2(e$1.Pull);
3789
3108
  }
3790
3109
  }));
3791
3110
  };
@@ -3798,17 +3117,17 @@ function subscribe(l2) {
3798
3117
  if (t2 === r.End) {
3799
3118
  i2 = true;
3800
3119
  } else if (t2.tag === r.Start) {
3801
- (a = t2[0])(e.Pull);
3120
+ (a = t2[0])(e$1.Pull);
3802
3121
  } else if (!i2) {
3803
3122
  l2(t2[0]);
3804
- a(e.Pull);
3123
+ a(e$1.Pull);
3805
3124
  }
3806
3125
  });
3807
3126
  return {
3808
3127
  unsubscribe() {
3809
3128
  if (!i2) {
3810
3129
  i2 = true;
3811
- a(e.Close);
3130
+ a(e$1.Close);
3812
3131
  }
3813
3132
  }
3814
3133
  };
@@ -3822,10 +3141,10 @@ function toPromise(l2) {
3822
3141
  if (t2 === r.End) {
3823
3142
  Promise.resolve(i2).then(n);
3824
3143
  } else if (t2.tag === r.Start) {
3825
- (a = t2[0])(e.Pull);
3144
+ (a = t2[0])(e$1.Pull);
3826
3145
  } else {
3827
3146
  i2 = t2[0];
3828
- a(e.Pull);
3147
+ a(e$1.Pull);
3829
3148
  }
3830
3149
  });
3831
3150
  });
@@ -4121,127 +3440,2295 @@ function callUseMutation(e2, r2 = useClient()) {
4121
3440
  o2.value = e3.extensions;
4122
3441
  return e3;
4123
3442
  });
4124
- }
4125
- };
4126
- }
4127
- var d = {
4128
- flush: "pre"
4129
- };
4130
- function callUseSubscription(e2, l2, t2 = useClient(), n = []) {
4131
- var o2 = reactive(e2);
4132
- var v2 = ref();
4133
- var f2 = ref(false);
4134
- var y = ref(false);
4135
- var b2 = ref();
4136
- var h = ref();
4137
- var x = ref();
4138
- var w = ref(l2);
4139
- var P = isRef(e2.pause) ? e2.pause : ref(!!e2.pause);
4140
- var q = ref(createRequest(o2.query, unwrapPossibleProxy(o2.variables)));
4141
- var E = ref();
4142
- n.push(watchEffect(() => {
4143
- var e3 = createRequest(o2.query, unwrapPossibleProxy(o2.variables));
4144
- if (q.value.key !== e3.key) {
4145
- q.value = e3;
4146
- }
4147
- }, d));
4148
- n.push(watchEffect(() => {
4149
- E.value = !P.value ? t2.value.executeSubscription(q.value, {
4150
- ...o2.context
4151
- }) : void 0;
4152
- }, d));
4153
- n.push(watchEffect((e3) => {
4154
- if (E.value) {
4155
- y.value = true;
4156
- e3(subscribe((e4) => {
4157
- y.value = true;
4158
- v2.value = void 0 !== e4.data ? "function" == typeof w.value ? w.value(v2.value, e4.data) : e4.data : e4.data, b2.value = e4.error;
4159
- x.value = e4.extensions;
4160
- f2.value = !!e4.stale;
4161
- h.value = e4.operation;
4162
- })(onEnd(() => {
4163
- y.value = false;
4164
- })(E.value)).unsubscribe);
4165
- } else {
4166
- y.value = false;
4167
- }
4168
- }, d));
4169
- var m = {
4170
- data: v2,
4171
- stale: f2,
4172
- error: b2,
4173
- operation: h,
4174
- extensions: x,
4175
- fetching: y,
4176
- isPaused: P,
4177
- executeSubscription(e3) {
4178
- E.value = t2.value.executeSubscription(q.value, {
4179
- ...o2.context,
4180
- ...e3
3443
+ }
3444
+ };
3445
+ }
3446
+ var d = {
3447
+ flush: "pre"
3448
+ };
3449
+ function callUseSubscription(e2, l2, t2 = useClient(), n = []) {
3450
+ var o2 = reactive(e2);
3451
+ var v2 = ref();
3452
+ var f2 = ref(false);
3453
+ var y = ref(false);
3454
+ var b2 = ref();
3455
+ var h = ref();
3456
+ var x = ref();
3457
+ var w = ref(l2);
3458
+ var P = isRef(e2.pause) ? e2.pause : ref(!!e2.pause);
3459
+ var q = ref(createRequest(o2.query, unwrapPossibleProxy(o2.variables)));
3460
+ var E = ref();
3461
+ n.push(watchEffect(() => {
3462
+ var e3 = createRequest(o2.query, unwrapPossibleProxy(o2.variables));
3463
+ if (q.value.key !== e3.key) {
3464
+ q.value = e3;
3465
+ }
3466
+ }, d));
3467
+ n.push(watchEffect(() => {
3468
+ E.value = !P.value ? t2.value.executeSubscription(q.value, {
3469
+ ...o2.context
3470
+ }) : void 0;
3471
+ }, d));
3472
+ n.push(watchEffect((e3) => {
3473
+ if (E.value) {
3474
+ y.value = true;
3475
+ e3(subscribe((e4) => {
3476
+ y.value = true;
3477
+ v2.value = void 0 !== e4.data ? "function" == typeof w.value ? w.value(v2.value, e4.data) : e4.data : e4.data, b2.value = e4.error;
3478
+ x.value = e4.extensions;
3479
+ f2.value = !!e4.stale;
3480
+ h.value = e4.operation;
3481
+ })(onEnd(() => {
3482
+ y.value = false;
3483
+ })(E.value)).unsubscribe);
3484
+ } else {
3485
+ y.value = false;
3486
+ }
3487
+ }, d));
3488
+ var m = {
3489
+ data: v2,
3490
+ stale: f2,
3491
+ error: b2,
3492
+ operation: h,
3493
+ extensions: x,
3494
+ fetching: y,
3495
+ isPaused: P,
3496
+ executeSubscription(e3) {
3497
+ E.value = t2.value.executeSubscription(q.value, {
3498
+ ...o2.context,
3499
+ ...e3
3500
+ });
3501
+ return m;
3502
+ },
3503
+ pause() {
3504
+ P.value = true;
3505
+ },
3506
+ resume() {
3507
+ P.value = false;
3508
+ }
3509
+ };
3510
+ return m;
3511
+ }
3512
+ function useClientHandle() {
3513
+ var e2 = useClient();
3514
+ var u = [];
3515
+ onBeforeUnmount(() => {
3516
+ var e3;
3517
+ while (e3 = u.shift()) {
3518
+ e3();
3519
+ }
3520
+ });
3521
+ var r2 = {
3522
+ client: e2.value,
3523
+ useQuery: (r3) => callUseQuery(r3, e2, u),
3524
+ useSubscription: (r3, a) => callUseSubscription(r3, a, e2, u),
3525
+ useMutation: (u2) => callUseMutation(u2, e2)
3526
+ };
3527
+ if ("production" !== process.env.NODE_ENV) {
3528
+ onMounted(() => {
3529
+ Object.assign(r2, {
3530
+ useQuery(r3) {
3531
+ if ("production" !== process.env.NODE_ENV && !getCurrentInstance()) {
3532
+ throw new Error("`handle.useQuery()` should only be called in the `setup()` or a lifecycle hook.");
3533
+ }
3534
+ return callUseQuery(r3, e2, u);
3535
+ },
3536
+ useSubscription(r3, a) {
3537
+ if ("production" !== process.env.NODE_ENV && !getCurrentInstance()) {
3538
+ throw new Error("`handle.useSubscription()` should only be called in the `setup()` or a lifecycle hook.");
3539
+ }
3540
+ return callUseSubscription(r3, a, e2, u);
3541
+ }
3542
+ });
3543
+ });
3544
+ }
3545
+ return r2;
3546
+ }
3547
+ function toInteger(dirtyNumber) {
3548
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
3549
+ return NaN;
3550
+ }
3551
+ var number = Number(dirtyNumber);
3552
+ if (isNaN(number)) {
3553
+ return number;
3554
+ }
3555
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
3556
+ }
3557
+ function requiredArgs(required, args) {
3558
+ if (args.length < required) {
3559
+ throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
3560
+ }
3561
+ }
3562
+ function _typeof(obj) {
3563
+ "@babel/helpers - typeof";
3564
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
3565
+ _typeof = function _typeof2(obj2) {
3566
+ return typeof obj2;
3567
+ };
3568
+ } else {
3569
+ _typeof = function _typeof2(obj2) {
3570
+ return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
3571
+ };
3572
+ }
3573
+ return _typeof(obj);
3574
+ }
3575
+ function toDate(argument) {
3576
+ requiredArgs(1, arguments);
3577
+ var argStr = Object.prototype.toString.call(argument);
3578
+ if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") {
3579
+ return new Date(argument.getTime());
3580
+ } else if (typeof argument === "number" || argStr === "[object Number]") {
3581
+ return new Date(argument);
3582
+ } else {
3583
+ if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
3584
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
3585
+ console.warn(new Error().stack);
3586
+ }
3587
+ return new Date(NaN);
3588
+ }
3589
+ }
3590
+ function addDays(dirtyDate, dirtyAmount) {
3591
+ requiredArgs(2, arguments);
3592
+ var date = toDate(dirtyDate);
3593
+ var amount = toInteger(dirtyAmount);
3594
+ if (isNaN(amount)) {
3595
+ return new Date(NaN);
3596
+ }
3597
+ if (!amount) {
3598
+ return date;
3599
+ }
3600
+ date.setDate(date.getDate() + amount);
3601
+ return date;
3602
+ }
3603
+ function startOfDay(dirtyDate) {
3604
+ requiredArgs(1, arguments);
3605
+ var date = toDate(dirtyDate);
3606
+ date.setHours(0, 0, 0, 0);
3607
+ return date;
3608
+ }
3609
+ function endOfDay(dirtyDate) {
3610
+ requiredArgs(1, arguments);
3611
+ var date = toDate(dirtyDate);
3612
+ date.setHours(23, 59, 59, 999);
3613
+ return date;
3614
+ }
3615
+ function endOfToday() {
3616
+ return endOfDay(Date.now());
3617
+ }
3618
+ function startOfToday() {
3619
+ return startOfDay(Date.now());
3620
+ }
3621
+ const useOperasionalStore = defineStore("neu:operasional", () => {
3622
+ const isLoading = ref(false);
3623
+ const staff = ref(null);
3624
+ return {
3625
+ isLoading,
3626
+ staff,
3627
+ setStaff
3628
+ };
3629
+ function setStaff(data) {
3630
+ staff.value = data;
3631
+ }
3632
+ });
3633
+ const useAttendanceStore = defineStore("neu:personalia:attendance", {
3634
+ state: () => ({
3635
+ isEntering: false,
3636
+ isAsking: false,
3637
+ isScanning: false,
3638
+ isScanError: false,
3639
+ isScanned: false,
3640
+ qrKey: "",
3641
+ type: "in",
3642
+ checkInId: ""
3643
+ }),
3644
+ getters: {},
3645
+ actions: {
3646
+ reset() {
3647
+ this.$patch((state) => {
3648
+ state.isEntering = false;
3649
+ state.isScanning = false;
3650
+ state.isScanError = false;
3651
+ state.isScanned = false;
3652
+ state.qrKey = "";
3653
+ state.type = "in";
3654
+ state.checkInId = "";
3655
+ });
3656
+ },
3657
+ async checkInStaff(qrKey, type, staffId) {
3658
+ const { client } = useClientHandle();
3659
+ try {
3660
+ this.qrKey = qrKey;
3661
+ this.type = type;
3662
+ const resp = await client.mutation(GraphUtil.executeOne(models.CheckInModel, {}), {
3663
+ action: "presence",
3664
+ input: {
3665
+ staffId,
3666
+ qrKey: this.qrKey || null,
3667
+ type: this.type
3668
+ }
3669
+ }).toPromise();
3670
+ const data = resp.data.executeCheckIn.output;
3671
+ if (data) {
3672
+ this.checkInId = data || "";
3673
+ this.isScanning = false;
3674
+ this.isScanned = true;
3675
+ } else
3676
+ throw new Error("Terjadi kesalahan.");
3677
+ } catch (error) {
3678
+ console.log(error);
3679
+ this.isScanError = true;
3680
+ }
3681
+ }
3682
+ }
3683
+ });
3684
+ const operasional_types = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3685
+ __proto__: null
3686
+ }, Symbol.toStringTag, { value: "Module" }));
3687
+ function useOperasional() {
3688
+ const context = ComponentUtil.injectStrict(
3689
+ "neu:operasional:operasional"
3690
+ );
3691
+ return { ...context };
3692
+ }
3693
+ const { StaffModel: StaffModel$1 } = models$1;
3694
+ function withOperasional() {
3695
+ const authStore = useAuthStore();
3696
+ const { userId } = storeToRefs(authStore);
3697
+ const store = useOperasionalStore();
3698
+ const { isLoading, staff } = storeToRefs(store);
3699
+ const { client } = useClientHandle();
3700
+ const context = {
3701
+ isLoading,
3702
+ staff,
3703
+ setStaff: store.setStaff,
3704
+ getStaff,
3705
+ init
3706
+ };
3707
+ provide("neu:operasional:operasional", context);
3708
+ return context;
3709
+ async function init() {
3710
+ await Promise.all([getStaff()]);
3711
+ }
3712
+ async function getStaff() {
3713
+ var _a;
3714
+ const resp = await client.query(
3715
+ GraphUtil.getMany(StaffModel$1, {
3716
+ id: 1,
3717
+ flag: 1,
3718
+ display: 1,
3719
+ nik: 1,
3720
+ name: 1,
3721
+ birthDate: 1,
3722
+ birthPlace: 1,
3723
+ image: 1,
3724
+ branchId: 1,
3725
+ branchIds: 1,
3726
+ branch: { id: 1, name: 1 },
3727
+ branches: { id: 1, name: 1 },
3728
+ note: 1
3729
+ }),
3730
+ {
3731
+ filter: { userId: userId.value },
3732
+ limit: 1,
3733
+ logs: ["error"]
3734
+ },
3735
+ { requestPolicy: "network-only" }
3736
+ ).toPromise();
3737
+ const wrapper = (_a = resp.data) == null ? void 0 : _a[StaffModel$1.plural];
3738
+ const items = (wrapper == null ? void 0 : wrapper.items) || [];
3739
+ store.setStaff(items[0]);
3740
+ }
3741
+ }
3742
+ function mitt(n) {
3743
+ return { all: n = n || /* @__PURE__ */ new Map(), on: function(t2, e2) {
3744
+ var i2 = n.get(t2);
3745
+ i2 ? i2.push(e2) : n.set(t2, [e2]);
3746
+ }, off: function(t2, e2) {
3747
+ var i2 = n.get(t2);
3748
+ i2 && (e2 ? i2.splice(i2.indexOf(e2) >>> 0, 1) : n.set(t2, []));
3749
+ }, emit: function(t2, e2) {
3750
+ var i2 = n.get(t2);
3751
+ i2 && i2.slice().map(function(n2) {
3752
+ n2(e2);
3753
+ }), (i2 = n.get("*")) && i2.slice().map(function(n2) {
3754
+ n2(t2, e2);
3755
+ });
3756
+ } };
3757
+ }
3758
+ const bus = mitt();
3759
+ const _withScopeId$2 = (n) => (pushScopeId("data-v-3ba48e60"), n = n(), popScopeId(), n);
3760
+ const _hoisted_1$7 = { id: "view-checkIns" };
3761
+ const _hoisted_2$4 = { class: "summary" };
3762
+ const _hoisted_3$1 = { class: "wrapper" };
3763
+ const _hoisted_4$1 = { class: "header" };
3764
+ const _hoisted_5 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode(
3765
+ "div",
3766
+ { class: "start" },
3767
+ [
3768
+ /* @__PURE__ */ createElementVNode("div", { class: "title" }, "➡️ Presensi"),
3769
+ /* @__PURE__ */ createElementVNode("div", { class: "description" }, "Daftar presensi hari ini.")
3770
+ ],
3771
+ -1
3772
+ /* HOISTED */
3773
+ ));
3774
+ const _hoisted_6 = { class: "end" };
3775
+ const __default__$7 = defineComponent({
3776
+ name: "CheckInPresenceCollection"
3777
+ });
3778
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
3779
+ ...__default__$7,
3780
+ setup(__props) {
3781
+ const collectionBus = useEventBus("neu:tempat:checkIn");
3782
+ const { client } = useClientHandle();
3783
+ const { staff } = useOperasional();
3784
+ const attendanceStore = useAttendanceStore();
3785
+ const { isAsking, isScanning, isEntering, isScanError, isScanned, type } = storeToRefs(attendanceStore);
3786
+ const toast = useToastStore();
3787
+ const isCheckpoint = ref(false);
3788
+ collectionBus.on((event, payload) => {
3789
+ if (isCheckpoint.value === true) {
3790
+ if (event === "createOne:ok") {
3791
+ const toastId = "neu:personalia:staff:checkIn";
3792
+ toast.push({
3793
+ id: toastId,
3794
+ icon: "check",
3795
+ content: "Presensi berhasil.",
3796
+ color: "success"
3797
+ });
3798
+ isCheckpoint.value = false;
3799
+ }
3800
+ }
3801
+ });
3802
+ const query = computed(() => {
3803
+ var _a;
3804
+ return Query.define({
3805
+ filter: {
3806
+ handle: "",
3807
+ operator: "mongo",
3808
+ value: {
3809
+ // staffId: staff.value?.id,
3810
+ // $and: PeriodUtil.getPeriodFilter('checkInAt', new Date().toISOString()),
3811
+ $and: [
3812
+ { staffId: (_a = staff.value) == null ? void 0 : _a.id },
3813
+ { checkInAt: { $gte: addDays(startOfToday(), 1) } },
3814
+ { checkInAt: { $lte: endOfToday() } }
3815
+ ]
3816
+ }
3817
+ }
3818
+ });
3819
+ });
3820
+ function onPresenceIn(data) {
3821
+ isAsking.value = true;
3822
+ type.value = "in";
3823
+ }
3824
+ function onPresenceOut(data) {
3825
+ isAsking.value = true;
3826
+ type.value = "out";
3827
+ }
3828
+ async function onPresenceHome() {
3829
+ var _a;
3830
+ await checkInStaff(null, "home", (_a = staff.value) == null ? void 0 : _a.id);
3831
+ }
3832
+ async function onScanned(data) {
3833
+ var _a;
3834
+ await checkInStaff(data, type.value, (_a = staff.value) == null ? void 0 : _a.id);
3835
+ }
3836
+ async function checkInStaff(qrKey, type2, staffId) {
3837
+ const toastId = "neu:personalia:staff:checkIn";
3838
+ console.log("bangunan...", qrKey);
3839
+ try {
3840
+ const resp = await client.mutation(GraphUtil.executeOne(models.CheckInModel, {}), {
3841
+ action: "presence",
3842
+ input: {
3843
+ staffId,
3844
+ key: qrKey,
3845
+ type: type2
3846
+ }
3847
+ }).toPromise();
3848
+ const data = resp.data.executeCheckIn.output;
3849
+ if (data) {
3850
+ isScanning.value = false;
3851
+ isScanned.value = true;
3852
+ toast.push({
3853
+ id: toastId,
3854
+ icon: "check",
3855
+ content: "Presensi berhasil.",
3856
+ color: "success"
3857
+ });
3858
+ } else
3859
+ throw new Error("Terjadi kesalahan.");
3860
+ } catch (error) {
3861
+ console.log(error);
3862
+ isScanError.value = true;
3863
+ toast.push({
3864
+ id: toastId,
3865
+ icon: "xmark",
3866
+ content: "Presensi gagal, cek kembali qrcode atau koneksi internet kamu dan coba lagi.",
3867
+ color: "danger"
3868
+ });
3869
+ }
3870
+ }
3871
+ return (_ctx, _cache) => {
3872
+ const _component_CheckInSingleView = resolveComponent("CheckInSingleView");
3873
+ const _component_CheckInCollection = resolveComponent("CheckInCollection");
3874
+ return openBlock(), createElementBlock("div", _hoisted_1$7, [
3875
+ createVNode(unref(OfficeContent), {
3876
+ icon: "barcode-read",
3877
+ title: "Presensi",
3878
+ "is-expanded": ""
3879
+ }, {
3880
+ "header-detail": withCtx(() => [
3881
+ createElementVNode("div", _hoisted_2$4, [
3882
+ createVNode(unref(NeonSlider), {
3883
+ "per-view": 2,
3884
+ gap: 16,
3885
+ offset: 16,
3886
+ peek: 24,
3887
+ breakpoints: {
3888
+ xl: { perView: 5 },
3889
+ lg: { perView: 4 },
3890
+ md: { perView: 4 },
3891
+ sm: { perView: 3 }
3892
+ }
3893
+ }, {
3894
+ default: withCtx(() => [
3895
+ createVNode(unref(NeonSlide), null, {
3896
+ default: withCtx(() => [
3897
+ createVNode(unref(NeonStat), {
3898
+ label: "Masuk",
3899
+ icon: "barcode-read",
3900
+ onClick: onPresenceIn
3901
+ }, {
3902
+ default: withCtx(() => [
3903
+ createTextVNode("Masuk")
3904
+ ]),
3905
+ _: 1
3906
+ /* STABLE */
3907
+ })
3908
+ ]),
3909
+ _: 1
3910
+ /* STABLE */
3911
+ }),
3912
+ createVNode(unref(NeonSlide), null, {
3913
+ default: withCtx(() => [
3914
+ createVNode(unref(NeonStat), {
3915
+ label: "Checkpoint",
3916
+ icon: "barcode-read",
3917
+ onClick: _cache[0] || (_cache[0] = ($event) => isCheckpoint.value = true)
3918
+ }, {
3919
+ default: withCtx(() => [
3920
+ createTextVNode("Checkpoint")
3921
+ ]),
3922
+ _: 1
3923
+ /* STABLE */
3924
+ })
3925
+ ]),
3926
+ _: 1
3927
+ /* STABLE */
3928
+ }),
3929
+ createVNode(unref(NeonSlide), null, {
3930
+ default: withCtx(() => [
3931
+ createVNode(unref(NeonStat), {
3932
+ label: "Keluar",
3933
+ icon: "barcode-read",
3934
+ onClick: onPresenceOut
3935
+ }, {
3936
+ default: withCtx(() => [
3937
+ createTextVNode("Keluar")
3938
+ ]),
3939
+ _: 1
3940
+ /* STABLE */
3941
+ })
3942
+ ]),
3943
+ _: 1
3944
+ /* STABLE */
3945
+ }),
3946
+ createVNode(unref(NeonSlide), null, {
3947
+ default: withCtx(() => [
3948
+ createVNode(unref(NeonStat), {
3949
+ label: "Pulang",
3950
+ icon: "barcode-read",
3951
+ onClick: onPresenceHome
3952
+ }, {
3953
+ default: withCtx(() => [
3954
+ createTextVNode("Pulang")
3955
+ ]),
3956
+ _: 1
3957
+ /* STABLE */
3958
+ })
3959
+ ]),
3960
+ _: 1
3961
+ /* STABLE */
3962
+ })
3963
+ ]),
3964
+ _: 1
3965
+ /* STABLE */
3966
+ }),
3967
+ isCheckpoint.value ? (openBlock(), createBlock(unref(NeonModal), {
3968
+ key: 0,
3969
+ "is-active": "",
3970
+ size: "lg",
3971
+ onClose: _cache[2] || (_cache[2] = ($event) => isCheckpoint.value = false)
3972
+ }, {
3973
+ default: withCtx(() => [
3974
+ createVNode(_component_CheckInSingleView, {
3975
+ id: "new",
3976
+ "is-new": "",
3977
+ "is-main": false,
3978
+ onClose: _cache[1] || (_cache[1] = ($event) => isCheckpoint.value = false)
3979
+ })
3980
+ ]),
3981
+ _: 1
3982
+ /* STABLE */
3983
+ })) : createCommentVNode("v-if", true),
3984
+ createVNode(unref(CheckInAccess), {
3985
+ onClose: _cache[3] || (_cache[3] = ($event) => isAsking.value = false)
3986
+ }),
3987
+ createVNode(unref(CheckInScanner), {
3988
+ onScanned,
3989
+ onClose: _cache[4] || (_cache[4] = ($event) => isScanning.value = false)
3990
+ }),
3991
+ createCommentVNode(' <CheckInScanError @close="isScanError = false" />\n <CheckInScanSuccess @close="isScanned = false" /> ')
3992
+ ])
3993
+ ]),
3994
+ default: withCtx(() => [
3995
+ createElementVNode("div", _hoisted_3$1, [
3996
+ createVNode(unref(NeonCollectionContext), {
3997
+ definition: "neu:tempat:checkIn",
3998
+ scope: "_checkIns",
3999
+ sheet: "single-view",
4000
+ query: unref(query),
4001
+ peeks: ["modal"],
4002
+ excludes: ["create"],
4003
+ columns: ["type", "checkInAt", "staff", "building"],
4004
+ "is-ready": "",
4005
+ "is-main": ""
4006
+ }, {
4007
+ default: withCtx(() => [
4008
+ createElementVNode("div", _hoisted_4$1, [
4009
+ _hoisted_5,
4010
+ createElementVNode("div", _hoisted_6, [
4011
+ createVNode(unref(OfficeCollectionQuery), { displays: ["table"] }, {
4012
+ default: withCtx(() => [
4013
+ createVNode(unref(OfficeCollectionOperation), { "is-main": "" })
4014
+ ]),
4015
+ _: 1
4016
+ /* STABLE */
4017
+ })
4018
+ ])
4019
+ ]),
4020
+ createVNode(_component_CheckInCollection)
4021
+ ]),
4022
+ _: 1
4023
+ /* STABLE */
4024
+ }, 8, ["query"])
4025
+ ])
4026
+ ]),
4027
+ _: 1
4028
+ /* STABLE */
4029
+ })
4030
+ ]);
4031
+ };
4032
+ }
4033
+ });
4034
+ const CheckInPresenceCollection_vue_vue_type_style_index_0_scoped_3ba48e60_lang = "";
4035
+ const _export_sfc = (sfc, props) => {
4036
+ const target = sfc.__vccOpts || sfc;
4037
+ for (const [key, val] of props) {
4038
+ target[key] = val;
4039
+ }
4040
+ return target;
4041
+ };
4042
+ const CheckInPresenceCollection = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-3ba48e60"]]);
4043
+ const _hoisted_1$6 = { class: "grid gap-4 sm:grid-cols-2" };
4044
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
4045
+ __name: "CheckInSingle",
4046
+ setup(__props) {
4047
+ const {
4048
+ fields,
4049
+ id,
4050
+ initialValues,
4051
+ values,
4052
+ isLoading,
4053
+ isChanged,
4054
+ isReady,
4055
+ isMain,
4056
+ isNew,
4057
+ saveOne,
4058
+ discardChanges,
4059
+ getOne
4060
+ } = useSingle();
4061
+ const { staff } = useOperasional();
4062
+ onMounted(() => {
4063
+ var _a, _b, _c;
4064
+ console.log("idnya?", id.value);
4065
+ if (id.value === "new") {
4066
+ values.value.staffId = (_a = staff.value) == null ? void 0 : _a.id;
4067
+ values.value.staff = {
4068
+ id: (_b = staff.value) == null ? void 0 : _b.id,
4069
+ display: (_c = staff.value) == null ? void 0 : _c.display
4070
+ };
4071
+ values.value.checkInAt = new Date().toISOString();
4072
+ values.value.type = "checkpoint";
4073
+ }
4074
+ });
4075
+ return (_ctx, _cache) => {
4076
+ return openBlock(), createBlock(unref(NeonSingle), { class: "neu-checkIn-single" }, {
4077
+ default: withCtx(() => [
4078
+ createVNode(unref(OfficeTabs), { "use-url": unref(isMain) }, {
4079
+ default: withCtx(() => [
4080
+ createVNode(unref(OfficeTab), {
4081
+ handle: "info",
4082
+ icon: "circle-info",
4083
+ title: "Info"
4084
+ }, {
4085
+ default: withCtx(() => [
4086
+ createVNode(unref(NeonForm), {
4087
+ handle: "info",
4088
+ "initial-values": unref(initialValues),
4089
+ "is-loading": unref(isLoading),
4090
+ "is-changed": unref(isChanged),
4091
+ "use-unsaved": "",
4092
+ onCancel: unref(discardChanges),
4093
+ onSubmit: unref(saveOne)
4094
+ }, {
4095
+ default: withCtx(() => [
4096
+ createVNode(unref(OfficeRelation), {
4097
+ modelValue: unref(values),
4098
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(values) ? values.value = $event : null),
4099
+ field: unref(fields).building,
4100
+ "is-disabled": ""
4101
+ }, null, 8, ["modelValue", "field"]),
4102
+ createElementVNode("div", _hoisted_1$6, [
4103
+ createVNode(unref(NeonField), mergeProps({
4104
+ modelValue: unref(values).type,
4105
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(values).type = $event)
4106
+ }, unref(fields).type, { "is-disabled": "" }), null, 16, ["modelValue"]),
4107
+ createVNode(unref(NeonField), mergeProps({
4108
+ modelValue: unref(values).checkInAt,
4109
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(values).checkInAt = $event)
4110
+ }, unref(fields).checkInAt, { "is-disabled": "" }), null, 16, ["modelValue"])
4111
+ ]),
4112
+ createVNode(unref(OfficeRelation), {
4113
+ modelValue: unref(values),
4114
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(values) ? values.value = $event : null),
4115
+ field: unref(fields).staff,
4116
+ "is-disabled": ""
4117
+ }, null, 8, ["modelValue", "field"]),
4118
+ createVNode(unref(NeonField), mergeProps({
4119
+ modelValue: unref(values).note,
4120
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(values).note = $event)
4121
+ }, unref(fields).note), null, 16, ["modelValue"])
4122
+ ]),
4123
+ _: 1
4124
+ /* STABLE */
4125
+ }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
4126
+ ]),
4127
+ _: 1
4128
+ /* STABLE */
4129
+ })
4130
+ ]),
4131
+ _: 1
4132
+ /* STABLE */
4133
+ }, 8, ["use-url"])
4134
+ ]),
4135
+ _: 1
4136
+ /* STABLE */
4137
+ });
4138
+ };
4139
+ }
4140
+ });
4141
+ const CheckInSingle_vue_vue_type_style_index_0_scoped_2e2803fb_lang = "";
4142
+ const CheckInSingle = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-2e2803fb"]]);
4143
+ const _withScopeId$1 = (n) => (pushScopeId("data-v-d23b6de5"), n = n(), popScopeId(), n);
4144
+ const _hoisted_1$5 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode(
4145
+ "h4",
4146
+ { align: "center" },
4147
+ "Aktifkan kamera untuk scan QR Code",
4148
+ -1
4149
+ /* HOISTED */
4150
+ ));
4151
+ const _hoisted_2$3 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode(
4152
+ "p",
4153
+ { align: "center" },
4154
+ [
4155
+ /* @__PURE__ */ createTextVNode(' Neutron Kantor membutuhkan akses ke kamera. Dengan klik "'),
4156
+ /* @__PURE__ */ createElementVNode("b", null, "Saya Setuju"),
4157
+ /* @__PURE__ */ createTextVNode('", kamu telah menyetujui syarat dan ketentuan yang berlaku. ')
4158
+ ],
4159
+ -1
4160
+ /* HOISTED */
4161
+ ));
4162
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
4163
+ __name: "CheckInAccess",
4164
+ emits: ["close"],
4165
+ setup(__props) {
4166
+ const attendanceStore = useAttendanceStore();
4167
+ const { isAsking, isScanError, isScanning } = storeToRefs(attendanceStore);
4168
+ function ok() {
4169
+ isAsking.value = false;
4170
+ isScanError.value = false;
4171
+ isScanning.value = true;
4172
+ }
4173
+ return (_ctx, _cache) => {
4174
+ return openBlock(), createBlock(unref(NeonModal), {
4175
+ "is-active": unref(isAsking),
4176
+ "onUpdate:isActive": _cache[1] || (_cache[1] = ($event) => isRef(isAsking) ? isAsking.value = $event : null),
4177
+ size: "lg",
4178
+ onClose: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("close"))
4179
+ }, {
4180
+ default: withCtx(() => [
4181
+ createVNode(unref(NeonSheet), {
4182
+ title: "Aktifkan Kamera",
4183
+ icon: "camera",
4184
+ onClose: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
4185
+ }, {
4186
+ default: withCtx(() => [
4187
+ _hoisted_1$5,
4188
+ _hoisted_2$3,
4189
+ createVNode(unref(NeonButton), {
4190
+ "is-full": "",
4191
+ size: "md",
4192
+ color: "success",
4193
+ "icon-left": "check",
4194
+ class: "buttons",
4195
+ onClick: ok
4196
+ }, {
4197
+ default: withCtx(() => [
4198
+ createTextVNode("Saya Setuju")
4199
+ ]),
4200
+ _: 1
4201
+ /* STABLE */
4202
+ })
4203
+ ]),
4204
+ _: 1
4205
+ /* STABLE */
4206
+ })
4207
+ ]),
4208
+ _: 1
4209
+ /* STABLE */
4210
+ }, 8, ["is-active"]);
4211
+ };
4212
+ }
4213
+ });
4214
+ const CheckInAccess_vue_vue_type_style_index_0_scoped_d23b6de5_lang = "";
4215
+ const CheckInAccess = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-d23b6de5"]]);
4216
+ const _hoisted_1$4 = { class: "buttons" };
4217
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
4218
+ __name: "CheckInScanError",
4219
+ setup(__props) {
4220
+ const attendanceStore = useAttendanceStore();
4221
+ const { isScanError } = storeToRefs(attendanceStore);
4222
+ function ok() {
4223
+ isScanError.value = false;
4224
+ }
4225
+ return (_ctx, _cache) => {
4226
+ return openBlock(), createBlock(unref(NeonModal), null, {
4227
+ default: withCtx(() => [
4228
+ createVNode(unref(NeonSheet), null, {
4229
+ footer: withCtx(() => [
4230
+ createElementVNode("div", _hoisted_1$4, [
4231
+ createVNode(unref(NeonButton), {
4232
+ "is-full": "",
4233
+ "is-rounded": "",
4234
+ "icon-left": "arrows-rotate",
4235
+ color: "success",
4236
+ onClick: ok
4237
+ }, {
4238
+ default: withCtx(() => [
4239
+ createTextVNode(" Coba Scan Lagi ")
4240
+ ]),
4241
+ _: 1
4242
+ /* STABLE */
4243
+ })
4244
+ ])
4245
+ ]),
4246
+ default: withCtx(() => [
4247
+ createVNode(unref(NeonInfo), {
4248
+ title: "Scan kode QR belum berhasil",
4249
+ description: "Pastikan koneksi internetmu stabil dan kameramu dalam kondisi baik. Coba lagi yuk!",
4250
+ "is-full": "",
4251
+ class: "mt-4"
4252
+ })
4253
+ ]),
4254
+ _: 1
4255
+ /* STABLE */
4256
+ })
4257
+ ]),
4258
+ _: 1
4259
+ /* STABLE */
4260
+ });
4261
+ };
4262
+ }
4263
+ });
4264
+ class e {
4265
+ constructor(a, b2, c, d2, f2) {
4266
+ this._legacyCanvasSize = e.DEFAULT_CANVAS_SIZE;
4267
+ this._preferredCamera = "environment";
4268
+ this._maxScansPerSecond = 25;
4269
+ this._lastScanTimestamp = -1;
4270
+ this._destroyed = this._flashOn = this._paused = this._active = false;
4271
+ this.$video = a;
4272
+ this.$canvas = document.createElement("canvas");
4273
+ c && "object" === typeof c ? this._onDecode = b2 : (c || d2 || f2 ? console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future") : console.warn("Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."), this._legacyOnDecode = b2);
4274
+ b2 = "object" === typeof c ? c : {};
4275
+ this._onDecodeError = b2.onDecodeError || ("function" === typeof c ? c : this._onDecodeError);
4276
+ this._calculateScanRegion = b2.calculateScanRegion || ("function" === typeof d2 ? d2 : this._calculateScanRegion);
4277
+ this._preferredCamera = b2.preferredCamera || f2 || this._preferredCamera;
4278
+ this._legacyCanvasSize = "number" === typeof c ? c : "number" === typeof d2 ? d2 : this._legacyCanvasSize;
4279
+ this._maxScansPerSecond = b2.maxScansPerSecond || this._maxScansPerSecond;
4280
+ this._onPlay = this._onPlay.bind(this);
4281
+ this._onLoadedMetaData = this._onLoadedMetaData.bind(this);
4282
+ this._onVisibilityChange = this._onVisibilityChange.bind(this);
4283
+ this._updateOverlay = this._updateOverlay.bind(this);
4284
+ a.disablePictureInPicture = true;
4285
+ a.playsInline = true;
4286
+ a.muted = true;
4287
+ let h = false;
4288
+ a.hidden && (a.hidden = false, h = true);
4289
+ document.body.contains(a) || (document.body.appendChild(a), h = true);
4290
+ c = a.parentElement;
4291
+ if (b2.highlightScanRegion || b2.highlightCodeOutline) {
4292
+ d2 = !!b2.overlay;
4293
+ this.$overlay = b2.overlay || document.createElement("div");
4294
+ f2 = this.$overlay.style;
4295
+ f2.position = "absolute";
4296
+ f2.display = "none";
4297
+ f2.pointerEvents = "none";
4298
+ this.$overlay.classList.add("scan-region-highlight");
4299
+ if (!d2 && b2.highlightScanRegion) {
4300
+ this.$overlay.innerHTML = '<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';
4301
+ try {
4302
+ this.$overlay.firstElementChild.animate({ transform: [
4303
+ "scale(.98)",
4304
+ "scale(1.01)"
4305
+ ] }, { duration: 400, iterations: Infinity, direction: "alternate", easing: "ease-in-out" });
4306
+ } catch (m) {
4307
+ }
4308
+ c.insertBefore(this.$overlay, this.$video.nextSibling);
4309
+ }
4310
+ b2.highlightCodeOutline && (this.$overlay.insertAdjacentHTML("beforeend", '<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'), this.$codeOutlineHighlight = this.$overlay.lastElementChild);
4311
+ }
4312
+ this._scanRegion = this._calculateScanRegion(a);
4313
+ requestAnimationFrame(() => {
4314
+ let m = window.getComputedStyle(a);
4315
+ "none" === m.display && (a.style.setProperty("display", "block", "important"), h = true);
4316
+ "visible" !== m.visibility && (a.style.setProperty("visibility", "visible", "important"), h = true);
4317
+ h && (console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."), a.style.opacity = "0", a.style.width = "0", a.style.height = "0", this.$overlay && this.$overlay.parentElement && this.$overlay.parentElement.removeChild(this.$overlay), delete this.$overlay, delete this.$codeOutlineHighlight);
4318
+ this.$overlay && this._updateOverlay();
4319
+ });
4320
+ a.addEventListener("play", this._onPlay);
4321
+ a.addEventListener("loadedmetadata", this._onLoadedMetaData);
4322
+ document.addEventListener("visibilitychange", this._onVisibilityChange);
4323
+ window.addEventListener("resize", this._updateOverlay);
4324
+ this._qrEnginePromise = e.createQrEngine();
4325
+ }
4326
+ static set WORKER_PATH(a) {
4327
+ console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.");
4328
+ }
4329
+ static async hasCamera() {
4330
+ try {
4331
+ return !!(await e.listCameras(false)).length;
4332
+ } catch (a) {
4333
+ return false;
4334
+ }
4335
+ }
4336
+ static async listCameras(a = false) {
4337
+ if (!navigator.mediaDevices)
4338
+ return [];
4339
+ let b2 = async () => (await navigator.mediaDevices.enumerateDevices()).filter((d2) => "videoinput" === d2.kind), c;
4340
+ try {
4341
+ a && (await b2()).every((d2) => !d2.label) && (c = await navigator.mediaDevices.getUserMedia({ audio: false, video: true }));
4342
+ } catch (d2) {
4343
+ }
4344
+ try {
4345
+ return (await b2()).map((d2, f2) => ({ id: d2.deviceId, label: d2.label || (0 === f2 ? "Default Camera" : `Camera ${f2 + 1}`) }));
4346
+ } finally {
4347
+ c && (console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"), e._stopVideoStream(c));
4348
+ }
4349
+ }
4350
+ async hasFlash() {
4351
+ let a;
4352
+ try {
4353
+ if (this.$video.srcObject) {
4354
+ if (!(this.$video.srcObject instanceof MediaStream))
4355
+ return false;
4356
+ a = this.$video.srcObject;
4357
+ } else
4358
+ a = (await this._getCameraStream()).stream;
4359
+ return "torch" in a.getVideoTracks()[0].getSettings();
4360
+ } catch (b2) {
4361
+ return false;
4362
+ } finally {
4363
+ a && a !== this.$video.srcObject && (console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"), e._stopVideoStream(a));
4364
+ }
4365
+ }
4366
+ isFlashOn() {
4367
+ return this._flashOn;
4368
+ }
4369
+ async toggleFlash() {
4370
+ this._flashOn ? await this.turnFlashOff() : await this.turnFlashOn();
4371
+ }
4372
+ async turnFlashOn() {
4373
+ if (!this._flashOn && !this._destroyed && (this._flashOn = true, this._active && !this._paused))
4374
+ try {
4375
+ if (!await this.hasFlash())
4376
+ throw "No flash available";
4377
+ await this.$video.srcObject.getVideoTracks()[0].applyConstraints({ advanced: [{ torch: true }] });
4378
+ } catch (a) {
4379
+ throw this._flashOn = false, a;
4380
+ }
4381
+ }
4382
+ async turnFlashOff() {
4383
+ this._flashOn && (this._flashOn = false, await this._restartVideoStream());
4384
+ }
4385
+ destroy() {
4386
+ this.$video.removeEventListener("loadedmetadata", this._onLoadedMetaData);
4387
+ this.$video.removeEventListener("play", this._onPlay);
4388
+ document.removeEventListener(
4389
+ "visibilitychange",
4390
+ this._onVisibilityChange
4391
+ );
4392
+ window.removeEventListener("resize", this._updateOverlay);
4393
+ this._destroyed = true;
4394
+ this._flashOn = false;
4395
+ this.stop();
4396
+ e._postWorkerMessage(this._qrEnginePromise, "close");
4397
+ }
4398
+ async start() {
4399
+ if (this._destroyed)
4400
+ throw Error("The QR scanner can not be started as it had been destroyed.");
4401
+ if (!this._active || this._paused) {
4402
+ if ("https:" !== window.location.protocol && console.warn("The camera stream is only accessible if the page is transferred via https."), this._active = true, !document.hidden)
4403
+ if (this._paused = false, this.$video.srcObject)
4404
+ await this.$video.play();
4405
+ else
4406
+ try {
4407
+ let { stream: a, facingMode: b2 } = await this._getCameraStream();
4408
+ !this._active || this._paused ? e._stopVideoStream(a) : (this._setVideoMirror(b2), this.$video.srcObject = a, await this.$video.play(), this._flashOn && (this._flashOn = false, this.turnFlashOn().catch(() => {
4409
+ })));
4410
+ } catch (a) {
4411
+ if (!this._paused)
4412
+ throw this._active = false, a;
4413
+ }
4414
+ }
4415
+ }
4416
+ stop() {
4417
+ this.pause();
4418
+ this._active = false;
4419
+ }
4420
+ async pause(a = false) {
4421
+ this._paused = true;
4422
+ if (!this._active)
4423
+ return true;
4424
+ this.$video.pause();
4425
+ this.$overlay && (this.$overlay.style.display = "none");
4426
+ let b2 = () => {
4427
+ this.$video.srcObject instanceof MediaStream && (e._stopVideoStream(this.$video.srcObject), this.$video.srcObject = null);
4428
+ };
4429
+ if (a)
4430
+ return b2(), true;
4431
+ await new Promise((c) => setTimeout(c, 300));
4432
+ if (!this._paused)
4433
+ return false;
4434
+ b2();
4435
+ return true;
4436
+ }
4437
+ async setCamera(a) {
4438
+ a !== this._preferredCamera && (this._preferredCamera = a, await this._restartVideoStream());
4439
+ }
4440
+ static async scanImage(a, b2, c, d2, f2 = false, h = false) {
4441
+ let m, n = false;
4442
+ b2 && ("scanRegion" in b2 || "qrEngine" in b2 || "canvas" in b2 || "disallowCanvasResizing" in b2 || "alsoTryWithoutScanRegion" in b2 || "returnDetailedScanResult" in b2) ? (m = b2.scanRegion, c = b2.qrEngine, d2 = b2.canvas, f2 = b2.disallowCanvasResizing || false, h = b2.alsoTryWithoutScanRegion || false, n = true) : b2 || c || d2 || f2 || h ? console.warn("You're using a deprecated api for scanImage which will be removed in the future.") : console.warn("Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true.");
4443
+ b2 = !!c;
4444
+ try {
4445
+ let p, k;
4446
+ [c, p] = await Promise.all([c || e.createQrEngine(), e._loadImage(a)]);
4447
+ [d2, k] = e._drawToCanvas(p, m, d2, f2);
4448
+ let q;
4449
+ if (c instanceof Worker) {
4450
+ let g = c;
4451
+ b2 || e._postWorkerMessageSync(g, "inversionMode", "both");
4452
+ q = await new Promise((l2, v2) => {
4453
+ let w, u, r2, y = -1;
4454
+ u = (t2) => {
4455
+ t2.data.id === y && (g.removeEventListener("message", u), g.removeEventListener("error", r2), clearTimeout(w), null !== t2.data.data ? l2({ data: t2.data.data, cornerPoints: e._convertPoints(t2.data.cornerPoints, m) }) : v2(e.NO_QR_CODE_FOUND));
4456
+ };
4457
+ r2 = (t2) => {
4458
+ g.removeEventListener("message", u);
4459
+ g.removeEventListener("error", r2);
4460
+ clearTimeout(w);
4461
+ v2("Scanner error: " + (t2 ? t2.message || t2 : "Unknown Error"));
4462
+ };
4463
+ g.addEventListener("message", u);
4464
+ g.addEventListener("error", r2);
4465
+ w = setTimeout(() => r2("timeout"), 1e4);
4466
+ let x = k.getImageData(0, 0, d2.width, d2.height);
4467
+ y = e._postWorkerMessageSync(g, "decode", x, [x.data.buffer]);
4468
+ });
4469
+ } else
4470
+ q = await Promise.race([new Promise((g, l2) => window.setTimeout(() => l2("Scanner error: timeout"), 1e4)), (async () => {
4471
+ try {
4472
+ var [g] = await c.detect(d2);
4473
+ if (!g)
4474
+ throw e.NO_QR_CODE_FOUND;
4475
+ return { data: g.rawValue, cornerPoints: e._convertPoints(g.cornerPoints, m) };
4476
+ } catch (l2) {
4477
+ g = l2.message || l2;
4478
+ if (/not implemented|service unavailable/.test(g))
4479
+ return e._disableBarcodeDetector = true, e.scanImage(a, { scanRegion: m, canvas: d2, disallowCanvasResizing: f2, alsoTryWithoutScanRegion: h });
4480
+ throw `Scanner error: ${g}`;
4481
+ }
4482
+ })()]);
4483
+ return n ? q : q.data;
4484
+ } catch (p) {
4485
+ if (!m || !h)
4486
+ throw p;
4487
+ let k = await e.scanImage(a, { qrEngine: c, canvas: d2, disallowCanvasResizing: f2 });
4488
+ return n ? k : k.data;
4489
+ } finally {
4490
+ b2 || e._postWorkerMessage(c, "close");
4491
+ }
4492
+ }
4493
+ setGrayscaleWeights(a, b2, c, d2 = true) {
4494
+ e._postWorkerMessage(this._qrEnginePromise, "grayscaleWeights", {
4495
+ red: a,
4496
+ green: b2,
4497
+ blue: c,
4498
+ useIntegerApproximation: d2
4499
+ });
4500
+ }
4501
+ setInversionMode(a) {
4502
+ e._postWorkerMessage(this._qrEnginePromise, "inversionMode", a);
4503
+ }
4504
+ static async createQrEngine(a) {
4505
+ a && console.warn("Specifying a worker path is not required and not supported anymore.");
4506
+ return !e._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code") ? new BarcodeDetector({ formats: ["qr_code"] }) : Promise.resolve().then(() => qrScannerWorker_min).then((b2) => b2.createWorker());
4507
+ }
4508
+ _onPlay() {
4509
+ this._scanRegion = this._calculateScanRegion(this.$video);
4510
+ this._updateOverlay();
4511
+ this.$overlay && (this.$overlay.style.display = "");
4512
+ this._scanFrame();
4513
+ }
4514
+ _onLoadedMetaData() {
4515
+ this._scanRegion = this._calculateScanRegion(this.$video);
4516
+ this._updateOverlay();
4517
+ }
4518
+ _onVisibilityChange() {
4519
+ document.hidden ? this.pause() : this._active && this.start();
4520
+ }
4521
+ _calculateScanRegion(a) {
4522
+ let b2 = Math.round(2 / 3 * Math.min(a.videoWidth, a.videoHeight));
4523
+ return {
4524
+ x: Math.round((a.videoWidth - b2) / 2),
4525
+ y: Math.round((a.videoHeight - b2) / 2),
4526
+ width: b2,
4527
+ height: b2,
4528
+ downScaledWidth: this._legacyCanvasSize,
4529
+ downScaledHeight: this._legacyCanvasSize
4530
+ };
4531
+ }
4532
+ _updateOverlay() {
4533
+ requestAnimationFrame(() => {
4534
+ if (this.$overlay) {
4535
+ var a = this.$video, b2 = a.videoWidth, c = a.videoHeight, d2 = a.offsetWidth, f2 = a.offsetHeight, h = a.offsetLeft, m = a.offsetTop, n = window.getComputedStyle(a), p = n.objectFit, k = b2 / c, q = d2 / f2;
4536
+ switch (p) {
4537
+ case "none":
4538
+ var g = b2;
4539
+ var l2 = c;
4540
+ break;
4541
+ case "fill":
4542
+ g = d2;
4543
+ l2 = f2;
4544
+ break;
4545
+ default:
4546
+ ("cover" === p ? k > q : k < q) ? (l2 = f2, g = l2 * k) : (g = d2, l2 = g / k), "scale-down" === p && (g = Math.min(g, b2), l2 = Math.min(l2, c));
4547
+ }
4548
+ var [v2, w] = n.objectPosition.split(" ").map((r2, y) => {
4549
+ const x = parseFloat(r2);
4550
+ return r2.endsWith("%") ? (y ? f2 - l2 : d2 - g) * x / 100 : x;
4551
+ });
4552
+ n = this._scanRegion.width || b2;
4553
+ q = this._scanRegion.height || c;
4554
+ p = this._scanRegion.x || 0;
4555
+ var u = this._scanRegion.y || 0;
4556
+ k = this.$overlay.style;
4557
+ k.width = `${n / b2 * g}px`;
4558
+ k.height = `${q / c * l2}px`;
4559
+ k.top = `${m + w + u / c * l2}px`;
4560
+ c = /scaleX\(-1\)/.test(a.style.transform);
4561
+ k.left = `${h + (c ? d2 - v2 - g : v2) + (c ? b2 - p - n : p) / b2 * g}px`;
4562
+ k.transform = a.style.transform;
4563
+ }
4564
+ });
4565
+ }
4566
+ static _convertPoints(a, b2) {
4567
+ if (!b2)
4568
+ return a;
4569
+ let c = b2.x || 0, d2 = b2.y || 0, f2 = b2.width && b2.downScaledWidth ? b2.width / b2.downScaledWidth : 1;
4570
+ b2 = b2.height && b2.downScaledHeight ? b2.height / b2.downScaledHeight : 1;
4571
+ for (let h of a)
4572
+ h.x = h.x * f2 + c, h.y = h.y * b2 + d2;
4573
+ return a;
4574
+ }
4575
+ _scanFrame() {
4576
+ !this._active || this.$video.paused || this.$video.ended || ("requestVideoFrameCallback" in this.$video ? this.$video.requestVideoFrameCallback.bind(this.$video) : requestAnimationFrame)(async () => {
4577
+ if (!(1 >= this.$video.readyState)) {
4578
+ var a = Date.now() - this._lastScanTimestamp, b2 = 1e3 / this._maxScansPerSecond;
4579
+ a < b2 && await new Promise((d2) => setTimeout(d2, b2 - a));
4580
+ this._lastScanTimestamp = Date.now();
4581
+ try {
4582
+ var c = await e.scanImage(
4583
+ this.$video,
4584
+ { scanRegion: this._scanRegion, qrEngine: this._qrEnginePromise, canvas: this.$canvas }
4585
+ );
4586
+ } catch (d2) {
4587
+ if (!this._active)
4588
+ return;
4589
+ this._onDecodeError(d2);
4590
+ }
4591
+ !e._disableBarcodeDetector || await this._qrEnginePromise instanceof Worker || (this._qrEnginePromise = e.createQrEngine());
4592
+ c ? (this._onDecode ? this._onDecode(c) : this._legacyOnDecode && this._legacyOnDecode(c.data), this.$codeOutlineHighlight && (clearTimeout(this._codeOutlineHighlightRemovalTimeout), this._codeOutlineHighlightRemovalTimeout = void 0, this.$codeOutlineHighlight.setAttribute(
4593
+ "viewBox",
4594
+ `${this._scanRegion.x || 0} ${this._scanRegion.y || 0} ${this._scanRegion.width || this.$video.videoWidth} ${this._scanRegion.height || this.$video.videoHeight}`
4595
+ ), this.$codeOutlineHighlight.firstElementChild.setAttribute("points", c.cornerPoints.map(({ x: d2, y: f2 }) => `${d2},${f2}`).join(" ")), this.$codeOutlineHighlight.style.display = "")) : this.$codeOutlineHighlight && !this._codeOutlineHighlightRemovalTimeout && (this._codeOutlineHighlightRemovalTimeout = setTimeout(() => this.$codeOutlineHighlight.style.display = "none", 100));
4596
+ }
4597
+ this._scanFrame();
4598
+ });
4599
+ }
4600
+ _onDecodeError(a) {
4601
+ a !== e.NO_QR_CODE_FOUND && console.log(a);
4602
+ }
4603
+ async _getCameraStream() {
4604
+ if (!navigator.mediaDevices)
4605
+ throw "Camera not found.";
4606
+ let a = /^(environment|user)$/.test(this._preferredCamera) ? "facingMode" : "deviceId", b2 = [{ width: { min: 1024 } }, { width: { min: 768 } }, {}], c = b2.map((d2) => Object.assign({}, d2, { [a]: { exact: this._preferredCamera } }));
4607
+ for (let d2 of [...c, ...b2])
4608
+ try {
4609
+ let f2 = await navigator.mediaDevices.getUserMedia({ video: d2, audio: false }), h = this._getFacingMode(f2) || (d2.facingMode ? this._preferredCamera : "environment" === this._preferredCamera ? "user" : "environment");
4610
+ return { stream: f2, facingMode: h };
4611
+ } catch (f2) {
4612
+ }
4613
+ throw "Camera not found.";
4614
+ }
4615
+ async _restartVideoStream() {
4616
+ let a = this._paused;
4617
+ await this.pause(true) && !a && this._active && await this.start();
4618
+ }
4619
+ static _stopVideoStream(a) {
4620
+ for (let b2 of a.getTracks())
4621
+ b2.stop(), a.removeTrack(b2);
4622
+ }
4623
+ _setVideoMirror(a) {
4624
+ this.$video.style.transform = "scaleX(" + ("user" === a ? -1 : 1) + ")";
4625
+ }
4626
+ _getFacingMode(a) {
4627
+ return (a = a.getVideoTracks()[0]) ? /rear|back|environment/i.test(a.label) ? "environment" : /front|user|face/i.test(a.label) ? "user" : null : null;
4628
+ }
4629
+ static _drawToCanvas(a, b2, c, d2 = false) {
4630
+ c = c || document.createElement("canvas");
4631
+ let f2 = b2 && b2.x ? b2.x : 0, h = b2 && b2.y ? b2.y : 0, m = b2 && b2.width ? b2.width : a.videoWidth || a.width, n = b2 && b2.height ? b2.height : a.videoHeight || a.height;
4632
+ d2 || (d2 = b2 && b2.downScaledWidth ? b2.downScaledWidth : m, b2 = b2 && b2.downScaledHeight ? b2.downScaledHeight : n, c.width !== d2 && (c.width = d2), c.height !== b2 && (c.height = b2));
4633
+ b2 = c.getContext("2d", { alpha: false });
4634
+ b2.imageSmoothingEnabled = false;
4635
+ b2.drawImage(a, f2, h, m, n, 0, 0, c.width, c.height);
4636
+ return [c, b2];
4637
+ }
4638
+ static async _loadImage(a) {
4639
+ if (a instanceof Image)
4640
+ return await e._awaitImageLoad(a), a;
4641
+ if (a instanceof HTMLVideoElement || a instanceof HTMLCanvasElement || a instanceof SVGImageElement || "OffscreenCanvas" in window && a instanceof OffscreenCanvas || "ImageBitmap" in window && a instanceof ImageBitmap)
4642
+ return a;
4643
+ if (a instanceof File || a instanceof Blob || a instanceof URL || "string" === typeof a) {
4644
+ let b2 = new Image();
4645
+ b2.src = a instanceof File || a instanceof Blob ? URL.createObjectURL(a) : a.toString();
4646
+ try {
4647
+ return await e._awaitImageLoad(b2), b2;
4648
+ } finally {
4649
+ (a instanceof File || a instanceof Blob) && URL.revokeObjectURL(b2.src);
4650
+ }
4651
+ } else
4652
+ throw "Unsupported image type.";
4653
+ }
4654
+ static async _awaitImageLoad(a) {
4655
+ a.complete && 0 !== a.naturalWidth || await new Promise((b2, c) => {
4656
+ let d2 = (f2) => {
4657
+ a.removeEventListener("load", d2);
4658
+ a.removeEventListener("error", d2);
4659
+ f2 instanceof ErrorEvent ? c("Image load error") : b2();
4660
+ };
4661
+ a.addEventListener("load", d2);
4662
+ a.addEventListener("error", d2);
4663
+ });
4664
+ }
4665
+ static async _postWorkerMessage(a, b2, c, d2) {
4666
+ return e._postWorkerMessageSync(await a, b2, c, d2);
4667
+ }
4668
+ static _postWorkerMessageSync(a, b2, c, d2) {
4669
+ if (!(a instanceof Worker))
4670
+ return -1;
4671
+ let f2 = e._workerMessageId++;
4672
+ a.postMessage({ id: f2, type: b2, data: c }, d2);
4673
+ return f2;
4674
+ }
4675
+ }
4676
+ e.DEFAULT_CANVAS_SIZE = 400;
4677
+ e.NO_QR_CODE_FOUND = "No QR code found";
4678
+ e._disableBarcodeDetector = false;
4679
+ e._workerMessageId = 0;
4680
+ const Scanner = e;
4681
+ const _withScopeId = (n) => (pushScopeId("data-v-ef426ef3"), n = n(), popScopeId(), n);
4682
+ const _hoisted_1$3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode(
4683
+ "div",
4684
+ { class: "invalid-message" },
4685
+ "Invalid Code!",
4686
+ -1
4687
+ /* HOISTED */
4688
+ ));
4689
+ const _hoisted_2$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode(
4690
+ "div",
4691
+ null,
4692
+ null,
4693
+ -1
4694
+ /* HOISTED */
4695
+ ));
4696
+ const _hoisted_3 = ["onClick"];
4697
+ const _hoisted_4 = { class: "mr-2 text-sm" };
4698
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
4699
+ __name: "CheckInScanner",
4700
+ emits: ["start", "stop", "scanned", "close"],
4701
+ setup(__props, { emit }) {
4702
+ const attendanceStore = useAttendanceStore();
4703
+ const { isScanning } = storeToRefs(attendanceStore);
4704
+ const frameEl = ref();
4705
+ const videoEl = ref();
4706
+ const scanner = ref();
4707
+ const state = reactive({
4708
+ isScanning: false,
4709
+ isInvalid: false,
4710
+ result: "",
4711
+ currentIndex: 0
4712
+ });
4713
+ const cameras = ref([]);
4714
+ const currentCamera = computed(
4715
+ () => {
4716
+ var _a;
4717
+ return ((_a = cameras.value[state.currentIndex]) == null ? void 0 : _a.label) || "";
4718
+ }
4719
+ );
4720
+ const canSwitch = computed(() => cameras.value.length > 1);
4721
+ const { resume, pause } = useIntervalFn(
4722
+ async () => {
4723
+ cameras.value = await Scanner.listCameras();
4724
+ console.log(cameras.value);
4725
+ },
4726
+ 1e3,
4727
+ { immediate: false }
4728
+ );
4729
+ const throttledEmit = useThrottleFn(emitResult, 2e3);
4730
+ watchEffect(() => {
4731
+ if (isScanning.value && videoEl.value) {
4732
+ scanner.value = new Scanner(
4733
+ videoEl.value,
4734
+ (result) => {
4735
+ if (!result.data)
4736
+ return;
4737
+ throttledEmit(result.data);
4738
+ stopScan();
4739
+ },
4740
+ {
4741
+ preferredCamera: "environment",
4742
+ highlightScanRegion: true,
4743
+ highlightCodeOutline: true
4744
+ }
4745
+ );
4746
+ resume();
4747
+ startScan();
4748
+ }
4749
+ });
4750
+ watchEffect(() => {
4751
+ if (!isScanning.value) {
4752
+ stopScan();
4753
+ destroy();
4754
+ }
4755
+ });
4756
+ bus.on("attendance:scan", (isStart) => {
4757
+ if (isStart)
4758
+ startScan();
4759
+ else
4760
+ stopScan();
4761
+ });
4762
+ onBeforeUnmount(() => {
4763
+ bus.off("attendance:scan");
4764
+ destroy();
4765
+ });
4766
+ function emitResult(data) {
4767
+ state.result = data;
4768
+ emit("scanned", data);
4769
+ }
4770
+ function switchCamera() {
4771
+ var _a, _b;
4772
+ if (cameras.value.length - 1 === state.currentIndex) {
4773
+ state.currentIndex = 0;
4774
+ } else {
4775
+ state.currentIndex++;
4776
+ }
4777
+ const deviceId = (_a = cameras.value[state.currentIndex]) == null ? void 0 : _a.id;
4778
+ (_b = scanner.value) == null ? void 0 : _b.setCamera(deviceId);
4779
+ }
4780
+ function startScan() {
4781
+ var _a;
4782
+ (_a = scanner.value) == null ? void 0 : _a.start();
4783
+ state.isScanning = true;
4784
+ emit("start");
4785
+ }
4786
+ function stopScan() {
4787
+ var _a;
4788
+ (_a = scanner.value) == null ? void 0 : _a.stop();
4789
+ state.isScanning = false;
4790
+ pause();
4791
+ emit("stop");
4792
+ }
4793
+ function destroy() {
4794
+ var _a;
4795
+ (_a = scanner.value) == null ? void 0 : _a.destroy();
4796
+ scanner.value = void 0;
4797
+ }
4798
+ return (_ctx, _cache) => {
4799
+ return openBlock(), createBlock(unref(NeonModal), {
4800
+ "is-active": unref(isScanning),
4801
+ "onUpdate:isActive": _cache[1] || (_cache[1] = ($event) => isRef(isScanning) ? isScanning.value = $event : null),
4802
+ size: "xl",
4803
+ onClose: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("close"))
4804
+ }, {
4805
+ default: withCtx(() => [
4806
+ createVNode(unref(NeonSheet), {
4807
+ icon: "barcode-read",
4808
+ title: "Scan QR Code",
4809
+ onClose: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
4810
+ }, {
4811
+ default: withCtx(() => [
4812
+ createElementVNode(
4813
+ "div",
4814
+ {
4815
+ ref_key: "frameEl",
4816
+ ref: frameEl,
4817
+ class: normalizeClass(["video-frame", [
4818
+ {
4819
+ "is-scanning": state.isScanning,
4820
+ "is-invalid": state.isInvalid
4821
+ }
4822
+ ]])
4823
+ },
4824
+ [
4825
+ createElementVNode(
4826
+ "video",
4827
+ {
4828
+ ref_key: "videoEl",
4829
+ ref: videoEl,
4830
+ style: {
4831
+ height: `auto`,
4832
+ width: `auto`
4833
+ }
4834
+ },
4835
+ null,
4836
+ 512
4837
+ /* NEED_PATCH */
4838
+ ),
4839
+ createElementVNode("div", {
4840
+ class: "inner",
4841
+ onClick: switchCamera
4842
+ }, [
4843
+ _hoisted_1$3,
4844
+ _hoisted_2$2,
4845
+ createElementVNode("div", {
4846
+ class: "button-switch",
4847
+ onClick: withModifiers(switchCamera, ["stop"])
4848
+ }, [
4849
+ createElementVNode(
4850
+ "div",
4851
+ _hoisted_4,
4852
+ toDisplayString(unref(currentCamera)),
4853
+ 1
4854
+ /* TEXT */
4855
+ ),
4856
+ createVNode(unref(NeonButton), {
4857
+ "icon-left": "arrows-repeat",
4858
+ "is-squared": "",
4859
+ size: "sm",
4860
+ "is-disabled": !unref(canSwitch)
4861
+ }, null, 8, ["is-disabled"])
4862
+ ], 8, _hoisted_3)
4863
+ ])
4864
+ ],
4865
+ 2
4866
+ /* CLASS */
4867
+ )
4868
+ ]),
4869
+ _: 1
4870
+ /* STABLE */
4871
+ })
4872
+ ]),
4873
+ _: 1
4874
+ /* STABLE */
4875
+ }, 8, ["is-active"]);
4876
+ };
4877
+ }
4878
+ });
4879
+ const CheckInScanner_vue_vue_type_style_index_0_scoped_ef426ef3_lang = "";
4880
+ const CheckInScanner = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-ef426ef3"]]);
4881
+ const _hoisted_1$2 = /* @__PURE__ */ createElementVNode(
4882
+ "h3",
4883
+ { align: "center" },
4884
+ "Presensi Berhasil!",
4885
+ -1
4886
+ /* HOISTED */
4887
+ );
4888
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
4889
+ __name: "CheckInScanSuccess",
4890
+ emits: ["close"],
4891
+ setup(__props) {
4892
+ const attendanceStore = useAttendanceStore();
4893
+ const { isScanned } = storeToRefs(attendanceStore);
4894
+ return (_ctx, _cache) => {
4895
+ return openBlock(), createBlock(unref(NeonModal), {
4896
+ "is-active": unref(isScanned),
4897
+ "onUpdate:isActive": _cache[1] || (_cache[1] = ($event) => isRef(isScanned) ? isScanned.value = $event : null),
4898
+ size: "lg",
4899
+ onClose: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("close"))
4900
+ }, {
4901
+ default: withCtx(() => [
4902
+ createVNode(unref(NeonSheet), {
4903
+ title: "Presensi",
4904
+ icon: "check",
4905
+ onClose: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
4906
+ }, {
4907
+ default: withCtx(() => [
4908
+ _hoisted_1$2
4909
+ ]),
4910
+ _: 1
4911
+ /* STABLE */
4912
+ })
4913
+ ]),
4914
+ _: 1
4915
+ /* STABLE */
4916
+ }, 8, ["is-active"]);
4917
+ };
4918
+ }
4919
+ });
4920
+ const __default__$6 = defineComponent({
4921
+ name: "CheckInCollection"
4922
+ });
4923
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
4924
+ ...__default__$6,
4925
+ setup(__props) {
4926
+ useCollection();
4927
+ return (_ctx, _cache) => {
4928
+ return openBlock(), createBlock(unref(NeonCollection), { class: "neu-checkIn-collection" }, {
4929
+ default: withCtx(() => [
4930
+ createVNode(unref(OfficeCollectionTable))
4931
+ ]),
4932
+ _: 1
4933
+ /* STABLE */
4934
+ });
4935
+ };
4936
+ }
4937
+ });
4938
+ const StaffModel = models$1.StaffModel;
4939
+ const __default__$5 = defineComponent({
4940
+ name: "StaffCollection"
4941
+ });
4942
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
4943
+ ...__default__$5,
4944
+ setup(__props) {
4945
+ useCollection();
4946
+ return (_ctx, _cache) => {
4947
+ return openBlock(), createBlock(unref(NeonCollection), { class: "neu-staff-collection" }, {
4948
+ default: withCtx(() => [
4949
+ createVNode(unref(OfficeCollectionTable))
4950
+ ]),
4951
+ _: 1
4952
+ /* STABLE */
4953
+ });
4954
+ };
4955
+ }
4956
+ });
4957
+ const _hoisted_1$1 = { class: "grid gap-4 sm:grid-cols-[3fr_1fr]" };
4958
+ const _hoisted_2$1 = { class: "grid gap-4 sm:grid-cols-2" };
4959
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
4960
+ __name: "StaffSingle",
4961
+ setup(__props) {
4962
+ const {
4963
+ fields,
4964
+ id,
4965
+ initialValues,
4966
+ values,
4967
+ isLoading,
4968
+ isChanged,
4969
+ isReady,
4970
+ isMain,
4971
+ isNew,
4972
+ saveOne,
4973
+ discardChanges
4974
+ } = useSingle();
4975
+ return (_ctx, _cache) => {
4976
+ return openBlock(), createBlock(unref(NeonSingle), { class: "neu-staff-single" }, {
4977
+ default: withCtx(() => [
4978
+ createVNode(unref(OfficeTabs), { "use-url": unref(isMain) }, {
4979
+ default: withCtx(() => [
4980
+ createVNode(unref(OfficeTab), {
4981
+ handle: "info",
4982
+ icon: "circle-info",
4983
+ title: "Info"
4984
+ }, {
4985
+ default: withCtx(() => [
4986
+ createVNode(unref(NeonForm), {
4987
+ handle: "info",
4988
+ "initial-values": unref(initialValues),
4989
+ "is-loading": unref(isLoading),
4990
+ "is-changed": unref(isChanged),
4991
+ "use-unsaved": "",
4992
+ onCancel: unref(discardChanges),
4993
+ onSubmit: unref(saveOne)
4994
+ }, {
4995
+ default: withCtx(() => [
4996
+ createElementVNode("div", _hoisted_1$1, [
4997
+ createVNode(unref(NeonField), mergeProps({
4998
+ modelValue: unref(values).name,
4999
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(values).name = $event)
5000
+ }, unref(fields).name), null, 16, ["modelValue"]),
5001
+ createVNode(unref(NeonField), mergeProps({
5002
+ modelValue: unref(values).nik,
5003
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(values).nik = $event)
5004
+ }, unref(fields).nik), null, 16, ["modelValue"])
5005
+ ]),
5006
+ createElementVNode("div", _hoisted_2$1, [
5007
+ createVNode(unref(NeonField), mergeProps({
5008
+ modelValue: unref(values).birthPlace,
5009
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(values).birthPlace = $event)
5010
+ }, unref(fields).birthPlace), null, 16, ["modelValue"]),
5011
+ createVNode(unref(NeonField), mergeProps({
5012
+ modelValue: unref(values).birthDate,
5013
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(values).birthDate = $event)
5014
+ }, unref(fields).birthDate), null, 16, ["modelValue"])
5015
+ ]),
5016
+ createVNode(unref(NeonField), mergeProps({
5017
+ modelValue: unref(values).image,
5018
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(values).image = $event)
5019
+ }, unref(fields).image), null, 16, ["modelValue"]),
5020
+ createVNode(unref(NeonField), mergeProps({
5021
+ modelValue: unref(values).note,
5022
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(values).note = $event)
5023
+ }, unref(fields).note), null, 16, ["modelValue"])
5024
+ ]),
5025
+ _: 1
5026
+ /* STABLE */
5027
+ }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
5028
+ ]),
5029
+ _: 1
5030
+ /* STABLE */
5031
+ }),
5032
+ createCommentVNode(' IDENTITAS\n <OfficeTab handle="identity" icon="circle-info" title="Identity">\n </OfficeTab> '),
5033
+ createCommentVNode(" CABANG "),
5034
+ createVNode(unref(OfficeTab), {
5035
+ handle: "branch",
5036
+ icon: "circle-info",
5037
+ title: "Cabang"
5038
+ }, {
5039
+ default: withCtx(() => [
5040
+ createVNode(unref(NeonForm), {
5041
+ handle: "branch",
5042
+ "initial-values": unref(initialValues),
5043
+ "is-loading": unref(isLoading),
5044
+ "is-changed": unref(isChanged),
5045
+ "use-unsaved": "",
5046
+ onCancel: unref(discardChanges),
5047
+ onSubmit: unref(saveOne)
5048
+ }, {
5049
+ default: withCtx(() => [
5050
+ createVNode(unref(OfficeRelation), {
5051
+ modelValue: unref(values),
5052
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => isRef(values) ? values.value = $event : null),
5053
+ field: unref(fields).branch
5054
+ }, null, 8, ["modelValue", "field"]),
5055
+ createVNode(unref(OfficeRelation), {
5056
+ modelValue: unref(values),
5057
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => isRef(values) ? values.value = $event : null),
5058
+ field: unref(fields).branches
5059
+ }, null, 8, ["modelValue", "field"])
5060
+ ]),
5061
+ _: 1
5062
+ /* STABLE */
5063
+ }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
5064
+ ]),
5065
+ _: 1
5066
+ /* STABLE */
5067
+ }),
5068
+ createCommentVNode(" KELUAR MASUK "),
5069
+ createVNode(unref(OfficeTab), {
5070
+ handle: "checkIn",
5071
+ icon: "person-to-door",
5072
+ title: "Keluar Masuk"
5073
+ }, {
5074
+ default: withCtx(() => [
5075
+ createCommentVNode(` <OfficeCollectionRelated
5076
+ definition="neu:tempat:checkIn"
5077
+ title="Keluar Masuk"
5078
+ description="Keluar masuk."
5079
+ :query="
5080
+ Query.define({
5081
+ filter: {
5082
+ handle: 'staffId',
5083
+ operator: 'eq',
5084
+ value: id,
5085
+ },
5086
+ })
5087
+ "
5088
+ /> `)
5089
+ ]),
5090
+ _: 1
5091
+ /* STABLE */
5092
+ })
5093
+ ]),
5094
+ _: 1
5095
+ /* STABLE */
5096
+ }, 8, ["use-url"])
5097
+ ]),
5098
+ _: 1
5099
+ /* STABLE */
5100
+ });
5101
+ };
5102
+ }
5103
+ });
5104
+ const StaffSingle_vue_vue_type_style_index_0_scoped_dbeb1998_lang = "";
5105
+ const StaffSingle = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-dbeb1998"]]);
5106
+ const SituationModel = models$1.SituationModel;
5107
+ const __default__$4 = defineComponent({ name: "SituationCollection" });
5108
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5109
+ ...__default__$4,
5110
+ setup(__props) {
5111
+ useCollection();
5112
+ return (_ctx, _cache) => {
5113
+ return openBlock(), createBlock(unref(NeonCollection), { class: "neu-situation-collection" }, {
5114
+ default: withCtx(() => [
5115
+ createVNode(unref(OfficeCollectionTable))
5116
+ ]),
5117
+ _: 1
5118
+ /* STABLE */
5119
+ });
5120
+ };
5121
+ }
5122
+ });
5123
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
5124
+ __name: "SituationSingle",
5125
+ setup(__props) {
5126
+ const {
5127
+ fields,
5128
+ id,
5129
+ initialValues,
5130
+ values,
5131
+ isNew,
5132
+ isLoading,
5133
+ isChanged,
5134
+ isReady,
5135
+ isMain,
5136
+ saveOne,
5137
+ discardChanges
5138
+ } = useSingle();
5139
+ return (_ctx, _cache) => {
5140
+ return openBlock(), createBlock(unref(NeonSingle), { class: "neu-situation-single" }, {
5141
+ default: withCtx(() => [
5142
+ createVNode(unref(OfficeTabs), { "use-url": unref(isMain) }, {
5143
+ default: withCtx(() => [
5144
+ createVNode(unref(OfficeTab), {
5145
+ handle: "info",
5146
+ icon: "circle-info",
5147
+ title: "Info"
5148
+ }, {
5149
+ default: withCtx(() => [
5150
+ createVNode(unref(NeonForm), {
5151
+ handle: "info",
5152
+ "initial-values": unref(initialValues),
5153
+ "is-loading": unref(isLoading),
5154
+ "is-changed": unref(isChanged),
5155
+ "use-unsaved": "",
5156
+ onCancel: unref(discardChanges),
5157
+ onSubmit: unref(saveOne)
5158
+ }, {
5159
+ default: withCtx(() => [
5160
+ createVNode(unref(NeonFields), {
5161
+ md: "grid-cols-4",
5162
+ title: "Situasi"
5163
+ }, {
5164
+ default: withCtx(() => [
5165
+ createVNode(unref(NeonField), mergeProps({
5166
+ modelValue: unref(values).situationStatus,
5167
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(values).situationStatus = $event)
5168
+ }, unref(fields).situationStatus), null, 16, ["modelValue"])
5169
+ ]),
5170
+ _: 1
5171
+ /* STABLE */
5172
+ }),
5173
+ createVNode(unref(OfficeRelation), {
5174
+ modelValue: unref(values),
5175
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(values) ? values.value = $event : null),
5176
+ field: unref(fields).branches
5177
+ }, null, 8, ["modelValue", "field"]),
5178
+ createVNode(unref(OfficeRelation), {
5179
+ modelValue: unref(values),
5180
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(values) ? values.value = $event : null),
5181
+ field: unref(fields).situationType
5182
+ }, null, 8, ["modelValue", "field"]),
5183
+ createVNode(unref(OfficeRelation), {
5184
+ modelValue: unref(values),
5185
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(values) ? values.value = $event : null),
5186
+ field: unref(fields).situationReportedBy
5187
+ }, null, 8, ["modelValue", "field"]),
5188
+ createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
5189
+ default: withCtx(() => [
5190
+ createVNode(unref(NeonField), mergeProps({
5191
+ modelValue: unref(values).situationDescription,
5192
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(values).situationDescription = $event)
5193
+ }, unref(fields).situationDescription), null, 16, ["modelValue"])
5194
+ ]),
5195
+ _: 1
5196
+ /* STABLE */
5197
+ }),
5198
+ createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
5199
+ default: withCtx(() => [
5200
+ createVNode(unref(NeonField), mergeProps({
5201
+ modelValue: unref(values).urgentSituationDate,
5202
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(values).urgentSituationDate = $event)
5203
+ }, unref(fields).urgentSituationDate), null, 16, ["modelValue"])
5204
+ ]),
5205
+ _: 1
5206
+ /* STABLE */
5207
+ }),
5208
+ createVNode(unref(OfficeRelation), {
5209
+ modelValue: unref(values),
5210
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => isRef(values) ? values.value = $event : null),
5211
+ field: unref(fields).situationRelatedBy
5212
+ }, null, 8, ["modelValue", "field"]),
5213
+ createVNode(unref(NeonFields), {
5214
+ md: "grid-cols-4",
5215
+ title: "Suportif"
5216
+ }, {
5217
+ default: withCtx(() => [
5218
+ createVNode(unref(NeonField), mergeProps({
5219
+ modelValue: unref(values).supportiveStatus,
5220
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(values).supportiveStatus = $event)
5221
+ }, unref(fields).supportiveStatus), null, 16, ["modelValue"])
5222
+ ]),
5223
+ _: 1
5224
+ /* STABLE */
5225
+ }),
5226
+ createVNode(unref(OfficeRelation), {
5227
+ modelValue: unref(values),
5228
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => isRef(values) ? values.value = $event : null),
5229
+ field: unref(fields).situationSupportedBy
5230
+ }, null, 8, ["modelValue", "field"]),
5231
+ createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
5232
+ default: withCtx(() => [
5233
+ createVNode(unref(NeonField), mergeProps({
5234
+ modelValue: unref(values).situationResponse,
5235
+ "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => unref(values).situationResponse = $event)
5236
+ }, unref(fields).situationResponse), null, 16, ["modelValue"])
5237
+ ]),
5238
+ _: 1
5239
+ /* STABLE */
5240
+ })
5241
+ ]),
5242
+ _: 1
5243
+ /* STABLE */
5244
+ }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
5245
+ ]),
5246
+ _: 1
5247
+ /* STABLE */
5248
+ })
5249
+ ]),
5250
+ _: 1
5251
+ /* STABLE */
5252
+ }, 8, ["use-url"])
5253
+ ]),
5254
+ _: 1
5255
+ /* STABLE */
5256
+ });
5257
+ };
5258
+ }
5259
+ });
5260
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
5261
+ __name: "SituationWork",
5262
+ setup(__props) {
5263
+ const {
5264
+ fields,
5265
+ id,
5266
+ initialValues,
5267
+ values,
5268
+ isNew,
5269
+ isLoading,
5270
+ isChanged,
5271
+ isReady,
5272
+ isMain,
5273
+ saveOne,
5274
+ discardChanges
5275
+ } = useSingle();
5276
+ return (_ctx, _cache) => {
5277
+ return openBlock(), createBlock(unref(NeonSingle), { class: "neu-situation-single" }, {
5278
+ default: withCtx(() => [
5279
+ createVNode(unref(OfficeTabs), { "use-url": unref(isMain) }, {
5280
+ default: withCtx(() => [
5281
+ createVNode(unref(OfficeTab), {
5282
+ handle: "info",
5283
+ icon: "circle-info",
5284
+ title: "Info"
5285
+ }, {
5286
+ default: withCtx(() => [
5287
+ createVNode(unref(NeonForm), {
5288
+ handle: "info",
5289
+ "initial-values": unref(initialValues),
5290
+ "is-loading": unref(isLoading),
5291
+ "is-changed": unref(isChanged),
5292
+ "use-unsaved": "",
5293
+ onCancel: unref(discardChanges),
5294
+ onSubmit: unref(saveOne)
5295
+ }, {
5296
+ default: withCtx(() => [
5297
+ createVNode(unref(NeonFields), {
5298
+ md: "grid-cols-4",
5299
+ title: "Situasi"
5300
+ }, {
5301
+ default: withCtx(() => [
5302
+ createVNode(unref(NeonField), mergeProps({
5303
+ modelValue: unref(values).situationStatus,
5304
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(values).situationStatus = $event)
5305
+ }, unref(fields).situationStatus, { "is-disabled": "" }), null, 16, ["modelValue"])
5306
+ ]),
5307
+ _: 1
5308
+ /* STABLE */
5309
+ }),
5310
+ createVNode(unref(OfficeRelation), {
5311
+ modelValue: unref(values),
5312
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(values) ? values.value = $event : null),
5313
+ field: unref(fields).branches
5314
+ }, null, 8, ["modelValue", "field"]),
5315
+ createVNode(unref(OfficeRelation), {
5316
+ modelValue: unref(values),
5317
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(values) ? values.value = $event : null),
5318
+ field: unref(fields).situationType
5319
+ }, null, 8, ["modelValue", "field"]),
5320
+ createVNode(unref(OfficeRelation), {
5321
+ modelValue: unref(values),
5322
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(values) ? values.value = $event : null),
5323
+ field: unref(fields).situationReportedBy,
5324
+ "is-disabled": ""
5325
+ }, null, 8, ["modelValue", "field"]),
5326
+ createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
5327
+ default: withCtx(() => [
5328
+ createVNode(unref(NeonField), mergeProps({
5329
+ modelValue: unref(values).situationDescription,
5330
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(values).situationDescription = $event)
5331
+ }, unref(fields).situationDescription), null, 16, ["modelValue"])
5332
+ ]),
5333
+ _: 1
5334
+ /* STABLE */
5335
+ }),
5336
+ createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
5337
+ default: withCtx(() => [
5338
+ createVNode(unref(NeonField), mergeProps({
5339
+ modelValue: unref(values).urgentSituationDate,
5340
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(values).urgentSituationDate = $event)
5341
+ }, unref(fields).urgentSituationDate), null, 16, ["modelValue"])
5342
+ ]),
5343
+ _: 1
5344
+ /* STABLE */
5345
+ }),
5346
+ createVNode(unref(OfficeRelation), {
5347
+ modelValue: unref(values),
5348
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => isRef(values) ? values.value = $event : null),
5349
+ field: unref(fields).situationRelatedBy
5350
+ }, null, 8, ["modelValue", "field"]),
5351
+ createVNode(unref(NeonFields), {
5352
+ md: "grid-cols-4",
5353
+ title: "Suportif"
5354
+ }, {
5355
+ default: withCtx(() => [
5356
+ createVNode(unref(NeonField), mergeProps({
5357
+ modelValue: unref(values).supportiveStatus,
5358
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(values).supportiveStatus = $event)
5359
+ }, unref(fields).supportiveStatus), null, 16, ["modelValue"])
5360
+ ]),
5361
+ _: 1
5362
+ /* STABLE */
5363
+ }),
5364
+ createVNode(unref(OfficeRelation), {
5365
+ modelValue: unref(values),
5366
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => isRef(values) ? values.value = $event : null),
5367
+ field: unref(fields).situationSupportedBy
5368
+ }, null, 8, ["modelValue", "field"]),
5369
+ createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
5370
+ default: withCtx(() => [
5371
+ createVNode(unref(NeonField), mergeProps({
5372
+ modelValue: unref(values).situationResponse,
5373
+ "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => unref(values).situationResponse = $event)
5374
+ }, unref(fields).situationResponse), null, 16, ["modelValue"])
5375
+ ]),
5376
+ _: 1
5377
+ /* STABLE */
5378
+ })
5379
+ ]),
5380
+ _: 1
5381
+ /* STABLE */
5382
+ }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
5383
+ ]),
5384
+ _: 1
5385
+ /* STABLE */
5386
+ })
5387
+ ]),
5388
+ _: 1
5389
+ /* STABLE */
5390
+ }, 8, ["use-url"])
5391
+ ]),
5392
+ _: 1
5393
+ /* STABLE */
5394
+ });
5395
+ };
5396
+ }
5397
+ });
5398
+ const __default__$3 = defineComponent({ name: "SituationSupportive" });
5399
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
5400
+ ...__default__$3,
5401
+ setup(__props) {
5402
+ const {
5403
+ fields,
5404
+ id,
5405
+ initialValues,
5406
+ values,
5407
+ isNew,
5408
+ isLoading,
5409
+ isChanged,
5410
+ isReady,
5411
+ isMain,
5412
+ saveOne,
5413
+ discardChanges
5414
+ } = useSingle();
5415
+ return (_ctx, _cache) => {
5416
+ return openBlock(), createBlock(unref(NeonSingle), { class: "neu-situation-single" }, {
5417
+ default: withCtx(() => [
5418
+ createVNode(unref(OfficeTabs), { "use-url": unref(isMain) }, {
5419
+ default: withCtx(() => [
5420
+ createVNode(unref(OfficeTab), {
5421
+ handle: "info",
5422
+ icon: "circle-info",
5423
+ title: "Info"
5424
+ }, {
5425
+ default: withCtx(() => [
5426
+ createVNode(unref(NeonForm), {
5427
+ handle: "info",
5428
+ "initial-values": unref(initialValues),
5429
+ "is-loading": unref(isLoading),
5430
+ "is-changed": unref(isChanged),
5431
+ "use-unsaved": "",
5432
+ onCancel: unref(discardChanges),
5433
+ onSubmit: unref(saveOne)
5434
+ }, {
5435
+ default: withCtx(() => [
5436
+ createVNode(unref(NeonFields), {
5437
+ md: "grid-cols-4",
5438
+ title: "Suportif"
5439
+ }, {
5440
+ default: withCtx(() => [
5441
+ createVNode(unref(NeonField), mergeProps({
5442
+ modelValue: unref(values).situationStatus,
5443
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(values).situationStatus = $event)
5444
+ }, unref(fields).situationStatus, { "is-disabled": "" }), null, 16, ["modelValue"])
5445
+ ]),
5446
+ _: 1
5447
+ /* STABLE */
5448
+ }),
5449
+ createVNode(unref(OfficeRelation), {
5450
+ modelValue: unref(values),
5451
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(values) ? values.value = $event : null),
5452
+ field: unref(fields).situationSupportedBy
5453
+ }, null, 8, ["modelValue", "field"]),
5454
+ createVNode(unref(NeonFields), {
5455
+ md: "grid-cols-4",
5456
+ title: "Situasi"
5457
+ }, {
5458
+ default: withCtx(() => [
5459
+ createVNode(unref(NeonField), mergeProps({
5460
+ modelValue: unref(values).situationResponse,
5461
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(values).situationResponse = $event)
5462
+ }, unref(fields).situationResponse), null, 16, ["modelValue"])
5463
+ ]),
5464
+ _: 1
5465
+ /* STABLE */
5466
+ }),
5467
+ createVNode(unref(OfficeRelation), {
5468
+ modelValue: unref(values),
5469
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(values) ? values.value = $event : null),
5470
+ field: unref(fields).branches,
5471
+ "is-disabled": ""
5472
+ }, null, 8, ["modelValue", "field"]),
5473
+ createVNode(unref(OfficeRelation), {
5474
+ modelValue: unref(values),
5475
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(values) ? values.value = $event : null),
5476
+ field: unref(fields).situationType,
5477
+ "is-disabled": ""
5478
+ }, null, 8, ["modelValue", "field"]),
5479
+ createVNode(unref(OfficeRelation), {
5480
+ modelValue: unref(values),
5481
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => isRef(values) ? values.value = $event : null),
5482
+ field: unref(fields).situationReportedBy,
5483
+ "is-disabled": ""
5484
+ }, null, 8, ["modelValue", "field"]),
5485
+ createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
5486
+ default: withCtx(() => [
5487
+ createVNode(unref(NeonField), mergeProps({
5488
+ modelValue: unref(values).situationDescription,
5489
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => unref(values).situationDescription = $event)
5490
+ }, unref(fields).situationDescription, { "is-disabled": "" }), null, 16, ["modelValue"])
5491
+ ]),
5492
+ _: 1
5493
+ /* STABLE */
5494
+ }),
5495
+ createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
5496
+ default: withCtx(() => [
5497
+ createVNode(unref(NeonField), mergeProps({
5498
+ modelValue: unref(values).urgentSituationDate,
5499
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(values).urgentSituationDate = $event)
5500
+ }, unref(fields).urgentSituationDate, { "is-disabled": "" }), null, 16, ["modelValue"])
5501
+ ]),
5502
+ _: 1
5503
+ /* STABLE */
5504
+ }),
5505
+ createVNode(unref(OfficeRelation), {
5506
+ modelValue: unref(values),
5507
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => isRef(values) ? values.value = $event : null),
5508
+ field: unref(fields).situationRelatedBy,
5509
+ "is-disabled": ""
5510
+ }, null, 8, ["modelValue", "field"])
5511
+ ]),
5512
+ _: 1
5513
+ /* STABLE */
5514
+ }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
5515
+ ]),
5516
+ _: 1
5517
+ /* STABLE */
5518
+ })
5519
+ ]),
5520
+ _: 1
5521
+ /* STABLE */
5522
+ }, 8, ["use-url"])
5523
+ ]),
5524
+ _: 1
5525
+ /* STABLE */
5526
+ });
5527
+ };
5528
+ }
5529
+ });
5530
+ const SituationTypeModel = models$1.SituationTypeModel;
5531
+ const __default__$2 = defineComponent({ name: "SituationTypeCollection" });
5532
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
5533
+ ...__default__$2,
5534
+ setup(__props) {
5535
+ useCollection();
5536
+ return (_ctx, _cache) => {
5537
+ return openBlock(), createBlock(unref(NeonCollection), { class: "neu-situationType-collection" }, {
5538
+ default: withCtx(() => [
5539
+ createVNode(unref(OfficeCollectionTable))
5540
+ ]),
5541
+ _: 1
5542
+ /* STABLE */
4181
5543
  });
4182
- return m;
4183
- },
4184
- pause() {
4185
- P.value = true;
4186
- },
4187
- resume() {
4188
- P.value = false;
4189
- }
4190
- };
4191
- return m;
4192
- }
4193
- function useClientHandle() {
4194
- var e2 = useClient();
4195
- var u = [];
4196
- onBeforeUnmount(() => {
4197
- var e3;
4198
- while (e3 = u.shift()) {
4199
- e3();
4200
- }
4201
- });
4202
- var r2 = {
4203
- client: e2.value,
4204
- useQuery: (r3) => callUseQuery(r3, e2, u),
4205
- useSubscription: (r3, a) => callUseSubscription(r3, a, e2, u),
4206
- useMutation: (u2) => callUseMutation(u2, e2)
4207
- };
4208
- if ("production" !== process.env.NODE_ENV) {
4209
- onMounted(() => {
4210
- Object.assign(r2, {
4211
- useQuery(r3) {
4212
- if ("production" !== process.env.NODE_ENV && !getCurrentInstance()) {
4213
- throw new Error("`handle.useQuery()` should only be called in the `setup()` or a lifecycle hook.");
4214
- }
4215
- return callUseQuery(r3, e2, u);
4216
- },
4217
- useSubscription(r3, a) {
4218
- if ("production" !== process.env.NODE_ENV && !getCurrentInstance()) {
4219
- throw new Error("`handle.useSubscription()` should only be called in the `setup()` or a lifecycle hook.");
4220
- }
4221
- return callUseSubscription(r3, a, e2, u);
4222
- }
5544
+ };
5545
+ }
5546
+ });
5547
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
5548
+ __name: "SituationTypeSingle",
5549
+ setup(__props) {
5550
+ const {
5551
+ fields,
5552
+ id,
5553
+ initialValues,
5554
+ values,
5555
+ isNew,
5556
+ isLoading,
5557
+ isChanged,
5558
+ isReady,
5559
+ isMain,
5560
+ saveOne,
5561
+ discardChanges
5562
+ } = useSingle();
5563
+ return (_ctx, _cache) => {
5564
+ return openBlock(), createBlock(unref(NeonSingle), { class: "neu-situation-type-single" }, {
5565
+ default: withCtx(() => [
5566
+ createVNode(unref(OfficeTabs), { "use-url": unref(isMain) }, {
5567
+ default: withCtx(() => [
5568
+ createVNode(unref(OfficeTab), {
5569
+ handle: "info",
5570
+ icon: "circle-info",
5571
+ title: "Info"
5572
+ }, {
5573
+ default: withCtx(() => [
5574
+ createVNode(unref(NeonForm), {
5575
+ handle: "info",
5576
+ "initial-values": unref(initialValues),
5577
+ "is-loading": unref(isLoading),
5578
+ "is-changed": unref(isChanged),
5579
+ "use-unsaved": "",
5580
+ onCancel: unref(discardChanges),
5581
+ onSubmit: unref(saveOne)
5582
+ }, {
5583
+ default: withCtx(() => [
5584
+ createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
5585
+ default: withCtx(() => [
5586
+ createVNode(unref(NeonField), mergeProps({
5587
+ modelValue: unref(values).situationTypeName,
5588
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(values).situationTypeName = $event)
5589
+ }, unref(fields).situationTypeName), null, 16, ["modelValue"])
5590
+ ]),
5591
+ _: 1
5592
+ /* STABLE */
5593
+ }),
5594
+ createVNode(unref(OfficeRelation), {
5595
+ modelValue: unref(values),
5596
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(values) ? values.value = $event : null),
5597
+ field: unref(fields).branches
5598
+ }, null, 8, ["modelValue", "field"])
5599
+ ]),
5600
+ _: 1
5601
+ /* STABLE */
5602
+ }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
5603
+ ]),
5604
+ _: 1
5605
+ /* STABLE */
5606
+ })
5607
+ ]),
5608
+ _: 1
5609
+ /* STABLE */
5610
+ }, 8, ["use-url"])
5611
+ ]),
5612
+ _: 1
5613
+ /* STABLE */
4223
5614
  });
4224
- });
5615
+ };
4225
5616
  }
4226
- return r2;
4227
- }
5617
+ });
5618
+ const TaskModel = models$1.TaskModel;
5619
+ const _hoisted_1 = { key: 0 };
5620
+ const _hoisted_2 = { key: 1 };
4228
5621
  const __default__$1 = defineComponent({ name: "TaskWorkButton" });
4229
5622
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4230
5623
  ...__default__$1,
4231
5624
  setup(__props) {
4232
- useClientHandle();
4233
- const startTaskWork = () => {
4234
- console.info("Start work");
5625
+ const { client } = useClientHandle();
5626
+ const {
5627
+ fields,
5628
+ id,
5629
+ initialValues,
5630
+ values,
5631
+ isNew,
5632
+ isLoading,
5633
+ isChanged,
5634
+ isReady,
5635
+ isMain,
5636
+ saveOne,
5637
+ discardChanges
5638
+ } = useSingle();
5639
+ const onHandleTaskWork = ref({
5640
+ onStartTaskWorking: true,
5641
+ onFinishedTaskWorking: false,
5642
+ onFinishedDisabledTaskWorking: false
5643
+ });
5644
+ watch(
5645
+ () => [values.value.resultAssignment],
5646
+ ([resultAssignment]) => {
5647
+ switch (true) {
5648
+ case (resultAssignment === null || resultAssignment === void 0):
5649
+ onHandleTaskWork.value.onStartTaskWorking = false;
5650
+ onHandleTaskWork.value.onFinishedTaskWorking = true;
5651
+ break;
5652
+ case (resultAssignment !== null || resultAssignment !== void 0):
5653
+ onHandleTaskWork.value.onStartTaskWorking = false;
5654
+ onHandleTaskWork.value.onFinishedTaskWorking = true;
5655
+ onHandleTaskWork.value.onFinishedDisabledTaskWorking = true;
5656
+ break;
5657
+ default:
5658
+ onHandleTaskWork.value.onStartTaskWorking = true;
5659
+ onHandleTaskWork.value.onFinishedTaskWorking = false;
5660
+ break;
5661
+ }
5662
+ },
5663
+ {
5664
+ immediate: true
5665
+ }
5666
+ );
5667
+ const onClickHandlerStartTaskWork = async () => {
5668
+ var _a, _b;
5669
+ onHandleTaskWork.value.onStartTaskWorking = false;
5670
+ onHandleTaskWork.value.onFinishedTaskWorking = true;
5671
+ try {
5672
+ const responseStartTaskWork = await client.mutation(GraphUtil.executeOne(models$1.TaskModel, {}), {
5673
+ action: "startTaskWork",
5674
+ input: {
5675
+ estimatedRealizedAssignmentStart: Date.now(),
5676
+ taskId: (_a = values.value) == null ? void 0 : _a.id
5677
+ }
5678
+ }).toPromise();
5679
+ const wrapper = (_b = responseStartTaskWork.data) == null ? void 0 : _b.executeStartTaskWork;
5680
+ window.location.reload();
5681
+ } catch (error) {
5682
+ }
5683
+ };
5684
+ const onClickHandlerFinishTaskWork = async () => {
5685
+ var _a, _b;
5686
+ onHandleTaskWork.value.onStartTaskWorking = false;
5687
+ onHandleTaskWork.value.onFinishedTaskWorking = true;
5688
+ onHandleTaskWork.value.onFinishedDisabledTaskWorking = true;
5689
+ try {
5690
+ const responseFinishedTaskWork = await client.mutation(GraphUtil.executeOne(models$1.TaskModel, {}), {
5691
+ action: "finishTaskWork",
5692
+ input: {
5693
+ estimatedRealizedAssignmentEnd: Date.now(),
5694
+ taskId: (_a = values.value) == null ? void 0 : _a.id
5695
+ }
5696
+ }).toPromise();
5697
+ const wrapper = (_b = responseFinishedTaskWork.data) == null ? void 0 : _b.executeStartTaskWork;
5698
+ window.location.reload();
5699
+ } catch (error) {
5700
+ }
4235
5701
  };
4236
5702
  return (_ctx, _cache) => {
4237
- return openBlock(), createBlock(unref(NeonButton), {
4238
- "is-rounded": true,
4239
- size: "sm",
4240
- color: "warning",
4241
- "icon-left": "play",
4242
- label: "Mulai",
4243
- onClick: startTaskWork
4244
- });
5703
+ return openBlock(), createElementBlock(
5704
+ Fragment,
5705
+ null,
5706
+ [
5707
+ onHandleTaskWork.value.onStartTaskWorking ? (openBlock(), createElementBlock("div", _hoisted_1, [
5708
+ createVNode(unref(NeonButton), {
5709
+ "is-rounded": true,
5710
+ size: "sm",
5711
+ color: "warning",
5712
+ "icon-left": "play",
5713
+ label: "Mulai",
5714
+ onClick: onClickHandlerStartTaskWork
5715
+ })
5716
+ ])) : createCommentVNode("v-if", true),
5717
+ onHandleTaskWork.value.onFinishedTaskWorking ? (openBlock(), createElementBlock("div", _hoisted_2, [
5718
+ createVNode(unref(NeonButton), {
5719
+ "is-rounded": true,
5720
+ size: "sm",
5721
+ color: "success",
5722
+ "icon-left": "check",
5723
+ label: "Selesai",
5724
+ "is-disabled": onHandleTaskWork.value.onFinishedDisabledTaskWorking,
5725
+ onClick: onClickHandlerFinishTaskWork
5726
+ }, null, 8, ["is-disabled"])
5727
+ ])) : createCommentVNode("v-if", true)
5728
+ ],
5729
+ 64
5730
+ /* STABLE_FRAGMENT */
5731
+ );
4245
5732
  };
4246
5733
  }
4247
5734
  });
@@ -4720,6 +6207,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4720
6207
  });
4721
6208
  const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4722
6209
  __proto__: null,
6210
+ CheckInAccess,
6211
+ CheckInCollection: _sfc_main$c,
6212
+ CheckInModel,
6213
+ CheckInPresenceCollection,
6214
+ CheckInScanError: _sfc_main$f,
6215
+ CheckInScanSuccess: _sfc_main$d,
6216
+ CheckInScanner,
6217
+ CheckInSingle,
4723
6218
  SituationCollection: _sfc_main$9,
4724
6219
  SituationModel,
4725
6220
  SituationSingle: _sfc_main$8,
@@ -4736,11 +6231,11 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
4736
6231
  TaskSingle: _sfc_main$1,
4737
6232
  TaskWork: _sfc_main,
4738
6233
  TaskWorkButton: _sfc_main$3,
4739
- XxxButton: _sfc_main$c
6234
+ XxxButton: _sfc_main$j
4740
6235
  }, Symbol.toStringTag, { value: "Module" }));
4741
6236
  function registerComponents(app) {
4742
6237
  Object.entries(components).forEach(([name, component]) => {
4743
- ComponentUtil.register(app, name, component);
6238
+ ComponentUtil$1.register(app, name, component);
4744
6239
  });
4745
6240
  }
4746
6241
  const graphql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -4751,7 +6246,118 @@ const OperasionalInterfacesPlugin = {
4751
6246
  registerComponents(app);
4752
6247
  }
4753
6248
  };
6249
+ const createWorker = () => new Worker(URL.createObjectURL(new Blob([`class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}
6250
+ class A{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,b){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}
6251
+ class ba{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,a-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,
6252
+ this.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var B,C=B||(B={});C.Numeric="numeric";C.Alphanumeric="alphanumeric";C.Byte="byte";C.Kanji="kanji";C.ECI="eci";C.StructuredAppend="structuredappend";var D,E=D||(D={});E[E.Terminator=0]="Terminator";E[E.Numeric=1]="Numeric";E[E.Alphanumeric=2]="Alphanumeric";E[E.Byte=4]="Byte";E[E.Kanji=8]="Kanji";E[E.ECI=7]="ECI";E[E.StructuredAppend=3]="StructuredAppend";let F="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");
6253
+ function ca(a,b){let c=[],d="";b=a.readBits([8,16,16][b]);for(let e=0;e<b;e++){let f=a.readBits(8);c.push(f)}try{d+=decodeURIComponent(c.map(e=>\`%\${("0"+e.toString(16)).substr(-2)}\`).join(""))}catch(e){}return{bytes:c,text:d}}
6254
+ function da(a,b){a=new ba(a);let c=9>=b?0:26>=b?1:2;for(b={text:"",bytes:[],chunks:[],version:b};4<=a.available();){var d=a.readBits(4);if(d===D.Terminator)return b;if(d===D.ECI)0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(7)}):0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(14)}):0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(21)}):b.chunks.push({type:B.ECI,assignmentNumber:-1});else if(d===D.Numeric){var e=a,f=[];d="";for(var g=
6255
+ e.readBits([10,12,14][c]);3<=g;){var h=e.readBits(10);if(1E3<=h)throw Error("Invalid numeric value above 999");var k=Math.floor(h/100),m=Math.floor(h/10)%10;h%=10;f.push(48+k,48+m,48+h);d+=k.toString()+m.toString()+h.toString();g-=3}if(2===g){g=e.readBits(7);if(100<=g)throw Error("Invalid numeric value above 99");e=Math.floor(g/10);g%=10;f.push(48+e,48+g);d+=e.toString()+g.toString()}else if(1===g){e=e.readBits(4);if(10<=e)throw Error("Invalid numeric value above 9");f.push(48+e);d+=e.toString()}b.text+=
6256
+ d;b.bytes.push(...f);b.chunks.push({type:B.Numeric,text:d})}else if(d===D.Alphanumeric){e=a;f=[];d="";for(g=e.readBits([9,11,13][c]);2<=g;)m=e.readBits(11),k=Math.floor(m/45),m%=45,f.push(F[k].charCodeAt(0),F[m].charCodeAt(0)),d+=F[k]+F[m],g-=2;1===g&&(e=e.readBits(6),f.push(F[e].charCodeAt(0)),d+=F[e]);b.text+=d;b.bytes.push(...f);b.chunks.push({type:B.Alphanumeric,text:d})}else if(d===D.Byte)d=ca(a,c),b.text+=d.text,b.bytes.push(...d.bytes),b.chunks.push({type:B.Byte,bytes:d.bytes,text:d.text});
6257
+ else if(d===D.Kanji){f=a;d=[];e=f.readBits([8,10,12][c]);for(g=0;g<e;g++)k=f.readBits(13),k=Math.floor(k/192)<<8|k%192,k=7936>k?k+33088:k+49472,d.push(k>>8,k&255);f=(new TextDecoder("shift-jis")).decode(Uint8Array.from(d));b.text+=f;b.bytes.push(...d);b.chunks.push({type:B.Kanji,bytes:d,text:f})}else d===D.StructuredAppend&&b.chunks.push({type:B.StructuredAppend,currentSequence:a.readBits(4),totalSequence:a.readBits(4),parity:a.readBits(8)})}if(0===a.available()||0===a.readBits(a.available()))return b}
6258
+ class G{constructor(a,b){if(0===b.length)throw Error("No coefficients.");this.field=a;let c=b.length;if(1<c&&0===b[0]){let d=1;for(;d<c&&0===b[d];)d++;if(d===c)this.coefficients=a.zero.coefficients;else for(this.coefficients=new Uint8ClampedArray(c-d),a=0;a<this.coefficients.length;a++)this.coefficients[a]=b[d+a]}else this.coefficients=b}degree(){return this.coefficients.length-1}isZero(){return 0===this.coefficients[0]}getCoefficient(a){return this.coefficients[this.coefficients.length-1-a]}addOrSubtract(a){if(this.isZero())return a;
6259
+ if(a.isZero())return this;let b=this.coefficients;a=a.coefficients;b.length>a.length&&([b,a]=[a,b]);let c=new Uint8ClampedArray(a.length),d=a.length-b.length;for(var e=0;e<d;e++)c[e]=a[e];for(e=d;e<a.length;e++)c[e]=b[e-d]^a[e];return new G(this.field,c)}multiply(a){if(0===a)return this.field.zero;if(1===a)return this;let b=this.coefficients.length,c=new Uint8ClampedArray(b);for(let d=0;d<b;d++)c[d]=this.field.multiply(this.coefficients[d],a);return new G(this.field,c)}multiplyPoly(a){if(this.isZero()||
6260
+ a.isZero())return this.field.zero;let b=this.coefficients,c=b.length;a=a.coefficients;let d=a.length,e=new Uint8ClampedArray(c+d-1);for(let f=0;f<c;f++){let g=b[f];for(let h=0;h<d;h++)e[f+h]=H(e[f+h],this.field.multiply(g,a[h]))}return new G(this.field,e)}multiplyByMonomial(a,b){if(0>a)throw Error("Invalid degree less than 0");if(0===b)return this.field.zero;let c=this.coefficients.length;a=new Uint8ClampedArray(c+a);for(let d=0;d<c;d++)a[d]=this.field.multiply(this.coefficients[d],b);return new G(this.field,
6261
+ a)}evaluateAt(a){let b=0;if(0===a)return this.getCoefficient(0);let c=this.coefficients.length;if(1===a)return this.coefficients.forEach(d=>{b^=d}),b;b=this.coefficients[0];for(let d=1;d<c;d++)b=H(this.field.multiply(a,b),this.coefficients[d]);return b}}function H(a,b){return a^b}
6262
+ class ea{constructor(a,b,c){this.primitive=a;this.size=b;this.generatorBase=c;this.expTable=Array(this.size);this.logTable=Array(this.size);a=1;for(b=0;b<this.size;b++)this.expTable[b]=a,a*=2,a>=this.size&&(a=(a^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new G(this,Uint8ClampedArray.from([0]));this.one=new G(this,Uint8ClampedArray.from([1]))}multiply(a,b){return 0===a||0===b?0:this.expTable[(this.logTable[a]+this.logTable[b])%(this.size-1)]}inverse(a){if(0===
6263
+ a)throw Error("Can't invert 0");return this.expTable[this.size-this.logTable[a]-1]}buildMonomial(a,b){if(0>a)throw Error("Invalid monomial degree less than 0");if(0===b)return this.zero;a=new Uint8ClampedArray(a+1);a[0]=b;return new G(this,a)}log(a){if(0===a)throw Error("Can't take log(0)");return this.logTable[a]}exp(a){return this.expTable[a]}}
6264
+ function fa(a,b,c,d){b.degree()<c.degree()&&([b,c]=[c,b]);let e=a.zero;for(var f=a.one;c.degree()>=d/2;){var g=b;let h=e;b=c;e=f;if(b.isZero())return null;c=g;f=a.zero;g=b.getCoefficient(b.degree());for(g=a.inverse(g);c.degree()>=b.degree()&&!c.isZero();){let k=c.degree()-b.degree(),m=a.multiply(c.getCoefficient(c.degree()),g);f=f.addOrSubtract(a.buildMonomial(k,m));c=c.addOrSubtract(b.multiplyByMonomial(k,m))}f=f.multiplyPoly(e).addOrSubtract(h);if(c.degree()>=b.degree())return null}d=f.getCoefficient(0);
6265
+ if(0===d)return null;a=a.inverse(d);return[f.multiply(a),c.multiply(a)]}
6266
+ function ha(a,b){let c=new Uint8ClampedArray(a.length);c.set(a);a=new ea(285,256,0);var d=new G(a,c),e=new Uint8ClampedArray(b),f=!1;for(var g=0;g<b;g++){var h=d.evaluateAt(a.exp(g+a.generatorBase));e[e.length-1-g]=h;0!==h&&(f=!0)}if(!f)return c;d=new G(a,e);d=fa(a,a.buildMonomial(b,1),d,b);if(null===d)return null;b=d[0];g=b.degree();if(1===g)b=[b.getCoefficient(1)];else{e=Array(g);f=0;for(h=1;h<a.size&&f<g;h++)0===b.evaluateAt(h)&&(e[f]=a.inverse(h),f++);b=f!==g?null:e}if(null==b)return null;e=d[1];
6267
+ f=b.length;d=Array(f);for(g=0;g<f;g++){h=a.inverse(b[g]);let k=1;for(let m=0;m<f;m++)g!==m&&(k=a.multiply(k,H(1,a.multiply(b[m],h))));d[g]=a.multiply(e.evaluateAt(h),a.inverse(k));0!==a.generatorBase&&(d[g]=a.multiply(d[g],h))}for(e=0;e<b.length;e++){f=c.length-1-a.log(b[e]);if(0>f)return null;c[f]^=d[e]}return c}
6268
+ let I=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,
6269
+ dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,
6270
+ ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},
6271
+ {infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,
6272
+ 34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,
6273
+ ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},
6274
+ {numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},
6275
+ {numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,
6276
+ dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,
6277
+ dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},
6278
+ {ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},
6279
+ {ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},
6280
+ {numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,
6281
+ ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,
6282
+ 74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,
6283
+ versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,
6284
+ dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,
6285
+ dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},
6286
+ {ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},
6287
+ {numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},
6288
+ {numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},
6289
+ {numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},
6290
+ {numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,
6291
+ ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,
6292
+ dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,
6293
+ dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},
6294
+ {ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},
6295
+ {numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,
6296
+ ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,
6297
+ 26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},
6298
+ {infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},
6299
+ {numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,
6300
+ dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},
6301
+ {ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,
6302
+ dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},
6303
+ {ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,
6304
+ dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},
6305
+ {ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,
6306
+ dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],
6307
+ errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,
6308
+ versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},
6309
+ {numBlocks:61,dataCodewordsPerBlock:16}]}]}];function J(a,b){a^=b;for(b=0;a;)b++,a&=a-1;return b}function K(a,b){return b<<1|a}
6310
+ let ia=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,
6311
+ dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,
6312
+ formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,
6313
+ dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],ja=[a=>0===(a.y+a.x)%2,a=>0===a.y%2,a=>0===a.x%3,a=>0===(a.y+a.x)%3,a=>0===(Math.floor(a.y/2)+Math.floor(a.x/3))%2,a=>0===a.x*a.y%
6314
+ 2+a.x*a.y%3,a=>0===(a.y*a.x%2+a.y*a.x%3)%2,a=>0===((a.y+a.x)%2+a.y*a.x%3)%2];
6315
+ function ka(a,b,c){c=ja[c.dataMask];let d=a.height;var e=17+4*b.versionNumber;let f=x.createEmpty(e,e);f.setRegion(0,0,9,9,!0);f.setRegion(e-8,0,8,9,!0);f.setRegion(0,e-8,9,8,!0);for(var g of b.alignmentPatternCenters)for(var h of b.alignmentPatternCenters)6===g&&6===h||6===g&&h===e-7||g===e-7&&6===h||f.setRegion(g-2,h-2,5,5,!0);f.setRegion(6,9,1,e-17,!0);f.setRegion(9,6,e-17,1,!0);6<b.versionNumber&&(f.setRegion(e-11,0,3,6,!0),f.setRegion(0,e-11,6,3,!0));b=[];h=g=0;e=!0;for(let k=d-1;0<k;k-=2){6===
6316
+ k&&k--;for(let m=0;m<d;m++){let l=e?d-1-m:m;for(let n=0;2>n;n++){let q=k-n;if(!f.get(q,l)){h++;let r=a.get(q,l);c({y:l,x:q})&&(r=!r);g=g<<1|r;8===h&&(b.push(g),g=h=0)}}}e=!e}return b}
6317
+ function la(a){var b=a.height,c=Math.floor((b-17)/4);if(6>=c)return I[c-1];c=0;for(var d=5;0<=d;d--)for(var e=b-9;e>=b-11;e--)c=K(a.get(e,d),c);d=0;for(e=5;0<=e;e--)for(let g=b-9;g>=b-11;g--)d=K(a.get(e,g),d);a=Infinity;let f;for(let g of I){if(g.infoBits===c||g.infoBits===d)return g;b=J(c,g.infoBits);b<a&&(f=g,a=b);b=J(d,g.infoBits);b<a&&(f=g,a=b)}if(3>=a)return f}
6318
+ function ma(a){let b=0;for(var c=0;8>=c;c++)6!==c&&(b=K(a.get(c,8),b));for(c=7;0<=c;c--)6!==c&&(b=K(a.get(8,c),b));var d=a.height;c=0;for(var e=d-1;e>=d-7;e--)c=K(a.get(8,e),c);for(e=d-8;e<d;e++)c=K(a.get(e,8),c);a=Infinity;d=null;for(let {bits:f,formatInfo:g}of ia){if(f===b||f===c)return g;e=J(b,f);e<a&&(d=g,a=e);b!==c&&(e=J(c,f),e<a&&(d=g,a=e))}return 3>=a?d:null}
6319
+ function na(a,b,c){let d=b.errorCorrectionLevels[c],e=[],f=0;d.ecBlocks.forEach(h=>{for(let k=0;k<h.numBlocks;k++)e.push({numDataCodewords:h.dataCodewordsPerBlock,codewords:[]}),f+=h.dataCodewordsPerBlock+d.ecCodewordsPerBlock});if(a.length<f)return null;a=a.slice(0,f);b=d.ecBlocks[0].dataCodewordsPerBlock;for(c=0;c<b;c++)for(var g of e)g.codewords.push(a.shift());if(1<d.ecBlocks.length)for(g=d.ecBlocks[0].numBlocks,b=d.ecBlocks[1].numBlocks,c=0;c<b;c++)e[g+c].codewords.push(a.shift());for(;0<a.length;)for(let h of e)h.codewords.push(a.shift());
6320
+ return e}function L(a){let b=la(a);if(!b)return null;var c=ma(a);if(!c)return null;a=ka(a,b,c);var d=na(a,b,c.errorCorrectionLevel);if(!d)return null;c=d.reduce((e,f)=>e+f.numDataCodewords,0);c=new Uint8ClampedArray(c);a=0;for(let e of d){d=ha(e.codewords,e.codewords.length-e.numDataCodewords);if(!d)return null;for(let f=0;f<e.numDataCodewords;f++)c[a++]=d[f]}try{return da(c,b.versionNumber)}catch(e){return null}}
6321
+ function M(a,b,c,d){var e=a.x-b.x+c.x-d.x;let f=a.y-b.y+c.y-d.y;if(0===e&&0===f)return{a11:b.x-a.x,a12:b.y-a.y,a13:0,a21:c.x-b.x,a22:c.y-b.y,a23:0,a31:a.x,a32:a.y,a33:1};let g=b.x-c.x;var h=d.x-c.x;let k=b.y-c.y,m=d.y-c.y;c=g*m-h*k;h=(e*m-h*f)/c;e=(g*f-e*k)/c;return{a11:b.x-a.x+h*b.x,a12:b.y-a.y+h*b.y,a13:h,a21:d.x-a.x+e*d.x,a22:d.y-a.y+e*d.y,a23:e,a31:a.x,a32:a.y,a33:1}}
6322
+ function oa(a,b,c,d){a=M(a,b,c,d);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}
6323
+ function pa(a,b){var c=oa({x:3.5,y:3.5},{x:b.dimension-3.5,y:3.5},{x:b.dimension-6.5,y:b.dimension-6.5},{x:3.5,y:b.dimension-3.5}),d=M(b.topLeft,b.topRight,b.alignmentPattern,b.bottomLeft),e=d.a11*c.a11+d.a21*c.a12+d.a31*c.a13,f=d.a12*c.a11+d.a22*c.a12+d.a32*c.a13,g=d.a13*c.a11+d.a23*c.a12+d.a33*c.a13,h=d.a11*c.a21+d.a21*c.a22+d.a31*c.a23,k=d.a12*c.a21+d.a22*c.a22+d.a32*c.a23,m=d.a13*c.a21+d.a23*c.a22+d.a33*c.a23,l=d.a11*c.a31+d.a21*c.a32+d.a31*c.a33,n=d.a12*c.a31+d.a22*c.a32+d.a32*c.a33,q=d.a13*
6324
+ c.a31+d.a23*c.a32+d.a33*c.a33;c=x.createEmpty(b.dimension,b.dimension);d=(r,u)=>{const p=g*r+m*u+q;return{x:(e*r+h*u+l)/p,y:(f*r+k*u+n)/p}};for(let r=0;r<b.dimension;r++)for(let u=0;u<b.dimension;u++){let p=d(u+.5,r+.5);c.set(u,r,a.get(Math.floor(p.x),Math.floor(p.y)))}return{matrix:c,mappingFunction:d}}let N=(a,b)=>Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2));function O(a){return a.reduce((b,c)=>b+c)}
6325
+ function qa(a,b,c){let d=N(a,b),e=N(b,c),f=N(a,c),g,h,k;e>=d&&e>=f?[g,h,k]=[b,a,c]:f>=e&&f>=d?[g,h,k]=[a,b,c]:[g,h,k]=[a,c,b];0>(k.x-h.x)*(g.y-h.y)-(k.y-h.y)*(g.x-h.x)&&([g,k]=[k,g]);return{bottomLeft:g,topLeft:h,topRight:k}}
6326
+ function ra(a,b,c,d){d=(O(P(a,c,d,5))/7+O(P(a,b,d,5))/7+O(P(c,a,d,5))/7+O(P(b,a,d,5))/7)/4;if(1>d)throw Error("Invalid module size");b=Math.round(N(a,b)/d);a=Math.round(N(a,c)/d);a=Math.floor((b+a)/2)+7;switch(a%4){case 0:a++;break;case 2:a--}return{dimension:a,moduleSize:d}}
6327
+ function Q(a,b,c,d){let e=[{x:Math.floor(a.x),y:Math.floor(a.y)}];var f=Math.abs(b.y-a.y)>Math.abs(b.x-a.x);if(f){var g=Math.floor(a.y);var h=Math.floor(a.x);a=Math.floor(b.y);b=Math.floor(b.x)}else g=Math.floor(a.x),h=Math.floor(a.y),a=Math.floor(b.x),b=Math.floor(b.y);let k=Math.abs(a-g),m=Math.abs(b-h),l=Math.floor(-k/2),n=g<a?1:-1,q=h<b?1:-1,r=!0;for(let u=g,p=h;u!==a+n;u+=n){g=f?p:u;h=f?u:p;if(c.get(g,h)!==r&&(r=!r,e.push({x:g,y:h}),e.length===d+1))break;l+=m;if(0<l){if(p===b)break;p+=q;l-=k}}c=
6328
+ [];for(f=0;f<d;f++)e[f]&&e[f+1]?c.push(N(e[f],e[f+1])):c.push(0);return c}function P(a,b,c,d){let e=b.y-a.y,f=b.x-a.x;b=Q(a,b,c,Math.ceil(d/2));a=Q(a,{x:a.x-f,y:a.y-e},c,Math.ceil(d/2));c=b.shift()+a.shift()-1;return a.concat(c).concat(...b)}function R(a,b){let c=O(a)/O(b),d=0;b.forEach((e,f)=>{d+=Math.pow(a[f]-e*c,2)});return{averageSize:c,error:d}}
6329
+ function S(a,b,c){try{let d=P(a,{x:-1,y:a.y},c,b.length),e=P(a,{x:a.x,y:-1},c,b.length),f=P(a,{x:Math.max(0,a.x-a.y)-1,y:Math.max(0,a.y-a.x)-1},c,b.length),g=P(a,{x:Math.min(c.width,a.x+a.y)+1,y:Math.min(c.height,a.y+a.x)+1},c,b.length),h=R(d,b),k=R(e,b),m=R(f,b),l=R(g,b),n=(h.averageSize+k.averageSize+m.averageSize+l.averageSize)/4;return Math.sqrt(h.error*h.error+k.error*k.error+m.error*m.error+l.error*l.error)+(Math.pow(h.averageSize-n,2)+Math.pow(k.averageSize-n,2)+Math.pow(m.averageSize-n,2)+
6330
+ Math.pow(l.averageSize-n,2))/n}catch(d){return Infinity}}function T(a,b){for(var c=Math.round(b.x);a.get(c,Math.round(b.y));)c--;for(var d=Math.round(b.x);a.get(d,Math.round(b.y));)d++;c=(c+d)/2;for(d=Math.round(b.y);a.get(Math.round(c),d);)d--;for(b=Math.round(b.y);a.get(Math.round(c),b);)b++;return{x:c,y:(d+b)/2}}
6331
+ function sa(a){var b=[],c=[];let d=[];var e=[];for(let p=0;p<=a.height;p++){var f=0,g=!1;let t=[0,0,0,0,0];for(let v=-1;v<=a.width;v++){var h=a.get(v,p);if(h===g)f++;else{t=[t[1],t[2],t[3],t[4],f];f=1;g=h;var k=O(t)/7;k=Math.abs(t[0]-k)<k&&Math.abs(t[1]-k)<k&&Math.abs(t[2]-3*k)<3*k&&Math.abs(t[3]-k)<k&&Math.abs(t[4]-k)<k&&!h;var m=O(t.slice(-3))/3;h=Math.abs(t[2]-m)<m&&Math.abs(t[3]-m)<m&&Math.abs(t[4]-m)<m&&h;if(k){let z=v-t[3]-t[4],y=z-t[2];k={startX:y,endX:z,y:p};m=c.filter(w=>y>=w.bottom.startX&&
6332
+ y<=w.bottom.endX||z>=w.bottom.startX&&y<=w.bottom.endX||y<=w.bottom.startX&&z>=w.bottom.endX&&1.5>t[2]/(w.bottom.endX-w.bottom.startX)&&.5<t[2]/(w.bottom.endX-w.bottom.startX));0<m.length?m[0].bottom=k:c.push({top:k,bottom:k})}if(h){let z=v-t[4],y=z-t[3];h={startX:y,y:p,endX:z};k=e.filter(w=>y>=w.bottom.startX&&y<=w.bottom.endX||z>=w.bottom.startX&&y<=w.bottom.endX||y<=w.bottom.startX&&z>=w.bottom.endX&&1.5>t[2]/(w.bottom.endX-w.bottom.startX)&&.5<t[2]/(w.bottom.endX-w.bottom.startX));0<k.length?
6333
+ k[0].bottom=h:e.push({top:h,bottom:h})}}}b.push(...c.filter(v=>v.bottom.y!==p&&2<=v.bottom.y-v.top.y));c=c.filter(v=>v.bottom.y===p);d.push(...e.filter(v=>v.bottom.y!==p));e=e.filter(v=>v.bottom.y===p)}b.push(...c.filter(p=>2<=p.bottom.y-p.top.y));d.push(...e);c=[];for(var l of b)2>l.bottom.y-l.top.y||(b=(l.top.startX+l.top.endX+l.bottom.startX+l.bottom.endX)/4,e=(l.top.y+l.bottom.y+1)/2,a.get(Math.round(b),Math.round(e))&&(f=[l.top.endX-l.top.startX,l.bottom.endX-l.bottom.startX,l.bottom.y-l.top.y+
6334
+ 1],f=O(f)/f.length,g=S({x:Math.round(b),y:Math.round(e)},[1,1,3,1,1],a),c.push({score:g,x:b,y:e,size:f})));if(3>c.length)return null;c.sort((p,t)=>p.score-t.score);l=[];for(b=0;b<Math.min(c.length,5);++b){e=c[b];f=[];for(var n of c)n!==e&&f.push(Object.assign(Object.assign({},n),{score:n.score+Math.pow(n.size-e.size,2)/e.size}));f.sort((p,t)=>p.score-t.score);l.push({points:[e,f[0],f[1]],score:e.score+f[0].score+f[1].score})}l.sort((p,t)=>p.score-t.score);let {topRight:q,topLeft:r,bottomLeft:u}=qa(...l[0].points);
6335
+ l=U(a,d,q,r,u);n=[];l&&n.push({alignmentPattern:{x:l.alignmentPattern.x,y:l.alignmentPattern.y},bottomLeft:{x:u.x,y:u.y},dimension:l.dimension,topLeft:{x:r.x,y:r.y},topRight:{x:q.x,y:q.y}});l=T(a,q);b=T(a,r);c=T(a,u);(a=U(a,d,l,b,c))&&n.push({alignmentPattern:{x:a.alignmentPattern.x,y:a.alignmentPattern.y},bottomLeft:{x:c.x,y:c.y},topLeft:{x:b.x,y:b.y},topRight:{x:l.x,y:l.y},dimension:a.dimension});return 0===n.length?null:n}
6336
+ function U(a,b,c,d,e){let f,g;try{({dimension:f,moduleSize:g}=ra(d,c,e,a))}catch(l){return null}var h=c.x-d.x+e.x,k=c.y-d.y+e.y;c=(N(d,e)+N(d,c))/2/g;e=1-3/c;let m={x:d.x+e*(h-d.x),y:d.y+e*(k-d.y)};b=b.map(l=>{const n=(l.top.startX+l.top.endX+l.bottom.startX+l.bottom.endX)/4;l=(l.top.y+l.bottom.y+1)/2;if(a.get(Math.floor(n),Math.floor(l))){var q=S({x:Math.floor(n),y:Math.floor(l)},[1,1,1],a)+N({x:n,y:l},m);return{x:n,y:l,score:q}}}).filter(l=>!!l).sort((l,n)=>l.score-n.score);return{alignmentPattern:15<=
6337
+ c&&b.length?b[0]:m,dimension:f}}
6338
+ function V(a){var b=sa(a);if(!b)return null;for(let e of b){b=pa(a,e);var c=b.matrix;if(null==c)c=null;else{var d=L(c);if(d)c=d;else{for(d=0;d<c.width;d++)for(let f=d+1;f<c.height;f++)c.get(d,f)!==c.get(f,d)&&(c.set(d,f,!c.get(d,f)),c.set(f,d,!c.get(f,d)));c=L(c)}}if(c)return{binaryData:c.bytes,data:c.text,chunks:c.chunks,version:c.version,location:{topRightCorner:b.mappingFunction(e.dimension,0),topLeftCorner:b.mappingFunction(0,0),bottomRightCorner:b.mappingFunction(e.dimension,e.dimension),bottomLeftCorner:b.mappingFunction(0,
6339
+ e.dimension),topRightFinderPattern:e.topRight,topLeftFinderPattern:e.topLeft,bottomLeftFinderPattern:e.bottomLeft,bottomRightAlignmentPattern:e.alignmentPattern},matrix:b.matrix}}return null}let ta={inversionAttempts:"attemptBoth",greyScaleWeights:{red:.2126,green:.7152,blue:.0722,useIntegerApproximation:!1},canOverwriteImage:!0};function W(a,b){Object.keys(b).forEach(c=>{a[c]=b[c]})}
6340
+ function X(a,b,c,d={}){let e=Object.create(null);W(e,ta);W(e,d);d="onlyInvert"===e.inversionAttempts||"invertFirst"===e.inversionAttempts;var f="attemptBoth"===e.inversionAttempts||d;var g=e.greyScaleWeights,h=e.canOverwriteImage,k=b*c;if(a.length!==4*k)throw Error("Malformed data passed to binarizer.");var m=0;if(h){var l=new Uint8ClampedArray(a.buffer,m,k);m+=k}l=new A(b,c,l);if(g.useIntegerApproximation)for(var n=0;n<c;n++)for(var q=0;q<b;q++){var r=4*(n*b+q);l.set(q,n,g.red*a[r]+g.green*a[r+1]+
6341
+ g.blue*a[r+2]+128>>8)}else for(n=0;n<c;n++)for(q=0;q<b;q++)r=4*(n*b+q),l.set(q,n,g.red*a[r]+g.green*a[r+1]+g.blue*a[r+2]);g=Math.ceil(b/8);n=Math.ceil(c/8);q=g*n;if(h){var u=new Uint8ClampedArray(a.buffer,m,q);m+=q}u=new A(g,n,u);for(q=0;q<n;q++)for(r=0;r<g;r++){var p=Infinity,t=0;for(var v=0;8>v;v++)for(let w=0;8>w;w++){let aa=l.get(8*r+w,8*q+v);p=Math.min(p,aa);t=Math.max(t,aa)}v=(p+t)/2;v=Math.min(255,1.11*v);24>=t-p&&(v=p/2,0<q&&0<r&&(t=(u.get(r,q-1)+2*u.get(r-1,q)+u.get(r-1,q-1))/4,p<t&&(v=t)));
6342
+ u.set(r,q,v)}h?(q=new Uint8ClampedArray(a.buffer,m,k),m+=k,q=new x(q,b)):q=x.createEmpty(b,c);r=null;f&&(h?(a=new Uint8ClampedArray(a.buffer,m,k),r=new x(a,b)):r=x.createEmpty(b,c));for(b=0;b<n;b++)for(a=0;a<g;a++){c=g-3;c=2>a?2:a>c?c:a;h=n-3;h=2>b?2:b>h?h:b;k=0;for(m=-2;2>=m;m++)for(p=-2;2>=p;p++)k+=u.get(c+m,h+p);c=k/25;for(h=0;8>h;h++)for(k=0;8>k;k++)m=8*a+h,p=8*b+k,t=l.get(m,p),q.set(m,p,t<=c),f&&r.set(m,p,!(t<=c))}f=f?{binarized:q,inverted:r}:{binarized:q};let {binarized:z,inverted:y}=f;(f=V(d?
6343
+ y:z))||"attemptBoth"!==e.inversionAttempts&&"invertFirst"!==e.inversionAttempts||(f=V(d?z:y));return f}X.default=X;let Y="dontInvert",Z={red:77,green:150,blue:29,useIntegerApproximation:!0};
6344
+ self.onmessage=a=>{let b=a.data.id,c=a.data.data;switch(a.data.type){case "decode":(a=X(c.data,c.width,c.height,{inversionAttempts:Y,greyScaleWeights:Z}))?self.postMessage({id:b,type:"qrResult",data:a.data,cornerPoints:[a.location.topLeftCorner,a.location.topRightCorner,a.location.bottomRightCorner,a.location.bottomLeftCorner]}):self.postMessage({id:b,type:"qrResult",data:null});break;case "grayscaleWeights":Z.red=c.red;Z.green=c.green;Z.blue=c.blue;Z.useIntegerApproximation=c.useIntegerApproximation;
6345
+ break;case "inversionMode":switch(c){case "original":Y="dontInvert";break;case "invert":Y="onlyInvert";break;case "both":Y="attemptBoth";break;default:throw Error("Invalid inversion mode");}break;case "close":self.close()}}
6346
+ `]), { type: "application/javascript" }));
6347
+ const qrScannerWorker_min = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6348
+ __proto__: null,
6349
+ createWorker
6350
+ }, Symbol.toStringTag, { value: "Module" }));
4754
6351
  export {
6352
+ CheckInAccess,
6353
+ _sfc_main$c as CheckInCollection,
6354
+ CheckInModel,
6355
+ CheckInPresenceCollection,
6356
+ _sfc_main$f as CheckInScanError,
6357
+ _sfc_main$d as CheckInScanSuccess,
6358
+ CheckInScanner,
6359
+ CheckInSingle,
6360
+ operasional_types as NOperasional,
4755
6361
  OperasionalInterfacesPlugin,
4756
6362
  graphql as Schema,
4757
6363
  _sfc_main$9 as SituationCollection,
@@ -4770,5 +6376,10 @@ export {
4770
6376
  _sfc_main$1 as TaskSingle,
4771
6377
  _sfc_main as TaskWork,
4772
6378
  _sfc_main$3 as TaskWorkButton,
4773
- _sfc_main$c as XxxButton
6379
+ _sfc_main$j as XxxButton,
6380
+ bus,
6381
+ useAttendanceStore,
6382
+ useOperasional,
6383
+ useOperasionalStore,
6384
+ withOperasional
4774
6385
  };