@squidcloud/backend 1.0.477 → 1.0.479

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/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- (()=>{var e={243(e,t,n){var r;e=n.nmd(e),function(){var o,i="Expected a function",u="__lodash_hash_undefined__",a="__lodash_placeholder__",s=32,c=128,f=1/0,l=9007199254740991,p=NaN,d=4294967295,h=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",256]],g="[object Arguments]",_="[object Array]",y="[object Boolean]",v="[object Date]",m="[object Error]",k="[object Function]",b="[object GeneratorFunction]",T="[object Map]",O="[object Number]",A="[object Object]",C="[object Promise]",w="[object RegExp]",I="[object Set]",E="[object String]",R="[object Symbol]",x="[object WeakMap]",S="[object ArrayBuffer]",N="[object DataView]",M="[object Float32Array]",D="[object Float64Array]",L="[object Int8Array]",G="[object Int16Array]",j="[object Int32Array]",Y="[object Uint8Array]",Q="[object Uint8ClampedArray]",P="[object Uint16Array]",B="[object Uint32Array]",q=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,F=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,V=RegExp(F.source),z=RegExp($.source),H=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,oe=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ue=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,fe=/\\(\\)?/g,le=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,_e=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,me=/($^)/,ke=/['\n\r\u2028\u2029\\]/g,be="\\ud800-\\udfff",Te="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Oe="\\u2700-\\u27bf",Ae="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",we="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ee="["+be+"]",Re="["+Ie+"]",xe="["+Te+"]",Se="\\d+",Ne="["+Oe+"]",Me="["+Ae+"]",De="[^"+be+Ie+Se+Oe+Ae+Ce+"]",Le="\\ud83c[\\udffb-\\udfff]",Ge="[^"+be+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",Ye="[\\ud800-\\udbff][\\udc00-\\udfff]",Qe="["+Ce+"]",Pe="\\u200d",Be="(?:"+Me+"|"+De+")",qe="(?:"+Qe+"|"+De+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",Ue="(?:['’](?:D|LL|M|RE|S|T|VE))?",Fe="(?:"+xe+"|"+Le+")?",$e="["+we+"]?",Ve=$e+Fe+"(?:"+Pe+"(?:"+[Ge,je,Ye].join("|")+")"+$e+Fe+")*",ze="(?:"+[Ne,je,Ye].join("|")+")"+Ve,He="(?:"+[Ge+xe+"?",xe,je,Ye,Ee].join("|")+")",Ke=RegExp("['’]","g"),Ze=RegExp(xe,"g"),Je=RegExp(Le+"(?="+Le+")|"+He+Ve,"g"),Xe=RegExp([Qe+"?"+Me+"+"+We+"(?="+[Re,Qe,"$"].join("|")+")",qe+"+"+Ue+"(?="+[Re,Qe+Be,"$"].join("|")+")",Qe+"?"+Be+"+"+We,Qe+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Se,ze].join("|"),"g"),et=RegExp("["+Pe+be+Te+we+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,ot={};ot[M]=ot[D]=ot[L]=ot[G]=ot[j]=ot[Y]=ot[Q]=ot[P]=ot[B]=!0,ot[g]=ot[_]=ot[S]=ot[y]=ot[N]=ot[v]=ot[m]=ot[k]=ot[T]=ot[O]=ot[A]=ot[w]=ot[I]=ot[E]=ot[x]=!1;var it={};it[g]=it[_]=it[S]=it[N]=it[y]=it[v]=it[M]=it[D]=it[L]=it[G]=it[j]=it[T]=it[O]=it[A]=it[w]=it[I]=it[E]=it[R]=it[Y]=it[Q]=it[P]=it[B]=!0,it[m]=it[k]=it[x]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,st=parseInt,ct="object"==typeof global&&global&&global.Object===Object&&global,ft="object"==typeof self&&self&&self.Object===Object&&self,lt=ct||ft||Function("return this")(),pt=t&&!t.nodeType&&t,dt=pt&&e&&!e.nodeType&&e,ht=dt&&dt.exports===pt,gt=ht&&ct.process,_t=function(){try{return dt&&dt.require&&dt.require("util").types||gt&&gt.binding&&gt.binding("util")}catch(e){}}(),yt=_t&&_t.isArrayBuffer,vt=_t&&_t.isDate,mt=_t&&_t.isMap,kt=_t&&_t.isRegExp,bt=_t&&_t.isSet,Tt=_t&&_t.isTypedArray;function Ot(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)}function At(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var u=e[o];t(r,u,n(u),e)}return r}function Ct(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function wt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function It(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Et(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var u=e[n];t(u,n,e)&&(i[o++]=u)}return i}function Rt(e,t){return!(null==e||!e.length)&&Qt(e,t,0)>-1}function xt(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 St(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}function Nt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Mt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function Dt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function Lt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Gt=Wt("length");function jt(e,t,n){var r;return n(e,function(e,n,o){if(t(e,n,o))return r=n,!1}),r}function Yt(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}function Qt(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):Yt(e,Bt,n)}function Pt(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function Bt(e){return e!=e}function qt(e,t){var n=null==e?0:e.length;return n?$t(e,t)/n:p}function Wt(e){return function(t){return null==t?o:t[e]}}function Ut(e){return function(t){return null==e?o:e[t]}}function Ft(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}function $t(e,t){for(var n,r=-1,i=e.length;++r<i;){var u=t(e[r]);u!==o&&(n=n===o?u:n+u)}return n}function Vt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function zt(e){return e?e.slice(0,pn(e)+1).replace(re,""):e}function Ht(e){return function(t){return e(t)}}function Kt(e,t){return St(t,function(t){return e[t]})}function Zt(e,t){return e.has(t)}function Jt(e,t){for(var n=-1,r=e.length;++n<r&&Qt(t,e[n],0)>-1;);return n}function Xt(e,t){for(var n=e.length;n--&&Qt(t,e[n],0)>-1;);return n}var en=Ut({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Ut({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(e){return"\\"+ut[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function un(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var u=e[n];u!==t&&u!==a||(e[n]=a,i[o++]=n)}return i}function sn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function fn(e){return rn(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):Gt(e)}function ln(e){return rn(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function pn(e){for(var t=e.length;t--&&oe.test(e.charAt(t)););return t}var dn=Ut({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),hn=function e(t){var n,r=(t=null==t?lt:hn.defaults(lt.Object(),t,hn.pick(lt,nt))).Array,oe=t.Date,be=t.Error,Te=t.Function,Oe=t.Math,Ae=t.Object,Ce=t.RegExp,we=t.String,Ie=t.TypeError,Ee=r.prototype,Re=Te.prototype,xe=Ae.prototype,Se=t["__core-js_shared__"],Ne=Re.toString,Me=xe.hasOwnProperty,De=0,Le=(n=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ge=xe.toString,je=Ne.call(Ae),Ye=lt._,Qe=Ce("^"+Ne.call(Me).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pe=ht?t.Buffer:o,Be=t.Symbol,qe=t.Uint8Array,We=Pe?Pe.allocUnsafe:o,Ue=un(Ae.getPrototypeOf,Ae),Fe=Ae.create,$e=xe.propertyIsEnumerable,Ve=Ee.splice,ze=Be?Be.isConcatSpreadable:o,He=Be?Be.iterator:o,Je=Be?Be.toStringTag:o,et=function(){try{var e=ci(Ae,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==lt.clearTimeout&&t.clearTimeout,ct=oe&&oe.now!==lt.Date.now&&oe.now,ft=t.setTimeout!==lt.setTimeout&&t.setTimeout,pt=Oe.ceil,dt=Oe.floor,gt=Ae.getOwnPropertySymbols,_t=Pe?Pe.isBuffer:o,Gt=t.isFinite,Ut=Ee.join,gn=un(Ae.keys,Ae),_n=Oe.max,yn=Oe.min,vn=oe.now,mn=t.parseInt,kn=Oe.random,bn=Ee.reverse,Tn=ci(t,"DataView"),On=ci(t,"Map"),An=ci(t,"Promise"),Cn=ci(t,"Set"),wn=ci(t,"WeakMap"),In=ci(Ae,"create"),En=wn&&new wn,Rn={},xn=ji(Tn),Sn=ji(On),Nn=ji(An),Mn=ji(Cn),Dn=ji(wn),Ln=Be?Be.prototype:o,Gn=Ln?Ln.valueOf:o,jn=Ln?Ln.toString:o;function Yn(e){if(ea(e)&&!Wu(e)&&!(e instanceof qn)){if(e instanceof Bn)return e;if(Me.call(e,"__wrapped__"))return Yi(e)}return new Bn(e)}var Qn=function(){function e(){}return function(t){if(!Xu(t))return{};if(Fe)return Fe(t);e.prototype=t;var n=new e;return e.prototype=o,n}}();function Pn(){}function Bn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function qn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Wn(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 Un(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 Fn(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 $n(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Fn;++t<n;)this.add(e[t])}function Vn(e){var t=this.__data__=new Un(e);this.size=t.size}function zn(e,t){var n=Wu(e),r=!n&&qu(e),o=!n&&!r&&Vu(e),i=!n&&!r&&!o&&sa(e),u=n||r||o||i,a=u?Vt(e.length,we):[],s=a.length;for(var c in e)!t&&!Me.call(e,c)||u&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||_i(c,s))||a.push(c);return a}function Hn(e){var t=e.length;return t?e[Fr(0,t-1)]:o}function Kn(e,t){return Ni(Io(e),ir(t,0,e.length))}function Zn(e){return Ni(Io(e))}function Jn(e,t,n){(n!==o&&!Qu(e[t],n)||n===o&&!(t in e))&&rr(e,t,n)}function Xn(e,t,n){var r=e[t];Me.call(e,t)&&Qu(r,n)&&(n!==o||t in e)||rr(e,t,n)}function er(e,t){for(var n=e.length;n--;)if(Qu(e[n][0],t))return n;return-1}function tr(e,t,n,r){return fr(e,function(e,o,i){t(r,e,n(e),i)}),r}function nr(e,t){return e&&Eo(t,xa(t),e)}function rr(e,t,n){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function or(e,t){for(var n=-1,i=t.length,u=r(i),a=null==e;++n<i;)u[n]=a?o:Ca(e,t[n]);return u}function ir(e,t,n){return e==e&&(n!==o&&(e=e<=n?e:n),t!==o&&(e=e>=t?e:t)),e}function ur(e,t,n,r,i,u){var a,s=1&t,c=2&t,f=4&t;if(n&&(a=i?n(e,r,i,u):n(e)),a!==o)return a;if(!Xu(e))return e;var l=Wu(e);if(l){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Me.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return Io(e,a)}else{var p=pi(e),d=p==k||p==b;if(Vu(e))return bo(e,s);if(p==A||p==g||d&&!i){if(a=c||d?{}:hi(e),!s)return c?function(e,t){return Eo(e,li(e),t)}(e,function(e,t){return e&&Eo(t,Sa(t),e)}(a,e)):function(e,t){return Eo(e,fi(e),t)}(e,nr(a,e))}else{if(!it[p])return i?e:{};a=function(e,t,n){var r,o=e.constructor;switch(t){case S:return To(e);case y:case v:return new o(+e);case N:return function(e,t){var n=t?To(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case M:case D:case L:case G:case j:case Y:case Q:case P:case B:return Oo(e,n);case T:return new o;case O:case E:return new o(e);case w:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case I:return new o;case R:return r=e,Gn?Ae(Gn.call(r)):{}}}(e,p,s)}}u||(u=new Vn);var h=u.get(e);if(h)return h;u.set(e,a),ia(e)?e.forEach(function(r){a.add(ur(r,t,n,r,e,u))}):ta(e)&&e.forEach(function(r,o){a.set(o,ur(r,t,n,o,e,u))});var _=l?o:(f?c?ni:ti:c?Sa:xa)(e);return Ct(_||e,function(r,o){_&&(r=e[o=r]),Xn(a,o,ur(r,t,n,o,e,u))}),a}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ae(e);r--;){var i=n[r],u=t[i],a=e[i];if(a===o&&!(i in e)||!u(a))return!1}return!0}function sr(e,t,n){if("function"!=typeof e)throw new Ie(i);return Ei(function(){e.apply(o,n)},t)}function cr(e,t,n,r){var o=-1,i=Rt,u=!0,a=e.length,s=[],c=t.length;if(!a)return s;n&&(t=St(t,Ht(n))),r?(i=xt,u=!1):t.length>=200&&(i=Zt,u=!1,t=new $n(t));e:for(;++o<a;){var f=e[o],l=null==n?f:n(f);if(f=r||0!==f?f:0,u&&l==l){for(var p=c;p--;)if(t[p]===l)continue e;s.push(f)}else i(t,l,r)||s.push(f)}return s}Yn.templateSettings={escape:H,evaluate:K,interpolate:Z,variable:"",imports:{_:Yn}},Yn.prototype=Pn.prototype,Yn.prototype.constructor=Yn,Bn.prototype=Qn(Pn.prototype),Bn.prototype.constructor=Bn,qn.prototype=Qn(Pn.prototype),qn.prototype.constructor=qn,Wn.prototype.clear=function(){this.__data__=In?In(null):{},this.size=0},Wn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Wn.prototype.get=function(e){var t=this.__data__;if(In){var n=t[e];return n===u?o:n}return Me.call(t,e)?t[e]:o},Wn.prototype.has=function(e){var t=this.__data__;return In?t[e]!==o:Me.call(t,e)},Wn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=In&&t===o?u:t,this},Un.prototype.clear=function(){this.__data__=[],this.size=0},Un.prototype.delete=function(e){var t=this.__data__,n=er(t,e);return!(n<0||(n==t.length-1?t.pop():Ve.call(t,n,1),--this.size,0))},Un.prototype.get=function(e){var t=this.__data__,n=er(t,e);return n<0?o:t[n][1]},Un.prototype.has=function(e){return er(this.__data__,e)>-1},Un.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Fn.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(On||Un),string:new Wn}},Fn.prototype.delete=function(e){var t=ai(this,e).delete(e);return this.size-=t?1:0,t},Fn.prototype.get=function(e){return ai(this,e).get(e)},Fn.prototype.has=function(e){return ai(this,e).has(e)},Fn.prototype.set=function(e,t){var n=ai(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},$n.prototype.add=$n.prototype.push=function(e){return this.__data__.set(e,u),this},$n.prototype.has=function(e){return this.__data__.has(e)},Vn.prototype.clear=function(){this.__data__=new Un,this.size=0},Vn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Vn.prototype.get=function(e){return this.__data__.get(e)},Vn.prototype.has=function(e){return this.__data__.has(e)},Vn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Un){var r=n.__data__;if(!On||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Fn(r)}return n.set(e,t),this.size=n.size,this};var fr=So(vr),lr=So(mr,!0);function pr(e,t){var n=!0;return fr(e,function(e,r,o){return n=!!t(e,r,o)}),n}function dr(e,t,n){for(var r=-1,i=e.length;++r<i;){var u=e[r],a=t(u);if(null!=a&&(s===o?a==a&&!aa(a):n(a,s)))var s=a,c=u}return c}function hr(e,t){var n=[];return fr(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function gr(e,t,n,r,o){var i=-1,u=e.length;for(n||(n=gi),o||(o=[]);++i<u;){var a=e[i];t>0&&n(a)?t>1?gr(a,t-1,n,r,o):Nt(o,a):r||(o[o.length]=a)}return o}var _r=No(),yr=No(!0);function vr(e,t){return e&&_r(e,t,xa)}function mr(e,t){return e&&yr(e,t,xa)}function kr(e,t){return Et(t,function(t){return Ku(e[t])})}function br(e,t){for(var n=0,r=(t=yo(t,e)).length;null!=e&&n<r;)e=e[Gi(t[n++])];return n&&n==r?e:o}function Tr(e,t,n){var r=t(e);return Wu(e)?r:Nt(r,n(e))}function Or(e){return null==e?e===o?"[object Undefined]":"[object Null]":Je&&Je in Ae(e)?function(e){var t=Me.call(e,Je),n=e[Je];try{e[Je]=o;var r=!0}catch(e){}var i=Ge.call(e);return r&&(t?e[Je]=n:delete e[Je]),i}(e):function(e){return Ge.call(e)}(e)}function Ar(e,t){return e>t}function Cr(e,t){return null!=e&&Me.call(e,t)}function wr(e,t){return null!=e&&t in Ae(e)}function Ir(e,t,n){for(var i=n?xt:Rt,u=e[0].length,a=e.length,s=a,c=r(a),f=1/0,l=[];s--;){var p=e[s];s&&t&&(p=St(p,Ht(t))),f=yn(p.length,f),c[s]=!n&&(t||u>=120&&p.length>=120)?new $n(s&&p):o}p=e[0];var d=-1,h=c[0];e:for(;++d<u&&l.length<f;){var g=p[d],_=t?t(g):g;if(g=n||0!==g?g:0,!(h?Zt(h,_):i(l,_,n))){for(s=a;--s;){var y=c[s];if(!(y?Zt(y,_):i(e[s],_,n)))continue e}h&&h.push(_),l.push(g)}}return l}function Er(e,t,n){var r=null==(e=Ci(e,t=yo(t,e)))?e:e[Gi(Hi(t))];return null==r?o:Ot(r,e,n)}function Rr(e){return ea(e)&&Or(e)==g}function xr(e,t,n,r,i){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,n,r,i,u){var a=Wu(e),s=Wu(t),c=a?_:pi(e),f=s?_:pi(t),l=(c=c==g?A:c)==A,p=(f=f==g?A:f)==A,d=c==f;if(d&&Vu(e)){if(!Vu(t))return!1;a=!0,l=!1}if(d&&!l)return u||(u=new Vn),a||sa(e)?Xo(e,t,n,r,i,u):function(e,t,n,r,o,i,u){switch(n){case N:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!i(new qe(e),new qe(t)));case y:case v:case O:return Qu(+e,+t);case m:return e.name==t.name&&e.message==t.message;case w:case E:return e==t+"";case T:var a=on;case I:var s=1&r;if(a||(a=sn),e.size!=t.size&&!s)return!1;var c=u.get(e);if(c)return c==t;r|=2,u.set(e,t);var f=Xo(a(e),a(t),r,o,i,u);return u.delete(e),f;case R:if(Gn)return Gn.call(e)==Gn.call(t)}return!1}(e,t,c,n,r,i,u);if(!(1&n)){var h=l&&Me.call(e,"__wrapped__"),k=p&&Me.call(t,"__wrapped__");if(h||k){var b=h?e.value():e,C=k?t.value():t;return u||(u=new Vn),i(b,C,n,r,u)}}return!!d&&(u||(u=new Vn),function(e,t,n,r,i,u){var a=1&n,s=ti(e),c=s.length;if(c!=ti(t).length&&!a)return!1;for(var f=c;f--;){var l=s[f];if(!(a?l in t:Me.call(t,l)))return!1}var p=u.get(e),d=u.get(t);if(p&&d)return p==t&&d==e;var h=!0;u.set(e,t),u.set(t,e);for(var g=a;++f<c;){var _=e[l=s[f]],y=t[l];if(r)var v=a?r(y,_,l,t,e,u):r(_,y,l,e,t,u);if(!(v===o?_===y||i(_,y,n,r,u):v)){h=!1;break}g||(g="constructor"==l)}if(h&&!g){var m=e.constructor,k=t.constructor;m==k||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof k&&k instanceof k||(h=!1)}return u.delete(e),u.delete(t),h}(e,t,n,r,i,u))}(e,t,n,r,xr,i))}function Sr(e,t,n,r){var i=n.length,u=i,a=!r;if(null==e)return!u;for(e=Ae(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<u;){var c=(s=n[i])[0],f=e[c],l=s[1];if(a&&s[2]){if(f===o&&!(c in e))return!1}else{var p=new Vn;if(r)var d=r(f,l,c,e,t,p);if(!(d===o?xr(l,f,3,r,p):d))return!1}}return!0}function Nr(e){return!(!Xu(e)||(t=e,Le&&Le in t))&&(Ku(e)?Qe:ge).test(ji(e));var t}function Mr(e){return"function"==typeof e?e:null==e?ns:"object"==typeof e?Wu(e)?Yr(e[0],e[1]):jr(e):ls(e)}function Dr(e){if(!bi(e))return gn(e);var t=[];for(var n in Ae(e))Me.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Lr(e,t){return e<t}function Gr(e,t){var n=-1,o=Fu(e)?r(e.length):[];return fr(e,function(e,r,i){o[++n]=t(e,r,i)}),o}function jr(e){var t=si(e);return 1==t.length&&t[0][2]?Oi(t[0][0],t[0][1]):function(n){return n===e||Sr(n,e,t)}}function Yr(e,t){return vi(e)&&Ti(t)?Oi(Gi(e),t):function(n){var r=Ca(n,e);return r===o&&r===t?wa(n,e):xr(t,r,3)}}function Qr(e,t,n,r,i){e!==t&&_r(t,function(u,a){if(i||(i=new Vn),Xu(u))!function(e,t,n,r,i,u,a){var s=wi(e,n),c=wi(t,n),f=a.get(c);if(f)Jn(e,n,f);else{var l=u?u(s,c,n+"",e,t,a):o,p=l===o;if(p){var d=Wu(c),h=!d&&Vu(c),g=!d&&!h&&sa(c);l=c,d||h||g?Wu(s)?l=s:$u(s)?l=Io(s):h?(p=!1,l=bo(c,!0)):g?(p=!1,l=Oo(c,!0)):l=[]:ra(c)||qu(c)?(l=s,qu(s)?l=_a(s):Xu(s)&&!Ku(s)||(l=hi(c))):p=!1}p&&(a.set(c,l),i(l,c,r,u,a),a.delete(c)),Jn(e,n,l)}}(e,t,a,n,Qr,r,i);else{var s=r?r(wi(e,a),u,a+"",e,t,i):o;s===o&&(s=u),Jn(e,a,s)}},Sa)}function Pr(e,t){var n=e.length;if(n)return _i(t+=t<0?n:0,n)?e[t]:o}function Br(e,t,n){t=t.length?St(t,function(e){return Wu(e)?function(t){return br(t,1===e.length?e[0]:e)}:e}):[ns];var r=-1;t=St(t,Ht(ui()));var o=Gr(e,function(e,n,o){var i=St(t,function(t){return t(e)});return{criteria:i,index:++r,value:e}});return function(e){var t=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var r=-1,o=e.criteria,i=t.criteria,u=o.length,a=n.length;++r<u;){var s=Ao(o[r],i[r]);if(s)return r>=a?s:s*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});t--;)e[t]=e[t].value;return e}(o)}function qr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var u=t[r],a=br(e,u);n(a,u)&&Kr(i,yo(u,e),a)}return i}function Wr(e,t,n,r){var o=r?Pt:Qt,i=-1,u=t.length,a=e;for(e===t&&(t=Io(t)),n&&(a=St(e,Ht(n)));++i<u;)for(var s=0,c=t[i],f=n?n(c):c;(s=o(a,f,s,r))>-1;)a!==e&&Ve.call(a,s,1),Ve.call(e,s,1);return e}function Ur(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;_i(o)?Ve.call(e,o,1):so(e,o)}}return e}function Fr(e,t){return e+dt(kn()*(t-e+1))}function $r(e,t){var n="";if(!e||t<1||t>l)return n;do{t%2&&(n+=e),(t=dt(t/2))&&(e+=e)}while(t);return n}function Vr(e,t){return Ri(Ai(e,t,ns),e+"")}function zr(e){return Hn(Qa(e))}function Hr(e,t){var n=Qa(e);return Ni(n,ir(t,0,n.length))}function Kr(e,t,n,r){if(!Xu(e))return e;for(var i=-1,u=(t=yo(t,e)).length,a=u-1,s=e;null!=s&&++i<u;){var c=Gi(t[i]),f=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=a){var l=s[c];(f=r?r(l,c,s):o)===o&&(f=Xu(l)?l:_i(t[i+1])?[]:{})}Xn(s,c,f),s=s[c]}return e}var Zr=En?function(e,t){return En.set(e,t),e}:ns,Jr=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Xa(t),writable:!0})}:ns;function Xr(e){return Ni(Qa(e))}function eo(e,t,n){var o=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var u=r(i);++o<i;)u[o]=e[o+t];return u}function to(e,t){var n;return fr(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}function no(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,u=e[i];null!==u&&!aa(u)&&(n?u<=t:u<t)?r=i+1:o=i}return o}return ro(e,t,ns,n)}function ro(e,t,n,r){var i=0,u=null==e?0:e.length;if(0===u)return 0;for(var a=(t=n(t))!=t,s=null===t,c=aa(t),f=t===o;i<u;){var l=dt((i+u)/2),p=n(e[l]),d=p!==o,h=null===p,g=p==p,_=aa(p);if(a)var y=r||g;else y=f?g&&(r||d):s?g&&d&&(r||!h):c?g&&d&&!h&&(r||!_):!h&&!_&&(r?p<=t:p<t);y?i=l+1:u=l}return yn(u,4294967294)}function oo(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var u=e[n],a=t?t(u):u;if(!n||!Qu(a,s)){var s=a;i[o++]=0===u?0:u}}return i}function io(e){return"number"==typeof e?e:aa(e)?p:+e}function uo(e){if("string"==typeof e)return e;if(Wu(e))return St(e,uo)+"";if(aa(e))return jn?jn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ao(e,t,n){var r=-1,o=Rt,i=e.length,u=!0,a=[],s=a;if(n)u=!1,o=xt;else if(i>=200){var c=t?null:Vo(e);if(c)return sn(c);u=!1,o=Zt,s=new $n}else s=t?[]:a;e:for(;++r<i;){var f=e[r],l=t?t(f):f;if(f=n||0!==f?f:0,u&&l==l){for(var p=s.length;p--;)if(s[p]===l)continue e;t&&s.push(l),a.push(f)}else o(s,l,n)||(s!==a&&s.push(l),a.push(f))}return a}function so(e,t){var n=-1,r=(t=yo(t,e)).length;if(!r)return!0;for(;++n<r;){var o=Gi(t[n]);if("__proto__"===o&&!Me.call(e,"__proto__"))return!1;if(("constructor"===o||"prototype"===o)&&n<r-1)return!1}var i=Ci(e,t);return null==i||delete i[Gi(Hi(t))]}function co(e,t,n,r){return Kr(e,t,n(br(e,t)),r)}function fo(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?eo(e,r?0:i,r?i+1:o):eo(e,r?i+1:0,r?o:i)}function lo(e,t){var n=e;return n instanceof qn&&(n=n.value()),Mt(t,function(e,t){return t.func.apply(t.thisArg,Nt([e],t.args))},n)}function po(e,t,n){var o=e.length;if(o<2)return o?ao(e[0]):[];for(var i=-1,u=r(o);++i<o;)for(var a=e[i],s=-1;++s<o;)s!=i&&(u[i]=cr(u[i]||a,e[s],t,n));return ao(gr(u,1),t,n)}function ho(e,t,n){for(var r=-1,i=e.length,u=t.length,a={};++r<i;){var s=r<u?t[r]:o;n(a,e[r],s)}return a}function go(e){return $u(e)?e:[]}function _o(e){return"function"==typeof e?e:ns}function yo(e,t){return Wu(e)?e:vi(e,t)?[e]:Li(ya(e))}var vo=Vr;function mo(e,t,n){var r=e.length;return n=n===o?r:n,!t&&n>=r?e:eo(e,t,n)}var ko=ut||function(e){return lt.clearTimeout(e)};function bo(e,t){if(t)return e.slice();var n=e.length,r=We?We(n):new e.constructor(n);return e.copy(r),r}function To(e){var t=new e.constructor(e.byteLength);return new qe(t).set(new qe(e)),t}function Oo(e,t){var n=t?To(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ao(e,t){if(e!==t){var n=e!==o,r=null===e,i=e==e,u=aa(e),a=t!==o,s=null===t,c=t==t,f=aa(t);if(!s&&!f&&!u&&e>t||u&&a&&c&&!s&&!f||r&&a&&c||!n&&c||!i)return 1;if(!r&&!u&&!f&&e<t||f&&n&&i&&!r&&!u||s&&n&&i||!a&&i||!c)return-1}return 0}function Co(e,t,n,o){for(var i=-1,u=e.length,a=n.length,s=-1,c=t.length,f=_n(u-a,0),l=r(c+f),p=!o;++s<c;)l[s]=t[s];for(;++i<a;)(p||i<u)&&(l[n[i]]=e[i]);for(;f--;)l[s++]=e[i++];return l}function wo(e,t,n,o){for(var i=-1,u=e.length,a=-1,s=n.length,c=-1,f=t.length,l=_n(u-s,0),p=r(l+f),d=!o;++i<l;)p[i]=e[i];for(var h=i;++c<f;)p[h+c]=t[c];for(;++a<s;)(d||i<u)&&(p[h+n[a]]=e[i++]);return p}function Io(e,t){var n=-1,o=e.length;for(t||(t=r(o));++n<o;)t[n]=e[n];return t}function Eo(e,t,n,r){var i=!n;n||(n={});for(var u=-1,a=t.length;++u<a;){var s=t[u],c=r?r(n[s],e[s],s,n,e):o;c===o&&(c=e[s]),i?rr(n,s,c):Xn(n,s,c)}return n}function Ro(e,t){return function(n,r){var o=Wu(n)?At:tr,i=t?t():{};return o(n,e,ui(r,2),i)}}function xo(e){return Vr(function(t,n){var r=-1,i=n.length,u=i>1?n[i-1]:o,a=i>2?n[2]:o;for(u=e.length>3&&"function"==typeof u?(i--,u):o,a&&yi(n[0],n[1],a)&&(u=i<3?o:u,i=1),t=Ae(t);++r<i;){var s=n[r];s&&e(t,s,r,u)}return t})}function So(e,t){return function(n,r){if(null==n)return n;if(!Fu(n))return e(n,r);for(var o=n.length,i=t?o:-1,u=Ae(n);(t?i--:++i<o)&&!1!==r(u[i],i,u););return n}}function No(e){return function(t,n,r){for(var o=-1,i=Ae(t),u=r(t),a=u.length;a--;){var s=u[e?a:++o];if(!1===n(i[s],s,i))break}return t}}function Mo(e){return function(t){var n=rn(t=ya(t))?ln(t):o,r=n?n[0]:t.charAt(0),i=n?mo(n,1).join(""):t.slice(1);return r[e]()+i}}function Do(e){return function(t){return Mt(Ka(qa(t).replace(Ke,"")),e,"")}}function Lo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Qn(e.prototype),r=e.apply(n,t);return Xu(r)?r:n}}function Go(e){return function(t,n,r){var i=Ae(t);if(!Fu(t)){var u=ui(n,3);t=xa(t),n=function(e){return u(i[e],e,i)}}var a=e(t,n,r);return a>-1?i[u?t[a]:a]:o}}function jo(e){return ei(function(t){var n=t.length,r=n,u=Bn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new Ie(i);if(u&&!s&&"wrapper"==oi(a))var s=new Bn([],!0)}for(r=s?r:n;++r<n;){var c=oi(a=t[r]),f="wrapper"==c?ri(a):o;s=f&&mi(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?s[oi(f[0])].apply(s,f[3]):1==a.length&&mi(a)?s[c]():s.thru(a)}return function(){var e=arguments,r=e[0];if(s&&1==e.length&&Wu(r))return s.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}})}function Yo(e,t,n,i,u,a,s,f,l,p){var d=t&c,h=1&t,g=2&t,_=24&t,y=512&t,v=g?o:Lo(e);return function c(){for(var m=arguments.length,k=r(m),b=m;b--;)k[b]=arguments[b];if(_)var T=ii(c),O=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(k,T);if(i&&(k=Co(k,i,u,_)),a&&(k=wo(k,a,s,_)),m-=O,_&&m<p){var A=an(k,T);return Fo(e,t,Yo,c.placeholder,n,k,A,f,l,p-m)}var C=h?n:this,w=g?C[e]:e;return m=k.length,f?k=function(e,t){for(var n=e.length,r=yn(t.length,n),i=Io(e);r--;){var u=t[r];e[r]=_i(u,n)?i[u]:o}return e}(k,f):y&&m>1&&k.reverse(),d&&l<m&&(k.length=l),this&&this!==lt&&this instanceof c&&(w=v||Lo(w)),w.apply(C,k)}}function Qo(e,t){return function(n,r){return function(e,t,n,r){return vr(e,function(e,o,i){t(r,n(e),o,i)}),r}(n,e,t(r),{})}}function Po(e,t){return function(n,r){var i;if(n===o&&r===o)return t;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=uo(n),r=uo(r)):(n=io(n),r=io(r)),i=e(n,r)}return i}}function Bo(e){return ei(function(t){return t=St(t,Ht(ui())),Vr(function(n){var r=this;return e(t,function(e){return Ot(e,r,n)})})})}function qo(e,t){var n=(t=t===o?" ":uo(t)).length;if(n<2)return n?$r(t,e):t;var r=$r(t,pt(e/fn(t)));return rn(t)?mo(ln(r),0,e).join(""):r.slice(0,e)}function Wo(e){return function(t,n,i){return i&&"number"!=typeof i&&yi(t,n,i)&&(n=i=o),t=pa(t),n===o?(n=t,t=0):n=pa(n),function(e,t,n,o){for(var i=-1,u=_n(pt((t-e)/(n||1)),0),a=r(u);u--;)a[o?u:++i]=e,e+=n;return a}(t,n,i=i===o?t<n?1:-1:pa(i),e)}}function Uo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ga(t),n=ga(n)),e(t,n)}}function Fo(e,t,n,r,i,u,a,c,f,l){var p=8&t;t|=p?s:64,4&(t&=~(p?64:s))||(t&=-4);var d=[e,t,i,p?u:o,p?a:o,p?o:u,p?o:a,c,f,l],h=n.apply(o,d);return mi(e)&&Ii(h,d),h.placeholder=r,xi(h,e,t)}function $o(e){var t=Oe[e];return function(e,n){if(e=ga(e),(n=null==n?0:yn(da(n),292))&&Gt(e)){var r=(ya(e)+"e").split("e");return+((r=(ya(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Vo=Cn&&1/sn(new Cn([,-0]))[1]==f?function(e){return new Cn(e)}:as;function zo(e){return function(t){var n=pi(t);return n==T?on(t):n==I?cn(t):function(e,t){return St(t,function(t){return[t,e[t]]})}(t,e(t))}}function Ho(e,t,n,u,f,l,p,d){var h=2&t;if(!h&&"function"!=typeof e)throw new Ie(i);var g=u?u.length:0;if(g||(t&=-97,u=f=o),p=p===o?p:_n(da(p),0),d=d===o?d:da(d),g-=f?f.length:0,64&t){var _=u,y=f;u=f=o}var v=h?o:ri(e),m=[e,t,n,u,f,_,y,l,p,d];if(v&&function(e,t){var n=e[1],r=t[1],o=n|r,i=o<131,u=r==c&&8==n||r==c&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!i&&!u)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var s=t[3];if(s){var f=e[3];e[3]=f?Co(f,s,t[4]):s,e[4]=f?an(e[3],a):t[4]}(s=t[5])&&(f=e[5],e[5]=f?wo(f,s,t[6]):s,e[6]=f?an(e[5],a):t[6]),(s=t[7])&&(e[7]=s),r&c&&(e[8]=null==e[8]?t[8]:yn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(m,v),e=m[0],t=m[1],n=m[2],u=m[3],f=m[4],!(d=m[9]=m[9]===o?h?0:e.length:_n(m[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)k=8==t||16==t?function(e,t,n){var i=Lo(e);return function u(){for(var a=arguments.length,s=r(a),c=a,f=ii(u);c--;)s[c]=arguments[c];var l=a<3&&s[0]!==f&&s[a-1]!==f?[]:an(s,f);return(a-=l.length)<n?Fo(e,t,Yo,u.placeholder,o,s,l,o,o,n-a):Ot(this&&this!==lt&&this instanceof u?i:e,this,s)}}(e,t,d):t!=s&&33!=t||f.length?Yo.apply(o,m):function(e,t,n,o){var i=1&t,u=Lo(e);return function t(){for(var a=-1,s=arguments.length,c=-1,f=o.length,l=r(f+s),p=this&&this!==lt&&this instanceof t?u:e;++c<f;)l[c]=o[c];for(;s--;)l[c++]=arguments[++a];return Ot(p,i?n:this,l)}}(e,t,n,u);else var k=function(e,t,n){var r=1&t,o=Lo(e);return function t(){return(this&&this!==lt&&this instanceof t?o:e).apply(r?n:this,arguments)}}(e,t,n);return xi((v?Zr:Ii)(k,m),e,t)}function Ko(e,t,n,r){return e===o||Qu(e,xe[n])&&!Me.call(r,n)?t:e}function Zo(e,t,n,r,i,u){return Xu(e)&&Xu(t)&&(u.set(t,e),Qr(e,t,o,Zo,u),u.delete(t)),e}function Jo(e){return ra(e)?o:e}function Xo(e,t,n,r,i,u){var a=1&n,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var f=u.get(e),l=u.get(t);if(f&&l)return f==t&&l==e;var p=-1,d=!0,h=2&n?new $n:o;for(u.set(e,t),u.set(t,e);++p<s;){var g=e[p],_=t[p];if(r)var y=a?r(_,g,p,t,e,u):r(g,_,p,e,t,u);if(y!==o){if(y)continue;d=!1;break}if(h){if(!Lt(t,function(e,t){if(!Zt(h,t)&&(g===e||i(g,e,n,r,u)))return h.push(t)})){d=!1;break}}else if(g!==_&&!i(g,_,n,r,u)){d=!1;break}}return u.delete(e),u.delete(t),d}function ei(e){return Ri(Ai(e,o,Ui),e+"")}function ti(e){return Tr(e,xa,fi)}function ni(e){return Tr(e,Sa,li)}var ri=En?function(e){return En.get(e)}:as;function oi(e){for(var t=e.name+"",n=Rn[t],r=Me.call(Rn,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function ii(e){return(Me.call(Yn,"placeholder")?Yn:e).placeholder}function ui(){var e=Yn.iteratee||rs;return e=e===rs?Mr:e,arguments.length?e(arguments[0],arguments[1]):e}function ai(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 si(e){for(var t=xa(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ti(o)]}return t}function ci(e,t){var n=function(e,t){return null==e?o:e[t]}(e,t);return Nr(n)?n:o}var fi=gt?function(e){return null==e?[]:(e=Ae(e),Et(gt(e),function(t){return $e.call(e,t)}))}:hs,li=gt?function(e){for(var t=[];e;)Nt(t,fi(e)),e=Ue(e);return t}:hs,pi=Or;function di(e,t,n){for(var r=-1,o=(t=yo(t,e)).length,i=!1;++r<o;){var u=Gi(t[r]);if(!(i=null!=e&&n(e,u)))break;e=e[u]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&Ju(o)&&_i(u,o)&&(Wu(e)||qu(e))}function hi(e){return"function"!=typeof e.constructor||bi(e)?{}:Qn(Ue(e))}function gi(e){return Wu(e)||qu(e)||!!(ze&&e&&e[ze])}function _i(e,t){var n=typeof e;return!!(t=t??l)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function yi(e,t,n){if(!Xu(n))return!1;var r=typeof t;return!!("number"==r?Fu(n)&&_i(t,n.length):"string"==r&&t in n)&&Qu(n[t],e)}function vi(e,t){if(Wu(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!aa(e))||X.test(e)||!J.test(e)||null!=t&&e in Ae(t)}function mi(e){var t=oi(e),n=Yn[t];if("function"!=typeof n||!(t in qn.prototype))return!1;if(e===n)return!0;var r=ri(n);return!!r&&e===r[0]}(Tn&&pi(new Tn(new ArrayBuffer(1)))!=N||On&&pi(new On)!=T||An&&pi(An.resolve())!=C||Cn&&pi(new Cn)!=I||wn&&pi(new wn)!=x)&&(pi=function(e){var t=Or(e),n=t==A?e.constructor:o,r=n?ji(n):"";if(r)switch(r){case xn:return N;case Sn:return T;case Nn:return C;case Mn:return I;case Dn:return x}return t});var ki=Se?Ku:gs;function bi(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||xe)}function Ti(e){return e==e&&!Xu(e)}function Oi(e,t){return function(n){return null!=n&&n[e]===t&&(t!==o||e in Ae(n))}}function Ai(e,t,n){return t=_n(t===o?e.length-1:t,0),function(){for(var o=arguments,i=-1,u=_n(o.length-t,0),a=r(u);++i<u;)a[i]=o[t+i];i=-1;for(var s=r(t+1);++i<t;)s[i]=o[i];return s[t]=n(a),Ot(e,this,s)}}function Ci(e,t){return t.length<2?e:br(e,eo(t,0,-1))}function wi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ii=Si(Zr),Ei=ft||function(e,t){return lt.setTimeout(e,t)},Ri=Si(Jr);function xi(e,t,n){var r=t+"";return Ri(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Ct(h,function(n){var r="_."+n[0];t&n[1]&&!Rt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ue);return t?t[1].split(ae):[]}(r),n)))}function Si(e){var t=0,n=0;return function(){var r=vn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Ni(e,t){var n=-1,r=e.length,i=r-1;for(t=t===o?r:t;++n<t;){var u=Fr(n,i),a=e[u];e[u]=e[n],e[n]=a}return e.length=t,e}var Mi,Di,Li=(Mi=Mu(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,function(e,n,r,o){t.push(r?o.replace(fe,"$1"):n||e)}),t},function(e){return 500===Di.size&&Di.clear(),e}),Di=Mi.cache,Mi);function Gi(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ji(e){if(null!=e){try{return Ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Yi(e){if(e instanceof qn)return e.clone();var t=new Bn(e.__wrapped__,e.__chain__);return t.__actions__=Io(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Qi=Vr(function(e,t){return $u(e)?cr(e,gr(t,1,$u,!0)):[]}),Pi=Vr(function(e,t){var n=Hi(t);return $u(n)&&(n=o),$u(e)?cr(e,gr(t,1,$u,!0),ui(n,2)):[]}),Bi=Vr(function(e,t){var n=Hi(t);return $u(n)&&(n=o),$u(e)?cr(e,gr(t,1,$u,!0),o,n):[]});function qi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:da(n);return o<0&&(o=_n(r+o,0)),Yt(e,ui(t,3),o)}function Wi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return n!==o&&(i=da(n),i=n<0?_n(r+i,0):yn(i,r-1)),Yt(e,ui(t,3),i,!0)}function Ui(e){return null!=e&&e.length?gr(e,1):[]}function Fi(e){return e&&e.length?e[0]:o}var $i=Vr(function(e){var t=St(e,go);return t.length&&t[0]===e[0]?Ir(t):[]}),Vi=Vr(function(e){var t=Hi(e),n=St(e,go);return t===Hi(n)?t=o:n.pop(),n.length&&n[0]===e[0]?Ir(n,ui(t,2)):[]}),zi=Vr(function(e){var t=Hi(e),n=St(e,go);return(t="function"==typeof t?t:o)&&n.pop(),n.length&&n[0]===e[0]?Ir(n,o,t):[]});function Hi(e){var t=null==e?0:e.length;return t?e[t-1]:o}var Ki=Vr(Zi);function Zi(e,t){return e&&e.length&&t&&t.length?Wr(e,t):e}var Ji=ei(function(e,t){var n=null==e?0:e.length,r=or(e,t);return Ur(e,St(t,function(e){return _i(e,n)?+e:e}).sort(Ao)),r});function Xi(e){return null==e?e:bn.call(e)}var eu=Vr(function(e){return ao(gr(e,1,$u,!0))}),tu=Vr(function(e){var t=Hi(e);return $u(t)&&(t=o),ao(gr(e,1,$u,!0),ui(t,2))}),nu=Vr(function(e){var t=Hi(e);return t="function"==typeof t?t:o,ao(gr(e,1,$u,!0),o,t)});function ru(e){if(!e||!e.length)return[];var t=0;return e=Et(e,function(e){if($u(e))return t=_n(e.length,t),!0}),Vt(t,function(t){return St(e,Wt(t))})}function ou(e,t){if(!e||!e.length)return[];var n=ru(e);return null==t?n:St(n,function(e){return Ot(t,o,e)})}var iu=Vr(function(e,t){return $u(e)?cr(e,t):[]}),uu=Vr(function(e){return po(Et(e,$u))}),au=Vr(function(e){var t=Hi(e);return $u(t)&&(t=o),po(Et(e,$u),ui(t,2))}),su=Vr(function(e){var t=Hi(e);return t="function"==typeof t?t:o,po(Et(e,$u),o,t)}),cu=Vr(ru),fu=Vr(function(e){var t=e.length,n=t>1?e[t-1]:o;return n="function"==typeof n?(e.pop(),n):o,ou(e,n)});function lu(e){var t=Yn(e);return t.__chain__=!0,t}function pu(e,t){return t(e)}var du=ei(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return or(t,e)};return!(t>1||this.__actions__.length)&&r instanceof qn&&_i(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:pu,args:[i],thisArg:o}),new Bn(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(o),e})):this.thru(i)}),hu=Ro(function(e,t,n){Me.call(e,n)?++e[n]:rr(e,n,1)}),gu=Go(qi),_u=Go(Wi);function yu(e,t){return(Wu(e)?Ct:fr)(e,ui(t,3))}function vu(e,t){return(Wu(e)?wt:lr)(e,ui(t,3))}var mu=Ro(function(e,t,n){Me.call(e,n)?e[n].push(t):rr(e,n,[t])}),ku=Vr(function(e,t,n){var o=-1,i="function"==typeof t,u=Fu(e)?r(e.length):[];return fr(e,function(e){u[++o]=i?Ot(t,e,n):Er(e,t,n)}),u}),bu=Ro(function(e,t,n){rr(e,n,t)});function Tu(e,t){return(Wu(e)?St:Gr)(e,ui(t,3))}var Ou=Ro(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),Au=Vr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&yi(e,t[0],t[1])?t=[]:n>2&&yi(t[0],t[1],t[2])&&(t=[t[0]]),Br(e,gr(t,1),[])}),Cu=ct||function(){return lt.Date.now()};function wu(e,t,n){return t=n?o:t,t=e&&null==t?e.length:t,Ho(e,c,o,o,o,o,t)}function Iu(e,t){var n;if("function"!=typeof t)throw new Ie(i);return e=da(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=o),n}}var Eu=Vr(function(e,t,n){var r=1;if(n.length){var o=an(n,ii(Eu));r|=s}return Ho(e,r,t,n,o)}),Ru=Vr(function(e,t,n){var r=3;if(n.length){var o=an(n,ii(Ru));r|=s}return Ho(t,r,e,n,o)});function xu(e,t,n){var r,u,a,s,c,f,l=0,p=!1,d=!1,h=!0;if("function"!=typeof e)throw new Ie(i);function g(t){var n=r,i=u;return r=u=o,l=t,s=e.apply(i,n)}function _(e){var n=e-f;return f===o||n>=t||n<0||d&&e-l>=a}function y(){var e=Cu();if(_(e))return v(e);c=Ei(y,function(e){var n=t-(e-f);return d?yn(n,a-(e-l)):n}(e))}function v(e){return c=o,h&&r?g(e):(r=u=o,s)}function m(){var e=Cu(),n=_(e);if(r=arguments,u=this,f=e,n){if(c===o)return function(e){return l=e,c=Ei(y,t),p?g(e):s}(f);if(d)return ko(c),c=Ei(y,t),g(f)}return c===o&&(c=Ei(y,t)),s}return t=ga(t)||0,Xu(n)&&(p=!!n.leading,a=(d="maxWait"in n)?_n(ga(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),m.cancel=function(){c!==o&&ko(c),l=0,r=f=u=c=o},m.flush=function(){return c===o?s:v(Cu())},m}var Su=Vr(function(e,t){return sr(e,1,t)}),Nu=Vr(function(e,t,n){return sr(e,ga(t)||0,n)});function Mu(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(i);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 u=e.apply(this,r);return n.cache=i.set(o,u)||i,u};return n.cache=new(Mu.Cache||Fn),n}function Du(e){if("function"!=typeof e)throw new Ie(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Mu.Cache=Fn;var Lu=vo(function(e,t){var n=(t=1==t.length&&Wu(t[0])?St(t[0],Ht(ui())):St(gr(t,1),Ht(ui()))).length;return Vr(function(r){for(var o=-1,i=yn(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return Ot(e,this,r)})}),Gu=Vr(function(e,t){var n=an(t,ii(Gu));return Ho(e,s,o,t,n)}),ju=Vr(function(e,t){var n=an(t,ii(ju));return Ho(e,64,o,t,n)}),Yu=ei(function(e,t){return Ho(e,256,o,o,o,t)});function Qu(e,t){return e===t||e!=e&&t!=t}var Pu=Uo(Ar),Bu=Uo(function(e,t){return e>=t}),qu=Rr(function(){return arguments}())?Rr:function(e){return ea(e)&&Me.call(e,"callee")&&!$e.call(e,"callee")},Wu=r.isArray,Uu=yt?Ht(yt):function(e){return ea(e)&&Or(e)==S};function Fu(e){return null!=e&&Ju(e.length)&&!Ku(e)}function $u(e){return ea(e)&&Fu(e)}var Vu=_t||gs,zu=vt?Ht(vt):function(e){return ea(e)&&Or(e)==v};function Hu(e){if(!ea(e))return!1;var t=Or(e);return t==m||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function Ku(e){if(!Xu(e))return!1;var t=Or(e);return t==k||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zu(e){return"number"==typeof e&&e==da(e)}function Ju(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=l}function Xu(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=mt?Ht(mt):function(e){return ea(e)&&pi(e)==T};function na(e){return"number"==typeof e||ea(e)&&Or(e)==O}function ra(e){if(!ea(e)||Or(e)!=A)return!1;var t=Ue(e);if(null===t)return!0;var n=Me.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==je}var oa=kt?Ht(kt):function(e){return ea(e)&&Or(e)==w},ia=bt?Ht(bt):function(e){return ea(e)&&pi(e)==I};function ua(e){return"string"==typeof e||!Wu(e)&&ea(e)&&Or(e)==E}function aa(e){return"symbol"==typeof e||ea(e)&&Or(e)==R}var sa=Tt?Ht(Tt):function(e){return ea(e)&&Ju(e.length)&&!!ot[Or(e)]},ca=Uo(Lr),fa=Uo(function(e,t){return e<=t});function la(e){if(!e)return[];if(Fu(e))return ua(e)?ln(e):Io(e);if(He&&e[He])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[He]());var t=pi(e);return(t==T?on:t==I?sn:Qa)(e)}function pa(e){return e?(e=ga(e))===f||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function da(e){var t=pa(e),n=t%1;return t==t?n?t-n:t:0}function ha(e){return e?ir(da(e),0,d):0}function ga(e){if("number"==typeof e)return e;if(aa(e))return p;if(Xu(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Xu(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=zt(e);var n=he.test(e);return n||_e.test(e)?st(e.slice(2),n?2:8):de.test(e)?p:+e}function _a(e){return Eo(e,Sa(e))}function ya(e){return null==e?"":uo(e)}var va=xo(function(e,t){if(bi(t)||Fu(t))Eo(t,xa(t),e);else for(var n in t)Me.call(t,n)&&Xn(e,n,t[n])}),ma=xo(function(e,t){Eo(t,Sa(t),e)}),ka=xo(function(e,t,n,r){Eo(t,Sa(t),e,r)}),ba=xo(function(e,t,n,r){Eo(t,xa(t),e,r)}),Ta=ei(or),Oa=Vr(function(e,t){e=Ae(e);var n=-1,r=t.length,i=r>2?t[2]:o;for(i&&yi(t[0],t[1],i)&&(r=1);++n<r;)for(var u=t[n],a=Sa(u),s=-1,c=a.length;++s<c;){var f=a[s],l=e[f];(l===o||Qu(l,xe[f])&&!Me.call(e,f))&&(e[f]=u[f])}return e}),Aa=Vr(function(e){return e.push(o,Zo),Ot(Ma,o,e)});function Ca(e,t,n){var r=null==e?o:br(e,t);return r===o?n:r}function wa(e,t){return null!=e&&di(e,t,wr)}var Ia=Qo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ge.call(t)),e[t]=n},Xa(ns)),Ea=Qo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ge.call(t)),Me.call(e,t)?e[t].push(n):e[t]=[n]},ui),Ra=Vr(Er);function xa(e){return Fu(e)?zn(e):Dr(e)}function Sa(e){return Fu(e)?zn(e,!0):function(e){if(!Xu(e))return function(e){var t=[];if(null!=e)for(var n in Ae(e))t.push(n);return t}(e);var t=bi(e),n=[];for(var r in e)("constructor"!=r||!t&&Me.call(e,r))&&n.push(r);return n}(e)}var Na=xo(function(e,t,n){Qr(e,t,n)}),Ma=xo(function(e,t,n,r){Qr(e,t,n,r)}),Da=ei(function(e,t){var n={};if(null==e)return n;var r=!1;t=St(t,function(t){return t=yo(t,e),r||(r=t.length>1),t}),Eo(e,ni(e),n),r&&(n=ur(n,7,Jo));for(var o=t.length;o--;)so(n,t[o]);return n}),La=ei(function(e,t){return null==e?{}:function(e,t){return qr(e,t,function(t,n){return wa(e,n)})}(e,t)});function Ga(e,t){if(null==e)return{};var n=St(ni(e),function(e){return[e]});return t=ui(t),qr(e,n,function(e,n){return t(e,n[0])})}var ja=zo(xa),Ya=zo(Sa);function Qa(e){return null==e?[]:Kt(e,xa(e))}var Pa=Do(function(e,t,n){return t=t.toLowerCase(),e+(n?Ba(t):t)});function Ba(e){return Ha(ya(e).toLowerCase())}function qa(e){return(e=ya(e))&&e.replace(ve,en).replace(Ze,"")}var Wa=Do(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ua=Do(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fa=Mo("toLowerCase"),$a=Do(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Va=Do(function(e,t,n){return e+(n?" ":"")+Ha(t)}),za=Do(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ha=Mo("toUpperCase");function Ka(e,t,n){return e=ya(e),(t=n?o:t)===o?function(e){return tt.test(e)}(e)?function(e){return e.match(Xe)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Za=Vr(function(e,t){try{return Ot(e,o,t)}catch(e){return Hu(e)?e:new be(e)}}),Ja=ei(function(e,t){return Ct(t,function(t){t=Gi(t),rr(e,t,Eu(e[t],e))}),e});function Xa(e){return function(){return e}}var es=jo(),ts=jo(!0);function ns(e){return e}function rs(e){return Mr("function"==typeof e?e:ur(e,1))}var os=Vr(function(e,t){return function(n){return Er(n,e,t)}}),is=Vr(function(e,t){return function(n){return Er(e,n,t)}});function us(e,t,n){var r=xa(t),o=kr(t,r);null!=n||Xu(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=kr(t,xa(t)));var i=!(Xu(n)&&"chain"in n&&!n.chain),u=Ku(e);return Ct(o,function(n){var r=t[n];e[n]=r,u&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__);return(n.__actions__=Io(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Nt([this.value()],arguments))})}),e}function as(){}var ss=Bo(St),cs=Bo(It),fs=Bo(Lt);function ls(e){return vi(e)?Wt(Gi(e)):function(e){return function(t){return br(t,e)}}(e)}var ps=Wo(),ds=Wo(!0);function hs(){return[]}function gs(){return!1}var _s,ys=Po(function(e,t){return e+t},0),vs=$o("ceil"),ms=Po(function(e,t){return e/t},1),ks=$o("floor"),bs=Po(function(e,t){return e*t},1),Ts=$o("round"),Os=Po(function(e,t){return e-t},0);return Yn.after=function(e,t){if("function"!=typeof t)throw new Ie(i);return e=da(e),function(){if(--e<1)return t.apply(this,arguments)}},Yn.ary=wu,Yn.assign=va,Yn.assignIn=ma,Yn.assignInWith=ka,Yn.assignWith=ba,Yn.at=Ta,Yn.before=Iu,Yn.bind=Eu,Yn.bindAll=Ja,Yn.bindKey=Ru,Yn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Wu(e)?e:[e]},Yn.chain=lu,Yn.chunk=function(e,t,n){t=(n?yi(e,t,n):t===o)?1:_n(da(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var u=0,a=0,s=r(pt(i/t));u<i;)s[a++]=eo(e,u,u+=t);return s},Yn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Yn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return Nt(Wu(n)?Io(n):[n],gr(t,1))},Yn.cond=function(e){var t=null==e?0:e.length,n=ui();return e=t?St(e,function(e){if("function"!=typeof e[1])throw new Ie(i);return[n(e[0]),e[1]]}):[],Vr(function(n){for(var r=-1;++r<t;){var o=e[r];if(Ot(o[0],this,n))return Ot(o[1],this,n)}})},Yn.conforms=function(e){return function(e){var t=xa(e);return function(n){return ar(n,e,t)}}(ur(e,1))},Yn.constant=Xa,Yn.countBy=hu,Yn.create=function(e,t){var n=Qn(e);return null==t?n:nr(n,t)},Yn.curry=function e(t,n,r){var i=Ho(t,8,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Yn.curryRight=function e(t,n,r){var i=Ho(t,16,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Yn.debounce=xu,Yn.defaults=Oa,Yn.defaultsDeep=Aa,Yn.defer=Su,Yn.delay=Nu,Yn.difference=Qi,Yn.differenceBy=Pi,Yn.differenceWith=Bi,Yn.drop=function(e,t,n){var r=null==e?0:e.length;return r?eo(e,(t=n||t===o?1:da(t))<0?0:t,r):[]},Yn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?eo(e,0,(t=r-(t=n||t===o?1:da(t)))<0?0:t):[]},Yn.dropRightWhile=function(e,t){return e&&e.length?fo(e,ui(t,3),!0,!0):[]},Yn.dropWhile=function(e,t){return e&&e.length?fo(e,ui(t,3),!0):[]},Yn.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&yi(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=da(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:da(r))<0&&(r+=i),r=n>r?0:ha(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Yn.filter=function(e,t){return(Wu(e)?Et:hr)(e,ui(t,3))},Yn.flatMap=function(e,t){return gr(Tu(e,t),1)},Yn.flatMapDeep=function(e,t){return gr(Tu(e,t),f)},Yn.flatMapDepth=function(e,t,n){return n=n===o?1:da(n),gr(Tu(e,t),n)},Yn.flatten=Ui,Yn.flattenDeep=function(e){return null!=e&&e.length?gr(e,f):[]},Yn.flattenDepth=function(e,t){return null!=e&&e.length?gr(e,t=t===o?1:da(t)):[]},Yn.flip=function(e){return Ho(e,512)},Yn.flow=es,Yn.flowRight=ts,Yn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];rr(r,o[0],o[1])}return r},Yn.functions=function(e){return null==e?[]:kr(e,xa(e))},Yn.functionsIn=function(e){return null==e?[]:kr(e,Sa(e))},Yn.groupBy=mu,Yn.initial=function(e){return null!=e&&e.length?eo(e,0,-1):[]},Yn.intersection=$i,Yn.intersectionBy=Vi,Yn.intersectionWith=zi,Yn.invert=Ia,Yn.invertBy=Ea,Yn.invokeMap=ku,Yn.iteratee=rs,Yn.keyBy=bu,Yn.keys=xa,Yn.keysIn=Sa,Yn.map=Tu,Yn.mapKeys=function(e,t){var n={};return t=ui(t,3),vr(e,function(e,r,o){rr(n,t(e,r,o),e)}),n},Yn.mapValues=function(e,t){var n={};return t=ui(t,3),vr(e,function(e,r,o){rr(n,r,t(e,r,o))}),n},Yn.matches=function(e){return jr(ur(e,1))},Yn.matchesProperty=function(e,t){return Yr(e,ur(t,1))},Yn.memoize=Mu,Yn.merge=Na,Yn.mergeWith=Ma,Yn.method=os,Yn.methodOf=is,Yn.mixin=us,Yn.negate=Du,Yn.nthArg=function(e){return e=da(e),Vr(function(t){return Pr(t,e)})},Yn.omit=Da,Yn.omitBy=function(e,t){return Ga(e,Du(ui(t)))},Yn.once=function(e){return Iu(2,e)},Yn.orderBy=function(e,t,n,r){return null==e?[]:(Wu(t)||(t=null==t?[]:[t]),Wu(n=r?o:n)||(n=null==n?[]:[n]),Br(e,t,n))},Yn.over=ss,Yn.overArgs=Lu,Yn.overEvery=cs,Yn.overSome=fs,Yn.partial=Gu,Yn.partialRight=ju,Yn.partition=Ou,Yn.pick=La,Yn.pickBy=Ga,Yn.property=ls,Yn.propertyOf=function(e){return function(t){return null==e?o:br(e,t)}},Yn.pull=Ki,Yn.pullAll=Zi,Yn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Wr(e,t,ui(n,2)):e},Yn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Wr(e,t,o,n):e},Yn.pullAt=Ji,Yn.range=ps,Yn.rangeRight=ds,Yn.rearg=Yu,Yn.reject=function(e,t){return(Wu(e)?Et:hr)(e,Du(ui(t,3)))},Yn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=ui(t,3);++r<i;){var u=e[r];t(u,r,e)&&(n.push(u),o.push(r))}return Ur(e,o),n},Yn.rest=function(e,t){if("function"!=typeof e)throw new Ie(i);return Vr(e,t=t===o?t:da(t))},Yn.reverse=Xi,Yn.sampleSize=function(e,t,n){return t=(n?yi(e,t,n):t===o)?1:da(t),(Wu(e)?Kn:Hr)(e,t)},Yn.set=function(e,t,n){return null==e?e:Kr(e,t,n)},Yn.setWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:Kr(e,t,n,r)},Yn.shuffle=function(e){return(Wu(e)?Zn:Xr)(e)},Yn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&yi(e,t,n)?(t=0,n=r):(t=null==t?0:da(t),n=n===o?r:da(n)),eo(e,t,n)):[]},Yn.sortBy=Au,Yn.sortedUniq=function(e){return e&&e.length?oo(e):[]},Yn.sortedUniqBy=function(e,t){return e&&e.length?oo(e,ui(t,2)):[]},Yn.split=function(e,t,n){return n&&"number"!=typeof n&&yi(e,t,n)&&(t=n=o),(n=n===o?d:n>>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!oa(t))&&!(t=uo(t))&&rn(e)?mo(ln(e),0,n):e.split(t,n):[]},Yn.spread=function(e,t){if("function"!=typeof e)throw new Ie(i);return t=null==t?0:_n(da(t),0),Vr(function(n){var r=n[t],o=mo(n,0,t);return r&&Nt(o,r),Ot(e,this,o)})},Yn.tail=function(e){var t=null==e?0:e.length;return t?eo(e,1,t):[]},Yn.take=function(e,t,n){return e&&e.length?eo(e,0,(t=n||t===o?1:da(t))<0?0:t):[]},Yn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?eo(e,(t=r-(t=n||t===o?1:da(t)))<0?0:t,r):[]},Yn.takeRightWhile=function(e,t){return e&&e.length?fo(e,ui(t,3),!1,!0):[]},Yn.takeWhile=function(e,t){return e&&e.length?fo(e,ui(t,3)):[]},Yn.tap=function(e,t){return t(e),e},Yn.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new Ie(i);return Xu(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),xu(e,t,{leading:r,maxWait:t,trailing:o})},Yn.thru=pu,Yn.toArray=la,Yn.toPairs=ja,Yn.toPairsIn=Ya,Yn.toPath=function(e){return Wu(e)?St(e,Gi):aa(e)?[e]:Io(Li(ya(e)))},Yn.toPlainObject=_a,Yn.transform=function(e,t,n){var r=Wu(e),o=r||Vu(e)||sa(e);if(t=ui(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:Xu(e)&&Ku(i)?Qn(Ue(e)):{}}return(o?Ct:vr)(e,function(e,r,o){return t(n,e,r,o)}),n},Yn.unary=function(e){return wu(e,1)},Yn.union=eu,Yn.unionBy=tu,Yn.unionWith=nu,Yn.uniq=function(e){return e&&e.length?ao(e):[]},Yn.uniqBy=function(e,t){return e&&e.length?ao(e,ui(t,2)):[]},Yn.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?ao(e,o,t):[]},Yn.unset=function(e,t){return null==e||so(e,t)},Yn.unzip=ru,Yn.unzipWith=ou,Yn.update=function(e,t,n){return null==e?e:co(e,t,_o(n))},Yn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:co(e,t,_o(n),r)},Yn.values=Qa,Yn.valuesIn=function(e){return null==e?[]:Kt(e,Sa(e))},Yn.without=iu,Yn.words=Ka,Yn.wrap=function(e,t){return Gu(_o(t),e)},Yn.xor=uu,Yn.xorBy=au,Yn.xorWith=su,Yn.zip=cu,Yn.zipObject=function(e,t){return ho(e||[],t||[],Xn)},Yn.zipObjectDeep=function(e,t){return ho(e||[],t||[],Kr)},Yn.zipWith=fu,Yn.entries=ja,Yn.entriesIn=Ya,Yn.extend=ma,Yn.extendWith=ka,us(Yn,Yn),Yn.add=ys,Yn.attempt=Za,Yn.camelCase=Pa,Yn.capitalize=Ba,Yn.ceil=vs,Yn.clamp=function(e,t,n){return n===o&&(n=t,t=o),n!==o&&(n=(n=ga(n))==n?n:0),t!==o&&(t=(t=ga(t))==t?t:0),ir(ga(e),t,n)},Yn.clone=function(e){return ur(e,4)},Yn.cloneDeep=function(e){return ur(e,5)},Yn.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:o)},Yn.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:o)},Yn.conformsTo=function(e,t){return null==t||ar(e,t,xa(t))},Yn.deburr=qa,Yn.defaultTo=function(e,t){return null==e||e!=e?t:e},Yn.divide=ms,Yn.endsWith=function(e,t,n){e=ya(e),t=uo(t);var r=e.length,i=n=n===o?r:ir(da(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Yn.eq=Qu,Yn.escape=function(e){return(e=ya(e))&&z.test(e)?e.replace($,tn):e},Yn.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Yn.every=function(e,t,n){var r=Wu(e)?It:pr;return n&&yi(e,t,n)&&(t=o),r(e,ui(t,3))},Yn.find=gu,Yn.findIndex=qi,Yn.findKey=function(e,t){return jt(e,ui(t,3),vr)},Yn.findLast=_u,Yn.findLastIndex=Wi,Yn.findLastKey=function(e,t){return jt(e,ui(t,3),mr)},Yn.floor=ks,Yn.forEach=yu,Yn.forEachRight=vu,Yn.forIn=function(e,t){return null==e?e:_r(e,ui(t,3),Sa)},Yn.forInRight=function(e,t){return null==e?e:yr(e,ui(t,3),Sa)},Yn.forOwn=function(e,t){return e&&vr(e,ui(t,3))},Yn.forOwnRight=function(e,t){return e&&mr(e,ui(t,3))},Yn.get=Ca,Yn.gt=Pu,Yn.gte=Bu,Yn.has=function(e,t){return null!=e&&di(e,t,Cr)},Yn.hasIn=wa,Yn.head=Fi,Yn.identity=ns,Yn.includes=function(e,t,n,r){e=Fu(e)?e:Qa(e),n=n&&!r?da(n):0;var o=e.length;return n<0&&(n=_n(o+n,0)),ua(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Qt(e,t,n)>-1},Yn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:da(n);return o<0&&(o=_n(r+o,0)),Qt(e,t,o)},Yn.inRange=function(e,t,n){return t=pa(t),n===o?(n=t,t=0):n=pa(n),function(e,t,n){return e>=yn(t,n)&&e<_n(t,n)}(e=ga(e),t,n)},Yn.invoke=Ra,Yn.isArguments=qu,Yn.isArray=Wu,Yn.isArrayBuffer=Uu,Yn.isArrayLike=Fu,Yn.isArrayLikeObject=$u,Yn.isBoolean=function(e){return!0===e||!1===e||ea(e)&&Or(e)==y},Yn.isBuffer=Vu,Yn.isDate=zu,Yn.isElement=function(e){return ea(e)&&1===e.nodeType&&!ra(e)},Yn.isEmpty=function(e){if(null==e)return!0;if(Fu(e)&&(Wu(e)||"string"==typeof e||"function"==typeof e.splice||Vu(e)||sa(e)||qu(e)))return!e.length;var t=pi(e);if(t==T||t==I)return!e.size;if(bi(e))return!Dr(e).length;for(var n in e)if(Me.call(e,n))return!1;return!0},Yn.isEqual=function(e,t){return xr(e,t)},Yn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:o)?n(e,t):o;return r===o?xr(e,t,o,n):!!r},Yn.isError=Hu,Yn.isFinite=function(e){return"number"==typeof e&&Gt(e)},Yn.isFunction=Ku,Yn.isInteger=Zu,Yn.isLength=Ju,Yn.isMap=ta,Yn.isMatch=function(e,t){return e===t||Sr(e,t,si(t))},Yn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:o,Sr(e,t,si(t),n)},Yn.isNaN=function(e){return na(e)&&e!=+e},Yn.isNative=function(e){if(ki(e))throw new be("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Nr(e)},Yn.isNil=function(e){return null==e},Yn.isNull=function(e){return null===e},Yn.isNumber=na,Yn.isObject=Xu,Yn.isObjectLike=ea,Yn.isPlainObject=ra,Yn.isRegExp=oa,Yn.isSafeInteger=function(e){return Zu(e)&&e>=-9007199254740991&&e<=l},Yn.isSet=ia,Yn.isString=ua,Yn.isSymbol=aa,Yn.isTypedArray=sa,Yn.isUndefined=function(e){return e===o},Yn.isWeakMap=function(e){return ea(e)&&pi(e)==x},Yn.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==Or(e)},Yn.join=function(e,t){return null==e?"":Ut.call(e,t)},Yn.kebabCase=Wa,Yn.last=Hi,Yn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=da(n))<0?_n(r+i,0):yn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Yt(e,Bt,i,!0)},Yn.lowerCase=Ua,Yn.lowerFirst=Fa,Yn.lt=ca,Yn.lte=fa,Yn.max=function(e){return e&&e.length?dr(e,ns,Ar):o},Yn.maxBy=function(e,t){return e&&e.length?dr(e,ui(t,2),Ar):o},Yn.mean=function(e){return qt(e,ns)},Yn.meanBy=function(e,t){return qt(e,ui(t,2))},Yn.min=function(e){return e&&e.length?dr(e,ns,Lr):o},Yn.minBy=function(e,t){return e&&e.length?dr(e,ui(t,2),Lr):o},Yn.stubArray=hs,Yn.stubFalse=gs,Yn.stubObject=function(){return{}},Yn.stubString=function(){return""},Yn.stubTrue=function(){return!0},Yn.multiply=bs,Yn.nth=function(e,t){return e&&e.length?Pr(e,da(t)):o},Yn.noConflict=function(){return lt._===this&&(lt._=Ye),this},Yn.noop=as,Yn.now=Cu,Yn.pad=function(e,t,n){e=ya(e);var r=(t=da(t))?fn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return qo(dt(o),n)+e+qo(pt(o),n)},Yn.padEnd=function(e,t,n){e=ya(e);var r=(t=da(t))?fn(e):0;return t&&r<t?e+qo(t-r,n):e},Yn.padStart=function(e,t,n){e=ya(e);var r=(t=da(t))?fn(e):0;return t&&r<t?qo(t-r,n)+e:e},Yn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),mn(ya(e).replace(re,""),t||0)},Yn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&yi(e,t,n)&&(t=n=o),n===o&&("boolean"==typeof t?(n=t,t=o):"boolean"==typeof e&&(n=e,e=o)),e===o&&t===o?(e=0,t=1):(e=pa(e),t===o?(t=e,e=0):t=pa(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=kn();return yn(e+i*(t-e+at("1e-"+((i+"").length-1))),t)}return Fr(e,t)},Yn.reduce=function(e,t,n){var r=Wu(e)?Mt:Ft,o=arguments.length<3;return r(e,ui(t,4),n,o,fr)},Yn.reduceRight=function(e,t,n){var r=Wu(e)?Dt:Ft,o=arguments.length<3;return r(e,ui(t,4),n,o,lr)},Yn.repeat=function(e,t,n){return t=(n?yi(e,t,n):t===o)?1:da(t),$r(ya(e),t)},Yn.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Yn.result=function(e,t,n){var r=-1,i=(t=yo(t,e)).length;for(i||(i=1,e=o);++r<i;){var u=null==e?o:e[Gi(t[r])];u===o&&(r=i,u=n),e=Ku(u)?u.call(e):u}return e},Yn.round=Ts,Yn.runInContext=e,Yn.sample=function(e){return(Wu(e)?Hn:zr)(e)},Yn.size=function(e){if(null==e)return 0;if(Fu(e))return ua(e)?fn(e):e.length;var t=pi(e);return t==T||t==I?e.size:Dr(e).length},Yn.snakeCase=$a,Yn.some=function(e,t,n){var r=Wu(e)?Lt:to;return n&&yi(e,t,n)&&(t=o),r(e,ui(t,3))},Yn.sortedIndex=function(e,t){return no(e,t)},Yn.sortedIndexBy=function(e,t,n){return ro(e,t,ui(n,2))},Yn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=no(e,t);if(r<n&&Qu(e[r],t))return r}return-1},Yn.sortedLastIndex=function(e,t){return no(e,t,!0)},Yn.sortedLastIndexBy=function(e,t,n){return ro(e,t,ui(n,2),!0)},Yn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=no(e,t,!0)-1;if(Qu(e[n],t))return n}return-1},Yn.startCase=Va,Yn.startsWith=function(e,t,n){return e=ya(e),n=null==n?0:ir(da(n),0,e.length),t=uo(t),e.slice(n,n+t.length)==t},Yn.subtract=Os,Yn.sum=function(e){return e&&e.length?$t(e,ns):0},Yn.sumBy=function(e,t){return e&&e.length?$t(e,ui(t,2)):0},Yn.template=function(e,t,n){var r=Yn.templateSettings;n&&yi(e,t,n)&&(t=o),e=ya(e),t=ba({},t,r,Ko);var i=ba({},t.imports,r.imports,Ko),u=xa(i),a=Kt(i,u);Ct(u,function(e){if(ce.test(e))throw new be("Invalid `imports` option passed into `_.template`")});var s,c,f=0,l=t.interpolate||me,p="__p += '",d=Ce((t.escape||me).source+"|"+l.source+"|"+(l===Z?le:me).source+"|"+(t.evaluate||me).source+"|$","g"),h="//# sourceURL="+(Me.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(d,function(t,n,r,o,i,u){return r||(r=o),p+=e.slice(f,u).replace(ke,nn),n&&(s=!0,p+="' +\n__e("+n+") +\n'"),i&&(c=!0,p+="';\n"+i+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=u+t.length,t}),p+="';\n";var g=Me.call(t,"variable")&&t.variable;if(g){if(ce.test(g))throw new be("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(c?p.replace(q,""):p).replace(W,"$1").replace(U,"$1;"),p="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var _=Za(function(){return Te(u,h+"return "+p).apply(o,a)});if(_.source=p,Hu(_))throw _;return _},Yn.times=function(e,t){if((e=da(e))<1||e>l)return[];var n=d,r=yn(e,d);t=ui(t),e-=d;for(var o=Vt(r,t);++n<e;)t(n);return o},Yn.toFinite=pa,Yn.toInteger=da,Yn.toLength=ha,Yn.toLower=function(e){return ya(e).toLowerCase()},Yn.toNumber=ga,Yn.toSafeInteger=function(e){return e?ir(da(e),-9007199254740991,l):0===e?e:0},Yn.toString=ya,Yn.toUpper=function(e){return ya(e).toUpperCase()},Yn.trim=function(e,t,n){if((e=ya(e))&&(n||t===o))return zt(e);if(!e||!(t=uo(t)))return e;var r=ln(e),i=ln(t);return mo(r,Jt(r,i),Xt(r,i)+1).join("")},Yn.trimEnd=function(e,t,n){if((e=ya(e))&&(n||t===o))return e.slice(0,pn(e)+1);if(!e||!(t=uo(t)))return e;var r=ln(e);return mo(r,0,Xt(r,ln(t))+1).join("")},Yn.trimStart=function(e,t,n){if((e=ya(e))&&(n||t===o))return e.replace(re,"");if(!e||!(t=uo(t)))return e;var r=ln(e);return mo(r,Jt(r,ln(t))).join("")},Yn.truncate=function(e,t){var n=30,r="...";if(Xu(t)){var i="separator"in t?t.separator:i;n="length"in t?da(t.length):n,r="omission"in t?uo(t.omission):r}var u=(e=ya(e)).length;if(rn(e)){var a=ln(e);u=a.length}if(n>=u)return e;var s=n-fn(r);if(s<1)return r;var c=a?mo(a,0,s).join(""):e.slice(0,s);if(i===o)return c+r;if(a&&(s+=c.length-s),oa(i)){if(e.slice(s).search(i)){var f,l=c;for(i.global||(i=Ce(i.source,ya(pe.exec(i))+"g")),i.lastIndex=0;f=i.exec(l);)var p=f.index;c=c.slice(0,p===o?s:p)}}else if(e.indexOf(uo(i),s)!=s){var d=c.lastIndexOf(i);d>-1&&(c=c.slice(0,d))}return c+r},Yn.unescape=function(e){return(e=ya(e))&&V.test(e)?e.replace(F,dn):e},Yn.uniqueId=function(e){var t=++De;return ya(e)+t},Yn.upperCase=za,Yn.upperFirst=Ha,Yn.each=yu,Yn.eachRight=vu,Yn.first=Fi,us(Yn,(_s={},vr(Yn,function(e,t){Me.call(Yn.prototype,t)||(_s[t]=e)}),_s),{chain:!1}),Yn.VERSION="4.18.1",Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Yn[e].placeholder=Yn}),Ct(["drop","take"],function(e,t){qn.prototype[e]=function(n){n=n===o?1:_n(da(n),0);var r=this.__filtered__&&!t?new qn(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,d),type:e+(r.__dir__<0?"Right":"")}),r},qn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Ct(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;qn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ui(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),Ct(["head","last"],function(e,t){var n="take"+(t?"Right":"");qn.prototype[e]=function(){return this[n](1).value()[0]}}),Ct(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");qn.prototype[e]=function(){return this.__filtered__?new qn(this):this[n](1)}}),qn.prototype.compact=function(){return this.filter(ns)},qn.prototype.find=function(e){return this.filter(e).head()},qn.prototype.findLast=function(e){return this.reverse().find(e)},qn.prototype.invokeMap=Vr(function(e,t){return"function"==typeof e?new qn(this):this.map(function(n){return Er(n,e,t)})}),qn.prototype.reject=function(e){return this.filter(Du(ui(e)))},qn.prototype.slice=function(e,t){e=da(e);var n=this;return n.__filtered__&&(e>0||t<0)?new qn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(n=(t=da(t))<0?n.dropRight(-t):n.take(t-e)),n)},qn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},qn.prototype.toArray=function(){return this.take(d)},vr(qn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Yn[r?"take"+("last"==t?"Right":""):t],u=r||/^find/.test(t);i&&(Yn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,s=t instanceof qn,c=a[0],f=s||Wu(t),l=function(e){var t=i.apply(Yn,Nt([e],a));return r&&p?t[0]:t};f&&n&&"function"==typeof c&&1!=c.length&&(s=f=!1);var p=this.__chain__,d=!!this.__actions__.length,h=u&&!p,g=s&&!d;if(!u&&f){t=g?t:new qn(this);var _=e.apply(t,a);return _.__actions__.push({func:pu,args:[l],thisArg:o}),new Bn(_,p)}return h&&g?e.apply(this,a):(_=this.thru(l),h?r?_.value()[0]:_.value():_)})}),Ct(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ee[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Yn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Wu(o)?o:[],e)}return this[n](function(n){return t.apply(Wu(n)?n:[],e)})}}),vr(qn.prototype,function(e,t){var n=Yn[t];if(n){var r=n.name+"";Me.call(Rn,r)||(Rn[r]=[]),Rn[r].push({name:t,func:n})}}),Rn[Yo(o,2).name]=[{name:"wrapper",func:o}],qn.prototype.clone=function(){var e=new qn(this.__wrapped__);return e.__actions__=Io(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Io(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Io(this.__views__),e},qn.prototype.reverse=function(){if(this.__filtered__){var e=new qn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},qn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Wu(e),r=t<0,o=n?e.length:0,i=function(e,t,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],u=i.size;switch(i.type){case"drop":e+=u;break;case"dropRight":t-=u;break;case"take":t=yn(t,e+u);break;case"takeRight":e=_n(e,t-u)}}return{start:e,end:t}}(0,o,this.__views__),u=i.start,a=i.end,s=a-u,c=r?a:u-1,f=this.__iteratees__,l=f.length,p=0,d=yn(s,this.__takeCount__);if(!n||!r&&o==s&&d==s)return lo(e,this.__actions__);var h=[];e:for(;s--&&p<d;){for(var g=-1,_=e[c+=t];++g<l;){var y=f[g],v=y.iteratee,m=y.type,k=v(_);if(2==m)_=k;else if(!k){if(1==m)continue e;break e}}h[p++]=_}return h},Yn.prototype.at=du,Yn.prototype.chain=function(){return lu(this)},Yn.prototype.commit=function(){return new Bn(this.value(),this.__chain__)},Yn.prototype.next=function(){this.__values__===o&&(this.__values__=la(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},Yn.prototype.plant=function(e){for(var t,n=this;n instanceof Pn;){var r=Yi(n);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Yn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof qn){var t=e;return this.__actions__.length&&(t=new qn(this)),(t=t.reverse()).__actions__.push({func:pu,args:[Xi],thisArg:o}),new Bn(t,this.__chain__)}return this.thru(Xi)},Yn.prototype.toJSON=Yn.prototype.valueOf=Yn.prototype.value=function(){return lo(this.__wrapped__,this.__actions__)},Yn.prototype.first=Yn.prototype.head,He&&(Yn.prototype[He]=function(){return this}),Yn}();lt._=hn,(r=function(){return hn}.call(t,n,t,e))===o||(e.exports=r)}.call(this)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};(()=>{"use strict";n.r(r),n.d(r,{ApiCallContext:()=>qe,CronExpression:()=>We,DistributedLockContext:()=>Ue,GraphqlContext:()=>Fe,MUTATION_TYPES:()=>$e,Meta:()=>_,MutationContext:()=>Ve,QueryContext:()=>Ae,SecureAiAgentContext:()=>Be,SquidLlmService:()=>Qe,SquidProject:()=>Pe,SquidService:()=>Ne,USER_CODE_MODULE_ID:()=>z,USER_CODE_PYTHON_MODULE_ID:()=>H,aiFunction:()=>x,aiFunctionsConfigurator:()=>S,clientConnectionStateHandler:()=>U,createWebhookResponse:()=>ze,eventHandler:()=>E,executable:()=>R,getPassiveSquid:()=>Ye,getSquid:()=>je,getSquidService:()=>De,limiterConfigToOptions:()=>$,limits:()=>Y,llmAsk:()=>P,llmService:()=>Q,mcpAuthorizer:()=>W,mcpServer:()=>B,mcpTool:()=>q,metadata:()=>v,onQueueMessage:()=>I,scheduler:()=>M,secureAiAgent:()=>j,secureAiQuery:()=>k,secureApi:()=>C,secureCollection:()=>b,secureDatabase:()=>m,secureDistributedLock:()=>G,secureGraphQL:()=>w,secureMetric:()=>A,secureNativeQuery:()=>L,secureStorage:()=>T,secureTopic:()=>O,squidInject:()=>Le,trigger:()=>N,webhook:()=>D});const e=require("@squidcloud/client");let t=e=>new Error(e);function o(e,n,...r){e||function(e,...n){const r=u(e);if("object"==typeof r)throw r;throw t(r||"Assertion error",...n)}(n,...r)}function i(e,t,...n){return o(e,t,...n),e}function u(e){return void 0===e?"":"string"==typeof e?e:e()}const a=(e,t=void 0)=>{o(function(e){return"string"==typeof e}(e),()=>function(e,t,n){const r=u(e);if("object"==typeof r)throw r;return`${r?`${r}: `:""}${t} ${function(e){return void 0===e?"<undefined>":"symbol"==typeof e?e.toString():null===e?"<null>":`<${typeof e}:${e}>`}(n)}`}(t,"Not a string",e))},s=/^[A-Za-z0-9_-]{1,64}$/;function c(e,t){o(function(e){return s.test(e)}(e),`Invalid @aiFunction id "${e}"${t?` on ${t}`:""}: it must be 1–64 characters of letters, digits, "_" and "-" — the tool-name charset LLM providers accept.`)}function f(e){const t=e.split(":");return o(2===t.length,`Invalid service function name: ${e}`),t[1]}var l=n(243);const p=["gpt-5.4-mini","gpt-5.4-nano","gpt-5.5","gpt-5.5-pro","gpt-4o","gpt-4o-mini","gpt-4.1","gpt-4.1-mini","gpt-4.1-nano","o1","o3","o3-mini","o4-mini","gpt-5","gpt-5-mini","gpt-5-nano","gpt-5.1","gpt-5.2","gpt-5.2-pro","gpt-5.4","claude-haiku-4-5-20251001","claude-opus-4-8","claude-sonnet-5","claude-3-7-sonnet-latest","claude-opus-4-1-20250805","claude-opus-4-20250514","claude-opus-4-5-20251101","claude-opus-4-6","claude-opus-4-7","claude-sonnet-4-20250514","claude-sonnet-4-5-20250929","claude-sonnet-4-6","gemini-3.1-pro","gemini-3.5-flash","gemini-3.1-flash-lite","gemini-2.5-pro","gemini-2.5-flash","gemini-2.5-flash-lite","gemini-3-flash","gemini-3-pro","grok-4.3","grok-4-1-fast-reasoning","grok-4-1-fast-non-reasoning","grok-3","grok-3-fast","grok-3-mini","grok-3-mini-fast","grok-4","grok-4-fast-reasoning","grok-4-fast-non-reasoning","bedrock-claude-sonnet-4-5"];function d(e){return p.includes(e)}const h={"gpt-4o":{name:"gpt-4o",displayName:"GPT-4o",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:16384,contextWindowTokens:128e3,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"gpt-4o-mini":{name:"gpt-4o-mini",displayName:"GPT-4o Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:16384,contextWindowTokens:128e3,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-mini"},"gpt-4.1":{name:"gpt-4.1",displayName:"GPT-4.1",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:32768,contextWindowTokens:1047576,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"gpt-4.1-mini":{name:"gpt-4.1-mini",displayName:"GPT-4.1 Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:32768,contextWindowTokens:1047576,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-mini"},"gpt-4.1-nano":{name:"gpt-4.1-nano",displayName:"GPT-4.1 Nano",description:"Legacy lightweight and quick",providerType:"openai",maxOutputTokens:32768,contextWindowTokens:1047576,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-nano"},o1:{name:"o1",displayName:"GPT-o1",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},o3:{name:"o3",displayName:"GPT-o3",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"o3-mini":{name:"o3-mini",displayName:"GPT-o3 Mini",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"o4-mini":{name:"o4-mini",displayName:"GPT-o4 Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-mini"},"gpt-5":{name:"gpt-5",displayName:"GPT-5",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"gpt-5-mini":{name:"gpt-5-mini",displayName:"GPT-5 Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.4-mini"},"gpt-5-nano":{name:"gpt-5-nano",displayName:"GPT-5 Nano",description:"Legacy lightweight and quick",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.4-nano"},"gpt-5.1":{name:"gpt-5.1",displayName:"GPT-5.1",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5"},"gpt-5.2":{name:"gpt-5.2",displayName:"GPT-5.2",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5"},"gpt-5.2-pro":{name:"gpt-5.2-pro",displayName:"GPT-5.2 Pro",description:"Legacy most advanced OpenAI model",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5-pro"},"gpt-5.4":{name:"gpt-5.4",displayName:"GPT-5.4",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5"},"gpt-5.4-mini":{name:"gpt-5.4-mini",displayName:"GPT-5.4 Mini",description:"Fast and efficient",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.4-nano":{name:"gpt-5.4-nano",displayName:"GPT-5.4 Nano",description:"Lightweight and quick",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.5":{name:"gpt-5.5",displayName:"GPT-5.5",description:"Powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.5-pro":{name:"gpt-5.5-pro",displayName:"GPT-5.5 Pro",description:"Most advanced OpenAI model",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"claude-sonnet-5":{name:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Balanced performance",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,usesAdaptiveThinking:!0},"claude-sonnet-4-6":{name:"claude-sonnet-4-6",displayName:"Claude Sonnet 4.6",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!0,replacedBy:"claude-sonnet-5"},"claude-sonnet-4-5-20250929":{name:"claude-sonnet-4-5-20250929",displayName:"Claude Sonnet 4.5",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"claude-sonnet-5"},"claude-3-7-sonnet-latest":{name:"claude-3-7-sonnet-latest",displayName:"Claude Sonnet 3.7",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-sonnet-5",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"claude-haiku-4-5-20251001":{name:"claude-haiku-4-5-20251001",displayName:"Claude Haiku 4.5",description:"Fastest responses",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"claude-opus-4-20250514":{name:"claude-opus-4-20250514",displayName:"Claude Opus 4",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:32e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-opus-4-8",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"claude-opus-4-1-20250805":{name:"claude-opus-4-1-20250805",displayName:"Claude Opus 4.1",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:32e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-opus-4-8",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"claude-opus-4-5-20251101":{name:"claude-opus-4-5-20251101",displayName:"Claude Opus 4.5",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"claude-opus-4-8"},"claude-opus-4-6":{name:"claude-opus-4-6",displayName:"Claude Opus 4.6",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"claude-opus-4-8"},"claude-opus-4-7":{name:"claude-opus-4-7",displayName:"Claude Opus 4.7",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,usesAdaptiveThinking:!0,replacedBy:"claude-opus-4-8"},"claude-opus-4-8":{name:"claude-opus-4-8",displayName:"Claude Opus 4.8",description:"Most capable Anthropic model",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,usesAdaptiveThinking:!0},"claude-sonnet-4-20250514":{name:"claude-sonnet-4-20250514",displayName:"Claude Sonnet 4",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-sonnet-5",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"bedrock-claude-sonnet-4-5":{name:"bedrock-claude-sonnet-4-5",vendorModelName:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",displayName:"Claude Sonnet 4.5 (Bedrock)",description:"Claude Sonnet hosted on AWS Bedrock",providerType:"bedrock",requiresExplicitAvailability:!0,maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"gemini-2.5-flash":{name:"gemini-2.5-flash",displayName:"Gemini Flash 2.5",description:"Legacy fast and efficient",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gemini-3.5-flash"},"gemini-2.5-pro":{name:"gemini-2.5-pro",displayName:"Gemini Pro 2.5",description:"Legacy most capable Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gemini-3.1-pro"},"gemini-2.5-flash-lite":{name:"gemini-2.5-flash-lite",displayName:"Gemini Flash 2.5 Lite",description:"Legacy lightweight Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gemini-3.1-flash-lite"},"gemini-3-flash":{name:"gemini-3-flash",vendorModelName:"gemini-3-flash-preview",displayName:"Gemini Flash 3",description:"Legacy fast and efficient",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gemini-3.5-flash"},"gemini-3.1-flash-lite":{name:"gemini-3.1-flash-lite",displayName:"Gemini Flash 3.1 Lite",description:"Lightweight Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"gemini-3.5-flash":{name:"gemini-3.5-flash",displayName:"Gemini Flash 3.5",description:"Fast and efficient",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"gemini-3-pro":{name:"gemini-3-pro",vendorModelName:"gemini-3-pro-preview",displayName:"Gemini Pro 3",description:"Legacy most capable Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gemini-3.1-pro"},"gemini-3.1-pro":{name:"gemini-3.1-pro",vendorModelName:"gemini-3.1-pro-preview",displayName:"Gemini Pro 3.1",description:"Most capable Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"grok-3":{name:"grok-3",displayName:"Grok-3",description:"Legacy most capable Grok model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4.3",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-3-fast":{name:"grok-3-fast",displayName:"Grok-3 Fast",description:"Legacy fast general-purpose model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-non-reasoning",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-3-mini":{name:"grok-3-mini",displayName:"Grok-3 Mini",description:"Legacy most capable Grok model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4.3",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-3-mini-fast":{name:"grok-3-mini-fast",displayName:"Grok-3 Mini Fast",description:"Legacy fast general-purpose model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-non-reasoning",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4":{name:"grok-4",displayName:"Grok-4",description:"Legacy most capable Grok model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:256e3,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4.3",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4.3":{name:"grok-4.3",displayName:"Grok-4.3",description:"Most capable Grok model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,reasoning:{kind:"levels",supported:["low","medium","high"]}},"grok-4-fast-reasoning":{name:"grok-4-fast-reasoning",displayName:"Grok-4 Fast Reasoning",description:"Legacy optimized for reasoning tasks",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:256e3,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-reasoning",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4-fast-non-reasoning":{name:"grok-4-fast-non-reasoning",displayName:"Grok-4 Fast Non-Reasoning",description:"Legacy fast general-purpose model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:256e3,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-non-reasoning",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4-1-fast-reasoning":{name:"grok-4-1-fast-reasoning",displayName:"Grok-4.1 Fast Reasoning",description:"Optimized for reasoning tasks",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:2e6,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4-1-fast-non-reasoning":{name:"grok-4-1-fast-non-reasoning",displayName:"Grok-4.1 Fast Non-Reasoning",description:"Fast general-purpose model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:2e6,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1}};for(const e of Object.values(h))o(!e.replacedBy||!h[e.replacedBy]?.replacedBy,`Model ${e.name} is replaced by ${e.replacedBy}, which is also marked as replaced (is not active).`),o(!e.replacedBy||e.description.startsWith("Legacy"),`Model ${e.name} is deprecated and its description must start with 'Legacy': '${e.description}'.`);const g=(e,t)=>Array.isArray(e)?e.concat(t):void 0;class _{constructor(){this.data={codeChecksum:"initial",databases:{},storage:{},executables:{},apis:{},graphql:{},triggers:{},schedulers:{},webhooks:{},nativeQueries:{},distributedLocks:{},aiChatbots:{},clientConnectionStateChangeHandlers:[],aiFunctions:{},openApiControllersMap:{},queues:{},queueMessageHandlers:{},eventHandlers:{},metrics:{security:{write:[],all:[]}},limits:{},llms:{},mcp:{},integrationLifecycleHooks:{onIntegrationCreated:!1,onIntegrationDeleted:!1,onIntegrationChanged:!1}}}secureDatabase(t,n,r=e.BUILT_IN_DB_INTEGRATION_ID){y(this.data,{databases:{[r]:{security:{[t]:[n]}}}})}secureAiQuery(t,n=e.BUILT_IN_DB_INTEGRATION_ID){y(this.data,{databases:{[n]:{security:{aiQuery:[t]}}}})}secureCollection(t,n,r,o=e.BUILT_IN_DB_INTEGRATION_ID){y(this.data,{databases:{[o]:{collections:{[t]:{security:{[n]:[r]}}}}}})}secureStorage(t,n,r=e.BUILT_IN_STORAGE_INTEGRATION_ID){y(this.data,{storage:{[r]:{security:{[t]:[n]}}}})}secureTopic(t,n,r,o=e.BUILT_IN_QUEUE_INTEGRATION_ID){y(this.data,{queues:{[o]:{topics:{[t]:{security:{[n]:[r]}}}}}})}queueMessage(t,n,r=e.BUILT_IN_QUEUE_INTEGRATION_ID){y(this.data,{queueMessageHandlers:{[r]:{[t]:[n]}}})}eventHandler(e,t){y(this.data,{eventHandlers:{[e]:[t]}})}secureMetric(e,t,n){y(this.data,{metrics:{security:{[t]:[{namePrefix:e,serviceFunction:n}]}}})}secureApi(e,t,n){y(this.data,t?{apis:{[e]:{endpoints:{[t]:{security:[n]}}}}}:{apis:{[e]:{security:[n]}}})}secureGraphQL(e,t){y(this.data,{graphql:{[e]:{security:[t]}}})}transformDatabase(t,n,r=e.BUILT_IN_DB_INTEGRATION_ID){y(this.data,{databases:{[r]:{transform:{[t]:{type:t,serviceFunction:n}}}}})}transformCollection(t,n,r,o=e.BUILT_IN_DB_INTEGRATION_ID){y(this.data,{databases:{[o]:{collections:{[t]:{transform:{[n]:{type:n,serviceFunction:r}}}}}}})}executable(e){const t=e.split(":")[1],n={serviceFunction:e},r=this.data.executables[t];r&&r.serviceFunction!==e&&console.warn(`Executable name collision: "${t}" is registered by both "${r.serviceFunction}" and "${e}". Use qualified names to avoid ambiguity.`),y(this.data,{executables:{[t]:n,[e]:n}})}aiFunction(e,{id:t,description:n,promptId:r,params:o,attributes:i,categories:u,internal:a}){const s={aiFunctions:{[t]:{serviceFunction:e,description:n,promptId:r,params:o,attributes:i,categories:u,internal:a}}};y(this.data,s)}aiFunctionsConfigurator(e,{id:t,integrationTypes:n}){const r={aiFunctionsConfigurators:{[t]:{serviceFunction:e,integrationTypes:n}}};y(this.data,r)}trigger(e,t,n,r,i){o(!this.data.triggers[e],`Duplicate Trigger IDs: ${e}`),this.data.triggers[e]={integrationId:r,collectionName:t,functionName:n,mutationTypes:i}}scheduler(e,t,n,r){o(!this.data.schedulers[e],`Duplicate Scheduler IDs: ${e}`),this.data.schedulers[e]={cronExpression:t,functionName:n,exclusive:r}}webhook(e,t){o(!this.data.webhooks[e],`Duplicate Webhook IDs: ${e}`),this.data.webhooks[e]={functionName:t}}secureNativeQuery(e,t){y(this.data,{nativeQueries:{[e]:[t]}})}secureDistributedLock(e,t){y(this.data,e?{distributedLocks:{mutexes:{[e]:{security:[t]}}}}:{distributedLocks:{security:[t]}})}secureAiAgent(t,n){y(this.data,t?{aiChatbots:{[e.AI_AGENTS_INTEGRATION_ID]:{profiles:{[t]:{security:{chat:[n]}}}}}}:{aiChatbots:{[e.AI_AGENTS_INTEGRATION_ID]:{security:{chat:[n]}}}})}limits(e,t){y(this.data,{limits:{[e]:t}})}clientConnectionChangeHandler(e){y(this.data,{clientConnectionStateChangeHandlers:[e]})}llmService(e,t){const n=t.models;o(void 0===this.data.llms?.[e]?.models,`LLM service '${e}' is already registered.`);const r=Object.keys(n);o(r.length>0,`LLM service '${e}' must declare at least one model.`);for(const t of r)o(!d(t),`LLM service '${e}' cannot declare an already-defined model: '${t}'.`);const i=Object.values(this.data.llms??{}).flatMap(e=>Object.keys(e.models??{}));for(const e of r)o(!i.includes(e),`Model '${e}' is already defined by another LLM service.`);y(this.data,{llms:{[e]:{models:n,...void 0!==t.supportsFunctions&&{supportsFunctions:t.supportsFunctions}}}})}llmAsk(e){const t=e.split(":")[0];o(void 0===this.data.llms?.[t]?.ask,`LLM service '${t}' already has an 'ask' function defined.`),y(this.data,{llms:{[t]:{ask:e}}})}mcpServer(e,t){const n=t.id;o(void 0===Object.values(this.data.mcp||{}).find(e=>e.options?.id===n),`MCP server with id ${n} already exists (${e}).`),y(this.data,{mcp:{[e]:{options:t,tools:[]}}})}mcpAuthorizer(e){const[t,n]=e.split(":");o(!this.data.mcp?.[t]?.authorizer,`MCP server '${t}' already has authorizer: ${n}.`),y(this.data,{mcp:{[t]:{authorizer:e}}})}mcpTool(e,t){const[n,r]=e.split(":");o(void 0===this.data.mcp?.[n]?.tools?.find(t=>t.serviceFunctionName===e),`MCP server '${n}' already has tool ${r}.`),y(this.data,{mcp:{[n]:{tools:[{serviceFunctionName:e,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema}]}}})}setIntegrationLifecycleHooks(e){this.data.integrationLifecycleHooks={onIntegrationCreated:e.onIntegrationCreated,onIntegrationChanged:e.onIntegrationChanged,onIntegrationDeleted:e.onIntegrationDeleted}}}function y(e,t){(0,l.mergeWith)(e,t,g)}const v=new _;function m(e,t){return function(n,r,o){return v.secureDatabase(e,F(n,r),t),o}}function k(e){return function(t,n,r){return v.secureAiQuery(F(t,n),e),r}}function b(e,t,n){return function(r,o,i){return v.secureCollection(e,t,F(r,o),n),i}}function T(e,t){return function(n,r,o){return v.secureStorage(e,F(n,r),t),o}}function O(e,t,n){return function(r,o,i){return v.secureTopic(e,t,F(r,o),n),i}}function A(e){return function(t,n,r){return v.secureMetric(e.metricNamePrefix||"",e.type,F(t,n)),r}}function C(e,t){return function(n,r,o){return v.secureApi(e,t,F(n,r)),o}}function w(e){return function(t,n,r){return v.secureGraphQL(e,F(t,n)),r}}function I(e,t){return function(n,r,o){return v.queueMessage(e,F(n,r),t),o}}function E(e){return function(t,n,r){return v.eventHandler(e,F(t,n)),r}}function R(){return function(e,t,n){return v.executable(F(e,t)),n}}function x(e,t=[],n={},r=[],o=!1){return function(u,a,s){const l=F(u,a),p=f(l);let d;return"object"==typeof e?(i(e.description??e.promptId,`AI function definition requires either "description" or "promptId" to be defined: ${a}`),void 0!==e.id&&c(e.id,a),d={id:e.id??p,description:e.description,promptId:e.promptId,params:i(e.params,`AI function definition requires "params" to be defined: ${a}`),attributes:e.attributes||{},categories:e.categories||[],internal:e.internal||!1}):d={id:p,description:e,promptId:void 0,params:t,attributes:n,categories:r,internal:o},v.aiFunction(l,d),s}}function S(e){return function(t,n,r){const o=F(t,n);void 0!==e.id&&c(e.id,n);const i={id:e.id??f(o),integrationTypes:e.integrationTypes};return v.aiFunctionsConfigurator(o,i),r}}function N(t,n="",r){const i="object"==typeof t?{...t}:{id:t,collection:n,integrationId:r};return o(i.collection,"Collection name can't be empty"),function(t,n,r){return i.id||(i.id=F(t,n)),v.trigger(i.id,i.collection,F(t,n),i.integrationId||e.BUILT_IN_DB_INTEGRATION_ID,i.mutationTypes),r}}function M(e,t,n=!0){return function(r,o,u){const a=F(r,o);let s;return s="object"==typeof e?{cron:e.cron,id:e.id||a,exclusive:e.exclusive??!0}:{id:e,cron:i(t,"cronExpression must be defined"),exclusive:n},v.scheduler(s.id,s.cron,a,s.exclusive),u}}function D(e){return function(t,n,r){return v.webhook(e,F(t,n)),r}}function L(e){return function(t,n,r){return v.secureNativeQuery(e,F(t,n)),r}}function G(e){return function(t,n,r){return v.secureDistributedLock(e,F(t,n)),r}}function j(e){return function(t,n,r){return v.secureAiAgent(e,F(t,n)),r}}function Y(e){return function(t,n,r){return v.limits(F(t,n),$(e)),r}}function Q(e){return t=>{v.llmService(t.name,e)}}function P(){return function(e,t,n){return v.llmAsk(F(e,t)),n}}function B(e){return t=>{v.mcpServer(t.name,e)}}function q(e){return function(t,n,r){return v.mcpTool(F(t,n),e),r}}function W(){return function(e,t,n){return v.mcpAuthorizer(F(e,t)),n}}function U(){return function(e,t,n){return v.clientConnectionChangeHandler(F(e,t)),n}}function F(e,t){return`${e.constructor.name}:${t}`}function $(e){return void 0!==e.rateLimit&&("number"==typeof e.rateLimit?e.rateLimit=[{value:e.rateLimit,scope:"global"}]:"object"!=typeof e.rateLimit||Array.isArray(e.rateLimit)||(e.rateLimit=[e.rateLimit]),e.rateLimit.forEach(e=>{void 0===e.scope&&(e.scope="global")})),void 0!==e.quotaLimit&&("number"==typeof e.quotaLimit?e.quotaLimit=[{value:e.quotaLimit,scope:"global",renewPeriod:"monthly"}]:"object"!=typeof e.quotaLimit||Array.isArray(e.quotaLimit)||(e.quotaLimit=[e.quotaLimit]),e.quotaLimit.forEach(e=>{void 0===e.scope&&(e.scope="global"),void 0===e.renewPeriod&&(e.renewPeriod="monthly")})),e}const V=require("path"),z="user-code",H="user-code-python";function K(e){a(e,"Invalid application ID");const[t,n,r,i]=e.split("-");return o(!i,`Invalid application ID: ${e}`),{appId:t,environmentId:n??"prod",squidDeveloperId:r}}const Z=["api","application","auth","mutation","native-query","query","queue","notification"];const J=require("node:async_hooks"),X=(require("node:stream"),"__docId__"),ee=/[.\[\]]/;function te(e,t){if(!e)return;const n=t.split(ee);let r,o=e;for(;o&&n.length;){const e=n.shift();if(e){if("object"!=typeof o||!(e in o))return;r=o[e],o=r}}return r}function ne(e){return null==e}function re(e,t){if(e===t)return!0;if(null===e||null===t)return!1;const n=typeof e;if(n!==typeof t)return!1;if("object"!==n)return e===t;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;for(const n of r)if(!o.includes(n)||!re(e[n],t[n]))return!1;return!0}function oe(e,t){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=ie(e[r],t);return n}function ie(e,t){const n=t?t(e):void 0;if(void 0!==n)return n;if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return oe(e,t);if(e instanceof Map)return new Map(oe(Array.from(e),t));if(e instanceof Set)return new Set(oe(Array.from(e),t));if(ArrayBuffer.isView(e))return r=e,"undefined"!=typeof Buffer&&r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length);var r;const o={};for(const n in e)Object.hasOwnProperty.call(e,n)&&(o[n]=ie(e[n],t));return o}function ue(e){if(Array.isArray(e))return e.map(e=>ue(e));if("object"!=typeof e||null===e||e instanceof Date)return e;const t=Object.keys(e),n={};return t.sort().forEach(t=>{n[t]=ue(e[t])}),n}function ae(e){return function(e){if(void 0===e)return null;const t=ie(e,e=>function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?{$date:e.toISOString()}:void 0);return JSON.stringify(t)}(ue(e))}function se(e){return ie(JSON.parse(e),e=>{if(null===e||"object"!=typeof e)return;const t=e,n=t.$date;return n&&1===Object.keys(t).length?new Date(n):void 0})}function ce(e,t,n){if(e=e instanceof Date?e.getTime():e??null,t=t instanceof Date?t.getTime():t??null,"=="===n)return re(e,t);if("!="===n)return!re(e,t);switch(n){case"<":return!ne(e)&&(!!ne(t)||t<e);case"<=":return!!ne(t)||!ne(e)&&t<=e;case">":return!ne(t)&&(!!ne(e)||t>e);case">=":return!!ne(e)||!ne(t)&&t>=e;case"like":return"string"==typeof t&&"string"==typeof e&&fe(t,e,!1);case"not like":return!("string"==typeof t&&"string"==typeof e&&fe(t,e,!1));case"like_cs":return"string"==typeof t&&"string"==typeof e&&fe(t,e,!0);case"not like_cs":return!("string"==typeof t&&"string"==typeof e&&fe(t,e,!0));case"array_includes_some":{const n=t;return Array.isArray(t)&&Array.isArray(e)&&e.some(e=>i(n,"VALUE_CANNOT_BE_NULL").some(t=>re(t,e)))}case"array_includes_all":{const n=t;return Array.isArray(e)&&Array.isArray(t)&&e.every(e=>i(n,"VALUE_CANNOT_BE_NULL").some(t=>re(t,e)))}case"array_not_includes":{const n=t;return Array.isArray(t)&&Array.isArray(e)&&e.every(e=>!i(n,"VALUE_CANNOT_BE_NULL").some(t=>re(t,e)))}default:throw new Error(`Unsupported operator comparison: ${n}`)}}function fe(e,t,n){n||(e=e.toLowerCase(),t=t.toLowerCase());const r=function(e){let t="";for(let n=0;n<e.length;++n)"\\"===e[n]?n+1<e.length&&["%","_"].includes(e[n+1])?(t+=e[n+1],n++):n+1<e.length&&"\\"===e[n+1]?(t+="\\\\",n++):t+="\\":"%"===e[n]?t+="[\\s\\S]*":"_"===e[n]?t+="[\\s\\S]":("/-\\^$*+?.()[]{}|".includes(e[n])&&(t+="\\"),t+=e[n]);return t}(t);return new RegExp(`^${r}$`).test(e)}function le(e){return"fieldName"in e}function pe(e){return"docIds"in e}function de(e,t,n){const r=e.docIds.some(e=>Object.entries(e).every(([e,r])=>ce(r,n(t,e)??null,"==")));switch(e.operator){case"==":case"in":return r;case"!=":case"not in":return!r}}function he(e,t,n,r){const o=e,i=r(t,X);if("string"!=typeof i)return ce(o,i??null,n);let u;try{u=se(i)}catch{return ce(o,i,n)}if(!u||"object"!=typeof u||Array.isArray(u))return ce(o,i,n);const a=Object.keys(u);if(1===a.length&&"__id"===a[0]){const e=u.__id,t=function(e){if("object"==typeof e&&null!==e&&!Array.isArray(e)){const t=Object.keys(e);return 1===t.length&&"__id"===t[0]?e.__id:ae(e)}if("string"==typeof e)try{const t=se(e);if(t&&"object"==typeof t&&!Array.isArray(t)){const e=Object.keys(t);if(1===e.length&&"__id"===e[0])return t.__id}}catch{}return e}(o);return ce(t,e,n)}if(1===a.length){const e=function(e,t){if("object"==typeof e&&null!==e&&!Array.isArray(e)){const n=Object.keys(e);if(1===n.length&&n[0]===t)return e[t]}if("string"==typeof e)try{const n=se(e);if(n&&"object"==typeof n&&!Array.isArray(n)){const e=Object.keys(n);if(1===e.length&&e[0]===t)return n[t]}}catch{}return e}(o,a[0]);return ce(e,u[a[0]],n)}return"object"!=typeof o||null===o||Array.isArray(o)?ce(o,i,n):ce(ae(o),i,n)}const ge={"in:in":(e,t)=>e.every(e=>t.includes(e)),"in:not in":(e,t)=>e.every(e=>!t.includes(e)),"not in:not in":(e,t)=>t.every(t=>e.includes(t)),">:not in":(e,t)=>t.every(t=>e>=t),">=:not in":(e,t)=>t.every(t=>e>t),"<:not in":(e,t)=>t.every(t=>e<=t),"<=:not in":(e,t)=>t.every(t=>e<t),">:>":(e,t)=>e>=t,">=:>":(e,t)=>e>t,"in:>":(e,t)=>e.every(e=>e>t),">:>=":(e,t)=>e>=t,">=:>=":(e,t)=>e>=t,"in:>=":(e,t)=>e.every(e=>e>=t),"<:<":(e,t)=>e<=t,"<=:<":(e,t)=>e<t,"in:<":(e,t)=>e.every(e=>e<t),"<:<=":(e,t)=>e<=t,"<=:<=":(e,t)=>e<=t,"in:<=":(e,t)=>e.every(e=>e<=t),"like:like":(e,t)=>_e(e.toLowerCase(),t.toLowerCase()),"like_cs:like":(e,t)=>_e(e.toLowerCase(),t.toLowerCase()),"like:like_cs":(e,t)=>_e(e,t)&&ve(t),"like_cs:like_cs":(e,t)=>_e(e,t),"like:not like":(e,t)=>!ye(e.toLowerCase(),t.toLowerCase()),"like_cs:not like":(e,t)=>!ye(e.toLowerCase(),t.toLowerCase()),"like:not like_cs":(e,t)=>!ye(e.toLowerCase(),t.toLowerCase()),"like_cs:not like_cs":(e,t)=>!ye(e,t),"not like:like":(e,t)=>ke(e,t),"not like_cs:like":(e,t)=>ke(e,t),"not like:like_cs":(e,t)=>ke(e,t),"not like_cs:like_cs":(e,t)=>ke(e,t),"not like:not like":(e,t)=>_e(t.toLowerCase(),e.toLowerCase()),"not like_cs:not like":(e,t)=>_e(t,e)&&ve(e),"not like:not like_cs":(e,t)=>_e(t.toLowerCase(),e.toLowerCase()),"not like_cs:not like_cs":(e,t)=>_e(t,e),"in:like":(e,t)=>e.every(e=>ce(t,e,"like")),"in:like_cs":(e,t)=>e.every(e=>ce(t,e,"like_cs")),"in:not like":(e,t)=>e.every(e=>ce(t,e,"not like")),"in:not like_cs":(e,t)=>e.every(e=>ce(t,e,"not like_cs")),"like:in":(e,t)=>!e.includes("%")&&!e.includes("_")&&!!t.find(t=>t.toLowerCase()===e.toLowerCase()),"like_cs:in":(e,t)=>!e.includes("%")&&!e.includes("_")&&t.includes(e),"not like:in":(e,t)=>e.length>0&&me(e)||be(e)&&t.includes(""),"not like_cs:in":(e,t)=>e.length>0&&me(e)||be(e)&&t.includes(""),"not in:like":(e,t)=>t.length>0&&me(t)||be(t)&&e.includes(""),"not in:like_cs":(e,t)=>t.length>0&&me(t)||be(t)&&e.includes(""),"not in:not like":(e,t)=>!t.includes("%")&&!t.includes("_")&&!!e.find(e=>e.toLowerCase()===t.toLowerCase()),"not in:not like_cs":(e,t)=>!t.includes("%")&&!t.includes("_")&&e.includes(t),"like:not in":(e,t)=>t.every(t=>ce(e,t,"not like")),"like_cs:not in":(e,t)=>t.every(t=>ce(e,t,"not like_cs")),"not like:not in":(e,t)=>t.every(t=>ce(e,t,"like")),"not like_cs:not in":(e,t)=>t.every(t=>ce(e,t,"like_cs")),"array_includes_some:array_includes_some":(e,t)=>e.every(e=>t.includes(e)),"array_includes_all:array_includes_all":(e,t)=>e.every(e=>t.includes(e)),"array_not_includes:array_not_includes":(e,t)=>t.every(t=>e.includes(t)),"array_includes_some:array_not_includes":(e,t)=>e.every(e=>!t.includes(e)),"array_not_includes:array_includes_some":(e,t)=>t.every(t=>!e.includes(t)),"array_includes_all:array_includes_some":(e,t)=>e.every(e=>t.includes(e)),"array_includes_some:array_includes_all":(e,t)=>e.every(e=>t.includes(e)),"array_not_includes:array_includes_all":(e,t)=>t.every(t=>!e.includes(t)),"array_includes_all:array_not_includes":(e,t)=>e.every(e=>!t.includes(e))};function _e(e,t,n=0,r=0){if(r>=t.length)return n>=e.length;if(n>=e.length)return me(t.substring(r));const o=e[n],i=t[r];return"%"===o&&"%"===i?_e(e,t,n+1,r+1)||_e(e,t,n+1,r):"%"!==o&&("%"===i?_e(e,t,n,r+1)||_e(e,t,n+1,r):(o===i||"_"===i)&&_e(e,t,n+1,r+1))}function ye(e,t,n=0,r=0){if(n>=e.length&&r>=t.length)return!0;if(n>=e.length)return me(t.substring(r));if(r>=t.length)return me(e.substring(n));const o=n<e.length?e[n]:"",i=r<t.length?t[r]:"";return"%"===o&&"%"===i?ye(e,t,n+1,r+1)||ye(e,t,n,r+1)||ye(e,t,n+1,r):"%"===o||"%"===i?ye(e,t,n,r+1)||ye(e,t,n+1,r):(o===i||"_"===o||"_"===i)&&ye(e,t,n+1,r+1)}function ve(e){return!/[a-zA-Z]/.test(e)}function me(e){return e.split("").every(e=>"%"===e)}function ke(e,t){return e.length>0&&me(e)||t.length>0&&me(t)||be(e)&&0===t.length}function be(e){let t=!1,n=!1;for(const r of e)switch(r){case"%":t=!0;break;case"_":if(n)return!1;n=!0;break;default:return!1}return t&&n}function Te(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(!re(e[r],t[r]))return!1}return!0}function Oe(e,t){return t.every(t=>{const n=Object.keys(t).sort();if(n.length!==e.length)return!1;for(let t=0;t<e.length;t++)if(n[t]!==e[t])return!1;return!0})}class Ae{constructor(e){this.query=e,this.query=e;const t=this.query.conditions.filter(le),n=this.query.conditions.filter(pe),r=n.flatMap(e=>function(e){if("=="!==e.operator&&"in"!==e.operator)return[];if(0===e.docIds.length)return[];const t=[],n=e.docIds[0];for(const r of Object.keys(n)){const o=n[r];e.docIds.every(e=>Object.prototype.hasOwnProperty.call(e,r)&&re(e[r],o))&&t.push({fieldName:r,operator:"==",value:o})}return t}(e));this.exactSimpleConditions=this.parseConditions(t),this.exactDocIdConditions=n,this.subqueryConditions=this.parseConditions([...t,...r])}get integrationId(){return this.query.integrationId}get collectionName(){return this.query.collectionName}get limit(){return this.query.limit}get projectFields(){return this.query.projectFields}sortedBy(e){return!e.find((e,t)=>!re(this.query.sortOrder[t],{...e,asc:e.asc??!0}))}sortedByExact(e){return e.length===this.query.sortOrder.length&&this.sortedBy(e)}isSubqueryOf(e,t,n){return this.isSubqueryOfCondition({fieldName:e,operator:t,value:n})}isSubqueryOfCondition(e){return!!this.subqueryConditions.filter(t=>t.fieldName===e.fieldName).find(t=>this.evaluateSubset(t,e))}isSubqueryOfConditions(e){return this.parseConditions(e).every(e=>this.isSubqueryOfCondition(e))}isSubqueryOfQuery(e){if(e.collectionName!==this.collectionName||e.integrationId!==this.integrationId)return!1;for(const t of e.conditions.filter(pe))if(!this.childImpliesParentDocIdCondition(t))return!1;const t=e.conditions.filter(le),n=this.isSubqueryOfConditions(t),r=this.sortedBy(e.sortOrder),o=-1===e.limit||this.limit>-1&&this.limit<e.limit,i=this.isProjectFieldsSubset(this.query.projectFields,e.projectFields);return n&&r&&o&&i}childImpliesParentDocIdCondition(e){const t=e.docIds;if(0===t.length)return!1;const n="=="===e.operator||"in"===e.operator,r=Object.keys(t[0]).sort(),o=[];for(const e of this.query.conditions)pe(e)&&o.push(...e.docIds);if(!Oe(r,t)||!Oe(r,o))return!1;const i=this.buildChildEffectiveTupleSet();return n?void 0!==i.allowed&&i.allowed.every(e=>t.some(t=>Te(e,t))):void 0!==i.allowed?i.allowed.every(e=>!t.some(t=>Te(e,t))):t.every(e=>i.excluded.some(t=>Te(e,t)))}buildChildEffectiveTupleSet(){let e;const t=[];for(const n of this.query.conditions)if(pe(n))if("=="===n.operator||"in"===n.operator)e=void 0===e?[...n.docIds]:e.filter(e=>n.docIds.some(t=>Te(e,t)));else for(const e of n.docIds)t.some(t=>Te(t,e))||t.push(e);return void 0!==e&&t.length>0&&(e=e.filter(e=>!t.some(t=>Te(e,t)))),{allowed:e,excluded:t}}isProjectFieldsSubset(e,t){if(!t)return!0;if(!e)return!1;const n=new Set(t);return e.every(e=>n.has(e))}getConditionsFor(...e){return this.subqueryConditions.filter(t=>e.includes(t.fieldName))}getConditionsForField(e){return this.subqueryConditions.filter(t=>t.fieldName===e)}documentMatchesQuery(e){for(const t of this.exactSimpleConditions){const n=t.fieldName,r=t.operator;if(n===X){const n=t.value;if("in"===r||"not in"===r){const t=(Array.isArray(n)?n:[n]).some(t=>he(t,e,"==",te));if(!("in"===r?t:!t))return!1;continue}if(!he(n,e,r,te))return!1;continue}const o=te(e,n);if("in"===r){if(t.value.includes(o))continue;return!1}if("not in"!==r){if(!ce(t.value,o,r))return!1}else if(t.value.includes(o))return!1}for(const t of this.exactDocIdConditions)if(!de(t,e,te))return!1;return!0}evaluateSubset(e,t){const{operator:n,value:r}=e,{operator:o,value:i}=this.parseConditions([t])[0],u=ge[`${n}:${o}`];return!!u&&u(r,i)}parseConditions(e){const t=[],n=new Map,r=new Map;return e.forEach(e=>{switch(e.operator){case"==":case"in":n.set(e.fieldName,(n.get(e.fieldName)||[]).concat(e.value));break;case"!=":case"not in":r.set(e.fieldName,(r.get(e.fieldName)||[]).concat(e.value));break;default:t.push(e)}}),n.forEach((e,n)=>{t.push({fieldName:n,operator:"in",value:e})}),r.forEach((e,n)=>{t.push({fieldName:n,operator:"not in",value:e})}),t}}function Ce(){if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;if("undefined"!=typeof self)return self;throw new Error("Unable to locate global object")}void 0===Ce()?.SQUID_LOG_DEBUG_ENABLED&&function(e=!0){Ce().SQUID_LOG_DEBUG_ENABLED=e}(function(){let e="";return"undefined"!=typeof window&&window.location?e=new URLSearchParams(window.location.search).get("SQUID_DEBUG")||"":"undefined"!=typeof process&&process.env&&(e=process.env.SQUID_DEBUG||""),"1"===e||"true"===e}());const we="__squidMetadata",Ie="CIRCULAR_DEPENDENCY",Ee=(new J.AsyncLocalStorage,[]);function Re(e,t,n){const r=Se();r.codeDirByServiceClassName.set(e.name,n);let i=r.serviceInstanceByCtor.get(e);if(!i||function(e){return e[we]||{version:0}}(i).version<=1){const n=Se(),r={...n,...t};o(!Ee.includes(e),()=>`${Ie}: ${Ee[Ee.length-1]?.name} => ${e.name}`),Ee.push(e);try{i=n.requestLocalStorage.run(t,()=>new e(r))}finally{Ee.pop()}n.serviceInstanceByCtor.set(e,i)}else(function(e,t){o(e.backendApiKey===t.backendApiKey,"backendApiKey does not match."),o(e.requestLocalStorage===t.requestLocalStorage,"requestLocalStorage does not match"),o(e.environmentId===t.environmentId,"environmentId does not match"),o(e.squidDeveloperId===t.squidDeveloperId,"squidDeveloperId does not match");const n=K(e.appId),r=K(t.appId);o(n.appId===r.appId,`appId does not match! Before: ${n.appId}, after ${r.appId}`)})(i.config,r),i.config.secrets=r.secrets,i.config.apiKeys=r.apiKeys;return i}const xe="SQUID_GLOBAL_CONFIG";function Se(){return i(Ce()[xe],"Squid global config is not defined! Make sure you are not trying to use Squid at module load time.")}class Ne{constructor(){this.region=process.env.SQUID_REGION||"local",this.config=Se(),this[we]={version:2},this.backendBaseUrl=function(e,t,n,r,o,i){let u="https",a=`${r||t}.${o||e}.${new URL("https://squid.cloud").host}`,s="";if(/^local/.test(e)){if(u="http",s=i||function(e){const t=e.replace(/^\/+/,"").split("/"),n=t[0]||"";return"ws"===n?"squidlet"===t[1]:Z.includes(n)}(n)?"8001":"8000","undefined"!=typeof process){const e=i?void 0:process.env.SQUID_LOCAL_WS_FORCE_PORT;e&&n.replace(/^\/+/,"").startsWith("ws/general")&&(s=e)}/android$/.test(e)?a="10.0.2.2":/ios$/.test(e)&&(a="localhost")}const c=u+"://"+a+(s?`:${s}`:""),f=n.replace(/^\/+/,"");return f?`${c}/${f}`:c}(this.region,this.config.appId,"")}get secrets(){return this.config.secrets}get apiKeys(){return this.config.apiKeys}get context(){return this.getRequestConfig().context}get squid(){return je()}get assetsDirectory(){const e=Object.getPrototypeOf(this).constructor.name,t=this.config.codeDir||this.config.codeDirByServiceClassName.get(e);return o(t,()=>`No codeDir found for service: ${e}`),V.resolve(t,"public")}getApiKey(){return this.config.backendApiKey}getUserAuth(){const{auth:e}=this.getRequestConfig();return"Bearer"===e?.type?e:void 0}getApiKeyAuth(){const{auth:e}=this.getRequestConfig();return"ApiKey"===e?.type?e:void 0}isAuthenticated(){const{auth:e}=this.getRequestConfig();return!!e}assertIsAuthenticated(){this.assertInRequestScope(),o(this.isAuthenticated(),"UNAUTHORIZED")}assertInRequestScope(){o(this.config.requestLocalStorage.getStore(),"This method can only be called with a valid request scope.")}assertApiKeyCall(){o(this.getApiKeyAuth(),"This method can only be called with API key")}createWebhookResponse(e,t,n){return{body:e||"",statusCode:t||(e?200:204),headers:n||{},__isWebhookResponse__:!0}}throwWebhookResponse(e){throw{body:e.body||"",statusCode:e.statusCode||500,headers:e.headers||{},__isWebhookResponse__:!0}}createOpenApiResponse(e,t,n){return{body:e||"",statusCode:t||(e?200:204),headers:n||{},__isOpenApiResponse__:!0}}throwOpenApiResponse(e){throw{body:e.body||"",statusCode:e.statusCode||500,headers:e.headers||{},__isOpenApiResponse__:!0}}async convertToSquidFile(e){return{__isSquidFile__:!0,data:new Uint8Array(await e.arrayBuffer()),fieldName:e.name,mimetype:e.type,originalName:e.name,size:e.size,encoding:e.type}}async publishAiStatusUpdate(e,t){const n={type:"aiStatus",agentId:e.agentId,messageId:e.messageId,chatId:e.chatId,jobId:e.jobId,payload:{title:e.title,body:e.body,parentStatusUpdateId:e.parentStatusUpdateId,tags:e.tags}};await this.squid.getNotificationClient().publishSystemNotification(n,[t])}getRequestConfig(){return this.assertInRequestScope(),i(this.config.requestLocalStorage.getStore(),"Failed to access request data outside of the request's scope")}}function Me(e,t){return Re(e,{},t)}function De(e,t){const n=Object.getPrototypeOf(t).constructor.name,r=Se().codeDirByServiceClassName.get(n);return o(r,()=>`Caller class codeDir is not set: ${n}`),Me(e,r)}function Le(e,t=z){return Me(e,i(Se().moduleById.get(t),"Module not found: "+t).codeDir)}function Ge(){const e=Se(),t=process.env.SQUID_REGION||"local",n=process.env.SQUID_CONSOLE_REGION,r=K(e.appId);return{appId:r.appId,apiKey:e.backendApiKey,squidDeveloperId:r.squidDeveloperId,environmentId:r.environmentId,region:t,consoleRegion:n}}function je(){return e.Squid.getInstance(Ge())}function Ye(){return e.Squid.getInstance({...Ge(),isPassiveMode:!0})}class Qe extends Ne{}class Pe{constructor(){v.setIntegrationLifecycleHooks({onIntegrationCreated:this.onIntegrationCreated!==Pe.prototype.onIntegrationCreated,onIntegrationDeleted:this.onIntegrationDeleted!==Pe.prototype.onIntegrationDeleted,onIntegrationChanged:this.onIntegrationChanged!==Pe.prototype.onIntegrationChanged})}get squid(){return je()}metadata(){return v.data}async onIntegrationCreated(e){}async onIntegrationChanged(e){}async onIntegrationDeleted(e){}async cleanup(){for(const t of e.Squid.getInstances())await t.destruct()}}class Be{constructor(e){this.agentId=e.agentId,this.prompt=e.prompt,this.options=e.options}}class qe{constructor(e){this.integrationId=e.integrationId,this.endpointId=e.endpointId,this.url=e.url,this.method=e.method,this.body=e.body,this.options=e.options}}var We;!function(e){e.EVERY_SECOND="* * * * * *",e.EVERY_5_SECONDS="*/5 * * * * *",e.EVERY_10_SECONDS="*/10 * * * * *",e.EVERY_30_SECONDS="*/30 * * * * *",e.EVERY_MINUTE="*/1 * * * *",e.EVERY_5_MINUTES="0 */5 * * * *",e.EVERY_10_MINUTES="0 */10 * * * *",e.EVERY_30_MINUTES="0 */30 * * * *",e.EVERY_HOUR="0 0-23/1 * * *",e.EVERY_2_HOURS="0 0-23/2 * * *",e.EVERY_3_HOURS="0 0-23/3 * * *",e.EVERY_4_HOURS="0 0-23/4 * * *",e.EVERY_5_HOURS="0 0-23/5 * * *",e.EVERY_6_HOURS="0 0-23/6 * * *",e.EVERY_7_HOURS="0 0-23/7 * * *",e.EVERY_8_HOURS="0 0-23/8 * * *",e.EVERY_9_HOURS="0 0-23/9 * * *",e.EVERY_10_HOURS="0 0-23/10 * * *",e.EVERY_11_HOURS="0 0-23/11 * * *",e.EVERY_12_HOURS="0 0-23/12 * * *",e.EVERY_DAY_AT_1AM="0 01 * * *",e.EVERY_DAY_AT_2AM="0 02 * * *",e.EVERY_DAY_AT_3AM="0 03 * * *",e.EVERY_DAY_AT_4AM="0 04 * * *",e.EVERY_DAY_AT_5AM="0 05 * * *",e.EVERY_DAY_AT_6AM="0 06 * * *",e.EVERY_DAY_AT_7AM="0 07 * * *",e.EVERY_DAY_AT_8AM="0 08 * * *",e.EVERY_DAY_AT_9AM="0 09 * * *",e.EVERY_DAY_AT_10AM="0 10 * * *",e.EVERY_DAY_AT_11AM="0 11 * * *",e.EVERY_DAY_AT_NOON="0 12 * * *",e.EVERY_DAY_AT_1PM="0 13 * * *",e.EVERY_DAY_AT_2PM="0 14 * * *",e.EVERY_DAY_AT_3PM="0 15 * * *",e.EVERY_DAY_AT_4PM="0 16 * * *",e.EVERY_DAY_AT_5PM="0 17 * * *",e.EVERY_DAY_AT_6PM="0 18 * * *",e.EVERY_DAY_AT_7PM="0 19 * * *",e.EVERY_DAY_AT_8PM="0 20 * * *",e.EVERY_DAY_AT_9PM="0 21 * * *",e.EVERY_DAY_AT_10PM="0 22 * * *",e.EVERY_DAY_AT_11PM="0 23 * * *",e.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",e.EVERY_WEEK="0 0 * * 7",e.EVERY_WEEKDAY="0 0 * * 1-5",e.EVERY_WEEKEND="0 0 * * 6,7",e.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",e.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",e.EVERY_2ND_HOUR="0 */2 * * *",e.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",e.EVERY_2ND_MONTH="0 0 1 */2 *",e.EVERY_QUARTER="0 0 1 */3 *",e.EVERY_6_MONTHS="0 0 1 */6 *",e.EVERY_YEAR="0 0 1 1 *",e.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",e.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",e.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",e.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",e.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",e.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",e.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",e.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",e.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",e.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",e.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",e.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",e.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",e.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",e.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",e.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",e.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",e.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",e.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",e.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",e.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",e.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",e.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",e.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",e.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5"}(We||(We={}));class Ue{constructor(e){this.mutex=e}}class Fe{constructor(e){this.isGraphiQL=e.isGraphiQL,this.query=e.query,this.operationName=e.operationName,this.variables=e.variables}}const $e=["insert","update","delete"];class Ve{constructor(e,t,n){this.mutation=e,this.beforeAndAfterDocs=t,this.serverTimeStamp=n}get before(){return this.beforeAndAfterDocs.before}get after(){return this.beforeAndAfterDocs.after}getMutationType(){return this.mutation.type}affectsPath(e){return!re(te(this.before,e),te(this.after,e))}affectedPaths(e=""){o("update"===this.mutation.type,"affectedPaths can only be used with update mutations");const t=[];return this.checkPath(e,t),t}checkPath(e,t){const n=te(this.before,e),r=te(this.after,e);if(!re(n,r)&&(""!==e&&t.push(e),"object"==typeof n&&null!==n&&"object"==typeof r&&null!==r)){const o=Object.keys(n),i=Object.keys(r);new Set([...o,...i]).forEach(n=>{const r=e?`${e}.${n}`:n;this.checkPath(r,t)})}}}function ze(e){return{__isWebhookResponse__:!0,body:"",statusCode:204,headers:{},...e}}})();var o=exports;for(var i in r)o[i]=r[i];r.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
2
+ (()=>{var e={243(e,t,n){var r;e=n.nmd(e),function(){var o,i="Expected a function",u="__lodash_hash_undefined__",a="__lodash_placeholder__",s=32,c=128,l=1/0,f=9007199254740991,p=NaN,d=4294967295,h=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",256]],g="[object Arguments]",_="[object Array]",y="[object Boolean]",m="[object Date]",v="[object Error]",k="[object Function]",T="[object GeneratorFunction]",b="[object Map]",O="[object Number]",w="[object Object]",A="[object Promise]",C="[object RegExp]",I="[object Set]",E="[object String]",R="[object Symbol]",x="[object WeakMap]",S="[object ArrayBuffer]",M="[object DataView]",N="[object Float32Array]",D="[object Float64Array]",L="[object Int8Array]",G="[object Int16Array]",j="[object Int32Array]",P="[object Uint8Array]",Y="[object Uint8ClampedArray]",Q="[object Uint16Array]",$="[object Uint32Array]",q=/\b__p \+= '';/g,B=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,V=RegExp(W.source),z=RegExp(F.source),H=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,oe=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ue=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,_e=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,me=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,ke=/['\n\r\u2028\u2029\\]/g,Te="\\ud800-\\udfff",be="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Oe="\\u2700-\\u27bf",we="a-z\\xdf-\\xf6\\xf8-\\xff",Ae="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ee="["+Te+"]",Re="["+Ie+"]",xe="["+be+"]",Se="\\d+",Me="["+Oe+"]",Ne="["+we+"]",De="[^"+Te+Ie+Se+Oe+we+Ae+"]",Le="\\ud83c[\\udffb-\\udfff]",Ge="[^"+Te+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",Pe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ye="["+Ae+"]",Qe="\\u200d",$e="(?:"+Ne+"|"+De+")",qe="(?:"+Ye+"|"+De+")",Be="(?:['’](?:d|ll|m|re|s|t|ve))?",Ue="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+xe+"|"+Le+")?",Fe="["+Ce+"]?",Ve=Fe+We+"(?:"+Qe+"(?:"+[Ge,je,Pe].join("|")+")"+Fe+We+")*",ze="(?:"+[Me,je,Pe].join("|")+")"+Ve,He="(?:"+[Ge+xe+"?",xe,je,Pe,Ee].join("|")+")",Ke=RegExp("['’]","g"),Ze=RegExp(xe,"g"),Je=RegExp(Le+"(?="+Le+")|"+He+Ve,"g"),Xe=RegExp([Ye+"?"+Ne+"+"+Be+"(?="+[Re,Ye,"$"].join("|")+")",qe+"+"+Ue+"(?="+[Re,Ye+$e,"$"].join("|")+")",Ye+"?"+$e+"+"+Be,Ye+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Se,ze].join("|"),"g"),et=RegExp("["+Qe+Te+be+Ce+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,ot={};ot[N]=ot[D]=ot[L]=ot[G]=ot[j]=ot[P]=ot[Y]=ot[Q]=ot[$]=!0,ot[g]=ot[_]=ot[S]=ot[y]=ot[M]=ot[m]=ot[v]=ot[k]=ot[b]=ot[O]=ot[w]=ot[C]=ot[I]=ot[E]=ot[x]=!1;var it={};it[g]=it[_]=it[S]=it[M]=it[y]=it[m]=it[N]=it[D]=it[L]=it[G]=it[j]=it[b]=it[O]=it[w]=it[C]=it[I]=it[E]=it[R]=it[P]=it[Y]=it[Q]=it[$]=!0,it[v]=it[k]=it[x]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,st=parseInt,ct="object"==typeof global&&global&&global.Object===Object&&global,lt="object"==typeof self&&self&&self.Object===Object&&self,ft=ct||lt||Function("return this")(),pt=t&&!t.nodeType&&t,dt=pt&&e&&!e.nodeType&&e,ht=dt&&dt.exports===pt,gt=ht&&ct.process,_t=function(){try{return dt&&dt.require&&dt.require("util").types||gt&&gt.binding&&gt.binding("util")}catch(e){}}(),yt=_t&&_t.isArrayBuffer,mt=_t&&_t.isDate,vt=_t&&_t.isMap,kt=_t&&_t.isRegExp,Tt=_t&&_t.isSet,bt=_t&&_t.isTypedArray;function Ot(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)}function wt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var u=e[o];t(r,u,n(u),e)}return r}function At(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Ct(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function It(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Et(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var u=e[n];t(u,n,e)&&(i[o++]=u)}return i}function Rt(e,t){return!(null==e||!e.length)&&Yt(e,t,0)>-1}function xt(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 St(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}function Mt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Nt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function Dt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function Lt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Gt=Bt("length");function jt(e,t,n){var r;return n(e,function(e,n,o){if(t(e,n,o))return r=n,!1}),r}function Pt(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}function Yt(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):Pt(e,$t,n)}function Qt(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function $t(e){return e!=e}function qt(e,t){var n=null==e?0:e.length;return n?Ft(e,t)/n:p}function Bt(e){return function(t){return null==t?o:t[e]}}function Ut(e){return function(t){return null==e?o:e[t]}}function Wt(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}function Ft(e,t){for(var n,r=-1,i=e.length;++r<i;){var u=t(e[r]);u!==o&&(n=n===o?u:n+u)}return n}function Vt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function zt(e){return e?e.slice(0,pn(e)+1).replace(re,""):e}function Ht(e){return function(t){return e(t)}}function Kt(e,t){return St(t,function(t){return e[t]})}function Zt(e,t){return e.has(t)}function Jt(e,t){for(var n=-1,r=e.length;++n<r&&Yt(t,e[n],0)>-1;);return n}function Xt(e,t){for(var n=e.length;n--&&Yt(t,e[n],0)>-1;);return n}var en=Ut({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Ut({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(e){return"\\"+ut[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function un(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var u=e[n];u!==t&&u!==a||(e[n]=a,i[o++]=n)}return i}function sn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function ln(e){return rn(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):Gt(e)}function fn(e){return rn(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function pn(e){for(var t=e.length;t--&&oe.test(e.charAt(t)););return t}var dn=Ut({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),hn=function e(t){var n,r=(t=null==t?ft:hn.defaults(ft.Object(),t,hn.pick(ft,nt))).Array,oe=t.Date,Te=t.Error,be=t.Function,Oe=t.Math,we=t.Object,Ae=t.RegExp,Ce=t.String,Ie=t.TypeError,Ee=r.prototype,Re=be.prototype,xe=we.prototype,Se=t["__core-js_shared__"],Me=Re.toString,Ne=xe.hasOwnProperty,De=0,Le=(n=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ge=xe.toString,je=Me.call(we),Pe=ft._,Ye=Ae("^"+Me.call(Ne).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qe=ht?t.Buffer:o,$e=t.Symbol,qe=t.Uint8Array,Be=Qe?Qe.allocUnsafe:o,Ue=un(we.getPrototypeOf,we),We=we.create,Fe=xe.propertyIsEnumerable,Ve=Ee.splice,ze=$e?$e.isConcatSpreadable:o,He=$e?$e.iterator:o,Je=$e?$e.toStringTag:o,et=function(){try{var e=ci(we,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,ct=oe&&oe.now!==ft.Date.now&&oe.now,lt=t.setTimeout!==ft.setTimeout&&t.setTimeout,pt=Oe.ceil,dt=Oe.floor,gt=we.getOwnPropertySymbols,_t=Qe?Qe.isBuffer:o,Gt=t.isFinite,Ut=Ee.join,gn=un(we.keys,we),_n=Oe.max,yn=Oe.min,mn=oe.now,vn=t.parseInt,kn=Oe.random,Tn=Ee.reverse,bn=ci(t,"DataView"),On=ci(t,"Map"),wn=ci(t,"Promise"),An=ci(t,"Set"),Cn=ci(t,"WeakMap"),In=ci(we,"create"),En=Cn&&new Cn,Rn={},xn=ji(bn),Sn=ji(On),Mn=ji(wn),Nn=ji(An),Dn=ji(Cn),Ln=$e?$e.prototype:o,Gn=Ln?Ln.valueOf:o,jn=Ln?Ln.toString:o;function Pn(e){if(ea(e)&&!Bu(e)&&!(e instanceof qn)){if(e instanceof $n)return e;if(Ne.call(e,"__wrapped__"))return Pi(e)}return new $n(e)}var Yn=function(){function e(){}return function(t){if(!Xu(t))return{};if(We)return We(t);e.prototype=t;var n=new e;return e.prototype=o,n}}();function Qn(){}function $n(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function qn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Bn(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 Un(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 Wn(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 Fn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Wn;++t<n;)this.add(e[t])}function Vn(e){var t=this.__data__=new Un(e);this.size=t.size}function zn(e,t){var n=Bu(e),r=!n&&qu(e),o=!n&&!r&&Vu(e),i=!n&&!r&&!o&&sa(e),u=n||r||o||i,a=u?Vt(e.length,Ce):[],s=a.length;for(var c in e)!t&&!Ne.call(e,c)||u&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||_i(c,s))||a.push(c);return a}function Hn(e){var t=e.length;return t?e[Wr(0,t-1)]:o}function Kn(e,t){return Mi(Io(e),ir(t,0,e.length))}function Zn(e){return Mi(Io(e))}function Jn(e,t,n){(n!==o&&!Yu(e[t],n)||n===o&&!(t in e))&&rr(e,t,n)}function Xn(e,t,n){var r=e[t];Ne.call(e,t)&&Yu(r,n)&&(n!==o||t in e)||rr(e,t,n)}function er(e,t){for(var n=e.length;n--;)if(Yu(e[n][0],t))return n;return-1}function tr(e,t,n,r){return lr(e,function(e,o,i){t(r,e,n(e),i)}),r}function nr(e,t){return e&&Eo(t,xa(t),e)}function rr(e,t,n){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function or(e,t){for(var n=-1,i=t.length,u=r(i),a=null==e;++n<i;)u[n]=a?o:Aa(e,t[n]);return u}function ir(e,t,n){return e==e&&(n!==o&&(e=e<=n?e:n),t!==o&&(e=e>=t?e:t)),e}function ur(e,t,n,r,i,u){var a,s=1&t,c=2&t,l=4&t;if(n&&(a=i?n(e,r,i,u):n(e)),a!==o)return a;if(!Xu(e))return e;var f=Bu(e);if(f){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ne.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return Io(e,a)}else{var p=pi(e),d=p==k||p==T;if(Vu(e))return To(e,s);if(p==w||p==g||d&&!i){if(a=c||d?{}:hi(e),!s)return c?function(e,t){return Eo(e,fi(e),t)}(e,function(e,t){return e&&Eo(t,Sa(t),e)}(a,e)):function(e,t){return Eo(e,li(e),t)}(e,nr(a,e))}else{if(!it[p])return i?e:{};a=function(e,t,n){var r,o=e.constructor;switch(t){case S:return bo(e);case y:case m:return new o(+e);case M:return function(e,t){var n=t?bo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case D:case L:case G:case j:case P:case Y:case Q:case $:return Oo(e,n);case b:return new o;case O:case E:return new o(e);case C:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case I:return new o;case R:return r=e,Gn?we(Gn.call(r)):{}}}(e,p,s)}}u||(u=new Vn);var h=u.get(e);if(h)return h;u.set(e,a),ia(e)?e.forEach(function(r){a.add(ur(r,t,n,r,e,u))}):ta(e)&&e.forEach(function(r,o){a.set(o,ur(r,t,n,o,e,u))});var _=f?o:(l?c?ni:ti:c?Sa:xa)(e);return At(_||e,function(r,o){_&&(r=e[o=r]),Xn(a,o,ur(r,t,n,o,e,u))}),a}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=we(e);r--;){var i=n[r],u=t[i],a=e[i];if(a===o&&!(i in e)||!u(a))return!1}return!0}function sr(e,t,n){if("function"!=typeof e)throw new Ie(i);return Ei(function(){e.apply(o,n)},t)}function cr(e,t,n,r){var o=-1,i=Rt,u=!0,a=e.length,s=[],c=t.length;if(!a)return s;n&&(t=St(t,Ht(n))),r?(i=xt,u=!1):t.length>=200&&(i=Zt,u=!1,t=new Fn(t));e:for(;++o<a;){var l=e[o],f=null==n?l:n(l);if(l=r||0!==l?l:0,u&&f==f){for(var p=c;p--;)if(t[p]===f)continue e;s.push(l)}else i(t,f,r)||s.push(l)}return s}Pn.templateSettings={escape:H,evaluate:K,interpolate:Z,variable:"",imports:{_:Pn}},Pn.prototype=Qn.prototype,Pn.prototype.constructor=Pn,$n.prototype=Yn(Qn.prototype),$n.prototype.constructor=$n,qn.prototype=Yn(Qn.prototype),qn.prototype.constructor=qn,Bn.prototype.clear=function(){this.__data__=In?In(null):{},this.size=0},Bn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Bn.prototype.get=function(e){var t=this.__data__;if(In){var n=t[e];return n===u?o:n}return Ne.call(t,e)?t[e]:o},Bn.prototype.has=function(e){var t=this.__data__;return In?t[e]!==o:Ne.call(t,e)},Bn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=In&&t===o?u:t,this},Un.prototype.clear=function(){this.__data__=[],this.size=0},Un.prototype.delete=function(e){var t=this.__data__,n=er(t,e);return!(n<0||(n==t.length-1?t.pop():Ve.call(t,n,1),--this.size,0))},Un.prototype.get=function(e){var t=this.__data__,n=er(t,e);return n<0?o:t[n][1]},Un.prototype.has=function(e){return er(this.__data__,e)>-1},Un.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new Bn,map:new(On||Un),string:new Bn}},Wn.prototype.delete=function(e){var t=ai(this,e).delete(e);return this.size-=t?1:0,t},Wn.prototype.get=function(e){return ai(this,e).get(e)},Wn.prototype.has=function(e){return ai(this,e).has(e)},Wn.prototype.set=function(e,t){var n=ai(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,u),this},Fn.prototype.has=function(e){return this.__data__.has(e)},Vn.prototype.clear=function(){this.__data__=new Un,this.size=0},Vn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Vn.prototype.get=function(e){return this.__data__.get(e)},Vn.prototype.has=function(e){return this.__data__.has(e)},Vn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Un){var r=n.__data__;if(!On||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(e,t),this.size=n.size,this};var lr=So(mr),fr=So(vr,!0);function pr(e,t){var n=!0;return lr(e,function(e,r,o){return n=!!t(e,r,o)}),n}function dr(e,t,n){for(var r=-1,i=e.length;++r<i;){var u=e[r],a=t(u);if(null!=a&&(s===o?a==a&&!aa(a):n(a,s)))var s=a,c=u}return c}function hr(e,t){var n=[];return lr(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function gr(e,t,n,r,o){var i=-1,u=e.length;for(n||(n=gi),o||(o=[]);++i<u;){var a=e[i];t>0&&n(a)?t>1?gr(a,t-1,n,r,o):Mt(o,a):r||(o[o.length]=a)}return o}var _r=Mo(),yr=Mo(!0);function mr(e,t){return e&&_r(e,t,xa)}function vr(e,t){return e&&yr(e,t,xa)}function kr(e,t){return Et(t,function(t){return Ku(e[t])})}function Tr(e,t){for(var n=0,r=(t=yo(t,e)).length;null!=e&&n<r;)e=e[Gi(t[n++])];return n&&n==r?e:o}function br(e,t,n){var r=t(e);return Bu(e)?r:Mt(r,n(e))}function Or(e){return null==e?e===o?"[object Undefined]":"[object Null]":Je&&Je in we(e)?function(e){var t=Ne.call(e,Je),n=e[Je];try{e[Je]=o;var r=!0}catch(e){}var i=Ge.call(e);return r&&(t?e[Je]=n:delete e[Je]),i}(e):function(e){return Ge.call(e)}(e)}function wr(e,t){return e>t}function Ar(e,t){return null!=e&&Ne.call(e,t)}function Cr(e,t){return null!=e&&t in we(e)}function Ir(e,t,n){for(var i=n?xt:Rt,u=e[0].length,a=e.length,s=a,c=r(a),l=1/0,f=[];s--;){var p=e[s];s&&t&&(p=St(p,Ht(t))),l=yn(p.length,l),c[s]=!n&&(t||u>=120&&p.length>=120)?new Fn(s&&p):o}p=e[0];var d=-1,h=c[0];e:for(;++d<u&&f.length<l;){var g=p[d],_=t?t(g):g;if(g=n||0!==g?g:0,!(h?Zt(h,_):i(f,_,n))){for(s=a;--s;){var y=c[s];if(!(y?Zt(y,_):i(e[s],_,n)))continue e}h&&h.push(_),f.push(g)}}return f}function Er(e,t,n){var r=null==(e=Ai(e,t=yo(t,e)))?e:e[Gi(Hi(t))];return null==r?o:Ot(r,e,n)}function Rr(e){return ea(e)&&Or(e)==g}function xr(e,t,n,r,i){return e===t||(null==e||null==t||!ea(e)&&!ea(t)?e!=e&&t!=t:function(e,t,n,r,i,u){var a=Bu(e),s=Bu(t),c=a?_:pi(e),l=s?_:pi(t),f=(c=c==g?w:c)==w,p=(l=l==g?w:l)==w,d=c==l;if(d&&Vu(e)){if(!Vu(t))return!1;a=!0,f=!1}if(d&&!f)return u||(u=new Vn),a||sa(e)?Xo(e,t,n,r,i,u):function(e,t,n,r,o,i,u){switch(n){case M:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!i(new qe(e),new qe(t)));case y:case m:case O:return Yu(+e,+t);case v:return e.name==t.name&&e.message==t.message;case C:case E:return e==t+"";case b:var a=on;case I:var s=1&r;if(a||(a=sn),e.size!=t.size&&!s)return!1;var c=u.get(e);if(c)return c==t;r|=2,u.set(e,t);var l=Xo(a(e),a(t),r,o,i,u);return u.delete(e),l;case R:if(Gn)return Gn.call(e)==Gn.call(t)}return!1}(e,t,c,n,r,i,u);if(!(1&n)){var h=f&&Ne.call(e,"__wrapped__"),k=p&&Ne.call(t,"__wrapped__");if(h||k){var T=h?e.value():e,A=k?t.value():t;return u||(u=new Vn),i(T,A,n,r,u)}}return!!d&&(u||(u=new Vn),function(e,t,n,r,i,u){var a=1&n,s=ti(e),c=s.length;if(c!=ti(t).length&&!a)return!1;for(var l=c;l--;){var f=s[l];if(!(a?f in t:Ne.call(t,f)))return!1}var p=u.get(e),d=u.get(t);if(p&&d)return p==t&&d==e;var h=!0;u.set(e,t),u.set(t,e);for(var g=a;++l<c;){var _=e[f=s[l]],y=t[f];if(r)var m=a?r(y,_,f,t,e,u):r(_,y,f,e,t,u);if(!(m===o?_===y||i(_,y,n,r,u):m)){h=!1;break}g||(g="constructor"==f)}if(h&&!g){var v=e.constructor,k=t.constructor;v==k||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof k&&k instanceof k||(h=!1)}return u.delete(e),u.delete(t),h}(e,t,n,r,i,u))}(e,t,n,r,xr,i))}function Sr(e,t,n,r){var i=n.length,u=i,a=!r;if(null==e)return!u;for(e=we(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<u;){var c=(s=n[i])[0],l=e[c],f=s[1];if(a&&s[2]){if(l===o&&!(c in e))return!1}else{var p=new Vn;if(r)var d=r(l,f,c,e,t,p);if(!(d===o?xr(f,l,3,r,p):d))return!1}}return!0}function Mr(e){return!(!Xu(e)||(t=e,Le&&Le in t))&&(Ku(e)?Ye:ge).test(ji(e));var t}function Nr(e){return"function"==typeof e?e:null==e?ns:"object"==typeof e?Bu(e)?Pr(e[0],e[1]):jr(e):fs(e)}function Dr(e){if(!Ti(e))return gn(e);var t=[];for(var n in we(e))Ne.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Lr(e,t){return e<t}function Gr(e,t){var n=-1,o=Wu(e)?r(e.length):[];return lr(e,function(e,r,i){o[++n]=t(e,r,i)}),o}function jr(e){var t=si(e);return 1==t.length&&t[0][2]?Oi(t[0][0],t[0][1]):function(n){return n===e||Sr(n,e,t)}}function Pr(e,t){return mi(e)&&bi(t)?Oi(Gi(e),t):function(n){var r=Aa(n,e);return r===o&&r===t?Ca(n,e):xr(t,r,3)}}function Yr(e,t,n,r,i){e!==t&&_r(t,function(u,a){if(i||(i=new Vn),Xu(u))!function(e,t,n,r,i,u,a){var s=Ci(e,n),c=Ci(t,n),l=a.get(c);if(l)Jn(e,n,l);else{var f=u?u(s,c,n+"",e,t,a):o,p=f===o;if(p){var d=Bu(c),h=!d&&Vu(c),g=!d&&!h&&sa(c);f=c,d||h||g?Bu(s)?f=s:Fu(s)?f=Io(s):h?(p=!1,f=To(c,!0)):g?(p=!1,f=Oo(c,!0)):f=[]:ra(c)||qu(c)?(f=s,qu(s)?f=_a(s):Xu(s)&&!Ku(s)||(f=hi(c))):p=!1}p&&(a.set(c,f),i(f,c,r,u,a),a.delete(c)),Jn(e,n,f)}}(e,t,a,n,Yr,r,i);else{var s=r?r(Ci(e,a),u,a+"",e,t,i):o;s===o&&(s=u),Jn(e,a,s)}},Sa)}function Qr(e,t){var n=e.length;if(n)return _i(t+=t<0?n:0,n)?e[t]:o}function $r(e,t,n){t=t.length?St(t,function(e){return Bu(e)?function(t){return Tr(t,1===e.length?e[0]:e)}:e}):[ns];var r=-1;t=St(t,Ht(ui()));var o=Gr(e,function(e,n,o){var i=St(t,function(t){return t(e)});return{criteria:i,index:++r,value:e}});return function(e){var t=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var r=-1,o=e.criteria,i=t.criteria,u=o.length,a=n.length;++r<u;){var s=wo(o[r],i[r]);if(s)return r>=a?s:s*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});t--;)e[t]=e[t].value;return e}(o)}function qr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var u=t[r],a=Tr(e,u);n(a,u)&&Kr(i,yo(u,e),a)}return i}function Br(e,t,n,r){var o=r?Qt:Yt,i=-1,u=t.length,a=e;for(e===t&&(t=Io(t)),n&&(a=St(e,Ht(n)));++i<u;)for(var s=0,c=t[i],l=n?n(c):c;(s=o(a,l,s,r))>-1;)a!==e&&Ve.call(a,s,1),Ve.call(e,s,1);return e}function Ur(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;_i(o)?Ve.call(e,o,1):so(e,o)}}return e}function Wr(e,t){return e+dt(kn()*(t-e+1))}function Fr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=dt(t/2))&&(e+=e)}while(t);return n}function Vr(e,t){return Ri(wi(e,t,ns),e+"")}function zr(e){return Hn(Ya(e))}function Hr(e,t){var n=Ya(e);return Mi(n,ir(t,0,n.length))}function Kr(e,t,n,r){if(!Xu(e))return e;for(var i=-1,u=(t=yo(t,e)).length,a=u-1,s=e;null!=s&&++i<u;){var c=Gi(t[i]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=a){var f=s[c];(l=r?r(f,c,s):o)===o&&(l=Xu(f)?f:_i(t[i+1])?[]:{})}Xn(s,c,l),s=s[c]}return e}var Zr=En?function(e,t){return En.set(e,t),e}:ns,Jr=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Xa(t),writable:!0})}:ns;function Xr(e){return Mi(Ya(e))}function eo(e,t,n){var o=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var u=r(i);++o<i;)u[o]=e[o+t];return u}function to(e,t){var n;return lr(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}function no(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,u=e[i];null!==u&&!aa(u)&&(n?u<=t:u<t)?r=i+1:o=i}return o}return ro(e,t,ns,n)}function ro(e,t,n,r){var i=0,u=null==e?0:e.length;if(0===u)return 0;for(var a=(t=n(t))!=t,s=null===t,c=aa(t),l=t===o;i<u;){var f=dt((i+u)/2),p=n(e[f]),d=p!==o,h=null===p,g=p==p,_=aa(p);if(a)var y=r||g;else y=l?g&&(r||d):s?g&&d&&(r||!h):c?g&&d&&!h&&(r||!_):!h&&!_&&(r?p<=t:p<t);y?i=f+1:u=f}return yn(u,4294967294)}function oo(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var u=e[n],a=t?t(u):u;if(!n||!Yu(a,s)){var s=a;i[o++]=0===u?0:u}}return i}function io(e){return"number"==typeof e?e:aa(e)?p:+e}function uo(e){if("string"==typeof e)return e;if(Bu(e))return St(e,uo)+"";if(aa(e))return jn?jn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ao(e,t,n){var r=-1,o=Rt,i=e.length,u=!0,a=[],s=a;if(n)u=!1,o=xt;else if(i>=200){var c=t?null:Vo(e);if(c)return sn(c);u=!1,o=Zt,s=new Fn}else s=t?[]:a;e:for(;++r<i;){var l=e[r],f=t?t(l):l;if(l=n||0!==l?l:0,u&&f==f){for(var p=s.length;p--;)if(s[p]===f)continue e;t&&s.push(f),a.push(l)}else o(s,f,n)||(s!==a&&s.push(f),a.push(l))}return a}function so(e,t){var n=-1,r=(t=yo(t,e)).length;if(!r)return!0;for(;++n<r;){var o=Gi(t[n]);if("__proto__"===o&&!Ne.call(e,"__proto__"))return!1;if(("constructor"===o||"prototype"===o)&&n<r-1)return!1}var i=Ai(e,t);return null==i||delete i[Gi(Hi(t))]}function co(e,t,n,r){return Kr(e,t,n(Tr(e,t)),r)}function lo(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?eo(e,r?0:i,r?i+1:o):eo(e,r?i+1:0,r?o:i)}function fo(e,t){var n=e;return n instanceof qn&&(n=n.value()),Nt(t,function(e,t){return t.func.apply(t.thisArg,Mt([e],t.args))},n)}function po(e,t,n){var o=e.length;if(o<2)return o?ao(e[0]):[];for(var i=-1,u=r(o);++i<o;)for(var a=e[i],s=-1;++s<o;)s!=i&&(u[i]=cr(u[i]||a,e[s],t,n));return ao(gr(u,1),t,n)}function ho(e,t,n){for(var r=-1,i=e.length,u=t.length,a={};++r<i;){var s=r<u?t[r]:o;n(a,e[r],s)}return a}function go(e){return Fu(e)?e:[]}function _o(e){return"function"==typeof e?e:ns}function yo(e,t){return Bu(e)?e:mi(e,t)?[e]:Li(ya(e))}var mo=Vr;function vo(e,t,n){var r=e.length;return n=n===o?r:n,!t&&n>=r?e:eo(e,t,n)}var ko=ut||function(e){return ft.clearTimeout(e)};function To(e,t){if(t)return e.slice();var n=e.length,r=Be?Be(n):new e.constructor(n);return e.copy(r),r}function bo(e){var t=new e.constructor(e.byteLength);return new qe(t).set(new qe(e)),t}function Oo(e,t){var n=t?bo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function wo(e,t){if(e!==t){var n=e!==o,r=null===e,i=e==e,u=aa(e),a=t!==o,s=null===t,c=t==t,l=aa(t);if(!s&&!l&&!u&&e>t||u&&a&&c&&!s&&!l||r&&a&&c||!n&&c||!i)return 1;if(!r&&!u&&!l&&e<t||l&&n&&i&&!r&&!u||s&&n&&i||!a&&i||!c)return-1}return 0}function Ao(e,t,n,o){for(var i=-1,u=e.length,a=n.length,s=-1,c=t.length,l=_n(u-a,0),f=r(c+l),p=!o;++s<c;)f[s]=t[s];for(;++i<a;)(p||i<u)&&(f[n[i]]=e[i]);for(;l--;)f[s++]=e[i++];return f}function Co(e,t,n,o){for(var i=-1,u=e.length,a=-1,s=n.length,c=-1,l=t.length,f=_n(u-s,0),p=r(f+l),d=!o;++i<f;)p[i]=e[i];for(var h=i;++c<l;)p[h+c]=t[c];for(;++a<s;)(d||i<u)&&(p[h+n[a]]=e[i++]);return p}function Io(e,t){var n=-1,o=e.length;for(t||(t=r(o));++n<o;)t[n]=e[n];return t}function Eo(e,t,n,r){var i=!n;n||(n={});for(var u=-1,a=t.length;++u<a;){var s=t[u],c=r?r(n[s],e[s],s,n,e):o;c===o&&(c=e[s]),i?rr(n,s,c):Xn(n,s,c)}return n}function Ro(e,t){return function(n,r){var o=Bu(n)?wt:tr,i=t?t():{};return o(n,e,ui(r,2),i)}}function xo(e){return Vr(function(t,n){var r=-1,i=n.length,u=i>1?n[i-1]:o,a=i>2?n[2]:o;for(u=e.length>3&&"function"==typeof u?(i--,u):o,a&&yi(n[0],n[1],a)&&(u=i<3?o:u,i=1),t=we(t);++r<i;){var s=n[r];s&&e(t,s,r,u)}return t})}function So(e,t){return function(n,r){if(null==n)return n;if(!Wu(n))return e(n,r);for(var o=n.length,i=t?o:-1,u=we(n);(t?i--:++i<o)&&!1!==r(u[i],i,u););return n}}function Mo(e){return function(t,n,r){for(var o=-1,i=we(t),u=r(t),a=u.length;a--;){var s=u[e?a:++o];if(!1===n(i[s],s,i))break}return t}}function No(e){return function(t){var n=rn(t=ya(t))?fn(t):o,r=n?n[0]:t.charAt(0),i=n?vo(n,1).join(""):t.slice(1);return r[e]()+i}}function Do(e){return function(t){return Nt(Ka(qa(t).replace(Ke,"")),e,"")}}function Lo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Yn(e.prototype),r=e.apply(n,t);return Xu(r)?r:n}}function Go(e){return function(t,n,r){var i=we(t);if(!Wu(t)){var u=ui(n,3);t=xa(t),n=function(e){return u(i[e],e,i)}}var a=e(t,n,r);return a>-1?i[u?t[a]:a]:o}}function jo(e){return ei(function(t){var n=t.length,r=n,u=$n.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new Ie(i);if(u&&!s&&"wrapper"==oi(a))var s=new $n([],!0)}for(r=s?r:n;++r<n;){var c=oi(a=t[r]),l="wrapper"==c?ri(a):o;s=l&&vi(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?s[oi(l[0])].apply(s,l[3]):1==a.length&&vi(a)?s[c]():s.thru(a)}return function(){var e=arguments,r=e[0];if(s&&1==e.length&&Bu(r))return s.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}})}function Po(e,t,n,i,u,a,s,l,f,p){var d=t&c,h=1&t,g=2&t,_=24&t,y=512&t,m=g?o:Lo(e);return function c(){for(var v=arguments.length,k=r(v),T=v;T--;)k[T]=arguments[T];if(_)var b=ii(c),O=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(k,b);if(i&&(k=Ao(k,i,u,_)),a&&(k=Co(k,a,s,_)),v-=O,_&&v<p){var w=an(k,b);return Wo(e,t,Po,c.placeholder,n,k,w,l,f,p-v)}var A=h?n:this,C=g?A[e]:e;return v=k.length,l?k=function(e,t){for(var n=e.length,r=yn(t.length,n),i=Io(e);r--;){var u=t[r];e[r]=_i(u,n)?i[u]:o}return e}(k,l):y&&v>1&&k.reverse(),d&&f<v&&(k.length=f),this&&this!==ft&&this instanceof c&&(C=m||Lo(C)),C.apply(A,k)}}function Yo(e,t){return function(n,r){return function(e,t,n,r){return mr(e,function(e,o,i){t(r,n(e),o,i)}),r}(n,e,t(r),{})}}function Qo(e,t){return function(n,r){var i;if(n===o&&r===o)return t;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=uo(n),r=uo(r)):(n=io(n),r=io(r)),i=e(n,r)}return i}}function $o(e){return ei(function(t){return t=St(t,Ht(ui())),Vr(function(n){var r=this;return e(t,function(e){return Ot(e,r,n)})})})}function qo(e,t){var n=(t=t===o?" ":uo(t)).length;if(n<2)return n?Fr(t,e):t;var r=Fr(t,pt(e/ln(t)));return rn(t)?vo(fn(r),0,e).join(""):r.slice(0,e)}function Bo(e){return function(t,n,i){return i&&"number"!=typeof i&&yi(t,n,i)&&(n=i=o),t=pa(t),n===o?(n=t,t=0):n=pa(n),function(e,t,n,o){for(var i=-1,u=_n(pt((t-e)/(n||1)),0),a=r(u);u--;)a[o?u:++i]=e,e+=n;return a}(t,n,i=i===o?t<n?1:-1:pa(i),e)}}function Uo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ga(t),n=ga(n)),e(t,n)}}function Wo(e,t,n,r,i,u,a,c,l,f){var p=8&t;t|=p?s:64,4&(t&=~(p?64:s))||(t&=-4);var d=[e,t,i,p?u:o,p?a:o,p?o:u,p?o:a,c,l,f],h=n.apply(o,d);return vi(e)&&Ii(h,d),h.placeholder=r,xi(h,e,t)}function Fo(e){var t=Oe[e];return function(e,n){if(e=ga(e),(n=null==n?0:yn(da(n),292))&&Gt(e)){var r=(ya(e)+"e").split("e");return+((r=(ya(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Vo=An&&1/sn(new An([,-0]))[1]==l?function(e){return new An(e)}:as;function zo(e){return function(t){var n=pi(t);return n==b?on(t):n==I?cn(t):function(e,t){return St(t,function(t){return[t,e[t]]})}(t,e(t))}}function Ho(e,t,n,u,l,f,p,d){var h=2&t;if(!h&&"function"!=typeof e)throw new Ie(i);var g=u?u.length:0;if(g||(t&=-97,u=l=o),p=p===o?p:_n(da(p),0),d=d===o?d:da(d),g-=l?l.length:0,64&t){var _=u,y=l;u=l=o}var m=h?o:ri(e),v=[e,t,n,u,l,_,y,f,p,d];if(m&&function(e,t){var n=e[1],r=t[1],o=n|r,i=o<131,u=r==c&&8==n||r==c&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!i&&!u)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var s=t[3];if(s){var l=e[3];e[3]=l?Ao(l,s,t[4]):s,e[4]=l?an(e[3],a):t[4]}(s=t[5])&&(l=e[5],e[5]=l?Co(l,s,t[6]):s,e[6]=l?an(e[5],a):t[6]),(s=t[7])&&(e[7]=s),r&c&&(e[8]=null==e[8]?t[8]:yn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(v,m),e=v[0],t=v[1],n=v[2],u=v[3],l=v[4],!(d=v[9]=v[9]===o?h?0:e.length:_n(v[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)k=8==t||16==t?function(e,t,n){var i=Lo(e);return function u(){for(var a=arguments.length,s=r(a),c=a,l=ii(u);c--;)s[c]=arguments[c];var f=a<3&&s[0]!==l&&s[a-1]!==l?[]:an(s,l);return(a-=f.length)<n?Wo(e,t,Po,u.placeholder,o,s,f,o,o,n-a):Ot(this&&this!==ft&&this instanceof u?i:e,this,s)}}(e,t,d):t!=s&&33!=t||l.length?Po.apply(o,v):function(e,t,n,o){var i=1&t,u=Lo(e);return function t(){for(var a=-1,s=arguments.length,c=-1,l=o.length,f=r(l+s),p=this&&this!==ft&&this instanceof t?u:e;++c<l;)f[c]=o[c];for(;s--;)f[c++]=arguments[++a];return Ot(p,i?n:this,f)}}(e,t,n,u);else var k=function(e,t,n){var r=1&t,o=Lo(e);return function t(){return(this&&this!==ft&&this instanceof t?o:e).apply(r?n:this,arguments)}}(e,t,n);return xi((m?Zr:Ii)(k,v),e,t)}function Ko(e,t,n,r){return e===o||Yu(e,xe[n])&&!Ne.call(r,n)?t:e}function Zo(e,t,n,r,i,u){return Xu(e)&&Xu(t)&&(u.set(t,e),Yr(e,t,o,Zo,u),u.delete(t)),e}function Jo(e){return ra(e)?o:e}function Xo(e,t,n,r,i,u){var a=1&n,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var l=u.get(e),f=u.get(t);if(l&&f)return l==t&&f==e;var p=-1,d=!0,h=2&n?new Fn:o;for(u.set(e,t),u.set(t,e);++p<s;){var g=e[p],_=t[p];if(r)var y=a?r(_,g,p,t,e,u):r(g,_,p,e,t,u);if(y!==o){if(y)continue;d=!1;break}if(h){if(!Lt(t,function(e,t){if(!Zt(h,t)&&(g===e||i(g,e,n,r,u)))return h.push(t)})){d=!1;break}}else if(g!==_&&!i(g,_,n,r,u)){d=!1;break}}return u.delete(e),u.delete(t),d}function ei(e){return Ri(wi(e,o,Ui),e+"")}function ti(e){return br(e,xa,li)}function ni(e){return br(e,Sa,fi)}var ri=En?function(e){return En.get(e)}:as;function oi(e){for(var t=e.name+"",n=Rn[t],r=Ne.call(Rn,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function ii(e){return(Ne.call(Pn,"placeholder")?Pn:e).placeholder}function ui(){var e=Pn.iteratee||rs;return e=e===rs?Nr:e,arguments.length?e(arguments[0],arguments[1]):e}function ai(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 si(e){for(var t=xa(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,bi(o)]}return t}function ci(e,t){var n=function(e,t){return null==e?o:e[t]}(e,t);return Mr(n)?n:o}var li=gt?function(e){return null==e?[]:(e=we(e),Et(gt(e),function(t){return Fe.call(e,t)}))}:hs,fi=gt?function(e){for(var t=[];e;)Mt(t,li(e)),e=Ue(e);return t}:hs,pi=Or;function di(e,t,n){for(var r=-1,o=(t=yo(t,e)).length,i=!1;++r<o;){var u=Gi(t[r]);if(!(i=null!=e&&n(e,u)))break;e=e[u]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&Ju(o)&&_i(u,o)&&(Bu(e)||qu(e))}function hi(e){return"function"!=typeof e.constructor||Ti(e)?{}:Yn(Ue(e))}function gi(e){return Bu(e)||qu(e)||!!(ze&&e&&e[ze])}function _i(e,t){var n=typeof e;return!!(t=t??f)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function yi(e,t,n){if(!Xu(n))return!1;var r=typeof t;return!!("number"==r?Wu(n)&&_i(t,n.length):"string"==r&&t in n)&&Yu(n[t],e)}function mi(e,t){if(Bu(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!aa(e))||X.test(e)||!J.test(e)||null!=t&&e in we(t)}function vi(e){var t=oi(e),n=Pn[t];if("function"!=typeof n||!(t in qn.prototype))return!1;if(e===n)return!0;var r=ri(n);return!!r&&e===r[0]}(bn&&pi(new bn(new ArrayBuffer(1)))!=M||On&&pi(new On)!=b||wn&&pi(wn.resolve())!=A||An&&pi(new An)!=I||Cn&&pi(new Cn)!=x)&&(pi=function(e){var t=Or(e),n=t==w?e.constructor:o,r=n?ji(n):"";if(r)switch(r){case xn:return M;case Sn:return b;case Mn:return A;case Nn:return I;case Dn:return x}return t});var ki=Se?Ku:gs;function Ti(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||xe)}function bi(e){return e==e&&!Xu(e)}function Oi(e,t){return function(n){return null!=n&&n[e]===t&&(t!==o||e in we(n))}}function wi(e,t,n){return t=_n(t===o?e.length-1:t,0),function(){for(var o=arguments,i=-1,u=_n(o.length-t,0),a=r(u);++i<u;)a[i]=o[t+i];i=-1;for(var s=r(t+1);++i<t;)s[i]=o[i];return s[t]=n(a),Ot(e,this,s)}}function Ai(e,t){return t.length<2?e:Tr(e,eo(t,0,-1))}function Ci(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ii=Si(Zr),Ei=lt||function(e,t){return ft.setTimeout(e,t)},Ri=Si(Jr);function xi(e,t,n){var r=t+"";return Ri(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return At(h,function(n){var r="_."+n[0];t&n[1]&&!Rt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ue);return t?t[1].split(ae):[]}(r),n)))}function Si(e){var t=0,n=0;return function(){var r=mn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Mi(e,t){var n=-1,r=e.length,i=r-1;for(t=t===o?r:t;++n<t;){var u=Wr(n,i),a=e[u];e[u]=e[n],e[n]=a}return e.length=t,e}var Ni,Di,Li=(Ni=Nu(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,function(e,n,r,o){t.push(r?o.replace(le,"$1"):n||e)}),t},function(e){return 500===Di.size&&Di.clear(),e}),Di=Ni.cache,Ni);function Gi(e){if("string"==typeof e||aa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ji(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Pi(e){if(e instanceof qn)return e.clone();var t=new $n(e.__wrapped__,e.__chain__);return t.__actions__=Io(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Yi=Vr(function(e,t){return Fu(e)?cr(e,gr(t,1,Fu,!0)):[]}),Qi=Vr(function(e,t){var n=Hi(t);return Fu(n)&&(n=o),Fu(e)?cr(e,gr(t,1,Fu,!0),ui(n,2)):[]}),$i=Vr(function(e,t){var n=Hi(t);return Fu(n)&&(n=o),Fu(e)?cr(e,gr(t,1,Fu,!0),o,n):[]});function qi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:da(n);return o<0&&(o=_n(r+o,0)),Pt(e,ui(t,3),o)}function Bi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return n!==o&&(i=da(n),i=n<0?_n(r+i,0):yn(i,r-1)),Pt(e,ui(t,3),i,!0)}function Ui(e){return null!=e&&e.length?gr(e,1):[]}function Wi(e){return e&&e.length?e[0]:o}var Fi=Vr(function(e){var t=St(e,go);return t.length&&t[0]===e[0]?Ir(t):[]}),Vi=Vr(function(e){var t=Hi(e),n=St(e,go);return t===Hi(n)?t=o:n.pop(),n.length&&n[0]===e[0]?Ir(n,ui(t,2)):[]}),zi=Vr(function(e){var t=Hi(e),n=St(e,go);return(t="function"==typeof t?t:o)&&n.pop(),n.length&&n[0]===e[0]?Ir(n,o,t):[]});function Hi(e){var t=null==e?0:e.length;return t?e[t-1]:o}var Ki=Vr(Zi);function Zi(e,t){return e&&e.length&&t&&t.length?Br(e,t):e}var Ji=ei(function(e,t){var n=null==e?0:e.length,r=or(e,t);return Ur(e,St(t,function(e){return _i(e,n)?+e:e}).sort(wo)),r});function Xi(e){return null==e?e:Tn.call(e)}var eu=Vr(function(e){return ao(gr(e,1,Fu,!0))}),tu=Vr(function(e){var t=Hi(e);return Fu(t)&&(t=o),ao(gr(e,1,Fu,!0),ui(t,2))}),nu=Vr(function(e){var t=Hi(e);return t="function"==typeof t?t:o,ao(gr(e,1,Fu,!0),o,t)});function ru(e){if(!e||!e.length)return[];var t=0;return e=Et(e,function(e){if(Fu(e))return t=_n(e.length,t),!0}),Vt(t,function(t){return St(e,Bt(t))})}function ou(e,t){if(!e||!e.length)return[];var n=ru(e);return null==t?n:St(n,function(e){return Ot(t,o,e)})}var iu=Vr(function(e,t){return Fu(e)?cr(e,t):[]}),uu=Vr(function(e){return po(Et(e,Fu))}),au=Vr(function(e){var t=Hi(e);return Fu(t)&&(t=o),po(Et(e,Fu),ui(t,2))}),su=Vr(function(e){var t=Hi(e);return t="function"==typeof t?t:o,po(Et(e,Fu),o,t)}),cu=Vr(ru),lu=Vr(function(e){var t=e.length,n=t>1?e[t-1]:o;return n="function"==typeof n?(e.pop(),n):o,ou(e,n)});function fu(e){var t=Pn(e);return t.__chain__=!0,t}function pu(e,t){return t(e)}var du=ei(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return or(t,e)};return!(t>1||this.__actions__.length)&&r instanceof qn&&_i(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:pu,args:[i],thisArg:o}),new $n(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(o),e})):this.thru(i)}),hu=Ro(function(e,t,n){Ne.call(e,n)?++e[n]:rr(e,n,1)}),gu=Go(qi),_u=Go(Bi);function yu(e,t){return(Bu(e)?At:lr)(e,ui(t,3))}function mu(e,t){return(Bu(e)?Ct:fr)(e,ui(t,3))}var vu=Ro(function(e,t,n){Ne.call(e,n)?e[n].push(t):rr(e,n,[t])}),ku=Vr(function(e,t,n){var o=-1,i="function"==typeof t,u=Wu(e)?r(e.length):[];return lr(e,function(e){u[++o]=i?Ot(t,e,n):Er(e,t,n)}),u}),Tu=Ro(function(e,t,n){rr(e,n,t)});function bu(e,t){return(Bu(e)?St:Gr)(e,ui(t,3))}var Ou=Ro(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),wu=Vr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&yi(e,t[0],t[1])?t=[]:n>2&&yi(t[0],t[1],t[2])&&(t=[t[0]]),$r(e,gr(t,1),[])}),Au=ct||function(){return ft.Date.now()};function Cu(e,t,n){return t=n?o:t,t=e&&null==t?e.length:t,Ho(e,c,o,o,o,o,t)}function Iu(e,t){var n;if("function"!=typeof t)throw new Ie(i);return e=da(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=o),n}}var Eu=Vr(function(e,t,n){var r=1;if(n.length){var o=an(n,ii(Eu));r|=s}return Ho(e,r,t,n,o)}),Ru=Vr(function(e,t,n){var r=3;if(n.length){var o=an(n,ii(Ru));r|=s}return Ho(t,r,e,n,o)});function xu(e,t,n){var r,u,a,s,c,l,f=0,p=!1,d=!1,h=!0;if("function"!=typeof e)throw new Ie(i);function g(t){var n=r,i=u;return r=u=o,f=t,s=e.apply(i,n)}function _(e){var n=e-l;return l===o||n>=t||n<0||d&&e-f>=a}function y(){var e=Au();if(_(e))return m(e);c=Ei(y,function(e){var n=t-(e-l);return d?yn(n,a-(e-f)):n}(e))}function m(e){return c=o,h&&r?g(e):(r=u=o,s)}function v(){var e=Au(),n=_(e);if(r=arguments,u=this,l=e,n){if(c===o)return function(e){return f=e,c=Ei(y,t),p?g(e):s}(l);if(d)return ko(c),c=Ei(y,t),g(l)}return c===o&&(c=Ei(y,t)),s}return t=ga(t)||0,Xu(n)&&(p=!!n.leading,a=(d="maxWait"in n)?_n(ga(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),v.cancel=function(){c!==o&&ko(c),f=0,r=l=u=c=o},v.flush=function(){return c===o?s:m(Au())},v}var Su=Vr(function(e,t){return sr(e,1,t)}),Mu=Vr(function(e,t,n){return sr(e,ga(t)||0,n)});function Nu(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(i);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 u=e.apply(this,r);return n.cache=i.set(o,u)||i,u};return n.cache=new(Nu.Cache||Wn),n}function Du(e){if("function"!=typeof e)throw new Ie(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Nu.Cache=Wn;var Lu=mo(function(e,t){var n=(t=1==t.length&&Bu(t[0])?St(t[0],Ht(ui())):St(gr(t,1),Ht(ui()))).length;return Vr(function(r){for(var o=-1,i=yn(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return Ot(e,this,r)})}),Gu=Vr(function(e,t){var n=an(t,ii(Gu));return Ho(e,s,o,t,n)}),ju=Vr(function(e,t){var n=an(t,ii(ju));return Ho(e,64,o,t,n)}),Pu=ei(function(e,t){return Ho(e,256,o,o,o,t)});function Yu(e,t){return e===t||e!=e&&t!=t}var Qu=Uo(wr),$u=Uo(function(e,t){return e>=t}),qu=Rr(function(){return arguments}())?Rr:function(e){return ea(e)&&Ne.call(e,"callee")&&!Fe.call(e,"callee")},Bu=r.isArray,Uu=yt?Ht(yt):function(e){return ea(e)&&Or(e)==S};function Wu(e){return null!=e&&Ju(e.length)&&!Ku(e)}function Fu(e){return ea(e)&&Wu(e)}var Vu=_t||gs,zu=mt?Ht(mt):function(e){return ea(e)&&Or(e)==m};function Hu(e){if(!ea(e))return!1;var t=Or(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function Ku(e){if(!Xu(e))return!1;var t=Or(e);return t==k||t==T||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zu(e){return"number"==typeof e&&e==da(e)}function Ju(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function Xu(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=vt?Ht(vt):function(e){return ea(e)&&pi(e)==b};function na(e){return"number"==typeof e||ea(e)&&Or(e)==O}function ra(e){if(!ea(e)||Or(e)!=w)return!1;var t=Ue(e);if(null===t)return!0;var n=Ne.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Me.call(n)==je}var oa=kt?Ht(kt):function(e){return ea(e)&&Or(e)==C},ia=Tt?Ht(Tt):function(e){return ea(e)&&pi(e)==I};function ua(e){return"string"==typeof e||!Bu(e)&&ea(e)&&Or(e)==E}function aa(e){return"symbol"==typeof e||ea(e)&&Or(e)==R}var sa=bt?Ht(bt):function(e){return ea(e)&&Ju(e.length)&&!!ot[Or(e)]},ca=Uo(Lr),la=Uo(function(e,t){return e<=t});function fa(e){if(!e)return[];if(Wu(e))return ua(e)?fn(e):Io(e);if(He&&e[He])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[He]());var t=pi(e);return(t==b?on:t==I?sn:Ya)(e)}function pa(e){return e?(e=ga(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function da(e){var t=pa(e),n=t%1;return t==t?n?t-n:t:0}function ha(e){return e?ir(da(e),0,d):0}function ga(e){if("number"==typeof e)return e;if(aa(e))return p;if(Xu(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Xu(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=zt(e);var n=he.test(e);return n||_e.test(e)?st(e.slice(2),n?2:8):de.test(e)?p:+e}function _a(e){return Eo(e,Sa(e))}function ya(e){return null==e?"":uo(e)}var ma=xo(function(e,t){if(Ti(t)||Wu(t))Eo(t,xa(t),e);else for(var n in t)Ne.call(t,n)&&Xn(e,n,t[n])}),va=xo(function(e,t){Eo(t,Sa(t),e)}),ka=xo(function(e,t,n,r){Eo(t,Sa(t),e,r)}),Ta=xo(function(e,t,n,r){Eo(t,xa(t),e,r)}),ba=ei(or),Oa=Vr(function(e,t){e=we(e);var n=-1,r=t.length,i=r>2?t[2]:o;for(i&&yi(t[0],t[1],i)&&(r=1);++n<r;)for(var u=t[n],a=Sa(u),s=-1,c=a.length;++s<c;){var l=a[s],f=e[l];(f===o||Yu(f,xe[l])&&!Ne.call(e,l))&&(e[l]=u[l])}return e}),wa=Vr(function(e){return e.push(o,Zo),Ot(Na,o,e)});function Aa(e,t,n){var r=null==e?o:Tr(e,t);return r===o?n:r}function Ca(e,t){return null!=e&&di(e,t,Cr)}var Ia=Yo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ge.call(t)),e[t]=n},Xa(ns)),Ea=Yo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ge.call(t)),Ne.call(e,t)?e[t].push(n):e[t]=[n]},ui),Ra=Vr(Er);function xa(e){return Wu(e)?zn(e):Dr(e)}function Sa(e){return Wu(e)?zn(e,!0):function(e){if(!Xu(e))return function(e){var t=[];if(null!=e)for(var n in we(e))t.push(n);return t}(e);var t=Ti(e),n=[];for(var r in e)("constructor"!=r||!t&&Ne.call(e,r))&&n.push(r);return n}(e)}var Ma=xo(function(e,t,n){Yr(e,t,n)}),Na=xo(function(e,t,n,r){Yr(e,t,n,r)}),Da=ei(function(e,t){var n={};if(null==e)return n;var r=!1;t=St(t,function(t){return t=yo(t,e),r||(r=t.length>1),t}),Eo(e,ni(e),n),r&&(n=ur(n,7,Jo));for(var o=t.length;o--;)so(n,t[o]);return n}),La=ei(function(e,t){return null==e?{}:function(e,t){return qr(e,t,function(t,n){return Ca(e,n)})}(e,t)});function Ga(e,t){if(null==e)return{};var n=St(ni(e),function(e){return[e]});return t=ui(t),qr(e,n,function(e,n){return t(e,n[0])})}var ja=zo(xa),Pa=zo(Sa);function Ya(e){return null==e?[]:Kt(e,xa(e))}var Qa=Do(function(e,t,n){return t=t.toLowerCase(),e+(n?$a(t):t)});function $a(e){return Ha(ya(e).toLowerCase())}function qa(e){return(e=ya(e))&&e.replace(me,en).replace(Ze,"")}var Ba=Do(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ua=Do(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Wa=No("toLowerCase"),Fa=Do(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Va=Do(function(e,t,n){return e+(n?" ":"")+Ha(t)}),za=Do(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ha=No("toUpperCase");function Ka(e,t,n){return e=ya(e),(t=n?o:t)===o?function(e){return tt.test(e)}(e)?function(e){return e.match(Xe)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Za=Vr(function(e,t){try{return Ot(e,o,t)}catch(e){return Hu(e)?e:new Te(e)}}),Ja=ei(function(e,t){return At(t,function(t){t=Gi(t),rr(e,t,Eu(e[t],e))}),e});function Xa(e){return function(){return e}}var es=jo(),ts=jo(!0);function ns(e){return e}function rs(e){return Nr("function"==typeof e?e:ur(e,1))}var os=Vr(function(e,t){return function(n){return Er(n,e,t)}}),is=Vr(function(e,t){return function(n){return Er(e,n,t)}});function us(e,t,n){var r=xa(t),o=kr(t,r);null!=n||Xu(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=kr(t,xa(t)));var i=!(Xu(n)&&"chain"in n&&!n.chain),u=Ku(e);return At(o,function(n){var r=t[n];e[n]=r,u&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__);return(n.__actions__=Io(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Mt([this.value()],arguments))})}),e}function as(){}var ss=$o(St),cs=$o(It),ls=$o(Lt);function fs(e){return mi(e)?Bt(Gi(e)):function(e){return function(t){return Tr(t,e)}}(e)}var ps=Bo(),ds=Bo(!0);function hs(){return[]}function gs(){return!1}var _s,ys=Qo(function(e,t){return e+t},0),ms=Fo("ceil"),vs=Qo(function(e,t){return e/t},1),ks=Fo("floor"),Ts=Qo(function(e,t){return e*t},1),bs=Fo("round"),Os=Qo(function(e,t){return e-t},0);return Pn.after=function(e,t){if("function"!=typeof t)throw new Ie(i);return e=da(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=Cu,Pn.assign=ma,Pn.assignIn=va,Pn.assignInWith=ka,Pn.assignWith=Ta,Pn.at=ba,Pn.before=Iu,Pn.bind=Eu,Pn.bindAll=Ja,Pn.bindKey=Ru,Pn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Bu(e)?e:[e]},Pn.chain=fu,Pn.chunk=function(e,t,n){t=(n?yi(e,t,n):t===o)?1:_n(da(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var u=0,a=0,s=r(pt(i/t));u<i;)s[a++]=eo(e,u,u+=t);return s},Pn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Pn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return Mt(Bu(n)?Io(n):[n],gr(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,n=ui();return e=t?St(e,function(e){if("function"!=typeof e[1])throw new Ie(i);return[n(e[0]),e[1]]}):[],Vr(function(n){for(var r=-1;++r<t;){var o=e[r];if(Ot(o[0],this,n))return Ot(o[1],this,n)}})},Pn.conforms=function(e){return function(e){var t=xa(e);return function(n){return ar(n,e,t)}}(ur(e,1))},Pn.constant=Xa,Pn.countBy=hu,Pn.create=function(e,t){var n=Yn(e);return null==t?n:nr(n,t)},Pn.curry=function e(t,n,r){var i=Ho(t,8,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Pn.curryRight=function e(t,n,r){var i=Ho(t,16,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Pn.debounce=xu,Pn.defaults=Oa,Pn.defaultsDeep=wa,Pn.defer=Su,Pn.delay=Mu,Pn.difference=Yi,Pn.differenceBy=Qi,Pn.differenceWith=$i,Pn.drop=function(e,t,n){var r=null==e?0:e.length;return r?eo(e,(t=n||t===o?1:da(t))<0?0:t,r):[]},Pn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?eo(e,0,(t=r-(t=n||t===o?1:da(t)))<0?0:t):[]},Pn.dropRightWhile=function(e,t){return e&&e.length?lo(e,ui(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?lo(e,ui(t,3),!0):[]},Pn.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&yi(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=da(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:da(r))<0&&(r+=i),r=n>r?0:ha(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Pn.filter=function(e,t){return(Bu(e)?Et:hr)(e,ui(t,3))},Pn.flatMap=function(e,t){return gr(bu(e,t),1)},Pn.flatMapDeep=function(e,t){return gr(bu(e,t),l)},Pn.flatMapDepth=function(e,t,n){return n=n===o?1:da(n),gr(bu(e,t),n)},Pn.flatten=Ui,Pn.flattenDeep=function(e){return null!=e&&e.length?gr(e,l):[]},Pn.flattenDepth=function(e,t){return null!=e&&e.length?gr(e,t=t===o?1:da(t)):[]},Pn.flip=function(e){return Ho(e,512)},Pn.flow=es,Pn.flowRight=ts,Pn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];rr(r,o[0],o[1])}return r},Pn.functions=function(e){return null==e?[]:kr(e,xa(e))},Pn.functionsIn=function(e){return null==e?[]:kr(e,Sa(e))},Pn.groupBy=vu,Pn.initial=function(e){return null!=e&&e.length?eo(e,0,-1):[]},Pn.intersection=Fi,Pn.intersectionBy=Vi,Pn.intersectionWith=zi,Pn.invert=Ia,Pn.invertBy=Ea,Pn.invokeMap=ku,Pn.iteratee=rs,Pn.keyBy=Tu,Pn.keys=xa,Pn.keysIn=Sa,Pn.map=bu,Pn.mapKeys=function(e,t){var n={};return t=ui(t,3),mr(e,function(e,r,o){rr(n,t(e,r,o),e)}),n},Pn.mapValues=function(e,t){var n={};return t=ui(t,3),mr(e,function(e,r,o){rr(n,r,t(e,r,o))}),n},Pn.matches=function(e){return jr(ur(e,1))},Pn.matchesProperty=function(e,t){return Pr(e,ur(t,1))},Pn.memoize=Nu,Pn.merge=Ma,Pn.mergeWith=Na,Pn.method=os,Pn.methodOf=is,Pn.mixin=us,Pn.negate=Du,Pn.nthArg=function(e){return e=da(e),Vr(function(t){return Qr(t,e)})},Pn.omit=Da,Pn.omitBy=function(e,t){return Ga(e,Du(ui(t)))},Pn.once=function(e){return Iu(2,e)},Pn.orderBy=function(e,t,n,r){return null==e?[]:(Bu(t)||(t=null==t?[]:[t]),Bu(n=r?o:n)||(n=null==n?[]:[n]),$r(e,t,n))},Pn.over=ss,Pn.overArgs=Lu,Pn.overEvery=cs,Pn.overSome=ls,Pn.partial=Gu,Pn.partialRight=ju,Pn.partition=Ou,Pn.pick=La,Pn.pickBy=Ga,Pn.property=fs,Pn.propertyOf=function(e){return function(t){return null==e?o:Tr(e,t)}},Pn.pull=Ki,Pn.pullAll=Zi,Pn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Br(e,t,ui(n,2)):e},Pn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Br(e,t,o,n):e},Pn.pullAt=Ji,Pn.range=ps,Pn.rangeRight=ds,Pn.rearg=Pu,Pn.reject=function(e,t){return(Bu(e)?Et:hr)(e,Du(ui(t,3)))},Pn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=ui(t,3);++r<i;){var u=e[r];t(u,r,e)&&(n.push(u),o.push(r))}return Ur(e,o),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new Ie(i);return Vr(e,t=t===o?t:da(t))},Pn.reverse=Xi,Pn.sampleSize=function(e,t,n){return t=(n?yi(e,t,n):t===o)?1:da(t),(Bu(e)?Kn:Hr)(e,t)},Pn.set=function(e,t,n){return null==e?e:Kr(e,t,n)},Pn.setWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:Kr(e,t,n,r)},Pn.shuffle=function(e){return(Bu(e)?Zn:Xr)(e)},Pn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&yi(e,t,n)?(t=0,n=r):(t=null==t?0:da(t),n=n===o?r:da(n)),eo(e,t,n)):[]},Pn.sortBy=wu,Pn.sortedUniq=function(e){return e&&e.length?oo(e):[]},Pn.sortedUniqBy=function(e,t){return e&&e.length?oo(e,ui(t,2)):[]},Pn.split=function(e,t,n){return n&&"number"!=typeof n&&yi(e,t,n)&&(t=n=o),(n=n===o?d:n>>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!oa(t))&&!(t=uo(t))&&rn(e)?vo(fn(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new Ie(i);return t=null==t?0:_n(da(t),0),Vr(function(n){var r=n[t],o=vo(n,0,t);return r&&Mt(o,r),Ot(e,this,o)})},Pn.tail=function(e){var t=null==e?0:e.length;return t?eo(e,1,t):[]},Pn.take=function(e,t,n){return e&&e.length?eo(e,0,(t=n||t===o?1:da(t))<0?0:t):[]},Pn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?eo(e,(t=r-(t=n||t===o?1:da(t)))<0?0:t,r):[]},Pn.takeRightWhile=function(e,t){return e&&e.length?lo(e,ui(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?lo(e,ui(t,3)):[]},Pn.tap=function(e,t){return t(e),e},Pn.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new Ie(i);return Xu(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),xu(e,t,{leading:r,maxWait:t,trailing:o})},Pn.thru=pu,Pn.toArray=fa,Pn.toPairs=ja,Pn.toPairsIn=Pa,Pn.toPath=function(e){return Bu(e)?St(e,Gi):aa(e)?[e]:Io(Li(ya(e)))},Pn.toPlainObject=_a,Pn.transform=function(e,t,n){var r=Bu(e),o=r||Vu(e)||sa(e);if(t=ui(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:Xu(e)&&Ku(i)?Yn(Ue(e)):{}}return(o?At:mr)(e,function(e,r,o){return t(n,e,r,o)}),n},Pn.unary=function(e){return Cu(e,1)},Pn.union=eu,Pn.unionBy=tu,Pn.unionWith=nu,Pn.uniq=function(e){return e&&e.length?ao(e):[]},Pn.uniqBy=function(e,t){return e&&e.length?ao(e,ui(t,2)):[]},Pn.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?ao(e,o,t):[]},Pn.unset=function(e,t){return null==e||so(e,t)},Pn.unzip=ru,Pn.unzipWith=ou,Pn.update=function(e,t,n){return null==e?e:co(e,t,_o(n))},Pn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:co(e,t,_o(n),r)},Pn.values=Ya,Pn.valuesIn=function(e){return null==e?[]:Kt(e,Sa(e))},Pn.without=iu,Pn.words=Ka,Pn.wrap=function(e,t){return Gu(_o(t),e)},Pn.xor=uu,Pn.xorBy=au,Pn.xorWith=su,Pn.zip=cu,Pn.zipObject=function(e,t){return ho(e||[],t||[],Xn)},Pn.zipObjectDeep=function(e,t){return ho(e||[],t||[],Kr)},Pn.zipWith=lu,Pn.entries=ja,Pn.entriesIn=Pa,Pn.extend=va,Pn.extendWith=ka,us(Pn,Pn),Pn.add=ys,Pn.attempt=Za,Pn.camelCase=Qa,Pn.capitalize=$a,Pn.ceil=ms,Pn.clamp=function(e,t,n){return n===o&&(n=t,t=o),n!==o&&(n=(n=ga(n))==n?n:0),t!==o&&(t=(t=ga(t))==t?t:0),ir(ga(e),t,n)},Pn.clone=function(e){return ur(e,4)},Pn.cloneDeep=function(e){return ur(e,5)},Pn.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:o)},Pn.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:o)},Pn.conformsTo=function(e,t){return null==t||ar(e,t,xa(t))},Pn.deburr=qa,Pn.defaultTo=function(e,t){return null==e||e!=e?t:e},Pn.divide=vs,Pn.endsWith=function(e,t,n){e=ya(e),t=uo(t);var r=e.length,i=n=n===o?r:ir(da(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Pn.eq=Yu,Pn.escape=function(e){return(e=ya(e))&&z.test(e)?e.replace(F,tn):e},Pn.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Pn.every=function(e,t,n){var r=Bu(e)?It:pr;return n&&yi(e,t,n)&&(t=o),r(e,ui(t,3))},Pn.find=gu,Pn.findIndex=qi,Pn.findKey=function(e,t){return jt(e,ui(t,3),mr)},Pn.findLast=_u,Pn.findLastIndex=Bi,Pn.findLastKey=function(e,t){return jt(e,ui(t,3),vr)},Pn.floor=ks,Pn.forEach=yu,Pn.forEachRight=mu,Pn.forIn=function(e,t){return null==e?e:_r(e,ui(t,3),Sa)},Pn.forInRight=function(e,t){return null==e?e:yr(e,ui(t,3),Sa)},Pn.forOwn=function(e,t){return e&&mr(e,ui(t,3))},Pn.forOwnRight=function(e,t){return e&&vr(e,ui(t,3))},Pn.get=Aa,Pn.gt=Qu,Pn.gte=$u,Pn.has=function(e,t){return null!=e&&di(e,t,Ar)},Pn.hasIn=Ca,Pn.head=Wi,Pn.identity=ns,Pn.includes=function(e,t,n,r){e=Wu(e)?e:Ya(e),n=n&&!r?da(n):0;var o=e.length;return n<0&&(n=_n(o+n,0)),ua(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Yt(e,t,n)>-1},Pn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:da(n);return o<0&&(o=_n(r+o,0)),Yt(e,t,o)},Pn.inRange=function(e,t,n){return t=pa(t),n===o?(n=t,t=0):n=pa(n),function(e,t,n){return e>=yn(t,n)&&e<_n(t,n)}(e=ga(e),t,n)},Pn.invoke=Ra,Pn.isArguments=qu,Pn.isArray=Bu,Pn.isArrayBuffer=Uu,Pn.isArrayLike=Wu,Pn.isArrayLikeObject=Fu,Pn.isBoolean=function(e){return!0===e||!1===e||ea(e)&&Or(e)==y},Pn.isBuffer=Vu,Pn.isDate=zu,Pn.isElement=function(e){return ea(e)&&1===e.nodeType&&!ra(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(Wu(e)&&(Bu(e)||"string"==typeof e||"function"==typeof e.splice||Vu(e)||sa(e)||qu(e)))return!e.length;var t=pi(e);if(t==b||t==I)return!e.size;if(Ti(e))return!Dr(e).length;for(var n in e)if(Ne.call(e,n))return!1;return!0},Pn.isEqual=function(e,t){return xr(e,t)},Pn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:o)?n(e,t):o;return r===o?xr(e,t,o,n):!!r},Pn.isError=Hu,Pn.isFinite=function(e){return"number"==typeof e&&Gt(e)},Pn.isFunction=Ku,Pn.isInteger=Zu,Pn.isLength=Ju,Pn.isMap=ta,Pn.isMatch=function(e,t){return e===t||Sr(e,t,si(t))},Pn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:o,Sr(e,t,si(t),n)},Pn.isNaN=function(e){return na(e)&&e!=+e},Pn.isNative=function(e){if(ki(e))throw new Te("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mr(e)},Pn.isNil=function(e){return null==e},Pn.isNull=function(e){return null===e},Pn.isNumber=na,Pn.isObject=Xu,Pn.isObjectLike=ea,Pn.isPlainObject=ra,Pn.isRegExp=oa,Pn.isSafeInteger=function(e){return Zu(e)&&e>=-9007199254740991&&e<=f},Pn.isSet=ia,Pn.isString=ua,Pn.isSymbol=aa,Pn.isTypedArray=sa,Pn.isUndefined=function(e){return e===o},Pn.isWeakMap=function(e){return ea(e)&&pi(e)==x},Pn.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==Or(e)},Pn.join=function(e,t){return null==e?"":Ut.call(e,t)},Pn.kebabCase=Ba,Pn.last=Hi,Pn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=da(n))<0?_n(r+i,0):yn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Pt(e,$t,i,!0)},Pn.lowerCase=Ua,Pn.lowerFirst=Wa,Pn.lt=ca,Pn.lte=la,Pn.max=function(e){return e&&e.length?dr(e,ns,wr):o},Pn.maxBy=function(e,t){return e&&e.length?dr(e,ui(t,2),wr):o},Pn.mean=function(e){return qt(e,ns)},Pn.meanBy=function(e,t){return qt(e,ui(t,2))},Pn.min=function(e){return e&&e.length?dr(e,ns,Lr):o},Pn.minBy=function(e,t){return e&&e.length?dr(e,ui(t,2),Lr):o},Pn.stubArray=hs,Pn.stubFalse=gs,Pn.stubObject=function(){return{}},Pn.stubString=function(){return""},Pn.stubTrue=function(){return!0},Pn.multiply=Ts,Pn.nth=function(e,t){return e&&e.length?Qr(e,da(t)):o},Pn.noConflict=function(){return ft._===this&&(ft._=Pe),this},Pn.noop=as,Pn.now=Au,Pn.pad=function(e,t,n){e=ya(e);var r=(t=da(t))?ln(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return qo(dt(o),n)+e+qo(pt(o),n)},Pn.padEnd=function(e,t,n){e=ya(e);var r=(t=da(t))?ln(e):0;return t&&r<t?e+qo(t-r,n):e},Pn.padStart=function(e,t,n){e=ya(e);var r=(t=da(t))?ln(e):0;return t&&r<t?qo(t-r,n)+e:e},Pn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),vn(ya(e).replace(re,""),t||0)},Pn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&yi(e,t,n)&&(t=n=o),n===o&&("boolean"==typeof t?(n=t,t=o):"boolean"==typeof e&&(n=e,e=o)),e===o&&t===o?(e=0,t=1):(e=pa(e),t===o?(t=e,e=0):t=pa(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=kn();return yn(e+i*(t-e+at("1e-"+((i+"").length-1))),t)}return Wr(e,t)},Pn.reduce=function(e,t,n){var r=Bu(e)?Nt:Wt,o=arguments.length<3;return r(e,ui(t,4),n,o,lr)},Pn.reduceRight=function(e,t,n){var r=Bu(e)?Dt:Wt,o=arguments.length<3;return r(e,ui(t,4),n,o,fr)},Pn.repeat=function(e,t,n){return t=(n?yi(e,t,n):t===o)?1:da(t),Fr(ya(e),t)},Pn.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Pn.result=function(e,t,n){var r=-1,i=(t=yo(t,e)).length;for(i||(i=1,e=o);++r<i;){var u=null==e?o:e[Gi(t[r])];u===o&&(r=i,u=n),e=Ku(u)?u.call(e):u}return e},Pn.round=bs,Pn.runInContext=e,Pn.sample=function(e){return(Bu(e)?Hn:zr)(e)},Pn.size=function(e){if(null==e)return 0;if(Wu(e))return ua(e)?ln(e):e.length;var t=pi(e);return t==b||t==I?e.size:Dr(e).length},Pn.snakeCase=Fa,Pn.some=function(e,t,n){var r=Bu(e)?Lt:to;return n&&yi(e,t,n)&&(t=o),r(e,ui(t,3))},Pn.sortedIndex=function(e,t){return no(e,t)},Pn.sortedIndexBy=function(e,t,n){return ro(e,t,ui(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=no(e,t);if(r<n&&Yu(e[r],t))return r}return-1},Pn.sortedLastIndex=function(e,t){return no(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return ro(e,t,ui(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=no(e,t,!0)-1;if(Yu(e[n],t))return n}return-1},Pn.startCase=Va,Pn.startsWith=function(e,t,n){return e=ya(e),n=null==n?0:ir(da(n),0,e.length),t=uo(t),e.slice(n,n+t.length)==t},Pn.subtract=Os,Pn.sum=function(e){return e&&e.length?Ft(e,ns):0},Pn.sumBy=function(e,t){return e&&e.length?Ft(e,ui(t,2)):0},Pn.template=function(e,t,n){var r=Pn.templateSettings;n&&yi(e,t,n)&&(t=o),e=ya(e),t=Ta({},t,r,Ko);var i=Ta({},t.imports,r.imports,Ko),u=xa(i),a=Kt(i,u);At(u,function(e){if(ce.test(e))throw new Te("Invalid `imports` option passed into `_.template`")});var s,c,l=0,f=t.interpolate||ve,p="__p += '",d=Ae((t.escape||ve).source+"|"+f.source+"|"+(f===Z?fe:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),h="//# sourceURL="+(Ne.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(d,function(t,n,r,o,i,u){return r||(r=o),p+=e.slice(l,u).replace(ke,nn),n&&(s=!0,p+="' +\n__e("+n+") +\n'"),i&&(c=!0,p+="';\n"+i+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+t.length,t}),p+="';\n";var g=Ne.call(t,"variable")&&t.variable;if(g){if(ce.test(g))throw new Te("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(c?p.replace(q,""):p).replace(B,"$1").replace(U,"$1;"),p="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var _=Za(function(){return be(u,h+"return "+p).apply(o,a)});if(_.source=p,Hu(_))throw _;return _},Pn.times=function(e,t){if((e=da(e))<1||e>f)return[];var n=d,r=yn(e,d);t=ui(t),e-=d;for(var o=Vt(r,t);++n<e;)t(n);return o},Pn.toFinite=pa,Pn.toInteger=da,Pn.toLength=ha,Pn.toLower=function(e){return ya(e).toLowerCase()},Pn.toNumber=ga,Pn.toSafeInteger=function(e){return e?ir(da(e),-9007199254740991,f):0===e?e:0},Pn.toString=ya,Pn.toUpper=function(e){return ya(e).toUpperCase()},Pn.trim=function(e,t,n){if((e=ya(e))&&(n||t===o))return zt(e);if(!e||!(t=uo(t)))return e;var r=fn(e),i=fn(t);return vo(r,Jt(r,i),Xt(r,i)+1).join("")},Pn.trimEnd=function(e,t,n){if((e=ya(e))&&(n||t===o))return e.slice(0,pn(e)+1);if(!e||!(t=uo(t)))return e;var r=fn(e);return vo(r,0,Xt(r,fn(t))+1).join("")},Pn.trimStart=function(e,t,n){if((e=ya(e))&&(n||t===o))return e.replace(re,"");if(!e||!(t=uo(t)))return e;var r=fn(e);return vo(r,Jt(r,fn(t))).join("")},Pn.truncate=function(e,t){var n=30,r="...";if(Xu(t)){var i="separator"in t?t.separator:i;n="length"in t?da(t.length):n,r="omission"in t?uo(t.omission):r}var u=(e=ya(e)).length;if(rn(e)){var a=fn(e);u=a.length}if(n>=u)return e;var s=n-ln(r);if(s<1)return r;var c=a?vo(a,0,s).join(""):e.slice(0,s);if(i===o)return c+r;if(a&&(s+=c.length-s),oa(i)){if(e.slice(s).search(i)){var l,f=c;for(i.global||(i=Ae(i.source,ya(pe.exec(i))+"g")),i.lastIndex=0;l=i.exec(f);)var p=l.index;c=c.slice(0,p===o?s:p)}}else if(e.indexOf(uo(i),s)!=s){var d=c.lastIndexOf(i);d>-1&&(c=c.slice(0,d))}return c+r},Pn.unescape=function(e){return(e=ya(e))&&V.test(e)?e.replace(W,dn):e},Pn.uniqueId=function(e){var t=++De;return ya(e)+t},Pn.upperCase=za,Pn.upperFirst=Ha,Pn.each=yu,Pn.eachRight=mu,Pn.first=Wi,us(Pn,(_s={},mr(Pn,function(e,t){Ne.call(Pn.prototype,t)||(_s[t]=e)}),_s),{chain:!1}),Pn.VERSION="4.18.1",At(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Pn[e].placeholder=Pn}),At(["drop","take"],function(e,t){qn.prototype[e]=function(n){n=n===o?1:_n(da(n),0);var r=this.__filtered__&&!t?new qn(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,d),type:e+(r.__dir__<0?"Right":"")}),r},qn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),At(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;qn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ui(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),At(["head","last"],function(e,t){var n="take"+(t?"Right":"");qn.prototype[e]=function(){return this[n](1).value()[0]}}),At(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");qn.prototype[e]=function(){return this.__filtered__?new qn(this):this[n](1)}}),qn.prototype.compact=function(){return this.filter(ns)},qn.prototype.find=function(e){return this.filter(e).head()},qn.prototype.findLast=function(e){return this.reverse().find(e)},qn.prototype.invokeMap=Vr(function(e,t){return"function"==typeof e?new qn(this):this.map(function(n){return Er(n,e,t)})}),qn.prototype.reject=function(e){return this.filter(Du(ui(e)))},qn.prototype.slice=function(e,t){e=da(e);var n=this;return n.__filtered__&&(e>0||t<0)?new qn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(n=(t=da(t))<0?n.dropRight(-t):n.take(t-e)),n)},qn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},qn.prototype.toArray=function(){return this.take(d)},mr(qn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Pn[r?"take"+("last"==t?"Right":""):t],u=r||/^find/.test(t);i&&(Pn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,s=t instanceof qn,c=a[0],l=s||Bu(t),f=function(e){var t=i.apply(Pn,Mt([e],a));return r&&p?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(s=l=!1);var p=this.__chain__,d=!!this.__actions__.length,h=u&&!p,g=s&&!d;if(!u&&l){t=g?t:new qn(this);var _=e.apply(t,a);return _.__actions__.push({func:pu,args:[f],thisArg:o}),new $n(_,p)}return h&&g?e.apply(this,a):(_=this.thru(f),h?r?_.value()[0]:_.value():_)})}),At(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ee[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Pn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Bu(o)?o:[],e)}return this[n](function(n){return t.apply(Bu(n)?n:[],e)})}}),mr(qn.prototype,function(e,t){var n=Pn[t];if(n){var r=n.name+"";Ne.call(Rn,r)||(Rn[r]=[]),Rn[r].push({name:t,func:n})}}),Rn[Po(o,2).name]=[{name:"wrapper",func:o}],qn.prototype.clone=function(){var e=new qn(this.__wrapped__);return e.__actions__=Io(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Io(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Io(this.__views__),e},qn.prototype.reverse=function(){if(this.__filtered__){var e=new qn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},qn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Bu(e),r=t<0,o=n?e.length:0,i=function(e,t,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],u=i.size;switch(i.type){case"drop":e+=u;break;case"dropRight":t-=u;break;case"take":t=yn(t,e+u);break;case"takeRight":e=_n(e,t-u)}}return{start:e,end:t}}(0,o,this.__views__),u=i.start,a=i.end,s=a-u,c=r?a:u-1,l=this.__iteratees__,f=l.length,p=0,d=yn(s,this.__takeCount__);if(!n||!r&&o==s&&d==s)return fo(e,this.__actions__);var h=[];e:for(;s--&&p<d;){for(var g=-1,_=e[c+=t];++g<f;){var y=l[g],m=y.iteratee,v=y.type,k=m(_);if(2==v)_=k;else if(!k){if(1==v)continue e;break e}}h[p++]=_}return h},Pn.prototype.at=du,Pn.prototype.chain=function(){return fu(this)},Pn.prototype.commit=function(){return new $n(this.value(),this.__chain__)},Pn.prototype.next=function(){this.__values__===o&&(this.__values__=fa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},Pn.prototype.plant=function(e){for(var t,n=this;n instanceof Qn;){var r=Pi(n);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Pn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof qn){var t=e;return this.__actions__.length&&(t=new qn(this)),(t=t.reverse()).__actions__.push({func:pu,args:[Xi],thisArg:o}),new $n(t,this.__chain__)}return this.thru(Xi)},Pn.prototype.toJSON=Pn.prototype.valueOf=Pn.prototype.value=function(){return fo(this.__wrapped__,this.__actions__)},Pn.prototype.first=Pn.prototype.head,He&&(Pn.prototype[He]=function(){return this}),Pn}();ft._=hn,(r=function(){return hn}.call(t,n,t,e))===o||(e.exports=r)}.call(this)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};(()=>{"use strict";n.r(r),n.d(r,{ApiCallContext:()=>ot,CronExpression:()=>it,DistributedLockContext:()=>ut,GraphqlContext:()=>at,MUTATION_TYPES:()=>st,Meta:()=>y,MutationContext:()=>ct,QueryContext:()=>Ce,SecureAiAgentContext:()=>rt,SquidLlmService:()=>tt,SquidProject:()=>nt,SquidService:()=>ze,USER_CODE_MODULE_ID:()=>K,USER_CODE_PYTHON_MODULE_ID:()=>Z,WorkspaceClient:()=>Ve,aiFunction:()=>S,aiFunctionsConfigurator:()=>M,clientConnectionStateHandler:()=>W,createWebhookResponse:()=>lt,eventHandler:()=>R,executable:()=>x,getPassiveSquid:()=>et,getSquid:()=>Xe,getSquidService:()=>Ke,isWorkspaceServerConfigured:()=>Fe,limiterConfigToOptions:()=>z,limits:()=>Y,llmAsk:()=>$,llmService:()=>Q,mcpAuthorizer:()=>U,mcpServer:()=>q,mcpTool:()=>B,metadata:()=>v,onQueueMessage:()=>E,scheduler:()=>D,secureAiAgent:()=>P,secureAiQuery:()=>T,secureApi:()=>C,secureCollection:()=>b,secureDatabase:()=>k,secureDistributedLock:()=>j,secureGraphQL:()=>I,secureMetric:()=>A,secureNativeQuery:()=>G,secureStorage:()=>O,secureTopic:()=>w,squidInject:()=>Ze,trigger:()=>N,webhook:()=>L});const e=require("@squidcloud/client");let t=e=>new Error(e);function o(e,n,...r){e||function(e,...n){const r=u(e);if("object"==typeof r)throw r;throw t(r||"Assertion error",...n)}(n,...r)}function i(e,t,...n){return o(e,t,...n),e}function u(e){return void 0===e?"":"string"==typeof e?e:e()}const a=(e,t=void 0)=>{o(function(e){return"string"==typeof e}(e),()=>function(e,t,n){const r=u(e);if("object"==typeof r)throw r;return`${r?`${r}: `:""}${t} ${function(e){return void 0===e?"<undefined>":"symbol"==typeof e?e.toString():null===e?"<null>":`<${typeof e}:${e}>`}(n)}`}(t,"Not a string",e))};function s(e,t){return e instanceof Error?e.message:null!=t?t:`${e}`}const c=/^[A-Za-z0-9_-]{1,64}$/;function l(e,t){o(function(e){return c.test(e)}(e),`Invalid @aiFunction id "${e}"${t?` on ${t}`:""}: it must be 1–64 characters of letters, digits, "_" and "-" — the tool-name charset LLM providers accept.`)}function f(e){const t=e.split(":");return o(2===t.length,`Invalid service function name: ${e}`),t[1]}var p=n(243);const d=["gpt-5.4-mini","gpt-5.4-nano","gpt-5.5","gpt-5.5-pro","gpt-5.6-sol","gpt-5.6-terra","gpt-5.6-luna","gpt-4o","gpt-4o-mini","gpt-4.1","gpt-4.1-mini","gpt-4.1-nano","o1","o3","o3-mini","o4-mini","gpt-5","gpt-5-mini","gpt-5-nano","gpt-5.1","gpt-5.2","gpt-5.2-pro","gpt-5.4","claude-haiku-4-5-20251001","claude-opus-4-8","claude-sonnet-5","claude-3-7-sonnet-latest","claude-opus-4-1-20250805","claude-opus-4-20250514","claude-opus-4-5-20251101","claude-opus-4-6","claude-opus-4-7","claude-sonnet-4-20250514","claude-sonnet-4-5-20250929","claude-sonnet-4-6","gemini-3.1-pro","gemini-3.5-flash","gemini-3.1-flash-lite","gemini-2.5-pro","gemini-2.5-flash","gemini-2.5-flash-lite","gemini-3-flash","gemini-3-pro","grok-4.3","grok-4-1-fast-reasoning","grok-4-1-fast-non-reasoning","grok-3","grok-3-fast","grok-3-mini","grok-3-mini-fast","grok-4","grok-4-fast-reasoning","grok-4-fast-non-reasoning","bedrock-claude-sonnet-4-5"];function h(e){return d.includes(e)}const g={"gpt-4o":{name:"gpt-4o",displayName:"GPT-4o",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:16384,contextWindowTokens:128e3,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"gpt-4o-mini":{name:"gpt-4o-mini",displayName:"GPT-4o Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:16384,contextWindowTokens:128e3,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-mini"},"gpt-4.1":{name:"gpt-4.1",displayName:"GPT-4.1",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:32768,contextWindowTokens:1047576,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"gpt-4.1-mini":{name:"gpt-4.1-mini",displayName:"GPT-4.1 Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:32768,contextWindowTokens:1047576,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-mini"},"gpt-4.1-nano":{name:"gpt-4.1-nano",displayName:"GPT-4.1 Nano",description:"Legacy lightweight and quick",providerType:"openai",maxOutputTokens:32768,contextWindowTokens:1047576,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-nano"},o1:{name:"o1",displayName:"GPT-o1",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},o3:{name:"o3",displayName:"GPT-o3",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"o3-mini":{name:"o3-mini",displayName:"GPT-o3 Mini",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"o4-mini":{name:"o4-mini",displayName:"GPT-o4 Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-mini"},"gpt-5":{name:"gpt-5",displayName:"GPT-5",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"gpt-5-mini":{name:"gpt-5-mini",displayName:"GPT-5 Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.4-mini"},"gpt-5-nano":{name:"gpt-5-nano",displayName:"GPT-5 Nano",description:"Legacy lightweight and quick",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.4-nano"},"gpt-5.1":{name:"gpt-5.1",displayName:"GPT-5.1",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5"},"gpt-5.2":{name:"gpt-5.2",displayName:"GPT-5.2",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5"},"gpt-5.2-pro":{name:"gpt-5.2-pro",displayName:"GPT-5.2 Pro",description:"Legacy most advanced OpenAI model",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5-pro"},"gpt-5.4":{name:"gpt-5.4",displayName:"GPT-5.4",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5"},"gpt-5.4-mini":{name:"gpt-5.4-mini",displayName:"GPT-5.4 Mini",description:"Fast and efficient",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.4-nano":{name:"gpt-5.4-nano",displayName:"GPT-5.4 Nano",description:"Lightweight and quick",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.5":{name:"gpt-5.5",displayName:"GPT-5.5",description:"Powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.5-pro":{name:"gpt-5.5-pro",displayName:"GPT-5.5 Pro",description:"Most advanced OpenAI model",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.6-sol":{name:"gpt-5.6-sol",displayName:"GPT-5.6 Sol",description:"Flagship model for complex tasks",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.6-terra":{name:"gpt-5.6-terra",displayName:"GPT-5.6 Terra",description:"Balanced and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.6-luna":{name:"gpt-5.6-luna",displayName:"GPT-5.6 Luna",description:"Fast and affordable",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"claude-sonnet-5":{name:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Balanced performance",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,usesAdaptiveThinking:!0},"claude-sonnet-4-6":{name:"claude-sonnet-4-6",displayName:"Claude Sonnet 4.6",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!0,replacedBy:"claude-sonnet-5"},"claude-sonnet-4-5-20250929":{name:"claude-sonnet-4-5-20250929",displayName:"Claude Sonnet 4.5",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"claude-sonnet-5"},"claude-3-7-sonnet-latest":{name:"claude-3-7-sonnet-latest",displayName:"Claude Sonnet 3.7",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-sonnet-5",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"claude-haiku-4-5-20251001":{name:"claude-haiku-4-5-20251001",displayName:"Claude Haiku 4.5",description:"Fastest responses",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"claude-opus-4-20250514":{name:"claude-opus-4-20250514",displayName:"Claude Opus 4",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:32e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-opus-4-8",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"claude-opus-4-1-20250805":{name:"claude-opus-4-1-20250805",displayName:"Claude Opus 4.1",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:32e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-opus-4-8",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"claude-opus-4-5-20251101":{name:"claude-opus-4-5-20251101",displayName:"Claude Opus 4.5",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"claude-opus-4-8"},"claude-opus-4-6":{name:"claude-opus-4-6",displayName:"Claude Opus 4.6",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"claude-opus-4-8"},"claude-opus-4-7":{name:"claude-opus-4-7",displayName:"Claude Opus 4.7",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,usesAdaptiveThinking:!0,replacedBy:"claude-opus-4-8"},"claude-opus-4-8":{name:"claude-opus-4-8",displayName:"Claude Opus 4.8",description:"Most capable Anthropic model",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,usesAdaptiveThinking:!0},"claude-sonnet-4-20250514":{name:"claude-sonnet-4-20250514",displayName:"Claude Sonnet 4",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-sonnet-5",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"bedrock-claude-sonnet-4-5":{name:"bedrock-claude-sonnet-4-5",vendorModelName:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",displayName:"Claude Sonnet 4.5 (Bedrock)",description:"Claude Sonnet hosted on AWS Bedrock",providerType:"bedrock",requiresExplicitAvailability:!0,maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"gemini-2.5-flash":{name:"gemini-2.5-flash",displayName:"Gemini Flash 2.5",description:"Legacy fast and efficient",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gemini-3.5-flash"},"gemini-2.5-pro":{name:"gemini-2.5-pro",displayName:"Gemini Pro 2.5",description:"Legacy most capable Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gemini-3.1-pro"},"gemini-2.5-flash-lite":{name:"gemini-2.5-flash-lite",displayName:"Gemini Flash 2.5 Lite",description:"Legacy lightweight Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gemini-3.1-flash-lite"},"gemini-3-flash":{name:"gemini-3-flash",vendorModelName:"gemini-3-flash-preview",displayName:"Gemini Flash 3",description:"Legacy fast and efficient",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gemini-3.5-flash"},"gemini-3.1-flash-lite":{name:"gemini-3.1-flash-lite",displayName:"Gemini Flash 3.1 Lite",description:"Lightweight Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"gemini-3.5-flash":{name:"gemini-3.5-flash",displayName:"Gemini Flash 3.5",description:"Fast and efficient",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"gemini-3-pro":{name:"gemini-3-pro",vendorModelName:"gemini-3-pro-preview",displayName:"Gemini Pro 3",description:"Legacy most capable Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gemini-3.1-pro"},"gemini-3.1-pro":{name:"gemini-3.1-pro",vendorModelName:"gemini-3.1-pro-preview",displayName:"Gemini Pro 3.1",description:"Most capable Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"grok-3":{name:"grok-3",displayName:"Grok-3",description:"Legacy most capable Grok model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4.3",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-3-fast":{name:"grok-3-fast",displayName:"Grok-3 Fast",description:"Legacy fast general-purpose model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-non-reasoning",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-3-mini":{name:"grok-3-mini",displayName:"Grok-3 Mini",description:"Legacy most capable Grok model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4.3",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-3-mini-fast":{name:"grok-3-mini-fast",displayName:"Grok-3 Mini Fast",description:"Legacy fast general-purpose model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-non-reasoning",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4":{name:"grok-4",displayName:"Grok-4",description:"Legacy most capable Grok model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:256e3,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4.3",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4.3":{name:"grok-4.3",displayName:"Grok-4.3",description:"Most capable Grok model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,reasoning:{kind:"levels",supported:["low","medium","high"]}},"grok-4-fast-reasoning":{name:"grok-4-fast-reasoning",displayName:"Grok-4 Fast Reasoning",description:"Legacy optimized for reasoning tasks",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:256e3,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-reasoning",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4-fast-non-reasoning":{name:"grok-4-fast-non-reasoning",displayName:"Grok-4 Fast Non-Reasoning",description:"Legacy fast general-purpose model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:256e3,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-non-reasoning",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4-1-fast-reasoning":{name:"grok-4-1-fast-reasoning",displayName:"Grok-4.1 Fast Reasoning",description:"Optimized for reasoning tasks",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:2e6,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4-1-fast-non-reasoning":{name:"grok-4-1-fast-non-reasoning",displayName:"Grok-4.1 Fast Non-Reasoning",description:"Fast general-purpose model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:2e6,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1}};for(const e of Object.values(g))o(!e.replacedBy||!g[e.replacedBy]?.replacedBy,`Model ${e.name} is replaced by ${e.replacedBy}, which is also marked as replaced (is not active).`),o(!e.replacedBy||e.description.startsWith("Legacy"),`Model ${e.name} is deprecated and its description must start with 'Legacy': '${e.description}'.`);const _=(e,t)=>Array.isArray(e)?e.concat(t):void 0;class y{constructor(){this.data={codeChecksum:"initial",databases:{},storage:{},executables:{},apis:{},graphql:{},triggers:{},schedulers:{},webhooks:{},nativeQueries:{},distributedLocks:{},aiChatbots:{},clientConnectionStateChangeHandlers:[],aiFunctions:{},openApiControllersMap:{},queues:{},queueMessageHandlers:{},eventHandlers:{},metrics:{security:{write:[],all:[]}},limits:{},llms:{},mcp:{},integrationLifecycleHooks:{onIntegrationCreated:!1,onIntegrationDeleted:!1,onIntegrationChanged:!1}}}secureDatabase(t,n,r=e.BUILT_IN_DB_INTEGRATION_ID){m(this.data,{databases:{[r]:{security:{[t]:[n]}}}})}secureAiQuery(t,n=e.BUILT_IN_DB_INTEGRATION_ID){m(this.data,{databases:{[n]:{security:{aiQuery:[t]}}}})}secureCollection(t,n,r,o=e.BUILT_IN_DB_INTEGRATION_ID){m(this.data,{databases:{[o]:{collections:{[t]:{security:{[n]:[r]}}}}}})}secureStorage(t,n,r=e.BUILT_IN_STORAGE_INTEGRATION_ID){m(this.data,{storage:{[r]:{security:{[t]:[n]}}}})}secureTopic(t,n,r,o=e.BUILT_IN_QUEUE_INTEGRATION_ID){m(this.data,{queues:{[o]:{topics:{[t]:{security:{[n]:[r]}}}}}})}queueMessage(t,n,r=e.BUILT_IN_QUEUE_INTEGRATION_ID){m(this.data,{queueMessageHandlers:{[r]:{[t]:[n]}}})}eventHandler(e,t){m(this.data,{eventHandlers:{[e]:[t]}})}secureMetric(e,t,n){m(this.data,{metrics:{security:{[t]:[{namePrefix:e,serviceFunction:n}]}}})}secureApi(e,t,n){m(this.data,t?{apis:{[e]:{endpoints:{[t]:{security:[n]}}}}}:{apis:{[e]:{security:[n]}}})}secureGraphQL(e,t){m(this.data,{graphql:{[e]:{security:[t]}}})}transformDatabase(t,n,r=e.BUILT_IN_DB_INTEGRATION_ID){m(this.data,{databases:{[r]:{transform:{[t]:{type:t,serviceFunction:n}}}}})}transformCollection(t,n,r,o=e.BUILT_IN_DB_INTEGRATION_ID){m(this.data,{databases:{[o]:{collections:{[t]:{transform:{[n]:{type:n,serviceFunction:r}}}}}}})}executable(e){const t=e.split(":")[1],n={serviceFunction:e},r=this.data.executables[t];r&&r.serviceFunction!==e&&console.warn(`Executable name collision: "${t}" is registered by both "${r.serviceFunction}" and "${e}". Use qualified names to avoid ambiguity.`),m(this.data,{executables:{[t]:n,[e]:n}})}aiFunction(e,{id:t,description:n,promptId:r,params:o,attributes:i,categories:u,internal:a}){const s={aiFunctions:{[t]:{serviceFunction:e,description:n,promptId:r,params:o,attributes:i,categories:u,internal:a}}};m(this.data,s)}aiFunctionsConfigurator(e,{id:t,integrationTypes:n}){const r={aiFunctionsConfigurators:{[t]:{serviceFunction:e,integrationTypes:n}}};m(this.data,r)}trigger(e,t,n,r,i){o(!this.data.triggers[e],`Duplicate Trigger IDs: ${e}`),this.data.triggers[e]={integrationId:r,collectionName:t,functionName:n,mutationTypes:i}}scheduler(e,t,n,r){o(!this.data.schedulers[e],`Duplicate Scheduler IDs: ${e}`),this.data.schedulers[e]={cronExpression:t,functionName:n,exclusive:r}}webhook(e,t){o(!this.data.webhooks[e],`Duplicate Webhook IDs: ${e}`),this.data.webhooks[e]={functionName:t}}secureNativeQuery(e,t){m(this.data,{nativeQueries:{[e]:[t]}})}secureDistributedLock(e,t){m(this.data,e?{distributedLocks:{mutexes:{[e]:{security:[t]}}}}:{distributedLocks:{security:[t]}})}secureAiAgent(t,n){m(this.data,t?{aiChatbots:{[e.AI_AGENTS_INTEGRATION_ID]:{profiles:{[t]:{security:{chat:[n]}}}}}}:{aiChatbots:{[e.AI_AGENTS_INTEGRATION_ID]:{security:{chat:[n]}}}})}limits(e,t){m(this.data,{limits:{[e]:t}})}clientConnectionChangeHandler(e){m(this.data,{clientConnectionStateChangeHandlers:[e]})}llmService(e,t){const n=t.models;o(void 0===this.data.llms?.[e]?.models,`LLM service '${e}' is already registered.`);const r=Object.keys(n);o(r.length>0,`LLM service '${e}' must declare at least one model.`);for(const t of r)o(!h(t),`LLM service '${e}' cannot declare an already-defined model: '${t}'.`);const i=Object.values(this.data.llms??{}).flatMap(e=>Object.keys(e.models??{}));for(const e of r)o(!i.includes(e),`Model '${e}' is already defined by another LLM service.`);m(this.data,{llms:{[e]:{models:n,...void 0!==t.supportsFunctions&&{supportsFunctions:t.supportsFunctions}}}})}llmAsk(e){const t=e.split(":")[0];o(void 0===this.data.llms?.[t]?.ask,`LLM service '${t}' already has an 'ask' function defined.`),m(this.data,{llms:{[t]:{ask:e}}})}mcpServer(e,t){const n=t.id;o(void 0===Object.values(this.data.mcp||{}).find(e=>e.options?.id===n),`MCP server with id ${n} already exists (${e}).`),m(this.data,{mcp:{[e]:{options:t,tools:[]}}})}mcpAuthorizer(e){const[t,n]=e.split(":");o(!this.data.mcp?.[t]?.authorizer,`MCP server '${t}' already has authorizer: ${n}.`),m(this.data,{mcp:{[t]:{authorizer:e}}})}mcpTool(e,t){const[n,r]=e.split(":");o(void 0===this.data.mcp?.[n]?.tools?.find(t=>t.serviceFunctionName===e),`MCP server '${n}' already has tool ${r}.`),m(this.data,{mcp:{[n]:{tools:[{serviceFunctionName:e,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema}]}}})}setIntegrationLifecycleHooks(e){this.data.integrationLifecycleHooks={onIntegrationCreated:e.onIntegrationCreated,onIntegrationChanged:e.onIntegrationChanged,onIntegrationDeleted:e.onIntegrationDeleted}}}function m(e,t){(0,p.mergeWith)(e,t,_)}const v=new y;function k(e,t){return V(n=>v.secureDatabase(e,n,t))}function T(e){return V(t=>v.secureAiQuery(t,e))}function b(e,t,n){return V(r=>v.secureCollection(e,t,r,n))}function O(e,t){return V(n=>v.secureStorage(e,n,t))}function w(e,t,n){return V(r=>v.secureTopic(e,t,r,n))}function A(e){return V(t=>v.secureMetric(e.metricNamePrefix||"",e.type,t))}function C(e,t){return V(n=>v.secureApi(e,t,n))}function I(e){return V(t=>v.secureGraphQL(e,t))}function E(e,t){return V(n=>v.queueMessage(e,n,t))}function R(e){return V(t=>v.eventHandler(e,t))}function x(){return V(e=>v.executable(e))}function S(e,t=[],n={},r=[],o=!1){return function(u,a,s){const c=F(u,a),p=f(c);let d;return"object"==typeof e?(i(e.description??e.promptId,`AI function definition requires either "description" or "promptId" to be defined: ${a}`),void 0!==e.id&&l(e.id,a),d={id:e.id??p,description:e.description,promptId:e.promptId,params:i(e.params,`AI function definition requires "params" to be defined: ${a}`),attributes:e.attributes||{},categories:e.categories||[],internal:e.internal||!1}):d={id:p,description:e,promptId:void 0,params:t,attributes:n,categories:r,internal:o},v.aiFunction(c,d),s}}function M(e){return function(t,n,r){const o=F(t,n);void 0!==e.id&&l(e.id,n);const i={id:e.id??f(o),integrationTypes:e.integrationTypes};return v.aiFunctionsConfigurator(o,i),r}}function N(t,n="",r){const i="object"==typeof t?{...t}:{id:t,collection:n,integrationId:r};return o(i.collection,"Collection name can't be empty"),function(t,n,r){return i.id||(i.id=F(t,n)),v.trigger(i.id,i.collection,F(t,n),i.integrationId||e.BUILT_IN_DB_INTEGRATION_ID,i.mutationTypes),r}}function D(e,t,n=!0){return function(r,o,u){const a=F(r,o);let s;return s="object"==typeof e?{cron:e.cron,id:e.id||a,exclusive:e.exclusive??!0}:{id:e,cron:i(t,"cronExpression must be defined"),exclusive:n},v.scheduler(s.id,s.cron,a,s.exclusive),u}}function L(e){return V(t=>v.webhook(e,t))}function G(e){return V(t=>v.secureNativeQuery(e,t))}function j(e){return V(t=>v.secureDistributedLock(e,t))}function P(e){return V(t=>v.secureAiAgent(e,t))}function Y(e){return V(t=>v.limits(t,z(e)))}function Q(e){return t=>{v.llmService(t.name,e)}}function $(){return V(e=>v.llmAsk(e))}function q(e){return t=>{v.mcpServer(t.name,e)}}function B(e){return V(t=>v.mcpTool(t,e))}function U(){return V(e=>v.mcpAuthorizer(e))}function W(){return V(e=>v.clientConnectionChangeHandler(e))}function F(e,t){return`${e.constructor.name}:${t}`}function V(e){return function(t,n,r){return e(F(t,n)),r}}function z(e){return void 0!==e.rateLimit&&("number"==typeof e.rateLimit?e.rateLimit=[{value:e.rateLimit,scope:"global"}]:"object"!=typeof e.rateLimit||Array.isArray(e.rateLimit)||(e.rateLimit=[e.rateLimit]),e.rateLimit.forEach(e=>{void 0===e.scope&&(e.scope="global")})),void 0!==e.quotaLimit&&("number"==typeof e.quotaLimit?e.quotaLimit=[{value:e.quotaLimit,scope:"global",renewPeriod:"monthly"}]:"object"!=typeof e.quotaLimit||Array.isArray(e.quotaLimit)||(e.quotaLimit=[e.quotaLimit]),e.quotaLimit.forEach(e=>{void 0===e.scope&&(e.scope="global"),void 0===e.renewPeriod&&(e.renewPeriod="monthly")})),e}const H=require("path"),K="user-code",Z="user-code-python";function J(e){a(e,"Invalid application ID");const[t,n,r,i]=e.split("-");return o(!i,`Invalid application ID: ${e}`),{appId:t,environmentId:n??"prod",squidDeveloperId:r}}const X=["application","auth","mutation","native-query","query","queue","notification"];const ee=require("node:async_hooks"),te=(require("node:stream"),"__docId__"),ne=/[.\[\]]/;function re(e,t){if(!e)return;const n=t.split(ne);let r,o=e;for(;o&&n.length;){const e=n.shift();if(e){if("object"!=typeof o||!(e in o))return;r=o[e],o=r}}return r}function oe(e){return null==e}function ie(e,t){if(e===t)return!0;if(null===e||null===t)return!1;const n=typeof e;if(n!==typeof t)return!1;if("object"!==n)return e===t;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;for(const n of r)if(!o.includes(n)||!ie(e[n],t[n]))return!1;return!0}function ue(e,t){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=ae(e[r],t);return n}function ae(e,t){const n=t?t(e):void 0;if(void 0!==n)return n;if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return ue(e,t);if(e instanceof Map)return new Map(ue(Array.from(e),t));if(e instanceof Set)return new Set(ue(Array.from(e),t));if(ArrayBuffer.isView(e))return r=e,"undefined"!=typeof Buffer&&r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length);var r;const o={};for(const n in e)Object.hasOwnProperty.call(e,n)&&(o[n]=ae(e[n],t));return o}function se(e){if(Array.isArray(e))return e.map(e=>se(e));if("object"!=typeof e||null===e||e instanceof Date)return e;const t=Object.keys(e),n={};return t.sort().forEach(t=>{n[t]=se(e[t])}),n}function ce(e){return function(e){if(void 0===e)return null;const t=ae(e,e=>function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?{$date:e.toISOString()}:void 0);return JSON.stringify(t)}(se(e))}function le(e){return ae(JSON.parse(e),e=>{if(null===e||"object"!=typeof e)return;const t=e,n=t.$date;return n&&1===Object.keys(t).length?new Date(n):void 0})}function fe(e,t,n){if(e=e instanceof Date?e.getTime():e??null,t=t instanceof Date?t.getTime():t??null,"=="===n)return ie(e,t);if("!="===n)return!ie(e,t);switch(n){case"<":return!oe(e)&&(!!oe(t)||t<e);case"<=":return!!oe(t)||!oe(e)&&t<=e;case">":return!oe(t)&&(!!oe(e)||t>e);case">=":return!!oe(e)||!oe(t)&&t>=e;case"like":return"string"==typeof t&&"string"==typeof e&&pe(t,e,!1);case"not like":return!("string"==typeof t&&"string"==typeof e&&pe(t,e,!1));case"like_cs":return"string"==typeof t&&"string"==typeof e&&pe(t,e,!0);case"not like_cs":return!("string"==typeof t&&"string"==typeof e&&pe(t,e,!0));case"array_includes_some":{const n=t;return Array.isArray(t)&&Array.isArray(e)&&e.some(e=>i(n,"VALUE_CANNOT_BE_NULL").some(t=>ie(t,e)))}case"array_includes_all":{const n=t;return Array.isArray(e)&&Array.isArray(t)&&e.every(e=>i(n,"VALUE_CANNOT_BE_NULL").some(t=>ie(t,e)))}case"array_not_includes":{const n=t;return Array.isArray(t)&&Array.isArray(e)&&e.every(e=>!i(n,"VALUE_CANNOT_BE_NULL").some(t=>ie(t,e)))}default:throw new Error(`Unsupported operator comparison: ${n}`)}}function pe(e,t,n){n||(e=e.toLowerCase(),t=t.toLowerCase());const r=function(e){let t="";for(let n=0;n<e.length;++n)"\\"===e[n]?n+1<e.length&&["%","_"].includes(e[n+1])?(t+=e[n+1],n++):n+1<e.length&&"\\"===e[n+1]?(t+="\\\\",n++):t+="\\":"%"===e[n]?t+="[\\s\\S]*":"_"===e[n]?t+="[\\s\\S]":("/-\\^$*+?.()[]{}|".includes(e[n])&&(t+="\\"),t+=e[n]);return t}(t);return new RegExp(`^${r}$`).test(e)}function de(e){return"fieldName"in e}function he(e){return"docIds"in e}function ge(e,t,n){const r=e.docIds.some(e=>Object.entries(e).every(([e,r])=>fe(r,n(t,e)??null,"==")));switch(e.operator){case"==":case"in":return r;case"!=":case"not in":return!r}}function _e(e,t,n,r){const o=e,i=r(t,te);if("string"!=typeof i)return fe(o,i??null,n);let u;try{u=le(i)}catch{return fe(o,i,n)}if(!u||"object"!=typeof u||Array.isArray(u))return fe(o,i,n);const a=Object.keys(u);if(1===a.length&&"__id"===a[0]){const e=u.__id,t=function(e){if("object"==typeof e&&null!==e&&!Array.isArray(e)){const t=Object.keys(e);return 1===t.length&&"__id"===t[0]?e.__id:ce(e)}if("string"==typeof e)try{const t=le(e);if(t&&"object"==typeof t&&!Array.isArray(t)){const e=Object.keys(t);if(1===e.length&&"__id"===e[0])return t.__id}}catch{}return e}(o);return fe(t,e,n)}if(1===a.length){const e=function(e,t){if("object"==typeof e&&null!==e&&!Array.isArray(e)){const n=Object.keys(e);if(1===n.length&&n[0]===t)return e[t]}if("string"==typeof e)try{const n=le(e);if(n&&"object"==typeof n&&!Array.isArray(n)){const e=Object.keys(n);if(1===e.length&&e[0]===t)return n[t]}}catch{}return e}(o,a[0]);return fe(e,u[a[0]],n)}return"object"!=typeof o||null===o||Array.isArray(o)?fe(o,i,n):fe(ce(o),i,n)}const ye={"in:in":(e,t)=>e.every(e=>t.includes(e)),"in:not in":(e,t)=>e.every(e=>!t.includes(e)),"not in:not in":(e,t)=>t.every(t=>e.includes(t)),">:not in":(e,t)=>t.every(t=>e>=t),">=:not in":(e,t)=>t.every(t=>e>t),"<:not in":(e,t)=>t.every(t=>e<=t),"<=:not in":(e,t)=>t.every(t=>e<t),">:>":(e,t)=>e>=t,">=:>":(e,t)=>e>t,"in:>":(e,t)=>e.every(e=>e>t),">:>=":(e,t)=>e>=t,">=:>=":(e,t)=>e>=t,"in:>=":(e,t)=>e.every(e=>e>=t),"<:<":(e,t)=>e<=t,"<=:<":(e,t)=>e<t,"in:<":(e,t)=>e.every(e=>e<t),"<:<=":(e,t)=>e<=t,"<=:<=":(e,t)=>e<=t,"in:<=":(e,t)=>e.every(e=>e<=t),"like:like":(e,t)=>me(e.toLowerCase(),t.toLowerCase()),"like_cs:like":(e,t)=>me(e.toLowerCase(),t.toLowerCase()),"like:like_cs":(e,t)=>me(e,t)&&ke(t),"like_cs:like_cs":(e,t)=>me(e,t),"like:not like":(e,t)=>!ve(e.toLowerCase(),t.toLowerCase()),"like_cs:not like":(e,t)=>!ve(e.toLowerCase(),t.toLowerCase()),"like:not like_cs":(e,t)=>!ve(e.toLowerCase(),t.toLowerCase()),"like_cs:not like_cs":(e,t)=>!ve(e,t),"not like:like":(e,t)=>be(e,t),"not like_cs:like":(e,t)=>be(e,t),"not like:like_cs":(e,t)=>be(e,t),"not like_cs:like_cs":(e,t)=>be(e,t),"not like:not like":(e,t)=>me(t.toLowerCase(),e.toLowerCase()),"not like_cs:not like":(e,t)=>me(t,e)&&ke(e),"not like:not like_cs":(e,t)=>me(t.toLowerCase(),e.toLowerCase()),"not like_cs:not like_cs":(e,t)=>me(t,e),"in:like":(e,t)=>e.every(e=>fe(t,e,"like")),"in:like_cs":(e,t)=>e.every(e=>fe(t,e,"like_cs")),"in:not like":(e,t)=>e.every(e=>fe(t,e,"not like")),"in:not like_cs":(e,t)=>e.every(e=>fe(t,e,"not like_cs")),"like:in":(e,t)=>!e.includes("%")&&!e.includes("_")&&!!t.find(t=>t.toLowerCase()===e.toLowerCase()),"like_cs:in":(e,t)=>!e.includes("%")&&!e.includes("_")&&t.includes(e),"not like:in":(e,t)=>e.length>0&&Te(e)||Oe(e)&&t.includes(""),"not like_cs:in":(e,t)=>e.length>0&&Te(e)||Oe(e)&&t.includes(""),"not in:like":(e,t)=>t.length>0&&Te(t)||Oe(t)&&e.includes(""),"not in:like_cs":(e,t)=>t.length>0&&Te(t)||Oe(t)&&e.includes(""),"not in:not like":(e,t)=>!t.includes("%")&&!t.includes("_")&&!!e.find(e=>e.toLowerCase()===t.toLowerCase()),"not in:not like_cs":(e,t)=>!t.includes("%")&&!t.includes("_")&&e.includes(t),"like:not in":(e,t)=>t.every(t=>fe(e,t,"not like")),"like_cs:not in":(e,t)=>t.every(t=>fe(e,t,"not like_cs")),"not like:not in":(e,t)=>t.every(t=>fe(e,t,"like")),"not like_cs:not in":(e,t)=>t.every(t=>fe(e,t,"like_cs")),"array_includes_some:array_includes_some":(e,t)=>e.every(e=>t.includes(e)),"array_includes_all:array_includes_all":(e,t)=>e.every(e=>t.includes(e)),"array_not_includes:array_not_includes":(e,t)=>t.every(t=>e.includes(t)),"array_includes_some:array_not_includes":(e,t)=>e.every(e=>!t.includes(e)),"array_not_includes:array_includes_some":(e,t)=>t.every(t=>!e.includes(t)),"array_includes_all:array_includes_some":(e,t)=>e.every(e=>t.includes(e)),"array_includes_some:array_includes_all":(e,t)=>e.every(e=>t.includes(e)),"array_not_includes:array_includes_all":(e,t)=>t.every(t=>!e.includes(t)),"array_includes_all:array_not_includes":(e,t)=>e.every(e=>!t.includes(e))};function me(e,t,n=0,r=0){if(r>=t.length)return n>=e.length;if(n>=e.length)return Te(t.substring(r));const o=e[n],i=t[r];return"%"===o&&"%"===i?me(e,t,n+1,r+1)||me(e,t,n+1,r):"%"!==o&&("%"===i?me(e,t,n,r+1)||me(e,t,n+1,r):(o===i||"_"===i)&&me(e,t,n+1,r+1))}function ve(e,t,n=0,r=0){if(n>=e.length&&r>=t.length)return!0;if(n>=e.length)return Te(t.substring(r));if(r>=t.length)return Te(e.substring(n));const o=n<e.length?e[n]:"",i=r<t.length?t[r]:"";return"%"===o&&"%"===i?ve(e,t,n+1,r+1)||ve(e,t,n,r+1)||ve(e,t,n+1,r):"%"===o||"%"===i?ve(e,t,n,r+1)||ve(e,t,n+1,r):(o===i||"_"===o||"_"===i)&&ve(e,t,n+1,r+1)}function ke(e){return!/[a-zA-Z]/.test(e)}function Te(e){return e.split("").every(e=>"%"===e)}function be(e,t){return e.length>0&&Te(e)||t.length>0&&Te(t)||Oe(e)&&0===t.length}function Oe(e){let t=!1,n=!1;for(const r of e)switch(r){case"%":t=!0;break;case"_":if(n)return!1;n=!0;break;default:return!1}return t&&n}function we(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(!ie(e[r],t[r]))return!1}return!0}function Ae(e,t){return t.every(t=>{const n=Object.keys(t).sort();if(n.length!==e.length)return!1;for(let t=0;t<e.length;t++)if(n[t]!==e[t])return!1;return!0})}class Ce{constructor(e){this.query=e,this.query=e;const t=this.query.conditions.filter(de),n=this.query.conditions.filter(he),r=n.flatMap(e=>function(e){if("=="!==e.operator&&"in"!==e.operator)return[];if(0===e.docIds.length)return[];const t=[],n=e.docIds[0];for(const r of Object.keys(n)){const o=n[r];e.docIds.every(e=>Object.prototype.hasOwnProperty.call(e,r)&&ie(e[r],o))&&t.push({fieldName:r,operator:"==",value:o})}return t}(e));this.exactSimpleConditions=this.parseConditions(t),this.exactDocIdConditions=n,this.subqueryConditions=this.parseConditions([...t,...r])}get integrationId(){return this.query.integrationId}get collectionName(){return this.query.collectionName}get limit(){return this.query.limit}get projectFields(){return this.query.projectFields}sortedBy(e){return!e.find((e,t)=>!ie(this.query.sortOrder[t],{...e,asc:e.asc??!0}))}sortedByExact(e){return e.length===this.query.sortOrder.length&&this.sortedBy(e)}isSubqueryOf(e,t,n){return this.isSubqueryOfCondition({fieldName:e,operator:t,value:n})}isSubqueryOfCondition(e){return!!this.subqueryConditions.filter(t=>t.fieldName===e.fieldName).find(t=>this.evaluateSubset(t,e))}isSubqueryOfConditions(e){return this.parseConditions(e).every(e=>this.isSubqueryOfCondition(e))}isSubqueryOfQuery(e){if(e.collectionName!==this.collectionName||e.integrationId!==this.integrationId)return!1;for(const t of e.conditions.filter(he))if(!this.childImpliesParentDocIdCondition(t))return!1;const t=e.conditions.filter(de),n=this.isSubqueryOfConditions(t),r=this.sortedBy(e.sortOrder),o=-1===e.limit||this.limit>-1&&this.limit<e.limit,i=this.isProjectFieldsSubset(this.query.projectFields,e.projectFields);return n&&r&&o&&i}childImpliesParentDocIdCondition(e){const t=e.docIds;if(0===t.length)return!1;const n="=="===e.operator||"in"===e.operator,r=Object.keys(t[0]).sort(),o=[];for(const e of this.query.conditions)he(e)&&o.push(...e.docIds);if(!Ae(r,t)||!Ae(r,o))return!1;const i=this.buildChildEffectiveTupleSet();return n?void 0!==i.allowed&&i.allowed.every(e=>t.some(t=>we(e,t))):void 0!==i.allowed?i.allowed.every(e=>!t.some(t=>we(e,t))):t.every(e=>i.excluded.some(t=>we(e,t)))}buildChildEffectiveTupleSet(){let e;const t=[];for(const n of this.query.conditions)if(he(n))if("=="===n.operator||"in"===n.operator)e=void 0===e?[...n.docIds]:e.filter(e=>n.docIds.some(t=>we(e,t)));else for(const e of n.docIds)t.some(t=>we(t,e))||t.push(e);return void 0!==e&&t.length>0&&(e=e.filter(e=>!t.some(t=>we(e,t)))),{allowed:e,excluded:t}}isProjectFieldsSubset(e,t){if(!t)return!0;if(!e)return!1;const n=new Set(t);return e.every(e=>n.has(e))}getConditionsFor(...e){return this.subqueryConditions.filter(t=>e.includes(t.fieldName))}getConditionsForField(e){return this.subqueryConditions.filter(t=>t.fieldName===e)}documentMatchesQuery(e){for(const t of this.exactSimpleConditions){const n=t.fieldName,r=t.operator;if(n===te){const n=t.value;if("in"===r||"not in"===r){const t=(Array.isArray(n)?n:[n]).some(t=>_e(t,e,"==",re));if(!("in"===r?t:!t))return!1;continue}if(!_e(n,e,r,re))return!1;continue}const o=re(e,n);if("in"===r){if(t.value.includes(o))continue;return!1}if("not in"!==r){if(!fe(t.value,o,r))return!1}else if(t.value.includes(o))return!1}for(const t of this.exactDocIdConditions)if(!ge(t,e,re))return!1;return!0}evaluateSubset(e,t){const{operator:n,value:r}=e,{operator:o,value:i}=this.parseConditions([t])[0],u=ye[`${n}:${o}`];return!!u&&u(r,i)}parseConditions(e){const t=[],n=new Map,r=new Map;return e.forEach(e=>{switch(e.operator){case"==":case"in":n.set(e.fieldName,(n.get(e.fieldName)||[]).concat(e.value));break;case"!=":case"not in":r.set(e.fieldName,(r.get(e.fieldName)||[]).concat(e.value));break;default:t.push(e)}}),n.forEach((e,n)=>{t.push({fieldName:n,operator:"in",value:e})}),r.forEach((e,n)=>{t.push({fieldName:n,operator:"not in",value:e})}),t}}function Ie(){if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;if("undefined"!=typeof self)return self;throw new Error("Unable to locate global object")}void 0===Ie()?.SQUID_LOG_DEBUG_ENABLED&&function(e=!0){Ie().SQUID_LOG_DEBUG_ENABLED=e}(function(){let e="";return"undefined"!=typeof window&&window.location?e=new URLSearchParams(window.location.search).get("SQUID_DEBUG")||"":"undefined"!=typeof process&&process.env&&(e=process.env.SQUID_DEBUG||""),"1"===e||"true"===e}());const Ee="__squidMetadata",Re="CIRCULAR_DEPENDENCY",xe=(new ee.AsyncLocalStorage,[]);function Se(e,t,n){const r=Ne();r.codeDirByServiceClassName.set(e.name,n);let i=r.serviceInstanceByCtor.get(e);if(!i||function(e){return e[Ee]||{version:0}}(i).version<=1){const n=Ne(),r={...n,...t};o(!xe.includes(e),()=>`${Re}: ${xe[xe.length-1]?.name} => ${e.name}`),xe.push(e);try{i=n.requestLocalStorage.run(t,()=>new e(r))}finally{xe.pop()}n.serviceInstanceByCtor.set(e,i)}else(function(e,t){o(e.backendApiKey===t.backendApiKey,"backendApiKey does not match."),o(e.requestLocalStorage===t.requestLocalStorage,"requestLocalStorage does not match"),o(e.environmentId===t.environmentId,"environmentId does not match"),o(e.squidDeveloperId===t.squidDeveloperId,"squidDeveloperId does not match");const n=J(e.appId),r=J(t.appId);o(n.appId===r.appId,`appId does not match! Before: ${n.appId}, after ${r.appId}`)})(i.config,r),i.config.secrets=r.secrets,i.config.apiKeys=r.apiKeys;return i}const Me="SQUID_GLOBAL_CONFIG";function Ne(){return i(Ie()[Me],"Squid global config is not defined! Make sure you are not trying to use Squid at module load time.")}const De=require("child_process"),Le=require("crypto"),Ge=require("fs/promises"),je=require("os"),Pe=require("util"),Ye=(0,H.join)((0,je.tmpdir)(),"squid-workspaces"),Qe=/^[A-Za-z0-9_-]{1,200}$/;function $e(e){return"string"==typeof e&&Qe.test(e)}function qe(e){return function(e,t){return(0,H.join)(e,"workspaces",t)}(Ye,e)}const Be=(0,Pe.promisify)(De.execFile),Ue="SQUID_WORKSPACE_SERVER_HOST",We=(0,H.join)((0,je.tmpdir)(),"squid-workspace-ssh","id_ed25519");function Fe(){return!!process.env[Ue]}class Ve{constructor(){this.lp="WorkspaceClient"}async create(e){const t=e??(0,Le.randomUUID)();o($e(t),()=>`Invalid workspace id "${t}"`);const n=qe(t);return await(0,Ge.mkdir)(n,{recursive:!0}),await this.pull(t,n),this.buildMetadata(t,n)}async push(e){o($e(e),()=>`Invalid workspace id "${e}"`);const t=qe(e);return await this.pushDir(e,t),this.buildMetadata(e,t)}async delete(e){o($e(e),()=>`Invalid workspace id "${e}"`);const t=`${this.lp}.delete:`,n=qe(e);try{await this.rsyncEmptyTo(e)}catch(n){throw new Error(`${t} Failed to clear server-side workspace "${e}": ${s(n)}`)}await(0,Ge.rm)(n,{recursive:!0,force:!0})}buildMetadata(e,t){return{id:e,path:t}}async pull(e,t){const n=`${this.lp}.pull:`;try{await this.rsync(e,["--delete",`${this.remoteTarget()}/`,`${t}/`])}catch(t){if(this.isMissingRemoteError(t))return;throw new Error(`${n} Failed to pull workspace "${e}": ${s(t)}`)}}async pushDir(e,t){const n=`${this.lp}.push:`;try{await this.rsync(e,["--delete",`${t}/`,`${this.remoteTarget()}/`])}catch(t){throw new Error(`${n} Failed to push workspace "${e}": ${s(t)}`)}}async rsyncEmptyTo(e){const t=qe(`.empty-${(0,Le.randomUUID)()}`);await(0,Ge.mkdir)(t,{recursive:!0});try{await this.rsync(e,["--delete",`${t}/`,`${this.remoteTarget()}/`])}finally{await(0,Ge.rm)(t,{recursive:!0,force:!0})}}async rsync(e,t){await this.ensurePodKeypair();const n=`${this.sshKeyPath()}-cert-${(0,Le.randomUUID)()}.pub`;try{await this.issueCert(e,n);const r=`ssh -i ${this.sshKeyPath()} -o CertificateFile=${n} -p ${this.sshPort()} -o StrictHostKeyChecking=accept-new -o ConnectTimeout=15 -o ServerAliveInterval=15 -o ServerAliveCountMax=3`;await Be("rsync",["-a","-e",r,...t],{timeout:3e5})}finally{await(0,Ge.rm)(n,{force:!0}).catch(()=>{})}}ensurePodKeypair(){return this.podKeypairReady||(this.podKeypairReady=this.generatePodKeypair().catch(e=>{throw this.podKeypairReady=void 0,e})),this.podKeypairReady}async generatePodKeypair(){const e=this.sshKeyPath();await this.fileExists(e)||(await(0,Ge.mkdir)((0,H.join)(e,".."),{recursive:!0}),await Be("ssh-keygen",["-t","ed25519","-N","","-f",e,"-C","squid-workspace"],{timeout:3e4}))}async issueCert(e,t){const n=`${this.lp}.issueCert:`,r=(await(0,Ge.readFile)(`${this.sshKeyPath()}.pub`,"utf8")).trim();try{const{certificate:n}=await Xe().rpcManager.post("workspaces/issueCert",{workspaceId:e,ephemeralPublicKey:r});await(0,Ge.writeFile)(t,`${n}\n`,{mode:420})}catch(t){throw new Error(`${n} Failed to obtain certificate for workspace "${e}": ${s(t)}`)}}async fileExists(e){try{return await(0,Ge.access)(e),!0}catch{return!1}}remoteTarget(){return`${this.sshUser()}@${this.sshHost()}:.`}isMissingRemoteError(e){return 23===(e&&"object"==typeof e&&"code"in e?e.code:void 0)&&/no such file or directory/i.test(s(e))}sshHost(){return this.getEnv(Ue)}sshPort(){return process.env.SQUID_WORKSPACE_SERVER_PORT||"22"}sshUser(){return process.env.SQUID_WORKSPACE_SSH_USER||"workspace"}sshKeyPath(){return process.env.SQUID_WORKSPACE_SSH_KEY_PATH||We}getEnv(e){const t=process.env[e];return o(t,()=>`Missing required env var "${e}" for WorkspaceClient`),t}}class ze{constructor(){this.region=process.env.SQUID_REGION||"local",this.config=Ne(),this[Ee]={version:2},this.backendBaseUrl=function(e,t,n,r,o,i){let u="https",a=`${r||t}.${o||e}.${new URL("https://squid.cloud").host}`,s="";/^local/.test(e)&&(u="http",s=i||function(e){const t=e.replace(/^\/+/,"").split("/")[0]||"";return X.includes(t)}(n)?"8001":"8000",/android$/.test(e)?a="10.0.2.2":(c=e,/ios$/.test(c)&&(a="localhost")));var c;const l=u+"://"+a+(s?`:${s}`:""),f=n.replace(/^\/+/,"");return f?`${l}/${f}`:l}(this.region,this.config.appId,"")}get secrets(){return this.config.secrets}get apiKeys(){return this.config.apiKeys}get context(){return this.getRequestConfig().context}get squid(){return Xe()}get assetsDirectory(){const e=Object.getPrototypeOf(this).constructor.name,t=this.config.codeDir||this.config.codeDirByServiceClassName.get(e);return o(t,()=>`No codeDir found for service: ${e}`),H.resolve(t,"public")}get workspace(){return new Ve}getApiKey(){return this.config.backendApiKey}getUserAuth(){const{auth:e}=this.getRequestConfig();return"Bearer"===e?.type?e:void 0}getApiKeyAuth(){const{auth:e}=this.getRequestConfig();return"ApiKey"===e?.type?e:void 0}isAuthenticated(){const{auth:e}=this.getRequestConfig();return!!e}assertIsAuthenticated(){this.assertInRequestScope(),o(this.isAuthenticated(),"UNAUTHORIZED")}assertInRequestScope(){o(this.config.requestLocalStorage.getStore(),"This method can only be called with a valid request scope.")}assertApiKeyCall(){o(this.getApiKeyAuth(),"This method can only be called with API key")}createWebhookResponse(e,t,n){return{body:e||"",statusCode:t||(e?200:204),headers:n||{},__isWebhookResponse__:!0}}throwWebhookResponse(e){throw{body:e.body||"",statusCode:e.statusCode||500,headers:e.headers||{},__isWebhookResponse__:!0}}createOpenApiResponse(e,t,n){return{body:e||"",statusCode:t||(e?200:204),headers:n||{},__isOpenApiResponse__:!0}}throwOpenApiResponse(e){throw{body:e.body||"",statusCode:e.statusCode||500,headers:e.headers||{},__isOpenApiResponse__:!0}}async convertToSquidFile(e){return{__isSquidFile__:!0,data:new Uint8Array(await e.arrayBuffer()),fieldName:e.name,mimetype:e.type,originalName:e.name,size:e.size,encoding:e.type}}async publishAiStatusUpdate(e,t){const n={type:"aiStatus",agentId:e.agentId,messageId:e.messageId,chatId:e.chatId,jobId:e.jobId,payload:{title:e.title,body:e.body,parentStatusUpdateId:e.parentStatusUpdateId,tags:e.tags}};await this.squid.getNotificationClient().publishSystemNotification(n,[t])}getRequestConfig(){return this.assertInRequestScope(),i(this.config.requestLocalStorage.getStore(),"Failed to access request data outside of the request's scope")}}function He(e,t){return Se(e,{},t)}function Ke(e,t){const n=Object.getPrototypeOf(t).constructor.name,r=Ne().codeDirByServiceClassName.get(n);return o(r,()=>`Caller class codeDir is not set: ${n}`),He(e,r)}function Ze(e,t=K){return He(e,i(Ne().moduleById.get(t),"Module not found: "+t).codeDir)}function Je(){const e=Ne(),t=process.env.SQUID_REGION||"local",n=process.env.SQUID_CONSOLE_REGION,r=J(e.appId);return{appId:r.appId,apiKey:e.backendApiKey,squidDeveloperId:r.squidDeveloperId,environmentId:r.environmentId,region:t,consoleRegion:n}}function Xe(){return e.Squid.getInstance(Je())}function et(){return e.Squid.getInstance({...Je(),isPassiveMode:!0})}class tt extends ze{}class nt{constructor(){v.setIntegrationLifecycleHooks({onIntegrationCreated:this.onIntegrationCreated!==nt.prototype.onIntegrationCreated,onIntegrationDeleted:this.onIntegrationDeleted!==nt.prototype.onIntegrationDeleted,onIntegrationChanged:this.onIntegrationChanged!==nt.prototype.onIntegrationChanged})}get squid(){return Xe()}metadata(){return v.data}async onIntegrationCreated(e){}async onIntegrationChanged(e){}async onIntegrationDeleted(e){}async cleanup(){for(const t of e.Squid.getInstances())await t.destruct()}}class rt{constructor(e){this.agentId=e.agentId,this.prompt=e.prompt,this.options=e.options}}class ot{constructor(e){this.integrationId=e.integrationId,this.endpointId=e.endpointId,this.url=e.url,this.method=e.method,this.body=e.body,this.options=e.options}}var it;!function(e){e.EVERY_SECOND="* * * * * *",e.EVERY_5_SECONDS="*/5 * * * * *",e.EVERY_10_SECONDS="*/10 * * * * *",e.EVERY_30_SECONDS="*/30 * * * * *",e.EVERY_MINUTE="*/1 * * * *",e.EVERY_5_MINUTES="0 */5 * * * *",e.EVERY_10_MINUTES="0 */10 * * * *",e.EVERY_30_MINUTES="0 */30 * * * *",e.EVERY_HOUR="0 0-23/1 * * *",e.EVERY_2_HOURS="0 0-23/2 * * *",e.EVERY_3_HOURS="0 0-23/3 * * *",e.EVERY_4_HOURS="0 0-23/4 * * *",e.EVERY_5_HOURS="0 0-23/5 * * *",e.EVERY_6_HOURS="0 0-23/6 * * *",e.EVERY_7_HOURS="0 0-23/7 * * *",e.EVERY_8_HOURS="0 0-23/8 * * *",e.EVERY_9_HOURS="0 0-23/9 * * *",e.EVERY_10_HOURS="0 0-23/10 * * *",e.EVERY_11_HOURS="0 0-23/11 * * *",e.EVERY_12_HOURS="0 0-23/12 * * *",e.EVERY_DAY_AT_1AM="0 01 * * *",e.EVERY_DAY_AT_2AM="0 02 * * *",e.EVERY_DAY_AT_3AM="0 03 * * *",e.EVERY_DAY_AT_4AM="0 04 * * *",e.EVERY_DAY_AT_5AM="0 05 * * *",e.EVERY_DAY_AT_6AM="0 06 * * *",e.EVERY_DAY_AT_7AM="0 07 * * *",e.EVERY_DAY_AT_8AM="0 08 * * *",e.EVERY_DAY_AT_9AM="0 09 * * *",e.EVERY_DAY_AT_10AM="0 10 * * *",e.EVERY_DAY_AT_11AM="0 11 * * *",e.EVERY_DAY_AT_NOON="0 12 * * *",e.EVERY_DAY_AT_1PM="0 13 * * *",e.EVERY_DAY_AT_2PM="0 14 * * *",e.EVERY_DAY_AT_3PM="0 15 * * *",e.EVERY_DAY_AT_4PM="0 16 * * *",e.EVERY_DAY_AT_5PM="0 17 * * *",e.EVERY_DAY_AT_6PM="0 18 * * *",e.EVERY_DAY_AT_7PM="0 19 * * *",e.EVERY_DAY_AT_8PM="0 20 * * *",e.EVERY_DAY_AT_9PM="0 21 * * *",e.EVERY_DAY_AT_10PM="0 22 * * *",e.EVERY_DAY_AT_11PM="0 23 * * *",e.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",e.EVERY_WEEK="0 0 * * 7",e.EVERY_WEEKDAY="0 0 * * 1-5",e.EVERY_WEEKEND="0 0 * * 6,7",e.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",e.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",e.EVERY_2ND_HOUR="0 */2 * * *",e.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",e.EVERY_2ND_MONTH="0 0 1 */2 *",e.EVERY_QUARTER="0 0 1 */3 *",e.EVERY_6_MONTHS="0 0 1 */6 *",e.EVERY_YEAR="0 0 1 1 *",e.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",e.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",e.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",e.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",e.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",e.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",e.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",e.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",e.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",e.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",e.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",e.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",e.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",e.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",e.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",e.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",e.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",e.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",e.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",e.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",e.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",e.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",e.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",e.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",e.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5"}(it||(it={}));class ut{constructor(e){this.mutex=e}}class at{constructor(e){this.isGraphiQL=e.isGraphiQL,this.query=e.query,this.operationName=e.operationName,this.variables=e.variables}}const st=["insert","update","delete"];class ct{constructor(e,t,n){this.mutation=e,this.beforeAndAfterDocs=t,this.serverTimeStamp=n}get before(){return this.beforeAndAfterDocs.before}get after(){return this.beforeAndAfterDocs.after}getMutationType(){return this.mutation.type}affectsPath(e){return!ie(re(this.before,e),re(this.after,e))}affectedPaths(e=""){o("update"===this.mutation.type,"affectedPaths can only be used with update mutations");const t=[];return this.checkPath(e,t),t}checkPath(e,t){const n=re(this.before,e),r=re(this.after,e);if(!ie(n,r)&&(""!==e&&t.push(e),"object"==typeof n&&null!==n&&"object"==typeof r&&null!==r)){const o=Object.keys(n),i=Object.keys(r);new Set([...o,...i]).forEach(n=>{const r=e?`${e}.${n}`:n;this.checkPath(r,t)})}}}function lt(e){return{__isWebhookResponse__:!0,body:"",statusCode:204,headers:{},...e}}})();var o=exports;for(var i in r)o[i]=r[i];r.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();