Untitled
Untitled
Untitled
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var r=function(){return(r=Object.assign||function(e){for(var
t,r=1,n=arguments.length;r<n;r++)for(var i in
t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return
e}).apply(this,arguments)};var n=function(e){var t=typeof e;return null!
=e&&("object"==t||"function"==t)},i="undefined"!=typeof globalThis?
globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?
self:{},s="object"==typeof i&&i&&i.Object===Object&&i,o="object"==typeof
self&&self&&self.Object===Object&&self,a=s||o||Function("return this")
(),c=function(){return
a.Date.now()},u=a.Symbol,l=Object.prototype,d=l.hasOwnProperty,h=l.toString,f=u?
u.toStringTag:void 0;var m=function(e){var t=d.call(e,f),r=e[f];try{e[f]=void 0;var
n=!0}catch(e){}var i=h.call(e);return n&&(t?e[f]=r:delete
e[f]),i},p=Object.prototype.toString;var g=function(e){return p.call(e)},b=u?
u.toStringTag:void 0;var y=function(e){return null==e?void 0===e?"[object
Undefined]":"[object Null]":b&&b in Object(e)?m(e):g(e)};var v=function(e){return
null!=e&&"object"==typeof e};var E=function(e){return"symbol"==typeof e||
v(e)&&"[object Symbol]"==y(e)},I=/^\s+|\s+$/g,O=/^[-+]0x[0-9a-f]+$/i,T=/^0b[01]+$/
i,w=/^0o[0-7]+$/i,S=parseInt;var _=function(e){if("number"==typeof e)return
e;if(E(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?
e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:
+e;e=e.replace(I,"");var r=T.test(e);return r||w.test(e)?S(e.slice(2),r?
2:8):O.test(e)?NaN:+e},P=Math.max,j=Math.min;var k=function(e,t,r){var
i,s,o,a,u,l,d=0,h=!1,f=!1,m=!0;if("function"!=typeof e)throw new
TypeError("Expected a function");function p(t){var r=i,n=s;return i=s=void
0,d=t,a=e.apply(n,r)}function g(e){return d=e,u=setTimeout(y,t),h?p(e):a}function
b(e){var r=e-l;return void 0===l||r>=t||r<0||f&&e-d>=o}function y(){var
e=c();if(b(e))return v(e);u=setTimeout(y,function(e){var r=t-(e-l);return f?j(r,o-
(e-d)):r}(e))}function v(e){return u=void 0,m&&i?p(e):(i=s=void 0,a)}function E()
{var e=c(),r=b(e);if(i=arguments,s=this,l=e,r){if(void 0===u)return
g(l);if(f)return u=setTimeout(y,t),p(l)}return void
0===u&&(u=setTimeout(y,t)),a}return t=_(t)||0,n(r)&&(h=!!r.leading,o=(f="maxWait"in
r)?P(_(r.maxWait)||0,t):o,m="trailing"in r?!!r.trailing:m),E.cancel=function(){void
0!==u&&clearTimeout(u),d=0,i=l=s=u=void 0},E.flush=function(){return void 0===u?
a:v(c())},E};var A=function(e,t,r){var i=!0,s=!0;if("function"!=typeof e)throw new
TypeError("Expected a function");return n(r)&&(i="leading"in r?!!
r.leading:i,s="trailing"in r?!!r.trailing:s),k(e,t,
{leading:i,maxWait:t,trailing:s})},D=["scroll","resize"],C=["wheel","keydown","keyu
p","mousedown","mousemove","touchstart","touchmove","click","contextmenu"],N=functi
on(){function e(e){var t=e.timeIntervalEllapsedCallbacks,n=void 0===t?
[]:t,i=e.absoluteTimeEllapsedCallbacks,s=void 0===i?
[]:i,o=e.checkCallbacksIntervalMs,a=void 0===o?
100:o,c=e.browserTabInactiveCallbacks,u=void 0===c?[]:c,l=e.idleCallbacks,d=void
0===l?[]:l,h=e.stopTimerOnTabchange,f=void 0===h||h,m=e.activeCallbacks,p=void
0===m?[]:m,g=e.browserTabActiveCallbacks,b=void 0===g?[]:g,y=e.idleTimeoutMs,v=void
0===y?3e3:y,E=this;this.onBrowserTabInactive=function()
{E.isRunning()&&E.stopTimerOnTabchange&&E.stopTimer(),E.browserTabInactiveCallbacks
.forEach((function(e){return
e(E.getTimeInMilliseconds())}))},this.onBrowserTabActive=function(){E.isRunning()||
E.startTimer(),E.browserTabActiveCallbacks.forEach((function(e){return
e(E.getTimeInMilliseconds())}))},this.onBrowserActiveChange=function()
{"visible"===document.visibilityState?
E.onBrowserTabActive():E.onBrowserTabInactive()},this.onTimePassed=function()
{E.absoluteTimeEllapsedCallbacks.forEach((function(e,t){var
r=e.callback,n=e.pending,i=e.timeInMilliseconds;n&&i<=E.getTimeInMilliseconds()&&(r
(E.getTimeInMilliseconds()),E.absoluteTimeEllapsedCallbacks[t].pending=!
1)})),E.timeIntervalEllapsedCallbacks.forEach((function(e,t){var
r=e.callback,n=e.timeInMilliseconds,i=e.multiplier;n<=E.getTimeInMilliseconds()&&(r
(E.getTimeInMilliseconds()),E.timeIntervalEllapsedCallbacks[t].timeInMilliseconds=i
(n))})),E.currentIdleTimeMs>=E.idleTimeoutMs&&E.isRunning()?(E.idle=!
0,E.stopTimer(),E.idleCallbacks.forEach((function(e){return
e(E.getTimeInMilliseconds())}))):E.currentIdleTimeMs+=E.checkCallbacksIntervalMs},t
his.resetIdleTime=function()
{E.idle&&E.startTimer(),E.activeCallbacks.forEach((function(e){return
e(E.getTimeInMilliseconds())})),E.idle=!
1,E.currentIdleTimeMs=0},this.registerEventListeners=function(){var e={passive:!
0},t=r({},e,{capture:!
0});document.addEventListener("visibilitychange",E.onBrowserActiveChange);var
n=A(E.resetIdleTime,2e3,{leading:!0,trailing:!1});D.forEach((function(e)
{window.addEventListener(e,n,t)})),C.forEach((function(t){return
document.addEventListener(t,n,e)}))},this.unregisterEventListeners=function()
{document.removeEventListener("visibilitychange",E.onBrowserActiveChange),D.forEach
((function(e){return
window.removeEventListener(e,E.resetIdleTime)})),C.forEach((function(e){return
document.removeEventListener(e,E.resetIdleTime)}))},this.checkCallbacksOnInterval=f
unction(){E.checkCallbackIntervalId=window.setInterval((function()
{E.onTimePassed()}),E.checkCallbacksIntervalMs)},this.startTimer=function()
{E.checkCallbackIntervalId||E.checkCallbacksOnInterval();var
e=E.times[E.times.length-1];e&&null===e.stop||
(E.times.push({start:performance.now(),stop:null}),E.running=!
0)},this.stopTimer=function(){E.times.length&&(E.times[E.times.length-
1].stop=performance.now(),E.running=!
1)},this.addTimeIntervalEllapsedCallback=function(e)
{E.timeIntervalEllapsedCallbacks.push(e)},this.addAbsoluteTimeEllapsedCallback=func
tion(e)
{E.absoluteTimeEllapsedCallbacks.push(e)},this.addBrowserTabInactiveCallback=functi
on(e)
{E.browserTabInactiveCallbacks.push(e)},this.addBrowserTabActiveCallback=function(e
){E.browserTabActiveCallbacks.push(e)},this.addIdleCallback=function(e)
{E.idleCallbacks.push(e)},this.addActiveCallback=function(e)
{E.activeCallbacks.push(e)},this.getTimeInMilliseconds=function(){return
E.times.reduce((function(e,t){return t.stop?e+=t.stop-t.start:e+=performance.now()-
t.start,e}),0)},this.isRunning=function(){return E.running},this.isIdle=function()
{return E.idle},this.reset=function(){E.times=[]},this.destroy=function()
{E.unregisterEventListeners(),E.checkCallbackIntervalId&&window.clearInterval(E.che
ckCallbackIntervalId)},this.running=!1,this.times=[],this.idle=!
1,this.currentIdleTimeMs=0,this.marks={},this.measures={},this.stopTimerOnTabchange
=f,this.browserTabActiveCallbacks=b,this.browserTabInactiveCallbacks=u,this.checkCa
llbacksIntervalMs=a,this.idleTimeoutMs=v,this.timeIntervalEllapsedCallbacks=n,this.
absoluteTimeEllapsedCallbacks=s,this.idleCallbacks=d,this.activeCallbacks=p,this.re
gisterEventListeners()}return e.prototype.mark=function(e){this.marks[e]||
(this.marks[e]=[]),this.marks[e].push({time:this.getTimeInMilliseconds()})},e.proto
type.getMarks=function(e){if(!(this.marks[e].length<1))return
this.marks[e]},e.prototype.measure=function(e,t,r){var
n=this.marks[t],i=n[n.length-1],s=this.marks[r],o=s[s.length-1];this.measures[e]||
(this.measures[e]=[]),this.measures[e].push({name:e,startTime:i.time,duration:o.tim
e-i.time})},e.prototype.getMeasures=function(e){if(this.measures[e]||!
(this.measures[e].length<1))return this.measures[e]},e}
();t.default=N}.call(this,r(101))},function(e,t){var r;r=function(){return this}
();try{r=r||new Function("return this")()}catch(e){"object"==typeof
window&&(r=window)}e.exports=r},function(e,t,r){"use
strict";r.r(t),r.d(t,"default",(function(){return c}));var n=r(2),i=r.n(n);function
s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var
n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return
Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return
r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?
arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){i()
(e,t,r[t])})):Object.getOwnPropertyDescriptors?
Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach
((function(t)
{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return
e}function a(e,t,r){const n=o({action:e},r);return
n.attributes=o(o({},t),n.attributes),n}class c{constructor(e,t)
{this._onEvent=e,this._baseEvent=t,this._searchStartedTime=null,this._lastQueryResu
ltsTime=null,this._queryLength=null,this._baseEvent=o({},t)}search(e){if(!e&&""!
==e)throw new Error("Missing query
param");this._searchStartedTime=Date.now(),this._queryLength=(e||"").length}searche
d(e){if(!e)throw new Error("Missing results
param");if(null===this._queryLength)throw new Error("search() must be called before
searched().");const t=Date.now()-
this._searchStartedTime;this._lastQueryResultsTime=Date.now(),this._lastResults=e;c
onst r=a("searched",
{responseTimeMs:t,queryLength:this._queryLength,results:e},this._baseEvent);this._o
nEvent(r)}selected(e){if(!e&&0!==e)throw new Error("Missing selectionIndex
param");if(!this._lastQueryResultsTime)throw new Error("searched() must be called
before selected().");const t=Date.now(),r=t-this._lastQueryResultsTime,n=t-
this._searchStartedTime,i=this._lastResults[e],s=a("selected",
{queryLength:this._queryLength,selectionIndex:e,selectionTimeMs:r,searchTimeMs:n,se
lectedResultValue:i},this._baseEvent);this._onEvent(s)}}}])}));}
(globalRequire.define));