{"version":3,"sources":["webpack:///../../../src/mixins/rippleable/index.ts","webpack:///./src/views/settings/components/DarkModeSwitch.vue?5673","webpack:///./src/views/settings/components/DarkModeSwitch.vue","webpack:///./src/views/settings/components/DarkModeSwitch.vue?02c4","webpack:///./src/views/settings/components/DarkModeSwitch.vue?8b08","webpack:///../../../src/components/VSwitch/VSwitch.ts","webpack:///../../../src/mixins/selectable/index.ts"],"names":["Vue","extend","name","directives","ripple","props","type","Boolean","Object","default","methods","genRipple","data","this","staticClass","push","value","center","$createElement","render","_vm","_h","_c","_self","VSwitch","attrs","label","model","$vuetify","theme","callback","$$v","$set","expression","staticRenderFns","DarkModeSwitch","mode","Storage","setDarkMode","showLabel","__decorate","Prop","Watch","Component","component","Selectable","Touch","inset","loading","String","flat","computed","classes","VInput","options","call","isActive","isDisabled","role","validationState","hasError","shouldValidate","hasSuccess","hasColor","computedColor","switchData","setTextColor","undefined","class","themeClasses","genDefaultSlot","genSwitch","genLabel","attrs$","switchAttrs","title","genInput","left","onSwipeLeft","right","onSwipeRight","genProgress","VFabTransition","$slots","progress","VProgressCircular","color","size","width","indeterminate","onChange","onKeydown","e","keyCode","keyCodes","prevent","preventDefault","mixins","Rippleable","Comparable","prop","event","id","inputValue","falseValue","trueValue","multiple","lazyValue","isDark","appIsDark","isMultiple","Array","isArray","internalValue","input","some","item","valueComparator","isDirty","rippleState","watch","val","on","click","assign","toString","disabled","computedId","domProps","checked","blur","onBlur","change","focus","onFocus","keydown","ref","onClick","$emit","isInteractive","length","filter","validate","isFocused"],"mappings":"gHAAA,4BAMeA,oBAAIC,OAAO,CACxBC,KAAM,aAENC,WAAY,CAAEC,eAEdC,MAAO,CACLD,OAAQ,CACNE,KAAM,CAACC,QAASC,QAChBC,SAAS,IAIbC,QAAS,CACPC,UAAS,WAAsB,IAApBC,yDAAkB,GAC3B,OAAKC,KAAKT,QAEVQ,EAAKE,YAAc,sCAEnBF,EAAKT,WAAaS,EAAKT,YAAc,GACrCS,EAAKT,WAAWY,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K6H,MAAM,QAAS9C,IAEtBuC,OAAM,SAAEvC,GACN/E,KAAKkI,WAAY,EACjBlI,KAAK6H,MAAM,OAAQ9C,IAGrBD,UAAS,SAAEC","file":"assets/js/chunk-dfd2cbfe.28dc5c1f.js","sourcesContent":["// Directives\nimport ripple from '../../directives/ripple'\n\n// Types\nimport Vue, { VNode, VNodeData, VNodeDirective } from 'vue'\n\nexport default Vue.extend({\n name: 'rippleable',\n\n directives: { ripple },\n\n props: {\n ripple: {\n type: [Boolean, Object],\n default: true,\n },\n },\n\n methods: {\n genRipple (data: VNodeData = {}): VNode | null {\n if (!this.ripple) return null\n\n data.staticClass = 'v-input--selection-controls__ripple'\n\n data.directives = data.directives || []\n data.directives.push({\n name: 'ripple',\n value: { center: true },\n } as VNodeDirective)\n\n return this.$createElement('div', data)\n },\n },\n})\n","import { VSwitch } from 'vuetify/lib/components/VSwitch';\n\nvar render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"px-4\"},[_c(VSwitch,{staticClass:\"font-weight-bold mt-0\",attrs:{\"inset\":\"\",\"hide-details\":\"\",\"label\":_vm.label},model:{value:(_vm.$vuetify.theme.dark),callback:function ($$v) {_vm.$set(_vm.$vuetify.theme, \"dark\", $$v)},expression:\"$vuetify.theme.dark\"}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport Vue from \"vue\";\r\nimport { Component, Watch, Prop } from \"vue-property-decorator\";\r\nimport Storage from \"@/core/utils/LocalStorage\";\r\n\r\n@Component\r\nexport default class DarkModeSwitch extends Vue {\r\n @Prop({ default: () => true }) showLabel!: boolean;\r\n @Watch(\"$vuetify.theme.dark\")\r\n toggleMode(mode: boolean) {\r\n Storage.setDarkMode(mode);\r\n }\r\n\r\n get label() {\r\n if (this.showLabel) return \"Dark Mode\";\r\n return \"\";\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DarkModeSwitch.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DarkModeSwitch.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./DarkModeSwitch.vue?vue&type=template&id=7d7afecc&\"\nimport script from \"./DarkModeSwitch.vue?vue&type=script&lang=ts&\"\nexport * from \"./DarkModeSwitch.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","// Styles\nimport '../../styles/components/_selection-controls.sass'\nimport './VSwitch.sass'\n\n// Mixins\nimport Selectable from '../../mixins/selectable'\nimport VInput from '../VInput'\n\n// Directives\nimport Touch from '../../directives/touch'\n\n// Components\nimport { VFabTransition } from '../transitions'\nimport VProgressCircular from '../VProgressCircular/VProgressCircular'\n\n// Helpers\nimport { keyCodes } from '../../util/helpers'\n\n// Types\nimport { VNode, VNodeData } from 'vue'\n\n/* @vue/component */\nexport default Selectable.extend({\n name: 'v-switch',\n\n directives: { Touch },\n\n props: {\n inset: Boolean,\n loading: {\n type: [Boolean, String],\n default: false,\n },\n flat: {\n type: Boolean,\n default: false,\n },\n },\n\n computed: {\n classes (): object {\n return {\n ...VInput.options.computed.classes.call(this),\n 'v-input--selection-controls v-input--switch': true,\n 'v-input--switch--flat': this.flat,\n 'v-input--switch--inset': this.inset,\n }\n },\n attrs (): object {\n return {\n 'aria-checked': String(this.isActive),\n 'aria-disabled': String(this.isDisabled),\n role: 'switch',\n }\n },\n // Do not return undefined if disabled,\n // according to spec, should still show\n // a color when disabled and active\n validationState (): string | undefined {\n if (this.hasError && this.shouldValidate) return 'error'\n if (this.hasSuccess) return 'success'\n if (this.hasColor !== null) return this.computedColor\n return undefined\n },\n switchData (): VNodeData {\n return this.setTextColor(this.loading ? undefined : this.validationState, {\n class: this.themeClasses,\n })\n },\n },\n\n methods: {\n genDefaultSlot (): (VNode | null)[] {\n return [\n this.genSwitch(),\n this.genLabel(),\n ]\n },\n genSwitch (): VNode {\n const { title, ...switchAttrs } = this.attrs$\n\n return this.$createElement('div', {\n staticClass: 'v-input--selection-controls__input',\n }, [\n this.genInput('checkbox', {\n ...this.attrs,\n ...switchAttrs,\n }),\n this.genRipple(this.setTextColor(this.validationState, {\n directives: [{\n name: 'touch',\n value: {\n left: this.onSwipeLeft,\n right: this.onSwipeRight,\n },\n }],\n })),\n this.$createElement('div', {\n staticClass: 'v-input--switch__track',\n ...this.switchData,\n }),\n this.$createElement('div', {\n staticClass: 'v-input--switch__thumb',\n ...this.switchData,\n }, [this.genProgress()]),\n ])\n },\n genProgress (): VNode {\n return this.$createElement(VFabTransition, {}, [\n this.loading === false\n ? null\n : this.$slots.progress || this.$createElement(VProgressCircular, {\n props: {\n color: (this.loading === true || this.loading === '')\n ? (this.color || 'primary')\n : this.loading,\n size: 16,\n width: 2,\n indeterminate: true,\n },\n }),\n ])\n },\n onSwipeLeft () {\n if (this.isActive) this.onChange()\n },\n onSwipeRight () {\n if (!this.isActive) this.onChange()\n },\n onKeydown (e: KeyboardEvent) {\n if (\n (e.keyCode === keyCodes.left && this.isActive) ||\n (e.keyCode === keyCodes.right && !this.isActive)\n ) this.onChange()\n },\n },\n})\n","// Components\nimport VInput from '../../components/VInput'\n\n// Mixins\nimport Rippleable from '../rippleable'\nimport Comparable from '../comparable'\n\n// Utilities\nimport mixins from '../../util/mixins'\n\nexport function prevent (e: Event) {\n e.preventDefault()\n}\n\n/* @vue/component */\nexport default mixins(\n VInput,\n Rippleable,\n Comparable\n).extend({\n name: 'selectable',\n\n model: {\n prop: 'inputValue',\n event: 'change',\n },\n\n props: {\n id: String,\n inputValue: null as any,\n falseValue: null as any,\n trueValue: null as any,\n multiple: {\n type: Boolean,\n default: null,\n },\n label: String,\n },\n\n data () {\n return {\n hasColor: this.inputValue,\n lazyValue: this.inputValue,\n }\n },\n\n computed: {\n computedColor (): string | undefined {\n if (!this.isActive) return undefined\n if (this.color) return this.color\n if (this.isDark && !this.appIsDark) return 'white'\n return 'primary'\n },\n isMultiple (): boolean {\n return this.multiple === true || (this.multiple === null && Array.isArray(this.internalValue))\n },\n isActive (): boolean {\n const value = this.value\n const input = this.internalValue\n\n if (this.isMultiple) {\n if (!Array.isArray(input)) return false\n\n return input.some(item => this.valueComparator(item, value))\n }\n\n if (this.trueValue === undefined || this.falseValue === undefined) {\n return value\n ? this.valueComparator(value, input)\n : Boolean(input)\n }\n\n return this.valueComparator(input, this.trueValue)\n },\n isDirty (): boolean {\n return this.isActive\n },\n rippleState (): string | undefined {\n return !this.isDisabled && !this.validationState\n ? undefined\n : this.validationState\n },\n },\n\n watch: {\n inputValue (val) {\n this.lazyValue = val\n this.hasColor = val\n },\n },\n\n methods: {\n genLabel () {\n const label = VInput.options.methods.genLabel.call(this)\n\n if (!label) return label\n\n label!.data!.on = {\n // Label shouldn't cause the input to focus\n click: prevent,\n }\n\n return label\n },\n genInput (type: string, attrs: object) {\n return this.$createElement('input', {\n attrs: Object.assign({\n 'aria-checked': this.isActive.toString(),\n disabled: this.isDisabled,\n id: this.computedId,\n role: type,\n type,\n }, attrs),\n domProps: {\n value: this.value,\n checked: this.isActive,\n },\n on: {\n blur: this.onBlur,\n change: this.onChange,\n focus: this.onFocus,\n keydown: this.onKeydown,\n click: prevent,\n },\n ref: 'input',\n })\n },\n onClick (e: Event) {\n this.onChange()\n this.$emit('click', e)\n },\n onChange () {\n if (!this.isInteractive) return\n\n const value = this.value\n let input = this.internalValue\n\n if (this.isMultiple) {\n if (!Array.isArray(input)) {\n input = []\n }\n\n const length = input.length\n\n input = input.filter((item: any) => !this.valueComparator(item, value))\n\n if (input.length === length) {\n input.push(value)\n }\n } else if (this.trueValue !== undefined && this.falseValue !== undefined) {\n input = this.valueComparator(input, this.trueValue) ? this.falseValue : this.trueValue\n } else if (value) {\n input = this.valueComparator(input, value) ? null : value\n } else {\n input = !input\n }\n\n this.validate(true, input)\n this.internalValue = input\n this.hasColor = input\n },\n onFocus (e: FocusEvent) {\n this.isFocused = true\n this.$emit('focus', e)\n },\n onBlur (e: FocusEvent) {\n this.isFocused = false\n this.$emit('blur', e)\n },\n /** @abstract */\n onKeydown (e: Event) {},\n },\n})\n"],"sourceRoot":""}