PageSourceSearch

https://dxbx.ru/fe/vendor.0ec132d177a5bdf4b635.js

js dxbx.ru collected 2026-10-03 17:39:04 UTC 140,186 bytes, 2 lines download raw bytes

1/*! For license information please see vendor.0ec132d177a5bdf4b635.js.LICENSE.txt */
2try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="409c0d34-92a6-4860-b9e8-e811f1ca24ee",e._sentryDebugIdIdentifier="sentry-dbid-409c0d34-92a6-4860-b9e8-e811f1ca24ee")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"b536d8afd6805652df2813ecb6ec0bc58faae7c4"}}catch(e){}}(),(globalThis.webpackChunkdxbx_fe=globalThis.webpackChunkdxbx_fe||[]).push([[5243],{3736(){"undefined"!=typeof globalThis&&globalThis.__pretenderNodePolyfill&&(delete globalThis.self,delete globalThis.__pretenderNodePolyfill)},97083(){"undefined"!=typeof globalThis&&void 0===globalThis.self&&(globalThis.self={},globalThis.__pretenderNodePolyfill=!0)},91033(e){e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},83729(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},16547(e,t,r){var n=r(43360),i=r(75288),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var s=e[t];o.call(e,t)&&i(s,r)&&(void 0!==r||t in e)||n(e,t,r)}},74733(e,t,r){var n=r(21791),i=r(95950);e.exports=function(e,t){return e&&n(t,i(t),e)}},43838(e,t,r){var n=r(21791),i=r(37241);e.exports=function(e,t){return e&&n(t,i(t),e)}},43360(e,t,r){var n=r(93243);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},9999(e,t,r){var n=r(37217),i=r(83729),o=r(16547),s=r(74733),a=r(43838),u=r(93290),c=r(23007),l=r(92271),h=r(48948),d=r(50002),f=r(83349),p=r(5861),y=r(76189),v=r(77199),m=r(35529),g=r(56449),b=r(3656),_=r(87730),w=r(23805),k=r(38440),A=r(95950),R=r(37241),F="[object Arguments]",E="[object Function]",x="[object Object]",C={};C[F]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[x]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[E]=C["[object WeakMap]"]=!1,e.exports=function e(t,r,O,N,I,T){var P,j=1&r,S=2&r,M=4&r;if(O&&(P=I?O(t,N,I,T):O(t)),void 0!==P)return P;if(!w(t))return t;var q=g(t);if(q){if(P=y(t),!j)return c(t,P)}else{var z=p(t),D=z==E||"[object GeneratorFunction]"==z;if(b(t))return u(t,j);if(z==x||z==F||D&&!I){if(P=S||D?{}:m(t),!j)return S?h(t,a(P,t)):l(t,s(P,t))}else{if(!C[z])return I?t:{};P=v(t,z,j)}}T||(T=new n);var $=T.get(t);if($)return $;T.set(t,P),k(t)?t.forEach((function(n){P.add(e(n,r,O,n,t,T))})):_(t)&&t.forEach((function(n,i){P.set(i,e(n,r,O,i,t,T))}));var U=q?void 0:(M?S?f:d:S?R:A)(t);return i(U||t,(function(n,i){U&&(n=t[i=n]),o(P,i,e(n,r,O,i,t,T))})),P}},39344(e,t,r){var n=r(23805),i=Object.create,o=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=o},80909(e,t,r){var n=r(30641),i=r(38329)(n);e.exports=i},83120(e,t,r){var n=r(14528),i=r(45891);e.exports=function e(t,r,o,s,a){var u=-1,c=t.length;for(o||(o=i),a||(a=[]);++u<c;){var l=t[u];r>0&&o(l)?r>1?e(l,r-1,o,s,a):n(a,l):s||(a[a.length]=l)}return a}},86649(e,t,r){var n=r(83221)();e.exports=n},30641(e,t,r){var n=r(86649),i=r(95950);e.exports=function(e,t){return e&&n(e,t,i)}},20426(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e,r){return null!=e&&t.call(e,r)}},88728(e,t,r){var n=r(91033),i=r(31769),o=r(68090),s=r(68969),a=r(77797);e.exports=function(e,t,r){t=i(t,e);var u=null==(e=s(e,t))?e:e[a(o(t))];return null==u?void 0:n(u,e,r)}},29172(e,t,r){var n=r(5861),i=r(40346);e.exports=function(e){return i(e)&&"[object Map]"==n(e)}},16038(e,t,r){var n=r(5861),i=r(40346);e.exports=function(e){return i(e)&&"[object Set]"==n(e)}},72903(e,t,r){var n=r(23805),i=r(55527),o=r(90181),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=i(e),r=[];
vendor: 7,426 bytes, line 2
2for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&r.push(a);return r}},5128(e,t,r){var n=r(80909),i=r(64894);e.exports=function(e,t){var r=-1,o=i(e)?Array(e.length):[];return n(e,(function(e,n,i){o[++r]=t(e,n,i)})),o}},76001(e,t,r){var n=r(97420),i=r(80631);e.exports=function(e,t){return n(e,t,(function(t,r){return i(e,r)}))}},97420(e,t,r){var n=r(47422),i=r(73170),o=r(31769);e.exports=function(e,t,r){for(var s=-1,a=t.length,u={};++s<a;){var c=t[s],l=n(e,c);r(l,c)&&i(u,o(c,e),l)}return u}},69302(e,t,r){var n=r(83488),i=r(56757),o=r(32865);e.exports=function(e,t){return o(i(e,t,n),e+"")}},73170(e,t,r){var n=r(16547),i=r(31769),o=r(30361),s=r(23805),a=r(77797);e.exports=function(e,t,r,u){if(!s(e))return e;for(var c=-1,l=(t=i(t,e)).length,h=l-1,d=e;null!=d&&++c<l;){var f=a(t[c]),p=r;if("__proto__"===f||"constructor"===f||"prototype"===f)return e;if(c!=h){var y=d[f];void 0===(p=u?u(y,f,d):void 0)&&(p=s(y)?y:o(t[c+1])?[]:{})}n(d,f,p),d=d[f]}return e}},97189(e,t,r){var n=r(37334),i=r(93243),o=r(83488),s=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:o;e.exports=s},30514(e,t,r){var n=r(34932);e.exports=function(e,t){return n(t,(function(t){return e[t]}))}},24066(e,t,r){var n=r(83488);e.exports=function(e){return"function"==typeof e?e:n}},49653(e,t,r){var n=r(37828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},93290(e,t,r){e=r.nmd(e);var n=r(9325),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}},76169(e,t,r){var n=r(49653);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},73201(e){var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},93736(e,t,r){var n=r(51873),i=n?n.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},71961(e,t,r){var n=r(49653);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},23007(e){e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},21791(e,t,r){var n=r(16547),i=r(43360);e.exports=function(e,t,r,o){var s=!r;r||(r={});for(var a=-1,u=t.length;++a<u;){var c=t[a],l=o?o(r[c],e[c],c,r,e):void 0;void 0===l&&(l=e[c]),s?i(r,c,l):n(r,c,l)}return r}},92271(e,t,r){var n=r(21791),i=r(4664);e.exports=function(e,t){return n(e,i(e),t)}},48948(e,t,r){var n=r(21791),i=r(86375);e.exports=function(e,t){return n(e,i(e),t)}},20999(e,t,r){var n=r(69302),i=r(36800);e.exports=function(e){return n((function(t,r){var n=-1,o=r.length,s=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(s=e.length>3&&"function"==typeof s?(o--,s):void 0,a&&i(r[0],r[1],a)&&(s=o<3?void 0:s,o=1),t=Object(t);++n<o;){var u=r[n];u&&e(t,u,n,s)}return t}))}},38329(e,t,r){var n=r(64894);e.exports=function(e,t){return function(r,i){if(null==r)return r;if(!n(r))return e(r,i);for(var o=r.length,s=t?o:-1,a=Object(r);(t?s--:++s<o)&&!1!==i(a[s],s,a););return r}}},83221(e){e.exports=function(e){return function(t,r,n){for(var i=-1,o=Object(t),s=n(t),a=s.length;a--;){var u=s[e?a:++i];if(!1===r(o[u],u,o))break}return t}}},12507(e,t,r){var n=r(28754),i=r(49698),o=r(63912),s=r(13222);e.exports=function(e){return function(t){t=s(t);var r=i(t)?o(t):void 0,a=r?r[0]:t.charAt(0),u=r?n(r,1).join(""):t.slice(1);return a[e]()+u}}},62006(e,t,r){var n=r(15389),i=r(64894),o=r(95950);e.exports=function(e){return function(t,r,s){var a=Object(t);if(!i(t)){var u=n(r,3);t=o(t),r=function(e){return u(a[e],e,a)}}var c=e(t,r,s);return c>-1?a[u?t[c]:c]:void 0}}},93243(e,t,r){var n=r(33729),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},38816(e,t,r){var n=r(35970),i=r(56757),o=r(32865);e.exports=function(e){return o(i(e,void 0,n),e+"")}},83349(e,t,r){var n=r(82199),i=r(86375),o=r(37241);e.exports=function(e){return n(e,o,i)}},28879(e,t,r){var n=r(74335)(Object.getPrototypeOf,Object);e.exports=n},86375(e,t,r){var n=r(14528),i=r(28879),o=r(4664),s=r(63345),a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,o(e)),e=i(e);return t}:s;e.exports=a},76189(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},77199(e,t,r){var n=r(49653),i=r(76169),o=r(73201),s=r(93736),a=r(71961);e.exports=function(e,t,r){var u=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new u(+e);case"[object DataView]":return i(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(e,r);case"[object Map]":case"[object Set]":return new u;case"[object Number]":case"[object String]":return new u(e);case"[object RegExp]":return o(e);case"[object Symbol]":return s(e)}}},35529(e,t,r){var n=r(39344),i=r(28879),o=r(55527);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:n(i(e))}},45891(e,t,r){var n=r(51873),i=r(72428),o=r(56449),s=n?n.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(s&&e&&e[s])}},36800(e,t,r){var n=r(75288),i=r(64894),o=r(30361),s=r(23805);e.exports=function(e,t,r){if(!s(r))return!1;var a=typeof t;return!!("number"==a?i(r)&&o(t,r.length):"string"==a&&t in r)&&n(r[t],e)}},90181(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},56757(e,t,r){var n=r(91033),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,s=-1,a=i(o.length-t,0),u=Array(a);++s<a;)u[s]=o[t+s];s=-1;for(var c=Array(t+1);++s<t;)c[s]=o[s];return c[t]=r(u),n(e,this,c)}}},68969(e,t,r){var n=r(47422),i=r(25160);e.exports=function(e,t){return t.length<2?e:n(e,i(t,0,-1))}},32865(e,t,r){var n=r(97189),i=r(51811)(n);e.exports=i},51811(e){var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},86139(e,t,r){var n=r(16547),i=r(21791),o=r(20999),s=r(64894),a=r(55527),u=r(95950),c=Object.prototype.hasOwnProperty,l=o((function(e,t){if(a(t)||s(t))i(t,u(t),e);else for(var r in t)c.call(t,r)&&n(e,r,t[r])}));e.exports=l},88055(e,t,r){var n=r(9999);e.exports=function(e){return n(e,5)}},83673(e){e.exports=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i}},37334(e){e.exports=function(e){return function(){return e}}},7309(e,t,r){var n=r(62006)(r(24713));e.exports=n},24713(e,t,r){var n=r(2523),i=r(15389),o=r(61489),s=Math.max;e.exports=function(e,t,r){var a=null==e?0:e.length;if(!a)return-1;var u=null==r?0:o(r);return u<0&&(u=s(a+u,0)),n(e,i(t,3),u)}},35970(e,t,r){var n=r(83120);e.exports=function(e){return null!=e&&e.length?n(e,1):[]}},52420(e,t,r){var n=r(86649),i=r(24066),o=r(37241);e.exports=function(e,t){return null==e?e:n(e,i(t),o)}},61448(e,t,r){var n=r(20426),i=r(49326);e.exports=function(e,t){return null!=e&&i(e,t,n)}},66154(e,t,r){var n=r(91033),i=r(80909),o=r(88728),s=r(69302),a=r
2(64894),u=s((function(e,t,r){var s=-1,u="function"==typeof t,c=a(e)?Array(e.length):[];return i(e,(function(e){c[++s]=u?n(t,e,r):o(e,t,r)})),c}));e.exports=u},62193(e,t,r){var n=r(88984),i=r(5861),o=r(72428),s=r(56449),a=r(64894),u=r(3656),c=r(55527),l=r(37167),h=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(a(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||l(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!n(e).length;for(var r in e)if(h.call(e,r))return!1;return!0}},64846(e,t,r){var n=r(61489);e.exports=function(e){return"number"==typeof e&&e==n(e)}},87730(e,t,r){var n=r(29172),i=r(27301),o=r(86009),s=o&&o.isMap,a=s?i(s):n;e.exports=a},11331(e,t,r){var n=r(72552),i=r(28879),o=r(40346),s=Function.prototype,a=Object.prototype,u=s.toString,c=a.hasOwnProperty,l=u.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==l}},38440(e,t,r){var n=r(16038),i=r(27301),o=r(86009),s=o&&o.isSet,a=s?i(s):n;e.exports=a},37241(e,t,r){var n=r(70695),i=r(72903),o=r(64894);e.exports=function(e){return o(e)?n(e,!0):i(e)}},68090(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},8455(e,t,r){var n=r(12507)("toLowerCase");e.exports=n},55378(e,t,r){var n=r(34932),i=r(15389),o=r(5128),s=r(56449);e.exports=function(e,t){return(s(e)?n:o)(e,i(t,3))}},73916(e,t,r){var n=r(43360),i=r(30641),o=r(15389);e.exports=function(e,t){var r={};return t=o(t,3),i(e,(function(e,i,o){n(r,i,t(e,i,o))})),r}},44383(e,t,r){var n=r(76001),i=r(38816)((function(e,t){return null==e?{}:n(e,t)}));e.exports=i},63375(e,t,r){var n=r(55765);e.exports=function(e){return e&&e.length?n(e):[]}},35880(e,t,r){var n=r(30514),i=r(95950);e.exports=function(e){return null==e?[]:n(e,i(e))}},45243(e,t,r){"use strict";r.d(t,{YK:()=>pr,sA:()=>fn});var n=r(11331),i=r.n(n),o=r(1882),s=r.n(o),a=r(73916),u=r.n(a),c=r(63375),l=r.n(c),h=r(35970),d=r.n(h),f=Object.prototype.toString;var p=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},y=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function v(e){return e.split("").map((function(e){return"(?:"+e.toUpperCase()+"|"+e.toLowerCase()+")"})).join("")}function m(e,t){for(var r=e.length-1;r>=0;r--)e[r]===t&&Array.prototype.splice.call(e,r,1)}function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var b={},_=function(){function e(){p(this,e),this.plurals=[],this.singulars=[],this.uncountables=[],this.humans=[],this.acronyms={},this.acronymRegex=/(?=a)b/}return y(e,null,[{key:"getInstance",value:function(t){return b[t]=b[t]||new e,b[t]}}]),y(e,[{key:"acronym",value:function(e){this.acronyms[e.toLowerCase()]=e;var t=[];for(var r in this.acronyms)g(this.acronyms,r)&&t.push(this.acronyms[r]);this.acronymRegex=new RegExp(t.join("|"))}},{key:"plural",value:function(e,t){"string"==typeof e&&m(this.uncountables,e),m(this.uncountables,t),this.plurals.unshift([e,t])}},{key:"singular",value:function(e,t){"string"==typeof e&&m(this.uncountables,e),m(this.uncountables,t),this.singulars.unshift([e,t])}},{key:"irregular",value:function(e,t){m(this.uncountables,e),m(this.uncountables,t);var r=e[0],n=e.substr(1),i=t[0],o=t.substr(1);if(r.toUpperCase()===i.toUpperCase())this.plural(new RegExp("("+r+")"+n+"$","i"),"$1"+o),this.plural(new RegExp("("+i+")"+o+"$","i"),"$1"+o),this.singular(new RegExp("("+r+")"+n+"$","i"),"$1"+n),this.singular(new RegExp("("+i+")"+o+"$","i"),"$1"+n);else{var s=v(n),a=v(o);this.plural(new RegExp(r.toUpperCase()+s+"$"),i.toUpperCase()+o),this.plural(new RegExp(r.toLowerCase()+s+"$"),i.toLowerCase()+o),this.plural(new RegExp(i.toUpperCase()+a+"$"),i.toUpperCase()+o),this.plural(new RegExp(i.toLowerCase()+a+"$"),i.toLowerCase()+o),this.singular(new RegExp(r.toUpperCase()+s+"$"),r.toUpperCase()+n),this.singular(new RegExp(r.toLowerCase()+s+"$"),r.toLowerCase()+n),this.singular(new RegExp(i.toUpperCase()+a+"$"),r.toUpperCase()+n),this.singular(new RegExp(i.toLowerCase()+a+"$"),r.toLowerCase()+n)}}},{key:"uncountable",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.uncountables=this.uncountables.concat(t)}},{key:"human",value:function(e,t){this.humans.unshift([e,t])}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";"all"===e?(this.plurals=[],this.singulars=[],this.uncountables=[],this.humans=[]):this[e]=[]}}]),e}(),w={en:function(e){e.plural(/$/,"s"),e.plural(/s$/i,"s"),e.plural(/^(ax|test)is$/i,"$1es"),e.plural(/(octop|vir)us$/i,"$1i"),e.plural(/(octop|vir)i$/i,"$1i"),e.plural(/(alias|status)$/i,"$1es"),e.plural(/(bu)s$/i,"$1ses"),e.plural(/(buffal|tomat)o$/i,"$1oes"),e.plural(/([ti])um$/i,"$1a"),e.plural(/([ti])a$/i,"$1a"),e.plural(/sis$/i,"ses"),e.plural(/(?:([^f])fe|([lr])f)$/i,"$1$2ves"),e.plural(/(hive)$/i,"$1s"),e.plural(/([^aeiouy]|qu)y$/i,"$1ies"),e.plural(/(x|ch|ss|sh)$/i,"$1es"),e.plural(/(matr|vert|ind)(?:ix|ex)$/i,"$1ices"),e.plural(/^(m|l)ouse$/i,"$1ice"),e.plural(/^(m|l)ice$/i,"$1ice"),e.plural(/^(ox)$/i,"$1en"),e.plural(/^(oxen)$/i,"$1"),e.plural(/(quiz)$/i,"$1zes"),e.singular(/s$/i,""),e.singular(/(ss)$/i,"$1"),e.singular(/(n)ews$/i,"$1ews"),e.singular(/([ti])a$/i,"$1um"),e.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i,"$1sis"),e.singular(/(^analy)(sis|ses)$/i,"$1sis"),e.singular(/([^f])ves$/i,"$1fe"),e.singular(/(hive)s$/i,"$1"),e.singular(/(tive)s$/i,"$1"),e.singular(/([lr])ves$/i,"$1f"),e.singular(/([^aeiouy]|qu)ies$/i,"$1y"),e.singular(/(s)eries$/i,"$1eries"),e.singular(/(m)ovies$/i,"$1ovie"),e.singular(/(x|ch|ss|sh)es$/i,"$1"),e.singular(/^(m|l)ice$/i,"$1ouse"),e.singular(/(bus)(es)?$/i,"$1"),e.singular(/(o)es$/i,"$1"),e.singular(/(shoe)s$/i,"$1"),e.singular(/(cris|test)(is|es)$/i,"$1is"),e.singular(/^(a)x[ie]s$/i,"$1xis"),e.singular(/(octop|vir)(us|i)$/i,"$1us"),e.singular(/(alias|status)(es)?$/i,"$1"),e.singular(/^(ox)en/i,"$1"),e.singular(/(vert|ind)ices$/i,"$1ex"),e.singular(/(matr)ices$/i,"$1ix"),e.singular(/(quiz)zes$/i,"$1"),e.singular(/(database)s$/i,"$1"),e.irregular("person","people"),e.irregular("man","men"),e.irregular("child","children"),e.irregular("sex","sexes"),e.irregular("move","moves"),e.irregular("zombie","zombies"),e.uncountable("equipment","information","rice","money","species","series","fish","sheep","jeans","police")}};function k(e,t){if(r=e,"[object Function]"===f.call(r)&&(t=e,e=null),e=e||"en",!t)return _.getInstance(e);var r;t(_.getInstance(e))}for(var A in w)k(A,w[A]);function R(e,t){var r,n,i,o=""+e;if(0===o.length)return o;var s=o.toLowerCase().match(/\b\w+$/);if(s&&k().uncountables.indexOf(s[0])>-1)return o;for(var a=0,u=t.length;a<u;a++)if(n=(r=t[a])[0],i=r[1],o.match(n)){o=o.replace(n,i);break}return o}function F(e){return R(e,k(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en").plurals)}function E(e){return R(e,k(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en").singulars)}function x(e){var t=null==e?"":String(e);return t.charAt(0).toUpperCase()+t.slice(1)}var C={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Æ:"AE",Ç:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O","×":"x",Ø:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",Þ:"Th",ß:"ss",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",æ:"ae",ç:"c",è:"e",é:"e",ê:"e",ë:"e",ì:"i",í:"i",î:"i",ï:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",þ:"th",ÿ:"y",Ā:"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",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"L",ł:"l",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"'n",Ŋ:"NG",ŋ:"ng",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",Ŕ:"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",А:"A",Б:"B",В:"V",Г:"G",Д:"D",Е:"E",Ё:"E",Ж:"ZH",З:"Z",И:"I",Й:"J",К:"K",Л:"L",М:"M",Н:"N",О:"O",П:"P",Р:"R",С:"S",Т:"T",У:"U",Ф:"F",Х:"KH",Ц:"C",Ч:"CH",Ш:"SH",Щ:"SHCH",Ъ:"",Ы:"Y",Ь:"",Э:"E",Ю:"YU",Я:"YA",а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"j",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"c",ч:"ch",ш:"sh",щ:"shch",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya"},O={};!function(){function e(){for(var t in p(this,e),this.approximations={},C)this.approximate(t,C[t])}y(e,null,[{key:"getInstance",value:function(t){return O[t]=O[t]||new e,O[t]}}]),y(e,[{key:"approximate",value:function(e,t){this.approximations[e]=t}},{key:"transliterate",value:function(e,t){var r=this;
2return e.replace(/[^\u0000-\u007f]/g,(function(e){return r.approximations[e]||t||"?"}))}}])}();var N=r(8455),I=r.n(N),T=r(2404),P=r.n(T),j=r(55378),S=r.n(j),M=r(88055),q=r.n(M),z=r(66154),D=r.n(z),$=r(83673),U=r.n($),H=r(61448),L=r.n(H),K=r(35880),B=r.n(K),Y=r(62193),G=r.n(Y),W=r(58156),V=r.n(W),X=r(50014),J=r.n(X),Q=r(52420),Z=r.n(Q),ee=r(44383),te=r.n(ee),re=r(86139),ne=r.n(re),ie=r(7309),oe=r.n(ie),se=r(64846),ae=r.n(se),ue=(r(97083),Object.create);function ce(){var e=ue(null);return e.__=void 0,delete e.__,e}var le=function(e,t,r){this.path=e,this.matcher=t,this.delegate=r};le.prototype.to=function(e,t){var r=this.delegate;if(r&&r.willAddRoute&&(e=r.willAddRoute(this.matcher.target,e)),this.matcher.add(this.path,e),t){if(0===t.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,e,t,this.delegate)}};var he=function(e){this.routes=ce(),this.children=ce(),this.target=e};function de(e,t,r){return function(n,i){var o=e+n;if(!i)return new le(o,t,r);i(de(o,t,r))}}function fe(e,t,r){for(var n=0,i=0;i<e.length;i++)n+=e[i].path.length;var o={path:t=t.substr(n),handler:r};e.push(o)}function pe(e,t,r,n){for(var i=t.routes,o=Object.keys(i),s=0;s<o.length;s++){var a=o[s],u=e.slice();fe(u,a,i[a]);var c=t.children[a];c?pe(u,c,r,n):r.call(n,u)}}function ye(e){return e.split("/").map(me).join("/")}he.prototype.add=function(e,t){this.routes[e]=t},he.prototype.addChild=function(e,t,r,n){var i=new he(t);this.children[e]=i;var o=de(e,i,n);n&&n.contextEntered&&n.contextEntered(t,o),r(o)};var ve=/%|\//g;function me(e){return e.length<3||-1===e.indexOf("%")?e:decodeURIComponent(e).replace(ve,encodeURIComponent)}var ge=/%(?:2(?:4|6|B|C)|3(?:B|D|A)|40)/g;function be(e){return encodeURIComponent(e).replace(ge,decodeURIComponent)}var _e=/(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\)/g,we=Array.isArray,ke=Object.prototype.hasOwnProperty;function Ae(e,t){if("object"!=typeof e||null===e)throw new Error("You must pass an object as the second argument to `generate`.");if(!ke.call(e,t))throw new Error("You must provide param `"+t+"` to `generate`.");var r=e[t],n="string"==typeof r?r:""+r;if(0===n.length)throw new Error("You must provide a param `"+t+"`.");return n}var Re=[];Re[0]=function(e,t){for(var r=t,n=e.value,i=0;i<n.length;i++){var o=n.charCodeAt(i);r=r.put(o,!1,!1)}return r},Re[1]=function(e,t){return t.put(47,!0,!0)},Re[2]=function(e,t){return t.put(-1,!1,!0)},Re[4]=function(e,t){return t};var Fe=[];Fe[0]=function(e){return e.value.replace(_e,"\\$1")},Fe[1]=function(){return"([^/]+)"},Fe[2]=function(){return"(.+)"},Fe[4]=function(){return""};var Ee=[];Ee[0]=function(e){return e.value},Ee[1]=function(e,t){var r=Ae(t,e.value);return Me.ENCODE_AND_DECODE_PATH_SEGMENTS?be(r):r},Ee[2]=function(e,t){return Ae(t,e.value)},Ee[4]=function(){return""};var xe=Object.freeze({}),Ce=Object.freeze([]);function Oe(e,t,r){t.length>0&&47===t.charCodeAt(0)&&(t=t.substr(1));for(var n=t.split("/"),i=void 0,o=void 0,s=0;s<n.length;s++){var a,u,c=n[s];12&(a=2<<(u=""===c?4:58===c.charCodeAt(0)?1:42===c.charCodeAt(0)?2:0))&&(c=c.slice(1),(i=i||[]).push(c),(o=o||[]).push(!!(4&a))),14&a&&r[u]++,e.push({type:u,value:me(c)})}return{names:i||Ce,shouldDecodes:o||Ce}}function Ne(e,t,r){return e.char===t&&e.negate===r}var Ie=function(e,t,r,n,i){this.states=e,this.id=t,this.char=r,this.negate=n,this.nextStates=i?t:null,this.pattern="",this._regex=void 0,this.handlers=void 0,this.types=void 0};function Te(e,t){return e.negate?e.char!==t&&-1!==e.char:e.char===t||-1===e.char}function Pe(e,t){for(var r=[],n=0,i=e.length;n<i;n++){var o=e[n];r=r.concat(o.match(t))}return r}Ie.prototype.regex=function(){return this._regex||(this._regex=new RegExp(this.pattern)),this._regex},Ie.prototype.get=function(e,t){var r=this.nextStates;if(null!==r)if(we(r))for(var n=0;n<r.length;n++){var i=this.states[r[n]];if(Ne(i,e,t))return i}else{var o=this.states[r];if(Ne(o,e,t))return o}},Ie.prototype.put=function(e,t,r){var n;if(n=this.get(e,t))return n;var i=this.states;return n=new Ie(i,i.length,e,t,r),i[i.length]=n,null==this.nextStates?this.nextStates=n.id:we(this.nextStates)?this.nextStates.push(n.id):this.nextStates=[this.nextStates,n.id],n},Ie.prototype.match=function(e){var t=this.nextStates;if(!t)return[];var r=[];if(we(t))for(var n=0;n<t.length;n++){var i=this.states[t[n]];Te(i,e)&&r.push(i)}else{var o=this.states[t];Te(o,e)&&r.push(o)}return r};var je=function(e){this.length=0,this.queryParams=e||{}};function Se(e){var t;e=e.replace(/\+/gm,"%20");try{t=decodeURIComponent(e)}catch(e){t=""}return t}je.prototype.splice=Array.prototype.splice,je.prototype.slice=Array.prototype.slice,je.prototype.push=Array.prototype.push;var Me=function(){this.names=ce();var e=[],t=new Ie(e,0,-1,!0,!1);e[0]=t,this.states=e,this.rootState=t};Me.prototype.add=function(e,t){for(var r,n=this.rootState,i="^",o=[0,0,0],s=new Array(e.length),a=[],u=!0,c=0,l=0;l<e.length;l++){for(var h=e[l],d=Oe(a,h.path,o),f=d.names,p=d.shouldDecodes;c<a.length;c++){var y=a[c];4!==y.type&&(u=!1,n=n.put(47,!1,!1),i+="/",n=Re[y.type](y,n),i+=Fe[y.type](y))}s[l]={handler:h.handler,names:f,shouldDecodes:p}}u&&(n=n.put(47,!1,!1),i+="/"),n.handlers=s,n.pattern=i+"$",n.types=o,"object"==typeof t&&null!==t&&t.as&&(r=t.as),r&&(this.names[r]={segments:a,handlers:s})},Me.prototype.handlersFor=function(e){var t=this.names[e];if(!t)throw new Error("There is no route named "+e);for(var r=new Array(t.handlers.length),n=0;n<t.handlers.length;n++){var i=t.handlers[n];r[n]=i}return r},Me.prototype.hasRoute=function(e){return!!this.names[e]},Me.prototype.generate=function(e,t){var r=this.names[e],n="";if(!r)throw new Error("There is no route named "+e);for(var i=r.segments,o=0;o<i.length;o++){var s=i[o];
24!==s.type&&(n+="/",n+=Ee[s.type](s,t))}return"/"!==n.charAt(0)&&(n="/"+n),t&&t.queryParams&&(n+=this.generateQueryString(t.queryParams)),n},Me.prototype.generateQueryString=function(e){var t=[],r=Object.keys(e);r.sort();for(var n=0;n<r.length;n++){var i=r[n],o=e[i];if(null!=o){var s=encodeURIComponent(i);if(we(o))for(var a=0;a<o.length;a++){var u=i+"[]="+encodeURIComponent(o[a]);t.push(u)}else s+="="+encodeURIComponent(o),t.push(s)}}return 0===t.length?"":"?"+t.join("&")},Me.prototype.parseQueryString=function(e){for(var t=e.split("&"),r={},n=0;n<t.length;n++){var i=t[n].split("="),o=Se(i[0]),s=o.length,a=!1,u=void 0;1===i.length?u="true":(s>2&&"[]"===o.slice(s-2)&&(a=!0,r[o=o.slice(0,s-2)]||(r[o]=[])),u=i[1]?Se(i[1]):""),a?r[o].push(u):r[o]=u}return r},Me.prototype.recognize=function(e){var t,r=[this.rootState],n={},i=!1,o=e.indexOf("#");-1!==o&&(e=e.substr(0,o));var s=e.indexOf("?");if(-1!==s){var a=e.substr(s+1,e.length);e=e.substr(0,s),n=this.parseQueryString(a)}"/"!==e.charAt(0)&&(e="/"+e);var u=e;Me.ENCODE_AND_DECODE_PATH_SEGMENTS?e=ye(e):(e=decodeURI(e),u=decodeURI(u));var c=e.length;c>1&&"/"===e.charAt(c-1)&&(e=e.substr(0,c-1),u=u.substr(0,u.length-1),i=!0);for(var l=0;l<e.length&&(r=Pe(r,e.charCodeAt(l))).length;l++);for(var h=[],d=0;d<r.length;d++)r[d].handlers&&h.push(r[d]);r=function(e){return e.sort((function(e,t){var r=e.types||[0,0,0],n=r[0],i=r[1],o=r[2],s=t.types||[0,0,0],a=s[0],u=s[1],c=s[2];if(o!==c)return o-c;if(o){if(n!==a)return a-n;if(i!==u)return u-i}return i!==u?i-u:n!==a?a-n:0}))}(h);var f=h[0];return f&&f.handlers&&(i&&f.pattern&&"(.+)$"===f.pattern.slice(-5)&&(u+="/"),t=function(e,t,r){var n=e.handlers,i=e.regex();if(!i||!n)throw new Error("state not initialized");var o=t.match(i),s=1,a=new je(r);a.length=n.length;for(var u=0;u<n.length;u++){var c=n[u],l=c.names,h=c.shouldDecodes,d=xe,f=!1;if(l!==Ce&&h!==Ce)for(var p=0;p<l.length;p++){f=!0;var y=l[p],v=o&&o[s++];d===xe&&(d={}),Me.ENCODE_AND_DECODE_PATH_SEGMENTS&&h[p]?d[y]=v&&decodeURIComponent(v):d[y]=v}a[u]={handler:c.handler,params:d,isDynamic:f}}return a}(f,u,n)),t},Me.VERSION="0.3.4",Me.ENCODE_AND_DECODE_PATH_SEGMENTS=!0,Me.Normalizer={normalizeSegment:me,normalizePath:ye,encodePathSegment:be},Me.prototype.map=function(e,t){var r=new he;e(de("",r,this.delegate)),pe([],r,(function(e){t?t(this,e):this.add(e)}),this)};const qe=Me;var ze=function(e,t,r,n){this.type=e,this.bubbles=t,this.cancelable=r,this.target=n};ze.prototype={stopPropagation:function(){},preventDefault:function(){this.defaultPrevented=!0}};var De={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Multiple Choice",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"},$e={"Accept-Charset":!0,"Accept-Encoding":!0,Connection:!0,"Content-Length":!0,Cookie:!0,Cookie2:!0,"Content-Transfer-Encoding":!0,Date:!0,Expect:!0,Host:!0,"Keep-Alive":!0,Referer:!0,TE:!0,Trailer:!0,"Transfer-Encoding":!0,Upgrade:!0,"User-Agent":!0,Via:!0};function Ue(e,t){t.addEventListener(e,(function(r){var n=t["on"+e];n&&"function"==typeof n&&n.call(r.target,r)}))}function He(){this._eventListeners={};for(var e=["loadstart","progress","load","abort","loadend"],t=e.length-1;t>=0;t--)Ue(e[t],this)}function Le(){He.call(this),this.readyState=Le.UNSENT,this.requestHeaders={},this.requestBody=null,this.status=0,this.statusText="",this.upload=new He,this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.onreadystatechange=null,this.ontimeout=null}He.prototype={addEventListener:function(e,t){this._eventListeners[e]=this._eventListeners[e]||[],this._eventListeners[e].push(t)},removeEventListener:function(e,t){for(var r=this._eventListeners[e]||[],n=0,i=r.length;n<i;++n)if(r[n]==t)return r.splice(n,1)},dispatchEvent:function(e){for(var t=e.type,r=this._eventListeners[t]||[],n=0;n<r.length;n++)"function"==typeof r[n]?r[n].call(this,e):r[n].handleEvent(e);return!!e.defaultPrevented},_progress:function(e,t,r){var n=new ze("progress");n.target=this,n.lengthComputable=e,n.loaded=t,n.total=r,this.dispatchEvent(n)}},Le.prototype=new He,Le.UNSENT=0,Le.OPENED=1,Le.HEADERS_RECEIVED=2,Le.LOADING=3,Le.DONE=4;var Ke={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4,async:!0,withCredentials:!1,open:function(e,t,r,n,i){this.method=e,this.url=t,this.async="boolean"!=typeof r||r,this.username=n,this.password=i,this.responseText=null,this.response=this.responseText,this.responseXML=null,this.responseURL=t,this.requestHeaders={},this.sendFlag=!1,this._readyStateChange(Le.OPENED)},setRequestHeader:function(e,t){if(Ye(this),$e[e]||/^(Sec-|Proxy-)/.test(e))throw new Error('Refused to set unsafe header "'+e+'"');this.requestHeaders[e]?this.requestHeaders[e]+=","+t:this.requestHeaders[e]=t},send:function(e){if(Ye(this),!/^(get|head)$/i.test(this.method)){var t=!1;
2Object.keys(this.requestHeaders).forEach((function(e){"content-type"===e.toLowerCase()&&(t=!0)})),t||(e||"").toString().match("FormData")||(this.requestHeaders["Content-Type"]="text/plain;charset=UTF-8"),this.requestBody=e}this.errorFlag=!1,this.sendFlag=this.async,this._readyStateChange(Le.OPENED),"function"==typeof this.onSend&&this.onSend(this),this.dispatchEvent(new ze("loadstart",!1,!1,this))},abort:function(){this.aborted=!0,this.responseText=null,this.response=this.responseText,this.errorFlag=!0,this.requestHeaders={},this.dispatchEvent(new ze("abort",!1,!1,this)),this.readyState>Le.UNSENT&&this.sendFlag&&(this._readyStateChange(Le.UNSENT),this.sendFlag=!1),"function"==typeof this.onerror&&this.onerror()},getResponseHeader:function(e){if(this.readyState<Le.HEADERS_RECEIVED)return null;if(/^Set-Cookie2?$/i.test(e))return null;for(var t in e=e.toLowerCase(),this.responseHeaders)if(t.toLowerCase()==e)return this.responseHeaders[t];return null},getAllResponseHeaders:function(){if(this.readyState<Le.HEADERS_RECEIVED)return"";var e="";for(var t in this.responseHeaders)this.responseHeaders.hasOwnProperty(t)&&!/^Set-Cookie2?$/i.test(t)&&(e+=t+": "+this.responseHeaders[t]+"\r\n");return e},overrideMimeType:function(e){"string"==typeof e&&(this.forceMimeType=e.toLowerCase())},_readyStateChange:function(e){this.readyState=e,"function"==typeof this.onreadystatechange&&this.onreadystatechange(new ze("readystatechange")),this.dispatchEvent(new ze("readystatechange")),this.readyState==Le.DONE&&this.dispatchEvent(new ze("load",!1,!1,this)),this.readyState!=Le.UNSENT&&this.readyState!=Le.DONE||this.dispatchEvent(new ze("loadend",!1,!1,this))},_setResponseHeaders:function(e){for(var t in this.responseHeaders={},e)e.hasOwnProperty(t)&&(this.responseHeaders[t]=e[t]);this.forceMimeType&&(this.responseHeaders["Content-Type"]=this.forceMimeType),this.async?this._readyStateChange(Le.HEADERS_RECEIVED):this.readyState=Le.HEADERS_RECEIVED},_setResponseBody:function(e){!function(e){if(e.readyState==Le.DONE)throw new Error("Request done")}(this),function(e){if(e.async&&e.readyState!=Le.HEADERS_RECEIVED)throw new Error("No headers received")}(this),function(e){if("string"!=typeof e){var t=new Error("Attempted to respond to fake XMLHttpRequest with "+e+", which is not a string.");throw t.name="InvalidBodyException",t}}(e);var t=this.chunkSize||10,r=0;this.responseText="",this.response=this.responseText;do{this.async&&this._readyStateChange(Le.LOADING),this.responseText+=e.substring(r,r+t),this.response=this.responseText,r+=t}while(r<e.length);var n,i,o=this.getResponseHeader("Content-Type");if(this.responseText&&(!o||/(text\/xml)|(application\/xml)|(\+xml)/.test(o)))try{this.responseXML=(n=this.responseText,"undefined"!=typeof DOMParser?i=(new DOMParser).parseFromString(n,"text/xml"):((i=new ActiveXObject("Microsoft.XMLDOM")).async="false",i.loadXML(n)),i)}catch(e){}this.async?this._readyStateChange(Le.DONE):this.readyState=Le.DONE},respond:function(e,t,r){this._setResponseHeaders(t||{}),this.status="number"==typeof e?e:200,this.statusText=De[this.status],this._setResponseBody(r||"")}};for(var Be in Ke)Le.prototype[Be]=Ke[Be];function Ye(e){if(e.readyState!==Le.OPENED)throw new Error("INVALID_STATE_ERR");if(e.sendFlag)throw new Error("INVALID_STATE_ERR")}const Ge=Le;var We="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},Ve=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e},Xe=Object.prototype.hasOwnProperty;function Je(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}var Qe={stringify:function(e,t){t=t||"";var r,n,i=[];for(n in"string"!=typeof t&&(t="?"),e)if(Xe.call(e,n)){if((r=e[n])||null!=r&&!isNaN(r)||(r=""),n=encodeURIComponent(n),r=encodeURIComponent(r),null===n||null===r)continue;i.push(n+"="+r)}return i.length?t+i.join("&"):""},parse:function(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,n={};t=r.exec(e);){var i=Je(t[1]),o=Je(t[2]);null===i||null===o||i in n||(n[i]=o)}return n}}
vendor: 5,300 bytes, line 2
2,Ze=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,et=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,tt=/^[a-zA-Z]:/,rt=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function nt(e){return(e||"").toString().replace(rt,"")}var it=[["#","hash"],["?","query"],function(e,t){return at(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],ot={hash:1,query:1};function st(e){var t,r=("undefined"!=typeof window?window:void 0!==We?We:"undefined"!=typeof self?self:{}).location||{},n={},i=typeof(e=e||r);if("blob:"===e.protocol)n=new ct(unescape(e.pathname),{});else if("string"===i)for(t in n=new ct(e,{}),ot)delete n[t];else if("object"===i){for(t in e)t in ot||(n[t]=e[t]);void 0===n.slashes&&(n.slashes=Ze.test(e.href))}return n}function at(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function ut(e,t){e=nt(e),t=t||{};var r,n=et.exec(e),i=n[1]?n[1].toLowerCase():"",o=!!n[2],s=!!n[3],a=0;return o?s?(r=n[2]+n[3]+n[4],a=n[2].length+n[3].length):(r=n[2]+n[4],a=n[2].length):s?(r=n[3]+n[4],a=n[3].length):r=n[4],"file:"===i?a>=2&&(r=r.slice(2)):at(i)?r=n[4]:i?o&&(r=r.slice(2)):a>=2&&at(t.protocol)&&(r=n[4]),{protocol:i,slashes:o||at(i),slashesCount:a,rest:r}}function ct(e,t,r){if(e=nt(e),!(this instanceof ct))return new ct(e,t,r);var n,i,o,s,a,u,c=it.slice(),l=typeof t,h=this,d=0;for("object"!==l&&"string"!==l&&(r=t,t=null),r&&"function"!=typeof r&&(r=Qe.parse),n=!(i=ut(e||"",t=st(t))).protocol&&!i.slashes,h.slashes=i.slashes||n&&t.slashes,h.protocol=i.protocol||t.protocol||"",e=i.rest,("file:"===i.protocol&&(2!==i.slashesCount||tt.test(e))||!i.slashes&&(i.protocol||i.slashesCount<2||!at(h.protocol)))&&(c[3]=[/(.*)/,"pathname"]);d<c.length;d++)"function"!=typeof(s=c[d])?(o=s[0],u=s[1],o!=o?h[u]=e:"string"==typeof o?~(a=e.indexOf(o))&&("number"==typeof s[2]?(h[u]=e.slice(0,a),e=e.slice(a+s[2])):(h[u]=e.slice(a),e=e.slice(0,a))):(a=o.exec(e))&&(h[u]=a[1],e=e.slice(0,a.index)),h[u]=h[u]||n&&s[3]&&t[u]||"",s[4]&&(h[u]=h[u].toLowerCase())):e=s(e,h);r&&(h.query=r(h.query)),n&&t.slashes&&"/"!==h.pathname.charAt(0)&&(""!==h.pathname||""!==t.pathname)&&(h.pathname=function(e,t){if(""===e)return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),s++):s&&(0===n&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),"."!==i&&".."!==i||r.push(""),r.join("/")}(h.pathname,t.pathname)),"/"!==h.pathname.charAt(0)&&at(h.protocol)&&(h.pathname="/"+h.pathname),Ve(h.port,h.protocol)||(h.host=h.hostname,h.port=""),h.username=h.password="",h.auth&&(s=h.auth.split(":"),h.username=s[0]||"",h.password=s[1]||""),h.origin="file:"!==h.protocol&&at(h.protocol)&&h.host?h.protocol+"//"+h.host:"null",h.href=h.toString()}ct.prototype={set:function(e,t,r){var n=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||Qe.parse)(t)),n[e]=t;break;case"port":n[e]=t,Ve(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,/:\d+$/.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";n[e]=t.charAt(0)!==i?i+t:t}else n[e]=t;break;default:n[e]=t}for(var o=0;o<it.length;o++){var s=it[o];s[4]&&(n[s[1]]=n[s[1]].toLowerCase())}return n.origin="file:"!==n.protocol&&at(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n},toString:function(e){e&&"function"==typeof e||(e=Qe.stringify);var t,r=this,n=r.protocol;n&&":"!==n.charAt(n.length-1)&&(n+=":");var i=n+(r.slashes||at(r.protocol)?"//":"");return r.username&&(i+=r.username,r.password&&(i+=":"+r.password),i+="@"),i+=r.host+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(i+=r.hash),i}},ct.extractProtocol=ut,ct.location=st,ct.trimLeft=nt,ct.qs=Qe;var lt=ct;function ht(e){var t=new lt(e);t.host||(t.href=t.href);var r=t.pathname;"/"!==r.charAt(0)&&(r="/"+r);var n=t.host;return"80"!==t.port&&"443"!==t.port||(n=t.hostname),{host:n,protocol:t.protocol,search:t.query,hash:t.hash,href:t.href,pathname:r,fullpath:r+(t.query||"")+(t.hash||"")}}var dt=function(){this.verbs={GET:new qe,PUT:new qe,POST:new qe,DELETE:new qe,PATCH:new qe,HEAD:new qe,OPTIONS:new qe}},ft=function(){function e(){this.registries={}}return e.prototype.forURL=function(e){var t=ht(e).host,r=this.registries[t];return void 0===r&&(r=this.registries[t]=new dt),r.verbs},e}(),pt="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==pt&&pt,yt="URLSearchParams"in pt,vt="Symbol"in pt&&"iterator"in Symbol,mt="FileReader"in pt&&"Blob"in pt&&function(){try{return new Blob,!0}catch(e){return!1}}(),gt="FormData"in pt,bt="ArrayBuffer"in pt;if(bt)var _t=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array
2]"],wt=ArrayBuffer.isView||function(e){return e&&_t.indexOf(Object.prototype.toString.call(e))>-1};function kt(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function At(e){return"string"!=typeof e&&(e=String(e)),e}function Rt(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return vt&&(t[Symbol.iterator]=function(){return t}),t}function Ft(e){this.map={},e instanceof Ft?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function Et(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function xt(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function Ct(e){var t=new FileReader,r=xt(t);return t.readAsArrayBuffer(e),r}function Ot(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Nt(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:mt&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:gt&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:yt&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():bt&&mt&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=Ot(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):bt&&(ArrayBuffer.prototype.isPrototypeOf(e)||wt(e))?this._bodyArrayBuffer=Ot(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):yt&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},mt&&(this.blob=function(){var e=Et(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?Et(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(Ct)}),this.text=function(){var e,t,r,n=Et(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=xt(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},gt&&(this.formData=function(){return this.text().then(Pt)}),this.json=function(){return this.text().then(JSON.parse)},this}Ft.prototype.append=function(e,t){e=kt(e),t=At(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},Ft.prototype.delete=function(e){delete this.map[kt(e)]},Ft.prototype.get=function(e){return e=kt(e),this.has(e)?this.map[e]:null},Ft.prototype.has=function(e){return this.map.hasOwnProperty(kt(e))},Ft.prototype.set=function(e,t){this.map[kt(e)]=At(t)},Ft.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},Ft.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),Rt(e)},Ft.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Rt(e)},Ft.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),Rt(e)},vt&&(Ft.prototype[Symbol.iterator]=Ft.prototype.entries);var It=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Tt(e,t){if(!(this instanceof Tt))throw new TypeError('Please use the "new" operator, this DOM object c
2onstructor cannot be called as a function.');var r,n,i=(t=t||{}).body;if(e instanceof Tt){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Ft(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Ft(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),It.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function Pt(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function jt(e,t){if(!(this instanceof jt))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new Ft(t.headers),this.url=t.url||"",this._initBody(e)}Tt.prototype.clone=function(){return new Tt(this,{body:this._bodyInit})},Nt.call(Tt.prototype),Nt.call(jt.prototype),jt.prototype.clone=function(){return new jt(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Ft(this.headers),url:this.url})},jt.error=function(){var e=new jt(null,{status:0,statusText:""});return e.type="error",e};var St=[301,302,303,307,308];jt.redirect=function(e,t){if(-1===St.indexOf(t))throw new RangeError("Invalid status code");return new jt(null,{status:t,headers:{location:e}})};var Mt=pt.DOMException;try{new Mt}catch(e){(Mt=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),Mt.prototype.constructor=Mt}function qt(e,t){return new Promise((function(r,n){var i=new Tt(e,t);if(i.signal&&i.signal.aborted)return n(new Mt("Aborted","AbortError"));var o=new XMLHttpRequest;function s(){o.abort()}o.onload=function(){var e,t,n={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new Ft,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};n.url="responseURL"in o?o.responseURL:n.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;setTimeout((function(){r(new jt(i,n))}),0)},o.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},o.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},o.onabort=function(){setTimeout((function(){n(new Mt("Aborted","AbortError"))}),0)},o.open(i.method,function(e){try{return""===e&&pt.location.href?pt.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&(mt?o.responseType="blob":bt&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(o.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof Ft?i.headers.forEach((function(e,t){o.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){o.setRequestHeader(e,At(t.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",s),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",s)}),o.send(void 0===i._bodyInit?null:i._bodyInit)}))}qt.polyfill=!0,pt.fetch||(pt.fetch=qt,pt.Headers=Ft,pt.Request=Tt,pt.Response=jt);var zt=Object.freeze({__proto__:null,Headers:Ft,Request:Tt,Response:jt,get DOMException(){return Mt},fetch:qt}),Dt=function(){function e(){this.length=0}return e.prototype.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0},e}();function $t(e,t,r){var n=0,i=e.requestBody;
2i&&(i instanceof FormData?i.forEach((function(e){e instanceof File?n+=e.size:n+=e.length})):n=i.byteLength||i.size||i.length||0),setTimeout((function(){if(e.aborted||e.status)e.status&&(e.upload._progress(!0,n,n),e._progress(!0,n,n));else{var i=(new Date).getTime()-t.getTime(),o=r<=0?0:i/r*n;e.upload._progress(!0,o,n),e._progress(!0,o,n),$t(e,t,r)}}),50)}var Ut={};function Ht(e){return function(t,r,n){return this.register(e,t,r,n)}}var Lt=function(){function e(){var e=this;this.hosts=new ft,this.handlers=[],this.get=Ht("GET"),this.post=Ht("POST"),this.put=Ht("PUT"),this.delete=Ht("DELETE"),this.patch=Ht("PATCH"),this.head=Ht("HEAD"),this.options=Ht("OPTIONS"),this.passthrough=Ut;var t=arguments[arguments.length-1],r="object"==typeof t?t:null,n=r&&!1===r.trackRequests;this.handledRequests=n?new Dt:[],this.passthroughRequests=n?new Dt:[],this.unhandledRequests=n?new Dt:[],this.requestReferences=[],this.forcePassthrough=r&&!0===r.forcePassthrough,this.disableUnhandled=r&&!0===r.disableUnhandled,this._nativeXMLHttpRequest=self.XMLHttpRequest,this.running=!1;var i={pretender:this};this.ctx=i,self.XMLHttpRequest=function(e){function t(){Ge.call(this)}return t.prototype=Object.create(Ge.prototype),t.prototype.constructor=t,t.prototype.send=function(){if(this.sendArguments=arguments,!e.pretender.running)throw new Error("You shut down a Pretender instance while there was a pending request. That request just tried to complete. Check to see if you accidentally shut down a pretender earlier than you intended to");Ge.prototype.send.apply(this,arguments),e.pretender.checkPassthrough(this)?this.passthrough():e.pretender.handleRequest(this)},t.prototype.passthrough=function(){if(!this.sendArguments)throw new Error("You attempted to passthrough a FakeRequest that was never sent. Call `.send()` on the original request first");var t=function(e,t){var r,n=["error","timeout","abort","readystatechange"],i=[],o=["readyState","responseText","response","responseXML","responseURL","status","statusText"],s=e._passthroughRequest=new t;function a(e,t,r){e.dispatchEvent(r),e["on"+t]&&e["on"+t](r)}function u(t){s["on"+t]=function(r){!function(e,t,r){for(var n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i])}}(o,s,e),a(e,t,r)}}function c(t){s.upload&&e.upload&&e.upload["on"+t]&&(s.upload["on"+t]=function(r){a(e.upload,t,r)})}s.open(e.method,e.url,e.async,e.username,e.password),"arraybuffer"===e.responseType&&(o=["readyState","response","status","statusText"],s.responseType=e.responseType),"onload"in s&&n.push("load"),e.async&&"arraybuffer"!==e.responseType&&(n.push("progress"),i.push("progress"));for(r=0;r<n.length;r++)u(n[r]);for(r=0;r<i.length;r++)c(i[r]);for(var l in e.async&&(s.timeout=e.timeout,s.withCredentials=e.withCredentials),s.timeout||0===s.timeout||(s.timeout=0),e.requestHeaders)s.setRequestHeader(l,e.requestHeaders[l]);return s}(this,e.pretender._nativeXMLHttpRequest);return t.send.apply(t,this.sendArguments),t},t.prototype._passthroughCheck=function(e,t){return this._passthroughRequest?this._passthroughRequest[e].apply(this._passthroughRequest,t):Ge.prototype[e].apply(this,t)},t.prototype.abort=function(){return this._passthroughCheck("abort",arguments)},t.prototype.getResponseHeader=function(){return this._passthroughCheck("getResponseHeader",arguments)},t.prototype.getAllResponseHeaders=function(){return this._passthroughCheck("getAllResponseHeaders",arguments)},e.pretender._nativeXMLHttpRequest.prototype._passthroughCheck&&console.warn("You created a second Pretender instance while there was already one running. Running two Pretender servers at once will lead to unexpected results and will be removed entirely in a future major version.Please call .shutdown() on your instances when you no longer need them to respond."),t}(i),this._fetchProps=zt?["fetch","Headers","Request","Response"]:[],this._fetchProps.forEach((function(t){e["_native"+t]=self[t],self[t]=zt[t]}),this),this.running=!0;for(var o=r?arguments.length-1:arguments.length,s=0;s<o;s++)this.map(arguments[s])}return e.prototype.map=function(e){e.call(this)},e.prototype.register=function(e,t,r,n){if(!r)throw new Error("The function you tried passing to Pretender to handle "+e+" "+t+" is undefined or missing.");var i=r;return i.numberOfCalls=0,i.async=n,this.handlers.push(i),this.hosts.forURL(t)[e].add([{path:ht(t).fullpath,handler:i}]),i},e.prototype.checkPassthrough=function(e){var t=e.method.toUpperCase(),r=ht(e.url).fullpath,n=this.hosts.forURL(e.url)[t].recognize(r),i=n&&n[0];return!!(i&&i.handler===Ut||this.forcePassthrough)&&(this.passthroughRequests.push(e),this.passthroughRequest(t,r,e),!0)},e.prototype.handleRequest=function(e){var t=e.method.toUpperCase(),r=e.url,n=this._handlerFor(t,r,e);if(n){n.handler.numberOfCalls++;var i=n.handler.async;this.handledRequests.push(e);var o=this,s=function(n){if(s=n,"[object Array]"!==Object.prototype.toString.call(s))throw new Error("Nothing returned by handler for "+r+". Remember to `return [status, headers, body];` in your route handler.");var s,a=n[0],u=o.prepareHeaders(n[1]),c=o.prepareBody(n[2],u);o.handleResponse(e,i,(function(){e.respond(a,u,c),o.handledRequest(t,r,e)}))};try{var a=n.handler(e);a&&"function"==typeof a.then?a.then((function(e){s(e)})):s(a)}catch(n){this.erroredRequest(t,r,e,n),this.resolve(e)}}else this.disableUnhandled||(this.unhandledRequests.push(e),this.unhandledRequest(t,r,e))},e.prototype.handleResponse=function(e,t,r){var n="function"==typeof t?t():t;if(!1===(n="boolean"==typeof n||"number"==typeof n?n:0))r();else{var i=this;i.requestReferences.push({request:e,callback:r}),!0!==n&&($t(e,new Date,n),setTimeout((function(){i.resolve(e)}),n))}},e.prototype.resolve=function(e){for(var t=0,r=this.requestReferences.length;t<r;t++){var n=this.requestReferences[t];if(n.request===e){n.callback(),this.requestReferences.splice(t,1);break}}},e.prototype.requiresManualResolution=function(e,t){var r=this._handlerFor(e.toUpperCase(),t,{});if(!r)return!1;var n=r.handler.async;return"function"==typeof n?!0===n():!0===n},e.prototype.prepareBody=function(e,t){return e},e.prototype.prepareHeaders=function(e){return e},e.prototype.handledRequest=function(e,t,r){},e.prototype.passthroughRequest=function(e,t,r){},e.prototype.unhandledRequest=function(e,t,r){throw new Error("Pretender intercepted "+e+" "+t+" but no handler was defined for this type of request")},e.prototype.erroredRequest=function(e,t,r,n){throw n.message="Pretender intercepted "+e+" "+t+" but encountered an error: "+n.message,n},e.prototype.shutdown=function(){var e=this;self.XMLHttpRequest=this._nativeXMLHttpRequest,this._fetchProps.forEach((function(t){self[t]=e["_native"+t]}),this),this.ctx.pretender=void 0,this.running=!1},e.prototype._handlerFor=function(e,t,r){var n=this.hosts.forURL(t)[e].recognize(ht(t).fullpath),i=n?n[0]:null;return i&&(r.params=i.params,r.queryParams=n.queryParams),i},e.parseURL=ht,e.Hosts=ft,e.Registry=dt,e}();Lt.parseURL=ht,Lt.Hosts=ft,Lt.Registry=dt;
2const Kt=Lt;function Bt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yt(e){return Yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yt(e)}function Gt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Vt(e,t,r){return t&&Wt(e.prototype,t),r&&Wt(e,r),e}function Xt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Zt(e,t)}function Qt(e){return Qt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Qt(e)}function Zt(e,t){return Zt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Zt(e,t)}function er(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function tr(e,t,r){return tr=er()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Zt(i,r.prototype),i},tr.apply(null,arguments)}function rr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nr(e){var t=er();return function(){var r,n=Qt(e);if(t){var i=Qt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return rr(e)}(this,r)}}function ir(e,t){return sr(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],s=!0,a=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==r.return||r.return()}finally{if(a)throw i}}return o}}(e,t)||ur(e,t)||lr()}function or(e){return function(e){if(Array.isArray(e))return cr(e)}(e)||ar(e)||ur(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sr(e){if(Array.isArray(e))return e}function ar(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ur(e,t){if(e){if("string"==typeof e)return cr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?cr(e,t):void 0}}function cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lr(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}r(3736);var hr=function e(){this.build=function(t){var r=this,n={},o=Object.assign({},this.attrs);delete o.afterCreate,Object.keys(o).forEach((function(t){e.isTrait.call(r,t)&&delete o[t]}));var a=function(e,t){var r,n=new function(){},i=[];return Object.keys(e).forEach((function(e){var t;Object.defineProperty(n.constructor.prototype,e,{get:function(){return i.push([r,e]),t},set:function(e){t=e},enumerable:!1,configurable:!0})})),Object.keys(e).forEach((function(t){var r=e[t];"function"!=typeof r&&(n[t]=r)})),Object.keys(e).forEach((function(o){var s=e[o];r=o,"function"==typeof s&&(n[o]=s.call(n,t)),i.push([o])})),function(e){for(var t=l()(d()(e)),r=t.length,n=new Array(r),i={},o=r,s=function o(s,a,u){if(u.indexOf(s)>=0)throw new Error("Cyclic dependency in properties ".concat(JSON.stringify(u)));if(!i[a]){i[a]=!0;var c=e.filter((function(e){return e&&e[0]===s}));if(a=c.length){var l=u.concat(s);do{var h=c[--a][1];h&&o(h,t.indexOf(h),l)}while(a)}n[--r]=s}};o--;)i[o]||s(t[o],o,[]);return n.reverse()}(i)}(o,t);return a.forEach((function(e){var r,a;r=function(e){return u()(e,a)},a=function(e){return Array.isArray(e)?e.map(a):i()(e)?r(e):s()(e)?e.call(o,t):e};var c=o[e];s()(c)?n[e]=c.call(n,t):n[e]=a(c)})),n}};hr.extend=function(e){var t=Object.assign({},this.attrs,e),r=function(){this.attrs=t,hr.call(this)};return r.extend=hr.extend,r.extractAfterCreateCallbacks=hr.extractAfterCreateCallbacks,r.isTrait=hr.isTrait,r.attrs=t,r},hr.extractAfterCreateCallbacks=function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).traits,r=[],n=this.attrs||{};return n.afterCreate&&r.push(n.afterCreate),(Array.isArray(t)?t:Object.keys(n)).filter((function(t){return e.isTrait(t)&&n[t].extension.afterCreate}
2)).forEach((function(e){r.push(n[e].extension.afterCreate)})),r},hr.isTrait=function(e){var t=this.attrs;return i()(t[e])&&!0===t[e].__isTrait__};var dr=function(){function e(){Gt(this,e),this._nextId=1,this._ids={}}return Vt(e,[{key:"get",value:function(){return this._nextId}},{key:"set",value:function(e){if(this._ids[e])throw new Error("Attempting to use the ID ".concat(e,", but it's already been used"));var t;(+(t=e)).toString()===t.toString()&&+e>=this._nextId&&(this._nextId=+e+1),this._ids[e]=!0}},{key:"inc",value:function(){var e=this.get()+1;return this._nextId=e,e}},{key:"fetch",value:function(){var e=this.get();return this._ids[e]=!0,this.inc(),e.toString()}},{key:"reset",value:function(){this._nextId=1,this._ids={}}}]),e}(),fr=console.warn,pr=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;Gt(this,e),this.code=t,this.headers=r,204===t?void 0!==n&&""!==n?fr("Mirage: One of your route handlers is returning a custom\n          204 Response that has data, but this is a violation of the HTTP spec\n          and could lead to unexpected behavior. 204 responses should have no\n          content (an empty string) as their body."):this.data="":void 0!==n&&""!==n||Object.prototype.hasOwnProperty.call(this.headers,"Content-Type")?this.data=n:this.data={},204===t||Object.prototype.hasOwnProperty.call(this.headers,"Content-Type")||(this.headers["Content-Type"]="application/json")}return Vt(e,[{key:"toRackResponse",value:function(){return[this.code,this.headers,this.data]}}]),e}(),yr={},vr={},mr={},gr={};function br(e){if("string"!=typeof yr[e]){var t=function(e,t){null==t&&(t=!0);var r=""+e;return(r=t?r.replace(/^[a-z\d]*/,(function(e){return k().acronyms[e]||x(e)})):r.replace(new RegExp("^(?:"+k().acronymRegex.source+"(?=\\b|[A-Z_])|\\w)"),(function(e){return e.toLowerCase()}))).replace(/(?:_|(\/))([a-z\d]*)/gi,(function(e,t,r,n,i){return t||(t=""),""+t+(k().acronyms[r]||x(r))}))}(wr(e),!1).split("/").map(I()).join("/");yr[e]=t}return yr[e]}function _r(e){if("string"!=typeof vr[e]){var t=wr(e).replace(/_/g,"-");vr[e]=t}return vr[e]}function wr(e){if("string"!=typeof mr[e]){var t=(""+e).replace(new RegExp("(?:([A-Za-z\\d])|^)("+k().acronymRegex.source+")(?=\\b|[^a-z])","g"),(function(e,t,r){return(t||"")+(t?"_":"")+r.toLowerCase()})).replace(/([A-Z\d]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase();mr[e]=t}return mr[e]}function kr(e){if("string"!=typeof gr[e]){var t=x(e);gr[e]=t}return gr[e]}var Ar=["description","fileName","lineNumber","message","name","number","stack"];function Rr(e,t){if("string"==typeof e&&!t)throw new Fr(e);if(!e)throw new Fr(t.replace(/^ +/gm,"")||"Assertion failed")}function Fr(e,t){var r=Error(e);t&&(r.stack=t);for(var n=0;n<Ar.length;n++){var i=Ar[n];["description","message","stack"].indexOf(i)>-1?this[i]="Mirage: ".concat(r[i]):this[i]=r[i]}}Fr.prototype=Object.create(Error.prototype);var Er=function(){function e(t,r){Gt(this,e),this.modelName=void 0,"object"===Yt(t)?(this.modelName=void 0,this.opts=t):(this.modelName=t?_r(t):"",this.opts=r||{}),this.name="",this.ownerModelName=""}return Vt(e,[{key:"setSchema",value:function(e){this.schema=e}},{key:"isReflexive",value:function(){var e=!(this.modelName!==this.ownerModelName||!this.opts.inverse),t=!(void 0!==this.opts.inverse||this.ownerModelName!==this.modelName);return e||t}},{key:"isPolymorphic",get:function(){return this.opts.polymorphic}},{key:"type",get:function(){throw new Error("Subclasses of Association must implement a getter for type")}},{key:"foreignKey",get:function(){return this.getForeignKey()}},{key:"identifier",get:function(){throw new Error("Subclasses of Association must implement a getter for identifier")}}]),e}(),xr={},Cr=function(e){Jt(r,e);var t=nr(r);function r(){return Gt(this,r),t.apply(this,arguments)}return Vt(r,[{key:"identifier",get:function(){if("string"!=typeof xr[this.name]){var e="".concat(br(this.name),"Id");xr[this.name]=e}return xr[this.name]}},{key:"type",get:function(){return"belongsTo"}},{key:"getForeignKeyArray",value:function(){return[br(this.ownerModelName),this.getForeignKey()]}},{key:"getForeignKey",value:function(){if("string"!=typeof xr[this.name]){var e="".concat(br(this.name),"Id");xr[this.name]=e}return xr[this.name]}},{key:"addMethodsToModelClass",value:function(e,t){var r=e.prototype,n=this,i=this.getForeignKey(),o=Xt({},t,this);r.belongsToAssociations=Object.assign(r.belongsToAssociations,o),Object.keys(r.belongsToAssociations).forEac
2h((function(e){var t=r.belongsToAssociations[e];r.belongsToAssociationFks[t.getForeignKey()]=t})),this.schema.addDependentAssociation(this,this.modelName),r.associationKeys.add(t),r.associationIdKeys.add(i),Object.defineProperty(r,i,{get:function(){this._tempAssociations=this._tempAssociations||{};var e=this._tempAssociations[t];return null===e?null:n.isPolymorphic?e?{id:e.id,type:e.modelName}:this.attrs[i]:e?e.id:this.attrs[i]},set:function(e){var r;null===e?r=null:void 0!==e&&(n.isPolymorphic?(Rr("object"===Yt(e),"You're setting an ID on the polymorphic association '".concat(n.name,"' but you didn't pass in an object. Polymorphic IDs need to be in the form { type, id }.")),r=n.schema[n.schema.toCollectionName(e.type)].find(e.id)):Rr(r=n.schema[n.schema.toCollectionName(n.modelName)].find(e),"Couldn't find ".concat(n.modelName," with id = ").concat(e))),this[t]=r}}),Object.defineProperty(r,t,{get:function(){this._tempAssociations=this._tempAssociations||{};var e=this._tempAssociations[t],r=this[i],o=null;return e?o=e:null!==r&&(o=n.isPolymorphic?n.schema[n.schema.toCollectionName(r.type)].find(r.i
2d):n.schema[n.schema.toCollectionName(n.modelName)].find(r)),o},set:function(e){if(this._tempAssociations=this._tempAssociations||{},this._tempAssociations[t]=e,e&&e.hasInverseFor(n)){var r=e.inverseFor(n);e.associate(this,r)}}}),r["new".concat(kr(t))]=function(){var e,r;n.isPolymorphic?(e=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1]):(e=n.modelName,r=arguments.length<=0?void 0:arguments[0]);var i=n.schema[n.schema.toCollectionName(e)].new(r);return this[t]=i,i},r["create".concat(kr(t))]=function(){var e,r;n.isPolymorphic?(e=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1]):(e=n.modelName,r=arguments.length<=0?void 0:arguments[0]);var i=n.schema[n.schema.toCollectionName(e)].create(r);return this[t]=i,this.save(),i.reload()}}},{key:"disassociateAllDependentsFromTarget",value:function(e){var t,r=this,n=this.ownerModelName;t=this.isPolymorphic?{type:e.modelName,id:e.id}:e.id,this.schema[this.schema.toCollectionName(n)].where((function(e){var n=e[r.getForeignKey()];return!!n&&("object"===Yt(n)?n.type===t.type&&n.id===t.id:n===t)})).models.forEach((function(t){t.disassociate(e,r),t.save()}))}}]),r}(Er);function Or(e){return Array.isArray(e)?e.map(Or):Object.assign({},e)}var Nr=function(){function e(t,r,n){Gt(this,e),this.name=t,this._records=[],this.identityManager=new n,r&&this.insert(r)}return Vt(e,[{key:"all",value:function(){return Or(this._records)}},{key:"insert",value:function(e){var t=this;return Array.isArray(e)?S()(e,(function(e){return t._insertRecord(e)})):this._insertRecord(e)}},{key:"find",value:function(e){if(Array.isArray(e))return this._findRecords(e).filter(Boolean).map(Or);var t=this._findRecord(e);return t?Or(t):null}},{key:"findBy",value:function(e){var t=this._findRecordBy(e);return t?Or(t):null}},{key:"where",value:function(e){return this._findRecordsWhere(e).map(Or)}},{key:"firstOrCreate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=ir(this.where(e),1)[0];if(r)return r;var n=Object.assign(t,e);return this.insert(n)}},{key:"update",value:function(e,t){var r,n=this;if(void 0===t){t=e;var i=[];return this._records.forEach((function(e){var r=Object.assign({},e);n._updateRecord(e,t),P()(r,e)||i.push(e)})),i}if("number"==typeof e||"string"==typeof e){var o=e,s=this._findRecord(o);return this._updateRecord(s,t),s}if(Array.isArray(e)){var a=e;return(r=this._findRecords(a)).forEach((function(e){n._updateRecord(e,t)})),r}if("object"===Yt(e)){var u=e;return(r=this._findRecordsWhere(u)).forEach((function(e){n._updateRecord(e,t)})),r}}},{key:"remove",value:function(e){var t=this;if(void 0===e)this._records=[],this.identityManager.reset();else if("number"==typeof e||"string"==typeof e){var r=this._findRecord(e),n=this._records.indexOf(r);this._records.splice(n,1)}else Array.isArray(e)?this._findRecords(e).forEach((function(e){var r=t._records.indexOf(e);t._records.splice(r,1)})):"object"===Yt(e)&&this._findRecordsWhere(e).forEach((function(e){var r=t._records.indexOf(e);t._records.splice(r,1)}))}},{key:"_findRecord",value:function(e){return e=e.toString(),this._records.find((function(t){return t.id===e}))}},{key:"_findRecordBy",value:function(e){return this._findRecordsWhere(e)[0]}},{key:"_findRecords",value:function(e){return e.map(this._findRecord,this)}},{key:"_findRecordsWhere",value:function(e){var t=this._records,r="object"===Yt(e)?function(t){return Object.keys(e).every((function(r){return String(t[r])===String(e[r])}))}:e;return t.filter(r)}},{key:"_insertRecord",value:function(e){var t=Or(e);return!t||void 0!==t.id&&null!==t.id?(t.id=t.id.toString(),this.identityManager.set(t.id)):t.id=this.identityManager.fetch(t),this._records.push(t),Or(t)}},{key:"_updateRecord",value:function(e,t){var r=t&&Object.prototype.hasOwnProperty.call(t,"id")?t.id.toString():null,n=e.id;if(r&&n!==r)throw new Error("Updating the ID of a record is not permitted");for(var i in t)"id"!==i&&(e[i]=t[i])}}]),e}(),Ir=function(){function e(t,r){Gt(this,e),this._collections=[],this.registerIdentityManagers(r),t&&this.loadData(t)}return Vt(e,[{key:"loadData",value:function(e){for(var t in e)this.createCollection(t,q()(e[t]))}},{key:"dump",value:function(){return this._collections.reduce((function(e,t){return e[t.name]=t.all(),e}),{})}},{key:"createCollection",value:function(e,t){if(this[e])t&&this[e].insert(t);else{var r=this.identityManagerFor(e),n=new Nr(e,t,r);Object.defineProperty(this,e,{get:function(){var e=n.all();return["insert","find","findBy","where","update","remove","firstOrCreate"].forEach((function(t){e[t]=function(){return n[t].apply(n,arguments)}})),e}}
2),Object.defineProperty(this,"_".concat(e),{get:function(){var e=[];return["insert","find","findBy","where","update","remove","firstOrCreate"].forEach((function(t){e[t]=function(){return n[t].apply(n,arguments)}})),e}}),this._collections.push(n)}return this}},{key:"createCollections",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];r.forEach((function(t){return e.createCollection(t)}))}},{key:"emptyData",value:function(){this._collections.forEach((function(e){return e.remove()}))}},{key:"identityManagerFor",value:function(e){return this._identityManagers[this._container.inflector.singularize(e)]||this._identityManagers.application||dr}},{key:"registerIdentityManagers",value:function(e){this._identityManagers=e||{}}}]),e}(),Tr=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Gt(this,e),Rr(t&&"string"==typeof t,"You must pass a `modelName` into a Collection"),this.modelName=t,this.models=r}return Vt(e,[{key:"length",get:function(){return this.models.length}},{key:"update",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return D().apply(void 0,[this.models,"update"].concat(t)),this}},{key:"save",value:function(){return D()(this.models,"save"),this}},{key:"reload",value:function(){return D()(this.models,"reload"),this}},{key:"destroy",value:function(){return D()(this.models,"destroy"),this}},{key:"add",value:function(e){return this.models.push(e),this}},{key:"remove",value:function(e){var t=this.models.find((function(t){return t.toString()===e.toString()}));if(t){var r=this.models.indexOf(t);this.models.splice(r,1)}return this}},{key:"includes",value:function(e){return this.models.some((function(t){return t.toString()===e.toString()}))}},{key:"filter",value:function(t){var r=this.models.filter(t);return new e(this.modelName,r)}},{key:"sort",value:function(t){var r=this.models.concat().sort(t);return new e(this.modelName,r)}},{key:"slice",value:function(){var t,r=(t=this.models).slice.apply(t,arguments);return new e(this.modelName,r)}},{key:"mergeCollection",value:function(e){return this.models=this.models.concat(e.models),this}},{key:"toString",value:function(){return"collection:".concat(this.modelName,"(").concat(this.models.map((function(e){return e.id})).join(","),")")}}]),e}(),Pr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Gt(this,e),this.models=t}return Vt(e,[{key:"length",get:function(){return this.models.length}},{key:"update",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return D().apply(void 0,[this.models,"update"].concat(t)),this}},{key:"destroy",value:function(){return D()(this.models,"destroy"),this}},{key:"save",value:function(){return D()(this.models,"save"),this}},{key:"reload",value:function(){return D()(this.models,"reload"),this}},{key:"add",value:function(e){return this.models.push(e),this}},{key:"remove",value:function(e){var t=this.models.find((function(t){return P()(t.attrs,e.attrs)}));if(t){var r=this.models.indexOf(t);this.models.splice(r,1)}return this}},{key:"includes",value:function(e){return this.models.some((function(t){return P()(t.attrs,e.attrs)}))}},{key:"filter",value:function(t){return new e(this.models.filter(t))}},{key:"sort",value:function(t){return new e(this.models.concat().sort(t))}},{key:"slice",value:function(){var t;return new e((t=this.models).slice.apply(t,arguments))}},{key:"mergeCollection",value:function(e){return this.models=this.models.concat(e.models),this}},{key:"toString",value:function(){return"collection:".concat(this.modelName,"(").concat(this.models.map((function(e){return e.id})).join(","),")")}}]),e}(),jr={},Sr=function(e){Jt(r,e);var t=nr(r);function r(){return Gt(this,r),t.apply(this,arguments)}return Vt(r,[{key:"identifier",get:function(){if("string"!=typeof jr[this.name]){var e="".concat(br(this._container.inflector.singularize(this.name)),"Ids");jr[this.name]=e}return jr[this.name]}},{key:"type",get:function(){return"hasMany"}},{key:"getForeignKeyArray",value:function(){return[br(this.ownerModelName),this.getForeignKey()]}},{key:"getForeignKey",value:function(){if("string"!=typeof jr[this.name]){var e="".concat(this._container.inflector.singularize(br(this.name)),"Ids");jr[this.name]=e}return jr[this.name]}},{key:"addMethodsToModelClass",value:function(e,t){var r=e.prototype,n=this,i=this.getForeignKey(),o=Xt({},t,this);r.hasManyAssociations=Object.assign(r.hasManyAssociations,o),Object.keys(r.hasManyAssociations).forEac
2h((function(e){var t=r.hasManyAssociations[e];r.hasManyAssociationFks[t.getForeignKey()]=t})),this.schema.addDependentAssociation(this,this.modelName),r.associationKeys.add(t),r.associationIdKeys.add(i),Object.defineProperty(r,i,{get:function(){this._tempAssociations=this._tempAssociations||{};var e=this._tempAssociations[t];return e?n.isPolymorphic?e.models.map((function(e){return{type:e.modelName,id:e.id}})):e.models.map((function(e){return e.id})):this.attrs[i]||[]},set:function(e){var r;if(null===e)r=[];else if(void 0!==e)if(Rr(Array.isArray(e),"You must pass an array in when setting ".concat(i," on ").concat(this)),n.isPolymorphic){Rr(e.every((function(e){return"object"===Yt(e)&&void 0!==Yt(e.type)&&void 0!==Yt(e.id)})),"You must pass in an array of polymorphic identifiers (objects of shape { type, id }) when setting ".concat(i," on ").concat(this));var o=e.map((function(e){var t=e.type,r=e.id;return n.schema[n.schema.toCollectionName(t)].find(r)}));r=new Pr(o)}else r=n.schema[n.schema.toCollectionName(n.modelName)].find(e);this[t]=r}}),Object.defineProperty(r,t,{get:function(){this._tempAssociations=this._tempAssociations||{};var e=null;if(this._tempAssociations[t])e=this._tempAssociations[t];else{if(n.isPolymorphic)if(this[i]){var r=this[i].map((function(e){var t=e.type,r=e.id;return n.schema[n.schema.toCollectionName(t)].find(r)}));e=new Pr(r)}else e=new Pr(n.modelName);else e=this[i]?n.schema[n.schema.toCollectionName(n.modelName)].find(this[i]):new Tr(n.modelName);this._tempAssociations[t]=e}return e},set:function(e){var r,i=this;(e instanceof Tr||e instanceof Pr)&&(e=e.models),e=e?U()(e):[],this._tempAssociations=this._tempAssociations||{},r=n.isPolymorphic?new Pr(e):new Tr(n.modelName,e),this._tempAssociations[t]=r,e.forEach((function(e){if(e.hasInverseFor(n)){var t=e.inverseFor(n);e.associate(i,t)}}))}}),r["new".concat(kr(br(this._container.inflector.singularize(n.name))))]=function(){var e,r;n.isPolymorphic?(e=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1]):(e=n.modelName,r=arguments.length<=0?void 0:arguments[0]);var i=n.schema[n.schema.toCollectionName(e)].new(r),o=this[t].models;return o.push(i),this[t]=o,i},r["create".concat(kr(br(this._container.inflector.singularize(n.name))))]=function(){var e,r;n.isPolymorphic?(e=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1]):(e=n.modelName,r=arguments.length<=0?void 0:arguments[0]);var i=n.schema[n.schema.toCollectionName(e)].create(r),o=this[t].models;return o.push(i),this[t]=o,this.save(),i.reload()}}},{key:"disassociateAllDependentsFromTarget",value:function(e){var t,r=this,n=this.ownerModelName;t=this.isPolymorphic?{type:e.modelName,id:e.id}:e.id,this.schema[this.schema.toCollectionName(n)].where((function(e){var n=e[r.getForeignKey()];return n&&n.find((function(e){return"object"===Yt(e)?e.type===t.type&&e.id===t.id:e===t}))})).models.forEach((function(t){t.disassociate(e,r),t.save()}))}}]),r}(Er),Mr={},qr=function(){function e(){Gt(this,e)}return Vt(e,[{key:"getModelClassFromPath",value:function(e){if(e){if("string"!=typeof Mr[e]){for(var t,r=e.split("/"),n=r.length-1;n>=0;n--){var i=r[n];if(i.length&&":"!==i[0]){t=i;break}}Mr[e]=_r(br(this._container.inflector.singularize(t)))}return Mr[e]}}},{key:"_getIdForRequest",value:function(e,t){var r;return e&&e.params&&e.params.id?r=e.params.id:t&&t.data&&t.data.id&&(r=t.data.id),r}},{key:"_getJsonApiDocForRequest",value:function(e,t){var r;return e&&e.requestBody&&(r=JSON.parse(e.requestBody)),this.serializerOrRegistry.normalize(r,t)}},{key:"_getAttrsForRequest",value:function(e,t){var r=this,n=this._getJsonApiDocForRequest(e,t),i=this._getIdForRequest(e,n),o={};return Rr(n.data&&(n.data.attributes||n.data.type||n.data.relationships),"You're using a shorthand or #normalizedRequestAttrs, but your serializer's normalize function did not return a valid JSON:API document. Consult the docs for the normalize hook on the Serializer class."),n.data.attributes&&(o=Object.keys(n.data.attributes).reduce((function(e,t){return e[br(t)]=n.data.attributes[t],e}),{})),n.data.relationships&&Object.keys(n.data.relationships).forEac
2h((function(i){var s,a=n.data.relationships[i],u=r.schema.modelClassFor(t).associationFor(br(i));Rr(u,"You're passing the relationship '".concat(i,"' to the '").concat(t,"' model via a ").concat(e.method," to '").concat(e.url,"', but you did not define the '").concat(i,"' association on the '").concat(t,"' model.")),s=u.isPolymorphic?a.data:u instanceof Sr?a.data&&a.data.map((function(e){return e.id})):a.data&&a.data.id,o[u.identifier]=s}),{}),i&&(o.id=i),o}},{key:"_getAttrsForFormRequest",value:function(e){var t=e.requestBody;return Rr(t&&"string"==typeof t,"You're using the helper method #normalizedFormData, but the request body is empty or not a valid url encoded string."),t.split("&").reduce((function(e,t){var r=ir(t.split("="),2),n=r[0],i=r[1];return e[n]=decodeURIComponent(i.replace(/\+/g," ")),e}),{})}}]),e}(),zr=function(e){Jt(r,e);var t=nr(r);function r(e,n,i,o,s){var a;return Gt(this,r),(a=t.call(this,s)).schema=e,a.serializerOrRegistry=n,a.userFunction=i,a.path=o,a}return Vt(r,[{key:"handle",value:function(e){return this.userFunction(this.schema,e)}},{key:"setRequest",value:function(e){this.request=e}},{key:"serialize",value:function(e,t){return(t?this.serializerOrRegistry.serializerFor(t,{explicit:!0}):this.serializerOrRegistry).serialize(e,this.request)}},{key:"normalizedRequestAttrs",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=this.path,n=this.request,i=this.request.requestHeaders,o={};for(var s in i)o[s.toLowerCase()]=i[s];return/x-www-form-urlencoded/.test(o["content-type"])?e=this._getAttrsForFormRequest(n):(t?Rr(_r(t)===t,"You called normalizedRequestAttrs('".concat(t,"'), but normalizedRequestAttrs was intended to be used with the dasherized version of the model type. Please change this to normalizedRequestAttrs('").concat(_r(t),"').")):t=this.getModelClassFromPath(r),Rr(this.schema.hasModelForModelName(t),"You're using a shorthand or the #normalizedRequestAttrs helper but the detected model of '".concat(t,"' does not exist. You might need to pass in the correct modelName as the first argument to #normalizedRequestAttrs.")),e=this._getAttrsForRequest(n,t)),e}}]),r}(qr),Dr=function(){function e(t,r,n){Gt(this,e),this.schema=t,this.serializerOrRegistry=r,this.object=n}return Vt(e,[{key:"handle",value:function(){return this.object}}]),e}(),$r=function(e){Jt(r,e);var t=nr(r);function r(e,n,i,o){var s,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};Gt(this,r),s=t.call(this),i=i||s.getModelClassFromPath(o),s.schema=e,s.serializerOrRegistry=n,s.shorthand=i,s.options=a;var u=Array.isArray(i)?"array":Yt(i);if("string"===u){var c=s.schema[s.schema.toCollectionName(i)];s.handle=function(e){return s.handleStringShorthand(e,c)}}else if("array"===u){var l=i.map((function(e){return s.schema[s.schema.toCollectionName(e)]}));s.handle=function(e){return s.handleArrayShorthand(e,l)}}return s}return r}(qr),Ur=function(e){Jt(r,e);var t=nr(r);function r(){return Gt(this,r),t.apply(this,arguments)}return Vt(r,[{key:"handleStringShorthand",value:function(e,t){var r=br(this.shorthand);Rr(t,"The route handler for ".concat(e.url," is trying to access the ").concat(r," model, but that model doesn't exist."));var n=this._getIdForRequest(e);if(n)return t.find(n)||new pr(404);if(this.options.coalesce){var i=this.serializerOrRegistry.getCoalescedIds(e,r);if(i)return t.find(i)}return t.all()}},{key:"handleArrayShorthand",value:function(e,t){var r=this.shorthand;return Rr(!this._getIdForRequest(e)||this._container.inflector.singularize(r[0])!==r[0],"It looks like you're using the \"Single record with\n      related records\" version of the array shorthand, in addition to opting\n      in to the model layer. This shorthand was made when there was no\n      serializer layer. Now that you're using models, please ensure your\n      relationships are defined, and create a serializer for the parent\n      model, adding the relationships there."),t.map((function(e){return e.all()}))}}]),r}($r),Hr=function(e){Jt(r,e);var t=nr(r);function r(){return Gt(this,r),t.apply(this,arguments)}return Vt(r,[{key:"handleStringShorthand",value:function(e,t){var r=br(this.shorthand);Rr(t,"The route handler for ".concat(e.url," is trying to access the ").concat(r," model, but that model doesn't exist."));var n=this._getAttrsForRequest(e,t.camelizedModelName);return t.create(n)}}]),r}($r),Lr=function(e){Jt(r,e);var t=nr(r);function r(){return Gt(this,r),t.apply(this,arguments)}return Vt(r,[{key:"handleStringShorthand",value:function(e,t){var r=br(this.shorthand);Rr(t,"The route handler for ".concat(e.url," is trying to access the ").concat(r," model, but that model doesn't exist."));var n=this._getIdForRequest(e),i=t.find(n);if(!i)return new pr(404);var o=this._getAttrsForRequest(e,t.camelizedModelName);return i.update(o)}}]),r}($r),Kr=function(e){Jt(r,e);var t=nr(r);function r(){return Gt(this,r),t.apply(this,arguments)}return Vt(r,[{key:"handleStringShorthand",value:function(e,t){var r=br(this.shorthand);Rr(t,"The route handler for ".concat(e.url," is trying to access the ").concat(r," model, but that model doesn't exist."));var n=this._getIdForRequest(e),i=t.find(n);if(!i)return new pr(404);i.destroy()}},{key:"handleArrayShorthand",value:function(e,t){var r=this,n=this._getIdForRequest(e),i=t[0].find(n);t.slice(1).map((function(e){return r._container.inflector.pluralize(e.camelizedModelName)}
2)).forEach((function(e){return i[e].destroy()})),i.destroy()}}]),r}($r),Br=function(e){Jt(r,e);var t=nr(r);function r(){return Gt(this,r),t.apply(this,arguments)}return Vt(r,[{key:"handleStringShorthand",value:function(e,t){var r=br(this.shorthand);Rr(t,"The route handler for ".concat(e.url," is trying to access the ").concat(r," model, but that model doesn't exist."));var n=this._getIdForRequest(e);if(n){var i=t.find(n);return new pr(i?204:404)}if(this.options.coalesce&&e.queryParams&&e.queryParams.ids){var o=t.find(e.queryParams.ids);return new pr(o?204:404)}return new pr(204)}}]),r}($r),Yr={get:200,put:204,post:201,delete:204},Gr=function(){function e(t){var r=t.schema,n=t.verb,i=t.rawHandler,o=t.customizedCode,s=t.options,a=t.path,u=t.serializerOrRegistry,c=t.middleware;Gt(this,e),this.verb=n,this.customizedCode=o,this.serializerOrRegistry=u,this.middleware=c||[],this.handler=function(e){var t,r=e.verb,n=e.rawHandler,i=[e.schema,e.serializerOrRegistry,n,e.path,e.options,e.middleware],o=Yt(n);return"function"===o?t=tr(zr,i):"object"===o&&n?t=tr(Dr,i):"get"===r?t=tr(Ur,i):"post"===r?t=tr(Hr,i):"put"===r||"patch"===r?t=tr(Lr,i):"delete"===r?t=tr(Kr,i):"head"===r&&(t=tr(Br,i)),t}({verb:n,schema:r,path:a,serializerOrRegistry:u,rawHandler:i,options:s})}return Vt(e,[{key:"handle",value:function(e){var t=this;return this._getMirageResponseForRequest(e,this.middleware).then((function(r){return t.serialize(r,e)})).then((function(e){return e.toRackResponse()}))}},{key:"_getMirageResponseForRequest",value:function(e){var t,r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{this.handler instanceof zr&&this.handler.setRequest(e),t=this.handleWithMiddleware(e,[].concat(or(n),[function(e,t){return r.handler.handle(t)}]))}catch(r){if(r instanceof Fr)t=new pr(500,{},r);else{var i=r.message||r;t=new pr(500,{},{message:i,stack:"Mirage: Your ".concat(e.method," handler for the url ").concat(e.url," threw an error:\n\n").concat(r.stack||r)})}}return this._toMirageResponse(t)}},{key:"handleWithMiddleware",value:function(e,t){var r,n=this,i=sr(r=t)||ar(r)||ur(r)||lr(),o=i[0],s=i.slice(1);return o(this.schema,e,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;return n.handleWithMiddleware(t,s)}))}},{key:"_toMirageResponse",value:function(e){var t,r=this;return new Promise((function(n,i){Promise.resolve(e).then((function(i){if(i instanceof pr)t=e;else{var o=r._getCodeForResponse(i);t=new pr(o,{},i)}n(t)})).catch(i)}))}},{key:"_getCodeForResponse",value:function(e){var t;return this.customizedCode?t=this.customizedCode:204===(t=Yr[this.verb])&&void 0!==e&&""!==e&&(t=200),t}},{key:"serialize",value:function(e,t){return e.data=this.serializerOrRegistry.serialize(e.data,t),e}}]),e}();function Wr(e,t){var r=function(t){Jt(n,t);var r=nr(n);function n(){var t,i;Gt(this,n);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return t=r.call.apply(r,[this].concat(s)),e&&L()(e,"constructor")&&(i=e.constructor).call.apply(i,[rr(t)].concat(s)),t}return n}(this);return Object.assign(r,this,t),e&&Object.assign(r.prototype,e),r}var Vr=function(){function e(t,r,n,i){var o=this;return Gt(this,e),Rr(t,"A model requires a schema"),Rr(r,"A model requires a modelName"),this._schema=t,this.modelName=r,this.fks=i||[],this.attrs={},n=n||{},this.fks.forEach((function(e){o.attrs[e]=void 0!==n[e]?n[e]:null})),Object.keys(n).forEach((function(e){var t=n[e];o._validateAttr(e,t),o._setupAttr(e,t),o._setupRelationship(e,t)})),this}return Vt(e,[{key:"save",value:function(){var e=this._schema.toInternalCollectionName(this.modelName);return this.isNew()?(this.attrs=this._schema.db[e].insert(this.attrs),this._definePlainAttribute("id")):(this._schema.isSaving[this.toString()]=!0,this._schema.db[e].update(this.attrs.id,this.attrs)),this._saveAssociations(),this._schema.isSaving[this.toString()]=!1,this}},{key:"update",value:function(e,t){var r;return null==e||("object"===Yt(e)?r=e:(r={})[e]=t,Object.keys(r).forEach((function(e){this.associationKeys.has(e)||this.associationIdKeys.has(e)||this._definePlainAttribute(e),this[e]=r[e]}),this),this.save()),this}},{key:"destroy",value:function(){if(this.isSaved()){this._disassociateFromDependents();var e=this._schema.toInternalCollectionName(this.modelName);this._schema.db[e].remove(this.attrs.id)}}},{key:"isNew",value:function(){var e=!1;if(void 0!==this.attrs.id&&null!==this.attrs.id){var t=this._schema.toInternalCollectionName(this.modelName);this._schema.db[t].find(this.attrs.id)&&(e=!0)}return!e}},{key:"isSaved",value:function(){return!this.isNew()}}
2,{key:"reload",value:function(){if(this.id){var e=this._schema.toInternalCollectionName(this.modelName),t=this._schema.db[e].find(this.id);Object.keys(t).filter((function(e){return"id"!==e})).forEach((function(e){this.attrs[e]=t[e]}),this)}return this._tempAssociations={},this}},{key:"toJSON",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bt(Object(r),!0).forEach((function(t){Xt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},this.attrs)}},{key:"associations",get:function(){return this._schema.associationsFor(this.modelName)}},{key:"associationFor",value:function(e){return this.associations[e]}},{key:"inverseFor",value:function(e){return this._explicitInverseFor(e)||this._implicitInverseFor(e)}},{key:"_explicitInverseFor",value:function(e){this._checkForMultipleExplicitInverses(e);var t=this._schema.associationsFor(this.modelName),r=e.opts.inverse,n=r?t[r]:null,i=n&&n.isPolymorphic,o=n&&n.modelName===e.ownerModelName;return n&&n.opts.inverse&&n.opts.inverse!==e.name&&Rr(!1,"You specified an inverse of ".concat(r," for ").concat(e.name,", but it does not match ").concat(n.modelName," ").concat(n.name,"'s inverse")),i||o?n:null}},{key:"_checkForMultipleExplicitInverses",value:function(e){var t=this._schema.associationsFor(this.modelName);Rr(Object.keys(t).filter((function(r){var n=t[r],i=e.ownerModelName===n.modelName,o=e.name===n.opts.inverse;return i&&o})).length<=1,"The ".concat(this.modelName," model has defined multiple explicit inverse associations for the ").concat(e.ownerModelName,".").concat(e.name," association."))}},{key:"_implicitInverseFor",value:function(e){var t=this,r=this._schema.associationsFor(this.modelName),n=e.ownerModelName;return B()(r).filter((function(e){return e.modelName===n})).reduce((function(r,n){var i=n.opts.inverse,o=void 0===i,s=i===e.name;return(o||s)&&(Rr(!r,"The ".concat(t.modelName," model has multiple possible inverse associations for the ").concat(e.ownerModelName,".").concat(e.name," association.")),r=n),r}),null)}},{key:"hasInverseFor",value:function(e){return!!this.inverseFor(e)}},{key:"alreadyAssociatedWith",value:function(t,r){var n=this[r.name];if(n&&t)return n instanceof e?n.isSaved()&&t.isSaved()?n.toString()===t.toString():n===t:n.includes(t)}},{key:"associate",value:function(e,t){if(!this.alreadyAssociatedWith(e,t)){var r=t.name;t instanceof Sr?this[r].includes(e)||this[r].add(e):this[r]=e}}},{key:"disassociate",value:function(e,t){var r=t.getForeignKey();if(t instanceof Sr){var n;if(t.isPolymorphic){var i=this[r].find((function(t){var r=t.type,n=t.id;return r===e.modelName&&n===e.id}));n=i&&this[r].indexOf(i)}else n=this[r].map((function(e){return e.toString()})).indexOf(e.id.toString());n>-1&&this.attrs[r].splice(n,1)}else this.attrs[r]=null}},{key:"isSaving",get:function(){return this._schema.isSaving[this.toString()]}},{key:"_setupAttr",value:function(e,t){this.associationKeys.has(e)||this.associationIdKeys.has(e)||(this.attrs[e]=t,this._definePlainAttribute(e))}},{key:"_definePlainAttribute",value:function(e){var t=Object.getOwnPropertyDescriptor(this,e);t&&t.get||(Object.prototype.hasOwnProperty.call(this.attrs,e)||(this.attrs[e]=null),Object.defineProperty(this,e,{get:function(){return this.attrs[e]},set:function(t){this.attrs[e]=t}}))}},{key:"_setupRelationship",value:function(e,t){var r=this.associationIdKeys.has(e)||this.fks.includes(e),n=this.associationKeys.has(e);r&&(null!=t&&this._validateForeignKeyExistsInDatabase(e,t),this.attrs[e]=t),n&&(this[e]=t)}},{key:"_validateAttr",value:function(t,r){if(this.associationKeys.has(t)){var n=this.associationFor(t),i=null===r;if(n instanceof Sr){var o=r instanceof Tr||r instanceof Pr,s=Array.isArray(r)&&r.every((function(t){return t instanceof e}));Rr(o||s||i,"You're trying to create a ".concat(this.modelName,' model and you passed in "').concat(r,'" under the ').concat(t," key, but that key is a HasMany relationship. You must pass in a Collection, PolymorphicCollection, array of Models, or null."))}else n instanceof Cr&&Rr(r instanceof e||i,"You're trying to create a ".concat(this.modelName,' model and 
2you passed in "').concat(r,'" under the ').concat(t," key, but that key is a BelongsTo relationship. You must pass in a Model or null."))}this.associationIdKeys.has(t)&&t.endsWith("Ids")&&Rr(Array.isArray(r)||null===r,"You're trying to create a ".concat(this.modelName,' model and you passed in "').concat(r,'" under the ').concat(t," key, but that key is a foreign key for a HasMany relationship. You must pass in an array of ids or null."));var a=r instanceof e||r instanceof Tr||r instanceof Pr,u=Array.isArray(r)&&r.length&&r.every((function(t){return t instanceof e}));if(a||u){var c=r;Rr(this.associationKeys.has(t),"You're trying to create a ".concat(this.modelName," model and you passed in a ").concat(c.toString()," under the ").concat(t," key, but you haven't defined that key as an association on your model."))}}},{key:"_validateForeignKeyExistsInDatabase",value:function(e,t){var r=this;if(Array.isArray(t)){var n,i=this.hasManyAssociationFks[e];i.isPolymorphic?(n=t.map((function(e){var t=e.type,n=e.id;return r._schema.db[r._schema.toInternalCollectionName(t)].find(n)})),n=U()(n)):n=this._schema.db[this._schema.toInternalCollectionName(i.modelName)].find(t);var o=i.isPolymorphic?t.map((function(e){return"".concat(e.type,":").concat(e.id)})).join(","):t;Rr(n.length===t.length,"You're instantiating a ".concat(this.modelName," that has a ").concat(e," of ").concat(o,", but some of those records don't exist in the database."))}else{var s,a=this.belongsToAssociationFks[e];s=a.isPolymorphic?this._schema.db[this._schema.toInternalCollectionName(t.type)].find(t.id):this._schema.db[this._schema.toInternalCollectionName(a.modelName)].find(t);var u=a.isPolymorphic?"".concat(t.type,":").concat(t.id):t;Rr(s,"You're instantiating a ".concat(this.modelName," that has a ").concat(e," of ").concat(u,", but that record doesn't exist in the database."))}}},{key:"_saveAssociations",value:function(){this._saveBelongsToAssociations(),this._saveHasManyAssociations()}},{key:"_saveBelongsToAssociations",value:function(){var e=this;B()(this.belongsToAssociations).forEach((function(t){e._disassociateFromOldInverses(t),e._saveNewAssociates(t),e._associateWithNewInverses(t)}))}},{key:"_saveHasManyAssociations",value:function(){var e=this;B()(this.hasManyAssociations).forEach((function(t){e._disassociateFromOldInverses(t),e._saveNewAssociates(t),e._associateWithNewInverses(t)}))}},{key:"_disassociateFromOldInverses",value:function(e){e instanceof Sr?this._disassociateFromHasManyInverses(e):e instanceof Cr&&this._disassociateFromBelongsToInverse(e)}},{key:"_disassociateFromHasManyInverses",value:function(e){var t=this,r=e.getForeignKey(),n=this._tempAssociations&&this._tempAssociations[e.name],i=this.attrs[r];n&&i&&(e.isPolymorphic?i.map((function(e){var r=e.type,n=e.id;return t._schema[t._schema.toCollectionName(r)].find(n)})):this._schema[this._schema.toCollectionName(e.modelName)].find(i||[]).models).filter((function(t){return!t.isSaving&&!n.includes(t)&&t.hasInverseFor(e)})).forEach((function(r){var n=r.inverseFor(e);r.disassociate(t,n),r.save()}))}},{key:"_disassociateFromBelongsToInverse",value:function(e){var t,r=e.getForeignKey(),n=this._tempAssociations&&this._tempAssociations[e.name],i=this.attrs[r];if(void 0!==n&&i&&(t=e.isPolymorphic?this._schema[this._schema.toCollectionName(i.type)].find(i.id):this._schema[this._schema.toCollectionName(e.modelName)].find(i)).hasInverseFor(e)){var o=t.inverseFor(e);t.disassociate(this,o),t._updateInDb(t.attrs)}}},{key:"_disassociateFromDependents",value:function(){var e=this;this._schema.dependentAssociationsFor(this.modelName).forEach((function(t){t.disassociateAllDependentsFromTarget(e)}))}},{key:"_saveNewAssociates",value:function(e){var t=e.getForeignKey(),r=this._tempAssociations&&this._tempAssociations[e.name];if(void 0!==r){if(this.__isSavingNewChildren=!0,delete this._tempAssociations[e.name],r instanceof Tr)r.models.filter((function(e){return!e.isSaving})).forEach((function(e){e.save()})),this._updateInDb(Xt({},t,r.models.map((function(e){return e.id}))));else if(r instanceof Pr)r.models.filter((function(e){return!e.isSaving}
2)).forEach((function(e){e.save()})),this._updateInDb(Xt({},t,r.models.map((function(e){return{type:e.modelName,id:e.id}}))));else if(null===r)this._updateInDb(Xt({},t,null));else if(this.equals(r))this._updateInDb(Xt({},t,this.id));else if(!r.isSaving){var n;r.save(),this._syncTempAssociations(r),n=e.isPolymorphic?{id:r.id,type:r.modelName}:r.id,this._updateInDb(Xt({},t,n))}this.__isSavingNewChildren=!1}}},{key:"_associateWithNewInverses",value:function(t){var r=this;if(!this.__isSavingNewChildren){var n=this[t.name];n instanceof e?this._associateModelWithInverse(n,t):(n instanceof Tr||n instanceof Pr)&&n.models.forEach((function(e){r._associateModelWithInverse(e,t)})),delete this._tempAssociations[t.name]}}},{key:"_associateModelWithInverse",value:function(e,t){var r=this;if(e.hasInverseFor(t)){var n=e.inverseFor(t),i=n.getForeignKey(),o=this.id;if(n instanceof Cr){var s;s=n.isPolymorphic?{type:this.modelName,id:o}:o,this._schema.db[this._schema.toInternalCollectionName(e.modelName)].update(e.id,Xt({},i,s))}else{var a,u,c=this._schema.db[this._schema.toInternalCollectionName(e.modelName)],l=c.find(e.id)[n.getForeignKey()]||[],h=Object.assign([],l);n.isPolymorphic?(a={type:this.modelName,id:o},u=h.some((function(e){return e.type==r.modelName&&e.id==o}))):(a=o,u=h.includes(o)),u||h.push(a),c.update(e.id,Xt({},i,h))}}}},{key:"_updateInDb",value:function(e){this.attrs=this._schema.db[this._schema.toInternalCollectionName(this.modelName)].update(this.attrs.id,e)}},{key:"_syncTempAssociations",value:function(e){var t=this;Object.keys(this._tempAssociations).forEach((function(r){t._tempAssociations[r]&&t._tempAssociations[r].toString()===e.toString()&&(t._tempAssociations[r]=e)}))}},{key:"toString",value:function(){var e=this.id?"(".concat(this.id,")"):"";return"model:".concat(this.modelName).concat(e)}},{key:"equals",value:function(e){return this.toString()===e.toString()}}]),e}();Vr.extend=Wr,Vr.findBelongsToAssociation=function(e){return this.prototype.belongsToAssociations[e]};var Xr=function(){function e(t,r){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Gt(this,e),this.registry=t,this.type=r,this.request=i,this.attrs=this.attrs||void 0,this.include=this.include||[],this.root=this.root||void 0,this.embed=this.embed||void 0,this._embedFn=s()(this.embed)?this.embed:function(){return!!n.embed},this.serializeIds=this.serializeIds||void 0,this.primaryKey=this.primaryKey||void 0}return Vt(e,[{key:"serialize",value:function(e){return this.primaryResource=e,this.buildPayload(e)}},{key:"normalize",value:function(e){return e}},{key:"buildPayload",value:function(e,t,r,n){if(!e&&G()(t))return n;if(e){var i=ir(this.getHashForPrimaryResource(e),2),o=i[0],s=i[1],a=this.isCollection(e)?e.models:[e];return this.buildPayload(void 0,s,a,o)}var u=t.shift(),c=ir(this.getHashForIncludedResource(u),2),l=c[0],h=c[1].filter((function(e){return!r.map((function(e){return e.toString()})).includes(e.toString())})).concat(t),d=(this.isCollection(u)?u.models:[u]).concat(r),f=this.mergePayloads(n,l);return this.buildPayload(void 0,h,d,f)}},{key:"getHashForPrimaryResource",value:function(e){var t,r=ir(this.getHashForResource(e),2),n=r[0],i=r[1];return this.root?(Rr(!(e instanceof Pr),"The base Serializer class cannot serialize a top-level PolymorphicCollection when root is true, since PolymorphicCollections have no type."),t=Xt({},this.serializerFor(e.modelName).keyForResource(e),n)):t=n,[t,i]}},{key:"getHashForIncludedResource",value:function(e){var t,r;if(e instanceof Pr)t={},r=e.models;else{var n=this.serializerFor(e.modelName),i=ir(n.getHashForResource(e),2),o=i[0],s=i[1],a=n.keyForRelationship(e.modelName);t=Array.isArray(o)?Xt({},a,o):Xt({},a,[o]),r=s}return[t,r]}},{key:"getHashForResource",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this;return arguments.length>3&&void 0!==arguments[3]&&arguments[3]&&e.modelName&&(i=this.serializerFor(e.modelName)),[this.isModel(e)?i._hashForModel(e,r,n):e.models.map((function(e){var o=i;return o||(o=t.serializerFor(e.modelName)),o._hashForModel(e,r,n)}
2)),J()(U()(d()(i.getKeysForIncluded().map((function(r){return t.isCollection(e)?e.models.map((function(e){return e[r]})):e[r]})))),(function(e){return e.toString()}))]}},{key:"mergePayloads",value:function(e,t){var r,n=ir(Object.keys(t),1)[0];return e[n]?(r=e)[n]=e[n].concat(t[n]):r=Object.assign(e,t),r}},{key:"keyForResource",value:function(e){var t=e.modelName;return this.isModel(e)?this.keyForModel(t):this.keyForCollection(t)}},{key:"keyForModel",value:function(e){return br(e)}},{key:"keyForCollection",value:function(e){return this._container.inflector.pluralize(this.keyForModel(e))}},{key:"_hashForModel",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._attrsForModel(e);if(t&&e.fks.forEach((function(e){delete i[e]})),this.embed){var o=Object.assign({},n);o[e.modelName]=o[e.modelName]||{},o[e.modelName][e.id]=!0,this.getKeysForEmbedded().forEach((function(t){var n=e[t];if(n&&!V()(o,"".concat(n.modelName,".").concat(n.id))){var s=ir(r.getHashForResource(n,!0,o,!0),1)[0],a=r.keyForEmbeddedRelationship(t);if(i[a]=s,r.isModel(n)){var u="".concat(br(t),"Id");delete i[u]}}}))}return this._maybeAddAssociationIds(e,i)}},{key:"_attrsForModel",value:function(e){var t={};return t=this.attrs?this.attrs.reduce((function(t,r){return t[r]=e[r],t}),{}):Object.assign(t,e.attrs),e.fks.forEach((function(e){return delete t[e]})),this._formatAttributeKeys(t)}},{key:"_maybeAddAssociationIds",value:function(e,t){var r=this,n=Object.assign({},t);return"always"===this.serializeIds?or(e.associationKeys).filter((function(e){return!r._embedFn(e)})).forEach((function(t){var i=e[t],o=e.associationFor(t);if(r.isCollection(i)){var s=r.keyForRelationshipIds(t);n[s]=e["".concat(r._container.inflector.singularize(t),"Ids")]}else if(r.isModel(i)&&o.isPolymorphic){var a=r.keyForPolymorphicForeignKeyType(t),u=r.keyForPolymorphicForeignKeyId(t);n[a]=e["".concat(t,"Id")].type,n[u]=e["".concat(t,"Id")].id}else if(i){var c=r.keyForForeignKey(t);n[c]=e["".concat(t,"Id")]}})):"included"===this.serializeIds&&this.getKeysForIncluded().forEach((function(t){var i=e[t],o=e.associationFor(t);if(r.isCollection(i)){var s=r.keyForRelationshipIds(t);n[s]=e["".concat(r._container.inflector.singularize(t),"Ids")]}else if(r.isModel(i)&&o.isPolymorphic){var a=r.keyForPolymorphicForeignKeyType(t),u=r.keyForPolymorphicForeignKeyId(t);n[a]=e["".concat(t,"Id")].type,n[u]=e["".concat(t,"Id")].id}else if(r.isModel(i)){var c=r.keyForForeignKey(t);n[c]=e["".concat(t,"Id")]}})),n}},{key:"keyForAttribute",value:function(e){return"id"===e?this.keyForId():e}},{key:"keyForRelationship",value:function(e){return br(this._container.inflector.pluralize(e))}},{key:"keyForEmbeddedRelationship",value:function(e){return br(e)}},{key:"keyForRelationshipIds",value:function(e){return"".concat(this._container.inflector.singularize(br(e)),"Ids")}},{key:"keyForForeignKey",value:function(e){return"".concat(br(e),"Id")}},{key:"keyForPolymorphicForeignKeyId",value:function(e){return"".concat(br(e),"Id")}},{key:"keyForPolymorphicForeignKeyType",value:function(e){return"".concat(br(e),"Type")}},{key:"isModel",value:function(e){return e instanceof Vr}},{key:"isCollection",value:function(e){return e instanceof Tr||e instanceof Pr}},{key:"isModelOrCollection",value:function(e){return this.isModel(e)||this.isCollection(e)}},{key:"serializerFor",value:function(e){return this.registry.serializerFor(e)}},{key:"getAssociationKeys",value:function(){return s()(this.include)?this.include(this.request,this.primaryResource):this.include}},{key:"getKeysForEmbedded",value:function(){var e=this;return this.getAssociationKeys().filter((function(t){return e._embedFn(t)}))}},{key:"getKeysForIncluded",value:function(){var e=this;return this.getAssociationKeys().filter((function(t){return!e._embedFn(t)}))}},{key:"schema",get:function(){return this.registry.schema}},{key:"keyForId",value:function(){return this.primaryKey}},{key:"valueForId",value:function(e){return e}},{key:"_formatAttributeKeys",value:function(e){var t={};for(var r in e){var n=e[r];"id"===r&&(n=this.valueForId(n)),t[this.keyForAttribute(r)]=n}return t}}
2,{key:"getCoalescedIds",value:function(){}}]),e}();Xr.prototype.include=[],Xr.prototype.root=!0,Xr.prototype.embed=!1,Xr.prototype.primaryKey="id",Xr.prototype.serializeIds="included",Xr.extend=Wr;var Jr=function(e){Jt(r,e);var t=nr(r);function r(){var e;return Gt(this,r),(e=t.apply(this,arguments)).alwaysIncludeLinkageData=e.alwaysIncludeLinkageData||void 0,e}return Vt(r,[{key:"keyForModel",value:function(e){return _r(e)}},{key:"keyForCollection",value:function(e){return _r(e)}},{key:"keyForAttribute",value:function(e){return _r(e)}},{key:"keyForRelationship",value:function(e){return _r(e)}},{key:"links",value:function(){}},{key:"getHashForPrimaryResource",value:function(e){return this._createRequestedIncludesGraph(e),[{data:this.getHashForResource(e)},this.getAddToIncludesForResource(e)]}},{key:"getHashForIncludedResource",value:function(e){var t=this.serializerFor(e.modelName).getHashForResource(e),r={included:this.isModel(e)?[t]:t},n=[];return this.hasQueryParamIncludes()||(n=this.getAddToIncludesForResource(e)),[r,n]}},{key:"getHashForResource",value:function(e){var t=this;return this.isModel(e)?this.getResourceObjectForModel(e):e.models.map((function(e){return t.getResourceObjectForModel(e)}))}},{key:"getAddToIncludesForResource",value:function(e){var t;return t=this.hasQueryParamIncludes()?this.getQueryParamIncludes():this.serializerFor(e.modelName).getKeysForIncluded(),this.getAddToIncludesForResourceAndPaths(e,t)}},{key:"getAddToIncludesForResourceAndPaths",value:function(e,t){var r=this,n=[];return t.forEach((function(t){var i=t.split("."),o=r.getIncludesForResourceAndPath.apply(r,[e].concat(or(i)));n.push(o)})),J()(U()(d()(n)),(function(e){return e.toString()}))}},{key:"getIncludesForResourceAndPath",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var o=br(n.shift()),s=[],a=[];if(this.isModel(e)){var u=e[o];this.isModel(u)?a=[u]:this.isCollection(u)&&(a=u.models)}else e.models.forEach((function(e){var r=e[o];t.isModel(r)?a.push(r):t.isCollection(r)&&(a=a.concat(r.models))}));return s=s.concat(a),n.length&&a.forEach((function(e){s=s.concat(t.getIncludesForResourceAndPath.apply(t,[e].concat(n)))})),s}},{key:"getResourceObjectForModel",value:function(e){var t=this._attrsForModel(e,!0);delete t.id;var r={type:this.typeKeyForModel(e),id:e.id,attributes:t};return this._maybeAddRelationshipsToResourceObjectForModel(r,e)}},{key:"_maybeAddRelationshipsToResourceObjectForModel",value:function(e,t){var r=this,n={};return t.associationKeys.forEach((function(e){var i=t[e],o=r.keyForRelationship(e),s={};if(r.hasLinksForRelationship(t,e)){var a=r.serializerFor(t.modelName).links(t);s.links=a[e]}if(r.alwaysIncludeLinkageData||r.shouldIncludeLinkageData(e,t)||r._relationshipIsIncludedForModel(e,t)){var u=null;r.isModel(i)?u={type:r.typeKeyForModel(i),id:i.id}:r.isCollection(i)&&(u=i.models.map((function(e){return{type:r.typeKeyForModel(e),id:e.id}}))),s.data=u}G()(s)||(n[o]=s)})),G()(n)||(e.relationships=n),e}},{key:"hasLinksForRelationship",value:function(e,t){var r=this.serializerFor(e.modelName),n=r.links&&r.links(e);return n&&null!=n[t]}},{key:"_relationshipIsIncludedForModel",value:function(e,t){if(this.hasQueryParamIncludes()){var r,n=this.request._includesGraph,i=this._graphKeyForModel(t);return n.data[i]?r=n.data[i]:n.included[this._container.inflector.pluralize(t.modelName)]&&(r=n.included[this._container.inflector.pluralize(t.modelName)][i]),r&&r.relationships&&Object.prototype.hasOwnProperty.call(r.relationships,_r(e))}return this.getKeysForIncluded().includes(e)}},{key:"_createRequestedIncludesGraph",value:function(e){var t=this,r={data:{}};if(this.isModel(e)){var n=this._graphKeyForModel(e);r.data[n]={},this._addPrimaryModelToRequestedIncludesGraph(r,e)}else this.isCollection(e)&&e.models.forEach((function(e){var n=t._graphKeyForModel(e);r.data[n]={},t._addPrimaryModelToRequestedIncludesGraph(r,e)}));this.request._includesGraph=r}},{key:"_addPrimaryModelToRequestedIncludesGraph",value:function(e,t){var r=this;if(this.hasQueryParamIncludes()){var n=this._graphKeyForModel(t);this.getQueryParamIncludes().filter((function(e){return!!e.trim()}
2)).forEach((function(i){e.data[n].relationships=e.data[n].relationships||{};var o=i.split(".").map(_r),s=o[0],a=s,u=br(s);Rr(t.associationKeys.has(u),'You tried to include "'.concat(s,'" with ').concat(t,' but no association named "').concat(u,'" is defined on the model.'));var c,l=t[u];c=r.isModel(l)?r._graphKeyForModel(l):r.isCollection(l)?l.models.map(r._graphKeyForModel):null,e.data[n].relationships[a]=c,l&&r._addResourceToRequestedIncludesGraph(e,l,o.slice(1))}))}}},{key:"_addResourceToRequestedIncludesGraph",value:function(e,t,r){var n=this;e.included=e.included||{},(this.isCollection(t)?t.models:[t]).forEach((function(t){var i=n._container.inflector.pluralize(t.modelName);e.included[i]=e.included[i]||{},n._addModelToRequestedIncludesGraph(e,t,r)}))}},{key:"_addModelToRequestedIncludesGraph",value:function(e,t,r){var n=this._container.inflector.pluralize(t.modelName),i=this._graphKeyForModel(t);e.included[n][i]=e.included[n][i]||{},r.length&&this._addResourceRelationshipsToRequestedIncludesGraph(e,n,i,t,r)}},{key:"_addResourceRelationshipsToRequestedIncludesGraph",value:function(e,t,r,n,i){e.included[t][r].relationships=e.included[t][r].relationships||{};var o,s=i[0],a=n[br(s)];this.isModel(a)?o=this._graphKeyForModel(a):this.isCollection(a)&&(o=a.models.map(this._graphKeyForModel)),e.included[t][r].relationships[s]=o,a&&this._addResourceToRequestedIncludesGraph(e,a,i.slice(1))}},{key:"_graphKeyForModel",value:function(e){return"".concat(e.modelName,":").concat(e.id)}},{key:"getQueryParamIncludes",value:function(){var e=V()(this,"request.queryParams.include");return e&&!Array.isArray(e)&&(e=e.split(",")),e}},{key:"hasQueryParamIncludes",value:function(){return!!this.getQueryParamIncludes()}},{key:"typeKeyForModel",value:function(e){return _r(this._container.inflector.pluralize(e.modelName))}},{key:"getCoalescedIds",value:function(e){var t=e.queryParams&&e.queryParams["filter[id]"];return"string"==typeof t?t.split(","):t}},{key:"shouldIncludeLinkageData",value:function(e,t){return!1}}]),r}(Xr);Jr.prototype.alwaysIncludeLinkageData=!1;var Qr=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Gt(this,e),this.schema=t,this._serializerMap=r}return Vt(e,[{key:"normalize",value:function(e,t){return this.serializerFor(t).normalize(e)}},{key:"serialize",value:function(e,t){var r=this;return this.request=t,this._isModelOrCollection(e)?this.serializerFor(e.modelName).serialize(e,t):Array.isArray(e)&&e.some(this._isCollection)?e.reduce((function(e,n){var i=r.serializerFor(n.modelName);return i.embed?e[r._container.inflector.pluralize(n.modelName)]=i.serialize(n,t):e=Object.assign(e,i.serialize(n,t)),e}),{}):e}},{key:"serializerFor",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).explicit,r=void 0!==t&&t,n=e&&this._serializerMap&&this._serializerMap[br(e)];return r?Rr(!!n,"You passed in ".concat(e," as an explicit serializer type but that serializer doesn't exist.")):Rr(!(n=n||this._serializerMap.application||Xr)||n.prototype.embed||n.prototype.root||new n instanceof Jr,"You cannot have a serializer that sideloads (embed: false) and disables the root (root: false)."),new n(this,e,this.request)}},{key:"_isModel",value:function(e){return e instanceof Vr}},{key:"_isCollection",value:function(e){return e instanceof Tr||e instanceof Pr}},{key:"_isModelOrCollection",value:function(e){return this._isModel(e)||this._isCollection(e)}},{key:"registerSerializers",value:function(e){var t=this._serializerMap||{};this._serializerMap=Object.assign(t,e)}},{key:"getCoalescedIds",value:function(e,t){return this.serializerFor(t).getCoalescedIds(e)}}]),e}(),Zr={},en={},tn={},rn=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Gt(this,e),Rr(t,"A schema requires a db"),this.db=t,this._registry={},this._dependentAssociations={polymorphic:[]},this.registerModels(r),this.isSaving={}}return Vt(e,[{key:"registerModels",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Z()(t,(function(r,n){e.registerModel(n,t[n])}))}},{key:"registerModel",value:function(e,t){var r=this,n=br(e),i=_r(n);t=t.extend(),this._registry[n]=this._registry[n]||{class:null,foreignKeys:[]},this._registry[n].class=t,t.prototype._schema=this,t.prototype.modelName=i,t.prototype.hasManyAssociations={},t.prototype.hasManyAssociationFks={},t.prototype.belongsToAssociations={},t.prototype.belongsToAssociationFks={},t.prototype.associationKeys=new Set,t.prototype.associationIdKeys=new Set,t.prototype.depen
2dentAssociations=[];var o={};for(var s in t.prototype)if(t.prototype[s]instanceof Er){var a=t.prototype[s];a.name=s,a.modelName=a.modelName||this.toModelName(s),a.ownerModelName=i,a.setSchema(this);var u=ir(a.getForeignKeyArray(),2),c=u[0],l=u[1];o[c]=o[c]||[],Rr(!o[c].includes(l),"Your '".concat(e,"' model definition has multiple possible inverse relationships of type '").concat(c,"'. Please use explicit inverses.")),o[c].push(l),this._addForeignKeyToRegistry(c,l),a.addMethodsToModelClass(t,s)}var h=this.toCollectionName(i);return this.db[h]||this.db.createCollection(h),this[h]={camelizedModelName:n,new:function(e){return r.new(n,e)},create:function(e){return r.create(n,e)},all:function(e){return r.all(n,e)},find:function(e){return r.find(n,e)},findBy:function(e){return r.findBy(n,e)},findOrCreateBy:function(e){return r.findOrCreateBy(n,e)},where:function(e){return r.where(n,e)},none:function(e){return r.none(n,e)},first:function(e){return r.first(n,e)}},this}},{key:"modelFor",value:function(e){return this._registry[e]}},{key:"new",value:function(e,t){return this._instantiateModel(_r(e),t)}},{key:"create",value:function(e,t){return this.new(e,t).save()}},{key:"all",value:function(e){var t=this.collectionForType(e);return this._hydrate(t,_r(e))}},{key:"none",value:function(e){return this._hydrate([],_r(e))}},{key:"find",value:function(e,t){var r=this.collectionForType(e).find(t);return Array.isArray(t)&&Rr(r.length===t.length,"Couldn't find all ".concat(this._container.inflector.pluralize(e)," with ids: (").concat(t.join(","),") (found ").concat(r.length," results, but was looking for ").concat(t.length,")")),this._hydrate(r,_r(e))}},{key:"findBy",value:function(e,t){var r=this.collectionForType(e).findBy(t);return this._hydrate(r,_r(e))}},{key:"findOrCreateBy",value:function(e,t){var r=this.collectionForType(e).findBy(t);return r?this._hydrate(r,_r(e)):this.create(e,t)}},{key:"where",value:function(e,t){var r=this.collectionForType(e).where(t);return this._hydrate(r,_r(e))}},{key:"first",value:function(e){var t=this.collectionForType(e)[0];return this._hydrate(t,_r(e))}},{key:"modelClassFor",value:function(e){var t=this._registry[br(e)];return Rr(t,"Model not registered: ".concat(e)),t.class.prototype}},{key:"addDependentAssociation",value:function(e,t){e.isPolymorphic?this._dependentAssociations.polymorphic.push(e):(this._dependentAssociations[t]=this._dependentAssociations[t]||[],this._dependentAssociations[t].push(e))}},{key:"dependentAssociationsFor",value:function(e){var t=this._dependentAssociations[e]||[],r=this._dependentAssociations.polymorphic||[];return t.concat(r)}},{key:"associationsFor",value:function(e){var t=this.modelClassFor(e);return Object.assign({},t.belongsToAssociations,t.hasManyAssociations)}},{key:"hasModelForModelName",value:function(e){return this.modelFor(br(e))}},{key:"collectionForType",value:function(e){var t=this.toCollectionName(e);return Rr(this.db[t],"You're trying to find model(s) of type ".concat(e," but this collection doesn't exist in the database.")),this.db[t]}},{key:"toCollectionName",value:function(e){if("string"!=typeof Zr[e]){var t=_r(e),r=br(this._container.inflector.pluralize(t));Zr[e]=r}return Zr[e]}},{key:"toInternalCollectionName",value:function(e){if("string"!=typeof en[e]){var t="_".concat(this.toCollectionName(e));en[e]=t}return en[e]}},{key:"toModelName",value:function(e){if("string"!=typeof tn[e]){var t=_r(e),r=this._container.inflector.singularize(t);tn[e]=r}return tn[e]}},{key:"_addForeignKeyToRegistry",value:function(e,t){this._registry[e]=this._registry[e]||{class:null,foreignKeys:[]};var r=this._registry[e].foreignKeys;r.includes(t)||r.push(t)}},{key:"_instantiateModel",value:function(e,t){return new(this._modelFor(e))(this,e,t,this._foreignKeysFor(e))}},{key:"_modelFor",value:function(e){return this._registry[br(e)].class}},{key:"_foreignKeysFor",value:function(e){return this._registry[br(e)].foreignKeys}},{key:"_hydrate",value:function(e,t){if(Array.isArray(e)){var r=e.map((function(e){return this._instantiateModel(t,e)}),this);return new Tr(t,r)}return e?this._instantiateModel(t,e):null}}]),e}(),nn={Db:Ir,Association:Er,RouteHandler:Gr,BaseRouteHandler:qr,Serializer:Xr,SerializerRegistry:Qr,Schema:rn},on={singularize:E,pluralize:F},sn=function(){function e(){Gt(this,e),this.inflector=on}return Vt(e,[{key:"register",value:function(e,t){this[e]=t}},{key:"create",value:function(e){var t=nn[e];t.prototype._container=this;for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return tr(t,n)}}]),e}(),an=new sn;Ir.prototype._container=an,Er.prototype._container=an,qr.prototype._container=an,Gr.prototype._container=an,Xr.prototype._container=an,Qr.prototype._container=an,rn.prototype._container=an;var un=["http://localhost:0/chromecheckurl","http://localhost:30820/socket.io",function(e){return/.+\.hot-update.json$/.test(e.url)}],cn={coalesce:!1,timing:void 0};var ln=function(){function e(){Gt(this,e),Xt(this,"urlPrefix",void 0),Xt(this,"namespace",void 0),Xt(this,"timing",void 0),Xt(this,"passthroughChecks",void 0),Xt(this,"pretender",void 0),Xt(this,"mirageServer",void 0),Xt(this,"trackRequests",void 0)}return Vt(e,[{key:"create",value:function(e,t){var r=this;this.mirageServer=e,this.pretender=this._create(e,t),e.pretender=this.pretender,this.passthroughChecks=this.passthroughChecks||[],this.config(t),[["get"],["post"],["put"],["delete","del"],["patch"],["head"],["options"]].forEac
2h((function(t){var n=ir(t,2),i=n[0],o=n[1];r[i]=function(t){for(var n,o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];var u=ir(function(e){var t=ir(e.splice(-1),1)[0];!function(e){if(!e||"object"!==Yt(e))return!1;for(var t=Object.keys(cn),r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];if(t.indexOf(i)>-1)return!0}return!1}(t)?(e.push(t),t=cn):t=ne()({},cn,t);for(var r=2-e.length;r-- >0;)e.push(void 0);return e.push(t),e}(s),3),c=u[0],l=u[1],h=u[2],d=e.registerRouteHandler(i,t,c,l,h),f=r._getFullPath(t),p=void 0!==h.timing?h.timing:function(){return r.timing};return null===(n=r.pretender)||void 0===n?void 0:n[i](f,d,p)},e[i]=r[i],o&&(r[o]=r[i],e[o]=r[i])}))}},{key:"config",value:function(e){var t,r;(void 0===e.useDefaultPassthroughs||e.useDefaultPassthroughs)&&this._configureDefaultPassthroughs(),Rr(!(void 0!==e.trackRequests&&e.trackRequests!==this.trackRequests),"You cannot modify Pretender's request tracking once the server is created"),this.timing=null!==(t=null!==(r=e.timing)&&void 0!==r?r:this.timing)&&void 0!==t?t:400,this.urlPrefix=this.urlPrefix||e.urlPrefix||"",this.namespace=this.namespace||e.namespace||""}},{key:"_configureDefaultPassthroughs",value:function(){var e=this;un.forEach((function(t){e.passthrough(t)}))}},{key:"_create",value:function(e,t){if("undefined"!=typeof window)return this.trackRequests=t.trackRequests||!1,new Kt((function(){this.passthroughRequest=function(t,r,n){e.shouldLog()&&console.log("Mirage: Passthrough request for ".concat(t.toUpperCase()," ").concat(n.url))},this.handledRequest=function(t,r,n){if(e.shouldLog()){console.groupCollapsed("Mirage: [".concat(n.status,"] ").concat(t.toUpperCase()," ").concat(n.url));var i,o,s=n.requestBody,a=n.responseText;try{i=JSON.parse(s)}catch(e){i=s}try{o=JSON.parse(a)}catch(e){o=a}console.groupCollapsed("Response"),console.log(o),console.groupEnd(),console.groupCollapsed("Request (data)"),console.log(i),console.groupEnd(),console.groupCollapsed("Request (raw)"),console.log(n),console.groupEnd(),console.groupEnd()}};var t=this.checkPassthrough;this.checkPassthrough=function(r){if(e.passthroughChecks.some((function(e){return e(r)}))){var n=r.url.includes("?")?r.url.substr(0,r.url.indexOf("?")):r.url;this[r.method.toLowerCase()](n,this.passthrough)}return t.apply(this,arguments)},this.unhandledRequest=function(e,t){t=decodeURI(t);var r;r=""===this.namespace?"There is no existing namespace defined. Please define one":"The existing namespace is ".concat(this.namespace),Rr("Your app tried to ".concat(e," '").concat(t,"', but there was no route defined to handle this request. Define a route for this endpoint in your routes() config. Did you forget to define a namespace? ").concat(r))}}),{trackRequests:this.trackRequests})}},{key:"passthrough",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if("undefined"!=typeof window){var i=["get","post","put","delete","patch","options","head"],o=r[r.length-1];0===r.length?r=["/**","/"]:r.length>1&&Array.isArray(o)&&(i=r.pop()),r.forEach((function(t){"function"==typeof t?e.passthroughChecks.push(t):i.forEach((function(r){var n=e._getFullPath(t);e.pretender[r](n,e.pretender.passthrough)}))}))}}},{key:"_getFullPath",value:function(e){e="/"===e[0]?e.slice(1):e;var t="",r=this.urlPrefix?this.urlPrefix.trim():"",n="";if(this.urlPrefix&&this.namespace&&("/"===this.namespace[0]&&"/"===this.namespace[this.namespace.length-1]&&(n=this.namespace.substring(0,this.namespace.length-1).substring(1)),"/"===this.namespace[0]&&"/"!==this.namespace[this.namespace.length-1]&&(n=this.namespace.substring(1)),"/"!==this.namespace[0]&&"/"===this.namespace[this.namespace.length-1]&&(n=this.namespace.substring(0,this.namespace.length-1)),"/"!==this.namespace[0]&&"/"!==this.namespace[this.namespace.length-1]&&(n=this.namespace)),this.namespace&&!this.urlPrefix){if("/"===this.namespace[0]&&"/"===this.namespace[this.namespace.length-1]&&(n=this.namespace.substring(0,this.namespace.length-1)),"/"===this.namespace[0]&&"/"!==this.namespace[this.namespace.length-1]&&(n=this.namespace),"/"!==this.namespace[0]&&"/"===this.namespace[this.namespace.length-1]){var i=this.namespace.substring(0,this.namespace.length-1);n="/".concat(i)}"/"!==this.namespace[0]&&"/"!==this.namespace[this.namespace.length-1]&&(n="/".concat(this.namespace))}return this.namespace||(n=""),/^https?:\/\//.test(e)?t+=e:(r.length&&(t+="/"===r[r.length-1]?r:"".concat(r,"/")),"/"!==(t+=n)[t.length-1]&&(t+="/"),/^https?:\/\//.test(t+=e)||(t=(t="/".concat(t)).replace(/\/+/g,"/"))),t}},{key:"start",value:function(){}},{key:"shutdown",value:function(){this.pretender.shutdown()}}]),e}(),hn={},dn={singularize:E,pluralize:F};function fn(e){return new pn(e)}var pn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Gt(this,e),this._container=new sn,this.config(t),this.db=this.db||void 0,this.schema=this.schema||void 0,this.middleware=[]}return Vt(e,[{key:"namespace",get:function(){return this.interceptor.namespace},set:function(e){this.interceptor.namespace=e}},{key:"urlPrefix",get:function(){return this.interceptor.urlPrefix},set:function(e){this.interceptor.urlPrefix=e}},{key:"timing",get:function(){return this.interceptor.timing},set:function(e){this.interceptor.timing=e}},{key:"passthroughChecks",get:function(){return this.interceptor.passthroughChecks},set:function(e){this.interceptor.passthroughChecks=e}},{key:"config",value:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r.interceptor||(r.interceptor=new ln),this.interceptor?this.interceptor.config(r):(this.interceptor=r.interceptor,this.interceptor.create(this,r)),Rr(!(r.environment&&this.environment&&this.environment!==r.environment),"You cannot modify Mirage's environment once the server is created"),this.environment=r.environment||this.environment||"development",r.routes&&(Rr(!r.baseConfig,"The routes option is an alias for the baseConfig option. You can't pass both options into your server definition."),r.baseConfig=r.routes),r.seeds&&(Rr(!r.scenarios,"The seeds option is an alias for the scenarios.default option. You can't pass both options into your server definition."),r.scenarios={default:r.seeds}),this._config=r,this.inflector=r.inflector||dn,this._container.register("inflector",this.inflector),this.logging=void 0!==r.logging?this.logging:void 0,this.testConfig=this.testConfig||void 0,this.trackRequests=r.trackRequests,this.db?this.db.registerIdentityManagers(r.identityManagers):this.db=this._container.create("Db",void 0,r.identityManagers),this.schema?(this.schema.registerModels(r.models),this.serializerOrRegistry.registerSerializers(r.
2serializers||{})):(this.schema=this._container.create("Schema",this.db,r.models),this.serializerOrRegistry=this._container.create("SerializerRegistry",this.schema,r.serializers));var n=this._hasModulesOfType(r,"factories"),i=r.scenarios&&Object.prototype.hasOwnProperty.call(r.scenarios,"default");r.baseConfig&&this.loadConfig(r.baseConfig),this.isTest()&&(this.loadConfig(r.testConfig),"undefined"!=typeof window&&(window.server=this)),this.isTest()&&n?this.loadFactories(r.factories):!this.isTest()&&i?(this.loadFactories(r.factories),r.scenarios.default(this)):this.loadFixtures(),null===(e=(t=this.interceptor).start)||void 0===e||e.call(t)}},{key:"isTest",value:function(){return"test"===this.environment}},{key:"shouldLog",value:function(){return void 0!==this.logging?this.logging:!this.isTest()}},{key:"loadConfig",value:function(e){null==e||e.call(this),this.timing=this.isTest()?0:this.timing||0}},{key:"passthrough",value:function(){for(var e,t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];null===(e=(t=this.interceptor).passthrough)||void 0===e||e.call.apply(e,[t].concat(n))}},{key:"loadFixtures",value:function(){for(var e=this._config.fixtures,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r.length){var i=r.map(br),o=i.filter((function(t){return!e[t]}));if(o.length)throw new Error("Fixtures not found: ".concat(o.join(", ")));e=te().apply(void 0,[e].concat(or(i)))}this.db.loadData(e)}},{key:"loadFactories",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this._factoryMap||{};this._factoryMap=ne()(r,t),Object.keys(t).forEach((function(t){var r=e.schema.toCollectionName(t);e.db.createCollection(r)}))}},{key:"factoryFor",value:function(e){var t=br(e);if(this._factoryMap&&this._factoryMap[t])return this._factoryMap[t]}},{key:"build",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=r.filter((function(e){return e&&"string"==typeof e})),s=oe()(r,(function(e){return i()(e)})),a=br(e);this.factorySequences=this.factorySequences||{},this.factorySequences[a]=this.factorySequences[a]+1||0;var u=this.factoryFor(e);if(u){var c=(u=u.extend({})).attrs||{};this._validateTraits(o,u,e);var l=this._mergeExtensions(c,o,s);this._mapAssociationsFromAttributes(e,c,s),this._mapAssociationsFromAttributes(e,l);var h=new(u.extend(l)),d=this.factorySequences[a];return h.build(d)}return s}},{key:"buildList",value:function(e,t){Rr(ae()(t),"second argument has to be an integer, you passed: ".concat(Yt(t)));for(var r=[],n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];for(var s=[e].concat(i),a=0;a<t;a++)r.push(this.build.apply(this,s));return r}},{key:"create",value:function(e){var t=this;Rr(this._modelOrFactoryExistsForType(e),"You called server.create('".concat(e,"') but no model or factory was found. Make sure you're passing in the singularized version of the model or factory name."));for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var s,a=n.filter((function(e){return e&&"string"==typeof e})),u=oe()(n,(function(e){return i()(e)})),c=oe()(n,(function(e){return e&&Array.isArray(e)})),l=this.build.apply(this,[e].concat(or(a),[u]));if(this.schema&&this.schema[this.schema.toCollectionName(e)]){var h=this.schema[this.schema.toCollectionName(e)];s=h.create(l)}else{var d,f;c?d=c:(f=this.schema?this.schema.toInternalCollectionName(e):"_".concat(this.inflector.pluralize(e)),d=this.db[f]),Rr(d,"You called server.create('".concat(e,"') but no model or factory was found.")),s=d.insert(l)}var p=this.factoryFor(e);return p&&p.extractAfterCreateCallbacks({traits:a}).forEach((function(e){e(s,t)})),s}},{key:"createList",value:function(e,t){Rr(this._modelOrFactoryExistsForType(e),"You called server.createList('".concat(e,"') but no model or factory was found. Make sure you're passing in the singularized version of the model or factory name.")),Rr(ae()(t),"second argument has to be an integer, you passed: ".concat(Yt(t)));for(var r=[],n=this.schema?this.schema.toInternalCollectionName(e):"_".concat(this.inflector.pluralize(e)),i=this.db[n],o=arguments.length,s=new Array(o>2?o-2:0),a=2;a<o;a++)s[a-2]=arguments[a];for(var u=[e].concat(s,[i]),c=0;c<t;c++)r.push(this.create.apply(this,u));return r}},{key:"shutdown",value:function(){"undefined"!=typeof window&&this.interceptor.shutdown(),"undefined"!=typeof window&&"test"===this.environment&&(window.server=void 0)}},{key:"resource",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.only,i=r.except,o=r.path;if(e=this.inflector.pluralize(e),o=o||"/".concat(e),i=i||[],(n=n||[]).length>0&&i.length>0)throw"cannot use both :only and :except options";var s={index:{methods:["get"],path:"".concat(o)},show:{methods:["get"],path:"".concat(o,"/:id")},create:{methods:["post"],path:"".concat(o)},update:{methods:["put","patch"],path:"".concat(o,"/:id")},delete:{methods:["del"],path:"".concat(o,"/:id")}},a=Object.keys(s);(n.length>0&&n||i.length>0&&a.filter((function(e){return-1===i.indexOf(e)}
2))||a).forEach((function(r){var n=s[r];n.methods.forEach((function(r){return o===e?t[r](n.path):t[r](n.path,e)}))}))}},{key:"_serialize",value:function(e){return"string"==typeof e?e:JSON.stringify(e)}},{key:"registerRouteHandler",value:function(e,t,r,n,i){var o=this,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.middleware,a=this._container.create("RouteHandler",{schema:this.schema,verb:e,rawHandler:r,customizedCode:n,options:i,path:t,serializerOrRegistry:this.serializerOrRegistry,middleware:s});return function(e){return a.handle(e).then((function(e){var t=ir(e,3),r=t[0],n=t[1],i=t[2];return[r,n,o._serialize(i)]}))}}},{key:"_hasModulesOfType",value:function(e,t){var r=e[t];return!!r&&Object.keys(r).length>0}},{key:"_typeIsPluralForModel",value:function(e){if("boolean"!=typeof hn[e]){var t=this._modelOrFactoryExistsForTypeOrCollectionName(e),r=e===this.inflector.pluralize(e),n=this.inflector.singularize(e)===this.inflector.pluralize(e),i=r&&!n&&t;hn[e]=i}return hn[e]}},{key:"_modelOrFactoryExistsForType",value:function(e){var t=this.schema&&this.schema.modelFor(br(e)),r=this.db[this.schema.toInternalCollectionName(e)];return(t||r)&&!this._typeIsPluralForModel(e)}},{key:"_modelOrFactoryExistsForTypeOrCollectionName",value:function(e){var t=this.schema&&this.schema.modelFor(br(e)),r=this.db[this.schema.toInternalCollectionName(e)];return t||r}},{key:"_validateTraits",value:function(e,t,r){e.forEach((function(e){if(!t.isTrait(e))throw new Error("'".concat(e,"' trait is not registered in '").concat(r,"' factory"))}))}},{key:"_mergeExtensions",value:function(e,t,r){var n=t.map((function(t){return e[t].extension}));return n.push(r||{}),n.reduce((function(e,t){return ne()(e,t)}),{})}},{key:"_mapAssociationsFromAttributes",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(t||{}).filter((function(e){return r=t[e],i()(r)&&!0===r.__isAssociation__;var r})).forEach((function(i){var o=r.schema.modelClassFor(e).associationFor(i);Rr(o&&o instanceof Cr,"You're using the `association` factory helper on the '".concat(i,"' attribute of your ").concat(e," factory, but that attribute is not a `belongsTo` association.")),Rr(!(o&&o instanceof Cr&&o.modelName===e),"You're using the association() helper on your ".concat(e," factory for ").concat(i,", which is a belongsTo self-referential relationship. You can't do this as it will lead to infinite recursion. You can move the helper inside of a trait and use it selectively.")),Rr(!(o&&o.opts&&o.opts.polymorphic),"You're using the association() helper on your ".concat(e," factory for ").concat(i,", which is a polymorphic relationship. This is not currently supported."));var s=t[i],a="".concat(br(i),"Id");n[i]||(t[a]=r.create.apply(r,[o.modelName].concat(or(s.traitsAndOverrides))).id),delete t[i]}))}}]),e}(),yn=Xr.extend({serializeIds:"always",normalizeIds:!0,keyForModel:function(e){return wr(e)},keyForAttribute:function(e){return wr(e=Xr.prototype.keyForAttribute.apply(this,arguments))},keyForRelationship:function(e){return this._container.inflector.pluralize(wr(e))},keyForEmbeddedRelationship:function(e){return wr(e)},keyForRelationshipIds:function(e){return"".concat(wr(this._container.inflector.singularize(e)),"_ids")},keyForForeignKey:function(e){return"".concat(wr(e),"_id")},keyForPolymorphicForeignKeyId:function(e){return"".concat(wr(e),"_id")},keyForPolymorphicForeignKeyType:function(e){return"".concat(wr(e),"_type")},normalize:function(e){var t=this,r=Object.keys(e)[0],n=e[r],i=br(r),o=this.schema.modelClassFor(i),s=o.belongsToAssociations,a=o.hasManyAssociations,u=Object.keys(s),c=Object.keys(a);"id"!==this.primaryKey&&(n.id=n[this.primaryKey],delete n[this.primaryKey]);var l={data:{type:this._container.inflector.pluralize(r),attributes:{}}};n.id&&(l.data.id=n.id);var h={};return Object.keys(n).forEach((function(e){if("id"!==e)if(t.normalizeIds)if(u.includes(e)){var r=s[e].modelName;h[_r(e)]={data:{type:r,id:n[e]}}}else if(c.includes(e)){var i=a[e].modelName,o=n[e].map((function(e){return{type:i,id:e}}));h[_r(e)]={data:o}}else l.data.attributes[_r(e)]=n[e];else l.data.attributes[_r(e)]=n[e]})),Object.keys(h).length&&(l.data.relationships=h),l},getCoalescedIds:function(e){return e.queryParams&&e.queryParams.ids}});yn.extend({serializeIds:"always",keyForModel:function(e){return br(e)},keyForAttribute:function(e){return br(e=yn.prototype.keyForAttribute.apply(this,arguments))},keyForRelationship:function(e){return br(this._container.inflector.pluralize(e))},keyForEmbeddedRelationship:function(e){return br(e)},keyForRelationshipIds:function(e){return br(this._container.inflector.pluralize(e))},keyForForeignKey:function(e){return br(this._container.inflector.singularize(e))},getCoalescedIds:function(e){return e.queryParams&&e.queryParams.ids}})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.