module.exports = "(function(e,r,n){function t(e,r){return null!=r&&\"undefined\"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}var o=n(5894),a=n(280).C,s=n(9404),i=n(4527),c=n(8737),g=n(4810),l=n(7152),u=n(6474),_=i.get(\"stores/client_metadata\"),d=i.get(\"stores/global\"),E=__ERROR_LOG_HOST__,m=__EXPERIMENTAL_EDGE_SPA__,f=__EXPERIMENTAL_TRACKING_ONLY__;function p(e){return e&&e.engine?e.engine:f?\"edge-tracking\":m?\"edge-helper\":_.getClientName()}r.handleError=function(e,r){if(__ERROR_MONITOR__){var n=function(){return u.request({url:E+\"/log\",method:\"POST\",data:h,contentType:\"application/json\"}).then((function(e){g.log(\"Error Monitor / Logged error with response: \",e)}),(function(e){g.error(\"Failed to log error, response was: \",e)}))},i=e.name||\"Error\",m=e.message||\"\",f=e.stack||null;t(e,a)&&(t(m,Error)?(m=m.message,f=e.message.stack):f=null);var h={timestamp:s.now(),clientEngine:p(r),clientVersion:_.getClientVersion(),accountId:d.getAccountId(),projectId:d.getProjectId(),errorClass:i,message:m,stacktrace:f},I=o.map(d.getExperimental(),(function(e,r){return{key:\"exp_\"+r,value:String(e)}}));r&&o.forEach(r,(function(e,r){o.isObject(e)||I.push({key:r,value:String(e)})}),[]),o.isEmpty(I)||(h.metadata=I),g.error(\"Logging error\",h),c.isLoaded()?n():l.addEventListener(\"load\",n)}else r?g.error(\"Uncaught error:\",e,r):g.error(\"Uncaught error:\",e)}})";