diff options
author | Mark Otto <markdotto@gmail.com> | 2020-06-14 01:40:28 +0300 |
---|---|---|
committer | Mark Otto <otto@github.com> | 2020-06-14 23:52:54 +0300 |
commit | a6564588567a14ebc4bfa4e50358f1c32e3b10d7 (patch) | |
tree | 37b84533c45e6286d75918c9d0221895ec659ce2 /js/dist/button.js.map | |
parent | cde53a85d14d22b3eba6f96b7e01490848da047e (diff) |
Run dist on latest
Diffstat (limited to 'js/dist/button.js.map')
-rw-r--r-- | js/dist/button.js.map | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/js/dist/button.js.map b/js/dist/button.js.map index d80d999a22..3cb297a545 100644 --- a/js/dist/button.js.map +++ b/js/dist/button.js.map @@ -1 +1 @@ -{"version":3,"file":"button.js","sources":["../src/util/index.js","../src/button.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-alpha1): util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1000000\nconst MILLISECONDS_MULTIPLIER = 1000\nconst TRANSITION_END = 'transitionend'\n\n// Shoutout AngusCroll (https://goo.gl/pxwQGp)\nconst toType = obj => {\n if (obj === null || obj === undefined) {\n return `${obj}`\n }\n\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\n/**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\nconst getUID = prefix => {\n do {\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n\n return prefix\n}\n\nconst getSelector = element => {\n let selector = element.getAttribute('data-target')\n\n if (!selector || selector === '#') {\n const hrefAttr = element.getAttribute('href')\n\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null\n }\n\n return selector\n}\n\nconst getSelectorFromElement = element => {\n const selector = getSelector(element)\n\n if (selector) {\n return document.querySelector(selector) ? selector : null\n }\n\n return null\n}\n\nconst getElementFromSelector = element => {\n const selector = getSelector(element)\n\n return selector ? document.querySelector(selector) : null\n}\n\nconst getTransitionDurationFromElement = element => {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let {\n transitionDuration,\n transitionDelay\n } = window.getComputedStyle(element)\n\n const floatTransitionDuration = parseFloat(transitionDuration)\n const floatTransitionDelay = parseFloat(transitionDelay)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n transitionDelay = transitionDelay.split(',')[0]\n\n return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n}\n\nconst triggerTransitionEnd = element => {\n element.dispatchEvent(new Event(TRANSITION_END))\n}\n\nconst isElement = obj => (obj[0] || obj).nodeType\n\nconst emulateTransitionEnd = (element, duration) => {\n let called = false\n const durationPadding = 5\n const emulatedDuration = duration + durationPadding\n function listener() {\n called = true\n element.removeEventListener(TRANSITION_END, listener)\n }\n\n element.addEventListener(TRANSITION_END, listener)\n setTimeout(() => {\n if (!called) {\n triggerTransitionEnd(element)\n }\n }, emulatedDuration)\n}\n\nconst typeCheckConfig = (componentName, config, configTypes) => {\n Object.keys(configTypes)\n .forEach(property => {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && isElement(value) ?\n 'element' :\n toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n })\n}\n\nconst isVisible = element => {\n if (!element) {\n return false\n }\n\n if (element.style && element.parentNode && element.parentNode.style) {\n const elementStyle = getComputedStyle(element)\n const parentNodeStyle = getComputedStyle(element.parentNode)\n\n return elementStyle.display !== 'none' &&\n parentNodeStyle.display !== 'none' &&\n elementStyle.visibility !== 'hidden'\n }\n\n return false\n}\n\nconst findShadowRoot = element => {\n if (!document.documentElement.attachShadow) {\n return null\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode()\n return root instanceof ShadowRoot ? root : null\n }\n\n if (element instanceof ShadowRoot) {\n return element\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null\n }\n\n return findShadowRoot(element.parentNode)\n}\n\nconst noop = () => function () {}\n\nconst reflow = element => element.offsetHeight\n\nconst getjQuery = () => {\n const { jQuery } = window\n\n if (jQuery && !document.body.hasAttribute('data-no-jquery')) {\n return jQuery\n }\n\n return null\n}\n\nexport {\n getjQuery,\n TRANSITION_END,\n getUID,\n getSelectorFromElement,\n getElementFromSelector,\n getTransitionDurationFromElement,\n triggerTransitionEnd,\n isElement,\n emulateTransitionEnd,\n typeCheckConfig,\n isVisible,\n findShadowRoot,\n noop,\n reflow\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-alpha1): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { getjQuery } from './util/index'\nimport Data from './dom/data'\nimport EventHandler from './dom/event-handler'\nimport SelectorEngine from './dom/selector-engine'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'button'\nconst VERSION = '5.0.0-alpha1'\nconst DATA_KEY = 'bs.button'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst CLASS_NAME_ACTIVE = 'active'\nconst CLASS_NAME_DISABLED = 'disabled'\nconst CLASS_NAME_FOCUS = 'focus'\n\nconst SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^=\"button\"]'\nconst SELECTOR_DATA_TOGGLE = '[data-toggle=\"buttons\"]'\nconst SELECTOR_INPUT = 'input:not([type=\"hidden\"])'\nconst SELECTOR_ACTIVE = '.active'\nconst SELECTOR_BUTTON = '.btn'\n\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_FOCUS_DATA_API = `focus${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_BLUR_DATA_API = `blur${EVENT_KEY}${DATA_API_KEY}`\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Button {\n constructor(element) {\n this._element = element\n Data.setData(element, DATA_KEY, this)\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n toggle() {\n let triggerChangeEvent = true\n let addAriaPressed = true\n\n const rootElement = this._element.closest(SELECTOR_DATA_TOGGLE)\n\n if (rootElement) {\n const input = SelectorEngine.findOne(SELECTOR_INPUT, this._element)\n\n if (input && input.type === 'radio') {\n if (input.checked &&\n this._element.classList.contains(CLASS_NAME_ACTIVE)) {\n triggerChangeEvent = false\n } else {\n const activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE, rootElement)\n\n if (activeElement) {\n activeElement.classList.remove(CLASS_NAME_ACTIVE)\n }\n }\n\n if (triggerChangeEvent) {\n if (input.hasAttribute('disabled') ||\n rootElement.hasAttribute('disabled') ||\n input.classList.contains(CLASS_NAME_DISABLED) ||\n rootElement.classList.contains(CLASS_NAME_DISABLED)) {\n return\n }\n\n input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE)\n EventHandler.trigger(input, 'change')\n }\n\n input.focus()\n addAriaPressed = false\n }\n }\n\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed',\n !this._element.classList.contains(CLASS_NAME_ACTIVE))\n }\n\n if (triggerChangeEvent) {\n this._element.classList.toggle(CLASS_NAME_ACTIVE)\n }\n }\n\n dispose() {\n Data.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Static\n\n static jQueryInterface(config) {\n return this.each(function () {\n let data = Data.getData(this, DATA_KEY)\n\n if (!data) {\n data = new Button(this)\n }\n\n if (config === 'toggle') {\n data[config]()\n }\n })\n }\n\n static getInstance(element) {\n return Data.getData(element, DATA_KEY)\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, event => {\n event.preventDefault()\n\n const button = event.target.closest(SELECTOR_BUTTON)\n\n let data = Data.getData(button, DATA_KEY)\n if (!data) {\n data = new Button(button)\n }\n\n data.toggle()\n})\n\nEventHandler.on(document, EVENT_FOCUS_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, event => {\n const button = event.target.closest(SELECTOR_BUTTON)\n\n if (button) {\n button.classList.add(CLASS_NAME_FOCUS)\n }\n})\n\nEventHandler.on(document, EVENT_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, event => {\n const button = event.target.closest(SELECTOR_BUTTON)\n\n if (button) {\n button.classList.remove(CLASS_NAME_FOCUS)\n }\n})\n\nconst $ = getjQuery()\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .button to jQuery only if jQuery is present\n */\n/* istanbul ignore if */\nif ($) {\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n $.fn[NAME] = Button.jQueryInterface\n $.fn[NAME].Constructor = Button\n\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Button.jQueryInterface\n }\n}\n\nexport default Button\n"],"names":["getjQuery","window","jQuery","document","body","hasAttribute","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","CLASS_NAME_ACTIVE","CLASS_NAME_DISABLED","CLASS_NAME_FOCUS","SELECTOR_DATA_TOGGLE_CARROT","SELECTOR_DATA_TOGGLE","SELECTOR_INPUT","SELECTOR_ACTIVE","SELECTOR_BUTTON","EVENT_CLICK_DATA_API","EVENT_FOCUS_DATA_API","EVENT_BLUR_DATA_API","Button","element","_element","Data","setData","toggle","triggerChangeEvent","addAriaPressed","rootElement","closest","input","SelectorEngine","findOne","type","checked","classList","contains","activeElement","remove","EventHandler","trigger","focus","setAttribute","dispose","removeData","jQueryInterface","config","each","data","getData","getInstance","on","event","preventDefault","button","target","add","$","JQUERY_NO_CONFLICT","fn","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;EA6KA,IAAMA,SAAS,GAAG,SAAZA,SAAY,GAAM;EAAA,gBACHC,MADG;EAAA,MACdC,MADc,WACdA,MADc;;EAGtB,MAAIA,MAAM,IAAI,CAACC,QAAQ,CAACC,IAAT,CAAcC,YAAd,CAA2B,gBAA3B,CAAf,EAA6D;EAC3D,WAAOH,MAAP;EACD;;EAED,SAAO,IAAP;EACD,CARD;;ECjKA;;;;;;EAMA,IAAMI,IAAI,GAAG,QAAb;EACA,IAAMC,OAAO,GAAG,cAAhB;EACA,IAAMC,QAAQ,GAAG,WAAjB;EACA,IAAMC,SAAS,SAAOD,QAAtB;EACA,IAAME,YAAY,GAAG,WAArB;EAEA,IAAMC,iBAAiB,GAAG,QAA1B;EACA,IAAMC,mBAAmB,GAAG,UAA5B;EACA,IAAMC,gBAAgB,GAAG,OAAzB;EAEA,IAAMC,2BAA2B,GAAG,yBAApC;EACA,IAAMC,oBAAoB,GAAG,yBAA7B;EACA,IAAMC,cAAc,GAAG,4BAAvB;EACA,IAAMC,eAAe,GAAG,SAAxB;EACA,IAAMC,eAAe,GAAG,MAAxB;EAEA,IAAMC,oBAAoB,aAAWV,SAAX,GAAuBC,YAAjD;EACA,IAAMU,oBAAoB,aAAWX,SAAX,GAAuBC,YAAjD;EACA,IAAMW,mBAAmB,YAAUZ,SAAV,GAAsBC,YAA/C;EAEA;;;;;;MAMMY;EACJ,kBAAYC,OAAZ,EAAqB;EACnB,SAAKC,QAAL,GAAgBD,OAAhB;EACAE,IAAAA,IAAI,CAACC,OAAL,CAAaH,OAAb,EAAsBf,QAAtB,EAAgC,IAAhC;EACD;;;;;EAQD;WAEAmB,SAAA,kBAAS;EACP,QAAIC,kBAAkB,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../src/util/index.js","../src/button.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-alpha1): util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1000000\nconst MILLISECONDS_MULTIPLIER = 1000\nconst TRANSITION_END = 'transitionend'\n\n// Shoutout AngusCroll (https://goo.gl/pxwQGp)\nconst toType = obj => {\n if (obj === null || obj === undefined) {\n return `${obj}`\n }\n\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\n/**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\nconst getUID = prefix => {\n do {\n prefix += Math.floor(Math.random() * MAX_UID)\n } while (document.getElementById(prefix))\n\n return prefix\n}\n\nconst getSelector = element => {\n let selector = element.getAttribute('data-target')\n\n if (!selector || selector === '#') {\n const hrefAttr = element.getAttribute('href')\n\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null\n }\n\n return selector\n}\n\nconst getSelectorFromElement = element => {\n const selector = getSelector(element)\n\n if (selector) {\n return document.querySelector(selector) ? selector : null\n }\n\n return null\n}\n\nconst getElementFromSelector = element => {\n const selector = getSelector(element)\n\n return selector ? document.querySelector(selector) : null\n}\n\nconst getTransitionDurationFromElement = element => {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let {\n transitionDuration,\n transitionDelay\n } = window.getComputedStyle(element)\n\n const floatTransitionDuration = parseFloat(transitionDuration)\n const floatTransitionDelay = parseFloat(transitionDelay)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n transitionDelay = transitionDelay.split(',')[0]\n\n return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n}\n\nconst triggerTransitionEnd = element => {\n element.dispatchEvent(new Event(TRANSITION_END))\n}\n\nconst isElement = obj => (obj[0] || obj).nodeType\n\nconst emulateTransitionEnd = (element, duration) => {\n let called = false\n const durationPadding = 5\n const emulatedDuration = duration + durationPadding\n function listener() {\n called = true\n element.removeEventListener(TRANSITION_END, listener)\n }\n\n element.addEventListener(TRANSITION_END, listener)\n setTimeout(() => {\n if (!called) {\n triggerTransitionEnd(element)\n }\n }, emulatedDuration)\n}\n\nconst typeCheckConfig = (componentName, config, configTypes) => {\n Object.keys(configTypes)\n .forEach(property => {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && isElement(value) ?\n 'element' :\n toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n })\n}\n\nconst isVisible = element => {\n if (!element) {\n return false\n }\n\n if (element.style && element.parentNode && element.parentNode.style) {\n const elementStyle = getComputedStyle(element)\n const parentNodeStyle = getComputedStyle(element.parentNode)\n\n return elementStyle.display !== 'none' &&\n parentNodeStyle.display !== 'none' &&\n elementStyle.visibility !== 'hidden'\n }\n\n return false\n}\n\nconst findShadowRoot = element => {\n if (!document.documentElement.attachShadow) {\n return null\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode()\n return root instanceof ShadowRoot ? root : null\n }\n\n if (element instanceof ShadowRoot) {\n return element\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null\n }\n\n return findShadowRoot(element.parentNode)\n}\n\nconst noop = () => function () {}\n\nconst reflow = element => element.offsetHeight\n\nconst getjQuery = () => {\n const { jQuery } = window\n\n if (jQuery && !document.body.hasAttribute('data-no-jquery')) {\n return jQuery\n }\n\n return null\n}\n\nexport {\n getjQuery,\n TRANSITION_END,\n getUID,\n getSelectorFromElement,\n getElementFromSelector,\n getTransitionDurationFromElement,\n triggerTransitionEnd,\n isElement,\n emulateTransitionEnd,\n typeCheckConfig,\n isVisible,\n findShadowRoot,\n noop,\n reflow\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-alpha1): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { getjQuery } from './util/index'\nimport Data from './dom/data'\nimport EventHandler from './dom/event-handler'\nimport SelectorEngine from './dom/selector-engine'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'button'\nconst VERSION = '5.0.0-alpha1'\nconst DATA_KEY = 'bs.button'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst CLASS_NAME_ACTIVE = 'active'\nconst CLASS_NAME_DISABLED = 'disabled'\nconst CLASS_NAME_FOCUS = 'focus'\n\nconst SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^=\"button\"]'\nconst SELECTOR_DATA_TOGGLE = '[data-toggle=\"buttons\"]'\nconst SELECTOR_INPUT = 'input:not([type=\"hidden\"])'\nconst SELECTOR_ACTIVE = '.active'\nconst SELECTOR_BUTTON = '.btn'\n\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_FOCUS_DATA_API = `focus${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_BLUR_DATA_API = `blur${EVENT_KEY}${DATA_API_KEY}`\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Button {\n constructor(element) {\n this._element = element\n Data.setData(element, DATA_KEY, this)\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n toggle() {\n let triggerChangeEvent = true\n let addAriaPressed = true\n\n const rootElement = this._element.closest(SELECTOR_DATA_TOGGLE)\n\n if (rootElement) {\n const input = SelectorEngine.findOne(SELECTOR_INPUT, this._element)\n\n if (input && input.type === 'radio') {\n if (input.checked &&\n this._element.classList.contains(CLASS_NAME_ACTIVE)) {\n triggerChangeEvent = false\n } else {\n const activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE, rootElement)\n\n if (activeElement) {\n activeElement.classList.remove(CLASS_NAME_ACTIVE)\n }\n }\n\n if (triggerChangeEvent) {\n if (input.hasAttribute('disabled') ||\n rootElement.hasAttribute('disabled') ||\n input.classList.contains(CLASS_NAME_DISABLED) ||\n rootElement.classList.contains(CLASS_NAME_DISABLED)) {\n return\n }\n\n input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE)\n EventHandler.trigger(input, 'change')\n }\n\n input.focus()\n addAriaPressed = false\n }\n }\n\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed',\n !this._element.classList.contains(CLASS_NAME_ACTIVE))\n }\n\n if (triggerChangeEvent) {\n this._element.classList.toggle(CLASS_NAME_ACTIVE)\n }\n }\n\n dispose() {\n Data.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Static\n\n static jQueryInterface(config) {\n return this.each(function () {\n let data = Data.getData(this, DATA_KEY)\n\n if (!data) {\n data = new Button(this)\n }\n\n if (config === 'toggle') {\n data[config]()\n }\n })\n }\n\n static getInstance(element) {\n return Data.getData(element, DATA_KEY)\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, event => {\n event.preventDefault()\n\n const button = event.target.closest(SELECTOR_BUTTON)\n\n let data = Data.getData(button, DATA_KEY)\n if (!data) {\n data = new Button(button)\n }\n\n data.toggle()\n})\n\nEventHandler.on(document, EVENT_FOCUS_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, event => {\n const button = event.target.closest(SELECTOR_BUTTON)\n\n if (button) {\n button.classList.add(CLASS_NAME_FOCUS)\n }\n})\n\nEventHandler.on(document, EVENT_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, event => {\n const button = event.target.closest(SELECTOR_BUTTON)\n\n if (button) {\n button.classList.remove(CLASS_NAME_FOCUS)\n }\n})\n\nconst $ = getjQuery()\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .button to jQuery only if jQuery is present\n */\n/* istanbul ignore if */\nif ($) {\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n $.fn[NAME] = Button.jQueryInterface\n $.fn[NAME].Constructor = Button\n\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Button.jQueryInterface\n }\n}\n\nexport default Button\n"],"names":["getjQuery","window","jQuery","document","body","hasAttribute","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","CLASS_NAME_ACTIVE","CLASS_NAME_DISABLED","CLASS_NAME_FOCUS","SELECTOR_DATA_TOGGLE_CARROT","SELECTOR_DATA_TOGGLE","SELECTOR_INPUT","SELECTOR_ACTIVE","SELECTOR_BUTTON","EVENT_CLICK_DATA_API","EVENT_FOCUS_DATA_API","EVENT_BLUR_DATA_API","Button","element","_element","Data","setData","toggle","triggerChangeEvent","addAriaPressed","rootElement","closest","input","SelectorEngine","findOne","type","checked","classList","contains","activeElement","remove","EventHandler","trigger","focus","setAttribute","dispose","removeData","jQueryInterface","config","each","data","getData","getInstance","on","event","preventDefault","button","target","add","$","JQUERY_NO_CONFLICT","fn","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;EAAA;;;;;;;EA6KA,IAAMA,SAAS,GAAG,SAAZA,SAAY,GAAM;EAAA,gBACHC,MADG;EAAA,MACdC,MADc,WACdA,MADc;;EAGtB,MAAIA,MAAM,IAAI,CAACC,QAAQ,CAACC,IAAT,CAAcC,YAAd,CAA2B,gBAA3B,CAAf,EAA6D;EAC3D,WAAOH,MAAP;EACD;;EAED,SAAO,IAAP;EACD,CARD;;;;;ECjKA;;;;;;EAMA,IAAMI,IAAI,GAAG,QAAb;EACA,IAAMC,OAAO,GAAG,cAAhB;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