Socket
Socket
Sign inDemoInstall

@jledentu/vue-finder

Package Overview
Dependencies
11
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.2 to 2.2.0

src/utils/__tests__/drag-counter.test.js

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# [2.2.0](https://github.com/jledentu/vue-finder/compare/v2.1.2...v2.2.0) (2023-05-19)
### Features
* **virtualization:** add virtualize prop ([#210](https://github.com/jledentu/vue-finder/issues/210)) ([fad3f78](https://github.com/jledentu/vue-finder/commit/fad3f78117742ae1b384cd7dc9a7cc7b2b0a822e))
## [2.1.2](https://github.com/jledentu/vue-finder/compare/v2.1.1...v2.1.2) (2023-05-05)

@@ -2,0 +9,0 @@

2

dist/vue-finder.min.js

@@ -25,2 +25,2 @@ /**

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e=e||self)["vue-finder"]={},e.Vue)}(this,(function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?c(e):t}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function p(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}t=t&&t.hasOwnProperty("default")?t.default:t;var h="object"==typeof global&&global&&global.Object===Object&&global,v="object"==typeof self&&self&&self.Object===Object&&self,g=h||v||Function("return this")(),b=g.Symbol,y=Object.prototype,m=y.hasOwnProperty,_=y.toString,j=b?b.toStringTag:void 0;var O=Object.prototype.toString;var w=b?b.toStringTag:void 0;function x(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":w&&w in Object(e)?function(e){var t=m.call(e,j),n=e[j];try{e[j]=void 0;var r=!0}catch(e){}var o=_.call(e);return r&&(t?e[j]=n:delete e[j]),o}(e):function(e){return O.call(e)}(e)}function D(e){return null!=e&&"object"==typeof e}function C(e){return"symbol"==typeof e||D(e)&&"[object Symbol]"==x(e)}function M(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var E=Array.isArray,S=b?b.prototype:void 0,A=S?S.toString:void 0;function k(e){if("string"==typeof e)return e;if(E(e))return M(e,k)+"";if(C(e))return A?A.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function N(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function T(e){return e}function F(e){if(!N(e))return!1;var t=x(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var P,I=g["__core-js_shared__"],$=(P=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+P:"";var B=Function.prototype.toString;function z(e){if(null!=e){try{return B.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var L=/^\[object .+?Constructor\]$/,V=Function.prototype,R=Object.prototype,W=V.toString,H=R.hasOwnProperty,Z=RegExp("^"+W.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function q(e){return!(!N(e)||(t=e,$&&$ in t))&&(F(e)?Z:L).test(z(e));var t}function U(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return q(n)?n:void 0}var G=U(g,"WeakMap");function X(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var J=Date.now;var K,Q,Y,ee=function(){try{var e=U(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),te=(K=ee?function(e,t){return ee(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:T,Q=0,Y=0,function(){var e=J(),t=16-(e-Y);if(Y=e,t>0){if(++Q>=800)return arguments[0]}else Q=0;return K.apply(void 0,arguments)});function ne(e){return e!=e}function re(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}(e,ne,n)}(e,t,0)>-1}var oe=/^(?:0|[1-9]\d*)$/;function ie(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&oe.test(e))&&e>-1&&e%1==0&&e<t}function ae(e,t){return e===t||e!=e&&t!=t}var ue=Math.max;function de(e,t){return te(function(e,t,n){return t=ue(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=ue(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var u=Array(t+1);++o<t;)u[o]=r[o];return u[t]=n(a),X(e,this,u)}}(e,t,T),e+"")}function se(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ce(e){return null!=e&&se(e.length)&&!F(e)}var le=Object.prototype;function fe(e){return D(e)&&"[object Arguments]"==x(e)}var pe=Object.prototype,he=pe.hasOwnProperty,ve=pe.propertyIsEnumerable,ge=fe(function(){return arguments}())?fe:function(e){return D(e)&&he.call(e,"callee")&&!ve.call(e,"callee")};var be="object"==typeof e&&e&&!e.nodeType&&e,ye=be&&"object"==typeof module&&module&&!module.nodeType&&module,me=ye&&ye.exports===be?g.Buffer:void 0,_e=(me?me.isBuffer:void 0)||function(){return!1},je={};function Oe(e){return function(t){return e(t)}}je["[object Float32Array]"]=je["[object Float64Array]"]=je["[object Int8Array]"]=je["[object Int16Array]"]=je["[object Int32Array]"]=je["[object Uint8Array]"]=je["[object Uint8ClampedArray]"]=je["[object Uint16Array]"]=je["[object Uint32Array]"]=!0,je["[object Arguments]"]=je["[object Array]"]=je["[object ArrayBuffer]"]=je["[object Boolean]"]=je["[object DataView]"]=je["[object Date]"]=je["[object Error]"]=je["[object Function]"]=je["[object Map]"]=je["[object Number]"]=je["[object Object]"]=je["[object RegExp]"]=je["[object Set]"]=je["[object String]"]=je["[object WeakMap]"]=!1;var we="object"==typeof e&&e&&!e.nodeType&&e,xe=we&&"object"==typeof module&&module&&!module.nodeType&&module,De=xe&&xe.exports===we&&h.process,Ce=function(){try{var e=xe&&xe.require&&xe.require("util").types;return e||De&&De.binding&&De.binding("util")}catch(e){}}(),Me=Ce&&Ce.isTypedArray,Ee=Me?Oe(Me):function(e){return D(e)&&se(e.length)&&!!je[x(e)]},Se=Object.prototype.hasOwnProperty;function Ae(e,t){var n=E(e),r=!n&&ge(e),o=!n&&!r&&_e(e),i=!n&&!r&&!o&&Ee(e),a=n||r||o||i,u=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],d=u.length;for(var s in e)!t&&!Se.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ie(s,d))||u.push(s);return u}var ke=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Ne=Object.prototype.hasOwnProperty;function Te(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||le))return ke(e);var t,n,r=[];for(var o in Object(e))Ne.call(e,o)&&"constructor"!=o&&r.push(o);return r}function Fe(e){return ce(e)?Ae(e):Te(e)}var Pe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ie=/^\w*$/;function $e(e,t){if(E(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!C(e))||(Ie.test(e)||!Pe.test(e)||null!=t&&e in Object(t))}var Be=U(Object,"create");var ze=Object.prototype.hasOwnProperty;var Le=Object.prototype.hasOwnProperty;function Ve(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Re(e,t){for(var n=e.length;n--;)if(ae(e[n][0],t))return n;return-1}Ve.prototype.clear=function(){this.__data__=Be?Be(null):{},this.size=0},Ve.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ve.prototype.get=function(e){var t=this.__data__;if(Be){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ze.call(t,e)?t[e]:void 0},Ve.prototype.has=function(e){var t=this.__data__;return Be?void 0!==t[e]:Le.call(t,e)},Ve.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Be&&void 0===t?"__lodash_hash_undefined__":t,this};var We=Array.prototype.splice;function He(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}He.prototype.clear=function(){this.__data__=[],this.size=0},He.prototype.delete=function(e){var t=this.__data__,n=Re(t,e);return!(n<0)&&(n==t.length-1?t.pop():We.call(t,n,1),--this.size,!0)},He.prototype.get=function(e){var t=this.__data__,n=Re(t,e);return n<0?void 0:t[n][1]},He.prototype.has=function(e){return Re(this.__data__,e)>-1},He.prototype.set=function(e,t){var n=this.__data__,r=Re(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Ze=U(g,"Map");function qe(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Ue(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ue.prototype.clear=function(){this.size=0,this.__data__={hash:new Ve,map:new(Ze||He),string:new Ve}},Ue.prototype.delete=function(e){var t=qe(this,e).delete(e);return this.size-=t?1:0,t},Ue.prototype.get=function(e){return qe(this,e).get(e)},Ue.prototype.has=function(e){return qe(this,e).has(e)},Ue.prototype.set=function(e,t){var n=qe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ge(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Ge.Cache||Ue),n}Ge.Cache=Ue;var Xe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Je=/\\(\\)?/g,Ke=function(e){var t=Ge(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Xe,(function(e,n,r,o){t.push(r?o.replace(Je,"$1"):n||e)})),t}));function Qe(e,t){return E(e)?e:$e(e,t)?[e]:Ke(function(e){return null==e?"":k(e)}(e))}function Ye(e){if("string"==typeof e||C(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function et(e,t){for(var n=0,r=(t=Qe(t,e)).length;null!=e&&n<r;)e=e[Ye(t[n++])];return n&&n==r?e:void 0}function tt(e,t,n){var r=null==e?void 0:et(e,t);return void 0===r?n:r}function nt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var rt=b?b.isConcatSpreadable:void 0;function ot(e){return E(e)||ge(e)||!!(rt&&e&&e[rt])}function it(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=ot),o||(o=[]);++i<a;){var u=e[i];t>0&&n(u)?t>1?it(u,t-1,n,r,o):nt(o,u):r||(o[o.length]=u)}return o}function at(e){var t=this.__data__=new He(e);this.size=t.size}at.prototype.clear=function(){this.__data__=new He,this.size=0},at.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},at.prototype.get=function(e){return this.__data__.get(e)},at.prototype.has=function(e){return this.__data__.has(e)},at.prototype.set=function(e,t){var n=this.__data__;if(n instanceof He){var r=n.__data__;if(!Ze||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ue(r)}return n.set(e,t),this.size=n.size,this};var ut=Object.prototype.propertyIsEnumerable,dt=Object.getOwnPropertySymbols,st=dt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}(dt(e),(function(t){return ut.call(e,t)})))}:function(){return[]};function ct(e){return function(e,t,n){var r=t(e);return E(e)?r:nt(r,n(e))}(e,Fe,st)}var lt=U(g,"DataView"),ft=U(g,"Promise"),pt=U(g,"Set"),ht=z(lt),vt=z(Ze),gt=z(ft),bt=z(pt),yt=z(G),mt=x;(lt&&"[object DataView]"!=mt(new lt(new ArrayBuffer(1)))||Ze&&"[object Map]"!=mt(new Ze)||ft&&"[object Promise]"!=mt(ft.resolve())||pt&&"[object Set]"!=mt(new pt)||G&&"[object WeakMap]"!=mt(new G))&&(mt=function(e){var t=x(e),n="[object Object]"==t?e.constructor:void 0,r=n?z(n):"";if(r)switch(r){case ht:return"[object DataView]";case vt:return"[object Map]";case gt:return"[object Promise]";case bt:return"[object Set]";case yt:return"[object WeakMap]"}return t});var _t=mt,jt=g.Uint8Array;function Ot(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ue;++t<n;)this.add(e[t])}function wt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function xt(e,t){return e.has(t)}Ot.prototype.add=Ot.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ot.prototype.has=function(e){return this.__data__.has(e)};function Dt(e,t,n,r,o,i){var a=1&n,u=e.length,d=t.length;if(u!=d&&!(a&&d>u))return!1;var s=i.get(e),c=i.get(t);if(s&&c)return s==t&&c==e;var l=-1,f=!0,p=2&n?new Ot:void 0;for(i.set(e,t),i.set(t,e);++l<u;){var h=e[l],v=t[l];if(r)var g=a?r(v,h,l,t,e,i):r(h,v,l,e,t,i);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!wt(t,(function(e,t){if(!xt(p,t)&&(h===e||o(h,e,n,r,i)))return p.push(t)}))){f=!1;break}}else if(h!==v&&!o(h,v,n,r,i)){f=!1;break}}return i.delete(e),i.delete(t),f}function Ct(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Mt(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var Et=b?b.prototype:void 0,St=Et?Et.valueOf:void 0;var At=Object.prototype.hasOwnProperty;var kt=Object.prototype.hasOwnProperty;function Nt(e,t,n,r,o,i){var a=E(e),u=E(t),d=a?"[object Array]":_t(e),s=u?"[object Array]":_t(t),c="[object Object]"==(d="[object Arguments]"==d?"[object Object]":d),l="[object Object]"==(s="[object Arguments]"==s?"[object Object]":s),f=d==s;if(f&&_e(e)){if(!_e(t))return!1;a=!0,c=!1}if(f&&!c)return i||(i=new at),a||Ee(e)?Dt(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new jt(e),new jt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ae(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var u=Ct;case"[object Set]":var d=1&r;if(u||(u=Mt),e.size!=t.size&&!d)return!1;var s=a.get(e);if(s)return s==t;r|=2,a.set(e,t);var c=Dt(u(e),u(t),r,o,i,a);return a.delete(e),c;case"[object Symbol]":if(St)return St.call(e)==St.call(t)}return!1}(e,t,d,n,r,o,i);if(!(1&n)){var p=c&&kt.call(e,"__wrapped__"),h=l&&kt.call(t,"__wrapped__");if(p||h){var v=p?e.value():e,g=h?t.value():t;return i||(i=new at),o(v,g,n,r,i)}}return!!f&&(i||(i=new at),function(e,t,n,r,o,i){var a=1&n,u=ct(e),d=u.length;if(d!=ct(t).length&&!a)return!1;for(var s=d;s--;){var c=u[s];if(!(a?c in t:At.call(t,c)))return!1}var l=i.get(e),f=i.get(t);if(l&&f)return l==t&&f==e;var p=!0;i.set(e,t),i.set(t,e);for(var h=a;++s<d;){var v=e[c=u[s]],g=t[c];if(r)var b=a?r(g,v,c,t,e,i):r(v,g,c,e,t,i);if(!(void 0===b?v===g||o(v,g,n,r,i):b)){p=!1;break}h||(h="constructor"==c)}if(p&&!h){var y=e.constructor,m=t.constructor;y!=m&&"constructor"in e&&"constructor"in t&&!("function"==typeof y&&y instanceof y&&"function"==typeof m&&m instanceof m)&&(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,r,o,i))}function Tt(e,t,n,r,o){return e===t||(null==e||null==t||!D(e)&&!D(t)?e!=e&&t!=t:Nt(e,t,n,r,Tt,o))}function Ft(e){return e==e&&!N(e)}function Pt(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function It(e){var t=function(e){for(var t=Fe(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ft(o)]}return t}(e);return 1==t.length&&t[0][2]?Pt(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var u=n[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<i;){var d=(u=n[o])[0],s=e[d],c=u[1];if(a&&u[2]){if(void 0===s&&!(d in e))return!1}else{var l=new at;if(r)var f=r(s,c,d,e,t,l);if(!(void 0===f?Tt(c,s,3,r,l):f))return!1}}return!0}(n,e,t)}}function $t(e,t){return null!=e&&t in Object(e)}function Bt(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=Qe(t,e)).length,i=!1;++r<o;){var a=Ye(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&se(o)&&ie(a,o)&&(E(e)||ge(e))}(e,t,$t)}function zt(e){return $e(e)?(t=Ye(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return et(t,e)}}(e);var t}function Lt(e){return"function"==typeof e?e:null==e?T:"object"==typeof e?E(e)?function(e,t){return $e(e)&&Ft(t)?Pt(Ye(e),t):function(n){var r=tt(n,e);return void 0===r&&r===t?Bt(n,e):Tt(t,r,3)}}(e[0],e[1]):It(e):zt(e)}function Vt(e){return D(e)&&ce(e)}function Rt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function Wt(e,t,n,r){var o=-1,i=re,a=!0,u=e.length,d=[],s=t.length;if(!u)return d;n&&(t=M(t,Oe(n))),r?(i=Rt,a=!1):t.length>=200&&(i=xt,a=!1,t=new Ot(t));e:for(;++o<u;){var c=e[o],l=null==n?c:n(c);if(c=r||0!==c?c:0,a&&l==l){for(var f=s;f--;)if(t[f]===l)continue e;d.push(c)}else i(t,l,r)||d.push(c)}return d}var Ht=de((function(e,t){return Vt(e)?Wt(e,it(t,1,Vt,!0)):[]}));var Zt=de((function(e,t){var n=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}(t);return Vt(n)&&(n=void 0),Vt(e)?Wt(e,it(t,1,Vt,!0),Lt(n)):[]}));var qt=pt&&1/Mt(new pt([,-0]))[1]==1/0?function(e){return new pt(e)}:function(){};var Ut=de((function(e){return function(e,t,n){var r=-1,o=re,i=e.length,a=!0,u=[],d=u;if(n)a=!1,o=Rt;else if(i>=200){var s=t?null:qt(e);if(s)return Mt(s);a=!1,o=xt,d=new Ot}else d=t?[]:u;e:for(;++r<i;){var c=e[r],l=t?t(c):c;if(c=n||0!==c?c:0,a&&l==l){for(var f=d.length;f--;)if(d[f]===l)continue e;t&&d.push(l),u.push(c)}else o(d,l,n)||(d!==u&&d.push(l),u.push(c))}return u}(it(e,1,Vt,!0))}));function Gt(e,t){return e.id===t||!!e.children&&e.children.some((function(e){return Gt(e,t)}))}function Xt(e){var t={};return function e(n,r){if(n&&n.id&&(t[n.id]=u({},n,{},r?{parent:r}:{}),n.children))for(var o=0,i=n.children.length;o<i;++o)e(n.children[o],n.id)}(e),t}function Jt(e,t,n){var r=[];return function t(o){var i=n[o],a=(i.children||[]).map((function(e){return t(e.id)})).filter((function(e){return!e.toHide}));return 0!==a.length||e(i)?(r.push(o),u({},i,{children:a})):u({},i,{toHide:!0})}(t),r}var Kt=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n(this,t),e=l(this,d(t).call(this)),Object.defineProperty(c(e),"_root",{value:r,configurable:!1,writable:!0}),Object.defineProperty(c(e),"nodesMap",{value:Xt(r),configurable:!1,writable:!0}),e._initExpanded(o.defaultExpanded),e.selected=Object.values(e.nodesMap).filter((function(e){return e.selected})).map((function(e){return e.id})),e.filtered=[],o.filter&&(e.filter=o.filter),e.autoSelectDescendants=o.autoSelectDescendants,e.autoDeselectDescendants=o.autoDeselectDescendants,e._updateVisibleTree(),e.draggedNodeId=void 0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),o(t,[{key:"_initExpanded",value:function(e){e?this.expandNode(e):this.root&&this.root.id?(this.expanded=[this.root.id],this.expandedWithoutFilter=this.expanded):(this.expanded=[],this.expandedWithoutFilter=[])}},{key:"_updateVisibleTree",value:function(){this.visibleTree=this._computeVisibleTree(this.root.id,{expanded:this.expanded})}},{key:"_detachNodeFromParent",value:function(e){var t=this._getNode(e.parent);e.parent=void 0,t&&(t.children=Zt(t.children||[],[e],(function(e){return e.id})))}},{key:"_attachNodeToParent",value:function(e,t,n){this._detachNodeFromParent(e);var r,o=this._getNode(t);o&&(e.parent=o.id,r=n,o.children=null==r?[].concat(p(o.children||[]),[u({},e)]):[].concat(p((o.children||[]).slice(0,n)),[u({},e)],p((o.children||[]).slice(n))))}},{key:"_computeVisibleTree",value:function(e,t){var n=this,r=t.expanded,o=this._getNode(e);if(!o)return{};var i=o.children||[];return u({},o,{children:r.includes(o.id)?i.filter((function(e){return n.isNodeFiltered(e.id)})).map((function(e){return n._computeVisibleTree(e.id,{expanded:r})})):[],isLeaf:0===i.length})}},{key:"_getNode",value:function(e){return this.nodesMap[e]}},{key:"expandNode",value:function(e,t){var n,r;this.expanded&&e===this.expanded[this.expanded.length-1]||(this.expanded=(n=e,r=this.nodesMap,function e(t){var n=r[t];return n?[].concat(p(e(n.parent)),[t]):[]}(n)),this.expandedWithoutFilter=this.expanded,this._updateVisibleTree(),this.trigger("expand",this.expanded,t))}},{key:"isNodeExpanded",value:function(e){return this.expanded.includes(e)}},{key:"selectNode",value:function(e,t){var n=(t?this.autoSelectDescendants:this.autoDeselectDescendants)?Jt((function(e){return!1!==e.selectable}),e,this.nodesMap):[e];this.selected=(t?Ut:Ht)(this.selected,n),this.trigger("select",this.selected)}},{key:"isNodeSelected",value:function(e){return this.selected.includes(e)}},{key:"isNodeFiltered",value:function(e){return!this._filter||this.filtered.includes(e)}},{key:"startDrag",value:function(e){Object.prototype.hasOwnProperty.call(this.nodesMap,e)&&(this.draggedNodeId=e)}},{key:"stopDrag",value:function(){this.draggedNodeId=void 0}},{key:"isParent",value:function(e,t){var n=this._getNode(e);return!!n&&Gt(n,t)}},{key:"dropOnNode",value:function(e,t){if(this.isDragging()&&!this.isNodeDragged(e)){var n=this._getNode(this.draggedNodeId);Gt(n,e)||(this._attachNodeToParent(n,e,t),this.expandNode(this.draggedNodeId,"drop"),this.draggedNodeId=void 0,this._updateVisibleTree(),this.trigger("move",{moved:n.id,to:e,index:t}))}}},{key:"isNodeDragged",value:function(e){return this.draggedNodeId===e}},{key:"isDragging",value:function(){return void 0!==this.draggedNodeId}},{key:"_applyFilter",value:function(){var e=this;this._filter?(this.expandedWithoutFilter.some((function(t){var n=e._getNode(t);return e._filter(n)||n.children&&n.children.some(e._filter)}))?this.expanded=this.expandedWithoutFilter:this.expanded=[this.root.id],this.filtered=Jt(this._filter,this.root.id,this.nodesMap)):this.filtered=[]}},{key:"root",get:function(){return this._root},set:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._root=t,this.nodesMap=Xt(t),this.expanded.length&&!this.expanded.some((function(t){return!e.nodesMap[t]}))||this._initExpanded(),this._applyFilter(),this._updateVisibleTree()}},{key:"filter",set:function(e){this._filter=e,this._applyFilter(),this._updateVisibleTree()}}]),t}(function(){function e(){n(this,e),this.listeners={}}return o(e,[{key:"on",value:function(e,t){this.listeners[e]=[].concat(p(this.listeners[e]||[]),[t])}},{key:"off",value:function(e,t){var n=this.listeners[e];n&&(this.listeners[e]=n.filter((function(e){return e===t})))}},{key:"trigger",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=this.listeners[e];o&&o.forEach((function(e){return e.apply(null,n)}))}}]),e}());function Qt(e,t){Object.entries(t).forEach((function(t){var n=f(t,2),r=n[0],o=n[1];e.style[r]=o}))}function Yt(e,t,n,r,o,i,a,u,d,s){"boolean"!=typeof a&&(d=u,u=a,a=!1);const c="function"==typeof n?n.options:n;let l;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,o&&(c.functional=!0)),r&&(c._scopeId=r),i?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=l):t&&(l=a?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,u(e))}),l)if(c.functional){const e=c.render;c.render=function(t,n){return l.call(n),e(t,n)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,l):[l]}return n}var en={name:"FinderItemArrow",props:{expanded:{type:Boolean,default:!1},theme:{type:Object,default:function(){}},item:{type:Object,default:function(){}}}},tn=function(e,t){return(0,t._c)("div",{staticClass:"arrow",style:Object.assign({},{expanded:t.props.expanded},t.props.theme.arrowColor&&{borderColor:t.props.theme.arrowColor})})};tn._withStripped=!0;var nn=Yt({render:tn,staticRenderFns:[]},void 0,en,"data-v-8d4a66ea",!0,void 0,!1,void 0,void 0,void 0),rn={name:"FinderListDropZone",props:{treeModel:{type:Object,required:!0},node:{type:Object,required:!0},dragEnabled:{type:[Boolean,Function],default:!1},index:{type:Number,default:void 0},options:{type:Object,default:function(){return{}}}},data:function(){return{dragCounter:0}},computed:{dragOver:function(){return this.treeModel.isDragging()&&this.canDrop&&this.dragCounter>0},theme:function(){return tt(this,"options.theme",{})},canDrag:function(){return"function"==typeof this.dragEnabled?this.dragEnabled(this.node):this.dragEnabled},canDrop:function(){return!this.treeModel.isParent(this.treeModel.draggedNodeId,this.node.id)&&(!this.options.canDrop||this.options.canDrop(this.node.id,this.treeModel.draggedNodeId))}},methods:{onDragEnter:function(){this.dragCounter++},onDragLeave:function(){this.dragCounter--},onDrop:function(e){e.preventDefault(),this.dragCounter=0,this.canDrop&&this.treeModel.isDragging()&&this.treeModel.dropOnNode(this.node.id,this.index)}}},on=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"drop-zone",class:{"drag-over":e.dragOver,dragging:e.treeModel.isDragging(),"no-drop":e.treeModel.isDragging()&&!e.canDrop},style:Object.assign({},e.dragOver&&e.theme.primaryColor&&{borderColor:e.theme.primaryColor},e.dragOver&&e.theme.dropZoneBgColor&&{backgroundColor:e.theme.dropZoneBgColor}),on:{dragenter:function(t){return t.preventDefault(),e.onDragEnter(t)},dragleave:function(t){return t.preventDefault(),e.onDragLeave(t)},dragover:function(e){e.preventDefault()},drop:function(t){return t.preventDefault(),e.onDrop(t)}}},[e.options.dropZoneComponent?n(e.options.dropZoneComponent,{tag:"component",staticStyle:{"flex-grow":"1"},attrs:{dragging:e.treeModel.isDragging(),"drag-over":e.dragOver}}):e._e()],1)};on._withStripped=!0;var an=Yt({render:on,staticRenderFns:[]},void 0,rn,"data-v-8a4b9c90",!1,void 0,!1,void 0,void 0,void 0),un={name:"FinderItem",mixins:[an],props:{selectable:{type:Boolean,default:!1}},computed:{expanded:function(){return this.treeModel.isNodeExpanded(this.node.id)},selected:function(){return this.treeModel.isNodeSelected(this.node.id)},dragged:function(){return this.treeModel.isNodeDragged(this.node.id)},itemComponent:function(){return this.options.itemComponent||"div"},arrowComponent:function(){return this.options.arrowComponent||nn}},watch:{dragOver:function(e){var t=this;e&&this.canDrop&&!this.node.isLeaf?this.dragOverTimeout=setTimeout((function(){return t.treeModel.expandNode(t.node.id,"dragover")}),500):this.dragOverTimeout&&clearTimeout(this.dragOverTimeout)},node:function(){this.dragOverTimeout&&clearTimeout(this.dragOverTimeout)}},methods:{onMouseDown:function(){var e=this;this.mousedown=!0,setTimeout((function(){e.mousedown=!1}),100)},onClick:function(){this.treeModel.expandNode(this.node.id,"click")},onFocus:function(){this.mousedown||this.treeModel.expandNode(this.node.id,"focus")},onSelect:function(e){this.treeModel.selectNode(this.node.id,e.target.checked)},onDragStart:function(e){this.canDrag&&(this.options.dragImageComponent&&(this.appendGhost(),e.dataTransfer.setDragImage(this.ghost,0,0)),e.dataTransfer.setData("text/plain",this.node.id),this.treeModel.startDrag(this.node.id))},onDragOver:function(e){this.canDrag&&(e.preventDefault(),this.canDrop?e.dataTransfer.dropEffect="move":e.dataTransfer.dropEffect="none")},onDragEnd:function(){this.ghost&&(this.ghost.parentNode.removeChild(this.ghost),this.ghost=null),this.canDrag&&(this.options.hasDragHandle&&this.$el.setAttribute("draggable","false"),this.treeModel.stopDrag())},appendGhost:function(){var e=this;this.ghost=document.createElement("div");var n=document.createElement("div"),r=new t({render:function(t){return t(e.options.dragImageComponent,{props:{item:e.node}})}}).$mount(n);this.ghost.appendChild(r.$el),Qt(r.$el,{boxShadow:"0 3px 4px rgba(116, 116, 116, 0.3)"}),Qt(this.ghost,{position:"absolute",padding:"10px",top:"-1000px",boxSizing:"border-box",pointerEvents:"none"}),this.$el.ownerDocument.body.appendChild(this.ghost)}}},dn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"item",class:[e.node.cssClass||"",{expanded:e.expanded,draggable:e.canDrag&&!e.options.hasDragHandle,dragged:e.dragged,"has-drag-handle":e.canDrag&&e.options.hasDragHandle,"drag-over":e.dragOver,"no-drop":e.treeModel.isDragging()&&!e.canDrop}],style:Object.assign({},e.expanded&&e.theme.primaryColor&&{backgroundColor:e.theme.primaryColor},e.dragged&&e.theme.draggedItemBgColor&&{backgroundColor:e.theme.draggedItemBgColor},e.dragged&&e.theme.draggedItemBoxShadow&&{"box-shadow":e.theme.draggedItemBoxShadow},e.dragOver&&e.theme.primaryColor&&{borderColor:e.theme.primaryColor},e.dragOver&&e.theme.dropZoneBgColor&&{backgroundColor:e.theme.dropZoneBgColor}),attrs:{role:"button",draggable:e.canDrag&&!e.options.hasDragHandle,"aria-expanded":e.node.isLeaf?void 0:e.expanded},on:{mousedown:e.onMouseDown,click:e.onClick,dragenter:e.onDragEnter,dragleave:e.onDragLeave,dragstart:e.onDragStart,dragover:e.onDragOver,drop:e.onDrop,dragend:e.onDragEnd,focus:e.onFocus}},[e.canDrag&&e.options.hasDragHandle?n("div",{staticClass:"drag-handle",on:{mousedown:function(t){return e.$el.setAttribute("draggable","true")},mouseup:function(t){return e.$el.setAttribute("draggable","false")}}},[n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2m0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8m0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14m6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6m0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8m0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14"}})])]):e._e(),e._v(" "),e.selectable?n("input",{attrs:{type:"checkbox",disabled:!1===e.node.selectable,"aria-label":e.node.label},domProps:{checked:e.selected},on:{click:function(e){e.stopPropagation()},change:e.onSelect}}):e._e(),e._v(" "),n(e.itemComponent,{tag:"component",staticClass:"inner-item",attrs:{item:e.node,expanded:e.expanded,dragged:e.dragged}},[e._t("default")],2),e._v(" "),e.node.isLeaf?e._e():n(e.arrowComponent,{tag:"component",attrs:{theme:e.theme,expanded:e.expanded,item:e.node}})],1)};dn._withStripped=!0;var sn=Yt({render:dn,staticRenderFns:[]},void 0,un,"data-v-1050ea25",!1,void 0,!1,void 0,void 0,void 0);function cn(e,t){var n=t.props,r=t.expandedItemIndex,o=n.items,i=n.options;return i.sortBy&&(o=p(o).sort(i.sortBy)),o.map((function(t,o){return[n.dragEnabled&&e(an,{key:"drop-zone-".concat(t.id),attrs:{node:n.parent,treeModel:n.treeModel,dragEnabled:n.dragEnabled,index:o,options:n.options}})].concat([e(sn,{key:"item-".concat(t.id),attrs:{node:t,treeModel:n.treeModel,selectable:n.selectable,dragEnabled:n.dragEnabled,options:n.options,tabindex:o===r?"0":"-1"}},[t.label])])}))}var ln=Yt({},void 0,{name:"FinderList",functional:!0,props:{parent:{type:Object,default:function(){return{}}},items:{type:Array,default:function(){return[]}},treeModel:{type:Object,required:!0},selectable:{type:Boolean,default:!1},dragEnabled:{type:[Boolean,Function],default:!1},options:{type:Object,default:function(){return{}}},hasExpandedItem:{type:Boolean,default:!1}},render:function(e,t){var n=t.props,r=t.listeners,o=tt(n,"options.theme.separatorColor",""),i=tt(n,"options.theme.separatorWidth",""),a=u({},o&&{borderColor:o},{},i&&{borderWidth:i}),d=Math.max(0,n.items.findIndex((function(e){return n.treeModel.isNodeExpanded(e.id)})));return[e("div",{class:"list",style:a,on:{keydown:function(e){var t;"ArrowDown"===e.key?t=function(e){for(var t=e.nextSibling;t;){if(t.classList&&t.classList.contains("item"))return t;t=t.nextSibling}}(e.target):"ArrowUp"===e.key&&(t=function(e){for(var t=e.previousSibling;t;){if(t.classList&&t.classList.contains("item"))return t;t=t.previousSibling}}(e.target)),t&&t.focus()}}},[[].concat(p(cn(e,{props:n,listeners:r,expandedItemIndex:d})),[n.dragEnabled&&e(an,{class:"last",attrs:{treeModel:n.treeModel,node:n.parent,dragEnabled:n.dragEnabled,index:n.items.length,options:n.options}})])])]}},"data-v-3afed33d",void 0,void 0,!1,void 0,void 0,void 0);function fn(e,t,n){if(!n||!n.children||0===n.children.length)return null;var r=n.children.find((function(e){return t.treeModel.isNodeExpanded(e.id)})),o={sortBy:t.sortBy,itemComponent:t.itemComponent,arrowComponent:t.arrowComponent,dragImageComponent:t.dragImageComponent,dropZoneComponent:t.dropZoneComponent,theme:t.theme,hasDragHandle:t.hasDragHandle,canDrop:t.canDrop},i=e(ln,{ref:"rootList",attrs:{"tree-model":t.treeModel,parent:n,items:n.children,selectable:t.selectable,"drag-enabled":t.dragEnabled,options:o,"has-expanded-item":!!r}});return e("div",{class:"list-container"},[i,r&&fn(e,t,r)])}var pn=Yt({},void 0,{name:"Finder",components:{FinderList:ln},props:{tree:{type:Object,required:!0},selectable:{type:Boolean,default:!1},autoSelectDescendants:{type:Boolean,default:!1},autoDeselectDescendants:{type:Boolean,default:!1},dragEnabled:{type:[Boolean,Function],default:!1},hasDragHandle:{type:Boolean,default:!1},canDrop:{type:Function,default:void 0},filter:{type:Function,default:void 0},sortBy:{type:Function,default:void 0},defaultExpanded:{type:String,default:void 0},itemComponent:{type:[String,Object],default:void 0},arrowComponent:{type:[String,Object],default:void 0},dragImageComponent:{type:[String,Object],default:void 0},dropZoneComponent:{type:[String,Object],default:void 0},theme:{type:Object,default:function(){return{}}},scrollAnimationDuration:{type:Number,default:200}},data:function(){return{treeModel:{}}},watch:{tree:function(e){this.treeModel.root=e},filter:function(e){this.treeModel.filter=e},autoSelectDescendants:function(e){this.treeModel.autoSelectDescendants=e},autoDeselectDescendants:function(e){this.treeModel.autoDeselectDescendants=e}},beforeCreate:function(){Object.defineProperty(this.$options.propsData,"tree",{configurable:!1})},created:function(){var e=this;this.treeModel=new Kt(this.tree,{filter:this.filter,defaultExpanded:this.defaultExpanded,autoSelectDescendants:this.autoSelectDescendants,autoDeselectDescendants:this.autoDeselectDescendants}),this.treeModel.on("expand",(function(t,n){"dragover"!==n&&e.$nextTick((function(){e._scrollToRight(e.scrollAnimationDuration)})),e.$emit("expand",{expanded:t,sourceEvent:n})})),this.treeModel.on("select",(function(t){e.$emit("select",{selected:t})})),this.treeModel.on("move",(function(t){var n=t.moved,r=t.to,o=t.index;e.$emit("move",{moved:n,to:r,index:o})}))},methods:{expand:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"api";this.treeModel.expandNode(e,t)},_scrollToRight:function(e){var t=this,n=this.$el,r=n.scrollLeft,o=n.scrollWidth,i=n.offsetWidth;if(0!==e){var a=o-i-r;if(!(a<=0)){var u=performance.now(),d=0;window.requestAnimationFrame((function n(o){(d+=o-u)>=e?t.$el.scrollLeft=t.$el.scrollWidth:(u=o,t.$el.scrollLeft=function(e,t,n,r){return-n*(e/=r)*(e-2)+t}(d,r,a,e),window.requestAnimationFrame(n))}))}}else this.$el.scrollLeft=o}},render:function(e){return e("div",{class:"tree-container"},[this.treeModel&&fn(e,this,this.treeModel.visibleTree)])}},"data-v-5bea1df7",void 0,void 0,!1,void 0,void 0,void 0),hn={Finder:pn,install:function(e){e.component("Finder",pn)}},vn=Object.freeze({__proto__:null,default:hn,Finder:pn});"undefined"!=typeof window&&window.Vue&&window.Vue.use(hn),e.default=vn,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e=e||self)["vue-finder"]={},e.Vue)}(this,(function(e,t){"use strict";function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y(r.key),r)}}function s(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,n){return(t=y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d(e);if(t){var o=d(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return f(this,n)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,d=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){d=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw o}}return s}}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}t=t&&t.hasOwnProperty("default")?t.default:t;var m="object"==typeof global&&global&&global.Object===Object&&global,_="object"==typeof self&&self&&self.Object===Object&&self,j=m||_||Function("return this")(),O=j.Symbol,w=Object.prototype,x=w.hasOwnProperty,D=w.toString,M=O?O.toStringTag:void 0;var S=Object.prototype.toString;var E=O?O.toStringTag:void 0;function C(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":E&&E in Object(e)?function(e){var t=x.call(e,M),n=e[M];try{e[M]=void 0;var r=!0}catch(e){}var o=D.call(e);return r&&(t?e[M]=n:delete e[M]),o}(e):function(e){return S.call(e)}(e)}function k(e){return null!=e&&"object"==typeof e}function A(e){return"symbol"==typeof e||k(e)&&"[object Symbol]"==C(e)}function I(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var N=Array.isArray,P=O?O.prototype:void 0,z=P?P.toString:void 0;function T(e){if("string"==typeof e)return e;if(N(e))return I(e,T)+"";if(A(e))return z?z.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function $(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function F(e){return e}function R(e){if(!$(e))return!1;var t=C(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var B,L=j["__core-js_shared__"],V=(B=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+B:"";var W=Function.prototype.toString;function H(e){if(null!=e){try{return W.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var U=/^\[object .+?Constructor\]$/,Z=Function.prototype,q=Object.prototype,G=Z.toString,X=q.hasOwnProperty,J=RegExp("^"+G.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function K(e){return!(!$(e)||(t=e,V&&V in t))&&(R(e)?J:U).test(H(e));var t}function Q(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return K(n)?n:void 0}var Y=Q(j,"WeakMap");function ee(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var te=Date.now;var ne,re,oe,ie=function(){try{var e=Q(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ae=(ne=ie?function(e,t){return ie(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:F,re=0,oe=0,function(){var e=te(),t=16-(e-oe);if(oe=e,t>0){if(++re>=800)return arguments[0]}else re=0;return ne.apply(void 0,arguments)});function se(e){return e!=e}function ue(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}(e,se,n)}(e,t,0)>-1}var de=/^(?:0|[1-9]\d*)$/;function ce(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&de.test(e))&&e>-1&&e%1==0&&e<t}function le(e,t){return e===t||e!=e&&t!=t}var fe=Math.max;function he(e,t){return ae(function(e,t,n){return t=fe(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=fe(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),ee(e,this,s)}}(e,t,F),e+"")}function pe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ve(e){return null!=e&&pe(e.length)&&!R(e)}var ge=Object.prototype;function be(e){return k(e)&&"[object Arguments]"==C(e)}var ye=Object.prototype,me=ye.hasOwnProperty,_e=ye.propertyIsEnumerable,je=be(function(){return arguments}())?be:function(e){return k(e)&&me.call(e,"callee")&&!_e.call(e,"callee")};var Oe="object"==typeof e&&e&&!e.nodeType&&e,we=Oe&&"object"==typeof module&&module&&!module.nodeType&&module,xe=we&&we.exports===Oe?j.Buffer:void 0,De=(xe?xe.isBuffer:void 0)||function(){return!1},Me={};function Se(e){return function(t){return e(t)}}Me["[object Float32Array]"]=Me["[object Float64Array]"]=Me["[object Int8Array]"]=Me["[object Int16Array]"]=Me["[object Int32Array]"]=Me["[object Uint8Array]"]=Me["[object Uint8ClampedArray]"]=Me["[object Uint16Array]"]=Me["[object Uint32Array]"]=!0,Me["[object Arguments]"]=Me["[object Array]"]=Me["[object ArrayBuffer]"]=Me["[object Boolean]"]=Me["[object DataView]"]=Me["[object Date]"]=Me["[object Error]"]=Me["[object Function]"]=Me["[object Map]"]=Me["[object Number]"]=Me["[object Object]"]=Me["[object RegExp]"]=Me["[object Set]"]=Me["[object String]"]=Me["[object WeakMap]"]=!1;var Ee="object"==typeof e&&e&&!e.nodeType&&e,Ce=Ee&&"object"==typeof module&&module&&!module.nodeType&&module,ke=Ce&&Ce.exports===Ee&&m.process,Ae=function(){try{var e=Ce&&Ce.require&&Ce.require("util").types;return e||ke&&ke.binding&&ke.binding("util")}catch(e){}}(),Ie=Ae&&Ae.isTypedArray,Ne=Ie?Se(Ie):function(e){return k(e)&&pe(e.length)&&!!Me[C(e)]},Pe=Object.prototype.hasOwnProperty;function ze(e,t){var n=N(e),r=!n&&je(e),o=!n&&!r&&De(e),i=!n&&!r&&!o&&Ne(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],u=s.length;for(var d in e)!t&&!Pe.call(e,d)||a&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ce(d,u))||s.push(d);return s}var Te=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),$e=Object.prototype.hasOwnProperty;function Fe(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||ge))return Te(e);var t,n,r=[];for(var o in Object(e))$e.call(e,o)&&"constructor"!=o&&r.push(o);return r}function Re(e){return ve(e)?ze(e):Fe(e)}var Be=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Le=/^\w*$/;function Ve(e,t){if(N(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!A(e))||(Le.test(e)||!Be.test(e)||null!=t&&e in Object(t))}var We=Q(Object,"create");var He=Object.prototype.hasOwnProperty;var Ue=Object.prototype.hasOwnProperty;function Ze(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qe(e,t){for(var n=e.length;n--;)if(le(e[n][0],t))return n;return-1}Ze.prototype.clear=function(){this.__data__=We?We(null):{},this.size=0},Ze.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ze.prototype.get=function(e){var t=this.__data__;if(We){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return He.call(t,e)?t[e]:void 0},Ze.prototype.has=function(e){var t=this.__data__;return We?void 0!==t[e]:Ue.call(t,e)},Ze.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=We&&void 0===t?"__lodash_hash_undefined__":t,this};var Ge=Array.prototype.splice;function Xe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Xe.prototype.clear=function(){this.__data__=[],this.size=0},Xe.prototype.delete=function(e){var t=this.__data__,n=qe(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ge.call(t,n,1),--this.size,!0)},Xe.prototype.get=function(e){var t=this.__data__,n=qe(t,e);return n<0?void 0:t[n][1]},Xe.prototype.has=function(e){return qe(this.__data__,e)>-1},Xe.prototype.set=function(e,t){var n=this.__data__,r=qe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Je=Q(j,"Map");function Ke(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Qe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Qe.prototype.clear=function(){this.size=0,this.__data__={hash:new Ze,map:new(Je||Xe),string:new Ze}},Qe.prototype.delete=function(e){var t=Ke(this,e).delete(e);return this.size-=t?1:0,t},Qe.prototype.get=function(e){return Ke(this,e).get(e)},Qe.prototype.has=function(e){return Ke(this,e).has(e)},Qe.prototype.set=function(e,t){var n=Ke(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ye(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Ye.Cache||Qe),n}Ye.Cache=Qe;var et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/\\(\\)?/g,nt=function(e){var t=Ye(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(et,(function(e,n,r,o){t.push(r?o.replace(tt,"$1"):n||e)})),t}));function rt(e,t){return N(e)?e:Ve(e,t)?[e]:nt(function(e){return null==e?"":T(e)}(e))}function ot(e){if("string"==typeof e||A(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function it(e,t){for(var n=0,r=(t=rt(t,e)).length;null!=e&&n<r;)e=e[ot(t[n++])];return n&&n==r?e:void 0}function at(e,t,n){var r=null==e?void 0:it(e,t);return void 0===r?n:r}function st(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var ut=O?O.isConcatSpreadable:void 0;function dt(e){return N(e)||je(e)||!!(ut&&e&&e[ut])}function ct(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=dt),o||(o=[]);++i<a;){var s=e[i];t>0&&n(s)?t>1?ct(s,t-1,n,r,o):st(o,s):r||(o[o.length]=s)}return o}function lt(e){var t=this.__data__=new Xe(e);this.size=t.size}lt.prototype.clear=function(){this.__data__=new Xe,this.size=0},lt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},lt.prototype.get=function(e){return this.__data__.get(e)},lt.prototype.has=function(e){return this.__data__.has(e)},lt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Xe){var r=n.__data__;if(!Je||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Qe(r)}return n.set(e,t),this.size=n.size,this};var ft=Object.prototype.propertyIsEnumerable,ht=Object.getOwnPropertySymbols,pt=ht?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}(ht(e),(function(t){return ft.call(e,t)})))}:function(){return[]};function vt(e){return function(e,t,n){var r=t(e);return N(e)?r:st(r,n(e))}(e,Re,pt)}var gt=Q(j,"DataView"),bt=Q(j,"Promise"),yt=Q(j,"Set"),mt=H(gt),_t=H(Je),jt=H(bt),Ot=H(yt),wt=H(Y),xt=C;(gt&&"[object DataView]"!=xt(new gt(new ArrayBuffer(1)))||Je&&"[object Map]"!=xt(new Je)||bt&&"[object Promise]"!=xt(bt.resolve())||yt&&"[object Set]"!=xt(new yt)||Y&&"[object WeakMap]"!=xt(new Y))&&(xt=function(e){var t=C(e),n="[object Object]"==t?e.constructor:void 0,r=n?H(n):"";if(r)switch(r){case mt:return"[object DataView]";case _t:return"[object Map]";case jt:return"[object Promise]";case Ot:return"[object Set]";case wt:return"[object WeakMap]"}return t});var Dt=xt,Mt=j.Uint8Array;function St(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Qe;++t<n;)this.add(e[t])}function Et(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Ct(e,t){return e.has(t)}St.prototype.add=St.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},St.prototype.has=function(e){return this.__data__.has(e)};function kt(e,t,n,r,o,i){var a=1&n,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;var d=i.get(e),c=i.get(t);if(d&&c)return d==t&&c==e;var l=-1,f=!0,h=2&n?new St:void 0;for(i.set(e,t),i.set(t,e);++l<s;){var p=e[l],v=t[l];if(r)var g=a?r(v,p,l,t,e,i):r(p,v,l,e,t,i);if(void 0!==g){if(g)continue;f=!1;break}if(h){if(!Et(t,(function(e,t){if(!Ct(h,t)&&(p===e||o(p,e,n,r,i)))return h.push(t)}))){f=!1;break}}else if(p!==v&&!o(p,v,n,r,i)){f=!1;break}}return i.delete(e),i.delete(t),f}function At(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function It(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var Nt=O?O.prototype:void 0,Pt=Nt?Nt.valueOf:void 0;var zt=Object.prototype.hasOwnProperty;var Tt=Object.prototype.hasOwnProperty;function $t(e,t,n,r,o,i){var a=N(e),s=N(t),u=a?"[object Array]":Dt(e),d=s?"[object Array]":Dt(t),c="[object Object]"==(u="[object Arguments]"==u?"[object Object]":u),l="[object Object]"==(d="[object Arguments]"==d?"[object Object]":d),f=u==d;if(f&&De(e)){if(!De(t))return!1;a=!0,c=!1}if(f&&!c)return i||(i=new lt),a||Ne(e)?kt(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Mt(e),new Mt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return le(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=At;case"[object Set]":var u=1&r;if(s||(s=It),e.size!=t.size&&!u)return!1;var d=a.get(e);if(d)return d==t;r|=2,a.set(e,t);var c=kt(s(e),s(t),r,o,i,a);return a.delete(e),c;case"[object Symbol]":if(Pt)return Pt.call(e)==Pt.call(t)}return!1}(e,t,u,n,r,o,i);if(!(1&n)){var h=c&&Tt.call(e,"__wrapped__"),p=l&&Tt.call(t,"__wrapped__");if(h||p){var v=h?e.value():e,g=p?t.value():t;return i||(i=new lt),o(v,g,n,r,i)}}return!!f&&(i||(i=new lt),function(e,t,n,r,o,i){var a=1&n,s=vt(e),u=s.length;if(u!=vt(t).length&&!a)return!1;for(var d=u;d--;){var c=s[d];if(!(a?c in t:zt.call(t,c)))return!1}var l=i.get(e),f=i.get(t);if(l&&f)return l==t&&f==e;var h=!0;i.set(e,t),i.set(t,e);for(var p=a;++d<u;){var v=e[c=s[d]],g=t[c];if(r)var b=a?r(g,v,c,t,e,i):r(v,g,c,e,t,i);if(!(void 0===b?v===g||o(v,g,n,r,i):b)){h=!1;break}p||(p="constructor"==c)}if(h&&!p){var y=e.constructor,m=t.constructor;y!=m&&"constructor"in e&&"constructor"in t&&!("function"==typeof y&&y instanceof y&&"function"==typeof m&&m instanceof m)&&(h=!1)}return i.delete(e),i.delete(t),h}(e,t,n,r,o,i))}function Ft(e,t,n,r,o){return e===t||(null==e||null==t||!k(e)&&!k(t)?e!=e&&t!=t:$t(e,t,n,r,Ft,o))}function Rt(e){return e==e&&!$(e)}function Bt(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Lt(e){var t=function(e){for(var t=Re(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Rt(o)]}return t}(e);return 1==t.length&&t[0][2]?Bt(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var s=n[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){var u=(s=n[o])[0],d=e[u],c=s[1];if(a&&s[2]){if(void 0===d&&!(u in e))return!1}else{var l=new lt;if(r)var f=r(d,c,u,e,t,l);if(!(void 0===f?Ft(c,d,3,r,l):f))return!1}}return!0}(n,e,t)}}function Vt(e,t){return null!=e&&t in Object(e)}function Wt(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=rt(t,e)).length,i=!1;++r<o;){var a=ot(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&pe(o)&&ce(a,o)&&(N(e)||je(e))}(e,t,Vt)}function Ht(e){return Ve(e)?(t=ot(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return it(t,e)}}(e);var t}function Ut(e){return"function"==typeof e?e:null==e?F:"object"==typeof e?N(e)?function(e,t){return Ve(e)&&Rt(t)?Bt(ot(e),t):function(n){var r=at(n,e);return void 0===r&&r===t?Wt(n,e):Ft(t,r,3)}}(e[0],e[1]):Lt(e):Ht(e)}function Zt(e){return k(e)&&ve(e)}function qt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function Gt(e,t,n,r){var o=-1,i=ue,a=!0,s=e.length,u=[],d=t.length;if(!s)return u;n&&(t=I(t,Se(n))),r?(i=qt,a=!1):t.length>=200&&(i=Ct,a=!1,t=new St(t));e:for(;++o<s;){var c=e[o],l=null==n?c:n(c);if(c=r||0!==c?c:0,a&&l==l){for(var f=d;f--;)if(t[f]===l)continue e;u.push(c)}else i(t,l,r)||u.push(c)}return u}var Xt=he((function(e,t){return Zt(e)?Gt(e,ct(t,1,Zt,!0)):[]}));var Jt=he((function(e,t){var n=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}(t);return Zt(n)&&(n=void 0),Zt(e)?Gt(e,ct(t,1,Zt,!0),Ut(n)):[]}));var Kt=yt&&1/It(new yt([,-0]))[1]==1/0?function(e){return new yt(e)}:function(){};var Qt=he((function(e){return function(e,t,n){var r=-1,o=ue,i=e.length,a=!0,s=[],u=s;if(n)a=!1,o=qt;else if(i>=200){var d=t?null:Kt(e);if(d)return It(d);a=!1,o=Ct,u=new St}else u=t?[]:s;e:for(;++r<i;){var c=e[r],l=t?t(c):c;if(c=n||0!==c?c:0,a&&l==l){for(var f=u.length;f--;)if(u[f]===l)continue e;t&&u.push(l),s.push(c)}else o(u,l,n)||(u!==s&&u.push(l),s.push(c))}return s}(ct(e,1,Zt,!0))}));function Yt(e,t){return e.id===t||!!e.children&&e.children.some((function(e){return Yt(e,t)}))}function en(e){var t={};return function e(n,o){if(n&&n.id&&(t[n.id]=r(r({},n),o?{parent:o}:{}),n.children))for(var i=0,a=n.children.length;i<a;++i)e(n.children[i],n.id)}(e),t}function tn(e,t,n){var o=[];return function t(i){var a=n[i],s=(a.children||[]).map((function(e){return t(e.id)})).filter((function(e){return!e.toHide}));return 0!==s.length||e(a)?(o.push(i),r(r({},a),{},{children:s})):r(r({},a),{},{toHide:!0})}(t),o}var nn=function(){function e(){i(this,e),this.listeners={}}return s(e,[{key:"on",value:function(e,t){this.listeners[e]=[].concat(v(this.listeners[e]||[]),[t])}},{key:"off",value:function(e,t){var n=this.listeners[e];n&&(this.listeners[e]=n.filter((function(e){return e===t})))}},{key:"trigger",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=this.listeners[e];o&&o.forEach((function(e){return e.apply(null,n)}))}}]),e}(),rn=function(){function e(){i(this,e),this.counter=0,this.enteredDropzoneId=void 0}return s(e,[{key:"onDragEnter",value:function(e){this.counter++,this.enteredDropzoneId=e}},{key:"onDragLeave",value:function(e){e===this.enteredDropzoneId&&(this.counter--,0===this.counter&&(this.enteredDropzoneId=void 0))}},{key:"reset",value:function(){this.enteredDropzoneId=void 0,this.counter=0}}]),e}(),on=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(n,e);var t=h(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(this,n),e=t.call(this),Object.defineProperty(l(e),"_root",{value:r,configurable:!1,writable:!0}),Object.defineProperty(l(e),"nodesMap",{value:en(r),configurable:!1,writable:!0}),e._initExpanded(o.defaultExpanded),e.selected=Object.values(e.nodesMap).filter((function(e){return e.selected})).map((function(e){return e.id})),e.filtered=[],o.filter&&(e.filter=o.filter),e.autoSelectDescendants=o.autoSelectDescendants,e.autoDeselectDescendants=o.autoDeselectDescendants,e._updateVisibleTree(),e.draggedNodeId=void 0,e.dragCounter=new rn,e}return s(n,[{key:"_initExpanded",value:function(e){e?this.expandNode(e):this.root&&this.root.id?(this.expanded=[this.root.id],this.expandedWithoutFilter=this.expanded):(this.expanded=[],this.expandedWithoutFilter=[])}},{key:"_updateVisibleTree",value:function(){this.visibleTree=this._computeVisibleTree(this.root.id,{expanded:this.expandedMap})}},{key:"_detachNodeFromParent",value:function(e){var t=this._getNode(e.parent);e.parent=void 0,t&&(t.children=Jt(t.children||[],[e],(function(e){return e.id})))}},{key:"_attachNodeToParent",value:function(e,t,n){this._detachNodeFromParent(e);var o,i=this._getNode(t);i&&(e.parent=i.id,o=n,i.children=null==o?[].concat(v(i.children||[]),[r({},e)]):[].concat(v((i.children||[]).slice(0,n)),[r({},e)],v((i.children||[]).slice(n))))}},{key:"_computeVisibleTree",value:function(e,t){var n=this,o=t.expanded,i=this._getNode(e);if(!i)return{};var a=i.children||[];return r(r({},i),{},{children:o[i.id]?a.filter((function(e){return n.isNodeFiltered(e.id)})).map((function(e){return n._computeVisibleTree(e.id,{expanded:o})})):[],isLeaf:0===a.length})}},{key:"_getNode",value:function(e){return this.nodesMap[e]}},{key:"expanded",get:function(){return this._expanded},set:function(e){this._expanded=e,this.expandedMap=e.reduce((function(e,t){return e[t]=!0,e}),{}),this.focusedNodeId=e[e.length-1]}},{key:"expandNode",value:function(e,t){var n,r;this.expanded&&e===this.expanded[this.expanded.length-1]||(this.expanded=(n=e,r=this.nodesMap,function e(t){var n=r[t];return n?[].concat(v(e(n.parent)),[t]):[]}(n)),this.expandedWithoutFilter=this.expanded,this._updateVisibleTree(),this.trigger("expand",this.expanded,t))}},{key:"isNodeExpanded",value:function(e){return this.expandedMap[e]}},{key:"selectNode",value:function(e,t){var n=(t?this.autoSelectDescendants:this.autoDeselectDescendants)?tn((function(e){return!1!==e.selectable}),e,this.nodesMap):[e];this.selected=(t?Qt:Xt)(this.selected,n),this.trigger("select",this.selected)}},{key:"isNodeSelected",value:function(e){return this.selected.includes(e)}},{key:"isNodeFiltered",value:function(e){return!this._filter||this.filtered.includes(e)}},{key:"startDrag",value:function(e){Object.prototype.hasOwnProperty.call(this.nodesMap,e)&&(this.draggedNodeId=e)}},{key:"stopDrag",value:function(){this.draggedNodeId=void 0}},{key:"isParent",value:function(e,t){var n=this._getNode(e);return!!n&&Yt(n,t)}},{key:"dropOnNode",value:function(e,t){if(this.isDragging()&&!this.isNodeDragged(e)){var n=this._getNode(this.draggedNodeId);Yt(n,e)||(this._attachNodeToParent(n,e,t),this.expandNode(this.draggedNodeId,"drop"),this.draggedNodeId=void 0,this._updateVisibleTree(),this.trigger("move",{moved:n.id,to:e,index:t}))}}},{key:"isNodeDragged",value:function(e){return this.draggedNodeId===e}},{key:"isDragging",value:function(){return void 0!==this.draggedNodeId}},{key:"root",get:function(){return this._root},set:function(e){var t=this;void 0===e&&(e={}),this._root=e,this.nodesMap=en(e),this.expanded.length&&!this.expanded.some((function(e){return!t.nodesMap[e]}))||this._initExpanded(),this._applyFilter(),this._updateVisibleTree()}},{key:"filter",set:function(e){this._filter=e,this._applyFilter(),this._updateVisibleTree()}},{key:"_applyFilter",value:function(){var e=this;this._filter?(this.expandedWithoutFilter.some((function(t){var n=e._getNode(t);return e._filter(n)||n.children&&n.children.some(e._filter)}))?this.expanded=this.expandedWithoutFilter:this.expanded=[this.root.id],this.filtered=tn(this._filter,this.root.id,this.nodesMap)):this.filtered=[]}},{key:"onDragEnter",value:function(e){this.dragCounter.onDragEnter(e)}},{key:"onDragLeave",value:function(e){this.dragCounter.onDragLeave(e)}},{key:"dragReset",value:function(){this.dragCounter.reset()}},{key:"isDragOver",value:function(e){return this.dragCounter.enteredDropzoneId===e}}]),n}(nn);function an(e,t){Object.entries(t).forEach((function(t){var n=p(t,2),r=n[0],o=n[1];e.style[r]=o}))}function sn(e,t,n,r,o,i,a,s,u,d){"boolean"!=typeof a&&(u=s,s=a,a=!1);const c="function"==typeof n?n.options:n;let l;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,o&&(c.functional=!0)),r&&(c._scopeId=r),i?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,u(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=l):t&&(l=a?function(e){t.call(this,d(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,s(e))}),l)if(c.functional){const e=c.render;c.render=function(t,n){return l.call(n),e(t,n)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,l):[l]}return n}var un={name:"FinderItemArrow",props:{expanded:{type:Boolean,default:!1},theme:{type:Object,default:function(){}},item:{type:Object,default:function(){}}}},dn=function(e,t){return(0,t._c)("div",{staticClass:"arrow",style:Object.assign({},{expanded:t.props.expanded},t.props.theme.arrowColor&&{borderColor:t.props.theme.arrowColor})})};dn._withStripped=!0;var cn=sn({render:dn,staticRenderFns:[]},void 0,un,"data-v-8d4a66ea",!0,void 0,!1,void 0,void 0,void 0),ln={name:"FinderListDropZone",props:{treeModel:{type:Object,required:!0},node:{type:Object,required:!0},dragEnabled:{type:[Boolean,Function],default:!1},index:{type:Number,default:void 0},options:{type:Object,default:function(){return{}}}},computed:{dragOver:function(){return this.treeModel.isDragging()&&this.canDrop&&this.treeModel.isDragOver(this.dropzoneId)},theme:function(){return at(this,"options.theme",{})},canDrag:function(){return"function"==typeof this.dragEnabled?this.dragEnabled(this.node):this.dragEnabled},canDrop:function(){return!this.treeModel.isParent(this.treeModel.draggedNodeId,this.node.id)&&(!this.options.canDrop||this.options.canDrop(this.node.id,this.treeModel.draggedNodeId))},dropzoneId:function(){return"drop-zone-".concat(this.node.id).concat(this.index?"____i".concat(this.index):"")}},methods:{onDragEnter:function(){this.treeModel.onDragEnter(this.dropzoneId)},onDragLeave:function(){this.treeModel.onDragLeave(this.dropzoneId)},onDrop:function(e){e.preventDefault(),this.treeModel.dragReset(),this.canDrop&&this.treeModel.isDragging()&&this.treeModel.dropOnNode(this.node.id,this.index)}}},fn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"drop-zone",class:{"drag-over":e.dragOver,dragging:e.treeModel.isDragging(),"no-drop":e.treeModel.isDragging()&&!e.canDrop},style:Object.assign({},e.dragOver&&e.theme.primaryColor&&{borderColor:e.theme.primaryColor},e.dragOver&&e.theme.dropZoneBgColor&&{backgroundColor:e.theme.dropZoneBgColor}),on:{dragenter:function(t){return t.preventDefault(),e.onDragEnter(t)},dragleave:function(t){return t.preventDefault(),e.onDragLeave(t)},dragover:function(e){e.preventDefault()},drop:function(t){return t.preventDefault(),e.onDrop(t)}}},[e.options.dropZoneComponent?n(e.options.dropZoneComponent,{tag:"component",staticStyle:{"flex-grow":"1"},attrs:{dragging:e.treeModel.isDragging(),"drag-over":e.dragOver}}):e._e()],1)};fn._withStripped=!0;var hn=sn({render:fn,staticRenderFns:[]},void 0,ln,"data-v-642fb16c",!1,void 0,!1,void 0,void 0,void 0),pn={name:"FinderItem",mixins:[hn],props:{selectable:{type:Boolean,default:!1}},computed:{expanded:function(){return this.treeModel.isNodeExpanded(this.node.id)},selected:function(){return this.treeModel.isNodeSelected(this.node.id)},dragged:function(){return this.treeModel.isNodeDragged(this.node.id)},itemComponent:function(){return this.options.itemComponent||"div"},arrowComponent:function(){return this.options.arrowComponent||cn}},watch:{dragOver:function(e){var t=this;e&&this.canDrop&&!this.node.isLeaf?this.dragOverTimeout=setTimeout((function(){return t.treeModel.expandNode(t.node.id,"dragover")}),500):this.dragOverTimeout&&clearTimeout(this.dragOverTimeout)},node:function(){this.dragOverTimeout&&clearTimeout(this.dragOverTimeout)}},methods:{onMouseDown:function(){var e=this;this.mousedown=!0,setTimeout((function(){e.mousedown=!1}),100)},onClick:function(){this.treeModel.expandNode(this.node.id,"click")},onFocus:function(){this.mousedown||this.treeModel.expandNode(this.node.id,"focus")},onSelect:function(e){this.treeModel.selectNode(this.node.id,e.target.checked)},onDragStart:function(e){this.canDrag&&(this.options.dragImageComponent&&(this.appendGhost(),e.dataTransfer.setDragImage(this.ghost,0,0)),e.dataTransfer.setData("text/plain",this.node.id),this.treeModel.startDrag(this.node.id))},onDragOver:function(e){this.canDrag&&(e.preventDefault(),this.canDrop?e.dataTransfer.dropEffect="move":e.dataTransfer.dropEffect="none")},onDragEnd:function(){this.ghost&&(this.ghost.parentNode.removeChild(this.ghost),this.ghost=null),this.canDrag&&(this.options.hasDragHandle&&this.$el.setAttribute("draggable","false"),this.treeModel.stopDrag())},appendGhost:function(){var e=this;this.ghost=document.createElement("div");var n=document.createElement("div"),r=new t({render:function(t){return t(e.options.dragImageComponent,{props:{item:e.node}})}}).$mount(n);this.ghost.appendChild(r.$el),an(r.$el,{boxShadow:"0 3px 4px rgba(116, 116, 116, 0.3)"}),an(this.ghost,{position:"absolute",padding:"10px",top:"-1000px",boxSizing:"border-box",pointerEvents:"none"}),this.$el.ownerDocument.body.appendChild(this.ghost)}}},vn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"item",class:[e.node.cssClass||"",{expanded:e.expanded,draggable:e.canDrag&&!e.options.hasDragHandle,dragged:e.dragged,"has-drag-handle":e.canDrag&&e.options.hasDragHandle,"drag-over":e.dragOver,"no-drop":e.treeModel.isDragging()&&!e.canDrop}],style:Object.assign({},e.expanded&&e.theme.primaryColor&&{backgroundColor:e.theme.primaryColor},e.dragged&&e.theme.draggedItemBgColor&&{backgroundColor:e.theme.draggedItemBgColor},e.dragged&&e.theme.draggedItemBoxShadow&&{"box-shadow":e.theme.draggedItemBoxShadow},e.dragOver&&e.theme.primaryColor&&{borderColor:e.theme.primaryColor},e.dragOver&&e.theme.dropZoneBgColor&&{backgroundColor:e.theme.dropZoneBgColor}),attrs:{role:"button",draggable:e.canDrag&&!e.options.hasDragHandle,"aria-expanded":e.node.isLeaf?void 0:e.expanded},on:{mousedown:e.onMouseDown,click:e.onClick,dragenter:e.onDragEnter,dragleave:e.onDragLeave,dragstart:e.onDragStart,dragover:e.onDragOver,drop:e.onDrop,dragend:e.onDragEnd,focus:e.onFocus}},[e.canDrag&&e.options.hasDragHandle?n("div",{staticClass:"drag-handle",on:{mousedown:function(t){return e.$el.setAttribute("draggable","true")},mouseup:function(t){return e.$el.setAttribute("draggable","false")}}},[n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2m0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8m0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14m6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6m0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8m0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14"}})])]):e._e(),e._v(" "),e.selectable?n("input",{attrs:{type:"checkbox",disabled:!1===e.node.selectable,"aria-label":e.node.label},domProps:{checked:e.selected},on:{click:function(e){e.stopPropagation()},change:e.onSelect}}):e._e(),e._v(" "),n(e.itemComponent,{tag:"component",staticClass:"inner-item",attrs:{item:e.node,expanded:e.expanded,dragged:e.dragged}},[e._t("default")],2),e._v(" "),e.node.isLeaf?e._e():n(e.arrowComponent,{tag:"component",attrs:{theme:e.theme,expanded:e.expanded,item:e.node}})],1)};vn._withStripped=!0;var gn=sn({render:vn,staticRenderFns:[]},void 0,pn,"data-v-1050ea25",!1,void 0,!1,void 0,void 0,void 0);var bn=sn({},void 0,{name:"FinderList",components:{FinderItem:gn,FinderListDropZone:hn},inject:["virtualize","itemHeight"],props:{parent:{type:Object,default:function(){return{}}},items:{type:Array,default:function(){return[]}},treeModel:{type:Object,required:!0},selectable:{type:Boolean,default:!1},dragEnabled:{type:[Boolean,Function],default:!1},options:{type:Object,default:function(){return{}}},hasExpandedItem:{type:Boolean,default:!1}},data:function(){return{listWidth:null,visibleStart:null,visibleEnd:null}},computed:{sortedItems:function(){return this.options.sortBy?v(this.items).sort(this.options.sortBy):this.items},topOffset:function(){return this.visibleStart*this.itemHeight},bottomOffset:function(){return(this.items.length-this.visibleEnd)*this.itemHeight},style:function(){var e=at(this.options,"theme.separatorColor",""),t=at(this.options,"theme.separatorWidth","");return r(r(r({},e&&{borderColor:e}),t&&{borderWidth:t}),this.listWidth&&{width:"".concat(this.listWidth,"px")})},expandedItemIndex:function(){var e=this;return Math.max(0,this.sortedItems.findIndex((function(t){return e.treeModel.isNodeExpanded(t.id)})))}},watch:{parent:{immediate:!0,handler:function(e,t){e.id!==(null==t?void 0:t.id)&&this.$el&&(this.listWidth=null,this.$el.scrollTop=0,this.updateVisibleRange())}},"items.length":{handler:function(){this.updateVisibleRange()}}},mounted:function(){var e=this;this.updateVisibleRange(),new ResizeObserver((function(){e.updateVisibleRange()})).observe(this.$el),this.$el.addEventListener("keydown",this.navigate)},destroyed:function(){this.resizeObserver&&this.resizeObserver.disconnect()},methods:{navigate:function(e){var t;"ArrowDown"===e.key?t=function(e){for(var t=e.nextSibling;t;){if(t.classList&&t.classList.contains("item"))return t;t=t.nextSibling}}(e.target):"ArrowUp"===e.key&&(t=function(e){for(var t=e.previousSibling;t;){if(t.classList&&t.classList.contains("item"))return t;t=t.previousSibling}}(e.target)),t&&t.focus()},onScroll:function(){var e=this;this.virtualize&&!this.isUpdatingVisibleRange&&(window.requestAnimationFrame((function(){e.updateVisibleRange(),e.isUpdatingVisibleRange=!1})),this.isUpdatingVisibleRange=!0)},getOffset:function(){Math.floor(this.$el.scrollTop/this.itemHeight)},getVirtualRange:function(){var e=Math.max(0,Math.floor(this.$el.scrollTop/this.itemHeight)+1-5),t=Math.ceil(this.$el.clientHeight/this.itemHeight);return{start:e,end:Math.min(e+t+5,this.items.length)}},updateVisibleRange:function(){var e,t=this;return(e=regeneratorRuntime.mark((function e(){var n,r,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.virtualize){e.next=2;break}return e.abrupt("return");case 2:if(n=t.getVirtualRange(),r=n.start,o=n.end,r!==t.visibleStart||o!==t.visibleEnd){e.next=5;break}return e.abrupt("return");case 5:return t.visibleStart=r,t.visibleEnd=o,e.next=9,t.$nextTick();case 9:t.listWidth||(t.listWidth=t.$el.clientWidth),(i=t.$refs["item-".concat(t.treeModel.focusedNodeId)])&&i.$el&&i.$el!==document.activeElement&&i.$el.focus({preventScroll:!0});case 12:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)}))})()}},render:function(e){var t=this,n=Math.max(0,this.sortedItems.findIndex((function(e){return t.treeModel.isNodeExpanded(e.id)})));return[e("div",{class:"list",style:this.style,on:{scroll:this.onScroll}},[[].concat(v(this.virtualize?[e("div",{style:{flexShrink:0,height:"".concat(this.topOffset,"px")}})]:[]),v(this.sortedItems.map((function(r,o){return function(e){return!t.virtualize||e>=t.visibleStart&&e<=t.visibleEnd}(o)&&function(e,t){var n=t.props,r=t.item,o=t.index,i=t.expandedItemIndex;return[n.dragEnabled&&e(hn,{key:"drop-zone-".concat(r.id),attrs:{node:n.parent,treeModel:n.treeModel,dragEnabled:n.dragEnabled,index:o,options:n.options}})].concat([e(gn,{ref:"item-".concat(r.id),key:"item-".concat(r.id),attrs:{node:r,treeModel:n.treeModel,selectable:n.selectable,dragEnabled:n.dragEnabled,options:n.options,tabindex:o===i?"0":"-1"}},[r.label])])}(e,{props:t.$props,item:r,index:o,expandedItemIndex:n})}))),[this.dragEnabled&&e(hn,{class:"last",attrs:{treeModel:this.treeModel,node:this.parent,dragEnabled:this.dragEnabled,index:this.items.length,options:this.options}})],v(this.virtualize?[e("div",{style:{flexShrink:0,height:"".concat(this.bottomOffset,"px")}})]:[]))])]}},"data-v-d5dd7ce2",void 0,void 0,!1,void 0,void 0,void 0);function yn(e,t,n){if(!n||!n.children||0===n.children.length)return null;var r=n.children.find((function(e){return t.treeModel.isNodeExpanded(e.id)})),o={sortBy:t.sortBy,itemComponent:t.itemComponent,arrowComponent:t.arrowComponent,dragImageComponent:t.dragImageComponent,dropZoneComponent:t.dropZoneComponent,theme:t.theme,hasDragHandle:t.hasDragHandle,canDrop:t.canDrop},i=e(bn,{ref:"rootList",attrs:{"tree-model":t.treeModel,parent:n,items:n.children,selectable:t.selectable,"drag-enabled":t.dragEnabled,options:o,"has-expanded-item":!!r}});return e("div",{class:"list-container"},[i,r&&yn(e,t,r)])}var mn=sn({},void 0,{name:"Finder",components:{FinderList:bn},props:{tree:{type:Object,required:!0},selectable:{type:Boolean,default:!1},autoSelectDescendants:{type:Boolean,default:!1},autoDeselectDescendants:{type:Boolean,default:!1},dragEnabled:{type:[Boolean,Function],default:!1},hasDragHandle:{type:Boolean,default:!1},canDrop:{type:Function,default:void 0},filter:{type:Function,default:void 0},sortBy:{type:Function,default:void 0},defaultExpanded:{type:String,default:void 0},itemComponent:{type:[String,Object],default:void 0},arrowComponent:{type:[String,Object],default:void 0},dragImageComponent:{type:[String,Object],default:void 0},dropZoneComponent:{type:[String,Object],default:void 0},theme:{type:Object,default:function(){return{}}},scrollAnimationDuration:{type:Number,default:200},virtualize:{type:Boolean,default:!1},itemHeight:{type:Number,default:44}},provide:function(){return{virtualize:this.virtualize,itemHeight:this.itemHeight}},data:function(){return{treeModel:{}}},watch:{tree:function(e){this.treeModel.root=e},filter:function(e){this.treeModel.filter=e},autoSelectDescendants:function(e){this.treeModel.autoSelectDescendants=e},autoDeselectDescendants:function(e){this.treeModel.autoDeselectDescendants=e}},beforeCreate:function(){Object.defineProperty(this.$options.propsData,"tree",{configurable:!1})},created:function(){var e=this;this.treeModel=new on(this.tree,{filter:this.filter,defaultExpanded:this.defaultExpanded,autoSelectDescendants:this.autoSelectDescendants,autoDeselectDescendants:this.autoDeselectDescendants}),this.treeModel.on("expand",(function(t,n){"dragover"!==n&&e.$nextTick((function(){e._scrollToRight(e.scrollAnimationDuration)})),e.$emit("expand",{expanded:t,sourceEvent:n})})),this.treeModel.on("select",(function(t){e.$emit("select",{selected:t})})),this.treeModel.on("move",(function(t){var n=t.moved,r=t.to,o=t.index;e.$emit("move",{moved:n,to:r,index:o})}))},methods:{expand:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"api";this.treeModel.expandNode(e,t)},_scrollToRight:function(e){var t=this,n=this.$el,r=n.scrollLeft,o=n.scrollWidth,i=n.offsetWidth;if(0!==e){var a=o-i-r;if(!(a<=0)){var s=performance.now(),u=0;window.requestAnimationFrame((function n(o){(u+=o-s)>=e?t.$el.scrollLeft=t.$el.scrollWidth:(s=o,t.$el.scrollLeft=function(e,t,n,r){return-n*(e/=r)*(e-2)+t}(u,r,a,e),window.requestAnimationFrame(n))}))}}else this.$el.scrollLeft=o}},render:function(e){return e("div",{class:"tree-container"},[this.treeModel&&yn(e,this,this.treeModel.visibleTree)])}},"data-v-41c85beb",void 0,void 0,!1,void 0,void 0,void 0),_n={Finder:mn,install:function(e){e.component("Finder",mn)}},jn=Object.freeze({__proto__:null,default:_n,Finder:mn});"undefined"!=typeof window&&window.Vue&&window.Vue.use(_n),e.default=jn,Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "@jledentu/vue-finder",
"description": "A Vue.js component to display hierarchical data",
"version": "2.1.2",
"version": "2.2.0",
"license": "MIT",

@@ -70,3 +70,4 @@ "main": "dist/vue-finder.common.js",

"@vue/babel-preset-jsx": "^1.1.2",
"@vue/test-utils": "^1.0.0-beta.30",
"@vue/test-utils": "^1.3.5",
"@vue/vue2-jest": "^29.2.4",
"@vuepress/plugin-register-components": "^1.3.1",

@@ -76,3 +77,3 @@ "babel-core": "^7.0.0-bridge.0",

"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "^25.1.0",
"babel-jest": "^29.5.0",
"babel-loader": "^8.0.6",

@@ -95,8 +96,9 @@ "babel-plugin-dynamic-import-node": "^2.2.0",

"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jest": "^23.7.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-vue": "^6.2.1",
"husky": "^4.2.3",
"jest": "^25.1.0",
"jest-serializer-html": "^7.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest-serializer-html": "^7.1.0",
"jest-serializer-vue": "^2.0.2",

@@ -123,3 +125,2 @@ "jest-vue-preprocessor": "^1.7.1",

"vue-docgen-cli": "^4.9.0",
"vue-jest": "^3.0.5",
"vue-loader": "^15.9.0",

@@ -126,0 +127,0 @@ "vue-template-compiler": "^2.6.11",

@@ -134,4 +134,5 @@ import { mount } from "@vue/test-utils";

.at(0)
.trigger("focus");
.element.dispatchEvent(new FocusEvent("focus"));
await wrapper.vm.$nextTick();
expect(wrapper.emitted().expand).toEqual([

@@ -264,7 +265,6 @@ [{ expanded: ["test1", "test11"], sourceEvent: "focus" }]

wrapper
await wrapper
.findAll(".item > input[type=checkbox]")
.at(1)
.trigger("click");
await wrapper.vm.$nextTick();
.setChecked(true);

@@ -297,7 +297,6 @@ expect(wrapper.emitted().select).toEqual([

wrapper
await wrapper
.findAll(".item > input[type=checkbox]")
.at(2)
.trigger("click");
await wrapper.vm.$nextTick();
.setChecked(true);

@@ -334,7 +333,6 @@ expect(wrapper.emitted().select).toEqual([

wrapper
await wrapper
.findAll(".item > input[type=checkbox]")
.at(3)
.trigger("click");
await wrapper.vm.$nextTick();
.setChecked(false);

@@ -365,3 +363,3 @@ expect(wrapper.emitted().select).toEqual([[{ selected: ["test11"] }]]);

wrapper
await wrapper
.findAll(".item")

@@ -377,3 +375,3 @@ .at(0)

wrapper
await wrapper
.findAll(".item")

@@ -380,0 +378,0 @@ .at(1)

@@ -5,3 +5,2 @@ import { mount } from "@vue/test-utils";

jest.mock("@/utils/tree-model");
jest.useFakeTimers();

@@ -50,4 +49,8 @@

describe("Expand", () => {
beforeEach(() => {
jest.spyOn(treeModel, "expandNode");
});
it("should match snapshot if expanded", () => {
treeModel.isNodeExpanded.mockReturnValue(true);
treeModel.expandNode("test111");
const wrapper = mount(FinderItem, {

@@ -62,3 +65,3 @@ propsData: {

it("should call treeModel.expandNode on focus", () => {
it("should call treeModel.expandNode on focus", async () => {
const wrapper = mount(FinderItem, {

@@ -68,10 +71,12 @@ propsData: {

node
}
},
attachTo: document.body
});
wrapper.trigger("focus");
wrapper.find(".item").element.dispatchEvent(new FocusEvent("focus"));
expect(treeModel.expandNode).toHaveBeenCalledWith("test111", "focus");
});
it("should call treeModel.expandNode on click", () => {
it("should call treeModel.expandNode on click", async () => {
const wrapper = mount(FinderItem, {

@@ -84,7 +89,7 @@ propsData: {

wrapper.trigger("click");
await wrapper.trigger("click");
expect(treeModel.expandNode).toHaveBeenCalledWith("test111", "click");
});
it("should not call treeModel.expandNode on mousedown", () => {
it("should not call treeModel.expandNode on mousedown", async () => {
const wrapper = mount(FinderItem, {

@@ -97,4 +102,5 @@ propsData: {

wrapper.trigger("mousedown");
wrapper.trigger("focus");
await wrapper.trigger("mousedown");
wrapper.element.focus();
expect(treeModel.expandNode).not.toHaveBeenCalled();

@@ -105,2 +111,6 @@ });

describe("Selection", () => {
beforeEach(() => {
jest.spyOn(treeModel, "selectNode");
});
it("should match snapshot if selectable", () => {

@@ -117,3 +127,3 @@ const wrapper = mount(FinderItem, {

it("should call treeModel.selectNode on click on checkbox", () => {
it("should call treeModel.selectNode on click on checkbox", async () => {
const wrapper = mount(FinderItem, {

@@ -127,8 +137,8 @@ propsData: {

wrapper.find('input[type="checkbox"]').trigger("click");
await wrapper.find('input[type="checkbox"]').setChecked(true);
expect(treeModel.selectNode).toHaveBeenCalledWith("test111", true);
});
it("should call treeModel.selectNode on click on checked checkbox", () => {
treeModel.isNodeSelected.mockReturnValue(true);
it("should call treeModel.selectNode on click on checked checkbox", async () => {
treeModel.selectNode("test111", true);
const wrapper = mount(FinderItem, {

@@ -142,3 +152,3 @@ propsData: {

wrapper.find('input[type="checkbox"]').trigger("click");
await wrapper.find('input[type="checkbox"]').setChecked(false);
expect(treeModel.selectNode).toHaveBeenCalledWith("test111", false);

@@ -183,3 +193,7 @@ });

describe("dragstart", () => {
it("should call treeModel.startDrag", () => {
beforeEach(() => {
jest.spyOn(treeModel, "startDrag");
});
it("should call treeModel.startDrag", async () => {
const dataTransfer = {

@@ -197,3 +211,3 @@ setDragImage: jest.fn(),

wrapper.trigger("dragstart", {
await wrapper.trigger("dragstart", {
dataTransfer

@@ -210,3 +224,3 @@ });

it("should call treeModel.startDrag if `dragEnabled` is a function returning `true`", () => {
it("should call treeModel.startDrag if `dragEnabled` is a function returning `true`", async () => {
const dataTransfer = {

@@ -224,3 +238,3 @@ setDragImage: jest.fn(),

wrapper.trigger("dragstart", {
await wrapper.trigger("dragstart", {
dataTransfer

@@ -237,3 +251,3 @@ });

it("should not call treeModel.startDrag if `dragEnabled` is false", () => {
it("should not call treeModel.startDrag if `dragEnabled` is false", async () => {
const wrapper = mount(FinderItem, {

@@ -247,7 +261,7 @@ propsData: {

wrapper.trigger("dragstart");
await wrapper.trigger("dragstart");
expect(treeModel.startDrag).not.toHaveBeenCalled();
});
it("should not call treeModel.startDrag if `dragEnabled` is a function returning `false`", () => {
it("should not call treeModel.startDrag if `dragEnabled` is a function returning `false`", async () => {
const wrapper = mount(FinderItem, {

@@ -261,7 +275,7 @@ propsData: {

wrapper.trigger("dragstart");
await wrapper.trigger("dragstart");
expect(treeModel.startDrag).not.toHaveBeenCalled();
});
it("should initialize drag image element if `dragImageComponent` is defined", () => {
it("should initialize drag image element if `dragImageComponent` is defined", async () => {
const dataTransfer = {

@@ -286,3 +300,3 @@ setDragImage: jest.fn(),

wrapper.trigger("dragstart", {
await wrapper.trigger("dragstart", {
dataTransfer

@@ -301,3 +315,4 @@ });

beforeEach(() => {
treeModel.isDragging.mockReturnValue(true);
treeModel.startDrag("test12");
jest.spyOn(treeModel, "expandNode");
});

@@ -314,3 +329,3 @@

wrapper.trigger("dragenter");
await wrapper.trigger("dragenter");
await wrapper.vm.$nextTick();

@@ -337,3 +352,3 @@ jest.runAllTimers();

wrapper.trigger("dragenter");
await wrapper.trigger("dragenter");
await wrapper.vm.$nextTick();

@@ -357,5 +372,3 @@ jest.runAllTimers();

wrapper.trigger("dragenter");
await wrapper.vm.$nextTick();
jest.runAllTimers();
await wrapper.trigger("dragenter");

@@ -374,7 +387,4 @@ expect(treeModel.expandNode).not.toHaveBeenCalled();

wrapper.trigger("dragenter");
await wrapper.vm.$nextTick();
wrapper.trigger("dragleave");
await wrapper.vm.$nextTick();
jest.runAllTimers();
await wrapper.trigger("dragenter");
await wrapper.trigger("dragleave");

@@ -393,3 +403,3 @@ expect(treeModel.expandNode).not.toHaveBeenCalled();

wrapper.trigger("dragenter");
await wrapper.trigger("dragenter");
wrapper.setProps({

@@ -400,4 +410,2 @@ node: {

});
await wrapper.vm.$nextTick();
jest.runAllTimers();

@@ -409,3 +417,3 @@ expect(treeModel.expandNode).not.toHaveBeenCalled();

describe("dragover", () => {
it("should set dataTransfer.dropEffect = `all` if can drop", () => {
it("should set dataTransfer.dropEffect = `all` if can drop", async () => {
const dataTransfer = {};

@@ -423,3 +431,3 @@ const wrapper = mount(FinderItem, {

wrapper.trigger("dragover", {
await wrapper.trigger("dragover", {
dataTransfer

@@ -431,3 +439,3 @@ });

it("should set dataTransfer.dropEffect = `none` if can not drop", () => {
it("should set dataTransfer.dropEffect = `none` if can not drop", async () => {
const dataTransfer = {};

@@ -445,3 +453,3 @@ const wrapper = mount(FinderItem, {

wrapper.trigger("dragover", {
await wrapper.trigger("dragover", {
dataTransfer

@@ -453,3 +461,3 @@ });

it("should do nothing if drag not enabled", () => {
it("should do nothing if drag not enabled", async () => {
const dataTransfer = {};

@@ -464,3 +472,3 @@ const wrapper = mount(FinderItem, {

wrapper.trigger("dragover", {
await wrapper.trigger("dragover", {
dataTransfer

@@ -474,3 +482,7 @@ });

describe("dragend", () => {
it("should call treeModel.stopDrag", () => {
beforeEach(() => {
jest.spyOn(treeModel, "stopDrag");
});
it("should call treeModel.stopDrag", async () => {
const wrapper = mount(FinderItem, {

@@ -484,7 +496,7 @@ propsData: {

wrapper.trigger("dragend");
await wrapper.trigger("dragend");
expect(treeModel.stopDrag).toHaveBeenCalled();
});
it("should not call treeModel.stopDrag if `dragEnabled` is false", () => {
it("should not call treeModel.stopDrag if `dragEnabled` is false", async () => {
const wrapper = mount(FinderItem, {

@@ -498,7 +510,7 @@ propsData: {

wrapper.trigger("dragend");
await wrapper.trigger("dragend");
expect(treeModel.stopDrag).not.toHaveBeenCalled();
});
it("should set `draggable = false` if `options.hasDragHandle` is true", () => {
it("should set `draggable = false` if `options.hasDragHandle` is true", async () => {
const wrapper = mount(FinderItem, {

@@ -515,10 +527,10 @@ propsData: {

wrapper.find(".drag-handle").trigger("mousedown");
await wrapper.find(".drag-handle").trigger("mousedown");
expect(wrapper.vm.$el.getAttribute("draggable")).toBe("true");
wrapper.trigger("dragend");
await wrapper.trigger("dragend");
expect(wrapper.vm.$el.getAttribute("draggable")).toBe("false");
});
it("should remove ghost element if `dragImageComponent` is defined", () => {
it("should remove ghost element if `dragImageComponent` is defined", async () => {
const dataTransfer = {

@@ -543,3 +555,3 @@ setDragImage: jest.fn(),

wrapper.trigger("dragstart", {
await wrapper.trigger("dragstart", {
dataTransfer

@@ -550,3 +562,3 @@ });

wrapper.trigger("dragend", {
await wrapper.trigger("dragend", {
dataTransfer

@@ -553,0 +565,0 @@ });

@@ -9,2 +9,3 @@ import { mount } from "@vue/test-utils";

let treeModel;
let provide;
const tree = {

@@ -38,2 +39,6 @@ id: "test1",

treeModel = new TreeModel(tree);
provide = {
virtualize: false,
itemHeight: 45
};
});

@@ -46,3 +51,4 @@

items: tree.children
}
},
provide
});

@@ -56,3 +62,4 @@ expect(wrapper).toMatchSnapshot();

treeModel
}
},
provide
});

@@ -68,3 +75,4 @@ expect(wrapper).toMatchSnapshot();

dragEnabled: true
}
},
provide
});

@@ -80,3 +88,4 @@ expect(wrapper).toMatchSnapshot();

selectable: true
}
},
provide
});

@@ -92,3 +101,4 @@ expect(wrapper).toMatchSnapshot();

},
attachToDocument: true
attachTo: document.body,
provide
});

@@ -122,3 +132,4 @@

},
attachToDocument: true
attachTo: document.body,
provide
});

@@ -144,2 +155,19 @@

});
it("should handle virtualize option", async () => {
provide.virtualize = true;
const wrapper = mount(FinderList, {
propsData: {
treeModel,
items: tree.children,
dragEnabled: true
},
attachTo: document.body,
provide
});
expect(wrapper).toMatchSnapshot();
expect(wrapper.vm.visibleStart).toBe(0);
expect(wrapper.vm.visibleEnd).toBe(2);
});
});

@@ -5,4 +5,2 @@ import { mount } from "@vue/test-utils";

jest.mock("@/utils/tree-model");
describe("FinderListDropZone", () => {

@@ -49,3 +47,3 @@ let treeModel;

it("should match if drag enter and is dragging", async () => {
treeModel.isDragging.mockReturnValue(true);
treeModel.startDrag("test12");
const wrapper = mount(FinderListDropZone, {

@@ -58,3 +56,11 @@ propsData: {

});
wrapper.trigger("dragenter");
expect(treeModel.dragCounter.counter).toBe(1);
expect(treeModel.dragCounter.enteredDropzoneId).toBe("drop-zone-test111");
expect(wrapper.vm.dropzoneId).toBe("drop-zone-test111");
expect(treeModel.isDragging()).toBe(true);
expect(wrapper.vm.canDrop).toBe(true);
expect(wrapper.vm.dragOver).toBe(true);
await wrapper.vm.$nextTick();

@@ -66,3 +72,3 @@

it("should match if drag leave and is dragging", async () => {
treeModel.isDragging.mockReturnValue(true);
treeModel.startDrag("test12");
const wrapper = mount(FinderListDropZone, {

@@ -75,2 +81,3 @@ propsData: {

});
wrapper.trigger("dragenter");

@@ -84,3 +91,2 @@ wrapper.trigger("dragleave");

it("should match if drag enter and not dragging", async () => {
treeModel.isDragging.mockReturnValue(false);
const wrapper = mount(FinderListDropZone, {

@@ -99,3 +105,2 @@ propsData: {

it("should match if drag leave and not dragging", async () => {
treeModel.isDragging.mockReturnValue(false);
const wrapper = mount(FinderListDropZone, {

@@ -115,4 +120,7 @@ propsData: {

describe("#onDrop", () => {
beforeEach(() => {
jest.spyOn(treeModel, "dropOnNode");
});
it("should call `treeModel.dropOnNode`", () => {
treeModel.isDragging.mockReturnValue(true);
treeModel.startDrag("test12");
const wrapper = mount(FinderListDropZone, {

@@ -130,3 +138,4 @@ propsData: {

it("should call `treeModel.dropOnNode` with index", () => {
treeModel.isDragging.mockReturnValue(true);
treeModel.startDrag("test12");
const wrapper = mount(FinderListDropZone, {

@@ -144,4 +153,3 @@ propsData: {

it("should not call `treeModel.dropOnNode` if not dragging", () => {
treeModel.isDragging.mockReturnValue(false);
it("should not call `treeModel.dropOnNode` if not dragging", async () => {
const wrapper = mount(FinderListDropZone, {

@@ -154,3 +162,3 @@ propsData: {

});
wrapper.trigger("drop");
await wrapper.trigger("drop");
expect(treeModel.dropOnNode).not.toHaveBeenCalled();

@@ -157,0 +165,0 @@ });

@@ -9,2 +9,3 @@ import { isNil, union, difference, differenceBy } from "lodash-es";

import EventManager from "./event-manager";
import DragCounter from "./drag-counter";

@@ -41,2 +42,3 @@ export default class extends EventManager {

this.draggedNodeId = undefined;
this.dragCounter = new DragCounter();
}

@@ -58,3 +60,3 @@

this.visibleTree = this._computeVisibleTree(this.root.id, {
expanded: this.expanded
expanded: this.expandedMap
});

@@ -102,3 +104,3 @@ }

...node,
children: expanded.includes(node.id)
children: expanded[node.id]
? children

@@ -120,2 +122,16 @@ .filter(child => this.isNodeFiltered(child.id))

get expanded() {
return this._expanded;
}
set expanded(newExpanded) {
this._expanded = newExpanded;
this.expandedMap = newExpanded.reduce((map, node) => {
map[node] = true;
return map;
}, {});
this.focusedNodeId = newExpanded[newExpanded.length - 1];
}
/**

@@ -138,3 +154,3 @@ * Expand a node.

isNodeExpanded(nodeId) {
return this.expanded.includes(nodeId);
return this.expandedMap[nodeId];
}

@@ -273,2 +289,18 @@

}
onDragEnter(dropzoneId) {
this.dragCounter.onDragEnter(dropzoneId);
}
onDragLeave(dropzoneId) {
this.dragCounter.onDragLeave(dropzoneId);
}
dragReset() {
this.dragCounter.reset();
}
isDragOver(dropzoneId) {
return this.dragCounter.enteredDropzoneId === dropzoneId;
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc