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QAAQ,QAAU,QAClB,QAAQ,UAAY,UACpB,QAAQ,MAAQ","file":"/npm/vue-clickaway2@2.3.2/dist/vue-clickaway.common.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/vue-clickaway2@2.3.2/dist/vue-clickaway.common.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nvar Vue = require('vue');\nVue = 'default' in Vue ? Vue['default'] : Vue;\n\nvar version = '2.2.2';\n\nvar compatible = (/^2\\./).test(Vue.version);\nif (!compatible) {\n  Vue.util.warn('VueClickaway ' + version + ' only supports Vue 2.x, and does not support Vue ' + Vue.version);\n}\n\n// @SECTION: implementation\n\nvar HANDLER = '_vue_clickaway_handler';\n\nfunction bind(el, binding, vnode) {\n  unbind(el, binding);\n\n  var vm = vnode.context;\n\n  var callback = binding.value;\n  if (typeof callback !== 'function') {\n    if (process.env.NODE_ENV !== 'production') {\n      Vue.util.warn(\n        'v-' + binding.name + '=\"' +\n        binding.expression + '\" expects a function value, ' +\n        'got ' + callback\n      );\n    }\n    return;\n  }\n\n  // @NOTE: Vue binds directives in microtasks, while UI events are dispatched\n  //        in macrotasks. This causes the listener to be set up before\n  //        the \"origin\" click event (the event that lead to the binding of\n  //        the directive) arrives at the document root. To work around that,\n  //        we ignore events until the end of the \"initial\" macrotask.\n  // @REFERENCE: https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/\n  // @REFERENCE: https://github.com/simplesmiler/vue-clickaway/issues/8\n  var initialMacrotaskEnded = false;\n  setTimeout(function() {\n    initialMacrotaskEnded = true;\n  }, 0);\n\n  el[HANDLER] = function(ev) {\n    // @NOTE: this test used to be just `el.contains`, but working with path is better,\n    //        because it tests whether the element was there at the time of\n    //        the click, not whether it is there now, that the event has arrived\n    //        to the top.\n    // @NOTE: `.path` is non-standard, the standard way is `.composedPath()`\n    var path = ev.path || (ev.composedPath ? ev.composedPath() : undefined);\n    if (initialMacrotaskEnded && (path ? path.indexOf(el) < 0 : !el.contains(ev.target))) {\n      return callback.call(vm, ev);\n    }\n  };\n\n  if (binding.arg) {\n    document.documentElement.addEventListener(binding.arg, el[HANDLER], false);\n  } \n  else { // default state, if no argument is passed\n    document.documentElement.addEventListener('click', el[HANDLER], false);\n  }\n}\n\nfunction unbind(el, binding) {\n  if (binding.arg) {\n    document.documentElement.removeEventListener(binding.arg, el[HANDLER], false);\n  } \n  else { // default state, if no argument is passed\n    document.documentElement.removeEventListener('click', el[HANDLER], false);\n  }\n\n  delete el[HANDLER];\n}\n\nvar directive = {\n  bind: bind,\n  update: function(el, binding, vnode) {\n    if (binding.value === binding.oldValue) return;\n    bind(el, binding, vnode);\n  },\n  unbind: unbind,\n};\n\nvar mixin = {\n  directives: { onClickaway: directive },\n};\n\nexports.version = version;\nexports.directive = directive;\nexports.mixin = mixin;"]}