UNPKG

material-components-vue

Version:
2 lines 33.7 kB
/*! For license information please see chips.min.js.LICENSE */ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(window,(function(){return n={},t.m=e={0:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return c}));var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function r(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function a(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function c(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}},11:function(t,e,n){"use strict";var i=n(0),r=n(3),o={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},a={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},s={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300},c=n(9);n.d(e,"a",(function(){return h}));var d,u=["touchstart","pointerdown","mousedown","keydown"],l=["touchend","pointerup","mouseup","contextmenu"],p=[],h=(d=r.a,i.b(f,d),Object.defineProperty(f,"cssClasses",{get:function(){return o},enumerable:!0,configurable:!0}),Object.defineProperty(f,"strings",{get:function(){return a},enumerable:!0,configurable:!0}),Object.defineProperty(f,"numbers",{get:function(){return s},enumerable:!0,configurable:!0}),Object.defineProperty(f,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!0,configurable:!0}),f.prototype.init=function(){var t=this,e=this.supportsPressRipple_();if(this.registerRootHandlers_(e),e){var n=f.cssClasses,i=n.ROOT,r=n.UNBOUNDED;requestAnimationFrame((function(){t.adapter_.addClass(i),t.adapter_.isUnbounded()&&(t.adapter_.addClass(r),t.layoutInternal_())}))}},f.prototype.destroy=function(){var t=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter_.removeClass(f.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter_.removeClass(f.cssClasses.FG_DEACTIVATION));var e=f.cssClasses,n=e.ROOT,i=e.UNBOUNDED;requestAnimationFrame((function(){t.adapter_.removeClass(n),t.adapter_.removeClass(i),t.removeCssVars_()}))}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},f.prototype.activate=function(t){this.activate_(t)},f.prototype.deactivate=function(){this.deactivate_()},f.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},f.prototype.setUnbounded=function(t){var e=f.cssClasses.UNBOUNDED;t?this.adapter_.addClass(e):this.adapter_.removeClass(e)},f.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter_.addClass(f.cssClasses.BG_FOCUSED)}))},f.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter_.removeClass(f.cssClasses.BG_FOCUSED)}))},f.prototype.supportsPressRipple_=function(){return this.adapter_.browserSupportsCssVars()},f.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},f.prototype.registerRootHandlers_=function(t){var e=this;t&&(u.forEach((function(t){e.adapter_.registerInteractionHandler(t,e.activateHandler_)})),this.adapter_.isUnbounded()&&this.adapter_.registerResizeHandler(this.resizeHandler_)),this.adapter_.registerInteractionHandler("focus",this.focusHandler_),this.adapter_.registerInteractionHandler("blur",this.blurHandler_)},f.prototype.registerDeactivationHandlers_=function(t){var e=this;"keydown"===t.type?this.adapter_.registerInteractionHandler("keyup",this.deactivateHandler_):l.forEach((function(t){e.adapter_.registerDocumentInteractionHandler(t,e.deactivateHandler_)}))},f.prototype.deregisterRootHandlers_=function(){var t=this;u.forEach((function(e){t.adapter_.deregisterInteractionHandler(e,t.activateHandler_)})),this.adapter_.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter_.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter_.isUnbounded()&&this.adapter_.deregisterResizeHandler(this.resizeHandler_)},f.prototype.deregisterDeactivationHandlers_=function(){var t=this;this.adapter_.deregisterInteractionHandler("keyup",this.deactivateHandler_),l.forEach((function(e){t.adapter_.deregisterDocumentInteractionHandler(e,t.deactivateHandler_)}))},f.prototype.removeCssVars_=function(){var t=this,e=f.strings;Object.keys(e).forEach((function(n){0===n.indexOf("VAR_")&&t.adapter_.updateCssVariable(e[n],null)}))},f.prototype.activate_=function(t){var e=this;if(!this.adapter_.isSurfaceDisabled()){var n=this.activationState_;if(!n.isActivated){var i=this.previousActivationEvent_;i&&void 0!==t&&i.type!==t.type||(n.isActivated=!0,n.isProgrammatic=void 0===t,n.activationEvent=t,n.wasActivatedByPointer=!n.isProgrammatic&&void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type),void 0!==t&&0<p.length&&p.some((function(t){return e.adapter_.containsEventTarget(t)}))?this.resetActivationState_():(void 0!==t&&(p.push(t.target),this.registerDeactivationHandlers_(t)),n.wasElementMadeActive=this.checkElementMadeActive_(t),n.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame((function(){p=[],n.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(n.wasElementMadeActive=e.checkElementMadeActive_(t),n.wasElementMadeActive&&e.animateActivation_()),n.wasElementMadeActive||(e.activationState_=e.defaultActivationState_())}))))}}},f.prototype.checkElementMadeActive_=function(t){return void 0===t||"keydown"!==t.type||this.adapter_.isSurfaceActive()},f.prototype.animateActivation_=function(){var t=this,e=f.strings,n=e.VAR_FG_TRANSLATE_START,i=e.VAR_FG_TRANSLATE_END,r=f.cssClasses,o=r.FG_DEACTIVATION,a=r.FG_ACTIVATION,s=f.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var c="",d="";if(!this.adapter_.isUnbounded()){var u=this.getFgTranslationCoordinates_(),l=u.startPoint,p=u.endPoint;c=l.x+"px, "+l.y+"px",d=p.x+"px, "+p.y+"px"}this.adapter_.updateCssVariable(n,c),this.adapter_.updateCssVariable(i,d),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter_.removeClass(o),this.adapter_.computeBoundingRect(),this.adapter_.addClass(a),this.activationTimer_=setTimeout((function(){return t.activationTimerCallback_()}),s)},f.prototype.getFgTranslationCoordinates_=function(){var t,e=this.activationState_,n=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?Object(c.a)(n,this.adapter_.getWindowPageOffset(),this.adapter_.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:t.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},f.prototype.runDeactivationUXLogicIfReady_=function(){var t=this,e=f.cssClasses.FG_DEACTIVATION,n=this.activationState_,i=n.hasDeactivationUXRun,r=n.isActivated;!i&&r||!this.activationAnimationHasEnded_||(this.rmBoundedActivationClasses_(),this.adapter_.addClass(e),this.fgDeactivationRemovalTimer_=setTimeout((function(){t.adapter_.removeClass(e)}),s.FG_DEACTIVATION_MS))},f.prototype.rmBoundedActivationClasses_=function(){var t=f.cssClasses.FG_ACTIVATION;this.adapter_.removeClass(t),this.activationAnimationHasEnded_=!1,this.adapter_.computeBoundingRect()},f.prototype.resetActivationState_=function(){var t=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout((function(){return t.previousActivationEvent_=void 0}),f.numbers.TAP_DELAY_MS)},f.prototype.deactivate_=function(){var t=this,e=this.activationState_;if(e.isActivated){var n=i.a({},e);e.isProgrammatic?(requestAnimationFrame((function(){return t.animateDeactivation_(n)})),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame((function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(n),t.resetActivationState_()})))}},f.prototype.animateDeactivation_=function(t){var e=t.wasActivatedByPointer,n=t.wasElementMadeActive;(e||n)&&this.runDeactivationUXLogicIfReady_()},f.prototype.layoutInternal_=function(){this.frame_=this.adapter_.computeBoundingRect();var t=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter_.isUnbounded()?t:Math.sqrt(Math.pow(this.frame_.width,2)+Math.pow(this.frame_.height,2))+f.numbers.PADDING,this.initialSize_=Math.floor(t*f.numbers.INITIAL_ORIGIN_SCALE),this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},f.prototype.updateLayoutCssVars_=function(){var t=f.strings,e=t.VAR_FG_SIZE,n=t.VAR_LEFT,i=t.VAR_TOP,r=t.VAR_FG_SCALE;this.adapter_.updateCssVariable(e,this.initialSize_+"px"),this.adapter_.updateCssVariable(r,this.fgScale_),this.adapter_.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter_.updateCssVariable(n,this.unboundedCoords_.left+"px"),this.adapter_.updateCssVariable(i,this.unboundedCoords_.top+"px"))},f);function f(t){var e=d.call(this,i.a({},f.defaultAdapter,t))||this;return e.activationAnimationHasEnded_=!1,e.activationTimer_=0,e.fgDeactivationRemovalTimer_=0,e.fgScale_="0",e.frame_={width:0,height:0},e.initialSize_=0,e.layoutFrame_=0,e.maxRadius_=0,e.unboundedCoords_={left:0,top:0},e.activationState_=e.defaultActivationState_(),e.activationTimerCallback_=function(){e.activationAnimationHasEnded_=!0,e.runDeactivationUXLogicIfReady_()},e.activateHandler_=function(t){return e.activate_(t)},e.deactivateHandler_=function(){return e.deactivate_()},e.focusHandler_=function(){return e.handleFocus()},e.blurHandler_=function(){return e.handleBlur()},e.resizeHandler_=function(){return e.layout()},e}},13:function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i,r=n(0),o=n(5),a=n(6),s=n(8),c=n(11),d=n(9),u=(i=o.a,r.b(l,i),l.attachTo=function(t,e){void 0===e&&(e={isUnbounded:void 0});var n=new l(t);return void 0!==e.isUnbounded&&(n.unbounded=e.isUnbounded),n},l.createAdapter=function(t){return{addClass:function(e){return t.root_.classList.add(e)},browserSupportsCssVars:function(){return d.b(window)},computeBoundingRect:function(){return t.root_.getBoundingClientRect()},containsEventTarget:function(e){return t.root_.contains(e)},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,Object(a.a)())},deregisterInteractionHandler:function(e,n){return t.root_.removeEventListener(e,n,Object(a.a)())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return Object(s.b)(t.root_,":active")},isSurfaceDisabled:function(){return Boolean(t.disabled)},isUnbounded:function(){return Boolean(t.unbounded)},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,Object(a.a)())},registerInteractionHandler:function(e,n){return t.root_.addEventListener(e,n,Object(a.a)())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(e){return t.root_.classList.remove(e)},updateCssVariable:function(e,n){return t.root_.style.setProperty(e,n)}}},Object.defineProperty(l.prototype,"unbounded",{get:function(){return Boolean(this.unbounded_)},set:function(t){this.unbounded_=Boolean(t),this.setUnbounded_()},enumerable:!0,configurable:!0}),l.prototype.activate=function(){this.foundation_.activate()},l.prototype.deactivate=function(){this.foundation_.deactivate()},l.prototype.layout=function(){this.foundation_.layout()},l.prototype.getDefaultFoundation=function(){return new c.a(l.createAdapter(this))},l.prototype.initialSyncWithDOM=function(){var t=this.root_;this.unbounded="mdcRippleIsUnbounded"in t.dataset},l.prototype.setUnbounded_=function(){this.foundation_.setUnbounded(Boolean(this.unbounded_))},l);function l(){var t=null!==i&&i.apply(this,arguments)||this;return t.disabled=!1,t}},2:function(t,e,n){"use strict";var i={inheritAttrs:!1},r=["primary","secondary","background","surface","on-primary","on-secondary","on-surface","primary-bg","secondary-bg","text-primary-on-light","text-secondary-on-light","text-hint-on-light","text-disabled-on-light","text-icon-on-light","text-primary-on-dark","text-secondary-on-dark","text-hint-on-dark","text-disabled-on-dark","text-icon-on-dark"],o={props:{theming:{type:String,default:""}},mounted:function(){-1<r.indexOf(this.theming)&&this.$el.classList.add("mdc-theme--"+this.theming)}};n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}))},3:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=(Object.defineProperty(r,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),r.prototype.init=function(){},r.prototype.destroy=function(){},r);function r(t){void 0===t&&(t={}),this.adapter_=t}},31:function(t,e,n){},4:function(t,e,n){"use strict";function i(t,e,n,i,r,o,a,s){var c,d="function"==typeof t?t.options:t;if(e&&(d.render=e,d.staticRenderFns=n,d._compiled=!0),i&&(d.functional=!0),o&&(d._scopeId="data-v-"+o),a?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},d._ssrRegister=c):r&&(c=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),c)if(d.functional){d._injectStyles=c;var u=d.render;d.render=function(t,e){return c.call(e),u(t,e)}}else{var l=d.beforeCreate;d.beforeCreate=l?[].concat(l,c):[c]}return{exports:t,options:d}}n.d(e,"a",(function(){return i}))},5:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(0),r=n(3),o=(a.attachTo=function(t){return new a(t,new r.a({}))},a.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},a.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},a.prototype.initialSyncWithDOM=function(){},a.prototype.destroy=function(){this.foundation_.destroy()},a.prototype.listen=function(t,e,n){this.root_.addEventListener(t,e,n)},a.prototype.unlisten=function(t,e,n){this.root_.removeEventListener(t,e,n)},a.prototype.emit=function(t,e,n){var i;void 0===n&&(n=!1),"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:n,detail:e}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,n,!1,e),this.root_.dispatchEvent(i)},a);function a(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];this.root_=t,this.initialize.apply(this,i.d(n)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}},6:function(t,e,n){"use strict";var i;function r(t,e){if(void 0===t&&(t=window),void 0===e&&(e=!1),void 0===i||e){var n=!1;try{t.document.addEventListener("test",(function(){}),{get passive(){return n=!0}})}catch(t){}i=n}return!!i&&{passive:!0}}n.d(e,"a",(function(){return r}))},65:function(t,e,n){"use strict";n.r(e);var i,r=n(2),o={mixins:[r.a,r.b],model:{prop:"selected",event:"change"},props:{selected:{type:Boolean,default:!1}},inject:["mdcChipSet"],data:function(){return{slotObserver:void 0}},computed:{classes:function(){return{"mdc-chip--selected":this.selected}}},mounted:function(){var t=this;this.updateSlots(),this.slotObserver=new MutationObserver((function(){return t.updateSlots()})),this.slotObserver.observe(this.$el,{childList:!0,subtree:!0})},beforeDestroy:function(){this.slotObserver.disconnect()},methods:{updateSlots:function(){var t=this;this.$slots.leadingIcon&&this.$slots.leadingIcon.map((function(e){e.elm.classList.add("mdc-chip__icon"),t.selected?e.elm.classList.add("mdc-chip__icon--leading-hidden"):(e.elm.classList.remove("mdc-chip__icon--leading-hidden"),e.elm.classList.add("mdc-chip__icon--leading"))})),this.$slots.trailingIcon&&this.$slots.trailingIcon.map((function(t){t.elm.classList.add("mdc-chip__icon"),t.elm.classList.add("mdc-chip__icon--trailing"),t.elm.setAttribute("role","button"),t.elm.setAttribute("tabindex","0")}))},onTrailingIconInteraction:function(t){this.$emit("onTrailingIconInteraction",t.detail)}}},a=n(4),s=Object(a.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mdc-chip",class:t.classes,attrs:{tabindex:"0"},on:{"MDCChip:interaction":function(e){return t.$emit("change",!t.selected)},"MDCChip:removal":function(e){t.$emit("remove")&&t.$emit("change",!1)},"MDCChip:trailingIconInteraction":t.onTrailingIconInteraction}},[t.$slots.leadingIcon?t._t("leadingIcon"):t._e(),t._v(" "),t.mdcChipSet&&t.mdcChipSet.filter?n("div",{staticClass:"mdc-chip__checkmark"},[n("svg",{staticClass:"mdc-chip__checkmark-svg",attrs:{viewBox:"-2 -3 30 30"}},[n("path",{staticClass:"mdc-chip__checkmark-path",attrs:{fill:"none",stroke:"black",d:"M1.73,12.91 8.1,19.28 22.79,4.59"}})])]):t._e(),t._v(" "),n("div",{staticClass:"mdc-chip__text"},[t._t("default")],2),t._v(" "),t.$slots.trailingIcon?t._t("trailingIcon"):t._e()],2)}),[],!1,null,null,null).exports,c=n(0),d=n(5),u=n(13),l=n(11),p={ARIA_CHECKED:"aria-checked",CHECKMARK_SELECTOR:".mdc-chip__checkmark",ENTRY_ANIMATION_NAME:"mdc-chip-entry",INTERACTION_EVENT:"MDCChip:interaction",LEADING_ICON_SELECTOR:".mdc-chip__icon--leading",REMOVAL_EVENT:"MDCChip:removal",SELECTION_EVENT:"MDCChip:selection",TRAILING_ICON_INTERACTION_EVENT:"MDCChip:trailingIconInteraction",TRAILING_ICON_SELECTOR:".mdc-chip__icon--trailing"},h={CHECKMARK:"mdc-chip__checkmark",CHIP_EXIT:"mdc-chip--exit",HIDDEN_LEADING_ICON:"mdc-chip__icon--leading-hidden",LEADING_ICON:"mdc-chip__icon--leading",SELECTED:"mdc-chip--selected",TRAILING_ICON:"mdc-chip__icon--trailing"},f=n(3),_={bottom:0,height:0,left:0,right:0,top:0,width:0},v=(i=f.a,c.b(m,i),Object.defineProperty(m,"strings",{get:function(){return p},enumerable:!0,configurable:!0}),Object.defineProperty(m,"cssClasses",{get:function(){return h},enumerable:!0,configurable:!0}),Object.defineProperty(m,"defaultAdapter",{get:function(){return{addClass:function(){},addClassToLeadingIcon:function(){},eventTargetHasClass:function(){return!1},getCheckmarkBoundingClientRect:function(){return _},getComputedStyleValue:function(){return""},getRootBoundingClientRect:function(){return _},hasClass:function(){return!1},hasLeadingIcon:function(){return!1},notifyInteraction:function(){},notifyRemoval:function(){},notifySelection:function(){},notifyTrailingIconInteraction:function(){},removeClass:function(){},removeClassFromLeadingIcon:function(){},setAttr:function(){},setStyleProperty:function(){}}},enumerable:!0,configurable:!0}),m.prototype.isSelected=function(){return this.adapter_.hasClass(h.SELECTED)},m.prototype.setSelected=function(t){t?(this.adapter_.addClass(h.SELECTED),this.adapter_.setAttr(p.ARIA_CHECKED,"true")):(this.adapter_.removeClass(h.SELECTED),this.adapter_.setAttr(p.ARIA_CHECKED,"false")),this.adapter_.notifySelection(t)},m.prototype.getShouldRemoveOnTrailingIconClick=function(){return this.shouldRemoveOnTrailingIconClick_},m.prototype.setShouldRemoveOnTrailingIconClick=function(t){this.shouldRemoveOnTrailingIconClick_=t},m.prototype.getDimensions=function(){function t(){return e.adapter_.getRootBoundingClientRect()}var e=this;if(!this.adapter_.hasLeadingIcon()){var n=e.adapter_.getCheckmarkBoundingClientRect();if(n){var i=t();return{bottom:i.bottom,height:i.height,left:i.left,right:i.right,top:i.top,width:i.width+n.height}}}return t()},m.prototype.beginExit=function(){this.adapter_.addClass(h.CHIP_EXIT)},m.prototype.handleInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;"click"!==t.type&&!e||this.adapter_.notifyInteraction()},m.prototype.handleTransitionEnd=function(t){var e=this;if(this.adapter_.eventTargetHasClass(t.target,h.CHIP_EXIT)){if("width"===t.propertyName)this.adapter_.notifyRemoval();else if("opacity"===t.propertyName){var n=this.adapter_.getComputedStyleValue("width");requestAnimationFrame((function(){e.adapter_.setStyleProperty("width",n),e.adapter_.setStyleProperty("padding","0"),e.adapter_.setStyleProperty("margin","0"),requestAnimationFrame((function(){e.adapter_.setStyleProperty("width","0")}))}))}}else"opacity"===t.propertyName&&(this.adapter_.eventTargetHasClass(t.target,h.LEADING_ICON)&&this.adapter_.hasClass(h.SELECTED)?this.adapter_.addClassToLeadingIcon(h.HIDDEN_LEADING_ICON):this.adapter_.eventTargetHasClass(t.target,h.CHECKMARK)&&!this.adapter_.hasClass(h.SELECTED)&&this.adapter_.removeClassFromLeadingIcon(h.HIDDEN_LEADING_ICON))},m.prototype.handleTrailingIconInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;t.stopPropagation(),"click"!==t.type&&!e||(this.adapter_.notifyTrailingIconInteraction(),this.shouldRemoveOnTrailingIconClick_&&this.beginExit())},m);function m(t){var e=i.call(this,c.a({},m.defaultAdapter,t))||this;return e.shouldRemoveOnTrailingIconClick_=!0,e}var g,y=["click","keydown"],C=(g=d.a,c.b(I,g),Object.defineProperty(I.prototype,"selected",{get:function(){return this.foundation_.isSelected()},set:function(t){this.foundation_.setSelected(t)},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"shouldRemoveOnTrailingIconClick",{get:function(){return this.foundation_.getShouldRemoveOnTrailingIconClick()},set:function(t){this.foundation_.setShouldRemoveOnTrailingIconClick(t)},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(I.prototype,"id",{get:function(){return this.root_.id},enumerable:!0,configurable:!0}),I.attachTo=function(t){return new I(t)},I.prototype.initialize=function(t){var e=this;void 0===t&&(t=function(t,e){return new u.a(t,e)}),this.leadingIcon_=this.root_.querySelector(p.LEADING_ICON_SELECTOR),this.trailingIcon_=this.root_.querySelector(p.TRAILING_ICON_SELECTOR),this.checkmark_=this.root_.querySelector(p.CHECKMARK_SELECTOR);var n=c.a({},u.a.createAdapter(this),{computeBoundingRect:function(){return e.foundation_.getDimensions()}});this.ripple_=t(this.root_,new l.a(n))},I.prototype.initialSyncWithDOM=function(){var t=this;this.handleInteraction_=function(e){return t.foundation_.handleInteraction(e)},this.handleTransitionEnd_=function(e){return t.foundation_.handleTransitionEnd(e)},this.handleTrailingIconInteraction_=function(e){return t.foundation_.handleTrailingIconInteraction(e)},y.forEach((function(e){t.listen(e,t.handleInteraction_)})),this.listen("transitionend",this.handleTransitionEnd_),this.trailingIcon_&&y.forEach((function(e){t.trailingIcon_.addEventListener(e,t.handleTrailingIconInteraction_)}))},I.prototype.destroy=function(){var t=this;this.ripple_.destroy(),y.forEach((function(e){t.unlisten(e,t.handleInteraction_)})),this.unlisten("transitionend",this.handleTransitionEnd_),this.trailingIcon_&&y.forEach((function(e){t.trailingIcon_.removeEventListener(e,t.handleTrailingIconInteraction_)})),g.prototype.destroy.call(this)},I.prototype.beginExit=function(){this.foundation_.beginExit()},I.prototype.getDefaultFoundation=function(){var t=this;return new v({addClass:function(e){return t.root_.classList.add(e)},addClassToLeadingIcon:function(e){t.leadingIcon_&&t.leadingIcon_.classList.add(e)},eventTargetHasClass:function(t,e){return!!t&&t.classList.contains(e)},getCheckmarkBoundingClientRect:function(){return t.checkmark_?t.checkmark_.getBoundingClientRect():null},getComputedStyleValue:function(e){return window.getComputedStyle(t.root_).getPropertyValue(e)},getRootBoundingClientRect:function(){return t.root_.getBoundingClientRect()},hasClass:function(e){return t.root_.classList.contains(e)},hasLeadingIcon:function(){return!!t.leadingIcon_},notifyInteraction:function(){return t.emit(p.INTERACTION_EVENT,{chipId:t.id},!0)},notifyRemoval:function(){return t.emit(p.REMOVAL_EVENT,{chipId:t.id,root:t.root_},!0)},notifySelection:function(e){return t.emit(p.SELECTION_EVENT,{chipId:t.id,selected:e},!0)},notifyTrailingIconInteraction:function(){return t.emit(p.TRAILING_ICON_INTERACTION_EVENT,{chipId:t.id},!0)},removeClass:function(e){return t.root_.classList.remove(e)},removeClassFromLeadingIcon:function(e){t.leadingIcon_&&t.leadingIcon_.classList.remove(e)},setAttr:function(e,n){return t.root_.setAttribute(e,n)},setStyleProperty:function(e,n){return t.root_.style.setProperty(e,n)}})},I);function I(){return null!==g&&g.apply(this,arguments)||this}var b,E={CHIP_SELECTOR:".mdc-chip"},T={CHOICE:"mdc-chip-set--choice",FILTER:"mdc-chip-set--filter"},A=(b=f.a,c.b(S,b),Object.defineProperty(S,"strings",{get:function(){return E},enumerable:!0,configurable:!0}),Object.defineProperty(S,"cssClasses",{get:function(){return T},enumerable:!0,configurable:!0}),Object.defineProperty(S,"defaultAdapter",{get:function(){return{hasClass:function(){return!1},removeChip:function(){},setSelected:function(){}}},enumerable:!0,configurable:!0}),S.prototype.getSelectedChipIds=function(){return this.selectedChipIds_.slice()},S.prototype.select=function(t){if(!(0<=this.selectedChipIds_.indexOf(t))){if(this.adapter_.hasClass(T.CHOICE)&&0<this.selectedChipIds_.length){var e=this.selectedChipIds_[0];this.selectedChipIds_.length=0,this.adapter_.setSelected(e,!1)}this.selectedChipIds_.push(t),this.adapter_.setSelected(t,!0)}},S.prototype.handleChipInteraction=function(t){(this.adapter_.hasClass(T.CHOICE)||this.adapter_.hasClass(T.FILTER))&&this.toggleSelect_(t)},S.prototype.handleChipSelection=function(t,e){var n=0<=this.selectedChipIds_.indexOf(t);e&&!n?this.select(t):!e&&n&&this.deselect_(t)},S.prototype.handleChipRemoval=function(t){this.deselect_(t),this.adapter_.removeChip(t)},S.prototype.deselect_=function(t){var e=this.selectedChipIds_.indexOf(t);0<=e&&(this.selectedChipIds_.splice(e,1),this.adapter_.setSelected(t,!1))},S.prototype.toggleSelect_=function(t){0<=this.selectedChipIds_.indexOf(t)?this.deselect_(t):this.select(t)},S);function S(t){var e=b.call(this,c.a({},S.defaultAdapter,t))||this;return e.selectedChipIds_=[],e}var O,R=v.strings,D=R.INTERACTION_EVENT,N=R.SELECTION_EVENT,L=R.REMOVAL_EVENT,w=A.strings.CHIP_SELECTOR,H=0,x=(O=d.a,c.b(P,O),P.attachTo=function(t){return new P(t)},Object.defineProperty(P.prototype,"chips",{get:function(){return this.chips_.slice()},enumerable:!0,configurable:!0}),Object.defineProperty(P.prototype,"selectedChipIds",{get:function(){return this.foundation_.getSelectedChipIds()},enumerable:!0,configurable:!0}),P.prototype.initialize=function(t){void 0===t&&(t=function(t){return new C(t)}),this.chipFactory_=t,this.chips_=this.instantiateChips_(this.chipFactory_)},P.prototype.initialSyncWithDOM=function(){var t=this;this.chips_.forEach((function(e){e.id&&e.selected&&t.foundation_.select(e.id)})),this.handleChipInteraction_=function(e){return t.foundation_.handleChipInteraction(e.detail.chipId)},this.handleChipSelection_=function(e){return t.foundation_.handleChipSelection(e.detail.chipId,e.detail.selected)},this.handleChipRemoval_=function(e){return t.foundation_.handleChipRemoval(e.detail.chipId)},this.listen(D,this.handleChipInteraction_),this.listen(N,this.handleChipSelection_),this.listen(L,this.handleChipRemoval_)},P.prototype.destroy=function(){this.chips_.forEach((function(t){t.destroy()})),this.unlisten(D,this.handleChipInteraction_),this.unlisten(N,this.handleChipSelection_),this.unlisten(L,this.handleChipRemoval_),O.prototype.destroy.call(this)},P.prototype.addChip=function(t){t.id=t.id||"mdc-chip-"+ ++H,this.chips_.push(this.chipFactory_(t))},P.prototype.getDefaultFoundation=function(){var t=this;return new A({hasClass:function(e){return t.root_.classList.contains(e)},removeChip:function(e){var n=t.findChipIndex_(e);0<=n&&(t.chips_[n].destroy(),t.chips_.splice(n,1))},setSelected:function(e,n){var i=t.findChipIndex_(e);0<=i&&(t.chips_[i].selected=n)}})},P.prototype.instantiateChips_=function(t){return[].slice.call(this.root_.querySelectorAll(w)).map((function(e){return e.id=e.id||"mdc-chip-"+ ++H,t(e)}))},P.prototype.findChipIndex_=function(t){for(var e=0;e<this.chips_.length;e++)if(this.chips_[e].id===t)return e;return-1},P);function P(){return null!==O&&O.apply(this,arguments)||this}var k={mixins:[r.a,r.b],props:{choice:{type:Boolean,default:!1},filter:{type:Boolean,default:!1},input:{type:Boolean,default:!1}},provide:function(){return{mdcChipSet:this}},data:function(){return{mdcChipSet:void 0}},computed:{classes:function(){return{"mdc-chip-set--choice":this.choice,"mdc-chip-set--filter":this.filter,"mdc-chip-set--input":this.input}}},mounted:function(){this.mdcChipSet=x.attachTo(this.$el)},beforeDestroy:function(){this.mdcChipSet.destroy()}},V=Object(a.a)(k,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"mdc-chip-set",class:this.classes},[this._t("default")],2)}),[],!1,null,null,null).exports,F=(n(31),n(7)),M={install:function(t){t.component("m-chip",s),t.component("m-chip-set",V)}};e.default=M,Object(F.a)(M)},7:function(t,e,n){"use strict";function i(t){"undefined"!=typeof window&&window.Vue&&window.Vue.use(t)}n.d(e,"a",(function(){return i}))},8:function(t,e,n){"use strict";function i(t,e){if(t.closest)return t.closest(e);for(var n=t;n;){if(r(n,e))return n;n=n.parentElement}return null}function r(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return r}))},9:function(t,e,n){"use strict";var i;function r(t,e){void 0===e&&(e=!1);var n,r=t.CSS;if("boolean"==typeof i&&!e)return i;if(!r||"function"!=typeof r.supports)return!1;var o=r.supports("--css-vars","yes"),a=r.supports("(--css-vars: yes)")&&r.supports("color","#00000000");return n=!(!o&&!a||function(t){var e=t.document,n=e.createElement("div");n.className="mdc-ripple-surface--test-edge-var-bug",e.head.appendChild(n);var i=t.getComputedStyle(n),r=null!==i&&"solid"===i.borderTopStyle;return n.parentNode&&n.parentNode.removeChild(n),r}(t)),e||(i=n),n}function o(t,e,n){if(!t)return{x:0,y:0};var i,r,o=e.x,a=e.y,s=o+n.left,c=a+n.top;if("touchstart"===t.type){var d=t;i=d.changedTouches[0].pageX-s,r=d.changedTouches[0].pageY-c}else{var u=t;i=u.pageX-s,r=u.pageY-c}return{x:i,y:r}}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return o}))}},t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i})},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(i,r,function(t){return e[t]}.bind(null,r));return i},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.p="",t(t.s=65);function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var e,n}));