{"version":3,"file":"VDialog-YP7MfD8D.js","sources":["../../../node_modules/.pnpm/vuetify@2.7.2_vue@2.7.16/node_modules/vuetify/lib/components/VDialog/VDialog.js"],"sourcesContent":["// Styles\nimport \"../../../src/components/VDialog/VDialog.sass\"; // Components\n\nimport { VThemeProvider } from '../VThemeProvider'; // Mixins\n\nimport Activatable from '../../mixins/activatable';\nimport Dependent from '../../mixins/dependent';\nimport Detachable from '../../mixins/detachable';\nimport Overlayable from '../../mixins/overlayable';\nimport Returnable from '../../mixins/returnable';\nimport Stackable from '../../mixins/stackable'; // Directives\n\nimport ClickOutside from '../../directives/click-outside'; // Helpers\n\nimport mixins from '../../util/mixins';\nimport { removed } from '../../util/console';\nimport { convertToUnit, keyCodes } from '../../util/helpers';\nconst baseMixins = mixins(Dependent, Detachable, Overlayable, Returnable, Stackable, Activatable);\n/* @vue/component */\n\nexport default baseMixins.extend({\n name: 'v-dialog',\n directives: {\n ClickOutside\n },\n props: {\n dark: Boolean,\n disabled: Boolean,\n fullscreen: Boolean,\n light: Boolean,\n maxWidth: [String, Number],\n noClickAnimation: Boolean,\n origin: {\n type: String,\n default: 'center center'\n },\n persistent: Boolean,\n retainFocus: {\n type: Boolean,\n default: true\n },\n scrollable: Boolean,\n transition: {\n type: [String, Boolean],\n default: 'dialog-transition'\n },\n width: [String, Number]\n },\n\n data() {\n return {\n activatedBy: null,\n animate: false,\n animateTimeout: -1,\n stackMinZIndex: 200,\n previousActiveElement: null\n };\n },\n\n computed: {\n classes() {\n return {\n [`v-dialog ${this.contentClass}`.trim()]: true,\n 'v-dialog--active': this.isActive,\n 'v-dialog--persistent': this.persistent,\n 'v-dialog--fullscreen': this.fullscreen,\n 'v-dialog--scrollable': this.scrollable,\n 'v-dialog--animated': this.animate\n };\n },\n\n contentClasses() {\n return {\n 'v-dialog__content': true,\n 'v-dialog__content--active': this.isActive\n };\n },\n\n hasActivator() {\n return Boolean(!!this.$slots.activator || !!this.$scopedSlots.activator);\n }\n\n },\n watch: {\n isActive(val) {\n var _a;\n\n if (val) {\n this.show();\n this.hideScroll();\n } else {\n this.removeOverlay();\n this.unbind();\n (_a = this.previousActiveElement) === null || _a === void 0 ? void 0 : _a.focus();\n }\n },\n\n fullscreen(val) {\n if (!this.isActive) return;\n\n if (val) {\n this.hideScroll();\n this.removeOverlay(false);\n } else {\n this.showScroll();\n this.genOverlay();\n }\n }\n\n },\n\n created() {\n /* istanbul ignore next */\n if (this.$attrs.hasOwnProperty('full-width')) {\n removed('full-width', this);\n }\n },\n\n beforeMount() {\n this.$nextTick(() => {\n this.isBooted = this.isActive;\n this.isActive && this.show();\n });\n },\n\n beforeDestroy() {\n if (typeof window !== 'undefined') this.unbind();\n },\n\n methods: {\n animateClick() {\n this.animate = false; // Needed for when clicking very fast\n // outside of the dialog\n\n this.$nextTick(() => {\n this.animate = true;\n window.clearTimeout(this.animateTimeout);\n this.animateTimeout = window.setTimeout(() => this.animate = false, 150);\n });\n },\n\n closeConditional(e) {\n const target = e.target; // Ignore the click if the dialog is closed or destroyed,\n // if it was on an element inside the content,\n // if it was dragged onto the overlay (#6969),\n // or if this isn't the topmost dialog (#9907)\n\n return !(this._isDestroyed || !this.isActive || this.$refs.content.contains(target) || this.overlay && target && !this.overlay.$el.contains(target)) && this.activeZIndex >= this.getMaxZIndex();\n },\n\n hideScroll() {\n if (this.fullscreen) {\n document.documentElement.classList.add('overflow-y-hidden');\n } else {\n Overlayable.options.methods.hideScroll.call(this);\n }\n },\n\n show() {\n !this.fullscreen && !this.hideOverlay && this.genOverlay(); // Double nextTick to wait for lazy content to be generated\n\n this.$nextTick(() => {\n this.$nextTick(() => {\n var _a, _b;\n\n if (!((_a = this.$refs.dialog) === null || _a === void 0 ? void 0 : _a.contains(document.activeElement))) {\n this.previousActiveElement = document.activeElement;\n (_b = this.$refs.dialog) === null || _b === void 0 ? void 0 : _b.focus();\n }\n\n this.bind();\n });\n });\n },\n\n bind() {\n window.addEventListener('focusin', this.onFocusin);\n },\n\n unbind() {\n window.removeEventListener('focusin', this.onFocusin);\n },\n\n onClickOutside(e) {\n this.$emit('click:outside', e);\n\n if (this.persistent) {\n this.noClickAnimation || this.animateClick();\n } else {\n this.isActive = false;\n }\n },\n\n onKeydown(e) {\n if (e.keyCode === keyCodes.esc && !this.getOpenDependents().length) {\n if (!this.persistent) {\n this.isActive = false;\n const activator = this.getActivator();\n this.$nextTick(() => activator && activator.focus());\n } else if (!this.noClickAnimation) {\n this.animateClick();\n }\n }\n\n this.$emit('keydown', e);\n },\n\n // On focus change, wrap focus to stay inside the dialog\n // https://github.com/vuetifyjs/vuetify/issues/6892\n onFocusin(e) {\n if (!e || !this.retainFocus) return;\n const target = e.target;\n\n if (!!target && this.$refs.dialog && // It isn't the document or the dialog body\n ![document, this.$refs.dialog].includes(target) && // It isn't inside the dialog body\n !this.$refs.dialog.contains(target) && // We're the topmost dialog\n this.activeZIndex >= this.getMaxZIndex() && // It isn't inside a dependent element (like a menu)\n !this.getOpenDependentElements().some(el => el.contains(target)) // So we must have focused something outside the dialog and its children\n ) {\n // Find and focus the first available element inside the dialog\n const focusable = this.$refs.dialog.querySelectorAll('button, [href], input:not([type=\"hidden\"]), select, textarea, [tabindex]:not([tabindex=\"-1\"])');\n const el = [...focusable].find(el => !el.hasAttribute('disabled') && !el.matches('[tabindex=\"-1\"]'));\n el && el.focus();\n }\n },\n\n genContent() {\n return this.showLazyContent(() => [this.$createElement(VThemeProvider, {\n props: {\n root: true,\n light: this.light,\n dark: this.dark\n }\n }, [this.$createElement('div', {\n class: this.contentClasses,\n attrs: {\n role: 'dialog',\n 'aria-modal': this.hideOverlay ? undefined : 'true',\n ...this.getScopeIdAttrs()\n },\n on: {\n keydown: this.onKeydown\n },\n style: {\n zIndex: this.activeZIndex\n },\n ref: 'content'\n }, [this.genTransition()])])]);\n },\n\n genTransition() {\n const content = this.genInnerContent();\n if (!this.transition) return content;\n return this.$createElement('transition', {\n props: {\n name: this.transition,\n origin: this.origin,\n appear: true\n }\n }, [content]);\n },\n\n genInnerContent() {\n const data = {\n class: this.classes,\n attrs: {\n tabindex: this.isActive ? 0 : undefined\n },\n ref: 'dialog',\n directives: [{\n name: 'click-outside',\n value: {\n handler: this.onClickOutside,\n closeConditional: this.closeConditional,\n include: this.getOpenDependentElements\n }\n }, {\n name: 'show',\n value: this.isActive\n }],\n style: {\n transformOrigin: this.origin\n }\n };\n\n if (!this.fullscreen) {\n data.style = { ...data.style,\n maxWidth: convertToUnit(this.maxWidth),\n width: convertToUnit(this.width)\n };\n }\n\n return this.$createElement('div', data, this.getContentSlot());\n }\n\n },\n\n render(h) {\n return h('div', {\n staticClass: 'v-dialog__container',\n class: {\n 'v-dialog__container--attached': this.attach === '' || this.attach === true || this.attach === 'attach'\n }\n }, [this.genActivator(), this.genContent()]);\n }\n\n});\n//# sourceMappingURL=VDialog.js.map"],"names":["baseMixins","mixins","Dependent","Detachable","Overlayable","Returnable","Stackable","Activatable","__unplugin_components_31","ClickOutside","val","_a","removed","e","target","_b","keyCodes","activator","el","VThemeProvider","__spreadValues","content","data","__spreadProps","convertToUnit","h"],"mappings":"qgCAiBA,MAAMA,EAAaC,EAAOC,EAAWC,EAAYC,EAAaC,EAAYC,EAAWC,CAAW,EAGjFC,EAAAR,EAAW,OAAO,CAC/B,KAAM,WACN,WAAY,CACV,aAAAS,CACD,EACD,MAAO,CACL,KAAM,QACN,SAAU,QACV,WAAY,QACZ,MAAO,QACP,SAAU,CAAC,OAAQ,MAAM,EACzB,iBAAkB,QAClB,OAAQ,CACN,KAAM,OACN,QAAS,eACV,EACD,WAAY,QACZ,YAAa,CACX,KAAM,QACN,QAAS,EACV,EACD,WAAY,QACZ,WAAY,CACV,KAAM,CAAC,OAAQ,OAAO,EACtB,QAAS,mBACV,EACD,MAAO,CAAC,OAAQ,MAAM,CACvB,EAED,MAAO,CACL,MAAO,CACL,YAAa,KACb,QAAS,GACT,eAAgB,GAChB,eAAgB,IAChB,sBAAuB,IACxB,CACF,EAED,SAAU,CACR,SAAU,CACR,MA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