{"version":3,"file":"index.mjs","sources":["../../../node_modules/debounce/index.js"],"sourcesContent":["/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing. The function also has a property 'clear' \n * that is a function which will clear the timer to prevent previously scheduled executions. \n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\nfunction debounce(func, wait, immediate){\n  var timeout, args, context, timestamp, result;\n  if (null == wait) wait = 100;\n\n  function later() {\n    var last = Date.now() - timestamp;\n\n    if (last < wait && last >= 0) {\n      timeout = setTimeout(later, wait - last);\n    } else {\n      timeout = null;\n      if (!immediate) {\n        result = func.apply(context, args);\n        context = args = null;\n      }\n    }\n  };\n\n  var debounced = function(){\n    context = this;\n    args = arguments;\n    timestamp = Date.now();\n    var callNow = immediate && !timeout;\n    if (!timeout) timeout = setTimeout(later, wait);\n    if (callNow) {\n      result = func.apply(context, args);\n      context = args = null;\n    }\n\n    return result;\n  };\n\n  debounced.clear = function() {\n    if (timeout) {\n      clearTimeout(timeout);\n      timeout = null;\n    }\n  };\n  \n  debounced.flush = function() {\n    if (timeout) {\n      result = func.apply(context, args);\n      context = args = null;\n      \n      clearTimeout(timeout);\n      timeout = null;\n    }\n  };\n\n  return debounced;\n};\n\n// Adds compatibility for ES modules\ndebounce.debounce = debounce;\n\nmodule.exports = debounce;\n"],"names":["debounce","func","wait","immediate","timeout","args","context","timestamp","result","later","last","Date","now","setTimeout","apply","debounced","this","arguments","callNow","clear","clearTimeout","flush"],"mappings":"8EAcA,SAASA,SAASC,EAAMC,EAAMC,GAC5B,IAAIC,EAASC,EAAMC,EAASC,EAAWC,EAGvC,SAASC,QACP,IAAIC,EAAOC,KAAKC,MAAQL,EAEpBG,EAAOR,GAAQQ,GAAQ,EACzBN,EAAUS,WAAWJ,MAAOP,EAAOQ,IAEnCN,EAAU,KACLD,IACHK,EAASP,EAAKa,MAAMR,EAASD,GAC7BC,EAAUD,EAAO,MAIzB,CAfM,MAAQH,IAAMA,EAAO,KAgBzB,IAAIa,UAAY,WACdT,EAAUU,KACVX,EAAOY,UACPV,EAAYI,KAAKC,MACjB,IAAIM,EAAUf,IAAcC,EAO5B,OANKA,IAASA,EAAUS,WAAWJ,MAAOP,IACtCgB,IACFV,EAASP,EAAKa,MAAMR,EAASD,GAC7BC,EAAUD,EAAO,MAGZG,CACX,EAmBE,OAjBAO,UAAUI,MAAQ,WACZf,IACFgB,aAAahB,GACbA,EAAU,KAEhB,EAEEW,UAAUM,MAAQ,WACZjB,IACFI,EAASP,EAAKa,MAAMR,EAASD,GAC7BC,EAAUD,EAAO,KAEjBe,aAAahB,GACbA,EAAU,KAEhB,EAESW,SACT,CAGAf,SAASA,SAAWA,SAEpB,QAAiBA","x_google_ignoreList":[0]}