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;AACX,gBAAI,OAAO,MAAP,KAAkB,WAAtB,EAAmC;AAEnC,mBAAO,mBAAP,CAA2B,QAA3B,EAAqC,KAAK,QAA1C;AACD,SA9Fe;;AAgGhB,iBAAS;AACP,oBADO,sBACC;AACN,6BAAa,KAAK,aAAlB;AAEA;AACA;AACA;AACA;AACA,qBAAK,aAAL,GAAqB,OAAO,UAAP,CAAkB,KAAK,aAAvB,EAAsC,GAAtC,CAArB;AACD,aATM;AAUP,yBAVO,2BAUM;AACX,qBAAK,YAAL,GAAoB,iBAApB;AACA,qBAAK,WAAL,GAAmB,gBAAnB;AACD;AAbM;AAhGO,KAAX,CAAP;AAgHD;AAED;AACA;AACA,SAAS,cAAT,GAAuB;AACrB,QAAI,OAAO,QAAP,KAAoB,WAAxB,EAAqC,OAAO,CAAP,CADhB,CACyB;AAC9C,WAAO,KAAK,GAAL,CACL,SAAS,eAAT,CAA0B,WADrB,EAEL,OAAO,UAAP,IAAqB,CAFhB,CAAP;AAID;AAED,SAAS,eAAT,GAAwB;AACtB,QAAI,OAAO,QAAP,KAAoB,WAAxB,EAAqC,OAAO,CAAP,CADf,CACwB;AAC9C,WAAO,KAAK,GAAL,CACL,SAAS,eAAT,CAA0B,YADrB,EAEL,OAAO,WAAP,IAAsB,CAFjB,CAAP;AAID","sourcesContent":["import Vue from 'vue'\nimport { VuetifyUseOptions, VuetifyBreakpoint } from 'vuetify/types'\n\nconst BREAKPOINTS_DEFAULTS = {\n thresholds: {\n xs: 600,\n sm: 960,\n md: 1280,\n lg: 1920\n },\n scrollbarWidth: 16\n}\n\n/**\n * Factory function for the breakpoint mixin.\n */\nexport default function breakpoint (opts: VuetifyUseOptions['breakpoint'] = {}) {\n if (!opts) {\n opts = {}\n }\n\n return Vue.extend({\n data () {\n return {\n clientHeight: getClientHeight(),\n clientWidth: getClientWidth(),\n resizeTimeout: undefined as number | undefined,\n\n ...BREAKPOINTS_DEFAULTS,\n ...opts\n }\n },\n\n computed: {\n breakpoint (): VuetifyBreakpoint {\n const xs = this.clientWidth < this.thresholds.xs\n const sm = this.clientWidth < this.thresholds.sm && !xs\n const md = this.clientWidth < (this.thresholds.md - this.scrollbarWidth) && !(sm || xs)\n const lg = this.clientWidth < (this.thresholds.lg - this.scrollbarWidth) && !(md || sm || xs)\n const xl = this.clientWidth >= (this.thresholds.lg - this.scrollbarWidth)\n\n const xsOnly = xs\n const smOnly = sm\n const smAndDown = (xs || sm) && !(md || lg || xl)\n const smAndUp = !xs && (sm || md || lg || xl)\n const mdOnly = md\n const mdAndDown = (xs || sm || md) && !(lg || xl)\n const mdAndUp = !(xs || sm) && (md || lg || xl)\n const lgOnly = lg\n const lgAndDown = (xs || sm || md || lg) && !xl\n const lgAndUp = !(xs || sm || md) && (lg || xl)\n const xlOnly = xl\n\n let name\n switch (true) {\n case (xs):\n name = 'xs'\n break\n case (sm):\n name = 'sm'\n break\n case (md):\n name = 'md'\n break\n case (lg):\n name = 'lg'\n break\n default:\n name = 'xl'\n break\n }\n\n return {\n // Definite breakpoint.\n xs,\n sm,\n md,\n lg,\n xl,\n\n // Useful e.g. to construct CSS class names dynamically.\n name,\n\n // Breakpoint ranges.\n xsOnly,\n smOnly,\n smAndDown,\n smAndUp,\n mdOnly,\n mdAndDown,\n mdAndUp,\n lgOnly,\n lgAndDown,\n lgAndUp,\n xlOnly,\n\n // For custom breakpoint logic.\n width: this.clientWidth,\n height: this.clientHeight,\n thresholds: this.thresholds,\n scrollbarWidth: this.scrollbarWidth\n }\n }\n },\n\n created () {\n if (typeof window === 'undefined') return\n\n window.addEventListener('resize', this.onResize, { passive: true })\n },\n\n beforeDestroy () {\n if (typeof window === 'undefined') return\n\n window.removeEventListener('resize', this.onResize)\n },\n\n methods: {\n onResize (): void {\n clearTimeout(this.resizeTimeout)\n\n // Added debounce to match what\n // v-resize used to do but was\n // removed due to a memory leak\n // https://github.com/vuetifyjs/vuetify/pull/2997\n this.resizeTimeout = window.setTimeout(this.setDimensions, 200)\n },\n setDimensions (): void {\n this.clientHeight = getClientHeight()\n this.clientWidth = getClientWidth()\n }\n }\n })\n}\n\n// Cross-browser support as described in:\n// https://stackoverflow.com/questions/1248081\nfunction getClientWidth () {\n if (typeof document === 'undefined') return 0 // SSR\n return Math.max(\n document.documentElement!.clientWidth,\n window.innerWidth || 0\n )\n}\n\nfunction getClientHeight () {\n if (typeof document === 'undefined') return 0 // SSR\n return Math.max(\n document.documentElement!.clientHeight,\n window.innerHeight || 0\n )\n}\n"],"sourceRoot":""}