bt-core-app 2.1.36 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_commonjs-dynamic-modules.mjs +6 -0
- package/dist/_virtual/_commonjsHelpers.mjs +30 -0
- package/dist/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/dist/_virtual/index.mjs +4 -0
- package/dist/_virtual/localforage.mjs +4 -0
- package/dist/_virtual/luxon.mjs +6 -0
- package/dist/_virtual/matcher.mjs +4 -0
- package/dist/_virtual/parser.mjs +4 -0
- package/dist/bt-core/core/node_modules/@datasert/cronjs-matcher/dist/index.mjs +12 -0
- package/dist/bt-core/core/node_modules/@datasert/cronjs-matcher/dist/matcher.mjs +220 -0
- package/dist/bt-core/core/node_modules/@datasert/cronjs-parser/dist/parser.mjs +186 -0
- package/dist/bt-core/core/node_modules/@mdi/js/mdi.mjs +70 -0
- package/dist/bt-core/core/node_modules/@vuepic/vue-datepicker/dist/main.css.mjs +1 -0
- package/dist/bt-core/core/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.mjs +5210 -0
- package/dist/bt-core/core/node_modules/date-fns/_lib/addLeadingZeros.mjs +7 -0
- package/dist/bt-core/core/node_modules/date-fns/_lib/defaultOptions.mjs +7 -0
- package/dist/bt-core/core/node_modules/date-fns/_lib/format/formatters.mjs +517 -0
- package/dist/bt-core/core/node_modules/date-fns/_lib/format/lightFormatters.mjs +59 -0
- package/dist/bt-core/core/node_modules/date-fns/_lib/format/longFormatters.mjs +52 -0
- package/dist/bt-core/core/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs +18 -0
- package/dist/bt-core/core/node_modules/date-fns/_lib/normalizeDates.mjs +11 -0
- package/dist/bt-core/core/node_modules/date-fns/_lib/normalizeInterval.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/_lib/protectedTokens.mjs +21 -0
- package/dist/bt-core/core/node_modules/date-fns/add.mjs +20 -0
- package/dist/bt-core/core/node_modules/date-fns/addDays.mjs +10 -0
- package/dist/bt-core/core/node_modules/date-fns/addHours.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/addMilliseconds.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/addMonths.mjs +21 -0
- package/dist/bt-core/core/node_modules/date-fns/addQuarters.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/addYears.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/compareAsc.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/constants.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/constructFrom.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/differenceInCalendarDays.mjs +16 -0
- package/dist/bt-core/core/node_modules/date-fns/differenceInCalendarYears.mjs +13 -0
- package/dist/bt-core/core/node_modules/date-fns/differenceInYears.mjs +17 -0
- package/dist/bt-core/core/node_modules/date-fns/eachDayOfInterval.mjs +20 -0
- package/dist/bt-core/core/node_modules/date-fns/eachQuarterOfInterval.mjs +21 -0
- package/dist/bt-core/core/node_modules/date-fns/endOfQuarter.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/endOfWeek.mjs +11 -0
- package/dist/bt-core/core/node_modules/date-fns/endOfYear.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/format.mjs +60 -0
- package/dist/bt-core/core/node_modules/date-fns/getDay.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/getDayOfYear.mjs +11 -0
- package/dist/bt-core/core/node_modules/date-fns/getDaysInMonth.mjs +10 -0
- package/dist/bt-core/core/node_modules/date-fns/getDefaultOptions.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/getHours.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/getISODay.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/getISOWeek.mjs +12 -0
- package/dist/bt-core/core/node_modules/date-fns/getISOWeekYear.mjs +15 -0
- package/dist/bt-core/core/node_modules/date-fns/getMinutes.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/getMonth.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/getQuarter.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/getSeconds.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/getWeek.mjs +12 -0
- package/dist/bt-core/core/node_modules/date-fns/getWeekYear.mjs +17 -0
- package/dist/bt-core/core/node_modules/date-fns/getYear.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/isAfter.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/isBefore.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/isDate.mjs +7 -0
- package/dist/bt-core/core/node_modules/date-fns/isEqual.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/isSameQuarter.mjs +14 -0
- package/dist/bt-core/core/node_modules/date-fns/isValid.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs +18 -0
- package/dist/bt-core/core/node_modules/date-fns/locale/_lib/buildMatchFn.mjs +31 -0
- package/dist/bt-core/core/node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs +17 -0
- package/dist/bt-core/core/node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs +70 -0
- package/dist/bt-core/core/node_modules/date-fns/locale/en-US/_lib/formatLong.mjs +33 -0
- package/dist/bt-core/core/node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs +11 -0
- package/dist/bt-core/core/node_modules/date-fns/locale/en-US/_lib/localize.mjs +155 -0
- package/dist/bt-core/core/node_modules/date-fns/locale/en-US/_lib/match.mjs +110 -0
- package/dist/bt-core/core/node_modules/date-fns/locale/en-US.mjs +21 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/Parser.mjs +22 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/Setter.mjs +41 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/constants.mjs +49 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.mjs +49 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/AMPMParser.mjs +49 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/DateParser.mjs +61 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.mjs +51 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/DayParser.mjs +45 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.mjs +49 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/EraParser.mjs +30 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.mjs +21 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.mjs +22 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.mjs +32 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.mjs +32 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.mjs +33 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.mjs +33 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/ISODayParser.mjs +99 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.mjs +48 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.mjs +48 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.mjs +49 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.mjs +40 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.mjs +74 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.mjs +48 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.mjs +69 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/MinuteParser.mjs +32 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/MonthParser.mjs +71 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/QuarterParser.mjs +70 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/SecondParser.mjs +32 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.mjs +74 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.mjs +71 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.mjs +70 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.mjs +22 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs +22 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers/YearParser.mjs +49 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/parsers.mjs +67 -0
- package/dist/bt-core/core/node_modules/date-fns/parse/_lib/utils.mjs +103 -0
- package/dist/bt-core/core/node_modules/date-fns/parse.mjs +90 -0
- package/dist/bt-core/core/node_modules/date-fns/set.mjs +11 -0
- package/dist/bt-core/core/node_modules/date-fns/setDay.mjs +12 -0
- package/dist/bt-core/core/node_modules/date-fns/setHours.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/setISODay.mjs +11 -0
- package/dist/bt-core/core/node_modules/date-fns/setISOWeek.mjs +10 -0
- package/dist/bt-core/core/node_modules/date-fns/setMilliseconds.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/setMinutes.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/setMonth.mjs +13 -0
- package/dist/bt-core/core/node_modules/date-fns/setSeconds.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/setWeek.mjs +10 -0
- package/dist/bt-core/core/node_modules/date-fns/setYear.mjs +10 -0
- package/dist/bt-core/core/node_modules/date-fns/startOfDay.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/startOfISOWeek.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/startOfISOWeekYear.mjs +11 -0
- package/dist/bt-core/core/node_modules/date-fns/startOfMonth.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/startOfQuarter.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/startOfWeek.mjs +11 -0
- package/dist/bt-core/core/node_modules/date-fns/startOfWeekYear.mjs +13 -0
- package/dist/bt-core/core/node_modules/date-fns/startOfYear.mjs +9 -0
- package/dist/bt-core/core/node_modules/date-fns/sub.mjs +19 -0
- package/dist/bt-core/core/node_modules/date-fns/subDays.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/subMonths.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/subYears.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/toDate.mjs +8 -0
- package/dist/bt-core/core/node_modules/date-fns/transpose.mjs +18 -0
- package/dist/bt-core/core/node_modules/localforage/dist/localforage.mjs +1454 -0
- package/dist/bt-core/core/node_modules/luxon/src/datetime.mjs +1855 -0
- package/dist/bt-core/core/node_modules/luxon/src/duration.mjs +753 -0
- package/dist/bt-core/core/node_modules/luxon/src/errors.mjs +40 -0
- package/dist/bt-core/core/node_modules/luxon/src/impl/conversions.mjs +92 -0
- package/dist/bt-core/core/node_modules/luxon/src/impl/diff.mjs +36 -0
- package/dist/bt-core/core/node_modules/luxon/src/impl/digits.mjs +77 -0
- package/dist/bt-core/core/node_modules/luxon/src/impl/english.mjs +138 -0
- package/dist/bt-core/core/node_modules/luxon/src/impl/formats.mjs +150 -0
- package/dist/bt-core/core/node_modules/luxon/src/impl/formatter.mjs +258 -0
- package/dist/bt-core/core/node_modules/luxon/src/impl/invalid.mjs +11 -0
- package/dist/bt-core/core/node_modules/luxon/src/impl/locale.mjs +294 -0
- package/dist/bt-core/core/node_modules/luxon/src/impl/regexParser.mjs +202 -0
- package/dist/bt-core/core/node_modules/luxon/src/impl/tokenParser.mjs +329 -0
- package/dist/bt-core/core/node_modules/luxon/src/impl/util.mjs +220 -0
- package/dist/bt-core/core/node_modules/luxon/src/impl/zoneUtil.mjs +20 -0
- package/dist/bt-core/core/node_modules/luxon/src/info.mjs +180 -0
- package/dist/bt-core/core/node_modules/luxon/src/interval.mjs +481 -0
- package/dist/bt-core/core/node_modules/luxon/src/luxon.mjs +24 -0
- package/dist/bt-core/core/node_modules/luxon/src/settings.mjs +150 -0
- package/dist/bt-core/core/node_modules/luxon/src/zone.mjs +88 -0
- package/dist/bt-core/core/node_modules/luxon/src/zones/IANAZone.mjs +183 -0
- package/dist/bt-core/core/node_modules/luxon/src/zones/fixedOffsetZone.mjs +125 -0
- package/dist/bt-core/core/node_modules/luxon/src/zones/invalidZone.mjs +41 -0
- package/dist/bt-core/core/node_modules/luxon/src/zones/systemZone.mjs +47 -0
- package/dist/bt-core/core/node_modules/merge-images/dist/index.es2015.mjs +47 -0
- package/dist/bt-core/core/node_modules/signature_pad/dist/signature_pad.mjs +248 -0
- package/dist/bt-core/core/node_modules/thenby/thenBy.module.mjs +38 -0
- package/dist/bt-core/core/node_modules/vue-picture-cropper/lib/index.mjs +1643 -0
- package/dist/bt-core/core/node_modules/vue-signature-pad/dist/vue-signature-pad.esm.mjs +173 -0
- package/dist/bt-core/core/node_modules/vue-use-spring/dist/index.mjs +204 -0
- package/dist/bt-core/core/node_modules/vuetify/lib/composables/defaults.mjs +61 -0
- package/dist/bt-core/core/node_modules/vuetify/lib/composables/icons.mjs +82 -0
- package/dist/bt-core/core/node_modules/vuetify/lib/iconsets/mdi-svg.mjs +74 -0
- package/dist/bt-core/core/node_modules/vuetify/lib/util/colors.mjs +322 -0
- package/dist/bt-core/core/node_modules/vuetify/lib/util/console.mjs +7 -0
- package/dist/bt-core/core/node_modules/vuetify/lib/util/defineComponent.mjs +34 -0
- package/dist/bt-core/core/node_modules/vuetify/lib/util/getCurrentInstance.mjs +10 -0
- package/dist/bt-core/core/node_modules/vuetify/lib/util/helpers.mjs +44 -0
- package/dist/bt-core/core/node_modules/vuetify/lib/util/injectSelf.mjs +12 -0
- package/dist/bt-core/core/node_modules/vuetify/lib/util/propsFactory.mjs +14 -0
- package/dist/components/BT-Assistant-Menu.vue.d.ts +19 -0
- package/dist/components/BT-Assistant-Menu.vue.mjs +464 -0
- package/dist/components/BT-Assistant-Menu.vue2.mjs +4 -0
- package/dist/components/BT-Avatar.vue.d.ts +16 -0
- package/dist/components/BT-Avatar.vue.mjs +41 -0
- package/dist/components/BT-Avatar.vue2.mjs +4 -0
- package/dist/components/BT-Background-Task.vue.d.ts +61 -0
- package/dist/components/BT-Background-Task.vue.mjs +89 -0
- package/dist/components/BT-Background-Task.vue2.mjs +4 -0
- package/dist/components/BT-Blade-Item.vue.d.ts +578 -0
- package/dist/components/BT-Blade-Item.vue.mjs +441 -0
- package/dist/components/BT-Blade-Item.vue2.mjs +4 -0
- package/dist/components/BT-Blade-Items.vue.d.ts +2358 -0
- package/dist/components/BT-Blade-Items.vue.mjs +7 -0
- package/dist/components/BT-Blade-Items.vue2.mjs +943 -0
- package/dist/components/BT-Blade-Items.vue3.mjs +1 -0
- package/dist/components/BT-Blade-Steps.vue.d.ts +1740 -0
- package/dist/components/BT-Blade-Steps.vue.mjs +7 -0
- package/dist/components/BT-Blade-Steps.vue2.mjs +1305 -0
- package/dist/components/BT-Blade-Steps.vue3.mjs +1 -0
- package/dist/components/BT-Blade.vue.d.ts +109 -0
- package/dist/components/BT-Blade.vue.mjs +268 -0
- package/dist/components/BT-Blade.vue2.mjs +4 -0
- package/dist/components/BT-Btn.vue.d.ts +47 -0
- package/dist/components/BT-Btn.vue.mjs +43 -0
- package/dist/components/BT-Btn.vue2.mjs +4 -0
- package/dist/components/BT-Camera-Overlay.vue.d.ts +57 -0
- package/dist/components/BT-Camera-Overlay.vue.mjs +173 -0
- package/dist/components/BT-Camera-Overlay.vue2.mjs +4 -0
- package/dist/components/BT-Col.vue.d.ts +49 -0
- package/dist/components/BT-Col.vue.mjs +33 -0
- package/dist/components/BT-Col.vue2.mjs +4 -0
- package/dist/components/BT-Color-Picker-Menu.vue.d.ts +23 -0
- package/dist/components/BT-Color-Picker-Menu.vue.mjs +63 -0
- package/dist/components/BT-Color-Picker-Menu.vue2.mjs +4 -0
- package/dist/components/BT-Cosmetics-Menu.vue.d.ts +14 -0
- package/dist/components/BT-Cosmetics-Menu.vue.mjs +211 -0
- package/dist/components/BT-Cosmetics-Menu.vue2.mjs +4 -0
- package/dist/components/BT-Cron-Span.vue.d.ts +21 -0
- package/dist/components/BT-Cron-Span.vue.mjs +66 -0
- package/dist/components/BT-Cron-Span.vue2.mjs +4 -0
- package/dist/components/BT-Cron.vue.d.ts +37 -0
- package/dist/components/BT-Cron.vue.mjs +538 -0
- package/dist/components/BT-Cron.vue2.mjs +4 -0
- package/dist/components/BT-Date-Select.vue.d.ts +46 -0
- package/dist/components/BT-Date-Select.vue.mjs +71 -0
- package/dist/components/BT-Date-Select.vue2.mjs +4 -0
- package/dist/components/BT-Date.vue.d.ts +53 -0
- package/dist/components/BT-Date.vue.mjs +55 -0
- package/dist/components/BT-Date.vue2.mjs +4 -0
- package/dist/components/BT-Demo-Profile-Select.vue.d.ts +17 -0
- package/dist/components/BT-Demo-Profile-Select.vue.mjs +52 -0
- package/dist/components/BT-Demo-Profile-Select.vue2.mjs +4 -0
- package/dist/components/BT-Dialog-Confirm.vue.d.ts +2 -0
- package/dist/components/BT-Dialog-Confirm.vue.mjs +63 -0
- package/dist/components/BT-Dialog-Confirm.vue2.mjs +4 -0
- package/dist/components/BT-Dialog-Date.vue.d.ts +2 -0
- package/dist/components/BT-Dialog-Date.vue.mjs +79 -0
- package/dist/components/BT-Dialog-Date.vue2.mjs +4 -0
- package/dist/components/BT-Dialog-Number.vue.d.ts +2 -0
- package/dist/components/BT-Dialog-Number.vue.mjs +178 -0
- package/dist/components/BT-Dialog-Number.vue2.mjs +4 -0
- package/dist/components/BT-Dialog-Select.vue.d.ts +2 -0
- package/dist/components/BT-Dialog-Select.vue.mjs +235 -0
- package/dist/components/BT-Dialog-Select.vue2.mjs +4 -0
- package/dist/components/BT-Divider.vue.d.ts +24 -0
- package/dist/components/BT-Divider.vue.mjs +31 -0
- package/dist/components/BT-Divider.vue2.mjs +4 -0
- package/dist/components/BT-Drag-Counter.vue.d.ts +114 -0
- package/dist/components/BT-Drag-Counter.vue.mjs +7 -0
- package/dist/components/BT-Drag-Counter.vue2.mjs +156 -0
- package/dist/components/BT-Drag-Counter.vue3.mjs +1 -0
- package/dist/components/BT-Entity.vue.d.ts +82 -0
- package/dist/components/BT-Entity.vue.mjs +172 -0
- package/dist/components/BT-Entity.vue2.mjs +4 -0
- package/dist/components/BT-Error.vue.d.ts +15 -0
- package/dist/components/BT-Error.vue.mjs +35 -0
- package/dist/components/BT-Error.vue2.mjs +4 -0
- package/dist/components/BT-Field-Checkbox.vue.d.ts +57 -0
- package/dist/components/BT-Field-Checkbox.vue.mjs +61 -0
- package/dist/components/BT-Field-Checkbox.vue2.mjs +4 -0
- package/dist/components/BT-Field-Date.vue.d.ts +69 -0
- package/dist/components/BT-Field-Date.vue.mjs +120 -0
- package/dist/components/BT-Field-Date.vue2.mjs +4 -0
- package/dist/components/BT-Field-Entity.vue.d.ts +48 -0
- package/dist/components/BT-Field-Entity.vue.mjs +55 -0
- package/dist/components/BT-Field-Entity.vue2.mjs +4 -0
- package/dist/components/BT-Field-Select-Simple.vue.d.ts +55 -0
- package/dist/components/BT-Field-Select-Simple.vue.mjs +52 -0
- package/dist/components/BT-Field-Select-Simple.vue2.mjs +4 -0
- package/dist/components/BT-Field-Select.vue.d.ts +70 -0
- package/dist/components/BT-Field-Select.vue.mjs +60 -0
- package/dist/components/BT-Field-Select.vue2.mjs +4 -0
- package/dist/components/BT-Field-String.vue.d.ts +57 -0
- package/dist/components/BT-Field-String.vue.mjs +87 -0
- package/dist/components/BT-Field-String.vue2.mjs +4 -0
- package/dist/components/BT-Field-Switch.vue.d.ts +51 -0
- package/dist/components/BT-Field-Switch.vue.mjs +64 -0
- package/dist/components/BT-Field-Switch.vue2.mjs +4 -0
- package/dist/components/BT-Field-Tags.vue.d.ts +53 -0
- package/dist/components/BT-Field-Tags.vue.mjs +80 -0
- package/dist/components/BT-Field-Tags.vue2.mjs +4 -0
- package/dist/components/BT-Field-Textarea.vue.d.ts +53 -0
- package/dist/components/BT-Field-Textarea.vue.mjs +66 -0
- package/dist/components/BT-Field-Textarea.vue2.mjs +4 -0
- package/dist/components/BT-Field-Trigger.vue.d.ts +113 -0
- package/dist/components/BT-Field-Trigger.vue.mjs +368 -0
- package/dist/components/BT-Field-Trigger.vue2.mjs +4 -0
- package/dist/components/BT-Field.vue.d.ts +49 -0
- package/dist/components/BT-Field.vue.mjs +59 -0
- package/dist/components/BT-Field.vue2.mjs +4 -0
- package/dist/components/BT-Form-Builder.vue.d.ts +74 -0
- package/dist/components/BT-Form-Builder.vue.mjs +762 -0
- package/dist/components/BT-Form-Builder.vue2.mjs +4 -0
- package/dist/components/BT-Form-Field.vue.d.ts +41 -0
- package/dist/components/BT-Form-Field.vue.mjs +186 -0
- package/dist/components/BT-Form-Field.vue2.mjs +4 -0
- package/dist/components/BT-Form.vue.d.ts +95 -0
- package/dist/components/BT-Form.vue.mjs +635 -0
- package/dist/components/BT-Form.vue2.mjs +4 -0
- package/dist/components/BT-Header-Option.vue.d.ts +18 -0
- package/dist/components/BT-Header-Option.vue.mjs +62 -0
- package/dist/components/BT-Header-Option.vue2.mjs +4 -0
- package/dist/components/BT-Image-Select.vue.d.ts +71 -0
- package/dist/components/BT-Image-Select.vue.mjs +219 -0
- package/dist/components/BT-Image-Select.vue2.mjs +4 -0
- package/dist/components/BT-Json.vue.d.ts +6 -0
- package/dist/components/BT-Json.vue.mjs +38 -0
- package/dist/components/BT-Json.vue2.mjs +1 -0
- package/dist/components/BT-Json.vue3.mjs +5 -0
- package/dist/components/BT-Loader.vue.d.ts +6 -0
- package/dist/components/BT-Loader.vue.mjs +37 -0
- package/dist/components/BT-Loader.vue2.mjs +4 -0
- package/dist/components/BT-Nav-Sidebar.vue.d.ts +25 -0
- package/dist/components/BT-Nav-Sidebar.vue.mjs +138 -0
- package/dist/components/BT-Nav-Sidebar.vue2.mjs +4 -0
- package/dist/components/BT-Number.vue.d.ts +23 -0
- package/dist/components/BT-Number.vue.mjs +7 -0
- package/dist/components/BT-Number.vue2.mjs +43 -0
- package/dist/components/BT-Number.vue3.mjs +1 -0
- package/dist/components/BT-Numpad.vue.d.ts +68 -0
- package/dist/components/BT-Numpad.vue.mjs +191 -0
- package/dist/components/BT-Numpad.vue2.mjs +4 -0
- package/dist/components/BT-Select-Inline.vue.d.ts +121 -0
- package/dist/components/BT-Select-Inline.vue.mjs +74 -0
- package/dist/components/BT-Select-Inline.vue2.mjs +24 -0
- package/dist/components/BT-Select-Inline.vue3.mjs +1 -0
- package/dist/components/BT-Select-List-Box.vue.d.ts +137 -0
- package/dist/components/BT-Select-List-Box.vue.mjs +414 -0
- package/dist/components/BT-Select-List-Box.vue2.mjs +4 -0
- package/dist/components/BT-Select-Simple.vue.d.ts +58 -0
- package/dist/components/BT-Select-Simple.vue.mjs +126 -0
- package/dist/components/BT-Select-Simple.vue2.mjs +4 -0
- package/dist/components/BT-Select.vue.d.ts +73 -0
- package/dist/components/BT-Select.vue.mjs +138 -0
- package/dist/components/BT-Select.vue2.mjs +4 -0
- package/dist/components/BT-Signature-Overlay.vue.d.ts +65 -0
- package/dist/components/BT-Signature-Overlay.vue.mjs +146 -0
- package/dist/components/BT-Signature-Overlay.vue2.mjs +4 -0
- package/dist/components/BT-Signature.vue.d.ts +70 -0
- package/dist/components/BT-Signature.vue.mjs +155 -0
- package/dist/components/BT-Signature.vue2.mjs +4 -0
- package/dist/components/BT-Slider.vue.d.ts +37 -0
- package/dist/components/BT-Slider.vue.mjs +126 -0
- package/dist/components/BT-Slider.vue2.mjs +4 -0
- package/dist/components/BT-Span.vue.d.ts +19 -0
- package/dist/components/BT-Span.vue.mjs +23 -0
- package/dist/components/BT-Span.vue2.mjs +4 -0
- package/dist/components/BT-Square-Check.vue.d.ts +104 -0
- package/dist/components/BT-Square-Check.vue.mjs +98 -0
- package/dist/components/BT-Square-Check.vue2.mjs +4 -0
- package/dist/components/BT-Status-Item.vue.d.ts +45 -0
- package/dist/components/BT-Status-Item.vue.mjs +51 -0
- package/dist/components/BT-Status-Item.vue2.mjs +4 -0
- package/dist/components/BT-Tags.vue.d.ts +19 -0
- package/dist/components/BT-Tags.vue.mjs +32 -0
- package/dist/components/BT-Tags.vue2.mjs +4 -0
- package/dist/components/BT-Tour.vue.d.ts +43 -0
- package/dist/components/BT-Tour.vue.mjs +78 -0
- package/dist/components/BT-Tour.vue2.mjs +4 -0
- package/dist/components.mjs +36 -0
- package/dist/composables/actions-local.d.ts +14 -0
- package/dist/composables/actions-local.mjs +26 -0
- package/dist/composables/actions-tracker.d.ts +36 -0
- package/dist/composables/actions-tracker.mjs +88 -0
- package/dist/composables/actions.d.ts +116 -0
- package/dist/composables/actions.mjs +272 -0
- package/dist/composables/api.d.ts +100 -0
- package/dist/composables/api.mjs +329 -0
- package/dist/composables/assistant.d.ts +38 -0
- package/dist/composables/assistant.mjs +70 -0
- package/dist/composables/auth.d.ts +94 -0
- package/dist/composables/auth.mjs +257 -0
- package/dist/composables/background-tasks.d.ts +31 -0
- package/dist/composables/background-tasks.mjs +79 -0
- package/dist/composables/blade-old.d.ts +1 -0
- package/dist/composables/blade.d.ts +91 -0
- package/dist/composables/blade.mjs +156 -0
- package/dist/composables/charts.d.ts +10 -0
- package/dist/composables/colorizer.d.ts +5 -0
- package/dist/composables/colorizer.mjs +27 -0
- package/dist/composables/component-config.d.ts +8 -0
- package/dist/composables/component-config.mjs +11 -0
- package/dist/composables/confirm.d.ts +1 -0
- package/dist/composables/confirm.mjs +11 -0
- package/dist/composables/cosmetics.d.ts +44 -0
- package/dist/composables/cosmetics.mjs +125 -0
- package/dist/composables/cron-adjustments.d.ts +63 -0
- package/dist/composables/cron-adjustments.mjs +106 -0
- package/dist/composables/cron.d.ts +72 -0
- package/dist/composables/cron.mjs +326 -0
- package/dist/composables/csv.d.ts +44 -0
- package/dist/composables/csv.mjs +163 -0
- package/dist/composables/dates.d.ts +22 -0
- package/dist/composables/dates.mjs +61 -0
- package/dist/composables/demo.d.ts +68 -0
- package/dist/composables/demo.mjs +173 -0
- package/dist/composables/dialog-items.d.ts +117 -0
- package/dist/composables/dialog-items.mjs +72 -0
- package/dist/composables/document-meta.d.ts +11 -0
- package/dist/composables/document-meta.mjs +20 -0
- package/dist/composables/draggable.d.ts +56 -0
- package/dist/composables/draggable.mjs +76 -0
- package/dist/composables/feedback.d.ts +24 -0
- package/dist/composables/feedback.mjs +32 -0
- package/dist/composables/filters.d.ts +27 -0
- package/dist/composables/filters.mjs +218 -0
- package/dist/composables/forage.d.ts +89 -0
- package/dist/composables/forage.mjs +37 -0
- package/dist/composables/forms.d.ts +104 -0
- package/dist/composables/forms.mjs +256 -0
- package/dist/composables/geo.d.ts +24 -0
- package/dist/composables/geo.mjs +95 -0
- package/dist/composables/graph-pro.d.ts +98 -0
- package/dist/composables/graph-pro.mjs +205 -0
- package/dist/composables/graphing.d.ts +1 -0
- package/dist/composables/heights.d.ts +24 -0
- package/dist/composables/heights.mjs +41 -0
- package/dist/composables/helpers.d.ts +114 -0
- package/dist/composables/helpers.mjs +512 -0
- package/dist/composables/icons.d.ts +3 -0
- package/dist/composables/icons.mjs +84 -0
- package/dist/composables/id.d.ts +8 -0
- package/dist/composables/id.mjs +32 -0
- package/dist/composables/item.d.ts +132 -0
- package/dist/composables/item.mjs +263 -0
- package/dist/composables/iterating.d.ts +1 -0
- package/dist/composables/list.d.ts +345 -0
- package/dist/composables/list.mjs +460 -0
- package/dist/composables/lists.d.ts +10 -0
- package/dist/composables/lists.mjs +31 -0
- package/dist/composables/menu.d.ts +35 -0
- package/dist/composables/menu.mjs +63 -0
- package/dist/composables/navigation.d.ts +123 -0
- package/dist/composables/navigation.mjs +157 -0
- package/dist/composables/nested.d.ts +3 -0
- package/dist/composables/nested.mjs +20 -0
- package/dist/composables/old-dialogs.d.ts +1 -0
- package/dist/composables/presets.d.ts +8 -0
- package/dist/composables/presets.mjs +16 -0
- package/dist/composables/pwa-old.d.ts +15 -0
- package/dist/composables/pwa.d.ts +26 -0
- package/dist/composables/pwa.mjs +80 -0
- package/dist/composables/resizable.d.ts +34 -0
- package/dist/composables/resizable.mjs +135 -0
- package/dist/composables/routing-old.d.ts +1 -0
- package/dist/composables/routing.d.ts +16 -0
- package/dist/composables/routing.mjs +112 -0
- package/dist/composables/rules.d.ts +13 -0
- package/dist/composables/rules.mjs +22 -0
- package/dist/composables/select.d.ts +78 -0
- package/dist/composables/select.mjs +129 -0
- package/dist/composables/settings.d.ts +6 -0
- package/dist/composables/settings.mjs +21 -0
- package/dist/composables/setup.d.ts +1 -0
- package/dist/composables/steps-old.d.ts +1 -0
- package/dist/composables/steps.d.ts +53 -0
- package/dist/composables/steps.mjs +39 -0
- package/dist/composables/stores.d.ts +258 -0
- package/dist/composables/stores.mjs +1257 -0
- package/dist/composables/sync.d.ts +33 -0
- package/dist/composables/track.d.ts +13 -0
- package/dist/composables/track.mjs +30 -0
- package/dist/composables/urls.d.ts +35 -0
- package/dist/composables/urls.mjs +66 -0
- package/dist/composables/vuetify.d.ts +85 -0
- package/dist/composables.mjs +237 -0
- package/dist/core.d.ts +48 -0
- package/dist/core.mjs +6 -0
- package/dist/core2.mjs +118 -0
- package/dist/index-components.d.ts +19 -0
- package/dist/index-composables.d.ts +75 -0
- package/dist/index-core.d.ts +3 -0
- package/dist/index.d.ts +96 -3036
- package/dist/index.mjs +275 -0
- package/dist/main.d.ts +1 -0
- package/dist/node_modules/bt-core-app/dist/bt-core-app.mjs +30372 -0
- package/dist/style.css +1 -5
- package/dist/types.d.ts +18 -0
- package/dist/types.mjs +7 -0
- package/package.json +4 -1
- package/dist/bt-core-app.js +0 -81355
|
@@ -0,0 +1,1257 @@
|
|
|
1
|
+
import { defineStore as Q } from "pinia";
|
|
2
|
+
import { ref as _, toValue as J, toRaw as Y } from "vue";
|
|
3
|
+
import q from "../bt-core/core/node_modules/luxon/src/datetime.mjs";
|
|
4
|
+
import "../bt-core/core/node_modules/luxon/src/duration.mjs";
|
|
5
|
+
import { isNullOrEmpty as G, getMinDateString as z, appendUrl as le, pullPropsFrom as ue, distinct as ce } from "./helpers.mjs";
|
|
6
|
+
import { t as R } from "../bt-core/core/node_modules/thenby/thenBy.module.mjs";
|
|
7
|
+
import { useLocalDb as B } from "./forage.mjs";
|
|
8
|
+
import { BTDateFormat as V } from "./dates.mjs";
|
|
9
|
+
let X, Z;
|
|
10
|
+
function Se(a) {
|
|
11
|
+
return Z(a)();
|
|
12
|
+
}
|
|
13
|
+
function be(a) {
|
|
14
|
+
return X(a)();
|
|
15
|
+
}
|
|
16
|
+
function Ie(a) {
|
|
17
|
+
return X(a);
|
|
18
|
+
}
|
|
19
|
+
function xe(a) {
|
|
20
|
+
return X = (e) => ne({
|
|
21
|
+
...a,
|
|
22
|
+
...e
|
|
23
|
+
}), X;
|
|
24
|
+
}
|
|
25
|
+
function $e(a) {
|
|
26
|
+
return Z = (e) => ie({
|
|
27
|
+
...a,
|
|
28
|
+
...e
|
|
29
|
+
}), Z;
|
|
30
|
+
}
|
|
31
|
+
function ne(a) {
|
|
32
|
+
var x, D, y;
|
|
33
|
+
let e = (x = a.navigation) == null ? void 0 : x.findItem(a.nav);
|
|
34
|
+
if (a.storeMode ?? (a.storeMode = (e == null ? void 0 : e.storeMode) ?? "session"), a.storageMode ?? (a.storageMode = (e == null ? void 0 : e.storageMode) ?? "local-cache"), a.storeName ?? (a.storeName = ((D = a.navigation) == null ? void 0 : D.findStoreName(e ?? a.nav)) ?? a.nav), a.getStorageKey ?? (a.getStorageKey = e == null ? void 0 : e.getStorageKey), a.updateIgnoreProps ?? (a.updateIgnoreProps = e == null ? void 0 : e.updateIgnoreProps), (y = a.demo) != null && y.isDemoing.value && (a.storageMode = "session"), a.storeName == null)
|
|
35
|
+
throw new Error("no store name provided");
|
|
36
|
+
var m = a.storeName;
|
|
37
|
+
if (G(a.proxyID) || (m = `${a.storeName}_${a.proxyID}`), a.storeMode == "whole-store") {
|
|
38
|
+
if (a.api == null)
|
|
39
|
+
throw new Error("Must supply an api object to use store");
|
|
40
|
+
return de({
|
|
41
|
+
...a,
|
|
42
|
+
minutesToClear: e == null ? void 0 : e.minutesToClear,
|
|
43
|
+
storeName: m,
|
|
44
|
+
priority: (e == null ? void 0 : e.priority) ?? "local"
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (a.storeMode == "whole-last-updated") {
|
|
48
|
+
if (a.api == null)
|
|
49
|
+
throw new Error("Must supply an api object to use store");
|
|
50
|
+
return ve({
|
|
51
|
+
...a,
|
|
52
|
+
minutesToClear: e == null ? void 0 : e.minutesToClear,
|
|
53
|
+
storeName: m,
|
|
54
|
+
priority: (e == null ? void 0 : e.priority) ?? "local"
|
|
55
|
+
});
|
|
56
|
+
} else if (a.storeMode == "partial-last-updated") {
|
|
57
|
+
if (a.api == null)
|
|
58
|
+
throw new Error("Must supply an api object to use store");
|
|
59
|
+
return oe({
|
|
60
|
+
...a,
|
|
61
|
+
storeName: m,
|
|
62
|
+
dateProp: (e == null ? void 0 : e.pluWindowProp) ?? "lastEditedOn",
|
|
63
|
+
bundlingDays: e == null ? void 0 : e.pluDays
|
|
64
|
+
});
|
|
65
|
+
} else
|
|
66
|
+
return fe({
|
|
67
|
+
...a,
|
|
68
|
+
storeName: m
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
const re = (a) => {
|
|
72
|
+
let e = J(a.url) ?? void 0;
|
|
73
|
+
if (a.additionalUrl != null && (e == null ? e = a.additionalUrl : e = le(e, a.additionalUrl)), a.id != null && (e != null && e.includes("{id}") ? e = e.replaceAll("{id}", a.id) : e = le(e, a.id)), a.params != null) {
|
|
74
|
+
e ?? (e = "");
|
|
75
|
+
let m = new URLSearchParams();
|
|
76
|
+
Object.entries(a.params).sort(R.firstBy((D) => D[0])).forEach((D) => {
|
|
77
|
+
D[1] != null && m.append(D[0], D[1].toString());
|
|
78
|
+
}), e = `${e}?${m.toString()}`;
|
|
79
|
+
}
|
|
80
|
+
return a.finalUrl = e, a.finalUrl ?? "";
|
|
81
|
+
};
|
|
82
|
+
function ie(a) {
|
|
83
|
+
var m, x, D;
|
|
84
|
+
let e = (m = a.navigation) == null ? void 0 : m.findItem(a.nav);
|
|
85
|
+
if (a.storeMode ?? (a.storeMode = (e == null ? void 0 : e.storeMode) ?? "session"), a.storageMode ?? (a.storageMode = (e == null ? void 0 : e.storageMode) ?? "local-cache"), a.storeName ?? (a.storeName = `blob-${((x = a.navigation) == null ? void 0 : x.findStoreName(e ?? a.nav)) ?? a.nav}${a.proxyID != null ? "_" + a.proxyID : ""}`), a.getStorageKey ?? (a.getStorageKey = e == null ? void 0 : e.getStorageKey), (D = a.demo) != null && D.isDemoing.value && (a.storageMode = "session"), a.storeName == null)
|
|
86
|
+
throw new Error("no store name provided");
|
|
87
|
+
return Q(a.storeName, () => {
|
|
88
|
+
var k;
|
|
89
|
+
const y = _({}), $ = _({}), s = a.storageMode == "local-cache", A = B(), T = a.buildUrl ?? ((k = a.api) == null ? void 0 : k.buildUrl) ?? re;
|
|
90
|
+
function K(F) {
|
|
91
|
+
var P, u, r, t;
|
|
92
|
+
let U = "blob";
|
|
93
|
+
((P = a.demo) == null ? void 0 : P.isDemoing.value) == !0 && (U = `${U}_demo`);
|
|
94
|
+
let M = {
|
|
95
|
+
credentials: (u = a.auth) == null ? void 0 : u.credentials.value,
|
|
96
|
+
itemID: F.id ?? ((r = F.data) == null ? void 0 : r.id),
|
|
97
|
+
proxyID: F.proxyID,
|
|
98
|
+
userID: (t = a.auth) == null ? void 0 : t.credentials.value.userID,
|
|
99
|
+
start: U,
|
|
100
|
+
storeName: a.storeName
|
|
101
|
+
};
|
|
102
|
+
if (F.getStorageKey != null)
|
|
103
|
+
return F.getStorageKey(M);
|
|
104
|
+
if (a.getStorageKey != null)
|
|
105
|
+
return a.getStorageKey(M);
|
|
106
|
+
let N = "";
|
|
107
|
+
const f = F.params ?? {};
|
|
108
|
+
return f != null && (N = Object.entries(f).sort(R.firstBy((n) => n[0])).map((n) => `${n[0]}=${JSON.stringify(n[1])}`).join("&")), `${M.start}_${M.storeName ?? "base"}_${M.userID ?? "no-user-id"}_${G(M.itemID) ? "no-item-id" : M.itemID}_${N ?? "no-params"}_${F.proxyID ?? ""}`;
|
|
109
|
+
}
|
|
110
|
+
async function L(F) {
|
|
111
|
+
F.additionalUrl ?? (F.additionalUrl = "/get"), T(F);
|
|
112
|
+
const U = K(F), M = F.refresh;
|
|
113
|
+
if (!M && y.value[U] !== void 0)
|
|
114
|
+
return y.value[U];
|
|
115
|
+
if (!M && s == !0) {
|
|
116
|
+
const N = await A.getItem(U);
|
|
117
|
+
if (N != null)
|
|
118
|
+
return N;
|
|
119
|
+
}
|
|
120
|
+
if (a.api == null || F.localOnly)
|
|
121
|
+
return y.value[U];
|
|
122
|
+
try {
|
|
123
|
+
let N = $.value[U];
|
|
124
|
+
N == null && (N = new Promise(async (P, u) => {
|
|
125
|
+
a.api.getBlob(F).then((r) => r.blob()).then((r) => {
|
|
126
|
+
s == !0 ? A.setItem(U, r).then((t) => {
|
|
127
|
+
P(t);
|
|
128
|
+
}) : P(r);
|
|
129
|
+
}).catch((r) => u(r)).finally(() => {
|
|
130
|
+
delete $.value[U];
|
|
131
|
+
});
|
|
132
|
+
}), $.value[U] = N);
|
|
133
|
+
const f = await N;
|
|
134
|
+
return y.value[U] = f, f;
|
|
135
|
+
} catch (N) {
|
|
136
|
+
throw N;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
getBlob: L
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function fe(a) {
|
|
145
|
+
return Q(a.storeName, () => {
|
|
146
|
+
var u;
|
|
147
|
+
const e = q.utc().toSeconds() / 86400, m = _({}), x = _({}), D = a.storageMode == "local-cache", y = B(), $ = a.buildUrl ?? ((u = a.api) == null ? void 0 : u.buildUrl) ?? re, s = a.idSelector ?? ((r) => r.id);
|
|
148
|
+
function A(r) {
|
|
149
|
+
return `${r.start}_${r.storeName ?? "base"}_${r.userID ?? "no-user-id"}_${r.proxyID ?? "no-proxy-id"}`;
|
|
150
|
+
}
|
|
151
|
+
function T(r) {
|
|
152
|
+
var t, n, c, l;
|
|
153
|
+
return {
|
|
154
|
+
credentials: (t = a.auth) == null ? void 0 : t.credentials.value,
|
|
155
|
+
itemID: r.id ?? ((n = r.data) == null ? void 0 : n.id),
|
|
156
|
+
proxyID: r.proxyID,
|
|
157
|
+
userID: (c = a.auth) == null ? void 0 : c.credentials.value.userID,
|
|
158
|
+
start: `ses${((l = a.demo) == null ? void 0 : l.isDemoing.value) == !0 ? "_demo" : ""}`,
|
|
159
|
+
storeName: a.storeName
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function K(r) {
|
|
163
|
+
let t = T(r);
|
|
164
|
+
if (r.getStorageKey != null)
|
|
165
|
+
return r.getStorageKey(t);
|
|
166
|
+
if (a.getStorageKey != null)
|
|
167
|
+
return a.getStorageKey(t);
|
|
168
|
+
if (!G(t.itemID))
|
|
169
|
+
return `${A(t)}_${t.itemID}`;
|
|
170
|
+
let n = "";
|
|
171
|
+
const c = r.params ?? {};
|
|
172
|
+
return c != null && (n = Object.entries(c).sort(R.firstBy((l) => l[0])).map((l) => `${l[0]}=${JSON.stringify(l[1])}`).join("&")), `${A(t)}_${G(n) ? "no-params" : n}`;
|
|
173
|
+
}
|
|
174
|
+
function L() {
|
|
175
|
+
m.value = {}, x.value = {};
|
|
176
|
+
}
|
|
177
|
+
async function k(r) {
|
|
178
|
+
var c;
|
|
179
|
+
r.additionalUrl ?? (r.additionalUrl = "/getAll"), $(r);
|
|
180
|
+
const t = K(r), n = r.refresh;
|
|
181
|
+
if (!n && m.value[t] !== void 0)
|
|
182
|
+
return m.value[t];
|
|
183
|
+
if (!n && D == !0) {
|
|
184
|
+
const l = await y.getItem(t);
|
|
185
|
+
if (l != null && (a.api == null || parseFloat(l.meta.storedOn) > e - 7))
|
|
186
|
+
return m.value[t] = l, l;
|
|
187
|
+
}
|
|
188
|
+
if (a.api == null || r.localOnly)
|
|
189
|
+
return m.value[t];
|
|
190
|
+
try {
|
|
191
|
+
let l = x.value[t];
|
|
192
|
+
l == null && (l = new Promise(async (d, v) => {
|
|
193
|
+
var w;
|
|
194
|
+
try {
|
|
195
|
+
const o = await ((w = a.api) == null ? void 0 : w.getAll(r)), g = {
|
|
196
|
+
meta: { storedOn: e.toString() },
|
|
197
|
+
data: o == null ? void 0 : o.data,
|
|
198
|
+
count: o == null ? void 0 : o.count,
|
|
199
|
+
filters: (o == null ? void 0 : o.filters) ?? []
|
|
200
|
+
};
|
|
201
|
+
D == !0 && await y.setItem(t, g), d(g);
|
|
202
|
+
} catch (o) {
|
|
203
|
+
v(o);
|
|
204
|
+
} finally {
|
|
205
|
+
delete x.value[t];
|
|
206
|
+
}
|
|
207
|
+
}), x.value[t] = l);
|
|
208
|
+
const i = await l;
|
|
209
|
+
return m.value[t] = i, {
|
|
210
|
+
data: (c = m.value[t]) == null ? void 0 : c.data,
|
|
211
|
+
//apiRes?.data,
|
|
212
|
+
filters: i == null ? void 0 : i.filters,
|
|
213
|
+
count: i == null ? void 0 : i.count
|
|
214
|
+
};
|
|
215
|
+
} catch (l) {
|
|
216
|
+
throw l;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
async function F(r) {
|
|
220
|
+
var c, l;
|
|
221
|
+
r.additionalUrl ?? (r.additionalUrl = "/get"), $(r);
|
|
222
|
+
const t = K(r), n = r.refresh;
|
|
223
|
+
if (!n && m.value[t] !== void 0)
|
|
224
|
+
return m.value[t];
|
|
225
|
+
if (!n && D == !0) {
|
|
226
|
+
const i = await y.getItem(t);
|
|
227
|
+
if (i != null && (a.api == null || parseFloat(((c = i.meta) == null ? void 0 : c.storedOn) ?? "0") > e - 7))
|
|
228
|
+
return m.value[t] = i, { data: i.data };
|
|
229
|
+
}
|
|
230
|
+
if (a.api == null || r.localOnly)
|
|
231
|
+
return m.value[t];
|
|
232
|
+
try {
|
|
233
|
+
let i = x.value[t];
|
|
234
|
+
i == null && (i = new Promise(async (v, w) => {
|
|
235
|
+
var o;
|
|
236
|
+
try {
|
|
237
|
+
let g = await ((o = a.api) == null ? void 0 : o.get(r));
|
|
238
|
+
const h = {
|
|
239
|
+
meta: { storedOn: e.toString() },
|
|
240
|
+
data: g == null ? void 0 : g.data
|
|
241
|
+
};
|
|
242
|
+
D == !0 && await y.setItem(t, h), v(h);
|
|
243
|
+
} catch (g) {
|
|
244
|
+
w(g);
|
|
245
|
+
} finally {
|
|
246
|
+
delete x.value[t];
|
|
247
|
+
}
|
|
248
|
+
}), x.value[t] = i);
|
|
249
|
+
const d = await i;
|
|
250
|
+
return m.value[t] = d, { data: (l = m.value[t]) == null ? void 0 : l.data };
|
|
251
|
+
} catch (i) {
|
|
252
|
+
throw i;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
async function U(r, t, n, c) {
|
|
256
|
+
var h;
|
|
257
|
+
let l = Y(ue(((h = m.value[r]) == null ? void 0 : h.data) ?? n.data ?? {}, t, a.updateIgnoreProps, "all-obj2-props")), i = {
|
|
258
|
+
meta: { storedOn: e.toString() },
|
|
259
|
+
data: l
|
|
260
|
+
};
|
|
261
|
+
c == "update" ? m.value[r] = i : c == "remove" && delete m.value[r], D == !0 && (c == "update" ? await y.setItem(r, Y(i)) : c == "remove" && await y.removeItem(r));
|
|
262
|
+
var d = await y.keys();
|
|
263
|
+
let v = T(n), w = A(v), o = `${w}_${G(v.itemID) ? "no-item-id" : v.itemID}`;
|
|
264
|
+
d = d.filter((b) => (b.startsWith(w) || b.startsWith(o)) && b != r), Object.entries(m.value).filter((b) => d.some((S) => b[0] == S)).forEach((b) => {
|
|
265
|
+
const S = b[1].data;
|
|
266
|
+
if (S != null)
|
|
267
|
+
if (Array.isArray(S))
|
|
268
|
+
for (let I = 0; I < S.length; I++)
|
|
269
|
+
s(S[I]) == s(l) && (c == "update" ? S.splice(I, 1, l) : c == "remove" && S.splice(I, 1));
|
|
270
|
+
else
|
|
271
|
+
s(S) == s(l) && (c == "update" ? m.value[b[0]] = i : c == "remove" && delete m.value[b[0]]);
|
|
272
|
+
});
|
|
273
|
+
for (let b = 0; b < d.length; b++) {
|
|
274
|
+
const S = d[b];
|
|
275
|
+
let I = await y.getItem(S);
|
|
276
|
+
if (I != null)
|
|
277
|
+
if (Array.isArray(I.data)) {
|
|
278
|
+
let C = !1;
|
|
279
|
+
for (let W = 0; W < I.data.length; W++)
|
|
280
|
+
s(I.data[W]) == s(l) && (c == "update" ? I.data.splice(W, 1, l) : c == "remove" && I.data.splice(W, 1), C = !0);
|
|
281
|
+
C && await y.setItem(S, I);
|
|
282
|
+
} else
|
|
283
|
+
s(I.data) == s(l) && (c == "update" ? (I.data = l, await y.setItem(S, I)) : c == "remove" && await y.removeItem(S));
|
|
284
|
+
}
|
|
285
|
+
return i.data;
|
|
286
|
+
}
|
|
287
|
+
async function M(r) {
|
|
288
|
+
r.additionalUrl ?? (r.additionalUrl = "/patch"), $(r);
|
|
289
|
+
const t = K(r);
|
|
290
|
+
let n;
|
|
291
|
+
if (a.api != null && r.localOnly !== !0)
|
|
292
|
+
try {
|
|
293
|
+
let c = await a.api.patch(r);
|
|
294
|
+
n = c == null ? void 0 : c.data;
|
|
295
|
+
} catch (c) {
|
|
296
|
+
throw c;
|
|
297
|
+
}
|
|
298
|
+
else
|
|
299
|
+
n = r.data;
|
|
300
|
+
return n != null ? await U(
|
|
301
|
+
t,
|
|
302
|
+
n,
|
|
303
|
+
r,
|
|
304
|
+
"update"
|
|
305
|
+
) : n;
|
|
306
|
+
}
|
|
307
|
+
async function N(r) {
|
|
308
|
+
var n;
|
|
309
|
+
r.additionalUrl ?? (r.additionalUrl = "/post"), $(r);
|
|
310
|
+
let t;
|
|
311
|
+
if (a.api != null && r.localOnly !== !0)
|
|
312
|
+
try {
|
|
313
|
+
let c = await a.api.post(r);
|
|
314
|
+
t = c == null ? void 0 : c.data;
|
|
315
|
+
} catch (c) {
|
|
316
|
+
throw c;
|
|
317
|
+
}
|
|
318
|
+
else
|
|
319
|
+
t = r.data;
|
|
320
|
+
if (t != null) {
|
|
321
|
+
let c = {
|
|
322
|
+
meta: { storedOn: e.toString() },
|
|
323
|
+
data: t
|
|
324
|
+
};
|
|
325
|
+
t != null && (r.id ?? (r.id = t.id));
|
|
326
|
+
const l = K(r);
|
|
327
|
+
return D == !0 && await y.setItem(l, Y(c)), m.value[l] = c, (n = m.value[l]) == null ? void 0 : n.data;
|
|
328
|
+
}
|
|
329
|
+
return t;
|
|
330
|
+
}
|
|
331
|
+
async function f(r) {
|
|
332
|
+
var l;
|
|
333
|
+
r.additionalUrl ?? (r.additionalUrl = "/delete"), $(r);
|
|
334
|
+
const t = K(r);
|
|
335
|
+
let n;
|
|
336
|
+
if (a.api != null && r.localOnly !== !0)
|
|
337
|
+
try {
|
|
338
|
+
var c = await a.api.deleteItem(r);
|
|
339
|
+
n = c == null ? void 0 : c.data;
|
|
340
|
+
} catch (i) {
|
|
341
|
+
throw i;
|
|
342
|
+
}
|
|
343
|
+
else
|
|
344
|
+
n = r.data;
|
|
345
|
+
return await U(
|
|
346
|
+
t,
|
|
347
|
+
{ id: ((l = r.data) == null ? void 0 : l.id) ?? r.id },
|
|
348
|
+
r,
|
|
349
|
+
"remove"
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
async function P(r) {
|
|
353
|
+
r.additionalUrl ?? (r.additionalUrl = `/restore?id=${r.data.id}`), $(r);
|
|
354
|
+
const t = K(r);
|
|
355
|
+
let n;
|
|
356
|
+
if (a.api != null && r.localOnly !== !0)
|
|
357
|
+
try {
|
|
358
|
+
let c = await a.api.patch(r);
|
|
359
|
+
n = c == null ? void 0 : c.data;
|
|
360
|
+
} catch (c) {
|
|
361
|
+
throw c;
|
|
362
|
+
}
|
|
363
|
+
else
|
|
364
|
+
n = r.data;
|
|
365
|
+
return await U(
|
|
366
|
+
t,
|
|
367
|
+
n,
|
|
368
|
+
r,
|
|
369
|
+
"update"
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
return {
|
|
373
|
+
$reset: L,
|
|
374
|
+
deleteItem: f,
|
|
375
|
+
get: F,
|
|
376
|
+
getAll: k,
|
|
377
|
+
patch: M,
|
|
378
|
+
post: N,
|
|
379
|
+
restore: P,
|
|
380
|
+
searchMemory: m,
|
|
381
|
+
//mainly for testing
|
|
382
|
+
currentTimeStampDays: e,
|
|
383
|
+
promiseMemory: x,
|
|
384
|
+
cacheLocally: D
|
|
385
|
+
};
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
function de(a) {
|
|
389
|
+
return Q(a.storeName, () => {
|
|
390
|
+
const e = _(), m = _(0), x = a.storageMode == "local-cache", D = a.idSelector ?? ((f) => f.id), y = _({}), $ = _({});
|
|
391
|
+
function s() {
|
|
392
|
+
e.value = void 0, m.value = 0, $.value = {};
|
|
393
|
+
}
|
|
394
|
+
function A(f) {
|
|
395
|
+
var r, t, n;
|
|
396
|
+
let P = "wst";
|
|
397
|
+
((r = a.demo) == null ? void 0 : r.isDemoing.value) == !0 && (P = `${P}_demo`);
|
|
398
|
+
let u = {
|
|
399
|
+
credentials: (t = a.auth) == null ? void 0 : t.credentials.value,
|
|
400
|
+
proxyID: f,
|
|
401
|
+
userID: (n = a.auth) == null ? void 0 : n.credentials.value.userID,
|
|
402
|
+
start: P,
|
|
403
|
+
storeName: a.storeName
|
|
404
|
+
};
|
|
405
|
+
return a.getStorageKey != null ? a.getStorageKey(u) : `${u.start}_${u.storeName}_${u.userID ?? "no-user-id"}_${u.proxyID ?? "no-proxy-id"}`;
|
|
406
|
+
}
|
|
407
|
+
async function T(f) {
|
|
408
|
+
if (x == !0) {
|
|
409
|
+
const P = {
|
|
410
|
+
meta: J(y),
|
|
411
|
+
data: J(e) ?? [],
|
|
412
|
+
count: J(m) ?? 0,
|
|
413
|
+
filters: []
|
|
414
|
+
};
|
|
415
|
+
try {
|
|
416
|
+
await B().setItem(A(f), JSON.parse(JSON.stringify(P)));
|
|
417
|
+
} catch (u) {
|
|
418
|
+
console.log("sav err"), console.log(u);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
function K(f) {
|
|
423
|
+
const P = A(f.proxyID);
|
|
424
|
+
return $.value[P] || ($.value[P] = new Promise(async (u, r) => {
|
|
425
|
+
var t;
|
|
426
|
+
try {
|
|
427
|
+
let n = await ((t = a.api) == null ? void 0 : t.getAll({
|
|
428
|
+
additionalUrl: "/getAll",
|
|
429
|
+
nav: f.nav,
|
|
430
|
+
proxyID: f.proxyID
|
|
431
|
+
}));
|
|
432
|
+
n == null ? r(n) : (e.value = n.data, m.value = e.value.length, y.value = {}, await T(f.proxyID), u(n));
|
|
433
|
+
} catch (n) {
|
|
434
|
+
r(n);
|
|
435
|
+
} finally {
|
|
436
|
+
delete $.value[P];
|
|
437
|
+
}
|
|
438
|
+
})), $.value[P];
|
|
439
|
+
}
|
|
440
|
+
async function L(f) {
|
|
441
|
+
var t, n, c, l, i, d, v, w;
|
|
442
|
+
const P = A(f.proxyID), u = f.refresh;
|
|
443
|
+
if (!u && e.value != null) {
|
|
444
|
+
if (f.localPredicate != null) {
|
|
445
|
+
var r = ((t = e.value) == null ? void 0 : t.filter((o) => !!f.localPredicate(o))) ?? [];
|
|
446
|
+
return {
|
|
447
|
+
count: r.length,
|
|
448
|
+
data: r,
|
|
449
|
+
filters: []
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
return {
|
|
453
|
+
count: (n = e.value) == null ? void 0 : n.length,
|
|
454
|
+
data: e.value,
|
|
455
|
+
filters: []
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
if (!u && a.priority != "server" && x == !0) {
|
|
459
|
+
const o = await B().getItem(P);
|
|
460
|
+
if (o != null) {
|
|
461
|
+
if (e.value = o.data, m.value = o.data.length, y.value = o.meta, f.localPredicate != null) {
|
|
462
|
+
var r = ((c = e.value) == null ? void 0 : c.filter((h) => !!f.localPredicate(h))) ?? [];
|
|
463
|
+
return {
|
|
464
|
+
count: r.length,
|
|
465
|
+
data: r,
|
|
466
|
+
filters: []
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
return {
|
|
470
|
+
count: (l = e.value) == null ? void 0 : l.length,
|
|
471
|
+
data: e.value ?? [],
|
|
472
|
+
filters: []
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
if (a.api == null || f.localOnly) {
|
|
477
|
+
if (f.localPredicate != null) {
|
|
478
|
+
var r = ((i = e.value) == null ? void 0 : i.filter((g) => !!f.localPredicate(g))) ?? [];
|
|
479
|
+
return {
|
|
480
|
+
count: r.length,
|
|
481
|
+
data: r,
|
|
482
|
+
filters: []
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
return {
|
|
486
|
+
count: (d = e.value) == null ? void 0 : d.length,
|
|
487
|
+
data: e.value ?? [],
|
|
488
|
+
filters: []
|
|
489
|
+
};
|
|
490
|
+
} else
|
|
491
|
+
e.value ?? (e.value = []);
|
|
492
|
+
try {
|
|
493
|
+
if (await K(f), f.localPredicate != null) {
|
|
494
|
+
var r = ((v = e.value) == null ? void 0 : v.filter((g) => !!f.localPredicate(g))) ?? [];
|
|
495
|
+
return {
|
|
496
|
+
count: r.length,
|
|
497
|
+
data: r,
|
|
498
|
+
filters: []
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
return {
|
|
502
|
+
count: (w = e.value) == null ? void 0 : w.length,
|
|
503
|
+
data: e.value ?? [],
|
|
504
|
+
filters: []
|
|
505
|
+
};
|
|
506
|
+
} catch (o) {
|
|
507
|
+
let g = o;
|
|
508
|
+
throw new Error(g.message ?? "Problem");
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
async function k(f) {
|
|
512
|
+
var n, c, l, i, d, v, w, o, g;
|
|
513
|
+
const P = A(f.proxyID), u = f.id ?? ((n = f.data) == null ? void 0 : n.id);
|
|
514
|
+
if (u == null && f.localPredicate == null)
|
|
515
|
+
throw new Error("no id provided");
|
|
516
|
+
let r = f.refresh, t;
|
|
517
|
+
if (!r && e.value != null && (f.localPredicate != null ? t = (c = e.value) == null ? void 0 : c.find((h) => f.localPredicate(h)) : t = (l = e.value) == null ? void 0 : l.find((h) => D(h) == u), t != null))
|
|
518
|
+
return { data: t };
|
|
519
|
+
if (!r && x == !0) {
|
|
520
|
+
const h = await B().getItem(P);
|
|
521
|
+
if (h != null && (e.value = h.data, m.value = h.data.length, y.value = h.meta, f.localPredicate != null ? t = (i = e.value) == null ? void 0 : i.find((b) => f.localPredicate(b)) : t = (d = e.value) == null ? void 0 : d.find((b) => D(b) == u), t != null))
|
|
522
|
+
return { data: t };
|
|
523
|
+
}
|
|
524
|
+
if (a.api == null || f.localOnly)
|
|
525
|
+
return f.localPredicate != null ? t = (v = e.value) == null ? void 0 : v.find((h) => f.localPredicate(h)) : t = (w = e.value) == null ? void 0 : w.find((h) => D(h) == u), t != null ? { data: t } : { data: t };
|
|
526
|
+
e.value ?? (e.value = []);
|
|
527
|
+
try {
|
|
528
|
+
return await K(f), f.localPredicate != null ? t = (o = e.value) == null ? void 0 : o.find((h) => f.localPredicate(h)) : t = (g = e.value) == null ? void 0 : g.find((h) => D(h) == u), { data: t };
|
|
529
|
+
} catch (h) {
|
|
530
|
+
let b = h;
|
|
531
|
+
throw new Error(b.message ?? "Problem");
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
async function F(f) {
|
|
535
|
+
var r, t, n;
|
|
536
|
+
f.additionalUrl ?? (f.additionalUrl = "/patch");
|
|
537
|
+
let P;
|
|
538
|
+
if (a.api != null && f.localOnly !== !0)
|
|
539
|
+
try {
|
|
540
|
+
let c = await a.api.patch(f);
|
|
541
|
+
P = { ...f.data, ...c == null ? void 0 : c.data };
|
|
542
|
+
} catch (c) {
|
|
543
|
+
let l = c;
|
|
544
|
+
throw new Error(l.message ?? "Patch Problem");
|
|
545
|
+
}
|
|
546
|
+
else
|
|
547
|
+
P = f.data;
|
|
548
|
+
if (P != null) {
|
|
549
|
+
let c = (r = e.value) == null ? void 0 : r.findIndex((l) => D(l) == D(P));
|
|
550
|
+
c != null && c >= 0 && (e.value ?? (e.value = []), (t = e.value) == null || t.splice(c, 1, P), await T(f.proxyID));
|
|
551
|
+
}
|
|
552
|
+
const u = D(P) ?? f.id ?? D(f.data);
|
|
553
|
+
return (n = e.value) == null ? void 0 : n.find((c) => D(c) == u);
|
|
554
|
+
}
|
|
555
|
+
async function U(f) {
|
|
556
|
+
var r, t;
|
|
557
|
+
f.additionalUrl ?? (f.additionalUrl = "/post");
|
|
558
|
+
let P;
|
|
559
|
+
if (a.api != null && f.localOnly !== !0)
|
|
560
|
+
try {
|
|
561
|
+
let n = await a.api.post(f);
|
|
562
|
+
P = n == null ? void 0 : n.data;
|
|
563
|
+
} catch (n) {
|
|
564
|
+
let c = n;
|
|
565
|
+
throw new Error(c.message ?? "Patch Problem");
|
|
566
|
+
}
|
|
567
|
+
else
|
|
568
|
+
P = f.data;
|
|
569
|
+
P != null && (e.value ?? (e.value = []), (r = e.value) == null || r.unshift(P), m.value += 1, await T(f.proxyID));
|
|
570
|
+
const u = D(P) ?? f.id ?? D(f.data);
|
|
571
|
+
return (t = e.value) == null ? void 0 : t.find((n) => D(n) == u);
|
|
572
|
+
}
|
|
573
|
+
async function M(f) {
|
|
574
|
+
var r, t;
|
|
575
|
+
f.additionalUrl ?? (f.additionalUrl = "/delete");
|
|
576
|
+
let P;
|
|
577
|
+
if (a.api != null && f.localOnly !== !0)
|
|
578
|
+
try {
|
|
579
|
+
let n = await a.api.deleteItem(f);
|
|
580
|
+
P = { ...f.data, ...n == null ? void 0 : n.data };
|
|
581
|
+
} catch (n) {
|
|
582
|
+
let c = n;
|
|
583
|
+
throw new Error(c.message ?? "Patch Problem");
|
|
584
|
+
}
|
|
585
|
+
else
|
|
586
|
+
P = f.data;
|
|
587
|
+
const u = f.id ?? D(f.data);
|
|
588
|
+
if (u != null) {
|
|
589
|
+
let n = (r = e.value) == null ? void 0 : r.findIndex((c) => D(c) == u);
|
|
590
|
+
n != null && n >= 0 && (e.value ?? (e.value = []), (t = e.value) == null || t.splice(n, 1), await T(f.proxyID));
|
|
591
|
+
}
|
|
592
|
+
return P;
|
|
593
|
+
}
|
|
594
|
+
async function N(f) {
|
|
595
|
+
var u;
|
|
596
|
+
const P = f.id ?? D(f.data);
|
|
597
|
+
if (f.additionalUrl ?? (f.additionalUrl = `/restore?id=${P}`), a.api != null && f.localOnly !== !0)
|
|
598
|
+
try {
|
|
599
|
+
await a.api.patch(f);
|
|
600
|
+
} catch (r) {
|
|
601
|
+
let t = r;
|
|
602
|
+
throw new Error(t.message ?? "Patch Problem");
|
|
603
|
+
}
|
|
604
|
+
try {
|
|
605
|
+
f.additionalUrl = "/getAll", await K(f);
|
|
606
|
+
} catch (r) {
|
|
607
|
+
let t = r;
|
|
608
|
+
throw new Error(t.message ?? "Problem");
|
|
609
|
+
}
|
|
610
|
+
return (u = e.value) == null ? void 0 : u.find((r) => r.id == P);
|
|
611
|
+
}
|
|
612
|
+
return {
|
|
613
|
+
$reset: s,
|
|
614
|
+
deleteItem: M,
|
|
615
|
+
get: k,
|
|
616
|
+
getAll: L,
|
|
617
|
+
patch: F,
|
|
618
|
+
post: U,
|
|
619
|
+
restore: N,
|
|
620
|
+
//other stuff
|
|
621
|
+
dataItems: e,
|
|
622
|
+
count: m,
|
|
623
|
+
// filters,
|
|
624
|
+
meta: y,
|
|
625
|
+
promiseMemory: $,
|
|
626
|
+
cacheLocally: x
|
|
627
|
+
};
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
function ve(a) {
|
|
631
|
+
return Q(a.storeName, () => {
|
|
632
|
+
const e = _(), m = _(0), x = q.utc().toSeconds() / 3600, D = a.storageMode == "local-cache", y = a.idSelector ?? ((u) => u.id), $ = _({ storedOn: x.toString() }), s = _({});
|
|
633
|
+
function A() {
|
|
634
|
+
e.value = void 0, m.value = 0, s.value = {};
|
|
635
|
+
}
|
|
636
|
+
function T(u) {
|
|
637
|
+
var n, c, l;
|
|
638
|
+
let r = "wlu";
|
|
639
|
+
((n = a.demo) == null ? void 0 : n.isDemoing.value) == !0 && (r = `${r}_demo`);
|
|
640
|
+
let t = {
|
|
641
|
+
credentials: (c = a.auth) == null ? void 0 : c.credentials.value,
|
|
642
|
+
proxyID: u,
|
|
643
|
+
userID: (l = a.auth) == null ? void 0 : l.credentials.value.userID,
|
|
644
|
+
start: r,
|
|
645
|
+
storeName: a.storeName
|
|
646
|
+
};
|
|
647
|
+
return a.getStorageKey != null ? a.getStorageKey(t) : `${t.start}_${t.storeName}_${t.userID ?? "no-user-id"}_${t.proxyID ?? "no-proxy-id"}`;
|
|
648
|
+
}
|
|
649
|
+
async function K(u) {
|
|
650
|
+
if (D == !0) {
|
|
651
|
+
const r = {
|
|
652
|
+
meta: J($),
|
|
653
|
+
data: J(e) ?? [],
|
|
654
|
+
count: J(m) ?? 0,
|
|
655
|
+
filters: []
|
|
656
|
+
};
|
|
657
|
+
try {
|
|
658
|
+
await B().setItem(T(u), JSON.parse(JSON.stringify(r)));
|
|
659
|
+
} catch (t) {
|
|
660
|
+
console.log("sav err"), console.log(t);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
function L(u) {
|
|
665
|
+
const r = T(u.proxyID);
|
|
666
|
+
return s.value[r] || (s.value[r] = new Promise(async (t, n) => {
|
|
667
|
+
var c, l;
|
|
668
|
+
try {
|
|
669
|
+
const i = {
|
|
670
|
+
lastUpdate: $.value.lastUpdate ?? z()
|
|
671
|
+
};
|
|
672
|
+
let d = await ((c = a.api) == null ? void 0 : c.getAll({
|
|
673
|
+
additionalUrl: "/getAll",
|
|
674
|
+
nav: u.nav,
|
|
675
|
+
params: i,
|
|
676
|
+
proxyID: u.proxyID
|
|
677
|
+
}));
|
|
678
|
+
d == null ? n(d) : (e.value ?? (e.value = []), d.data.forEach((v) => {
|
|
679
|
+
var o, g;
|
|
680
|
+
const w = e.value.findIndex((h) => y(h) == y(v));
|
|
681
|
+
w >= 0 ? (o = e.value) == null || o.splice(w, 1, v) : (g = e.value) == null || g.push(v);
|
|
682
|
+
}), m.value = e.value.length, $.value = {
|
|
683
|
+
lastUpdate: ((l = a.dates) == null ? void 0 : l.utcString()) ?? q.utc().toString(),
|
|
684
|
+
storedOn: x.toString()
|
|
685
|
+
}, await K(u.proxyID), t(d));
|
|
686
|
+
} catch (i) {
|
|
687
|
+
n(i);
|
|
688
|
+
} finally {
|
|
689
|
+
delete s.value[r];
|
|
690
|
+
}
|
|
691
|
+
})), s.value[r];
|
|
692
|
+
}
|
|
693
|
+
async function k(u) {
|
|
694
|
+
if (!(a.minutesToClear == null || $.value == null || $.value.storedOn == null)) {
|
|
695
|
+
var r = q.utc().toSeconds() / 60, t = parseFloat($.value.storedOn) * 60;
|
|
696
|
+
if (r > t + a.minutesToClear) {
|
|
697
|
+
console.log(`clearing and reloading ${a.storeName}`);
|
|
698
|
+
const n = T(u);
|
|
699
|
+
await B().removeItem(n), e.value = void 0, m.value = 0, $.value = {
|
|
700
|
+
lastUpdate: z(),
|
|
701
|
+
storedOn: x.toString()
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
async function F(u) {
|
|
707
|
+
var c, l, i, d, v, w, o, g;
|
|
708
|
+
const r = T(u.proxyID), t = u.refresh;
|
|
709
|
+
if (await k(u.proxyID), !t && e.value != null) {
|
|
710
|
+
if (u.localPredicate != null) {
|
|
711
|
+
var n = ((c = e.value) == null ? void 0 : c.filter((h) => !!u.localPredicate(h))) ?? [];
|
|
712
|
+
return {
|
|
713
|
+
count: n.length,
|
|
714
|
+
data: n,
|
|
715
|
+
filters: []
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
return {
|
|
719
|
+
count: (l = e.value) == null ? void 0 : l.length,
|
|
720
|
+
data: e.value,
|
|
721
|
+
filters: []
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
if (!t && a.priority != "server" && D == !0) {
|
|
725
|
+
const h = await B().getItem(r);
|
|
726
|
+
if (h != null && parseFloat(h.meta.storedOn) > x - 7) {
|
|
727
|
+
if (e.value = h.data, m.value = h.data.length, $.value = h.meta, u.localPredicate != null) {
|
|
728
|
+
var n = ((i = e.value) == null ? void 0 : i.filter((S) => !!u.localPredicate(S))) ?? [];
|
|
729
|
+
return {
|
|
730
|
+
count: n.length,
|
|
731
|
+
data: n,
|
|
732
|
+
filters: []
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
return {
|
|
736
|
+
count: (d = e.value) == null ? void 0 : d.length,
|
|
737
|
+
data: e.value ?? [],
|
|
738
|
+
filters: []
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
if (a.api == null || u.localOnly) {
|
|
743
|
+
if (u.localPredicate != null) {
|
|
744
|
+
var n = ((v = e.value) == null ? void 0 : v.filter((b) => !!u.localPredicate(b))) ?? [];
|
|
745
|
+
return {
|
|
746
|
+
count: n.length,
|
|
747
|
+
data: n,
|
|
748
|
+
filters: []
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
return {
|
|
752
|
+
count: (w = e.value) == null ? void 0 : w.length,
|
|
753
|
+
data: e.value ?? [],
|
|
754
|
+
filters: []
|
|
755
|
+
};
|
|
756
|
+
} else
|
|
757
|
+
e.value ?? (e.value = []);
|
|
758
|
+
try {
|
|
759
|
+
if (await L(u), u.localPredicate != null) {
|
|
760
|
+
var n = ((o = e.value) == null ? void 0 : o.filter((b) => !!u.localPredicate(b))) ?? [];
|
|
761
|
+
return {
|
|
762
|
+
count: n.length,
|
|
763
|
+
data: n,
|
|
764
|
+
filters: []
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
return {
|
|
768
|
+
count: (g = e.value) == null ? void 0 : g.length,
|
|
769
|
+
data: e.value ?? [],
|
|
770
|
+
filters: []
|
|
771
|
+
};
|
|
772
|
+
} catch (h) {
|
|
773
|
+
let b = h;
|
|
774
|
+
throw new Error(b.message ?? "Problem");
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
async function U(u) {
|
|
778
|
+
var l, i, d, v, w, o, g, h, b;
|
|
779
|
+
const r = T(u.proxyID), t = u.id ?? ((l = u.data) == null ? void 0 : l.id);
|
|
780
|
+
if (t == null && u.localPredicate == null)
|
|
781
|
+
throw new Error("no id provided");
|
|
782
|
+
let n = u.refresh, c;
|
|
783
|
+
if (!n && e.value != null && (u.localPredicate != null ? c = (i = e.value) == null ? void 0 : i.find((S) => u.localPredicate(S)) : c = (d = e.value) == null ? void 0 : d.find((S) => y(S) == t), c != null))
|
|
784
|
+
return { data: c };
|
|
785
|
+
if (!n && D == !0) {
|
|
786
|
+
const S = await B().getItem(r);
|
|
787
|
+
if (S != null && parseFloat(S.meta.storedOn) > x - 12 && (e.value = S.data, m.value = S.data.length, $.value = S.meta, u.localPredicate != null ? c = (v = e.value) == null ? void 0 : v.find((I) => u.localPredicate(I)) : c = (w = e.value) == null ? void 0 : w.find((I) => y(I) == t), c != null))
|
|
788
|
+
return { data: c };
|
|
789
|
+
}
|
|
790
|
+
if (a.api == null || u.localOnly)
|
|
791
|
+
return u.localPredicate != null ? c = (o = e.value) == null ? void 0 : o.find((S) => u.localPredicate(S)) : c = (g = e.value) == null ? void 0 : g.find((S) => y(S) == t), c != null ? { data: c } : { data: c };
|
|
792
|
+
e.value ?? (e.value = []);
|
|
793
|
+
try {
|
|
794
|
+
return await L(u), u.localPredicate != null ? c = (h = e.value) == null ? void 0 : h.find((S) => u.localPredicate(S)) : c = (b = e.value) == null ? void 0 : b.find((S) => y(S) == t), { data: c };
|
|
795
|
+
} catch (S) {
|
|
796
|
+
let I = S;
|
|
797
|
+
throw new Error(I.message ?? "Problem");
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
async function M(u) {
|
|
801
|
+
var n, c, l;
|
|
802
|
+
u.additionalUrl ?? (u.additionalUrl = "/patch");
|
|
803
|
+
let r;
|
|
804
|
+
if (a.api != null && u.localOnly !== !0)
|
|
805
|
+
try {
|
|
806
|
+
let i = await a.api.patch(u);
|
|
807
|
+
r = { ...u.data, ...i == null ? void 0 : i.data };
|
|
808
|
+
} catch (i) {
|
|
809
|
+
let d = i;
|
|
810
|
+
throw new Error(d.message ?? "Patch Problem");
|
|
811
|
+
}
|
|
812
|
+
else
|
|
813
|
+
r = u.data;
|
|
814
|
+
if (r != null) {
|
|
815
|
+
let i = (n = e.value) == null ? void 0 : n.findIndex((d) => y(d) == y(r));
|
|
816
|
+
i != null && i >= 0 && (e.value ?? (e.value = []), (c = e.value) == null || c.splice(i, 1, r), await K(u.proxyID));
|
|
817
|
+
}
|
|
818
|
+
const t = y(r) ?? u.id ?? y(u.data);
|
|
819
|
+
return (l = e.value) == null ? void 0 : l.find((i) => y(i) == t);
|
|
820
|
+
}
|
|
821
|
+
async function N(u) {
|
|
822
|
+
var n, c;
|
|
823
|
+
u.additionalUrl ?? (u.additionalUrl = "/post");
|
|
824
|
+
let r;
|
|
825
|
+
if (a.api != null && u.localOnly !== !0)
|
|
826
|
+
try {
|
|
827
|
+
let l = await a.api.post(u);
|
|
828
|
+
r = l == null ? void 0 : l.data;
|
|
829
|
+
} catch (l) {
|
|
830
|
+
let i = l;
|
|
831
|
+
throw new Error(i.message ?? "Patch Problem");
|
|
832
|
+
}
|
|
833
|
+
else
|
|
834
|
+
r = u.data;
|
|
835
|
+
r != null && (e.value ?? (e.value = []), (n = e.value) == null || n.unshift(r), m.value += 1, await K(u.proxyID));
|
|
836
|
+
const t = y(r) ?? u.id ?? y(u.data);
|
|
837
|
+
return (c = e.value) == null ? void 0 : c.find((l) => y(l) == t);
|
|
838
|
+
}
|
|
839
|
+
async function f(u) {
|
|
840
|
+
var n, c;
|
|
841
|
+
u.additionalUrl ?? (u.additionalUrl = "/delete");
|
|
842
|
+
let r;
|
|
843
|
+
if (a.api != null && u.localOnly !== !0)
|
|
844
|
+
try {
|
|
845
|
+
let l = await a.api.deleteItem(u);
|
|
846
|
+
r = { ...u.data, ...l == null ? void 0 : l.data };
|
|
847
|
+
} catch (l) {
|
|
848
|
+
let i = l;
|
|
849
|
+
throw new Error(i.message ?? "Patch Problem");
|
|
850
|
+
}
|
|
851
|
+
else
|
|
852
|
+
r = u.data;
|
|
853
|
+
const t = u.id ?? y(u.data);
|
|
854
|
+
if (t != null) {
|
|
855
|
+
let l = (n = e.value) == null ? void 0 : n.findIndex((i) => y(i) == t);
|
|
856
|
+
l != null && l >= 0 && (e.value ?? (e.value = []), (c = e.value) == null || c.splice(l, 1), await K(u.proxyID));
|
|
857
|
+
}
|
|
858
|
+
return r;
|
|
859
|
+
}
|
|
860
|
+
async function P(u) {
|
|
861
|
+
var t;
|
|
862
|
+
const r = u.id ?? y(u.data);
|
|
863
|
+
if (u.additionalUrl ?? (u.additionalUrl = `/restore?id=${r}`), a.api != null && u.localOnly !== !0)
|
|
864
|
+
try {
|
|
865
|
+
await a.api.patch(u);
|
|
866
|
+
} catch (n) {
|
|
867
|
+
let c = n;
|
|
868
|
+
throw new Error(c.message ?? "Patch Problem");
|
|
869
|
+
}
|
|
870
|
+
try {
|
|
871
|
+
u.additionalUrl = "/getAll", await L(u);
|
|
872
|
+
} catch (n) {
|
|
873
|
+
let c = n;
|
|
874
|
+
throw new Error(c.message ?? "Problem");
|
|
875
|
+
}
|
|
876
|
+
return (t = e.value) == null ? void 0 : t.find((n) => n.id == r);
|
|
877
|
+
}
|
|
878
|
+
return {
|
|
879
|
+
$reset: A,
|
|
880
|
+
deleteItem: f,
|
|
881
|
+
get: U,
|
|
882
|
+
getAll: F,
|
|
883
|
+
patch: M,
|
|
884
|
+
post: N,
|
|
885
|
+
restore: P,
|
|
886
|
+
//other stuff
|
|
887
|
+
dataItems: e,
|
|
888
|
+
count: m,
|
|
889
|
+
currentTimeStampHours: x,
|
|
890
|
+
// filters,
|
|
891
|
+
meta: $,
|
|
892
|
+
promiseMemory: s,
|
|
893
|
+
cacheLocally: D
|
|
894
|
+
};
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
function oe(a) {
|
|
898
|
+
return Q(a.storeName, () => {
|
|
899
|
+
const e = _(), m = _(0), x = q.utc().toSeconds() / 3600, D = a.storageMode == "local-cache", y = a.idSelector ?? ((l) => l.id), $ = a.dateProp ?? "lastEditedOn", s = _({
|
|
900
|
+
lastUpdate: z(),
|
|
901
|
+
storedOn: x.toString()
|
|
902
|
+
}), A = _(!1), T = _({});
|
|
903
|
+
function K() {
|
|
904
|
+
e.value = void 0, m.value = 0, T.value = {};
|
|
905
|
+
}
|
|
906
|
+
function L(l) {
|
|
907
|
+
var v, w, o;
|
|
908
|
+
let i = "plu";
|
|
909
|
+
((v = a.demo) == null ? void 0 : v.isDemoing.value) == !0 && (i = `${i}_demo`);
|
|
910
|
+
let d = {
|
|
911
|
+
credentials: (w = a.auth) == null ? void 0 : w.credentials.value,
|
|
912
|
+
proxyID: l,
|
|
913
|
+
start: i,
|
|
914
|
+
userID: (o = a.auth) == null ? void 0 : o.credentials.value.userID,
|
|
915
|
+
storeName: a.storeName
|
|
916
|
+
};
|
|
917
|
+
return a.getStorageKey != null ? a.getStorageKey(d) : `${d.start}_${d.storeName}_${d.userID ?? "no-user-id"}_${d.proxyID ?? "no-proxy-id"}`;
|
|
918
|
+
}
|
|
919
|
+
async function k(l) {
|
|
920
|
+
if (D == !0) {
|
|
921
|
+
const i = { data: J(e) ?? [] }, d = J(s);
|
|
922
|
+
try {
|
|
923
|
+
const v = B();
|
|
924
|
+
v.setItem(L(l), JSON.parse(JSON.stringify(i))), v.setItem(`${L(l)}_meta`, JSON.parse(JSON.stringify(d)));
|
|
925
|
+
} catch (v) {
|
|
926
|
+
console.log("sav err"), console.log(v);
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
async function F(l) {
|
|
931
|
+
if (D && !A.value)
|
|
932
|
+
try {
|
|
933
|
+
s.value = await B().getItem(`${L(l)}_meta`) ?? {
|
|
934
|
+
lastUpdate: z(),
|
|
935
|
+
storedOn: x.toString()
|
|
936
|
+
}, A.value = !0;
|
|
937
|
+
} catch {
|
|
938
|
+
console.log("meta save err");
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
function U(l) {
|
|
942
|
+
var d;
|
|
943
|
+
if (s.value.dateFrom == null || s.value.dateTo == null)
|
|
944
|
+
return {
|
|
945
|
+
left: {
|
|
946
|
+
dateFrom: l.dateFrom ?? z(),
|
|
947
|
+
dateTo: l.dateTo ?? ((d = a.dates) == null ? void 0 : d.utcString()) ?? q.utc().toString()
|
|
948
|
+
},
|
|
949
|
+
reset: !0,
|
|
950
|
+
right: void 0
|
|
951
|
+
};
|
|
952
|
+
var i = {
|
|
953
|
+
reset: !1
|
|
954
|
+
};
|
|
955
|
+
return l.dateFrom != null && l.dateFrom < s.value.dateFrom && (i.left = {
|
|
956
|
+
dateFrom: l.dateFrom,
|
|
957
|
+
dateTo: s.value.dateFrom
|
|
958
|
+
}), l.dateTo != null && l.dateTo > s.value.dateTo && (i.right = {
|
|
959
|
+
dateFrom: s.value.dateTo,
|
|
960
|
+
dateTo: l.dateTo
|
|
961
|
+
}), i;
|
|
962
|
+
}
|
|
963
|
+
function M(l) {
|
|
964
|
+
if (a.bundlingDays == null)
|
|
965
|
+
return {
|
|
966
|
+
left: l.left != null ? [l.left] : [],
|
|
967
|
+
reset: l.reset,
|
|
968
|
+
right: l.right != null ? [l.right] : []
|
|
969
|
+
};
|
|
970
|
+
let i = {
|
|
971
|
+
reset: l.reset
|
|
972
|
+
};
|
|
973
|
+
if (l.left != null) {
|
|
974
|
+
i.left = [];
|
|
975
|
+
let d = a.dates.btDate(l.left.dateFrom), v = a.dates.btDate(l.left.dateTo);
|
|
976
|
+
for (; v.diff(d).as("days") > a.bundlingDays; )
|
|
977
|
+
i.left.push({
|
|
978
|
+
dateFrom: d.toFormat(V),
|
|
979
|
+
dateTo: d.plus({ days: a.bundlingDays }).toFormat(V)
|
|
980
|
+
}), d = d.plus({ days: a.bundlingDays });
|
|
981
|
+
i.left.push({
|
|
982
|
+
dateFrom: d.toFormat(V),
|
|
983
|
+
dateTo: v.toFormat(V)
|
|
984
|
+
});
|
|
985
|
+
}
|
|
986
|
+
if (l.right != null) {
|
|
987
|
+
i.right = [];
|
|
988
|
+
let d = a.dates.btDate(l.right.dateFrom), v = a.dates.btDate(l.right.dateTo);
|
|
989
|
+
for (; v.diff(d).as("days") > a.bundlingDays; )
|
|
990
|
+
i.right.push({
|
|
991
|
+
dateFrom: d.toFormat(V),
|
|
992
|
+
dateTo: d.plus({ days: a.bundlingDays }).toFormat(V)
|
|
993
|
+
}), d = d.plus({ days: a.bundlingDays });
|
|
994
|
+
i.right.push({
|
|
995
|
+
dateFrom: d.toFormat(V),
|
|
996
|
+
dateTo: v.toFormat(V)
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
return i;
|
|
1000
|
+
}
|
|
1001
|
+
function N(l) {
|
|
1002
|
+
const i = L(l.proxyID);
|
|
1003
|
+
return T.value[i] || (T.value[i] = new Promise(async (d, v) => {
|
|
1004
|
+
var w, o, g, h, b, S;
|
|
1005
|
+
try {
|
|
1006
|
+
let I = U(l), C = M(I), W = a.dates.utcString() ?? q.utc().toString();
|
|
1007
|
+
console.log("windows"), console.log(I), console.log("bundled window"), console.log(C), console.log(`last-update: ${W}`);
|
|
1008
|
+
let O = [];
|
|
1009
|
+
if (C.left != null)
|
|
1010
|
+
for (let E = 0; E < C.left.length; E++) {
|
|
1011
|
+
let H = C.left[E], j = await ((w = a.api) == null ? void 0 : w.getAll({
|
|
1012
|
+
additionalUrl: "/getAll",
|
|
1013
|
+
nav: l.nav,
|
|
1014
|
+
params: {
|
|
1015
|
+
dateFrom: H.dateFrom,
|
|
1016
|
+
dateTo: H.dateTo
|
|
1017
|
+
},
|
|
1018
|
+
proxyID: l.proxyID
|
|
1019
|
+
}));
|
|
1020
|
+
if (j == null) {
|
|
1021
|
+
v(j);
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
j.data != null && O.push(...j.data);
|
|
1025
|
+
}
|
|
1026
|
+
let p = [];
|
|
1027
|
+
if (C.right != null)
|
|
1028
|
+
for (let E = 0; E < C.right.length; E++) {
|
|
1029
|
+
let H = C.right[E], j = await ((o = a.api) == null ? void 0 : o.getAll({
|
|
1030
|
+
additionalUrl: "/getAll",
|
|
1031
|
+
nav: l.nav,
|
|
1032
|
+
params: {
|
|
1033
|
+
dateFrom: H.dateFrom,
|
|
1034
|
+
dateTo: H.dateTo
|
|
1035
|
+
},
|
|
1036
|
+
proxyID: l.proxyID
|
|
1037
|
+
}));
|
|
1038
|
+
if (j == null) {
|
|
1039
|
+
v(j);
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
j.data != null && p.push(...j.data);
|
|
1043
|
+
}
|
|
1044
|
+
let ee = [];
|
|
1045
|
+
if (s.value.dateFrom != null && s.value.dateTo != null) {
|
|
1046
|
+
let E = await ((g = a.api) == null ? void 0 : g.getAll({
|
|
1047
|
+
additionalUrl: "/getAll",
|
|
1048
|
+
nav: l.nav,
|
|
1049
|
+
params: {
|
|
1050
|
+
dateFrom: s.value.dateFrom,
|
|
1051
|
+
dateTo: s.value.dateTo,
|
|
1052
|
+
lastUpdate: s.value.lastUpdate ?? z()
|
|
1053
|
+
},
|
|
1054
|
+
proxyID: l.proxyID
|
|
1055
|
+
}));
|
|
1056
|
+
if (E == null) {
|
|
1057
|
+
v(E);
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
ee = (E == null ? void 0 : E.data) ?? [];
|
|
1061
|
+
}
|
|
1062
|
+
if (D && e.value == null) {
|
|
1063
|
+
const E = await B().getItem(i);
|
|
1064
|
+
E != null && (e.value = E.data, m.value = E.data.length);
|
|
1065
|
+
}
|
|
1066
|
+
e.value ?? (e.value = []), I.reset && (e.value = [], m.value = 0), e.value.unshift(...O), e.value.push(...p), ee.forEach((E) => {
|
|
1067
|
+
var j, ae;
|
|
1068
|
+
const H = e.value.findIndex((te) => y(te) == y(E));
|
|
1069
|
+
H >= 0 ? (j = e.value) == null || j.splice(H, 1, E) : (ae = e.value) == null || ae.push(E);
|
|
1070
|
+
}), e.value = ce(e.value, y), m.value = e.value.length, s.value.lastUpdate = W, s.value.storedOn = x.toString(), s.value.dateFrom = ((h = I.left) == null ? void 0 : h.dateFrom) ?? s.value.dateFrom, s.value.dateTo = ((b = I.right) == null ? void 0 : b.dateTo) ?? s.value.dateTo ?? ((S = I.left) == null ? void 0 : S.dateTo), await k(l.proxyID), d({
|
|
1071
|
+
count: m.value,
|
|
1072
|
+
data: e.value
|
|
1073
|
+
});
|
|
1074
|
+
} catch (I) {
|
|
1075
|
+
v(I);
|
|
1076
|
+
} finally {
|
|
1077
|
+
delete T.value[i];
|
|
1078
|
+
}
|
|
1079
|
+
})), T.value[i];
|
|
1080
|
+
}
|
|
1081
|
+
function f(l) {
|
|
1082
|
+
let i = l.dateFrom ?? s.value.dateFrom, d = l.dateTo ?? s.value.dateTo, v = e.value ?? [];
|
|
1083
|
+
if (l.dateFrom == null && l.dateTo == null)
|
|
1084
|
+
return {
|
|
1085
|
+
count: v.length,
|
|
1086
|
+
data: v,
|
|
1087
|
+
filters: []
|
|
1088
|
+
};
|
|
1089
|
+
let w = v.filter((o) => o[$] >= i && o[$] < d);
|
|
1090
|
+
return {
|
|
1091
|
+
count: w.length,
|
|
1092
|
+
data: w,
|
|
1093
|
+
filters: []
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
async function P(l) {
|
|
1097
|
+
const i = L(l.proxyID);
|
|
1098
|
+
let d = l.refresh;
|
|
1099
|
+
if (await F(l.proxyID), (s.value.dateFrom == null || s.value.dateTo == null || l.dateFrom != null && l.dateFrom < s.value.dateFrom || l.dateTo != null && l.dateTo > s.value.dateTo) && (d = !0), !d && e.value != null)
|
|
1100
|
+
return f(l);
|
|
1101
|
+
if (!d && D == !0) {
|
|
1102
|
+
const v = await B().getItem(i);
|
|
1103
|
+
if (v != null)
|
|
1104
|
+
return e.value = v.data, m.value = v.data.length, f(l);
|
|
1105
|
+
}
|
|
1106
|
+
if (a.api == null || l.localOnly)
|
|
1107
|
+
return f(l);
|
|
1108
|
+
e.value ?? (e.value = []);
|
|
1109
|
+
try {
|
|
1110
|
+
return await N(l), f(l);
|
|
1111
|
+
} catch (v) {
|
|
1112
|
+
let w = v;
|
|
1113
|
+
throw new Error(w.message ?? "Problem");
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
async function u(l) {
|
|
1117
|
+
var w, o, g, h;
|
|
1118
|
+
const i = L(l.proxyID), d = l.id ?? ((w = l.data) == null ? void 0 : w.id);
|
|
1119
|
+
if (d == null)
|
|
1120
|
+
throw new Error("no id provided");
|
|
1121
|
+
let v = l.refresh;
|
|
1122
|
+
if (!v && e.value != null) {
|
|
1123
|
+
const b = e.value.find((S) => y(S) == d);
|
|
1124
|
+
if (b != null)
|
|
1125
|
+
return { data: b };
|
|
1126
|
+
}
|
|
1127
|
+
if (await F(l.proxyID), !v && D == !0) {
|
|
1128
|
+
const b = await B().getItem(i);
|
|
1129
|
+
if (b != null) {
|
|
1130
|
+
e.value = b.data, m.value = b.data.length;
|
|
1131
|
+
let S = (o = e.value) == null ? void 0 : o.find((I) => y(I) == d);
|
|
1132
|
+
if (S != null)
|
|
1133
|
+
return { data: S };
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
if (a.api == null || l.localOnly)
|
|
1137
|
+
return {
|
|
1138
|
+
data: (g = e.value) == null ? void 0 : g.find((b) => y(b) == d)
|
|
1139
|
+
};
|
|
1140
|
+
e.value ?? (e.value = []);
|
|
1141
|
+
try {
|
|
1142
|
+
return await N(l), { data: (h = e.value) == null ? void 0 : h.find((b) => y(b) == d) };
|
|
1143
|
+
} catch (b) {
|
|
1144
|
+
let S = b;
|
|
1145
|
+
throw new Error(S.message ?? "Problem");
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
async function r(l) {
|
|
1149
|
+
var v, w, o;
|
|
1150
|
+
l.additionalUrl ?? (l.additionalUrl = "/patch");
|
|
1151
|
+
let i;
|
|
1152
|
+
if (a.api != null && l.localOnly !== !0)
|
|
1153
|
+
try {
|
|
1154
|
+
let g = await a.api.patch(l);
|
|
1155
|
+
i = { ...l.data, ...g == null ? void 0 : g.data };
|
|
1156
|
+
} catch (g) {
|
|
1157
|
+
let h = g;
|
|
1158
|
+
throw new Error(h.message ?? "Patch Problem");
|
|
1159
|
+
}
|
|
1160
|
+
else
|
|
1161
|
+
i = l.data;
|
|
1162
|
+
if (i != null) {
|
|
1163
|
+
let g = (v = e.value) == null ? void 0 : v.findIndex((h) => y(h) == y(i));
|
|
1164
|
+
g != null && g >= 0 && (e.value ?? (e.value = []), (w = e.value) == null || w.splice(g, 1, i), await k(l.proxyID));
|
|
1165
|
+
}
|
|
1166
|
+
const d = y(i) ?? l.id ?? y(l.data);
|
|
1167
|
+
return (o = e.value) == null ? void 0 : o.find((g) => y(g) == d);
|
|
1168
|
+
}
|
|
1169
|
+
async function t(l) {
|
|
1170
|
+
var v, w;
|
|
1171
|
+
l.additionalUrl ?? (l.additionalUrl = "/post");
|
|
1172
|
+
let i;
|
|
1173
|
+
if (a.api != null && l.localOnly !== !0)
|
|
1174
|
+
try {
|
|
1175
|
+
let o = await a.api.post(l);
|
|
1176
|
+
i = o == null ? void 0 : o.data;
|
|
1177
|
+
} catch (o) {
|
|
1178
|
+
let g = o;
|
|
1179
|
+
throw new Error(g.message ?? "Patch Problem");
|
|
1180
|
+
}
|
|
1181
|
+
else
|
|
1182
|
+
i = l.data;
|
|
1183
|
+
i != null && (e.value ?? (e.value = []), (v = e.value) == null || v.unshift(i), m.value += 1, await k(l.proxyID));
|
|
1184
|
+
const d = y(i) ?? l.id ?? y(l.data);
|
|
1185
|
+
return (w = e.value) == null ? void 0 : w.find((o) => y(o) == d);
|
|
1186
|
+
}
|
|
1187
|
+
async function n(l) {
|
|
1188
|
+
var v, w;
|
|
1189
|
+
l.additionalUrl ?? (l.additionalUrl = "/delete");
|
|
1190
|
+
let i;
|
|
1191
|
+
if (a.api != null && l.localOnly !== !0)
|
|
1192
|
+
try {
|
|
1193
|
+
let o = await a.api.deleteItem(l);
|
|
1194
|
+
i = { ...l.data, ...o == null ? void 0 : o.data };
|
|
1195
|
+
} catch (o) {
|
|
1196
|
+
let g = o;
|
|
1197
|
+
throw new Error(g.message ?? "Patch Problem");
|
|
1198
|
+
}
|
|
1199
|
+
else
|
|
1200
|
+
i = l.data;
|
|
1201
|
+
const d = l.id ?? y(l.data);
|
|
1202
|
+
if (d != null) {
|
|
1203
|
+
let o = (v = e.value) == null ? void 0 : v.findIndex((g) => y(g) == d);
|
|
1204
|
+
o != null && o >= 0 && (e.value ?? (e.value = []), (w = e.value) == null || w.splice(o, 1), await k(l.proxyID));
|
|
1205
|
+
}
|
|
1206
|
+
return i;
|
|
1207
|
+
}
|
|
1208
|
+
async function c(l) {
|
|
1209
|
+
var d;
|
|
1210
|
+
const i = l.id ?? y(l.data);
|
|
1211
|
+
if (l.additionalUrl ?? (l.additionalUrl = `/restore?id=${i}`), a.api != null && l.localOnly !== !0)
|
|
1212
|
+
try {
|
|
1213
|
+
await a.api.patch(l);
|
|
1214
|
+
} catch (v) {
|
|
1215
|
+
let w = v;
|
|
1216
|
+
throw new Error(w.message ?? "Patch Problem");
|
|
1217
|
+
}
|
|
1218
|
+
try {
|
|
1219
|
+
l.additionalUrl = "/getAll", await N(l);
|
|
1220
|
+
} catch (v) {
|
|
1221
|
+
let w = v;
|
|
1222
|
+
throw new Error(w.message ?? "Problem");
|
|
1223
|
+
}
|
|
1224
|
+
return (d = e.value) == null ? void 0 : d.find((v) => v.id == i);
|
|
1225
|
+
}
|
|
1226
|
+
return {
|
|
1227
|
+
$reset: K,
|
|
1228
|
+
deleteItem: n,
|
|
1229
|
+
get: u,
|
|
1230
|
+
getAll: P,
|
|
1231
|
+
patch: r,
|
|
1232
|
+
post: t,
|
|
1233
|
+
restore: c,
|
|
1234
|
+
//other stuff
|
|
1235
|
+
dataItems: e,
|
|
1236
|
+
count: m,
|
|
1237
|
+
currentTimeStampHours: x,
|
|
1238
|
+
// filters,
|
|
1239
|
+
meta: s,
|
|
1240
|
+
promiseMemory: T,
|
|
1241
|
+
cacheLocally: D
|
|
1242
|
+
};
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
export {
|
|
1246
|
+
$e as createBlobStoreBuilder,
|
|
1247
|
+
ie as createBlobStoreDefinition,
|
|
1248
|
+
oe as createPartialLastUpdateStoreDefinition,
|
|
1249
|
+
fe as createSessionStoreDefinition,
|
|
1250
|
+
xe as createStoreBuilder,
|
|
1251
|
+
ne as createStoreDefinition,
|
|
1252
|
+
ve as createWholeLastUpdateStoreDefinition,
|
|
1253
|
+
de as createWholeStoreStoreDefinition,
|
|
1254
|
+
Se as useBlobStore,
|
|
1255
|
+
be as useStore,
|
|
1256
|
+
Ie as useStoreDefinition
|
|
1257
|
+
};
|