@stacksjs/collections 0.64.5 → 0.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var as=Object.create;var{getPrototypeOf:hs,defineProperty:ct,getOwnPropertyNames:ps}=Object;var ys=Object.prototype.hasOwnProperty;var ls=(e,t,r)=>{r=e!=null?as(hs(e)):{};const n=t||!e||!e.__esModule?ct(r,"default",{value:e,enumerable:!0}):r;for(let i of ps(e))if(!ys.call(n,i))ct(n,i,{get:()=>e[i],enumerable:!0});return n};var c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var at=c((Rf,ot)=>{ot.exports=function e(){var t=this,r=-1;return{next:function n(){return r+=1,{value:t.items[r],done:r>=t.items.length}}}}});var pt=c((Bf,ht)=>{ht.exports=function e(){return this.items}});var p=c((Qf,yt)=>{function T(e){return T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(e)}yt.exports={isArray:function e(t){return Array.isArray(t)},isObject:function e(t){return T(t)==="object"&&Array.isArray(t)===!1&&t!==null},isFunction:function e(t){return typeof t==="function"}}});var F=c((Xf,lt)=>{var vs=p(),ms=vs.isFunction;lt.exports=function e(t){if(t===void 0)return this.sum()/this.items.length;if(ms(t))return new this.constructor(this.items).sum(t)/this.items.length;return new this.constructor(this.items).pluck(t).sum()/this.items.length}});var mt=c((Yf,vt)=>{var bs=F();vt.exports=bs});var At=c((Zf,bt)=>{function M(e){return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(e)}bt.exports=function e(t){var r=this,n=[],i=0;if(Array.isArray(this.items))do{var s=this.items.slice(i,i+t),u=new this.constructor(s);n.push(u),i+=t}while(i<this.items.length);else if(M(this.items)==="object"){var a=Object.keys(this.items),f=function h(){var g=a.slice(i,i+t),v=new r.constructor({});g.forEach(function(y){return v.put(y,r.items[y])}),n.push(v),i+=t};do f();while(i<a.length)}else n.push(new this.constructor([this.items]));return new this.constructor(n)}});var gt=c((Gf,wt)=>{function As(e){return xs(e)||Os(e)||gs(e)||ws()}function ws(){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 gs(e,t){if(!e)return;if(typeof e==="string")return D(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return D(e,t)}function Os(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xs(e){if(Array.isArray(e))return D(e)}function D(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}wt.exports=function e(){var t;return new this.constructor((t=[]).concat.apply(t,As(this.items)))}});var dt=c((zf,xt)=>{function ds(e,t){return Es(e)||js(e,t)||_s(e,t)||Ss()}function Ss(){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 _s(e,t){if(!e)return;if(typeof e==="string")return Ot(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ot(e,t)}function Ot(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function js(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[],i=!0,s=!1,u,a;try{for(r=r.call(e);!(i=(u=r.next()).done);i=!0)if(n.push(u.value),t&&n.length===t)break}catch(f){s=!0,a=f}finally{try{if(!i&&r.return!=null)r.return()}finally{if(s)throw a}}return n}function Es(e){if(Array.isArray(e))return e}function _(e){return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(e)}xt.exports=function e(t){var r=this,n=t;if(n instanceof this.constructor)n=t.all();var i={};if(Array.isArray(this.items)&&Array.isArray(n))this.items.forEach(function(a,f){i[a]=n[f]});else if(_(this.items)==="object"&&_(n)==="object")Object.keys(this.items).forEach(function(a,f){i[r.items[a]]=n[Object.keys(n)[f]]});else if(Array.isArray(this.items))i[this.items[0]]=n;else if(typeof this.items==="string"&&Array.isArray(n)){var s=n,u=ds(s,1);i[this.items]=u[0]}else if(typeof this.items==="string")i[this.items]=n;return new this.constructor(i)}});var $=c((Lf,St)=>{function qs(e){return Fs(e)||Ts(e)||Ps(e)||Is()}function Is(){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 Ps(e,t){if(!e)return;if(typeof e==="string")return V(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return V(e,t)}function Ts(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Fs(e){if(Array.isArray(e))return V(e)}function V(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}St.exports=function e(t){var r;if(Array.isArray(t)){var n;r=[],(n=r).push.apply(n,qs(t))}else r={},Object.keys(t).forEach(function(i){r[i]=t[i]});return r}});var jt=c((Cf,_t)=>{function j(e){return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(e)}var Ms=$();_t.exports=function e(t){var r=t;if(t instanceof this.constructor)r=t.all();else if(j(t)==="object")r=[],Object.keys(t).forEach(function(i){r.push(t[i])});var n=Ms(this.items);return r.forEach(function(i){if(j(i)==="object")Object.keys(i).forEach(function(s){return n.push(i[s])});else n.push(i)}),new this.constructor(n)}});var b=c((kf,qt)=>{function Et(e){return Ns(e)||$s(e)||Vs(e)||Ds()}function Ds(){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 Vs(e,t){if(!e)return;if(typeof e==="string")return N(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return N(e,t)}function $s(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ns(e){if(Array.isArray(e))return N(e)}function N(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}qt.exports=function e(t){var r=[];if(Array.isArray(t))r.push.apply(r,Et(t));else if(t.constructor.name==="Collection")r.push.apply(r,Et(t.all()));else Object.keys(t).forEach(function(n){return r.push(t[n])});return r}});var H=c((tc,It)=>{function Us(e){return Js(e)||Ws(e)||Ks(e)||Hs()}function Hs(){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 Ks(e,t){if(!e)return;if(typeof e==="string")return U(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return U(e,t)}function Ws(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Js(e){if(Array.isArray(e))return U(e)}function U(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Rs=b(),Bs=p(),Qs=Bs.isFunction;It.exports=function e(t,r){if(r!==void 0){if(Array.isArray(this.items))return this.items.filter(function(i){return i[t]!==void 0&&i[t]===r}).length>0;return this.items[t]!==void 0&&this.items[t]===r}if(Qs(t))return this.items.filter(function(i,s){return t(i,s)}).length>0;if(Array.isArray(this.items))return this.items.indexOf(t)!==-1;var n=Rs(this.items);return n.push.apply(n,Us(Object.keys(this.items))),n.indexOf(t)!==-1}});var Tt=c((rc,Pt)=>{Pt.exports=function e(){return this.count()===1}});var Mt=c((ec,Ft)=>{Ft.exports=function e(){var t=0;if(Array.isArray(this.items))t=this.items.length;return Math.max(Object.keys(this.items).length,t)}});var Vt=c((nc,Dt)=>{Dt.exports=function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(r){return r};return new this.constructor(this.items).groupBy(t).map(function(r){return r.count()})}});var Nt=c((ic,$t)=>{$t.exports=function e(){function t(s,u,a){var f=a[0];if(f instanceof u)f=f.all();var h=a.slice(1),g=!h.length,v=[];for(var y=0;y<f.length;y+=1){var m=s.slice();if(m.push(f[y]),g)v.push(m);else v=v.concat(t(m,u,h))}return v}for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return new this.constructor(t([],this.constructor,[].concat([this.items],n)))}});var Ht=c((sc,Ut)=>{Ut.exports=function e(){if(this.dump(),typeof process!=="undefined")process.exit(1)}});var Wt=c((uc,Kt)=>{Kt.exports=function e(t){var r;if(t instanceof this.constructor)r=t.all();else r=t;var n=this.items.filter(function(i){return r.indexOf(i)===-1});return new this.constructor(n)}});var Rt=c((fc,Jt)=>{Jt.exports=function e(t){var r=this,n=t;if(t instanceof this.constructor)n=t.all();var i={};return Object.keys(this.items).forEach(function(s){if(n[s]===void 0||n[s]!==r.items[s])i[s]=r.items[s]}),new this.constructor(i)}});var Qt=c((cc,Bt)=>{Bt.exports=function e(t){var r;if(t instanceof this.constructor)r=t.all();else r=t;var n=Object.keys(r),i=Object.keys(this.items).filter(function(s){return n.indexOf(s)===-1});return new this.constructor(this.items).only(i)}});var Yt=c((oc,Xt)=>{Xt.exports=function e(t,r){var n=this.items.filter(function(i){return!(t&&t.some(function(s){return r(i,s)===0}))});return new this.constructor(n)}});var Gt=c((ac,Zt)=>{Zt.exports=function e(t,r){return!this.contains(t,r)}});var Lt=c((hc,zt)=>{zt.exports=function e(){return console.log(this),this}});var kt=c((pc,Ct)=>{function E(e){return E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(e)}Ct.exports=function e(){var t=this,r=[],n={},i=function s(u){if(Array.isArray(u)||E(u)==="object")return JSON.stringify(u);return u};if(Array.isArray(this.items))this.items.forEach(function(s,u){var a=i(s);if(r.indexOf(a)===-1)r.push(a);else n[u]=s});else if(E(this.items)==="object")Object.keys(this.items).forEach(function(s){var u=i(t.items[s]);if(r.indexOf(u)===-1)r.push(u);else n[s]=t.items[s]});return new this.constructor(n)}});var rr=c((yc,tr)=>{tr.exports=function e(t){var r=!1;if(Array.isArray(this.items)){var n=this.items.length;for(var i=0;i<n&&!r;i+=1)r=t(this.items[i],i,this.items)===!1}else{var s=Object.keys(this.items),u=s.length;for(var a=0;a<u&&!r;a+=1){var f=s[a];r=t(this.items[f],f,this.items)===!1}}return this}});var nr=c((lc,er)=>{function Xs(e){return zs(e)||Gs(e)||Zs(e)||Ys()}function Ys(){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 Zs(e,t){if(!e)return;if(typeof e==="string")return K(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K(e,t)}function Gs(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zs(e){if(Array.isArray(e))return K(e)}function K(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}er.exports=function e(t){return this.each(function(r,n){t.apply(void 0,Xs(r).concat([n]))}),this}});var sr=c((vc,ir)=>{var Ls=b();ir.exports=function e(t){var r=Ls(this.items);return r.every(t)}});var d=c((mc,ur)=>{ur.exports=function e(t){if(Array.isArray(t[0]))return t[0];return t}});var cr=c((bc,fr)=>{var Cs=d();fr.exports=function e(){var t=this;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=Cs(n);if(Array.isArray(this.items)){var u=this.items.filter(function(f){return s.indexOf(f)===-1});return new this.constructor(u)}var a={};return Object.keys(this.items).forEach(function(f){if(s.indexOf(f)===-1)a[f]=t.items[f]}),new this.constructor(a)}});var hr=c((Ac,ar)=>{function W(e){return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(e)}function or(e){if(Array.isArray(e)){if(e.length)return!1}else if(e!==void 0&&e!==null&&W(e)==="object"){if(Object.keys(e).length)return!1}else if(e)return!1;return!0}function ks(e,t){var r={};return Object.keys(t).forEach(function(n){if(e){if(e(t[n],n))r[n]=t[n]}else if(!or(t[n]))r[n]=t[n]}),r}function tu(e,t){if(e)return t.filter(e);var r=[];for(var n=0;n<t.length;n+=1){var i=t[n];if(!or(i))r.push(i)}return r}ar.exports=function e(t){var r=t||!1,n=null;if(Array.isArray(this.items))n=tu(r,this.items);else n=ks(r,this.items);return new this.constructor(n)}});var yr=c((wc,pr)=>{var ru=p(),J=ru.isFunction;pr.exports=function e(t,r){if(J(t)){var n=Object.keys(this.items);for(var i=0;i<n.length;i+=1){var s=n[i],u=this.items[s];if(t(u,s))return u}if(J(r))return r();return r}if(Array.isArray(this.items)&&this.items.length||Object.keys(this.items).length){if(Array.isArray(this.items))return this.items[0];var a=Object.keys(this.items)[0];return this.items[a]}if(J(r))return r();return r}});var vr=c((gc,lr)=>{var eu=p(),nu=eu.isFunction;lr.exports=function e(t,r,n){if(nu(t))return this.first(t,function(){throw new Error("Item not found.")});var i=this.where(t,r,n);if(i.isEmpty())throw new Error("Item not found.");return i.first()}});var br=c((Oc,mr)=>{mr.exports=function e(t,r,n){return this.where(t,r,n).first()||null}});var wr=c((xc,Ar)=>{Ar.exports=function e(t){return this.map(t).collapse()}});var xr=c((dc,Or)=>{var gr=p(),R=gr.isArray,B=gr.isObject;Or.exports=function e(t){var r=t||1/0,n=!1,i=[],s=function u(a){if(i=[],R(a))a.forEach(function(f){if(R(f))i=i.concat(f);else if(B(f))Object.keys(f).forEach(function(h){i=i.concat(f[h])});else i.push(f)});else Object.keys(a).forEach(function(f){if(R(a[f]))i=i.concat(a[f]);else if(B(a[f]))Object.keys(a[f]).forEach(function(h){i=i.concat(a[f][h])});else i.push(a[f])});n=i.filter(function(f){return B(f)}),n=n.length===0,r-=1};s(this.items);while(!n&&r>0)s(i);return new this.constructor(i)}});var Sr=c((Sc,dr)=>{dr.exports=function e(){var t=this,r={};if(Array.isArray(this.items))Object.keys(this.items).forEach(function(n){r[t.items[n]]=Number(n)});else Object.keys(this.items).forEach(function(n){r[t.items[n]]=n});return new this.constructor(r)}});var jr=c((_c,_r)=>{_r.exports=function e(t,r){var n=this,i={};if(Array.isArray(this.items))i=this.items.slice(t*r-r,t*r);else Object.keys(this.items).slice(t*r-r,t*r).forEach(function(s){i[s]=n.items[s]});return new this.constructor(i)}});var qr=c((jc,Er)=>{Er.exports=function e(t){if(Array.isArray(this.items))this.items.splice(t,1);else delete this.items[t];return this}});var Pr=c((Ec,Ir)=>{var iu=p(),su=iu.isFunction;Ir.exports=function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.items[t]!==void 0)return this.items[t];if(su(r))return r();if(r!==null)return r;return null}});var A=c((qc,Tr)=>{Tr.exports=function e(t,r){try{return r.split(".").reduce(function(n,i){return n[i]},t)}catch(n){return t}}});var Mr=c((Ic,Fr)=>{var Q=A(),uu=p(),fu=uu.isFunction;Fr.exports=function e(t){var r=this,n={};return this.items.forEach(function(i,s){var u;if(fu(t))u=t(i,s);else if(Q(i,t)||Q(i,t)===0)u=Q(i,t);else u="";if(n[u]===void 0)n[u]=new r.constructor([]);n[u].push(i)}),new this.constructor(n)}});var Vr=c((Pc,Dr)=>{var cu=d();Dr.exports=function e(){var t=this;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=cu(n);return s.filter(function(u){return Object.hasOwnProperty.call(t.items,u)}).length===s.length}});var Nr=c((Tc,$r)=>{$r.exports=function e(t,r){if(r===void 0)return this.items.join(t);return new this.constructor(this.items).pluck(t).all().join(r)}});var Hr=c((Fc,Ur)=>{Ur.exports=function e(t){var r=t;if(t instanceof this.constructor)r=t.all();var n=this.items.filter(function(i){return r.indexOf(i)!==-1});return new this.constructor(n)}});var Wr=c((Mc,Kr)=>{Kr.exports=function e(t){var r=this,n=Object.keys(t);if(t instanceof this.constructor)n=Object.keys(t.all());var i={};return Object.keys(this.items).forEach(function(s){if(n.indexOf(s)!==-1)i[s]=r.items[s]}),new this.constructor(i)}});var Rr=c((Dc,Jr)=>{Jr.exports=function e(){if(Array.isArray(this.items))return!this.items.length;return!Object.keys(this.items).length}});var Qr=c((Vc,Br)=>{Br.exports=function e(){return!this.isEmpty()}});var Yr=c(($c,Xr)=>{Xr.exports=function e(t,r){var n=this.values();if(r===void 0)return n.implode(t);var i=n.count();if(i===0)return"";if(i===1)return n.last();var s=n.pop();return n.implode(t)+r+s}});var Gr=c((Nc,Zr)=>{var ou=A(),au=p(),hu=au.isFunction;Zr.exports=function e(t){var r={};if(hu(t))this.items.forEach(function(n){r[t(n)]=n});else this.items.forEach(function(n){var i=ou(n,t);r[i||""]=n});return new this.constructor(r)}});var Lr=c((Uc,zr)=>{zr.exports=function e(){var t=Object.keys(this.items);if(Array.isArray(this.items))t=t.map(Number);return new this.constructor(t)}});var te=c((Hc,kr)=>{var pu=p(),Cr=pu.isFunction;kr.exports=function e(t,r){var n=this.items;if(Cr(t))n=this.filter(t).all();if(Array.isArray(n)&&!n.length||!Object.keys(n).length){if(Cr(r))return r();return r}if(Array.isArray(n))return n[n.length-1];var i=Object.keys(n);return n[i[i.length-1]]}});var ee=c((Kc,re)=>{re.exports=function e(t,r){this.constructor.prototype[t]=r}});var ie=c((Wc,ne)=>{ne.exports=function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return new this.constructor(t)}});var ue=c((Jc,se)=>{se.exports=function e(t){var r=this;if(Array.isArray(this.items))return new this.constructor(this.items.map(t));var n={};return Object.keys(this.items).forEach(function(i){n[i]=t(r.items[i],i)}),new this.constructor(n)}});var ce=c((Rc,fe)=>{function yu(e){return bu(e)||mu(e)||vu(e)||lu()}function lu(){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 vu(e,t){if(!e)return;if(typeof e==="string")return X(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(e,t)}function mu(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bu(e){if(Array.isArray(e))return X(e)}function X(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}fe.exports=function e(t){return this.map(function(r,n){return t.apply(void 0,yu(r).concat([n]))})}});var he=c((Bc,ae)=>{function Au(e,t){return xu(e)||Ou(e,t)||gu(e,t)||wu()}function wu(){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 gu(e,t){if(!e)return;if(typeof e==="string")return oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oe(e,t)}function oe(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ou(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[],i=!0,s=!1,u,a;try{for(r=r.call(e);!(i=(u=r.next()).done);i=!0)if(n.push(u.value),t&&n.length===t)break}catch(f){s=!0,a=f}finally{try{if(!i&&r.return!=null)r.return()}finally{if(s)throw a}}return n}function xu(e){if(Array.isArray(e))return e}ae.exports=function e(t){var r={};return this.items.forEach(function(n,i){var s=t(n,i),u=Au(s,2),a=u[0],f=u[1];if(r[a]===void 0)r[a]=[f];else r[a].push(f)}),new this.constructor(r)}});var ye=c((Qc,pe)=>{pe.exports=function e(t){return this.map(function(r,n){return new t(r,n)})}});var me=c((Xc,ve)=>{function du(e,t){return Eu(e)||ju(e,t)||_u(e,t)||Su()}function Su(){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 _u(e,t){if(!e)return;if(typeof e==="string")return le(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return le(e,t)}function le(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ju(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[],i=!0,s=!1,u,a;try{for(r=r.call(e);!(i=(u=r.next()).done);i=!0)if(n.push(u.value),t&&n.length===t)break}catch(f){s=!0,a=f}finally{try{if(!i&&r.return!=null)r.return()}finally{if(s)throw a}}return n}function Eu(e){if(Array.isArray(e))return e}ve.exports=function e(t){var r={};return this.items.forEach(function(n,i){var s=t(n,i),u=du(s,2),a=u[0],f=u[1];if(r[a]===void 0)r[a]=[f];else r[a].push(f)}),new this.constructor(r)}});var ge=c((Yc,we)=>{function be(e,t){return Tu(e)||Pu(e,t)||Iu(e,t)||qu()}function qu(){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 Iu(e,t){if(!e)return;if(typeof e==="string")return Ae(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ae(e,t)}function Ae(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pu(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[],i=!0,s=!1,u,a;try{for(r=r.call(e);!(i=(u=r.next()).done);i=!0)if(n.push(u.value),t&&n.length===t)break}catch(f){s=!0,a=f}finally{try{if(!i&&r.return!=null)r.return()}finally{if(s)throw a}}return n}function Tu(e){if(Array.isArray(e))return e}we.exports=function e(t){var r=this,n={};if(Array.isArray(this.items))this.items.forEach(function(i,s){var u=t(i,s),a=be(u,2),f=a[0],h=a[1];n[f]=h});else Object.keys(this.items).forEach(function(i){var s=t(r.items[i],i),u=be(s,2),a=u[0],f=u[1];n[a]=f});return new this.constructor(n)}});var de=c((Zc,xe)=>{function Oe(e){return Vu(e)||Du(e)||Mu(e)||Fu()}function Fu(){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 Mu(e,t){if(!e)return;if(typeof e==="string")return Y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Y(e,t)}function Du(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Vu(e){if(Array.isArray(e))return Y(e)}function Y(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}xe.exports=function e(t){if(typeof t==="string"){var r=this.items.filter(function(n){return n[t]!==void 0});return Math.max.apply(Math,Oe(r.map(function(n){return n[t]})))}return Math.max.apply(Math,Oe(this.items))}});var _e=c((Gc,Se)=>{Se.exports=function e(t){var r=this.items.length;if(t===void 0){if(r%2===0)return(this.items[r/2-1]+this.items[r/2])/2;return this.items[Math.floor(r/2)]}if(r%2===0)return(this.items[r/2-1][t]+this.items[r/2][t])/2;return this.items[Math.floor(r/2)][t]}});var Ee=c((zc,je)=>{je.exports=function e(t){var r=t;if(typeof r==="string")r=[r];if(Array.isArray(this.items)&&Array.isArray(r))return new this.constructor(this.items.concat(r));var n=JSON.parse(JSON.stringify(this.items));return Object.keys(r).forEach(function(i){n[i]=r[i]}),new this.constructor(n)}});var Te=c((Lc,Pe)=>{function q(e){return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(e)}function qe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qe(Object(r),!0).forEach(function(n){$u(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $u(e,t,r){if(t in e)Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0});else e[t]=r;return e}Pe.exports=function e(t){var r=function n(i,s){var u={},a=Object.keys(Ie(Ie({},i),s));return a.forEach(function(f){if(i[f]===void 0&&s[f]!==void 0)u[f]=s[f];else if(i[f]!==void 0&&s[f]===void 0)u[f]=i[f];else if(i[f]!==void 0&&s[f]!==void 0)if(i[f]===s[f])u[f]=i[f];else if(!Array.isArray(i[f])&&q(i[f])==="object"&&!Array.isArray(s[f])&&q(s[f])==="object")u[f]=n(i[f],s[f]);else u[f]=[].concat(i[f],s[f])}),u};if(!t)return this;if(t.constructor.name==="Collection")return new this.constructor(r(this.items,t.all()));return new this.constructor(r(this.items,t))}});var De=c((Cc,Me)=>{function Fe(e){return Ku(e)||Hu(e)||Uu(e)||Nu()}function Nu(){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 Uu(e,t){if(!e)return;if(typeof e==="string")return Z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Z(e,t)}function Hu(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ku(e){if(Array.isArray(e))return Z(e)}function Z(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}Me.exports=function e(t){if(t!==void 0){var r=this.items.filter(function(n){return n[t]!==void 0});return Math.min.apply(Math,Fe(r.map(function(n){return n[t]})))}return Math.min.apply(Math,Fe(this.items))}});var $e=c((kc,Ve)=>{Ve.exports=function e(t){var r=[],n=1;if(!this.items.length)return null;return this.items.forEach(function(i){var s=r.filter(function(a){if(t!==void 0)return a.key===i[t];return a.key===i});if(!s.length)if(t!==void 0)r.push({key:i[t],count:1});else r.push({key:i,count:1});else{s[0].count+=1;var u=s[0].count;if(u>n)n=u}}),r.filter(function(i){return i.count===n}).map(function(i){return i.key})}});var Ue=c((to,Ne)=>{var Wu=b();Ne.exports=function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=Wu(this.items),i=n.slice(r).filter(function(s,u){return u%t===0});return new this.constructor(i)}});var Ke=c((ro,He)=>{var Ju=d();He.exports=function e(){var t=this;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=Ju(n);if(Array.isArray(this.items)){var u=this.items.filter(function(f){return s.indexOf(f)!==-1});return new this.constructor(u)}var a={};return Object.keys(this.items).forEach(function(f){if(s.indexOf(f)!==-1)a[f]=t.items[f]}),new this.constructor(a)}});var Je=c((eo,We)=>{var Ru=$();We.exports=function e(t,r){var n=Math.abs(t),i=this.count();if(n<=i)return this;var s=n-i,u=Ru(this.items),a=Array.isArray(this.items),f=t<0;for(var h=0;h<s;){if(!a)if(u[h]!==void 0)s+=1;else u[h]=r;else if(f)u.unshift(r);else u.push(r);h+=1}return new this.constructor(u)}});var Be=c((no,Re)=>{Re.exports=function e(t){var r=this,n;if(Array.isArray(this.items))n=[new this.constructor([]),new this.constructor([])],this.items.forEach(function(i){if(t(i)===!0)n[0].push(i);else n[1].push(i)});else n=[new this.constructor({}),new this.constructor({})],Object.keys(this.items).forEach(function(i){var s=r.items[i];if(t(s)===!0)n[0].put(i,s);else n[1].put(i,s)});return new this.constructor(n)}});var Xe=c((io,Qe)=>{Qe.exports=function e(t){return t(this)}});var Ge=c((so,Ze)=>{var Ye=p(),Bu=Ye.isArray,Qu=Ye.isObject,I=A(),Xu=function e(t){var r={};return t.forEach(function(n,i){function s(u,a){if(Qu(u))Object.keys(u).forEach(function(f){s(u[f],"".concat(a,".").concat(f))});else if(Bu(u))u.forEach(function(f,h){s(f,"".concat(a,".").concat(h))});r[a]=u}s(n,i)}),r};Ze.exports=function e(t,r){if(t.indexOf("*")!==-1){var n=Xu(this.items),i=[];if(r!==void 0){var s=new RegExp("0.".concat(r),"g"),u="0.".concat(r).split(".").length;Object.keys(n).forEach(function(y){var m=y.match(s);if(m){var x=m[0];if(x.split(".").length===u)i.push(n[x])}})}var a=[],f=new RegExp("0.".concat(t),"g"),h="0.".concat(t).split(".").length;if(Object.keys(n).forEach(function(y){var m=y.match(f);if(m){var x=m[0];if(x.split(".").length===h)a.push(n[x])}}),r!==void 0){var g={};return this.items.forEach(function(y,m){g[i[m]||""]=a}),new this.constructor(g)}return new this.constructor([a])}if(r!==void 0){var v={};return this.items.forEach(function(y){if(I(y,t)!==void 0)v[y[r]||""]=I(y,t);else v[y[r]||""]=null}),new this.constructor(v)}return this.map(function(y){if(I(y,t)!==void 0)return I(y,t);return null})}});var G=c((uo,ze)=>{var Yu=d();ze.exports=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];Yu(n).forEach(function(s){delete t[s]})}});var tn=c((fo,ke)=>{var Ce=p(),Zu=Ce.isArray,Gu=Ce.isObject,Le=G();ke.exports=function e(){var t=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(Zu(this.items)){if(r===1)return this.items.pop();return new this.constructor(this.items.splice(-r))}if(Gu(this.items)){var n=Object.keys(this.items);if(r===1){var i=n[n.length-1],s=this.items[i];return Le(this.items,i),s}var u=n.slice(-r),a=u.reduce(function(f,h){return f[h]=t.items[h],f},{});return Le(this.items,u),new this.constructor(a)}return null}});var en=c((co,rn)=>{rn.exports=function e(t,r){if(r!==void 0)return this.put(r,t);return this.items.unshift(t),this}});var sn=c((oo,nn)=>{var zu=p(),Lu=zu.isFunction;nn.exports=function e(t,r){var n=this.items[t]||null;if(!n&&r!==void 0)if(Lu(r))n=r();else n=r;return delete this.items[t],n}});var fn=c((ao,un)=>{un.exports=function e(){var t;return(t=this.items).push.apply(t,arguments),this}});var on=c((ho,cn)=>{cn.exports=function e(t,r){return this.items[t]=r,this}});var hn=c((po,an)=>{var Cu=b();an.exports=function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=Cu(this.items),n=new this.constructor(r).shuffle();if(t!==parseInt(t,10))return n.first();return n.take(t)}});var yn=c((yo,pn)=>{pn.exports=function e(t,r){var n=this,i=null;if(r!==void 0)i=r;if(Array.isArray(this.items))this.items.forEach(function(s){i=t(i,s)});else Object.keys(this.items).forEach(function(s){i=t(i,n.items[s],s)});return i}});var vn=c((lo,ln)=>{ln.exports=function e(t){return new this.constructor(this.items).filter(function(r){return!t(r)})}});var An=c((vo,bn)=>{function mn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function P(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mn(Object(r),!0).forEach(function(n){ku(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ku(e,t,r){if(t in e)Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0});else e[t]=r;return e}bn.exports=function e(t){if(!t)return this;if(Array.isArray(t)){var r=this.items.map(function(s,u){return t[u]||s});return new this.constructor(r)}if(t.constructor.name==="Collection"){var n=P(P({},this.items),t.all());return new this.constructor(n)}var i=P(P({},this.items),t);return new this.constructor(i)}});var On=c((mo,gn)=>{function w(e){return w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(e)}function wn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wn(Object(r),!0).forEach(function(n){tf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tf(e,t,r){if(t in e)Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0});else e[t]=r;return e}gn.exports=function e(t){var r=function n(i,s){var u=O({},i),a=Object.keys(O(O({},i),s));return a.forEach(function(f){if(!Array.isArray(s[f])&&w(s[f])==="object")u[f]=n(i[f],s[f]);else if(i[f]===void 0&&s[f]!==void 0)if(w(i[f])==="object")u[f]=O({},s[f]);else u[f]=s[f];else if(i[f]!==void 0&&s[f]===void 0)if(w(i[f])==="object")u[f]=O({},i[f]);else u[f]=i[f];else if(i[f]!==void 0&&s[f]!==void 0)if(w(s[f])==="object")u[f]=O({},s[f]);else u[f]=s[f]}),u};if(!t)return this;if(!Array.isArray(t)&&w(t)!=="object")return new this.constructor(r(this.items,[t]));if(t.constructor.name==="Collection")return new this.constructor(r(this.items,t.all()));return new this.constructor(r(this.items,t))}});var dn=c((bo,xn)=>{xn.exports=function e(){var t=[].concat(this.items).reverse();return new this.constructor(t)}});var _n=c((Ao,Sn)=>{var z=p(),rf=z.isArray,ef=z.isObject,nf=z.isFunction;Sn.exports=function e(t,r){var n=this,i,s=function u(a,f){if(nf(t))return t(n.items[f],f);if(r)return n.items[f]===t;return n.items[f]==t};if(rf(this.items))i=this.items.findIndex(s);else if(ef(this.items))i=Object.keys(this.items).find(function(u){return s(n.items[u],u)});if(i===void 0||i<0)return!1;return i}});var qn=c((wo,En)=>{var jn=p(),sf=jn.isArray,uf=jn.isObject,ff=G();En.exports=function e(){var t=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(sf(this.items)){if(r===1)return this.items.shift();return new this.constructor(this.items.splice(0,r))}if(uf(this.items)){if(r===1){var n=Object.keys(this.items)[0],i=this.items[n];return delete this.items[n],i}var s=Object.keys(this.items),u=s.slice(0,r),a=u.reduce(function(f,h){return f[h]=t.items[h],f},{});return ff(this.items,u),new this.constructor(a)}return null}});var Pn=c((go,In)=>{var cf=b();In.exports=function e(){var t=cf(this.items),r,n,i;for(i=t.length;i;i-=1)r=Math.floor(Math.random()*i),n=t[i-1],t[i-1]=t[r],t[r]=n;return this.items=t,this}});var Fn=c((Oo,Tn)=>{var of=p(),af=of.isObject;Tn.exports=function e(t){var r=this;if(af(this.items))return new this.constructor(Object.keys(this.items).reduce(function(n,i,s){if(s+1>t)n[i]=r.items[i];return n},{}));return new this.constructor(this.items.slice(t))}});var Dn=c((xo,Mn)=>{var L=p(),hf=L.isArray,pf=L.isObject,yf=L.isFunction;Mn.exports=function e(t){var r=this,n=null,i,s=function u(a){return a===t};if(yf(t))s=t;if(hf(this.items))i=this.items.filter(function(u){if(n!==!0)n=s(u);return n});if(pf(this.items))i=Object.keys(this.items).reduce(function(u,a){if(n!==!0)n=s(r.items[a]);if(n!==!1)u[a]=r.items[a];return u},{});return new this.constructor(i)}});var $n=c((So,Vn)=>{var C=p(),lf=C.isArray,vf=C.isObject,mf=C.isFunction;Vn.exports=function e(t){var r=this,n=null,i,s=function u(a){return a===t};if(mf(t))s=t;if(lf(this.items))i=this.items.filter(function(u){if(n!==!0)n=!s(u);return n});if(vf(this.items))i=Object.keys(this.items).reduce(function(u,a){if(n!==!0)n=!s(r.items[a]);if(n!==!1)u[a]=r.items[a];return u},{});return new this.constructor(i)}});var Un=c((_o,Nn)=>{Nn.exports=function e(t,r){var n=this.items.slice(t);if(r!==void 0)n=n.slice(0,r);return new this.constructor(n)}});var Kn=c((jo,Hn)=>{var bf=p(),Af=bf.isFunction;Hn.exports=function e(t,r,n){var i;if(Af(t))i=this.filter(t);else i=this.where(t,r,n);if(i.isEmpty())throw new Error("Item not found.");if(i.count()>1)throw new Error("Multiple items found.");return i.first()}});var Jn=c((Eo,Wn)=>{var wf=H();Wn.exports=wf});var Bn=c((qo,Rn)=>{Rn.exports=function e(t){var r=[].concat(this.items);if(t===void 0)if(this.every(function(n){return typeof n==="number"}))r.sort(function(n,i){return n-i});else r.sort();else r.sort(t);return new this.constructor(r)}});var Xn=c((Io,Qn)=>{Qn.exports=function e(){return this.sort().reverse()}});var Zn=c((Po,Yn)=>{var gf=A(),Of=p(),xf=Of.isFunction;Yn.exports=function e(t){var r=[].concat(this.items),n=function i(s){if(xf(t))return t(s);return gf(s,t)};return r.sort(function(i,s){var u=n(i),a=n(s);if(u===null||u===void 0)return 1;if(a===null||a===void 0)return-1;if(u<a)return-1;if(u>a)return 1;return 0}),new this.constructor(r)}});var zn=c((To,Gn)=>{Gn.exports=function e(t){return this.sortBy(t).reverse()}});var Cn=c((Fo,Ln)=>{Ln.exports=function e(){var t=this,r={};return Object.keys(this.items).sort().forEach(function(n){r[n]=t.items[n]}),new this.constructor(r)}});var ti=c((Mo,kn)=>{kn.exports=function e(){var t=this,r={};return Object.keys(this.items).sort().reverse().forEach(function(n){r[n]=t.items[n]}),new this.constructor(r)}});var ei=c((Do,ri)=>{ri.exports=function e(t,r,n){var i=this.slice(t,r);if(this.items=this.diff(i.all()).all(),Array.isArray(n))for(var s=0,u=n.length;s<u;s+=1)this.items.splice(t+s,0,n[s]);return i}});var ii=c((Vo,ni)=>{ni.exports=function e(t){var r=Math.round(this.items.length/t),n=JSON.parse(JSON.stringify(this.items)),i=[];for(var s=0;s<t;s+=1)i.push(new this.constructor(n.splice(0,r)));return new this.constructor(i)}});var ui=c(($o,si)=>{var df=b(),Sf=p(),_f=Sf.isFunction;si.exports=function e(t){var r=df(this.items),n=0;if(t===void 0)for(var i=0,s=r.length;i<s;i+=1)n+=parseFloat(r[i]);else if(_f(t))for(var u=0,a=r.length;u<a;u+=1)n+=parseFloat(t(r[u]));else for(var f=0,h=r.length;f<h;f+=1)n+=parseFloat(r[f][t]);return parseFloat(n.toPrecision(12))}});var ci=c((No,fi)=>{function k(e){return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(e)}fi.exports=function e(t){var r=this;if(!Array.isArray(this.items)&&k(this.items)==="object"){var n=Object.keys(this.items),i;if(t<0)i=n.slice(t);else i=n.slice(0,t);var s={};return n.forEach(function(u){if(i.indexOf(u)!==-1)s[u]=r.items[u]}),new this.constructor(s)}if(t<0)return new this.constructor(this.items.slice(t));return new this.constructor(this.items.slice(0,t))}});var ai=c((Uo,oi)=>{var tt=p(),jf=tt.isArray,Ef=tt.isObject,qf=tt.isFunction;oi.exports=function e(t){var r=this,n=null,i,s=function u(a){return a===t};if(qf(t))s=t;if(jf(this.items))i=this.items.filter(function(u){if(n!==!1)n=!s(u);return n});if(Ef(this.items))i=Object.keys(this.items).reduce(function(u,a){if(n!==!1)n=!s(r.items[a]);if(n!==!1)u[a]=r.items[a];return u},{});return new this.constructor(i)}});var pi=c((Ho,hi)=>{var rt=p(),If=rt.isArray,Pf=rt.isObject,Tf=rt.isFunction;hi.exports=function e(t){var r=this,n=null,i,s=function u(a){return a===t};if(Tf(t))s=t;if(If(this.items))i=this.items.filter(function(u){if(n!==!1)n=s(u);return n});if(Pf(this.items))i=Object.keys(this.items).reduce(function(u,a){if(n!==!1)n=s(r.items[a]);if(n!==!1)u[a]=r.items[a];return u},{});return new this.constructor(i)}});var li=c((Ko,yi)=>{yi.exports=function e(t){return t(this),this}});var mi=c((Wo,vi)=>{vi.exports=function e(t,r){for(var n=1;n<=t;n+=1)this.items.push(r(n));return this}});var Ai=c((Jo,bi)=>{bi.exports=function e(){var t=this.constructor;function r(i,s){var u=[];if(i instanceof t)i.items.forEach(function(a){return r(a,u)}),s.push(u);else if(Array.isArray(i))i.forEach(function(a){return r(a,u)}),s.push(u);else s.push(i)}if(Array.isArray(this.items)){var n=[];return this.items.forEach(function(i){r(i,n)}),n}return this.values().all()}});var gi=c((Ro,wi)=>{function et(e){return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(e)}wi.exports=function e(){if(et(this.items)==="object"&&!Array.isArray(this.items))return JSON.stringify(this.all());return JSON.stringify(this.toArray())}});var xi=c((Bo,Oi)=>{Oi.exports=function e(t){var r=this;if(Array.isArray(this.items))this.items=this.items.map(t);else{var n={};Object.keys(this.items).forEach(function(i){n[i]=t(r.items[i],i)}),this.items=n}return this}});var ji=c((Qo,_i)=>{function di(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Si(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?di(Object(r),!0).forEach(function(n){Ff(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):di(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ff(e,t,r){if(t in e)Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0});else e[t]=r;return e}_i.exports=function e(){var t=this;if(Array.isArray(this.items))return this;var r={};return Object.keys(this.items).forEach(function(n){if(n.indexOf(".")!==-1){var i=r;n.split(".").reduce(function(s,u,a,f){if(!s[u])s[u]={};if(a===f.length-1)s[u]=t.items[n];return s[u]},i),r=Si(Si({},r),i)}else r[n]=t.items[n]}),new this.constructor(r)}});var qi=c((Xo,Ei)=>{Ei.exports=function e(t,r,n){if(!t)r(this);else n(this)}});var nt=c((Yo,Ii)=>{Ii.exports=function e(t,r){if(Array.isArray(this.items)&&this.items.length)return t(this);if(Object.keys(this.items).length)return t(this);if(r!==void 0){if(Array.isArray(this.items)&&!this.items.length)return r(this);if(!Object.keys(this.items).length)return r(this)}return this}});var it=c((Zo,Pi)=>{Pi.exports=function e(t,r){if(Array.isArray(this.items)&&!this.items.length)return t(this);if(!Object.keys(this.items).length)return t(this);if(r!==void 0){if(Array.isArray(this.items)&&this.items.length)return r(this);if(Object.keys(this.items).length)return r(this)}return this}});var Fi=c((Go,Ti)=>{Ti.exports=function e(t){var r=this,n=JSON.parse(JSON.stringify(this.items));return Object.keys(t).forEach(function(i){if(r.items[i]===void 0)n[i]=t[i]}),new this.constructor(n)}});var Di=c((zo,Mi)=>{var Mf=p(),Df=Mf.isFunction;Mi.exports=function e(t){var r;if(t===void 0)r=this.items.filter(function(a,f,h){return h.indexOf(a)===f});else{r=[];var n=[];for(var i=0,s=this.items.length;i<s;i+=1){var u=void 0;if(Df(t))u=t(this.items[i]);else u=this.items[i][t];if(n.indexOf(u)===-1)r.push(this.items[i]),n.push(u)}}return new this.constructor(r)}});var $i=c((Lo,Vi)=>{Vi.exports=function e(t){if(t instanceof this.constructor)return t.all();return t}});var Ui=c((Co,Ni)=>{var Vf=b();Ni.exports=function e(){return new this.constructor(Vf(this.items))}});var Ki=c((ko,Hi)=>{Hi.exports=function e(t,r,n){if(t)return r(this,t);if(n)return n(this,t);return this}});var Ji=c((ta,Wi)=>{var $f=b(),l=A();Wi.exports=function e(t,r,n){var i=r,s=n,u=$f(this.items);if(r===void 0||r===!0)return new this.constructor(u.filter(function(f){return l(f,t)}));if(r===!1)return new this.constructor(u.filter(function(f){return!l(f,t)}));if(n===void 0)s=r,i="===";var a=u.filter(function(f){switch(i){case"==":return l(f,t)===Number(s)||l(f,t)===s.toString();default:case"===":return l(f,t)===s;case"!=":case"<>":return l(f,t)!==Number(s)&&l(f,t)!==s.toString();case"!==":return l(f,t)!==s;case"<":return l(f,t)<s;case"<=":return l(f,t)<=s;case">":return l(f,t)>s;case">=":return l(f,t)>=s}});return new this.constructor(a)}});var Bi=c((ra,Ri)=>{Ri.exports=function e(t,r){return this.where(t,">=",r[0]).where(t,"<=",r[r.length-1])}});var Xi=c((ea,Qi)=>{var Nf=b(),Uf=A();Qi.exports=function e(t,r){var n=Nf(r),i=this.items.filter(function(s){return n.indexOf(Uf(s,t))!==-1});return new this.constructor(i)}});var Zi=c((na,Yi)=>{Yi.exports=function e(t){return this.filter(function(r){return r instanceof t})}});var Li=c((ia,zi)=>{var Gi=A();zi.exports=function e(t,r){return this.filter(function(n){return Gi(n,t)<r[0]||Gi(n,t)>r[r.length-1]})}});var ki=c((sa,Ci)=>{var Hf=b(),Kf=A();Ci.exports=function e(t,r){var n=Hf(r),i=this.items.filter(function(s){return n.indexOf(Kf(s,t))===-1});return new this.constructor(i)}});var rs=c((ua,ts)=>{ts.exports=function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(t,"===",null)}});var ns=c((fa,es)=>{es.exports=function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(t,"!==",null)}});var ss=c((ca,is)=>{function st(e){return st=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(e)}is.exports=function e(t){if(t instanceof this.constructor)return t;if(st(t)==="object")return new this.constructor(t);return new this.constructor([t])}});var fs=c((oa,us)=>{us.exports=function e(t){var r=this,n=t;if(n instanceof this.constructor)n=n.all();var i=this.items.map(function(s,u){return new r.constructor([s,n[u]])});return new this.constructor(i)}});var cs=c((aa,S)=>{function ut(e){return ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(e)}function o(e){if(e!==void 0&&!Array.isArray(e)&&ut(e)!=="object")this.items=[e];else if(e instanceof this.constructor)this.items=e.all();else this.items=e||[]}var Wf=at();if(typeof Symbol!=="undefined")o.prototype[Symbol.iterator]=Wf;o.prototype.toJSON=function e(){return this.items};o.prototype.all=pt();o.prototype.average=F();o.prototype.avg=mt();o.prototype.chunk=At();o.prototype.collapse=gt();o.prototype.combine=dt();o.prototype.concat=jt();o.prototype.contains=H();o.prototype.containsOneItem=Tt();o.prototype.count=Mt();o.prototype.countBy=Vt();o.prototype.crossJoin=Nt();o.prototype.dd=Ht();o.prototype.diff=Wt();o.prototype.diffAssoc=Rt();o.prototype.diffKeys=Qt();o.prototype.diffUsing=Yt();o.prototype.doesntContain=Gt();o.prototype.dump=Lt();o.prototype.duplicates=kt();o.prototype.each=rr();o.prototype.eachSpread=nr();o.prototype.every=sr();o.prototype.except=cr();o.prototype.filter=hr();o.prototype.first=yr();o.prototype.firstOrFail=vr();o.prototype.firstWhere=br();o.prototype.flatMap=wr();o.prototype.flatten=xr();o.prototype.flip=Sr();o.prototype.forPage=jr();o.prototype.forget=qr();o.prototype.get=Pr();o.prototype.groupBy=Mr();o.prototype.has=Vr();o.prototype.implode=Nr();o.prototype.intersect=Hr();o.prototype.intersectByKeys=Wr();o.prototype.isEmpty=Rr();o.prototype.isNotEmpty=Qr();o.prototype.join=Yr();o.prototype.keyBy=Gr();o.prototype.keys=Lr();o.prototype.last=te();o.prototype.macro=ee();o.prototype.make=ie();o.prototype.map=ue();o.prototype.mapSpread=ce();o.prototype.mapToDictionary=he();o.prototype.mapInto=ye();o.prototype.mapToGroups=me();o.prototype.mapWithKeys=ge();o.prototype.max=de();o.prototype.median=_e();o.prototype.merge=Ee();o.prototype.mergeRecursive=Te();o.prototype.min=De();o.prototype.mode=$e();o.prototype.nth=Ue();o.prototype.only=Ke();o.prototype.pad=Je();o.prototype.partition=Be();o.prototype.pipe=Xe();o.prototype.pluck=Ge();o.prototype.pop=tn();o.prototype.prepend=en();o.prototype.pull=sn();o.prototype.push=fn();o.prototype.put=on();o.prototype.random=hn();o.prototype.reduce=yn();o.prototype.reject=vn();o.prototype.replace=An();o.prototype.replaceRecursive=On();o.prototype.reverse=dn();o.prototype.search=_n();o.prototype.shift=qn();o.prototype.shuffle=Pn();o.prototype.skip=Fn();o.prototype.skipUntil=Dn();o.prototype.skipWhile=$n();o.prototype.slice=Un();o.prototype.sole=Kn();o.prototype.some=Jn();o.prototype.sort=Bn();o.prototype.sortDesc=Xn();o.prototype.sortBy=Zn();o.prototype.sortByDesc=zn();o.prototype.sortKeys=Cn();o.prototype.sortKeysDesc=ti();o.prototype.splice=ei();o.prototype.split=ii();o.prototype.sum=ui();o.prototype.take=ci();o.prototype.takeUntil=ai();o.prototype.takeWhile=pi();o.prototype.tap=li();o.prototype.times=mi();o.prototype.toArray=Ai();o.prototype.toJson=gi();o.prototype.transform=xi();o.prototype.undot=ji();o.prototype.unless=qi();o.prototype.unlessEmpty=nt();o.prototype.unlessNotEmpty=it();o.prototype.union=Fi();o.prototype.unique=Di();o.prototype.unwrap=$i();o.prototype.values=Ui();o.prototype.when=Ki();o.prototype.whenEmpty=it();o.prototype.whenNotEmpty=nt();o.prototype.where=Ji();o.prototype.whereBetween=Bi();o.prototype.whereIn=Xi();o.prototype.whereInstanceOf=Zi();o.prototype.whereNotBetween=Li();o.prototype.whereNotIn=ki();o.prototype.whereNull=rs();o.prototype.whereNotNull=ns();o.prototype.wrap=ss();o.prototype.zip=fs();var ft=function e(t){return new o(t)};S.exports=ft;S.exports.collect=ft;S.exports.default=ft;S.exports.Collection=o});var os=ls(cs(),1);var export_collect=os.collect;var export_Collection=os.Collection;export{export_collect as collect,export_Collection as Collection};
1
+ var{create:g,defineProperty:A,getOwnPropertyDescriptor:f,getOwnPropertyNames:p,getPrototypeOf:d}=Object,v=Object.prototype.hasOwnProperty,m=(T,w)=>()=>(w||T((w={exports:{}}).exports,w),w.exports),r=(T,w)=>{for(var E in w)A(T,E,{get:w[E],enumerable:!0})},z=(T,w,E,L)=>{if(w&&typeof w=="object"||typeof w=="function")for(let _ of p(w))!v.call(T,_)&&_!==E&&A(T,_,{get:()=>w[_],enumerable:!(L=f(w,_))||L.enumerable});return T},s=(T,w,E)=>(z(T,w,"default"),E&&z(E,w,"default")),V=(T,w,E)=>(E=T!=null?g(d(T)):{},z(w||!T||!T.__esModule?A(E,"default",{value:T,enumerable:!0}):E,T)),C=m((T,w)=>{var E=w.exports={},L,_;function Q(){throw new Error("setTimeout has not been defined")}function U(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?L=setTimeout:L=Q}catch{L=Q}try{typeof clearTimeout=="function"?_=clearTimeout:_=U}catch{_=U}})();function Y(X){if(L===setTimeout)return setTimeout(X,0);if((L===Q||!L)&&setTimeout)return L=setTimeout,setTimeout(X,0);try{return L(X,0)}catch{try{return L.call(null,X,0)}catch{return L.call(this,X,0)}}}function q(X){if(_===clearTimeout)return clearTimeout(X);if((_===U||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(X);try{return _(X)}catch{try{return _.call(null,X)}catch{return _.call(this,X)}}}var J=[],$=!1,R,M=-1;function b(){!$||!R||($=!1,R.length?J=R.concat(J):M=-1,J.length&&j())}function j(){if(!$){var X=Y(b);$=!0;for(var S=J.length;S;){for(R=J,J=[];++M<S;)R&&R[M].run();M=-1,S=J.length}R=null,$=!1,q(X)}}E.nextTick=function(X){var S=new Array(arguments.length-1);if(arguments.length>1)for(var I=1;I<arguments.length;I++)S[I-1]=arguments[I];J.push(new h(X,S)),J.length===1&&!$&&Y(j)};function h(X,S){this.fun=X,this.array=S}h.prototype.run=function(){this.fun.apply(null,this.array)},E.title="browser",E.browser=!0,E.env={},E.argv=[],E.version="",E.versions={};function N(){}E.on=N,E.addListener=N,E.once=N,E.off=N,E.removeListener=N,E.removeAllListeners=N,E.emit=N,E.prependListener=N,E.prependOnceListener=N,E.listeners=function(X){return[]},E.binding=function(X){throw new Error("process.binding is not supported")},E.cwd=function(){return"/"},E.chdir=function(X){throw new Error("process.chdir is not supported")},E.umask=function(){return 0}}),F={};r(F,{default:()=>K});s(F,V(C()));var K=V(C());function x(T){if(Array.isArray(T))return[...T];return{...T}}function O(T){if(Array.isArray(T))return T;return[T]}function P(T,...w){O(w).forEach((E)=>{delete T[E]})}function W(T){return typeof T==="object"&&!Array.isArray(T)&&T!==null}var B=(T)=>Array.isArray(T),Z=(T)=>typeof T==="function";function G(T,w){try{return w.split(".").reduce((E,L)=>E[L],T)}catch(E){return T}}function D(T){if(Array.isArray(T))return[...T];if("all"in T&&typeof T.all==="function")return T.all();return Object.values(T)}function n(T){return new H(T)}function y(){let T=-1;return{next:()=>{return T+=1,{value:this.items[T],done:T>=this.items.length}}}}class H{items;constructor(T=[]){this.items=T}[Symbol.iterator]=y;toJSON(){return this.items}all(){return this.items}average(T){if(T===void 0)return this.sum()/Number(this.items.length);if(Z(T))return Number(new this.constructor(this.items).sum(T))/Number(this.items.length);return Number(new this.constructor(this.items).pluck(T).sum())/Number(this.items.length)}avg=this.average;chunk(T){const w=[],E=Array.isArray(this.items)?this.items:Object.values(this.items);for(let L=0;L<E.length;L+=T)w.push(E.slice(L,L+T));return new H(w)}collapse(){return new this.constructor([].concat(...this.items))}combine(T){if(typeof T==="string")T=[T];if(!Array.isArray(T))throw new TypeError("The values must be an array or a string");const w={};return(Array.isArray(this.items)?this.items:Object.keys(this.items)).forEach((L,_)=>{if(T[_]!==void 0)w[L]=T[_]}),new H(w)}concat(T){let w=T;if(T instanceof this.constructor)w=T.all();else if(typeof T==="object")w=[],Object.keys(T).forEach((L)=>{w.push(T[L])});const E=x(this.items);return w.forEach((L)=>{if(typeof L==="object")Object.keys(L).forEach((_)=>E.push(L[_]));else E.push(L)}),new this.constructor(E)}contains(T,w){if(typeof T==="function")return this.items.some(T);if(Array.isArray(this.items))return this.items.includes(T);if(w!==void 0){if(Array.isArray(this.items))return this.items.some((E)=>E[T]!==void 0&&E[T]===w);return T in this.items&&this.items[T]===w}if(Array.isArray(this.items))return this.items.includes(T);return Object.values(this.items).includes(T)}containsOneItem(){if(typeof this.items==="string")return!0;return Object.keys(this.items).length===1}count(T){if(T)return this.filter(T).count();return Object.keys(this.items).length}countBy(T){const w={};return this.each((E)=>{const L=T?T(E):E;w[L]=(w[L]||0)+1}),new H(w)}crossJoin(...T){function w(E,L,_){let Q=_[0];if(Q instanceof H)Q=Q.all();const U=_.slice(1),Y=!U.length;let q=[];for(let J=0;J<Q.length;J+=1){const $=E.slice();if($.push(Q[J]),Y)q.push($);else q=q.concat(w($,L,U))}return q}return new this.constructor(w([],this.constructor,[].concat([this.items],T)))}dd(){console.log(JSON.stringify(this.all(),null,2)),K.exit()}diff(T){let w;if(T instanceof this.constructor)w=T.all();else w=T;const E=this.items.filter((L)=>!w.includes(L));return new this.constructor(E)}diffAssoc(T){let w=T;if(T instanceof this.constructor)w=T.all();const E={};return Object.keys(this.items).forEach((L)=>{if(w[L]===void 0||w[L]!==this.items[L])E[L]=this.items[L]}),new this.constructor(E)}diffKeys(T){let w;if(T instanceof this.constructor)w=T.all();else w=T;const E=Object.keys(w),L=Object.keys(this.items).filter((_)=>!E.includes(_));return new this.constructor(this.items).only(L)}diffUsing(T,w){if(console.log("Original collection:",this.items),console.log("Array to compare:",T),T===null)return new H(this.items);const E=this.items.filter((L)=>{return T.findIndex((Q)=>{return w(L,Q)===0})===-1});return new H(E)}doesntContain(T,w){if(console.log("doesntContain called with:",{key:T,value:w}),typeof T==="function")return console.log("Function branch"),!this.contains(T);if(w!==void 0)return console.log("Key-value pair branch"),!this.contains((E)=>{return console.log("Comparing:",E[T],"with",w),E[T]===w});return console.log("Single value branch"),!this.contains(T)}dump(){return console.log(this.items),this}duplicates(){const T=[],w={},E=(L)=>{if(Array.isArray(L)||typeof L==="object")return JSON.stringify(L);return L};if(Array.isArray(this.items))this.items.forEach((L,_)=>{const Q=E(L);if(!T.includes(Q))T.push(Q);else w[_]=L});else if(typeof this.items==="object")Object.keys(this.items).forEach((L)=>{const _=E(this.items[L]);if(!T.includes(_))T.push(_);else w[L]=this.items[L]});return new this.constructor(w)}each(T){let w=!1;if(Array.isArray(this.items)){const{length:E}=this.items;for(let L=0;L<E&&!w;L+=1)w=T(this.items[L],L,this.items)===!1}else{const E=Object.keys(this.items),{length:L}=E;for(let _=0;_<L&&!w;_+=1){const Q=E[_];w=T(this.items[Q],Q,this.items)===!1}}return this}eachSpread(T){return this.each((w,E)=>{T(...w,E)}),this}every(T){return D(this.items).every(T)}except(T){const w={...this.items};return(Array.isArray(T)?T:[T]).forEach((L)=>delete w[L]),new H(w)}filter(T){if(console.log("Filter method called with callback:",T),console.log("Current items:",this.items),typeof T!=="function"){console.log("No callback provided, removing falsy values");const E=this.items.filter((L)=>{return console.log("Filtering item:",L),Boolean(L)});return console.log("Filtered items:",E),new H(E)}const w=this.items.filter((E,L)=>{return console.log("Filtering item:",E,"at index:",L),T(E,L)});return console.log("Filtered items:",w),new H(w)}first(T,w){if(Z(T)){const E=Object.keys(this.items);for(let L=0;L<E.length;L+=1){const _=E[L],Q=this.items[_];if(T(Q,_))return Q}if(Z(w))return w();return w}if(Array.isArray(this.items)&&this.items.length||Object.keys(this.items).length){if(Array.isArray(this.items))return this.items[0];const E=Object.keys(this.items)[0];return this.items[E]}if(Z(w))return w();return w}firstOrFail(T){const w=this.items.find(T||(()=>!0));if(w===void 0)throw new Error("Item not found.");return w}firstWhere(T,w,E){return this.where(T,w,E).first()||null}flatMap(T){return this.map(T).collapse()}flatten(T=Number.POSITIVE_INFINITY){const w=(E,L)=>{if(!Array.isArray(E)&&typeof E!=="object")return[E];return L>0?Object.values(E).reduce((_,Q)=>_.concat(Array.isArray(Q)||typeof Q==="object"?w(Q,L-1):Q),[]):Array.isArray(E)?[...E]:[E]};return new H(w(this.items,T))}flip(){const T={};if(Array.isArray(this.items))this.items.forEach((w,E)=>{T[w]=E});else Object.entries(this.items).forEach(([w,E])=>{T[E]=w});return new this.constructor(T)}forPage(T,w){let E={};if(Array.isArray(this.items))E=this.items.slice(T*w-w,T*w);else Object.keys(this.items).slice(T*w-w,T*w).forEach((L)=>{E[L]=this.items[L]});return new this.constructor(E)}forget(T){if(Array.isArray(this.items))this.items=this.items.filter((w,E)=>E!==Number.parseInt(T,10));else if(typeof this.items==="object"&&this.items!==null)delete this.items[T];return this}get(T,w=null){if(Array.isArray(this.items))return this.items[T]??w;return this.items[T]??w}groupBy(T){const w={};return this.each((E,L)=>{const _=typeof T==="function"?T(E):E[T];if(!(_ in w))w[_]=new H;w[_].push(E)}),new H(w)}has(T){if(Array.isArray(this.items))return T in this.items;return T in this.items}implode(T,w){if(w===void 0)return this.items.join(T);return new this.constructor(this.items).pluck(T).all().join(w)}includes(T){if(Array.isArray(this.items))return this.items.includes(T);return Object.values(this.items).includes(T)}intersect(T){let w=T;if(T instanceof this.constructor)w=T.all();const E=this.items.filter((L)=>w.includes(L));return new this.constructor(E)}intersectByKeys(T){let w=Object.keys(T);if(T instanceof this.constructor)w=Object.keys(T.all());const E={};return Object.keys(this.items).forEach((L)=>{if(w.includes(L))E[L]=this.items[L]}),new this.constructor(E)}isEmpty(){return this.count()===0}isNotEmpty(){return!this.isEmpty()}join(T,w){const E=this.values();if(w===void 0)return E.implode(T);const L=E.count();if(L===0)return"";if(L===1)return E.last();const _=E.pop();return E.implode(T)+w+_}keyBy(T){const w={};if(Z(T))this.items.forEach((E)=>{w[T(E)]=E});else this.items.forEach((E)=>{const L=G(E,T);w[L||""]=E});return new this.constructor(w)}keys(){return new H(Object.keys(this.items))}last(T,w){let{items:E}=this;if(Z(T))E=this.filter(T).all();if(Array.isArray(E)&&!E.length||!Object.keys(E).length){if(Z(w))return w();return w}if(Array.isArray(E))return E[E.length-1];const L=Object.keys(E);return E[L[L.length-1]]}macro(T,w){this.constructor.prototype[T]=w}make(T=[]){return new this.constructor(T)}map(T){if(Array.isArray(this.items))return new this.constructor(this.items.map(T));const w={};return Object.keys(this.items).forEach((E)=>{w[E]=T(this.items[E],Number(E))}),new this.constructor(w)}mapSpread(T){return this.map((w,E)=>T(...w,E))}mapToDictionary(T){const w={};return this.items.forEach((E,L)=>{const[_,Q]=T(E,L);if(w[_]===void 0)w[_]=[Q];else w[_].push(Q)}),new this.constructor(w)}mapInto(T){return this.map((w,E)=>new T(w,E))}mapToGroups(T){const w={};return this.items.forEach((E,L)=>{const[_,Q]=T(E,L);if(w[_]===void 0)w[_]=[Q];else w[_].push(Q)}),new this.constructor(w)}mapWithKeys(T){const w={};if(Array.isArray(this.items))this.items.forEach((E,L)=>{const[_,Q]=T(E,L);w[_]=Q});else Object.keys(this.items).forEach((E)=>{const[L,_]=T(this.items[E],Number(E));w[L]=_});return new this.constructor(w)}max(T){if(typeof T==="string"){const w=this.items.filter((E)=>E[T]!==void 0);return Math.max(...w.map((E)=>E[T]))}return Math.max(...this.items)}median(T){const{length:w}=this.items;if(T===void 0){if(w%2===0)return(this.items[w/2-1]+this.items[w/2])/2;return this.items[Math.floor(w/2)]}if(w%2===0)return(this.items[w/2-1][T]+this.items[w/2][T])/2;return this.items[Math.floor(w/2)][T]}merge(T){const w={...this.items,...T};return new H(w)}mergeRecursive(T){const w=(E,L)=>{const _={};return Object.keys({...E,...L}).forEach((U)=>{if(E[U]===void 0&&L[U]!==void 0)_[U]=L[U];else if(E[U]!==void 0&&L[U]===void 0)_[U]=E[U];else if(E[U]!==void 0&&L[U]!==void 0)if(E[U]===L[U])_[U]=E[U];else if(!Array.isArray(E[U])&&typeof E[U]==="object"&&!Array.isArray(L[U])&&typeof L[U]==="object")_[U]=w(E[U],L[U]);else _[U]=[].concat(E[U],L[U])}),_};if(!T)return this;if(T.constructor.name==="Collection")return new this.constructor(w(this.items,T.all()));return new this.constructor(w(this.items,T))}min(T){if(T!==void 0){const w=this.items.filter((E)=>E[T]!==void 0);return Math.min(...w.map((E)=>E[T]))}return Math.min(...this.items)}mode(T){const w=[];let E=1;if(!this.items.length)return null;return this.items.forEach((L)=>{const _=w.filter((Q)=>{if(T!==void 0)return Q.key===L[T];return Q.key===L});if(!_.length)if(T!==void 0)w.push({key:L[T],count:1});else w.push({key:L,count:1});else{_[0].count+=1;const{count:Q}=_[0];if(Q>E)E=Q}}),w.filter((L)=>L.count===E).map((L)=>L.key)}nth(T,w=0){const L=D(this.items).slice(w).filter((_,Q)=>Q%T===0);return new this.constructor(L)}only(T){const w={};return T.forEach((E)=>{if(E in this.items)w[E]=this.items[E]}),new H(w)}pad(T,w){const E=Math.abs(T),L=this.count();if(E<=L)return this;let _=E-L;const Q=x(this.items),U=Array.isArray(this.items),Y=T<0;for(let q=0;q<_;){if(!U)if(Q[q]!==void 0)_+=1;else Q[q]=w;else if(Y)Q.unshift(w);else Q.push(w);q+=1}return new this.constructor(Q)}partition(T){let w;if(Array.isArray(this.items))w=[new this.constructor([]),new this.constructor([])],this.items.forEach((E)=>{if(T(E)===!0)w[0].push(E);else w[1].push(E)});else w=[new this.constructor({}),new this.constructor({})],Object.keys(this.items).forEach((E)=>{const L=this.items[E];if(T(L)===!0)w[0].put(E,L);else w[1].put(E,L)});return new this.constructor(w)}pipe(T){return T(this)}pluck(T,w){if(T.includes("*")){const E=o(this.items),L=[];if(w!==void 0){const Y=new RegExp(`0.${w}`,"g"),q=`0.${w}`.split(".").length;Object.keys(E).forEach((J)=>{const $=J.match(Y);if($){const R=$[0];if(R.split(".").length===q)L.push(E[R])}})}const _=[],Q=new RegExp(`0.${T}`,"g"),U=`0.${T}`.split(".").length;if(Object.keys(E).forEach((Y)=>{const q=Y.match(Q);if(q){const J=q[0];if(J.split(".").length===U)_.push(E[J])}}),w!==void 0){const Y={};return this.items.forEach((q,J)=>{Y[L[J]||""]=_}),new this.constructor(Y)}return new this.constructor([_])}if(w!==void 0){const E={};return this.items.forEach((L)=>{if(G(L,T)!==void 0)E[L[w]||""]=G(L,T);else E[L[w]||""]=null}),new this.constructor(E)}return this.map((E)=>{if(G(E,T)!==void 0)return G(E,T);return null})}pop(T=1){if(this.isEmpty())return null;if(B(this.items)){if(T===1)return this.items.pop();return new this.constructor(this.items.splice(-T))}if(W(this.items)){const w=Object.keys(this.items);if(T===1){const _=w[w.length-1],Q=this.items[_];return P(this.items,_),Q}const E=w.slice(-T),L=E.reduce((_,Q)=>{return _[Q]=this.items[Q],_},{});return P(this.items,E),new this.constructor(L)}return null}prepend(T,w){if(w!==void 0)return this.put(w,T);return this.items.unshift(T),this}pull(T,w=null){if(Array.isArray(this.items)){const L=Number(T);if(Number.isNaN(L))return w;const _=this.items[L];return this.items.splice(L,1),_??w}const E=this.items[T];return delete this.items[T],E??w}push(...T){return this.items=[...this.items,...T],this}put(T,w){return this.items[T]=w,this}random(T=null){const w=D(this.items),E=new this.constructor(w).shuffle();if(T!==Number.parseInt(T,10))return E.first();return E.take(T)}reduce(T,w){let E=null;if(w!==void 0)E=w;if(Array.isArray(this.items))this.items.forEach((L)=>{E=T(E,L)});else Object.keys(this.items).forEach((L)=>{E=T(E,this.items[L],L)});return E}reject(T){return new this.constructor(this.items).filter((w)=>!T(w))}replace(T){if(!T)return this;if(Array.isArray(T)){const E=this.items.map((L,_)=>T[_]||L);return new this.constructor(E)}if(T.constructor.name==="Collection"){const E={...this.items,...T.all()};return new this.constructor(E)}const w={...this.items,...T};return new this.constructor(w)}replaceRecursive(T){const w=(E,L)=>{const _={...E};return Object.keys({...E,...L}).forEach((U)=>{if(!Array.isArray(L[U])&&typeof L[U]==="object")_[U]=w(E[U],L[U]);else if(E[U]===void 0&&L[U]!==void 0)if(typeof E[U]==="object")_[U]={...L[U]};else _[U]=L[U];else if(E[U]!==void 0&&L[U]===void 0)if(typeof E[U]==="object")_[U]={...E[U]};else _[U]=E[U];else if(E[U]!==void 0&&L[U]!==void 0)if(typeof L[U]==="object")_[U]={...L[U]};else _[U]=L[U]}),_};if(!T)return this;if(!Array.isArray(T)&&typeof T!=="object")return new this.constructor(w(this.items,[T]));if(T.constructor.name==="Collection")return new this.constructor(w(this.items,T.all()));return new this.constructor(w(this.items,T))}reverse(){const T=[].concat(this.items).reverse();return new this.constructor(T)}search(T,w){let E;const L=(_,Q)=>{if(Z(T))return T(this.items[Q],Q);if(w)return this.items[Q]===T;return this.items[Q]==T};if(B(this.items))E=this.items.findIndex(L);else if(W(this.items))E=Object.keys(this.items).find((_)=>L(this.items[_],_));if(E===void 0||E<0)return!1;return E}shift(T=1){if(this.isEmpty())return null;if(B(this.items)){if(T===1)return this.items.shift();return new this.constructor(this.items.splice(0,T))}if(W(this.items)){if(T===1){const _=Object.keys(this.items)[0],Q=this.items[_];return delete this.items[_],Q}const E=Object.keys(this.items).slice(0,T),L=E.reduce((_,Q)=>{return _[Q]=this.items[Q],_},{});return P(this.items,E),new this.constructor(L)}return null}shuffle(){const T=D(this.items);let w,E,L;for(L=T.length;L;L-=1)w=Math.floor(Math.random()*L),E=T[L-1],T[L-1]=T[w],T[w]=E;return this.items=T,this}skip(T){if(W(this.items))return new this.constructor(Object.keys(this.items).reduce((w,E,L)=>{if(L+1>T)w[E]=this.items[E];return w},{}));return new this.constructor(this.items.slice(T))}skipUntil(T){let w=null,E,L=(_)=>_===T;if(Z(T))L=T;if(B(this.items))E=this.items.filter((_)=>{if(w!==!0)w=L(_);return w});if(W(this.items))E=Object.keys(this.items).reduce((_,Q)=>{if(w!==!0)w=L(this.items[Q]);if(w!==!1)_[Q]=this.items[Q];return _},{});return new this.constructor(E)}skipWhile(T){let w=null,E,L=(_)=>_===T;if(Z(T))L=T;if(B(this.items))E=this.items.filter((_)=>{if(w!==!0)w=!L(_);return w});if(W(this.items))E=Object.keys(this.items).reduce((_,Q)=>{if(w!==!0)w=!L(this.items[Q]);if(w!==!1)_[Q]=this.items[Q];return _},{});return new this.constructor(E)}slice(T,w){let E=this.items.slice(T);if(w!==void 0)E=E.slice(0,w);return new this.constructor(E)}sole(){if(this.items.length!==1)throw new Error("Collection does not contain exactly one item.");return this.items[0]}some(T){return this.items.some((w)=>w.hasOwnProperty(T))}sort(T){const w=[].concat(this.items);if(T===void 0)if(this.every((E)=>typeof E==="number"))w.sort((E,L)=>E-L);else w.sort();else w.sort(T);return new this.constructor(w)}sortDesc(){return this.sort().reverse()}sortBy(T){const w=[].concat(this.items),E=(L)=>{if(Z(T))return T(L);return G(L,T)};return w.sort((L,_)=>{const Q=E(L),U=E(_);if(Q===null||Q===void 0)return 1;if(U===null||U===void 0)return-1;if(Q<U)return-1;if(Q>U)return 1;return 0}),new this.constructor(w)}sortByDesc(T){return this.sortBy(T).reverse()}sortKeys(){const T={};return Object.keys(this.items).sort().forEach((w)=>{T[w]=this.items[w]}),new this.constructor(T)}sortKeysDesc(){const T={};return Object.keys(this.items).sort().reverse().forEach((w)=>{T[w]=this.items[w]}),new this.constructor(T)}splice(T,w,E){const L=this.slice(T,w);if(this.items=this.diff(L.all()).all(),Array.isArray(E))for(let _=0,{length:Q}=E;_<Q;_+=1)this.items.splice(T+_,0,E[_]);return L}split(T){const w=this.toArray(),E=[],L=Math.ceil(w.length/T);for(let _=0;_<w.length;_+=L)E.push(w.slice(_,_+L));return new H(E)}sum(T){const w=D(this.items);let E=0;if(T===void 0)for(let L=0,{length:_}=w;L<_;L+=1)E+=Number.parseFloat(w[L]);else if(Z(T))for(let L=0,{length:_}=w;L<_;L+=1)E+=Number.parseFloat(T(w[L]));else for(let L=0,{length:_}=w;L<_;L+=1)E+=Number.parseFloat(w[L][T]);return Number.parseFloat(E.toPrecision(12))}take(T){if(!Array.isArray(this.items)&&typeof this.items==="object"){const w=Object.keys(this.items);let E;if(T<0)E=w.slice(T);else E=w.slice(0,T);const L={};return w.forEach((_)=>{if(E.includes(_))L[_]=this.items[_]}),new this.constructor(L)}if(T<0)return new this.constructor(this.items.slice(T));return new this.constructor(this.items.slice(0,T))}takeUntil(T){let w=null,E,L=(_)=>_===T;if(Z(T))L=T;if(B(this.items))E=this.items.filter((_)=>{if(w!==!1)w=!L(_);return w});if(W(this.items))E=Object.keys(this.items).reduce((_,Q)=>{if(w!==!1)w=!L(this.items[Q]);if(w!==!1)_[Q]=this.items[Q];return _},{});return new this.constructor(E)}takeWhile(T){let w=null,E,L=(_)=>_===T;if(Z(T))L=T;if(B(this.items))E=this.items.filter((_)=>{if(w!==!1)w=L(_);return w});if(W(this.items))E=Object.keys(this.items).reduce((_,Q)=>{if(w!==!1)w=L(this.items[Q]);if(w!==!1)_[Q]=this.items[Q];return _},{});return new this.constructor(E)}tap(T){return T(this),this}times(T,w){for(let E=1;E<=T;E+=1)this.items.push(w(E));return this}toArray(){return Array.isArray(this.items)?this.items:Object.values(this.items)}toJson(){return JSON.stringify(this.items)}transform(T){if(Array.isArray(this.items))this.items=this.items.map(T);else{const w={};Object.keys(this.items).forEach((E)=>{w[E]=T(this.items[E],E)}),this.items=w}return this}undot(){if(Array.isArray(this.items))return this;let T={};return Object.keys(this.items).forEach((w)=>{if(w.includes(".")){const E=T;w.split(".").reduce((L,_,Q,U)=>{if(!L[_])L[_]={};if(Q===U.length-1)L[_]=this.items[w];return L[_]},E),T={...T,...E}}else T[w]=this.items[w]}),new this.constructor(T)}unless(T,w,E){if(!T)return w(this);if(E)return E();return}unlessEmpty(T){if(!this.isEmpty())T(this);return this}unlessNotEmpty(T){if(this.isEmpty())T(this);return this}union(T){const w=JSON.parse(JSON.stringify(this.items));return Object.keys(T).forEach((E)=>{if(this.items[E]===void 0)w[E]=T[E]}),new this.constructor(w)}unique(){const T=Array.from(new Set(this.items));return new this.constructor(T)}unwrap(){return this.items}values(){return new H(Object.values(this.items))}when(T,w,E){if(T)w(this,T);else if(E)E();return this}whenEmpty(T,w){if(Array.isArray(this.items)&&!this.items.length)return T(this);if(!Object.keys(this.items).length)return T(this);if(w!==void 0){if(Array.isArray(this.items)&&this.items.length)return w(this);if(Object.keys(this.items).length)return w(this)}return this}whenNotEmpty(T,w){if(Array.isArray(this.items)&&this.items.length)return T(this);if(Object.keys(this.items).length)return T(this);if(w!==void 0){if(Array.isArray(this.items)&&!this.items.length)return w(this);if(!Object.keys(this.items).length)return w(this)}return this}where(T,w,E){if(arguments.length===1)return new H(this.items.filter((_)=>_[T]!==void 0));if(arguments.length===2)E=w,w="===";const L=(_,Q,U,Y)=>{const q=_[Q];switch(Y){case"===":return q===U;case"!==":return q!==U;case"<":return q<U;case"<=":return q<=U;case">":return q>U;case">=":return q>=U;default:return q==U}};return new H(this.items.filter((_)=>L(_,T,E,w)))}whereBetween(T,w){return this.filter((E)=>{const L=typeof E==="object"?E[T]:E;return L>=w[0]&&L<=w[1]})}whereIn(T,w){return this.filter((E)=>{const L=typeof E==="object"?E[T]:E;return w.includes(L)})}whereNotBetween(T,w){return this.filter((E)=>{const L=typeof E==="object"?E[T]:E;return L<w[0]||L>w[1]})}whereNotIn(T,w){const E=this.items.filter((L)=>{const _=T.split(".");let Q=L;for(let U of _){if(Q[U]===void 0)return!0;Q=Q[U]}return!w.includes(Q)});return new H(E)}getNestedValue(T,w){return w.split(".").reduce((L,_)=>L&&L[_]!==void 0?L[_]:null,T)}whereInstanceOf(T){return this.filter((w)=>w instanceof T)}whereNotNull(T){return this.where(T,"!==",null)}whereNull(T){return this.where(T,"===",null)}static wrap(T){if(T instanceof H)return T;return new H(Array.isArray(T)?T:[T])}static unwrap(T){if(T instanceof H)return T.all();return T}wrap(T){if(T instanceof H)return T;if(typeof T==="object")return new H(T);return new H([T])}zip(...T){const w=T.map((L)=>this.constructor.wrap(L).all()),E=this.items.map((L,_)=>{const Q=[L];return w.forEach((U)=>{Q.push(U[_])}),new this.constructor(Q)});return new this.constructor(E)}}var o=function T(w){const E={};return w.forEach((L,_)=>{function Q(U,Y){if(W(U))Object.keys(U).forEach((q)=>{Q(U[q],`${Y}.${q}`)});else if(B(U))U.forEach((q,J)=>{Q(q,`${Y}.${J}`)});E[Y]=U}Q(L,_)}),E},LT=n;export{LT as default,n as collect,H as Collection};
2
2
 
3
- //# debugId=805AD41A7CB3136D64756E2164756E21
3
+ //# debugId=4028D12A0E5372FB64756E2164756E21
4
4
  //# sourceMappingURL=index.js.map